/* =====================================================================
   聚流 · 控制台（本地预览版）
   视觉语言：黑场 / 纸白交替 · 极细分割线 · 等宽小标签 · 衬线斜体点缀
   结构：左侧固定侧栏（品牌 / 导航分组 / 底部工具）+ 右侧主区
   ===================================================================== */

/* ---------- Google Sans（复用官网自托管字体，仅拉丁子集） ---------- */
@font-face { font-family: 'Google Sans'; font-style: normal; font-weight: 300; font-display: swap; src: url('fonts/GoogleSans-300.woff2') format('woff2'); unicode-range: U+0020-007E, U+00A0-00FF, U+2000-206F, U+2190-2193, U+2212, U+25A0-25FF; }
@font-face { font-family: 'Google Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/GoogleSans-400.woff2') format('woff2'); unicode-range: U+0020-007E, U+00A0-00FF, U+2000-206F, U+2190-2193, U+2212, U+25A0-25FF; }
@font-face { font-family: 'Google Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/GoogleSans-500.woff2') format('woff2'); unicode-range: U+0020-007E, U+00A0-00FF, U+2000-206F, U+2190-2193, U+2212, U+25A0-25FF; }
@font-face { font-family: 'Google Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/GoogleSans-600.woff2') format('woff2'); unicode-range: U+0020-007E, U+00A0-00FF, U+2000-206F, U+2190-2193, U+2212, U+25A0-25FF; }
@font-face { font-family: 'Google Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/GoogleSans-700.woff2') format('woff2'); unicode-range: U+0020-007E, U+00A0-00FF, U+2000-206F, U+2190-2193, U+2212, U+25A0-25FF; }
@font-face { font-family: 'Google Sans'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/GoogleSans-italic-400.woff2') format('woff2'); unicode-range: U+0020-007E, U+00A0-00FF, U+2000-206F; }

/* ---------- 令牌 ---------- */
:root {
  --sans: 'Google Sans', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --serif: 'Noto Serif SC', 'Songti SC', 'Source Han Serif SC', Georgia, 'Times New Roman', serif;

  --paper: #ffffff;
  --paper-2: #ffffff;
  --paper-3: #f2f1ee;
  --ink: #101010;
  --ink-2: #4a4a48;
  --ink-3: #8a8a86;
  --ink-4: #b5b5b0;
  --line: rgba(16, 16, 16, .12);
  --line-soft: rgba(16, 16, 16, .07);
  --line-faint: rgba(16, 16, 16, .045);

  --accent: #5a4bc4;
  --accent-2: #9d92ff;
  --accent-soft: #f1eefb;

  --side-bg: #050505;
  --side-ink: #f2f0ea;
  --side-ink-2: rgba(242, 240, 234, .58);
  --side-ink-3: rgba(242, 240, 234, .32);
  --side-line: rgba(255, 255, 255, .10);
  --side-hover: rgba(255, 255, 255, .055);
  --side-on: rgba(255, 255, 255, .09);

  --ok: #0f7a45;
  --ok-bg: #e9f5ee;
  --warn: #8a5a00;
  --warn-bg: #fbf3e2;
  --bad: #b2352b;
  --bad-bg: #fbeeec;

  --r: 2px;
  --side-w: 264px;
  --pad: clamp(26px, 3.2vw, 52px);
  --nav-h: 56px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

[data-theme='dark'] {
  --paper: #0a0a0a;
  --paper-2: #101010;
  --paper-3: #161616;
  --ink: #eeeeea;
  --ink-2: #a8a8a4;
  --ink-3: #777772;
  --ink-4: #4e4e4a;
  --line: rgba(255, 255, 255, .14);
  --line-soft: rgba(255, 255, 255, .08);
  --line-faint: rgba(255, 255, 255, .05);

  --accent: #9d92ff;
  --accent-2: #c3bbff;
  --accent-soft: rgba(157, 146, 255, .12);

  --side-bg: #000000;
  --side-ink: #f2f0ea;
  --side-ink-2: rgba(242, 240, 234, .55);
  --side-ink-3: rgba(242, 240, 234, .3);

  --ok: #4fd18b;
  --ok-bg: rgba(79, 209, 139, .12);
  --warn: #e0b05a;
  --warn-bg: rgba(224, 176, 90, .12);
  --bad: #ff8074;
  --bad-bg: rgba(255, 128, 116, .12);
  color-scheme: dark;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .35s var(--ease), color .35s var(--ease);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }

.mono { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.mono-lc { font-family: var(--mono); letter-spacing: .02em; text-transform: none; }
.tnum { font-variant-numeric: tabular-nums; }

/* 细滚动条 */
* ::-webkit-scrollbar { width: 8px; height: 8px; }
* ::-webkit-scrollbar-thumb { background: var(--line); }
* ::-webkit-scrollbar-track { background: transparent; }

/* ---------- 外壳 ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: 100vh;
}

/* ---------- 侧栏 ---------- */
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--side-bg);
  color: var(--side-ink);
  border-right: 1px solid var(--side-line);
  overflow: hidden;
}
.side::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 60% at 20% 0%, rgba(157, 146, 255, .10), transparent 62%);
  opacity: .9;
}

.side-head {
  padding: 22px 20px 0;
  position: relative;
  z-index: 2;
}
.brand { display: block; }
.brand-mark {
  display: block;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.1;
}
.brand-mark sup { font-size: 9px; font-weight: 400; margin-left: 1px; vertical-align: super; opacity: .5; }
.brand-sub { display: block; margin-top: 6px; color: var(--side-ink-3); font-size: 9px; }

.ws-switch {
  margin-top: 18px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--side-line);
  border-radius: var(--r);
  color: var(--side-ink);
  background: transparent;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.ws-switch:hover { border-color: rgba(255, 255, 255, .26); background: var(--side-hover); }
.ws-av {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-2);
  color: #0b0b0b;
  font-size: 10px; font-weight: 600;
}
.ws-name { font-size: 12.5px; flex: 1; text-align: left; }
.ws-chev { font-size: 9px; color: var(--side-ink-3); transition: transform .3s var(--ease); }
.ws-switch[aria-expanded='true'] .ws-chev { transform: rotate(180deg); }

.nav {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow-y: auto;
  padding: 22px 12px 8px;
}
.nav-group { margin-bottom: 20px; }
.nav-label {
  display: block;
  padding: 0 8px 8px;
  color: var(--side-ink-3);
  font-size: 9px;
  letter-spacing: .18em;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin-bottom: 1px;
  border-radius: var(--r);
  color: var(--side-ink-2);
  font-size: 13px;
  transition: color .22s var(--ease), background .22s var(--ease);
}
.nav-link::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 2px; height: 0;
  background: var(--accent-2);
  transform: translateY(-50%);
  transition: height .3s var(--ease);
}
.nav-link:hover { color: var(--side-ink); background: var(--side-hover); }
.nav-link.is-on { color: #fff; background: var(--side-on); }
.nav-link.is-on::before { height: 16px; }
.nav-i { width: 14px; text-align: center; font-size: 11px; opacity: .75; }
.nav-link.is-on .nav-i { opacity: 1; color: var(--accent-2); }
.nav-t { flex: 1; }
.nav-n { font-size: 9px; color: var(--side-ink-3); opacity: 0; transition: opacity .25s var(--ease); }
.nav-link:hover .nav-n, .nav-link.is-on .nav-n { opacity: .55; }

.side-foot {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--side-line);
  padding: 10px 12px 14px;
}
.foot-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r);
  color: var(--side-ink-2);
  font-size: 12.5px;
  transition: color .22s var(--ease), background .22s var(--ease);
}
.foot-btn:hover { color: var(--side-ink); background: var(--side-hover); }
.foot-i { width: 14px; text-align: center; font-size: 11px; opacity: .8; }

/* ---------- 主区 ---------- */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0 var(--pad) 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  margin: 0 calc(var(--pad) * -1);
  padding: 0 var(--pad);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-faint);
}
.crumb { display: flex; align-items: center; gap: 10px; }
.menu-btn {
  display: none;
  width: 30px; height: 30px;
  margin-right: 2px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink-2);
  font-size: 12px;
  transition: border-color .2s, color .2s;
}
.menu-btn:hover { border-color: var(--ink); color: var(--ink); }
.crumb-num { color: var(--accent); font-size: 10px; }
.crumb-dash { color: var(--ink-4); }
.crumb-name { font-size: 12px; color: var(--ink-2); letter-spacing: .01em; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-sep { width: 1px; height: 12px; background: var(--line); }
.clock { color: var(--ink-2); font-size: 10px; letter-spacing: .1em; }

.view-host {
  flex: 1;
  padding: 34px 0 40px;
}

.main-foot {
  display: flex;
  justify-content: space-between;
  padding: 16px 0 22px;
  border-top: 1px solid var(--line-faint);
  color: var(--ink-4);
}

/* ---------- 视图通用 ---------- */
/* 视图入场动画：只在真正换页时播（.is-entering 由 afterRender 挂上，
   同一视图重渲染/翻页/换筛选不再重播，避免「每切一次闪一下」） */
.view.is-entering { animation: viewIn .42s var(--ease) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.page-head-main { min-width: 0; }
.page-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.kicker-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.page-title {
  margin: 0;
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.025em;
}
.page-title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.01em;
}
.page-lede {
  margin: 12px 0 0;
  max-width: 52ch;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.7;
}
.page-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--paper-2);
  font-size: 12.5px;
  letter-spacing: .01em;
  transition: transform .3s var(--ease), background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-icon { padding: 8px 10px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }

/* 分段器 / 标签页 */
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.seg button {
  padding: 7px 13px;
  font-size: 12px;
  color: var(--ink-3);
  border-left: 1px solid var(--line-soft);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.seg button:first-child { border-left: 0; }
.seg button:hover { color: var(--ink); }
.seg button.is-on { background: var(--ink); color: var(--paper-2); }

.tabs {
  display: flex;
  gap: 26px;
  margin-top: 26px;
  border-bottom: 1px solid var(--line);
}
.tab {
  position: relative;
  padding: 0 0 12px;
  font-size: 13px;
  color: var(--ink-3);
  transition: color .22s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab .tab-n { font-family: var(--mono); font-size: 9px; opacity: .55; margin-left: 5px; }
.tab::after {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: 100%; height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.tab.is-on { color: var(--ink); }
.tab.is-on::after { transform: scaleX(1); }

/* 搜索 / 输入 */
.field {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper-2);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.field:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-i { color: var(--ink-4); font-size: 11px; }
.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12.5px;
}
.field input::placeholder { color: var(--ink-4); }

/* 卡片 / 网格 */
.card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper-2);
  transition: border-color .3s var(--ease), background .35s var(--ease);
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 0;
}
.card-t { font-size: 13px; font-weight: 500; letter-spacing: -.005em; }
.card-s { margin-top: 3px; color: var(--ink-3); font-size: 11.5px; }
.card-body { padding: 18px 20px 20px; }

.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.grid > * { background: var(--paper-2); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }

/* KPI */
.kpi { position: relative; padding: 20px 22px 22px; overflow: hidden; }
/* KPI 卡片的错峰入场改到 .is-entering 上，跟视图一起只播一次 */
.view.is-entering .kpi { animation: kpiIn .5s var(--ease) both; }
@keyframes kpiIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.kpi::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease);
}
.kpi:hover::after { transform: scaleX(1); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { color: var(--ink-3); font-size: 9px; }
.kpi-link { color: var(--ink-3); font-size: 11px; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.kpi-link:hover { color: var(--accent); border-color: var(--accent); }
.kpi-val {
  margin-top: 16px;
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.kpi-val small { font-size: .5em; font-weight: 400; margin-right: 1px; }
.kpi-sub { margin-top: 10px; color: var(--ink-3); font-size: 11px; }
.kpi-sub b { color: var(--ink-2); font-weight: 500; }

/* 提示条 */
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 15px;
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--accent);
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--ink-2);
  font-size: 12px;
}

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  padding: 10px 14px;
  text-align: left;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  background: var(--paper-3);
  white-space: nowrap;
}
.table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-faint);
  font-size: 12.5px;
  vertical-align: middle;
}
.table tbody tr { transition: background .2s var(--ease); }
.table tbody tr:hover { background: var(--line-faint); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.table .muted { color: var(--ink-3); }
.table .strong { font-weight: 500; }
.t-right { text-align: right; }

/* 状态 pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.pill-ok { color: var(--ok); background: var(--ok-bg); }
.pill-warn { color: var(--warn); background: var(--warn-bg); }
.pill-bad { color: var(--bad); background: var(--bad-bg); }
.pill-off { color: var(--ink-3); background: var(--paper-3); }

/* 细标签 */
.tag {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--ink-3);
  text-transform: uppercase;
}

/* 空状态 */
.empty {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 54px 20px;
  color: var(--ink-3);
  text-align: center;
}
.empty-i { font-size: 20px; opacity: .35; letter-spacing: .1em; }
.empty-t { font-size: 12px; }

/* ---------- 概览 ---------- */
.ov-kpis { margin-top: 22px; }
.ov-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--r) var(--r);
  overflow: hidden;
}
.chart-card { background: var(--paper-2); padding: 20px 22px 18px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; }
.chart-t { font-size: 13px; font-weight: 500; }
.chart-s { margin-top: 2px; color: var(--ink-3); font-size: 11.5px; }
.chart-plot { position: relative; height: 168px; margin-top: 16px; }

/* 柱状图 */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 100%; }
.bars .bar {
  position: relative;
  flex: 1;
  min-width: 0;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
  animation: barGrow .7s var(--ease) forwards;
  border-radius: 1px;
}
.bars .bar.is-empty { background: var(--line-soft); }
.bars .bar:hover { background: var(--accent-2); }
@keyframes barGrow { to { transform: scaleY(1); } }
.chart-x {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--ink-4);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
}
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.legend-i { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 11.5px; }
.legend-d { width: 6px; height: 6px; border-radius: 50%; }
.legend-v { color: var(--ink-3); font-family: var(--mono); font-size: 10px; }

/* 折线图 */
.line-plot { width: 100%; height: 100%; overflow: visible; }
.line-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: var(--len, 1000);
  stroke-dashoffset: var(--len, 1000);
  animation: drawLine 1.1s var(--ease) .1s forwards;
}
@keyframes drawLine { to { stroke-dashoffset: 0; } }
.line-area { opacity: 0; animation: fadeIn .8s var(--ease) .5s forwards; }
@keyframes fadeIn { to { opacity: 1; } }
.line-dot { fill: var(--accent); opacity: 0; animation: fadeIn .3s var(--ease) forwards; }
.line-grid line { stroke: var(--line-faint); stroke-width: 1; }

/* 甜甜圈 */
.donut-wrap { display: flex; align-items: center; gap: 26px; height: 100%; }
.donut { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.donut svg { transform: rotate(-90deg); overflow: visible; }
.donut circle { fill: none; stroke-width: 12; }
.donut circle.seg { stroke-linecap: butt; transition: stroke-dashoffset 1s var(--ease); }
.donut-center {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  text-align: center;
}
.donut-num { font-size: 24px; font-weight: 300; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.donut-cap { margin-top: 5px; color: var(--ink-3); font-family: var(--mono); font-size: 9px; letter-spacing: .12em; }

/* 排行条 */
.rank { display: flex; flex-direction: column; gap: 15px; }
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.rank-name { font-size: 12px; color: var(--ink-2); }
.rank-val { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.rank-bar { grid-column: 1 / -1; height: 2px; background: var(--line-soft); overflow: hidden; }
.rank-bar i {
  display: block; height: 100%;
  width: 0;
  background: var(--accent);
  animation: rankGrow 1s var(--ease) forwards;
}
@keyframes rankGrow { to { width: var(--w, 50%); } }

/* ---------- 调用记录 ---------- */
.log-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.log-tools .field { flex: 1; min-width: 220px; max-width: 340px; }
.log-src { display: flex; gap: 6px; }
.status-tag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10px; }
.status-tag i { width: 5px; height: 5px; border-radius: 50%; }
.status-ok { color: var(--ok); }
.status-ok i { background: var(--ok); }
.status-bad { color: var(--bad); }
.status-bad i { background: var(--bad); }
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 2px 0;
  color: var(--ink-3);
  font-size: 11px;
}
.pager-btns { display: flex; gap: 6px; }

/* ---------- 密钥 ---------- */
.key-row-main { display: flex; align-items: center; gap: 8px; }
.key-name { font-weight: 500; }
.key-pre { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .02em; }
.key-dots { letter-spacing: .12em; color: var(--ink-4); }
.icon-btn {
  display: inline-grid;
  width: 26px; height: 26px;
  place-items: center;
  border-radius: var(--r);
  color: var(--ink-3);
  transition: color .2s, background .2s;
}
.icon-btn:hover { color: var(--ink); background: var(--line-faint); }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-bg); }

/* 一次性密钥展示 */
.key-reveal {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  background: var(--paper-3);
}
.key-reveal code { flex: 1; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; word-break: break-all; }
.key-reveal[hidden] { display: none; }

/* ---------- 充值 ---------- */
.bal-card {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 22px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper-2);
}
.bal-num {
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.bal-num small { font-size: .42em; margin-right: 3px; font-weight: 400; }
.bal-meta { margin-top: 12px; color: var(--ink-3); font-size: 11.5px; }
.bal-meta b { color: var(--ink-2); font-weight: 500; }
.bal-side { text-align: right; color: var(--ink-3); font-size: 11px; }

.sec-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 0 12px;
}
.sec-label-t { display: flex; align-items: baseline; gap: 9px; }
.sec-label-t b { font-size: 13px; font-weight: 500; }
.sec-label-t span { color: var(--ink-4); font-family: var(--mono); font-size: 9px; letter-spacing: .1em; }

.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.amount {
  position: relative;
  padding: 22px 16px;
  background: var(--paper-2);
  text-align: center;
  transition: background .25s var(--ease);
}
.amount:hover { background: var(--paper-3); }
.amount .a-val { font-size: 20px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.amount .a-val small { font-size: .6em; margin-right: 1px; font-weight: 400; }
.amount .a-hint { margin-top: 4px; color: var(--ink-4); font-family: var(--mono); font-size: 9px; letter-spacing: .06em; }
.amount.is-on { background: var(--ink); color: var(--paper-2); }
.amount.is-on .a-hint { color: rgba(255, 255, 255, .5); }
.amount.is-on::after {
  content: '✓';
  position: absolute;
  top: 8px; right: 10px;
  font-size: 11px;
  color: #fff;
}

.pay-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.pay-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 12px;
  color: var(--ink-2);
  transition: border-color .25s var(--ease), color .25s, background .25s;
}
.pay-chip:hover { border-color: var(--ink); color: var(--ink); }
.pay-chip.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pay-chip.is-off { opacity: .45; cursor: not-allowed; }

.pay-bar { display: flex; gap: 10px; margin-top: 10px; }
.pay-bar .field { flex: 1; height: 44px; }

/* ---------- Plan ---------- */
.plan-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 24px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.plan-card { padding: 26px 24px; background: var(--paper-2); transition: background .3s var(--ease); }
.plan-card:hover { background: var(--paper-3); }
.plan-name { font-size: 11px; letter-spacing: .14em; color: var(--ink-3); text-transform: uppercase; font-family: var(--mono); }
.plan-price { margin-top: 14px; font-size: 34px; font-weight: 300; letter-spacing: -.03em; line-height: 1; }
.plan-price small { font-size: .4em; margin-right: 2px; }
.plan-price span { font-size: .32em; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.plan-list { margin: 20px 0 0; padding: 0; list-style: none; }
.plan-list li { display: flex; gap: 8px; padding: 6px 0; color: var(--ink-2); font-size: 12px; border-top: 1px solid var(--line-faint); }
.plan-list li i { color: var(--accent); font-style: normal; }
.plan-card.is-current { position: relative; background: var(--accent-soft); }
.plan-card.is-current .plan-name { color: var(--accent); }

/* 用量条 */
.meter { margin-top: 6px; }
.meter-top { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 12px; }
.meter-top b { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--ink-3); }
.meter-bar { margin-top: 8px; height: 3px; background: var(--line-soft); overflow: hidden; }
.meter-bar i { display: block; height: 100%; width: 0; background: var(--accent); animation: rankGrow 1.1s var(--ease) forwards; }

/* ---------- 模型列表 ---------- */
.model-tools { display: grid; grid-template-columns: 232px 1fr; gap: 26px; margin-top: 22px; align-items: start; }
.filters { border: 1px solid var(--line); border-radius: var(--r); background: var(--paper-2); padding: 16px; }
.filters .field { margin-bottom: 16px; }
.filter-label { color: var(--ink-3); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; font-family: var(--mono); margin-bottom: 9px; display: block; }
.filter-list { display: flex; flex-direction: column; gap: 1px; }
.filter-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 9px;
  border-radius: var(--r);
  font-size: 12px;
  color: var(--ink-2);
  transition: background .2s, color .2s;
}
.filter-item:hover { background: var(--line-faint); color: var(--ink); }
.filter-item.is-on { background: var(--accent-soft); color: var(--accent); }
.filter-item .n { font-family: var(--mono); font-size: 9px; opacity: .7; }

.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.model-card { padding: 18px 20px 20px; background: var(--paper-2); transition: background .3s var(--ease); }
.model-card:hover { background: var(--paper-3); }
.mc-head { display: flex; align-items: center; gap: 9px; }
.mc-logo { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 3px; background: var(--paper-3); font-size: 10px; font-weight: 600; color: var(--ink-2); overflow: hidden; }
.mc-logo img { width: 100%; height: 100%; object-fit: contain; padding: 1px; }
.mc-name { font-size: 13px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-badge { font-family: var(--mono); font-size: 8.5px; letter-spacing: .08em; color: var(--ink-3); border: 1px solid var(--line); padding: 1px 5px; border-radius: 2px; }
.mc-price { margin-top: 15px; display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 6px 8px; align-items: center; font-size: 11.5px; }
.mc-price .k { color: var(--ink-3); }
.mc-price .v { font-family: var(--mono); font-size: 11px; text-align: right; }
.mc-price .v.old { color: var(--ink-4); text-decoration: line-through; }
.mc-price .d { color: var(--accent); font-family: var(--mono); font-size: 10px; }
.mc-desc { margin-top: 12px; color: var(--ink-3); font-size: 11.5px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-faint); }
.mc-vendor { color: var(--ink-3); font-size: 11px; }
.mc-more { color: var(--ink-2); font-size: 11.5px; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.mc-more:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 模型详情弹窗（对齐旧版 jl-detail 的能力） ---------- */
/* 用 .modal-card.md-card 提高优先级：文件里后面还有 .modal-card{width:520px} 的通用规则 */
.modal-card.md-card { width: min(900px, 100%); }
.md-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.md-title { font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.md-sub { margin-top: 3px; color: var(--ink-3); font-size: 10px; letter-spacing: .04em; }
.md-tabs { display: flex; gap: 2px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.md-tab {
  position: relative; padding: 9px 14px 10px;
  font-size: 12px; color: var(--ink-3);
  background: transparent; border: 0; cursor: pointer;
  transition: color .2s var(--ease);
}
.md-tab:hover { color: var(--ink); }
.md-tab.is-on { color: var(--ink); }
.md-tab.is-on::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 1px; background: var(--ink);
}
.md-body { padding: 18px 22px 4px; }
.md-split { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 18px; }
.md-rail { border: 1px solid var(--line); background: var(--paper-2); padding: 12px 10px; max-height: 420px; overflow: auto; }
.md-rail-h { color: var(--ink-3); font-size: 9px; letter-spacing: .14em; margin: 2px 4px 9px; }
.md-ritem {
  display: block; width: 100%; text-align: left;
  padding: 9px 10px; margin-bottom: 6px;
  border: 1px solid transparent; background: transparent;
  cursor: pointer; transition: background .18s var(--ease), border-color .18s var(--ease);
}
.md-ritem:hover { background: var(--paper-3); }
.md-ritem.is-on { border-color: var(--accent); background: var(--accent-soft); }
.md-ritem-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.md-ritem-n { font-size: 12px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-ritem-rec { font-family: var(--mono); font-size: 8.5px; color: var(--accent); border: 1px solid currentColor; padding: 0 4px; flex-shrink: 0; }
.md-ritem-id { display: block; margin-top: 4px; color: var(--ink-3); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-ritem-p { display: block; margin-top: 4px; color: var(--ink-2); font-size: 10px; letter-spacing: 0; }
.md-pane { min-width: 0; }
.md-pane-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.md-pane-title { font-size: 13px; font-weight: 500; }
.md-pane-sub { margin-top: 3px; color: var(--ink-3); font-size: 10px; }
.md-idrow {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px; padding: 9px 12px;
  border: 1px solid var(--line); background: var(--paper-2);
}
.md-k { color: var(--ink-3); font-size: 9px; letter-spacing: .12em; flex-shrink: 0; white-space: nowrap; }
.md-code { font-family: var(--mono); font-size: 11px; letter-spacing: 0; color: var(--ink); white-space: nowrap; overflow-x: auto; }
.md-prices { margin-top: 14px; border: 1px solid var(--line); }
.md-prow {
  display: grid; grid-template-columns: 1.15fr .95fr .95fr .55fr;
  gap: 8px; align-items: center;
  padding: 8px 12px; font-size: 11.5px;
  border-bottom: 1px solid var(--line-faint);
}
.md-prow:last-child { border-bottom: 0; }
.md-prow-h { color: var(--ink-3); font-size: 10px; border-bottom: 1px solid var(--line); }
.md-prow-k { color: var(--ink-2); white-space: nowrap; }
.md-prow-v { text-align: right; letter-spacing: 0; white-space: nowrap; }
.md-prow-off { text-align: right; letter-spacing: 0; color: var(--ink-4); text-decoration: line-through; white-space: nowrap; }
.md-prow-z { text-align: right; letter-spacing: 0; white-space: nowrap; }
.md-prow-z.is-good { color: var(--accent); }
.md-prow-z.is-bad { color: var(--bad); }
.md-perf { margin-top: 16px; border: 1px solid var(--line); padding: 12px 14px 14px; background: var(--paper-2); }
.md-perf-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink-3); font-size: 10px; letter-spacing: .06em; white-space: nowrap; }
.md-perf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin-top: 12px; }
.md-stat-k { color: var(--ink-3); font-size: 9px; letter-spacing: .12em; white-space: nowrap; }
.md-stat-v { margin-top: 5px; font-size: 18px; font-weight: 300; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.md-stat-s { margin-top: 3px; color: var(--ink-4); font-size: 10.5px; }
.md-perf-empty { margin-top: 10px; color: var(--ink-3); font-size: 11.5px; }
.md-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.md-info { background: var(--paper-2); padding: 11px 13px; }
.md-info-k { display: block; color: var(--ink-3); font-size: 9px; letter-spacing: .12em; }
.md-info-v { display: block; margin-top: 5px; font-size: 12px; word-break: break-all; }
.md-info-v.is-mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0; }
.md-info-v.is-empty { color: var(--ink-4); }
.md-hint { margin-top: 14px; color: var(--ink-4); font-size: 11px; }
@media (max-width: 720px) {
  .md-split { grid-template-columns: 1fr; }
  .md-rail { max-height: 190px; }
  .md-perf-grid, .md-info-grid { grid-template-columns: 1fr; }
  .md-card { width: 100%; }
}

/* 未读徽标：用户显示数字红圈，管理员只显示小红点 */
.nav-badge {
  margin-left: auto;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: var(--bad, #d24b5a); color: #fff;
  font-family: var(--mono); font-size: 9px; line-height: 1; letter-spacing: 0;
}
.nav-badge[hidden] { display: none; }
.nav-badge--dot { min-width: 0; width: 6px; height: 6px; padding: 0; background: var(--bad, #d24b5a); }

/* ---------- 设置 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 40px; margin-top: 22px; }
.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row .lbl { color: var(--ink-3); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; font-family: var(--mono); }
.form-row .hint { color: var(--ink-4); font-size: 11px; }
.form-row .field { height: 40px; }
.form-row .field input { font-size: 12.5px; }
.form-row .field input:disabled { color: var(--ink-3); }
.form-actions { display: flex; gap: 10px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }

.setting-line {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-faint);
}
.setting-line:last-child { border-bottom: 0; }
.setting-main .t { font-size: 13px; }
.setting-main .s { margin-top: 2px; color: var(--ink-3); font-size: 11.5px; }

/* 开关 */
.switch {
  position: relative;
  width: 36px; height: 20px;
  border-radius: 999px;
  background: var(--line);
  transition: background .3s var(--ease);
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--paper-2);
  transition: transform .3s var(--ease);
}
.switch.is-on { background: var(--accent); }
.switch.is-on::after { transform: translateX(16px); }

/* ---------- 管理员 --------- */
.admin-kpis { margin-top: 22px; }
.admin-row-main { display: flex; align-items: center; gap: 10px; }
.admin-name { font-weight: 500; }

/* ---------- 邀请码 --------- */
.invite-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .06em;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .model-tools { grid-template-columns: 1fr; }
  .g4, .g3 { grid-template-columns: repeat(2, 1fr); }
  .ov-charts { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .plan-cards { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    z-index: 40;
    left: 0; top: 0;
    width: 84%;
    max-width: 300px;
    transform: translateX(-101%);
    transition: transform .42s var(--ease);
    box-shadow: 0 0 0 1px var(--side-line);
  }
  .side.is-open { transform: none; }
  .scrim {
    position: fixed; inset: 0; z-index: 30;
    background: rgba(0, 0, 0, .5);
    opacity: 0; pointer-events: none;
    transition: opacity .35s var(--ease);
    backdrop-filter: blur(2px);
  }
  .scrim.is-on { opacity: 1; pointer-events: auto; }
  .main { padding: 0 20px; }
  .topbar { padding: 0 20px; }
  .menu-btn { display: grid; }
  .topbar-sep, .clock { display: none; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 640px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .amounts { grid-template-columns: repeat(2, 1fr); }
  .donut-wrap { flex-direction: column; align-items: flex-start; gap: 16px; }
  .bal-card { flex-direction: column; align-items: flex-start; }
  .bal-side { text-align: left; }
  .table-wrap { overflow-x: auto; }
  .model-grid { grid-template-columns: 1fr; }
}

/* ---------- 降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .bars .bar { transform: none; }
  .line-path { stroke-dashoffset: 0; }
  .rank-bar i { width: var(--w, 50%); }
  .meter-bar i { width: var(--w, 50%); }
  .line-area, .line-dot { opacity: 1; }
}

/* =====================================================================
   线上版补充（真接口）—— 2026-10
   ===================================================================== */

.muted { color: var(--ink-3); }
.nav-group[hidden] { display: none; }
.mono .mono { font-family: var(--mono); }

/* 顶栏 / 页脚里的「切回旧版」 */
.ui-switch a {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.ui-switch a:hover { color: var(--accent); border-color: var(--accent); }
.main-foot a { color: inherit; border-bottom: 1px solid var(--line); }
.main-foot a:hover { color: var(--accent); border-color: var(--accent); }

/* 原生下拉（模型筛选等） */
.select {
  height: 36px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper-2);
  color: var(--ink);
  font-size: 12.5px;
  font-family: inherit;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
  max-width: 100%;
}
.select:focus { outline: 0; border-color: var(--ink); }

/* 危险操作按钮 */
.btn-danger {
  background: transparent;
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
}
.btn-danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }

/* 表格里的行内操作组 */
.row-acts { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }

/* 代码 / 接入信息 */
.code-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  background: var(--paper-3);
}
.code-box code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 模型详情展开区 */
.mc-detail {
  grid-column: 1 / -1;
  border-top: 1px dashed var(--line);
  margin-top: 2px;
  padding-top: 10px;
}
.mc-detail .route-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 11.5px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-faint);
}
.mc-detail .route-line:last-child { border-bottom: 0; }
.mc-detail .route-line .rname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-detail .route-line .rprice { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

/* 屏内提示（替代 alert） */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  transform: translate(-50%, 14px);
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--ink);
  color: var(--paper-2);
  font-size: 12.5px;
  line-height: 1.5;
  max-width: min(560px, 88vw);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-bad { background: var(--bad); border-color: var(--bad); }

/* 加载占位：让等待也有节奏，不做假数据 */
.spinner {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--ink-4);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 只读字段 */
.form-row .field.is-readonly { opacity: .72; }
.hint-bad { color: var(--bad); font-size: 11.5px; }

/* ---------- 工单 / 对话 ---------- */
.ticket-card { transition: border-color .25s var(--ease), box-shadow .25s var(--ease); }
.ticket-card.is-unread { border-left: 2px solid var(--accent); }
.ticket-card:hover { border-color: rgba(16, 16, 16, .26); }

.chat-box {
  margin-top: 16px;
  padding: 18px 4px 6px;
  max-height: 460px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 78%;
}
.chat-row.is-me { align-self: flex-end; align-items: flex-end; }
.chat-bubble {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: normal;
  word-break: break-word;
}
.chat-row.is-me .chat-bubble { background: var(--accent-soft); border-color: transparent; }
.chat-meta {
  font-size: 9.5px;
  letter-spacing: .06em;
  color: var(--ink-4);
  padding: 0 4px;
}
.chat-input { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.chat-input textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.7;
  resize: vertical;
  outline: 0;
  transition: border-color .2s var(--ease);
}
.chat-input textarea:focus { border-color: var(--ink); }
.chat-input-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ---------- 调用记录：行点击 + 详情弹层 ---------- */
.table tr.row-click { cursor: pointer; }
.table tr.row-click:hover td { background: var(--paper-3); }
.modal {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(8, 8, 8, .42);
  animation: fadeInBackdrop .2s var(--ease);
}
.modal-card-wrap {
  position: fixed; inset: 0; z-index: 56;
  display: grid; place-items: center;
  padding: 20px;
  pointer-events: none;
}
.modal-card {
  pointer-events: auto;
  width: min(520px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .18);
  animation: modalIn .32s var(--ease);
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}
.kvlist { padding: 6px 22px; }
.kv-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 9px 0;
  border-bottom: 1px solid var(--line-faint);
  font-size: 12px;
}
.kv-row:last-child { border-bottom: 0; }
.kv-k { color: var(--ink-3); font-size: 11px; }
.kv-v { color: var(--ink); text-align: right; word-break: break-word; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }
.modal-card.is-wide { width: min(700px, 100%); }
.modal-card .form-body { padding: 0 22px; }
.modal-card .form-grid { gap: 18px 24px; margin-top: 8px; }
.modal-card .form-row .field { height: 38px; }
.modal-ta {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.6;
  outline: none;
}
.modal-ta:focus { border-color: var(--accent); }
/* 协助模式返回条 */
.imp-bar {
  position: fixed; z-index: 70; top: 0; left: 0; right: 0;
  height: 40px; padding: 0 18px;
  display: flex; align-items: center; gap: 14px;
  background: #111; color: #fff; font-size: 12px;
}
.imp-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-bar .btn { color: #fff; border-color: rgba(255, 255, 255, .38); background: transparent; }
.imp-bar .btn:hover { background: rgba(255, 255, 255, .12); }
body.imp-on .shell { padding-top: 40px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fadeInBackdrop { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 积分批次明细 ---------- */
.cred-lots {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.cred-lots[hidden] { display: none; }
.lot-row {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr .7fr .8fr;
  gap: 10px;
  align-items: center;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line-faint);
  font-size: 11px;
}
.lot-row:last-child { border-bottom: 0; }
.lot-row .num { text-align: right; font-family: var(--mono); }

@media (max-width: 860px) {
  .ui-switch { display: none; }
  .chat-row { max-width: 92%; }
  .lot-row { grid-template-columns: 1fr 1fr; row-gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  /* 关掉动效时，图表的入场动画也别留着，否则元素会停在 transform 的初始态 */
  .bars .bar, .rank-bar i, .meter-bar i { animation: none; transform: scaleY(1); width: var(--w, 100%); }
  .line-path { animation: none; stroke-dashoffset: 0; }
  .line-area, .line-dot { animation: none; opacity: 1; }
  .donut circle.seg { transition: none; }
  .view.is-entering, .view.is-entering .kpi { animation: none; }
}

/* ---------- 模型线路编辑 ---------- */
.route-list { display: flex; flex-direction: column; gap: 12px; }
.route-card { border: 1px solid var(--line); padding: 14px 14px 10px; background: var(--paper); }
.route-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.route-card .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.route-price { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 4px; }
.route-pr { display: grid; grid-template-columns: 68px 1fr 1.2fr 60px; gap: 10px; align-items: center; padding: 5px 0; font-size: 11px; }
.route-pr .field { height: 32px; }
.route-pr-head { color: var(--ink-3); border-bottom: 1px solid var(--line-faint); }
.route-pr > span:last-child { text-align: right; }
@media (max-width: 860px) {
  .route-card .form-grid { grid-template-columns: 1fr; }
  .route-pr { grid-template-columns: 48px 1fr 1fr; }
  .route-pr > span:last-child { display: none; }
}
