:root {
  /* 官网取样、语义色与无障碍派生值见 brand/TOKENS.md。 */
  --brand: #101010; --brand-600: #000000; --brand-50: #f3f4f6; --brand-100: #e5e7eb;
  --brand-accent: #f02e27;
  --ink: #111827; --ink-2: #374151; --muted: #667085; --faint: #667085;
  --line: #e5e7eb; --line-2: #f3f4f6; --bg: #f7f8fb; --card: #ffffff;
  --ok: #047857; --ok-bg: #ecfdf5; --warn: #b45309; --warn-bg: #fffbeb; --err: #b91c1c; --err-bg: #fef2f2; --info: #1d4ed8; --info-bg: #eff6ff;
  --control-border: #7c8594;
  --warm-1: #fdd5d3; --warm-2: #fde2e0; --warm-3: #fdecd0; --warm-4: #fdf5d6;
  --radius: 12px; --shadow: 0 1px 3px rgba(16,16,16,.04), 0 4px 16px rgba(16,16,16,.025);
  --sidebar: 220px; --top: 60px; --tab: 60px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 布局 ---------- */
#app { min-height: 100%; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: linear-gradient(155deg, color-mix(in srgb, var(--warm-2) 28%, white), white 210px); color: var(--ink-2); border-right: 1px solid var(--line); overflow-y: auto; padding: 16px 12px 20px; z-index: 20; }
.sidebar .brand { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 4px 12px 14px; color: var(--ink); font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.sidebar .brand img { display: block; width: 128px; max-width: 100%; height: auto; object-fit: contain; }
.sidebar .sec { font-size: 11px; font-weight: 600; color: var(--muted); padding: 16px 12px 6px; letter-spacing: .1em; }
.sidebar a { display: flex; align-items: center; gap: 11px; min-height: 38px; padding: 8px 12px; margin-bottom: 2px; border-radius: 9px; color: var(--ink-2); font-size: 14px; transition: background .15s, color .15s; }
.sidebar a:hover { background: var(--brand-50); color: var(--brand); }
.sidebar a.active { background: var(--brand); color: var(--card); font-weight: 600; }
.sidebar a .badge { margin-left: auto; }
.shell { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; min-height: var(--top); display: flex; align-items: center; gap: 8px; padding: 0 28px; background: rgba(255,255,255,.92); -webkit-backdrop-filter: saturate(150%) blur(14px); backdrop-filter: saturate(150%) blur(14px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 17px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.back-btn { display: none; font-size: 28px; line-height: 1; }
main { flex: 1; padding: 24px 28px 40px; max-width: 1180px; width: 100%; min-width: 0; margin-inline: auto; }
.tabbar { display: none; }
body.bare .sidebar, body.bare .topbar, body.bare .tabbar { display: none !important; }
body.bare .shell { margin-left: 0; }
body.bare main { max-width: none; padding: 0; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .shell { margin-left: 0; }
  .topbar { padding: 0 12px; }
  .back-btn { display: inline-flex; }
  body.root-page .back-btn { visibility: hidden; }
  main { padding: 12px 12px calc(var(--tab) + 24px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset: auto 0 0 0; height: calc(var(--tab) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); z-index: 20; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; position: relative; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--brand); }
  .tabbar .badge { position: absolute; top: 5px; left: calc(50% + 6px); }
  .hide-mobile { display: none !important; }
}
@media (min-width: 901px) { .hide-desktop { display: none !important; } }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; min-width: 0; }
.card > h2, .card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-title .spacer, .row .spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.err-text { color: var(--err); } .ok-text { color: var(--ok); } .warn-text { color: var(--warn); }
.right { text-align: right; } .nowrap { white-space: nowrap; }
.grid { display: grid; gap: 14px; min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .grid-2.collapse, .grid-3.collapse { grid-template-columns: 1fr; } }
@media (min-width: 521px) { .span2 { grid-column: span 2; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--control-border); background: #fff; color: var(--ink-2); cursor: pointer; font-size: 14px; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--brand-50); border-color: var(--brand); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.danger { color: var(--err); border-color: var(--err); background: var(--card); }
.btn.danger.solid { background: var(--card); color: var(--err); border-color: var(--err); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); padding: 0 8px; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; border: 0; border-radius: 8px; background: none; padding: 4px 8px; cursor: pointer; color: var(--ink-2); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 13px; color: var(--ink-2); }
.field > label .req { color: var(--err); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--control-border); border-radius: 8px; background: #fff; outline: none; transition: border-color .12s, box-shadow .12s; min-width: 0; }
textarea.input { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.input:disabled { background: var(--brand-50); color: var(--muted); }
.input.money { text-align: right; font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; background: #f3f4f6; color: var(--ink-2); }
.badge.dot { height: 18px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--err); color: #fff; font-size: 11px; justify-content: center; }
.badge.blue { background: var(--info-bg); color: var(--info); }
.badge.green { background: var(--ok-bg); color: var(--ok); }
.badge.amber { background: var(--warn-bg); color: var(--warn); }
.badge.red { background: var(--err-bg); color: var(--err); }
.badge.gray { background: #f3f4f6; color: var(--muted); }
.tag { display: inline-block; font-size: 12px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 12px; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs a.active { color: var(--brand); border-color: var(--brand); font-weight: 500; }

.notice { border-radius: 8px; border-left: 3px solid transparent; padding: 11px 13px; font-size: 14px; display: flex; gap: 8px; align-items: flex-start; overflow-wrap: anywhere; }
.notice.warn { background: var(--warn-bg); color: #92400e; border-left-color: var(--warn); }
.notice.err { background: var(--err-bg); color: #991b1b; border-left-color: var(--err); }
.notice.info { background: var(--info-bg); color: #1e3a8a; border-left-color: var(--info); }
.notice.ok { background: var(--ok-bg); color: #065f46; border-left-color: var(--ok); }
.notice ul { margin: 0; padding-left: 18px; }

/* 列表 */
.list { border: 1px solid var(--line); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line-2); color: inherit; cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--brand-50); }
.list-item .main { flex: 1; min-width: 0; }
.list-item .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.list-item .amt { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 6px; opacity: .5; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* 表格 */
.table-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; background: var(--brand-50); height: 44px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { height: 44px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.amt, .table th.amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.clickable { cursor: pointer; } .table tr.clickable:hover td { background: var(--brand-50); }

/* 统计 */
.stat { min-width: 0; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; color: inherit; display: block; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-size: clamp(20px, 2vw, 26px); font-weight: 600; line-height: 1.3; margin-top: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat.hl .value { color: var(--brand); }

.hero { background: linear-gradient(110deg, var(--warm-1), var(--warm-2) 35%, var(--warm-3) 72%, var(--warm-4)); color: var(--ink); border-radius: 16px; padding: 24px; margin-bottom: 16px; }
.hero .hi { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.hero .sub { color: var(--ink-2); font-size: 13px; margin-top: 5px; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.quick a { background: rgba(255,255,255,.72); border: 1px solid transparent; border-radius: 10px; padding: 13px 6px; min-height: 78px; color: var(--brand); text-align: center; font-size: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.quick a:hover { background: var(--card); border-color: var(--control-border); }
.quick svg { width: 24px; height: 24px; }

/* 单据详情 */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; word-break: break-all; }
.doc-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.doc-head .t { font-size: 20px; font-weight: 600; }
.doc-head .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.line-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: var(--card); min-width: 0; }
.line-card + .line-card { margin-top: 10px; }
.line-card .lh { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.line-card .lh .n { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.line-view { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.line-view:last-child { border-bottom: 0; }
.line-view .main { flex: 1; min-width: 0; }
.line-view .amt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.line-view .strike { text-decoration: line-through; color: var(--faint); font-weight: 400; font-size: 12px; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: var(--control-border); }
.tl { position: relative; padding-bottom: 14px; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ""; position: absolute; left: -20px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--faint); }
.tl.APPROVED::before { border-color: var(--ok); background: var(--ok); }
.tl.REJECTED::before { border-color: var(--err); background: var(--err); }
.tl.PENDING::before { border-color: var(--info); background: var(--card); }
.tl.SKIPPED::before, .tl.TRANSFERRED::before, .tl.CANCELLED::before { border-color: var(--line); background: var(--line); }
.tl .node { font-size: 13px; color: var(--muted); }
.tl .who { font-weight: 500; }
.tl .cmt { font-size: 13px; background: var(--brand-50); border-radius: 6px; padding: 6px 8px; margin-top: 4px; color: var(--ink-2); }
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 900px) {
  .action-bar.sticky { position: fixed; left: 0; right: 0; bottom: calc(var(--tab) + env(safe-area-inset-bottom)); background: #fff; padding: 10px 12px; border-top: 1px solid var(--line); z-index: 15; justify-content: stretch; }
  .action-bar.sticky .btn { flex: 1; }
  .has-action-bar { padding-bottom: calc(var(--action-bar-height, 68px) + 16px); }
}
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb { width: 88px; height: 88px; border-radius: 8px; border: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; background: #fafafa; position: relative; cursor: pointer; font-size: 12px; color: var(--muted); text-align: center; padding: 4px; word-break: break-all; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .x { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.55); color: #fff; border: 0; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-size: 12px; line-height: 20px; padding: 0; }
.upload-tile { width: 88px; height: 88px; border: 1.5px dashed var(--control-border); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; cursor: pointer; }
.upload-tile:hover { border-color: var(--brand); color: var(--brand); }
.sum-bar { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; padding: 10px 2px 0; }
.sum-bar .big { font-size: 30px; line-height: 1.25; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }

/* 弹窗 */
.overlay { position: fixed; inset: 0; background: rgba(16,16,16,.4); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .12s ease; }
.modal { background: #fff; border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(16,16,16,.18); }
.modal.wide { max-width: 760px; }
.modal-h { padding: 20px 22px 10px; font-size: 17px; font-weight: 600; display: flex; align-items: center; }
.modal-h .icon-btn { margin-left: auto; font-size: 20px; color: var(--muted); }
.modal-b { padding: 10px 22px 22px; overflow-y: auto; min-height: 0; overflow-wrap: anywhere; }
.modal-f { padding: 16px 22px 20px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line-2); }
@media (max-width: 600px) {
  .overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: 14px 14px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); animation: up .18s ease; }
  .modal-f .btn { flex: 1; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }

#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: fade .15s ease; max-width: 90vw; }
.toast.err { background: #b91c1c; } .toast.ok { background: #047857; }

/* 选人 */
.picker { position: relative; }
.picker .drop { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--control-border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.1); margin-top: 4px; z-index: 30; max-height: 240px; overflow-y: auto; }
.picker .opt { min-height: 40px; padding: 10px; cursor: pointer; font-size: 14px; }
.picker .opt:hover, .picker .opt.on { background: var(--brand-50); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-50); color: var(--brand); border-radius: 14px; padding: 2px 4px 2px 10px; font-size: 13px; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 14px; padding: 0 4px; }

/* 登录 */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: radial-gradient(ellipse at 15% 5%, var(--warm-1), transparent 55%), radial-gradient(ellipse at 90% 100%, var(--warm-4), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid rgba(255,255,255,.8); border-radius: 18px; box-shadow: 0 16px 64px rgba(16,16,16,.08); padding: 32px; }
.auth-card .logo { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; margin-bottom: 28px; }
.auth-card .logo img { display: block; width: 160px; max-width: 100%; height: auto; object-fit: contain; }
.auth-card .logo .n { font-size: 21px; font-weight: 600; }
.auth-card .logo .s { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* 审批流编辑 */
.flow-node { border: 1px solid var(--control-border); border-radius: 10px; padding: 12px; background: #fff; position: relative; }
.flow-arrow { text-align: center; color: var(--faint); font-size: 18px; line-height: 1; padding: 4px 0; }
.flow-node .idx { font-size: 12px; color: var(--brand); font-weight: 600; }
.section-help { font-size: 13px; color: var(--muted); background: var(--brand-50); border-radius: 8px; padding: 10px 12px; }
.section-help ol { margin: 4px 0 0; padding-left: 18px; }
.secret-set { font-size: 12px; color: var(--ok); }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }

/* ---------- 统一可读性、焦点与触达区域 ---------- */
html { color-scheme: light; scroll-padding-top: calc(var(--top) + 16px); }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
[hidden] { display: none !important; }
button, a, input, select, textarea, summary { touch-action: manipulation; }
.num, .amt { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.strike { text-decoration: line-through; color: var(--muted); }
.lh { line-height: 1.6; }
.sub, .meta, .section-help, .tl .cmt { overflow-wrap: anywhere; }
.shell, .row, .grid > *, .doc-head > * { min-width: 0; }
.topbar h1 { min-width: 0; }
.back-btn { display: none; }
.topbar-right a { display: inline-flex; min-height: 44px; align-items: center; }
.sidebar svg, .tabbar svg, .quick svg { flex-shrink: 0; stroke-width: 1.7; }
.btn.danger:hover { background: var(--err-bg); }
.btn.ghost:hover, .icon-btn:hover { background: var(--brand-50); }
.input::placeholder { color: var(--muted); opacity: 1; }
.input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.check input { flex-shrink: 0; }
.notice.small { font-size: 13px; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; }
.stat.hl, .stat:hover { border-color: var(--control-border); }
.stat .value { text-align: right; }
.list-item .amt, .line-view .amt { white-space: nowrap; }
.line-view .main { overflow-wrap: anywhere; }
.line-card .idx { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; background: var(--brand-50); border-radius: 6px; font-size: 12px; font-weight: 600; }
.doc-head .title { font-size: 20px; font-weight: 600; }
.doc-head .t, .doc-head .title { overflow-wrap: anywhere; }
.doc-head + .kv { margin-top: 4px; }
.doc-head + .kv .v:not(.small) { white-space: nowrap; word-break: normal; font-size: 18px; font-weight: 600; margin-top: 2px; }
.tl .t { color: var(--muted); font-size: 12px; }
.flow-node .n { font-weight: 600; }
.flow-node .s { font-size: 13px; color: var(--muted); }
.section-help code { color: var(--ink-2); font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.sum-bar { flex-wrap: wrap; padding-top: 18px; }
.toast { overflow-wrap: anywhere; }
.row > select.input { flex: 1; }
.row > .btn { flex-shrink: 0; }
.upload-tile:focus-within { outline: 3px solid var(--brand); outline-offset: 3px; }
.thumb { border-color: var(--control-border); }
.empty .big { opacity: 1; }
.tl.SKIPPED::before, .tl.TRANSFERRED::before, .tl.CANCELLED::before { border-color: var(--control-border); }
@media (max-width: 900px) {
  .back-btn { display: inline-flex; }
  .card-title > a, .row > a:not(.btn), .kv a, .table a { display: inline-flex; align-items: center; min-height: 44px; }
  .input, input.input, select.input, textarea.input { font-size: 16px; min-height: 44px; }
  .btn, .btn.sm, .icon-btn { min-height: 44px; height: auto; }
  .btn { padding-block: 9px; }
  .icon-btn { min-width: 44px; }
  .check { min-height: 44px; }
  .check input { width: 20px; height: 20px; }
  .picker .opt { min-height: 44px; }
  .chip button { min-width: 44px; min-height: 44px; }
  .thumb .x { width: 44px; height: 44px; line-height: 44px; top: 0; right: 0; border-radius: 0 8px 0 8px; }
  details summary { min-height: 44px; padding-block: 11px; }
  .card { padding: 16px; }
  .line-card { padding: 12px; }
  .hero { padding: 20px 16px 16px; }
  .hero .hi { font-size: 20px; }
  .quick { gap: 6px; margin-top: 18px; }
  .quick a { font-size: 12px; padding-inline: 3px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 22px; }
  .list-item { padding: 14px; }
  .auth-card { padding: 28px 24px; }
  .tabbar a.active { font-weight: 600; }
  .tabbar a.active::before { content: ""; position: absolute; top: 0; width: 22px; height: 3px; border-radius: 0 0 3px 3px; background: currentColor; }
  .action-bar.sticky .btn { padding-inline: 12px; }
  main.has-action-bar { padding-bottom: calc(var(--tab) + var(--action-bar-height, 68px) + 40px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* 交互补强：弹窗隔离、错误定位与移动端可见区域。 */
body.modal-open { overflow: hidden; overscroll-behavior: none; }
.modal { max-height: calc(100dvh - 40px); }
.modal-b, .picker .drop { overscroll-behavior: contain; }
.input[aria-invalid="true"] { border-color: var(--err); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 14%, transparent); }
.picker .opt.on { outline: 1px solid var(--control-border); outline-offset: -1px; }
@media (max-width: 900px) {
  .input { scroll-margin-top: calc(var(--top) + 16px); scroll-margin-bottom: calc(var(--tab) + var(--action-bar-height, 68px) + 20px); }
  .picker .drop { max-height: min(240px, 40dvh); }
  .action-bar.sticky .btn { flex: 1 1 auto; }
}
@media (max-width: 600px) {
  .modal { max-height: 92dvh; }
}

/* ---------- 反馈 ---------- */
.fb-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--control-border); border-radius: 999px; background: var(--card); color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; }
.fb-btn:hover { background: var(--brand-50); }
.fb-btn:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-chip { min-height: 36px; padding: 6px 14px; border: 1px solid var(--control-border); border-radius: 999px; background: var(--card); color: var(--ink-2); font-size: 14px; cursor: pointer; }
.fb-chip[aria-checked="true"] { background: var(--brand); border-color: var(--brand); color: var(--card); font-weight: 600; }
.fb-chip:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
.fb-env { margin: 6px 0 0; padding-left: 18px; }
.fb-env li { margin: 2px 0; overflow-wrap: anywhere; }
.fb-frame-holder { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); max-width: 100%; }
.fb-frame { position: absolute; top: 0; left: 0; border: 0; background: var(--bg); transform-origin: 0 0; }
.side-foot { margin-top: 18px; padding: 10px 12px 0; border-top: 1px solid var(--line); }
.sidebar .side-foot a { min-height: 0; padding: 4px 0; margin: 0; font-size: 12px; color: var(--muted); background: none; }
.sidebar .side-foot a:hover { color: var(--ink); background: none; }
.trial .trial-row { display: flex; align-items: center; gap: 10px; }
.trial-check { flex-shrink: 0; width: 26px; height: 26px; border: 1.5px solid var(--control-border); border-radius: 8px; background: var(--card); color: var(--card); font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; }
.trial-row.done .trial-check { background: var(--ok); border-color: var(--ok); }
.trial-row.issue .trial-check { background: var(--warn); border-color: var(--warn); }
.trial-label { flex: 1; min-width: 0; color: var(--ink); font-size: 14px; }
.trial-row.done .trial-label { color: var(--muted); text-decoration: line-through; }
.changelog { margin: 0; padding-left: 18px; }
.changelog li { margin: 6px 0; line-height: 1.6; }
@media (max-width: 900px) {
  .fb-btn { height: 36px; padding: 0 10px; }
  .fb-chip { min-height: 44px; }
  .trial-check { width: 32px; height: 32px; }
}
.notice.plain { background: var(--line-2); color: var(--ink-2); border-left-color: var(--control-border); }
.fb-thread .notice { display: block; }
/* 自动迭代 */
.auto-token { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.auto-token code { flex: 1; min-width: 0; padding: 10px 12px; background: var(--line-2); border: 1px dashed var(--control-border); border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; user-select: all; }
.auto-log { max-height: 360px; overflow: auto; margin: 0; padding: 12px; background: #0f172a; color: #e2e8f0; border-radius: 8px; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.auto-steps { margin: 6px 0 0; padding-left: 20px; }
.auto-steps li { margin: 4px 0; }
.auto-steps code { background: var(--line-2); padding: 1px 5px; border-radius: 4px; }
