/* 首页定稿：静态配置窗口、点阵、虚线侧轨。 */
.hero { position: relative; overflow: hidden; overflow-x: clip; background: var(--bg); color: var(--text); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, var(--clear) 1.3px);
  background-size: 18px 18px;
  mask-image: radial-gradient(ellipse 52% 58% at 50% 26%, var(--clear) 40%, var(--text) 100%);
  -webkit-mask-image: radial-gradient(ellipse 52% 58% at 50% 26%, var(--clear) 40%, var(--text) 100%);
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 80px; z-index: 2; pointer-events: none;
  background: linear-gradient(to bottom, var(--clear), var(--bg-panel)); color: var(--text);
}
.rails {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  width: min(var(--rail), calc(100% - var(--gutter) * 2)); margin-inline: auto;
  border-left: 1px dashed var(--border); border-right: 1px dashed var(--border);
}
.hero-in {
  position: relative; z-index: 1;
  width: 100%; max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto; padding-inline: var(--gutter); padding-top: 34px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.notice {
  display: inline-flex; align-items: center; gap: 10px; min-height: 30px; max-width: 100%;
  padding: 3px 13px 3px 4px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text); font-size: 13.5px;
}
.notice:hover { border-color: var(--border-strong); }
.notice-tag {
  display: inline-flex; flex-shrink: 0; align-items: center; min-height: 22px; padding: 0 9px;
  border-radius: var(--r-pill); background: var(--accent-tint); color: var(--accent-dark);
  font-size: 12px; font-weight: var(--weight-medium);
}
.notice-arrow { color: var(--text-muted); flex-shrink: 0; }
.hero-title {
  margin: 20px 0 0; font-family: var(--font-display); font-weight: var(--weight-regular);
  font-size: var(--size-h1); line-height: 1.1; letter-spacing: var(--tracking-title); color: var(--text);
}
.hero-title > span { display: block; }
.hero .cta-row { margin-top: 24px; justify-content: center; }
.hero-lede { margin: 16px 0 0; max-width: 720px; font-size: 16px; line-height: 1.6; color: var(--text-muted); }
.hero-lede strong { font-weight: var(--weight-medium); color: var(--text); }
.platforms { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.platforms a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 4px 13px 4px 11px;
  border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); color: var(--text-muted); font-size: 13px;
}
.platforms svg { width: 14px; height: 14px; color: var(--text); }
.platforms a:hover { border-color: var(--border-strong); color: var(--text); }
.editor {
  align-self: stretch; min-width: 0; margin: 30px 0 0; text-align: left; padding: 6px;
  border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg-panel); color: var(--text);
  box-shadow: var(--shadow-window);
}
.ed-bar { display: flex; align-items: center; justify-content: space-between; min-height: 40px; gap: 8px; }
.ed-tabs { display: flex; gap: 2px; min-width: 0; }
.ed-tab {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 12px;
  border: 1px solid var(--clear); border-radius: var(--r-ctl); font-size: 13.5px; color: var(--text-muted);
}
.ed-tab code { font-size: 12.5px; color: var(--text-muted); }
.ed-tab.is-on { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-card); }
.ed-tab.is-on code { color: var(--text); }
.ed-dot { flex-shrink: 0; width: 7px; height: 7px; border-radius: var(--r-round); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.ed-more { display: inline-flex; align-items: center; gap: 5px; padding-inline: 12px; font-size: 13px; color: var(--text-muted); }
.ed-more:hover { color: var(--accent-dark); }
.ed-body { display: grid; grid-template-columns: minmax(0, 58fr) minmax(0, 42fr); gap: 6px; margin-top: 6px; height: 440px; }
.ed-body > * { min-width: 0; }
.ed-canvas {
  position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-card);
  background-color: var(--bg); color: var(--text);
  background-image: radial-gradient(circle, var(--dot) 1px, var(--clear) 1.3px);
  background-size: 16px 16px; background-position: 8px 8px;
}
.flow { display: flex; flex-direction: column; align-items: center; padding-top: 28px; }
.node {
  position: relative; display: flex; align-items: center; gap: 11px; width: 240px; max-width: 100%;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-card);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-card);
}
.node-wide { width: 280px; }
.node-ico {
  display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px;
  border-radius: var(--r-ctl); background: var(--bg-panel-2); color: var(--text-muted);
}
.node-ico svg { width: 14px; height: 14px; }
.node-ico.is-mint { background: var(--success-tint); color: var(--success); }
.node-txt { display: flex; flex-direction: column; min-width: 0; }
.node-k { font-size: 12px; line-height: 1.4; color: var(--text-muted); }
.node-k code { font-size: 11.5px; }
.node-v { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.node-mark { position: absolute; top: 50%; right: 12px; width: 6px; height: 6px; margin-top: -3px; border-radius: var(--r-round); background: var(--accent); }
.wire { display: block; width: 1px; height: 18px; flex-shrink: 0; background: var(--border-strong); }
.wire-s { height: 12px; }
.fork { position: relative; width: 277px; height: 34px; border: 1px dashed var(--border-strong); border-bottom: 0; border-radius: var(--r-ctl) var(--r-ctl) 0 0; }
.fork-tag {
  position: absolute; top: 58%; padding: 1px 7px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; line-height: 1.5; white-space: nowrap;
}
.fork-tag-l { left: 0; transform: translate(-50%, -50%); }
.fork-tag-r { right: 0; transform: translate(50%, -50%); font-family: var(--font-body); }
.pair { display: flex; gap: 36px; max-width: 100%; }
.merge { width: 277px; height: 16px; border: 1px solid var(--border-strong); border-top: 0; border-radius: 0 0 var(--r-ctl) var(--r-ctl); }
.end { display: inline-flex; align-items: center; height: 26px; padding-inline: 14px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.ed-panel { overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); color: var(--text); }
.pn-head { display: flex; align-items: center; justify-content: space-between; height: 38px; padding-inline: 14px; border-bottom: 1px solid var(--border); }
.pn-file { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: var(--weight-medium); color: var(--text); }
.pn-file svg { width: 14px; height: 14px; color: var(--text-muted); }
.pn-switcher { color: var(--text-muted); }
.pn-lang { padding: 1px 7px; border: 1px solid var(--border); border-radius: var(--r-pill); font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); }
.code { counter-reset: ln; padding-block: 8px; max-width: 100%; overflow-x: auto; font-family: var(--font-mono); font-size: 12px; line-height: 17.5px; color: var(--text); }
.ln { position: relative; counter-increment: ln; width: max-content; min-width: 100%; padding: 0 14px 0 44px; white-space: pre; }
.ln::before { content: counter(ln); position: absolute; left: 0; width: 28px; text-align: right; color: var(--text-muted); }
.ln.is-hl { background: var(--bg-panel); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.t-k { color: var(--accent-dark); }
.t-s, .t-n { color: var(--text); }
.t-p { color: var(--text-muted); }
.pn-note { margin: 0; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 12.5px; line-height: 1.55; color: var(--text-muted); }
.pn-note code { font-size: 12px; color: var(--text); }
.pn-state { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--border); }
.pn-state-l { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text); }
.pn-state-l code { font-size: 12.5px; }
.st-dot { flex-shrink: 0; width: 7px; height: 7px; border-radius: var(--r-round); background: var(--success); box-shadow: 0 0 0 3px var(--success-tint); }
.switch { position: relative; flex-shrink: 0; width: 30px; height: 18px; border-radius: var(--r-pill); background: var(--success); }
.switch::after { content: ""; position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: var(--r-round); background: var(--surface); box-shadow: var(--shadow-card); }
.band { position: relative; background: var(--bg-panel); color: var(--text); border-top: 1px solid var(--border); overflow-x: clip; }
.band-in { width: min(var(--rail), calc(100% - var(--gutter) * 2)); margin-inline: auto; padding: 72px 60px 88px; border-left: 1px dashed var(--border); border-right: 1px dashed var(--border); }
.band-title { margin: 0; font-family: var(--font-display); font-weight: var(--weight-regular); font-size: 28px; line-height: 1.25; letter-spacing: -.015em; }
.band-lede { margin: 10px 0 0; font-size: 16px; color: var(--text-muted); }
.dl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 32px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); color: var(--text); }
.dl-cell { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; border-left: 1px solid var(--border); }
.dl-cell:first-child { border-left: 0; }
.dl-os { font-size: 15px; color: var(--text); }
.dl-client { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent-dark); }
.dl-desc { font-size: 13.5px; color: var(--text-muted); }
.dl-go { margin-top: 6px; font-size: 13.5px; color: var(--accent-dark); }

/* 可访问 tab：装饰窗口上方的静态字段标签不伪装成交互 tab。 */
.tabs { min-width: 0; }
.tab-list, [role="tablist"] { display: flex; gap: 0; max-width: 100%; overflow-x: auto; border-bottom: 1px solid var(--border); }
.tab, [role="tab"] {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  flex-shrink: 0; min-height: 46px; padding: 12px 20px; border: 0;
  background: var(--clear); color: var(--text-muted); font-size: 14px; text-align: left;
}
[role="tab"]:hover { background: var(--bg-panel); color: var(--text); }
[role="tab"][aria-selected="true"] { background: var(--bg-panel); color: var(--text); }
[role="tab"][aria-selected="true"]::after { content: ""; position: absolute; bottom: 0; left: 16px; right: 16px; height: 2px; background: var(--accent); }
.tab-panel { min-width: 0; padding-top: 28px; }
.feature-tabs { display: grid; grid-template-columns: minmax(0, 32fr) minmax(0, 68fr); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.feature-tabs > * { min-width: 0; }
.feature-tabs [role="tablist"] { flex-direction: column; border-bottom: 0; border-right: 1px solid var(--border); overflow-x: visible; }
.feature-tabs [role="tab"] { justify-content: flex-start; flex-wrap: wrap; min-height: 66px; border-bottom: 1px solid var(--border); }
.feature-tabs [role="tab"]:last-child { border-bottom: 0; }
.feature-tabs [role="tab"] code { font-size: 12px; }
.feature-tabs [role="tab"][aria-selected="true"]::after { top: 0; bottom: 0; left: 0; right: auto; width: 2px; height: auto; }
.feature-tabs .tab-panel { padding: 32px; background: var(--surface); color: var(--text); }
.mini-canvas { display: grid; place-items: center; gap: 16px; min-height: 160px; padding: 24px; margin-top: 24px; border: 1px solid var(--border); border-radius: var(--r-card); background-color: var(--bg); color: var(--text); background-image: radial-gradient(circle, var(--dot) 1px, var(--clear) 1.3px); background-size: 16px 16px; }
.mini-canvas pre { width: 100%; margin: 0; font-size: 12px; }

/* 目录直接置于覆盖全部章节的容器中；不做祖先布局改写。 */
.toc { position: sticky; top: 0; z-index: 10; display: flex; gap: 8px; max-width: 100%; overflow-x: auto; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); color: var(--text); }
.toc a { flex-shrink: 0; padding: 8px 12px; border-radius: var(--r-ctl); font-size: 13px; color: var(--text-muted); }
.toc a:hover, .toc a[aria-current="location"] { background: var(--bg-panel); color: var(--accent-dark); }
.faq-item { border-bottom: 1px solid var(--border); padding-block: 4px; }
.faq-item summary { position: relative; min-height: 56px; padding: 16px 36px 16px 0; list-style: none; cursor: pointer; font-weight: var(--weight-medium); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 8px; top: 14px; color: var(--text-muted); font-family: var(--font-mono); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding: 0 24px 16px 0; color: var(--text-muted); }
.faq-answer p:last-child { margin-bottom: 0; }
.term-card { border: 1px solid var(--border); border-radius: var(--r-card); padding: 24px; background: var(--surface); color: var(--text); min-width: 0; }
.term-card dt { font-family: var(--font-mono); font-size: 17px; margin-bottom: 10px; }
.term-card dd { margin: 0; color: var(--text-muted); font-size: 14px; }
.client-card { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); color: var(--text); padding: 28px; min-width: 0; }
.client-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.app-logo { width: 56px; height: 56px; flex-shrink: 0; }
.client-head h3 { margin: 0; }
.client-meta { color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.client-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.badge, .tag {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 9px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--bg-panel); color: var(--text-muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere;
}
.badge-primary, .badge-recommended { background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent-dark); }
.badge-retired { background: var(--bg-panel-2); color: var(--text-muted); }
.badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.article-card { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 24px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); color: var(--text); }
.article-card h3 { margin: 18px 0 12px; font-size: 20px; line-height: 1.5; }
.article-card h3 a:hover { color: var(--accent-dark); }
.article-card p { color: var(--text-muted); font-size: 14px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); }
.article-card .text-link { margin-top: auto; font-size: 13px; }
.callout { margin: 24px 0; padding: 20px 24px; border: 1px solid var(--border); border-left: 2px solid var(--accent); border-radius: var(--r-ctl); background: var(--bg-panel); color: var(--text); }
.callout p:last-child { margin-bottom: 0; }
.callout-title { display: block; margin-bottom: 8px; font-weight: var(--weight-medium); }
.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--border); border-radius: var(--r-card); -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.data-table th, .data-table td, .prose table th, .prose table td, .article-body table th, .article-body table td {
  min-width: 7em; padding: 14px 18px; border-bottom: 1px solid var(--border);
  overflow-wrap: normal; word-break: normal; vertical-align: top;
}
.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(--surface); 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; }
.data-table code, .prose table code, .article-body table code { overflow-wrap: anywhere; }
.article-body { min-width: 0; }
.article-body > div { min-width: 0; max-width: 100%; }
.article-download { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: 48px; padding: 24px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg-panel); color: var(--text); }
.article-download h2 { margin: 0 0 8px; font-size: 24px; }
.article-download p { margin: 0; color: var(--text-muted); font-size: 14px; }
.dl-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 20;
  display: inline-flex; align-items: center; gap: 12px;
  max-width: calc(100% - 32px); min-height: 52px; padding: 12px 16px;
  border: 1px solid var(--border-strong); border-radius: var(--r-card);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-card);
}
.dl-fab > svg { width: 20px; height: 20px; color: var(--accent-dark); }
.dl-fab-copy { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.dl-fab-copy small { color: var(--text-muted); font-size: 12px; }
.dl-fab:hover { border-color: var(--accent); }
.has-dl-fab { padding-bottom: 90px; }

/* 预览专用家具，不污染实际页面内容。 */
.preview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.swatch { min-width: 0; border: 1px solid var(--border); border-radius: var(--r-ctl); overflow: hidden; background: var(--surface); color: var(--text); }
.swatch-chip { display: block; height: 56px; border-bottom: 1px solid var(--border); }
.swatch code { display: block; padding: 9px 12px; font-size: 11px; }
.sw-bg { background: var(--bg); }
.sw-panel { background: var(--bg-panel); }
.sw-panel2 { background: var(--bg-panel-2); }
.sw-surface { background: var(--surface); }
.sw-border { background: var(--border); }
.sw-strong { background: var(--border-strong); }
.sw-dot { background: var(--dot); }
.sw-accent { background: var(--accent); }
.sw-dark { background: var(--accent-dark); }
.sw-tint { background: var(--accent-tint); }
.sw-on { background: var(--accent-on); }
.sw-text { background: var(--text); }
.sw-muted { background: var(--text-muted); }
.sw-faint { background: var(--text-faint); }
.sw-success { background: var(--success); }
.sw-mint { background: var(--success-tint); }
.sw-warn { background: var(--warn); }
.sw-error { background: var(--error); }
.sw-clear { background: var(--clear); }
.sw-veil { background: var(--veil); }
.type-sample { padding-block: 20px; border-bottom: 1px solid var(--border); }
.type-sample > :first-child { margin-top: 0; }
.type-sample > :last-child { margin-bottom: 0; }
.preview-mobile { display: none; }
.preview-mobile summary { list-style: none; cursor: pointer; }
.preview-mobile nav { padding-top: 12px; }
.preview-mobile a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 12px; }
.preview-mobile svg { width: 16px; height: 16px; }

@media (max-width: 1100px) {
  .preview-mobile { display: block; }
}
@media (max-width: 1000px) and (min-width: 901px) {
  .pair { gap: 14px; }
  .pair .node { width: 205px; padding-inline: 8px; gap: 6px; }
  .pair .node-v { font-size: 11px; }
}
@media (max-width: 900px) {
  .ed-body { grid-template-columns: minmax(0, 1fr); height: auto; }
  .ed-canvas { min-height: 380px; }
  .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl-cell:nth-child(3) { border-left: 0; }
  .dl-cell:nth-child(n+3) { border-top: 1px solid var(--border); }
  .band-in { padding-inline: 28px; }
}
@media (max-width: 640px) {
  .notice { gap: 6px; font-size: 11px; }
  .hero-in { padding-top: 26px; }
  .hero-lede { font-size: 14px; }
  .ed-bar { flex-wrap: wrap; }
  .ed-tabs { flex-wrap: wrap; }
  .ed-tab { padding-inline: 8px; }
  .ed-tabs .ed-tab:nth-child(n+3) { display: none; }
  .ed-more { font-size: 11px; padding-inline: 6px; }
  .ed-canvas { min-height: 0; padding: 0 12px 28px; }
  .pair { flex-direction: column; gap: 12px; align-items: center; width: 100%; }
  .node, .node-wide { width: 240px; }
  .fork, .merge { display: none; }
  .flow { padding-top: 24px; }
  .code { font-size: 11px; }
  .band-in { padding: 56px 16px 64px; }
  .dl-grid { grid-template-columns: minmax(0, 1fr); }
  .dl-cell { border-left: 0; border-top: 1px solid var(--border); }
  .dl-cell:first-child { border-top: 0; }
  .feature-tabs { grid-template-columns: minmax(0, 1fr); }
  .feature-tabs [role="tablist"] { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .feature-tabs [role="tab"] { min-height: 52px; border-bottom: 0; padding: 12px 16px; }
  .feature-tabs [role="tab"][aria-selected="true"]::after { top: auto; bottom: 0; left: 16px; right: 16px; width: auto; height: 2px; }
  .feature-tabs .tab-panel { padding: 20px; }
  .mini-canvas { padding: 16px; }
  .client-card { padding: 20px; }
  .callout { padding: 16px 18px; }
  .dl-fab { right: 16px; bottom: 16px; }
  .preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}