/* ============================================================
   hub.css — wintersp.cc 全项目总入口页（零外部依赖，系统字体栈）
   三套皮肤：body[data-theme="swiss | terminal | broadsheet"]
   同一套 DOM，差异全部走 CSS 变量 + 各皮肤覆写段
   ============================================================ */

/* ---------- 皮肤变量 · swiss 瑞士网格（默认） ---------- */
body[data-theme="swiss"] {
  --bg: #fafaf7;
  --ink: #17150e;
  --muted: #6f6c5d;
  --faint: #a3a08f;
  --accent: #c8402a;
  --ok: #2e7d46;
  --line: rgba(23, 21, 14, 0.18);
  --line-strong: rgba(23, 21, 14, 0.9);
  --row-hover: rgba(23, 21, 14, 0.05);
  --backdrop: rgba(23, 21, 14, 0.42);
  --desc: #6f6c5d;
  --code-bg: rgba(23, 21, 14, 0.07);
  /* 首屏光色：朱砂橙红主光（hue≈14）+ 朱红次光 + 浅朱边缘光，同族内拉明度差 */
  --hero-bg-rgb: 19, 16, 11;
  --glow-a: 228, 88, 46;
  --glow-b: 200, 78, 44;
  --glow-c: 230, 102, 60;
  --font: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
  --fs: 14px;
  --name-fs: 15px;
  --wrap: 1120px;
  --tab-on-bg: #17150e;
  --tab-on-ink: #fafaf7;
  --brand-size: 13px;
  --brand-ls: 0.12em;
  --rule-head: 2.5px solid var(--ink);
  --rule-cols: 1px solid var(--line);
  --rule-foot: 1px solid var(--ink);
}

/* ---------- 皮肤变量 · terminal 金融终端 ---------- */
body[data-theme="terminal"] {
  --bg: #0e1116;
  --ink: #e8a33d;
  --muted: #9a7b45;
  --faint: #5b6470;
  --accent: #3fb950;
  --ok: #3fb950;
  --line: rgba(232, 163, 61, 0.26);
  --line-strong: rgba(232, 163, 61, 0.62);
  --row-hover: rgba(232, 163, 61, 0.08);
  --backdrop: rgba(0, 0, 0, 0.62);
  /* NOTES 正文提亮一档（约标题琥珀 80% 明度），不再是全屏最暗层 */
  --desc: #bb8432;
  --code-bg: rgba(232, 163, 61, 0.14);
  /* 首屏光色：琥珀金主光（hue≈38）+ 深琥珀次光 + 终端绿边缘光（提亮一档，实测要可辨） */
  --hero-bg-rgb: 12, 15, 20;
  --glow-a: 232, 166, 56;
  --glow-b: 150, 102, 34;
  --glow-c: 68, 200, 92;
  --font: "SF Mono", Menlo, Consolas, "Courier New", "PingFang SC", "Microsoft YaHei", monospace;
  --mono: "SF Mono", Menlo, Consolas, "Courier New", "PingFang SC", monospace;
  --fs: 13px;
  --name-fs: 14px;
  --wrap: 1120px;
  --tab-on-bg: #e8a33d;
  --tab-on-ink: #0e1116;
  --brand-size: 12.5px;
  --brand-ls: 0.14em;
  --rule-head: 1px solid var(--line-strong);
  --rule-cols: 1px solid var(--line);
  --rule-foot: 1px solid var(--line-strong);
}

/* ---------- 皮肤变量 · broadsheet 报纸头版 ---------- */
body[data-theme="broadsheet"] {
  --bg: #f7f3ea;
  --ink: #1d1a14;
  --muted: #6e6759;
  --faint: #a89f8d;
  --accent: #8c2f1b;
  --ok: #2e7d46;
  --line: rgba(29, 26, 20, 0.24);
  --line-strong: rgba(29, 26, 20, 0.85);
  --row-hover: rgba(29, 26, 20, 0.05);
  --backdrop: rgba(29, 26, 20, 0.4);
  --desc: #6e6759;
  --code-bg: rgba(29, 26, 20, 0.08);
  /* 首屏光色：冷香槟白金主光（hue≈47，低饱和高明度）+ 香槟次光 + 铂白边缘光 */
  --hero-bg-rgb: 22, 18, 14;
  --glow-a: 236, 226, 190;
  --glow-b: 222, 210, 168;
  --glow-c: 240, 236, 224;
  --font: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
  --fs: 14px;
  --name-fs: 15px;
  --wrap: 1020px;
  --tab-on-bg: #1d1a14;
  --tab-on-ink: #f7f3ea;
  --brand-size: 24px;
  --brand-ls: 0;
  --rule-head: 4px double var(--ink);
  --rule-cols: 1px solid var(--line);
  --rule-foot: 1px solid var(--ink);
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.22s ease, color 0.22s ease;
}

a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
::selection { background: var(--accent); color: var(--bg); }

/* ---------- 布局骨架：报头 auto / 索引表 1fr / 底栏 auto，满屏高 ----------
   （flex column 而非 grid：sticky 顶栏的包含块需要是整个容器，grid area 会钳住它） */
.outer {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- 流光首屏（封面） ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  /* WebGL 不可用 / prefers-reduced-motion 时的降级背景（与着色器同一组光色变量）；
     降级视觉同样收窄光斑：暗底占主导，光只是点缀 */
  background:
    radial-gradient(46% 38% at 30% 40%, rgba(var(--glow-a), 0.30), rgba(var(--glow-a), 0) 70%),
    radial-gradient(38% 32% at 70% 62%, rgba(var(--glow-b), 0.22), rgba(var(--glow-b), 0) 70%),
    radial-gradient(30% 26% at 56% 46%, rgba(var(--glow-c), 0.12), rgba(var(--glow-c), 0) 72%),
    rgb(var(--hero-bg-rgb));
  /* 首屏文字用更实的暖白：次级文字 0.85 不透明度，叠 scrim 后对比度 ≥4.5:1 */
  --hero-ink: #f6f2e7;
  --hero-dim: rgba(246, 242, 231, 0.85);
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 0 20px;
  pointer-events: none; /* 不挡光：鼠标事件穿透到 hero 驱动光源 */
}
/* 中央文字后方压一层暗色径向 scrim：光从四周流过，文字底下永远够暗，
   即使最亮的 broadsheet 光斑漂到正中央，文字对比度仍 ≥4.5:1 */
.hero-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(56% 46% at 50% 50%,
    rgba(5, 4, 3, 0.62) 0%,
    rgba(5, 4, 3, 0.45) 48%,
    rgba(5, 4, 3, 0.18) 72%,
    rgba(5, 4, 3, 0) 88%);
}
.hero-name {
  margin: 0;
  font-size: clamp(42px, 8.5vw, 104px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--hero-ink);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}
.hero-tagline {
  margin: 0;
  font-size: clamp(15px, 2vw, 19px);
  letter-spacing: 0.22em;
  color: var(--hero-dim);
}
.hero-stats {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: var(--hero-dim);
}
.hero-hint {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--hero-dim);
  font-size: 12.5px;
  letter-spacing: 0.26em;
  text-indent: 0.26em; /* 末字符右侧的多余字距补回，视觉重新居中 */
}
.hero-hint:hover { color: var(--hero-ink); }
/* 动画竖线：一小段亮点沿细线向下滴落，暗示「往下滚」 */
.hero-hint-line {
  position: relative;
  width: 1px;
  height: 30px;
  overflow: hidden;
  background: rgba(246, 242, 231, 0.22);
}
.hero-hint-line::after {
  content: "";
  position: absolute;
  left: 0;
  top: -12px;
  width: 100%;
  height: 12px;
  background: var(--hero-ink);
  animation: heroDrop 2.4s cubic-bezier(0.45, 0, 0.3, 1) infinite;
}
@keyframes heroDrop {
  0% { top: -12px; }
  62%, 100% { top: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-hint-line::after { animation: none; }
}

/* 单根左轴线：报头、表格、底栏共用同一居中容器与相同水平 padding */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: var(--rule-head);
}
.topbar-inner {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 14px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-left { display: flex; align-items: baseline; gap: 16px; min-width: 0; }
.brand {
  font-size: var(--brand-size);
  font-weight: 700;
  letter-spacing: var(--brand-ls);
  text-transform: uppercase;
  white-space: nowrap;
}
.gen-date {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* 皮肤切换：三套皮肤的唯一入口，未激活也要高对比（≥3:1） */
.theme-switch { display: inline-flex; border: 1px solid var(--line-strong); }
.theme-tab {
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink);
  line-height: 1;
}
.theme-tab + .theme-tab { border-left: 1px solid var(--line); }
.theme-tab:hover { color: var(--accent); }
.theme-tab[aria-pressed="true"] { background: var(--tab-on-bg); color: var(--tab-on-ink); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* 驾驶舱入口：图标 + 文字标签 */
.lock-btn { width: auto; padding: 0 12px; gap: 7px; font-size: 12px; letter-spacing: 0.08em; }

.lockout-btn {
  border: 1px solid var(--line-strong);
  padding: 7px 16px;
  font-size: 12px;
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--ink);
}
.lockout-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 对外层 · 编号索引表（行均分剩余高度） ---------- */
.index-wrap {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 12px 20px 0;
  display: flex;
  flex-direction: column;
}
.index-frame { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.index-head, .row {
  display: grid;
  grid-template-columns: 4ch minmax(0, 200px) minmax(0, 1fr) 96px 92px;
  gap: 12px;
  align-items: center;
}
.index-head > span, .row > span { min-width: 0; }

.index-head {
  flex: none;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-strong);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.index-list {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.row {
  flex: 1 1 0;
  min-height: 38px;
  border-bottom: 1px solid var(--line);
}
.row.is-online { cursor: pointer; }
.row.is-online:hover, .row.is-online:focus-visible { background: var(--row-hover); }

.col-num { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.col-name {
  font-size: var(--name-fs);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.col-desc {
  font-size: calc(var(--fs) - 1px);
  color: var(--desc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.col-date {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

/* 状态列：ONLINE / LOCAL 统一徽章形态，只靠颜色与 ↗ 区分 */
.st {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid;
  padding: 2px 7px;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.3;
  white-space: nowrap;
}
/* ONLINE 三套皮肤统一语义绿；朱红只留给品牌点缀 */
.st-online { color: var(--ok); border-color: var(--ok); }
.st-local { color: var(--muted); border-color: var(--line); }

/* ---------- 对外层 · 底栏（BOOKS / LAB / ARCHIVE） ---------- */
.basebar { border-top: var(--rule-foot); }
.basebar-inner {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 16px 20px 22px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.7fr;
  gap: 22px;
}
.base-group + .base-group { border-left: var(--rule-cols); padding-left: 22px; }
.base-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.books { list-style: none; margin: 0; padding: 0; }
/* 悬挂缩进：折行的续行内收，不被误读成新条目 */
.book {
  font-size: calc(var(--fs) - 1px);
  line-height: 1.8;
  padding-left: 14px;
  text-indent: -14px;
}
.book-link {
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.book-link:hover { color: var(--accent); text-decoration-color: var(--accent); }
.book-desc { color: var(--muted); font-size: calc(var(--fs) - 2px); }
.lab, .archive {
  margin: 0;
  font-size: calc(var(--fs) - 2px);
  color: var(--muted);
  line-height: 1.8;
}
/* 实验名是不可拆分的芯片，只在条目之间换行 */
.lab-item { display: inline-block; }

/* ---------- 内层 · 驾驶舱 ---------- */
.deck-main {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 20px 20px 48px;
}
.deck-section { margin-bottom: 30px; }
.deck-title {
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.deck-title-note {
  margin-left: 8px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
  font-size: 11.5px;
}

/* 档案卡：CSS columns 流式排列，短卡自然短，不留等高空洞 */
.dossiers { column-count: 2; column-gap: 14px; }
.dossier {
  break-inside: avoid;
  margin: 0 0 14px;
  border: 1px solid var(--line-strong);
  padding: 12px 14px;
}
.dossier-head { display: flex; align-items: baseline; gap: 10px; }
.dossier-num { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.dossier-name { margin: 0; font-size: 16px; }
.dossier-status {
  margin-left: auto;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 1px 6px;
}
.dossier-online { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ok); }
.dossier-path {
  margin: 5px 0 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.dossier-note { margin: 0 0 6px; font-size: calc(var(--fs) - 0.5px); }
.readme-block h4 {
  margin: 10px 0 3px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
/* readme 正文：数据端已限长，不做任何会切到行中间的高度限制 */
.md-text { font-size: calc(var(--fs) - 1px); color: var(--ink); }
/* 悬挂缩进：行首符号/编号凸出，续行对齐文字 */
.md-line {
  display: block;
  overflow-wrap: anywhere;
  padding-left: 1.6em;
  text-indent: -1.6em;
}
.md-line + .md-line { margin-top: 2px; }
/* 行内代码：等宽 + 浅底 */
.md-code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0 4px;
}
.dossier-git {
  list-style: none;
  margin: 12px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.dossier-git li {
  display: grid;
  grid-template-columns: 66px 82px minmax(0, 1fr);
  gap: 8px;
  padding: 2px 0;
  align-items: baseline;
}
.g-hash { font-family: var(--mono); color: var(--accent); }
.g-date { font-family: var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.g-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.glog { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-strong); }
.glog li {
  display: grid;
  grid-template-columns: 86px minmax(0, 170px) 72px minmax(0, 1fr);
  gap: 12px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
  font-size: calc(var(--fs) - 1px);
}
.glog li:last-child { border-bottom: none; }
.glog li > span { min-width: 0; }
.g2-date { font-family: var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.g2-proj { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g2-hash { font-family: var(--mono); color: var(--accent); }
.g2-msg { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.health { border: 1px solid var(--line-strong); padding: 12px 14px; font-size: calc(var(--fs) - 0.5px); }
.health-ok { margin: 0; color: var(--ok); }
.health-list { margin: 0; padding-left: 18px; }
.health-list li { padding: 2px 0; }

/* 线上站点直达：名称带下划线与 ↗，明确可点 */
.online-links { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-strong); }
.online-links li + li { border-top: 1px solid var(--line); }
.ol-link {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 12px;
  text-decoration: none;
}
.ol-link:hover { background: var(--row-hover); }
.ol-name {
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ol-arrow { color: var(--accent); font-size: 12px; }
.ol-url {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ---------- 密码门 ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.gate-backdrop { position: absolute; inset: 0; background: var(--backdrop); }
.gate-dialog {
  position: relative;
  width: min(340px, 100%);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  padding: 22px 24px 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}
.gate-title { margin: 0 0 4px; font-size: 16px; }
.gate-hint { margin: 0 0 14px; font-size: calc(var(--fs) - 1.5px); color: var(--muted); }
.gate-form { display: flex; gap: 8px; }
.gate-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
  outline: none;
}
.gate-input:focus { border-color: var(--accent); }
.gate-submit {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--tab-on-bg);
  color: var(--tab-on-ink);
  font-size: 12px;
  letter-spacing: 0.1em;
}
.gate-error { margin: 10px 0 0; font-size: calc(var(--fs) - 1.5px); color: var(--accent); }

/* ============================================================
   皮肤覆写 · terminal（可见表格边框，彭博终端气质）
   ============================================================ */
body[data-theme="terminal"] .index-head,
body[data-theme="terminal"] .st,
body[data-theme="terminal"] .theme-tab,
body[data-theme="terminal"] .base-title,
body[data-theme="terminal"] .deck-title,
body[data-theme="terminal"] .col-name { text-transform: uppercase; }

body[data-theme="terminal"] .index-frame {
  border: 1px solid var(--line-strong);
  margin-top: 14px;
}
body[data-theme="terminal"] .index-head {
  border-bottom: 1px solid var(--line-strong);
  padding: 0;
}
body[data-theme="terminal"] .row { border-bottom: 1px solid var(--line); }
body[data-theme="terminal"] .row:last-child { border-bottom: none; }
body[data-theme="terminal"] .index-head,
body[data-theme="terminal"] .row { align-items: stretch; gap: 0; }
/* 等宽字体大写下名称更宽：名称列加宽并留足右内边距，不顶竖线 */
body[data-theme="terminal"] .index-head,
body[data-theme="terminal"] .row { grid-template-columns: 4ch minmax(0, 236px) minmax(0, 1fr) 96px 92px; }
body[data-theme="terminal"] .index-head > span,
body[data-theme="terminal"] .row > span {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-left: 1px solid var(--line);
}
body[data-theme="terminal"] .row > span.col-name { padding-right: 14px; }
body[data-theme="terminal"] .index-head > span:first-child,
body[data-theme="terminal"] .row > span:first-child { border-left: none; }
body[data-theme="terminal"] .col-date { justify-content: flex-end; }

/* ============================================================
   皮肤覆写 · broadsheet（报头双线、衬线、editorial 分栏）
   ============================================================ */
body[data-theme="broadsheet"] .brand { font-weight: 700; text-transform: none; }
body[data-theme="broadsheet"] .gen-date { font-family: var(--font); font-style: italic; font-size: 13px; }
body[data-theme="broadsheet"] .index-head { font-variant: small-caps; letter-spacing: 0.1em; text-transform: none; font-size: 12.5px; }
body[data-theme="broadsheet"] .col-name { font-weight: 700; }
body[data-theme="broadsheet"] .st { text-transform: none; letter-spacing: 0.06em; }
body[data-theme="broadsheet"] .base-title,
body[data-theme="broadsheet"] .deck-title { font-variant: small-caps; text-transform: none; letter-spacing: 0.1em; font-size: 13.5px; }
body[data-theme="broadsheet"] .dossier-name { font-size: 18px; }
/* broadsheet 的 BOOKS：折行续行与首行左对齐，不做悬挂缩进 */
body[data-theme="broadsheet"] .book { padding-left: 0; text-indent: 0; }
/* terminal 的 LOCAL 芯片字色提亮到 ≥4.5:1，与 ONLINE 绿保持亮度差 */
body[data-theme="terminal"] .st-local { color: #a6854d; }

/* 台账体检：内容自适应的紧凑块，不撑满全宽 */
.health { display: inline-block; }

/* ---------- 手机（≤640px）：每行两行——首行 编号/名称/徽章/日期，次行简介小字 ---------- */
@media (max-width: 640px) {
  .topbar-inner { padding: 10px 14px; flex-wrap: wrap; }
  .theme-tab {
    min-height: 44px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    font-size: 12px;
  }
  .icon-btn { min-width: 44px; width: auto; height: 44px; }
  .lockout-btn { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; }
  .index-wrap { padding: 8px 14px 0; }
  .index-head { font-size: 10.5px; }
  .index-head, .row {
    grid-template-columns: 3ch minmax(0, 1fr) 74px 88px;
    column-gap: 12px;
    row-gap: 2px;
  }
  .index-head .col-desc { display: none; }
  .index-list { flex: none; }
  .row { flex: none; min-height: 0; padding: 9px 0; grid-template-rows: auto auto; }
  /* 长名称允许折行（连字符是自然折行点），保证完整可读 */
  .row .col-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: break-word;
    line-height: 1.35;
  }
  /* 简介降为第二行小字，横跨整行宽（不被 WORK 列宽钳住），一行截断带 … */
  .row .col-desc {
    display: block;
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 11.5px;
  }
  /* 顶部控件行右对齐贴边，与桌面端一致 */
  .topbar-right { margin-left: auto; }
  .basebar-inner { grid-template-columns: 1fr; gap: 14px; padding: 12px 14px 18px; }
  .base-group + .base-group { border-left: none; padding-left: 0; }
  .deck-main { padding: 14px 14px 40px; }
  .dossiers { column-count: 1; }
  .glog li { grid-template-columns: 80px minmax(0, 1fr); }
  .g2-proj, .g2-hash { display: none; }
  .brand { white-space: normal; }
  /* terminal 移动端：列模板对齐边框网格，不用 gap 撑距（徽章间距由名称列右 padding 保证） */
  body[data-theme="terminal"] .index-head,
  body[data-theme="terminal"] .row { grid-template-columns: 3ch minmax(0, 1fr) 74px 88px; gap: 0; }
  body[data-theme="terminal"] .row > span.col-name,
  body[data-theme="terminal"] .row > span.col-desc { display: block; }
}
