@import url('/design-tokens.css');
.checkout-page{margin:0;background:#f2f2f7;color:#1c1c1e;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;line-height:1.6}
.checkout-page *{box-sizing:border-box}.checkout-page [hidden]{display:none!important}
.checkout-header{max-width:900px;margin:auto;padding:24px;display:flex;justify-content:space-between;align-items:center;font-size:14px}
.checkout-page a{color:var(--accent);text-decoration:none}.checkout-header a{font-weight:650}
.checkout-shell{max-width:680px;margin:20px auto 60px;padding:0 20px}
.checkout-card{background:white;border-radius:26px;padding:36px;box-shadow:0 8px 30px #1c1c1e04}
.checkout-kicker{color:var(--accent);font-size:13px;font-weight:600}.checkout-page h1{font-size:25px;line-height:1.4;margin:10px 0}.checkout-page h2{font-size:19px;margin:24px 0 6px}
.checkout-amount{font-size:32px;font-weight:700;letter-spacing:-1px}.checkout-muted{color:#73737b;font-size:13px;overflow-wrap:anywhere}
.checkout-steps{display:flex;gap:12px;padding:16px 0;list-style:none;border-top:1px solid #eee;border-bottom:1px solid #eee;font-size:12px;color:#73737b}.checkout-steps .complete{color:#23854a}
.checkout-page button{font:inherit;border:0;border-radius:13px;padding:12px 18px;background:var(--accent);color:white;cursor:pointer;font-size:14px;font-weight:600}.checkout-page button:disabled{opacity:.5;cursor:wait}.checkout-page button.secondary{background:#f2f2f7;color:var(--accent)}
.checkout-actions{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:24px}.checkout-actions a{font-size:14px}
#paymentQr{display:block;width:240px;height:240px;max-width:100%;object-fit:contain;margin:18px auto}
#voucherArea{background:#f6f9fe;border-radius:18px;padding:20px;margin-top:20px}#voucherArea label{font-size:13px;font-weight:600}
#voucherCode{width:100%;resize:none;display:block;font-family:ui-monospace,monospace;font-size:17px;padding:15px;margin:12px 0;border:1px solid #dae4f0;border-radius:12px;background:white;color:#1c1c1e;overflow-wrap:anywhere}
.checkout-support{border-top:1px solid #eee;margin-top:25px;padding-top:20px;font-size:13px}.checkout-support p{white-space:pre-line;color:#73737b}
.checkout-error{color:#b63a35;font-size:13px;overflow-wrap:anywhere}.checkout-summary{font-weight:600}
.site-dialog .checkout-payment{min-width:0;margin:0;padding:16px;border:0;border-radius:18px;background:#f2f2f7}
.site-dialog .checkout-payment legend{float:left;width:100%;padding:0;margin:0 0 12px;font-size:14px;font-weight:600;color:#63636b}
.checkout-payment-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;clear:both}
.site-dialog .checkout-payment-option{position:relative;display:block;margin:0;cursor:pointer}
.site-dialog .checkout-payment-option input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.checkout-payment-face{display:flex;align-items:center;justify-content:center;gap:10px;min-height:58px;padding:12px 14px;background:white;border:2px solid #e0e0e6;border-radius:999px;font-size:16px;font-weight:600;color:#1c1c1e;transition:border-color .15s,background .15s}
.checkout-payment-face img,.checkout-payment-face .checkout-payment-icon{display:block;flex:none;width:28px;height:28px;object-fit:contain;border-radius:7px}
.checkout-payment-check{display:none;color:var(--accent);font-size:14px}
.checkout-payment-option input:checked+.checkout-payment-face{border-color:var(--accent);background:var(--accent-soft)}
.checkout-payment-option input:checked+.checkout-payment-face .checkout-payment-check{display:inline}
.checkout-payment-option input:focus-visible+.checkout-payment-face{outline:3px solid #007aff55;outline-offset:3px}
.checkout-payment-option input:disabled{cursor:default}
@media(max-width:600px){.checkout-payment-face{gap:6px;padding:12px 8px;font-size:14px;white-space:nowrap}.checkout-payment-face img,.checkout-payment-face .checkout-payment-icon{width:26px;height:26px}.checkout-payment-check{font-size:12px}}
@media(max-width:380px){.site-dialog .checkout-payment{padding:12px}.checkout-payment-options{gap:8px}.checkout-payment-face{gap:7px;padding:10px 8px;font-size:14px}.checkout-payment-face img,.checkout-payment-face .checkout-payment-icon{width:24px;height:24px}}
@media(max-width:600px){.checkout-header{padding:18px 20px}.checkout-shell{margin:5px auto 30px;padding:0 14px}.checkout-card{padding:24px 20px;border-radius:22px}.checkout-page h1{font-size:21px}.checkout-steps{gap:9px;font-size:11px}.checkout-actions button{flex:1}.checkout-actions a{width:100%;text-align:center}#voucherCode{font-size:14px}}
.site-dialog.checkout-flow{box-sizing:border-box;width:min(480px,calc(100% - 28px));max-width:480px;max-height:92dvh;padding:0;border:0;border-radius:28px;background:#fff;color:#1c1c1e;overflow:auto;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;line-height:1.6}
.checkout-flow *{box-sizing:border-box}.checkout-flow [hidden]{display:none!important}
.checkout-flow::backdrop{background:#20242d66;}
.checkout-flow .flow-header{position:sticky;top:0;z-index:2;display:flex;justify-content:space-between;align-items:center;background:#f7f7f8;border-bottom:1px dashed #cfcfd4;padding:20px 26px}
.flow-header span{display:block;color:#808087;font-size:12px;letter-spacing:1px}.flow-header strong{display:block;font-size:13px;font-weight:500;overflow-wrap:anywhere}
.checkout-flow .flow-close{border:0;background:transparent;color:#777;font-size:28px;width:44px;height:44px;padding:0;border-radius:50%}
.checkout-flow .flow-back{display:inline-flex;align-items:center;min-height:44px;padding:4px 0;margin:-12px 0 12px;border:0;background:transparent;color:var(--accent);font:inherit;font-size:13px;cursor:pointer}
.flow-content{padding:26px}.flow-product{display:flex;align-items:center;gap:12px;margin-bottom:26px}.flow-product-icon{width:48px;height:48px;flex:none;border-radius:14px;background:#202023;color:white;display:grid;place-items:center;font-size:25px;overflow:hidden}.flow-product-icon img{width:100%;height:100%;object-fit:contain}.flow-product-name{flex:1;min-width:0}.flow-product-name strong{display:block;font-size:17px;line-height:1.4;overflow-wrap:anywhere}.flow-product-name span,.flow-product-price span{display:block;color:#85858c;font-size:12px;margin-top:5px}.flow-product-price{text-align:right;flex:none}.flow-product-price strong{font-size:23px;letter-spacing:-.5px}
.checkout-flow .flow-product-icon.ios-detail-icon{width:48px;height:48px;border-radius:14px;font-size:16px}
.flow-product-icon>svg{display:block;width:100%;height:100%}
.flow-stepper{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;list-style:none;padding:0 0 24px;margin:0 0 26px;border-bottom:1px solid #e6e6e9}.flow-stepper li{text-align:center;color:#939399}.flow-stepper li>span{display:grid;place-items:center;width:28px;height:28px;margin:0 auto 8px;background:#f3f3f5;border-radius:50%;font-size:12px}.flow-stepper small{font-size:11px;white-space:nowrap}.flow-stepper .current{color:#111}.flow-stepper .current>span{color:#fff;background:#171719}.flow-stepper .complete>span{background:#e9f5ed;color:#248044}
.checkout-flow .flow-step h2,.checkout-flow .flow-body>h2{font-size:24px;letter-spacing:-.5px;margin:0 0 26px;font-weight:700;line-height:1.4}.checkout-flow h3{font-size:14px;font-weight:500;margin:22px 0 12px}
.flow-field{display:block;font-size:14px;margin:18px 0 10px}.flow-field>span:first-child{display:block;margin-bottom:10px}.flow-input-wrap{display:flex;align-items:center;border:1px solid #dedee3;border-radius:14px;background:#fafafa;padding:0 15px;gap:10px}.flow-mail{color:#85858b;font-size:22px}.checkout-flow .flow-input-wrap input{min-width:0;width:100%;height:52px;font:inherit;font-size:16px;color:#222;border:0;background:transparent;outline:0;padding:0}.flow-input-wrap:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px #007aff15}
.checkout-flow .flow-muted{font-size:12px;line-height:1.8;color:#85858c;overflow-wrap:anywhere;margin:10px 0 20px}
.checkout-flow .flow-primary,.checkout-flow .flow-secondary{display:block;width:100%;text-align:center;border:0;border-radius:13px;padding:14px 12px;font:inherit;font-size:14px;line-height:1.5;font-weight:600;text-decoration:none;cursor:pointer;margin:12px 0;color:white;background:var(--accent)}.checkout-flow .flow-primary:disabled{background:#83b9f0;color:#fff;cursor:default}.checkout-flow .flow-secondary{background:#f4f4f7;color:var(--accent);font-weight:500}.checkout-flow button:disabled{cursor:default;opacity:.7}
.flow-footer{border-top:1px solid #e6e6e9;padding:18px 0 0;margin-top:22px;font-size:11px;line-height:1.8;color:#919198}.checkout-flow .flow-error{font-size:12px;color:#b73c35;overflow-wrap:anywhere;white-space:pre-line}.flow-error:empty{display:none}.flow-summary{display:flex;gap:6px;flex-wrap:wrap;justify-content:space-between;padding:14px;background:#f7f7f9;border-radius:14px;margin-bottom:20px;font-size:13px}.flow-summary>span:last-child{width:100%;font-size:12px;color:#85858c;overflow-wrap:anywhere}.flow-accept{display:flex;align-items:start;gap:8px;font-size:12px;margin:18px 0}.flow-accept input{accent-color:var(--accent);flex:none;margin:4px 0 0}.flow-countdown{color:#85858c;font-size:13px;text-align:center}.flow-qr{display:block;width:220px;max-width:100%;height:auto;margin:16px auto}.flow-voucher{width:100%;resize:none;padding:14px;border:1px solid #dce8f7;background:#f5f9ff;border-radius:14px;font:16px/1.6 ui-monospace,monospace;color:#222}.flow-link{display:block;color:var(--accent);font-size:13px;margin:12px 0}.flow-result{display:grid;place-items:center;width:58px;height:58px;border-radius:50%;font-size:30px;margin:0 auto 20px}.flow-result.success{background:#e8f5ee;color:#26824a}.flow-result.failure{background:#fff0eb;color:#bb4f34}.flow-order-text{overflow-wrap:anywhere;font-size:12px}.flow-spinner{width:34px;height:34px;margin:26px auto;border:3px solid #e9e9ec;border-top-color:var(--accent);border-radius:50%;animation:flow-spin .8s linear infinite}@keyframes flow-spin{to{transform:rotate(360deg)}}
@media(max-width:600px){.storefront .site-dialog.checkout-flow,.site-dialog.checkout-flow{position:fixed;inset:auto 0 0;width:100%;max-width:480px;margin:0 auto;border-radius:28px 28px 0 0;max-height:94dvh}.flow-content{padding:24px 22px calc(20px + env(safe-area-inset-bottom))}.checkout-flow .flow-header{padding:18px 22px}.flow-product{gap:10px}.flow-product-name strong{font-size:16px}.flow-product-price strong{font-size:21px}.flow-stepper small{font-size:11px}.checkout-flow .flow-step h2{font-size:23px}}
@media(prefers-reduced-motion:reduce){.flow-spinner{animation:none}.checkout-flow::backdrop{}}
.flow-instructions{margin:18px 0;font-size:13px;overflow-wrap:anywhere}.flow-instructions summary{cursor:pointer;font-weight:600}.flow-instruction-text{white-space:pre-wrap;color:#73737b;line-height:1.8}

/* Checkout presentation uses the shared design tokens; order state is unchanged. */
.site-dialog.checkout-flow{color:var(--ui-ink);background:var(--ui-surface);font-family:var(--ui-font);box-shadow:var(--ui-shadow-float)}
.checkout-flow .flow-header{background:var(--ui-surface);border-color:var(--ui-line)}
.checkout-flow .flow-header span,.checkout-flow .flow-muted,.checkout-flow .flow-footer{color:var(--ui-muted)}
.checkout-flow .flow-product-price strong,.checkout-flow .flow-order-text,.checkout-flow .flow-voucher{font-family:var(--ui-numeric);font-variant-numeric:tabular-nums}
.checkout-flow .flow-stepper{border-color:var(--ui-line)}
.checkout-flow .flow-stepper li{position:relative;color:var(--ui-subtle-text)}
.checkout-flow .flow-stepper li:not(:last-child)::after{content:'';position:absolute;top:14px;left:calc(50% + 18px);right:calc(-50% + 18px);height:2px;background:var(--ui-line)}
.checkout-flow .flow-stepper li>span{position:relative;z-index:1;background:var(--ui-bg)}
.checkout-flow .flow-stepper .current{color:var(--ui-blue)}
.checkout-flow .flow-stepper .current>span{background:var(--ui-blue);color:var(--ui-surface)}
.checkout-flow .flow-stepper .complete>span{background:var(--ui-success-bg);color:var(--ui-success-text)}
.checkout-flow .flow-input-wrap{border-color:var(--ui-line);background:var(--ui-bg);border-radius:var(--ui-radius-control)}
.checkout-flow .flow-input-wrap:focus-within{border-color:var(--ui-blue);outline:2px solid var(--ui-blue);outline-offset:1px}
.checkout-flow .flow-primary,.checkout-flow .flow-secondary{min-height:52px;border-radius:var(--ui-radius-control)}
.checkout-flow .flow-primary{background:var(--ui-blue)}
.checkout-flow .flow-primary:active{background:var(--ui-blue-active)}
.checkout-flow .flow-primary:disabled{background:var(--ui-subtle)}
.checkout-flow .flow-secondary{background:var(--ui-blue-soft);color:var(--ui-blue)}
.checkout-flow .flow-back,.checkout-flow .flow-link{color:var(--ui-blue)}
.checkout-flow .flow-error{color:var(--ui-danger-text)}
.checkout-flow .flow-voucher{border-color:var(--ui-line);background:var(--ui-bg);color:var(--ui-ink);border-radius:var(--ui-radius-control)}
.checkout-flow .flow-result.success{background:var(--ui-success-bg);color:var(--ui-success-text)}
.checkout-flow .flow-result.failure{background:var(--ui-danger-bg);color:var(--ui-danger-text)}
.checkout-flow .checkout-payment-face{border-color:var(--ui-line);border-radius:var(--ui-radius-control);color:var(--ui-ink)}
.checkout-flow .checkout-payment-option input:checked+.checkout-payment-face{border-color:var(--ui-blue);background:var(--ui-blue-soft)}
.checkout-flow .checkout-payment-check{color:var(--ui-blue)}
.checkout-flow .flow-field>input{display:block;width:100%;min-height:52px;padding:0 var(--ui-space-4);border:1px solid var(--ui-line);border-radius:var(--ui-radius-control);background:var(--ui-bg);color:var(--ui-ink);font:inherit;font-size:16px}
.checkout-flow .flow-field>input:focus-visible{outline:2px solid var(--ui-blue);outline-offset:1px}
.checkout-flow .flow-order-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--ui-space-2);padding:var(--ui-space-4);border:1px solid var(--ui-line);border-radius:var(--ui-radius-card);background:var(--ui-surface)}
.checkout-flow .flow-order-card>strong{font-family:var(--ui-numeric);overflow-wrap:anywhere}
.checkout-flow .flow-order-card>.flow-order-status{grid-column:2;grid-row:1;width:auto;padding:var(--ui-space-1) var(--ui-space-3);border-radius:var(--ui-radius-pill);background:var(--ui-blue-soft);color:var(--ui-blue);font-size:var(--ui-font-xs)}
.checkout-flow .flow-result.success.flow-result-once{position:relative;color:transparent;animation:flow-result-pop .3s ease-out both}
.checkout-flow .flow-result.success.flow-result-once::after{content:'✓';position:absolute;inset:0;display:grid;place-items:center;color:var(--ui-success-text);animation:flow-result-check .45s .15s ease-out both}
@keyframes flow-result-pop{from{transform:scale(.75);opacity:0}to{transform:scale(1);opacity:1}}
@keyframes flow-result-check{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}
