/* 量化工作台：浅色/深色两套配色，红涨绿跌（国内习惯） */
:root {
  --bg: #F2F4F7; --surface: #FFFFFF; --sunk: #E9EDF3; --ink: #151B2B; --muted: #5A6377;
  --line: #D6DCE6; --grid: #E7EAF0; --accent: #2443C4; --accent-ink: #FFFFFF; --accent-soft: #E2E7FA;
  --up: #D2303C; --down: #0F8F58; --up-soft: rgba(210,48,60,.10); --down-soft: rgba(15,143,88,.11);
  --fast: #D98300; --slow: #2443C4; --warn-bg: #FFF3DE; --warn-ink: #6E4500; --err-bg: #FDE8EA; --err-ink: #8E1622;
  --shadow: 0 1px 2px rgba(21,27,43,.06), 0 4px 16px rgba(21,27,43,.05);
  --f-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1119; --surface: #151B26; --sunk: #1B2230; --ink: #E6EAF2; --muted: #97A1B5;
    --line: #283041; --grid: #212938; --accent: #8098FF; --accent-ink: #0D1119; --accent-soft: #1E2747;
    --up: #FF5C62; --down: #2ECC85; --up-soft: rgba(255,92,98,.13); --down-soft: rgba(46,204,133,.13);
    --fast: #FFB13D; --slow: #8098FF; --warn-bg: #3A2A10; --warn-ink: #FFD58A; --err-bg: #3A1418; --err-ink: #FFB3B8;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1119; --surface: #151B26; --sunk: #1B2230; --ink: #E6EAF2; --muted: #97A1B5;
  --line: #283041; --grid: #212938; --accent: #8098FF; --accent-ink: #0D1119; --accent-soft: #1E2747;
  --up: #FF5C62; --down: #2ECC85; --up-soft: rgba(255,92,98,.13); --down-soft: rgba(46,204,133,.13);
  --fast: #FFB13D; --slow: #8098FF; --warn-bg: #3A2A10; --warn-ink: #FFD58A; --err-bg: #3A1418; --err-ink: #FFB3B8;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.6 var(--f-body); -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num, code, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
code { font-size: .88em; background: var(--sunk); padding: .1em .38em; border-radius: 4px; }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--muted); }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
p { margin: 0 0 10px; }
[hidden] { display: none !important; }

/* 顶栏 */
.top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 20px; padding: 0 max(16px, env(safe-area-inset-left)); height: 56px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; white-space: nowrap; font-size: 14px; }
.nav a:hover { color: var(--ink); background: var(--sunk); }
.nav a.on { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.top-tools { display: flex; gap: 6px; align-items: center; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 15px; }
.icon-btn:hover { color: var(--ink); background: var(--sunk); }

.wrap { max-width: 1320px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-left)) 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* 卡片和布局 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.split > .card + .card, .split > div > .card + .card { margin-top: 0; }
.stack > * + * { margin-top: 16px; }
.cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cols > .card + .card { margin-top: 0; }
@media (max-width: 960px) { .split { grid-template-columns: minmax(0, 1fr); } .form-card { position: static !important; } }
.form-card { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; }

/* 表单 */
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field > label, .field > .lab { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; justify-content: space-between; gap: 8px; }
.field .hint { font-size: 12px; color: var(--muted); line-height: 1.45; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%; min-width: 0; }
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); vertical-align: -3px; }
input:disabled, select:disabled { background: var(--sunk); color: var(--muted); }
.sec { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); margin: 18px 0 10px; padding-top: 14px; border-top: 1px dashed var(--line); }
.sec:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
details.more > summary { cursor: pointer; font-size: 13px; color: var(--accent); margin: 4px 0 10px; list-style: none; }
details.more > summary::before { content: "▸ "; } details.more[open] > summary::before { content: "▾ "; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.chip:hover { color: var(--ink); border-color: var(--muted); }

.btn { font: inherit; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--sunk); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--up); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; padding: 11px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.seg { display: inline-flex; background: var(--sunk); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { font: inherit; font-size: 13px; border: 0; background: transparent; color: var(--muted); padding: 5px 12px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

/* 提示框 */
.note, .warn, .err { border-radius: 10px; padding: 11px 14px; font-size: 14px; }
.note { background: var(--accent-soft); }
.warn { background: var(--warn-bg); color: var(--warn-ink); }
.err { background: var(--err-bg); color: var(--err-ink); white-space: pre-wrap; }
.note p:last-child, .warn p:last-child { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }

/* 指标卡 */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--sunk); border-radius: 10px; padding: 11px 13px; min-width: 0; }
.stat .k { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.stat .v { font: 600 21px/1.3 var(--f-mono); font-variant-numeric: tabular-nums; margin-top: 3px; overflow-wrap: anywhere; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tip { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--muted); font-size: 10px; color: var(--muted); cursor: help; flex: none; position: relative; }
.tip:hover::after, .tip:focus::after { content: attr(data-tip); position: absolute; left: 50%; top: 20px; transform: translateX(-50%); width: 220px; background: var(--ink); color: var(--bg); padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.5; z-index: 30; font-weight: 400; text-align: left; }
.verdict { margin: 14px 0 0; font-size: 14.5px; line-height: 1.75; }

/* 表格 */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.tbl th, .tbl td { padding: 8px 11px; text-align: left; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.tbl th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--sunk); position: sticky; top: 0; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--sunk); }
.tbl tr.grp td { background: var(--bg); font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; }
.tbl .wrap-cell { white-space: normal; min-width: 160px; }
.scroll-y { max-height: 520px; overflow-y: auto; }

.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--down-soft); color: var(--down); }
.tag.err { background: var(--up-soft); color: var(--up); }
.tag.run { background: var(--accent-soft); color: var(--accent); }
.tag.long { background: var(--up-soft); color: var(--up); }
.tag.short { background: var(--down-soft); color: var(--down); }

/* 图表 */
.chart { width: 100%; height: 420px; }
.chart.tall { height: 560px; }
.chart.short { height: 300px; }
@media (max-width: 720px) { .chart { height: 340px; } .chart.tall { height: 460px; } }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 14px; overflow-x: auto; scrollbar-width: none; }
.tabs button { font: inherit; font-size: 14px; border: 0; background: none; color: var(--muted); padding: 9px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
pre.log { background: var(--sunk); border-radius: 10px; padding: 12px 14px; font: 12.5px/1.6 var(--f-mono); max-height: 420px; overflow: auto; margin: 0; white-space: pre-wrap; }

/* 进度条 */
.progress { height: 10px; background: var(--sunk); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }

/* 首页 */
.hero { background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); }
.hero h1 { font-size: 26px; margin-bottom: 8px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.step { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-decoration: none; color: var(--ink); }
.step:hover { border-color: var(--accent); }
.step .n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.step h3 { margin-bottom: 4px; }
.step p { color: var(--muted); font-size: 13.5px; margin: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

/* 弹出提示 */
.toast-box { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); white-space: pre-wrap; }
.toast.bad { background: var(--up); color: #fff; }

/* 登录页 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); padding: 28px; }
.login h1 { font-size: 20px; margin: 10px 0 4px; }

.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } .progress > div { transition: none; } }

/* AI 助手气泡 */
.chat-fab { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 40; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(36,67,196,.35); }
.chat-fab:hover { filter: brightness(1.08); }
.chat-dot { position: absolute; top: 4px; right: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--fast); border: 2px solid var(--surface); }
.chat-panel { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 41; width: 400px; height: min(640px, calc(100vh - 100px)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.22); display: flex; flex-direction: column; overflow: hidden; }
@media (max-width: 720px) { .chat-panel { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); } }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head b { display: block; font-size: 15px; }
.chat-head .muted { font-size: 12px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.chat-hello ul { margin: 4px 0 10px; padding-left: 20px; line-height: 1.8; }
.chat-hello .chip { text-align: left; }
.msg { max-width: 92%; line-height: 1.65; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.msg.ai { align-self: flex-start; background: var(--sunk); padding: 10px 12px; border-radius: 14px 14px 14px 4px; display: block; min-width: 60px; }
.msg.ai > * + * { margin-top: 8px; }
.msg.ai, .msg.ai * { min-width: 0; }
.msg.ai .md { overflow-wrap: anywhere; word-break: normal; }
.msg.ai .md code { word-break: break-all; white-space: pre-wrap; }
.msg.ai .md .tbl-wrap { max-width: 100%; overflow-x: auto; }
.msg.ai .md .tbl th, .msg.ai .md .tbl td { white-space: nowrap; }
.msg.ai .md a { overflow-wrap: anywhere; }
.msg .tool { overflow-wrap: anywhere; }
.run-card .rc-text { min-width: 0; overflow-wrap: anywhere; }
.run-card .btn { flex: none; }
details.step-group { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
details.step-group > summary { cursor: pointer; list-style: none; padding: 8px 10px 8px 11px; font-size: 12.5px; line-height: 1.5;
  display: flex; align-items: center; gap: 10px; }
details.step-group > summary::-webkit-details-marker { display: none; }
details.step-group > summary:hover { background: var(--sunk); }
details.step-group > summary .sum-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
details.step-group > summary .spin { width: 11px; height: 11px; }
/* 右侧明显的「展开 / 收起」按钮 */
details.step-group .sum-btn { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 10px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; white-space: nowrap; }
details.step-group .sum-btn::before { content: "展开"; }
details.step-group .sum-btn::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
details.step-group[open] .sum-btn::before { content: "收起"; }
details.step-group[open] .sum-btn::after { transform: translateY(1px) rotate(-135deg); }
@media (prefers-reduced-motion: reduce) { details.step-group .sum-btn::after { transition: none; } }
/* 收起时彻底隐藏内容，避免浏览器给隐藏部分留出空白 */
details.step-group:not([open]) > .steps-body { display: none; }
.steps-body { padding: 4px 11px 8px; display: grid; gap: 5px; max-height: 360px; overflow-y: auto; border-top: 1px solid var(--grid); }
.steps-body > :last-child { margin-bottom: 0; }
.run-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding-top: 6px; border-top: 1px dashed var(--grid); font-size: 12.5px; }
.run-row .rr-text { overflow-wrap: anywhere; line-height: 1.45; }
.run-row .rr-text .muted { font-size: 11.5px; }
.msg.ai .md p { margin: 0 0 6px; } .msg.ai .md p:last-child { margin: 0; }
.msg.ai .md ul, .msg.ai .md ol { margin: 2px 0 6px; padding-left: 20px; }
.msg.ai .md h4 { font-size: 14px; margin: 6px 0 4px; }
.msg.ai .md .tbl-wrap { margin: 4px 0; background: var(--surface); }
.msg.ai .md .tbl th, .msg.ai .md .tbl td { padding: 5px 8px; font-size: 12.5px; }
.msg .tool { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.msg .tool.ok { color: var(--down); } .msg .tool.error { color: var(--up); }
.msg .tool .spin { width: 11px; height: 11px; }
.run-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 13px; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.chat-input textarea { flex: 1; resize: none; min-height: 40px; max-height: 140px; line-height: 1.5; }
.chat-input .btn.danger { background: var(--up); border-color: var(--up); color: #fff; }
.style-toggle { font: inherit; font-size: 12px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; white-space: nowrap; }
.style-toggle:hover { color: var(--ink); }
.style-toggle.on { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--fast); font-weight: 600; }
.style-toggle.on::before { content: "● "; color: var(--fast); }
.msg .style-mark { display: block; font-size: 11px; opacity: .8; margin-bottom: 2px; }

/* ---------- 手机适配 ---------- */
.mobile-only, .tabbar { display: none; }
.chat-head { flex-wrap: nowrap; }
.chat-head > div:first-child { min-width: 0; }
.chat-head .muted { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .btns { flex-wrap: nowrap; flex: none; }
@media (max-width: 720px) {
  .top-in { gap: 10px; height: 52px; }
  .top .nav { display: none; }
  .mobile-only { display: grid; }
  .brand { flex: 1; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
    padding: 4px max(4px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); }
  .tabbar a { flex: 1; display: grid; justify-items: center; gap: 1px; padding: 5px 0 3px; font-size: 11px; color: var(--muted); text-decoration: none; border-radius: 8px; }
  .tabbar a.on { color: var(--accent); font-weight: 600; }
  .wrap { padding-top: 16px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .chat-fab { bottom: calc(70px + env(safe-area-inset-bottom)); right: 14px; width: 52px; height: 52px; }
  .chat-panel { z-index: 45; }
  h1 { font-size: 21px; } .hero h1 { font-size: 22px; }
  .page-head { margin-bottom: 12px; } .page-head p { font-size: 13.5px; }
  .card { padding: 14px; border-radius: 10px; }
  .stat .v { font-size: 19px; }
  .tabs button { padding: 9px 11px; }
  .chart { height: 320px; } .chart.tall { height: 440px; } .chart.short { height: 260px; }
  .btn.sm { padding: 6px 11px; }
  /* 宽表格在手机上改成一行一张卡片 */
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr { display: block; width: 100%; }
  .tbl.cards tr { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; padding: 11px 12px; border-bottom: 1px solid var(--grid); }
  .tbl.cards tr:last-child { border-bottom: 0; }
  .tbl.cards td { display: block; border: 0; padding: 0; white-space: normal; text-align: left !important; font-size: 13.5px; min-width: 0; }
  .tbl.cards td[data-l]::before { content: attr(data-l) "　"; color: var(--muted); font-size: 12px; }
  .tbl.cards td.full { grid-column: 1 / -1; }
  .tbl.cards td.hide-m { display: none; }
  .tbl.cards tbody tr:hover td { background: none; }
  .tbl .wrap-m { white-space: normal; }
}

/* 六关检查卡片 */
.ck-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.ck-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ck-head b { font-size: 13.5px; }
.ck-veto { background: var(--up-soft); color: var(--up); border-radius: 8px; padding: 6px 9px; margin-bottom: 6px; font-size: 12.5px; }
.ck-gates { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.ck-gates li { border-top: 1px dashed var(--grid); padding-top: 7px; }
.ck-gates li:first-child { border-top: 0; padding-top: 0; }
.ck-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ck-basis { color: var(--ink); line-height: 1.55; margin-top: 2px; overflow-wrap: anywhere; }
.ck-ask { color: var(--muted); font-size: 12px; margin-top: 2px; }
.ck-note { color: var(--muted); font-size: 11.5px; margin-top: 8px; line-height: 1.5; }
.rt-quote { font-size: 13px; font-weight: 400; margin-left: 10px; white-space: nowrap; }
.ck-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 4px 0 8px; }
.ck-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; background: var(--sunk); border-radius: 8px; padding: 6px 8px; font-size: 12.5px; }
.ck-cell .tag { font-size: 11.5px; }
.ck-more { border-radius: 8px; }
.ck-more .steps-body { max-height: none; padding-top: 8px; }
@media (max-width: 360px) { .ck-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
