/* 首屏：纸片、订阅、代理、TUN、规则窗口按书写顺序叠压。 */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: stretch;
  min-height: max(680px, calc(100svh - var(--nav-h) - var(--peek)));
}
.hero__in {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.hero__copy {
  align-self: center;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 48px 24px 48px 0;
}
.hero__title { font-size: var(--type-1); line-height: 1.16; letter-spacing: -.02em; }
.hero__line { display: block; }
.hero__line--soft { color: var(--c-muted); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero__lede { margin-top: 28px; max-width: 28em; color: var(--c-muted); font-size: 17px; line-height: 1.65; }
.hero__lede strong {
  font-weight: var(--weight-label);
  color: var(--c-text);
  text-decoration: underline var(--c-accent) 2px;
  text-underline-offset: 5px;
}
.facts, .plats__list { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.facts { gap: 8px; margin-top: 24px; }
.facts__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  max-width: 100%;
  padding-inline: 14px;
  font: 13px/1.45 var(--font-mono);
  overflow-wrap: anywhere;
  background: var(--c-bg);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
}
.facts__dot, .status-dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--c-accent); color: var(--c-on-ink); }
.facts__dot--b { background: var(--tint-coral); color: var(--c-text); }
.facts__dot--c { background: var(--tint-sky); color: var(--c-text); }
.plats { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--c-border); width: min(100%, 470px); }
.plats__list { gap: 6px 18px; }
.plat { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; text-decoration: none; }
.plat__tile {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg);
  color: var(--c-text);
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.plat__tile svg { width: 15px; height: 15px; }
.plat__name { text-decoration: underline var(--c-clear); text-underline-offset: 4px; transition: text-decoration-color .2s var(--ease); }
.plat:hover .plat__tile { border-color: var(--c-text); background: var(--c-panel); color: var(--c-text); }
.plat:hover .plat__name { text-decoration-color: var(--c-accent); }

.hero__stage { position: relative; min-height: 100%; --rig-scale: 1; }
.rig {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 640px;
  height: 660px;
  transform: translate(-50%, -50%) scale(var(--rig-scale));
  transform-origin: center;
}
.slab { position: absolute; }
.slab--paper { inset: -44px auto auto 0; width: 168px; height: 580px; background: var(--tint-lilac); color: var(--c-text); border-radius: var(--r-md); }
.slab--coral {
  inset: 0 auto auto 72px;
  width: 380px;
  height: 290px;
  padding: 20px;
  background: var(--tint-coral);
  color: var(--c-text);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.veil { padding: 20px; background: var(--c-veil); color: var(--c-text); border-radius: var(--r-md); }
.veil__head { display: flex; align-items: center; justify-content: space-between; height: 24px; }
.veil__title { font-size: 16px; font-weight: var(--weight-label); }
.veil__save { padding: 2px 10px; font-size: 13px; border-radius: var(--r-pill); background: var(--c-text); color: var(--c-on-ink); }
.field { margin-top: 16px; }
.field__label { display: block; color: var(--c-muted); font-size: 12px; line-height: 18px; }
.field__box {
  display: flex;
  align-items: center;
  min-height: 40px;
  margin-top: 6px;
  padding: 4px 12px;
  font: 12px/1.6 var(--font-mono);
  overflow-wrap: anywhere;
  background: var(--c-bg);
  color: var(--c-muted);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
}
.field__caret { width: 1px; height: 16px; margin-right: 6px; background: var(--c-accent); color: var(--c-on-ink); flex: none; }
.veil__row { display: flex; align-items: center; justify-content: space-between; height: 36px; margin-top: 14px; font-size: 14px; }
.veil__end, .lime-row__end { display: inline-flex; align-items: center; gap: 10px; }
.veil__val { color: var(--c-muted); font-size: 13px; }
.sw {
  position: relative;
  width: 36px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--c-switch-off);
  color: var(--c-text);
  flex: none;
}
.sw::after {
  content: "";
  position: absolute;
  inset: 2px auto auto 2px;
  width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  background: var(--c-knob);
  color: var(--c-text);
}
.sw--on { background: var(--c-text); color: var(--c-on-ink); }
.sw--on::after { left: 16px; }
.sw--ink { background: var(--c-ink-switch); color: var(--c-on-ink); }
.slab--ink {
  inset: 236px auto auto 112px;
  width: 300px;
  height: 360px;
  padding: 14px 16px;
  background: var(--c-ink);
  color: var(--c-on-ink);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.sbar { display: flex; align-items: center; justify-content: space-between; height: 24px; padding-inline: 6px; }
.sbar__time { font-size: 14px; font-weight: var(--weight-status); letter-spacing: -.01em; }
.sbar__icons { display: inline-flex; align-items: center; gap: 5px; }
.sbar__icons svg { height: 11px; width: auto; }
.phone__title { margin-top: 14px; padding-inline: 4px; font-size: 15px; line-height: 20px; }
.seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  height: 40px;
  margin-top: 12px;
  padding: 4px;
  background: var(--c-ink-raise);
  color: var(--c-on-ink);
  border-radius: var(--r-seg);
}
.seg__item { display: grid; place-items: center; font-size: 14px; color: var(--c-on-ink-muted); border-radius: var(--r-mark); }
.seg__item--on { background: var(--tint-lime); color: var(--c-text); font-weight: var(--weight-label); }
.ink-row { display: flex; align-items: center; justify-content: space-between; height: 32px; margin-top: 14px; padding-inline: 4px; font-size: 14px; }
.ink-yaml { margin-top: 18px; padding-inline: 4px; color: var(--c-on-ink-muted); font: 12px/20px var(--font-mono); }
.slab--lime {
  inset: 420px auto auto 340px;
  width: 300px;
  height: 200px;
  padding: 18px 20px;
  background: var(--tint-lime);
  color: var(--c-text);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.lime-row { display: flex; align-items: center; justify-content: space-between; height: 28px; font-size: 15px; }
.lime-row__state { font-size: 12px; }
.lime-rule { height: 1px; margin-block: 14px; background: var(--c-line-on-tint); color: var(--c-text); }
.lime-pill {
  padding: 3px 10px;
  font: 12px/1.6 var(--font-mono);
  background: var(--c-veil-soft);
  color: var(--c-text);
  border: 1px solid var(--c-line-on-tint);
  border-radius: var(--r-pill);
}
.slab--sheet {
  inset: 548px auto auto 150px;
  width: 430px;
  height: 600px;
  background: var(--c-bg);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}
.sheet__bar { display: flex; align-items: center; gap: 6px; height: 40px; padding-inline: 16px; border-bottom: 1px solid var(--c-border); }
.sheet__dot { width: 8px; height: 8px; flex: none; border-radius: var(--r-pill); background: var(--c-dot); color: var(--c-text); }
.sheet__name { margin-left: 10px; color: var(--c-muted); font: 12px/1.6 var(--font-mono); }
.sheet__code { padding: 14px 20px; border: 0; font: 13px/24px var(--font-mono); }
.sheet__ln { display: block; white-space: pre; }
.sheet__no { display: inline-block; width: 26px; color: var(--c-muted); }
pre .tok-type { color: var(--c-accent); }
pre .tok-soft { color: var(--c-muted); }
.pointer { position: absolute; z-index: 5; width: 0; height: 0; }
.pointer__arrow { position: absolute; top: -1px; width: 17px; height: 22px; max-width: none; }
.pointer__arrow path { fill: currentColor; stroke: var(--c-bg); stroke-width: 1.4; stroke-linejoin: round; }
.pointer__tag { position: absolute; top: 19px; padding: 4px 10px; font-size: 13px; font-weight: var(--weight-label); line-height: 18px; white-space: nowrap; border-radius: var(--r-xs); }
.pointer--accent { left: 138px; top: 342px; color: var(--c-accent); }
.pointer--accent .pointer__arrow { left: -15.5px; transform: scaleX(-1); }
.pointer--accent .pointer__tag { right: 10px; background: var(--c-accent); color: var(--c-on-ink); }
.pointer--sky { left: 596px; top: 514px; color: var(--tint-sky); }
.pointer--sky .pointer__arrow { left: -1.5px; }
.pointer--sky .pointer__tag { left: 12px; background: var(--tint-sky); color: var(--c-text); }

.boards { max-width: var(--maxw); margin-inline: auto; padding: 24px var(--gutter) var(--section-gap); }
.boards__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-grid); }
.board__canvas { position: relative; height: 420px; overflow: hidden; border-radius: var(--r-xl); }
.board__canvas--lime { background: var(--c-panel); color: var(--c-text); }
.board__canvas--lilac { background: var(--c-panel-2); color: var(--c-text); }
.board__tag { position: absolute; left: 32px; top: 26px; right: 24px; color: var(--c-muted); font-size: 15px; }
.mini {
  position: absolute;
  left: 50%;
  top: 78px;
  width: min(340px, calc(100% - 32px));
  height: 420px;
  transform: translateX(-50%);
  padding: 14px 18px;
  border-radius: var(--r-lg);
}
.mini--paper { background: var(--c-bg); color: var(--c-text); border: 1px solid var(--c-border); }
.mini--ink { background: var(--c-ink); color: var(--c-on-ink); }
.mini__title { margin-top: 18px; font: var(--weight-display) 20px/1.4 var(--font-display); }
.mini__list { margin-top: 14px; }
.mini__item { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-size: 15px; border-top: 1px solid var(--c-border); }
.mini__item:last-child { border-bottom: 1px solid var(--c-border); }
.mini__chev { color: var(--c-muted); }
.mini__code { margin-top: 14px; padding: 0; border: 0; font: 12px/26px var(--font-mono); background: var(--c-ink); color: var(--c-on-ink-muted); }
.mini__code .tok-type { color: var(--tint-lime); }
.board__meta { padding: 28px 4px 0; }
.board__glyph { width: 20px; height: 20px; color: var(--c-text); }
.board__title { margin-top: 18px; font-size: 19px; }
.board__desc { margin-top: 4px; color: var(--c-muted); }
.board__link { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; text-decoration: none; }
.board__link span { text-decoration: underline var(--c-accent) 1.5px; text-underline-offset: 5px; }
.board__link:hover { color: var(--c-accent-dark); }

/* 资料浏览与正文组件 */
.tabs { display: grid; gap: 16px; }
.tabs--index { grid-template-columns: minmax(170px, 1fr) minmax(0, 3fr); gap: var(--gap-grid); }
.tablist, .toc-tabs { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.tablist[aria-orientation="vertical"] { flex-direction: column; align-items: stretch; }
.tab, .toc-tabs a, .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  background: var(--c-bg);
  color: var(--c-text);
  overflow-wrap: anywhere;
}
.tab, .toc-tabs a { min-height: 44px; padding: 7px 16px; text-align: center; text-decoration: none; }
.tablist[aria-orientation="vertical"] .tab { justify-content: flex-start; border-radius: var(--r-btn); }
.tab[aria-selected="true"] {
  border-color: var(--c-accent);
  background: var(--c-panel-2);
  color: var(--c-text);
  text-decoration: underline var(--c-accent);
  text-underline-offset: 4px;
}
.tab:not([aria-selected="true"]):hover, .toc-tabs a:hover { background: var(--c-panel); color: var(--c-text); }
.tab-panel { min-width: 0; }
.toc { display: grid; gap: 12px; margin-block-end: 24px; }
.faq { border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-bg); color: var(--c-text); }
.faq summary { position: relative; min-height: 52px; padding: 13px 48px 13px 18px; }
.faq summary::after { content: "+"; position: absolute; inset: 12px 18px auto auto; color: var(--c-accent-dark); }
.faq[open] summary::after { content: "−"; }
.faq__body { margin-inline: 18px; padding-block: 14px 18px; border-top: 1px solid var(--c-border); }
.term-card { border-radius: var(--r-md); }
.term-card dl, .term-card dd { margin: 0; }
.term-card dt { font: var(--weight-display) var(--type-3)/1.3 var(--font-display); }
.term-card dd { margin-top: 8px; overflow-wrap: anywhere; }
.client-card__head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; }
.client-card__icon { width: 56px; height: 56px; flex-shrink: 0; }
.client-card__meta, .badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.client-card__meta { margin-top: 8px; }
.client-card [data-rev]:empty { display: none; }
.client-card [data-rev] { color: var(--c-muted); font: 13px/1.5 var(--font-mono); overflow-wrap: anywhere; }
.badge { gap: 6px; min-height: 28px; padding: 3px 11px; font-size: 13px; line-height: 1.4; }
.badge--lead { background: var(--c-panel); color: var(--c-text); }
.badge--recommended { background: var(--c-panel-2); color: var(--c-text); }
.badge--archive { border-style: dashed; }
.status-dot--success { background: var(--c-success); color: var(--c-text); }
.status-dot--warn { background: var(--c-warn); color: var(--c-text); }
.status-dot--error { background: var(--c-error); color: var(--c-on-ink); }
.post-card { display: grid; align-content: start; gap: 12px; }
.post-card__meta { color: var(--c-muted); font: 13px/1.5 var(--font-mono); }
.callout {
  margin-inline: 0;
  padding: 16px 20px;
  border-inline-start: 3px solid var(--c-accent);
  border-radius: var(--r-btn);
  background: var(--c-panel-2);
  color: var(--c-text);
}
.article-download { display: grid; gap: 12px; justify-items: start; }
.dl-fab {
  position: fixed;
  z-index: 10;
  inset-inline-end: max(var(--gutter), env(safe-area-inset-right));
  inset-block-end: calc(16px + env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100% - var(--gutter) * 2);
}
.has-dl-fab { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }

.table-wrap, .prose table, .reading table:not(.table-wrap table), .wrap table:not(.table-wrap table) {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.prose table, .reading table:not(.table-wrap table), .wrap table:not(.table-wrap table) { display: block; }
.table-wrap { border: 1px solid var(--c-border); border-radius: var(--r-btn); }
.table-wrap > table { display: table; overflow: visible; max-width: none; }
.data-table, .prose table, .reading table, .wrap table { width: 100%; border-collapse: collapse; }
:is(.data-table, .prose table, .reading table, .wrap table) :is(th, td) {
  min-width: 7em;
  padding: 10px 16px;
  text-align: start;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
  border-bottom: 1px solid var(--c-border);
}
:is(.data-table, .prose table, .reading table, .wrap table) th { background: var(--c-panel); color: var(--c-text); font-weight: var(--weight-label); }
.table-wrap tr:last-child td { border-bottom: 0; }
.data-table caption { padding: 10px 16px; text-align: start; }

.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 156px), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.swatch { min-width: 0; display: grid; gap: 8px; color: var(--c-text); }
.swatch::before { content: ""; height: 42px; border: 1px solid var(--c-border); border-radius: var(--r-sm); background: var(--sample); color: var(--c-text); }
.swatch--bg { --sample: var(--c-bg); }
.swatch--panel { --sample: var(--c-panel); }
.swatch--panel2 { --sample: var(--c-panel-2); }
.swatch--border { --sample: var(--c-border); }
.swatch--accent { --sample: var(--c-accent); }
.swatch--accent-dark { --sample: var(--c-accent-dark); }
.swatch--text { --sample: var(--c-text); }
.swatch--muted { --sample: var(--c-muted); }
.swatch--success { --sample: var(--c-success); }
.swatch--warn { --sample: var(--c-warn); }
.swatch--error { --sample: var(--c-error); }
.swatch--coral { --sample: var(--tint-coral); }
.swatch--lime { --sample: var(--tint-lime); }
.swatch--sky { --sample: var(--tint-sky); }
.swatch--lilac { --sample: var(--tint-lilac); }
.swatch--ink { --sample: var(--c-ink); }
.swatch--raise { --sample: var(--c-ink-raise); }
.swatch--on-ink { --sample: var(--c-on-ink); }
.swatch--ink-muted { --sample: var(--c-on-ink-muted); }
.swatch--ink-switch { --sample: var(--c-ink-switch); }
.swatch--veil { --sample: var(--c-veil); }
.swatch--veil-soft { --sample: var(--c-veil-soft); }
.swatch--tint-line { --sample: var(--c-line-on-tint); }
.swatch--off { --sample: var(--c-switch-off); }
.swatch--knob { --sample: var(--c-knob); }
.swatch--dot { --sample: var(--c-dot); }
.swatch--mask { --sample: var(--c-mask); }
.swatch--clear { --sample: var(--c-clear); }
.swatch:is(.swatch--ink-muted, .swatch--ink-switch)::before { background: linear-gradient(var(--sample), var(--sample)), var(--c-ink); color: var(--c-on-ink); }
.swatch:is(.swatch--veil, .swatch--veil-soft, .swatch--tint-line)::before { background: linear-gradient(var(--sample), var(--sample)), var(--tint-coral); color: var(--c-text); }
.display-sample { font: var(--weight-display) var(--type-1)/1.16 var(--font-display); letter-spacing: -.02em; }

@media (max-width: 1320px) { .hero__stage { --rig-scale: .88; } }
@media (max-width: 1120px) {
  .hero { min-height: 0; }
  .hero__in { grid-template-columns: minmax(0, 1fr); }
  .hero__copy { padding: 56px 0 24px; }
  .hero__stage { min-height: 640px; --rig-scale: .82; }
}
@media (max-width: 760px) {
  .hero__stage { min-height: 460px; --rig-scale: .56; }
  .boards__grid, .tabs--index { grid-template-columns: minmax(0, 1fr); }
  .board__canvas { height: 360px; }
}
@media (max-width: 640px) {
  .facts { justify-content: center; }
  .facts__item { gap: 5px; padding-inline: 9px; }
  .hero__cta { margin-top: 24px; }
}
@media (max-width: 420px) {
  .hero__stage { min-height: 345px; --rig-scale: .43; }
}
@media (max-width: 360px) {
  .hero__stage { min-height: 310px; --rig-scale: .39; }
}