:root {
  --ink:#172033;
  --muted:#667085;
  --line:#dfe5ec;
  --background:#f2f5f8;
  --navy:#25324a;
  --blue:#315ea8;
  --green:#18794e;
  --red:#b42318;
}

* { box-sizing:border-box; }
html { background:var(--background); }
body {
  margin:0;
  min-width:320px;
  background:var(--background);
  color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC",sans-serif;
  -webkit-font-smoothing:antialiased;
}
button,a { font:inherit; }

.scanner-shell { width:min(620px,100%); margin:0 auto; padding:20px 16px 48px; }
.brand { display:flex; align-items:center; gap:10px; margin-bottom:18px; }
.brand-mark { display:grid; place-items:center; width:42px; height:42px; border-radius:13px; background:var(--navy); color:#fff; font-size:12px; font-weight:850; }
.brand strong,.brand small { display:block; }
.brand strong { font-size:13px; letter-spacing:.04em; }
.brand small { margin-top:2px; color:var(--muted); font-size:10px; }

.hero { overflow:hidden; padding:24px 20px; border-radius:22px; background:linear-gradient(135deg,var(--navy),var(--blue)); color:#fff; box-shadow:0 16px 40px rgba(28,39,60,.12); }
.eyebrow { margin:0; font-size:10px; font-weight:800; letter-spacing:.15em; opacity:.7; }
.hero h1 { margin:8px 0 6px; font-size:28px; }
.hero>p:last-child { margin:0; color:rgba(255,255,255,.78); font-size:12px; line-height:1.65; }

.card { margin-top:16px; padding:18px; border:1px solid var(--line); border-radius:18px; background:#fff; box-shadow:0 7px 24px rgba(28,39,60,.05); }
.card h2 { margin:0; font-size:18px; }
.helper,.storage-note { color:var(--muted); font-size:11px; line-height:1.65; }
.helper { margin:7px 0 0; }
.storage-note { margin:14px 0 0; }

.video-frame { position:relative; overflow:hidden; margin-top:16px; border-radius:17px; background:#101828; aspect-ratio:3/4; }
.video-frame[hidden],.result-card[hidden] { display:none; }
.video-frame video { display:block; width:100%; height:100%; object-fit:cover; }
.video-frame>p { position:absolute; right:0; bottom:18px; left:0; margin:0; color:#fff; font-size:11px; font-weight:700; text-align:center; text-shadow:0 1px 5px #000; }
.scan-guide { position:absolute; top:50%; left:50%; width:min(68vw,260px); aspect-ratio:1; border:3px solid rgba(255,255,255,.9); border-radius:20px; box-shadow:0 0 0 999px rgba(0,0,0,.24); transform:translate(-50%,-54%); }

.status { margin-top:14px; padding:12px 13px; border-radius:11px; background:#f4f6f9; color:var(--muted); font-size:11px; line-height:1.6; overflow-wrap:anywhere; }
.status.success { background:#ecfdf3; color:var(--green); }
.status.error { background:#fef3f2; color:var(--red); }
.actions { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:13px; }
.actions.stacked { grid-template-columns:1fr; }
.button { display:flex; align-items:center; justify-content:center; min-height:48px; padding:0 15px; border:1px solid var(--line); border-radius:12px; background:#fff; color:var(--ink); font-size:12px; font-weight:750; text-align:center; text-decoration:none; }
.button.primary { border-color:var(--blue); background:var(--blue); color:#fff; }
.button:disabled { cursor:not-allowed; opacity:.5; }

.result-card { text-align:center; }
.success-mark { display:grid; place-items:center; width:62px; height:62px; margin:0 auto 14px; border-radius:19px; background:#ecfdf3; color:var(--green); font-size:28px; font-weight:850; }
.result-card .eyebrow { color:var(--green); }
.result-card h2 { margin-top:6px; }
.result-card dl { display:grid; gap:8px; margin:17px 0 0; text-align:left; }
.result-card dl div { padding:11px; border-radius:11px; background:#f5f7fa; }
.result-card dt,.result-card dd { margin:0; }
.result-card dt { color:var(--muted); font-size:9px; }
.result-card dd { margin-top:4px; font-size:12px; font-weight:750; overflow-wrap:anywhere; }

@media (min-width:600px) {
  .scanner-shell { padding-top:34px; }
  .video-frame { aspect-ratio:4/3; }
  .scan-guide { width:260px; }
}
