/* Kede 插件市场 */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --c: #1a1a2e;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --bg: #ffffff;
  --bg-subtle: #f8f8f8;
  --border: #e5e5e5;
  --text: #111111;
  --text-secondary: #666666;
  --text-muted: #999999;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 4px;
}

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 14px;
}

/* ---- Navbar ---- */
.navbar {
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}
.nav-left { display: flex; align-items: center; gap: 32px; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.nav-brand span { color: var(--accent); }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: var(--radius);
}
.nav-links a:hover { background: var(--bg-subtle); color: var(--text); }
.nav-links a.active { color: var(--accent); }
.nav-user {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 3px 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-subtle); }
.btn:active { background: #eee; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 9px 20px; font-size: 14px; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #15803d; border-color: #15803d; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #b45309; border-color: #b45309; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Cards ---- */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-title { font-size: 14px; font-weight: 600; }

/* ---- Form ---- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 5px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}
.form-input:hover, .form-select:hover, .form-textarea:hover { border-color: #ccc; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); }
.form-textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: var(--bg-subtle); font-weight: 600; color: var(--text-secondary); font-size: 12px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-subtle); }

/* ---- Tags ---- */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid;
}
.tag-blue { background: #eff6ff; color: var(--accent); border-color: #bfdbfe; }
.tag-green { background: #f0fdf4; color: var(--success); border-color: #bbf7d0; }
.tag-yellow { background: #fffbeb; color: var(--warning); border-color: #fde68a; }
.tag-red { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.tag-gray { background: var(--bg-subtle); color: var(--text-muted); border-color: var(--border); }

/* ---- Status dot ---- */
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; }
.status-dot.green { background: var(--success); }
.status-dot.yellow { background: var(--warning); }
.status-dot.red { background: var(--danger); }
.status-dot.gray { background: var(--text-muted); }
.status-dot.blue { background: var(--accent); }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 20px; right: 20px;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: #111;
  color: #fff;
  font-size: 13px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* ---- Grid ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ---- Stat card ---- */
.stat-card { text-align: center; padding: 16px; }
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
.modal-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ---- Empty state ---- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 32px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ---- Page header ---- */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: 18px; font-weight: 600; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 10px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- Stepper ---- */
.stepper { display: flex; align-items: flex-start; gap: 0; margin: 20px 0; position: relative; }
.step { flex: 1; text-align: center; position: relative; }
.step .step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: var(--border);
  color: var(--text-muted);
  margin-bottom: 8px;
}
.step.active .step-num { background: var(--accent); color: #fff; }
.step.done .step-num { background: var(--success); color: #fff; }
.step.fail .step-num { background: var(--danger); color: #fff; }
.step .step-label { font-size: 12px; color: var(--text-muted); }
.step.active .step-label { color: var(--accent); font-weight: 500; }
.step.done .step-label { color: var(--success); }
.step + .step::before {
  content: '';
  position: absolute;
  top: 12px;
  left: -50%;
  width: 100%;
  height: 1px;
  background: var(--border);
  z-index: -1;
}
.step.done + .step::before { background: var(--success); }

/* ---- Auth page ---- */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 110px);
  padding: 24px;
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card .card { padding: 28px; }
.auth-card h2 { text-align: center; margin-bottom: 4px; font-size: 20px; font-weight: 700; }
.auth-card .subtitle { text-align: center; color: var(--text-secondary); font-size: 13px; margin-bottom: 24px; }
.auth-card .form-footer { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-secondary); }
.auth-card .form-footer a { color: var(--accent); text-decoration: none; }
.auth-card .form-footer a:hover { text-decoration: underline; }
.auth-card .btn { width: 100%; padding: 9px; font-size: 14px; font-weight: 500; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---- Upload area ---- */
.upload-zone {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-subtle);
  transition: background 0.1s;
}
.upload-zone:hover { border-color: var(--accent); background: #f0f4ff; }
.upload-zone .icon { font-size: 28px; margin-bottom: 10px; }
.upload-zone p { color: var(--text-secondary); font-size: 13px; }
.upload-zone .file-name { font-size: 14px; font-weight: 500; color: var(--text); }

/* ---- Progress bar ---- */
.progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin: 10px 0; }
.progress-bar .fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }

/* ---- Alert ---- */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ---- Utility ---- */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-muted); }

/* ---- Detail row ---- */
.detail-row { display: flex; padding: 8px 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-row .label { width: 110px; flex-shrink: 0; color: var(--text-muted); font-size: 13px; }
.detail-row .value { flex: 1; font-size: 13px; }

/* ---- Container ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 24px 28px; }

/* ---- Hero section ---- */
.hero-section { padding: 56px 20px 48px; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.hero-section h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 10px; }
.hero-section p { font-size: 15px; color: var(--text-secondary); margin-bottom: 24px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .navbar { padding: 0 16px; }
  .container { padding: 16px; }
  .page-header { flex-direction: column; gap: 12px; align-items: stretch; }
  .stepper { flex-direction: column; gap: 8px; }
  .step + .step::before { display: none; }
  .detail-row { flex-direction: column; gap: 4px; }
  .detail-row .label { width: auto; }
}
