/* 首屏：居中排版与总开关。 */
.hero {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  display: grid;
  align-content: center;
  padding: 24px 40px;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}
.hero-inner { width: 100%; max-width: 1120px; margin-inline: auto; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.badge { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; padding: 5px 14px 5px 12px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--panel); color: var(--muted); box-shadow: var(--shadow-hair); font-size: 13px; line-height: 18px; overflow-wrap: anywhere; }
.badge-strong { color: var(--text); }
.pulse { position: relative; width: 8px; height: 8px; flex-shrink: 0; border-radius: var(--r-round); background: var(--accent); color: var(--on-accent); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-round); background: var(--accent); color: var(--on-accent); animation: breathe 2.4s ease-out infinite; }
@keyframes breathe { 0% { transform: scale(1); opacity: 0.35; } 70%, 100% { transform: scale(2.6); opacity: 0; } }
.hero-title { margin-top: 22px; font-weight: var(--weight-regular); font-size: clamp(30px, 3.4vw, 48px); line-height: 1.14; letter-spacing: -0.02em; color: var(--text); }
.hero-title .line { display: block; }
.hero-title .line-b { color: var(--muted); }
.hero .actions { margin-top: 26px; justify-content: center; }
.lede { margin-top: 18px; max-width: 640px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.lede strong { color: var(--text); font-weight: var(--weight-medium); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.chips li, .tag { max-width: 100%; padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--clear); color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.chips li { line-height: 1; }
.tag { display: inline-block; }
.platforms { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin-top: 14px; }
.platforms a { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; line-height: 20px; text-decoration: none; transition: color var(--motion-fast); }
.platforms a:hover { color: var(--text); }
.platforms svg { width: 14px; height: 14px; flex-shrink: 0; }
.device { position: relative; z-index: 1; margin-top: 48px; display: flex; flex-direction: column; align-items: center; }
.switch { position: relative; width: var(--trk-w); height: var(--trk-h); }
.rings { position: absolute; left: 50%; top: 50%; z-index: -1; width: var(--ring-d); height: var(--ring-d); transform: translate(-50%, -50%); border-radius: var(--r-round); background: radial-gradient(circle closest-side, var(--ring-1) 0, var(--ring-1) 50.8%, var(--ring-2) 51.6%, var(--ring-2) 75.2%, var(--ring-3) 76%, var(--ring-3) 98.6%, var(--clear) 100%); color: var(--text); pointer-events: none; }
.puddle { position: absolute; left: 50%; top: calc(var(--trk-h) - 40px); z-index: -1; width: calc(var(--trk-w) * 1.5); height: 80px; transform: translateX(-50%); border-radius: var(--r-round); background: radial-gradient(closest-side, var(--puddle) 0%, var(--puddle-mid) 48%, var(--clear) 100%); color: var(--text); filter: blur(12px); pointer-events: none; }
.track { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--switch-off); color: var(--text); box-shadow: var(--track-inset), var(--shadow-track); }
.track-on { position: absolute; inset: 0; border-radius: var(--r-pill); background: linear-gradient(180deg, var(--sheen) 0%, var(--clear) 42%), var(--accent); color: var(--on-accent); box-shadow: inset 0 1px 0 var(--switch-hi), inset 0 -10px 24px var(--track-depth); animation: track-fill var(--motion-switch) var(--ease-out) var(--motion-delay) both; }
.knob { position: absolute; top: var(--pad); right: var(--pad); width: var(--knob); height: var(--knob); display: grid; place-items: center; border-radius: var(--r-round); background: radial-gradient(circle at 50% 30%, var(--panel) 0%, var(--panel) 55%, var(--knob-edge) 100%); color: var(--text); box-shadow: var(--shadow-knob); animation: knob-travel var(--motion-switch) var(--ease-out) var(--motion-delay) both; }
.knob-mark { display: block; width: calc(var(--knob) * 0.43); height: calc(var(--knob) * 0.43); border-radius: var(--r-mark); box-shadow: var(--shadow-mark); }
.device-cap { margin-top: 40px; font-family: var(--font-mono); font-size: 13px; line-height: 18px; color: var(--muted); }
@keyframes knob-travel { from { transform: translateX(calc(-1 * var(--travel))); } to { transform: translateX(0); } }
@keyframes track-fill { from { opacity: 0; } to { opacity: 1; } }
.facts { position: relative; z-index: 2; width: min(100%, 760px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 28px 0 0; padding: 0; list-style: none; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow-panel); text-align: left; }
.facts li { display: flex; flex-direction: column; min-width: 0; gap: 2px; padding: 14px 24px; }
.facts li + li { border-left: 1px solid var(--border); }
.fact-k { font-family: var(--font-mono); font-size: 11px; line-height: 16px; color: var(--muted); letter-spacing: 0.02em; }
.fact-v { font-size: 14px; line-height: 20px; color: var(--text); }

/* Tabs 与设置窗口共享布局。 */
.tabs { min-width: 0; }
[role="tablist"] { display: flex; gap: 24px; overflow-x: auto; max-width: 100%; padding: 4px 4px 8px; scrollbar-width: thin; }
[role="tab"] { position: relative; flex-shrink: 0; display: inline-flex; align-items: center; min-height: 44px; padding: 10px 0; border: 0; background: var(--clear); color: var(--muted); font-size: 15px; line-height: 1.5; text-align: left; }
[role="tab"]:hover, [role="tab"][aria-selected="true"] { color: var(--text); }
[role="tab"][aria-selected="true"]::after { content: ""; position: absolute; bottom: 0; inset-inline: 0; height: 2px; background: var(--accent); color: var(--on-accent); transform-origin: left; }
.tabs.is-cycling [role="tab"][aria-selected="true"]::after { animation: tab-cycle var(--cycle) linear both; }
@keyframes tab-cycle { from { transform: scaleX(0); } to { transform: scaleX(1); } }
[role="tabpanel"] { min-width: 0; margin-top: 24px; }
[role="tabpanel"]:focus-visible { outline-offset: 8px; }
.feature-browser { display: grid; grid-template-columns: minmax(0, 62fr) minmax(0, 30fr); column-gap: 8%; align-items: start; }
.feature-browser > * { min-width: 0; }
.feature-browser > [role="tablist"] { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding-top: 12px; }
.feature-browser > .settings-window { grid-column: 1; grid-row: 1; }
.feature-browser > .feature-details { grid-column: 1; grid-row: 2; }
.settings-window { border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--panel); color: var(--text); box-shadow: var(--shadow-panel); padding: 24px; }
.window-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.window-tools { display: flex; align-items: center; gap: 20px; color: var(--muted); flex-shrink: 0; }
.window-tools svg { width: 16px; height: 16px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; padding: 12px 14px; border-left: 1px solid var(--clear); font-size: 14px; }
.setting-row + .setting-row { border-top: 1px solid var(--border); }
.setting-row.is-highlighted { border-left-color: var(--accent); }
.setting-value { color: var(--muted); text-align: right; }
.mini-switch { display: inline-block; position: relative; width: 36px; height: 20px; border-radius: var(--r-pill); background: var(--border-strong); color: var(--text); flex-shrink: 0; }
.mini-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: var(--r-round); background: var(--panel); color: var(--text); box-shadow: var(--shadow-hair); }
.mini-switch.is-on { background: var(--muted); color: var(--on-accent); }
.mini-switch.is-on::after { left: 19px; }
.feature-details { padding-top: 24px; }
.feature-details [role="tabpanel"] { margin-top: 0; }
.feature-details h3 { margin-bottom: 12px; font-size: 20px; }
.feature-details p { color: var(--muted); line-height: 1.9; }
.toc { position: sticky; top: 16px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-small); background: var(--bg); color: var(--text); }
.toc a { display: inline-flex; align-items: center; min-height: 32px; font-size: 13px; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); text-decoration: underline; }
.faq-item { border-bottom: 1px solid var(--border); padding-block: 22px; }
.faq-item summary { position: relative; padding-right: 36px; font-size: 18px; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 4px; top: 0; color: var(--muted); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding-top: 16px; max-width: 760px; color: var(--muted); }
.term-card { padding: 28px 0; border-top: 1px solid var(--border); }
.term-card h3 { margin-bottom: 8px; }
.term-name { display: inline-block; margin-bottom: 16px; color: var(--muted); font-family: var(--font-mono); font-size: 13px; }
.term-card p { color: var(--muted); }
.client-card { display: flex; flex-direction: column; gap: 20px; }
.client-card > * { margin-top: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.card-head h3 { font-size: 24px; }
.client-card.is-featured { border-color: var(--border-strong); }
.client-card .actions { margin-top: auto; }
.client-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 13px; }
[data-version]:empty { display: none; }
.badge-pick { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.badge-recommended { background: var(--panel-2); color: var(--text); }
.badge-archived { border-style: dashed; background: var(--panel); color: var(--muted); }
.post-card { display: flex; flex-direction: column; gap: 20px; padding: 32px 0; border-top: 1px solid var(--border); min-width: 0; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.post-card h3 { font-size: 24px; line-height: 1.5; }
.post-card h3 a { text-decoration: none; }
.post-card h3 a:hover { text-decoration: underline; }
.post-card p { color: var(--muted); }
.post-link { align-self: flex-start; font-size: 13px; }
.callout { margin-block: 24px; padding: 20px 24px; border-left: 2px solid var(--accent); border-radius: 0 var(--r-small) var(--r-small) 0; background: var(--panel-2); color: var(--text); }
.callout p + p { margin-top: 12px; }
.table-scroll { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--border); border-radius: var(--r-small); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; background: var(--panel); color: var(--text); font-size: 14px; }
.data-table :is(th, td), .prose table :is(th, td), .article-body table :is(th, 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, .article-body table th { background: var(--panel-2); color: var(--text); font-weight: var(--weight-medium); }
.data-table tr:last-child td { border-bottom: 0; }
.prose table, .article-body table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; min-width: 0; border-collapse: collapse; background: var(--panel); color: var(--text); }
.prose table code, .article-body table code, .data-table code { overflow-wrap: anywhere; }
.article-body { min-width: 0; }
.download-guide { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; margin-top: 48px; }
.download-guide > div { min-width: 0; flex: 1 1 260px; }
.download-guide h3 { margin-bottom: 8px; font-size: 24px; }
.download-guide p { color: var(--muted); }
.dl-fab { position: fixed; right: 24px; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 40; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px 0 14px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: var(--weight-medium); text-decoration: none; box-shadow: var(--shadow-fab); transition: background-color var(--motion-fast); }
.dl-fab:hover { background: var(--accent-dark); color: var(--on-accent); }
.dl-fab svg { width: 16px; height: 16px; flex-shrink: 0; }

/* 预览专用展示，不改变正式组件。 */
.preview .knob, .preview .track-on { animation: none; }
.sample-row { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.sample-row + .sample-row { margin-top: 24px; }
.swatch-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.swatch { min-width: 0; }
.swatch-face { height: 72px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--r-small); color: var(--text); }
.swatch code { font-size: 12px; }
.sw-bg { background: var(--bg); }
.sw-panel { background: var(--panel); }
.sw-panel-2 { background: var(--panel-2); }
.sw-border { background: var(--border); }
.sw-border-strong { background: var(--border-strong); }
.sw-accent { background: var(--accent); color: var(--on-accent); }
.sw-accent-dark { background: var(--accent-dark); color: var(--on-accent); }
.sw-text { background: var(--text); color: var(--on-accent); }
.sw-muted { background: var(--muted); color: var(--on-accent); }
.sw-faint { background: var(--faint); }
.sw-on-accent { background: var(--on-accent); }
.sw-success { background: var(--success); color: var(--on-accent); }
.sw-warn { background: var(--warn); color: var(--on-accent); }
.sw-error { background: var(--error); color: var(--on-accent); }
.sw-switch-off { background: var(--switch-off); }
.sw-switch-hi { background: var(--switch-hi); color: var(--on-accent); }
.sw-knob-edge { background: var(--knob-edge); }
.sw-ring-1 { background: var(--ring-1); }
.sw-ring-2 { background: var(--ring-2); }
.sw-ring-3 { background: var(--ring-3); }
.sw-clear { background: var(--clear); }
.sw-sheen { background: var(--sheen); }
.sw-track-depth { background: var(--track-depth); }
.sw-puddle { background: var(--puddle); }
.sw-puddle-mid { background: var(--puddle-mid); }
.sw-veil { background: var(--veil); }
@media (max-width: 760px) {
  :root { --trk-w: 260px; --trk-h: 120px; --pad: 10px; --knob: 100px; --ring-d: 500px; }
  .hero { min-height: 0; padding: 28px 20px 96px; }
  .hero-title { margin-top: 18px; font-size: clamp(24px, 7.2vw, 30px); }
  .lede { font-size: 15px; }
  .hero .actions { margin-top: 22px; }
  .device { margin-top: 44px; }
  .device-cap { margin-top: 28px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts li + li { border-left: 0; border-top: 1px solid var(--border); }
  .feature-browser { display: flex; flex-direction: column; gap: 24px; }
  .feature-browser > [role="tablist"] { width: 100%; flex-direction: row; gap: 24px; padding-top: 4px; }
  .feature-browser > .settings-window, .feature-browser > .feature-details { width: 100%; }
  .feature-details { padding-top: 0; }
  .settings-window { padding: 20px; }
  .setting-row { padding-inline: 10px; }
  .dl-fab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); min-height: 40px; font-size: 13px; }
}
@media (max-width: 640px) {
  .swatch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toc { position: static; }
  .post-card h3 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .knob, .track-on, .tabs.is-cycling [role="tab"][aria-selected="true"]::after { animation: none; }
  .pulse::after { animation: none; opacity: 0; }
}