:root {
  color-scheme: light;
  --page: #f5f7fa;
  --panel: #ffffff;
  --line: #dfe5ec;
  --text: #172033;
  --muted: #6f7b8c;
  --alipay: #1677ff;
  --alipay-hover: #0d67e5;
  --success: #168a48;
  --danger: #c83532;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--text); background: var(--page); font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.checkout-header { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 max(24px, calc((100vw - 1040px) / 2)); border-bottom: 1px solid var(--line); background: var(--panel); }
.checkout-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.checkout-brand img { flex: 0 0 auto; border-radius: 8px; }
.checkout-brand span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.checkout-brand strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.checkout-brand small { color: var(--muted); font-size: 10px; }
.checkout-security { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.checkout-security span { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--success); font-size: 11px; }

.checkout-main { min-height: calc(100vh - 124px); display: grid; place-items: center; padding: 42px 20px; }
.checkout-panel { width: min(100%, 620px); padding: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: 0 16px 44px rgba(23,32,51,.08); }
.account-panel { width: min(100%, 520px); }
.plan-panel { width: min(100%, 820px); }
.flow-heading { margin-bottom: 26px; }
.flow-heading p { margin: 0 0 8px; color: var(--alipay); font-size: 11px; font-weight: 700; }
.flow-heading h1 { margin: 0; font-size: 23px; line-height: 1.35; }
.flow-heading > span, .flow-heading div > span { display: block; margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.plan-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.account-form { display: grid; gap: 10px; }
.account-form label { margin-top: 4px; color: #475569; font-size: 11px; font-weight: 650; }
.account-form input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid #cfd8e4; border-radius: 7px; color: var(--text); background: #fff; font: inherit; font-size: 13px; outline: none; transition: border-color .2s, box-shadow .2s; }
.account-form input::placeholder { color: #a1aab7; }
.account-form input:focus { border-color: var(--alipay); box-shadow: 0 0 0 3px rgba(22,119,255,.12); }
.account-form .pay-button { margin-top: 12px; }
.text-button { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #d5deea; border-radius: 6px; color: #52647a; background: #fff; cursor: pointer; font-size: 10px; }
.text-button:hover { color: var(--alipay); border-color: #9cc6ff; background: #f7fbff; }
.plan-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-option { position: relative; min-height: 210px; display: flex; flex-direction: column; align-items: flex-start; padding: 20px; border: 1px solid #d9e2ed; border-radius: 10px; color: var(--text); background: linear-gradient(155deg, #fff 0%, #f8fafc 100%); cursor: pointer; text-align: left; transition: transform .2s, border-color .2s, box-shadow .2s; }
.plan-option:hover:not(:disabled) { transform: translateY(-3px); border-color: #82b7ff; box-shadow: 0 12px 28px rgba(22,119,255,.12); }
.plan-option:focus-visible { outline: 3px solid rgba(22,119,255,.2); outline-offset: 2px; }
.plan-option:disabled { cursor: wait; opacity: .58; }
.plan-option.featured { border-color: #9bc5ff; background: linear-gradient(155deg, #fff 0%, #f0f7ff 100%); }
.plan-option.featured::after { content: '推荐'; position: absolute; top: 14px; right: 14px; padding: 4px 8px; border-radius: 99px; color: #fff; background: var(--alipay); font-size: 9px; font-weight: 700; }
.plan-option-kicker { color: var(--alipay); font-size: 10px; font-weight: 700; }
.plan-option strong { margin-top: 17px; font-size: 20px; }
.plan-option small { margin-top: 8px; color: var(--muted); font-size: 11px; }
.plan-option b { width: 100%; margin-top: auto; padding-top: 18px; border-top: 1px solid #e4eaf1; color: var(--alipay); font-size: 11px; }
.checkout-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.checkout-title-row p { margin: 0 0 8px; color: var(--muted); font-size: 11px; }
.checkout-title-row h1 { margin: 0; font-size: 23px; line-height: 1.35; }
.order-state { flex: 0 0 auto; min-width: 60px; padding: 6px 9px; border: 1px solid #cfd8e4; border-radius: 6px; color: var(--muted); background: #f8fafc; font-size: 10px; text-align: center; }
.order-state.success { color: var(--success); border-color: #b8dec9; background: #eef9f3; }
.order-state.error { color: var(--danger); border-color: #ebc5c4; background: #fff4f3; }

.order-details { margin: 28px 0 22px; border-top: 1px solid var(--line); }
.order-details > div { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.order-details dt { color: var(--muted); font-size: 11px; }
.order-details dd { max-width: 72%; margin: 0; overflow-wrap: anywhere; font-size: 12px; text-align: right; }
.order-details .order-total { min-height: 68px; }
.order-total dd { color: #d83b34; font-size: 25px; font-weight: 700; }

.payment-method { height: 68px; display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 0 16px; border: 2px solid var(--alipay); border-radius: 8px; background: #f7fbff; }
.alipay-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: var(--alipay); font-size: 21px; font-weight: 700; }
.payment-method > div:nth-child(2) { display: flex; flex-direction: column; gap: 4px; }
.payment-method strong { font-size: 13px; }
.payment-method span { color: var(--muted); font-size: 10px; }
.selected-mark { margin-left: auto; width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; color: #fff !important; background: var(--alipay); }

.pay-button { width: 100%; height: 48px; border: 0; border-radius: 7px; color: #fff; background: var(--alipay); cursor: pointer; font-size: 14px; font-weight: 650; }
.pay-button:hover:not(:disabled) { background: var(--alipay-hover); }
.pay-button:focus-visible { outline: 3px solid rgba(22,119,255,.24); outline-offset: 2px; }
.pay-button:disabled { color: #99a3b0; background: #e8ecf1; cursor: not-allowed; }
.checkout-message { min-height: 18px; margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; text-align: center; }
.checkout-message.error { color: var(--danger); }

.payment-qr { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 22px; padding: 24px 20px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.qr-frame { width: 208px; height: 208px; display: grid; place-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qr-frame img, .qr-frame canvas { display: block; width: 184px; height: 184px; }
.payment-qr p { margin: 0; color: var(--text); font-size: 12px; }
.payment-qr p strong { color: var(--alipay); }
.payment-qr .qr-hint { color: var(--muted); font-size: 10px; }

.qr-modal-open { overflow: hidden; }
.qr-modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; }
.qr-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .52); backdrop-filter: blur(2px); }
.qr-modal-dialog { position: relative; width: min(100%, 390px); display: flex; flex-direction: column; align-items: center; padding: 30px 28px 26px; border: 1px solid #dfe5ec; border-radius: 14px; background: #fff; box-shadow: 0 24px 70px rgba(15, 23, 42, .24); text-align: center; }
.qr-modal-close { position: absolute; top: 9px; right: 12px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; color: #738096; background: transparent; cursor: pointer; font-size: 25px; line-height: 1; }
.qr-modal-close:hover { color: var(--text); background: #f1f5f9; }
.qr-modal-close:focus-visible { outline: 3px solid rgba(22,119,255,.24); outline-offset: 1px; }
.qr-modal-heading { display: flex; align-items: center; gap: 12px; align-self: stretch; text-align: left; }
.qr-modal-heading > div:last-child { display: flex; flex-direction: column; gap: 4px; }
.qr-modal-heading strong { font-size: 15px; }
.qr-modal-heading span { color: var(--muted); font-size: 10px; }
.qr-modal-amount { margin: 22px 0 14px; color: #d83b34; font-size: 28px; font-weight: 700; }
.qr-modal-frame { width: 216px; height: 216px; padding: 15px; box-shadow: 0 5px 16px rgba(23,32,51,.06); }
.qr-modal-frame img, .qr-modal-frame canvas { width: 184px; height: 184px; }
.qr-modal-tip { margin: 16px 0 0; color: var(--text); font-size: 12px; }
.qr-modal-hint { margin: 7px 0 0; color: var(--muted); font-size: 10px; }

.payment-success { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 16px; border: 1px solid #b8dec9; border-radius: 8px; background: #eef9f3; }
.payment-success > span { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--success); font-size: 18px; }
.payment-success div { min-width: 0; }
.payment-success strong { color: #116c39; font-size: 13px; }
.payment-success p { margin: 5px 0 0; color: #4e7560; font-size: 10px; line-height: 1.6; }
.checkout-footer { min-height: 52px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; padding: 12px 14px; color: #8b95a3; font-size: 10px; line-height: 1.7; text-align: center; }
.checkout-footer a { white-space: nowrap; }
.checkout-footer .checkout-icp { color: #8b95a3; text-decoration: none; white-space: nowrap; transition: color .2s ease; }
.checkout-footer .checkout-icp::before { content: " · "; }
.checkout-footer .checkout-icp:hover { color: #e3f1ff; }

@media (max-width: 600px) {
  .checkout-header { height: 66px; padding: 0 16px; }
  .checkout-security { display: none; }
  .checkout-main { min-height: calc(100vh - 112px); padding: 18px 12px; }
  .checkout-panel { padding: 22px 18px; }
  .checkout-title-row h1 { font-size: 19px; }
  .flow-heading h1 { font-size: 19px; }
  .plan-heading { display: block; }
  .plan-heading .text-button { margin-top: 14px; }
  .plan-options { grid-template-columns: 1fr; }
  .plan-option { min-height: 154px; }
  .order-details dd { max-width: 62%; }
  .qr-modal { padding: 12px; }
  .qr-modal-dialog { padding: 28px 18px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
