/* 6+3 收银台 —— 简洁明亮样式 */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f2f5fa;
  --line: #e3e8f0;
  --line-strong: #d2d9e6;
  --text: #1c2133;
  --text-dim: #5b6480;
  --text-mute: #8d96ad;
  --brand: #ff6b35;
  --brand-2: #f59340;
  --cyan: #0f9b8e;
  --purple: #6d5ce7;
  --danger: #e04848;
  --ok: #0f9b8e;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(60, 72, 110, .12);
  --shadow-sm: 0 3px 12px rgba(60, 72, 110, .08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(800px 460px at 8% -6%, rgba(255, 107, 53, .11), transparent 60%),
    radial-gradient(700px 420px at 92% 0%, rgba(109, 92, 231, .09), transparent 62%);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; font-size: 15px; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
  height: 62px; display: flex; align-items: center; gap: 16px;
}
.logo { display: flex; align-items: baseline; gap: 7px; font-weight: 900; letter-spacing: 1px; }
.logo .n6 { color: var(--text); font-size: 21px; }
.logo .n3 { color: var(--brand); font-size: 21px; }
.logo .sub { color: var(--text-mute); font-size: 13px; font-weight: 700; letter-spacing: 2px; margin-left: 4px; }
.spacer { flex: 1; }
.top-stat { display: flex; gap: 20px; align-items: center; }
.top-stat div { display: flex; flex-direction: column; align-items: flex-end; }
.top-stat b { font-size: 17px; color: var(--brand); font-weight: 900; line-height: 1.2; }
.top-stat span { font-size: 11px; color: var(--text-mute); }

/* ---------- 布局 ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 22px 20px 60px; }
.cols { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.card-panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.card-title { margin: 0 0 14px; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }

/* ---------- 金额输入 ---------- */
.amount-box {
  background: linear-gradient(135deg, #fff6f1, #fff);
  border: 1px solid rgba(255, 107, 53, .25);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px;
}
.amount-box label { font-size: 13px; font-weight: 700; color: var(--text-dim); display: block; margin-bottom: 8px; }
.amount-input { display: flex; align-items: baseline; gap: 8px; }
.amount-input .sym { font-size: 30px; font-weight: 900; color: var(--brand); }
.amount-input input {
  flex: 1; border: none; outline: none; background: none;
  font-size: 44px; font-weight: 900; color: var(--text); letter-spacing: -1px;
  font-variant-numeric: tabular-nums; min-width: 0; padding: 0;
}
.amount-input input::placeholder { color: #d5dae5; }
.amount-input input::-webkit-outer-spin-button,
.amount-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.quick-amounts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.quick-amounts button {
  padding: 8px 15px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: #fff; border: 1px solid var(--line-strong); color: var(--text-dim); transition: .16s;
}
.quick-amounts button:hover { border-color: var(--brand); color: var(--brand); }
.quick-amounts button:active { transform: scale(.96); }

/* ---------- 扫码区 ---------- */
.scan-stage {
  position: relative; background: #eef1f7; border-radius: 14px;
  border: 1px dashed var(--line-strong);
  overflow: hidden; aspect-ratio: 16/9; max-height: 340px;
  display: flex; align-items: center; justify-content: center;
}
.scan-stage video { width: 100%; height: 100%; object-fit: cover; }
.scan-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; color: var(--text-mute); text-align: center; padding: 20px; }
.scan-placeholder .ico { font-size: 38px; opacity: .75; }
.scan-placeholder .sub { font-size: 12px; color: #a4adbf; }
.scan-frame { position: absolute; inset: 0; pointer-events: none; }
.scan-frame i {
  position: absolute; width: 30px; height: 30px; border: 3px solid var(--brand);
  border-radius: 4px;
}
.scan-frame i:nth-child(1) { top: 14%; left: 18%; border-right: 0; border-bottom: 0; }
.scan-frame i:nth-child(2) { top: 14%; right: 18%; border-left: 0; border-bottom: 0; }
.scan-frame i:nth-child(3) { bottom: 14%; left: 18%; border-right: 0; border-top: 0; }
.scan-frame i:nth-child(4) { bottom: 14%; right: 18%; border-left: 0; border-top: 0; }
.scan-line {
  position: absolute; left: 18%; right: 18%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  animation: sweep 2.2s ease-in-out infinite;
}
@keyframes sweep { 0%,100% { top: 16%; } 50% { top: 82%; } }
.scan-status {
  margin-top: 12px; padding: 11px 14px; border-radius: 10px;
  background: var(--panel-2); font-size: 13px; font-weight: 600; color: var(--text-dim);
  display: flex; align-items: center; gap: 8px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }
.dot.live { animation: blink 1.2s infinite; }
.dot.ok { background: var(--ok); }
.dot.err { background: var(--danger); }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; font-weight: 800; font-size: 15px;
  transition: .18s; border: 1px solid transparent;
}
.btn-primary { background: linear-gradient(135deg, var(--brand), #ff8f5e); color: #fff; box-shadow: 0 6px 18px rgba(255,107,53,.28); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(255,107,53,.34); }
.btn-primary:disabled { opacity: .45; transform: none; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--text-dim); }
.btn-ghost:hover { color: var(--brand); border-color: var(--brand); }
.btn-block { width: 100%; }

/* ---------- 结果 ---------- */
.result-panel { text-align: center; padding: 30px 22px; }
.result-ico { font-size: 60px; line-height: 1; }
.result-panel h2 { margin: 12px 0 6px; font-size: 24px; font-weight: 900; }
.result-panel .amount-big { font-size: 40px; font-weight: 900; color: var(--brand); letter-spacing: -1px; }
.result-panel .amount-big small { font-size: 24px; }
.result-meta { font-size: 13px; color: var(--text-mute); margin-top: 10px; line-height: 1.9; }
.result-meta code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--text-dim); }

.err-panel { border-color: rgba(224,72,72,.3); background: #fffafa; }
.err-panel h2 { color: var(--danger); }
.err-hint {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  background: #fef2f2; border: 1px solid rgba(224,72,72,.2);
  font-size: 13px; color: #a83232; text-align: left; line-height: 1.7;
}

/* ---------- 手动输入 ---------- */
.manual { margin-top: 14px; }
.manual summary {
  cursor: pointer; font-size: 13px; color: var(--text-mute); font-weight: 700;
  padding: 9px 0; list-style: none; user-select: none;
}
.manual summary::-webkit-details-marker { display: none; }
.manual summary::before { content: '⌄ '; color: var(--brand); }
.manual[open] summary::before { content: '⌃ '; }
.manual-body { padding-top: 8px; }
.manual input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text); outline: none;
}
.manual input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,107,53,.12); }
.manual-hint { font-size: 12px; color: var(--text-mute); margin: 8px 0 12px; }

/* ---------- 记录 ---------- */
.record { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line-strong); }
.record:last-child { border-bottom: none; }
.record .r-no { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--text-mute); }
.record .r-amt { font-weight: 900; color: var(--text); font-size: 15px; margin-left: auto; }
.pill { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; border: 1px solid; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: #fff; border: 1px solid var(--line); color: var(--text);
  box-shadow: 0 8px 24px rgba(60,72,110,.16); animation: slideDown .26s ease;
}
.toast.err { border-color: rgba(224,72,72,.45); color: #c93b3b; background: #fef4f4; }
.toast.ok { border-color: rgba(15,155,142,.45); color: #0b8b80; background: #f2fcfa; }
@keyframes slideDown { from { transform: translateY(-14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- 响应式 ---------- */
@media (max-width: 880px) {
  .cols { grid-template-columns: 1fr; }
  .wrap { padding: 16px 14px 40px; }
  .top-stat { gap: 14px; }
  .top-stat b { font-size: 15px; }
  .amount-input input { font-size: 36px; }
  .card-panel { padding: 18px; }
}
@media (max-width: 520px) {
  .logo .sub { display: none; }
  .top-stat div:nth-child(2) { display: none; }
}
