/* 首屏：网格与核对表各在独立层，纸卡可以越过底边。 */
.hero-field {
  position: relative;
  display: flow-root;
  padding-top: 28px;
  background: var(--hero-bg);
  color: var(--on-dark);
  text-align: center;
}
.hero-visual {
  position: absolute;
  inset: 0;
  overflow: clip;
  pointer-events: none;
}
.hero-visual > img {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  max-height: 190px;
  object-fit: cover;
}
.horizon {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 190px;
  color: var(--grid-line);
}
.hero-copy {
  position: relative;
  z-index: 1;
  max-width: var(--device-w);
  margin-inline: auto;
  padding-inline: var(--hero-gutter);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  max-width: 100%;
  padding: 2px 15px;
  border: 1px solid var(--on-dark-line);
  border-radius: var(--r-pill);
  color: var(--on-dark-muted);
  font-size: var(--fs-chip);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}
.badge-dot, .fact-dot { width: 7px; height: 7px; border-radius: var(--r-dot); background: var(--on-dark); color: var(--hero-bg); }
.hero-title { margin: 20px 0 16px; font-size: var(--fs-hero); line-height: var(--lh-tight); }
.hero-title .line-a { display: block; color: var(--on-dark); }
.hero-title .line-b { display: block; color: var(--coral); }
.lead {
  max-width: 620px;
  margin: 0 auto 24px;
  color: var(--on-dark-muted);
  font-size: var(--fs-lead);
  line-height: var(--lh-lead);
}
.lead strong { color: var(--on-dark); font-weight: var(--weight-medium); }
.platforms {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.platforms a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--on-dark-line);
  border-radius: var(--r-pill);
  color: var(--on-dark-muted);
  font-size: var(--fs-chip);
  text-decoration: none;
  transition: color var(--quick), border-color var(--quick);
}
.platforms a:hover { color: var(--on-dark); border-color: var(--on-dark-line-strong); }
.platforms svg { width: 15px; height: 15px; flex-shrink: 0; }

.device-slot {
  position: relative;
  z-index: 1;
  max-width: calc(var(--device-w) + var(--hero-gutter) * 2);
  margin: 32px auto calc(var(--overhang) * -1);
  padding-inline: var(--hero-gutter);
}
.ledger-stack { position: relative; isolation: isolate; }
.ledger-stack::before {
  content: "";
  position: absolute;
  inset: 14px 24px -14px;
  z-index: -1;
  border-radius: var(--r-card);
  background: var(--paper);
  color: var(--text);
}
.ledger {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-card);
  text-align: left;
}
.ledger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 4px 24px;
  border-bottom: 1px solid var(--border);
}
.ledger-name { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.ledger-name b { font-size: var(--fs-nav); font-weight: var(--weight-medium); }
.ledger-name span { color: var(--text-muted); font-size: var(--fs-code); }
.ro-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-size: var(--fs-xs);
}
.ledger-scroll, .table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ledger-scroll:focus-visible, .table-wrap:focus-visible { outline-offset: -3px; border-radius: 0; }
.ledger table { width: 100%; min-width: 620px; border-collapse: collapse; table-layout: fixed; }
.ledger .c-item { width: 35%; }
.ledger .c-loc { width: 27%; }
.ledger .c-field { width: 38%; }
.ledger th {
  height: 42px;
  padding-inline: 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
}
.ledger th.hl {
  background: var(--accent);
  color: var(--on-dark);
  border-bottom-color: var(--accent);
  font-size: var(--fs-code);
  letter-spacing: 0.02em;
  text-transform: none;
}
.ledger td {
  height: 38px;
  padding-inline: 24px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-tool);
  white-space: nowrap;
}
.ledger tbody tr:nth-child(even) td { background: var(--bg-panel); color: var(--text); }
.ledger tbody tr td.loc { color: var(--text-muted); font-size: var(--fs-small); }
.ledger tbody tr td.hl { background: var(--bg-panel2); color: var(--text); border-bottom-color: var(--line-pink); }
.ledger tbody tr:last-child td { border-bottom: 0; }
.field { display: flex; align-items: center; gap: 10px; }
.field svg { width: 14px; height: 14px; flex: none; color: var(--coral); }
.field code { color: var(--text); font-size: var(--fs-chip); }
.field .k { color: var(--accent); }

.factbar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  row-gap: 4px;
  margin: calc(var(--overhang) + 36px) auto 0;
  padding-inline: var(--gutter);
  list-style: none;
  color: var(--text-muted);
  font: var(--fs-fact)/20px var(--font-mono);
  letter-spacing: 0.02em;
}
.factbar li { display: inline-flex; align-items: center; gap: 8px; padding-inline: 18px; }
.factbar li + li { border-inline-start: 1px solid var(--border); }
.fact-dot { width: 6px; height: 6px; background: var(--success); color: var(--text); }

.dl-entry { max-width: var(--wrap); margin-inline: auto; padding: 88px var(--gutter) 112px; }
.dl-entry-head { text-align: center; }
.dl-entry-head h2 { margin: 0; }
.dl-entry-head h2 > span { display: block; color: var(--accent); white-space: normal; overflow-wrap: anywhere; }
.dl-entry-head p { max-width: 560px; margin: 16px auto 0; color: var(--text-muted); }
.dl-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
}
.dl-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: border-color var(--quick);
}
.dl-card:hover { border-color: var(--accent); color: var(--text); }
.dl-tile {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-tile);
  background: var(--bg-panel);
  color: var(--accent);
}
.dl-tile svg { width: 20px; height: 20px; }
.dl-card b { margin-top: 16px; font-size: var(--fs-lead); font-weight: var(--weight-medium); }
.dl-card .dl-note { margin-top: 6px; color: var(--text-muted); font-size: var(--fs-small); line-height: var(--lh-card); }
.dl-card em { margin-top: auto; padding-top: 16px; color: var(--accent); font-size: var(--fs-small); font-style: normal; font-weight: var(--weight-medium); }

.tabset, .feature-browser { min-width: 0; }
.tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
[role="tab"], .feature-pause {
  min-height: var(--tap);
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text);
  text-align: start;
  overflow-wrap: anywhere;
}
[role="tab"]:hover, .feature-pause:hover { border-color: var(--accent); color: var(--accent); }
[role="tab"][aria-selected="true"] { background: var(--bg-panel2); color: var(--accent); border-color: var(--accent); }
[role="tabpanel"] { min-width: 0; }
.feature-browser {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg);
  color: var(--text);
}
.feature-head {
  position: relative;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--r-card) var(--r-card) 0 0;
  background: var(--bg-panel);
  color: var(--text-muted);
}
.feature-pause { font-size: var(--fs-xs); }
.feature-progress {
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--accent);
  color: var(--on-dark);
  transform: scaleX(0);
  transform-origin: left;
}
.feature-browser.is-playing .feature-progress { animation: scan-ledger var(--feature-time) linear both; }
.feature-browser:is(:hover, :focus-within) .feature-progress { animation-play-state: paused; }
@keyframes scan-ledger { to { transform: scaleX(1); } }
.feature-rows {
  border-inline-end: 1px solid var(--border);
  border-end-start-radius: var(--r-card);
  overflow: clip;
}
.feature-rows [role="tab"], .feature-accordion summary {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 12px 18px;
  border: 0;
  border-inline-start: 3px solid var(--clear);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  text-align: start;
}
.feature-rows [role="tab"]:nth-child(even), .feature-accordion details:nth-child(even) summary {
  background: var(--bg-panel);
  color: var(--text);
}
.feature-rows [role="tab"]:hover { color: var(--accent); }
.feature-rows [role="tab"]:focus-visible, .feature-accordion summary:focus-visible { outline-offset: -4px; }
.feature-rows [role="tab"][aria-selected="true"], .feature-accordion details[open] > summary {
  border-inline-start-color: var(--accent);
  color: var(--accent);
  font-weight: var(--weight-active);
}
.feature-panels { border-end-end-radius: var(--r-card); background: var(--bg-panel2); color: var(--text); }
.feature-panel { padding: clamp(18px, 4vw, 40px); overflow-wrap: anywhere; }
.checklist { display: grid; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.checklist li { position: relative; padding-inline-start: 1.4em; }
.checklist li::before { content: ""; position: absolute; inset: 0.33em auto auto 0.18em; width: 0.4em; height: 0.7em; border: solid var(--coral); border-width: 0 2px 2px 0; transform: rotate(42deg); }
.feature-accordion { grid-column: 1 / -1; border-end-start-radius: var(--r-card); border-end-end-radius: var(--r-card); overflow: clip; }
.feature-accordion summary::after { content: "+"; float: inline-end; color: var(--accent); }
.feature-accordion details[open] > summary::after { content: "−"; }
.feature-accordion .feature-panel { background: var(--bg-panel2); color: var(--text); }
.preview-accordion { display: none; }

.toc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 18px 32px;
  padding-block: 8px;
  border-block: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.toc-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 4px 14px;
  border-radius: var(--r-pill);
  text-decoration: none;
}
.toc-tabs a:hover, .toc-tabs a[aria-current="location"] { background: var(--bg-panel2); color: var(--accent); }

.faq-item {
  margin-block: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--bg);
  color: var(--text);
}
.faq-item summary {
  position: relative;
  min-height: var(--tap);
  padding: 12px 48px 12px 18px;
  list-style: none;
  overflow-wrap: anywhere;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; inset: 12px 18px auto auto; color: var(--accent); }
.faq-item[open] summary { color: var(--accent); border-bottom: 1px solid var(--border); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding: 16px 18px; overflow-wrap: anywhere; }

.term-card { border-top: 3px solid var(--accent); }
.term-card .eyebrow, .post-meta { color: var(--text-muted); }
.client-card, .post-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.client-card :is(h3, p), .post-card :is(h3, p) { margin: 0; }
.post-card h3 a { text-decoration: none; }
.post-card h3 a:hover { text-decoration: underline; }
.post-meta { font-size: var(--fs-small); }
.card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tag, .status-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  overflow-wrap: anywhere;
}
.status-first { background: var(--accent); color: var(--on-dark); }
.status-recommended { background: var(--bg-panel2); color: var(--accent); }
.status-archived { border: 1px solid var(--border); background: var(--bg-panel); color: var(--text); }
[data-ver]:empty { display: none; }

.callout {
  margin: 1em 0;
  padding: 16px 20px;
  border-inline-start: 3px solid var(--accent);
  border-radius: 0 var(--r-panel) var(--r-panel) 0;
  background: var(--bg-panel2);
  color: var(--text);
  overflow-wrap: anywhere;
}
.article-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-block: 32px;
  background: var(--bg-panel2);
  color: var(--text);
}
.article-download > div { min-width: 0; flex: 1 1 16rem; }
.dl-fab {
  position: fixed;
  inset: auto 24px 24px auto;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 4px 20px;
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-dark);
  box-shadow: var(--shadow-fab);
  font-size: var(--fs-tool);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: background-color var(--quick);
}
.dl-fab:hover { background: var(--accent-dark); color: var(--on-dark); }
.dl-fab svg { width: 16px; height: 16px; }

.table-wrap { border: 1px solid var(--border); border-radius: var(--r-card); }
.data-table, :is(.prose, .reading) table {
  width: 100%;
  border-collapse: collapse;
  overflow-wrap: normal;
}
.prose table, .reading table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
}
:is(.prose, .reading) .table-wrap table { display: table; }
:is(.data-table, .prose table, .reading table) :is(th, td) {
  min-width: 7em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: start;
  overflow-wrap: normal;
  word-break: normal;
}
:is(.data-table, .prose table, .reading table) thead th { background: var(--accent); color: var(--on-dark); }
:is(.data-table, .prose table, .reading table) tbody tr:nth-child(even) > * { background: var(--bg-panel); color: var(--text); }
:is(.data-table, .prose table, .reading table) tbody tr > .hl { background: var(--bg-panel2); color: var(--text); }
:is(.data-table, .prose table, .reading table) tbody tr:last-child > * { border-bottom: 0; }

/* 仅供根目录样稿显示令牌。 */
.swatch-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.swatch { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.swatch i {
  display: block;
  height: 42px;
  margin-bottom: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-tile);
  background: var(--sample);
  color: var(--text);
}
.sw-bg { --sample: var(--bg); }
.sw-panel { --sample: var(--bg-panel); }
.sw-pink { --sample: var(--bg-panel2); }
.sw-border { --sample: var(--border); }
.sw-accent { --sample: var(--accent); }
.sw-dark { --sample: var(--accent-dark); }
.sw-hero { --sample: var(--hero-bg); }
.sw-coral { --sample: var(--coral); }
.sw-text { --sample: var(--text); }
.sw-muted { --sample: var(--text-muted); }
.sw-ok { --sample: var(--success); }
.sw-warn { --sample: var(--warn); }
.sw-error { --sample: var(--error); }
.sw-on { --sample: var(--on-dark); }
.sw-on-muted { --sample: var(--on-dark-muted); }
.sw-on-line { --sample: var(--on-dark-line); }
.sw-on-strong { --sample: var(--on-dark-line-strong); }
.sw-on-wash { --sample: var(--on-dark-wash); }
.sw-grid { --sample: var(--grid-line); }
.sw-paper { --sample: var(--paper); }
.sw-pink-line { --sample: var(--line-pink); }
.sw-veil { --sample: var(--veil); }
.sw-clear { --sample: var(--clear); }
.dark-swatches { margin-top: 16px; padding: 16px; border-radius: var(--r-panel); }

@media (max-width: 1180px) { .dl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) { .horizon { display: none; } }
@media (max-width: 640px) {
  .hero-field { padding-top: 24px; }
  .lead { font-size: var(--fs-button); }
  .ledger-name span { display: none; }
  .ledger-head { padding-inline: 18px; }
  .factbar li { padding: 2px 12px; }
  .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl-fab { inset: auto 16px 16px auto; }
  .feature-browser { grid-template-columns: minmax(0, 1fr); }
  .preview-browser > :is(.feature-rows, .feature-panels) { display: none; }
  .preview-browser .preview-accordion { display: block; }
}
@media (max-width: 420px) { .dl-grid { grid-template-columns: minmax(0, 1fr); } }