/* ==========================================================================
   bracket-williamhill.com.cn — 共享样式 /assets/site.css
   夜色技术台 + 战术板：暖纸底、粗边框、硬阴影、状态色纪律
   ========================================================================== */

/* 1. Reset ----------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(90deg, rgba(15, 26, 22, .035) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg, rgba(15, 26, 22, .035) 0 1px, transparent 1px 48px);
}

h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl { margin: 0; }
ul, ol { padding: 0; }
img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: var(--green); }
table { border-collapse: collapse; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

::selection { background: var(--gold); color: var(--ink); }

/* 2. 变量 ------------------------------------------------------------------ */
:root {
  --ink: #0F1A16;
  --paper: #F4EFE4;
  --paper-2: #E5DCCB;
  --green: #14432E;
  --green-deep: #0B2A1D;
  --up: #3FA76A;
  --red: #6E1D22;
  --gold: #C6A052;
  --amber: #C98A22;
  --out: #8A6A6A;
  --line: #C9C0AC;
  --muted: #5A6B60;
  --board: #2B3A44;

  --font-display: "Songti SC", "Source Han Serif SC", "Noto Serif SC", STSong, SimSun, Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --shell: 1240px;
  --radius: 4px;
  --edge: 2px solid var(--ink);
  --edge-hair: 1px solid var(--line);
  --hard: 6px 6px 0 var(--ink);
  --hard-sm: 4px 4px 0 var(--ink);
  --gutter: clamp(16px, 4vw, 32px);
}

/* 3. 基础排版 -------------------------------------------------------------- */
h1, .h-display {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .01em;
}

h2 { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.35; }
h3 { font-size: 20px; font-weight: 700; line-height: 1.45; }

p + p { margin-top: .85em; }

.lede { font-size: 17px; color: var(--muted); max-width: 68ch; }
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.stat { font-family: var(--font-mono); font-size: 22px; font-weight: 600; letter-spacing: -.01em; }

/* 4. 布局工具 -------------------------------------------------------------- */
.shell {
  width: min(100% - 2 * var(--gutter), var(--shell));
  margin-inline: auto;
}

.stack { display: flex; flex-direction: column; gap: 18px; }
.stack--tight { gap: 10px; }

.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.split { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; }
.narrow { max-width: 720px; }

.scroller { overflow-x: auto; overflow-y: hidden; padding-bottom: 8px; }

/* 5. 章节 ------------------------------------------------------------------ */
.section { padding: clamp(36px, 6vw, 64px) 0; }
.section--band { background: var(--paper-2); border-top: var(--edge); border-bottom: var(--edge); }
.section--dark {
  background: var(--green);
  color: var(--paper);
  border-top: var(--edge);
  border-bottom: var(--edge);
}
.section--dark a { color: var(--gold); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 24px;
  border-bottom: var(--edge);
}
.section-head__no {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .12em;
  color: var(--red);
}
.section-head__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 600;
}
.section-head__meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--muted);
}
.section--dark .section-head { border-bottom-color: rgba(244, 239, 228, .35); }
.section--dark .section-head__meta { color: rgba(244, 239, 228, .7); }

/* 6. 卡片 / 注释 ----------------------------------------------------------- */
.card {
  position: relative;
  background: var(--paper);
  border: var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--hard);
  padding: 20px;
}
.card--dark { background: var(--green); color: var(--paper); }
.card--dark a { color: var(--gold); }
.card__label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.card--dark .card__label { color: var(--gold); }

.note {
  background: var(--paper-2);
  border-left: 4px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--muted);
}
.note__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
  margin-right: 8px;
}
.aside-note {
  border-left: 2px solid var(--line);
  padding-left: 14px;
  font-size: 14px;
  color: var(--muted);
}

/* 7. 按钮 ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ink);
  background: var(--paper);
  border: var(--edge);
  border-radius: 2px;
  box-shadow: var(--hard-sm);
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn--gold { background: var(--gold); }
.btn--green { background: var(--green); color: var(--paper); }
.btn--ghost { background: transparent; box-shadow: none; border-color: currentColor; }
.btn--ghost:hover { transform: none; box-shadow: none; background: rgba(198, 160, 82, .18); }

/* 8. 标签 / 状态色 --------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--paper-2);
  color: var(--ink);
}
.tag--up { background: var(--up); color: #07160E; }
.tag--pending { background: var(--amber); }
.tag--out { background: var(--out); color: var(--paper); }

.rail {
  display: flex;
  height: 10px;
  border: var(--edge);
  border-radius: 2px;
  overflow: hidden;
  background: var(--paper-2);
}
.rail__seg { flex: 1 1 0; border-right: 1px solid var(--ink); background: var(--paper-2); }
.rail__seg:last-child { border-right: 0; }
.rail__seg[data-state="up"] { background: var(--up); }
.rail__seg[data-state="pending"] { background: var(--amber); }
.rail__seg[data-state="out"] { background: var(--out); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 8px 14px;
  background: var(--paper-2);
  border: var(--edge);
  border-radius: 2px;
  font-size: 13px;
}
.legend__item { display: inline-flex; align-items: center; gap: 7px; }
.legend__dot {
  width: 10px;
  height: 10px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--line);
}
.legend__dot[data-state="up"] { background: var(--up); }
.legend__dot[data-state="pending"] { background: var(--amber); }
.legend__dot[data-state="out"] { background: var(--out); }

/* 9. 表格 ------------------------------------------------------------------ */
.table { width: 100%; font-size: 15px; }
.table th {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: left;
  padding: 10px 12px;
  border-bottom: var(--edge);
  background: var(--paper-2);
}
.table td { padding: 10px 12px; border-bottom: var(--edge-hair); }
.table tbody tr:nth-child(even) { background: rgba(229, 220, 203, .55); }
.table .num, .table td.num { text-align: right; font-family: var(--font-mono); }
.table--dark { color: var(--paper); }
.table--dark th { background: var(--green-deep); border-bottom-color: var(--ink); color: var(--gold); }
.table--dark td { border-bottom-color: rgba(244, 239, 228, .18); }
.table--dark tbody tr:nth-child(even) { background: rgba(244, 239, 228, .06); }

/* 10. 图片容器 ------------------------------------------------------------- */
.media {
  position: relative;
  overflow: hidden;
  border: var(--edge);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.72) contrast(1.03); }
.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--wide { aspect-ratio: 21 / 9; }
.media--square { aspect-ratio: 1 / 1; }
.media--pattern {
  background-image:
    repeating-linear-gradient(45deg, rgba(43, 58, 68, .14) 0 6px, transparent 6px 14px);
  min-height: 140px;
}
.media__cap {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .05em;
  color: var(--muted);
}

/* 11. 面包屑 / 目录 -------------------------------------------------------- */
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--line); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--green); text-decoration: underline; }

.toc { position: sticky; top: 96px; }
.toc ol { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.toc__link {
  display: flex;
  gap: 10px;
  padding: 7px 10px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  border-left: 3px solid var(--line);
  transition: color .12s ease, border-color .12s ease, background-color .12s ease;
}
.toc__link:hover { background: var(--paper-2); }
.toc__link[data-active] {
  border-left-color: var(--gold);
  background: var(--paper-2);
  font-weight: 700;
  color: var(--green);
}
.toc__no { font-family: var(--font-mono); font-size: 12px; color: var(--red); }

/* 12. 头部 ----------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 120;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border: var(--edge);
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  background: var(--paper);
}

.note-toggle {
  padding: 6px 12px;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--paper);
  background: transparent;
  border: 1px solid rgba(244, 239, 228, .5);
  border-radius: 2px;
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background-color .12s ease;
}
.note-toggle:hover { color: var(--gold); border-color: var(--gold); background: rgba(244, 239, 228, .1); }
.note-toggle[aria-expanded="true"] { color: var(--ink); background: var(--gold); border-color: var(--ink); }

.masthead {
  background-color: var(--green);
  color: var(--paper);
  border-bottom: var(--edge);
  background-image: repeating-linear-gradient(90deg, rgba(244, 239, 228, .06) 0 1px, transparent 1px 44px);
  max-height: 420px;
  opacity: 1;
  overflow: hidden;
  transition: max-height .25s ease, opacity .2s ease;
}
.site-header.is-tight .masthead { max-height: 0; opacity: 0; }
.site-header.is-note-open .masthead { max-height: 720px; opacity: 1; }

.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
}
.masthead__brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.masthead__mark {
  flex: 0 0 auto;
  width: 14px;
  height: 28px;
  border: 2px solid var(--gold);
  border-radius: 2px;
  box-shadow: inset 0 -10px 0 0 var(--gold);
}
.masthead__text { display: block; }
.masthead__name { display: block; font-size: 16px; font-weight: 700; letter-spacing: .04em; line-height: 1.25; }
.masthead__sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(244, 239, 228, .66);
}
.masthead__tagline {
  font-size: 14px;
  color: rgba(244, 239, 228, .78);
  border-left: 2px solid var(--gold);
  padding-left: 12px;
}
.masthead__tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.masthead__fix {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: var(--gold);
  border: var(--edge);
  border-radius: 2px;
  text-decoration: none;
  box-shadow: 3px 3px 0 rgba(15, 26, 22, .55);
}
.masthead__fix:hover { background: var(--paper); }

.scope-note {
  background: var(--paper-2);
  border-top: var(--edge-hair);
  border-bottom: var(--edge);
  color: var(--ink);
}
.scope-note__inner { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; padding: 14px 0; }
.scope-note__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--ink);
  padding: 3px 8px;
  border-radius: 2px;
}
.scope-note__body { font-size: 14px; color: var(--muted); max-width: 82ch; }

.capsule { position: relative; z-index: 78; padding: 10px 0 14px; transition: padding .2s ease; }
.site-header.is-tight .capsule { padding: 6px 0 10px; }

.capsule__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 10px 8px 18px;
  background: var(--paper);
  border: var(--edge);
  border-radius: 999px;
  box-shadow: var(--hard-sm);
}
.capsule__brand {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green);
  text-decoration: none;
  white-space: nowrap;
  padding-right: 14px;
  border-right: var(--edge);
}
.capsule__brand:hover { color: var(--red); }

.capsule__nav { flex: 1 1 auto; min-width: 0; }
.capsule__nav ul { display: flex; flex-wrap: wrap; gap: 2px; list-style: none; margin: 0; padding: 0; }
.capsule__nav a {
  display: block;
  padding: 7px 12px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.capsule__nav a:hover { background: var(--paper-2); border-color: var(--line); }
.capsule__nav a[aria-current="page"] {
  background: var(--green);
  color: var(--paper);
  border-color: var(--ink);
  font-weight: 700;
}

.capsule__switch { display: flex; gap: 6px; margin-left: auto; }
.switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  font-size: 13px;
  color: var(--ink);
  background: var(--paper-2);
  border: var(--edge);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .12s ease, color .12s ease;
}
.switch-btn:hover { background: var(--paper); }
.switch-btn[aria-expanded="true"] { background: var(--ink); color: var(--paper); }
.switch-btn__value { font-family: var(--font-mono); font-size: 12px; color: var(--red); }
.switch-btn[aria-expanded="true"] .switch-btn__value { color: var(--gold); }

.nav-toggle {
  display: none;
  margin-left: auto;
  padding: 8px 15px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  background: var(--gold);
  border: var(--edge);
  border-radius: 999px;
  cursor: pointer;
}
.nav-toggle[aria-expanded="true"] { background: var(--green); color: var(--paper); }

.switch-panel {
  position: absolute;
  left: 50%;
  top: calc(100% - 6px);
  transform: translateX(-50%);
  width: min(100%, 780px);
  padding: 16px;
  background: var(--paper);
  border: var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--hard);
  z-index: 80;
}
.switch-panel__title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--ink);
  background: var(--paper-2);
  border: var(--edge);
  border-radius: 2px;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease, box-shadow .12s ease;
}
.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--line);
}
.chip[data-state="up"]::before { background: var(--up); }
.chip[data-state="pending"]::before { background: var(--amber); }
.chip[data-state="out"]::before { background: var(--out); }
.chip:hover { background: var(--paper); }
.chip[aria-pressed="true"] { background: var(--green); color: var(--paper); box-shadow: var(--hard-sm); }
.chip[aria-pressed="true"]::before { background: var(--gold); }

.capsule__progress {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 6px;
  height: 3px;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
}
.capsule__progress span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .12s linear; }

/* 13. 页脚 ---------------------------------------------------------------- */
.site-footer {
  position: relative;
  margin-top: 64px;
  background: var(--ink);
  color: var(--paper);
  border-top: 6px solid var(--green);
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(244, 239, 228, .045) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg, rgba(244, 239, 228, .045) 0 1px, transparent 1px 30px);
}
.site-footer .shell { position: relative; z-index: 1; }

.footer-top {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 2.2fr);
  gap: 40px;
  padding: 52px 0 34px;
}
.footer-brand__name { font-family: var(--font-display); font-size: 26px; font-weight: 600; line-height: 1.3; }
.footer-brand__line { margin: 6px 0 18px; font-size: 14px; color: rgba(244, 239, 228, .68); }

.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.footer-col__heading {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(198, 160, 82, .45);
}
.footer-col__list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-col__list a {
  font-size: 14px;
  color: rgba(244, 239, 228, .84);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.footer-col__list a:hover { color: var(--gold); border-bottom-color: var(--gold); }
.footer-col__list li::before { content: "— "; color: var(--gold); font-family: var(--font-mono); font-size: 12px; }

.footer-contact {
  padding: 20px 0;
  border-top: 1px solid rgba(244, 239, 228, .18);
}
.footer-contact__line {
  font-family: var(--font-mono);
  font-size: 13.5px;
  letter-spacing: .02em;
  color: var(--paper);
  word-break: break-word;
}
.footer-contact__note { margin-top: 8px; font-size: 13px; color: rgba(244, 239, 228, .62); max-width: 78ch; }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 18px 0 40px;
  border-top: 1px solid rgba(244, 239, 228, .18);
}
.footer-legal__closing { font-size: 13px; color: rgba(244, 239, 228, .62); }
.footer-legal__meta {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: rgba(244, 239, 228, .72);
}
.footer-legal__icp { color: var(--gold); }

/* 14. 动效与显现 ----------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}
[data-reveal].is-in { opacity: 1; transform: none; }

.to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 90;
  width: 46px;
  height: 46px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  background: var(--gold);
  border: var(--edge);
  border-radius: 2px;
  box-shadow: var(--hard-sm);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease, transform .12s ease;
}
.to-top.is-on { opacity: 1; visibility: visible; }
.to-top:hover { transform: translate(-2px, -2px); }

/* 15. 响应式 --------------------------------------------------------------- */
@media (max-width: 1080px) {
  .split { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
}

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

  .masthead__tagline { display: none; }
  .masthead__tools { margin-left: auto; }

  .capsule__inner {
    flex-wrap: wrap;
    border-radius: var(--radius);
    padding: 12px;
    gap: 10px;
  }
  .capsule__brand { border-right: 0; padding-right: 0; }
  .nav-toggle { display: inline-flex; }
  .capsule__switch { margin-left: 0; }

  .capsule__nav {
    order: 5;
    flex: 1 1 100%;
    display: none;
    border-top: var(--edge-hair);
    padding-top: 10px;
  }
  .capsule__nav[data-open] { display: block; }
  .capsule__nav ul { flex-direction: column; gap: 2px; }
  .capsule__nav a { border-radius: 2px; padding: 10px 12px; }
  .capsule__nav a[aria-current="page"] { border-color: var(--green); }

  .switch-panel {
    position: static;
    transform: none;
    width: 100%;
    left: auto;
    top: auto;
    box-shadow: none;
    margin-top: 10px;
  }

  .capsule__progress { left: 12px; right: 12px; bottom: 4px; }

  .footer-cols { grid-template-columns: 1fr; gap: 24px; }

  .toc { position: static; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .masthead__inner { gap: 12px; }
  .masthead__sub { letter-spacing: .1em; }
  .section-head__meta { margin-left: 0; flex-basis: 100%; }
  .card { box-shadow: 4px 4px 0 var(--ink); padding: 16px; }
  .to-top { right: 12px; bottom: 14px; }
  .footer-legal__meta { margin-left: 0; }
}

/* 16. 减少动效 ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .btn:hover { transform: none; }
  .to-top:hover { transform: none; }
  .capsule__progress span { transition: none; }
}
