/* 首屏装置保持静态；唯一柔影属于探出的 RULE-SET 积木。 */
.stage { position: relative; height: 560px; margin: 0; min-width: 0; }
.board { position: absolute; left: 0; top: 24px; bottom: 24px; width: 85%; background: var(--bg-panel-2); color: var(--text); border-radius: var(--radius); }
.win {
  position: absolute; left: 28px; right: 140px; top: 56px; bottom: 48px;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
}
.win-bar { position: relative; flex: none; height: 36px; display: flex; align-items: center; padding-inline: 14px; border-bottom: 1px solid var(--border); }
.lights { display: flex; gap: 7px; position: relative; z-index: 1; flex-shrink: 0; }
.light { width: 10px; height: 10px; border-radius: var(--radius-round); flex-shrink: 0; }
.light-close { background: var(--error); color: var(--text); }
.light-min { background: var(--warn); color: var(--text); }
.light-max { background: var(--success); color: var(--text); }
.win-title { position: absolute; left: 0; right: 0; text-align: center; font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--text-muted); letter-spacing: .01em; }
.win-body { flex: 1; display: flex; min-height: 0; }
.side { flex: none; width: 116px; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; background: var(--bg-panel); color: var(--text-muted); border-right: 1px solid var(--border); }
.side-item { font-size: 12.5px; line-height: 1.3; padding: 7px 10px; border-radius: var(--radius-sm); }
.side-item.is-on { background: var(--accent-soft); color: var(--accent); font-weight: var(--weight-semibold); }
.main { flex: 1; min-width: 0; padding: 14px 18px 18px; display: flex; flex-direction: column; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; border-bottom: 1px solid var(--border); font-size: 13px; }
.row-label { font-weight: var(--weight-medium); color: var(--text); }
.seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--bg-panel-2); color: var(--text-muted); border-radius: var(--radius); flex-shrink: 0; }
.seg-item { font-size: var(--text-xs); line-height: 1.2; padding: 4px 11px; border-radius: var(--radius-sm); }
.seg-item.is-on { background: var(--accent); color: var(--on-accent); font-weight: var(--weight-semibold); }
.tgl { position: relative; width: 30px; height: 18px; flex-shrink: 0; border-radius: var(--radius-pill); background: var(--border-strong); color: var(--text); }
.tgl::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: var(--radius-round); background: var(--bg); color: var(--text); }
.tgl.is-on { background: var(--success); color: var(--text); }
.tgl.is-on::after { left: 14px; }
.field { min-width: 72px; padding: 4px 10px; text-align: right; font: var(--weight-medium) var(--text-xs)/1.4 var(--font-mono); color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.code { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel); color: var(--text); min-width: 0; }
.code-tab { display: flex; align-items: center; gap: 6px; height: 26px; padding-inline: 12px; border-bottom: 1px solid var(--border); font: var(--weight-medium) 11px/1 var(--font-mono); color: var(--text-muted); }
.code-tab svg { width: 12px; height: 12px; flex-shrink: 0; }
.code pre { margin: 0; padding: 9px 12px 10px; border: 0; font: var(--text-xs)/1.6 var(--font-mono); color: var(--text); white-space: pre; }
.code pre .y-k { font-weight: var(--weight-semibold); }
.code pre .y-p { color: var(--text-muted); }
.code pre .y-t { color: var(--accent); font-weight: var(--weight-medium); }
.code pre .y-v { font-weight: var(--weight-medium); }
.drop { margin-top: auto; min-height: 34px; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); font-size: var(--text-xs); color: var(--text-muted); background: var(--bg); }
.drop-plus { font-family: var(--font-mono); font-weight: var(--weight-semibold); color: var(--text); }
.rail { position: absolute; right: 0; top: 24px; bottom: 24px; width: 128px; overflow: hidden; }
.rail-list { position: absolute; left: 0; right: 0; top: -38px; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.tile { height: 108px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.tile-ic { width: 22px; height: 22px; margin-bottom: 2px; flex-shrink: 0; }
.tile-name { font: var(--weight-semibold) 10.5px/1 var(--font-mono); letter-spacing: .01em; color: var(--text); }
.tile-hint { font-size: 11px; line-height: 1; color: var(--text-muted); }
.tile-ghost { border-style: dashed; border-color: var(--border-strong); background: var(--bg-panel); color: var(--text); }
.tile-lift { position: absolute; right: 52px; top: 392px; width: 128px; z-index: 3; border-color: var(--accent); box-shadow: var(--shadow-lift); transform: rotate(-2deg); }
.cursor { position: absolute; right: 14px; bottom: 10px; width: 18px; height: 18px; }
.cursor path { fill: var(--bg); stroke: var(--text); stroke-width: 1.5; stroke-linejoin: round; }
.dl-band { background: var(--bg-panel); color: var(--text); border-top: 1px solid var(--border); padding-top: 88px; padding-bottom: 96px; }
.dl-band h2 { margin: 0 0 12px; font-size: 32px; }
.dl-band p { margin: 0; max-width: 620px; color: var(--text-muted); }

.tabs { min-width: 0; }
.tab-list, [role="tablist"].tab-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 24px; }
.tab-list [role="tab"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; max-width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text-muted); font-weight: var(--weight-medium);
}
.tab-list [role="tab"]:hover { border-color: var(--accent); color: var(--accent); }
.tab-list [role="tab"][aria-selected="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
[role="tabpanel"] { min-width: 0; }
[role="tabpanel"]:focus-visible { outline-offset: 6px; }

/* 面板容器的父级覆盖整组特性，sticky 才有真实行程。 */
.feature-workbench { display: grid; grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); gap: 48px; align-items: start; position: relative; }
.feature-previews { position: sticky; top: 24px; padding: 32px; background: var(--bg-panel); color: var(--text); border-radius: var(--radius); }
.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.feature-entry { min-width: 0; border-top: 1px solid var(--border); }
.feature-tab { display: block; width: 100%; min-height: 180px; padding: 24px 0 24px 16px; border: 0; border-left: 2px solid var(--transparent); text-align: left; background: var(--bg); color: var(--text); }
.feature-tab .icon { margin-bottom: 16px; }
.feature-title { display: block; margin-bottom: 10px; font-size: var(--title-sm); font-weight: var(--weight-bold); }
.feature-description { display: block; font-size: var(--text-sm); line-height: 1.75; color: var(--text-muted); }
.feature-tab[aria-selected="true"] { border-left-color: var(--accent); }
.feature-tab[aria-selected="true"] .feature-title { color: var(--accent); }
.interface-slice { border: 1px solid var(--border); padding: 20px; border-radius: var(--radius); background: var(--bg); color: var(--text); }
.interface-slice h3 { font-size: var(--text-sm); margin-top: 0; }
.slice-note { margin: 18px 0 0; font-size: var(--text-sm); color: var(--text-muted); }

.toc { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 16px 20px; margin-bottom: 40px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); }
.toc a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-muted); text-decoration: none; font-size: var(--text-sm); }
.toc a:hover { color: var(--accent); }
.toc.is-static { position: static; }
.faq-item { border-top: 1px solid var(--border); }
.faq-item:last-child { border-bottom: 1px solid var(--border); }
.faq-item summary { cursor: pointer; padding: 22px 32px 22px 0; position: relative; list-style: none; font-weight: var(--weight-semibold); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 4px; top: 22px; color: var(--text-muted); font-family: var(--font-mono); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding-bottom: 22px; color: var(--text-muted); max-width: 780px; }
.faq-answer > :last-child { margin-bottom: 0; }
.term-card { padding: 24px 0; border-top: 1px solid var(--border); min-width: 0; }
.term-card h3 { margin: 12px 0; font-size: var(--title-sm); }
.term-card p { color: var(--text-muted); margin-bottom: 0; }
.term-key { font: var(--text-xs)/1.5 var(--font-mono); color: var(--text-muted); overflow-wrap: anywhere; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%; padding: 4px 9px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-panel); color: var(--text-muted);
  font-size: var(--text-xs); font-weight: var(--weight-medium); line-height: 1.4; overflow-wrap: anywhere;
}
.badge-first, .badge-recommended { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.badge-archived { background: var(--bg-panel-2); color: var(--text-muted); border-color: var(--border); }
.status-dot { width: 6px; height: 6px; border-radius: var(--radius-round); background: var(--success); color: var(--text); flex-shrink: 0; }
.download-card { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); min-width: 0; }
.download-card.is-first { border-color: var(--accent); }
.download-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.download-card h3 { margin: 0; font-size: var(--title-md); }
.download-card p { color: var(--text-muted); }
.download-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: var(--text-sm); color: var(--text-muted); margin-bottom: 20px; }
[data-ver]:empty { display: none; }
.download-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.article-card { min-width: 0; padding-top: 24px; border-top: 1px solid var(--border); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: var(--text-xs); color: var(--text-muted); }
.article-card h3 { font-size: 21px; margin: 18px 0 12px; line-height: 1.5; }
.article-card h3 a { color: var(--text); text-decoration: none; }
.article-card h3 a:hover { color: var(--accent); }
.article-card p { color: var(--text-muted); font-size: var(--text-sm); }
.callout { padding: 20px 24px; border-left: 2px solid var(--accent); border-radius: var(--radius-sm); background: var(--bg-panel); color: var(--text); margin-block: 24px; }
.callout p:last-child { margin-bottom: 0; }
.callout-title { display: block; font-weight: var(--weight-semibold); margin-bottom: 8px; }
.callout-warning { border-left-color: var(--warn); }
.callout-error { border-left-color: var(--error); }
.article-download { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: 28px; margin-top: 48px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel); color: var(--text); }
.article-download > div { min-width: 0; flex: 1 1 280px; }
.article-download h2 { font-size: var(--title-md); margin: 0 0 10px; }
.article-download p { margin: 0; color: var(--text-muted); }

.table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-block: 24px; border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: var(--text-sm); }
.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);
  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-semibold); }
.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;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
}
.data-table code, .prose table code, .article-body table code { overflow-wrap: anywhere; }
.dl-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 50;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent); font: var(--weight-semibold) var(--text-sm)/1.4 var(--font-body);
  box-shadow: var(--ring-gap); text-decoration: none; transition: background-color var(--speed-fast) var(--ease);
}
.dl-fab:hover { background: var(--accent-dark); color: var(--on-accent); }
.dl-fab svg { width: 16px; height: 16px; flex-shrink: 0; }

/* 静态设计预览的色板与状态展示。 */
.swatch-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.swatch { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.swatch-color { min-height: 80px; padding: 12px; }
.swatch-name { padding: 12px; font: var(--text-xs)/1.6 var(--font-mono); overflow-wrap: anywhere; }
.sw-bg { background: var(--bg); color: var(--text); }
.sw-panel { background: var(--bg-panel); color: var(--text); }
.sw-panel-2 { background: var(--bg-panel-2); color: var(--text); }
.sw-border { background: var(--border); color: var(--text); }
.sw-border-strong { background: var(--border-strong); color: var(--text); }
.sw-accent { background: var(--accent); color: var(--on-accent); }
.sw-accent-dark { background: var(--accent-dark); color: var(--on-accent); }
.sw-accent-soft { background: var(--accent-soft); color: var(--text); }
.sw-text { background: var(--text); color: var(--bg); }
.sw-muted { background: var(--text-muted); color: var(--bg); }
.sw-success { background: var(--success); color: var(--text); }
.sw-warn { background: var(--warn); color: var(--text); }
.sw-error { background: var(--error); color: var(--text); }
.preview-block + .preview-block { margin-top: 48px; }
.preview-label { margin: 0 0 18px; font: var(--weight-medium) var(--text-sm)/1.5 var(--font-mono); color: var(--text-muted); }
.preview-title-sample { margin-top: 0; font-size: var(--title-xl); font-weight: var(--weight-display); }
.preview-header .desktop-nav { margin-left: auto; }
.preview-disclosure { position: relative; }
.preview-disclosure > summary { list-style: none; display: flex; align-items: center; cursor: pointer; }
.preview-disclosure > summary::-webkit-details-marker { display: none; }

@media (max-width: 1180px) {
  .stage { width: 100%; max-width: 704px; }
  .feature-workbench { gap: 28px; }
  .feature-list { grid-template-columns: minmax(0, 1fr); }
  .preview-header .desktop-nav { display: block; }
}
@media (max-width: 760px) {
  .stage { height: 500px; }
  .rail, .tile-lift { display: none; }
  .board { width: 100%; }
  .win { left: 14px; right: 14px; top: 44px; bottom: 36px; }
  .dl-fab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .swatch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-header { height: auto; padding-top: 14px; padding-bottom: 14px; }
  .preview-header .topbar-in { flex-wrap: wrap; row-gap: 10px; }
  .preview-header .desktop-nav { order: 3; width: 100%; margin-left: 0; }
  .preview-header .nav-list { flex-wrap: wrap; }
  .preview-header .nav-list li + li::before { margin-inline: 9px; }
}
@media (max-width: 640px) {
  .feature-workbench { display: block; }
  .feature-previews { display: none; position: static; }
  .feature-list { display: block; }
  .feature-tab { min-height: 0; padding-top: 20px; padding-bottom: 20px; }
  .feature-entry > [role="tabpanel"] { padding: 0 0 24px 18px; }
  .feature-entry > [role="tabpanel"] .interface-slice { background: var(--bg-panel); color: var(--text); }
  .toc { position: static; padding: 12px 16px; gap: 4px 16px; }
  .download-card, .article-download { padding: 20px; }
}
@media (max-width: 480px) {
  .side { display: none; }
  .seg-item { padding: 4px 8px; }
  .win-title { font-size: 10px; padding-left: 40px; }
}