/* MySQL · 不看视频 SSH 实操 —— 静态阅读版式
   设计目标：电脑分屏（680–900px）舒适、手机不横溢、正文 16–18px / 行高 1.75–1.9。
   零外网依赖：不引字体、不引 CDN、无动画库。 */

:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --paper: #ffffff;
  --text: #1e2126;
  --muted: #5d646d;
  --line: #ddd8ce;
  --line-soft: #ece7dd;
  --accent: #8a5a12;
  --accent-strong: #6d470e;
  --accent-soft: #f7efe0;
  --code-bg: #f4f1e9;
  --shell: #3f6b9c;
  --shell-soft: #eaf1f9;
  --mysql: #8a5a12;
  --mysql-soft: #f7efe0;
  --out: #5d646d;
  --out-soft: #f1f0ec;
  --danger: #8a3a2f;
  --fs: 17px;
  --lh: 1.82;
  --radius: 8px;
  --col: 900px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (min-width: 1100px) {
  :root { --fs: 17.5px; --lh: 1.8; }
}
@media (max-width: 520px) {
  :root { --fs: 16.5px; --lh: 1.78; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181b;
    --paper: #1c2024;
    --text: #e7e5df;
    --muted: #a9b0b8;
    --line: #343a40;
    --line-soft: #2a2f34;
    --accent: #dcb178;
    --accent-strong: #f0c98f;
    --accent-soft: #2a2419;
    --code-bg: #22262b;
    --shell: #8fb0d8;
    --shell-soft: #1e2833;
    --mysql: #dcb178;
    --mysql-soft: #2a2419;
    --out: #a9b0b8;
    --out-soft: #212528;
    --danger: #e0a094;
  }
}

:root[data-theme="dark"] {
  --bg: #15181b;
  --paper: #1c2024;
  --text: #e7e5df;
  --muted: #a9b0b8;
  --line: #343a40;
  --line-soft: #2a2f34;
  --accent: #dcb178;
  --accent-strong: #f0c98f;
  --accent-soft: #2a2419;
  --code-bg: #22262b;
  --shell: #8fb0d8;
  --shell-soft: #1e2833;
  --mysql: #dcb178;
  --mysql-soft: #2a2419;
  --out: #a9b0b8;
  --out-soft: #212528;
  --danger: #e0a094;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: auto;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs);
  line-height: var(--lh);
}

p, li, td, th, summary, dd, dt, h1, h2, h3 { overflow-wrap: anywhere; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
.tablewrap:focus-visible,
pre:focus-visible,
.main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 90;
  padding: 12px 16px;
  background: var(--paper);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}
.skip:focus { left: 8px; }

/* ---------------- 顶栏 ---------------- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px 8px;
  flex-wrap: nowrap;
}
.brand {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.brand-sub {
  display: block;
  font-weight: 400;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.bar-tools { display: flex; gap: 6px; flex: 0 0 auto; }

.btn {
  font: inherit;
  font-size: 0.76rem;
  line-height: 1.2;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent-strong); }

/* 只有“没有 JS”时才隐藏增强控件；有 JS 时各元素保持自己的 display */
html:not(.js) .js-only { display: none !important; }
[hidden] { display: none !important; }

/* ---------------- 布局 ---------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 72px;
}
@media (min-width: 1024px) {
  .layout {
    grid-template-columns: 15.5rem minmax(0, 1fr);
    gap: 2.4rem;
    align-items: start;
    padding-bottom: 96px;
  }
}
.main { min-width: 0; }
.lesson { max-width: var(--col); }

/* ---------------- 侧栏 / 目录 ---------------- */
.side {
  min-width: 0;
  font-size: 0.84rem;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 10px;
}
.side-head { padding: 4px 0 8px; }
.side-unit {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.side-title { margin: 2px 0 0; font-weight: 600; font-size: 0.92rem; line-height: 1.5; }

.side-nav { margin-top: 4px; }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li { margin: 2px 0; }
.lesson-link {
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 6px;
  min-height: 44px;
  padding: 9px 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  line-height: 1.45;
}
.lesson-link:hover { background: var(--accent-soft); }
.lesson-link .num { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); }
.lesson-link .lt { min-width: 0; }
.lesson-link .lc { font-size: 0.68rem; color: var(--muted); white-space: nowrap; }
.lesson-link.is-current {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 600;
}
.lesson-link.is-current .num { color: var(--accent-strong); }

.side-foot {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.76rem;
}
.side-foot a { color: var(--muted); text-decoration: none; min-height: 32px; }
.side-foot a:hover { color: var(--accent-strong); text-decoration: underline; }

/* 手机/窄屏：抽屉式目录（无 JS 时静态展开，正文仍可读） */
@media (max-width: 1023px) {
  html.js .side {
    position: fixed;
    z-index: 80;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(84vw, 20rem);
    background: var(--paper);
    border-right: 1px solid var(--line);
    border-bottom: 0;
    margin: 0;
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
    overflow-y: auto;
    transform: translateX(-102%);
    transition: transform 0.18s ease-out;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }
  html.js body.nav-open .side {
    transform: translateX(0);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.18);
  }
  html.js body.nav-open { overflow: hidden; }
  .scrim {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(20, 20, 20, 0.32);
    border: 0;
    padding: 0;
  }
}
@media (min-width: 1024px) {
  .scrim { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html.js .side { transition: none; }
}

/* ---------------- 正文排版 ---------------- */
.eyebrow {
  margin: 6px 0 2px;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
h1 {
  font-size: 1.46rem;
  line-height: 1.36;
  margin: 0.15em 0 0.3em;
  letter-spacing: 0.005em;
}
.sub { margin: 0 0 0.7rem; color: var(--muted); font-size: 0.96rem; }
.meta { margin: 0 0 0.9rem; font-size: 0.76rem; color: var(--muted); }

h2 {
  font-size: 1.1rem;
  line-height: 1.45;
  margin: 0 0 0.35em;
  border: 0;
}
h3 {
  font-size: 1rem;
  line-height: 1.5;
  margin: 1.5em 0 0.35em;
  color: var(--accent-strong);
}
p { margin: 0.62em 0; }
strong { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--line-soft); margin: 1.6em 0; }

blockquote {
  margin: 0.9em 0;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
blockquote p { margin: 0.3em 0; }

ul, ol { margin: 0.55em 0 0.7em; padding-left: 1.4em; }
li { margin: 0.32em 0; }
li > ul, li > ol { margin: 0.25em 0; }

.lead { margin: 0.6rem 0 1.4rem; }
.lead p:first-child { margin-top: 0; }

/* 代码块图例：左右两块牌子 */
.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0.9rem 0 1.1rem;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.6;
}
.lg {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.lg-shell { color: var(--shell); background: var(--shell-soft); }
.lg-mysql { color: var(--mysql); background: var(--mysql-soft); }
.lg-out { color: var(--out); background: var(--out-soft); }
.lg-note { flex: 1 1 14rem; }
.lg-note code { font-size: 0.95em; }

/* 页内步骤小导航 */
.stepnav { margin: 0 0 1.2rem; }
.stepnav-label {
  margin: 0 0 5px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.stepnav-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 40px;
  max-width: 16rem;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--text);
  text-decoration: none;
  font-size: 0.78rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip:hover { border-color: var(--accent); color: var(--accent-strong); }
.chip .cn { font-family: var(--font-mono); color: var(--accent); font-size: 0.72rem; }

.progline {
  margin: 0 0 1.4rem;
  font-size: 0.74rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.linkbtn {
  font: inherit;
  font-size: 0.74rem;
  min-height: 32px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}
.linkbtn:hover { color: var(--danger); }


/* 步骤卡：轻量，不做仪表盘 */
.step {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--accent-soft);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  margin: 0 0 1.15rem;
  scroll-margin-top: 12px;
}
@media (min-width: 720px) {
  .step { padding: 18px 22px 20px; margin-bottom: 1.35rem; }
}
.step-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 0.35rem; }
.stepnum {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  transform: translateY(0.12em);
}
.step-head h2 { margin: 0; }

.done {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px;
  margin: 0 0 0.5rem;
  border: 1px dashed var(--line);
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
}
.done input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.step.is-done { border-left-color: var(--accent); }
.step.is-done .done { color: var(--accent-strong); border-style: solid; }

/* ---------------- 代码 ---------------- */
.cb {
  margin: 0.75rem 0 0.85rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 6px;
  background: var(--code-bg);
  overflow: hidden;
}
.cb-shell { border-left-color: var(--shell); }
.cb-mysql { border-left-color: var(--mysql); }
.cb-output { border-left-color: var(--out); border-style: solid; background: var(--out-soft); }
.cb-other { border-left-color: var(--line); }

.cb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  font-size: 0.72rem;
  min-height: 40px;
}
.cb-tag {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
  font-size: 0.7rem;
}
.cb-tag.t-shell { color: var(--shell); background: var(--shell-soft); }
.cb-tag.t-mysql { color: var(--mysql); background: var(--mysql-soft); }
.cb-tag.t-output { color: var(--out); background: var(--out-soft); }
.cb-tag.t-other { color: var(--muted); }
.cb-file {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-copy {
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.72rem;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.btn-copy:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn-copy[data-state="ok"] { border-color: var(--accent); color: var(--accent-strong); }
.btn-copy[data-state="err"] { border-color: var(--danger); color: var(--danger); }
.ro { flex: 0 0 auto; font-size: 0.68rem; color: var(--out); }

pre {
  margin: 0;
  padding: 10px 12px 12px;
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.65;
  tab-size: 2;
}
pre code { white-space: pre; }
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.04em 0.28em;
}
pre code { background: none; border: 0; padding: 0; font-size: 1em; }

/* ---------------- 折叠：提示 / 答案 ---------------- */
.fold {
  margin: 0.8rem 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
}
.fold > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 0.86rem;
  line-height: 1.5;
  list-style: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: "+";
  margin-left: auto;
  font-family: var(--font-mono);
  color: var(--muted);
}
.fold[open] > summary::after { content: "−"; }
.fold > summary:hover { color: var(--accent-strong); }
.fold-body { padding: 2px 12px 12px; border-top: 1px solid var(--line-soft); }
.fold-body > :first-child { margin-top: 0.5em; }
.fold-kind {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  border: 1px solid currentColor;
}
.k-hint { color: var(--shell); background: var(--shell-soft); }
.k-answer { color: var(--accent-strong); background: var(--accent-soft); }
.k-note { color: var(--muted); background: var(--out-soft); }
.k-warn { color: var(--danger); background: transparent; }

/* ---------------- 表格 ---------------- */
.tablewrap {
  overflow-x: auto;
  max-width: 100%;
  margin: 0.7rem 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  -webkit-overflow-scrolling: touch;
}
table { border-collapse: collapse; width: 100%; font-size: 0.84rem; line-height: 1.6; }
th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; white-space: nowrap; background: var(--paper); }
tbody tr:last-child td { border-bottom: 0; }

/* ---------------- 首页列表 ---------------- */
.howto {
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 14px;
  margin: 1rem 0 1.5rem;
  font-size: 0.94rem;
}
.howto p { margin: 0.45em 0; }

.leslist { list-style: none; margin: 1rem 0 0; padding: 0; }
.lesrow { margin: 0; border-bottom: 1px solid var(--line-soft); }
.lesrow > a {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 4px 10px;
  min-height: 56px;
  padding: 12px 6px;
  text-decoration: none;
  color: var(--text);
}
.lesrow > a:hover { background: var(--accent-soft); }
.lnum { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); }
.lbody { min-width: 0; }
.lbody strong { font-weight: 600; }
.lsum { display: block; font-size: 0.8rem; color: var(--muted); line-height: 1.55; font-weight: 400; }
.lmeta { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.lprog { font-size: 0.72rem; color: var(--accent); white-space: nowrap; }

.dl { margin-top: 1.8rem; }
.dl h2 { font-size: 1rem; }
.plain { list-style: none; padding: 0; margin: 0.5rem 0; }
.plain li { margin: 0.35em 0; font-size: 0.9rem; }
.mut { color: var(--muted); font-size: 0.78rem; }

/* ---------------- 翻页 / 页脚 ---------------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 1.9rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.pager a {
  display: block;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  text-decoration: none;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.5;
}
.pager a span { color: var(--text); font-size: 0.86rem; }
.pager a:hover { border-color: var(--accent); }
.pager .next { text-align: right; }
@media (max-width: 520px) {
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { text-align: left; }
}

.foot {
  margin-top: 1.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.74rem;
  line-height: 1.7;
  color: var(--muted);
}
.foot p { margin: 0.35em 0; }

.fixture {
  max-width: 1200px;
  margin: 10px auto 0;
  padding: 10px 14px;
  border: 1px dashed var(--danger);
  border-radius: 6px;
  color: var(--danger);
  font-size: 0.78rem;
  line-height: 1.6;
}
.fixture code { font-size: 0.95em; }

/* ---------------- 打印 ---------------- */
@media print {
  :root {
    --bg: #fff; --paper: #fff; --text: #000; --muted: #333;
    --line: #999; --line-soft: #bbb; --accent: #000; --accent-soft: #eee;
    --code-bg: #f5f5f5; --shell: #000; --mysql: #000; --out: #333;
  }
  body { font-size: 10.8pt; line-height: 1.55; }
  .bar, .skip, .side, .scrim, .stepnav, .progline, .pager, .fixture, .js-only,
  .btn-copy, .done, .legend { display: none !important; }
  .layout { display: block; max-width: none; padding: 0; }
  .lesson { max-width: none; }
  .step { border: 1px solid #999; break-inside: auto; padding: 10px 12px; }
  h1, h2, h3 { break-after: avoid; }
  .cb, .tablewrap, .fold { break-inside: avoid; }
  pre { white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid #999; font-size: 9pt; }
  .cb { border-left-width: 1px; }
  details > summary { list-style: none; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; }
}

/* 触屏/窄屏：可点区域一律 ≥44px（详情折叠已是 44px，这里补齐按钮与小链接） */
@media (max-width: 720px), (pointer: coarse) {
  .btn-copy { min-height: 44px; padding: 10px 14px; }
  .chip { min-height: 44px; padding: 10px 12px; }
  .linkbtn { min-height: 44px; padding: 10px 2px; }
  .side-foot a { display: flex; align-items: center; min-height: 44px; }
}

/* ---------------- 普通小节 / 首页附加信息 ---------------- */
.sec {
  margin: 1.9rem 0 0;
  padding-top: 1.05rem;
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: 12px;
}
.sec > h2 { margin: 0 0 0.4em; }
.sec:first-of-type { margin-top: 1.2rem; }

.chip-plain { color: var(--muted); }
.chip-plain:hover { color: var(--accent-strong); }
.cn-dot { color: var(--muted); font-weight: 700; }

.prereq { margin: 1.2rem 0 0; }
.prereq h2 { font-size: 0.96rem; border: 0; margin: 0 0 0.25em; }
.prereq .plain li { font-size: 0.88rem; margin: 0.3em 0; }

.scope { margin-top: 1.6rem; }
.scope-h { margin: 0.7em 0 0.2em; font-weight: 600; font-size: 0.86rem; }
.scope ul { margin: 0.2em 0 0.4em; font-size: 0.86rem; }

.verify { font-size: 0.76rem; margin: 1.5rem 0 0; }

/* ---------------- 多单元（第二单元及以后）：首页分单元、侧栏分组 ---------------- */
/* 只在多单元构建里出现；单单元页面不渲染这些元素，样式不影响已发布的 3 节。 */
.unit-block {
  margin: 2.1rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 12px;
}
.unit-block:first-of-type { margin-top: 1.4rem; }
.unit-block .eyebrow { margin: 0 0 2px; }
.unit-h { font-size: 1.22rem; margin: 0 0 0.3em; }
.unit-block .meta { margin: 0 0 0.6rem; }
.unit-block .leslist { margin-top: 0.6rem; }
.unit-block .scope { margin-top: 1.1rem; }
.unit-block + .unit-block { margin-top: 2.6rem; }

.side-group { margin: 0 0 12px; }
.side-group + .side-group { padding-top: 10px; border-top: 1px solid var(--line-soft); }
.side-group .side-nav { margin-top: 2px; }
@media (max-width: 1023px) {
  /* 抽屉里两个单元也不挤：单元标题略小、行距收紧，但不小于 44px 可点高度 */
  .side-group .side-head { padding: 2px 0 6px; }
}


/* ------------------------------------------------------------------ */
/* 9 单元 / 21 节：侧栏按单元折叠（原生 <details>，无 JS 也能用）      */
/* ------------------------------------------------------------------ */
.side-fold { margin: 0; }
.side-fold-sum {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 8px;
  min-height: 44px;
  padding: 8px 8px 8px 26px;
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
  position: relative;
}
.side-fold-sum::-webkit-details-marker { display: none; }
.side-fold-sum::before {
  content: "▸";
  position: absolute;
  left: 8px;
  top: 10px;
  font-size: 0.7rem;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.side-fold[open] > .side-fold-sum::before { transform: rotate(90deg); }
.side-fold-sum:hover { background: var(--accent-soft); }
.side-fold-sum .side-unit,
.side-fold-sum .side-title { display: block; grid-column: 1; }
.side-fold-n { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 0.68rem; color: var(--muted); white-space: nowrap; }
.side-fold[open] > .side-fold-sum { border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.side-group.is-current > .side-fold > .side-fold-sum { color: var(--text); }

/* 旧节正文里的“下一节还没写” → 渲染器补的真实衔接卡 */
.handoff {
  margin: 1.1rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent, #b4761f);
  border-radius: 8px;
  background: var(--accent-soft);
}
.handoff-label { margin: 0 0 0.5rem; font-size: 0.84rem; color: var(--muted); }
.handoff-link {
  display: block;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}
.handoff-link span { display: block; font-weight: 400; font-size: 0.82rem; color: var(--muted); margin-top: 2px; }

/* 覆盖核对表 */
.covcta { margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.covcta a { font-weight: 600; }
.covcta .mut { font-size: 0.8rem; }
.cov-verdict {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 0.9rem;
  line-height: 1.6;
}
.cov-verdict.is-open { background: var(--accent-soft); }
.cov-note { font-size: 0.86rem; color: var(--muted); }
.cov-note p { margin: 0 0 0.6rem; }
.covwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0 0; border: 1px solid var(--line-soft); border-radius: 8px; }
.covtable { width: 100%; border-collapse: collapse; font-size: 0.8rem; min-width: 640px; }
.covtable th,
.covtable td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.covtable thead th { position: sticky; top: 0; background: var(--bg, #fff); font-size: 0.74rem; color: var(--muted); }
.covtable tbody th { font-family: var(--font-mono); font-size: 0.76rem; white-space: nowrap; }
.covtable tr[data-state="pending"] td:nth-child(5) { color: var(--muted); }
@media (max-width: 640px) {
  .covtable { min-width: 560px; }
  .covtable td,
  .covtable th { padding: 5px 6px; }
}
