:root {
  --ink: #0b1f3a;
  --ink-soft: #516176;
  --paper: #f5f7f8;
  --white: #ffffff;
  --line: #dce3e8;
  --blue: #2864f0;
  --blue-soft: #e8efff;
  --mint: #23a77a;
  --mint-soft: #e3f6ef;
  --amber: #d17a11;
  --amber-soft: #fff0d8;
  --danger: #d84a4a;
  --shadow: 0 16px 50px rgba(11, 31, 58, 0.09);
  --radius: 22px;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); }
body { min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(40, 100, 240, .25); outline-offset: 2px; }

.shell { min-height: 100dvh; max-width: 520px; margin: 0 auto; background: var(--paper); position: relative; padding-bottom: 96px; }
.topbar { padding: max(18px, env(safe-area-inset-top)) 20px 14px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; background: rgba(245,247,248,.92); backdrop-filter: blur(16px); }
.brand { display: flex; gap: 10px; align-items: center; }
.brand-mark { width: 34px; height: 34px; border-radius: 12px 12px 12px 4px; display: grid; place-items: center; color: white; background: var(--ink); font: 700 13px/1 ui-monospace, SFMono-Regular, monospace; }
.brand strong { display: block; letter-spacing: .03em; }
.brand small { color: var(--ink-soft); display: block; margin-top: 2px; }
.icon-button { border: 1px solid var(--line); background: var(--white); width: 40px; height: 40px; border-radius: 14px; color: var(--ink); display: grid; place-items: center; }
.user-chip { border: 1px solid var(--line); background: white; border-radius: 16px; padding: 5px 10px 5px 5px; display: flex; align-items: center; gap: 7px; color: var(--ink); }
.user-chip span { width: 30px; height: 30px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-weight: 800; }
.user-chip small { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 6px 18px 32px; }
.eyebrow { margin: 12px 0 8px; color: var(--blue); font: 700 12px/1.2 ui-monospace, SFMono-Regular, monospace; letter-spacing: .12em; text-transform: uppercase; }
h1 { font-size: clamp(28px, 8vw, 38px); line-height: 1.12; letter-spacing: -.045em; margin: 0; }
h2 { font-size: 22px; letter-spacing: -.025em; margin: 0; }
h3 { margin: 0; font-size: 17px; }
p { line-height: 1.65; }
.subcopy { color: var(--ink-soft); margin: 10px 0 22px; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin: 28px 2px 12px; }
.section-head span { color: var(--ink-soft); font-size: 13px; }

.hero { padding: 8px 2px 0; }
.hero-panel { margin-top: 20px; background: var(--ink); color: white; border-radius: 30px; padding: 22px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero-panel::after { content: ""; position: absolute; width: 180px; height: 180px; border: 38px solid rgba(255,255,255,.055); border-radius: 50%; right: -74px; top: -82px; }
.hero-row { display: flex; align-items: center; gap: 20px; position: relative; z-index: 1; }
.progress-ring { --p: 0; width: 112px; aspect-ratio: 1; flex: 0 0 112px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#72a0ff calc(var(--p) * 1%), rgba(255,255,255,.13) 0); position: relative; }
.progress-ring::before { content: ""; width: 82px; height: 82px; background: var(--ink); border-radius: 50%; position: absolute; }
.progress-ring b { position: relative; font: 750 24px/1 ui-monospace, SFMono-Regular, monospace; }
.hero-metric small { color: #9fb0c5; }
.hero-metric strong { display: block; font-size: 22px; margin: 5px 0 8px; }
.hero-metric p { color: #cbd5e0; font-size: 13px; margin: 0; line-height: 1.5; }

.primary, .secondary { border: 0; border-radius: 16px; padding: 14px 18px; font-weight: 700; min-height: 50px; }
.primary { background: var(--blue); color: white; box-shadow: 0 10px 24px rgba(40,100,240,.23); }
.secondary { background: var(--white); color: var(--ink); border: 1px solid var(--line); }
.wide { width: 100%; }
.action-row { display: flex; gap: 10px; margin-top: 18px; }
.action-row > * { flex: 1; }

.product-card { border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: 0 7px 22px rgba(11,31,58,.045); }
.product-top { display: flex; align-items: center; gap: 13px; }
.product-thumb { width: 52px; height: 52px; border-radius: 17px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-size: 24px; }
.product-main { min-width: 0; flex: 1; }
.product-main strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-main small { color: var(--ink-soft); display: block; margin-top: 5px; }
.chevron { color: #9aa7b5; font-size: 24px; }
.mini-progress { height: 7px; background: #edf1f4; border-radius: 10px; overflow: hidden; margin-top: 14px; }
.mini-progress span { height: 100%; display: block; background: var(--blue); border-radius: inherit; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-card { min-height: 136px; text-align: left; border: 1px solid var(--line); background: var(--white); border-radius: 22px; padding: 16px; color: var(--ink); transition: .2s ease; }
.choice-card.selected { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue), 0 12px 28px rgba(40,100,240,.11); transform: translateY(-2px); }
.choice-icon { font-size: 28px; display: block; margin-bottom: 16px; }
.choice-card small { color: var(--ink-soft); display: block; margin-top: 5px; line-height: 1.4; }
.form-card { margin-top: 18px; padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: 24px; }
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.field input, .field select { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; background: #fbfcfd; color: var(--ink); min-height: 48px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch-list { display: grid; gap: 9px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #edf0f2; }
.switch-row:last-child { border: 0; }
.switch { width: 48px; height: 28px; appearance: none; border-radius: 30px; background: #d6dde3; position: relative; transition: .2s; }
.switch::after { content: ""; width: 22px; height: 22px; border-radius: 50%; background: white; position: absolute; top: 3px; left: 3px; box-shadow: 0 2px 5px rgba(0,0,0,.16); transition: .2s; }
.switch:checked { background: var(--blue); }
.switch:checked::after { left: 23px; }

.task-group-label { display: flex; justify-content: space-between; align-items: center; margin: 26px 2px 10px; }
.task-group-label strong { font-size: 15px; }
.task-group-label span { font: 650 12px/1 ui-monospace, SFMono-Regular, monospace; color: var(--ink-soft); }
.task-card { background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 15px; margin-bottom: 10px; display: flex; gap: 13px; align-items: center; }
.task-card.done { border-color: #bfe8d8; }
.task-card.warn { border-color: #f3d2a7; }
.task-state { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 15px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-size: 20px; }
.task-card.done .task-state { background: var(--mint-soft); color: var(--mint); }
.task-card.warn .task-state { background: var(--amber-soft); color: var(--amber); }
.guide-thumb { background-size: 180%; background-position: center 42%; position: relative; overflow: hidden; border: 1px solid var(--line); }
.guide-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(11,31,58,.35)); }
.guide-thumb span { position: relative; z-index: 1; color: white; font-weight: 800; text-shadow: 0 1px 6px rgba(0,0,0,.25); }
.task-copy { min-width: 0; flex: 1; }
.task-copy strong { display: block; font-size: 15px; }
.task-copy small { color: var(--ink-soft); display: block; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-copy em { color: var(--blue); display: block; font-size: 11px; font-style: normal; font-weight: 700; margin-top: 6px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #c5cdd5; }
.task-card.done .status-dot { background: var(--mint); }
.task-card.warn .status-dot { background: var(--amber); }

.capture-head { text-align: center; padding: 6px 10px 18px; }
.guide-card { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 12px; margin-bottom: 14px; }
.guide-label { display: flex; justify-content: space-between; align-items: center; padding: 2px 2px 10px; }
.guide-label span { display: block; color: var(--blue); font: 700 11px/1.2 ui-monospace, SFMono-Regular, monospace; letter-spacing: .08em; }
.guide-label strong { display: block; font-size: 14px; margin-top: 5px; }
.guide-label button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); }
.guide-viewport { height: 176px; border-radius: 15px; overflow: hidden; background: #edf0f2; transition: height .25s ease; }
.guide-viewport img { width: 100%; height: 100%; object-fit: cover; object-position: center 43%; display: block; }
.guide-card.expanded .guide-viewport { height: min(72vh, 620px); }
.guide-card.expanded .guide-viewport img { object-fit: contain; background: white; }
.guide-card p { color: var(--ink-soft); font-size: 11px; margin: 9px 3px 1px; line-height: 1.5; }
.capture-stage { border-radius: 28px; background: var(--ink); color: white; min-height: 330px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.capture-stage::before { content: ""; position: absolute; inset: 18px; border: 1px dashed rgba(255,255,255,.24); border-radius: 22px; pointer-events: none; }
.angle-guide { align-self: center; width: 150px; height: 180px; border: 2px solid rgba(255,255,255,.32); border-radius: 48% 48% 25% 25%; margin-top: 22px; position: relative; }
.angle-guide::after { content: "产品保持完整入镜"; position: absolute; bottom: -40px; width: 180px; left: -17px; text-align: center; font-size: 12px; color: #9fb0c5; }
.capture-tip { position: relative; z-index: 1; background: rgba(255,255,255,.09); backdrop-filter: blur(8px); border-radius: 15px; padding: 12px; font-size: 13px; line-height: 1.5; }
.capture-actions { display: flex; justify-content: center; gap: 22px; align-items: center; margin: 22px 0; }
.capture-button { width: 78px; height: 78px; border-radius: 50%; border: 7px solid var(--blue-soft); background: var(--blue); color: white; display: grid; place-items: center; font-size: 26px; box-shadow: 0 10px 30px rgba(40,100,240,.28); }
.file-input { position: absolute; opacity: 0; pointer-events: none; }
.round-secondary { width: 50px; height: 50px; border-radius: 50%; background: white; border: 1px solid var(--line); display: grid; place-items: center; }
.preview-image { width: 100%; height: 330px; object-fit: cover; border-radius: 28px; background: var(--ink); }
.qa-list { margin-top: 15px; background: white; border: 1px solid var(--line); border-radius: 20px; padding: 8px 15px; }
.qa-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf0f2; font-size: 14px; }
.qa-row:last-child { border: 0; }
.pass { color: var(--mint); font-weight: 700; }

.summary-card { background: var(--ink); color: white; border-radius: 28px; padding: 23px; }
.score { display: flex; align-items: baseline; gap: 7px; }
.score strong { font: 750 56px/1 ui-monospace, SFMono-Regular, monospace; letter-spacing: -.08em; }
.score span { color: #9fb0c5; }
.summary-card p { color: #c6d1dd; font-size: 14px; }
.checklist { background: white; border-radius: 22px; border: 1px solid var(--line); padding: 8px 16px; margin-top: 14px; }
.check-row { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid #edf0f2; }
.check-row:last-child { border: 0; }
.check-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--mint-soft); color: var(--mint); font-weight: 800; }
.check-row.pending .check-icon { background: var(--amber-soft); color: var(--amber); }
.check-row div { flex: 1; }
.check-row small { color: var(--ink-soft); display: block; margin-top: 4px; }

.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(520px, 100%); padding: 10px 20px max(12px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(255,255,255,.94); backdrop-filter: blur(18px); border-top: 1px solid var(--line); z-index: 30; }
.bottom-nav.four { grid-template-columns: repeat(4, 1fr); }
.nav-item { border: 0; background: transparent; color: #8794a2; padding: 4px; display: grid; gap: 3px; place-items: center; font-size: 11px; }
.nav-item .nav-icon { font-size: 21px; }
.nav-item.active { color: var(--blue); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); background: var(--ink); color: white; padding: 11px 17px; border-radius: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; font-size: 14px; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.empty { text-align: center; color: var(--ink-soft); padding: 42px 20px; }
.backline { display: flex; align-items: center; gap: 10px; margin: 2px 0 18px; }
.backline button { border: 0; background: white; width: 38px; height: 38px; border-radius: 13px; }
.backline span { color: var(--ink-soft); font-size: 13px; }

.login-shell { min-height: 100dvh; max-width: 520px; margin: 0 auto; padding: max(34px, env(safe-area-inset-top)) 22px 40px; display: flex; flex-direction: column; justify-content: space-between; background: var(--ink); color: white; position: relative; overflow: hidden; }
.login-shell::after { content: ""; position: absolute; width: 360px; height: 360px; border: 70px solid rgba(255,255,255,.035); border-radius: 50%; top: -150px; right: -180px; }
.login-brand { position: relative; z-index: 1; }
.login-brand .brand-mark { background: white; color: var(--ink); margin-bottom: 40px; }
.login-brand h1 { font-size: 37px; }
.login-brand p:not(.eyebrow) { color: #afbed0; max-width: 390px; }
.login-card { position: relative; z-index: 1; background: white; color: var(--ink); border-radius: 26px; padding: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.login-card h2 { margin-bottom: 20px; }
.form-error { background: #fff0f0; color: var(--danger); padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.connection-card { border: 1px solid #f0cfaa; background: #fffaf3; border-radius: 22px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.connection-card.connected { border-color: #b9e6d6; background: #f4fcf8; }
.connection-card > div { min-width: 0; }
.connection-card strong { display: inline; margin-left: 7px; }
.connection-card small { display: block; color: var(--ink-soft); margin: 7px 0 0 17px; }
.connection-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); }
.connected .connection-dot { background: var(--mint); }
.connection-card button { padding: 10px 12px; min-height: 42px; white-space: nowrap; }
.admin-user { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 13px; display: flex; align-items: center; gap: 11px; margin-bottom: 9px; }
.admin-user .avatar { width: 42px; height: 42px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 800; }
.admin-user > div:nth-child(2) { flex: 1; min-width: 0; }
.admin-user small { display: block; color: var(--ink-soft); margin-top: 4px; }
.status-pill { border: 0; border-radius: 30px; padding: 7px 10px; background: #edf0f2; color: var(--ink-soft); font-size: 12px; }
.status-pill.active { background: var(--mint-soft); color: var(--mint); }
.admin-form { margin-top: 0; }
.admin-loading { padding: 40px; text-align: center; color: var(--ink-soft); }

@media (min-width: 700px) {
  body { background: #e9edf0; }
  .shell { box-shadow: 0 0 70px rgba(11,31,58,.12); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
