/* ============================================================================
   HelloChess 手册 DEMO · 公共样式
   ---------------------------------------------------------------------------
   变量名与生产站 `chess-user/css/theme_vars.css` 保持一致（--bg-card /
   --text-primary / --border-color / --shadow …），便于日后把本 DEMO 的样式
   直接搬进站点模块 guide.php。

   结构参考：https://ricky-chess-review.fly.dev/guide （Chess 诊断室 · 演示手册）
   借用的机制：顶部 chips 锚点 / 侧栏 sticky TOC / step=徽标标题+散文+截图位+
   编号说明+提示框 / scroll-margin-top 避开吸顶导航 / 768px 收起 TOC / 480px 单列。

   单位：全 px（网站端规范 §6.2「全部 px，rem 0 次」）。
   ========================================================================== */

/* ---------- 1. 主题变量 ---------- */
:root {
  /* 与 theme_vars.css 同名的 8 个基础 token */
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --border-color: #e0e0e0;
  --shadow: rgba(0, 0, 0, 0.06);

  /* 本手册派生变量（站点尚无同名 token，属 DEMO 私有） */
  --accent: #667eea;
  --accent-2: #764ba2;
  --accent-ink: #ffffff;
  --muted: #5b6270;
  --faint: #98a0ae;
  --border-strong: #d6dae1;
  --callout: #f0a020;
  --ok: #2e7d32;
  --warn: #b26a00;
  --bad: #c62828;
  --accent-soft: rgba(102, 126, 234, 0.10);
}

.theme-dark {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #1f2940;
  --bg-elevated: #2a3550;
  --text-primary: #e0e0e0;
  --text-secondary: #aaaaaa;
  --border-color: #333344;
  --shadow: rgba(0, 0, 0, 0.3);

  --accent: #8fa3ff;
  --accent-2: #b18fd8;
  --accent-ink: #14162a;
  --muted: #b6bcc9;
  --faint: #7b8496;
  --border-strong: #41435c;
  --callout: #ffb74d;
  --ok: #81c784;
  --warn: #ffb74d;
  --bad: #ef9a9a;
  --accent-soft: rgba(143, 163, 255, 0.16);
}

/* 护眼模式（.theme-protect 绿色皮肤）已于 2026-10-30 下线：
   手册页只保留「浅色 / 深色」两态，用户明确要求不要绿色。
   原绿色 token 块整段移除，任何残留 theme-protect 类都不会再把页面染绿。 */

/* 跟随系统（未手动切换时生效） */
@media (prefers-color-scheme: dark) {
  html:not(.theme-light):not(.theme-dark) {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #1f2940;
    --bg-elevated: #2a3550;
    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    --border-color: #333344;
    --shadow: rgba(0, 0, 0, 0.3);
    --accent: #8fa3ff;
    --accent-2: #b18fd8;
    --accent-ink: #14162a;
    --muted: #b6bcc9;
    --faint: #7b8496;
    --border-strong: #41435c;
    --callout: #ffb74d;
    --ok: #81c784;
    --warn: #ffb74d;
    --bad: #ef9a9a;
    --accent-soft: rgba(143, 163, 255, 0.16);
  }
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
  background: var(--accent-soft);
  color: var(--text-primary);
  padding: 1px 5px;
  border-radius: 4px;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- 3. 顶栏 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.top .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 58px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 16px;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.brand .mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 15px;
}

.top .links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top .plain {
  padding: 6px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  /* 链接不许被压成竖排单字 */
  white-space: nowrap;
  flex: none;
}
.top .plain:hover { background: var(--bg-primary); color: var(--text-primary); text-decoration: none; }
.top .plain.on { background: var(--accent-soft); color: var(--accent); }

.btn {
  padding: 7px 15px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.btn.primary:hover { text-decoration: none; filter: brightness(1.06); }
.btn.ghost { border-color: var(--border-strong); color: var(--text-secondary); background: transparent; }
.btn.ghost:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn.small { padding: 5px 12px; font-size: 12.5px; }

.theme-toggle {
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 15px;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 4. 页头 ---------- */
/* 左右内边距统一由 .wrap 提供（0 24px），各区块只改上下，
   这样顶栏品牌 / 标题 / 章节按钮行 / 侧栏目录共用同一条左边线。 */
.head {
  padding-top: 40px;
  padding-bottom: 8px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 11px;
}

.head h1 {
  font-size: 34px;
  line-height: 1.24;
  letter-spacing: -0.03em;
  margin: 14px 0 10px;
}

.head .lede {
  color: var(--muted);
  font-size: 16.5px;
  max-width: 760px;
  margin: 0 0 18px;
}

.demo-note {
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
}
.demo-note b { color: var(--text-primary); }

/* 生产版说明框（与 .demo-note 同款式，命名去 DEMO 味） */
.note-box {
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}
.note-box b { color: var(--text-primary); }

/* ---------- 5. 章节 chips ---------- */
/* 吸顶条铺满整宽，但按钮要跟正文栏（.head / .layout）同一条左边线，
   否则按钮会被顶到屏幕最左边，与整页内容列脱节。 */
.chips {
  position: sticky;
  top: 58px;
  z-index: 40;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

.chips .chips-inner {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}
.chips a {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.chips a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.chips a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 6. 布局（侧栏 TOC + 正文） ---------- */
.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding-top: 8px;
  padding-bottom: 60px;
}

aside.toc {
  position: sticky;
  top: 116px;
  max-height: calc(100vh - 136px);
  overflow-y: auto;
  padding: 22px 0 30px;
  font-size: 13.5px;
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc > ol > li { margin-bottom: 3px; }
.toc > ol > li > a {
  display: flex;
  gap: 9px;
  align-items: baseline;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
}
.toc > ol > li > a:hover { color: var(--text-primary); text-decoration: none; }
.toc > ol > li > a .n { color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 700; }
.toc > ol > li > a.on { background: var(--bg-card); color: var(--text-primary); box-shadow: 0 1px 2px var(--shadow); }
.toc li ol { display: none; padding: 2px 0 8px 34px; }
.toc li.open ol { display: block; }
.toc li ol a { display: block; padding: 3px 0; color: var(--faint); font-size: 12.5px; line-height: 1.5; }
.toc .back { display: block; margin-top: 18px; padding: 0 10px; color: var(--faint); font-size: 12.5px; }

main.content { min-width: 0; padding-bottom: 40px; }

/* ---------- 7. 章节 ---------- */
.chapter {
  padding: 44px 0 26px;
  border-bottom: 1px solid var(--border-color);
  scroll-margin-top: 116px;
}
.chapter:last-of-type { border-bottom: 0; }
.chapter h2 {
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1.24;
  margin: 8px 0 10px;
}
.chapter .intro p { color: var(--muted); font-size: 16px; max-width: 780px; margin: 0 0 8px; }
.chapter h3 { font-size: 19px; margin: 34px 0 8px; letter-spacing: -0.02em; }
.chapter h3:first-of-type { margin-top: 20px; }

/* ---------- 8. 步骤块（手册核心单元） ---------- */
.step {
  padding: 26px 0 6px;
  scroll-margin-top: 116px;
  border-left: 2px solid transparent;
  padding-left: 0;
}
.step:focus { outline: none; }

.step h3 {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 19px;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.step h3 .n {
  width: 28px; height: 28px;
  flex: none;
  border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.step p { color: var(--muted); margin: 0 0 12px; max-width: 800px; }
.step p b, .callouts b, .tip b { color: var(--text-primary); }

/* 截图占位框 —— 严禁放假截图，空着比画错好 */
figure.shot {
  margin: 16px 0 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg-elevated);
  min-height: 132px;
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
}
figure.shot .shot-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--faint);
  line-height: 1.6;
  /* 窄屏：占位文案很长，必须允许收缩换行，否则整页被撑出横向滚动条 */
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
}
figure.shot .shot-tag .ico {
  font-size: 17px;
  opacity: 0.75;
  flex: none;
}
figure.shot .shot-tag b { color: var(--text-secondary); font-weight: 700; }
/* flex 子项默认 min-width:auto，不加 min-width:0 就不会缩到容器宽度内 */
figure.shot .shot-tag > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
figure.shot .shot-url {
  display: block;
  margin-top: 6px;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 11.5px;
  color: var(--faint);
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* 实拍图：编号徽标是 DOM 叠加层，坐标存 guide-shots.json（百分比），不烧进图片。
   改文案不用重切图；重拍图只需更新坐标。缺图/缺条目由 guide_shot() 回落成上面的占位框。 */
figure.shot.real {
  display: block;
  border: 0;
  background: none;
  min-height: 0;
  padding: 0;
  text-align: left;
}
figure.shot.real .shot-frame {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elevated);
}
figure.shot.real .shot-frame img {
  display: block;
  width: 100%;
  height: auto;
}
figure.shot.real figcaption {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--faint);
  line-height: 1.6;
}
/* 编号徽标：位置=元素锚点在图片里的百分比；data-pin 与步骤内 callouts 的 .ref 编号对应，
   guide.js 里点 .ref 会闪亮对应的 .gs-pin 并滚动到它 */
.gs-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(0, 0, 0, 0.30);
  pointer-events: none;
  user-select: none;
}
.gs-pin.flash {
  animation: gsPinFlash 1.2s ease;
}
@keyframes gsPinFlash {
  0%, 100% { box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(0, 0, 0, 0.30); }
  40%      { box-shadow: 0 0 0 12px rgba(15, 23, 42, 0.07), 0 2px 6px rgba(0, 0, 0, 0.30); }
}
/* 第 2 章组概览图：小一点，不抢模块卡片 */
figure.shot.real.group-shot { max-width: 760px; }

/* 编号说明列表 */
.callouts {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
  max-width: 820px;
}
/* 徽标绝对定位、正文走普通流。
   li 若用 display:grid，li 内的 <b>/<a> 等行内元素会各自变成独立网格项，
   被挤进第一列（26px 宽）→ 出现「一个字一行」的竖排。 */
.callouts li {
  position: relative;
  display: block;
  padding-left: 34px;
  color: var(--muted);
  font-size: 14.5px;
}
.callouts li .ref {
  position: absolute;
  left: 0;
  top: 2px;
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

/* 提示框 */
.tip {
  margin: 6px 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--callout);
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  max-width: 820px;
}
.tip::before {
  content: "提示";
  font-weight: 700;
  color: var(--text-primary);
  margin-right: 8px;
}

/* 步骤里的直达链接行 */
.goto {
  margin: 0 0 14px;
  font-size: 13.5px;
}
.goto .lbl { color: var(--faint); margin-right: 6px; }
.goto a {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 12.5px;
}
.goto a:hover { text-decoration: none; background: var(--accent); color: #fff; }

/* ---------- 9. 模块卡片（第 2 层功能手册） ---------- */
.mod-group { margin: 26px 0 0; }

.mod-group > .mod-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}
.mod-group > .mod-group-head .cnt {
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 1px 9px;
}
.mod-group > .mod-group-head .ent {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--faint);
}
/* 分组折叠按钮：第 2 章 80 个模块太长，折叠后才好定位 */
.mod-group > .mod-group-head .mod-group-toggle {
  margin-left: auto;
  flex: none;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--faint);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: inherit;
  padding: 2px 11px;
  cursor: pointer;
}
.mod-group > .mod-group-head .mod-group-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.mod-group.collapsed > .mod-grid,
.mod-group.collapsed > figure.shot.real { display: none; }

/* 搜索过滤：命中的留下，没命中的整卡收起 */
.mod.search-hidden { display: none; }
.mod-group.search-empty { display: none; }

/* 只看文字：第 2 章配图整块收起来，页面从 8 万 px 缩到 1 万 px */
#handbook.no-shots figure.mod-shot,
#handbook.no-shots figure.shot.real { display: none; }

/* 工具条：搜索 + 两个开关 */
.hb-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0 6px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
}
.hb-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 320px;
  min-width: 0;
}
.hb-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 13.5px;
  font-family: inherit;
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.hb-search input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
}
.hb-count {
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}
.hb-count.is-zero { color: var(--warn); font-weight: 700; }
.hb-toggles { display: flex; gap: 8px; }
.hb-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: 9px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.hb-btn:hover { color: var(--accent); border-color: var(--accent); }
.hb-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.hb-hint {
  font-size: 12.5px;
  color: var(--faint);
  margin: 0 0 4px;
}

/* 第 2 章：每个模块都配一张实拍图，所以整章统一单列。
   网格里一卡只有 ~340px 宽，1065 宽的截图缩进去字全糊；
   单列后图能铺满卡片宽度，截图里的按钮文字可读。 */
.mod-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.mod {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 14px 16px;
  box-shadow: 0 2px 8px var(--shadow);
}

figure.mod-shot {
  margin: 10px 0 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated);
}
figure.mod-shot .shot-frame {
  position: relative;
  background: var(--bg-elevated);
}
figure.mod-shot img { display: block; width: 100%; height: auto; }
figure.mod-shot figcaption {
  padding: 7px 12px 8px;
  font-size: 12.5px;
  color: var(--faint);
  line-height: 1.6;
  border-top: 1px solid var(--border-color);
}

/* 实拍图可点开 1:1 原图（跟参考手册一致），角标只在悬停/聚焦时出现 */
.gs-open {
  display: block;
  position: relative;
  line-height: 0;
  cursor: zoom-in;
}
.gs-open img { display: block; width: 100%; height: auto; }
.gs-zoom {
  position: absolute;
  right: 8px;
  top: 8px;
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.gs-open:hover .gs-zoom,
.gs-open:focus-visible .gs-zoom { opacity: 1; }
@media (hover: none) {
  .gs-zoom { opacity: 0.85; }
}

/* 图下的编号说明列表：与图里徽标一一对应 */
.gs-legend {
  list-style: none;
  margin: 0;
  padding: 9px 12px 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  font-size: 12.5px;
  color: var(--muted);
}
.gs-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gs-lb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  flex: none;
}
.mod > .mod-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.mod > .mod-top .ic { font-size: 17px; line-height: 1; }
.mod > .mod-top .nm { font-weight: 700; font-size: 15px; }
.mod > .mod-top .badge {
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
  border: 1px solid var(--border-color);
  color: var(--faint);
  white-space: nowrap;
}
.mod > .mod-top .badge.guest { color: var(--ok); border-color: currentColor; }
.mod > .mod-top .badge.login { color: var(--warn); border-color: currentColor; }
.mod > .mod-top .badge.part { color: var(--accent); border-color: currentColor; }
.mod > .mod-top .badge.hidden { color: var(--faint); }

.mod .what { font-size: 14px; color: var(--text-primary); margin: 0 0 5px; }
.mod .when { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.mod .ops { margin: 0 0 10px; padding-left: 17px; font-size: 13px; color: var(--muted); }
.mod .ops li { margin: 2px 0; }
.mod .ops li b { color: var(--text-secondary); }
.mod .foot {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  border-top: 1px dashed var(--border-color);
  padding-top: 9px;
}
.mod .foot a.mod-link {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 2px 8px;
}
.mod .foot a.mod-link:hover { text-decoration: none; background: var(--accent); color: #fff; }
.mod .foot .src { font-size: 11px; color: var(--faint); }
.mod .foot .todo { font-size: 11.5px; color: var(--warn); font-weight: 700; }

/* ---------- 10. 不可达 / 缺陷表 ---------- */
table.tbl {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 10px;
  font-size: 13.5px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}
table.tbl th, table.tbl td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}
table.tbl th { background: var(--bg-elevated); font-size: 12.5px; color: var(--text-secondary); font-weight: 700; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl td code { font-size: 12px; }
table.tbl .bad { color: var(--bad); font-weight: 700; }
table.tbl .warn { color: var(--warn); font-weight: 700; }
table.tbl .ok { color: var(--ok); font-weight: 700; }

.note-card {
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--callout);
  background: var(--bg-card);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 14px 0;
  font-size: 14px;
  color: var(--muted);
}
.note-card b { color: var(--text-primary); }
.note-card.bad { border-left-color: var(--bad); }
.note-card.info { border-left-color: var(--accent); }

/* ---------- 11. 结尾 CTA ---------- */
.end { padding: 40px 0 10px; }
.cta {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-card);
  box-shadow: 0 2px 8px var(--shadow);
  padding: 24px 26px;
}
.cta h3 { margin: 0 0 8px; font-size: 20px; }
.cta p { color: var(--muted); margin: 0 0 16px; }
.cta .cta-btns { display: flex; gap: 10px; flex-wrap: wrap; }

.foot-note {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  color: var(--faint);
  font-size: 12.5px;
}

/* ---------- 12. 响应式 ---------- */
@media (max-width: 768px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  aside.toc { display: none; }
  .chips .chips-inner { display: flex; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-top: 10px; padding-bottom: 10px; }
  .chips .chips-inner::-webkit-scrollbar { display: none; }
  .chips a { flex: none; }
  .head h1 { font-size: 27px; }
  .chapter h2 { font-size: 23px; }
  .step h3 { font-size: 17px; }
  .mod-grid { grid-template-columns: minmax(0, 1fr); }
  .top .links .hide-sm { display: none; }
  /* 窄屏顶栏只留品牌 + 返回站点 + 主题按钮；章节跳转由下方吸顶 chips 承担 */
  .top .links .plain:not(.keep-sm) { display: none; }
  .wrap { padding-left: 16px; padding-right: 16px; }
}

/* 超窄屏（320px 一类）：品牌文字让位给「返回站点」和主题按钮，避免顶栏撑出横向滚动 */
@media (max-width: 400px) {
  .brand-text { display: none; }
  .top .wrap { gap: 8px; }
}

@media (max-width: 480px) {
  body { font-size: 14.5px; }
  .head { padding-top: 26px; padding-bottom: 6px; }
  .head h1 { font-size: 23px; }
  .head .lede { font-size: 15px; }
  .chapter { padding: 30px 0 18px; }
  .chapter h2 { font-size: 21px; }
  .step { padding-top: 20px; }
  .step h3 { font-size: 16.5px; gap: 9px; }
  .step h3 .n { width: 24px; height: 24px; font-size: 12.5px; border-radius: 7px; }
  .callouts li { padding-left: 28px; font-size: 13.5px; }
  .callouts li .ref { width: 19px; height: 19px; font-size: 11px; }
  .mod { padding: 12px 13px; }
  .top .wrap { min-height: 52px; gap: 10px; }
  .top .links .hide-sm { display: none; }
  .brand { font-size: 14.5px; }
  table.tbl { font-size: 12.5px; }
  table.tbl th, table.tbl td { padding: 7px 9px; }
}

/* ---------- 生产版追加（2026-10-28） ---------- */

/* 入口暂不可用的模块卡：虚线描边 + 弱化，避免用户点进去撞「模块不存在」 */
.mod.broken {
  border-style: dashed;
  border-color: var(--warn);
  background: var(--bg-elevated);
}
.mod.broken .foot .broken-note {
  font-size: 11.5px;
  color: var(--warn);
  font-weight: 700;
}
.mod .foot .mod-link.is-plain {
  color: var(--faint);
  border-style: dashed;
  cursor: default;
}

/* 页脚 */
.guide-foot {
  margin-top: 34px;
  padding-top: 20px;
  padding-bottom: 40px;
  border-top: 1px solid var(--border-color);
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.75;
}
.guide-foot a { color: var(--accent); }

/* ---------- 文末行动号召 ---------- */
.gs-cta {
  margin: 34px 0 0;
  padding: 30px 26px 26px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  text-align: center;
}
.gs-cta .eyebrow { color: rgba(255, 255, 255, 0.78); }
.gs-cta h2 {
  color: #fff;
  margin: 4px 0 8px;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.gs-cta p { color: rgba(255, 255, 255, 0.92); font-size: 14.5px; margin: 0; }
.gs-cta-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 18px 0 12px;
}
.gs-cta-btn {
  display: inline-block;
  padding: 9px 17px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.34);
}
.gs-cta-btn:hover { text-decoration: none; background: rgba(255, 255, 255, 0.28); }
.gs-cta-btn.primary {
  background: #fff;
  color: var(--accent);
  border-color: #fff;
}
.gs-cta-note {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.76);
}
.guide-foot code {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11.5px;
}

/* ============================================================================
   第 0 章「功能全景」（2026-10-29 追加）
   ---------------------------------------------------------------------------
   四块：实数条 → 功能域卡片 → 角色矩阵 → 入口地图。
   卡片刻意做成等高的纯文字网格，不放缩略图：组概览图只有 5 组有，
   放进来会让半数组长得不一样；图仍在第 2 章各组标题下方。
   ========================================================================== */

/* ---- 实数条 ---- */
.ov-stats {
  list-style: none;
  margin: 18px 0 4px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.ov-stats li {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 12px 14px;
  box-shadow: 0 2px 8px var(--shadow);
}
.ov-stats li b {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.ov-stats li span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* ---- 功能域卡片 ---- */
.ov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 12px;
  margin: 16px 0 4px;
}
.ov-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 14px 16px;
  box-shadow: 0 2px 8px var(--shadow);
  scroll-margin-top: 116px;
}
.ov-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.ov-top .ic { font-size: 17px; line-height: 1; }
.ov-top .nm { font-weight: 700; font-size: 15px; }
.ov-top .cnt {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--faint);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 1px 8px;
}
.ov-tag { margin: 0 0 8px; font-size: 13.5px; line-height: 1.65; color: var(--text-primary); }
.ov-who {
  margin: 0 0 10px;
  font-size: 12px;
  /* 用 --muted 而非 --faint：这一行承载「谁在用」的语义，白底上 faint 对比度不足 */
  color: var(--muted);
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
}
.ov-who > span { margin-right: 1px; }
.ov-who .ov-mk { margin-right: 7px; font-style: normal; }
.ov-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.ov-chips a {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--muted);
}
.ov-chips a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.ov-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  font-size: 11.5px;
}
.ov-foot a { color: var(--accent); font-weight: 700; }
.ov-foot .ent { margin-left: auto; color: var(--faint); text-align: right; line-height: 1.5; }

/* ---- 角色矩阵 ---- */
.ov-tablewrap { overflow-x: auto; margin: 14px 0 8px; -webkit-overflow-scrolling: touch; }
table.ov-matrix { min-width: 520px; }
table.ov-matrix th, table.ov-matrix td { text-align: center; }
table.ov-matrix th:first-child, table.ov-matrix td:first-child { text-align: left; }
table.ov-matrix td:first-child a { color: var(--text-primary); font-weight: 600; }
table.ov-matrix td:first-child a:hover { color: var(--accent); text-decoration: none; }
/* 三档标记要有可辨的明度阶梯：● = 强调色 / ○ = muted / – = faint（都能看清，不是空格子） */
.ov-mk { font-size: 15px; font-weight: 800; font-style: normal; line-height: 1; }
.ov-mk.full { color: var(--accent); }
.ov-mk.part { color: var(--muted); }
.ov-mk.none { color: var(--faint); font-weight: 600; }
.ov-legend { font-size: 12px; color: var(--muted); line-height: 1.75; margin: 6px 0 0; max-width: 820px; }
.ov-legend b { color: var(--text-primary); }

/* ---- 入口地图 ---- */
.ov-entry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  margin: 12px 0 0;
}
.ov-entry > div {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-elevated);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
}
.ov-entry b { display: block; margin-bottom: 4px; font-size: 13.5px; color: var(--text-primary); }
.ov-entry code { font-size: 12px; }

@media (max-width: 768px) {
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
  .ov-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-stats li b { font-size: 23px; }
}
@media (max-width: 480px) {
  .ov-card { padding: 12px 13px; }
  .ov-stats li { padding: 10px 12px; }
  .ov-stats li b { font-size: 21px; }
  .ov-entry > div { padding: 10px 12px; font-size: 12.5px; }
}

