:root {
  color-scheme: light;
  --ink: #243b40;
  --muted: #677d81;
  --brand: #247b73;
  --line: rgba(97, 136, 142, .16);
  --soft: #eef8f5;
  --bg: #f4f8f8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 280px;
  color: var(--ink);
  background: radial-gradient(ellipse at 10% 0%, #dcefe9 0, transparent 43%), radial-gradient(ellipse at 95% 15%, #e0edf6 0, transparent 38%), var(--bg);
  font: 14px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s, border-color .18s, box-shadow .18s;
  touch-action: manipulation;
}
button:hover:not(:disabled) { background: #fff; border-color: #9abeb8; box-shadow: 0 3px 12px #335c6208; }
button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
button.primary:hover:not(:disabled) { background: #1b655f; border-color: #1b655f; }
button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #68a9a1; outline-offset: 3px; }
.danger { color: #a04d49; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; font-weight: 650; letter-spacing: .5px; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 600; }
.shell { max-width: 1220px; margin: auto; padding: 26px 40px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 22px; }
.tabs { display: flex; flex-shrink: 0; gap: 4px; padding: 5px; border: 1px solid #ffffffcc; background: #ffffff59; border-radius: 16px; }
.tabs button { border: 1px solid transparent; background: transparent; color: var(--muted); padding: 9px 19px; }
.tabs button[aria-selected=true] { background: #fff; color: var(--brand); border-color: #ffffff; box-shadow: 0 2px 9px #42656a0a; }
.message { margin-bottom: 18px; padding: 10px 14px; color: #526f74; font-size: 12px; background: #ffffff6b; border: 1px solid #ffffffb8; border-radius: 13px; overflow-wrap: anywhere; }
.message.error { background: #fff3f0; border-color: #edd6d0; color: #98493d; }
.message.success { background: var(--soft); border-color: #cde6dc; color: #286c5b; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 304px; gap: 22px; align-items: start; }
.workspace, .sidebar { min-width: 0; }
.card { background: rgba(255, 255, 255, .7); border: 1px solid rgba(255, 255, 255, .94); border-radius: 22px; box-shadow: 0 8px 32px #35535b05, 0 1px 3px #35535b04; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 25px; border-bottom: 1px solid var(--line); }
.card-body { padding: 25px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.file-drop { border: 1px dashed #bfd5d1; border-radius: 17px; background: #f8fcfb85; padding: 20px 18px; text-align: center; }
.file-drop.drag-over { background: #e5f4ef; border-color: var(--brand); }
.file-drop h3 { font-weight: 550; margin-bottom: 12px; }
.file-meta { background: #f5f9f8b8; border: 1px solid var(--line); border-radius: 13px; padding: 10px 14px; margin-top: 18px; }
.info-row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.info-row:last-child { border: 0; }
.info-row > span:first-child { color: var(--muted); flex-shrink: 0; }
.info-row > span:last-child, .info-row code { min-width: 0; text-align: right; overflow-wrap: anywhere; }
.hash { max-width: 73%; font: 10px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.transfer-stage { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(140px, .62fr); gap: 25px; align-items: center; margin-top: 24px; }
.qr-box { display: grid; place-items: center; position: relative; min-width: 0; aspect-ratio: 1; padding: 14px; background: #fff; color: #000; border: 1px solid #e5eceb; border-radius: 16px; opacity: 1; filter: none; transform: none; }
.qr-holder { width: 100%; background: #fff; opacity: 1; filter: none; transform: none; }
.qr-holder:empty { display: none; }
.qr-holder svg { display: block; width: 100%; height: auto; background: #fff; opacity: 1; filter: none; transform: none; shape-rendering: crispEdges; }
.qr-placeholder { text-align: center; color: #788e92; font-size: 12px; }
.qr-placeholder > .icon { display: block; width: 42px; height: 42px; margin: 0 auto 13px; color: #b9ceca; }
.stats { min-width: 0; }
.stats h3 { font-size: 12px; font-weight: 550; margin-bottom: 18px; overflow-wrap: anywhere; }
.stat-label { color: var(--muted); font-size: 11px; }
.round-number { font-size: 35px; line-height: 1.4; font-weight: 400; font-variant-numeric: tabular-nums; margin-top: 3px; }
progress { display: block; appearance: none; -webkit-appearance: none; width: 100%; height: 5px; margin: 17px 0; background: #e6efed; border: 0; border-radius: 5px; overflow: hidden; }
progress::-webkit-progress-bar { background: #e6efed; }
progress::-webkit-progress-value { background: #4c9d91; border-radius: 5px; }
progress::-moz-progress-bar { background: #4c9d91; border-radius: 5px; }
.controls { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 23px; }
.sidebar .card-heading { padding: 18px 20px; }
.sidebar .card-heading h2 { font-size: 14px; }
.sidebar .card-body { padding: 20px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px 12px; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field.wide { grid-column: 1/-1; }
.form-field label { color: #5e7679; font-size: 11px; }
.form-field input, .form-field select { width: 100%; min-width: 0; min-height: 43px; border: 1px solid #dbe7e4; border-radius: 10px; background: #ffffffba; color: var(--ink); padding: 9px 10px; }
.form-field input:disabled, .form-field select:disabled { background: #edf3f1; color: #7a8a8c; }
.hint { color: var(--muted); font-size: 11px; margin-top: 14px; overflow-wrap: anywhere; }
.camera-box { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #edf3f2; }
.camera-box video { position: relative; display: block; width: 100%; height: auto; object-fit: contain; filter: none; opacity: 1; transform: none; }
.replay-controls { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.replay-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.replay-row input { flex: 1 1 160px; min-width: 0; }
.replay-controls input, #missingNumbers, #cameraSelect { width: 100%; border: 1px solid #dbe7e4; border-radius: 10px; background: #ffffffba; color: var(--ink); padding: 10px; font: inherit; }
.replay-controls label { font-size: 12px; color: var(--muted); }
#missingNumbers { margin-top: 8px; font-family: ui-monospace, monospace; }
#cameraSelect { margin-bottom: 12px; }
@media(max-width:720px) { .replay-controls input, #cameraSelect, #missingNumbers { font-size: 16px; } }
.camera-box .qr-placeholder { display: grid; place-items: center; min-height: 180px; padding: 25px; }
.camera-tag { display: inline-block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.scan-notice { margin-top: 11px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.scan-notice:empty, .missing:empty { display: none; }
.offer { margin-top: 20px; padding: 18px; border: 1px solid #eadfc6; border-radius: 14px; background: #fffbf3; }
.offer h3 { color: #826132; }
.offer p { margin-top: 6px; overflow-wrap: anywhere; }
.risk-label { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; margin-top: 14px; cursor: pointer; }
.risk-label input { width: 17px; height: 17px; accent-color: var(--brand); margin: 3px 0 0; flex-shrink: 0; }
.offer .controls { margin-top: 15px; }
.receive-result { margin-top: 22px; }
.receive-result > h3 { font-size: 14px; overflow-wrap: anywhere; }
.missing { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.notice { margin-bottom: 14px; padding: 12px 14px; border: 1px solid #e9dfc8; border-radius: 14px; background: #fffbf3bc; color: #82683e; font-size: 12px; overflow-wrap: anywhere; }
.bottom-card { margin-top: 22px; }
.bottom-card .card-heading { padding-top: 17px; padding-bottom: 17px; }
.bottom-card .card-heading h2 { font-size: 14px; }
.audit-actions { display: flex; gap: 7px; }
.audit-actions button { padding: 7px 11px; font-size: 11px; }
.audit-list { max-height: 290px; overflow: auto; }
.audit-row { display: grid; gap: 4px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.audit-row:last-child { border: 0; }
.audit-row strong { font-weight: 550; overflow-wrap: anywhere; }
.audit-row span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.audit-row code { color: #71888b; font-size: 10px; overflow-wrap: anywhere; }
.audit-count { color: var(--muted); font-size: 10px; font-weight: 400; margin-left: 6px; }
noscript { display: block; margin: 20px; color: #98493d; }
@supports not (backdrop-filter: blur(18px)) { .card { background: #fcfdfd; } }
@media (max-width: 1040px) {
  .shell { padding: 26px; }
  .layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
  .card-heading, .card-body { padding: 21px; }
  .transfer-stage { grid-template-columns: 1fr; gap: 20px; }
  .qr-box { width: 100%; max-width: 360px; margin: auto; }
  .stats { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 18px; }
  .stats h3 { margin-bottom: 0; }
  .stats > div { display: flex; align-items: baseline; gap: 10px; }
  .round-number { font-size: 25px; }
  .stats progress { grid-column: 1/-1; }
  .controls button { flex: 1; }
  .tabs button { padding-inline: 15px; }
}
@media (max-width: 720px) {
  .shell { padding: 20px 16px 26px; }
  .topbar { flex-wrap: wrap; margin-bottom: 18px; gap: 14px; }
  h1 { font-size: 18px; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; }
  .message { font-size: 12px; margin-bottom: 17px; padding: 11px 13px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .card { border-radius: 19px; }
  .card-heading { padding: 17px 18px; gap: 12px; }
  .card-body { padding: 18px; }
  .file-drop { padding: 20px 13px; border-radius: 14px; }
  .qr-box { padding: 12px; max-width: 400px; }
  .transfer-stage { margin-top: 20px; gap: 18px; }
  .stats { grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; }
  .stat-label { font-size: 10px; }
  .round-number { font-size: 23px; }
  .controls { gap: 7px; margin-top: 19px; }
  .controls button { padding: 10px 8px; font-size: 12px; }
  .bottom-card { margin-top: 18px; }
  .bottom-card .card-heading { flex-wrap: wrap; }
  .audit-actions { margin-left: auto; }
  .sidebar .card-heading, .sidebar .card-body { padding: 18px; }
  .form-field input, .form-field select { font-size: 16px; }
}
@media (max-width: 359px) {
  .shell { padding-inline: 12px; }
  .stats { display: block; }
  .stats > div { margin-top: 7px; }
  .controls button { flex-basis: 40%; }
}
.shell { max-width: 1160px; padding-top: 24px; }
.topbar { margin-bottom: 22px; }
.topbar .tabs { margin-left: auto; }
.card-heading { padding-top: 17px; padding-bottom: 17px; }
.file-drop { padding: 22px 16px; }
.file-drop .primary { margin-top: 14px; }
.scan-notice:empty, .missing:empty { display: none; }
@media (max-width: 720px) { .topbar { flex-wrap: wrap; margin-bottom: 18px; } .topbar .tabs { width: auto; margin-top: 0; } .topbar .tabs button { padding: 8px 12px; } }
@media (max-width: 359px) { .topbar .tabs { width: 100%; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
