:root {
  --navy-950: #061126;
  --navy-900: #08172f;
  --navy-850: #0b1d3b;
  --navy-800: #10264a;
  --navy-700: #17365f;
  --ink-900: #111827;
  --ink-800: #1f2937;
  --ink-700: #374151;
  --ink-600: #4b5563;
  --ink-500: #6b7280;
  --ink-400: #9ca3af;
  --line: #e8edf4;
  --line-strong: #dbe3ee;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-blue: #f2f8ff;
  --alipay: #1677ff;
  --alipay-dark: #0868ee;
  --alipay-soft: #edf6ff;
  --wechat: #07c160;
  --wechat-dark: #05a951;
  --wechat-soft: #effbf4;
  --gold: #d8b56a;
  --gold-light: #f2d99c;
  --success: #12a66a;
  --danger: #e04f5f;
  --warning: #e9902d;
  --shadow-card: 0 36px 100px rgba(16, 38, 74, .16), 0 8px 26px rgba(16, 38, 74, .07);
  --shadow-modal: 0 30px 100px rgba(3, 12, 29, .28);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #f3f6fb; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink-900);
  background:
    radial-gradient(circle at 10% 8%, rgba(22, 119, 255, .08), transparent 28%),
    radial-gradient(circle at 92% 86%, rgba(216, 181, 106, .09), transparent 25%),
    linear-gradient(145deg, #f8fafe 0%, #f1f5fa 48%, #f7f9fc 100%);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, a { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { color: inherit; }
svg { display: block; }

.page-atmosphere {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.glow { position: absolute; border-radius: 999px; filter: blur(4px); }
.glow-a {
  width: 520px;
  height: 520px;
  left: -240px;
  top: -250px;
  background: radial-gradient(circle, rgba(22, 119, 255, .13), transparent 70%);
}
.glow-b {
  width: 460px;
  height: 460px;
  right: -220px;
  bottom: -220px;
  background: radial-gradient(circle, rgba(216, 181, 106, .14), transparent 70%);
}
.fine-grid {
  position: absolute;
  inset: 0;
  opacity: .24;
  background-image:
    linear-gradient(rgba(25, 54, 95, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 54, 95, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
}

.topbar {
  width: min(1180px, calc(100% - 48px));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--navy-900);
}

.brand-emblem {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: var(--gold);
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--navy-900), var(--navy-800));
  box-shadow: 0 12px 28px rgba(8, 23, 47, .18), inset 0 0 0 1px rgba(255,255,255,.08);
}
.brand-emblem svg { width: 34px; height: 34px; }
.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-size: 20px; line-height: 1; letter-spacing: .06em; }
.brand-copy small { color: var(--ink-500); font-size: 11px; letter-spacing: .22em; }

.topbar-actions { display: flex; align-items: center; gap: 24px; }
.secure-indicator, .help-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-600);
  font-size: 13px;
}
.secure-indicator svg, .help-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.secure-indicator { color: #19835c; }
.help-link { border: 0; background: transparent; cursor: pointer; padding: 8px 0; }
.help-link:hover { color: var(--navy-900); }

.page-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 18px auto 0;
  padding-bottom: 26px;
}

.checkout-card {
  display: grid;
  grid-template-columns: minmax(0, 44%) minmax(0, 56%);
  min-height: 670px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(219, 227, 238, .72);
  animation: cardEnter .72s var(--ease) both;
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(16px) scale(.992); }
  to { opacity: 1; transform: none; }
}

.order-side {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 85% 12%, rgba(52, 113, 202, .26), transparent 28%),
    radial-gradient(circle at 14% 92%, rgba(216, 181, 106, .13), transparent 26%),
    linear-gradient(145deg, var(--navy-850), var(--navy-950));
}

.order-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.035), transparent 40%);
  z-index: -1;
}

.order-side-pattern {
  position: absolute;
  width: 330px;
  height: 330px;
  right: -120px;
  top: -110px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 50%;
}
.order-side-pattern::before,
.order-side-pattern::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 50%;
}
.order-side-pattern::before { inset: 34px; }
.order-side-pattern::after { inset: 76px; }

.order-side-content {
  position: relative;
  z-index: 1;
  min-height: 100%;
  padding: 48px 44px 42px;
  display: flex;
  flex-direction: column;
}

.order-heading-row { display: flex; justify-content: space-between; gap: 18px; }
.section-kicker {
  display: block;
  margin-bottom: 9px;
  color: var(--gold-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
}
.section-kicker.dark { color: #7a8ca8; }
.order-heading-row h1, .payment-side-head h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.order-heading-row p, .payment-side-head p {
  margin: 9px 0 0;
  color: rgba(255,255,255,.58);
  font-size: 13px;
  line-height: 1.7;
}
.pending-badge {
  height: 30px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border-radius: 99px;
  color: #dbeafe;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.09);
  font-size: 12px;
}
.pending-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #66a9ff;
  box-shadow: 0 0 0 4px rgba(102,169,255,.12);
}

.amount-hero { padding: 54px 0 45px; }
.amount-hero > span { color: rgba(255,255,255,.58); font-size: 13px; }
.amount-value { display: flex; align-items: flex-start; gap: 9px; margin-top: 10px; }
.amount-value small { margin-top: 8px; color: var(--gold-light); font-size: 24px; font-weight: 600; }
.amount-value strong {
  color: #fff;
  font-size: clamp(46px, 5vw, 62px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
  text-shadow: 0 8px 32px rgba(0,0,0,.2);
  word-break: break-all;
}
.amount-picker {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.amount-input-wrap {
  margin-top: 22px;
}
.amount-input-label {
  display: block;
  color: rgba(255,255,255,.58);
  font-size: 13px;
}
.amount-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.amount-input-prefix {
  color: var(--gold-light);
  font-size: 20px;
  font-weight: 600;
}
.amount-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  color: #fff;
  background: rgba(255,255,255,.06);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.amount-input::placeholder {
  color: rgba(255,255,255,.34);
  font-weight: 500;
}
.amount-input:focus {
  border-color: rgba(216,181,106,.55);
  box-shadow: 0 0 0 3px rgba(216,181,106,.08);
}
.amount-input.invalid {
  border-color: rgba(255,120,120,.65);
  box-shadow: 0 0 0 3px rgba(255,120,120,.12);
}
.amount-random-btn {
  flex-shrink: 0;
  height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(216,181,106,.35);
  border-radius: 10px;
  color: #fff;
  background: rgba(216,181,106,.14);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.amount-random-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(216,181,106,.55);
  background: rgba(216,181,106,.22);
}
.amount-range-hint {
  margin: 10px 0 0;
  color: rgba(255,255,255,.48);
  font-size: 12px;
}
.amount-option {
  min-width: 72px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.06);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}
.amount-option:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.28);
  color: #fff;
}
.amount-option.active {
  color: #fff;
  border-color: rgba(216,181,106,.55);
  background: rgba(216,181,106,.16);
  box-shadow: 0 0 0 3px rgba(216,181,106,.08);
}
.countdown-line {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.64);
  font-size: 13px;
}
.countdown-line svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.countdown-line strong { color: #fff; font-variant-numeric: tabular-nums; }
.countdown-line.urgent strong { color: #ffc77a; }

.order-divider { height: 1px; background: linear-gradient(90deg, rgba(255,255,255,.13), rgba(255,255,255,.02)); }

.order-details { margin: 30px 0 0; display: grid; gap: 20px; }
.order-details > div { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 18px; align-items: start; }
.order-details dt { color: rgba(255,255,255,.45); font-size: 12px; }
.order-details dd { margin: 0; min-width: 0; color: rgba(255,255,255,.88); font-size: 13px; text-align: right; overflow-wrap: anywhere; }
.order-number-wrap { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.order-number-wrap code { color: rgba(255,255,255,.88); font: inherit; font-variant-numeric: tabular-nums; }
.copy-mini {
  width: 24px; height: 24px; padding: 0; flex: 0 0 auto; display: grid; place-items: center;
  border: 0; border-radius: 7px; color: rgba(255,255,255,.55); background: rgba(255,255,255,.06); cursor: pointer;
}
.copy-mini:hover { color: #fff; background: rgba(255,255,255,.11); }
.copy-mini svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; }

.trust-note {
  margin-top: auto;
  padding-top: 30px;
  display: flex;
  gap: 13px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.trust-icon {
  width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 12px; color: var(--gold-light); background: rgba(216,181,106,.1); border: 1px solid rgba(216,181,106,.14);
}
.trust-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.trust-note strong { font-size: 13px; font-weight: 600; }
.trust-note p { margin: 6px 0 0; color: rgba(255,255,255,.46); font-size: 11px; line-height: 1.7; }

.payment-side {
  padding: 48px 54px 42px;
  display: flex;
  flex-direction: column;
}
.payment-side-head { display: flex; align-items: flex-start; justify-content: space-between; }
.payment-side-head h2 { color: var(--ink-900); }
.payment-side-head p { color: var(--ink-500); }
.shield-chip {
  width: 42px; height: 42px; display: grid; place-items: center;
  color: #1c8f69; border-radius: 13px; background: #effaf6; border: 1px solid #d9f3e8;
}
.shield-chip svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.payment-methods { display: grid; gap: 14px; margin-top: 38px; }
.payment-option {
  width: 100%;
  min-height: 88px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  transition: border-color .22s ease, background .22s ease, box-shadow .22s ease, transform .22s ease;
}
.payment-option:hover { transform: translateY(-1px); border-color: #c8d4e4; box-shadow: 0 12px 28px rgba(32, 56, 92, .07); }
.payment-option.alipay.active { border-color: rgba(22,119,255,.75); background: var(--alipay-soft); box-shadow: 0 0 0 3px rgba(22,119,255,.07); }
.payment-option.wechat.active { border-color: rgba(7,193,96,.75); background: var(--wechat-soft); box-shadow: 0 0 0 3px rgba(7,193,96,.07); }
.channel-logo { width: 48px; height: 48px; flex: 0 0 auto; }
.channel-logo svg,
.channel-logo img { width: 100%; height: 100%; display: block; border-radius: 12px; object-fit: cover; }
.pay-button .button-channel-icon { font-size: 18px; font-weight: 700; line-height: 1; }
.alipay-logo { color: var(--alipay); }
.wechat-logo { color: var(--wechat); }
.channel-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 6px; }
.channel-title-row { display: flex; align-items: center; gap: 8px; }
.channel-copy strong { font-size: 15px; font-weight: 650; }
.channel-copy small { color: var(--ink-500); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-title-row em {
  padding: 3px 7px;
  border-radius: 5px;
  color: var(--alipay);
  background: rgba(22,119,255,.1);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}
.radio-ring {
  width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center;
  border: 1.5px solid #cbd5e1; border-radius: 50%; transition: .2s ease;
}
.radio-ring i { width: 8px; height: 8px; border-radius: 50%; transform: scale(0); transition: transform .2s var(--ease); }
.payment-option.alipay.active .radio-ring { border-color: var(--alipay); }
.payment-option.alipay.active .radio-ring i { background: var(--alipay); transform: scale(1); }
.payment-option.wechat.active .radio-ring { border-color: var(--wechat); }
.payment-option.wechat.active .radio-ring i { background: var(--wechat); transform: scale(1); }

.pay-summary { margin-top: 32px; display: flex; align-items: flex-end; justify-content: space-between; }
.pay-summary > span { color: var(--ink-500); font-size: 13px; }
.pay-summary strong { display: flex; align-items: flex-start; gap: 5px; color: var(--ink-900); font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.pay-summary strong small { margin-top: 4px; font-size: 17px; }

.pay-button {
  position: relative;
  height: 56px;
  margin-top: 20px;
  padding: 0 22px;
  overflow: hidden;
  border: 0;
  border-radius: 13px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(22,119,255,.2);
  transition: transform .2s ease, box-shadow .2s ease, background .25s ease;
}
.pay-button::after {
  content: "";
  position: absolute;
  top: 0; left: -45%; width: 34%; height: 100%;
  transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transition: left .55s ease;
}
.pay-button:hover::after { left: 115%; }
.pay-button:hover { transform: translateY(-1px); }
.pay-button:active { transform: translateY(0) scale(.995); }
.pay-button:disabled { cursor: not-allowed; opacity: .75; transform: none; }
.pay-button.alipay-button { background: linear-gradient(135deg, #2086ff, var(--alipay-dark)); box-shadow: 0 14px 28px rgba(22,119,255,.22); }
.pay-button.wechat-button { background: linear-gradient(135deg, #11ca69, var(--wechat-dark)); box-shadow: 0 14px 28px rgba(7,193,96,.2); }
.pay-button-content { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 600; }
.pay-button-content > strong { margin-left: 2px; font-size: 16px; }
.button-channel-icon { width: 24px; height: 24px; display: grid; place-items: center; }
.button-channel-icon svg { width: 24px; height: 24px; }
.button-loading { display: none; align-items: center; justify-content: center; gap: 10px; font-size: 14px; font-weight: 600; }
.pay-button.loading .pay-button-content { display: none; }
.pay-button.loading .button-loading { display: flex; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.payment-footnote { margin-top: 17px; display: flex; align-items: flex-start; gap: 8px; color: var(--ink-500); font-size: 11px; line-height: 1.65; }
.payment-footnote svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.security-row {
  margin-top: auto;
  padding-top: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border-top: 1px solid var(--line);
}
.security-row span { display: inline-flex; align-items: center; gap: 6px; color: #7b889d; font-size: 11px; }
.security-row span svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.security-row > i { width: 1px; height: 12px; background: var(--line-strong); }

.footer {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #8a96a8;
  font-size: 11px;
}
.footer i { width: 2px; height: 2px; border-radius: 50%; background: #aeb8c6; }
.footer button { border: 0; padding: 4px; color: inherit; background: transparent; cursor: pointer; }
.footer button:hover { color: var(--ink-700); }

/* Payment Modal */
.modal-layer, .info-dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .25s ease, visibility .25s ease;
}
.modal-layer.show, .info-dialog.show { visibility: visible; opacity: 1; }
.modal-scrim, .info-backdrop { position: absolute; inset: 0; background: rgba(4, 13, 31, .66); backdrop-filter: blur(8px); }
.payment-modal {
  position: relative;
  width: min(500px, 100%);
  min-height: 610px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px 34px 32px;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-modal);
  transform: translateY(14px) scale(.98);
  transition: transform .32s var(--ease);
}
.modal-layer.show .payment-modal { transform: none; }
.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #8090a7;
  background: #f4f7fa;
  cursor: pointer;
  z-index: 2;
}
.modal-close:hover { color: var(--ink-900); background: #eaf0f6; }
.modal-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.modal-brand { display: flex; align-items: center; gap: 9px; }
.mini-crown { width: 34px; height: 34px; display: grid; place-items: center; color: var(--gold); border-radius: 10px; background: var(--navy-900); }
.mini-crown svg { width: 25px; height: 25px; }
.modal-brand > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.modal-brand strong { font-size: 14px; }
.modal-brand small { color: var(--ink-400); font-size: 9px; letter-spacing: .12em; }
.modal-stage { padding-top: 22px; }
.stage-enter { animation: stageEnter .34s var(--ease) both; }
@keyframes stageEnter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.channel-heading { text-align: center; }
.channel-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.channel-pill.alipay { color: var(--alipay); background: var(--alipay-soft); }
.channel-pill.wechat { color: var(--wechat-dark); background: var(--wechat-soft); }
.channel-pill svg { width: 16px; height: 16px; }
.channel-heading h2 { margin: 16px 0 0; font-size: 22px; letter-spacing: -.02em; }
.channel-heading p { margin: 7px 0 0; color: var(--ink-500); font-size: 12px; line-height: 1.6; }
.modal-pay-amount { margin-top: 17px; color: var(--ink-900); font-size: 30px; font-weight: 720; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }

.qr-shell {
  width: 226px;
  height: 226px;
  margin: 23px auto 0;
  padding: 13px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(22, 41, 75, .09);
}
.qr-code {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  color: #0b1830;
  background: #fff;
}
.qr-code svg { width: 100%; height: 100%; }
.qr-code img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.qr-placeholder { color: var(--ink-400); font-size: 12px; }
.qr-center {
  position: absolute;
  width: 42px; height: 42px; display: grid; place-items: center;
  color: #fff; border: 5px solid #fff; border-radius: 12px;
}
.qr-center.alipay { background: var(--alipay); }
.qr-center.wechat { background: var(--wechat); }
.qr-center svg { width: 26px; height: 26px; }
.scan-line {
  position: absolute;
  left: 10px; right: 10px; top: 10px; height: 2px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: .7;
  animation: scan 2.4s ease-in-out infinite;
}
@keyframes scan { 0%,100% { transform: translateY(0); opacity: 0; } 15%,85% { opacity: .65; } 50% { transform: translateY(176px); } }

.payment-time { margin-top: 17px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink-500); font-size: 12px; }
.payment-time strong { color: var(--warning); font-variant-numeric: tabular-nums; }
.mobile-open-button, .modal-primary, .modal-secondary, .modal-text-button {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.mobile-open-button, .modal-primary { margin-top: 20px; border: 0; color: #fff; }
.mobile-open-button.alipay, .modal-primary.alipay { background: var(--alipay); }
.mobile-open-button.wechat, .modal-primary.wechat { background: var(--wechat); }
.mobile-open-button:hover, .modal-primary:hover { filter: brightness(.97); }
.modal-secondary { margin-top: 11px; color: var(--ink-700); background: #fff; border: 1px solid var(--line-strong); }
.modal-secondary:hover { background: var(--surface-soft); }
.modal-text-button { height: auto; margin-top: 12px; padding: 6px; border: 0; color: var(--ink-500); background: transparent; font-size: 12px; font-weight: 500; }
.modal-text-button:hover { color: var(--alipay); }
.modal-order-meta { margin-top: 20px; padding-top: 17px; display: flex; justify-content: center; gap: 7px; border-top: 1px solid var(--line); color: var(--ink-400); font-size: 10px; }
.modal-order-meta code { color: var(--ink-500); font: inherit; overflow-wrap: anywhere; }
.polling-note { margin-top: 13px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #8190a5; font-size: 10px; }
.polling-note i { width: 6px; height: 6px; border-radius: 50%; background: #2da47a; box-shadow: 0 0 0 4px rgba(45,164,122,.1); animation: pulse 1.5s ease infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.85); } }

.loading-state, .result-state { min-height: 480px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.loading-orbit {
  position: relative;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-blue);
}
.loading-orbit::before { content: ""; position: absolute; inset: -7px; border: 2px solid transparent; border-top-color: var(--alipay); border-right-color: rgba(22,119,255,.2); border-radius: 50%; animation: spin 1s linear infinite; }
.loading-orbit svg { width: 34px; height: 34px; fill: none; stroke: var(--alipay); stroke-width: 1.5; }
.loading-state h2, .result-state h2 { margin: 28px 0 0; font-size: 22px; }
.loading-state p, .result-state p { max-width: 330px; margin: 9px 0 0; color: var(--ink-500); font-size: 12px; line-height: 1.8; }
.query-dots { display: flex; gap: 6px; margin-top: 19px; }
.query-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--alipay); animation: dot 1.2s ease infinite; }
.query-dots i:nth-child(2) { animation-delay: .15s; }
.query-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%,100% { opacity: .2; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

.result-icon {
  width: 84px; height: 84px; display: grid; place-items: center; border-radius: 50%;
}
.result-icon svg { width: 45px; height: 45px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.result-icon.success { color: var(--success); background: #edfbf5; }
.result-icon.failed { color: var(--danger); background: #fff1f3; }
.result-icon.expired { color: var(--warning); background: #fff7ec; }
.result-icon.network { color: #6d7a90; background: #f1f4f8; }
.result-icon.success svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: drawCheck .55s .15s var(--ease) forwards; }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }
.result-amount { margin-top: 18px; color: var(--ink-900); font-size: 31px; font-weight: 720; font-variant-numeric: tabular-nums; }
.result-actions { width: 100%; margin-top: 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-actions.single { grid-template-columns: 1fr; }
.auto-return { margin-top: 14px; color: var(--ink-400); font-size: 10px; }

/* Info dialog */
.info-card {
  position: relative;
  width: min(390px, 100%);
  padding: 40px 32px 30px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-modal);
  text-align: center;
  transform: translateY(10px) scale(.98);
  transition: transform .3s var(--ease);
}
.info-dialog.show .info-card { transform: none; }
.info-icon { width: 56px; height: 56px; margin: 0 auto; display: grid; place-items: center; color: var(--alipay); border-radius: 17px; background: var(--alipay-soft); }
.info-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.info-card h2 { margin: 20px 0 0; font-size: 19px; }
.info-card p { margin: 12px 0 0; color: var(--ink-500); font-size: 12px; line-height: 1.8; }
.dialog-confirm { width: 100%; height: 45px; margin-top: 24px; border: 0; border-radius: 11px; color: #fff; background: var(--navy-900); cursor: pointer; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 100;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 11px;
  color: #fff;
  background: rgba(12, 25, 48, .94);
  box-shadow: 0 12px 34px rgba(0,0,0,.18);
  font-size: 12px;
  transform: translate(-50%, 18px);
  opacity: 0;
  visibility: hidden;
  transition: .24s ease;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* Demo toolbar, only JS enables it for ?demo=1 */
.demo-toolbar { display: none; position: fixed; right: 18px; bottom: 18px; z-index: 90; }
.demo-toolbar.enabled { display: block; }
.demo-toggle { height: 38px; padding: 0 14px; border: 0; border-radius: 10px; color: #fff; background: var(--navy-900); box-shadow: 0 8px 24px rgba(0,0,0,.18); cursor: pointer; }
.demo-panel { position: absolute; right: 0; bottom: 46px; width: 250px; padding: 14px; border-radius: 14px; background: #fff; box-shadow: 0 16px 50px rgba(0,0,0,.2); opacity: 0; visibility: hidden; transform: translateY(8px); transition: .2s ease; }
.demo-toolbar.open .demo-panel { opacity: 1; visibility: visible; transform: none; }
.demo-panel > strong { display: block; margin-bottom: 10px; font-size: 12px; }
.demo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.demo-actions button { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fc; font-size: 11px; cursor: pointer; }
.demo-actions button:hover { border-color: var(--alipay); color: var(--alipay); }

@media (max-width: 920px) {
  .topbar, .page-shell { width: min(720px, calc(100% - 32px)); }
  .checkout-card { grid-template-columns: 1fr; }
  .order-side-content { padding: 34px 34px 32px; }
  .amount-hero { padding: 36px 0 32px; }
  .trust-note { margin-top: 30px; }
  .payment-side { padding: 36px 34px 32px; }
  .security-row { margin-top: 28px; }
}

@media (max-width: 600px) {
  body { background: #f4f7fb; }
  .fine-grid { display: none; }
  .topbar { width: 100%; height: 70px; padding: 0 18px; background: var(--navy-900); }
  .brand { color: #fff; }
  .brand-emblem { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(255,255,255,.09); }
  .brand-emblem svg { width: 29px; height: 29px; }
  .brand-copy strong { font-size: 17px; }
  .brand-copy small { color: rgba(255,255,255,.46); font-size: 9px; }
  .secure-indicator { display: none; }
  .help-link { color: rgba(255,255,255,.72); }
  .help-link:hover { color: #fff; }

  .page-shell { width: 100%; margin: 0; padding: 0 0 calc(18px + env(safe-area-inset-bottom)); }
  .checkout-card { min-height: auto; border: 0; border-radius: 0; box-shadow: none; animation: none; }
  .order-side { border-radius: 0 0 24px 24px; }
  .order-side-content { padding: 26px 20px 25px; }
  .order-heading-row h1 { font-size: 21px; }
  .order-heading-row p { display: none; }
  .section-kicker { font-size: 8px; }
  .pending-badge { height: 27px; font-size: 10px; }
  .amount-hero { padding: 28px 0 24px; text-align: center; }
  .amount-hero > span { font-size: 11px; }
  .amount-value { justify-content: center; }
  .amount-value small { font-size: 20px; }
  .amount-value strong { font-size: clamp(42px, 13vw, 54px); }
  .countdown-line { margin-top: 16px; }
  .order-divider { margin-top: 2px; }
  .order-details { margin-top: 22px; gap: 15px; }
  .order-details > div { grid-template-columns: 74px minmax(0,1fr); gap: 12px; }
  .order-details dt, .order-details dd { font-size: 11px; }
  .trust-note { display: none; }

  .payment-side { padding: 28px 18px calc(22px + env(safe-area-inset-bottom)); }
  .payment-side-head h2 { font-size: 21px; }
  .payment-side-head p { font-size: 11px; }
  .shield-chip { width: 38px; height: 38px; }
  .payment-methods { margin-top: 25px; gap: 11px; }
  .payment-option { min-height: 79px; padding: 13px 14px; gap: 12px; border-radius: 13px; }
  .channel-logo { width: 44px; height: 44px; }
  .channel-copy strong { font-size: 14px; }
  .channel-copy small { font-size: 10px; }
  .pay-summary { margin-top: 26px; }
  .pay-summary strong { font-size: 29px; }
  .pay-button {
    height: 54px;
    position: sticky;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 4;
    box-shadow: 0 12px 28px rgba(22,119,255,.24);
  }
  .payment-footnote { padding: 0 4px; }
  .security-row { margin-top: 24px; padding-top: 21px; gap: 9px; }
  .security-row span { font-size: 9px; }
  .security-row > i { height: 10px; }
  .footer { min-height: 53px; padding: 0 16px; gap: 8px; font-size: 9px; }

  .modal-layer { padding: 0; align-items: end; }
  .payment-modal {
    width: 100%;
    min-height: min(690px, 92vh);
    max-height: 92vh;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    transform: translateY(35px);
  }
  .modal-layer.show .payment-modal { transform: none; }
  .modal-brand { padding-right: 44px; }
  .modal-stage { padding-top: 17px; }
  .qr-shell { display: none; width: 205px; height: 205px; margin-top: 20px; }
  .qr-shell.force-visible { display: block; }
  .channel-heading h2 { margin-top: 13px; font-size: 20px; }
  .modal-pay-amount { margin-top: 13px; font-size: 27px; }
  .mobile-open-button { order: -1; }
  .desktop-qr-note { display: none; }
  .result-actions { grid-template-columns: 1fr; }
  .loading-state, .result-state { min-height: 500px; }
  .info-dialog { padding: 18px; }
  .demo-toolbar { right: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
