/* 首屏：白色规则终端，不模拟应用界面。 */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h) - var(--peek));
  min-height: calc(100svh - var(--nav-h) - var(--peek));
  padding: 28px var(--gutter) 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.horizon {
  position: absolute;
  left: -15%;
  right: -15%;
  bottom: 0;
  height: 64%;
  z-index: -1;
  perspective: 420px;
  perspective-origin: 50% 8%;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 52% 100% at 50% 100%, var(--mask) 30%, var(--clear) 100%);
  mask-image: radial-gradient(ellipse 52% 100% at 50% 100%, var(--mask) 30%, var(--clear) 100%);
}
.horizon::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 320%;
  background-image: linear-gradient(to right, var(--grid-line) 1px, var(--clear) 1px), linear-gradient(to bottom, var(--grid-line) 1px, var(--clear) 1px);
  background-size: 76px 76px;
  background-position: center bottom;
  transform: rotateX(72deg);
  transform-origin: 50% 100%;
}
.app-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-icon);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-hair), var(--shadow-float);
}
.app-mark img { display: block; width: 100%; height: auto; border-radius: var(--r-icon); }
.preview-mark::after {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--bg-panel-2);
  border-radius: var(--r-small);
}
.app-mark.preview-mark::after { width: 20px; height: 20px; border-width: 2px; }
.brand-mark.preview-mark { display: grid; place-items: center; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  min-height: 30px;
  margin: 0 0 22px;
  padding: 4px 14px 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
}
.tag-dot {
  position: relative;
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: var(--r-circle);
  background: var(--accent);
  color: var(--on-ink);
}
.tag-dot::after { content: ""; position: absolute; inset: -4px; border: 1px solid var(--accent); border-radius: var(--r-circle); opacity: .22; }
.tag-sep { color: var(--text-muted); }
.tag a { text-decoration: none; }
.hero h1 { font-size: clamp(30px, 2.2vw + 16px, 48px); margin: 0 0 26px; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 40px; }

.device { position: relative; width: min(760px, 100%); margin-bottom: 30px; }
.device::after {
  content: "";
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: -11px;
  height: 44px;
  z-index: 0;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--r-frame) var(--r-frame);
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: var(--shadow-sheet);
}
.frame { position: relative; z-index: 1; padding: 8px; border: 1px solid var(--border); border-radius: var(--r-frame); background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-hair), var(--shadow-float); }
.paper { overflow: hidden; text-align: left; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); box-shadow: var(--shadow-hair); }
.paper-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 38px; padding-inline: 20px; border-bottom: 1px solid var(--border); }
.paper-dots { display: flex; gap: 7px; }
.paper-dots i { width: 10px; height: 10px; border: 1px solid var(--border); border-radius: var(--r-circle); background: var(--bg-panel-2); color: var(--text); }
.paper-title { font-family: var(--font-mono); font-size: 12px; letter-spacing: .02em; color: var(--text-muted); }
.paper-body { padding: 20px 28px 18px; }
.sect { font-family: var(--font-mono); font-size: 13px; letter-spacing: .02em; color: var(--text-muted); }
.rules { position: relative; height: 46px; margin: 10px 0 14px; font-family: var(--font-mono); font-size: 28px; line-height: 46px; letter-spacing: -.01em; }
.rule-line { position: absolute; inset: 0 auto auto 0; white-space: nowrap; opacity: 0; animation: ruleSwap var(--cycle) ease infinite both; }
.rule-line.r1 { animation-delay: 0s; }
.rule-line.r2 { animation-delay: 4s; }
.rule-line.r3 { animation-delay: 8s; }
.rule-line.r4 { animation-delay: 12s; }
.rule-line .k { color: var(--text); }
.rule-line .s, .rule-line .v { color: var(--text-muted); }
.rule-line .p { color: var(--accent); }
.caret { display: inline-block; width: 2px; height: .95em; margin-left: 8px; vertical-align: -.14em; background: var(--text); color: var(--bg); }
.paper-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.comment { color: var(--text-muted); font-family: var(--font-mono); font-size: var(--text-caption); }
.enter-key { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border: 1px solid var(--border); border-radius: var(--r-circle); background: var(--bg-panel); color: var(--text-muted); }
.enter-key svg { width: 16px; height: 16px; }
.policies { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 26px; padding: 0; list-style: none; }
.policy { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 34px; min-width: 96px; padding: 5px 18px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg); color: var(--text-muted); box-shadow: var(--shadow-hair); font-family: var(--font-mono); font-size: 13px; letter-spacing: .04em; }
.policy-on { position: absolute; inset: -1px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--accent); border-radius: var(--r-pill); background: var(--bg); color: var(--accent-dark); opacity: 0; }
.policy-on::before { content: ""; width: 5px; height: 5px; border-radius: var(--r-circle); background: var(--accent); color: var(--on-ink); }
.policy-proxy .policy-on { animation: onProxy var(--cycle) linear infinite both; }
.policy-direct .policy-on { animation: onDirect var(--cycle) linear infinite both; }
.policy-reject .policy-on { animation: onReject var(--cycle) linear infinite both; }
.lede { max-width: 620px; margin: 0 0 18px; color: var(--text-muted); font-size: 15.5px; line-height: 1.7; }
.lede strong { color: var(--text); }
.platforms { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 20px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--text-muted); }
.platforms li { display: flex; align-items: center; }
.plat { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--text-muted); }
.plat svg { width: 18px; height: 18px; }
a.plat:hover { color: var(--text); }
.plat-sep { width: 1px; height: 16px; background: var(--border); color: var(--text); }
.chip, .badge { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; max-width: 100%; padding: 3px 12px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg); color: var(--text-muted); font-size: var(--text-caption); text-decoration: none; overflow-wrap: anywhere; }
.chip svg { width: 12px; height: 12px; color: var(--text); }

.board-wrap { padding-inline: var(--gutter); padding-bottom: var(--section-space); }
.board { position: relative; height: 560px; overflow: hidden; border-radius: var(--r-card); background: radial-gradient(62% 90% at 84% 18%, var(--apricot) 0%, var(--clear) 70%), linear-gradient(var(--board-angle), var(--accent) 12%, var(--apricot) 100%); color: var(--text); }
.board-word { position: absolute; left: 52px; top: 30px; font-family: var(--font-display); font-weight: var(--weight-strong); font-size: 320px; line-height: .8; letter-spacing: -.05em; color: var(--board-word); white-space: nowrap; user-select: none; }
.board-caption { max-width: 880px; padding-top: 32px; }
.board-caption h2 { font-size: 30px; margin-bottom: 12px; }
.board-meta { margin: 0; color: var(--text-muted); font-size: var(--text-small); }
.board-meta span { margin-right: 14px; color: var(--text); }

/* Tabs：内容先于目录；未增强时所有面板保持可读。 */
.tabs { min-width: 0; }
.feature-tabs { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); column-gap: 56px; }
.tab-panels { grid-column: 1; grid-row: 1; min-width: 0; }
.tab-list { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-self: start; min-width: 0; }
.tab-list [role="tab"] { position: relative; width: 100%; min-height: 86px; padding: 20px 24px; border: 0; border-bottom: 1px solid var(--border); background: var(--bg); color: var(--text-muted); font-size: 18px; text-align: left; font-weight: var(--weight-normal); }
.tab-list [role="tab"] small { display: block; margin-top: 5px; color: var(--text-muted); font-size: 13px; }
.tab-list [role="tab"][aria-selected="true"] { color: var(--text); }
.tab-list [role="tab"][aria-selected="true"]::before { content: ""; position: absolute; inset: 20px auto 20px 0; width: 2px; background: var(--accent); color: var(--on-ink); }
[role="tabpanel"] { min-width: 0; }
.tabs.is-enhanced [role="tabpanel"]:not([hidden]) { animation: panelAppear .3s var(--ease); }
.tab-panel .board { height: 420px; }
.tab-panel .board-word { left: 28px; font-size: 220px; }
.tab-panel h2 { margin-top: 28px; }
.tab-panel p { color: var(--text-muted); }
.board-demand { --board-angle: 145deg; }
.board-protocols { --board-angle: 78deg; }
.board-subscribe { --board-angle: 165deg; }
.board-config { --board-angle: 102deg; }
.board-diagnostics { --board-angle: 38deg; }

.toc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; padding: 12px; overflow-x: visible; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); }
.toc a { min-width: 0; max-width: 100%; padding: 10px 16px; border-radius: var(--r-pill); color: var(--text-muted); font-size: var(--text-small); white-space: normal; overflow-wrap: anywhere; text-decoration: none; }
.toc a:hover, .toc a[aria-current="location"] { background: var(--bg-panel); color: var(--text); }
.toc-sticky { position: sticky; top: 16px; z-index: 5; }
.toc-static { position: static; }

.faq-list { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); overflow: hidden; }
.faq-item + .faq-item { border-top: 1px solid var(--border); }
.faq-item summary { position: relative; padding: 24px 60px 24px 28px; min-height: 72px; cursor: pointer; list-style: none; font-size: 18px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 28px; top: 24px; color: var(--text-muted); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding: 0 28px 24px; color: var(--text-muted); }
.faq-answer > :last-child { margin-bottom: 0; }
.term-card { padding: 28px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); }
.term-card dt { margin-bottom: 12px; font-family: var(--font-mono); font-size: 19px; overflow-wrap: anywhere; }
.term-card dd { margin: 0; color: var(--text-muted); }
.term-category { margin-bottom: 16px; }

.appstore-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; max-width: 100%; padding: 12px 24px; border: 1px solid var(--ink); border-radius: var(--r-pill); background: var(--ink); color: var(--on-ink); text-decoration: none; transition: transform var(--duration-fast) var(--ease); }
.appstore-button:hover { transform: translateY(-1px); background: var(--ink-hover); color: var(--on-ink); }
.appstore-button > svg { width: 24px; height: 28px; }
.appstore-copy { display: block; min-width: 0; }
.appstore-copy small { display: block; font-size: 11px; line-height: 1.2; }
.appstore-copy strong { display: block; font-size: 16px; line-height: 1.5; }
.appstore-button.store-primary { min-height: 64px; padding-inline: 32px; box-shadow: var(--shadow-float); }
.fact-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; padding: 0; margin: 0; list-style: none; }
.fact-row .chip { text-align: center; justify-content: center; }
.fact-row-start { justify-content: flex-start; }

.shot-row { display: flex; justify-content: center; align-items: start; flex-wrap: wrap; gap: 32px; }
.official-shot { width: min(280px, 100%); max-width: 280px; min-width: 0; flex-shrink: 0; padding: 0; margin: 0; }
.official-shot img { display: block; width: 100%; height: auto; border-radius: var(--r-shot); }
.official-shot { filter: none; }
.official-shot img, .shot-placeholder { outline: 1px solid var(--border); outline-offset: -1px; }
.official-shot figcaption { padding-top: 14px; color: var(--text-muted); font-size: var(--text-caption); line-height: 1.7; }
.shot-placeholder { display: grid; place-items: center; width: 100%; aspect-ratio: 750 / 1334; border-radius: var(--r-shot); background: var(--bg-panel); color: var(--text-muted); text-align: center; }
.shot-placeholder span { max-width: 180px; padding: 20px; }
.device-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; padding: 32px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); color: var(--text); text-decoration: none; box-shadow: var(--shadow-hair); }
.device-card > svg { width: 42px; height: 56px; }
.device-card p { margin: 0 0 16px; color: var(--text-muted); font-size: var(--text-small); }
.device-card .device-link { font-size: var(--text-small); }
.device-card:hover { box-shadow: var(--shadow-hair), var(--shadow-float); }
.article-card { min-width: 0; }
.article-card a { display: block; text-decoration: none; }
.article-art { position: relative; height: 220px; overflow: hidden; border-radius: var(--r-card); background: var(--bg-panel); color: var(--text); }
.article-art span { position: absolute; left: 24px; bottom: 24px; font-family: var(--font-mono); font-size: 34px; }
.article-card h3 { margin-top: 24px; font-size: 23px; }
.article-card p { color: var(--text-muted); font-size: var(--text-small); }
.article-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: var(--text-caption); color: var(--text-muted); }
.callout { margin: 28px 0; padding: 24px 28px; border: 1px solid var(--border); border-left: 3px solid var(--text); border-radius: var(--r-card); background: var(--bg-panel); color: var(--text); }
.callout p:last-child { margin-bottom: 0; }
.callout-label { display: block; margin-bottom: 8px; font-size: var(--text-small); font-weight: var(--weight-medium); }
.article-store-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; margin-top: 64px; padding: 32px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg-panel); color: var(--text); }
.article-store-copy { flex: 1 1 240px; }
.article-store-copy h2 { font-size: 24px; margin-bottom: 12px; }
.article-store-copy p { margin: 0; color: var(--text-muted); }

.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--border); border-radius: var(--r-card); }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-small); }
.data-table :is(th, td), .prose table :is(th, td), .article-body table :is(th, td) { min-width: 7em; padding: 16px 20px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; overflow-wrap: normal; word-break: normal; }
.data-table th, .prose table th, .article-body table th { background: var(--bg-panel); color: var(--text); font-weight: var(--weight-medium); }
.data-table td, .prose table td, .article-body table td { background: var(--bg); color: var(--text); }
.data-table tr:last-child td { border-bottom: 0; }
.prose table, .article-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; min-width: 0; border-collapse: collapse; overscroll-behavior-inline: contain; }
.dl-fab { position: fixed; right: var(--gutter); bottom: 24px; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 20; display: inline-flex; align-items: center; gap: 12px; max-width: calc(100% - var(--gutter) * 2); min-height: 52px; padding: 12px 20px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg); color: var(--text); box-shadow: var(--shadow-hair), var(--shadow-float); text-decoration: none; font-size: var(--text-small); }
.dl-fab svg { width: 20px; height: 20px; }
.dl-fab span { min-width: 0; }
.fab-example { position: static; max-width: 100%; }

/* 仅供根目录静态设计预览使用。 */
.preview-section { padding-top: 0; padding-bottom: var(--section-space); }
.preview-label { margin-bottom: 32px; font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.swatch { margin: 0; }
.swatch-color { height: 90px; border: 1px solid var(--border); border-radius: var(--r-icon); }
.swatch figcaption { margin-top: 10px; font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
.swatch-bg { background: var(--bg); color: var(--text); }
.swatch-panel { background: var(--bg-panel); color: var(--text); }
.swatch-panel2 { background: var(--bg-panel-2); color: var(--text); }
.swatch-border { background: var(--border); color: var(--text); }
.swatch-grid { background: var(--grid-line); color: var(--text); }
.swatch-accent { background: var(--accent); color: var(--on-ink); }
.swatch-accent-dark { background: var(--accent-dark); color: var(--on-ink); }
.swatch-apricot { background: var(--apricot); color: var(--text); }
.swatch-text { background: var(--text); color: var(--on-ink); }
.swatch-muted { background: var(--text-muted); color: var(--on-ink); }
.swatch-faint { background: var(--text-faint); color: var(--text); }
.swatch-mask { background: var(--mask); color: var(--on-ink); }
.swatch-success { background: var(--success); color: var(--on-ink); }
.swatch-warn { background: var(--warn); color: var(--text); }
.swatch-error { background: var(--error); color: var(--on-ink); }
.swatch-clear { background: var(--clear); color: var(--text); }
.preview-h1 { font-size: var(--h1-size); line-height: 1.16; letter-spacing: var(--tracking-title); }
.preview-menu { display: none; }
.preview-menu summary { list-style: none; }
.preview-menu summary::-webkit-details-marker { display: none; }
.preview-menu[open] > nav { position: absolute; inset: var(--nav-h) 0 auto; padding: 16px var(--gutter); background: var(--bg); color: var(--text); border-bottom: 1px solid var(--border); max-height: calc(100dvh - var(--nav-h)); overflow-y: auto; }
.preview-menu nav a { display: flex; gap: 10px; align-items: center; width: 100%; min-height: 48px; padding: 12px; text-decoration: none; }
.preview-language > summary { cursor: pointer; list-style: none; }
.preview-language > summary::-webkit-details-marker { display: none; }
.preview-language { position: relative; }
.preview-language nav a { display: block; min-height: 44px; padding: 10px 16px; text-decoration: none; }
.preview-static .rule-line { animation: none; opacity: 0; transform: none; }
.preview-static .rule-line.r1 { opacity: 1; }
.preview-static .policy-on { animation: none; opacity: 0; }
.preview-static .policy-proxy .policy-on { opacity: 1; }

@keyframes ruleSwap {
  0% { opacity: 0; transform: translateY(8px); }
  3%, 22% { opacity: 1; transform: translateY(0); }
  25%, 100% { opacity: 0; transform: translateY(-8px); }
}
@keyframes onProxy {
  0%, 25%, 75%, 100% { opacity: 0; }
  3%, 22%, 78%, 97% { opacity: 1; }
}
@keyframes onDirect {
  0%, 25%, 50%, 100% { opacity: 0; }
  28%, 47% { opacity: 1; }
}
@keyframes onReject {
  0%, 50%, 75%, 100% { opacity: 0; }
  53%, 72% { opacity: 1; }
}
@keyframes panelAppear { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1280px) {
  .preview-menu { display: block; }
}
@media (max-width: 960px) {
  .board { height: 420px; }
  .board-word { left: 28px; font-size: 200px; }
  .feature-tabs { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .feature-tabs .tab-list { grid-column: 1; grid-row: 1; flex-direction: row; overflow-x: auto; gap: 8px; padding-block: 4px; }
  .feature-tabs .tab-panels { grid-column: 1; grid-row: 2; }
  .tab-list [role="tab"] { flex: 0 0 auto; width: auto; min-height: 44px; padding: 10px 18px; border: 1px solid var(--border); border-radius: var(--r-pill); font-size: var(--text-small); white-space: nowrap; }
  .tab-list [role="tab"] small { display: none; }
  .tab-list [role="tab"][aria-selected="true"] { background: var(--bg-panel); color: var(--text); border-color: var(--text-muted); }
  .tab-list [role="tab"][aria-selected="true"]::before { display: none; }
}
@media (max-width: 768px) {
  .hero h1 { font-size: 28px; }
}
@media (max-width: 640px) {
  .hero { padding-top: 28px; }
  .hero-actions { margin-bottom: 32px; gap: 10px; }
  .hero-actions .btn { padding-inline: 18px; }
  .tag { gap: 8px; font-size: 12px; }
  .rules { height: 36px; font-size: clamp(10px, 3.05vw, 20px); line-height: 36px; }
  .paper-body { padding: 16px 18px 14px; }
  .paper-bar { padding-inline: 16px; }
  .comment { display: none; }
  .paper-foot { justify-content: flex-end; }
  .policy { min-width: 0; padding-inline: 14px; }
  .lede { font-size: var(--text-small); }
  .platforms { gap: 10px 16px; }
  .board { height: 300px; }
  .board-word { font-size: 128px; }
  .board-caption h2 { font-size: 22px; }
  .tab-panel .board { height: 280px; }
  .tab-panel .board-word { font-size: 128px; }
  .shot-row { flex-direction: column; align-items: center; }
  .device-card { padding: 24px; gap: 18px; }
  .device-card > svg { width: 32px; height: 46px; }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact-row { flex-direction: row; flex-wrap: wrap; }
  .faq-item summary { padding: 20px 48px 20px 22px; font-size: 16px; }
  .faq-item summary::after { right: 22px; top: 20px; }
  .faq-answer { padding-inline: 22px; }
  .article-store-card { padding: 24px; }
  .callout { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .rule-line { opacity: 0; transform: none; }
  .rule-line.r1 { opacity: 1; }
  .policy-on { opacity: 0; }
  .policy-proxy .policy-on { opacity: 1; }
  .caret { opacity: 1; }
  .appstore-button:hover { transform: none; }
}