/* 剖面档案与平台切换 */
.tabs { min-width: 0; }
[role="tablist"] { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
[role="tab"] {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--bg);
  color: var(--text-muted);
  text-align: left;
  transition: color var(--ease), background-color var(--ease);
}
[role="tab"]:hover { color: var(--text); border-color: var(--line-hover); }
[role="tab"][aria-selected="true"] { background: var(--bg-panel-2); color: var(--text); border-color: var(--border-strong); }
[role="tabpanel"] { min-width: 0; margin-top: 20px; }
.dossier { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
.dossier > * { min-width: 0; }
.dossier [role="tablist"] { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--border); padding-right: 24px; }
.dossier [role="tab"] { position: relative; border: 0; background: var(--bg); color: var(--text-muted); border-radius: 0; padding-left: 18px; }
.dossier [role="tab"][aria-selected="true"] { background: var(--bg); color: var(--text); }
.dossier [role="tab"][aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--accent); }
.tab-number { margin-right: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.dossier [role="tabpanel"] { margin-top: 0; }
.dossier-figure { position: relative; overflow-x: clip; min-height: 220px; padding: 24px; border-bottom: 1px solid var(--border); }
.dossier-figure svg { width: 100%; height: 220px; display: block; }
.dossier-panel { padding: 0; }
.dossier-copy { padding: 28px; }
.dossier-copy p { color: var(--text-muted); }
.wire { fill: none; stroke: var(--xray-plate); stroke-width: 1; vector-effect: non-scaling-stroke; }
.wire-dash { fill: none; stroke: var(--xray-dash); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.toc { position: sticky; top: 16px; z-index: 10; display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; margin-bottom: 32px; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--bg-panel); color: var(--text); }
.toc a { min-height: 40px; display: inline-flex; align-items: center; padding: 8px 12px; color: var(--text-muted); font-size: 13px; border-radius: var(--r-ctl); }
.toc a:hover, .toc a[aria-current="location"] { background: var(--bg-panel-2); color: var(--text); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary { position: relative; padding: 20px 36px 20px 0; cursor: pointer; list-style: none; font-size: 16px; font-weight: var(--weight-medium); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 8px; top: 19px; font-family: var(--font-mono); color: var(--text-muted); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { max-width: 850px; padding-bottom: 20px; color: var(--text-muted); }
.faq-answer p:last-child { margin-bottom: 0; }
.term-card { padding: 24px; border-top: 1px solid var(--border); }
.term-card h3 { margin: 0 0 8px; }
.term-card p { margin-bottom: 12px; color: var(--text-muted); }
.term-alias { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.client-card { padding: 28px; background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-panel); }
.client-head { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.client-head > div { min-width: 0; }
.client-head h3 { margin: 0 0 4px; }
.client-head p { margin: 0; color: var(--text-muted); font-size: 13px; }
.app-logo { width: 56px; height: 56px; flex-shrink: 0; }
.client-description { color: var(--text-muted); }
.client-files { display: flex; flex-wrap: wrap; gap: 10px; }
.client-meta { margin-top: 20px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 8px; border: 1px solid var(--border-strong); border-radius: var(--r-ctl); background: var(--bg-panel-2); color: var(--text-muted); font-size: 11px; overflow-wrap: anywhere; }
.badge-primary, .badge-recommended { background: var(--bg-panel); color: var(--success); border-color: var(--accent-line); }
.badge-retired { background: var(--bg-panel); color: var(--warn); }
.badge-error { background: var(--bg-panel); color: var(--error); }
.dot { width: 6px; height: 6px; flex-shrink: 0; display: inline-block; border-radius: var(--r-full); background: var(--text-muted); }
.dot--ok { background: var(--success); }
.dot--warn { background: var(--warn); }
.dot--error { background: var(--error); }
.article-card { display: block; min-width: 0; padding: 28px; background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-panel); transition: border-color var(--ease); }
.article-card:hover { border-color: var(--line-hover); }
.article-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.article-card h3 { margin: 18px 0 12px; }
.article-card p { margin: 0; color: var(--text-muted); font-size: 14px; }
.callout { margin: 24px 0; padding: 20px 24px; border: 1px solid var(--border); border-left: 2px solid var(--accent); border-radius: var(--r-ctl); background: var(--bg-panel); color: var(--text); }
.callout p:last-child { margin-bottom: 0; }
.callout-warning { border-left-color: var(--warn); }
.callout-error { border-left-color: var(--error); }
.table-scroll { overflow-x: auto; max-width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: var(--r-panel); overscroll-behavior-x: contain; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td, .prose th, .prose td {
  min-width: 7em;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
}
.data-table th, .prose th { background: var(--bg-panel-2); color: var(--text); font-weight: var(--weight-medium); }
.data-table td, .prose td { background: var(--bg-panel); color: var(--text-muted); }
.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; overscroll-behavior-x: contain; }
.prose table code, .data-table code { overflow-wrap: anywhere; }
.dl-fab { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: calc(100% - var(--gutter) * 2); min-height: 48px; display: inline-flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--btn-bg); color: var(--btn-ink); border: 1px solid var(--btn-bg); border-radius: var(--r-panel); font-size: 13px; font-weight: var(--weight-medium); }
.dl-fab svg { width: 20px; height: 20px; flex-shrink: 0; }
.dl-fab:hover { background: var(--text); color: var(--btn-ink); }
.article-download { margin-top: 48px; padding: 28px; background: var(--bg-panel); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-panel); }
.article-download h2 { margin: 0 0 12px; font-size: 24px; }
.article-download p { color: var(--text-muted); }

/* 灰色承托场与 X 光切面。示意内容不承担交互。 */
.stage { margin-top: 30px; }
.field { position: relative; height: 470px; margin: 0 calc(var(--bleed) * -1); padding: 34px var(--bleed) 0; border-radius: var(--r-win) var(--r-win) 0 0; background: linear-gradient(180deg, var(--field-top) 0%, var(--field-mid) 48%, var(--bg) 100%); color: var(--text); }
.field::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; border-radius: var(--r-win) var(--r-win) 0 0; background: var(--hl); }
.rig { position: relative; }
.rig::before { content: ""; position: absolute; left: 28px; right: 28px; top: 22px; bottom: -12px; background: var(--bg-sunk); border: 1px solid var(--border); border-radius: var(--r-win); }
.cut-mark { position: absolute; z-index: 2; left: var(--slice); top: -28px; transform: translateX(-50%); font-family: var(--font-mono); font-size: 10.5px; line-height: 14px; font-weight: var(--weight-medium); letter-spacing: 0.08em; color: var(--text-muted); white-space: nowrap; }
.cut-mark::after { content: ""; position: absolute; left: 50%; top: calc(100% + 3px); height: 9px; border-left: 1px dashed var(--text-dim); }
.win { position: relative; z-index: 1; background: var(--bg-panel); color: var(--text); border: 1px solid var(--border-win); border-radius: var(--r-win); overflow: hidden; }
.win::after { content: ""; position: absolute; z-index: 5; top: 0; left: 0; right: 0; height: 1px; background: var(--hl); pointer-events: none; }
.win-bar { height: 34px; padding: 0 14px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: var(--bg-panel); color: var(--text-muted); border-bottom: 1px solid var(--border); }
.win-dots { display: flex; gap: 7px; }
.win-dots span { width: 10px; height: 10px; border-radius: var(--r-full); background: var(--dot); }
.win-title { font-size: 12px; font-weight: var(--weight-medium); letter-spacing: 0.01em; }
.win-stage { position: relative; height: 364px; }
.win-body { height: 100%; display: grid; grid-template-columns: 200px minmax(0, 1fr); background: var(--bg-panel); color: var(--text); }
.side { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--border); }
.side-item { min-height: 32px; padding: 5px 10px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); border: 1px solid var(--clear); border-radius: var(--r-ctl); }
.side-item svg { width: 15px; height: 15px; flex: none; }
.side-item.is-active { color: var(--text); background: var(--bg-panel-2); border-color: var(--border); }
.mock-main { min-width: 0; display: flex; flex-direction: column; }
.toolbar { min-height: 44px; flex: none; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); gap: 10px; }
.toolbar-title { font-size: 13px; font-weight: var(--weight-medium); color: var(--text); }
.toolbar-sub { margin-left: 10px; font-size: 12px; color: var(--text-muted); }
.toolbar-tools { display: flex; align-items: center; gap: 8px; }
.search { width: 200px; height: 26px; padding: 0 8px; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); background: var(--bg-sunk); border: 1px solid var(--border); border-radius: var(--r-ctl); }
.search svg { width: 12px; height: 12px; }
.tool { height: 26px; padding: 0 10px; display: flex; align-items: center; font-size: 12px; color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--r-ctl); }
.main-pad { padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.empty { min-height: 92px; padding: 16px 18px; display: flex; align-items: center; gap: 14px; background: var(--bg-sunk); color: var(--text); border: 1px dashed var(--border-strong); border-radius: var(--r-panel); }
.empty-ico { width: 36px; height: 36px; flex: none; display: grid; place-items: center; color: var(--text-muted); background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--r-ctl); }
.empty-ico svg { width: 17px; height: 17px; }
.empty-title { font-size: 13.5px; font-weight: var(--weight-medium); line-height: 20px; color: var(--text); }
.empty-schemes { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.scheme { min-height: 20px; padding: 1px 6px; display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--r-ctl); }
.kbd { margin-left: 14px; align-self: flex-start; margin-top: 8px; min-height: 20px; padding: 0 6px; display: inline-flex; align-items: center; font-size: 11px; color: var(--text-muted); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--r-ctl); white-space: nowrap; }
.settings-card { width: 540px; max-width: 100%; background: var(--bg-panel-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-panel); }
.card-head { height: 32px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.card-tag { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.setting-row { min-height: 42px; padding: 8px 14px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.row-label { flex: 1; min-width: 0; font-size: 13px; color: var(--text); }
.row-note { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.toggle { position: relative; width: 30px; height: 16px; flex: none; background: var(--bg-sunk); border: 1px solid var(--border-strong); border-radius: var(--r-full); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 8px; height: 8px; border-radius: var(--r-full); background: var(--text-dim); }
.toggle.is-on { border-color: var(--accent-line); }
.toggle.is-on::after { background: var(--accent); transform: translateX(14px); }
.win-status { min-height: 28px; padding: 5px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); background: var(--bg-panel); border-top: 1px solid var(--border); }
.status-sep { margin: 0 10px; color: var(--text-muted); }
.core { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; }
.core-key { color: var(--text-muted); }
.core-val { color: var(--text); }
.xray-ghost { position: absolute; inset: 0; z-index: 1; background: var(--bg-sunk); color: var(--text); clip-path: inset(0 0 0 var(--slice)); pointer-events: none; }
.ghost-frame { position: absolute; inset: 14px 18px; border: 1px solid var(--xray-line); border-radius: var(--r-panel); }
.ghost-frame::before { content: ""; position: absolute; left: 0; right: 0; top: 30%; height: 38%; border-top: 1px solid var(--xray-line); border-bottom: 1px solid var(--xray-line); }
.xray-plates { position: absolute; z-index: 2; top: 0; bottom: 0; left: var(--slice); right: 0; pointer-events: none; }
.xray-plates svg { display: block; width: 100%; height: 100%; }
.xr-face, .xr-det, .xr-side { fill: none; stroke: var(--xray-plate); stroke-width: 1; vector-effect: non-scaling-stroke; }
.xr-det, .xr-side { stroke: var(--xray-side); }
.xr-dash { fill: none; stroke: var(--xray-dash); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.xr-lead { fill: none; stroke: var(--xray-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.xr-k { fill: var(--text); font-family: var(--font-mono); font-size: 11px; font-weight: var(--weight-medium); }
.xr-v { fill: var(--text-muted); font-family: var(--font-mono); font-size: 10px; }
.xray-edge { position: absolute; z-index: 3; top: 0; bottom: 0; left: var(--slice); width: 1px; background: var(--accent); pointer-events: none; }
.xray-edge::before { content: ""; position: absolute; top: 0; bottom: 0; left: -6px; width: 13px; background: linear-gradient(90deg, var(--clear), var(--accent-glow), var(--clear)); }
.xray-edge::after { content: ""; position: absolute; top: 0; bottom: 0; left: 1px; width: 28px; background: linear-gradient(90deg, var(--accent-glow-soft), var(--clear)); }

/* 预览页色板：每项明确绑定设计令牌。 */
.palette-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.swatch { padding: 12px; border: 1px solid var(--border); border-radius: var(--r-panel); color: var(--text); background: var(--bg); font-family: var(--font-mono); font-size: 11px; overflow-wrap: anywhere; }
.swatch::before { content: ""; display: block; height: 40px; margin-bottom: 10px; border: 1px solid var(--border-strong); border-radius: var(--r-ctl); }
.sw-bg::before { background: var(--bg); }
.sw-panel::before { background: var(--bg-panel); }
.sw-panel2::before { background: var(--bg-panel-2); }
.sw-sunk::before { background: var(--bg-sunk); }
.sw-border::before { background: var(--border); }
.sw-win::before { background: var(--border-win); }
.sw-strong::before { background: var(--border-strong); }
.sw-hover::before { background: var(--line-hover); }
.sw-top::before { background: var(--field-top); }
.sw-mid::before { background: var(--field-mid); }
.sw-text::before { background: var(--text); }
.sw-muted::before { background: var(--text-muted); }
.sw-dim::before { background: var(--text-dim); }
.sw-accent::before { background: var(--accent); }
.sw-dark::before { background: var(--accent-dark); }
.sw-accent-line::before { background: var(--accent-line); }
.sw-glow::before { background: var(--accent-glow); }
.sw-soft::before { background: var(--accent-glow-soft); }
.sw-success::before { background: var(--success); }
.sw-warn::before { background: var(--warn); }
.sw-error::before { background: var(--error); }
.sw-hl::before { background: var(--hl); }
.sw-dot::before { background: var(--dot); }
.sw-btn::before { background: var(--btn-bg); }
.sw-ink::before { background: var(--btn-ink); }
.sw-xline::before { background: var(--xray-line); }
.sw-ghost::before { background: var(--xray-ghost); }
.sw-plate::before { background: var(--xray-plate); }
.sw-side::before { background: var(--xray-side); }
.sw-dash::before { background: var(--xray-dash); }
.sw-clear::before { background: var(--clear); }
.sw-veil::before { background: var(--veil); }
.preview-type { margin: 0; font-size: clamp(34px, 3.4vw, 48px); line-height: 1.12; }
.preview-footer { margin-top: 0; }
@media (max-width: 960px) {
  .win-body { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .settings-card { width: 100%; }
  .toolbar-tools .tool { display: none; }
  .dossier { grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 640px) {
  .dossier { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .dossier [role="tablist"] { position: static; flex-direction: row; flex-wrap: wrap; padding-right: 0; border-right: 0; }
  .dossier [role="tab"] { flex: 1 1 130px; padding: 10px 12px; }
  .dossier-copy { padding: 20px; }
  .dossier-figure { padding: 18px; }
  .toc { position: static; }
  .client-card, .article-card { padding: 20px; }
  .client-files .btn { width: 100%; }
  .dl-fab { right: var(--gutter); bottom: 16px; }
  .callout { padding: 16px 18px; }
  .field { height: auto; padding-bottom: 32px; border-radius: 0; }
  .win-stage { height: auto; min-height: 400px; }
  .win-body { min-height: 400px; }
  .main-pad { padding: 12px; }
  .empty { padding: 14px; flex-wrap: wrap; }
  .empty > div { min-width: 0; }
  .kbd, .row-note, .toolbar-sub { display: none; }
  .search { width: 108px; }
  .toolbar { padding-inline: 12px; }
  .win-status { flex-wrap: wrap; font-size: 10px; }
  .status-addresses { overflow-wrap: anywhere; }
  .xray-plates { display: none; }
  .xray-ghost { opacity: 0.28; }
  .xray-edge { opacity: 0.7; }
  .palette-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-type { font-size: 30px; }
}