/* 章节型 tab：轨道始终为 4px，选中段跟随按钮。 */
.tabs { min-width: 0; }
.tabs [role="tablist"] {
  display: flex;
  align-items: stretch;
  gap: 12px;
  position: relative;
  padding-bottom: 22px;
  margin-bottom: 24px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: thin;
}
.tabs [role="tablist"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--bg-panel-2);
}
.tabs [role="tab"] {
  position: relative;
  flex: 1 0 auto;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-size: var(--size-small);
  font-weight: 600;
}
.tabs [role="tab"]:hover { background: var(--bg-panel); color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.tabs [role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  bottom: -22px;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--accent);
  z-index: 1;
}
.tabs [role="tabpanel"] { min-width: 0; }
.feature-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  padding: 48px;
  border-radius: var(--r-panel);
  background: var(--bg-panel);
  color: var(--text);
}
.feature-panel > * { min-width: 0; }
.feature-panel h3 { margin-top: 0; }
.feature-panel p { margin-bottom: 0; color: var(--text-muted); }
.setting-list { margin: 0; padding: 24px; list-style: none; border-radius: var(--r-sm); background: var(--bg-panel-2); color: var(--text); font-family: var(--font-mono); font-size: var(--size-code); }
.setting-list li + li { margin-top: 14px; }
.toc {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 100%;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text);
}
.toc a { flex-shrink: 0; min-height: 44px; display: inline-flex; align-items: center; padding: 8px 16px; color: var(--text-muted); text-decoration: none; border-radius: var(--r-pill); }
.toc a:hover, .toc a[aria-current="location"] { background: var(--bg-panel); color: var(--accent); }
.toc.is-static { position: static; }
.faq-item { padding: 24px 28px; border-radius: var(--r-panel); background: var(--bg-panel); color: var(--text); }
.faq-item + .faq-item { margin-top: 12px; }
.faq-item summary { display: block; position: relative; padding-right: 32px; cursor: pointer; font-weight: 650; list-style: none; min-height: 28px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 0; top: -3px; font-size: 24px; font-weight: 400; color: var(--text-muted); }
.faq-item[open] summary::after { content: "−"; }
.faq-item .faq-answer { margin-top: 20px; color: var(--text-muted); }
.faq-answer > :last-child { margin-bottom: 0; }
.term-card { padding: 28px; border-radius: var(--r-panel); border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.term-card h3 { margin: 14px 0; }
.term-card p { color: var(--text-muted); }
.term-card > :last-child { margin-bottom: 0; }
.term-key { font-family: var(--font-mono); font-size: var(--size-code); color: var(--text-muted); }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.badge-top { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.badge-recommended { background: var(--bg-panel-2); color: var(--text); }
.badge-retired { background: var(--bg-panel); color: var(--text-muted); border-style: dashed; }
.badge-status .dot { width: 6px; height: 6px; background: var(--success); border-radius: var(--r-circle); }
.download-card { min-width: 0; padding: 36px; border-radius: var(--r-card); background: var(--bg-panel); color: var(--text); }
.download-card + .download-card { margin-top: 24px; }
.download-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 24px; }
.app-icon { width: 56px; height: 56px; flex-shrink: 0; }
.download-card-head h3 { margin: 0 0 6px; }
.download-card-head p { margin: 0; color: var(--text-muted); font-size: var(--size-small); }
.download-card-head .badges { margin-left: auto; }
.download-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.download-option { min-width: 0; padding: 24px; border-radius: var(--r-panel); background: var(--bg); color: var(--text); }
.download-option h4 { margin: 0 0 12px; }
.download-option p { color: var(--text-muted); font-size: var(--size-small); }
.download-option .btn { width: 100%; }
.download-note { margin-top: 20px; font-size: var(--size-small); color: var(--text-muted); }
.article-card { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 30px; border-radius: var(--r-panel); background: var(--bg-panel); color: var(--text); }
.article-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; color: var(--text-muted); font-size: 12px; }
.article-card h3 { margin: 22px 0 14px; line-height: 1.45; }
.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(--size-small); }
.article-card .article-link { margin-top: auto; font-weight: 600; font-size: var(--size-small); }
.callout { margin: 28px 0; padding: 24px 28px; border: 0; border-left: 4px 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; }
.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--r-sm); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: var(--size-small); background: var(--bg); color: var(--text); }
.data-table th, .data-table td, .prose table th, .prose table td {
  min-width: 7em;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
}
.data-table th, .prose table th { background: var(--bg-panel); color: var(--text); font-weight: 600; }
.data-table tr:last-child td { border-bottom: 0; }
.prose table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  border-collapse: collapse;
  background: var(--bg);
  color: var(--text);
  font-size: var(--size-small);
}
.prose table code, .data-table code { overflow-wrap: anywhere; }
.dl-fab {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  min-height: 56px;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-btn);
  text-decoration: none;
  font-size: var(--size-small);
  font-weight: 700;
}
.dl-fab svg { width: 22px; height: 22px; flex: none; }
.dl-fab:hover { background: var(--accent-dark); color: var(--on-accent); }
.article-download { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; margin-top: 56px; padding: 32px; border-radius: var(--r-panel); background: var(--bg-panel); color: var(--text); }
.article-download > div { flex: 1 1 240px; min-width: 0; }
.article-download h2 { margin: 0 0 12px; font-size: var(--size-h3); }
.article-download p { margin: 0; color: var(--text-muted); font-size: var(--size-small); }
.fact-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 32px; padding: 24px; border-radius: var(--r-pill); background: var(--bg-panel); color: var(--text-muted); font-family: var(--font-mono); font-size: var(--size-code); }

/* 仅预览页使用；无脚本、无内联设计值。 */
.spec-section { padding-top: 72px; padding-bottom: 72px; }
.spec-section h2 { margin-top: 0; }
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 16px; }
.swatch { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.swatch i { display: block; height: 64px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--r-inset); }
.swatch code { display: block; font-size: 12px; }
.sw-bg { background: var(--bg); }
.sw-panel { background: var(--bg-panel); }
.sw-panel2 { background: var(--bg-panel-2); }
.sw-border { background: var(--border); }
.sw-accent { background: var(--accent); }
.sw-accent-dark { background: var(--accent-dark); }
.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-white { background: var(--on-accent); }
.sw-faint { background: var(--text-faint); }
.sw-sep { background: var(--sep); }
.sw-skeleton { background: var(--skeleton); }
.sw-soft { background: var(--skeleton-soft); }
.sw-dot { background: var(--chrome-dot); }
.sw-ink2 { background: var(--ink-2); }
.sw-ink-line { background: var(--ink-line); }
.sw-ink-dim { background: var(--ink-dim); }
.sw-success-halo { background: var(--success-halo); }
.sw-ring-white { background: var(--ring-white); }
.sw-ring-line { background: var(--ring-line); }
.sw-veil { background: var(--veil); }
.sw-veil0 { background: var(--veil-0); }
.sw-ground { background: var(--ground); }
.sw-ground0 { background: var(--ground-0); }
.sw-focus { background: var(--focus); }
.sw-overlay { background: var(--overlay); }
.sw-transparent { background: var(--transparent); }
.type-display { font-family: var(--font-display); font-size: var(--size-h1); font-weight: 900; line-height: 1.14; }
.spec-shadow { box-shadow: var(--shadow-menu); }

@media (max-width: 768px) {
  .feature-panel { grid-template-columns: minmax(0, 1fr); padding: 28px; gap: 24px; }
  .tabs [role="tab"] { flex: 0 0 auto; }
  .download-card { padding: 24px; }
  .download-options { grid-template-columns: minmax(0, 1fr); }
  .download-card-head .badges { margin-left: 0; }
}
@media (max-width: 640px) {
  .feature-panel, .term-card, .article-card, .faq-item { padding: 24px; }
  .tabs [role="tablist"] { gap: 8px; }
  .tabs [role="tab"] { padding-inline: 16px; }
  .toc { border-radius: var(--r-panel); }
  .article-download { padding: 24px; }
  .dl-fab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .fact-strip { border-radius: var(--r-panel); gap: 12px 20px; }
}