/* ============================================================
   运营控制台 · 珍珠玻璃（Pearl Glass）
   移植自 scaffold-master 的后台设计系统，按本项目的服务端渲染方式落地。

   七层：令牌 → 基础 → 材质 → 组件 → 仪器化 → 外壳 → 页面差异
   —— 蓝色只表示「选择 / 主操作」，青柠只表示「成功 / 正常」，红只表示「危险」
   —— 玻璃只做层级暗示，表格与正文一律接近实色
   —— 圆角 8 / 10 / 12 / 16 / 24，胶囊 999
   —— 所有数字等宽 tabular-nums，读数是仪表的一部分

   老变量名（--ink-900…--ink-200、--accent、--brand-dark、--text-2）全部保留为
   新令牌的别名，视图里的内联 style 不用改。
   ============================================================ */

:root {
  /* ── 字色：四档 + 元信息 ───────────────────────────────────── */
  --ink:        #101418;   /* 正文 / 标题 */
  --ink-muted:  #596368;   /* 次级正文 */
  --ink-soft:   #6d777b;   /* 标签、表头 */
  --ink-faint:  #98a1a4;   /* 元信息、占位 */

  /* ── 语义色 ───────────────────────────────────────────────── */
  --blue:       #236de9;
  --blue-hover: #1d61d5;
  --blue-soft:  rgba(35, 109, 233, .1);
  --lime:       #82dd2d;
  --lime-soft:  rgba(130, 221, 45, .16);
  --red:        #ff5a50;
  --red-text:   #d93a30;
  --red-soft:   rgba(255, 90, 80, .11);
  --focus:      rgba(35, 109, 233, .8);

  /* ── 圆角 ─────────────────────────────────────────────────── */
  --r-xs: 8px;
  --r-sm: 10px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* ── 描边 ─────────────────────────────────────────────────── */
  --shade: 46, 58, 62;
  --line:        rgba(var(--shade), .085);
  --line-strong: rgba(var(--shade), .12);
  --glass-line:      rgba(255, 255, 255, .88);
  --glass-line-soft: rgba(255, 255, 255, .7);

  /* ── 材质高度：接触阴影 + 环境阴影 ─────────────────────────── */
  --e1: 0 1px 2px rgba(var(--shade), .05), 0 5px 14px rgba(var(--shade), .04);
  --e2: 0 1px 3px rgba(var(--shade), .06), 0 12px 30px rgba(var(--shade), .055);
  --e3: 0 2px 6px rgba(var(--shade), .07), 0 22px 50px rgba(var(--shade), .08);
  --e-accent:       0 1px 2px rgba(20, 66, 148, .28), 0 8px 18px rgba(35, 109, 233, .24);
  --e-accent-hover: 0 1px 2px rgba(20, 66, 148, .32), 0 12px 24px rgba(35, 109, 233, .3);
  --e-danger:       0 1px 2px rgba(150, 40, 34, .26), 0 8px 18px rgba(255, 90, 80, .24);
  --edge:        inset 0 1px 0 rgba(255, 255, 255, .92);
  --edge-strong: inset 0 1px 0 rgba(255, 255, 255, .98);

  /* ── 面：舞台、外框、画布、四种玻璃配方 ───────────────────── */
  --stage:        #dfe3e2;
  --frame:        #17191d;
  --canvas:       #f6f8f7;
  --surface:      #ffffff;
  --surface-solid:#fbfcfc;
  --surface-2:    #f6f8f7;
  --rail-bg:      rgba(248, 250, 250, .9);
  --pill-bg:      linear-gradient(145deg, rgba(255, 255, 255, .93), rgba(246, 251, 249, .62));
  --pill-inset:   inset 0 -1px 0 rgba(105, 122, 128, .08);
  --float-bg:     rgba(246, 248, 247, .86);
  --float-inset:  inset 0 0 0 1px rgba(120, 132, 135, .13), inset 0 1px 0 rgba(255, 255, 255, .72);
  --groove-bg:    rgba(217, 225, 222, .58);
  --groove-inset: inset 0 1px 0 rgba(255, 255, 255, .46);
  --input-bg:     rgba(255, 255, 255, .78);
  --hover-bg:     rgba(var(--shade), .045);
  --press-bg:     rgba(var(--shade), .075);
  --overlay:      rgba(16, 20, 24, .26);
  --dark-surface: #131619;

  /* 深色铭牌：浅色主题里也是深色面，用来承载「读数」 */
  --plate-bg:   rgba(21, 24, 26, .92);
  --plate-line: rgba(255, 255, 255, .1);
  --plate-ink:  #f2f5f4;
  --plate-soft: rgba(255, 255, 255, .56);

  /* 斜线与刻度：只承载「区间 / 刻度」语义，不做装饰 */
  --hatch-ink: rgba(var(--shade), .16);
  --hatch: repeating-linear-gradient(135deg, var(--hatch-ink) 0 1.5px, transparent 1.5px 6px);
  --tick:        rgba(var(--shade), .22);
  --tick-strong: rgba(var(--shade), .5);

  /* 画布上两团极淡的静态漫射光 */
  --ambient-a: rgba(130, 221, 45, .07);
  --ambient-b: rgba(35, 109, 233, .055);

  /* ── 字体 ─────────────────────────────────────────────────── */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
               "Source Han Sans SC", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono",
               Menlo, Consolas, "Liberation Mono", monospace;

  /* ── 尺寸 ─────────────────────────────────────────────────── */
  --rail-w:     232px;
  --topbar-h:   64px;
  --control-h:  36px;
  --control-h-sm: 30px;
  --row-h:      48px;
  --cell-px:    16px;
  --ease-premium: cubic-bezier(.16, 1, .3, 1);

  /* ── 旧名兼容：老视图的内联 style 靠这些 ───────────────────── */
  --ink-900: var(--ink);
  --ink-800: #1f272b;
  --ink-700: #333c40;
  --ink-600: var(--ink-muted);
  --ink-500: #6c7679;
  --ink-400: var(--ink-soft);
  --ink-300: #b7bfc3;
  --ink-200: #d9dedd;

  --paper:   var(--canvas);
  --text:    var(--ink-800);
  --text-2:  var(--ink-muted);
  --muted:   var(--ink-soft);

  --accent:      var(--blue);
  --accent-700:  var(--blue-hover);
  --accent-soft: var(--blue-soft);
  --accent-line: #cddcf8;
  --brand:       var(--blue);
  --brand-dark:  #3f7a17;
  --brand-soft:  var(--blue-soft);

  --ok:      #3f7a17;
  --ok-soft: var(--lime-soft);
  --ok-line: rgba(130, 221, 45, .34);
  --warn:      #96600a;
  --warn-soft: rgba(226, 168, 42, .14);
  --warn-line: rgba(226, 168, 42, .32);
  --danger:      var(--red-text);
  --danger-soft: var(--red-soft);
  --danger-line: rgba(255, 90, 80, .28);
  --info:      #2456a8;
  --info-soft: rgba(35, 109, 233, .08);
  --info-line: rgba(35, 109, 233, .2);

  --sidebar-w: var(--rail-w);
  --radius: var(--r);
  --shadow: var(--e1);
  --shadow-card: var(--e1);
  --shadow-card-hover: var(--e2);
}

/* ── 深色外观：同一套语义，换成深色材质 ─────────────────────── */
:root[data-theme="dark"] {
  color-scheme: dark;

  --ink:       #eef2f1;
  --ink-muted: #b0babd;
  --ink-soft:  #9aa4a6;
  --ink-faint: #78837f;

  --blue:       #4c8dff;
  --blue-hover: #3d7ff2;
  --blue-soft:  rgba(76, 141, 255, .16);
  --lime-soft:  rgba(130, 221, 45, .16);
  --red-text:   #ff8a80;
  --red-soft:   rgba(255, 90, 80, .16);
  --focus:      rgba(76, 141, 255, .85);

  --shade: 0, 0, 0;
  --line:        rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .11);
  --glass-line:      rgba(255, 255, 255, .1);
  --glass-line-soft: rgba(255, 255, 255, .07);

  --e1: 0 1px 2px rgba(0, 0, 0, .3), 0 5px 14px rgba(0, 0, 0, .2);
  --e2: 0 1px 3px rgba(0, 0, 0, .32), 0 12px 30px rgba(0, 0, 0, .28);
  --e3: 0 2px 6px rgba(0, 0, 0, .36), 0 22px 50px rgba(0, 0, 0, .42);
  --e-accent:       0 1px 2px rgba(0, 0, 0, .4), 0 8px 18px rgba(76, 141, 255, .26);
  --e-accent-hover: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 24px rgba(76, 141, 255, .34);
  --e-danger:       0 1px 2px rgba(0, 0, 0, .4), 0 8px 18px rgba(255, 90, 80, .26);
  --edge:        inset 0 1px 0 rgba(255, 255, 255, .06);
  --edge-strong: inset 0 1px 0 rgba(255, 255, 255, .09);

  --stage:  #090b0c;
  --frame:  #000000;
  --canvas: #121517;

  --surface:       #1b1f21;
  --surface-solid: #1b1f21;
  --surface-2:     #171b1d;
  --rail-bg:       rgba(22, 26, 28, .94);
  --pill-bg:       linear-gradient(145deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .05));
  --pill-inset:    inset 0 -1px 0 rgba(0, 0, 0, .2);
  --float-bg:      rgba(30, 34, 37, .92);
  --float-inset:   inset 0 0 0 1px rgba(255, 255, 255, .04), inset 0 1px 0 rgba(255, 255, 255, .06);
  --groove-bg:     rgba(0, 0, 0, .22);
  --groove-inset:  inset 0 1px 2px rgba(0, 0, 0, .28);
  --input-bg:      rgba(255, 255, 255, .04);
  --hover-bg:      rgba(255, 255, 255, .05);
  --press-bg:      rgba(255, 255, 255, .08);
  --overlay:       rgba(0, 0, 0, .5);

  --plate-bg:   rgba(8, 10, 11, .82);
  --plate-line: rgba(255, 255, 255, .1);

  --hatch-ink:   rgba(255, 255, 255, .12);
  --tick:        rgba(255, 255, 255, .16);
  --tick-strong: rgba(255, 255, 255, .42);

  --ambient-a: rgba(130, 221, 45, .05);
  --ambient-b: rgba(76, 141, 255, .07);

  --ink-800: #dfe6e4;
  --ink-700: #c7d0ce;
  --ink-500: #a8b2b4;
  --ink-300: #7d8888;
  --ink-200: #3a4245;

  --accent-line: #2c4a7a;
  --ok:      #94d564;
  --ok-line: rgba(148, 213, 100, .3);
  --warn:      #e8b25c;
  --warn-line: rgba(232, 178, 92, .28);
  --danger-line: rgba(255, 138, 128, .3);
  --info:      #8fb6f5;
  --info-soft: rgba(76, 141, 255, .14);
  --info-line: rgba(76, 141, 255, .24);
  --brand-dark: #94d564;
}

/* ============================================================
   基础
   ============================================================ */

* { box-sizing: border-box; }

html { height: 100%; }

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

body {
  height: 100%;
  overflow: hidden;
  background: var(--stage);
  color: var(--ink-800);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 数字一律等宽，读数才站得住 */
.num, .points, .stat__value, .metric__value, .kpi__value,
.code-text, .mono, .user-cell__id, .pager__links, .metric__foot b {
  font-variant-numeric: tabular-nums;
}

.mono, .code-text { font-family: var(--font-mono); }

/* 细滚动条：不抢视线 */
.content, .nav, .table-wrap, .login-main, .split-side {
  scrollbar-width: thin;
}
.content::-webkit-scrollbar, .nav::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar, .login-main::-webkit-scrollbar { width: 8px; height: 8px; }
.content::-webkit-scrollbar-thumb, .nav::-webkit-scrollbar-thumb,
.login-main::-webkit-scrollbar-thumb {
  background: rgba(var(--shade), .16);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.table-wrap::-webkit-scrollbar-thumb { background: rgba(var(--shade), .18); border-radius: 8px; }

/* ============================================================
   材质：四种玻璃配方
   差别只靠「不透明度 + 模糊 + 饱和度 + 白边强度」拉开，不换颜色
   ============================================================ */

.m-surface {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--edge), var(--e1);
}
.m-pill {
  border: 1px solid var(--glass-line);
  background: var(--pill-bg);
  box-shadow: var(--e2), var(--edge-strong), var(--pill-inset);
}
.m-float {
  border: 1px solid var(--glass-line);
  background: var(--float-bg);
  box-shadow: var(--e3), var(--float-inset);
  backdrop-filter: blur(28px) saturate(1.08);
  -webkit-backdrop-filter: blur(28px) saturate(1.08);
}
.m-groove {
  border: 1px solid var(--glass-line-soft);
  background: var(--groove-bg);
  box-shadow: var(--groove-inset);
}

/* ============================================================
   外壳：舞台 → 深色外框 → 导航轨 + 工作区
   ============================================================ */

.stage {
  position: relative;
  height: 100dvh;
  padding: 8px;
  overflow: clip;
  background: var(--stage);
}

.shell {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  overflow: clip;
  border: 10px solid var(--frame);
  border-radius: 38px;
  background:
    radial-gradient(55% 45% at 92% 0%, var(--ambient-a), transparent 70%),
    radial-gradient(45% 40% at 20% 100%, var(--ambient-b), transparent 70%),
    var(--canvas);
  box-shadow: 0 24px 70px rgba(17, 23, 27, .24), 0 3px 12px rgba(17, 23, 27, .16);
}

/* ---------- 导航轨 ---------- */

.sidebar {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--rail-bg);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-right: 1px solid var(--line-strong);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: var(--topbar-h);
  padding: 0 16px;
  flex: none;
  border-bottom: 0;
}
.brand__mark {
  position: relative;
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: var(--r-sm);
  background: var(--dark-surface);
  box-shadow: 0 1px 3px rgba(14, 18, 20, .16), 0 6px 16px rgba(14, 18, 20, .16),
              inset 0 1px 0 rgba(255, 255, 255, .12);
}
/* 品牌标记里的"划掉水印"符号 */
.brand__mark::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 16px; height: 2px;
  margin: -1px 0 0 -8px;
  border-radius: 2px;
  background: #fff;
  transform: rotate(-38deg);
}
/* 右上角一颗青柠状态点 */
.brand__mark::after {
  content: "";
  position: absolute;
  right: -2px; top: -2px;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--lime);
  box-shadow: 0 0 0 2px var(--rail-bg), 0 0 10px rgba(130, 221, 45, .55);
}
.brand__text { min-width: 0; }
.brand__name {
  font-size: 14px;
  font-weight: 660;
  letter-spacing: -.01em;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand__sub {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.4;
}

/* 侧栏额度胶囊 */
.side-chip {
  margin: 10px 12px 2px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--glass-line);
  background: var(--pill-bg);
  box-shadow: var(--e1), var(--edge);
  font-size: 11.5px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: none;
}
.side-chip b {
  color: var(--ink);
  font-weight: 640;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.side-chip--warn {
  border-color: var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn);
  box-shadow: none;
}
.side-chip--warn b { color: var(--warn); }
.side-chip__dot { font-size: 10.5px; opacity: .9; white-space: nowrap; }

/* ---------- 导航（两级手风琴 + 滑动玻璃块） ---------- */

.nav {
  position: relative;
  padding: 8px 12px 16px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: clip;
}

.nav__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav__item {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 520;
  margin-bottom: 1px;
  position: relative;
  z-index: 1;
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: color .18s ease, opacity .18s ease;
}
.nav__item:hover { color: var(--ink); text-decoration: none; }
.nav__item.is-active { color: var(--ink); font-weight: 640; }
.nav__item svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: .68; transition: color .18s ease; }
.nav__item:hover svg { opacity: .92; }
.nav__item.is-active svg { color: var(--blue); opacity: 1; }

/* 一块材质在导航项之间滑；标签与图标不动 */
.nav-thumb {
  position: absolute;
  left: 0; top: 0;
  z-index: 0;
  width: 0; height: 0;
  border-radius: var(--r-sm);
  border: 1px solid var(--glass-line);
  background: linear-gradient(145deg, #ffffff, #eff5fd);
  box-shadow: var(--e2), var(--edge-strong), inset 0 0 0 1px rgba(var(--shade), .035);
  pointer-events: none;
  opacity: 0;
}
:root[data-theme="dark"] .nav-thumb {
  background: linear-gradient(145deg, rgba(255, 255, 255, .13), rgba(76, 141, 255, .09));
}
.nav-thumb.is-on { opacity: 1; }
.nav-thumb.is-ready {
  transition: transform .3s var(--ease-premium), width .3s var(--ease-premium),
              height .3s var(--ease-premium), opacity .2s ease;
}

/* 兄弟项让位：被指向的那一个更清楚 */
@media (hover: hover) {
  .nav:has(.nav__item:hover) .nav__item:not(:hover):not(.is-active) { opacity: .66; }
}

/* ---- 二级及以下 ----
   三级树最容易"压实"：行高、字号、行距、缩进都要按层级递进，
   否则子项会挤成一条灰带，读起来要一行行去数。 */
.nav__lvl-1 { height: 34px; font-size: 13px;    gap: 0; padding-left: 10px; margin-bottom: 2px; }
.nav__lvl-2 { height: 32px; font-size: 12.5px;  gap: 0; padding-left: 10px; margin-bottom: 2px; }
.nav__lvl-3 { height: 32px; font-size: 12.5px;  gap: 0; padding-left: 10px; }

/* 折叠容器：左侧一条引线，把子项挂到父项下面；上下都留出呼吸位 */
.nav__sub {
  margin: 3px 0 7px 16px;
  padding-left: 7px;
  border-left: 1px solid var(--line-strong);
}
.nav__sub[hidden] { display: none; }
.nav__sub--1 { margin-left: 22px; }
.nav__sub--2 { margin-left: 28px; }
.nav__item--parent.is-open { margin-bottom: 2px; }

/* 父项：末尾一个小箭头代替"更多"的含义 */
.nav__item--parent { padding-right: 8px; }
.nav__caret {
  flex: 0 0 12px;
  color: var(--ink-faint);
  transition: transform .16s ease, color .16s ease;
}
.nav__item--parent:hover .nav__caret { color: var(--ink-soft); }
.nav__item.is-open > .nav__caret { transform: rotate(90deg); }
.nav__item--parent.is-open { color: var(--ink); }

.nav__count {
  margin-left: auto;
  font-size: 10.5px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  background: var(--press-bg);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0 6px;
  line-height: 16px;
}
.nav__item.is-active .nav__count { background: var(--blue-soft); color: var(--blue); }

/* 侧栏底部身份条：一行胶囊，退出是右侧图标按钮。
   旧版两行堆叠（"超管 xxx" + 带描边的退出按钮），退出比导航项还显眼，重心全在底部。 */
.sidebar__foot {
  flex: none;
  padding: 10px 10px 12px;
  border-top: 1px solid var(--line);
}
.side-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 6px 6px 6px 7px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  transition: background .16s, border-color .16s;
}
.side-user:hover { background: var(--pill-bg); border-color: var(--glass-line-soft); }
.side-user__avatar {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 680;
  line-height: 1;
  color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px rgba(var(--shade), .05);
}
.side-user__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.25;
}
.side-user__name {
  font-size: 12.5px;
  font-weight: 620;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-user__role {
  font-size: 10.5px;
  color: var(--ink-soft);
  letter-spacing: .02em;
  white-space: nowrap;
}
.side-user__out { flex: none; margin: 0 0 0 auto; }
.side-user__btn { width: 26px; height: 26px; color: var(--ink-soft); }
/* .icon-btn svg 是 14px 且写在后头，同权重会被它盖掉 —— 这里加一级选择器 */
.side-user .side-user__btn svg { width: 15px; height: 15px; }
.side-user__btn:hover { color: var(--danger); }

/* ---------- 工作区 ---------- */

.main {
  position: relative;
  display: grid;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 0 18px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
/* 凝结层：内容滚动后出现的玻璃面与投影 */
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background: var(--rail-bg);
  box-shadow: 0 1px 0 var(--line-strong), 0 10px 26px rgba(var(--shade), .07);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: opacity .3s ease;
}
.main.is-scrolled .topbar::before { opacity: 1; }

.topbar__hamburger { display: none; }
.topbar__spacer { flex: 1; }
.topbar__crumb {
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.topbar__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.topbar__clock { letter-spacing: .04em; font-variant-numeric: tabular-nums; }

/* 顶栏小控件（外观切换等） */
.topbar__tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  flex: none;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.topbar__tool:hover {
  color: var(--ink);
  background: var(--pill-bg);
  border-color: var(--glass-line);
  box-shadow: var(--e1);
}
.topbar__tool svg { width: 15px; height: 15px; }
/* 浅色态显示月亮（点了转深色），深色态显示太阳 */
:root:not([data-theme="dark"]) .topbar__tool .ico-sun { display: none; }
:root[data-theme="dark"] .topbar__tool .ico-moon { display: none; }

.chipset { display: flex; align-items: center; gap: 6px; }

/* 内容滚动容器 */
.content {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  overflow-x: clip;
  overscroll-behavior: contain;
}

.main__body {
  padding: 24px 26px 44px;
  max-width: 1520px;
  margin: 0 auto;
  width: 100%;
}

/* ---------- 页头 ---------- */

.main__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 22px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.main__head h1 {
  font-size: 26px;
  margin: 0;
  font-weight: 720;
  letter-spacing: -.025em;
  line-height: 1.16;
  color: var(--ink);
  text-wrap: balance;
}
.sub { color: var(--ink-muted); font-size: 13px; margin: 6px 0 0; max-width: 680px; }

/* ============================================================
   读数卡（每格一张独立卡，不连成一条）
   ============================================================ */

.metrics, .stats, .kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  background: none;
  border: 0;
  overflow: visible;
}
.metrics--3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.metrics--5 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.metric, .stat, .kpi {
  position: relative;
  padding: 15px 18px 14px;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--edge), var(--e1);
}
.metric::before, .stat::before, .kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--blue);
  opacity: .85;
}
.metric--alert::before, .stat--alert::before { background: var(--danger); opacity: 1; }
.metric--warn::before,  .stat--warn::before  { background: var(--warn);   opacity: 1; }

.metric__label, .stat__label, .kpi__label {
  font-size: 11.5px;
  letter-spacing: .01em;
  color: var(--ink-soft);
  font-weight: 540;
  display: flex;
  align-items: center;
  gap: 5px;
}
.metric__label svg, .stat__label svg { width: 12px; height: 12px; opacity: .62; }

.metric__value, .stat__value, .kpi__value {
  font-family: var(--font-mono);
  font-size: clamp(26px, 2.3vw, 32px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1.1;
  margin-top: 10px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.metric__value small, .stat__value small, .kpi__value small {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-left: 4px;
  letter-spacing: 0;
  font-family: var(--font-sans);
}
.metric__foot, .stat__foot, .kpi__foot {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 8px;
  line-height: 1.7;
}
.metric__foot b, .stat__foot b { color: var(--ink-700); font-weight: 620; }
.metric--alert .metric__value, .stat--alert .stat__value { color: var(--danger); }
.metric--warn  .metric__value, .stat--warn  .stat__value { color: var(--warn); }

/* ============================================================
   面板 / 卡片
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--edge), var(--e1);
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  min-height: 50px;
}
/* 标题 + 提示先成一组，右侧按钮才会被推到边上 */
.card__head-main { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; }
.card__head > .btn:last-child,
.card__head > .btn-row:last-child { margin-left: auto; flex: none; }
.card__title { font-size: 14px; font-weight: 640; margin: 0; letter-spacing: -.01em; color: var(--ink); }
.card__hint { font-size: 11.5px; color: var(--ink-soft); }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.card__foot {
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--surface-2);
}

/* 主卡片标记：只在顶部一道 2px 主色，不做整块变色 */
.card--accent { border-top: 2px solid var(--blue); }
.card--warn   { border-top: 2px solid var(--warn); }
.card--ok     { border-top: 2px solid var(--ok); }

/* ---------- 折叠表单面板 ----------
   列表页的主操作不再常驻平铺：点卡片头右侧的按钮就地展开，
   表格不被挤窄，收起时整页只剩列表。 */
.fold {
  overflow: hidden;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--line);
}
.fold[hidden] { display: none; }
.fold.is-animating { transition: height .28s var(--ease-premium); }
.fold__inner { padding: 15px 18px 18px; }
.fold__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}
.fold__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 640;
  color: var(--ink);
  min-width: 0;
}
.fold__title .badge { font-weight: 560; }
.fold__close { flex: none; }
/* 面板里的字段比设置页密一档：这是"顺手加一条"，不是长期表单 */
.fold .form-row { margin-bottom: 12px; }
.fold .hint { margin-top: 5px; }
.fold .btn-row { justify-content: flex-end; margin-top: 4px; }

/* 卡片里的一条窄信息带（最近批次、批量提示等），介于头部和表格之间 */
.card__strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  flex-wrap: wrap;
}
.card__strip-label { font-size: 11.5px; font-weight: 620; color: var(--ink-soft); flex: none; }

/* 套餐 / 接口 / 开通码：独立 tile，不是表格行 */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(264px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 16px 14px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--edge), var(--e1);
  transition: border-color .16s, box-shadow .16s, transform .16s var(--ease-premium);
}
.tile:hover {
  border-color: var(--accent-line);
  box-shadow: var(--edge), var(--e2);
  transform: translateY(-1px);
}
.tile__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.tile__name {
  font-size: 14.5px;
  font-weight: 660;
  letter-spacing: -.015em;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
}
.tile__desc {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 0 2px;
  border-top: 1px solid var(--line);
}
.tile__stat { min-width: 0; }
.tile__stat .k {
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.tile__stat .v {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-800);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
/* 卡片脚：状态一行、按钮一行。
   原来 badge 和三个按钮挤在同一行，240px 的卡里必然折行，删除按钮会孤零零掉到第二行。 */
.tile__foot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: auto;
  padding-top: 2px;
}
.tile__foot > .badge { align-self: flex-start; }
.tile__foot .btn-row { flex-wrap: nowrap; width: 100%; gap: 6px; }
.tile__foot .btn-row > .btn,
.tile__foot .btn-row > form { flex: 1 1 0; min-width: 0; }
.tile__foot .btn-row > form { display: flex; margin: 0; }
.tile__foot .btn-row > form > .btn { width: 100%; }
.tile__foot .btn-row .btn { padding: 0 6px; font-size: 12.5px; }
.tile--mute { opacity: .72; }
.tile--mute:hover { opacity: 1; }

/* 上游接口健康卡 */
.api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.api-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 13px 14px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--groove-bg);
  box-shadow: var(--groove-inset);
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.api-tile:hover {
  border-color: var(--accent-line);
  background: var(--surface);
  box-shadow: var(--edge), var(--e1);
  text-decoration: none;
}
.api-tile__name {
  font-size: 13px;
  font-weight: 620;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.api-tile__meta { font-size: 11.5px; color: var(--ink-soft); }

/* 步骤说明卡 */
.howto { display: flex; flex-direction: column; gap: 0; }
/* 整宽卡片里分两列，避免一口气读 1100px 的长行 */
.howto--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.howto--grid .howto__row { border-bottom: 1px solid var(--line); }
.howto--grid .howto__row:nth-last-child(-n+2) { border-bottom: 0; }
.howto__row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.65;
}
.howto__row:last-child { border-bottom: 0; }
.howto__n {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--plate-bg);
  color: var(--plate-ink);
  font-size: 11px;
  font-family: var(--font-mono);
  display: grid; place-items: center;
  margin-top: 1px;
}

.meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

/* ============================================================
   表格：密、平、无斑马纹、无竖线
   ============================================================ */

/* 横向滚动提示：内容溢出时右缘浮一道影，滚到头就收起
   （白色遮罩走 local 跟着内容走，阴影走 scroll 钉在容器上） */
.table-wrap {
  overflow-x: auto;
  overflow-y: clip;
  background:
    linear-gradient(to right, var(--surface) 40%, rgba(255, 255, 255, 0)) left center,
    linear-gradient(to left, var(--surface) 40%, rgba(255, 255, 255, 0)) right center,
    radial-gradient(farthest-side at 0 50%, rgba(var(--shade), .1), transparent) left center,
    radial-gradient(farthest-side at 100% 50%, rgba(var(--shade), .1), transparent) right center;
  background-repeat: no-repeat;
  background-size: 40px 100%, 40px 100%, 16px 100%, 16px 100%;
  background-attachment: local, local, scroll, scroll;
}

table.tb {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.tb th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 38px;
  padding: 0 var(--cell-px);
  text-align: left;
  font-weight: 620;
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--ink-soft);
  background: var(--surface-solid);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tb td {
  height: var(--row-h);
  padding: 0 var(--cell-px);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--ink-800);
}
.tb tbody tr { transition: background .15s ease; }
.tb tbody tr:hover { background: var(--hover-bg); }
.tb tbody tr:last-child td { border-bottom: 0; }
.tb .num { font-family: var(--font-mono); font-size: 12.5px; }
.tb .nowrap { white-space: nowrap; }
.tb .right { text-align: right; }
.tb .mono { font-family: var(--font-mono); font-size: 12px; }
.tb td.tight, .tb th.tight { padding-left: 8px; padding-right: 8px; }

/* 单元格里"标签 + 说明"排一行，避免一个格子堆三层把整行撑高 */
.row-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* 名称格：序号牌 + 名称必须在一行，窄屏时让名称截断，不许把序号挤到上一行 */
.tb .cell-name { flex-wrap: nowrap; }
.tb .cell-name .cell-text { min-width: 0; }
/* 地址格同理：鉴权标记要贴着 URL，挤不下就让 URL 截断，别掉到下一行去 */
.tb .cell-addr { flex-wrap: nowrap; }
.tb .cell-addr .cell-text { min-width: 0; }

/* 长文本列：一行截断，把横向空间留给操作列 */
.tb .cell-text {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 地址这种长串给它更宽的额度，但仍要截断 —— 不让 URL 把表格撑出横向滚动 */
.tb .cell-text--lg { max-width: 400px; }

/* 优先级：当成行首的小序号牌，而不是单开一列只放一个数字 */
.prio {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--press-bg);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
}

/* 调用次数后面那个「上次失败」提示：只留一个 i，全文放 title，不再单独占一行红字 */
.tb .err-i {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  color: var(--danger);
  opacity: .8;
  vertical-align: -1px;
  cursor: help;
}
.tb .err-i:hover { opacity: 1; }
.tb .err-i svg { width: 12px; height: 12px; }

/* 操作列：按钮之间留缝，文字按钮给足点击高度（原来只有 18px 高，点不准） */
.tb td form { display: inline-block; margin: 0; vertical-align: middle; }
.tb td .btn + .btn,
.tb td .btn + form,
.tb td form + .btn,
.tb td form + form { margin-left: 5px; }
.tb td .btn--link { height: 28px; padding: 0 7px; }
.tb td .btn--sm.btn--link { font-size: 12.5px; }

/* 行状态：行首 2px 色条 */
.tb tr.row--danger td:first-child { box-shadow: inset 2px 0 0 var(--danger); }
.tb tr.row--warn   td:first-child { box-shadow: inset 2px 0 0 var(--warn); }
.tb tr.row--ok     td:first-child { box-shadow: inset 2px 0 0 var(--ok); }
.tb tr.is-selected { background: var(--blue-soft); }

input[type="checkbox"] {
  accent-color: var(--blue);
  width: 14px;
  height: 14px;
  cursor: pointer;
  vertical-align: middle;
  margin: 0;
}
.tb td form { display: inline; }
.tb tbody tr[data-href] { cursor: pointer; }

.empty { padding: 46px 20px; text-align: center; color: var(--ink-soft); font-size: 13px; }
.empty__icon {
  width: 44px; height: 44px; margin: 0 auto 12px;
  border-radius: var(--r);
  background: var(--groove-bg);
  border: 1px dashed var(--line-strong);
  display: grid; place-items: center;
  color: var(--ink-faint);
}
.empty__title { color: var(--ink-muted); font-weight: 620; margin-bottom: 4px; }

/* ============================================================
   标签：胶囊 + 色点
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--press-bg);
  color: var(--ink-muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.badge--ok     { background: var(--ok-soft);     color: var(--ok); }
.badge--warn   { background: var(--warn-soft);   color: var(--warn); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--info   { background: var(--info-soft);   color: var(--info); }
.badge--mute   { color: var(--ink-soft); }

.dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: currentColor;
  display: inline-block;
  flex: none;
}
.badge--ok .dot     { background: var(--lime); box-shadow: 0 0 0 3px var(--ok-soft); }
.badge--danger .dot { box-shadow: 0 0 0 3px var(--danger-soft); }
.badge--warn .dot   { box-shadow: 0 0 0 3px var(--warn-soft); }

/* 状态点 + 文字，用于"服务状态"这类只读展示 */
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.state__dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--ink-300);
  box-shadow: 0 0 0 3px var(--press-bg);
}
.state--ok .state__dot     { background: var(--lime);    box-shadow: 0 0 0 3px var(--ok-soft); }
.state--warn .state__dot   { background: var(--warn);    box-shadow: 0 0 0 3px var(--warn-soft); }
.state--danger .state__dot { background: var(--danger);  box-shadow: 0 0 0 3px var(--danger-soft); }

/* ============================================================
   按钮
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control-h);
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 560;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  box-shadow: var(--edge);
  transition: background .18s ease, border-color .18s ease, color .18s ease,
              box-shadow .18s ease, transform .06s ease;
}
.btn:hover {
  background: var(--surface-2);
  border-color: rgba(var(--shade), .2);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--e2), var(--edge-strong), var(--pill-inset);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 14px; height: 14px; }

/* 主操作：全站唯一的实色蓝按钮 */
.btn--primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 620;
  box-shadow: var(--e-accent);
}
.btn--primary:hover {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
  color: #fff;
  box-shadow: var(--e-accent-hover);
}
.btn--primary svg { opacity: .92; }

.btn--accent { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 620; box-shadow: var(--e-accent); }
.btn--accent:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }

.btn--danger { color: var(--danger); border-color: var(--danger-line); background: var(--surface); }
.btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

.btn--sm { height: var(--control-h-sm); padding: 0 10px; font-size: 12px; border-radius: var(--r-xs); }
.btn--sm svg { width: 13px; height: 13px; }
.btn--lg { height: 40px; padding: 0 20px; font-size: 13.5px; border-radius: var(--r); }
.btn--block { width: 100%; }
.btn--link {
  border: 0; background: none; color: var(--blue);
  padding: 0 4px; height: auto; box-shadow: none;
}
.btn--link:hover { background: none; color: var(--blue-hover); text-decoration: underline; box-shadow: none; }
/* 表格里的删除：平时跟其他次要动作一样安静，悬停才转红 —— 一行三个按钮时，红色描边会把整行拽过去 */
.btn--link.btn--link-danger { color: var(--ink-soft); }
.btn--link.btn--link-danger:hover { color: var(--danger); }

.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }
.btn.is-loading { position: relative; }
.btn.is-loading::after {
  content: "";
  width: 12px; height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* 图标按钮（复制、关闭） */
.icon-btn {
  width: 28px; height: 28px;
  display: inline-grid; place-items: center;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s;
}
.icon-btn:hover { background: var(--pill-bg); border-color: var(--glass-line); color: var(--ink); box-shadow: var(--e1); }
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn.is-done { color: var(--ok); }

/* 分段控件（筛选切换）：凹槽底座 + 白色滑块 */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--glass-line-soft);
  border-radius: var(--r);
  background: var(--groove-bg);
  box-shadow: var(--groove-inset);
}
.seg a {
  padding: 0 12px;
  height: 28px;
  display: inline-flex; align-items: center;
  font-size: 12.5px;
  font-weight: 540;
  color: var(--ink-muted);
  border-radius: var(--r-xs);
  border-left: 0;
  transition: background .18s, color .18s, box-shadow .18s;
}
.seg a:hover { color: var(--ink); background: var(--hover-bg); text-decoration: none; box-shadow: none; }
.seg a.is-active {
  background: var(--pill-bg);
  color: var(--ink);
  font-weight: 640;
  border-color: transparent;
  box-shadow: var(--e1), var(--edge-strong), var(--pill-inset);
}

/* 页内标签：带 id 的详情页用它分页 */
.pagetabs {
  display: flex;
  gap: 2px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.pagetabs a {
  position: relative;
  padding: 8px 14px 10px;
  font-size: 13.5px;
  font-weight: 560;
  color: var(--ink-muted);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  white-space: nowrap;
  transition: color .16s, background .16s;
}
.pagetabs a:hover { background: var(--hover-bg); color: var(--ink); text-decoration: none; }
.pagetabs a.is-active { color: var(--ink); font-weight: 660; }
.pagetabs a.is-active::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--blue);
}

/* ============================================================
   表单
   ============================================================ */

.form-row { margin-bottom: 14px; }
.form-row--inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

label.lb {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 6px;
  font-weight: 560;
}
label.lb .req { color: var(--danger); margin-left: 2px; }
.hint { font-size: 11.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.6; }
.hint code {
  background: var(--groove-bg);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
}

.inp, select.inp, textarea.inp {
  width: 100%;
  height: var(--control-h);
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--input-bg);
  color: var(--ink-800);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  box-shadow: var(--edge);
  transition: border-color .18s ease, background .18s ease;
}
.inp:hover { border-color: rgba(var(--shade), .2); }
.inp:focus, .inp:focus-visible {
  border-color: transparent;
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  background: var(--surface);
}
textarea.inp {
  height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.6;
  resize: vertical;
  font-family: var(--font-mono); font-size: 12.5px;
}
.inp::placeholder { color: var(--ink-faint); }
.inp--sm { height: var(--control-h-sm); font-size: 12.5px; }
.inp.mono, .mono { font-family: var(--font-mono); letter-spacing: .01em; }
select.inp {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236d777b' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
:root[data-theme="dark"] select.inp {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%239aa4a6' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch__ui {
  width: 36px; height: 21px; border-radius: 999px;
  background: var(--groove-bg);
  border: 1px solid var(--glass-line-soft);
  box-shadow: var(--groove-inset);
  position: relative;
  transition: background .18s ease, border-color .18s ease;
  flex: 0 0 36px;
}
.switch__ui::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  transition: transform .18s var(--ease-premium);
}
.switch input:checked + .switch__ui { background: var(--blue); border-color: transparent; }
.switch input:checked + .switch__ui::after { transform: translateX(15px); }

.kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 5px;
  color: var(--ink-soft);
  background: var(--surface);
}

/* ============================================================
   提示 / 反馈
   ============================================================ */

.flashes {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 22px;
  z-index: 90;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 380px;
  pointer-events: none;
}
.flash {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  border-radius: var(--r);
  font-size: 13px;
  border: 1px solid var(--glass-line);
  background: var(--float-bg);
  color: var(--ink-800);
  box-shadow: var(--e3), var(--float-inset);
  backdrop-filter: blur(28px) saturate(1.08);
  -webkit-backdrop-filter: blur(28px) saturate(1.08);
  pointer-events: auto;
  animation: toast-in .24s var(--ease-premium);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.flash.is-out { animation: toast-out .18s ease forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateY(-4px); } }
.flash--ok     { border-color: var(--ok-line);     background: var(--ok-soft);     color: var(--ok); }
.flash--error  { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }
.flash--info   { border-color: var(--info-line);   background: var(--info-soft);   color: var(--info); }
.flash svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 2px; }
.flash__x { margin-left: auto; }

/* 确认弹层 */
.modal::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
.modal {
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  padding: 0;
  width: min(430px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--ink-800);
  box-shadow: var(--e3);
}
.modal__body { padding: 20px 22px 6px; }
.modal__title { font-size: 15px; font-weight: 660; margin: 0 0 8px; color: var(--ink); letter-spacing: -.01em; }
.modal__text { font-size: 13px; color: var(--ink-muted); line-height: 1.65; margin: 0 0 8px; }
.modal__foot { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; }

/* ============================================================
   筛选条 / 工具栏
   ============================================================ */

.filters, .toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.filters .inp, .toolbar .inp { width: auto; height: var(--control-h-sm); font-size: 12.5px; }
.filters .grow, .toolbar .grow { flex: 1; min-width: 170px; }
.filters__spacer, .toolbar__spacer { flex: 1; }
.toolbar__count {
  font-size: 11.5px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 批量操作条：选中行时才出现，深色铭牌 */
.bulkbar {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  background: var(--plate-bg);
  color: var(--plate-soft);
  border-bottom: 1px solid var(--plate-line);
  font-size: 12.5px;
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.bulkbar b { color: var(--plate-ink); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.bulkbar[hidden] { display: none; }
.bulkbar .btn {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .16);
  color: #ecf1ef;
  box-shadow: none;
}
.bulkbar .btn:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.bulkbar .btn--danger { color: #ffb4ad; border-color: rgba(255, 120, 110, .4); }
.bulkbar .btn--danger:hover { background: rgba(217, 58, 48, .34); color: #fff; }

/* ============================================================
   分页
   ============================================================ */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
  flex-wrap: wrap;
  background: var(--surface-2);
}
.pager__links { display: flex; gap: 4px; align-items: center; }
.pager__links a, .pager__links span {
  min-width: 30px; height: 30px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  color: var(--ink-muted);
  background: var(--surface);
  font-size: 12px;
  font-family: var(--font-mono);
  transition: background .16s, border-color .16s, color .16s, box-shadow .16s;
}
.pager__links a:hover {
  background: var(--pill-bg);
  border-color: var(--glass-line);
  color: var(--ink);
  box-shadow: var(--e1);
  text-decoration: none;
}
.pager__links .is-current {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 620;
  box-shadow: var(--e-accent);
}
.pager__links .is-disabled { color: var(--ink-faint); background: var(--groove-bg); }

/* ============================================================
   图表：实色 + 基线网格，不要渐变
   ============================================================ */

.chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 158px;
  padding: 0 2px;
  position: relative;
}
.chart::before {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 22px;
  border-top: 1px solid var(--line);
}
.chart__col {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; height: 100%; justify-content: flex-end;
  position: relative;
}
.chart__bar {
  width: 100%;
  max-width: 32px;
  border-radius: 4px 4px 0 0;
  background: #bfd5f7;
  min-height: 2px;
  transition: height .4s var(--ease-premium), background .16s;
}
.chart__col:hover .chart__bar { background: var(--blue); }
.chart__bar--zero { background: var(--hatch); }
.chart__x { font-size: 10.5px; color: var(--ink-faint); font-family: var(--font-mono); }
.chart__v { font-size: 11px; color: var(--ink-soft); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.chart__legend {
  display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-soft);
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
}
.chart__legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }

/* 基线网格：每 44px 一条，读数有刻度感 */
.chart--grid {
  background-image: repeating-linear-gradient(
    to top,
    var(--line) 0 1px,
    transparent 1px 44px
  );
  background-position: 0 22px;
}
.chart__bar--today { background: var(--blue); }
.chart__col:hover .chart__bar--today { background: var(--blue-hover); }
/* 深色下浅蓝柱会跳出来，压到中明度 */
:root[data-theme="dark"] .chart__bar { background: rgba(76, 141, 255, .34); }
:root[data-theme="dark"] .chart__col:hover .chart__bar { background: var(--blue); }
:root[data-theme="dark"] .chart__bar--today { background: var(--blue); }

/* 上线检查清单 */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  border-radius: var(--r-xs);
  transition: background .16s;
}
.check-row:last-child { border-bottom: 0; }
.check-row:hover { background: var(--hover-bg); text-decoration: none; }
.check-row__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.check-row__text b { font-size: 12.5px; font-weight: 600; color: var(--ink-800); }
.check-row__text span {
  font-size: 11.5px; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.check-row__go { color: var(--ink-faint); transform: rotate(180deg); display: inline-flex; }
.check-row:hover .check-row__go { color: var(--blue); }

/* ============================================================
   进度 / 额度
   ============================================================ */

.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--groove-bg);
  box-shadow: var(--groove-inset);
  overflow: hidden;
}
.meter__bar {
  height: 100%; border-radius: 999px;
  background: var(--blue);
  transition: width .5s var(--ease-premium);
  min-width: 2px;
}
.meter__bar--warn   { background: #c9922a; }
.meter__bar--danger { background: var(--danger); }

/* ============================================================
   用户 / 键值 / 杂项
   ============================================================ */

.avatar {
  width: 30px; height: 30px; border-radius: 999px;
  background: var(--groove-bg);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 12px; color: var(--ink-soft);
  overflow: hidden; flex: 0 0 30px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-hero { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.user-hero__avatar.avatar { width: 54px; height: 54px; flex: 0 0 54px; font-size: 18px; }
.user-hero__main { flex: 1; min-width: 220px; }
.user-hero__name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-hero__name h2 { margin: 0; font-size: 18px; font-weight: 680; letter-spacing: -.02em; }
.user-hero__nums { display: flex; gap: 24px; flex-wrap: wrap; }
.user-hero__num .v {
  font-size: 22px;
  font-weight: 520;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  letter-spacing: -.04em;
  margin-top: 2px;
  color: var(--ink);
}
.user-hero__meta { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

.user-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.user-cell__name {
  font-weight: 560; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 168px;
}
.user-cell__id { font-size: 10.5px; color: var(--ink-faint); font-family: var(--font-mono); }

.points { font-family: var(--font-mono); font-weight: 620; }
.points--low { color: var(--danger); }
.delta-pos { color: var(--ok); font-weight: 600; font-family: var(--font-mono); }
.delta-neg { color: var(--danger); font-weight: 600; font-family: var(--font-mono); }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 18px; }
.kv__item { min-width: 0; }
.kv__k { font-size: 11px; letter-spacing: .04em; color: var(--ink-soft); }
.kv__v { font-size: 13.5px; font-weight: 560; word-break: break-all; margin-top: 3px; color: var(--ink-800); }

.sec-title { font-size: 11px; letter-spacing: .06em; color: var(--ink-soft); margin: 0 0 9px; font-weight: 600; }

.code-text { font-size: 12.5px; letter-spacing: .05em; font-weight: 600; }
.copyable { display: inline-flex; align-items: center; gap: 4px; }

.note {
  background: var(--groove-bg);
  border: 1px solid var(--line);
  border-left: 2px solid var(--blue);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 11px 13px;
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.65;
}
.note b { color: var(--ink); font-weight: 620; }
.note code {
  font-family: var(--font-mono); font-size: 11.5px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 4px; padding: 0 4px;
}
.note--warn   { border-left-color: var(--warn); }
.note--danger { border-left-color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.note--ok     { border-left-color: var(--ok); }

.muted { color: var(--ink-soft); }
.small { font-size: 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ============================================================
   详情页
   ============================================================ */

.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
/* 栅格子项默认 min-width:auto，表格里的 nowrap 会把整列撑爆 —— 必须显式压回 0 */
.two-col > * { min-width: 0; }
.stack-actions { display: flex; flex-direction: column; gap: 8px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form .inp { width: auto; }
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.stat-pair { display: flex; gap: 16px; }
.stat-pair > div { min-width: 0; }
.stat-pair .k { font-size: 10.5px; color: var(--ink-soft); }
.stat-pair .v { font-size: 13px; font-weight: 620; font-family: var(--font-mono); }

/* 保存条：表单末尾唯一提交区 */
.savebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding: 13px 18px;
  background: var(--surface);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  box-shadow: var(--e2), var(--edge);
  flex-wrap: wrap;
}

/* ============================================================
   登录：左侧深色画布 + 右侧玻璃卡
   ============================================================ */

.login-shell {
  min-height: 100dvh;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(340px, 38%) 1fr;
  background: var(--stage);
}
.login-aside {
  position: relative;
  overflow: hidden;
  background: var(--frame);
  color: #b9c3c0;
  padding: 34px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}
/* 画布上两团漫射光 + 一层网格 */
.login-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 15% 0%, rgba(130, 221, 45, .12), transparent 68%),
    radial-gradient(55% 45% at 100% 90%, rgba(76, 141, 255, .16), transparent 70%);
}
.login-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .35;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(80% 70% at 30% 20%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(80% 70% at 30% 20%, #000 20%, transparent 78%);
}
.login-aside > * { position: relative; z-index: 1; }
.login-aside .brand { border: 0; padding: 0; height: auto; }
.login-aside .brand__mark { background: #fff; }
.login-aside .brand__mark::before { background: var(--frame); }
.login-aside .brand__mark::after { box-shadow: 0 0 0 2px var(--frame), 0 0 12px rgba(130, 221, 45, .6); }
.login-aside .brand__name { color: #fff; }
.login-aside .brand__sub { color: rgba(255, 255, 255, .42); }

.login-aside__body h2 {
  font-size: 25px;
  line-height: 1.42;
  font-weight: 660;
  color: #fff;
  letter-spacing: -.03em;
  margin: 0 0 24px;
}
.login-points { list-style: none; margin: 0; padding: 0; }
.login-points li {
  position: relative;
  padding: 0 0 15px 18px;
  font-size: 12.5px;
  line-height: 1.75;
  color: rgba(255, 255, 255, .5);
}
.login-points li::before {
  content: "";
  position: absolute; left: 0; top: 8px;
  width: 6px; height: 6px;
  border-radius: 2px;
  background: var(--lime);
}
.login-points b { display: block; color: rgba(255, 255, 255, .92); font-weight: 620; font-size: 13px; }
.login-aside__foot {
  font-size: 11px;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .34);
  text-transform: uppercase;
}

.login-main {
  display: grid;
  place-items: center;
  padding: 32px;
  position: relative;
  overflow-y: auto;
  background:
    radial-gradient(60% 50% at 100% 0%, var(--ambient-b), transparent 68%),
    radial-gradient(50% 45% at 0% 100%, var(--ambient-a), transparent 70%),
    var(--canvas);
}
.login-card {
  width: 100%;
  max-width: 372px;
  background: var(--surface);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-xl);
  box-shadow: var(--e3), var(--edge-strong);
  padding: 28px 28px 22px;
}
.login-card h1 { font-size: 21px; margin: 0 0 4px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.login-card .sub { margin-bottom: 22px; font-size: 12.5px; }
.login-card .btn { margin-top: 8px; }
.login-foot {
  text-align: center; font-size: 11px; color: var(--ink-faint);
  margin-top: 18px; padding-top: 15px;
  border-top: 1px solid var(--line);
  line-height: 1.9;
}
.login-card .flashes { position: static; max-width: none; margin-bottom: 14px; }

/* 「选商户」：账号密码在好几家都对时，把商户列成按钮点选，不再让用户填标识 */
.pick { display: flex; flex-direction: column; gap: 8px; }
.pick form { margin: 0; }
.pick__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--edge), var(--e1);
  transition: border-color .16s, box-shadow .16s, transform .16s var(--ease-premium);
}
.pick__item:hover {
  border-color: var(--accent-line);
  box-shadow: var(--edge), var(--e2);
  transform: translateY(-1px);
}
.pick__name {
  font-size: 13.5px;
  font-weight: 640;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick__code { flex: none; font-size: 11.5px; color: var(--ink-soft); }
.pick__go { margin-left: auto; color: var(--ink-400); font-size: 16px; line-height: 1; }

/* 商户入口：字段多，卡片放宽；矮屏时卡片内部滚动 */
.login-card--tall {
  max-width: 420px;
  max-height: calc(100dvh - 56px);
  overflow-y: auto;
}
.sep-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--ink-soft);
  margin: 18px 0 12px;
}
.sep-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; height: auto; min-height: 100dvh; }
  .login-aside { display: none; }
  .login-main { padding: 20px; }
}

/* ============================================================
   平台主题：同一套骨架，品牌标记换琥珀
   ============================================================ */

.theme-platform .brand__mark {
  background: linear-gradient(150deg, #d99a2b, #a25a08);
  box-shadow: 0 1px 3px rgba(90, 50, 0, .2), 0 6px 16px rgba(90, 50, 0, .18),
              inset 0 1px 0 rgba(255, 255, 255, .22);
}
.theme-platform .brand__mark::before { background: #fff; }
.theme-platform .brand__mark::after {
  background: #ffd37a;
  box-shadow: 0 0 0 2px var(--rail-bg), 0 0 10px rgba(217, 154, 43, .6);
}
.theme-platform .nav-thumb {
  background: linear-gradient(145deg, rgba(255, 253, 248, .95), rgba(253, 244, 228, .72));
}
.theme-platform .nav__item.is-active svg { color: #b8791a; }
.theme-platform .nav__item.is-active .nav__count { background: rgba(217, 154, 43, .14); color: #96600a; }
/* 页内标签的下划线保持蓝 —— 它表示"当前在哪一页"，属于选择语义，不随品牌色走 */
.theme-platform .topbar__meta .plat-chip {
  background: rgba(217, 154, 43, .14);
  color: #8a5a06;
  border: 1px solid rgba(217, 154, 43, .3);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10.5px;
  letter-spacing: .08em;
}
/* 平台端的主操作仍是蓝 —— 只有品牌标记和导航强调换色，
   避免同一个按钮在两端含义不同 */
.theme-platform .side-user__avatar { color: #96600a; background: rgba(217, 154, 43, .16); }
:root[data-theme="dark"] .theme-platform .side-user__avatar { color: #e8b563; background: rgba(217, 154, 43, .18); }
:root[data-theme="dark"] .theme-platform .nav-thumb {
  background: linear-gradient(145deg, rgba(255, 255, 255, .12), rgba(217, 154, 43, .1));
}

/* ============================================================
   一键安装向导
   ============================================================ */

.install-body {
  background: var(--stage);
  overflow-y: auto;
  height: auto;
  min-height: 100%;
}

.install-top {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 22px;
  background: var(--frame);
  color: rgba(255, 255, 255, .55);
}
.install-top .brand { border: 0; padding: 0; height: auto; }
.install-top .brand__mark { background: #fff; }
.install-top .brand__mark::before { background: var(--frame); }
.install-top .brand__mark::after { box-shadow: 0 0 0 2px var(--frame), 0 0 12px rgba(130, 221, 45, .6); }
.install-top .brand__name { color: #fff; }
.install-top .brand__sub { color: rgba(255, 255, 255, .4); }
.install-top__meta { display: flex; align-items: center; gap: 10px; }
.install-top__meta .btn {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .16);
  color: #ecf1ef;
  box-shadow: none;
}
.install-top__meta .btn:hover { background: rgba(255, 255, 255, .2); color: #fff; }

.install-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 22px 56px;
}

.install-intro { margin: 4px 0 18px; }
.install-intro h1 { font-size: 24px; font-weight: 700; letter-spacing: -.03em; margin: 0 0 6px; color: var(--ink); }
.install-intro p { margin: 0; color: var(--ink-muted); font-size: 13px; }

.env-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 18px; }
.env-item { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; }
.env-item__text { display: flex; flex-direction: column; min-width: 0; }
.env-item__text b { font-size: 12.5px; font-weight: 580; }
.env-item__text span { font-size: 11.5px; color: var(--ink-soft); }

.install-steps { display: flex; flex-direction: column; gap: 2px; }
.install-step {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.install-step:last-child { border-bottom: 0; }
.install-step .state { margin-top: 6px; }

.install-cred {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px 18px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.install-cred .kv__v { display: flex; align-items: center; gap: 4px; }

.install-foot { text-align: center; font-size: 11.5px; color: var(--ink-faint); margin: 24px 0 0; }
.install-foot code {
  font-family: var(--font-mono);
  background: var(--groove-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1240px) {
  .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .topbar__meta { gap: 10px; }
}

@media (max-width: 900px) {
  .stage { padding: 0; }
  .shell {
    border: 0;
    border-radius: 0;
    grid-template-columns: minmax(0, 1fr);
    box-shadow: none;
  }

  /* 侧栏变抽屉 */
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    z-index: 110;
    border-right: 1px solid var(--line-strong);
    box-shadow: var(--e3);
    transform: translateX(-100%);
    transition: transform .34s var(--ease-premium);
  }
  body.drawer-open .sidebar { transform: none; }
  .scrim {
    position: fixed; inset: 0;
    background: var(--overlay);
    z-index: 105;
    animation: fade-in .18s ease;
    backdrop-filter: blur(2px);
  }
  @keyframes fade-in { from { opacity: 0; } }

  .topbar__hamburger {
    display: inline-grid;
    place-items: center;
    width: 32px; height: 32px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink-muted);
    cursor: pointer;
    margin-left: -6px;
  }
  .topbar { padding: 0 14px; }
  .topbar__meta { display: none; }
  .main__body { padding: 18px 15px 40px; }
  .main__head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .main__head h1 { font-size: 22px; }
  .main__head .btn-row { width: 100%; }
  .main__head .btn-row .btn { flex: 1 1 auto; }

  /* 表格首列吸附，横向滚动时主列不丢 */
  .tb td { white-space: nowrap; }
  .tb td:first-child, .tb th:first-child {
    position: sticky; left: 0;
    z-index: 2;
    min-width: 128px;
  }
  .tb th:first-child { background: var(--surface-solid); }
  .tb tbody td:first-child { background: var(--surface); }
  .tb tbody tr:hover td:first-child { background: #f4f7f6; }
  :root[data-theme="dark"] .tb tbody tr:hover td:first-child { background: #232a2c; }
  .tb tr.is-selected td:first-child { background: var(--blue-soft); }
  .tb td.tight, .tb th.tight { min-width: 0; }

  .btn { height: 38px; }
  .btn--sm { height: 32px; }
  .inp, select.inp { height: 40px; }
  .inp--sm { height: 34px; }
  .filters .inp, .toolbar .inp { height: 36px; width: 100%; }
  .filters .grow, .toolbar .grow { flex: 1 1 100%; }
  .filters .btn, .toolbar .btn { flex: 1; }
  .form-grid, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .card__head { flex-wrap: wrap; padding: 10px 16px; min-height: 0; }
}

@media (max-width: 620px) {
  .metrics, .metrics--3, .metrics--5, .stats, .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile-grid { grid-template-columns: 1fr; }
  .metric, .stat, .kpi { padding: 13px 14px; }
  .metric__value, .stat__value, .kpi__value { font-size: 22px; }
  .flashes { left: 12px; right: 12px; top: calc(var(--topbar-h) + 8px); max-width: none; }
  .pager { justify-content: center; }
  .pager__links { flex-wrap: wrap; justify-content: center; }
  .modal { width: calc(100vw - 28px); }
  .install-top { padding: 0 14px; height: 54px; }
  .install-wrap { padding: 18px 15px 48px; }
  .form-grid-3 { grid-template-columns: 1fr; }
}

/* 触屏与低配设备：关掉玻璃，回到实色 */
@media (prefers-reduced-transparency: reduce) {
  .sidebar, .topbar::before, .flash, .bulkbar { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .sidebar { background: var(--surface); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  body { overflow: visible; height: auto; }
  .stage { padding: 0; height: auto; }
  .shell { border: 0; border-radius: 0; box-shadow: none; height: auto; display: block; }
  .sidebar, .topbar, .flashes { display: none !important; }
  .content { overflow: visible; }
  .main { display: block; }
  .main__body { padding: 0; }
  .card { break-inside: avoid; box-shadow: none; }
}
