/* Bento · 柔和浅灰 */
:root {
  --bg: #ececf0;
  --card: #f7f7f8;
  --bd: #e0e0e5;
  --tx: #2c2c2e;
  --mut: #6e6e73;
  --acc: #0a5fbd;
  --acc-hover: #084e9c;
  --hlb: #dce8f6;
  --r: 20px;
  --sh: 0 4px 18px rgba(0, 0, 0, 0.05);
  --ok: #248a3d;
  --bad: #d70015;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  max-width: 400px;
  margin: 0 auto;
}

.wrap { flex: 1; }
.wrap.hidden { display: none !important; }

.grid { display: flex; flex-direction: column; gap: 12px; }
.cell {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  box-shadow: var(--sh);
  padding: 18px;
}
.cell.center { text-align: center; }

.result-card { position: relative; padding-top: 12px; }
.back-btn {
  position: absolute;
  top: 12px;
  left: 10px;
  z-index: 2;
  border: none;
  background: transparent;
  color: var(--acc);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 10px;
}
.back-btn:active { background: var(--hlb); }

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
h1.title-left { justify-content: flex-start; }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acc);
  flex-shrink: 0;
}
.sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--mut);
  text-align: center;
}
.order-line {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--mut);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--hlb);
  color: var(--acc);
  white-space: nowrap;
}

/* 支付主区：倒计时在二维码上方 */
.pay-main { text-align: center; padding: 20px 18px 22px; }
.timer-bar {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--hlb);
  border-radius: 12px;
}
.timer-label {
  font-size: 13px;
  color: var(--mut);
}
.timer-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--acc);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.qr-frame {
  width: 160px;
  height: 160px;
  margin: 0 auto 16px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--bd);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.qr-frame svg { width: 140px; height: 140px; display: block; }

.amt {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  text-align: center;
}
.amt-unit {
  font-size: 12px;
  color: var(--mut);
  margin: 6px 0 18px;
  text-align: center;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

.btn {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  display: block;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: var(--acc);
  color: #f5f8fc;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.btn:active { background: var(--acc-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  color: var(--acc);
  border: 1px solid var(--bd);
  margin-top: 16px;
  max-width: 200px;
}

.tip {
  font-size: 11px;
  color: var(--mut);
  margin: 12px 0 0;
  text-align: center;
}

.result {
  padding: 48px 16px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.result h1 {
  width: 100%;
  justify-content: center;
}
.result-amount {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--mut);
  text-align: center;
  width: 100%;
}
.result-amount strong {
  color: var(--tx);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin: 0 4px;
}

.icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 26px;
  font-weight: 700;
}
.icon.ok { background: rgba(36, 138, 61, 0.12); color: var(--ok); }
.icon.bad { background: rgba(215, 0, 21, 0.1); color: var(--bad); }

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--bd);
  border-top-color: var(--acc);
  border-radius: 50%;
  margin: 24px auto 12px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.mut { color: var(--mut); font-size: 14px; }

.foot {
  text-align: center;
  font-size: 11px;
  color: var(--mut);
  margin-top: 16px;
  opacity: 0.85;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: rgba(44, 44, 46, 0.92);
  color: #f5f5f7;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 99;
  max-width: 86%;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.toast.show { opacity: 1; }

.copy-btn {
  border: 1px solid var(--bd);
  background: #fff;
  color: var(--acc);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}
.copy-btn:active { opacity: 0.75; }
.tip.disclaimer {
  color: #8a8a93;
  line-height: 1.45;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}
