:root {
  --bg: #f3f5f8; --card: #fff; --ink: #18212d; --ink-2: #4a5566; --ink-3: #8a94a3;
  --line: #e3e7ed; --line-2: #eef1f5; --side: #121b28; --side-2: #1e2a3b;
  --brand: #1d5fd1; --brand-d: #174ea9; --brand-2: #e9f0fc; --brand-3: #f4f7fd;
  --red: #c8372d; --red-bg: #fdeeec; --amber: #b56a00; --amber-bg: #fdf3e1;
  --green: #18794e; --green-bg: #e5f4ec; --violet: #6b4fd8; --violet-bg: #f0ecfd;
  --up: #8a5a14; --up-bg: #f7efe2;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif; font-size: 14px; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); display: flex; min-height: 100vh; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.r, .money { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* 侧栏 */
.side { width: 224px; flex: none; background: var(--side); color: #c3ccd8; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 18px 24px; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, #2f74ea, #1b4fb0); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 17px; }
.brand-name { color: #fff; font-weight: 600; font-size: 14.5px; }
.brand-co { font-size: 11.5px; color: #7f8ca0; margin-top: 3px; }
.side nav { display: flex; flex-direction: column; padding: 0 10px; gap: 2px; }
.side nav .grp { font-size: 11.5px; color: #627086; padding: 16px 12px 6px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: #c3ccd8; }
.side nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; flex: none; }
.side nav a:hover { background: var(--side-2); color: #fff; }
.side nav a.on { background: var(--brand); color: #fff; }
.side nav a .ai-dot { margin-left: auto; font-size: 10.5px; padding: 1px 6px; border-radius: 4px; background: rgba(255,255,255,.14); color: #fff; }
.side-foot { margin-top: auto; padding: 16px 18px; border-top: 1px solid #223044; display: flex; align-items: center; justify-content: space-between; }
.me { font-size: 13px; color: #e3e8ef; }
.me small { display: block; font-size: 11.5px; color: #7f8ca0; margin-top: 2px; }
.link-btn { background: none; border: 0; color: #8d9ab0; cursor: pointer; font-size: 12.5px; }
.link-btn:hover { color: #fff; }

/* 主区 */
main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; margin: 0; font-weight: 600; }
.page-head .sub { color: var(--ink-3); margin-top: 6px; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.crumb a { color: var(--ink-3); } .crumb a:hover { color: var(--brand); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); min-height: 54px; }
.card-h h2 { font-size: 15px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-h h2 svg { width: 17px; height: 17px; fill: none; stroke: var(--violet); stroke-width: 1.7; }
.card-h .hint { color: var(--ink-3); font-size: 12px; }
.card-b { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mt { margin-top: 16px; }
.muted { color: var(--ink-3); } .small { font-size: 12px; }

.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-height: 112px; }
.kpi-label { color: var(--ink-2); font-size: 13px; }
.kpi-val { font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-val small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }
.kpi-foot { font-size: 12px; color: var(--ink-3); margin-top: auto; }
.kpi-foot b { font-weight: 600; color: var(--ink-2); } .kpi-foot .bad { color: var(--red); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13.5px; white-space: nowrap; color: var(--ink); }
.btn:hover { border-color: #c8ced7; background: #fafbfc; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); }
.btn.ai { background: linear-gradient(135deg, #6b4fd8, #1d5fd1); border: 0; color: #fff; }
.btn.danger { color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-2); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag.blue { background: var(--brand-2); color: var(--brand); } .tag.up { background: var(--up-bg); color: var(--up); }
.tag.green { background: var(--green-bg); color: var(--green); } .tag.red { background: var(--red-bg); color: var(--red); }
.tag.amber { background: var(--amber-bg); color: var(--amber); } .tag.gray { background: #eff1f4; color: var(--ink-2); }
.tag.violet { background: var(--violet-bg); color: var(--violet); }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12px; padding: 10px 12px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; } .tbl .c { text-align: center; }
.tbl tbody tr.link { cursor: pointer; } .tbl tbody tr.link:hover td { background: #f6f9fe; }
.tbl tfoot td { font-weight: 600; background: #fafbfc; border-top: 1px solid var(--line); }
.tbl.nowrap td { white-space: nowrap; }
.tbl tr.bad td { background: #fff8f7; }

/* 流程节点 */
.flow { display: flex; align-items: center; gap: 3px; }
.flow i { width: 9px; height: 9px; border-radius: 50%; background: #dfe3ea; display: block; }
.flow i.ok { background: var(--green); }
.flow i.cur { background: #fff; box-shadow: inset 0 0 0 2px var(--brand); }
.stepper { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); padding: 16px 18px; }
.st { position: relative; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.st::before { content: ""; position: absolute; top: 12px; left: -50%; right: 50%; height: 2px; background: #e3e7ed; }
.st:first-child::before { display: none; }
.st.ok::before, .st.cur::before { background: var(--green); }
.st b { position: relative; display: grid; place-items: center; width: 26px; height: 26px; margin: 0 auto 7px; border-radius: 50%; background: #fff; border: 2px solid #dfe3ea; font-size: 12px; font-weight: 600; }
.st.ok { color: var(--ink-2); } .st.ok b { background: var(--green); border-color: var(--green); color: #fff; }
.st.cur { color: var(--brand); font-weight: 600; } .st.cur b { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-2); }

/* 链条 */
.chain { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, .8fr) 44px minmax(0, 1fr); align-items: stretch; padding: 18px; }
.node { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fcfcfd; min-width: 0; }
.node.us { background: var(--brand-3); border-color: #d3e0f7; }
.node-k { font-size: 11.5px; color: var(--ink-3); }
.node-n { font-weight: 600; margin: 4px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-v { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.arrow { display: grid; place-items: center; color: #a9b3c1; }
.arrow svg { width: 30px; height: 14px; }

/* 待办 */
.alerts { list-style: none; margin: 0; padding: 0; }
.alert { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.alert:last-child { border-bottom: 0; } .alert:hover { background: #f8fafc; }
.alert-text { font-size: 13.5px; }
.alert-meta { font-size: 12px; color: var(--ink-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-amt { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.alert-amt div + div { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 27px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { margin-left: 4px; opacity: .7; }
.empty { padding: 34px 18px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty.bad { color: var(--red); background: #fffafa; }

.notice { margin: 14px 18px 0; padding: 11px 14px; border-radius: 8px; font-size: 13px; line-height: 1.65; display: flex; gap: 10px; }
.notice.red { background: var(--red-bg); color: #8f2119; } .notice.amber { background: var(--amber-bg); color: #6e4300; }
.notice.green { background: var(--green-bg); color: #0f5a38; } .notice.blue { background: var(--brand-2); color: #173f87; }
.notice b { font-weight: 600; } .notice ul { margin: 4px 0 0; padding-left: 18px; }

.toolbar { display: flex; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; background: #f0f2f5; border-radius: 8px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: none; height: 28px; padding: 0 12px; border-radius: 6px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 500; }
.input, select.input, textarea.input { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; outline: none; width: 100%; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 95, 209, .12); }
.search { width: 260px; }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }

.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; }
.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.fgrid .w2 { grid-column: span 2; } .fgrid .w3 { grid-column: 1 / -1; }
.form-sec { padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.form-sec:last-child { border-bottom: 0; }
.form-sec h3 { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 12px; display: flex; justify-content: space-between; align-items: center; }

.lines-edit { width: 100%; border-collapse: collapse; table-layout: fixed; }
.lines-edit th { font-size: 12px; font-weight: 500; color: var(--ink-3); text-align: left; padding: 0 3px 6px; }
.lines-edit td { padding: 3px; }
.lines-edit .input { height: 31px; padding: 0 7px; font-size: 13px; }
.lines-edit td.r .input { text-align: right; }
.lines-edit tr.diff td.aw .input { border-color: var(--violet); background: #faf8ff; }
.icon-btn { width: 26px; height: 26px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--ink-3); display: inline-grid; place-items: center; vertical-align: middle; }
.icon-btn:hover { background: #f1f2f4; color: var(--red); }

/* 详情 */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.detail > .grid { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 12px 18px; font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.meta-row span b { color: var(--ink-3); font-weight: 400; margin-right: 6px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 9px 12px; font-size: 13.5px; margin: 0; align-items: center; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.kv .total { border-top: 1px solid var(--line); padding-top: 10px; font-weight: 600; font-size: 15px; }
.prog-top { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; gap: 8px; }
.track { height: 7px; background: #edf0f4; border-radius: 4px; overflow: hidden; }
.fill { height: 100%; background: var(--brand); border-radius: 4px; } .fill.full { background: var(--green); } .fill.late { background: var(--red); }
.plist { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; }
.plist li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); gap: 8px; }
.plist .x { opacity: 0; } .plist li:hover .x { opacity: 1; }
.timeline { list-style: none; margin: 0; padding: 6px 18px 12px; max-height: 420px; overflow: auto; }
.timeline li { position: relative; padding: 8px 0 8px 18px; font-size: 12.5px; border-left: 1px solid var(--line); margin-left: 4px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 12px; width: 9px; height: 9px; border-radius: 50%; background: #c9d1dc; }
.timeline li.删除::before { background: var(--red); } .timeline li.新增::before { background: var(--green); } .timeline li.修改::before { background: var(--amber); }
.timeline .who { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.weigh-advice { font-size: 12.5px; line-height: 1.6; margin-top: 4px; }
.basis { font-size: 12px; color: var(--ink-3); }
.files { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.files a { display: block; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #f6f7f9; aspect-ratio: 3/4; }
.files img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.files .fname { font-size: 11px; color: var(--ink-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* AI 录入 */
.drop { border: 1.5px dashed #c3cbd8; border-radius: 12px; background: #fafbfd; padding: 46px 20px; text-align: center; cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--violet); background: var(--violet-bg); }
.drop-icon { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 14px; background: linear-gradient(135deg, #6b4fd8, #1d5fd1); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(80, 70, 220, .25); }
.drop-icon svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.drop-title { font-size: 16px; font-weight: 500; }
.drop-sub { color: var(--ink-3); margin-top: 6px; font-size: 13px; }
.samples { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.sample { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; text-align: left; }
.sample:hover { border-color: var(--violet); box-shadow: 0 2px 8px rgba(107, 79, 216, .12); }
.sample-thumb { height: 120px; border-radius: 6px; border: 1px solid var(--line-2); background: #f5f6f8 center top/cover no-repeat; display: grid; place-items: center; color: var(--ink-3); font-size: 12px; }
.sample-name { font-size: 12.5px; font-weight: 500; line-height: 1.4; }

.scan-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.scan { position: relative; background: #e8ebf0; border-radius: var(--radius); overflow: hidden; min-height: 560px; display: grid; place-items: center; padding: 24px; }
.scan img { max-width: 100%; max-height: 74vh; display: block; box-shadow: 0 4px 18px rgba(0,0,0,.15); border-radius: 2px; }
.scan-box { position: relative; overflow: visible; }
.scan-clip { position: absolute; inset: 0; overflow: hidden; }
.scan-line { position: absolute; left: 0; right: 0; height: 70px; top: 0; background: linear-gradient(180deg, rgba(107, 79, 216, 0) 0%, rgba(107, 79, 216, .18) 70%, rgba(107, 79, 216, .9) 100%); animation: scan 2.2s ease-in-out infinite; pointer-events: none; }
.scan-line::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #8f7cff; box-shadow: 0 0 12px 2px rgba(143, 124, 255, .9); }
@keyframes scan { 0% { top: -70px; } 100% { top: 100%; } }
.corner { position: absolute; width: 22px; height: 22px; border: 3px solid #7c66f0; }
.corner.tl { top: -8px; left: -8px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.corner.tr { top: -8px; right: -8px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.corner.bl { bottom: -8px; left: -8px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.corner.br { bottom: -8px; right: -8px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.pdf-card { width: 300px; height: 380px; background: #fff; border-radius: 4px; box-shadow: 0 4px 18px rgba(0,0,0,.15); display: grid; place-items: center; color: var(--ink-3); }
.steps-ai { list-style: none; margin: 0; padding: 8px 18px 16px; }
.steps-ai li { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 13.5px; color: var(--ink-3); }
.steps-ai li i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #dfe3ea; flex: none; display: grid; place-items: center; font-style: normal; font-size: 11px; }
.steps-ai li.on { color: var(--ink); } .steps-ai li.on i { border-color: var(--violet); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps-ai li.ok { color: var(--ink-2); } .steps-ai li.ok i { background: var(--green); border-color: var(--green); color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.elapsed { font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--violet); }
.ai-review { display: grid; grid-template-columns: minmax(0, .68fr) minmax(0, 1.32fr); gap: 16px; align-items: start; }
.viewer { position: sticky; top: 16px; }
.viewer-box { height: calc(100vh - 190px); min-height: 460px; overflow: auto; background: #e8ebf0; border-radius: 0 0 var(--radius) var(--radius); }
.viewer-box img { display: block; margin: 12px auto; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.ro { display: flex; align-items: center; background: #fafbfc; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cmp { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-top: 12px; }
.cmp .side-v { font-size: 12px; color: var(--ink-3); }
.cmp .side-v b { display: block; font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 3px; }
.cmp .eq { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; }
.cmp .eq.ok { background: var(--green-bg); color: var(--green); } .cmp .eq.bad { background: var(--red-bg); color: var(--red); }
.fade-in { animation: fadein .35s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; margin-top: 8px; }
.choice:first-of-type { margin-top: 0; }
.choice.on { border-color: var(--brand); background: var(--brand-3); }
.choice input { margin-top: 3px; }
.choice-t { font-weight: 500; font-size: 13.5px; } .choice-s { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }
.sticky-foot { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-radius: 0 0 var(--radius) var(--radius); z-index: 2; }

/* 图表 */
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
svg.chart text { font-size: 11px; fill: var(--ink-3); font-family: inherit; }
svg.chart .gl { stroke: var(--line-2); }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(15, 22, 33, .45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 12px; width: 620px; max-width: 100%; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { width: 1100px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; }
.modal-h h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-b { padding: 0; overflow: auto; }
.modal-b.pad { padding: 18px 20px; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }
.mask.img { cursor: zoom-out; } .mask.img img { max-width: 94vw; max-height: 94vh; border-radius: 4px; }

#toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: .2s; z-index: 70; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); } #toast.err { background: var(--red); }

/* 登录 */
.login { width: 100%; min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 20% 0%, #e3ecfb 0%, transparent 60%), var(--bg); }
.login-card { width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(16, 24, 40, .08); padding: 30px 30px 26px; }
.login-card h1 { font-size: 20px; margin: 16px 0 4px; } .login-card p { margin: 0 0 22px; color: var(--ink-3); font-size: 13px; }
.login-card .field { margin-bottom: 14px; } .login-card .input { height: 40px; }
.note { font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }

@media (max-width: 1380px) {
  .detail, .ai-review { grid-template-columns: minmax(0, 1fr); }
  .viewer { position: static; } .viewer-box { height: 520px; min-height: 0; }
  .samples { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .scan-wrap { grid-template-columns: 1fr; } }
.clip { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl.dense th, .tbl.dense td { padding-left: 8px; padding-right: 8px; } .tbl.dense th:first-child, .tbl.dense td:first-child { padding-left: 16px; } .tbl.dense th:last-child, .tbl.dense td:last-child { padding-right: 16px; }
.pl-l { min-width: 0; flex: 1; } .pl-l .clip { max-width: 190px; }
.pl-s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.pl-r { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.lines-edit select.input { padding: 0 0 0 6px; }
.lines-edit .input { padding: 0 6px; }

/* 车牌、按车磅单 */
.plate { display: inline-block; font: 600 12px/1 "Consolas", "Microsoft YaHei", monospace; letter-spacing: .5px; padding: 4px 6px; border-radius: 4px;
  background: #eaf1fb; color: #1f4f8f; border: 1px solid #c9daf2; white-space: nowrap; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg2 .choice { margin-top: 0; }
.tk-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.tk { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: #fafbfc; min-height: 74px; min-width: 0; }
.tk-k { font-size: 12px; color: var(--ink-3); }
.tk-v { font-size: 17px; font-weight: 600; margin-top: 3px; }
.tk-s { font-size: 12px; color: var(--ink-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk.ok { border-color: #bfe3cf; background: var(--green-bg); } .tk.ok .tk-s { color: var(--green); }
.tk.warn { border-color: #f1d6a6; background: var(--amber-bg); } .tk.warn .tk-s { color: var(--amber); }
.tk.bad { border-color: #f1c4bf; background: var(--red-bg); } .tk.bad .tk-s { color: var(--red); }

/* 工作台：分级提醒 */
.lv-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px 18px 4px; }
.lv { text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px 10px; background: #fff; cursor: pointer; font: inherit; color: inherit; position: relative; overflow: hidden; }
.lv::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.lv.danger::before { background: var(--red); } .lv.warn::before { background: #e0a43a; } .lv.info::before { background: #8a94a3; }
.lv:hover { background: #fafbfc; } .lv.on { box-shadow: 0 0 0 2px var(--ink) inset; }
.lv-top { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.lv-sub { font-weight: 400; color: var(--ink-3); font-size: 12px; margin-left: auto; }
.lv-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.danger .lv-dot { background: var(--red); } .warn .lv-dot { background: #e0a43a; } .info .lv-dot { background: #8a94a3; }
.lv-n { font-size: 24px; font-weight: 600; margin-top: 6px; } .lv-n small { font-size: 12px; color: var(--ink-3); margin-left: 2px; font-weight: 500; }
.lv.danger .lv-n { color: var(--red); }
.lv-amt { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.al-group { margin-top: 8px; }
.al-gh { display: flex; align-items: center; gap: 8px; padding: 8px 18px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: #fafbfc; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.al-gh .muted { font-weight: 400; margin-left: auto; }
.alert.v2 { grid-template-columns: 32px 1fr auto 78px; padding: 11px 18px; position: relative; }
.alert.v2::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; }
.alert.v2.danger::before { background: var(--red); } .alert.v2.warn::before { background: #e0a43a; } .alert.v2.info::before { background: #c3c9d2; }
.al-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; font-weight: 600; }
.alert.danger .al-ic { background: var(--red-bg); color: var(--red); } .alert.warn .al-ic { background: var(--amber-bg); color: var(--amber); } .alert.info .al-ic { background: var(--line-2); color: var(--ink-2); }
.al-go { font-size: 12.5px; color: var(--brand); text-align: right; white-space: nowrap; opacity: .55; }
.alert.v2:hover .al-go { opacity: 1; }
/* 应收账龄 */
.aging-top { font-size: 22px; font-weight: 600; } .aging-top small { font-size: 12px; color: var(--ink-3); margin-left: 3px; font-weight: 500; }
.aging-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin: 10px 0 12px; background: var(--line-2); }
.aging-bar i { display: block; min-width: 6px; }
.aging-leg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.aging-leg div { display: grid; grid-template-columns: 1fr auto 36px; align-items: center; font-size: 12.5px; gap: 6px; }
.aging-leg span { color: var(--ink-2); white-space: nowrap; } .aging-leg span i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.aging-leg em { font-style: normal; color: var(--ink-3); font-size: 11.5px; text-align: right; }
.debt-h { font-size: 12px; color: var(--ink-3); margin: 16px 0 6px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.debts { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.debts li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 12.5px; }
.debt-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.debt-bar { height: 7px; background: var(--line-2); border-radius: 4px; overflow: hidden; } .debt-bar i { display: block; height: 100%; border-radius: 4px; }
.debt-v { text-align: right; white-space: nowrap; min-width: 128px; } .debt-v span { font-size: 11px; color: var(--ink-3); margin-left: 6px; }

.mini { display: flex; align-items: center; gap: 8px; } .mini .track { flex: 1; height: 6px; } .mini span { font-size: 11.5px; color: var(--ink-3); width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

.lines-scroll { overflow-x: auto; }
.lines-scroll .lines-edit { min-width: 860px; }

/* ======================================================================
   主题层（2026-12-03）：参考“AI 发票识别”案例——暖白纸面、近黑文字、
   大圆角白卡、等宽小标题、斜纹进度。主色按账号区分：录入员蓝、管理员粉。
   ====================================================================== */
:root {
  --bg: #f4f3f0; --card: #fff; --ink: #17181b; --ink-2: #55585f; --ink-3: #93959b;
  --line: #e6e4df; --line-2: #efeeea; --side: #eceae5; --side-2: #e2e0da;
  --green: #1d8a5a; --green-bg: #e6f3ec; --amber: #a8700d; --amber-bg: #fbf1de; --amber-line: #ecd3a2;
  --red: #c4372f; --red-bg: #fbebe9;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 10px 28px -16px rgba(20, 20, 20, .16);
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root, :root[data-role="user"] {
  --brand: #2f6fe4; --brand-d: #2158c0; --brand-2: #e7eefc; --brand-3: #f3f7fe; --brand-ring: rgba(47, 111, 228, .16);
}
:root[data-role="admin"] {
  --brand: #d84a86; --brand-d: #b9366d; --brand-2: #fbe7ef; --brand-3: #fdf4f8; --brand-ring: rgba(216, 74, 134, .16);
}
body {
  background-color: var(--bg);
  background-image: repeating-linear-gradient(180deg, transparent 0 31px, rgba(60, 50, 30, .045) 31px 32px);
}

/* 侧栏：浅色纸面，当前项为深色胶囊、图标用主色 */
.side { background: var(--side); color: var(--ink-2); border-right: 1px solid var(--line); }
.brand-mark { background: var(--brand); border-radius: 11px; box-shadow: 0 6px 14px -6px var(--brand); }
.brand-name { color: var(--ink); }
.brand-co { color: var(--ink-3); }
.side nav .grp { color: var(--ink-3); font: 500 10.5px/1 var(--mono); letter-spacing: .12em; padding: 18px 12px 8px; }
.side nav a { color: var(--ink-2); border-radius: 10px; transition: background .2s, color .2s; }
.side nav a:hover { background: var(--side-2); color: var(--ink); }
.side nav a.on { background: var(--ink); color: #fff; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .5); }
.side nav a.on svg { stroke: var(--brand); filter: brightness(1.3); }
.side nav a .ai-dot { background: var(--brand-2); color: var(--brand); font-weight: 600; }
.side nav a.on .ai-dot { background: var(--brand); color: #fff; }
.side-foot { border-top: 1px solid var(--line); }
.me { color: var(--ink); } .me small { color: var(--ink-3); }
.role-chip { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-right: 6px; vertical-align: 1px; }
.link-btn { color: var(--ink-3); } .link-btn:hover { color: var(--ink); }

/* 页面标题 */
main { padding: 30px 34px 70px; }
.page-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.crumb { font: 500 11.5px/1 var(--mono); letter-spacing: .06em; }

/* 卡片 */
.card { border: 1px solid rgba(30, 25, 15, .07); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { border-bottom: 1px solid var(--line-2); padding: 16px 20px; }
.card-h h2 { font-size: 15px; }
.card-h .hint { font: 11px/1.3 var(--mono); letter-spacing: .04em; color: var(--ink-3); }
.card-b { padding: 18px 20px; }
.grid { gap: 18px; } .mt { margin-top: 18px; }
.card > .tbl-wrap:last-child, .card > .tbl-wrap:last-child table { border-radius: 0 0 var(--radius) var(--radius); }

/* KPI：等宽小标题 + 大数字；第一张为深色重点卡 */
.kpi { padding: 18px 20px 16px; min-height: 124px; position: relative; overflow: hidden; }
.kpi-label { font: 500 11px/1.2 var(--mono); letter-spacing: .1em; color: var(--ink-3); }
.kpi-val { font-size: 31px; font-weight: 500; letter-spacing: -.025em; line-height: 1.1; margin-top: 4px; }
.kpi-val small { font-size: 13px; letter-spacing: 0; }
.kpi.hero { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi.hero .kpi-label { color: rgba(255, 255, 255, .55); }
.kpi.hero .kpi-val small, .kpi.hero .kpi-foot { color: rgba(255, 255, 255, .62); }
.kpi.hero .kpi-foot b { color: #fff; } .kpi.hero .kpi-foot .bad { color: #ff9c92; }
.kpi.hero::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); pointer-events: none; }
.ul-g { text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 7px; }

/* 按钮 */
.btn { height: 36px; border-radius: 10px; border-color: var(--line); transition: background .2s, border-color .2s, box-shadow .2s, transform .15s var(--ease); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { box-shadow: 0 6px 16px -8px var(--brand); }
.btn.ai { background: linear-gradient(135deg, #7b5ce6, var(--brand)); box-shadow: 0 6px 16px -8px var(--brand); }
.btn.ghost:hover { background: var(--brand-2); }
.btn.sm { height: 29px; border-radius: 8px; }
.input, select.input, textarea.input { border-radius: 10px; }
.input:focus { box-shadow: 0 0 0 3px var(--brand-ring); }

/* 标签改为胶囊 */
.tag { height: 23px; padding: 0 10px; border-radius: 999px; }
.tag.amber { box-shadow: inset 0 0 0 1px var(--amber-line); }
.tag.green { box-shadow: inset 0 0 0 1px #bfe0cd; }
.tag.red { box-shadow: inset 0 0 0 1px #f0c7c2; }
.chip { height: 28px; border-radius: 999px; transition: .2s; }
.chip.on { background: var(--ink); border-color: var(--ink); }
.seg { background: var(--line-2); border-radius: 11px; }
.seg button { border-radius: 8px; transition: .2s; }

/* 表格 */
.tbl th { background: transparent; font: 500 11px/1.2 var(--mono); letter-spacing: .06em; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.tbl tbody tr.link:hover td { background: var(--brand-3); }
.tbl tfoot td { background: #faf9f7; }
.tbl tr.bad td { background: #fdf6f5; }

/* 斜纹进度：进行中为主色斜纹，收齐为绿色斜纹，超期为红色 */
.track { height: 8px; background: var(--line-2); border-radius: 999px; }
.fill { border-radius: 999px; background: repeating-linear-gradient(-45deg, var(--brand) 0 4px, color-mix(in srgb, var(--brand) 50%, #fff) 4px 7px); }
.fill.full { background: repeating-linear-gradient(-45deg, var(--green) 0 4px, color-mix(in srgb, var(--green) 45%, #fff) 4px 7px); }
.fill.late { background: var(--red); }
.aging-bar { height: 14px; border-radius: 999px; gap: 3px; background: transparent; }
.aging-bar i { border-radius: 4px; }
.aging-bar i.hz { background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0) 0 4px, rgba(255, 255, 255, .45) 4px 7px) !important; }
.aging-top { font-size: 30px; font-weight: 500; letter-spacing: -.02em; }
.debt-bar { height: 8px; border-radius: 999px; } .debt-bar i { border-radius: 999px; }

/* 分级提醒 */
.lv-tiles { gap: 12px; padding: 16px 20px 6px; }
.lv { border-radius: 14px; padding: 13px 15px 12px; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.lv::before { display: none; }
.lv:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .3); }
.lv.on { box-shadow: 0 0 0 2px var(--ink) inset; }
.lv.danger { background: linear-gradient(180deg, #fff 0%, #fdf5f4 100%); border-color: #f2d3cf; }
.lv.warn { background: linear-gradient(180deg, #fff 0%, #fdf8ee 100%); border-color: var(--amber-line); }
.lv-n { font-size: 30px; font-weight: 500; letter-spacing: -.02em; }
.lv.warn .lv-n { color: var(--amber); }
.al-gh { background: transparent; font: 500 11px/1 var(--mono); letter-spacing: .08em; color: var(--ink-3); border-top: 1px solid var(--line-2); padding: 14px 20px 8px; border-bottom: 0; }
.alert.v2 { padding: 12px 20px; transition: background .2s; }
.alert.v2::before { display: none; }
.alert:hover { background: var(--brand-3); }
.al-ic { border-radius: 10px; }
.al-go { color: var(--brand); font-weight: 500; transition: opacity .2s, transform .2s var(--ease); }
.alert.v2:hover .al-go { transform: translateX(3px); }

/* 详情：链条、步骤、需要处理卡 */
.node { border-radius: 14px; background: #faf9f7; }
.node.us { background: var(--brand-3); border-color: color-mix(in srgb, var(--brand) 28%, #fff); }
.node-k { font: 500 10.5px/1.2 var(--mono); letter-spacing: .08em; }
.node-n { font-size: 15px; }
.st.ok b { background: var(--ink); border-color: var(--ink); }
.st.ok::before, .st.cur::before { background: var(--ink); }
.st.cur { color: var(--brand); } .st.cur b { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 5px var(--brand-ring); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px transparent; } }
.call-list { display: grid; gap: 12px; }
.call { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 16px; align-items: start; }
.call.warn { border-color: var(--amber-line); background: linear-gradient(180deg, #fff 55%, #fefaf2 100%); }
.call.danger { border-color: #f0cdc8; background: linear-gradient(180deg, #fff 55%, #fdf6f5 100%); }
.call-k { font: 500 11px/1 var(--mono); letter-spacing: .1em; color: var(--amber); }
.call.danger .call-k { color: var(--red); } .call.info .call-k { color: var(--ink-3); }
.call-t { font-size: 16px; font-weight: 500; letter-spacing: -.01em; line-height: 1.45; }
.call-pill { grid-row: 1 / span 2; grid-column: 2; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.call.warn .call-pill { background: var(--amber-bg); color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber-line); }
.call.danger .call-pill { background: var(--red-bg); color: var(--red); box-shadow: inset 0 0 0 1px #f0c7c2; }
.call.info .call-pill { background: var(--line-2); color: var(--ink-2); }
.call-s { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.plate { border-radius: 6px; background: var(--brand-3); color: var(--brand-d); border-color: color-mix(in srgb, var(--brand) 30%, #fff); font-family: var(--mono); }

/* AI 录入 */
.drop { border-radius: 18px; background: #fbfaf8; border-color: #d6d3cc; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-3); }
.drop-icon { background: linear-gradient(135deg, #7b5ce6, var(--brand)); box-shadow: 0 10px 22px -10px var(--brand); }
.sample { border-radius: 14px; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.sample:hover { border-color: var(--brand); box-shadow: 0 12px 24px -16px rgba(0, 0, 0, .35); transform: translateY(-3px); }
.sample-thumb { border-radius: 9px; }
.scan, .viewer-box { background: #e9e7e2; }
.choice { border-radius: 12px; transition: border-color .2s, background .2s; }
.cmp { border-radius: 14px; }
.elapsed { color: var(--brand); }

/* 弹窗与提示 */
.mask { background: rgba(23, 24, 27, .38); backdrop-filter: blur(3px); animation: fadeOnly .2s ease both; }
.modal { border-radius: 18px; animation: pop .32s var(--ease) both; }
@keyframes fadeOnly { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
#toast { border-radius: 999px; padding: 10px 20px; box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .45); }

/* 登录 */
.login { background: transparent; }
.login-card { border-radius: 20px; box-shadow: 0 24px 60px -28px rgba(20, 20, 20, .35); animation: pop .5s var(--ease) both; }
.login-card .brand-mark { background: var(--ink); box-shadow: none; }
.login-card .btn.primary { background: var(--ink); border-color: var(--ink); box-shadow: none; }

/* 动效：卡片依次浮入、数字滚动（JS）、进度和柱条生长 */
.rise { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.fill, .debt-bar i { transform-origin: left; animation: growX .9s var(--ease) both; animation-delay: .25s; }
.aging-bar { clip-path: inset(0 100% 0 0 round 999px); animation: reveal 1s var(--ease) .3s forwards; }
@keyframes growX { from { transform: scaleX(0); } }
@keyframes reveal { to { clip-path: inset(0 0 0 0 round 999px); } }
svg.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: growY .8s var(--ease) both; animation-delay: calc(var(--k, 0) * 70ms + 200ms); }
@keyframes growY { from { transform: scaleY(0); } }
svg.chart .line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.2s var(--ease) .6s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
svg.chart .dot { transform-box: fill-box; transform-origin: center; animation: dotIn .4s var(--ease) both; animation-delay: calc(var(--k, 0) * 90ms + 800ms); }
@keyframes dotIn { from { opacity: 0; transform: scale(.3); } }
svg.chart text { font-family: var(--mono); font-size: 10.5px; }
@media (prefers-reduced-motion: reduce) {
  .rise, .fill, .debt-bar i, svg.chart .bar, svg.chart .dot, .modal, .mask, .login-card, .st.cur b { animation: none !important; }
  .aging-bar { animation: none; clip-path: none; } svg.chart .line { animation: none; stroke-dashoffset: 0; }
}

.card-h { flex-wrap: wrap; row-gap: 10px; }
.card-h h2 { white-space: nowrap; }
.anim-done .fill, .anim-done .debt-bar i, .anim-done svg.chart .bar, .anim-done svg.chart .dot { animation: none; }
.anim-done .aging-bar { animation: none; clip-path: none; }
.anim-done svg.chart .line { animation: none; stroke-dashoffset: 0; }
@media (max-width: 1320px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.split { grid-template-columns: minmax(0, 1fr) !important; }
  .lv-sub { display: none; }
}

/* ======================================================================
   主题层二（2026-12-03）：管理员整套粉色（背景、侧栏、卡片阴影、重点卡），
   录入员保持蓝色；补手机和窄屏布局。
   ====================================================================== */
:root { --soft: #faf9f7; --well: #e9e7e2; --mask: rgba(23, 24, 27, .38); --hero: var(--ink); --pill: 10px; }
.node, .tbl tfoot td, .ro, .tk, .drop { background: var(--soft); }
.scan, .viewer-box { background: var(--well); }
.mask { background: var(--mask); }
::selection { background: var(--brand-2); }

:root[data-role="admin"] {
  --bg: #fdedf3; --card: #fff; --ink: #43212f; --ink-2: #7b5868; --ink-3: #b3909f;
  --line: #f5d6e2; --line-2: #fbe9f0; --side: #fbdde8; --side-2: #f8cddc;
  --soft: #fff6f9; --well: #f9e2eb; --mask: rgba(67, 33, 47, .34);
  --brand: #e85a98; --brand-d: #cf3f80; --brand-2: #fde2ed; --brand-3: #fff3f8; --brand-ring: rgba(232, 90, 152, .2);
  --radius: 22px; --pill: 999px;
  --shadow: 0 1px 2px rgba(214, 74, 134, .06), 0 16px 32px -20px rgba(214, 74, 134, .42);
  --hero: linear-gradient(135deg, #f790b9 0%, #e85a98 55%, #d7488c 100%);
}
:root[data-role="admin"] body {
  background-color: var(--bg);
  background-image:
    radial-gradient(700px 420px at 100% 0%, rgba(255, 214, 196, .75), transparent 70%),
    radial-gradient(620px 460px at 18% 100%, rgba(232, 214, 255, .7), transparent 70%),
    radial-gradient(520px 320px at 45% 0%, rgba(255, 198, 222, .55), transparent 70%);
  background-attachment: fixed;
}
/* 右下角一朵淡淡的樱花，只作装饰 */
:root[data-role="admin"] body::after {
  content: ""; position: fixed; right: -70px; bottom: -70px; width: 300px; height: 300px; pointer-events: none; z-index: 0; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-50 -50 100 100'%3E%3Cg fill='%23f7a8c8'%3E%3Cpath id='p' d='M0 -6C-13 -20 -11 -40 0 -46C11 -40 13 -20 0 -6Z'/%3E%3Cuse href='%23p' transform='rotate(72)'/%3E%3Cuse href='%23p' transform='rotate(144)'/%3E%3Cuse href='%23p' transform='rotate(216)'/%3E%3Cuse href='%23p' transform='rotate(288)'/%3E%3C/g%3E%3Ccircle r='5' fill='%23fff3c4'/%3E%3C/svg%3E") center/contain no-repeat;
}
:root[data-role="admin"] main, :root[data-role="admin"] .side { position: relative; z-index: 1; }
:root[data-role="admin"] .side { position: sticky; background: linear-gradient(180deg, #fce3ec 0%, #fbd6e4 100%); border-right-color: #f6cbdb; }
:root[data-role="admin"] .side nav a.on { background: linear-gradient(135deg, #f480b0, #e2508f); color: #fff; box-shadow: 0 8px 18px -8px rgba(226, 80, 143, .75); }
:root[data-role="admin"] .side nav a.on svg { stroke: #fff; filter: none; }
:root[data-role="admin"] .side nav a.on .ai-dot { background: rgba(255, 255, 255, .28); color: #fff; }
:root[data-role="admin"] .side nav a:hover:not(.on) { background: rgba(255, 255, 255, .6); }
:root[data-role="admin"] .brand-mark { background: linear-gradient(135deg, #f790b9, #e2508f); }
:root[data-role="admin"] .card, :root[data-role="admin"] .call { border-color: #f8dbe6; }
:root[data-role="admin"] .chip.on { background: var(--brand); border-color: var(--brand); }
:root[data-role="admin"] .st.ok b { background: var(--brand); border-color: var(--brand); }
:root[data-role="admin"] .st.ok::before, :root[data-role="admin"] .st.cur::before { background: var(--brand); }
:root[data-role="admin"] .lv.on { box-shadow: 0 0 0 2px var(--brand) inset; }
:root[data-role="admin"] .lv.info { background: linear-gradient(180deg, #fff 0%, #fff5f9 100%); }
:root[data-role="admin"] .btn.primary { background: linear-gradient(135deg, #f27aac, #e2508f); border-color: transparent; }
:root[data-role="admin"] .btn.primary:hover { background: linear-gradient(135deg, #ee6ba2, #d64685); }
:root[data-role="admin"] .btn.ai { background: linear-gradient(135deg, #a98bf0, #f27aac); }
:root[data-role="admin"] .tag.gray { background: #f9eaf0; color: var(--ink-2); }
:root[data-role="admin"] .tag.blue { background: var(--brand-2); color: var(--brand-d); }
:root[data-role="admin"] .tbl tbody tr.link:hover td, :root[data-role="admin"] .alert:hover { background: #fff5f9; }
:root[data-role="admin"] .login-card .brand-mark { background: linear-gradient(135deg, #f790b9, #e2508f); }
:root[data-role="admin"] .login-card .btn.primary { background: linear-gradient(135deg, #f27aac, #e2508f); border-color: transparent; box-shadow: 0 10px 20px -10px #e2508f; }
:root[data-role="admin"] *::-webkit-scrollbar { width: 10px; height: 10px; }
:root[data-role="admin"] *::-webkit-scrollbar-thumb { background: #f3bfd3; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
:root[data-role="admin"] *::-webkit-scrollbar-track { background: transparent; }

/* 重点卡：录入员为深色，管理员为玫瑰渐变加柔光圆点 */
.kpi.hero { background: var(--hero); border-color: transparent; }
:root[data-role="admin"] .kpi.hero { box-shadow: 0 18px 34px -18px rgba(226, 80, 143, .8); }
:root[data-role="admin"] .kpi.hero .kpi-label { color: rgba(255, 255, 255, .8); }
:root[data-role="admin"] .kpi.hero .kpi-val small, :root[data-role="admin"] .kpi.hero .kpi-foot { color: rgba(255, 255, 255, .85); }
:root[data-role="admin"] .kpi.hero .kpi-foot .bad { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .6); text-underline-offset: 4px; }
:root[data-role="admin"] .kpi.hero::after { left: auto; right: -30px; top: -40px; bottom: auto; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 65%); }
:root[data-role="admin"] .kpi.hero::before { content: ""; position: absolute; right: 70px; bottom: -34px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 65%); pointer-events: none; }

/* 圆角随主题：管理员用胶囊形按钮和输入框 */
.btn, .btn.sm { border-radius: var(--pill); }
:root[data-role="admin"] .input, :root[data-role="admin"] select.input { border-radius: 12px; }
:root[data-role="admin"] .lv, :root[data-role="admin"] .node, :root[data-role="admin"] .sample, :root[data-role="admin"] .choice, :root[data-role="admin"] .tk { border-radius: 16px; }
:root[data-role="admin"] .seg { border-radius: 999px; } :root[data-role="admin"] .seg button { border-radius: 999px; }
:root[data-role="admin"] .al-ic { border-radius: 50%; }

/* 问候语 */
.hello { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.hello b { color: var(--brand); font-weight: 600; }

/* AI 批量队列 */
.queue { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border-radius: 14px; background: var(--brand-3); border: 1px solid color-mix(in srgb, var(--brand) 22%, #fff); font-size: 13px; }
.queue b { font-weight: 600; }
.q-dots { display: flex; gap: 5px; align-items: center; }
.q-dots i { width: 22px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--brand) 22%, #fff); display: block; }
.q-dots i.ok { background: var(--green); } .q-dots i.cur { background: var(--brand); } .q-dots i.skip { background: var(--line); }
.queue .spacer { flex: 1; }
.q-ready { color: var(--green); } .q-wait { color: var(--ink-3); }

/* 顶部小屏导航、手机布局 */
@media (max-width: 860px) {
  body { flex-direction: column; }
  .side, :root[data-role="admin"] .side { width: 100%; height: auto; position: sticky; top: 0; z-index: 20; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px 8px; gap: 4px; }
  .brand { padding: 4px 6px; } .brand > div:last-child { display: none; } .brand-mark { width: 32px; height: 32px; font-size: 15px; }
  .side nav { flex-direction: row; overflow-x: auto; padding: 0; flex: 1; gap: 2px; scrollbar-width: none; }
  .side nav::-webkit-scrollbar { display: none; }
  .side nav .grp { display: none; }
  .side nav a { white-space: nowrap; padding: 8px 10px; font-size: 13px; gap: 6px; }
  .side nav a svg { width: 16px; height: 16px; } .side nav a .ai-dot { display: none; }
  .side-foot { margin: 0; padding: 0 4px; border: 0; gap: 8px; } .me { display: none; }
  main { padding: 16px 12px 60px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; } .page-head h1 { font-size: 22px; }
  .g4, .g3, .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid { gap: 12px; } .mt { margin-top: 12px; }
  .kpi { padding: 14px; min-height: 104px; } .kpi-val { font-size: 23px; }
  .lv-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 12px 4px; } .lv { padding: 10px; } .lv-n { font-size: 24px; } .lv-amt { display: none; }
  .card-h { padding: 12px 14px; } .card-b { padding: 14px; }
  .alert.v2 { grid-template-columns: 30px minmax(0, 1fr) auto; padding: 11px 14px; } .alert.v2 .al-go { display: none; }
  .alert-text { font-size: 13px; } .al-gh { padding: 12px 14px 6px; }
  .chain { grid-template-columns: 1fr; gap: 6px; padding: 12px; } .arrow { transform: rotate(90deg); height: 18px; }
  .stepper { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; padding: 14px 8px; } .st:nth-child(5)::before { display: none; }
  .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fgrid .w2 { grid-column: 1 / -1; }
  .samples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aging-leg { grid-template-columns: 1fr; }
  .call { grid-template-columns: 1fr; } .call-pill { grid-row: auto; grid-column: 1; justify-self: start; }
  .toolbar { padding: 10px 12px; } .search { width: 100%; }
  .modal { border-radius: 18px; } .mask { padding: 10px; }
  .seg2, .tk-row { grid-template-columns: 1fr; }
  .scan { min-height: 320px; padding: 14px; } .viewer-box { height: 360px; }
  .sticky-foot { flex-direction: column; align-items: stretch; }
  .debts li { grid-template-columns: minmax(0, 1fr) auto; } .debt-bar { display: none; } .debt-v { min-width: 0; }
  :root[data-role="admin"] body::after { width: 180px; height: 180px; right: -50px; bottom: -50px; opacity: .35; }
}

.foot-btns { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
@media (max-width: 860px) { .foot-btns { flex-direction: row; gap: 8px; white-space: nowrap; } }

/* 扫描线、四角标记跟随主色 */
.scan-line { background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--brand) 18%, transparent) 70%, color-mix(in srgb, var(--brand) 85%, transparent) 100%); }
.scan-line::after { background: var(--brand); box-shadow: 0 0 12px 2px color-mix(in srgb, var(--brand) 80%, transparent); }
.corner { border-color: var(--brand); }
.steps-ai li.on i { border-color: var(--brand); border-top-color: transparent; }
.card-h h2 svg { stroke: var(--brand); }
.tag.violet { background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand-d); }
.lines-edit tr.diff td.aw .input { border-color: var(--brand); background: var(--brand-3); }
@media (max-width: 860px) { .foot-btns { flex-direction: column; gap: 1px; align-items: flex-end; } .foot-btns .link-btn { font-size: 11px; padding: 1px 2px; } }

input[type=radio], input[type=checkbox] { accent-color: var(--brand); }

/* ======================================================================
   主题层三（2026-12-02）：管理员粉色调淡。参考 Chrome 的浅粉主题——
   浅粉底、白色卡片和白色胶囊，强调色用柔和的玫瑰色，不用大面积渐变。
   ====================================================================== */
:root[data-role="admin"] {
  --bg: #fdf2f2; --ink: #3a2b2f; --ink-2: #6e5b60; --ink-3: #a6959a;
  --line: #f2dede; --line-2: #f9ecec; --side: #fddcdc; --side-2: #f8cfcf;
  --soft: #fff8f8; --well: #f6e6e6; --mask: rgba(58, 43, 47, .32);
  --brand: #d66f88; --brand-d: #b95872; --brand-2: #fbe6ea; --brand-3: #fff6f7; --brand-ring: rgba(214, 111, 136, .18);
  --radius: 20px;
  --shadow: 0 1px 2px rgba(120, 60, 70, .05), 0 12px 26px -20px rgba(120, 60, 70, .28);
  --hero: #fddcdc;
}
:root[data-role="admin"] body { background-image: none; background-color: var(--bg); }
:root[data-role="admin"] body::after { width: 220px; height: 220px; right: -56px; bottom: -56px; opacity: .3; }
:root[data-role="admin"] .side { background: var(--side); border-right-color: #f6cccc; }
:root[data-role="admin"] .side nav a.on { background: #fff; color: var(--brand-d); font-weight: 600; box-shadow: 0 1px 2px rgba(120, 60, 70, .08), 0 6px 14px -10px rgba(120, 60, 70, .35); }
:root[data-role="admin"] .side nav a.on svg { stroke: var(--brand); }
:root[data-role="admin"] .side nav a.on .ai-dot { background: var(--brand-2); color: var(--brand-d); }
:root[data-role="admin"] .side nav a:hover:not(.on) { background: rgba(255, 255, 255, .55); }
:root[data-role="admin"] .brand-mark, :root[data-role="admin"] .login-card .brand-mark { background: var(--brand); box-shadow: 0 6px 14px -8px var(--brand); }
:root[data-role="admin"] .card, :root[data-role="admin"] .call { border-color: #f6e3e3; }
:root[data-role="admin"] .btn.primary, :root[data-role="admin"] .login-card .btn.primary { background: var(--brand); border-color: var(--brand); box-shadow: 0 6px 14px -10px var(--brand); }
:root[data-role="admin"] .btn.primary:hover { background: var(--brand-d); border-color: var(--brand-d); }
:root[data-role="admin"] .btn.ai { background: #fff; color: var(--brand-d); border: 1px solid #efc9d2; box-shadow: none; }
:root[data-role="admin"] .btn.ai:hover { background: var(--brand-3); }
:root[data-role="admin"] .drop-icon { background: var(--brand); box-shadow: 0 10px 20px -12px var(--brand); }
:root[data-role="admin"] .tbl tbody tr.link:hover td, :root[data-role="admin"] .alert:hover { background: #fff7f7; }
:root[data-role="admin"] .tag.gray { background: #f8ecec; }
:root[data-role="admin"] .lv.info { background: linear-gradient(180deg, #fff 0%, #fff8f8 100%); }
:root[data-role="admin"] *::-webkit-scrollbar-thumb { background: #f0c9c9; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
/* 重点卡：浅粉底、深色字，不再用整块玫瑰渐变 */
:root[data-role="admin"] .kpi.hero { background: var(--hero); color: var(--ink); border-color: #f8cfcf; box-shadow: var(--shadow); }
:root[data-role="admin"] .kpi.hero .kpi-label { color: #a57a80; }
:root[data-role="admin"] .kpi.hero .kpi-val small, :root[data-role="admin"] .kpi.hero .kpi-foot { color: #8a6a70; }
:root[data-role="admin"] .kpi.hero .kpi-foot b { color: var(--ink); }
:root[data-role="admin"] .kpi.hero .kpi-foot .bad { color: var(--red); text-decoration: none; }
:root[data-role="admin"] .kpi.hero::after { background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 65%); }
:root[data-role="admin"] .kpi.hero::before { background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 65%); }

/* 字体：优先苹果系统字体（苹果设备上是 SF Pro + 苹方）；其他系统没有装苹方时退回系统自带的中文字体 */
:root {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Helvetica Neue", "Segoe UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, "Cascadia Mono", Consolas, monospace;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
