/* Storefront stylesheet. Claude-like: warm ivory surfaces, ink text, clay accent, serif display headings,
   hairline borders and quiet shadows. Admin pages keep styles.css.
   Type scale has exactly three sizes: --fs-title (headings, totals), --fs-head (labels, plan names, the main button)
   and --fs-body (everything else). Hierarchy below that comes from weight and gray level, never another size.
   Motion: transform/opacity only, ease-out on enter, under 300ms, hover gated to fine pointers. */
@font-face{font-family:"Display Serif";src:local("Songti SC"),local("STSongti-SC-Regular"),local("Noto Serif CJK SC"),local("Noto Serif SC"),local("Source Han Serif SC"),local("Source Han Serif CN");font-weight:400}
@font-face{font-family:"Display Serif";src:local("Songti SC Bold"),local("STSongti-SC-Bold"),local("Noto Serif CJK SC Bold"),local("Noto Serif SC Bold"),local("Source Han Serif SC Bold"),local("Source Han Serif CN Bold"),local("Songti SC");font-weight:600}
:root{
 --bg:#faf9f5;--surface:#fff;--surface-2:#f5f4ee;--surface-3:#efede4;
 --ink:#141413;--ink-2:#5e5d59;--ink-3:#8a8880;
 --line:rgba(31,30,29,.1);--line-strong:rgba(31,30,29,.18);--line-focus:rgba(31,30,29,.42);
 --primary:#141413;--primary-ink:#faf9f5;--primary-press:#3d3d3a;
 --clay:#d97757;--clay-ink:#b5532f;--clay-soft:rgba(217,119,87,.12);--ring:rgba(217,119,87,.22);
 --success:#557a35;--success-soft:#eef2e6;--warn:#8a5a00;--warn-soft:#fbf3e1;--danger:#b5321f;--danger-soft:#fbece8;
 --shadow-sm:0 1px 2px rgba(31,30,29,.04);
 --shadow-md:0 1px 2px rgba(31,30,29,.04),0 8px 28px rgba(31,30,29,.05);
 --shadow-lg:0 2px 8px rgba(31,30,29,.06),0 24px 64px rgba(31,30,29,.14);
 --r-lg:16px;--r-md:12px;--r-sm:10px;
 --fs-title:24px;--fs-head:16px;--fs-body:14px;
 --seg-track:var(--surface-3);--seg-active:var(--surface);
 --ease-out:cubic-bezier(.23,1,.32,1);--ease-drawer:cubic-bezier(.32,.72,0,1);
 --font:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue",system-ui,sans-serif;
 --serif:"Display Serif",var(--font);
 --mono:ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
 color-scheme:light dark;
}
@media (prefers-color-scheme:dark){:root{
 --bg:#1f1e1d;--surface:#262624;--surface-2:#30302e;--surface-3:#363633;
 --ink:#faf9f5;--ink-2:#c2c0b6;--ink-3:#9c9a92;
 --line:rgba(250,249,245,.1);--line-strong:rgba(250,249,245,.18);--line-focus:rgba(250,249,245,.45);
 --primary:#faf9f5;--primary-ink:#141413;--primary-press:#e3e1d8;
 --seg-track:#1f1e1d;--seg-active:#3a3a37;
 --clay-ink:#e8957a;--clay-soft:rgba(217,119,87,.16);--ring:rgba(217,119,87,.3);
 --success:#9cbf7a;--success-soft:rgba(156,191,122,.12);--warn:#e8c06a;--warn-soft:rgba(232,192,106,.12);--danger:#f08a76;--danger-soft:rgba(240,138,118,.12);
 --shadow-sm:none;--shadow-md:none;--shadow-lg:0 0 0 1px rgba(250,249,245,.08),0 24px 64px rgba(0,0,0,.5);
}}
@media (max-width:600px){:root{--fs-title:22px}}

/* Base */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:72px}
body{margin:0;min-height:100vh;min-height:100dvh;background:var(--bg);color:var(--ink);font:400 var(--fs-body)/1.6 var(--font);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"kern"}
h1,h2,h3,p{margin:0}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit;color:inherit;letter-spacing:inherit}
button,a,[role="button"]{touch-action:manipulation}
button{cursor:pointer;background:none;border:0;padding:0;-webkit-user-select:none;user-select:none}
button:disabled{cursor:not-allowed}
:focus-visible{outline:2px solid var(--clay);outline-offset:2px;border-radius:8px}
::selection{background:var(--clay-soft)}
.hidden{display:none!important}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.mono{font-family:var(--mono);font-size:.92em;letter-spacing:0}
.wrap{width:100%;max-width:1080px;margin:0 auto;padding-left:max(24px,env(safe-area-inset-left));padding-right:max(24px,env(safe-area-inset-right))}
/* Display headings share one serif face and one size. */
#product-heading,#checkout-heading,.step-label,.dialog-header h2,.history-header h2,.coming-soon h3{font-family:var(--serif);font-size:var(--fs-title);font-weight:500;line-height:1.3;letter-spacing:-.005em;color:var(--ink)}

/* Header */
.site-header{position:sticky;top:0;z-index:20;height:60px;display:flex;align-items:center;justify-content:space-between;gap:16px;max-width:none;
 background:color-mix(in srgb,var(--bg) 86%,transparent);-webkit-backdrop-filter:saturate(160%) blur(16px);backdrop-filter:saturate(160%) blur(16px);box-shadow:0 1px 0 var(--line)}
.site-header{padding-left:max(24px,calc((100vw - 1080px)/2 + 24px));padding-right:max(24px,calc((100vw - 1080px)/2 + 24px))}
.brand{display:flex;align-items:center;gap:10px;min-width:0;white-space:nowrap}
.brand-mark{width:26px;height:26px;flex-shrink:0;border-radius:7px}
.wordmark{font-size:var(--fs-head);font-weight:600;letter-spacing:.01em;line-height:1;color:var(--ink)}
.wm-ai{color:var(--clay-ink)}
.site-header nav{display:flex;align-items:center;gap:20px;flex-shrink:0}
/* Borderless header link (加微信), sitting left of 订单查询. */
.nav-link{font-size:var(--fs-body);font-weight:500;color:var(--ink-2);transition:color 150ms ease}
.nav-link:active{opacity:.6}

/* Buttons */
.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:38px;padding:8px 16px;border-radius:var(--r-sm);border:1px solid transparent;font-size:var(--fs-body);font-weight:500;line-height:1.2;white-space:nowrap;
 transition:transform 160ms var(--ease-out),background-color 180ms ease,border-color 180ms ease,color 180ms ease,opacity 180ms ease}
.button:active:not(:disabled){transform:scale(.98)}
.button.primary{background:var(--primary);color:var(--primary-ink)}
.button.primary:active:not(:disabled){background:var(--primary-press)}
.button.secondary{background:var(--surface);color:var(--ink);border-color:var(--line-strong)}
.button.full{width:100%}
.button:disabled{opacity:.45}
.button.primary:disabled{opacity:1;background:var(--surface-3);color:var(--ink-3)}
.text-button{display:inline-flex;align-items:center;gap:6px;color:var(--ink-2);font-size:var(--fs-body);font-weight:500;text-decoration:underline;text-decoration-color:var(--line-strong);text-underline-offset:3px;transition:color 150ms ease,text-decoration-color 150ms ease}
.text-button:active{opacity:.6}
.icon-button{display:grid;place-items:center;width:32px;height:32px;border-radius:8px;color:var(--ink-2);font-size:20px;line-height:1;transition:transform 160ms var(--ease-out),background-color 180ms ease,color 180ms ease}
.icon-button:active{transform:scale(.92)}
@media (hover:hover) and (pointer:fine){
 .button.primary:hover:not(:disabled){background:var(--primary-press)}
 .button.secondary:hover:not(:disabled){background:var(--surface-2);border-color:var(--line-focus)}
 .text-button:hover{color:var(--ink);text-decoration-color:var(--ink)}
 .terms-link:hover{color:var(--ink);text-decoration-color:var(--ink)}
 .nav-link:hover{color:var(--ink)}
 .icon-button:hover{background:var(--surface-2);color:var(--ink)}
 .ai-tab:hover:not(.active){color:var(--ink)}
 .product-option:hover:not(.selected):not(:disabled){border-color:var(--line-focus)}
 .gateway:hover:not(:disabled):not(.selected){border-color:var(--line-focus)}
 .segmented button:hover:not(.active){color:var(--ink)}
 .lookup-result:hover{border-color:var(--line-focus)}
}

/* Page */
.storefront-main{padding-top:32px;padding-bottom:72px}
#product-heading{margin:0 0 16px 2px}

/* AI selector: underline tabs, the way claude.com switches between products. */
.ai-tabs{display:flex;justify-content:center;gap:4px;margin:0 auto 36px;max-width:560px;border-bottom:1px solid var(--line)}
.ai-tab{position:relative;display:flex;align-items:center;justify-content:center;gap:8px;flex:1;min-width:0;height:44px;padding:0 8px;color:var(--ink-3);font-size:var(--fs-body);font-weight:500;transition:color 180ms ease}
.ai-tab::after{content:"";position:absolute;left:12px;right:12px;bottom:-1px;height:2px;border-radius:2px;background:var(--ink);transform:scaleX(0);transition:transform 240ms var(--ease-out)}
.ai-tab.active{color:var(--ink)}
.ai-tab.active::after{transform:scaleX(1)}
.ai-logo{display:inline-flex;width:16px;height:16px;flex-shrink:0}
.ai-logo svg{width:100%;height:100%;display:block;fill:currentColor}
.ai-tab.active [data-brand-logo="claude"]{color:var(--clay)}

/* Layout: plans left, checkout right (sticky on wide screens). */
.store-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(340px,400px);gap:28px;align-items:start}
.store-grid.is-coming-soon{grid-template-columns:minmax(0,1fr)}
.product-panel{min-width:0}

/* Plans */
.products{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.product-option{position:relative;display:flex;flex-direction:column;gap:20px;min-width:0;min-height:140px;padding:20px 20px 18px;border:1px solid var(--line-strong);border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--shadow-sm);text-align:left;color:var(--ink);
 transition:border-color 180ms ease,box-shadow 180ms ease,transform 180ms var(--ease-out)}
.product-option:active:not(:disabled){transform:scale(.99)}
.product-option.selected{border-color:var(--ink);box-shadow:0 0 0 1px var(--ink),var(--shadow-md)}
.product-top{display:flex;align-items:center;gap:10px;font-size:var(--fs-head);font-weight:600;line-height:1.35;overflow-wrap:anywhere}
.plan-name{min-width:0}
.plan-brand{color:var(--ink-3);font-weight:500}
/* Selection mark: a circle whose check is a centred mask, so it can never drift off-centre. */
.radio-dot{position:relative;margin-left:auto;flex-shrink:0;width:20px;height:20px;border-radius:50%;box-shadow:inset 0 0 0 1.5px var(--line-strong);transition:background-color 180ms ease,box-shadow 180ms ease}
.radio-dot::after{content:"";position:absolute;inset:0;background:var(--primary-ink);
 -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.2l2.6 2.6L14 7.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% 100% no-repeat;
 mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.2l2.6 2.6L14 7.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% 100% no-repeat;
 opacity:0;transform:scale(.6);transition:transform 200ms var(--ease-out),opacity 150ms ease}
.selected .radio-dot{background:var(--primary);box-shadow:none}
.selected .radio-dot::after{opacity:1;transform:none}
.product-price{margin-top:auto;font-size:var(--fs-title);font-weight:600;letter-spacing:-.01em;line-height:1.2;font-variant-numeric:tabular-nums}
.product-term{display:block;margin-top:4px;font-size:var(--fs-body);font-weight:400;color:var(--ink-3);letter-spacing:0}
.product-option:disabled{cursor:default;opacity:1}
/* Grey out only plans without a price; a plan locked by a checked voucher keeps its selected look. */
.product-option[data-unpriced]{background:var(--surface-2);box-shadow:none;border-color:var(--line)}
.product-option[data-unpriced] .product-top{color:var(--ink-2)}
.product-option[data-unpriced] .product-price{color:var(--ink-3);font-size:var(--fs-body);font-weight:500}
.product-option[data-unpriced] .radio-dot{opacity:.5}

/* Checkout card */
.checkout-card{position:sticky;top:84px;min-width:0;padding:28px;border:1px solid var(--line-strong);border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--shadow-md)}
.checkout-title{margin-bottom:20px}
.segmented{position:relative;display:grid;grid-template-columns:1fr 1fr;gap:2px;padding:3px;margin-bottom:24px;border-radius:var(--r-sm);background:var(--seg-track)}
.segmented button{height:34px;border-radius:7px;font-size:var(--fs-body);font-weight:500;color:var(--ink-2);transition:color 180ms ease,background-color 180ms ease,box-shadow 180ms ease}
.segmented button.active{background:var(--seg-active);color:var(--ink);box-shadow:0 1px 2px rgba(31,30,29,.08),0 0 0 .5px rgba(31,30,29,.06)}

.field{margin:0 0 22px}
.field>label,#code-entry label{display:block;margin-bottom:10px;font-size:var(--fs-head);font-weight:500;line-height:1.35;color:var(--ink)}
.field-help,.inline-status{font-size:var(--fs-body);line-height:1.6;color:var(--ink-2)}
.field-help{margin-top:8px}
.inline-status{margin-top:10px}
input,textarea,select{width:100%;padding:11px 14px;border:1px solid var(--line-strong);border-radius:var(--r-sm);background:var(--surface);color:var(--ink);font-size:var(--fs-body);line-height:1.5;outline:none;
 transition:border-color 180ms ease,box-shadow 180ms ease}
input:focus,textarea:focus,select:focus{border-color:var(--line-focus);box-shadow:0 0 0 3px var(--ring)}
input::placeholder,textarea::placeholder{color:var(--ink-3)}
textarea{display:block;min-height:112px;resize:vertical;font-family:var(--mono);line-height:1.55;letter-spacing:0}
#code-status{margin:10px 0 0;color:var(--ink-2)}
#code-status:empty{display:none}
.step-label{margin:16px 0 4px}
.is-session-step #redeem-fields{margin-bottom:0}
#session-fields{margin-top:16px}
/* Grok login guide (2026-10-30): one short line + one masked schematic per step; tap a picture to open it full size. */
.grok-help{margin:0 0 14px;color:var(--ink-2)}
.grok-help>p{margin:0 0 10px}
.grok-mobile-note{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:10px 12px;border-radius:var(--r-sm);background:var(--clay-soft);color:var(--ink)}
.grok-steps{margin:0 0 10px;padding-left:20px;display:grid;gap:14px}
.grok-steps li p{margin:0 0 8px}
.grok-steps a{color:var(--clay-ink)}
.grok-shot{display:block;max-width:420px;border:1px solid var(--line-strong);border-radius:var(--r-sm);overflow:hidden;background:var(--surface-2)}
.grok-shot img{display:block;width:100%;height:auto}
.grok-shot-toggle summary{cursor:pointer;color:var(--clay-ink);width:max-content}
.grok-shot-toggle[open] summary{margin-bottom:8px}
#chatgpt-session-help{margin:0 0 14px;padding:16px;border-radius:var(--r-md);background:var(--surface-2);border:1px solid var(--line)}
#chatgpt-session-help p{margin:12px 0 0;color:var(--ink-2)}

.gateways{display:flex;flex-wrap:wrap;gap:8px}
.gateway{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border-radius:var(--r-sm);border:1px solid var(--line-strong);background:var(--surface);font-size:var(--fs-body);font-weight:500;transition:border-color 180ms ease,box-shadow 180ms ease,transform 160ms var(--ease-out)}
.gateway:active:not(:disabled){transform:scale(.98)}
.gateway.selected{border-color:var(--ink);box-shadow:0 0 0 1px var(--ink)}
.gateway:disabled{opacity:.45}
.gateway-icon{display:block;width:20px;height:20px;flex-shrink:0}

.order-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:4px 0 12px;padding-top:18px;border-top:1px solid var(--line)}
/* 买前须知 link and the confirmation tick that must be checked before buying. */
.terms-link{display:inline-flex;align-items:center;gap:2px;font-size:var(--fs-body);font-weight:500;color:var(--ink-2);text-decoration:underline;text-decoration-color:var(--line-strong);text-underline-offset:3px;transition:color 150ms ease}
.terms-link svg{width:14px;height:14px}
.terms-link:active{opacity:.6}
.terms-confirm{display:flex;align-items:center;gap:8px;width:max-content;margin:0 0 16px;font-size:var(--fs-body);color:var(--ink-2);cursor:pointer;-webkit-user-select:none;user-select:none}
.terms-confirm input{appearance:none;-webkit-appearance:none;position:relative;flex-shrink:0;width:18px;height:18px;margin:0;padding:0;border:1.5px solid var(--line-focus);border-radius:5px;background:var(--surface);cursor:pointer;transition:background-color 150ms ease,border-color 150ms ease}
.terms-confirm input:checked{background:var(--primary);border-color:var(--primary)}
.terms-confirm input::after{content:"";position:absolute;inset:0;background:var(--primary-ink);opacity:0;
 -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.2l3 3L14.5 7' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% 100% no-repeat;
 mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.2l3 3L14.5 7' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% 100% no-repeat}
.terms-confirm input:checked::after{opacity:1}
.terms-confirm input:focus{box-shadow:0 0 0 3px var(--ring)}
.terms-confirm input:checked+span{color:var(--ink)}
.terms-confirm.attention{color:var(--danger);animation:nudge 360ms var(--ease-out)}
.terms-confirm.attention input{border-color:var(--danger)}
@keyframes nudge{20%{transform:translateX(-4px)}40%{transform:translateX(4px)}60%{transform:translateX(-2px)}80%{transform:translateX(2px)}}
.checkout-total{flex-shrink:0}
.price{font-size:var(--fs-title);font-weight:600;letter-spacing:-.01em;line-height:1.3;font-variant-numeric:tabular-nums}
#submit-order{min-height:48px;font-size:var(--fs-head);font-weight:500}

.error-box{margin:0 0 14px;padding:12px 14px;border-radius:var(--r-sm);background:var(--danger-soft);color:var(--danger);font-size:var(--fs-body);line-height:1.6}
#availability-notice{margin-top:12px;background:var(--warn-soft);color:var(--warn)}
.info-note{margin:0 0 16px;padding:12px 14px;border-radius:var(--r-sm);background:var(--clay-soft);color:var(--ink);font-size:var(--fs-body);line-height:1.6}
.info-note strong{display:block;margin-bottom:4px;font-weight:600}
#recovery-panel{max-width:560px;margin:0 auto 24px}
.inline-actions{display:flex;gap:8px;margin-top:10px}
.inline-actions select{flex:1}
.empty-state{grid-column:1/-1;padding:36px 16px;border:1px dashed var(--line-strong);border-radius:var(--r-lg);color:var(--ink-2);text-align:center;font-size:var(--fs-body)}

.coming-soon{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;min-height:300px;border:1px solid var(--line-strong);border-radius:var(--r-lg);background:var(--surface)}
.coming-soon-art{display:grid;place-items:center;width:72px;height:72px;border-radius:18px;background:var(--clay-soft);color:var(--clay)}
.coming-soon-art svg{width:38px;height:38px}
.coming-soon h3{color:var(--ink-2)}

/* History */
.history-panel{margin-top:48px;padding:28px;border:1px solid var(--line-strong);border-radius:var(--r-lg);background:var(--surface);scroll-margin-top:76px}
.history-header{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}
.history-header h2{margin-bottom:6px}
.history-count{margin-left:6px;font-family:var(--font);font-size:var(--fs-body);font-weight:400;color:var(--ink-3)}
.history-header p:empty{display:none}
.history-header p,.history-explanation{font-size:var(--fs-body);line-height:1.6;color:var(--ink-2)}
.history-explanation{margin:8px 0}
.history-list{list-style:none;margin:8px 0 0;padding:0}
.history-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 0;border-top:1px solid var(--line)}
.history-info{display:flex;flex-direction:column;gap:4px;min-width:0}
.history-info strong{font-size:var(--fs-body);font-weight:600;overflow-wrap:anywhere}
.history-summary{font-size:var(--fs-body);line-height:1.5;color:var(--ink-2);overflow-wrap:anywhere}
.history-actions{display:flex;align-items:center;gap:12px;flex-shrink:0}
.history-actions .button{min-height:34px;padding:6px 14px}
.history-query-entry{margin-top:10px}

.site-footer{display:flex;justify-content:space-between;align-items:center;padding-top:24px;padding-bottom:max(32px,env(safe-area-inset-bottom));border-top:1px solid var(--line);font-size:var(--fs-body);color:var(--ink-3)}
.site-footer a{color:var(--ink-3)}

/* Dialogs: centered and scaled from 0.97 on wide screens, a bottom sheet on phones. */
dialog{width:min(480px,calc(100% - 32px));max-height:min(86vh,760px);overflow:auto;overscroll-behavior:contain;padding:28px;border:1px solid var(--line);border-radius:var(--r-lg);background:var(--surface);color:var(--ink);box-shadow:var(--shadow-lg);
 opacity:1;transform:none;transition:opacity 180ms ease,transform 240ms var(--ease-out),overlay 240ms allow-discrete,display 240ms allow-discrete}
dialog:not([open]){opacity:0;transform:scale(.97);transition-duration:140ms}
@starting-style{dialog[open]{opacity:0;transform:scale(.97) translateY(6px)}}
dialog::backdrop{background:rgba(20,20,19,.36);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);opacity:1;transition:opacity 200ms ease,overlay 200ms allow-discrete,display 200ms allow-discrete}
dialog:not([open])::backdrop{opacity:0}
@starting-style{dialog[open]::backdrop{opacity:0}}
.dialog-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
#lookup-dialog .inline-status{margin:0 0 18px}
#lookup-form .button{min-height:46px;font-size:var(--fs-head)}

.badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;font-size:var(--fs-body);font-weight:500;background:var(--surface-2);color:var(--ink-2);border:1px solid var(--line)}
.badge.pending::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--clay);animation:pulse 1.4s ease-in-out infinite}
.badge.success{background:var(--success-soft);color:var(--success);border-color:transparent}
.badge.success::before{content:"✓";font-weight:700}
.badge.failed{background:var(--danger-soft);color:var(--danger);border-color:transparent}
@keyframes pulse{50%{opacity:.35}}
.receipt-meta{display:grid;grid-template-columns:76px minmax(0,1fr);gap:10px 12px;margin:16px 0;padding:16px;border-radius:var(--r-md);background:var(--surface-2);font-size:var(--fs-body)}
.receipt-meta dt{color:var(--ink-3)}
.receipt-meta dd{margin:0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.receipt-actions{display:flex;gap:10px;margin-top:18px}
.receipt-voucher-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:4px}
.delivered-voucher{display:grid;gap:10px;margin:16px 0;padding:16px;border-radius:var(--r-md);background:var(--success-soft)}
.delivered-voucher strong{font-size:var(--fs-body);font-weight:600}
.delivered-voucher code{display:block;padding:12px;border-radius:8px;background:var(--surface);border:1px solid var(--line);font-family:var(--mono);font-size:var(--fs-body);line-height:1.6;word-break:break-all;-webkit-user-select:all;user-select:all}
.delivered-voucher .field-help{margin:0;color:var(--ink)}
.lookup-result{display:flex;flex-direction:column;gap:4px;width:100%;margin:0 0 10px;padding:14px;border:1px solid var(--line-strong);border-radius:var(--r-md);background:var(--surface);text-align:left;overflow-wrap:anywhere;transition:border-color 180ms ease,transform 160ms var(--ease-out)}
.lookup-result:active{transform:scale(.99)}
.lookup-result span,.lookup-result small{font-size:var(--fs-body);color:var(--ink-2)}
#reauthorize-form{margin-top:16px}

/* Payment hand-off to the provider. */
.pay-now{display:grid;gap:10px;margin:16px 0}
.pay-now .button{min-height:48px;font-size:var(--fs-head)}
.pay-now .field-help{margin:0;text-align:center}

/* Two-step subscription progress. */
.subscription-progress{margin:18px 0 4px}
.subscription-progress ol{display:flex;list-style:none;margin:0;padding:0}
.subscription-progress li{position:relative;flex:1;display:flex;flex-direction:column;align-items:center;gap:8px;font-size:var(--fs-body);color:var(--ink-3)}
.subscription-progress li:first-child::after{content:"";position:absolute;top:14px;left:calc(50% + 20px);width:calc(100% - 40px);height:1px;background:var(--line-strong)}
.subscription-progress ol:has(li:last-child.complete) li:first-child::after{background:var(--success)}
.progress-dot{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--surface-2);border:1px solid var(--line);font-size:var(--fs-body);font-weight:600;transition:background-color 300ms ease,color 300ms ease}
.subscription-progress .complete{color:var(--success)}
.subscription-progress .complete .progress-dot{background:var(--success);border-color:transparent;color:#fff}
.subscription-wait{margin:18px 0 0;padding:14px;border-radius:var(--r-md);background:var(--surface-2);text-align:center;font-size:var(--fs-body);line-height:1.6;color:var(--ink)}

.toast{position:fixed;z-index:100;left:50%;bottom:max(24px,env(safe-area-inset-bottom));max-width:min(90vw,420px);padding:11px 18px;border-radius:var(--r-sm);background:var(--primary);color:var(--primary-ink);font-size:var(--fs-body);font-weight:500;box-shadow:var(--shadow-lg);
 transform:translateX(-50%);opacity:1;transition:opacity 200ms ease,transform 300ms var(--ease-out),display 200ms allow-discrete}
@starting-style{.toast{opacity:0;transform:translate(-50%,12px)}}

/* Payment QR for computers; phones use the button (the provider link is meant for phones). */
.pay-qr{display:none;justify-self:center;padding:12px;border-radius:var(--r-md);background:#fff;border:1px solid var(--line)}
.pay-qr img{display:block;width:200px;height:200px;image-rendering:pixelated}
.pay-qr-hint{display:none;text-align:center;font-size:var(--fs-body);color:var(--ink-2)}
@media (hover:hover) and (pointer:fine){
 .pay-qr:not(:empty),.pay-qr:not(:empty)+.pay-qr-hint{display:block}
 .pay-qr:not(:empty)~#pay-now-link{background:var(--surface);color:var(--ink);border-color:var(--line-strong)}
}

/* Trust line under the main button. */
.trust-line{display:flex;align-items:center;justify-content:center;gap:6px;margin:12px 0 0;font-size:var(--fs-body);color:var(--ink-3)}
.trust-line svg{width:16px;height:16px;flex-shrink:0;color:var(--success)}

/* Quantity stepper. */
.stepper{display:inline-grid;grid-template-columns:44px 64px 44px;align-items:center;height:44px;border:1px solid var(--line-strong);border-radius:var(--r-sm);background:var(--surface);overflow:hidden}
.stepper-value{display:flex;align-items:center;justify-content:center;height:100%;border-left:1px solid var(--line);border-right:1px solid var(--line)}
.stepper-value input{width:100%;height:100%;padding:0;border:0;border-radius:0;background:transparent;text-align:center;font-size:var(--fs-body);font-weight:500;font-variant-numeric:tabular-nums}
.stepper-value input:focus{box-shadow:none;background:var(--surface-2)}
.stepper-button{height:100%;font-size:var(--fs-head);line-height:1;color:var(--ink);transition:background-color 150ms ease,opacity 150ms ease}
.stepper-button:active:not(:disabled){background:var(--surface-3)}
.stepper-button:disabled{color:var(--ink-3);opacity:.5}
@media (hover:hover) and (pointer:fine){.stepper-button:hover:not(:disabled){background:var(--surface-2)}}
/* Multi-voucher list. */
.voucher-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.voucher-list li{display:flex;align-items:center;gap:10px}
.voucher-list code{flex:1;min-width:0;padding:10px 12px}
.voucher-state{flex-shrink:0;font-size:var(--fs-body);font-weight:500;color:var(--success)}
.voucher-state.used{color:var(--ink-3)}

/* Standalone purchase note (not tied to any one field). */
.checkout-note{display:flex;align-items:flex-start;gap:10px;margin:0 0 22px;padding:12px 14px;border-radius:var(--r-sm);background:var(--surface-2);font-size:var(--fs-body);line-height:1.6;color:var(--ink-2)}
.checkout-note svg{width:16px;height:16px;flex-shrink:0;margin-top:3px;color:var(--ink-3)}

/* Tablet */
@media (max-width:900px){
 .store-grid{grid-template-columns:minmax(0,1fr)}
 .checkout-card{position:static}
}
/* Phone */
@media (max-width:600px){
 .wrap{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
 .site-header{height:56px;padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
 .site-header .button{min-height:34px;padding:6px 12px}
 .storefront-main{padding-top:12px;padding-bottom:40px}
 .ai-tabs{gap:0;margin-bottom:24px}
 .ai-tab{gap:6px;padding:0 4px}
 .ai-tab::after{left:6px;right:6px}
 .ai-logo{width:15px;height:15px}
 #product-heading{margin-bottom:12px}
 .store-grid{gap:20px}
 /* Plans become a list: name and term on the left, price on the right. */
 .products{grid-template-columns:minmax(0,1fr);gap:8px}
 .product-option{flex-direction:row;align-items:center;gap:12px;min-height:68px;padding:14px 16px;border-radius:var(--r-md)}
 .product-top{flex:1;min-width:0;flex-direction:row-reverse;justify-content:flex-end;gap:12px}
 .radio-dot{margin-left:0}
 .product-price{margin-top:0;display:flex;flex-direction:row-reverse;align-items:baseline;gap:6px;font-size:var(--fs-head);white-space:nowrap}
 .product-term{margin-top:0}
 .product-option[data-unpriced] .product-price{font-size:var(--fs-body)}
 .checkout-card{padding:22px 20px}
 .history-panel{padding:22px 20px}
 .history-header{flex-direction:column;gap:10px}
 .history-row{align-items:flex-start}
 .history-row .history-actions{flex-direction:column;align-items:flex-end;gap:6px}
 .receipt-voucher-actions{grid-template-columns:1fr}
 /* Phones get a bottom sheet that slides up and back down the same path. */
 dialog{width:100%;max-width:none;max-height:90dvh;margin:auto 0 0;padding:22px 20px max(24px,env(safe-area-inset-bottom));border-radius:18px 18px 0 0;
  transition:transform 320ms var(--ease-drawer),opacity 200ms ease,overlay 320ms allow-discrete,display 320ms allow-discrete}
 dialog:not([open]){opacity:1;transform:translateY(100%);transition-duration:220ms}
 @starting-style{dialog[open]{opacity:1;transform:translateY(100%)}}
 /* Price and main button stay pinned to the bottom on phones. */
 .checkout-bar{position:fixed;z-index:15;left:0;right:0;bottom:0;padding:12px max(16px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));
  display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:16px;
  background:color-mix(in srgb,var(--surface) 90%,transparent);-webkit-backdrop-filter:saturate(160%) blur(16px);backdrop-filter:saturate(160%) blur(16px);box-shadow:0 -1px 0 var(--line)}
 .checkout-bar{grid-template-areas:"confirm link" "price button" "trust trust";row-gap:10px}
 .checkout-bar:has(#order-summary.hidden){grid-template-areas:"button button" "trust trust"}
 .checkout-bar .order-summary{display:contents}
 .checkout-bar .terms-confirm{grid-area:confirm;margin:0}
 .checkout-bar .terms-link{grid-area:link;justify-self:end}
 .checkout-bar .checkout-total{grid-area:price;margin:0}
 .checkout-bar .price{line-height:1.1}
 .checkout-bar #submit-order{grid-area:button;min-height:46px}
 .checkout-bar .trust-line{grid-area:trust;margin-top:0}
 body{padding-bottom:calc(150px + env(safe-area-inset-bottom))}
 .toast{bottom:calc(160px + env(safe-area-inset-bottom))}
}
@media (max-width:340px){
 .ai-tab .ai-logo{display:none}
}
@media (prefers-reduced-motion:reduce){
 *,*::before,*::after{transition-duration:0ms!important;animation:none!important}
 dialog,dialog:not([open]){transition:opacity 150ms ease!important;transform:none!important}
 @starting-style{dialog[open]{transform:none}}
}
@media (prefers-reduced-transparency:reduce){
 .site-header,.checkout-bar{background:var(--bg);-webkit-backdrop-filter:none;backdrop-filter:none}
}

/* Test mode banner (only rendered by test-mode.js under ?test). */
.test-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px max(16px,calc((100vw - 1080px)/2 + 24px));background:var(--clay);color:#fff;font-size:var(--fs-body);line-height:1.5}
.test-banner strong{margin-right:8px;font-weight:600}
.test-banner-actions{display:flex;align-items:center;gap:14px;flex-shrink:0}
.test-banner button,.test-banner a{color:#fff;font-weight:500;text-decoration:underline;text-underline-offset:3px}
@media (max-width:600px){.test-banner{align-items:flex-start;padding:8px 16px}}

/* 加微信 dialog: a small centred card with the WeChat mark, the QR code and the add-friend button. */
dialog.support-dialog{width:min(340px,calc(100% - 32px));padding:20px 24px 24px}
.support-dialog .dialog-header{margin-bottom:0}
.support-body{display:grid;justify-items:center;gap:16px;text-align:center}
.support-body h2{display:flex;align-items:center;gap:8px;font-family:var(--serif);font-size:var(--fs-title);font-weight:500;line-height:1.3}
.wechat-mark{width:24px;height:24px;flex-shrink:0}
.support-qr{display:block;width:200px;height:200px;-webkit-touch-callout:default;-webkit-user-select:auto;user-select:auto;padding:10px;border-radius:var(--r-md);background:#fff;border:1px solid var(--line);object-fit:contain}
#support-link{min-height:46px;font-size:var(--fs-head)}
#support-link .wechat-mark{width:20px;height:20px}
@media (max-width:600px){
 .site-header nav{gap:14px}
 dialog.support-dialog{width:100%;padding:16px 20px max(28px,env(safe-area-inset-bottom))}
}

/* 买前须知 dialog: numbered terms in body text, generous line height. */
dialog.terms-dialog{width:min(520px,calc(100% - 32px))}
.terms-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-4px 0 12px -8px}
.terms-toolbar .terms-accept{min-height:34px;padding:6px 12px}
#terms-heading{margin:0 0 14px;font-family:var(--serif);font-size:var(--fs-title);font-weight:500;line-height:1.3}
.terms-dialog>.terms-accept{min-height:46px;font-size:var(--fs-head)}
.terms-content{margin:0 0 20px;font-size:var(--fs-body);line-height:1.75;color:var(--ink-2)}
.terms-content p{margin:0 0 10px}
.terms-content ol{margin:0;padding:0;list-style:none;counter-reset:term;display:grid;gap:12px}
.terms-content li{position:relative;padding-left:32px;counter-increment:term}
.terms-content li::before{content:counter(term);position:absolute;left:0;top:1px;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--surface-2);border:1px solid var(--line);font-size:var(--fs-body);font-weight:500;line-height:1;color:var(--ink);font-variant-numeric:tabular-nums}
.terms-content li:last-child{color:var(--ink);font-weight:500}
@media (max-width:600px){dialog.terms-dialog{width:100%}}

/* 订阅 / 成品号 section tabs in the header (2026-10-30). */
.section-tabs{display:flex;gap:2px;padding:3px;border-radius:var(--r-sm);background:var(--seg-track);margin-right:auto;margin-left:8px}
.section-tab{height:32px;padding:0 16px;border-radius:7px;font-size:var(--fs-body);font-weight:500;color:var(--ink-2);white-space:nowrap;transition:color 180ms ease,background-color 180ms ease,box-shadow 180ms ease}
.section-tab.active{background:var(--seg-active);color:var(--ink);box-shadow:0 1px 2px rgba(31,30,29,.08),0 0 0 .5px rgba(31,30,29,.06)}
@media (hover:hover) and (pointer:fine){.section-tab:hover:not(.active){color:var(--ink)}}
#account-heading{margin:0 0 16px;font-family:var(--serif);font-size:var(--fs-title);font-weight:500}
#account-closed{margin-bottom:16px}
/* 成品号 shop cards: a grid of products, each opening its detail window. */
.account-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px}
.account-card{display:flex;flex-direction:column;gap:10px;min-width:0;min-height:180px;padding:20px;border:1px solid var(--line-strong);border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--shadow-sm);text-align:left;color:var(--ink);transition:transform 160ms var(--ease-out),border-color 160ms ease,box-shadow 160ms ease}
.account-card:active{transform:scale(.99)}
@media (hover:hover) and (pointer:fine){.account-card:hover{border-color:var(--line-focus);box-shadow:var(--shadow-md)}}
.account-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.account-card-name{font-size:var(--fs-head);font-weight:600;line-height:1.4}
.account-badge{flex-shrink:0;padding:2px 8px;border-radius:999px;background:var(--surface-3);color:var(--ink-3);font-size:var(--fs-body)}
.account-card-desc{font-size:var(--fs-body);line-height:1.5;color:var(--ink-2);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.account-card-bottom{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-top:auto}
.account-card-price{font-size:var(--fs-title);font-weight:600;letter-spacing:-.01em;font-variant-numeric:tabular-nums}
.account-card-stock{font-size:var(--fs-body);color:var(--ink-3);white-space:nowrap}
.account-card-cta{font-size:var(--fs-body);font-weight:500;color:var(--clay-ink)}
.account-card.sold-out{background:var(--surface-2);box-shadow:none;border-color:var(--line)}
.account-card.sold-out .account-card-name,.account-card.sold-out .account-card-price{color:var(--ink-3)}
/* Product window: details on top, the purchase form below, total and button pinned at the bottom. */
dialog.account-dialog{width:min(560px,calc(100% - 32px));padding-bottom:0}
.account-dialog .dialog-header{margin-bottom:4px}
.account-dialog-kicker{font-size:var(--fs-body);color:var(--ink-3)}
#account-dialog-title{margin:0 0 8px;font-family:var(--serif);font-size:var(--fs-title);font-weight:500;line-height:1.3}
.account-dialog-price{display:flex;align-items:baseline;gap:12px;margin-bottom:12px}
#account-dialog-price{font-size:var(--fs-title);font-weight:600;font-variant-numeric:tabular-nums}
.account-stock{font-size:var(--fs-body);color:var(--success)}
.account-stock.out{color:var(--ink-3)}
.account-dialog-summary{margin:0 0 12px;color:var(--ink-2);line-height:1.6;white-space:pre-line}
.account-detail{margin:0 0 20px;padding:16px;border-radius:var(--r-md);background:var(--surface-2);font-size:var(--fs-body);line-height:1.75;color:var(--ink-2)}
.account-detail p{margin:0 0 8px}.account-detail p:last-child{margin-bottom:0}
.account-detail ol{margin:0 0 8px;padding-left:20px;display:grid;gap:6px}.account-detail ol:last-child{margin-bottom:0}
.account-buy-fields{display:grid;gap:4px}
.account-buy-bar{position:sticky;bottom:0;display:flex;align-items:center;justify-content:space-between;gap:16px;margin:12px -28px 0;padding:14px 28px max(16px,env(safe-area-inset-bottom));background:color-mix(in srgb,var(--surface) 92%,transparent);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);box-shadow:0 -1px 0 var(--line)}
.account-buy-total{display:flex;align-items:baseline;gap:10px}
.account-buy-total span{font-size:var(--fs-body);color:var(--ink-2)}
#account-submit{min-width:150px;min-height:46px;font-size:var(--fs-head)}
.account-list li{align-items:flex-start}
.account-list code{white-space:pre-wrap}
.account-list .button{min-height:34px;padding:6px 12px;flex-shrink:0}
.account-delivery-note{display:grid;gap:4px}
.account-delivery-note p{margin:0;white-space:pre-line;line-height:1.6}
@media (max-width:600px){
 .section-tabs{margin-left:0}
 .section-tab{padding:0 10px;height:30px}
 .account-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .account-card{min-height:150px;padding:14px;gap:8px}
 .account-card-price{font-size:var(--fs-head)}
 .account-card-bottom{flex-direction:column;align-items:flex-start;gap:2px}
 dialog.account-dialog{width:100%}
 .account-buy-bar{margin:12px -20px 0;padding:12px 20px max(16px,env(safe-area-inset-bottom))}
 #account-submit{min-width:0;flex:1}
}
@media (max-width:420px){.site-header .wordmark{display:none}.site-header nav{gap:10px}}
/* Five category tabs need the room the logos take on phones. */
@media (max-width:480px){.account-tabs .ai-logo{display:none}.account-tabs .ai-tab{padding:0 2px}}
