:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e4e8ee;
  --text: #1a2332;
  --text-2: #5a6678;
  --text-3: #909bab;
  --accent: #2f66e3;
  --accent-soft: #eef3ff;
  --ok: #0f9d58;
  --ok-soft: #e9f7ef;
  --warn: #c47b0b;
  --mint: #0d9488;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 30px rgba(16, 24, 40, .045);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 28px 48px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3a72ee, #6b4ce6);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .5px;
  box-shadow: 0 4px 12px rgba(58, 114, 238, .25);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16px; letter-spacing: -.2px; }
.brand-text small { color: var(--text-3); font-size: 12px; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.badge.live { background: var(--ok-soft); border-color: #c9ecd7; color: var(--ok); }
.badge.dev { background: #fff6e6; border-color: #f5e0b8; color: var(--warn); }
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.version { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---------- 错误条 ---------- */
.alert {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fdf0ef;
  border: 1px solid #f5d3cf;
  color: #a8443a;
  font-size: 13px;
}

/* ---------- Hero ---------- */
.hero { padding: 46px 0 34px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #dbe6ff;
  padding: 5px 12px;
  border-radius: 999px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

.hero h1 {
  margin: 20px 0 12px;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.2;
  letter-spacing: -1.2px;
  font-weight: 700;
}

.hero p {
  margin: 0;
  max-width: 660px;
  color: var(--text-2);
  font-size: 15.5px;
}

.hero-actions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(47, 102, 227, .22);
}
.btn.primary:hover { background: #2559cf; }
.btn.primary:disabled { opacity: .6; cursor: default; }
.btn.ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
}
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }

/* ---------- 状态卡 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  animation: rise .4s ease both;
}
.stat-card:nth-child(2) { animation-delay: .05s; }
.stat-card:nth-child(3) { animation-delay: .1s; }
.stat-card:nth-child(4) { animation-delay: .15s; }

.stat-label { font-size: 12px; color: var(--text-3); font-weight: 600; letter-spacing: .3px; }
.stat-value {
  margin: 10px 0 6px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
}
.stat-value.good { color: var(--ok); }
.stat-value.bad { color: #c0493c; }
.stat-note { font-size: 11.5px; color: var(--text-3); }
.placeholder { color: var(--text-3); font-weight: 500; }

/* ---------- 面板 ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px 22px;
  margin-bottom: 18px;
  animation: rise .4s ease both;
  animation-delay: .2s;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel h2 { margin: 0; font-size: 16px; letter-spacing: -.3px; }
.panel-sub { margin: 3px 0 0; font-size: 12px; color: var(--text-3); }
.count {
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 9px;
  white-space: nowrap;
}

/* 模块区 */
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }

.module-card {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 14px 15px;
  background: var(--surface-2);
}
.module-card .m-name { font-weight: 650; font-size: 14px; }
.module-card .m-id { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.module-card .m-desc { font-size: 12.5px; color: var(--text-2); margin-top: 8px; }

.empty {
  grid-column: 1 / -1;
  border: 1px dashed #cfd7e3;
  border-radius: 11px;
  padding: 26px 20px;
  text-align: center;
  background: var(--surface-2);
}
.empty .e-title { font-size: 14px; font-weight: 650; color: var(--text-2); }
.empty .e-desc { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }

/* 接口列表 */
.endpoints { display: flex; flex-direction: column; }

.ep-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-top: 1px solid #eef1f5;
  font-size: 13px;
}
.ep-row:first-child { border-top: none; }

.method {
  flex: 0 0 62px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 3px 0;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
}
.method.POST { background: var(--ok-soft); color: var(--ok); }
.method.PUT, .method.PATCH { background: #fff5e6; color: var(--warn); }
.method.DELETE { background: #fdeeec; color: #c0493c; }

.ep-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ep-group {
  font-size: 10.5px;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}
.ep-desc { font-size: 12px; color: var(--text-3); flex: 0 0 34%; text-align: right; }

/* ---------- 页脚 ---------- */
.footer {
  padding-top: 22px;
  font-size: 11.5px;
  color: var(--text-3);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.footer .sep { color: #c8d0da; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 820px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .ep-desc { display: none; }
}

@media (max-width: 520px) {
  .shell { padding: 0 16px 32px; }
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 34px 0 26px; }
  .ep-group { display: none; }
}
