/* 大纲树：六个节点共用一条连接线。 */
.outline-tabs { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.6fr); gap: 64px; align-items: stretch; }
.outline-tabs [role="tablist"] { position: relative; display: flex; flex-direction: column; gap: 0; padding-block: 8px; }
.outline-tabs [role="tablist"]::before { content: ""; position: absolute; top: 34px; bottom: 34px; left: 10px; width: 2px; background: var(--accent); color: var(--text); }
.outline-tabs [role="tab"] {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 64px;
  padding: 14px 0;
  border: 0;
  background: var(--clear);
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}
.outline-tabs [role="tab"]::before { content: ""; z-index: var(--layer-copy); width: 22px; height: 22px; flex-shrink: 0; border: 2px solid var(--accent); border-radius: var(--radius-pill); background: var(--bg); color: var(--text); }
.outline-tabs [role="tab"][aria-selected="true"] { background: var(--bg-panel); color: var(--accent-dark); }
.outline-tabs [role="tab"][aria-selected="true"]::before { background: var(--accent); color: var(--bg-panel); box-shadow: inset 0 0 0 4px var(--bg); }
.outline-tabs [role="tab"][aria-selected="true"]::after { content: ""; width: 32px; height: 2px; flex-shrink: 0; margin-left: auto; background: var(--accent); color: var(--text); }
.tab-panel { padding: 40px; border-radius: var(--radius-xl); background: var(--accent-soft); color: var(--text); }
.tab-panel.tone-periwinkle { background: var(--accent-2-soft); color: var(--text); }
.tab-panel.tone-pollen { background: var(--warn-soft); color: var(--text); }
.tab-panel pre { margin: 0 0 32px; padding: 0; border: 0; border-radius: 0; background: var(--clear); color: var(--text); }
.tab-panel p { margin-bottom: 20px; }
.tab-conclusion { display: block; padding-top: 20px; border-top: 1px dashed var(--accent); font-weight: 600; }
.tabbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tabbar [role="tab"] { min-height: 44px; padding: 10px 20px; border: 1px solid var(--chip-line); border-radius: var(--radius-pill); background: var(--bg-panel); color: var(--text); }
.tabbar [role="tab"][aria-selected="true"] { background: var(--accent); color: var(--bg-panel); border-color: var(--accent); }

/* 目录默认随文档流动；启用 sticky 时必须以完整正文为直接父容器。 */
.toc { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 28px 0 48px; padding: 20px 24px; border-radius: var(--radius-md); background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); }
.toc a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-dark); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc.is-sticky { position: sticky; top: 12px; z-index: var(--layer-copy); }
.toc.is-static { position: static; }
.faq-list { border-radius: var(--radius-xl); background: var(--bg-panel); color: var(--text); padding-inline: 28px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: 0; }
.faq-item summary { position: relative; list-style: none; cursor: pointer; padding: 24px 32px 24px 0; font-size: 18px; line-height: 1.6; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; top: 24px; right: 0; color: var(--accent-dark); font-family: var(--font-mono); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding-bottom: 24px; color: var(--text-muted); }
.faq-answer > :last-child { margin-bottom: 0; }

.term-card { padding: 32px; border-radius: var(--radius-xl); border: 1px solid var(--chip-line); background: var(--bg-panel); color: var(--text); }
.term-card h3 { font-family: var(--font-mono); font-size: 20px; letter-spacing: 0; overflow-wrap: anywhere; }
.term-card p { color: var(--text-muted); }
.term-card > :last-child { margin-bottom: 0; }
.term-category { display: inline-block; margin-bottom: 18px; color: var(--accent-dark); font-size: var(--fs-caption); }

.app-store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  max-width: 100%;
  padding: 10px 24px;
  border: var(--line) solid var(--accent);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--bg-panel);
  font-size: 16px;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color var(--duration-fast), border-color var(--duration-fast);
}
.app-store-btn:hover, .app-store-btn.is-hover { border-color: var(--accent-dark); background: var(--accent-dark); color: var(--bg-panel); }
.app-store-btn:active { background: var(--accent-dark); color: var(--bg-panel); }
.app-store-btn svg { width: 25px; height: 28px; fill: currentColor; flex-shrink: 0; }
.app-store-btn .store-copy { display: flex; flex-direction: column; align-items: flex-start; }
.app-store-btn small { font-size: 12px; line-height: 1.4; }
.app-store-btn strong { font-size: 17px; font-weight: 500; }
.app-store-btn.is-focus { outline: 2px solid var(--accent); outline-offset: 4px; }
.app-store-btn[aria-disabled="true"] { background: var(--bg); color: var(--text-muted); border-color: var(--border); cursor: not-allowed; }
.fact-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; padding: 0; list-style: none; }
.fact-row li { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin: 0; padding: 7px 14px; border: 1px solid var(--chip-line); border-radius: var(--radius-pill); background: var(--bg-panel); color: var(--text); font-size: var(--fs-caption); line-height: 1.5; overflow-wrap: anywhere; }
.fact-row li::before { content: ""; width: 6px; height: 6px; flex-shrink: 0; border-radius: var(--radius-pill); background: var(--accent); color: var(--text); }
.fact-row .fact-warn::before { background: var(--warn); color: var(--text); }
.fact-row .fact-secondary::before { background: var(--accent-2); color: var(--text); }

.official-shot { width: 100%; max-width: 280px; flex-shrink: 0; margin-inline: auto; }
.official-shot img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }
.official-shot img, .shot-placeholder { outline: 1px solid var(--border); outline-offset: -1px; }
.official-shot figcaption { margin-top: 14px; color: var(--text-muted); font-size: var(--fs-caption); line-height: 1.6; text-align: center; }
.shot-row { display: flex; align-items: flex-start; justify-content: center; flex-wrap: wrap; gap: 32px; }
.shot-placeholder { display: grid; place-items: center; width: 100%; aspect-ratio: 750 / 1334; border-radius: var(--radius-sm); background: var(--bg-panel-2); color: var(--accent-dark); font-family: var(--font-mono); font-size: 14px; text-align: center; }
.step-with-shot { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; align-items: start; }

.device-card { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding: 36px; border-radius: var(--radius-xl); background: var(--bg-panel); color: var(--text); border: 1px solid var(--chip-line); text-decoration: none; }
.device-card:hover { background: var(--bg-panel-2); color: var(--text); }
.device-card svg { width: 48px; height: 48px; fill: none; stroke: var(--accent-dark); stroke-width: var(--line); flex-shrink: 0; }
.device-card .solid { fill: var(--accent-dark); stroke: none; }
.device-card h3 { margin: 0; }
.device-card p { margin: 0; color: var(--text-muted); }
.device-card .device-link { margin-top: auto; padding-top: 8px; color: var(--accent-dark); font-size: 15px; }
.article-card { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 32px; border-radius: var(--radius-xl); background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); }
.article-card h3 { margin: 0; font-size: 22px; }
.article-card h3 a { color: var(--text); text-decoration: none; }
.article-card h3 a:hover { color: var(--accent-dark); }
.article-card p { margin: 0; color: var(--text-muted); font-size: 15px; }
.article-card .article-link { margin-top: auto; padding-top: 12px; font-size: 15px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--text-muted); font-size: var(--fs-caption); }

.badge { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; min-height: 28px; padding: 4px 11px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.badge-secondary { background: var(--accent-2-soft); color: var(--text); }
.badge-warn { background: var(--warn-soft); color: var(--text); }
.status-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: var(--radius-pill); background: var(--success); color: var(--text); }
.callout { margin: 28px 0; padding: 24px 28px; border-left: 3px solid var(--accent); border-radius: var(--radius-md); background: var(--bg-panel-2); color: var(--text); }
.callout p:last-child { margin-bottom: 0; }
.callout-warn { border-color: var(--warn); background: var(--warn-soft); color: var(--text); }
.grouped-links { overflow: hidden; border-radius: var(--radius-xl); background: var(--bg-panel); color: var(--text); }
.grouped-links a { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 60px; margin-inline: 24px; padding-block: 16px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.grouped-links a:last-child { border-bottom: 0; }
.grouped-links a::after { content: "›"; color: var(--accent-dark); font-family: var(--font-mono); font-size: 22px; }

.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--border); border-radius: var(--radius-md); }
.data-table { width: 100%; border-collapse: collapse; background: var(--bg-panel); color: var(--text); 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: 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(--bg-panel-2); color: var(--text); font-weight: 500; }
.data-table tr:last-child td { border-bottom: 0; }
.prose table, .article-body table {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  border-collapse: collapse;
  background: var(--bg-panel);
  color: var(--text);
  text-align: left;
}
.data-table code, .prose table code, .article-body table code { overflow-wrap: anywhere; word-break: normal; }

.dl-fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: var(--layer-fab);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  max-width: calc(100vw - 40px);
  padding: 12px 20px;
  border: var(--line) solid var(--accent);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--bg-panel);
  font-size: var(--fs-small);
  line-height: 1.5;
  text-decoration: none;
}
.dl-fab:hover { background: var(--accent-dark); color: var(--bg-panel); border-color: var(--accent-dark); }
.dl-fab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: var(--line); flex-shrink: 0; }
.has-article-fab { padding-bottom: 96px; }
.article-store-guide { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; margin-top: 64px; padding: 32px; border-radius: var(--radius-xl); background: var(--bg-panel-2); color: var(--text); }
.article-store-guide > div { flex: 1 1 240px; min-width: 0; }
.article-store-guide h2 { margin-bottom: 12px; font-size: 24px; }
.article-store-guide p { margin: 0; color: var(--text-muted); }

/* 预览页家具；正式内容页不依赖这些类。 */
.preview-section { padding-top: 0; padding-bottom: var(--space-section); }
.preview-section > h2 { margin-bottom: 32px; }
.swatch-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.swatch { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.swatch::before { content: ""; display: block; height: 64px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--swatch-color, var(--bg)); color: var(--text); }
.sw-bg { --swatch-color: var(--bg); }
.sw-panel { --swatch-color: var(--bg-panel); }
.sw-panel2 { --swatch-color: var(--bg-panel-2); }
.sw-border { --swatch-color: var(--border); }
.sw-accent { --swatch-color: var(--accent); }
.sw-accent-dark { --swatch-color: var(--accent-dark); }
.sw-accent2 { --swatch-color: var(--accent-2); }
.sw-text { --swatch-color: var(--text); }
.sw-muted { --swatch-color: var(--text-muted); }
.sw-success { --swatch-color: var(--success); }
.sw-warn { --swatch-color: var(--warn); }
.sw-error { --swatch-color: var(--error); }
.sw-soft { --swatch-color: var(--accent-soft); }
.sw-soft2 { --swatch-color: var(--accent-2-soft); }
.sw-warn-soft { --swatch-color: var(--warn-soft); }
.sw-chip { --swatch-color: var(--chip-line); }
.sw-ridge-far { --swatch-color: var(--ridge-far); }
.sw-ridge-mid { --swatch-color: var(--ridge-mid); }
.sw-ridge-line { --swatch-color: var(--ridge-line); }
.sw-meadow { --swatch-color: var(--meadow); }
.sw-grass { --swatch-color: var(--grass); }
.sw-grass-deep { --swatch-color: var(--grass-deep); }
.sw-grass-line { --swatch-color: var(--grass-line); }
.sw-sand { --swatch-color: var(--sand); }
.sw-sand-line { --swatch-color: var(--sand-line); }
.sw-reed { --swatch-color: var(--reed); }
.sw-ripple { --swatch-color: var(--ripple); }
.sw-cloud { --swatch-color: var(--cloud); }
.sw-post { --swatch-color: var(--post); }
.sw-veil { --swatch-color: var(--veil); }
.sw-clear { --swatch-color: var(--clear); }
.type-sample { margin-bottom: 24px; }
.type-sample .type-title { margin-top: 8px; font-family: var(--font-display); font-weight: 400; letter-spacing: var(--tracking-tight); line-height: 1.3; }
.type-h1 { font-size: var(--fs-h1); }
.type-h2 { font-size: var(--fs-h2); }
.type-h3 { font-size: var(--fs-h3); }
.preview-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.preview-static .ripples { animation: none; }
.preview-footer { margin-top: 0; }

@media (max-width: 960px) {
  .outline-tabs { gap: 32px; grid-template-columns: minmax(200px, .8fr) minmax(0, 1.5fr); }
  .tab-panel { padding: 32px; }
  .step-with-shot { gap: 32px; grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 768px) {
  .outline-tabs { display: block; }
  .outline-tabs [role="tablist"] { flex-direction: row; gap: 24px; overflow-x: auto; margin-bottom: 24px; padding: 8px 4px 16px; overscroll-behavior-inline: contain; }
  .outline-tabs [role="tablist"]::before { display: none; }
  .outline-tabs [role="tab"] { flex: 0 0 auto; width: auto; min-height: 48px; padding: 8px 0; white-space: nowrap; gap: 10px; }
  .outline-tabs [role="tab"][aria-selected="true"]::after { display: none; }
  .outline-tabs [role="tab"]::before { width: 18px; height: 18px; }
  .tab-panel { width: 100%; padding: 28px 24px; }
  .step-with-shot { grid-template-columns: minmax(0, 1fr); }
  .shot-row { flex-direction: column; align-items: center; }
  .fact-row { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .swatch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .toc { padding: 16px 20px; gap: 4px 16px; }
  .toc.is-sticky { position: static; }
  .faq-list { padding-inline: 20px; }
  .faq-item summary { font-size: 16px; }
  .term-card, .article-card, .device-card { padding: 28px 24px; }
  .article-card h3 { font-size: 20px; }
  .swatch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-store-guide { padding: 28px 24px; }
  .dl-fab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  .app-store-btn { transition: none; }
}