/* Jet Hub 控制台样式：独立站点，不复用 magpie 的 --magpie-* 变量。
 *
 * 设计语言对齐上游 dsh-providers-hub 的控制台（vendor/lib/client/jet-hub.js 的 `dim-jh-*` 样式）：
 * 品牌蓝 #1677ff、卡片 14px 圆角、#eef0f3 淡边框、#e5e5e5 分隔线、系统无衬线 14px。
 *
 * ⚠️ 关于深色：上游**文件里没有** prefers-color-scheme（那是 DSH 宿主给的），
 * 它的颜色全走 `var(--dsw-alias-*, 亮色兜底)` 宿主 token（单 `--dsw-alias-label-tertiary`
 * 就用了 66 次），深色由 DSH 宿主换成另一套值 —— 所以「上游只有亮色」在文件层面成立，
 * 但上游 UI 在 DSH 里其实是自适应的。
 * 本页是独立站点，拿不到宿主的 token ⇒ 深色版必须在这里自己补（跟随系统），
 * 层级与亮色一一对应。
 */
:root {
  /* 让原生控件（select 下拉、滚动条、文件选择器）也跟着深浅色走。
     不加的话深色模式下这些还是亮色 UA，白得扎眼。 */
  color-scheme: light dark;

  /* 品牌 */
  --brand: #1677ff;
  --brand-deep: #0f5fce;
  /* 品牌色**当文字**时要更深一档：`#1677ff` 对白底只有 4.10:1（13.5px 要 4.5）。
     深色模式反过来要更亮（见下面的覆盖）。 */
  --brand-ink: #0f5fce;

  /* 文字三档 + 更浅的一档（次要说明） */
  --fg: #1f2329;
  --fg2: #646a73;
  --fg2b: #5f6672;
  /* 上游原值是 #8f959e，对白底只有 3.02:1（刚过 WCAG 3:1 的非正文底线）。
     这里压到 #7c838e（3.82:1）——观感几乎不变，但小字能看清了。
     想彻底过 AA 4.5 得压到 #6b7280（4.8:1），但那样就和 --fg2 的 #646a73
     几乎没层次了，故止步于 3.8。 */
  --fg3: #7c838e;
  --fg4: #9aa0a6;

  /* 边框四档 */
  --line: #e5e5e5;
  --line2: #eef0f3;
  --line3: #dfe1e5;
  --line4: #d0d3d9;

  /* 背景 */
  --bg: #ffffff;
  --sunk: #f7f8fa;

  /* 语义色 */
  --green: #15803d;
  --green-bg: rgb(34 197 94 / 12%);
  /* 橙色**文字**专用。上游那档 `#e37400` 对白底只有 3.10:1，11–12px 小字过不了
     AA 4.5，所以只留这一档更深的值（#92400e = 7.09:1）。
     ⚠️ 别再补一个 `--orange` 当底色/边框：标签底色是写死的 `rgb(180 83 9 / 12%)`，
     那个变量会变成零引用的死代码（2026-11-05 三审抓过一次）。 */
  --orange-ink: #92400e;
  --red: #d93025;

  /* 阴影 */
  --shadow: 0 2px 8px rgb(31 35 41 / 3%);
  --shadow-hover: 0 5px 16px rgb(31 35 41 / 5%);

  --code: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  --font: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e8eaed;
    --fg2: #a9b0ba;
    --fg2b: #b8bec7;
    --fg3: #8b929c;
    --fg4: #737a84;

    --line: #2c2f36;
    --line2: #262930;
    --line3: #34383f;
    --line4: #3d424a;

    --bg: #17181c;
    --sunk: #1d1f24;

    --green: #4ade80;
    --green-bg: rgb(74 222 128 / 14%);
    /* 深色下 #fbbf24 对 #17181c 是 10.63:1，对标签底（14% 叠深底 = #372f1d）是 7.93:1。 */
    --orange-ink: #fbbf24;
    --red: #f87171;

    --shadow: 0 2px 8px rgb(0 0 0 / 24%);
    --shadow-hover: 0 5px 16px rgb(0 0 0 / 34%);
    /* 深色下品牌色得往亮里走：`#1677ff` 对 #17181c 只有 4.32:1，
       `#0f5fce` 更差（3.02:1）。`#6ba4ff` 是 7.13:1。 */
    --brand-ink: #6ba4ff;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
.boot { padding: 40px; color: var(--fg3); }

/* ⚠️ 通用 [hidden] 兜底（必须有）。
   UA 的 `[hidden] { display: none }` 是**元素选择器级**的普通声明，作者样式里
   任何 `display` 都能盖掉它 —— 本文件 `button, .btn { display: inline-block }`
   就盖掉了，于是 `#accAnon` / `#accProxy` 即便带 `hidden` 属性照样常驻可见。
   后果不只是「多两个按钮」：`addAnonymousChannel()` 无条件发
   `opencode.addAnonymous`，在 gemini 渠道下点「加匿名通道」会**静默建错渠道的账号**。
   下面 `.page[hidden]` / `.modal[hidden]` 两条本来是各自补的，有这条就能统一兜住（保留不冲突）。 */
[hidden] { display: none !important; }

/* ══════════ 页面骨架：顶栏 + 左栏 + 主区 ══════════ */
.page { display: flex; flex-direction: column; height: 100%; }
/* .page 自己设了 display:flex，会盖掉 [hidden] 的 UA 样式，这里补回来 */
.page[hidden] { display: none; }

.header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
.headerActions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.layout { display: flex; flex: 1; overflow: hidden; }

/* ── 左栏 ── */
/* 上下两段：上面是可滚动的供应商列表，下面是固定的三个切页按钮。 */
.rail {
  width: 228px;
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 6px;
  padding: 6px;
  border-right: 1px solid var(--line);
}
.railScroll {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding-bottom: 2px;
}
.railGroupTitle {
  padding: 2px 4px 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: var(--fg3);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 10px;
  font-size: 14px;
  font-weight: 680;
  color: var(--fg);
}
.brand small { font-size: 11px; font-weight: 400; color: var(--fg3); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg4); flex: none; }
.dot.ok { background: var(--green); }

/* 供应商项：照上游 .dim-jh-provider 的形状（48px 高、14px 圆角、30px 图标） */
.providerList { display: grid; gap: 8px; }
.providerItem {
  all: unset;
  /* `all: unset` 会把 box-sizing 打回 content-box（它比 `*` 的 0,0,0 优先），
     于是 `width: 100%` 会再加上 20px padding + 2px 边框 ⇒ 每张卡右缘溢出 22px、
     侧栏底部常驻一条 15px 横向滚动条。必须显式补回来。 */
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.providerItem:hover { border-color: color-mix(in srgb, var(--brand) 22%, var(--line2)); box-shadow: var(--shadow-hover); }
.providerItem.on {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line2));
  background: color-mix(in srgb, var(--brand) 6%, var(--bg));
}
.providerIcon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 660;
  /* 没有品牌图标时用首字 + 色相兜底（色相由 console.js 的 hueOf() 给，同一家每次同色） */
  background: color-mix(in srgb, hsl(var(--hue, 220) 68% 52%) 14%, var(--bg));
  color: hsl(var(--hue, 220) 62% 40%);
  box-shadow: 0 1px 3px rgb(31 35 41 / 7%);
}
.providerIcon[data-icon] { background: transparent; box-shadow: none; }
/* 白底是给「透明背景 + 深色图形」那几家（百智云是 `fill="none"` + `#1a1a1a` 的路径）——
   深色模式下没有它就是一个看不见的黑团。不透明的 png 会把白底完全盖住，不受影响。 */
.providerIcon img { display: block; width: 20px; height: 20px; border-radius: 4px; object-fit: contain; background: #fff; }
.providerItem.on .providerIcon { background: color-mix(in srgb, hsl(var(--hue, 220) 68% 52%) 24%, var(--bg)); }
.providerItem.on .providerIcon[data-icon] { background: transparent; }
@media (prefers-color-scheme: dark) {
  .providerIcon { color: hsl(var(--hue, 220) 70% 68%); }
}
.providerLabel { min-width: 0; display: grid; }
.providerLabel strong {
  overflow: hidden;
  font-size: 13.5px;
  line-height: 19px;
  font-weight: 660;
  color: var(--fg);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.providerItem.on .providerLabel strong { color: var(--brand-ink); }
.providerLabel small { font-size: 11px; line-height: 14px; font-weight: 400; color: var(--fg3); }

/* `all: unset` 连 UA 的焦点环一起干掉了（它比 `:focus-visible` 的 UA 规则优先）。
   侧栏是主导航，这 26+3 个按钮必须能看见焦点 —— WCAG 2.4.7。 */
.providerItem:focus-visible,
#nav button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* 底部一行：概览 / 设置 / 备份（图标在上、文字在下，三个等分） */
.railNav {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
#nav button {
  all: unset;
  /* 同 .providerItem：all:unset 会打回 content-box */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--fg2);
  font-size: 11px;
  line-height: 14px;
  transition: background .16s ease, color .16s ease;
}
#nav button:hover { background: var(--sunk); color: var(--fg); }
#nav button.on { background: color-mix(in srgb, var(--brand) 10%, var(--bg)); color: var(--brand-ink); font-weight: 600; }
.navIcon { display: grid; place-items: center; }
.navLabel { white-space: nowrap; }

/* 账号页顶部：当前选中的是哪家（侧栏选中项的等价文字，窄屏折叠侧栏时也能看见） */
.providerName { font-size: 13px; font-weight: 600; color: var(--fg); }

.gw { font-family: var(--code); font-size: 11px; color: var(--fg2); word-break: break-all; }
.hint { font-size: 11px; color: var(--fg3); line-height: 1.5; }

/* ── 主区 ── */
.main { flex: 1; min-width: 0; overflow-y: auto; padding: 24px; }
.tab { display: none; }
.tab.on { display: block; }

.panelHead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
h1 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
}
h1 .sub { font-size: 12px; font-weight: 400; color: var(--fg2); margin-left: 8px; }
h2 {
  margin: 22px 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg2b);
  letter-spacing: .02em;
}
h2 .sub { font-size: 11.5px; font-weight: 400; color: var(--fg2); margin-left: 6px; }


/* ── 表单控件 ── */
.bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.bar label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg3); }
/* `.bar label` 的 inline-flex 会盖掉 `hidden` 的 UA display:none —— 非分档渠道下必须真隐藏。 */
.bar label[hidden] { display: none; }
select, input[type=file], input[type=number], input[type=text], input[type=password], input:not([type]) {
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--line3);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: var(--fg4); }
input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 18%, transparent);
}
.grow { flex: 1 1 180px; min-width: 120px; }

button, .btn {
  font: inherit;
  font-size: 12px;
  line-height: 18px;
  padding: 4px 12px;
  border: 1px solid var(--line3);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
button:hover, .btn:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line3));
  background: color-mix(in srgb, var(--brand) 6%, var(--bg));
  color: var(--brand);
}
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
button.warn { color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, var(--line3)); }
button.warn:hover { background: color-mix(in srgb, var(--red) 6%, var(--bg)); border-color: var(--red); color: var(--red); }
button.right { float: right; margin-top: -4px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.msg { font-size: 12px; color: var(--fg3); }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }
/* 工具栏里的分组竖线（批量积分操作 | 永久锁定） */
.barSep { width: 1px; height: 18px; flex: none; background: var(--line); margin: 0 2px; }

/* ── 概览卡片 ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.cardc {
  padding: 12px 14px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: var(--shadow);
}
.cardc span { display: block; font-size: 11.5px; line-height: 18px; color: var(--fg3); }
.cardc b {
  display: block;
  margin: 2px 0 1px;
  font-size: 20px;
  font-weight: 650;
  line-height: 26px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.cardc b.mono { font-size: 14px; line-height: 22px; font-family: var(--code); }

/* ── chips ── */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 3px 9px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  background: var(--sunk);
  font-family: var(--code);
  font-size: 11px;
  color: var(--fg2);
}
.chip b { font-family: var(--font); font-weight: 600; margin-right: 4px; }
.chip i { font-style: normal; color: var(--fg3); margin-left: 4px; }

/* ── 代码块 ── */
.code {
  padding: 12px 14px;
  border: 1px solid var(--line2);
  border-radius: 12px;
  background: var(--sunk);
  font-family: var(--code);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--fg2);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── 账号卡片（照上游 .dim-jh-accountCard） ── */
.accountList { display: grid; gap: 10px; }
.accountCard {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: var(--shadow);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.accountCard:hover { border-color: color-mix(in srgb, var(--brand) 22%, var(--line2)); box-shadow: var(--shadow-hover); }
.accountTop { display: flex; align-items: center; gap: 8px; }
.dragHandle {
  width: 16px;
  height: 20px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg4);
}
.accountOrder {
  min-width: 18px;
  flex: none;
  padding: 0 5px;
  border-radius: 6px;
  background: rgb(31 35 41 / 6%);
  font-size: 11px;
  line-height: 17px;
  font-weight: 600;
  text-align: center;
  color: var(--fg2b);
  font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) { .accountOrder { background: rgb(255 255 255 / 8%); } }
.accountStatus { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--fg3); }
.accountStatus[data-tone="on"] { background: var(--green); }
/* 非文本 UI 要 3:1：--fg4（#9aa0a6）只有 2.64:1，用 --fg3（3.82:1）。 */
.accountStatus[data-tone="off"] { background: var(--fg3); }
.accountStatus[data-tone="dead"] { background: var(--red); }
.accountName {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--fg);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.accountTag {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 17px;
  font-weight: 500;
}
.accountTag[data-tone="on"] { color: var(--green); background: var(--green-bg); }
/* off 态可以弱化，但 11px 文本仍要过 4.5：--fg3 只有 3.42:1，用 --fg2（4.83:1）。 */
.accountTag[data-tone="off"] { color: var(--fg2); background: rgb(143 149 158 / 12%); }
/* ⚠️ 这一档必须两套都写：`#e37400` 在亮色底上只有 3.10:1，过不了 11px 小字的 4.5。
   亮色用更深的 #92400e（对标签底 6.00:1），深色用 #fbbf24（对标签底 7.93:1）。 */
.accountTag[data-tone="warn"] { color: #92400e; background: rgb(180 83 9 / 12%); }
@media (prefers-color-scheme: dark) {
  .accountTag[data-tone="warn"] { color: #fbbf24; background: rgb(251 191 36 / 14%); }
}

.accountMeta { display: grid; gap: 3px; margin: 8px 0 0; container-type: inline-size; }
.metaRow {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
}
.metaRow dt { font-size: 12px; line-height: 18px; color: var(--fg3); }
.metaRow dd {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 18px;
  color: var(--fg2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metaRow dd.mono { font-family: var(--code); font-size: 11.5px; color: var(--fg2b); }
/* 只有 `off` / `ok` 两种 —— 产出点在 console.js 的「可续期」行。
   （曾经还有一条 `[data-tone="warn"]`，但 warn 只落在 `.accountTag` 上，那条是死规则，已删。） */
.metaRow dd[data-tone="ok"] { color: var(--green); }
.metaRow dd[data-tone="off"] { color: var(--fg3); }
.creditTotal { font-size: 13px; font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; }
/* token 计渠道（Marvis）的单位后缀：与数字同号但弱化，避免被读成积分 */
.creditUnit { font-size: 11px; font-weight: 400; color: var(--fg3); }
.creditPoolPart { font-size: 11px; font-variant-numeric: tabular-nums; }
.creditExpire { color: var(--orange-ink); }
/* 「剩 22 天 / 已过 2 天」：跟「临期积分」用同一个橙，但**类名分开** ——
   两者语义无关，将来改「临期」配色不该连带把有效期也改掉。 */
.relTime { color: var(--orange-ink); }
/* 「另有 N 已失效」：弱化的橙，与主数值的品牌蓝明确区分，也不跟「临期」抢注意力
   （上游 `jet-hub.js:330` 的注释：已失效额度用弱化橙，用量才用中性色）。 */
.creditExpired { margin-left: 8px; font-size: 11px; color: var(--orange-ink); }
/* 百智云每日桶的「非默认口径」小字（今日尚未领取 / 发放额超过固定值 / 领取状态未知）。
   ⚠️ 必须**直显**而不是只挂 title：那一档数字（尤其是 0）不带解释会被读成「已经用光」。
   用中性灰而不是橙：它解释的是数字含义，不是告警（橙色留给「临期 / 零点过期」）。 */
.creditSplitNote { margin-left: 6px; font-size: 11px; color: var(--fg3); }
/* 「旧」：这一行是**兼顶旧读数**（RPC 层查不到新的就回上一轮的，并带 error 说明）。
   ⚠️ 必须标出来 —— 否则用户看到过期积分却以为是最新的（`jet-hub-rpc.js:905-925` 的硬要求）。
   用中性灰框而不是橙色：它不是错误，只是「不是这一秒的数」。 */
.creditStale {
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid var(--line4);
  border-radius: 4px;
  font-size: 10px;
  line-height: 15px;
  color: var(--fg2);
  vertical-align: 1px;
}

/* 操作行：值列（账号 id）吃掉剩余宽度，按钮组右对齐 —— 对应上游
   `.dim-jh-metaRow--actions{grid-template-columns:52px minmax(0,1fr) auto}`。
   ⚠️ `align-items: start` 是照抄上游的：操作行混了单行的 dt 与可能换行的按钮组，
   baseline 对齐会把行高撑歪（上游注释原话）。 */
.metaRow--actions { grid-template-columns: 52px minmax(0, 1fr); align-items: start; margin-top: 2px; }
.metaRow--actions .accountActions { margin-top: 0; padding-top: 0; border-top: 0; align-self: center; }
.accountActions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
/* 操作按钮放在第二个 <dd> 里（保持 dl > div > (dt, dd) 的合法结构），
   所以要盖掉 .metaRow dd 的省略号与不换行。 */
.metaRow dd.accountActions { overflow: visible; white-space: normal; }
.accountActions button { padding: 2px 9px; font-size: 11.5px; }
/* 窄容器：按钮组落到下一行铺满（阈值 420 与上游 `jet-hub.js` 的 `@container (max-width:420px)` 一致）。
   ⚠️ 换行后按钮组要 `flex-end` 而不是 `flex-start` —— 上游注释：贴右才「不会觉得
   按钮跑到左边」。 */
@container (max-width: 420px) {
  .metaRow--actions { grid-template-areas: "label ." "actions actions"; row-gap: 6px; }
  .metaRow--actions dt { grid-area: label; }
  .metaRow--actions .accountActions { grid-area: actions; justify-content: flex-end; }
}
.accountEmpty {
  padding: 40px 16px;
  border: 1px dashed var(--line3);
  border-radius: 14px;
  background: var(--sunk);
  font-size: 12px;
  color: var(--fg3);
  text-align: center;
}

/* ── 通用表格（renderGeneric / 签到渠道） ── */
.tablewrap { overflow: auto; border: 1px solid var(--line2); border-radius: 12px; background: var(--bg); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line2); text-align: left; vertical-align: middle; }
th { position: sticky; top: 0; background: var(--sunk); font-size: 11px; font-weight: 600; color: var(--fg3); }
tr:last-child td { border-bottom: none; }
td.mono { font-family: var(--code); font-size: 11.5px; color: var(--fg2b); }
.muted { color: var(--fg3); }
.mono { font-family: var(--code); }

/* ── 设置行 ── */
.rows { overflow: hidden; border: 1px solid var(--line2); border-radius: 14px; background: var(--bg); box-shadow: var(--shadow); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line2); }
.row:last-child { border-bottom: none; }
.row b { font-size: 13px; font-weight: 600; color: var(--fg); }
.row p { margin: 2px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--fg3); }
.sw { position: relative; display: inline-block; width: 34px; height: 20px; flex: none; }
.sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sw i { position: absolute; inset: 0; border-radius: 999px; background: var(--line4); transition: background .18s ease; }
.sw i::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(31 35 41 / 20%);
  transition: transform .18s ease;
}
.sw input:checked + i { background: var(--brand); }
.sw input:checked + i::after { transform: translateX(14px); }
.sw input:focus-visible + i { box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
/* 开关旁边的文字也是 <label>（点文字同样能切换，见 index.html 的说明）——
   手型光标是「这里可点」的唯一视觉线索，别省。 */
.swText { color: var(--fg3); cursor: pointer; }

/* ── 弹窗 ── */
.modal { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgb(0 0 0 / 32%); }
.modal[hidden] { display: none; }
.modal-box {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 20px 22px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 16px 48px rgb(0 0 0 / 22%);
}
.modal-box h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--fg); }
.modal-box h2 span { color: var(--brand); }
.modal-box p { margin: 0 0 10px; font-size: 12px; line-height: 1.6; color: var(--fg2); }
