* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #0f172a; color: #e5e7eb; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #111827; font-size: 18px; font-weight: 700;
  position: sticky; top: 0; z-index: 10;
}
header small { font-weight: 400; color: #9ca3af; font-size: 12px; }
main { padding: 14px; max-width: 560px; margin: 0 auto; }

/* 摄像头取景 */
.camWrap { position: relative; width: 100%; aspect-ratio: 4/3; background: #000; border-radius: 14px; overflow: hidden; }
.camWrap video { width: 100%; height: 100%; object-fit: cover; }
.roiBox {
  position: absolute; left: 15%; top: 15%; width: 70%; height: 70%;
  border: 3px solid #22d3ee; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(0,0,0,.28);
  pointer-events: none;
}
.camHint { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 14px; color: #e5e7eb; text-shadow: 0 1px 3px #000; }
.fileFallback { text-align: center; }

/* 按钮 */
.bigBtn {
  display: block; width: 100%; padding: 18px; margin-top: 12px; border: none; border-radius: 14px;
  font-size: 20px; font-weight: 700; color: #fff; background: #374151; cursor: pointer; text-align: center;
}
.bigBtn.primary { background: #2563eb; }
.bigBtn.ghost { background: #1f2937; color: #9ca3af; }
.smallBtn { padding: 8px 14px; border: 1px solid #374151; background: #1f2937; color: #e5e7eb; border-radius: 10px; font-size: 14px; }
.status { margin-top: 10px; padding: 10px; background: #1e293b; border-radius: 10px; text-align: center; color: #fbbf24; }

/* 结果卡 */
.card { margin-top: 14px; background: #1e293b; border-radius: 16px; padding: 16px; }
.bigBin { font-size: 40px; font-weight: 800; color: #fff; text-align: center; padding: 22px; border-radius: 14px; background: #2563eb; }
.detail { text-align: center; font-size: 17px; margin-top: 10px; color: #cbd5e1; }
.ocrText { text-align: center; font-family: ui-monospace, monospace; font-size: 14px; color: #94a3b8; margin-top: 6px; }
.reviewFlag { margin-top: 10px; padding: 10px; background: #422006; color: #fbbf24; border-radius: 10px; text-align: center; font-size: 14px; }
.actions { display: flex; gap: 10px; }
.actions .bigBtn { flex: 1; }
.altLabel { margin-top: 14px; font-size: 13px; color: #94a3b8; }
.altBins { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { padding: 10px 14px; border: 2px solid #475569; background: #0f172a; border-radius: 999px; font-size: 15px; font-weight: 600; cursor: pointer; }

/* 计数 */
.tallyCard { margin-top: 18px; background: #111827; border-radius: 14px; padding: 14px; }
.tallyHead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tallyGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tallyItem { display: flex; align-items: center; gap: 8px; font-size: 15px; background: #1e293b; padding: 10px; border-radius: 10px; }
.tallyItem b { margin-left: auto; font-size: 18px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* 手动测试输入 */
.manualBox { margin-top: 12px; background: #111827; border-radius: 12px; padding: 10px 14px; color: #94a3b8; font-size: 14px; }
.manualBox summary { cursor: pointer; }
.manualRow { display: flex; gap: 8px; margin-top: 10px; }
.manualInput { flex: 1; padding: 12px; border-radius: 10px; border: 1px solid #374151; background: #0f172a; color: #e5e7eb; font-size: 16px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.modalCard { width: 100%; max-width: 420px; background: #1e293b; border-radius: 16px; padding: 18px; }
.modalTitle { font-size: 19px; font-weight: 700; }
.modalHint { font-size: 14px; color: #94a3b8; margin: 8px 0 12px; }
.modalInput { width: 100%; padding: 14px; border-radius: 10px; border: 1px solid #475569; background: #0f172a; color: #e5e7eb; font-size: 18px; }
.modalCard .actions { margin-top: 14px; }

/* 提示闪条 */
.flash {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #16a34a; color: #fff; padding: 14px 26px; border-radius: 999px; font-size: 18px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 50;
}
