:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --subtle: #f8fafc;
  --line: #e5e9f0;
  --line-strong: #d3dbe6;
  --text: #0f172a;
  --sub: #475569;
  --faint: #8c98a9;
  --accent: #1668dc;
  --accent-hover: #0e54bd;
  --accent-soft: #ecf4ff;
  --green: #15803d;
  --green-soft: #eaf8ef;
  --gold: #b45309;
  --gold-soft: #fff6e5;
  --red: #dc2626;
  --red-soft: #fef1f1;
  --blue: #1668dc;
  --blue-soft: #ecf4ff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / .04);
  --shadow: 0 1px 2px rgb(15 23 42 / .04), 0 4px 16px -6px rgb(15 23 42 / .06);
  --ease: cubic-bezier(.2, .7, .3, 1);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 76px; overflow-x: clip; }
body { margin: 0; color: var(--text); background: var(--bg); overflow-x: clip; min-height: 100dvh; }
body.is-home { background: #f7faff; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; min-width: 0; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent); }
a.brand, a.nav-link, a.job-row { text-decoration: none; }
a.brand, a.job-row { color: var(--text); }
button:focus-visible, a:focus-visible, .tip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus, input:focus-visible, select:focus, select:focus-visible, textarea:focus, textarea:focus-visible { outline: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.muted { color: var(--sub); }
[hidden] { display: none !important; }

/* ---------- 首页背景动效画布 ---------- */
.home-bg {
  position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none;
  opacity: 0; transition: opacity .45s var(--ease);
}
body.is-home .home-bg { opacity: 1; }

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgb(255 255 255 / .84); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1180px; margin: 0 auto; height: 58px; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 660; font-size: 15px; letter-spacing: -.01em; color: var(--text); }
.brand-svg { width: 32px; height: 22px; display: block; }
.nav { display: flex; gap: 4px; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; color: var(--sub); font-weight: 550; transition: background .15s, color .15s; }
.nav-link svg { width: 16px; height: 16px; }
.nav-link:hover { background: #edf1f7; color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }

/* ---------- 主体 ---------- */
.main { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; padding: 32px 24px 24px; min-height: calc(100dvh - 58px); display: flex; flex-direction: column; }
.main.wide { max-width: 1180px; padding-bottom: 56px; }
.main.home { padding-bottom: 56px; }
.stack { display: grid; gap: 16px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: var(--radius-sm); font-weight: 580; white-space: nowrap; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s; }
.btn svg { width: 16px; height: 16px; }
.btn:hover:not(:disabled) { background: var(--subtle); border-color: #bfc9d8; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; }
.btn.primary { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 1px 2px rgb(22 104 220 / .2); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--sub); }
.btn.ghost:hover:not(:disabled) { background: #edf1f7; border-color: transparent; color: var(--text); }
.card .btn.ghost:not(.icon), .receipt-actions .btn.ghost, .job-actions .btn.ghost { border-color: var(--line-strong); background: var(--surface); color: var(--text); }
.card .btn.ghost:not(.icon):hover:not(:disabled) { background: var(--subtle); }
.btn.danger { color: var(--red); border-color: #f3c9c9; }
.btn.danger:hover:not(:disabled) { background: var(--red-soft); border-color: #eeb4b4; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; gap: 5px; }
.btn.sm svg { width: 14px; height: 14px; }
.btn.icon { width: 34px; height: 34px; padding: 0; }
.btn.link { height: auto; padding: 2px 4px; border: 0; background: none; box-shadow: none; color: var(--accent); font-weight: 560; }
.btn.link:hover:not(:disabled) { background: none; color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
.btn.link.sm { font-size: 13px; padding: 2px 6px; color: var(--sub); }
.btn.link.sm:hover:not(:disabled) { color: var(--accent); text-decoration: none; background: var(--accent-soft); border-radius: 6px; }
.btn[data-spinning] svg { animation: spin 1s linear infinite; }

/* ---------- 表单 ---------- */
:where(input:not([type="checkbox"]):not([type="file"]), select, textarea) {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .15s, background .15s; outline: none;
}
:where(textarea) { height: auto; min-height: 64px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
:where(input:not([type="checkbox"]):not([type="file"]), select, textarea):hover { border-color: #b7c4d6; }
:where(input:not([type="checkbox"]):not([type="file"]), select, textarea):focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
:where(input, select):disabled { background: var(--subtle); color: var(--faint); cursor: not-allowed; }
input[type="number"] { font-variant-numeric: tabular-nums; }
.select { position: relative; min-width: 0; }
.select select { appearance: none; padding-right: 32px; cursor: pointer; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c98a9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 9px center / 16px; }
.select.grow { flex: 1; }
.w-xs { width: 64px; }
.w-sm { width: 88px; }
.w-md { width: 150px; }
.w-lg { width: 230px; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline.wrap { flex-wrap: wrap; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; color: var(--sub); font-size: 13px; font-weight: 520; }
.dash, .unit { color: var(--faint); font-size: 13px; }
.hint { color: var(--faint); font-size: 12.5px; }
.hint.warn { color: var(--gold); }
p.hint { margin-top: 8px; }

/* 百分比输入 */
.pct { position: relative; display: flex; align-items: center; width: 96px; flex: none; }
.pct input { padding: 0 26px 0 10px; text-align: right; height: 34px; }
.pct span { position: absolute; right: 10px; color: var(--faint); font-size: 12px; pointer-events: none; }
.pct input::-webkit-outer-spin-button, .pct input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pct input { -moz-appearance: textfield; }

/* 分段控件 */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: #eaf0f7; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 560; color: var(--sub); white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.seg-btn svg { width: 15px; height: 15px; }
.seg-btn:hover:not(.on):not(:disabled) { color: var(--text); }
.seg-btn.on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgb(15 23 42 / .07), 0 0 0 .5px rgb(15 23 42 / .04); }
.seg-btn:disabled { opacity: .5; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 36px; height: 20px; border-radius: 99px; background: #cbd5e1; transition: background .2s var(--ease); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .16); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }
.switch-label { color: var(--text); }

/* 提示气泡 */
.tip { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 4px; color: var(--faint); cursor: help; vertical-align: -3px; border-radius: 50%; }
.tip svg { width: 15px; height: 15px; }
.tip:hover, .tip:focus-visible { color: var(--accent); }
.tip::after {
  content: attr(data-tip); display: none; position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 40; width: max-content; max-width: min(260px, 72vw);
  padding: 8px 11px; border-radius: 8px; background: #1e293b; color: #f8fafc; font-size: 12.5px; font-weight: 400; line-height: 1.55; letter-spacing: 0;
  white-space: normal; text-align: left; box-shadow: 0 8px 24px rgb(15 23 42 / .18); transform: translateX(-50%); pointer-events: none;
}
.tip:hover::after, .tip:focus-visible::after { display: block; }
.set-label .tip::after { left: -10px; transform: none; }
.toolbar-row .tip::after { left: auto; right: -8px; transform: none; }

/* 徽标与标签 */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 560; white-space: nowrap; color: var(--sub); background: #eef2f6; }
.badge.green { color: var(--green); background: var(--green-soft); }
.badge.gold { color: var(--gold); background: var(--gold-soft); }
.badge.red { color: var(--red); background: var(--red-soft); }
.badge.blue { color: var(--blue); background: var(--blue-soft); }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.blue.dot::before { animation: pulse 1.6s ease-in-out infinite; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 7px; background: #eef2f7; color: var(--sub); font-size: 12.5px; }
.chip b { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.chip.accent { background: var(--accent-soft); color: var(--accent); font-weight: 540; }
.chip.accent svg { width: 14px; height: 14px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; color: var(--sub); background: #eef2f7; white-space: nowrap; }
.req { color: var(--red); margin-left: 3px; font-weight: 600; }

/* 提示框 */
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 10px; font-size: 13px; color: var(--sub); background: var(--subtle); border: 1px solid var(--line); }
.callout svg { width: 16px; height: 16px; margin-top: 2px; }
.callout > div { min-width: 0; overflow-wrap: anywhere; }
.callout.warn { color: #92400e; background: var(--gold-soft); border-color: #fbe2b5; }
.callout.error { color: #b42318; background: var(--red-soft); border-color: #fbd0d0; }
.callout ul { margin: 6px 0 10px; padding-left: 18px; }
.callout li + li { margin-top: 2px; }
.callout p { margin-bottom: 10px; }

/* ---------- 卡片 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { font-size: 15px; font-weight: 640; letter-spacing: -.01em; }
.card-body { padding: 6px 22px; }
.card-body > .callout, .card-body > .dropzone, .card-body > .stat-strip, .card-body > #timing-summary { margin: 14px 0; }
.card.flush .card-body { padding: 0; }

/* 设置行 */
.set-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid #eef2f6; align-items: start; }
.set-row:last-child { border-bottom: 0; }
.set-label { display: flex; align-items: center; min-height: 34px; color: var(--sub); font-weight: 560; font-size: 13.5px; }
.set-body { min-width: 0; display: grid; gap: 10px; align-content: center; min-height: 34px; justify-items: start; }
.set-body > * { max-width: 100%; }
.set-body > .tiles, .set-body > .sources, .set-body > .region-list, .set-body > .list-foot, .set-body > .callout, .set-body > .region-picker { justify-self: stretch; }
.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.list-head { display: flex; }
.sum { font-size: 12.5px; color: var(--gold); font-variant-numeric: tabular-nums; }
.sum.ok { color: var(--faint); }

/* ---------- 首页 ---------- */
.hero { margin: clamp(36px, 10vh, 104px) auto 0; width: 100%; max-width: 620px; text-align: center; display: grid; justify-items: center; gap: 0; }
.hero-mark { width: 76px; height: 50px; margin-bottom: 20px; display: grid; place-items: center; }
.hero-mark svg { width: 76px; height: 50px; display: block; }
.hero h1 { font-size: clamp(28px, 4vw, 36px); font-weight: 700; letter-spacing: -.03em; line-height: 1.2; color: var(--text); }
.hero-sub { margin-top: 10px; color: var(--sub); font-size: 15px; }
.hero-form { margin-top: 30px; width: 100%; display: flex; align-items: center; gap: 6px; padding: 6px; background: rgb(255 255 255 / .94); backdrop-filter: blur(8px); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 1px 2px rgb(15 23 42 / .04), 0 12px 32px -12px rgb(15 23 42 / .1); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.hero-form:hover { border-color: #b7c4d6; }
.hero-form:focus-within { border-color: #60a5fa; box-shadow: 0 14px 36px -14px rgb(22 104 220 / .16), 0 2px 6px rgb(15 23 42 / .04); }
.hero-icon { display: grid; place-items: center; width: 34px; color: var(--faint); transition: color .2s; }
.hero-form:focus-within .hero-icon { color: var(--accent); }
.hero-form input#survey-url { border: 0; height: 44px; padding: 0 4px; font-size: 15px; background: transparent; }
.hero-form .btn { height: 44px; padding: 0 20px; border-radius: 10px; font-size: 14.5px; }
.hero .callout { margin-top: 14px; width: 100%; text-align: left; }
.hero-alt { margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; font-size: 13.5px; }
.hero-alt .sep { width: 1px; height: 14px; background: var(--line-strong); margin: 0 10px; }
.flow { list-style: none; padding: 0; margin: clamp(48px, 10vh, 96px) auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 620px; }
.flow li { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: rgb(255 255 255 / .78); backdrop-filter: blur(8px); border: 1px solid rgb(229 233 240 / .9); transition: transform .2s var(--ease), border-color .2s, background .2s; }
.flow li:hover { transform: translateY(-2px); border-color: #c7d7ee; background: #ffffff; }
.flow-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); flex: none; }
.flow-icon svg { width: 17px; height: 17px; }
.flow li > span:last-child { display: grid; font-weight: 580; font-size: 13.5px; line-height: 1.35; }
.flow small { color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .06em; }

/* ---------- 问卷头部 / 步骤 ---------- */
.survey-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.sh-text { min-width: 0; }
.sh-meta { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 13px; margin-bottom: 8px; }
.survey-head h1 { font-size: 24px; font-weight: 680; letter-spacing: -.025em; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.stepper { display: flex; align-items: center; gap: 6px; flex: none; padding-bottom: 2px; }
.step { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 5px; border-radius: 99px; font-size: 13px; font-weight: 560; color: var(--faint); transition: background .15s, color .15s; }
.step:hover:not(:disabled):not(.current) { background: #e9eef5; color: var(--text); }
.step-dot { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); font-size: 11.5px; font-weight: 650; background: var(--surface); }
.step-dot svg { width: 13px; height: 13px; stroke-width: 2.4; }
.step.done { color: var(--sub); }
.step.done .step-dot { border-color: var(--accent); background: var(--accent); color: #fff; }
.step.current { color: var(--text); background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.step.current .step-dot { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.step-line { width: 14px; height: 1.5px; background: var(--line-strong); border-radius: 2px; }

/* ---------- 答案 ---------- */
.mode-switch { display: flex; }
.mode-switch .seg { padding: 4px; }
.mode-switch .seg-btn { height: 34px; padding: 0 16px; font-size: 13.5px; }
.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 2px 0; }
.toolbar-row .btn.ghost { color: var(--sub); }
.q-list { display: grid; gap: 12px; }
.q-card { padding: 18px 22px 8px; }
.q-head { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 6px; }
.q-no { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 680; font-variant-numeric: tabular-nums; flex: none; }
.q-head h3 { flex: 1; font-size: 15px; font-weight: 620; line-height: 1.6; letter-spacing: -.005em; min-width: 0; overflow-wrap: anywhere; padding-top: 1px; }
.q-tags { display: flex; gap: 6px; flex: none; padding-top: 2px; }
.q-card > .callout { margin: 4px 0 12px; }
.unit { padding: 10px 0 12px 38px; }
.unit + .unit { border-top: 1px dashed var(--line); }
.unit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-height: 32px; }
.unit-title { font-weight: 600; font-size: 13.5px; }
.unit-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.unit-head:not(:has(.unit-title)) .unit-tools { margin-left: 0; width: 100%; }
.unit-tools .select { width: 160px; }
.unit-tools .select select { height: 32px; font-size: 13px; }
.tool-group { display: inline-flex; gap: 0; margin-left: auto; }
.ratio { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 560; color: var(--gold); font-variant-numeric: tabular-nums; }
.ratio::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ratio.ok { color: var(--green); }
.unit-body { margin-top: 10px; display: grid; gap: 10px; }
.chips .chip b { color: var(--accent); }
.opts { margin-top: 6px; display: grid; }
.opt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 180px) 96px; align-items: center; gap: 14px; padding: 6px 0; }
.opt-label { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 13.5px; cursor: text; }
.opt-label span { overflow-wrap: anywhere; }
.mark { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #cbd5e1; flex: none; }
.mark.square { border-radius: 4px; }
.meter { height: 6px; border-radius: 99px; background: #eaf0f7; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .3s var(--ease); }
.opt-detail { grid-column: 1 / -1; min-height: 52px; font-size: 13px; margin: 2px 0 4px 23px; width: calc(100% - 23px); }

/* Excel */
.toggle-chip { position: relative; cursor: pointer; }
.toggle-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-chip span { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; color: var(--sub); transition: all .15s; }
.toggle-chip svg { width: 0; height: 14px; stroke-width: 2.4; transition: width .15s; }
.toggle-chip:hover span { border-color: #b7c4d6; color: var(--text); }
.toggle-chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 560; }
.toggle-chip input:checked + span svg { width: 14px; }
.toggle-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone { position: relative; display: flex; align-items: center; gap: 14px; padding: 26px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--subtle); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone:not(.loaded) { flex-direction: column; justify-content: center; text-align: center; padding: 38px 20px; }
.dropzone.loaded { padding: 14px 16px; border-style: solid; border-width: 1px; background: var(--surface); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dz-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--surface); color: var(--accent); border: 1px solid var(--line); flex: none; }
.dropzone.loaded .dz-icon { background: var(--green-soft); color: var(--green); border-color: transparent; }
.dz-text { display: grid; gap: 2px; min-width: 0; }
.dz-text strong { font-weight: 600; overflow-wrap: anywhere; }
.dz-text small { color: var(--faint); font-size: 12.5px; }
.sheet-bar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding: 2px 0 16px; }
.sheet-bar .select { width: 220px; }
.map-delivery { padding: 14px 0 4px; }
.map-list { display: grid; }
.map-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 280px); gap: 16px; align-items: start; padding: 11px 0; border-bottom: 1px solid #eef2f6; }
.map-row:last-child { border-bottom: 0; }
.map-q { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; min-height: 38px; padding-top: 8px; }
.map-q > span:last-child { overflow-wrap: anywhere; }
.map-key { flex: none; min-width: 34px; height: 21px; display: grid; place-items: center; padding: 0 5px; border-radius: 5px; background: #eef2f6; color: var(--sub); font-size: 11px; font-weight: 650; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; margin-top: 1px; }
.map-row.missing .map-key { background: var(--red-soft); color: var(--red); }
.map-row.missing select { border-color: #f3b8b8; }
.map-ctl { display: grid; gap: 8px; min-width: 0; }
.sub-map { display: grid; gap: 6px; padding: 8px 0 2px 12px; border-left: 2px solid var(--line); }
.sub-field { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 8px; align-items: center; font-size: 12.5px; color: var(--sub); }
.sub-field select { height: 32px; font-size: 13px; }

/* ---------- 投放 ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--subtle); cursor: text; transition: border-color .15s, background .15s; }
.tile:focus-within { border-color: #93c5fd; background: var(--surface); }
.tile-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 540; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-name svg { color: var(--faint); width: 17px; height: 17px; }
.tile .pct { width: 86px; }
.sources { display: grid; gap: 8px; }
.source-line { display: grid; grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) 96px 34px; gap: 8px; align-items: center; }
.source-line.no-weight { grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) 34px; }
.source-line .pct input { height: 38px; }
.region-picker { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.region-picker .select:first-child:not(.grow) { width: 150px; }
.region-picker .select.grow { min-width: 180px; }
.region-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.region-item { display: flex; align-items: center; gap: 9px; padding: 6px 4px 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--subtle); }
.region-item strong { flex: 1; font-weight: 560; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.region-item .pct { width: 86px; }
.region-item .btn.icon { width: 28px; height: 28px; }
.stock-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.stock-dot.ok { background: #22c55e; box-shadow: 0 0 0 3px rgb(34 197 94 / .15); }
.stock-dot.warn { background: #f59e0b; box-shadow: 0 0 0 3px rgb(245 158 11 / .15); }
.stat-strip { display: grid; grid-template-columns: 0.6fr 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; background: var(--subtle); }
.stat-strip > div { display: grid; gap: 2px; padding: 12px 16px; min-width: 0; }
.stat-strip > div + div { border-left: 1px solid var(--line); }
.stat-strip span { color: var(--faint); font-size: 12px; }
.stat-strip strong { font-size: 15px; font-weight: 640; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#timing-summary .hint.warn { margin-top: 8px; }

/* 预览 */
#plan-result:empty { display: none; }
.plan .card-body { padding-top: 16px; padding-bottom: 18px; display: grid; gap: 16px; }
.plan .card-body > * { margin: 0 !important; }
.dist { display: grid; gap: 8px; }
.dist-row { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: start; }
.dist-key { font-size: 12.5px; color: var(--faint); line-height: 26px; }
.table-head { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 560; color: var(--sub); margin-bottom: -8px !important; }

/* 表格 */
.table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.card.flush .table-scroll { border: 0; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.table th { position: sticky; top: 0; padding: 10px 14px; font-size: 12px; font-weight: 560; color: var(--faint); background: var(--subtle); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid #eef2f6; vertical-align: top; overflow-wrap: anywhere; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f8fafc; }
.table td small { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.table td.num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--sub); white-space: nowrap; }
.table td.num small { font-weight: 400; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px !important; }
.preview-table td { min-width: 96px; max-width: 240px; }
.preview-table td.num { min-width: 0; }
.receipt-cell { min-width: 220px; }
.receipt-cell .btn { margin-top: 4px; margin-left: -6px; }

/* ---------- 底部操作栏 ---------- */
.actionbar {
  position: sticky; bottom: 16px; z-index: 20; margin-top: auto; padding: 12px 14px 12px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgb(255 255 255 / .92); backdrop-filter: saturate(1.4) blur(14px);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px -10px rgb(15 23 42 / .14), 0 1px 3px rgb(15 23 42 / .05);
}
.stack + .actionbar { margin-top: 24px; }
.ab-meta { color: var(--sub); font-size: 13px; font-variant-numeric: tabular-nums; }
.ab-actions { display: flex; gap: 8px; margin-left: auto; }
.actionbar .btn { height: 38px; padding: 0 16px; }
.actionbar .btn.ghost { border-color: var(--line-strong); background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- 任务 ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 680; letter-spacing: -.025em; }
.job-list { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.job-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px 128px 18px; align-items: center; gap: 24px; padding: 16px 22px; text-align: left; transition: background .12s; }
.job-row + .job-row { border-top: 1px solid #eef2f6; }
.job-row:hover { background: #f8fafc; }
.job-row > svg { color: var(--faint); width: 16px; height: 16px; transition: transform .15s, color .15s; }
.job-row:hover > svg { color: var(--accent); transform: translateX(2px); }
.job-main { display: grid; gap: 3px; min-width: 0; }
.job-main strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-main .muted { font-size: 12.5px; color: var(--faint); }
.job-progress { display: flex; align-items: center; gap: 12px; }
.job-progress .num { font-size: 12.5px; color: var(--sub); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 72px; text-align: right; }
.job-status { display: flex; justify-content: flex-start; }
.bar { flex: 1; height: 6px; border-radius: 99px; background: #eaf0f7; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .4s var(--ease); }
.bar.lg { height: 8px; }
.page-top { margin: -6px 0 14px; }
.page-top .btn.link { color: var(--sub); padding-left: 0; }
.page-top .btn.link:hover { color: var(--text); text-decoration: none; }
.job-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.job-head h1 { font-size: 24px; font-weight: 680; letter-spacing: -.025em; line-height: 1.3; overflow-wrap: anywhere; }
.job-head .badge { margin-top: 6px; }
.meta { margin-top: 6px; color: var(--faint); font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; }
.meta .sep { margin: 0 8px; color: var(--line-strong); }
.job-head + .card { margin-bottom: 16px; }
.job-head + .card .card-body { padding: 20px 22px; display: grid; gap: 14px; }
.big-progress { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: -4px; }
.big-progress strong { font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.big-progress span { color: var(--sub); font-size: 13.5px; }
.big-progress .pct-label { font-size: 14px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.notes { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--sub); font-size: 13px; }
.notes span { display: inline-flex; align-items: center; gap: 6px; }
.notes svg { width: 15px; height: 15px; color: var(--faint); }
.job-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.job-actions:empty { display: none; }
.lead-control { display: inline-flex; align-items: center; gap: 8px; padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--line); }
.lead-control input { height: 30px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 12px; border-top: 1px solid var(--line); color: var(--sub); font-size: 13px; font-variant-numeric: tabular-nums; }
.empty { margin: 10vh auto 0; display: grid; justify-items: center; gap: 14px; text-align: center; }
.empty h2 { font-size: 17px; font-weight: 620; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: var(--surface); border: 1px solid var(--line); color: var(--faint); box-shadow: var(--shadow); }
.empty-icon svg { width: 24px; height: 24px; }
.loading { display: grid; place-items: center; padding: 20vh 0; }

/* ---------- 弹窗 / 通知 ---------- */
.receipt-dialog { width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 24px 64px rgb(15 23 42 / .22); }
.receipt-dialog[open] { animation: pop .18s var(--ease); }
.receipt-dialog::backdrop { background: rgb(15 23 42 / .42); backdrop-filter: blur(2px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 15px; font-weight: 640; }
.receipt-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 22px; }
.receipt-display { display: grid; justify-items: center; padding: 16px; margin: 0 22px 22px; border-radius: 12px; background: #eef2f6; }
.receipt-display img { display: block; max-width: 100%; max-height: 64dvh; height: auto; object-fit: contain; border-radius: 6px; }
.notice { position: fixed; left: 50%; top: 72px; z-index: 50; display: flex; align-items: center; gap: 9px; max-width: min(440px, calc(100% - 32px)); padding: 10px 16px 10px 13px; border-radius: 12px; background: #0f172a; color: #f8fafc; font-size: 13.5px; box-shadow: 0 12px 32px rgb(15 23 42 / .22); transform: translateX(-50%); animation: drop .22s var(--ease); overflow-wrap: anywhere; }
.notice svg { width: 16px; height: 16px; color: #4ade80; }
.notice.error svg { color: #f87171; }

.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; opacity: .8; }
.loading .spinner, .dz-icon .spinner { color: var(--accent); width: 22px; height: 22px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .topbar-inner { padding: 0 16px; gap: 16px; }
  .main { padding: 22px 16px 18px; }
  .tiles { grid-template-columns: 1fr; }
  .actionbar { bottom: 12px; padding: 10px 12px; }
  .survey-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .survey-head h1 { font-size: 20px; }
  .stepper { align-self: flex-start; }
  .card-head { padding: 14px 16px; }
  .card-body { padding: 4px 16px; }
  .q-card { padding: 16px 16px 6px; }
  .unit { padding-left: 0; }
  .q-tags { display: none; }
  .set-row { grid-template-columns: 1fr; gap: 8px; padding: 14px 0; }
  .set-label { min-height: 0; }
  .opt { grid-template-columns: minmax(0, 1fr) 88px; gap: 4px 12px; }
  .opt .meter { grid-column: 1 / -1; grid-row: 2; height: 4px; }
  .opt .pct { width: 88px; }
  .opt-detail { margin-left: 0; width: 100%; }
  .tool-group { margin-left: -6px; }
  .unit-tools { margin-left: 0; width: 100%; }
  .map-row { grid-template-columns: 1fr; gap: 6px; }
  .sub-field { grid-template-columns: 1fr; gap: 4px; }
  .source-line { grid-template-columns: minmax(0, 1fr) 88px 34px; }
  .source-line .source-url { grid-column: 1 / -1; grid-row: 2; }
  .source-line.no-weight { grid-template-columns: minmax(0, 1fr) 34px; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip > div:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .stat-strip > div:nth-child(2) { border-left: 0; }
  .flow { grid-template-columns: 1fr; max-width: 360px; }
  .job-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; padding: 14px 16px; }
  .job-row > svg { display: none; }
  .job-progress { grid-column: 1 / -1; grid-row: 2; }
  .job-status { grid-row: 1; grid-column: 2; }
  .job-head { flex-direction: column; gap: 6px; }
  .lead-control { border-left: 0; padding-left: 0; margin-left: 0; }
  .actionbar .btn { padding: 0 14px; }
  .ab-meta { display: none; }
}
@media (max-width: 420px) {
  .brand { font-size: 0; gap: 0; }
  .hero-form { flex-wrap: wrap; }
  .hero-icon { display: none; }
  .hero-form .btn { width: 100%; }
  .step { padding: 0 8px 0 4px; font-size: 12px; }
  .step-line { width: 8px; }
}
.bill { display: grid; gap: 8px; max-width: 42rem; color: var(--sub); }
.bill-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.bill-row b { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lookup { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.lookup label, .login-box label { display: grid; gap: 7px; }
.orders-page > .lookup { display: grid; grid-template-columns: minmax(0, 380px) auto; justify-content: start; padding: 16px 20px; margin-bottom: 20px; }
.lookup-field { display: grid; gap: 6px; min-width: 0; }
.orders-page > .lookup .btn { border-color: var(--line-strong); }
.lookup-field label { font-size: 13px; font-weight: 600; color: var(--sub); }
.login-box { max-width: 440px; margin: 8vh auto; }
.orders-page .job-status { grid-column: 3; }
.orders-page .job-row > svg { grid-column: 4; }
.orders-page .job-row:focus-visible { outline-offset: -3px; }
.orders-page .btn.link:hover { text-decoration: none; }
.orders-empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: clamp(48px, 8vw, 88px) 16px; }
.orders-empty h2 { font-size: 17px; font-weight: 650; }
.order-progress-bar { display: block; width: 100%; height: 6px; appearance: none; border: 0; border-radius: 8px; background: var(--accent-soft); overflow: hidden; }
.order-progress-bar::-webkit-progress-bar { background: var(--accent-soft); }
.order-progress-bar::-webkit-progress-value { background: var(--accent); border-radius: 8px; }
.order-progress-bar::-moz-progress-bar { background: var(--accent); border-radius: 8px; }
.big-progress + .order-progress-bar { height: 8px; }
.task-code { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 11px 14px; background: var(--subtle); border-radius: var(--radius-sm); }
.task-code > div { min-width: 0; display: grid; gap: 2px; }
.task-code code { overflow-wrap: anywhere; user-select: all; }
.order-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; color: var(--faint); font-size: 12.5px; overflow-wrap: anywhere; }
.order-price summary { cursor: pointer; padding: 14px 20px; font-weight: 600; }
.order-price .card-body { border-top: 1px solid var(--line); }
.checkout-dialog { position: fixed; inset: 0; margin: auto; width: min(460px, calc(100% - 24px)); height: fit-content; color: var(--text); }
.checkout-content { display: grid; gap: 16px; padding: 20px 22px 22px; }
.checkout-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-weight: 600; }
.checkout-amount { font-size: 27px; font-weight: 720; letter-spacing: -.035em; color: var(--accent); font-variant-numeric: tabular-nums; }
.checkout-content .bill { padding: 13px 14px; border-radius: var(--radius-sm); background: var(--subtle); font-size: 13px; }
.checkout-form { display: grid; gap: 12px; }
.checkout-methods { display: flex; flex-wrap: wrap; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.checkout-methods legend { margin-bottom: 6px; padding: 0; color: var(--sub); font-weight: 600; font-size: 13px; }
.checkout-option { display: flex; flex: 1 1 115px; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.checkout-option:has(:checked) { border-color: var(--accent); background: var(--accent-soft); }
.checkout-option:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.checkout-option input { margin: 0; padding: 0; width: 14px; height: 14px; accent-color: var(--accent); }
.checkout-error { color: var(--gold); }
.checkout-error:empty, .checkout-actions:empty { display: none; }
.checkout-actions { display: flex; justify-content: flex-end; gap: 8px; }
.checkout-result { display: grid; gap: 12px; justify-items: center; text-align: center; }
.payment-qr { width: 216px; max-width: 100%; display: block; }
@media (max-width: 760px) {
  .orders-page .job-status { grid-column: 2; }
}
@media (max-width: 600px) {
  .checkout-content { padding-inline: 16px; }
}
