:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-alt: #f8fafc;
  --panel-hover: #f1f5f9;
  --input-bg: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-hover: #cbd5e1;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-weak: rgba(79, 70, 229, .1);
  --primary-ring: rgba(79, 70, 229, .18);
  --danger: #dc2626;
  --danger-weak: rgba(220, 38, 38, .1);
  --ok: #059669;
  --ok-weak: rgba(5, 150, 105, .11);
  --warn: #d97706;
  --warn-weak: rgba(217, 119, 6, .12);
  --tag-bg: #f1f5f9;
  --secret-bg: #fffbeb;
  --secret-border: #fde68a;
  --side-bg: linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
  --side-hover: rgba(255, 255, 255, .07);
  --side-active: rgba(99, 102, 241, .2);
  --side-text: #cbd5e1;
  --side-sec: #94a3b8;
  --side-brand: #ffffff;
  --side-line: rgba(148, 163, 184, .16);
  --overlay: rgba(15, 23, 42, .52);
  --toast-bg: #0f172a;
  --toast-text: #f8fafc;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 48px rgba(15, 23, 42, .22);
  --chart-grid: #e2e8f0;
  --chart-axis: #64748b;
  --chart-bar-bg: #eef2f6;
  --chart-hit: rgba(79, 70, 229, .06);
  --chart-rev: #4f46e5;
  --chart-cost: #f59e0b;
  --chart-profit: #059669;
  --chart-spend: #4f46e5;
  --chart-saved: #059669;
  --chart-claude: #d97706;
  --chart-antigravity: #4f46e5;
  --chart-codex: #059669;
  --radius: 12px;
  font-size: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #090d16;
    --panel: #111827;
    --panel-alt: #162033;
    --panel-hover: #1c283e;
    --input-bg: #0c1322;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --line: #1e293b;
    --line-hover: #334155;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-weak: rgba(99, 102, 241, .18);
    --primary-ring: rgba(99, 102, 241, .32);
    --danger: #f87171;
    --danger-weak: rgba(248, 113, 113, .16);
    --ok: #34d399;
    --ok-weak: rgba(52, 211, 153, .15);
    --warn: #fbbf24;
    --warn-weak: rgba(251, 191, 36, .16);
    --tag-bg: #1e293b;
    --secret-bg: rgba(250, 204, 21, .1);
    --secret-border: rgba(250, 204, 21, .34);
    --side-bg: linear-gradient(180deg, #060912 0%, #0b1120 100%);
    --side-hover: rgba(255, 255, 255, .06);
    --side-active: rgba(99, 102, 241, .22);
    --side-text: #cbd5e1;
    --side-sec: #64748b;
    --side-brand: #f8fafc;
    --side-line: rgba(148, 163, 184, .12);
    --overlay: rgba(2, 6, 23, .74);
    --toast-bg: #1e293b;
    --toast-text: #f8fafc;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, .4);
    --shadow-lg: 0 24px 56px rgba(0, 0, 0, .65);
    --chart-grid: #1e293b;
    --chart-axis: #94a3b8;
    --chart-bar-bg: #1e293b;
    --chart-hit: rgba(99, 102, 241, .12);
    --chart-rev: #6366f1;
    --chart-cost: #fbbf24;
    --chart-profit: #34d399;
    --chart-spend: #6366f1;
    --chart-saved: #34d399;
    --chart-claude: #fbbf24;
    --chart-antigravity: #60a5fa;
    --chart-codex: #34d399;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090d16;
  --panel: #111827;
  --panel-alt: #162033;
  --panel-hover: #1c283e;
  --input-bg: #0c1322;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --line: #1e293b;
  --line-hover: #334155;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-weak: rgba(99, 102, 241, .18);
  --primary-ring: rgba(99, 102, 241, .32);
  --danger: #f87171;
  --danger-weak: rgba(248, 113, 113, .16);
  --ok: #34d399;
  --ok-weak: rgba(52, 211, 153, .15);
  --warn: #fbbf24;
  --warn-weak: rgba(251, 191, 36, .16);
  --tag-bg: #1e293b;
  --secret-bg: rgba(250, 204, 21, .1);
  --secret-border: rgba(250, 204, 21, .34);
  --side-bg: linear-gradient(180deg, #060912 0%, #0b1120 100%);
  --side-hover: rgba(255, 255, 255, .06);
  --side-active: rgba(99, 102, 241, .22);
  --side-text: #cbd5e1;
  --side-sec: #64748b;
  --side-brand: #f8fafc;
  --side-line: rgba(148, 163, 184, .12);
  --overlay: rgba(2, 6, 23, .74);
  --toast-bg: #1e293b;
  --toast-text: #f8fafc;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .4);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, .65);
  --chart-grid: #1e293b;
  --chart-axis: #94a3b8;
  --chart-bar-bg: #1e293b;
  --chart-hit: rgba(99, 102, 241, .12);
  --chart-rev: #6366f1;
  --chart-cost: #fbbf24;
  --chart-profit: #34d399;
  --chart-spend: #6366f1;
  --chart-saved: #34d399;
  --chart-claude: #fbbf24;
  --chart-antigravity: #60a5fa;
  --chart-codex: #34d399;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  transition: background-color .15s ease, color .15s ease;
}
body.drawer-open { overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.boot { padding: 48px; color: var(--muted); text-align: center; }

button, .btn {
  font: inherit;
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: all .15s ease;
}
button:hover, .btn:hover { border-color: var(--line-hover); background: var(--panel-hover); }
button.primary {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, .28);
}
button.primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79, 70, 229, .32); }
button.danger { color: var(--danger); }
button.danger:hover { border-color: var(--danger); background: var(--danger-weak); }
button.small { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
button.icon { border: none; background: none; color: inherit; font-size: 20px; line-height: 1; padding: 4px 8px; border-radius: 8px; }
button.icon:hover { background: var(--panel-hover); }
button:disabled { opacity: .5; cursor: default; transform: none; }

input, select, textarea {
  font: inherit;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type="checkbox"] { width: auto; padding: 0; margin: 0 8px 0 0; accent-color: var(--primary); cursor: pointer; flex: 0 0 auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
textarea { min-height: 80px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
label { display: block; margin: 12px 0 5px; color: var(--muted); font-size: 12px; font-weight: 500; }
label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: center;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  cursor: pointer;
}
label:has(> input[type="checkbox"]):hover { border-color: var(--line-hover); }

.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }
.row > .shrink { flex: 0 0 auto; min-width: 0; }

.layout { display: flex; min-height: 100vh; }
.side-backdrop { display: none; }
.side {
  width: 232px;
  background: var(--side-bg);
  color: var(--side-text);
  padding: 18px 0 16px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--side-line);
}
.side .brand {
  color: var(--side-brand);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.01em;
  padding: 0 16px 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--side-line);
  margin-bottom: 8px;
}
.side-close { display: none; color: var(--side-text); }
.side-close:hover { background: var(--side-hover); color: #fff; }
.side-nav { flex: 1; overflow-y: auto; padding: 0 10px; }
.side .sec { font-size: 11px; font-weight: 600; color: var(--side-sec); padding: 14px 10px 6px; letter-spacing: .06em; text-transform: uppercase; }
.side a { display: flex; align-items: center; padding: 8px 12px; margin: 2px 0; border-radius: 8px; color: var(--side-text); text-decoration: none; font-size: 13.5px; transition: all .14s ease; }
.side a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.side a.on { background: var(--side-active); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #818cf8; }
.side-foot { margin-top: 12px; padding: 12px 12px 0; border-top: 1px solid var(--side-line); display: flex; flex-direction: column; gap: 6px; }
.side-theme-btn { width: 100%; justify-content: flex-start; background: rgba(255, 255, 255, .06); border-color: var(--side-line); color: var(--side-text); font-size: 13px; padding: 7px 12px; }
.side-theme-btn:hover { background: var(--side-hover); border-color: rgba(148, 163, 184, .35); color: #fff; }
.side-foot a.side-logout { border-radius: 8px; padding: 7px 12px; }

.main { flex: 1; padding: 26px 34px; min-width: 0; max-width: 1480px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.menu-btn { display: none; align-items: center; justify-content: center; font-size: 19px; padding: 4px 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.topbar-theme-btn { font-size: 13px; padding: 6px 12px; white-space: nowrap; }
.topbar .topbar-theme-btn { display: none; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.panel h3 { margin: 0 0 14px; font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.panel h4 { margin: 16px 0 10px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h3 { margin: 0; }
.panel-sub { font-size: 12.5px; color: var(--muted); }
.panel-alert { border-color: rgba(220, 38, 38, .4); background: linear-gradient(135deg, var(--danger-weak) 0%, var(--panel) 60%); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.card::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--line); }
.card.ok::before { background: var(--ok); }
.card.warn::before { background: var(--warn); }
.card.bad::before { background: var(--danger); }
.card.accent::before { background: linear-gradient(90deg, var(--primary), #818cf8); }
.card .k { color: var(--muted); font-size: 12px; font-weight: 500; }
.card .v { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.card .sub { color: var(--muted); font-size: 11.5px; margin-top: 4px; }

/* 订阅号池专属规则卡片、余量条与席位圆点 */
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rule-card {
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rule-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rule-title { font-size: 13px; font-weight: 600; color: var(--text); }
.rule-val { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--primary-weak); color: var(--primary); font-family: ui-monospace, Consolas, monospace; }
.rule-desc { font-size: 12px; color: var(--muted); line-height: 1.45; }

.meter-row { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 4px; }
.meter-lbl { width: 22px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.meter { flex: 1; min-width: 68px; height: 6px; border-radius: 999px; background: var(--tag-bg); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--ok); transition: width .2s ease; }
.meter-fill.warn { background: var(--warn); }
.meter-fill.bad { background: var(--danger); }
.meter-num { width: 34px; text-align: right; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--text); }

.seats { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-family: ui-monospace, Consolas, monospace; }
.seat-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--line-hover); display: inline-block; }
.seat-dot.on { background: var(--primary); border-color: var(--primary); }
.seat-dot.full { background: var(--warn); border-color: var(--warn); }

.device-code-box {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 3px;
  text-align: center;
  padding: 14px;
  margin: 10px 0;
  border-radius: 10px;
  background: var(--primary-weak);
  border: 1px dashed var(--primary);
  color: var(--primary);
  font-family: ui-monospace, Consolas, monospace;
}

/* 四大订阅平台等宽一行 + 火山引擎官方 API 独立横条 */
.platform-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1180px) { .platform-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .platform-grid { grid-template-columns: 1fr; } }
.platform-strip {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-left: 4px solid var(--plat-accent, #f97316);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.platform-strip-info { flex: 1; min-width: 260px; }
.platform-card {
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-top: 3px solid var(--plat-accent, var(--primary));
  border-radius: 12px;
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.platform-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--line-hover); }
.platform-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.platform-title { font-size: 15.5px; font-weight: 700; color: var(--text); }
.platform-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.platform-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.plat-pill {
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.plat-pill.warn { background: var(--warn-weak); border-color: transparent; color: var(--warn); font-weight: 600; }
.platform-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.plat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-btn {
  padding: 4px 11px;
  font-size: 12px;
  border-radius: 999px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill-btn:hover { border-color: var(--line-hover); color: var(--text); }
.pill-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill-cnt { font-variant-numeric: tabular-nums; opacity: .82; }

.fp-engine-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.fp-engine-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fp-engine-title { font-size: 13.5px; font-weight: 700; color: var(--text); }

/* 独立指纹环境卡片与三家订阅槽位 */
.env-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.env-card {
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.env-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.env-title { font-size: 14.5px; font-weight: 700; color: var(--text); }
.env-meta { color: var(--muted); font-size: 11.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.env-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.env-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.env-slot.bound { border-color: rgba(5, 150, 105, .35); background: var(--ok-weak); }
.env-slot-name { font-weight: 600; color: var(--ok); white-space: nowrap; }
.env-slot-ops { display: flex; gap: 4px; }
.env-slot.empty { justify-content: center; color: var(--muted); border-style: dashed; }
.env-slot.empty:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-weak); }
button.tiny { padding: 2px 7px; font-size: 11px; border-radius: 5px; }

/* 模型能力标签（思考 / 识图 / 生图 / 视频 / 音频 / 工具 / 上下文） */
.cap-wrap { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.cap-tag { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: var(--tag-bg); color: var(--muted); white-space: nowrap; }
.cap-think { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.cap-video { background: rgba(249, 115, 22, .14); color: #ea580c; font-weight: 600; }
.cap-vision { background: var(--ok-weak); color: var(--ok); }
.cap-img { background: var(--warn-weak); color: var(--warn); }
.fm-row { align-items: flex-start !important; padding: 6px 4px !important; border-bottom: 1px solid var(--line) !important; }
.fm-row:last-child { border-bottom: none !important; }

.fp-preview {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--panel-alt);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
  font-family: ui-monospace, Consolas, monospace;
}
.alert-box {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 150px;
  overflow-y: auto;
}
.alert-box.ok { background: var(--ok-weak); color: var(--ok); }
.alert-box.bad { background: var(--danger-weak); color: var(--danger); }

.details-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.details-box > summary {
  padding: 14px 20px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.details-box > summary::-webkit-details-marker { display: none; }
.details-box > summary::after { content: '展开 ▾'; font-size: 12px; font-weight: 500; color: var(--primary); }
.details-box[open] > summary::after { content: '收起 ▴'; }
.details-box[open] > summary { border-bottom: 1px solid var(--line); color: var(--text); }
.details-body { padding: 16px 20px 20px; }

.details-inline {
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
}
.details-inline > summary { cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.details-inline[open] > summary { margin-bottom: 8px; color: var(--text); }

table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; background: var(--panel-alt); letter-spacing: .02em; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--panel-hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }

.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--tag-bg);
  color: var(--muted);
  white-space: nowrap;
}
.tag.ok { background: var(--ok-weak); color: var(--ok); }
.tag.bad { background: var(--danger-weak); color: var(--danger); }
.tag.warn { background: var(--warn-weak); color: var(--warn); }
.tag.ok::before, .tag.bad::before, .tag.warn::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.mono-id { font-family: ui-monospace, Consolas, monospace; font-size: 12px; white-space: nowrap; word-break: normal; }

.auth { max-width: 410px; margin: 10vh auto; }
.auth-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.auth h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.02em; }
.tabs { display: flex; gap: 6px; margin: 16px 0; padding: 4px; background: var(--panel-alt); border-radius: 10px; border: 1px solid var(--line); }
.tabs button { flex: 1; border-color: transparent; background: transparent; }
.tabs button.on { background: var(--panel); border-color: var(--line); color: var(--primary); box-shadow: var(--shadow-sm); }

.modal {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px;
  z-index: 40;
  overflow-y: auto;
}
.modal.hidden, .toast.hidden { display: none; }
.modal-box {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 100%;
  max-width: 660px;
  padding: 22px 24px;
  box-shadow: var(--shadow-lg);
}
.modal-box.wide { max-width: 960px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--toast-bg);
  color: var(--toast-text);
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  max-width: 85vw;
  font-size: 13.5px;
}
.toast.err { background: var(--danger); border-color: var(--danger); color: #fff; }

.secret { background: var(--secret-bg); border: 1px solid var(--secret-border); padding: 12px 14px; border-radius: 10px; margin: 10px 0; }
.check-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--input-bg); }
.check-list label { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 13px; margin: 4px 0; background: none; border: none; padding: 2px 0; }
.check-list input { width: auto; }
.bar { height: 8px; background: var(--primary); border-radius: 4px; }

/* 内联 SVG 图表 */
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; font-size: 12px; color: var(--muted); align-items: center; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.legend-val { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-wrap { width: 100%; overflow-x: auto; margin-bottom: 12px; }
.svg-chart { display: block; width: 100%; min-width: 320px; height: auto; }
.chart-grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart-zero { stroke: var(--line-hover); stroke-width: 1.2; }
.chart-axis { fill: var(--chart-axis); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-label { fill: var(--text); font-size: 12px; font-weight: 500; }
.chart-sub { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-hit { fill: transparent; cursor: crosshair; }
.chart-hit:hover { fill: var(--chart-hit); }
.hbar-row:hover .chart-bar-track { opacity: .85; }
.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 120px;
  padding: 20px;
  margin-bottom: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 13px;
}

.quick-amounts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { padding: 4px 12px; font-size: 12px; border-radius: 999px; background: var(--panel-alt); border: 1px solid var(--line); color: var(--text); }
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-weak); }
.secret-input-row { display: flex; gap: 6px; align-items: center; }
.secret-input-row input { flex: 1; min-width: 0; }

@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .topbar .topbar-theme-btn { display: inline-flex; }
  .side-close { display: inline-flex; }
  .side-backdrop { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: 25; opacity: 0; pointer-events: none; transition: opacity .22s ease; }
  .side-backdrop.open { opacity: 1; pointer-events: auto; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; width: 250px; max-width: 82vw; z-index: 30; transform: translateX(-100%); transition: transform .22s cubic-bezier(.4, 0, .2, 1); box-shadow: var(--shadow-lg); }
  .side.open { transform: translateX(0); }
  .main { padding: 16px; }
  .topbar { margin-bottom: 14px; }
  .topbar h2 { font-size: 18px; }
  .auth { margin: 5vh 12px; }
  .modal { padding: 3vh 10px; }
  .modal-box { padding: 16px 18px; }
}
