:root {
  color-scheme: light dark;
  --bg: #f7f6f2;
  --surface: #fff;
  --ink: #191918;
  --muted: #686761;
  --line: #d9d7cf;
  --soft: #eceae3;
  --accent: #d45f3c;
  --green: #26705a;
  --blue: #1677d2;
  --shadow: 0 20px 60px rgba(28, 25, 21, .09);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181817;
    --surface: #222220;
    --ink: #f2f0ea;
    --muted: #aaa79f;
    --line: #3c3b37;
    --soft: #2d2c29;
    --accent: #ee7b58;
    --green: #73b99f;
    --blue: #69aef0;
    --shadow: 0 20px 60px rgba(0, 0, 0, .24);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
button, input { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar { height: 68px; padding: 0 max(24px, calc((100% - 1180px) / 2)); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; color: inherit; text-decoration: none; font-weight: 750; font-size: 18px; }
.brand img { border-radius: 6px; margin-right: 10px; }
.brand small { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 9px; }
nav { display: flex; gap: 26px; }
nav a { color: var(--muted); text-decoration: none; font-weight: 600; transition: color .2s ease; }
nav a:hover { color: var(--ink); }

main { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 62px 0 80px; }
.intro { max-width: none; padding-bottom: 42px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-weight: 750; text-transform: uppercase; }
h1 { margin: 0; font: 600 clamp(36px, 5vw, 64px)/1.08 Georgia, "Songti SC", serif; letter-spacing: 0; }
.intro > p:last-child { max-width: none; margin: 20px 0 0; color: var(--muted); font-size: 17px; }

.account-strip { min-height: 54px; margin-bottom: 28px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 7px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: color-mix(in srgb, var(--surface) 52%, transparent); }
.account-strip > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.account-strip strong { white-space: nowrap; }
.account-strip #account-note { color: var(--muted); white-space: nowrap; }
.account-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--muted); }
.account-strip.is-ready .account-dot { background: var(--green); }
.account-strip.is-error .account-dot { background: var(--accent); }
.account-actions { flex: 0 0 auto; }
.account-actions a, .account-actions button { min-height: 34px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--ink); text-decoration: none; font-weight: 700; cursor: pointer; }
.account-actions a { display: inline-flex; align-items: center; }

.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); gap: 52px; align-items: start; border-top: 1px solid var(--line); padding-top: 34px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-heading > div { display: flex; align-items: baseline; gap: 12px; }
.section-heading span { color: var(--accent); font: 700 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.section-heading p { margin: 0; color: var(--muted); }
.section-heading.compact { margin-bottom: 20px; }

.plan-list { border-top: 1px solid var(--line); }
.plan-option { width: 100%; min-height: 74px; display: grid; grid-template-columns: 92px minmax(0, 1fr) 80px; gap: 16px; align-items: center; padding: 0 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; text-align: left; cursor: pointer; transition: background .2s ease, padding .2s ease; }
.plan-option:hover { background: color-mix(in srgb, var(--surface) 55%, transparent); padding-left: 19px; }
.plan-option.is-selected { background: var(--surface); box-shadow: inset 3px 0 var(--accent); }
.plan-name { font-weight: 800; }
.plan-copy { color: var(--muted); overflow-wrap: anywhere; }
.plan-option strong { text-align: right; font-size: 18px; }

.payment-panel { min-height: 530px; padding: 26px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); position: sticky; top: 92px; }
.channel-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--soft); border-radius: 7px; }
.channel { min-height: 42px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.channel.is-selected { background: var(--surface); color: var(--ink); box-shadow: 0 1px 5px rgba(0,0,0,.08); }
.channel i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.wechat-dot { background: var(--green); }
.alipay-dot { background: var(--blue); }
.summary { margin: 25px 0; }
.summary div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 750; }
.primary-action, .secondary-action, .cancel-action { width: 100%; min-height: 48px; border-radius: 6px; font-weight: 750; cursor: pointer; }
.primary-action { border: 1px solid var(--ink); background: var(--ink); color: var(--bg); }
.secondary-action { border: 1px solid var(--line); background: transparent; color: var(--ink); }
.cancel-action { border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); background: transparent; color: var(--accent); }
.order-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
button:disabled { opacity: .5; cursor: wait; }
.fine-print, .exact-note, .warning { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.test-mode-note { margin: 12px 0 0; padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); font-size: 13px; font-weight: 700; }
.status-line { display: flex; justify-content: space-between; margin: 24px 0 8px; font-weight: 700; }
.status-line time { color: var(--accent); font-variant-numeric: tabular-nums; }
.amount-block { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 0; border-block: 1px solid var(--line); }
.amount-block span { color: var(--muted); }
.amount-block strong { font: 700 32px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.qr-frame { width: min(240px, 100%); aspect-ratio: 1; margin: 22px auto 12px; background: #fff; border: 1px solid var(--line); padding: 10px; }
.qr-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.delivery { margin-top: 24px; }
.delivery-kicker { color: var(--green); font-weight: 750; }
.delivery output { display: block; margin: 18px 0; padding: 14px 10px; border: 1px dashed var(--line); border-radius: 6px; text-align: center; font: 700 clamp(14px, 3.3vw, 19px)/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.redeem-link { display: block; margin-top: 12px; text-align: center; color: var(--accent); font-weight: 750; text-decoration: none; }
.panel-message { min-height: 24px; margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.panel-message.is-error { color: #c74b31; }

.steps { border-top: 1px solid var(--line); margin-top: 72px; padding-top: 34px; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.steps li { border-top: 3px solid var(--ink); padding-top: 18px; }
.steps strong, .steps span { display: block; }
.steps span { color: var(--muted); margin-top: 8px; }

footer { min-height: 78px; padding: 20px max(24px, calc((100% - 1180px) / 2)); border-top: 1px solid var(--line); color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 20px; }
[hidden] { display: none !important; }

@media (max-width: 820px) {
  .topbar { padding-inline: 18px; }
  .brand small { display: none; }
  nav { gap: 16px; font-size: 13px; }
  main { width: min(100% - 32px, 680px); padding-top: 42px; }
  .intro h1, .intro > p:last-child { white-space: normal; }
  .account-strip { align-items: flex-start; flex-direction: column; gap: 10px; }
  .account-strip > div:first-child { align-items: flex-start; flex-wrap: wrap; }
  .account-strip strong, .account-strip #account-note { white-space: normal; }
  .checkout-layout { grid-template-columns: 1fr; gap: 36px; }
  .payment-panel { position: static; min-height: 0; }
  .section-heading { align-items: start; flex-direction: column; gap: 8px; }
  .plan-option { grid-template-columns: 74px minmax(0,1fr) 62px; padding-inline: 8px; }
  .steps ol { grid-template-columns: 1fr; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (min-width: 821px) {
  .intro h1 { font-size: clamp(38px, 4.1vw, 56px); white-space: nowrap; }
  .intro > p:last-child { white-space: nowrap; }
}

@media (prefers-reduced-motion: no-preference) {
  .intro, .plans, .payment-panel { animation: enter .55s ease both; }
  .plans { animation-delay: .08s; }
  .payment-panel { animation-delay: .16s; }
  @keyframes enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
}
