/* ============================================================
   多盈官网 · 共享站点样式 /assets/site.css
   头部 · 页脚 · 通用排版 · 网格 · 基础组件
   ============================================================ */

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

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul, ol { padding: 0; }

img, svg, video { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid #C8362B;
  outline-offset: 3px;
}

/* ---------- 2. Design tokens ---------- */
:root {
  --ink: #241E1A;
  --indigo: #1B2A4A;
  --indigo-deep: #131F38;
  --sand: #E2D3BA;
  --cream: #F7F1E6;
  --paper: #FDFCF8;
  --vermilion: #C8362B;
  --vermilion-deep: #A32A20;
  --turquoise: #17806B;
  --turquoise-deep: #0F5A4C;
  --blue: #2C6FB5;
  --yellow: #D99411;
  --green: #3F8F4F;
  --stone: #A79880;

  --line: rgba(36, 30, 26, 0.16);
  --line-soft: rgba(36, 30, 26, 0.09);
  --line-strong: #A79880;
  --line-light: rgba(247, 241, 230, 0.22);
  --line-light-soft: rgba(247, 241, 230, 0.12);

  --font-head: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;

  --w-max: 1280px;
  --gutter: 24px;
  --header-h: 74px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 3. Base typography ---------- */
body {
  min-height: 100vh;
  background-color: var(--cream);
  background-image:
    linear-gradient(180deg, rgba(27, 42, 74, 0.05), rgba(27, 42, 74, 0) 360px),
    repeating-linear-gradient(90deg, rgba(36, 30, 26, 0.028) 0 1px, transparent 1px 96px);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 1.9vw, 1.75rem); font-weight: 700; letter-spacing: -0.01em; }
h4 { font-size: 1.25rem; font-weight: 700; letter-spacing: 0; }

p { text-wrap: pretty; }

code, kbd, samp, .mono {
  font-family: var(--font-mono);
  font-size: 0.86em;
  letter-spacing: 0.02em;
}

strong { font-weight: 700; }

::selection {
  background: var(--vermilion);
  color: #fff;
}

/* ---------- 4. Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--w-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: 880px; }

.section { padding-block: clamp(48px, 7vw, 96px); }

.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.panel-ink {
  background: var(--indigo);
  color: var(--cream);
  padding: clamp(24px, 4vw, 48px);
}

.panel-ink h2,
.panel-ink h3 { color: var(--cream); }

.panel-sand {
  background: var(--sand);
  padding: clamp(24px, 4vw, 48px);
}

.lede {
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.8;
  color: rgba(36, 30, 26, 0.78);
  max-width: 62ch;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  line-height: 1.6;
  color: var(--vermilion);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  flex: none;
}

/* 统计断点带 */
.stat-band {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(253, 252, 248, 0.6);
}

.stat {
  padding: 22px clamp(16px, 2vw, 28px);
  border-top: 1px solid var(--line);
}

.stat:first-child { border-top: 0; }

.stat-value {
  display: block;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--indigo);
}

.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.7;
  color: rgba(36, 30, 26, 0.66);
}

/* 细线卡片 */
.grid-card {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: clamp(20px, 3vw, 32px);
  transition: border-color 0.24s var(--ease);
}

.grid-card:hover { border-color: var(--line-strong); }

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  color: var(--blue);
  white-space: nowrap;
}

.tag--red { color: var(--vermilion); }
.tag--green { color: var(--green); }
.tag--blue { color: var(--blue); }
.tag--yellow { color: #9A6A05; }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn--primary {
  background: var(--vermilion);
  color: #fff;
}

.btn--primary:hover { background: var(--vermilion-deep); }

.btn--ghost {
  background: transparent;
  color: var(--indigo);
  border-color: var(--line-strong);
}

.btn--ghost:hover {
  background: var(--indigo);
  color: var(--cream);
  border-color: var(--indigo);
}

.btn--ghost-light {
  background: transparent;
  color: var(--cream);
  border-color: var(--line-light);
}

.btn--ghost-light:hover {
  background: var(--cream);
  color: var(--indigo);
}

.btn--sm {
  padding: 8px 16px;
  font-size: 14px;
}

/* ---------- 6. Breadcrumb ---------- */
.breadcrumb {
  padding-block: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: rgba(36, 30, 26, 0.6);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: var(--stone);
}

.breadcrumb a {
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.breadcrumb a:hover {
  color: var(--vermilion);
  border-bottom-color: currentColor;
}

.breadcrumb [aria-current="page"] { color: var(--ink); }

/* ---------- 7. Chapter scale (TOC) ---------- */
.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--line);
}

.toc-link {
  position: relative;
  display: block;
  padding: 8px 0 8px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: rgba(36, 30, 26, 0.6);
  transition: color 0.2s var(--ease);
}

.toc-link::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
  transition: background-color 0.2s var(--ease);
}

.toc-link:hover { color: var(--ink); }

.toc-link[aria-current="true"] {
  color: var(--vermilion);
  font-weight: 700;
}

.toc-link[aria-current="true"]::before { background: var(--vermilion); }

/* ---------- 8. Media frames ---------- */
.media-frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--sand);
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame[data-ratio="16x9"] { aspect-ratio: 16 / 9; }
.media-frame[data-ratio="4x3"] { aspect-ratio: 4 / 3; }
.media-frame[data-ratio="3x2"] { aspect-ratio: 3 / 2; }
.media-frame[data-ratio="1x1"] { aspect-ratio: 1 / 1; }

.media-frame--ridge {
  background:
    linear-gradient(160deg, rgba(44, 111, 181, 0.18), rgba(226, 211, 186, 0.55));
}

.media-frame--ridge::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(180deg, rgba(27, 42, 74, 0.09) 0 1px, transparent 1px 15px),
    repeating-linear-gradient(90deg, rgba(27, 42, 74, 0.06) 0 1px, transparent 1px 84px);
  pointer-events: none;
}

.media-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: rgba(36, 30, 26, 0.6);
}

/* ---------- 9. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(19, 31, 56, 0.62);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  backdrop-filter: blur(10px) saturate(130%);
  color: var(--cream);
  border-bottom: 1px solid var(--line-light-soft);
  transition: background-color 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.site-header[data-scrolled="true"] {
  background: var(--indigo);
  border-bottom-color: rgba(226, 211, 186, 0.3);
  box-shadow: 0 14px 34px -28px rgba(13, 21, 38, 0.95);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 8px;
  z-index: 120;
  padding: 10px 16px;
  background: var(--vermilion);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  width: 100%;
  max-width: var(--w-max);
  min-height: var(--header-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  order: 1;
  color: inherit;
  flex: none;
}

.brand-mark {
  width: 26px;
  height: 30px;
  flex: none;
  border: 1px solid rgba(247, 241, 230, 0.45);
  background:
    linear-gradient(180deg,
      var(--blue) 0 20%,
      var(--paper) 20% 40%,
      var(--vermilion) 40% 60%,
      var(--green) 60% 80%,
      var(--yellow) 80% 100%);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0.08em;
  color: var(--paper);
}

.brand-line {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  color: rgba(247, 241, 230, 0.62);
  white-space: nowrap;
}

/* 导航 */
.site-nav {
  order: 2;
  margin-left: auto;
  display: flex;
  align-items: center;
}

.nav-note,
.nav-drawer,
.nav-drawer-head {
  display: none;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 10px 11px;
  font-size: 14.5px;
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: rgba(247, 241, 230, 0.8);
  transition: color 0.2s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 4px;
  height: 2px;
  background: transparent;
  transition: background-color 0.2s var(--ease);
}

.nav-link:hover { color: var(--paper); }
.nav-link:hover::after { background: var(--yellow); }

.nav-link[aria-current="page"] {
  color: var(--paper);
  font-weight: 700;
}

.nav-link[aria-current="page"]::after { background: var(--vermilion); }

/* 右侧工具 */
.header-actions {
  order: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: clamp(10px, 1.6vw, 22px);
  flex: none;
}

.header-link {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  letter-spacing: 0.03em;
  color: var(--sand);
  border-bottom: 1px dashed rgba(226, 211, 186, 0.55);
  padding-bottom: 1px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.header-link:hover {
  color: var(--paper);
  border-bottom-color: var(--vermilion);
}

/* 汉堡按钮 */
.nav-toggle {
  order: 4;
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0 9px;
  border: 1px solid var(--line-light);
  flex: none;
}

.nav-toggle-bar {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--cream);
  transition: transform 0.24s var(--ease), opacity 0.24s var(--ease);
}

/* 抽屉内关闭按钮 */
.nav-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-light);
  color: var(--cream);
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-close:hover { border-color: var(--vermilion); }

/* 滚动进度 */
.read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(247, 241, 230, 0.14);
  overflow: hidden;
}

.read-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--vermilion);
  transition: transform 0.12s linear;
}

/* 移动抽屉遮罩 */
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(19, 31, 56, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.nav-scrim[hidden] { display: none; }

body.nav-open { overflow: hidden; }

/* ---------- 10. Footer ---------- */
.site-footer {
  background: var(--indigo);
  color: var(--cream);
  border-top: 1px solid rgba(226, 211, 186, 0.26);
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 4vw, 56px);
  max-width: var(--w-max);
  margin-inline: auto;
  padding: clamp(40px, 5vw, 64px) var(--gutter) clamp(32px, 4vw, 48px);
}

.footer-brand .brand { margin-bottom: 18px; }

.footer-brand-line {
  max-width: 34ch;
  font-size: 14.5px;
  line-height: 1.8;
  color: rgba(247, 241, 230, 0.74);
}

.footer-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(226, 211, 186, 0.4);
  background: transparent;
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: left;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.copy-btn:hover {
  border-color: var(--sand);
  background: rgba(226, 211, 186, 0.1);
}

.copy-btn-value {
  overflow-wrap: anywhere;
}

.copy-btn-hint {
  flex: none;
  padding-left: 9px;
  border-left: 1px solid rgba(226, 211, 186, 0.35);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--yellow);
}

.copy-btn[data-copied="true"] {
  background: var(--turquoise);
  border-color: var(--turquoise);
  color: #fff;
}

.copy-btn[data-copied="true"] .copy-btn-hint {
  color: #fff;
  border-left-color: rgba(255, 255, 255, 0.5);
}

.footer-address {
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(247, 241, 230, 0.72);
}

.footer-contact-note {
  margin-top: 10px;
  max-width: 38ch;
  font-size: 12.5px;
  line-height: 1.8;
  color: rgba(247, 241, 230, 0.52);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: clamp(20px, 3vw, 36px);
}

.footer-col-title {
  padding-top: 12px;
  border-top: 2px solid var(--sand);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  line-height: 1.6;
  color: var(--sand);
}

.footer-col:nth-child(1) .footer-col-title { border-top-color: var(--blue); }
.footer-col:nth-child(2) .footer-col-title { border-top-color: var(--green); }
.footer-col:nth-child(3) .footer-col-title { border-top-color: var(--yellow); }

.footer-links {
  margin-top: 14px;
  list-style: none;
}

.footer-links li + li { margin-top: 8px; }

.footer-link {
  display: inline-block;
  font-size: 14.5px;
  line-height: 1.7;
  color: rgba(247, 241, 230, 0.8);
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.footer-link:hover {
  color: var(--paper);
  border-bottom-color: var(--yellow);
}

/* 路径树 */
.footer-tree {
  background: var(--sand);
  color: var(--ink);
  border-top: 1px solid rgba(36, 30, 26, 0.2);
  border-bottom: 1px solid rgba(36, 30, 26, 0.14);
}

.tree-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
  max-width: var(--w-max);
  margin-inline: auto;
  padding: clamp(32px, 4vw, 48px) var(--gutter);
}

.tree-title {
  margin-top: 10px;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--indigo);
}

.tree-intro {
  margin-top: 12px;
  max-width: 40ch;
  font-size: 14.5px;
  line-height: 1.85;
  color: rgba(36, 30, 26, 0.76);
}

.path-tree {
  border: 1px solid var(--line);
  background: var(--paper);
}

.path-tree-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.5;
  color: var(--indigo);
  transition: background-color 0.2s var(--ease);
}

.path-tree-summary::-webkit-details-marker { display: none; }
.path-tree-summary::marker { content: ""; }

.path-tree-summary:hover { background: rgba(226, 211, 186, 0.4); }

.path-tree-summary::after {
  content: "+";
  flex: none;
  width: 22px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
  color: var(--vermilion);
}

.path-tree[open] .path-tree-summary::after { content: "−"; }

.path-tree-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(36, 30, 26, 0.6);
}

.path-tree-list {
  list-style: none;
  padding: 6px 18px 18px 30px;
  border-top: 1px solid var(--line);
}

.path-tree-item {
  position: relative;
  padding: 11px 0 11px 18px;
  border-bottom: 1px dashed rgba(36, 30, 26, 0.14);
}

.path-tree-item:last-child { border-bottom: 0; }

.path-tree-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(36, 30, 26, 0.2);
}

.path-tree-item:last-child::before {
  bottom: auto;
  height: 24px;
}

.path-tree-item::after {
  content: "";
  position: absolute;
  left: 0;
  top: 23px;
  width: 12px;
  height: 1px;
  background: rgba(36, 30, 26, 0.3);
}

.tree-node {
  position: absolute;
  left: -4px;
  top: 20px;
  width: 8px;
  height: 8px;
  background: var(--blue);
}

.path-tree-item:nth-child(5n + 2) .tree-node { background: var(--vermilion); }
.path-tree-item:nth-child(5n + 3) .tree-node { background: var(--green); }
.path-tree-item:nth-child(5n + 4) .tree-node { background: var(--yellow); }
.path-tree-item:nth-child(5n + 5) .tree-node { background: var(--stone); }

.tree-label {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink);
}

.tree-paths {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.tree-old {
  padding: 1px 6px;
  background: rgba(36, 30, 26, 0.07);
  color: rgba(36, 30, 26, 0.62);
  overflow-wrap: anywhere;
}

.tree-arrow {
  color: var(--vermilion);
}

.tree-new {
  color: var(--turquoise-deep);
  border-bottom: 1px solid rgba(15, 90, 76, 0.4);
  overflow-wrap: anywhere;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.tree-new:hover {
  color: var(--vermilion);
  border-bottom-color: var(--vermilion);
}

/* 法务条 */
.footer-legal {
  background: var(--indigo-deep);
  color: rgba(247, 241, 230, 0.72);
  border-top: 1px solid rgba(226, 211, 186, 0.18);
}

.legal-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  max-width: var(--w-max);
  margin-inline: auto;
  padding: 18px var(--gutter);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.03em;
}

.legal-icp { color: rgba(247, 241, 230, 0.78); }
.legal-note { color: rgba(247, 241, 230, 0.55); }

/* ---------- 11. Reveal ---------- */
.has-motion [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.28s ease-out, transform 0.28s ease-out;
}

.has-motion [data-reveal][data-revealed="true"] {
  opacity: 1;
  transform: none;
}

/* ---------- 12. Responsive ---------- */
@media (min-width: 720px) {
  .stat-band { grid-template-columns: repeat(2, 1fr); }
  .stat {
    border-top: 0;
    border-left: 1px solid var(--line);
  }
  .stat:first-child { border-left: 0; }
}

@media (min-width: 900px) {
  .split { grid-template-columns: 5fr 7fr; }
  .split--reverse { grid-template-columns: 7fr 5fr; }
}

@media (min-width: 1000px) {
  .stat-band { grid-template-columns: repeat(4, 1fr); }
  .footer-main { grid-template-columns: 5fr 7fr; }
  .tree-inner { grid-template-columns: 4fr 8fr; }
}

@media (max-width: 1100px) {
  .nav-link {
    padding: 10px 8px;
    font-size: 14px;
  }
  .nav-link::after {
    left: 8px;
    right: 8px;
  }
}

@media (max-width: 959px) {
  .site-header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--indigo);
  }

  .header-inner { gap: 10px; }

  .nav-toggle { display: flex; }

  .header-actions {
    margin-left: auto;
    gap: 10px;
  }

  .header-link { display: none; }

  .brand-line { display: none; }

  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 90;
    width: min(86vw, 340px);
    max-width: 100%;
    margin: 0;
    padding: 18px 20px 32px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    background: var(--indigo);
    border-right: 1px solid rgba(226, 211, 186, 0.28);
    transform: translateX(-102%);
    transition: transform 0.3s var(--ease);
    visibility: hidden;
  }

  .site-nav[data-open="true"] {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line-light);
  }

  .nav-drawer-brand {
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: 0.12em;
    color: var(--sand);
  }

  .nav-note {
    display: block;
    margin-top: 16px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    line-height: 1.7;
    letter-spacing: 0.04em;
    color: rgba(247, 241, 230, 0.5);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 8px;
  }

  .nav-list li + li { border-top: 1px solid var(--line-light-soft); }

  .nav-link {
    display: block;
    padding: 14px 0;
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.04em;
  }

  .nav-link::after {
    left: auto;
    right: 0;
    top: 50%;
    bottom: auto;
    width: 14px;
    height: 1.5px;
    transform: translateY(-50%);
  }

  .nav-drawer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line-light);
  }

  .nav-drawer-note {
    font-size: 13px;
    line-height: 1.8;
    color: rgba(247, 241, 230, 0.68);
  }

  .nav-drawer-link {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.03em;
    color: var(--sand);
    border-bottom: 1px dashed rgba(226, 211, 186, 0.5);
    padding-bottom: 2px;
  }

  .nav-drawer-link:hover { color: var(--paper); }

  .toc {
    position: static;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .toc-link {
    padding: 4px 10px;
    border: 1px solid var(--line);
  }

  .toc-link::before { display: none; }

  .toc-link[aria-current="true"] {
    border-color: var(--vermilion);
    background: rgba(200, 54, 43, 0.08);
  }
}

@media (max-width: 559px) {
  :root { --header-h: 64px; }

  body { font-size: 16px; }

  .brand-name { font-size: 18px; }
  .brand-mark { width: 22px; height: 26px; }

  .btn--sm {
    padding: 8px 12px;
    font-size: 13px;
  }

  .legal-inner { flex-direction: column; align-items: flex-start; }

  .path-tree-list { padding: 6px 12px 14px 22px; }

  .tree-paths { font-size: 11.5px; }
}

/* ---------- 13. Motion / print safety ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .has-motion [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .site-nav { transition: none; }
}

@media print {
  .site-header,
  .nav-scrim,
  .read-progress { display: none !important; }

  body { background: #fff; }
}
