/* ============================================================
   RelayHub UI  —  设计系统
   浅色纸感 + 深墨文字 + 单一靛蓝强调色
   ============================================================ */

:root {
  --bg: #faf9f7;
  --bg-soft: #f3f2ee;
  --card: #ffffff;
  --ink: #16181d;
  --ink-2: #3f4550;
  --muted: #6f7683;
  --line: #e4e2dc;
  --line-strong: #d3d0c8;
  --accent: #4f46e5;
  --accent-ink: #3730a3;
  --accent-soft: #eef0fe;
  --ok: #0f766e;
  --ok-soft: #e7f5f2;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --danger: #be123c;
  --danger-soft: #fdeef1;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(22, 24, 29, 0.04), 0 8px 24px -12px rgba(22, 24, 29, 0.12);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; }
p { margin: 0; }

code, pre, .mono { font-family: var(--mono); font-size: 0.92em; }

::selection { background: #dcd9ff; }

/* ------------------------------ 通用组件 ------------------------------ */
.wrap { width: min(1140px, calc(100% - 48px)); margin: 0 auto; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  font-weight: 560;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-soft); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.btn-primary:hover { background: #000; }

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-ink); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-soft); }

.btn-danger { color: var(--danger); border-color: #f3c9d2; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); }

.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 560;
  background: var(--bg-soft);
  color: var(--ink-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-accent { background: var(--accent-soft); color: var(--accent-ink); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* -------------------------------- 导航 -------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 249, 247, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 66px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 680; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(140deg, #6366f1, #4338ca 55%, #312e81);
  color: #fff; display: grid; place-items: center;
  font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: -0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.brand-sub { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--ink-2); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: 8px; }

/* -------------------------------- 首页 -------------------------------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(22, 24, 29, 0.07) 1px, transparent 0);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 70% 60% at 30% 20%, #000 20%, transparent 75%);
  pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; padding: 84px 0 76px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5vw, 58px); line-height: 1.06; letter-spacing: -0.035em; margin: 18px 0 20px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: 17px; color: var(--ink-2); max-width: 34em; }
.hero-cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 26px; margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.hero-meta div strong { display: block; font-size: 20px; letter-spacing: -0.02em; }
.hero-meta div span { font-size: 12.5px; color: var(--muted); }

.terminal {
  background: #14161d;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(20, 22, 29, 0.55), 0 2px 0 rgba(255, 255, 255, 0.06) inset;
  border: 1px solid #2a2d38;
}
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid #262a34; background: #191c24; }
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3f4d; display: block; }
.terminal-bar span { margin-left: 8px; font-family: var(--mono); font-size: 11.5px; color: #8b93a7; }
.terminal pre { margin: 0; padding: 18px 18px 20px; color: #d7dbe6; font-size: 12.5px; line-height: 1.75; overflow-x: auto; }
.terminal .c-key { color: #a5b4fc; }
.terminal .c-str { color: #86efac; }
.terminal .c-cm { color: #6b7280; }
.terminal .c-url { color: #fbd38d; }

.section { padding: 78px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(26px, 3vw, 34px); margin-top: 10px; }
.section-head p { color: var(--muted); max-width: 40em; margin-top: 10px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feature { background: var(--card); padding: 26px 24px 28px; }
.feature:hover { background: #fdfdfc; }
.icon-badge {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 16px;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
}
.feature h3 { font-size: 16px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 14px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; counter-reset: step; }
.step { position: relative; padding-top: 26px; border-top: 1px solid var(--line-strong); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  position: absolute; top: -9px; left: 0; padding-right: 8px;
  background: var(--bg);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--accent);
}
.step h3 { font-size: 16px; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 14px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fcfcfb;
  white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid #f0eee9; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fcfcfb; }
.table .num { font-family: var(--mono); font-size: 13px; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }

.footer { border-top: 1px solid var(--line); padding: 34px 0 44px; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--ink-2); }

/* -------------------------------- 登录页 ------------------------------- */
.auth-main {
  min-height: calc(100vh - 67px);
  min-height: calc(100svh - 67px);
  display: grid;
  place-items: center;
  padding: 40px 16px;
  background: #f5f6f8;
}
.auth-card {
  width: min(420px, 100%);
  padding: clamp(22px, 6vw, 36px);
  background: var(--card);
  border: 1px solid #e6e3ef;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.auth-heading { display: grid; justify-items: start; gap: 13px; margin-bottom: 23px; }
.auth-heading .brand-mark { width: 42px; height: 42px; border-radius: 12px; }
.auth-heading h1 { font-size: 28px; overflow-wrap: anywhere; }
.auth-card .input { min-height: 44px; font-size: 16px; }
.auth-card .auth-submit { min-height: 44px; margin-top: 3px; }
.auth-links {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}
.auth-links a { color: var(--ink-2); }
.auth-links a:hover { color: var(--accent-ink); }

.tabs { display: flex; gap: 4px; background: var(--bg-soft); padding: 4px; border-radius: 10px; margin-bottom: 24px; }
.tabs button {
  flex: 1; border: none; background: transparent; padding: 8px 10px; border-radius: 7px;
  font-family: inherit; font-size: 14px; font-weight: 560; color: var(--muted); cursor: pointer;
}
.tabs button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 560; margin-bottom: 6px; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: #fff; color: var(--ink); font-family: inherit; font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.textarea { min-height: 84px; resize: vertical; font-family: var(--mono); font-size: 13px; }
.form-error {
  background: var(--danger-soft); color: var(--danger); border-radius: 9px;
  padding: 9px 12px; font-size: 13px; margin-bottom: 14px; display: none;
}
.form-error.show { display: block; }

/* ------------------------------- 应用框架 ------------------------------ */
.app-shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  border-right: 1px solid var(--line); background: #fcfbf9; padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 4px 8px 18px; }
.side-group { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: #a3a8b2; padding: 14px 10px 6px; }
.side-link {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer; border: none; background: transparent;
  font-family: inherit; text-align: left; width: 100%;
}
.side-link:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.side-link.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.side-link .ico { font-family: var(--mono); font-size: 11px; width: 16px; opacity: 0.75; }
.side-link .side-icon { width: 16px; height: 16px; flex: none; stroke-width: 1.75; }
.side-link .side-external-icon { width: 13px; height: 13px; flex: none; margin-left: auto; color: var(--muted); }
.model-copy-cell { width: 1%; text-align: right; }
.model-copy-button { width: 28px; height: 28px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.model-copy-button:hover, .model-copy-button:focus-visible { background: var(--accent-soft); color: var(--accent-ink); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; }
.side-user { display: flex; align-items: center; gap: 9px; padding: 6px 8px; }
.avatar { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.side-user .u-name { font-weight: 560; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .u-role { font-size: 11px; color: var(--muted); }

.main { min-width: 0; padding: 26px 32px 64px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 25px; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 6px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.stat-card .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stat-card .v { font-size: 25px; font-weight: 640; letter-spacing: -0.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-card .s { font-size: 12px; color: var(--muted); margin-top: 2px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; }
.panel-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }

.chart { width: 100%; height: 190px; display: block; overflow: visible; }
.chart-legend { display: flex; gap: 18px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

.usage-chart { --usage-bar: #4f46e5; --usage-height: 220px; padding: 18px; }
.usage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.usage-head h2, .usage-total { display: inline-block; font-size: 16px; }
.usage-total { margin-left: 8px; overflow-wrap: anywhere; }
.usage-head h2 span, .usage-note { color: var(--muted); font-size: 12px; }
.usage-head .usage-note { margin-top: 4px; }
.usage-view { flex: none; }
.usage-plot { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px; font-size: 11px; color: var(--muted); }
.usage-axis, .usage-grid { height: var(--usage-height); display: flex; flex-direction: column; justify-content: space-between; }
.usage-axis { text-align: right; line-height: 1; font-variant-numeric: tabular-nums; transform: translateY(-5px); }
.usage-axis span { height: 1px; }
.usage-area { position: relative; min-width: 0; }
.usage-grid { position: absolute; inset: 0 0 auto; pointer-events: none; }
.usage-grid i { border-top: 1px solid var(--line); }
.usage-grid i:last-child { border-color: var(--line-strong); }
.usage-columns { position: relative; display: flex; height: var(--usage-height); }
.usage-column { appearance: none; flex: 1 1 0; min-width: 0; padding: 0; border: 0; background: transparent; display: flex; justify-content: center; align-items: flex-end; cursor: pointer; }
.usage-column.is-active { background: var(--accent-soft); }
.usage-column:focus-visible { z-index: 1; outline: 2px solid var(--usage-bar); outline-offset: -2px; }
.usage-bar { width: min(24px, 72%, max(1px, calc(100% - 2px))); background: var(--usage-bar); border-radius: 4px 4px 0 0; }
.usage-dates { position: relative; height: 24px; padding-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.usage-dates span { position: absolute; transform: translateX(-50%); }
.usage-dates span:first-child { transform: none; }
.usage-dates span:last-child { transform: translateX(-100%); }
.usage-no-data { position: absolute; top: 42%; inset-inline: 8px; text-align: center; pointer-events: none; font-size: 13px; }
.usage-tooltip { position: absolute; top: 0; left: 0; z-index: 2; width: min(290px, max(180px, 44%), 100%); padding: 10px 12px; background: #191919; color: #efefef; border-radius: 8px; box-shadow: var(--shadow); pointer-events: none; overflow-wrap: anywhere; }
.usage-tip-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; font-size: 13px; }
.usage-tooltip .usage-note, .usage-tooltip small { color: #bfbfbf; }
.usage-tip-models { margin: 6px 0 0; padding: 6px 0 0; list-style: none; border-top: 1px solid #474747; max-height: 124px; overflow: hidden; }
.usage-tip-models li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; }
.usage-tip-models small { grid-column: 2; text-align: right; font-size: 11px; }
.usage-table { max-height: 320px; overflow: auto; }
.usage-table td { overflow-wrap: anywhere; }
.usage-table td:not(:nth-child(2)) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.usage-drill { margin-top: 6px; }
@media (max-width: 480px) { .usage-chart { padding: 12px; --usage-height: 180px; } }
@media print { .usage-bar { background: repeating-linear-gradient(45deg, var(--usage-bar) 0 2px, white 2px 4px); print-color-adjust: exact; } }
@media (forced-colors: active) { .usage-bar { forced-color-adjust: none; background: repeating-linear-gradient(45deg, CanvasText 0 2px, Canvas 2px 4px); } }

.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }

.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid #f2f0eb; font-size: 13.5px; }
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .num { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 120px; padding: 7px 10px; font-size: 13px; }
.toolbar .spacer { flex: 1; }

.empty { padding: 46px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.empty strong { display: block; color: var(--ink); margin-bottom: 6px; font-size: 15px; }

.key-reveal {
  background: #14161d; color: #e6e9f2; border-radius: 10px; padding: 14px 14px;
  font-family: var(--mono); font-size: 13px; word-break: break-all; display: flex; gap: 10px; align-items: center;
}
.key-reveal code { flex: 1; }
.cc-switch-hint { margin-top: 10px; color: var(--muted); font-size: 13px; }
.key-advanced { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.key-advanced summary { cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 560; }
.key-model-label { margin: 12px 0 6px; font-size: 13px; font-weight: 560; }
.key-model-options { display: grid; gap: 7px; max-height: 170px; overflow: auto; }
.warn-box {
  background: var(--warn-soft); color: #7c3d06; border: 1px solid #f3ddba; border-radius: 10px;
  padding: 10px 13px; font-size: 13px; margin-top: 12px;
}

/* -------------------------------- 弹窗 -------------------------------- */
dialog.modal {
  border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 32px));
  background: var(--card); color: var(--ink); box-shadow: 0 40px 80px -30px rgba(22, 24, 29, 0.4);
}
dialog.modal::backdrop { background: rgba(22, 24, 29, 0.35); backdrop-filter: blur(3px); }
.modal-head { padding: 18px 20px 0; }
.modal-head h3 { font-size: 17px; }
.modal-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.modal-body { padding: 18px 20px; max-height: 65vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fcfcfb; border-radius: 0 0 16px 16px; }
.modal-wide { width: min(760px, calc(100vw - 32px)); }
.pricing-group { min-width: 0; margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pricing-group legend { padding: 0 6px; font-size: 13px; font-weight: 600; }
.pricing-rate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.pricing-group .hint { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.pricing-detail { margin-top: 6px; white-space: normal; }
.pricing-detail summary { cursor: pointer; color: var(--accent-ink); }
.pricing-detail ul { padding-left: 16px; margin: 6px 0; }

/* -------------------------------- Toast -------------------------------- */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #16181d; color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 13.5px;
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, 0.4); animation: toast-in 0.2s ease; max-width: 360px;
}
.toast.err { background: #8f1230; }
.toast.ok { background: #0f5f57; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* -------------------------------- 文档页 ------------------------------- */
.doc-layout { display: grid; grid-template-columns: 210px 1fr; gap: 48px; padding: 48px 0 80px; }
.doc-nav { position: sticky; top: 90px; align-self: start; font-size: 14px; }
.doc-nav a { display: block; padding: 5px 0; color: var(--muted); }
.doc-nav a:hover { color: var(--ink); text-decoration: none; }
.doc-nav .h { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: #a3a8b2; margin: 18px 0 6px; }
.doc-body h2 { font-size: 22px; margin: 40px 0 12px; padding-top: 8px; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 { font-size: 15.5px; margin: 24px 0 8px; }
.doc-body p, .doc-body li { color: var(--ink-2); font-size: 14.5px; }
.doc-body ul { padding-left: 20px; }
.doc-body li { margin: 5px 0; }
.doc-body pre {
  background: #14161d; color: #e3e7f1; padding: 15px 16px; border-radius: 10px; overflow-x: auto;
  font-size: 12.5px; line-height: 1.7; margin: 12px 0;
}
.doc-body :not(pre) > code { background: var(--bg-soft); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; font-size: 0.88em; }
.doc-body table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 12px 0; }
.doc-body th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-strong); font-size: 12px; color: var(--muted); font-weight: 600; }
.doc-body td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 13.5px; margin: 14px 0; }

/* ------------------------------- 响应式 -------------------------------- */
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; padding: 56px 0; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; gap: 22px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .doc-layout { grid-template-columns: 1fr; gap: 20px; }
  .doc-nav { position: static; display: none; }
}

@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .nav-inner { gap: 12px; }
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 10px 12px;
    border-right: none; border-bottom: 1px solid var(--line); gap: 6px; align-items: center;
  }
  .sidebar .brand, .side-group, .side-foot { display: none; }
  .side-link { width: auto; white-space: nowrap; padding: 7px 10px; }
  .main { padding: 20px 16px 48px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
}

/* ------------------------- 统一导航：登录态 -------------------------- */
.nav-user { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 560; color: var(--ink); }
.nav-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.nav-uname { max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announce-bar {
  background: var(--accent-soft); color: var(--accent-ink);
  text-align: center; padding: 8px 16px; font-size: 13px; border-bottom: 1px solid var(--line);
}

/* ----------------------- 导航右侧下拉菜单 ---------------------------- */
.nav-menu { position: relative; }
.nav-menu-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 13.5px; font-weight: 560; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.nav-menu-trigger:hover { background: #f7f6f2; }
.nav-menu-trigger .caret { font-size: 10px; color: var(--muted); transition: transform .15s; }
.nav-menu-trigger[aria-expanded="true"] .caret { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 170px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 14px 34px rgba(20, 22, 29, .14);
}
.nav-dropdown-item {
  display: flex; align-items: center; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink-2); background: transparent;
  border: none; cursor: pointer; text-decoration: none; line-height: 1.2;
}
.nav-dropdown-item:hover { background: #f4f2ee; color: var(--ink); text-decoration: none; }
.nav-dropdown-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* --------------------- 文档页：Markdown 渲染与大纲 -------------------- */
.doc-body h2, .doc-body h3 { scroll-margin-top: 90px; }
.doc-nav a.sub { padding-left: 14px; font-size: 13px; }
.doc-nav a.active { color: var(--ink); font-weight: 600; }
.doc-nav a.active.sub { color: var(--accent-ink); }
.doc-nav a { border-left: 2px solid transparent; padding-left: 10px; margin-left: -12px; }
.doc-nav a.active { border-left-color: var(--accent); }
.doc-body blockquote {
  margin: 14px 0; padding: 10px 14px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 8px 8px 0;
  color: var(--ink-2); font-size: 13.5px;
}
.doc-body blockquote p { margin: 0; font-size: 13.5px; }

/* ------------------------- 首页 Hero（简约，左右布局） ------------------------- */
.hero-stylized {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100vh - 64px);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.hero-stylized::before { display: none; }

.hero-stage {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 56px;
  align-items: center;
  padding: 56px 0;
}

.hero-copy { text-align: left; }

.hero-stylized h1 {
  margin: 18px 0 16px;
  font-size: clamp(36px, 4.4vw, 56px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.hero-stylized h1 em { font-style: normal; color: var(--accent); }

.hero-stylized .lead {
  max-width: 30em;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
}
.hero-stylized .hero-cta { margin-top: 26px; justify-content: flex-start; }

.btn-lg { padding: 11px 22px; font-size: 15px; border-radius: 11px; }
.hero-stylized .btn-primary {
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 10px 24px -14px rgba(79, 70, 229, 0.55);
}
.hero-stylized .btn-primary:hover { background: var(--accent-ink); }

.hero-stats { display: flex; gap: 36px; margin-top: 28px; flex-wrap: wrap; justify-content: flex-start; }
.hero-stat { text-align: left; }
.hero-stat strong { display: block; font-size: 21px; letter-spacing: -0.02em; color: var(--ink); }
.hero-stat span { font-size: 12.5px; color: var(--muted); }

.hero-terminal {
  width: 100%;
  margin-top: 0;
  text-align: left;
  box-shadow: var(--shadow);
}
.hero-terminal pre { font-size: 12px; line-height: 1.62; padding: 15px 18px 16px; }

@media (max-width: 920px) {
  .hero-stylized { min-height: auto; }
  .hero-stage { grid-template-columns: 1fr; gap: 32px; padding: 44px 0 40px; }
  .hero-stylized h1 { font-size: clamp(32px, 7.6vw, 44px); }
  .hero-stylized .lead { font-size: 15.5px; }
  .hero-stats { gap: 26px; }
  .hero-terminal { max-width: 680px; }
}
