html:has(#purchase-dialog[open]) { overflow: hidden; scrollbar-gutter: stable; }
.purchase-dialog { width: min(500px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 40px); margin: auto; padding: 0; border: 1px solid #394256; border-radius: 14px; background: #131720; color: var(--ink); box-shadow: 0 25px 90px #03050bb3; overflow: hidden; }
.purchase-dialog[open] { display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; }
.purchase-dialog::backdrop { background: #05070bbd; backdrop-filter: blur(6px); }
.purchase-header { grid-row: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 26px 18px; border-bottom: 1px solid #2d3544; }
.purchase-dialog h2 { font-size: 24px; font-weight: 500; line-height: 1.4; letter-spacing: -.03em; margin: 0; }
.purchase-dialog h3 { font-size: 20px; font-weight: 500; line-height: 1.5; margin: 0 0 14px; }
.purchase-dialog p { font-size: 16px; line-height: 1.8; }
.purchase-dialog button { min-height: 44px; padding: 10px 15px; border: 1px solid #e0e8ff; border-radius: 7px; background: #e0e8ff; color: #182030; font-size: 16px; line-height: 1.5; font-weight: 500; }
.purchase-dialog button:hover:not(:disabled) { background: #fff; }
.purchase-dialog button:active:not(:disabled) { transform: translateY(1px); }
.purchase-dialog button.secondary { background: transparent; border-color: #485976; color: #c5d3ec; }
.purchase-dialog button.secondary:hover:not(:disabled) { background: #253149; }
.purchase-dialog .icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 10px; flex-shrink: 0; background: transparent; border-color: transparent; color: #a4b1ca; }
.purchase-dialog .icon-button:hover:not(:disabled) { background: #263145; color: white; }
.icon-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.checkout-message { grid-row: 2; padding: 12px 26px; margin: 0; font-size: 16px; color: #cadaf5; background: #202c44; overflow-wrap: anywhere; }
.checkout-message:empty { display: none; }
.checkout-message.error { background: #302129; color: #f0bcc5; }
.purchase-layout, .checkout-loading, .checkout-error { grid-row: 3; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.product-summary { padding: 23px 26px 0; }
.summary-content { border-bottom: 1px solid #303a4d; padding-bottom: 20px; }
.summary-tag { color: #a0afc8; font-size: 14px !important; margin: 0 0 12px; }
.summary-price { display: flex; flex-direction: column; gap: 9px; }
.summary-price strong { font-size: 38px; font-weight: 500; line-height: 1.2; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.summary-price span { font-size: 16px; color: #adbcd5; }
.summary-details { margin-top: 18px; }
.purchase-dialog summary { font-size: 16px; font-weight: 400; color: #b5c6e5; cursor: pointer; }
.purchase-dialog details p { color: #a5b6d2; margin: 15px 0 0; }
.purchase-dialog dl { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px 16px; font-size: 16px; margin-block: 20px; }
.purchase-dialog dt { color: #9bafcf; }
.purchase-dialog dd { color: #d0dcf2; text-align: right; margin: 0; overflow-wrap: anywhere; }
.purchase-dialog[data-has-order=true] .product-summary, .purchase-dialog[data-view=orders] .product-summary { display: none; }
.checkout-main { padding: 23px 26px; }
.checkout-main > section:not([hidden]) ~ section:not([hidden]) { margin-top: 22px; }
.purchase-dialog .hint { font-size: 16px; color: #a0b1cd; line-height: 1.8; margin: 0 0 16px; }
.purchase-dialog label { display: block; font-size: 16px; font-weight: 400; color: #c0cee7; margin: 0; }
.purchase-dialog input:not([type=radio]), .purchase-dialog textarea, .purchase-dialog select { display: block; width: 100%; min-width: 0; min-height: 46px; padding: 11px 12px; margin-top: 8px; border: 1px solid #435371; border-radius: 6px; background: #0d121c; color: #e0e8f8; font-size: 16px; line-height: 1.5; }
.purchase-dialog input::placeholder, .purchase-dialog textarea::placeholder { color: #889ab8; opacity: 1; }
.purchase-dialog textarea { resize: vertical; }
.purchase-dialog .full-button { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 48px; }
.auth-tabs { display: flex; gap: 28px; margin-bottom: 20px; }
.purchase-dialog .auth-tabs button { padding: 5px 0 10px; background: transparent; border: 0; border-radius: 0; border-bottom: 2px solid transparent; color: #9cacc8; }
.purchase-dialog .auth-tabs button[aria-selected=true] { color: #e1eaff; border-bottom-color: #bbcdfa; }
.purchase-dialog .auth-tabs button:hover { background: transparent; color: #fff; }
#user-auth-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
#auth-submit, .account-notes { grid-column: 1 / -1; }
.account-notes { margin-top: 1px; }
.signed-in-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.account-check { color: #b8cff8; font-size: 16px; }
#user-name { font-size: 16px; font-weight: 400; color: #becde6; overflow-wrap: anywhere; }
.purchase-dialog .text-button { color: #b3c4e2; background: transparent; border-color: transparent; font-weight: 400; padding: 8px 3px; }
.purchase-dialog .text-button:hover:not(:disabled) { background: #222f46; color: #edf3ff; }
#user-logout { margin-left: auto; }
.legacy-orders { margin-top: 10px; }
.payment-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 0; padding: 0; margin: 0 0 23px; }
.purchase-dialog .payment-method { display: grid; grid-template-columns: 27px minmax(0,1fr) 14px; align-items: center; gap: 10px; min-height: 68px; padding: 13px; background: #101722; border: 1px solid #43516d; border-radius: 8px; cursor: pointer; }
.payment-method:has(input:checked) { background: #233049; border-color: #b2c5f1; }
.payment-method:has(input:disabled) { opacity: .4; cursor: default; }
.payment-method:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.payment-method input { width: 14px; height: 14px; margin: 0; accent-color: #bdcff9; }
.payment-method strong { font-size: 16px; font-weight: 500; }
.method-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 6px; }
.wechat-icon { background: #19372c; color: #92d7b6; }
.wechat-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.alipay-icon { background: #203850; color: #abd5ff; font-size: 19px; }
.order-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.order-heading .hint { margin: 0; color: #c3d2ec; }
#new-order { flex-shrink: 0; }
.payment-code { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0 0 23px; text-align: center; }
.code-amount { display: flex; flex-direction: column; gap: 8px; }
.code-amount span { font-size: 16px; color: #a6b9d7; }
.code-amount strong { font-size: 38px; line-height: 1.2; font-weight: 500; letter-spacing: -.05em; }
.qr-paper { padding: 12px; background: white; border-radius: 9px; }
.qr-paper img { width: 188px; height: 188px; display: block; object-fit: contain; }
.code-caption { display: none; }
.note-details { margin-bottom: 21px; }
#submit-form .hint { text-align: center; margin: 14px 0 0; }
.order-information, .refund-details { padding-top: 18px; border-top: 1px solid #303b50; margin-top: 22px; }
.order-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.refund-details form { padding-top: 17px; }
.refund-details button { margin-top: 16px; }
.refund-details .hint { margin: 14px 0 0; }
.order-state-panel, .activation-panel { margin-bottom: 22px; }
.order-state-panel p, .activation-panel p { color: #aabedb; margin-bottom: 23px; }
.state-symbol { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #607ba7; border-radius: 50%; color: #c6d9ff; font-size: 22px; margin-bottom: 20px; }
.activation-key { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.purchase-dialog .activation-key input { flex: 1; margin-top: 0; }
.activation-key button { flex-shrink: 0; }
.quota-details { margin-top: 24px; }
.order-history { margin-bottom: 24px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: #a0b2d0; font-size: 14px; }
.checkout-empty { text-align: center; padding-block: 25px; color: #b8cae7; }
.checkout-empty svg { display: none; }
.checkout-empty strong { font-size: 18px; font-weight: 400; }
.checkout-empty p { color: #9cb0d0; margin: 17px 0 0; }
.purchase-footer { grid-row: 4; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid #2e384a; padding: 12px 26px; }
#purchase-subtitle { font-size: 14px; color: #a2b3d0; margin: 0; }
.checkout-loading, .checkout-error { padding: 28px 26px; }
.checkout-loading p, .checkout-error p { color: #acbed9; }
.loading-line { display: block; height: 44px; border-radius: 7px; background: #242f43; margin-bottom: 17px; }
.loading-line.short { height: 22px; width: 65%; }
.purchase-dialog .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media(max-width:600px) { .purchase-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); } .purchase-header { padding: 19px 20px 15px; } .purchase-dialog h2 { font-size: 23px; } .product-summary { padding: 20px 20px 0; } .checkout-main { padding: 20px; } .purchase-footer { padding: 10px 20px; gap: 10px; } .checkout-message { padding-inline: 20px; } #user-auth-form { grid-template-columns: 1fr; } }
@media(max-width:360px) { .purchase-header, .product-summary, .checkout-main, .purchase-footer { padding-inline: 16px; } .purchase-dialog .payment-method { padding: 10px; grid-template-columns: 24px minmax(0,1fr) 13px; gap: 7px; } .method-icon { width: 24px; height: 24px; } .activation-key { flex-direction: column; align-items: stretch; } }
