/* Checkout 收银台 — JD-style light theme */
* { box-sizing: border-box; }

:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --border: #e5e6eb;
  --text: #1d2129;
  --muted: #86909c;
  --accent: #e1251b;        /* JD red */
  --accent-dark: #c0180f;
  --alipay: #1677ff;
  --wechat: #07c160;
  --ok: #07c160;
  --danger: #e1251b;
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px 6px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #ff6a3d);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; }
.brand-text span { font-size: 11px; color: var(--muted); }
.secure {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted);
}

/* ---- shell ---- */
.shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

/* ---- card ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 6px 24px -18px rgba(0,0,0,.4);
}
.card-title {
  margin: 0 0 20px;
  font-size: 17px;
  color: var(--text);
}

/* ---- fields ---- */
.field { margin-bottom: 20px; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.field-hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

input[type="text"] {
  width: 100%;
  padding: 11px 12px;
  font-size: 15px;
  color: var(--text);
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(225,37,27,.1);
}

/* amount */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.quick-chip {
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: #fafbfc;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  transition: border-color .15s, color .15s, background .15s;
}
.quick-chip:hover { border-color: #c9cdd4; }
.quick-chip[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff8f7;
}
.amount-input {
  display: flex; align-items: center;
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color .15s, box-shadow .15s;
}
.amount-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(225,37,27,.12);
}
.amount-input .cny { font-size: 24px; color: var(--text); font-weight: 600; margin-right: 6px; }
.amount-input input {
  flex: 1;
  border: none; background: transparent;
  font-size: 30px; font-weight: 700;
  color: var(--text);
  outline: none;
  padding: 0;
  font-variant-numeric: tabular-nums;
}
.amount-input input::placeholder { color: #c9cdd4; font-weight: 400; }

/* ---- channel cards ---- */
.channel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.channel-card {
  display: flex; align-items: center; gap: 8px;
  padding: 14px;
  background: #fafbfc;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  position: relative;
  transition: border-color .15s, background .15s;
}
.channel-card:hover { border-color: #c9cdd4; }
.channel-card[aria-pressed="true"] {
  border-color: var(--accent);
  background: #fff8f7;
}
.channel-logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  color: #fff;
  font-size: 16px; font-weight: 600;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.channel-logo.alipay { background: var(--alipay); }
.channel-logo.wechat { background: var(--wechat); }
.channel-name { font-size: 14px; flex: 1; text-align: left; }
.channel-check {
  color: var(--accent);
  font-size: 15px;
  opacity: 0;
  transition: opacity .15s;
}
.channel-card[aria-pressed="true"] .channel-check { opacity: 1; }

/* ---- buttons ---- */
.btn {
  display: block;
  width: 100%;
  padding: 13px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled, .btn-mock:disabled { opacity: .55; cursor: not-allowed; }
.btn-mock {
  margin-top: 14px;
  background: #eef9f2; color: #0b8a4e;
  border: 1px solid #cdf0dc;
  font-size: 14px;
}
.btn-mock:hover { background: #dff4e8; }
.btn-ghost {
  margin-top: 10px;
  background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 400;
}
.btn-ghost:hover { color: var(--text); }

.error { color: var(--danger); font-size: 13px; margin: 14px 0 0; text-align: center; }

/* ---- pay view ---- */
.pay-head {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}
.pay-label { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.pay-amount { margin: 0; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pay-amount .cny { font-size: 20px; margin-right: 4px; }
.chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
}
.chip.alipay { background: var(--alipay); }
.chip.wechat { background: var(--wechat); }

.qr-card {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}
.qr-logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  color: #fff;
  font-size: 18px; font-weight: 700;
  display: grid; place-items: center;
  margin: 0 auto 12px;
}
.qr-logo.alipay { background: var(--alipay); }
.qr-logo.wechat { background: var(--wechat); }
.qr-card img {
  width: 230px; height: 230px;
  background: #fff;
  padding: 8px;
  border-radius: 10px;
  display: inline-block;
}
.qr-tip { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.qr-tip b { color: var(--text); }

.order-id {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.pay-status {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 16px 0 0;
  font-size: 14px;
}
.countdown { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.countdown.expired { color: var(--danger); }

/* ---- success ---- */
.center { text-align: center; }
.ok {
  width: 68px; height: 68px;
  margin: 6px auto 14px;
  border-radius: 50%;
  background: #f0fbf5;
  color: var(--ok);
  font-size: 36px;
  line-height: 68px;
}
.done-title { margin: 0 0 6px; font-size: 20px; }
.done-sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.done-detail {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 14px;
  margin-bottom: 20px;
}
.done-row {
  display: flex; justify-content: space-between;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid #f2f3f5;
}
.done-row:last-child { border-bottom: none; }
.done-row span:first-child { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; word-break: break-all; }

.foot {
  text-align: center;
  padding: 8px 16px 32px;
  color: #c0c4cc;
  font-size: 12px;
}

@media (max-width: 480px) {
  .shell { padding: 12px 12px 32px; }
  .card { padding: 20px 16px; }
  .qr-card img { width: 200px; height: 200px; }
}