/* 交互组件在没有脚本时保留首个可读面板。 */
.tabs { min-width: 0; }
.tab-list, [role="tablist"].tab-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-panel);
  color: var(--text);
}
.tab-list [role="tab"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--clear);
  border-radius: var(--r-sm);
  background: var(--clear);
  color: var(--text-muted);
  font-weight: 700;
}
.tab-list [role="tab"]:hover { color: var(--text); }
.tab-list [role="tab"][aria-selected="true"] { border-color: var(--a-accent-40); background: var(--bg); color: var(--accent); box-shadow: 0 0 18px var(--a-accent-08); }
.section-light .tab-list { border-color: var(--line-light); background: var(--surface); color: var(--ink); }
.section-light .tab-list [role="tab"] { color: var(--ink-muted); }
.section-light .tab-list [role="tab"][aria-selected="true"] { background: var(--accent-dark); color: var(--surface); border-color: var(--accent-dark); }
.tab-panel { min-width: 0; }
.tab-panel:focus-visible { outline-offset: 6px; }

.toc {
  position: sticky;
  top: 12px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  flex-wrap: wrap;
  overflow-x: visible;
  padding: 10px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-panel);
  color: var(--text);
}
.toc a { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-height: 44px; padding: 8px 14px; border-radius: var(--r-xs); color: inherit; font-size: 13px; text-decoration: none; }
.toc a:hover { background: var(--a-accent-08); color: var(--accent); }
.section-light .toc { border-color: var(--line-light); background: var(--surface); color: var(--ink); }
.section-light .toc a:hover { background: var(--bg-light); color: var(--accent-dark); }
.toc-static { position: static; }
.anchor-section { scroll-margin-top: 100px; }

.faq-item {
  min-width: 0;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-panel);
  color: var(--text);
}
.faq-item summary { position: relative; padding: 20px 52px 20px 24px; list-style: none; cursor: pointer; font-weight: 700; overflow-wrap: anywhere; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 22px; top: 18px; color: var(--accent); font-family: var(--font-mono); font-size: 22px; }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding: 0 24px 24px; color: var(--text-muted); }
.faq-answer > :last-child { margin-bottom: 0; }
.section-light .faq-item { border-color: var(--line-light); background: var(--surface); color: var(--ink); }
.section-light .faq-answer { color: var(--ink-muted); }
.section-light .faq-item summary::after { color: var(--accent-dark); }

.term-card { border-top: 2px solid var(--accent); }
.term-card dt { margin-bottom: 8px; font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.term-card dd { margin: 0; color: var(--text-muted); line-height: 1.8; }
.section-light .term-card dd { color: var(--ink-muted); }
.term-en { display: block; margin-top: 4px; color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; font-weight: 400; }
.section-light .term-en { color: var(--ink-muted); }

.client-card { position: relative; display: flex; flex-direction: column; gap: 20px; }
.client-card.is-primary { border-color: var(--accent); box-shadow: 0 0 0 1px var(--a-accent-16), 0 12px 28px var(--a-cobalt-16); }
.client-head { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.client-head > div { min-width: 0; }
.client-head img { width: 56px; height: 56px; flex-shrink: 0; }
.client-head h3 { margin: 0 0 8px; }
.client-card .client-note { margin: 0; color: var(--text-muted); font-size: 14px; }
.section-light .client-card .client-note { color: var(--ink-muted); }
.client-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.section-light .client-meta { color: var(--ink-muted); }
[data-version]:empty { display: none; }
.client-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.badge-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--a-line-strong);
  border-radius: var(--r-xs);
  background: var(--a-fill);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.label-primary, .label-recommended { border-color: var(--a-accent-40); background: var(--a-accent-08); color: var(--accent); }
.label-archived { border-color: var(--a-line-strong); background: var(--bg); color: var(--warn); }
.section-light .label { border-color: var(--line-light); background: var(--bg-light); color: var(--ink-muted); }
.section-light .label-primary, .section-light .label-recommended { border-color: var(--accent-dark); background: var(--surface); color: var(--accent-dark); }
.section-light .label-archived { border-color: var(--ink-muted); background: var(--bg-light); color: var(--ink); }
.step-dot { width: 9px; height: 9px; flex-shrink: 0; border-radius: var(--r-round); background: var(--lime); }

.post-card { display: flex; flex-direction: column; gap: 16px; transition: transform var(--duration-fast) ease; }
.post-card:hover { transform: translateY(-3px); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--text-muted); font-size: 12px; }
.section-light .post-meta { color: var(--ink-muted); }
.post-card h3 { margin: 0; font-size: 20px; }
.post-card h3 a { color: inherit; text-decoration: none; }
.post-card h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.post-card p { margin: 0; font-size: 14px; line-height: 1.8; }
.post-card .text-link { margin-top: auto; font-size: 13px; }
.article-end-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; margin-top: 48px; border-color: var(--accent); }
.article-end-card > div { min-width: 0; flex: 1 1 240px; }
.article-end-card h2 { margin: 0 0 10px; font-size: 24px; }
.article-end-card p { margin-bottom: 0; }
.callout {
  margin: 28px 0;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--bg-panel);
  color: var(--text);
}
.callout p:last-child { margin-bottom: 0; }
.callout-title { display: block; margin-bottom: 8px; font-weight: 700; }
.callout-warn { border-left-color: var(--warn); }
.callout-error { border-left-color: var(--error); }
.callout-success { border-left-color: var(--success); }
.section-light .callout { border-top-color: var(--line-light); border-right-color: var(--line-light); border-bottom-color: var(--line-light); background: var(--surface); color: var(--ink); }

.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--border); border-radius: var(--r-sm); }
.data-table { width: 100%; border-collapse: collapse; background: var(--bg-panel); color: var(--text); font-size: 14px; }
.data-table th, .data-table td, .prose table th, .prose table 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 { font-size: 12px; font-weight: 700; background: var(--bg); color: var(--text-muted); }
.data-table tr:last-child td { border-bottom: 0; }
.section-light .table-scroll { border-color: var(--line-light); }
.section-light .data-table { background: var(--surface); color: var(--ink); }
.section-light .data-table th { background: var(--bg-light); color: var(--ink-muted); }
.section-light .data-table th, .section-light .data-table td, .section-light .prose table th, .section-light .prose table td { border-bottom-color: var(--line-light); }
.prose table, .article-body table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border-collapse: collapse;
}
.article-body table th, .article-body table td { min-width: 7em; padding: 16px 20px; overflow-wrap: normal; word-break: normal; }
.data-table code, .prose table code, .article-body table code { overflow-wrap: anywhere; }

.dl-fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  min-height: 54px;
  padding: 12px 20px;
  border: 1px solid var(--a-accent-40);
  border-radius: var(--r-sm);
  background: var(--accent-dark);
  color: var(--surface);
  box-shadow: 0 12px 36px var(--a-shadow);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}
.dl-fab svg { width: 22px; height: 22px; flex-shrink: 0; }
.dl-fab:hover { transform: translateY(-2px); }
.has-dl-fab .site-footer { padding-bottom: 100px; }

/* 左 58% 演示窗，右 42% 特性手风琴。 */
.feature-layout { display: grid; grid-template-columns: minmax(0, 58fr) minmax(0, 42fr); gap: 32px; align-items: start; margin-top: 40px; }
.client-window { min-width: 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-card); overflow: hidden; }
.window-chrome { display: flex; align-items: center; gap: 7px; min-height: 46px; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--bg); color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; }
.window-dot { width: 9px; height: 9px; flex-shrink: 0; border-radius: var(--r-round); }
.dot-close { background: var(--error); }
.dot-min { background: var(--warn); }
.dot-max { background: var(--success); }
.window-title { margin-left: 10px; }
.window-interior { display: grid; grid-template-columns: 110px minmax(0, 1fr); min-height: 350px; }
.window-sidebar { list-style: none; padding: 18px 10px; margin: 0; border-right: 1px solid var(--border); }
.window-sidebar li { padding: 10px 12px; color: var(--text-muted); font-size: 13px; border-radius: var(--r-xs); }
.window-sidebar .selected { background: var(--a-accent-08); color: var(--accent); }
.window-content { min-width: 0; padding: 24px; }
.window-content h3 { margin: 0 0 24px; font-size: 18px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--a-line); font-size: 13px; }
.setting-switch { position: relative; width: 34px; height: 20px; flex-shrink: 0; border-radius: var(--r-pill); background: var(--accent-dark); color: var(--surface); }
.setting-switch::after { content: ""; position: absolute; right: 3px; top: 3px; width: 14px; height: 14px; border-radius: var(--r-round); background: var(--surface); }
.setting-switch.is-off { background: var(--border); color: var(--text); }
.setting-switch.is-off::after { right: auto; left: 3px; }
.setting-value { font-family: var(--font-mono); color: var(--accent-ice); }
.setting-radio { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.setting-radio::before { content: ""; width: 12px; height: 12px; border: 3px solid var(--accent); border-radius: var(--r-round); }
.feature-list { display: flex; flex-direction: column; gap: 8px; }
.feature-item { position: relative; min-width: 0; padding: 20px 24px; border: 1px solid var(--clear); border-bottom-color: var(--line-light); border-radius: var(--r-sm); background: var(--clear); color: var(--ink); }
.feature-item.is-active { border-color: var(--accent); background: radial-gradient(ellipse at 0% 0%, var(--a-accent-16), var(--clear) 58%), var(--surface); color: var(--ink); box-shadow: 0 0 24px var(--a-accent-08); }
.feature-item [role="tab"] { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 0; border: 0; background: var(--clear); color: var(--ink); text-align: left; font-size: 21px; font-weight: 900; }
.feature-item [role="tab"]::after { content: "+"; margin-left: 12px; color: var(--accent-dark); font-family: var(--font-mono); }
.feature-item [aria-selected="true"]::after { content: "−"; }
.feature-copy { display: none; padding-top: 12px; color: var(--ink-muted); font-size: 14px; line-height: 1.85; }
.feature-copy p { margin-bottom: 12px; }
.feature-item.is-active .feature-copy { display: block; }
.feature-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; overflow: hidden; }
.feature-progress::after { content: ""; display: block; width: 100%; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.is-playing .feature-item.is-active .feature-progress::after { animation: feature-count var(--feature-time) linear forwards; }
@keyframes feature-count { to { transform: scaleX(1); } }

/* 静态设计预览专用色板。 */
.token-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.token { min-width: 0; margin: 0; border: 1px solid var(--line-light); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); color: var(--ink); }
.token-color { display: block; height: 66px; border-bottom: 1px solid var(--line-light); }
.token figcaption { padding: 12px; font-family: var(--font-mono); font-size: 11px; overflow-wrap: anywhere; }
.sw-bg { background: var(--bg); }
.sw-panel { background: var(--bg-panel); }
.sw-panel-hi { background: var(--bg-panel-hi); }
.sw-die { background: var(--die-hi); }
.sw-light { background: var(--bg-light); }
.sw-surface { background: var(--surface); }
.sw-ink { background: var(--ink); }
.sw-ink-muted { background: var(--ink-muted); }
.sw-line { background: var(--line-light); }
.sw-border { background: var(--border); }
.sw-accent { background: var(--accent); }
.sw-mid { background: var(--accent-mid); }
.sw-dark { background: var(--accent-dark); }
.sw-ice { background: var(--accent-ice); }
.sw-lime { background: var(--lime); }
.sw-text { background: var(--text); }
.sw-muted { background: var(--text-muted); }
.sw-success { background: var(--success); }
.sw-warn { background: var(--warn); }
.sw-error { background: var(--error); }
.sw-mask { background: var(--mask); }
.sw-clear { background: var(--clear); }
.sw-gradient { background: var(--grad-brand); }
.alpha-tokens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 24px; border-radius: var(--r-sm); background: var(--bg); color: var(--text); }
.alpha-token { padding: 14px; border: 1px solid var(--a-line); border-radius: var(--r-xs); font-family: var(--font-mono); font-size: 11px; overflow-wrap: anywhere; }
.sw-a-grid { background: var(--a-grid); }
.sw-a-line { background: var(--a-line); }
.sw-a-line-strong { background: var(--a-line-strong); }
.sw-a-fill { background: var(--a-fill); }
.sw-a-pin { background: var(--a-pin); }
.sw-a-white-10 { background: var(--a-white-10); }
.sw-a-white-16 { background: var(--a-white-16); }
.sw-a-accent-08 { background: var(--a-accent-08); }
.sw-a-accent-16 { background: var(--a-accent-16); }
.sw-a-accent-28 { background: var(--a-accent-28); }
.sw-a-accent-40 { background: var(--a-accent-40); }
.sw-a-cobalt-16 { background: var(--a-cobalt-16); }
.sw-a-cobalt-40 { background: var(--a-cobalt-40); }
.sw-a-cobalt-60 { background: var(--a-cobalt-60); }
.sw-a-lime-30 { background: var(--a-lime-30); }
.sw-a-shadow { background: var(--a-shadow); }
.sw-a-shadow-soft { background: var(--a-shadow-soft); }
.preview-stack > * + * { margin-top: 28px; }
.type-demo { margin: 0 0 18px; }
.type-h1 { font-family: var(--font-display); font-size: var(--size-h1); font-weight: 900; line-height: 1.15; }
.type-h2 { font-family: var(--font-display); font-size: var(--size-h2); font-weight: 900; line-height: 1.25; }
.type-h3 { font-family: var(--font-display); font-size: var(--size-h3); font-weight: 800; }
.type-mono { font-family: var(--font-mono); font-size: 13px; }
.preview-dark-card { padding: 28px; border-radius: var(--r-sm); background: var(--bg); color: var(--text); }
.preview-dark-card .btn-ghost { border-color: var(--a-line-strong); background: var(--a-fill); color: var(--text); }

@media (max-width: 900px) {
  .feature-layout { grid-template-columns: minmax(0, 1fr); }
  .token-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .tab-list { gap: 4px; }
  .tab-list [role="tab"] { flex: 1 1 auto; padding: 10px 12px; font-size: 13px; }
  .toc { top: 8px; }
  .feature-item { padding: 16px 18px; }
  .feature-item [role="tab"] { font-size: 18px; }
  .window-interior { grid-template-columns: 76px minmax(0, 1fr); }
  .window-sidebar { padding-inline: 6px; }
  .window-sidebar li { padding-inline: 8px; font-size: 12px; }
  .window-content { padding: 18px 14px; }
  .setting-row { font-size: 12px; gap: 8px; }
  .token-grid, .alpha-tokens { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alpha-tokens { padding: 16px; }
  .faq-item summary { padding-left: 18px; }
  .faq-answer { padding-inline: 18px; }
  .dl-fab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); min-height: 48px; padding: 10px 16px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .feature-progress { display: none; }
  .post-card:hover, .dl-fab:hover { transform: none; }
}