/* Gate Design Copilot · 样式
   气质：工业、克制。主色 RAL 7016 炭灰 #383E42，强调色安全黄 #F2B600；等宽数字；深浅色模式。
   结构：令牌 → 基础 → 布局 → 通用部件 → 各视图（首页 / 配置器 / 结果 / 副驾）→ Markdown → 响应式 */

/* ================================================================ 令牌 */

:root {
  color-scheme: light;
  --charcoal: #383e42;
  --charcoal-2: #2c3135;
  --charcoal-3: #22272a;
  --yellow: #f2b600;
  --yellow-ink: #3a2c00;

  --bg: #f3f3f0;
  --surface: #ffffff;
  --surface-2: #f7f7f5;
  --surface-3: #ecede9;
  --ink: #1d2124;
  --ink-2: #3d4449;
  --muted: #5f676d;
  --line: #dcded9;
  --line-2: #c7cac5;
  --focus: #1f6fd1;

  --pass: #1d7444;
  --pass-bg: #e2f1e7;
  --pass-line: #9ccfb0;
  --fail: #b8321f;
  --fail-bg: #fbe7e3;
  --fail-line: #eba99d;
  --pend: #8a6100;
  --pend-bg: #fff4cf;
  --pend-line: #efcf6c;
  --na: #5f676d;
  --na-bg: #eceeec;
  --na-line: #cfd3d0;
  --info: #25628f;
  --info-bg: #e5eff7;
  --info-line: #a9c7de;

  --viewer-top: #e9eae6;
  --viewer-bot: #f8f8f6;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgb(20 24 27 / 6%), 0 2px 10px rgb(20 24 27 / 5%);
  --shadow-lg: 0 10px 40px rgb(20 24 27 / 18%);
  --topbar-h: 60px;

  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono", "Noto Sans SC", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131618;
    --surface: #1c2023;
    --surface-2: #20252a;
    --surface-3: #282e33;
    --ink: #e7e9e7;
    --ink-2: #c3c8cb;
    --muted: #979fa5;
    --line: #30373c;
    --line-2: #434b51;
    --focus: #6aa8ff;
    --pass: #63cf91;
    --pass-bg: rgb(99 207 145 / 12%);
    --pass-line: rgb(99 207 145 / 38%);
    --fail: #ff806e;
    --fail-bg: rgb(255 128 110 / 12%);
    --fail-line: rgb(255 128 110 / 40%);
    --pend: #f5c542;
    --pend-bg: rgb(242 182 0 / 13%);
    --pend-line: rgb(242 182 0 / 42%);
    --na: #a0a8ad;
    --na-bg: rgb(160 168 173 / 12%);
    --na-line: rgb(160 168 173 / 30%);
    --info: #7db8e8;
    --info-bg: rgb(125 184 232 / 12%);
    --info-line: rgb(125 184 232 / 35%);
    --viewer-top: #4b5359;
    --viewer-bot: #2b3034;
    --shadow: 0 1px 2px rgb(0 0 0 / 35%), 0 2px 10px rgb(0 0 0 / 25%);
    --shadow-lg: 0 10px 40px rgb(0 0 0 / 55%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131618;
  --surface: #1c2023;
  --surface-2: #20252a;
  --surface-3: #282e33;
  --ink: #e7e9e7;
  --ink-2: #c3c8cb;
  --muted: #979fa5;
  --line: #30373c;
  --line-2: #434b51;
  --focus: #6aa8ff;
  --pass: #63cf91;
  --pass-bg: rgb(99 207 145 / 12%);
  --pass-line: rgb(99 207 145 / 38%);
  --fail: #ff806e;
  --fail-bg: rgb(255 128 110 / 12%);
  --fail-line: rgb(255 128 110 / 40%);
  --pend: #f5c542;
  --pend-bg: rgb(242 182 0 / 13%);
  --pend-line: rgb(242 182 0 / 42%);
  --na: #a0a8ad;
  --na-bg: rgb(160 168 173 / 12%);
  --na-line: rgb(160 168 173 / 30%);
  --info: #7db8e8;
  --info-bg: rgb(125 184 232 / 12%);
  --info-line: rgb(125 184 232 / 35%);
  --viewer-top: #4b5359;
  --viewer-bot: #2b3034;
  --shadow: 0 1px 2px rgb(0 0 0 / 35%), 0 2px 10px rgb(0 0 0 / 25%);
  --shadow-lg: 0 10px 40px rgb(0 0 0 / 55%);
}

/* ================================================================ 基础 */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

main { flex: 1 0 auto; outline: none; }
/* 路由切换后程序化聚焦正文只为读屏定位，不画整页焦点框（:focus-visible 的优先级高于 main 元素选择器） */
main:focus, main:focus-visible { outline: none; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; font-weight: 700; letter-spacing: .01em; }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
h4 { font-size: .92rem; }
p { margin: 0 0 .75em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
img { max-width: 100%; }
code, pre, .mono { font-family: var(--mono); font-size: .88em; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; }
details > summary { cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
/* 炭灰底上蓝色焦点环对比度只有 2.2:1：顶栏、首页头图、提示条、用户气泡改用安全黄 */
.topbar :focus-visible, .hero :focus-visible, .toast :focus-visible, .msg-user :focus-visible { outline-color: var(--yellow); }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.pad { padding: 12px 14px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.icon.flip { transform: scaleX(-1); }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--yellow); color: var(--yellow-ink); padding: 8px 14px; border-radius: var(--radius); font-weight: 700;
}
.skip-link:focus { top: 10px; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding-inline: 16px; }
@media (min-width: 760px) { .container { padding-inline: 28px; } }

/* ================================================================ 顶栏与页脚 */

.topbar { position: sticky; top: 0; z-index: 50; background: var(--charcoal); color: #eef0ee; }
.topbar-inner {
  max-width: 1280px; margin: 0 auto; height: 56px; padding-inline: 16px;
  display: flex; align-items: center; gap: 14px;
}
@media (min-width: 760px) { .topbar-inner { padding-inline: 28px; } }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; min-width: 0; }
.brand-mark { width: 30px; height: 30px; color: var(--yellow); flex: none; }
.brand-bg { fill: var(--charcoal-3); }
.brand-text { font-size: 1.02rem; letter-spacing: .02em; white-space: nowrap; font-weight: 500; }
.brand-text b { color: var(--yellow); font-weight: 700; }
.mainnav { display: flex; gap: 2px; margin-left: auto; }
.mainnav a {
  position: relative; padding: 8px 12px; border-radius: var(--radius); text-decoration: none;
  color: #d3d7d9; font-size: .95rem; white-space: nowrap;
}
.mainnav a:hover { color: #fff; background: rgb(255 255 255 / 7%); }
.mainnav a[aria-current="page"] { color: #fff; }
.mainnav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 3px; border-radius: 2px; background: var(--yellow);
}
.hazard-rule {
  height: 4px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 10px, var(--charcoal-3) 10px 20px);
}
.topbar .theme-toggle { color: #d3d7d9; }
.topbar .theme-toggle:hover { color: #fff; background: rgb(255 255 255 / 8%); }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: block; }
}

.sitefoot { margin-top: 56px; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: .84rem; }
.sitefoot-inner { padding-block: 20px 28px; display: grid; gap: 6px; }
.sitefoot-meta { font-family: var(--mono); font-size: .78rem; }

.boot { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50vh; color: var(--muted); }

/* ================================================================ 通用部件 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 7px 15px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-size: .94rem; font-weight: 500; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--ink-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--yellow); border-color: var(--yellow); color: var(--yellow-ink); font-weight: 700; }
.btn-primary:hover:not(:disabled) { background: #ffc61a; border-color: #ffc61a; }
.btn-dark { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.btn-dark:hover:not(:disabled) { background: var(--charcoal-2); border-color: var(--charcoal-2); }
:root[data-theme="dark"] .btn-dark { background: #4a5257; border-color: #4a5257; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-dark { background: #4a5257; border-color: #4a5257; } }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); border-color: transparent; }
.btn-on-dark { background: transparent; border-color: rgb(255 255 255 / 35%); color: #fff; }
.btn-on-dark:hover { border-color: #fff; background: rgb(255 255 255 / 8%); }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: .86rem; }
.btn-lg { min-height: 46px; padding: 10px 20px; font-size: 1rem; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }

.eyebrow {
  margin: 0 0 .4em; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }

.tag {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; padding: 1px 7px; border-radius: 99px;
  font-size: .72rem; font-weight: 600; background: var(--surface-3); color: var(--muted); vertical-align: 2px;
}
.tag .icon { width: .95em; height: .95em; }
.badge {
  display: inline-block; min-width: 1.6em; padding: 0 7px; border-radius: 99px; font-size: .76rem; line-height: 1.6;
  text-align: center; background: var(--surface-3); color: var(--muted); font-weight: 600;
}

.spinner {
  display: inline-block; width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 22%, transparent); border-top-color: var(--yellow);
  animation: spin .8s linear infinite; vertical-align: -3px;
}
.spinner.sm { width: 12px; height: 12px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.loading { display: flex; align-items: center; gap: 10px; padding: 28px 4px; color: var(--muted); }

.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; margin: 14px 0;
  border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); background: var(--surface-2);
}
.notice > .icon { width: 20px; height: 20px; margin-top: 2px; }
.notice > div { min-width: 0; flex: 1; }
.notice strong { display: block; margin-bottom: 2px; }
.notice p { margin: 0 0 .35em; }
.notice ul { margin: 4px 0 0; padding-left: 1.2em; }
.notice .actions { margin-top: 10px; }
.notice.compact { padding: 10px 13px; margin: 10px 0; font-size: .9rem; }
.notice-error { border-color: var(--fail-line); border-left-color: var(--fail); background: var(--fail-bg); }
.notice-error > .icon { color: var(--fail); }
.notice-pending { border-color: var(--pend-line); border-left-color: var(--yellow); background: var(--pend-bg); }
.notice-pending > .icon { color: var(--pend); }
.notice-info { border-color: var(--info-line); border-left-color: var(--info); background: var(--info-bg); }
.notice-info > .icon { color: var(--info); }

.empty { text-align: center; padding: 48px 16px; max-width: 520px; margin: 0 auto; }
.empty .empty-icon { width: 44px; height: 44px; color: var(--muted); margin-bottom: 10px; }
.empty .actions { justify-content: center; margin-top: 16px; }

.table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }

.more { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.more > summary { padding: 9px 14px; font-size: .9rem; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.more > summary::before {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s; flex: none;
}
.more[open] > summary::before { transform: rotate(45deg); }
.more > :not(summary) { margin: 0 14px 14px; }

.warn-list { margin: 0; padding-left: 1.2em; font-size: .88rem; color: var(--ink-2); }
.warn-list li { margin: .35em 0; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: .92rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  position: relative; width: 36px; height: 20px; border-radius: 99px; background: var(--line-2); transition: background .15s; flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 25%); transition: transform .15s;
}
.switch input:checked + .track { background: var(--charcoal); }
:root[data-theme="dark"] .switch input:checked + .track { background: var(--yellow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .switch input:checked + .track { background: var(--yellow); } }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }

/* 提示条 */
.toast-region {
  position: fixed; z-index: 200; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius);
  background: var(--charcoal); color: #fff; box-shadow: var(--shadow-lg); font-size: .92rem;
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: auto;
}
.toast.in { opacity: 1; transform: none; }
.toast .icon { margin-top: 2px; color: var(--yellow); }
.toast-error { background: #7c2518; }
.toast-error .icon { color: #ffd0c7; }
.toast-ok .icon { color: #8fe0b0; }

/* 判定色：通过绿 / 不通过红 / 待证黄 / 不适用灰 */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 99px; white-space: nowrap;
  font-size: .8rem; font-weight: 600; line-height: 1.6; border: 1px solid transparent;
}
.chip-sym { font-size: .78em; }
.chip-pass { color: var(--pass); background: var(--pass-bg); border-color: var(--pass-line); }
.chip-fail { color: var(--fail); background: var(--fail-bg); border-color: var(--fail-line); }
.chip-pending { color: var(--pend); background: var(--pend-bg); border-color: var(--pend-line); }
.chip-na { color: var(--na); background: var(--na-bg); border-color: var(--na-line); }

.st {
  display: inline-block; padding: 0 6px; border-radius: 4px; font-size: .72rem; font-weight: 600; line-height: 1.55;
  border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap;
}
.st-verified { color: var(--pass); border-color: var(--pass-line); }
.st-assumed { color: var(--info); border-color: var(--info-line); }
.st-decided { color: var(--ink-2); border-color: var(--line-2); }
.st-pending { color: var(--pend); border-color: var(--pend-line); background: var(--pend-bg); }

.mini-counts { display: flex; flex-wrap: wrap; gap: 6px; font-size: .78rem; font-weight: 600; }
.mini-counts span { padding: 0 8px; border-radius: 99px; line-height: 1.7; border: 1px solid transparent; }
.mini-counts .count-pass { color: var(--pass); background: var(--pass-bg); }
.mini-counts .count-fail { color: var(--fail); background: var(--fail-bg); }
.mini-counts .count-pending { color: var(--pend); background: var(--pend-bg); }
.mini-counts .zero { color: var(--muted); background: var(--surface-3); }

/* 关键数字瓷砖 */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.tile {
  position: relative; padding: 12px 14px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); min-width: 0; border-top: 3px solid var(--charcoal);
}
:root[data-theme="dark"] .tile { border-top-color: #58626a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tile { border-top-color: #58626a; } }
.tile-label { font-size: .8rem; color: var(--muted); line-height: 1.35; margin-bottom: 4px; }
.tile-value { font-size: 1.45rem; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tile-value small { font-size: .62em; font-weight: 500; color: var(--muted); margin-left: 4px; }
.tile-value.txt { font-size: 1.02rem; line-height: 1.35; padding-top: 4px; }
.tile .st { position: absolute; top: 9px; right: 9px; }
.tile .tile-label { padding-right: 38px; }

.kv-table { width: 100%; font-size: .88rem; }
.kv-table th, .kv-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.kv-table thead th { font-size: .78rem; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.kv-table tbody th { font-weight: 500; min-width: 180px; }
.kv-table td.num { white-space: nowrap; font-weight: 600; }
.kv-table td.src { font-family: var(--mono); font-size: .76rem; color: var(--muted); overflow-wrap: anywhere; }

/* 合规 */
.compliance .counts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.count {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .88rem; color: var(--ink-2);
}
.count b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.count-pass b { color: var(--pass); }
.count-fail b { color: var(--fail); }
.count-pending b { color: var(--pend); }
.count-na b { color: var(--na); }
.count.is-zero b { color: var(--muted); font-weight: 500; }
.count[aria-pressed="true"] { box-shadow: inset 0 0 0 2px currentColor; }
.count-pass[aria-pressed="true"] { color: var(--pass); background: var(--pass-bg); }
.count-fail[aria-pressed="true"] { color: var(--fail); background: var(--fail-bg); }
.count-pending[aria-pressed="true"] { color: var(--pend); background: var(--pend-bg); }
.count-na[aria-pressed="true"] { color: var(--na); background: var(--na-bg); }

.rules { display: grid; gap: 6px; }
.rule { border: 1px solid var(--line); border-left: 4px solid var(--na-line); border-radius: var(--radius); background: var(--surface); }
.rule-pass { border-left-color: var(--pass); }
.rule-fail { border-left-color: var(--fail); background: linear-gradient(90deg, var(--fail-bg), var(--surface) 55%); }
.rule-pending { border-left-color: var(--yellow); }
.rule > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; }
.rule-id { color: var(--muted); font-size: .8rem; min-width: 2.4em; }
.rule-title { font-size: .92rem; font-weight: 500; line-height: 1.4; }
.rule-title small { display: block; font-size: .76rem; color: var(--muted); font-weight: 400; }
.rule-body { padding: 0 14px 12px calc(12px + 2.4em + 10px); font-size: .88rem; color: var(--ink-2); }
.rule-body p { margin: 0 0 .5em; }
.rules-compact .rule > summary { padding: 7px 10px; }
.rules-compact .rule-body { padding-left: 12px; }

/* 进度 */
.job-progress { display: grid; gap: 10px; }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 4px; }
.stepper li {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: .8rem;
  color: var(--muted); background: var(--surface-3);
}
.stepper .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.stepper li.done { color: var(--pass); background: var(--pass-bg); }
.stepper li.done .dot { background: var(--pass); }
.stepper li.current { color: var(--ink); background: var(--pend-bg); box-shadow: inset 0 0 0 1px var(--pend-line); }
.stepper li.current .dot { background: var(--yellow); animation: pulse 1.2s ease-in-out infinite; }
.stepper li.failed { color: var(--fail); background: var(--fail-bg); }
.stepper li.failed .dot { background: var(--fail); }
@keyframes pulse { 50% { opacity: .35; } }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-fill {
  height: 100%; width: 2%; border-radius: inherit; transition: width .4s ease;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 8px, #e0a800 8px 16px);
}
.job-progress[data-status="done"] .bar-fill { background: var(--pass); }
.job-progress[data-status="failed"] .bar-fill { background: var(--fail); }
.progress-line { margin: 0; font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 文件清单 */
.file-list { display: grid; gap: 8px; }
.file-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.file-group > summary { display: flex; align-items: center; gap: 9px; padding: 10px 14px; font-weight: 600; }
.file-group > summary .badge { margin-left: auto; }
.file-group[open] > summary { border-bottom: 1px solid var(--line); }
.files { list-style: none; margin: 0; padding: 4px 0; }
.files li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 3.6em; gap: 12px; align-items: center; padding: 6px 14px;
}
.files li:hover { background: var(--surface-2); }
.files a { display: grid; min-width: 0; text-decoration: none; }
.files a:hover .file-title { text-decoration: underline; }
.file-title { font-size: .92rem; overflow-wrap: anywhere; }
.file-meta { font-size: .74rem; color: var(--muted); overflow-wrap: anywhere; }
.file-size { font-size: .8rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.file-ext {
  font-size: .7rem; text-align: center; padding: 1px 4px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--ink-2);
}

.skeleton { min-height: 280px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 300% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* ================================================================ 页头与分区 */

.view { padding-top: 26px; }
.page-head { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.page-head > div:first-child { min-width: 0; max-width: 760px; }
.page-head h1 { margin-bottom: .25em; }
.page-tools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.inline-field select { color: var(--ink); }

.section { padding-top: 44px; }
.section-head { max-width: 760px; margin-bottom: 18px; }
.section-tight { margin-top: 24px; }
.section-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 12px; }
.section-row h2 { margin: 0; }
.section-row p { margin: 0; }
.sub-head { font-size: .95rem; margin: 18px 0 10px; }

/* ================================================================ 首页 */

.hero {
  background:
    radial-gradient(ellipse at 85% 10%, rgb(242 182 0 / 10%), transparent 55%),
    linear-gradient(180deg, var(--charcoal) 0%, var(--charcoal-2) 100%);
  color: #eef0ee; margin-top: -26px;
}
.view-home { padding-top: 26px; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; align-items: center; padding-block: 56px 60px; }
.hero .eyebrow { color: var(--yellow); }
.hero h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem); line-height: 1.18; margin-bottom: .45em; color: #fff; letter-spacing: .005em; }
.hero .lead { font-size: 1.05rem; color: #c9ced1; max-width: 36em; margin-bottom: 1.6em; }
.hero-figure { min-width: 0; }
.hero-art { width: 100%; height: auto; display: block; }
.hero-art .ln { fill: none; stroke: #dfe3e5; stroke-width: 2.4; }
.hero-art .ln.thin { stroke-width: 1.4; stroke: #aeb5b9; }
.hero-art .ln.hair { stroke-width: 1; stroke: #7f878c; }
.hero-art .ln.ground { stroke: #8d959a; stroke-width: 1.6; }
.hero-art .ln.dash { stroke: #7f878c; stroke-width: 1.2; stroke-dasharray: 5 4; }
.hero-art .hatch { stroke: #5d666b; stroke-width: 1.2; }
.hero-art .post { fill: #5b6468; }
.hero-art .post.back { fill: #4b5357; }
.hero-art .carriage rect { fill: var(--yellow); }
.hero-art .fill-accent { fill: var(--yellow); }
.hero-art .dim line { stroke: var(--yellow); stroke-width: 1.4; }
.hero-art .dim text, .hero-art .note { fill: #c9ced1; font-size: 14px; font-family: var(--font); }
.hero-art .dim text { fill: var(--yellow); font-weight: 700; }

.samples-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.samples-grid > .notice, .samples-grid > p { grid-column: 1 / -1; margin: 0; }
/* 渲染图是宽幅（内核 iso 图 2400×1260）：放在卡片顶部按原比例显示，不在窄列里裁成一条 */
.sample-card { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; overflow: hidden; }
.sample-thumb {
  background: linear-gradient(180deg, var(--viewer-top), var(--viewer-bot)); display: grid; place-items: center;
  border-bottom: 1px solid var(--line); aspect-ratio: 1200 / 630;
}
.sample-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sample-thumb .thumb-icon { width: 54px; height: 54px; color: var(--line-2); }
.sample-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sample-body h3 { font-size: 1.15rem; margin-bottom: .2em; }
.sample-body > .muted { font-size: .88rem; }
.sample-facts dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 14px; margin: 6px 0 10px; font-size: .88rem; }
.sample-facts dt { color: var(--muted); }
.sample-facts dd { margin: 0; font-weight: 600; }
.sample-facts .mini-counts { margin-bottom: 12px; }
.sample-status:not(:empty) { margin: 6px 0 12px; }
.sample-body .actions { margin-top: auto; padding-top: 6px; }

.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; counter-reset: flow; }
.flow-step {
  position: relative; padding: 18px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
}
.flow-step:not(:last-child)::after {
  content: ""; position: absolute; top: 34px; right: -12px; width: 12px; height: 2px; background: var(--yellow);
}
.flow-no { position: absolute; top: 14px; right: 14px; font-size: .78rem; color: var(--muted); }
.flow-icon { width: 30px; height: 30px; color: var(--charcoal); margin-bottom: 10px; padding: 5px; border-radius: 6px; background: var(--yellow); }
.flow-step h3 { font-size: 1rem; margin-bottom: .3em; }
.flow-step p { font-size: .86rem; color: var(--ink-2); margin: 0; }

.callout {
  display: flex; gap: 16px; padding: 20px 22px; border-radius: var(--radius-lg);
  border: 1px solid var(--pend-line); background: var(--pend-bg);
}
.callout > .icon { width: 26px; height: 26px; color: var(--pend); margin-top: 2px; }
.callout h2 { font-size: 1.05rem; }
.callout p { font-size: .92rem; color: var(--ink-2); }

/* ================================================================ 配置器 */

.cfg-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 24px; align-items: start; }
.cfg-main { min-width: 0; }
.group-nav {
  position: sticky; top: var(--topbar-h); z-index: 20; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 0; margin-bottom: 6px; background: var(--bg);
}
.group-nav::-webkit-scrollbar { display: none; }
.group-nav a {
  flex: none; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; font-size: .85rem; color: var(--ink-2); white-space: nowrap;
}
.group-nav a:hover { border-color: var(--ink-2); color: var(--ink); }
.group-nav:not(.show-adv) a.is-adv { display: none; }
/* 桌面上分组较多时换行（隐藏滚动条的横向滚动没有可发现性）；手机上保留横向滚动，右缘渐隐提示还有内容 */
@media (min-width: 761px) { .group-nav { flex-wrap: wrap; overflow-x: visible; } }

.cfg-form { display: grid; gap: 16px; }
.group { padding: 18px 20px 20px; scroll-margin-top: calc(var(--topbar-h) + 60px); }
.group-head { margin-bottom: 12px; }
.group-head h2 { margin-bottom: .15em; }
.group-head p { margin: 0; }
.cfg-form:not(.show-adv) .group-adv, .cfg-form:not(.show-adv) .field.is-adv { display: none; }

.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 14px 18px; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 5px; position: relative; }
.field.wide { grid-column: 1 / -1; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--ink); min-height: 24px; }
.field-label label { cursor: pointer; }
.field-label .tag { margin-left: 0; }
.unit-tag { font-size: .74rem; color: var(--muted); font-weight: 400; font-family: var(--mono); }
.key-mark {
  display: inline-block; padding: 0 6px; border-radius: 4px; font-size: .7rem; font-weight: 700; line-height: 1.6;
  color: var(--yellow-ink); background: var(--yellow); vertical-align: 1px; margin: 0 3px;
}
.field-reset {
  margin-left: auto; width: 24px; height: 24px; display: none; place-items: center; padding: 0;
  border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer;
}
.field-reset .icon { width: 14px; height: 14px; }
.field.is-dirty .field-reset { display: inline-grid; }
.field-reset:hover { background: var(--surface-3); color: var(--ink); }
.field.is-dirty::before {
  content: ""; position: absolute; left: -10px; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: var(--yellow);
}

.field input[type="number"], .field input[type="text"], .field select, .field textarea,
.inline-field select, .login-card input {
  width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-variant-numeric: tabular-nums;
}
.inline-field select { width: auto; max-width: 60vw; }
.field input:focus, .field select:focus, .inline-field select:focus, .login-card input:focus {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent);
}
.field input:disabled, .field select:disabled { background: var(--surface-3); color: var(--muted); }
.field input[readonly] { background: var(--surface-2); color: var(--muted); }
.input-unit { position: relative; display: flex; align-items: center; }
.input-unit input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.input-unit input[type="number"]::-webkit-inner-spin-button, .input-unit input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input-unit input { padding-right: 46px; }
.input-unit .unit {
  position: absolute; right: 10px; font-size: .78rem; color: var(--muted); font-family: var(--mono); pointer-events: none;
}
.field .help { margin: 0; font-size: .78rem; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.field-error { margin: 0; font-size: .8rem; color: var(--fail); font-weight: 500; }
.field-error:empty { display: none; }
.field.has-error input, .field.has-error select { border-color: var(--fail); background: var(--fail-bg); }
.field.is-related .field-label::after { content: "相关"; font-size: .7rem; color: var(--fail); border: 1px solid var(--fail-line); border-radius: 4px; padding: 0 4px; font-weight: 500; }
.auto-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--ink-2); cursor: pointer; width: fit-content; }
.auto-toggle input { margin: 0; accent-color: var(--charcoal); }
.field.type-boolean .switch { min-height: 38px; }

.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 99px;
  font-size: .84rem; cursor: pointer; background: var(--surface);
}
.check-chip input { margin: 0; accent-color: var(--charcoal); }
.check-chip:has(input:checked) { background: var(--pend-bg); border-color: var(--pend-line); }
.sequence { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sequence li { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.sequence select { width: auto; min-height: 30px; padding: 3px 6px; }
.seq-no { font-size: .74rem; color: var(--muted); padding: 0 4px; }
.sequence .seq-add { border-style: dashed; background: transparent; }

.cfg-aside { position: sticky; top: calc(var(--topbar-h) + 14px); display: grid; gap: 16px; max-height: calc(100vh - var(--topbar-h) - 28px); overflow-y: auto; scrollbar-width: thin; padding: 2px; margin: -2px; }
.quick-card, .build-card { padding: 16px 18px 18px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.quick-status { margin: 0; color: var(--muted); }
.quick-status.fresh { color: var(--pass); }
.quick-status.stale { color: var(--pend); font-weight: 600; }
.quick-status.running { color: var(--ink-2); }
.quick-card > .actions { margin: 6px 0 12px; }
/* 过期结果：去色 + 顶部说明，不用半透明（半透明会把灰字压到 2:1 以下） */
.quick-body.is-stale > :not(.stale-note) { filter: grayscale(.9); }
.stale-note {
  display: flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 6px 10px; border-radius: var(--radius);
  border: 1px dashed var(--pend-line); background: var(--pend-bg); color: var(--ink-2); font-size: .82rem;
}
.stale-note .icon { color: var(--pend); }
.quick-body:not(.is-stale) > .stale-note { display: none; }
.quick-body .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.quick-body .tile { padding: 9px 11px; }
.quick-body .tile-value { font-size: 1.15rem; }
.quick-body .tile-value.txt { font-size: .92rem; }
.build-card h2 { margin-bottom: .35em; }
.build-card .btn { width: 100%; margin-top: 6px; }
.form-errors .notice { margin-top: 0; }
.form-errors ul { font-size: .86rem; }
.form-errors a { font-weight: 600; }
.form-errors li { margin-bottom: 4px; }
.fix-btn { display: flex; width: fit-content; margin-top: 6px; min-height: 28px; padding: 3px 10px; font-size: .8rem; white-space: normal; text-align: left; }

.mobile-bar { display: none; }

/* ================================================================ 结果页 */

.job-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; font-size: .86rem; color: var(--muted); }
.subnav {
  position: sticky; top: var(--topbar-h); z-index: 20; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 8px 0; margin-bottom: 10px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; padding: 5px 12px; border-radius: var(--radius); text-decoration: none; font-size: .9rem; color: var(--ink-2); }
.subnav a:hover { background: var(--surface-3); color: var(--ink); }
.job-section { padding-top: 28px; scroll-margin-top: calc(var(--topbar-h) + 54px); }
.job-section:focus { outline: none; }   /* 子导航跳转后的程序化焦点：只为读屏定位，不画整节大框 */
.job-section > h2 { margin-bottom: 14px; }
.job-section .tiles { margin-bottom: 4px; }
.running-card { padding: 20px 22px; max-width: 760px; }

.viewer {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--viewer-top), var(--viewer-bot));
  aspect-ratio: 16 / 8; min-height: 300px; max-height: 72vh; width: 100%;
}
.viewer-stage { position: absolute; inset: 0; }
.viewer-canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; cursor: grab; }
.viewer-canvas:active { cursor: grabbing; }
.viewer-status { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; }
.viewer-fallback { display: grid; justify-items: center; gap: 10px; text-align: center; max-width: 100%; }
.viewer-fallback img { max-height: 55vh; border-radius: var(--radius); }
.viewer-tools {
  position: absolute; left: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.viewer.ready .viewer-tools { opacity: 1; pointer-events: auto; }
.viewer-tools .tool, .segmented button {
  display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 5px 12px;
  border: 1px solid var(--line-2); background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink);
  border-radius: var(--radius); font-size: .86rem; cursor: pointer; text-decoration: none; backdrop-filter: blur(6px);
}
.viewer-tools .tool:hover, .segmented button:hover { border-color: var(--ink-2); }
.viewer-tools .tool[aria-pressed="true"] { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.segmented { display: inline-flex; border-radius: var(--radius); }
.segmented button { border-radius: 0; }
.segmented button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.segmented button:last-child { border-radius: 0 var(--radius) var(--radius) 0; margin-left: -1px; }
.segmented button[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--yellow-ink); font-weight: 700; position: relative; z-index: 1; }
.viewer-hint {
  position: absolute; right: 12px; top: 10px; margin: 0; font-size: .76rem; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 70%, transparent); padding: 2px 8px; border-radius: 4px; pointer-events: none;
}

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.thumb { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.thumb button { display: block; width: 100%; padding: 0; border: 0; background: #fff; cursor: zoom-in; aspect-ratio: 1400 / 990; }
.thumb-cad button { background: linear-gradient(180deg, #ecece8, #f8f8f6); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.thumb button:hover img { transform: scale(1.02); }
.thumb img { transition: transform .25s; }
.thumb figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; font-size: .86rem; border-top: 1px solid var(--line); }
.mini-link { font-size: .74rem; font-weight: 700; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 4px; text-decoration: none; color: var(--ink-2); }
.mini-link:hover { border-color: var(--ink-2); }

.lightbox {
  width: min(1320px, calc(100vw - 24px)); max-width: none; height: calc(100vh - 24px); max-height: none; padding: 0;
  border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox::backdrop { background: rgb(12 14 16 / 72%); }
.lb-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--line); }
.lb-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-links { display: flex; gap: 6px; }
.lb-body { flex: 1; min-height: 0; display: grid; place-items: center; padding: 12px; background: #fff; overflow: auto; }
.lb-body img { max-width: 100%; max-height: 100%; object-fit: contain; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  flex: none; padding: 8px 14px; border: 0; border-bottom: 3px solid transparent; background: none; cursor: pointer; color: var(--muted); font-weight: 500;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--yellow); }
.tabs button:hover { color: var(--ink); }
.doc-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 8px; }
.calc-doc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px clamp(16px, 3vw, 40px) 30px;
}

.job-list { display: grid; gap: 8px; }
.job-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 12px 16px;
  text-decoration: none; box-shadow: none;
}
.job-row:hover { border-color: var(--ink-2); }
.job-row-title { font-weight: 600; min-width: 0; }
.job-row > .muted.small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 46ch; }

/* ================================================================ 副驾 */

.copilot-gate { display: grid; place-items: center; min-height: 58vh; padding-block: 24px; }
.login-card { width: min(440px, 100%); padding: 28px 26px 22px; display: grid; gap: 10px; }
.login-card h1 { font-size: 1.4rem; margin: 4px 0 0; }
.login-card .field-label { margin-top: 6px; }
.login-card .actions { margin-top: 6px; }
.login-mark { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--charcoal); color: var(--yellow); }
.login-mark .icon { width: 24px; height: 24px; }

.copilot-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.chat-col { position: relative; min-width: 0; display: flex; flex-direction: column; min-height: calc(100vh - var(--topbar-h) - 60px); }
.chat-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
.chat-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.chat-title h1 { margin: 0; font-size: 1.5rem; }
.session-label { font-size: .78rem; }
.chat-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.usage-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; margin-right: 6px; border-radius: 99px;
  border: 1px solid var(--line-2); background: var(--surface); font-size: .78rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.usage-badge .icon { color: var(--pend); width: 14px; height: 14px; }

.chat-stream { flex: 1; display: flex; flex-direction: column; gap: 18px; padding-bottom: 24px; }

.chat-welcome { text-align: center; padding: 32px 8px 12px; max-width: 680px; margin: 0 auto; }
.welcome-mark {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center;
  background: var(--charcoal); color: var(--yellow);
}
.welcome-mark .icon { width: 26px; height: 26px; }
.chat-welcome h2 { font-size: 1.35rem; }
.suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; text-align: left; }
.suggestion {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); cursor: pointer; font-size: .9rem; line-height: 1.45; color: var(--ink-2); text-align: left;
}
.suggestion:hover { border-color: var(--ink-2); color: var(--ink); }
.suggestion .icon { color: var(--pend); margin-top: 1px; }

.msg { display: flex; gap: 12px; min-width: 0; }
.msg-user { justify-content: flex-end; }
.msg-user .bubble {
  max-width: min(78%, 620px); padding: 10px 14px; border-radius: 14px 14px 4px 14px;
  background: var(--charcoal); color: #f2f4f2; white-space: pre-wrap; overflow-wrap: anywhere;
}
:root[data-theme="dark"] .msg-user .bubble { background: #3b444a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg-user .bubble { background: #3b444a; } }
.msg-user .bubble p { margin: 0; }
.bubble-photo { display: block; max-width: 260px; max-height: 220px; border-radius: 8px; margin-bottom: 8px; object-fit: cover; }
.photo-placeholder {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; padding: 3px 9px; border-radius: 6px;
  background: rgb(255 255 255 / 12%); font-size: .8rem; color: #d6dadc;
}
.msg-user.is-confirm .bubble { background: var(--pass-bg); color: var(--ink); border: 1px solid var(--pass-line); display: flex; gap: 8px; align-items: flex-start; }
.confirm-mark { color: var(--pass); }

.avatar {
  flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--charcoal); color: var(--yellow); margin-top: 2px;
}
.avatar .icon { width: 18px; height: 18px; }
.turn-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.turn-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.turn-body:empty { display: none; }
.turn-pending { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .9rem; padding-top: 5px; }
.turn-foot { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.turn-foot:empty { display: none; }
.usage-mini { font-size: .74rem; color: var(--muted); }
.stop-tag { font-size: .74rem; padding: 0 7px; border-radius: 4px; background: var(--pend-bg); color: var(--pend); font-weight: 600; }
.turn-note { display: flex; align-items: center; gap: 7px; margin: 0; font-size: .84rem; color: var(--muted); }
.turn-note .icon { color: var(--pend); }

.md-msg { font-size: .96rem; line-height: 1.75; }
.md-msg.plain { white-space: pre-wrap; }
.md-msg > :first-child { margin-top: 0; }
.md-msg > :last-child { margin-bottom: 0; }

.thinking { border-left: 3px solid var(--line-2); padding-left: 12px; }
.thinking > summary { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; color: var(--muted); padding: 2px 0; }
.thinking > summary .icon { width: 14px; height: 14px; color: var(--pend); }
.thinking > summary:hover { color: var(--ink); }
.thinking-text { margin-top: 6px; font-size: .86rem; color: var(--muted); white-space: pre-wrap; line-height: 1.65; }

.tool-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tool-card > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 12px; }
.tool-icon { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.tool-icon .icon { width: 16px; height: 16px; }
.tool-head { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.tool-name { font-size: .88rem; font-weight: 600; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tool-code { font-size: .72rem; color: var(--muted); font-weight: 400; }
.tool-summary { font-size: .84rem; color: var(--ink-2); line-height: 1.45; }
.tool-extra:empty { display: none; }
.tool-extra .mini-counts { margin-top: 3px; }
.tool-status { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.tool-status .icon { width: 14px; height: 14px; }
.tool-card[data-state="ok"] .tool-status { color: var(--pass); background: var(--pass-bg); }
.tool-card[data-state="fail"] .tool-status { color: var(--fail); background: var(--fail-bg); }
.tool-card[data-state="fail"] { border-color: var(--fail-line); }
.tool-chevron { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.tool-card[open] .tool-chevron { transform: rotate(90deg); }
.tool-body { border-top: 1px solid var(--line); padding: 10px 12px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.tool-io { min-width: 0; }
.tool-io h4 { font-size: .76rem; color: var(--muted); font-weight: 600; margin: 0 0 4px; letter-spacing: .06em; }
pre.json {
  margin: 0; padding: 10px 12px; max-height: 340px; overflow: auto; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line); font-size: .76rem; line-height: 1.55; white-space: pre; tab-size: 2;
}

/* 参数提案卡：置信度 高 / 中 / 低 用三格条 + 文字 + 行左色条三重区分 */
.proposal-card {
  border: 1px solid var(--line-2); border-top: 4px solid var(--yellow); border-radius: var(--radius-lg);
  background: var(--surface); padding: 14px 16px 16px; box-shadow: var(--shadow);
}
.proposal-card[data-state="confirmed"] { border-top-color: var(--pass); }
.proposal-card[data-state="invalid"] { border-top-color: var(--fail); }
.proposal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.proposal-title { display: flex; align-items: center; gap: 8px; }
.proposal-title h3 { margin: 0; font-size: 1.05rem; }
.proposal-title .icon { color: var(--pend); }
.proposal-title code { font-size: .8rem; padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--ink-2); }
.conf-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 4px 0 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }

.conf {
  display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px 1px 6px; border-radius: 99px;
  font-size: .78rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.conf-bars { display: inline-flex; gap: 2px; align-items: flex-end; }
.conf-bars i { width: 4px; border-radius: 1px; background: currentColor; opacity: .22; }
.conf-bars i:nth-child(1) { height: 6px; }
.conf-bars i:nth-child(2) { height: 9px; }
.conf-bars i:nth-child(3) { height: 12px; }
.conf-bars i.on { opacity: 1; }
.conf-high { color: var(--pass); background: var(--pass-bg); border-color: var(--pass-line); }
.conf-medium { color: var(--pend); background: var(--pend-bg); border-color: var(--pend-line); }
.conf-low { color: var(--fail); background: var(--fail-bg); border-color: var(--fail-line); border-style: dashed; }
.conf-none { color: var(--muted); }

.proposal-table { width: 100%; font-size: .88rem; }
.proposal-table th, .proposal-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.proposal-table thead th { font-size: .76rem; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.proposal-table tbody tr { border-left: 4px solid transparent; }
.proposal-table tbody th { font-weight: 500; min-width: 150px; }
.proposal-table tr.conf-row-high { border-left-color: var(--pass); }
.proposal-table tr.conf-row-medium { border-left-color: var(--yellow); }
.proposal-table tr.conf-row-low { border-left-color: var(--fail); background: color-mix(in srgb, var(--fail-bg) 55%, transparent); }
.proposal-table tr.conf-row-none { border-left-color: var(--line-2); }
.proposal-table tr.has-error td.prop-value { color: var(--fail); }
.prop-label { display: inline; }
.prop-path { display: none; }
.must-tag {
  display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 4px; font-size: .68rem; font-weight: 700; line-height: 1.6;
  background: var(--charcoal); color: var(--yellow); vertical-align: 1px;
}
.prop-value { font-weight: 600; white-space: nowrap; }
.prop-basis { color: var(--ink-2); min-width: 200px; }
.src-tag {
  display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; font-size: .72rem; font-weight: 600;
  border: 1px solid var(--line-2); color: var(--muted); line-height: 1.55;
}
.src-photo { border-color: var(--fail-line); color: var(--fail); }
.src-user { border-color: var(--pass-line); color: var(--pass); }
.questions { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--info-bg); border: 1px solid var(--info-line); }
.questions h4 { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--info); }
.questions ol { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.questions li { font-size: .9rem; }
.questions li > span { margin-right: 6px; }
.answer-btn { min-height: 26px; padding: 1px 8px; font-size: .78rem; vertical-align: 1px; color: var(--info); }
.proposal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.proposal-hint { margin: 8px 0 0; }

.job-card { border: 1px solid var(--line); border-left: 4px solid var(--charcoal); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; display: grid; gap: 10px; }
.job-card header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.job-card header h3 { margin: 0; font-size: .95rem; }
.job-card header code { font-size: .76rem; }
.job-card .actions:empty { display: none; }

.composer {
  position: sticky; bottom: 0; z-index: 10; margin-top: auto; padding: 10px 0 12px;
  background: linear-gradient(180deg, transparent, var(--bg) 14px);
}
.composer-row {
  display: flex; align-items: flex-end; gap: 6px; padding: 6px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow);
}
.composer-row:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.composer textarea {
  flex: 1; min-width: 0; min-height: 38px; max-height: 220px; padding: 8px 6px; border: 0; outline: none; resize: none;
  background: transparent; line-height: 1.5;
}
.send-btn { min-height: 38px; }
.composer-meta { display: flex; justify-content: space-between; gap: 10px; padding: 5px 6px 0; font-size: .74rem; color: var(--muted); }
.counter.over { color: var(--fail); font-weight: 700; }
.attach-box:empty { display: none; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 5px 6px 5px 5px; max-width: 100%;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface);
}
.attach-chip img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.attach-name { font-size: .86rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30ch; }
.view-copilot.is-busy .send-btn { cursor: progress; }

.drop-overlay {
  position: absolute; inset: 0; z-index: 30; display: none; place-content: center; justify-items: center; gap: 10px;
  border: 2px dashed var(--yellow); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--bg) 86%, transparent);
  color: var(--ink); font-weight: 600; pointer-events: none;
}
.drop-overlay .icon { width: 40px; height: 40px; color: var(--pend); }
.chat-col.dragging .drop-overlay { display: grid; }

/* 侧栏比视口高时自己滚动，否则对话滚到底时"用量"标题会被顶出视口 */
.chat-aside {
  position: sticky; top: calc(var(--topbar-h) + 14px); display: grid; gap: 14px;
  max-height: calc(100vh - var(--topbar-h) - 28px); overflow-y: auto; scrollbar-width: thin; padding: 2px; margin: -2px;
}
.aside-card { padding: 14px 16px 16px; font-size: .88rem; }
.aside-card h2 { font-size: .95rem; margin-bottom: 8px; }
.aside-card h3 { font-size: .84rem; margin: 12px 0 4px; color: var(--muted); }
.aside-more > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; }
.aside-more > summary h2 { margin: 0; }
.aside-more > summary::after {
  content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .15s; flex: none; margin-right: 4px;
}
.aside-more[open] > summary::after { transform: rotate(-135deg); }
.aside-more[open] > summary { margin-bottom: 8px; }
.usage-line { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.usage-line b { font-size: .95rem; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 6px 0 10px; }
.meter span { display: block; height: 100%; background: var(--pass); border-radius: inherit; }
.meter-hot span { background: var(--fail); }
.usage-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 12px; margin: 6px 0 8px; font-size: .8rem; }
.usage-grid dt { color: var(--muted); }
.usage-grid dd { margin: 0; text-align: right; }
.tick-list, .cross-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--ink-2); }
.tick-list li, .cross-list li { position: relative; padding-left: 18px; line-height: 1.5; }
.tick-list li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 8px; height: 5px; border-left: 2px solid var(--pass); border-bottom: 2px solid var(--pass); transform: rotate(-45deg); }
.cross-list li::before, .cross-list li::after { content: ""; position: absolute; left: 2px; top: .75em; width: 10px; height: 2px; background: var(--fail); transform: rotate(45deg); }
.cross-list li::after { transform: rotate(-45deg); }
.aside-note { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); box-shadow: none; }
.aside-note .icon { color: var(--muted); margin-top: 3px; }

/* ================================================================ Markdown（计算书 / 副驾正文） */

.md { color: var(--ink); }
.md h1, .md h2, .md h3, .md h4 { scroll-margin-top: calc(var(--topbar-h) + 60px); }
.md-doc h1 { font-size: 1.45rem; margin: 1.8em 0 .6em; padding-bottom: .3em; border-bottom: 2px solid var(--charcoal); }
.md-doc h2 { font-size: 1.15rem; margin: 1.6em 0 .5em; }
.md-doc h3 { font-size: 1rem; margin: 1.3em 0 .4em; }
.md h1:first-child, .md h2:first-child { margin-top: .3em; }
.md p, .md ul, .md ol { margin: 0 0 .85em; }
.md ul, .md ol { padding-left: 1.4em; }
.md li { margin: .2em 0; }
.md table { width: 100%; margin: .4em 0 1em; font-size: .88rem; border: 1px solid var(--line); }
.md th, .md td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; min-width: 4em; }
/* 首列多为名称或符号：别被长文本挤成一字一行 */
.md tr > :first-child { min-width: 6.5em; }
.md thead th { background: var(--surface-3); font-weight: 600; font-size: .84rem; }
.md tbody tr:nth-child(even) td { background: var(--surface-2); }
.md td[align="right"], .md th[align="right"] { text-align: right; }
.md code { padding: .1em .35em; border-radius: 4px; background: var(--surface-3); font-size: .86em; overflow-wrap: anywhere; }
.md pre { margin: 0 0 1em; padding: 10px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); overflow-x: auto; }
.md pre code { padding: 0; background: none; font-size: .84rem; overflow-wrap: normal; }
.md pre code.language-formula { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }
.md pre:has(code.language-formula) { border-left: 4px solid var(--yellow); background: var(--pend-bg); border-color: var(--pend-line); }
.md blockquote { margin: 0 0 1em; padding: 6px 14px; border-left: 4px solid var(--line-2); color: var(--ink-2); background: var(--surface-2); }
.md img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.md hr { margin: 1.4em 0; }
.md a { color: var(--info); }
.md .dead-link { border-bottom: 1px dotted var(--muted); cursor: help; }
.md-msg table { font-size: .86rem; }

.md-box { margin: 0 0 1em; }
.md-box > :last-child { margin-bottom: 0; }
.md-danger, .md-warn, .md-warning, .md-note, .md-info, .md-tip {
  padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); border-left-width: 4px; font-size: .92rem;
}
.md-danger { border-color: var(--fail-line); border-left-color: var(--fail); background: var(--fail-bg); }
.md-warn, .md-warning { border-color: var(--pend-line); border-left-color: var(--yellow); background: var(--pend-bg); }
.md-note, .md-info, .md-tip { border-color: var(--info-line); border-left-color: var(--info); background: var(--info-bg); }
.md-small { font-size: .84rem; color: var(--ink-2); }
.md-cover {
  padding: 22px clamp(16px, 3vw, 30px); margin: 4px 0 1.6em; border: 1px solid var(--line-2); border-top: 6px solid var(--charcoal);
  border-radius: var(--radius-lg); background: var(--surface-2);
}
.md-cover h1 { border: 0; margin: .2em 0 .2em; font-size: 1.7rem; padding: 0; }
.md-cover h2 { margin-top: 0; color: var(--ink-2); font-weight: 500; font-size: 1.05rem; }
.md-cover .company { font-size: .82rem; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.md-calc {
  margin: 1.2em 0 1.4em; padding: 4px 18px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: inset 4px 0 0 var(--charcoal);
}
.md-calc h2, .md-calc h3 { margin-top: .8em; }
.md .calc-label {
  display: inline-block; margin: .6em 0 .3em; font-size: .72rem; font-weight: 700; letter-spacing: .14em; color: var(--muted);
  text-transform: uppercase; border-bottom: 2px solid var(--yellow);
}
.md-kv table { font-size: .85rem; }
.md-kv td:first-child code { font-weight: 600; }
.md-signoff table, .md-form table, .md-docinfo table { font-size: .84rem; }
.md-pagebreak { display: none; }
.md-ascii pre, .md-ascii { font-family: var(--mono); }
.md .badge { border: 1px solid var(--line-2); background: transparent; font-size: .74rem; padding: 0 6px; border-radius: 4px; }
.md .badge.st-confirmed, .md .badge.oc-pass { color: var(--pass); border-color: var(--pass-line); background: var(--pass-bg); }
.md .badge.st-assumed { color: var(--info); border-color: var(--info-line); }
.md .badge.st-decision { color: var(--ink-2); }
.md .badge.st-pending { color: var(--pend); border-color: var(--pend-line); background: var(--pend-bg); }
.md .badge.oc-fail { color: var(--fail); border-color: var(--fail-line); background: var(--fail-bg); }
.md .badge.oc-na { color: var(--na); }
.md-toc {
  margin: 0 0 1.6em; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-2);
}
.md-toc-title { font-weight: 700; margin-bottom: .4em; }
.md-toc ol { margin: 0; padding-left: 0; list-style: none; columns: 2 260px; column-gap: 28px; font-size: .88rem; }
.md-toc li { margin: .15em 0; break-inside: avoid; }
.md-toc li.sub { padding-left: 1.2em; font-size: .84rem; }
.md-toc a { color: var(--ink-2); text-decoration: none; }
.md-toc a:hover { color: var(--ink); text-decoration: underline; }

/* ================================================================ 响应式 */

@media (max-width: 1180px) {
  .copilot-layout { grid-template-columns: minmax(0, 1fr); }
  .chat-aside { display: none; }
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .flow-step:nth-child(3)::after { display: none; }
}

@media (max-width: 980px) {
  .cfg-layout { grid-template-columns: minmax(0, 1fr); }
  .cfg-aside { position: static; max-height: none; overflow: visible; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); padding-block: 36px 40px; gap: 16px; }
  .hero-figure { max-width: 620px; }
  .mobile-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(8px);
  }
  .mobile-bar .btn { flex: 1; }
  .view-configure { padding-bottom: 76px; }
  .build-card .btn { display: none; }
}

@media (max-width: 760px) {
  body { font-size: 14.5px; }
  :root { --topbar-h: 108px; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding-block: 8px 0; row-gap: 2px; }
  .mainnav { order: 3; width: 100%; margin: 0 -8px; justify-content: space-between; }
  .mainnav a { flex: 1; text-align: center; padding: 9px 4px 11px; }
  .theme-toggle { margin-left: auto; }
  .brand-text { font-size: .98rem; }
  .view { padding-top: 18px; }
  .hero { margin-top: -18px; }
  .samples-grid { grid-template-columns: minmax(0, 1fr); }
  /* 横向滚动的导航：右缘渐隐提示还有内容（粘在滚动容器右侧的伪元素；最后一项可滚出渐隐区） */
  .group-nav::after, .subnav::after, .tabs::after {
    content: ""; position: sticky; right: 0; flex: none; width: 32px; margin-left: -24px; align-self: stretch;
    background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 85%); pointer-events: none;
  }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow-step::after { display: none; }
  .flow-step { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; padding: 14px; }
  .flow-step .flow-icon { grid-row: span 2; margin: 0; }
  .flow-step h3 { margin: 0; }
  .callout { flex-direction: column; gap: 8px; padding: 16px; }
  .page-head { align-items: flex-start; }
  .group { padding: 14px 14px 16px; }
  .field.is-dirty::before { left: -8px; }
  .viewer { aspect-ratio: 4 / 3.4; min-height: 260px; }
  .viewer-hint { display: none; }
  .viewer-tools .tool-label { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-value { font-size: 1.2rem; }
  .job-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .job-row > .mono, .job-row > .muted.small { display: none; }
  .files li { grid-template-columns: minmax(0, 1fr) auto; }
  .files .file-ext { display: none; }
  .rule-body { padding-left: 14px; }
  .kv-table tbody th { min-width: 130px; }
  .lb-links .btn-ghost { display: none; }
  .md-toc ol { columns: 1; }

  .chat-head { margin-bottom: 12px; }
  .chat-title h1 { font-size: 1.3rem; }
  .chat-tools { width: 100%; }
  .usage-badge { margin-right: auto; }
  .usage-day { display: none; }
  .suggestions { grid-template-columns: minmax(0, 1fr); }
  .msg { gap: 8px; }
  .avatar { width: 26px; height: 26px; border-radius: 7px; }
  .msg-user .bubble { max-width: 88%; }
  .send-label { display: none; }
  .send-btn { padding-inline: 12px; }
  .composer-meta span:first-child { display: none; }
  .composer-meta { justify-content: flex-end; }

  /* 提案表在手机上改为逐行卡片 */
  .proposal-card { padding: 12px 12px 14px; }
  .proposal-table thead { display: none; }
  .proposal-table, .proposal-table tbody { display: block; }
  .proposal-table tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 9px 10px; border-bottom: 1px solid var(--line);
  }
  .proposal-table tbody th, .proposal-table tbody td { padding: 0; border: 0; min-width: 0; }
  .proposal-table tbody th { grid-column: 1 / -1; }
  .proposal-table .prop-value { white-space: normal; }
  .proposal-table .prop-conf { justify-self: end; }
  .proposal-table .prop-basis { grid-column: 1 / -1; font-size: .84rem; }
  .conf-legend .legend-item .muted { display: none; }
}

@media (max-width: 380px) {
  .brand-text b { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

@media print {
  .topbar, .sitefoot, .subnav, .mobile-bar, .viewer, .composer, .chat-aside, .toast-region { display: none !important; }
  body { background: #fff; color: #000; }
}

/* 副驾在手机上：页脚让位给对话（免责声明在侧栏与首页都有） */
@media (max-width: 760px) {
  body[data-view="copilot"] .sitefoot { display: none; }
}
