/* ============================================================
   RunningHub 邀请积分 · 用户端样式（重构版）
   设计：轻量金融科技风 —— 极光背景 + 玻璃拟态卡片
   兼容：Chrome / Edge / Firefox / Safari 近四代及主流移动端，
         关键视觉效果均带降级方案，功能布局不依赖新特性。
   ============================================================ */

:root {
    color-scheme: light;
    --page: #edf0f8;
    --surface: #ffffff;
    --surface-soft: #f6f8fc;
    --surface-glass: rgba(255, 255, 255, 0.86);
    --ink: #141b34;
    --ink-strong: #0b1130;
    --muted: #5d6679;
    --faint: #939cb0;
    --line: #e3e8f3;
    --line-strong: #cbd3e4;
    --brand: #4f46e5;
    --brand-2: #7c3aed;
    --brand-dark: #3d35c0;
    --brand-soft: #eef0ff;
    --brand-ring: rgba(79, 70, 229, 0.22);
    --green: #0b8457;
    --green-soft: #e7f8f0;
    --red: #bd2c1c;
    --red-soft: #fdf0ee;
    --amber: #96690a;
    --amber-soft: #fdf5e0;
    --alipay: #1677ff;
    --alipay-dark: #0e5fd7;
    --wechat: #09a154;
    --wechat-dark: #078044;
    --gradient-brand: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #a855f7 100%);
    --shadow-card: 0 1px 2px rgba(20, 27, 52, 0.04), 0 16px 44px rgba(20, 27, 52, 0.08);
    --shadow-pop: 0 24px 70px rgba(11, 17, 48, 0.28);
    --shadow-button: 0 6px 18px rgba(79, 70, 229, 0.32);
    --radius: 20px;
    --radius-inner: 13px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background: var(--page);
    background:
        radial-gradient(900px 520px at 12% -10%, rgba(99, 102, 241, 0.20), rgba(99, 102, 241, 0) 62%),
        radial-gradient(820px 480px at 96% 2%, rgba(34, 211, 238, 0.14), rgba(34, 211, 238, 0) 60%),
        radial-gradient(760px 620px at 52% 108%, rgba(168, 85, 247, 0.12), rgba(168, 85, 247, 0) 62%),
        var(--page);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 细网格纹理，仅作装饰，不支持时自动忽略 */
body::before {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(20, 27, 52, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 27, 52, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(760px 480px at 50% 0%, #000 0%, transparent 100%);
    mask-image: radial-gradient(760px 480px at 50% 0%, #000 0%, transparent 100%);
    pointer-events: none;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

/* 键盘与鼠标均可感知焦点；支持 :focus-visible 的浏览器鼠标点击不出现描边 */
button:focus,
input:focus {
    outline: 3px solid var(--brand-ring);
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
    outline: none;
}

button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--brand-ring);
    outline-offset: 2px;
}

h1,
h2,
p {
    margin-top: 0;
}

/* ---------- 页面骨架 ---------- */

.page-shell {
    width: calc(100% - 28px);
    max-width: 920px;
    width: min(920px, calc(100% - 28px));
    margin: 0 auto;
    padding: 40px 0 72px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 26px;
}

.brand-lockup {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 17px;
    background: #4f46e5;
    background: var(--gradient-brand);
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    color: #ffffff;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 2px rgba(28, 20, 90, 0.35);
}

.site-header h1 {
    margin-bottom: 4px;
    color: var(--ink-strong);
    font-size: 26px;
    font-size: clamp(22px, 4vw, 30px);
    line-height: 1.18;
    letter-spacing: 0.01em;
}

.site-header p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 14px;
}

.domain-ai {
    background: #4f46e5;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: var(--red);
    color: transparent;
    font-weight: 900;
}

/* 网址整串全彩渐变 */
.brand-domain {
    background: #4f46e5;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: var(--brand) !important;
    color: transparent !important;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.history-button {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid #c3cbfa;
    background: rgba(255, 255, 255, 0.92);
    color: var(--brand-dark);
    box-shadow: 0 2px 10px rgba(20, 27, 52, 0.06);
}

.site-header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.header-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.header-action-button:focus-visible {
    outline: 3px solid var(--brand-ring);
    outline-offset: 2px;
}

.history-button:hover:not(:disabled) {
    border-color: #a5b0f8;
    background: #ffffff;
    color: var(--brand);
}

/* 登录态没有右上角操作按钮时，品牌标题保持在页面正中。登录后仍
   保留右上角“历史订单”按钮，不改变应用页的导航布局。 */
body:not(.is-app) .site-header {
    justify-content: center;
}

body:not(.is-app) .brand-lockup {
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

body:not(.is-app) .brand-lockup > div:last-child {
    text-align: center;
}

/* ---------- 全局提示 ---------- */

.global-message {
    margin-bottom: 16px;
    padding: 13px 16px;
    border: 1px solid #c5ccf7;
    border-left-width: 4px;
    border-radius: 13px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 600;
    line-height: 1.55;
    box-shadow: 0 4px 14px rgba(20, 27, 52, 0.05);
}

.global-message.error {
    border-color: #f3c0ba;
    background: var(--red-soft);
    color: var(--red);
}

.global-message.success {
    border-color: #abe4cb;
    background: var(--green-soft);
    color: var(--green);
}

/* ---------- 卡片（玻璃拟态，不支持时退化为实色） ---------- */

.card {
    position: relative;
    margin-bottom: 18px;
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    background: var(--surface-glass);
    box-shadow: var(--shadow-card);
}

@supports ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
    .card {
        border-color: rgba(255, 255, 255, 0.72);
        -webkit-backdrop-filter: blur(16px) saturate(1.4);
        backdrop-filter: blur(16px) saturate(1.4);
    }
}

.login-card {
    width: 100%;
    max-width: 460px;
    width: min(460px, 100%);
    margin: 44px auto 0;
}

/* 登录卡片顶部的高光装饰条 */
.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 26px;
    right: 26px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: #4f46e5;
    background: var(--gradient-brand);
    opacity: 0.9;
}

.section-heading {
    margin-bottom: 18px;
}

.login-card .section-heading {
    text-align: center;
}

.login-card .section-heading > div {
    width: 100%;
}

.section-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.section-heading h2,
.account-heading h2 {
    margin: 0;
    color: var(--ink-strong);
    font-size: 21px;
    line-height: 1.25;
    letter-spacing: 0.01em;
}

.purchase-price {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    padding: 4px 9px;
    border: 1px solid rgba(96, 165, 250, 0.42);
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.1);
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0;
    white-space: nowrap;
    vertical-align: middle;
}

.purchase-price[hidden] {
    display: none;
}

.section-description {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

/* 登录前免责声明 */
/* 用户协议勾选 */
.agree-row {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    margin: 6px 0;
    padding: 4px 0;
}

.agree-row input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.agree-box {
    -ms-flex: none;
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border: 1.5px solid #c4cbe0;
    border-radius: 5px;
    background: #fff;
    -webkit-transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    position: relative;
}

.agree-row input:checked + .agree-box {
    border-color: var(--brand);
    background: #4f46e5;
    background: var(--gradient-brand);
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
}

.agree-row input:focus + .agree-box {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.agree-row input:checked + .agree-box::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
}

.agree-text {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.agree-link {
    color: var(--brand);
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    -webkit-text-decoration-style: dotted;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.agree-hint {
    margin: -6px 0 0 27px;
    color: #dc2626;
    font-size: 12.5px;
}

.agree-row.shake {
    -webkit-animation: agree-shake 0.4s ease;
    animation: agree-shake 0.4s ease;
}

@-webkit-keyframes agree-shake {
    0%, 100% { -webkit-transform: translateX(0); }
    25% { -webkit-transform: translateX(-6px); }
    50% { -webkit-transform: translateX(5px); }
    75% { -webkit-transform: translateX(-3px); }
}

@keyframes agree-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
}

/* 用户协议弹窗 */
.agree-dialog {
    width: 560px;
    width: min(560px, 100%);
    max-height: 78vh;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    border: 1px solid #e3e7f4;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(15, 23, 60, 0.3);
    outline: none;
    -webkit-animation: dialog-pop 0.28s cubic-bezier(0.2, 0.9, 0.25, 1.1) both;
    animation: dialog-pop 0.28s cubic-bezier(0.2, 0.9, 0.25, 1.1) both;
}

.agree-dialog h3 {
    margin: 0;
    padding: 20px 24px 14px;
    font-size: 18px;
    color: var(--ink);
    border-bottom: 1px solid #eef1f9;
}

.agree-dialog-body {
    padding: 16px 24px;
    overflow-y: auto;
}

.agree-dialog-body ol {
    margin: 0;
    padding-left: 19px;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.85;
}

.agree-dialog-body li {
    margin-bottom: 9px;
}

.agree-dialog-body li:last-child {
    margin-bottom: 0;
    color: var(--ink);
    font-weight: 600;
}

.agree-dialog-body strong {
    color: #b8860b;
}

.agree-dialog-body .agreement-critical {
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid rgba(184, 134, 11, 0.34);
    border-left: 4px solid #b8860b;
    border-radius: 10px;
    background: rgba(255, 247, 214, 0.72);
    color: #614700;
    font-weight: 750;
    line-height: 1.75;
}

.agree-read-status {
    margin: 0;
    padding: 11px 24px 0;
    color: var(--amber);
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.agree-read-status.is-ready {
    color: var(--green);
}

.agree-row.is-locked .agree-box {
    border-color: var(--line-strong);
    background: var(--surface-soft);
}

.agree-dialog-actions {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 12px;
    -webkit-box-pack: end;
    -ms-flex-pack: end;
    justify-content: flex-end;
    padding: 14px 24px 18px;
    border-top: 1px solid #eef1f9;
}

.agree-dialog-actions .button-primary {
    width: auto;
    padding: 0 22px;
}

.agree-dialog-actions .button-secondary {
    padding: 0 20px;
}

/* 密码设置说明弹窗 */
.password-help-dialog {
    width: 520px;
    width: min(520px, 100%);
    max-height: min(820px, calc(100vh - 48px));
    overflow-y: auto;
    padding: 22px;
    border: 1px solid #e3e7f4;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(15, 23, 60, 0.3);
    outline: none;
    -webkit-animation: dialog-pop 0.28s cubic-bezier(0.2, 0.9, 0.25, 1.1) both;
    animation: dialog-pop 0.28s cubic-bezier(0.2, 0.9, 0.25, 1.1) both;
}

.password-help-dialog:focus {
    outline: none;
}

.password-help-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.password-help-header h3 {
    margin: 0;
    color: var(--ink-strong);
    font-size: 19px;
    line-height: 1.35;
}

.password-help-note {
    margin: 18px 0 16px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.password-help-image-wrap {
    display: flex;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #111;
}

.password-help-image-wrap img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
}

@-webkit-keyframes dialog-pop {
    from { opacity: 0; -webkit-transform: translateY(26px) scale(0.95); }
    to { opacity: 1; -webkit-transform: translateY(0) scale(1); }
}

@keyframes dialog-pop {
    from { opacity: 0; transform: translateY(26px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

form {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.field-label {
    color: #3c4457;
    font-size: 13px;
    font-weight: 700;
}

.password-help-link {
    flex: 0 0 auto;
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.password-help-link:hover {
    color: var(--brand-dark);
}

.password-help-link:focus-visible {
    outline: 3px solid var(--brand-ring);
    outline-offset: 3px;
    border-radius: 4px;
}

.field > span,
.field-label {
    color: var(--ink-strong);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.015em;
}

.package-label {
    color: #3c4457;
    font-size: 13px;
    font-weight: 700;
}

input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #ffffff;
    color: var(--ink);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input::placeholder {
    color: var(--faint);
}

.login-card input {
    font-size: 16px;
    font-weight: 600;
}

.login-card input::placeholder {
    color: var(--muted);
    font-weight: 500;
}

input:hover {
    border-color: #b4bdd6;
}

input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

/* ---------- 按钮 ---------- */

.button {
    min-height: 48px;
    padding: 0 18px;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:active:not(:disabled) {
    transform: translateY(0) scale(0.985);
}

.button:disabled,
.credit-package:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.button-primary {
    background: #4f46e5;
    background: var(--gradient-brand);
    background-size: 140% 140%;
    background-position: 0% 50%;
    box-shadow: var(--shadow-button);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(28, 20, 90, 0.25);
}

.button-primary:hover:not(:disabled) {
    background-position: 60% 50%;
    box-shadow: 0 10px 26px rgba(79, 70, 229, 0.4);
}

.button-secondary {
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: #3c4457;
}

.button-secondary:hover:not(:disabled) {
    border-color: var(--line-strong);
    background: #ffffff;
}

.button-danger {
    border: 1px solid #efb4ad;
    background: var(--red-soft);
    color: var(--red);
}

.button-danger:hover:not(:disabled) {
    border-color: #e28e84;
    background: #fde5e2;
}

.button-small {
    min-height: 38px;
    padding: 0 13px;
    font-size: 13px;
}

.text-button {
    padding: 5px;
    border-radius: 8px;
    background: transparent;
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.text-button:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

/* ---------- 账号卡片 ---------- */

.account-card {
    overflow: hidden;
}

/* 账号卡片顶部氛围光 */
.account-card::before {
    content: "";
    position: absolute;
    top: -70px;
    right: -60px;
    width: 240px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(124, 58, 237, 0.12), transparent);
    pointer-events: none;
}

.account-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.account-heading h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.account-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    overflow-wrap: anywhere;
    word-break: break-all;
}

.account-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.partner-badge {
    padding: 4px 9px;
    border: 1px solid #f2d98c;
    border-radius: 999px;
    background: #fff3cf;
    background: linear-gradient(135deg, #fff3c4, #ffe08a);
    box-shadow: 0 2px 8px rgba(150, 105, 10, 0.18);
    color: #6b4e00;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
}

.eligibility-banner {
    margin: 20px 0 14px;
    padding: 13px 15px;
    border: 1px solid #abe4cb;
    border-left-width: 4px;
    border-radius: 13px;
    background: var(--green-soft);
    color: var(--green);
    font-weight: 600;
    line-height: 1.6;
}

.eligibility-banner.warning {
    border-color: #eed28a;
    background: var(--amber-soft);
    color: var(--amber);
}

.eligibility-banner.error {
    border-color: #f3c0ba;
    background: var(--red-soft);
    color: var(--red);
}

/* ---------- 指标网格 ---------- */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (min-width: 721px) {
    .metrics-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .metrics-grid.is-partner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.metric {
    position: relative;
    min-width: 0;
    padding: 15px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-inner);
    background: var(--surface-soft);
    overflow: hidden;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.metric:hover {
    transform: translateY(-2px);
    border-color: #d3dafa;
    box-shadow: 0 10px 22px rgba(20, 27, 52, 0.08);
}

/* 指标左侧高光 */
.metric::before {
    content: "";
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #4f46e5;
    background: var(--gradient-brand);
    opacity: 0.85;
}

.metric-wide {
    grid-column: span 2;
}

@media (max-width: 720px) {
    .metric-wide {
        grid-column: auto;
    }
}

.metric span,
.metric small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.metric strong {
    display: block;
    margin: 6px 0 5px;
    overflow-wrap: anywhere;
    color: var(--ink-strong);
    font-size: 21px;
    font-weight: 800;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.snapshot-time {
    margin: 13px 0 0;
    color: var(--faint);
    font-size: 11px;
    text-align: right;
}

.section-description {
    margin: -5px 0 20px;
}

.arrival-speed-inline {
    color: var(--amber);
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
}

/* ---------- 积分套餐 ---------- */

.package-field {
    display: grid;
    gap: 11px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.package-field small {
    color: var(--muted);
    font-size: 12px;
}

.package-field small.error {
    color: var(--red);
    font-weight: 700;
}

.package-field small.warning {
    color: #f59e0b;
    font-weight: 800;
}

.credit-amount-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 68px 68px;
    gap: 8px;
    width: min(100%, 460px);
}

.credit-amount-field {
    position: relative;
    min-width: 0;
}

.credit-amount-input {
    width: 100%;
    height: 54px;
    padding-right: 58px;
    font-size: 18px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
}

.credit-amount-input::-webkit-inner-spin-button,
.credit-amount-input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.credit-amount-input:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.credit-amount-unit {
    position: absolute;
    top: 50%;
    right: 16px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    pointer-events: none;
    transform: translateY(-50%);
}

.credit-adjust-button {
    display: grid;
    place-content: center;
    gap: 1px;
    min-width: 0;
    height: 54px;
    padding: 4px 7px;
    border: 2px solid rgba(37, 99, 235, 0.72);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.1));
    color: #bfdbfe;
    box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.12), 0 7px 16px rgba(15, 23, 42, 0.28);
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.credit-adjust-button:hover:not(:disabled),
.credit-adjust-button:focus-visible {
    border-color: #38bdf8;
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.3), rgba(37, 99, 235, 0.16));
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16), 0 9px 20px rgba(15, 23, 42, 0.34);
}

.credit-adjust-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.credit-adjust-arrow {
    color: #f8fafc;
    font-size: 20px;
    font-weight: 900;
    line-height: 0.9;
    text-shadow: 0 1px 8px rgba(56, 189, 248, 0.9);
}

.credit-adjust-button strong {
    font-size: 12px;
    font-weight: 900;
    line-height: 1.15;
    white-space: nowrap;
}

.credit-adjust-quick {
    border: 2px solid rgba(139, 92, 246, 0.65);
    background: rgba(139, 92, 246, 0.12);
    color: #ddd6fe;
}

.credit-adjust-quick .credit-adjust-arrow {
    color: #f5f3ff;
}

.credit-adjust-quick:hover:not(:disabled),
.credit-adjust-quick:focus-visible {
    border-color: #a78bfa;
    background: rgba(139, 92, 246, 0.22);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

.credit-adjust-quick[hidden] {
    display: none;
}

@media (max-width: 520px) {
    .credit-amount-control {
        grid-template-columns: minmax(0, 1fr) 62px 62px;
        gap: 6px;
    }

    .credit-adjust-button strong {
        font-size: 11px;
    }
}

.credit-packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
    gap: 9px;
}

.credit-packages:not([hidden]) {
    margin-top: 2px;
}

.credit-package {
    position: relative;
    display: grid;
    gap: 4px;
    min-height: 68px;
    padding: 10px 13px;
    border: 1.5px solid var(--line-strong);
    border-radius: 13px;
    background: var(--surface-soft);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.credit-package:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: #9aa8f2;
    background: #f5f7ff;
    box-shadow: 0 8px 18px rgba(20, 27, 52, 0.08);
}

.credit-package.selected {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14), 0 8px 18px rgba(79, 70, 229, 0.14);
}

/* 选中态右上角对勾 */
.credit-package.selected::after {
    content: "✓";
    position: absolute;
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4f46e5;
    background: var(--gradient-brand);
    box-shadow: 0 3px 8px rgba(79, 70, 229, 0.4);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
}

.credit-package strong {
    font-size: 16px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.credit-package.selected strong {
    color: var(--brand-dark);
}

.credit-package span {
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* ---------- 订单摘要 ---------- */

.order-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 18px 0;
}

.order-summary > div {
    position: relative;
    padding: 15px;
    border: 1px solid #dfe4fb;
    border-radius: 13px;
    background: var(--brand-soft);
    background: linear-gradient(150deg, #f2f3ff 0%, #eceaff 100%);
    overflow: hidden;
}

.order-summary > div::after {
    content: "";
    position: absolute;
    right: -26px;
    bottom: -34px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(124, 58, 237, 0.16), transparent);
}

.order-summary span,
.order-summary strong {
    display: block;
}

.order-summary span {
    color: var(--muted);
    font-size: 12px;
}

.order-summary strong {
    margin-top: 5px;
    color: var(--brand-dark);
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.payment-note {
    margin: -8px 0 18px;
    color: #8a5a00;
    font-size: 12px;
    line-height: 1.6;
}

/* ---------- 支付按钮 ---------- */

.payment-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.payment-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.alipay-button {
    background: var(--alipay);
    box-shadow: 0 6px 16px rgba(22, 119, 255, 0.3);
}

.alipay-button:hover:not(:disabled) {
    background: var(--alipay-dark);
    box-shadow: 0 10px 22px rgba(22, 119, 255, 0.36);
}

.wechat-button {
    background: var(--wechat);
    box-shadow: 0 6px 16px rgba(9, 161, 84, 0.3);
}

.wechat-button:hover:not(:disabled) {
    background: var(--wechat-dark);
    box-shadow: 0 10px 22px rgba(9, 161, 84, 0.36);
}

.pay-icon {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    font-size: 13px;
}

.purchase-message {
    min-height: 20px;
    margin: 12px 0 -5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.purchase-message.error {
    color: var(--red);
}

.purchase-message.success {
    color: var(--green);
}

/* ---------- 订单列表（历史订单弹窗） ---------- */

.orders-loading,
.empty-state {
    padding: 34px 14px;
    border: 1.5px dashed var(--line-strong);
    border-radius: 13px;
    color: var(--muted);
    text-align: center;
}

.orders-list {
    display: grid;
    gap: 10px;
}

.order-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 18px;
    width: 100%;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-soft);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.order-item:focus {
    outline: 3px solid var(--brand-ring);
    outline-offset: 2px;
}

.order-item:hover {
    border-color: #d3dafa;
    box-shadow: 0 6px 16px rgba(20, 27, 52, 0.06);
}

.order-item-main {
    min-width: 0;
}

.order-item-main strong,
.order-item-main span,
.order-item-side strong,
.order-item-side span {
    display: block;
}

.order-item-main strong {
    overflow: hidden;
    color: var(--ink-strong);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-item-main span,
.order-item-side span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.order-item-side {
    text-align: right;
}

.order-item-side strong {
    color: var(--brand-dark);
    font-variant-numeric: tabular-nums;
}

.order-item-progress {
    grid-column: 1 / -1;
    padding-top: 9px;
    border-top: 1px dashed var(--line);
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* ---------- 最近订单详情 ---------- */

.detail-heading {
    margin-bottom: 6px;
}

.detail-history-hint {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

#order-detail-title span {
    overflow-wrap: anywhere;
    word-break: break-all;
}

/* 历史订单只显示一个当前状态；旋转图标只表达服务端仍在处理。 */
.order-status-active::before {
    content: "↻";
    display: inline-block;
    margin-right: 4px;
    font-size: 13px;
    line-height: 1;
    vertical-align: -1px;
    animation: order-status-spin 1.1s linear infinite;
}

.order-milestones {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.order-milestone {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    color: var(--faint);
    text-align: center;
}

.order-milestone:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 16px;
    left: calc(50% + 19px);
    z-index: 0;
    width: calc(100% - 38px);
    height: 2px;
    background: var(--line-strong);
}

.milestone-marker {
    position: relative;
    z-index: 1;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--faint);
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.milestone-label {
    max-width: 100%;
    color: inherit;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.order-milestone.is-complete {
    color: var(--green);
}

.order-milestone.is-complete:not(:last-child)::before {
    background: var(--green);
}

.order-milestone.is-complete .milestone-marker {
    border-color: var(--green);
    background: var(--green-soft);
    color: var(--green);
}

.order-milestone.is-complete .milestone-index {
    visibility: hidden;
}

.order-milestone.is-complete .milestone-marker::after {
    content: "\2713";
    position: absolute;
    font-size: 17px;
    line-height: 1;
}

.order-milestone.is-current {
    color: var(--ink);
}

.order-milestone.is-pending,
.order-milestone.is-pending .milestone-marker {
    color: var(--muted);
}

.order-milestone.is-current .milestone-marker {
    border-color: var(--brand);
    color: var(--brand-dark);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.order-milestone.is-active {
    color: var(--brand-dark);
}

.order-milestone.is-active .milestone-marker {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.order-milestone.is-active .milestone-index {
    visibility: hidden;
}

.order-milestone.is-active .milestone-marker::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: order-status-spin 0.85s linear infinite;
}

.order-milestone.is-stopped {
    color: var(--amber);
}

.order-milestone.is-stopped .milestone-marker {
    border-color: var(--amber);
    background: var(--amber-soft);
    color: var(--amber);
}

@keyframes order-status-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.detail-message {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.6;
}

.detail-payment-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}

.detail-payment-action-message {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.detail-payment-action-message.error {
    color: var(--red);
}

.detail-payment-action-message.success {
    color: var(--green);
}

.detail-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 22px;
}

@media (min-width: 721px) {
    .detail-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.detail-payment-note {
    margin: -10px 0 22px;
}

.detail-summary > div {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.detail-summary span,
.detail-summary strong {
    display: block;
}

.detail-summary span {
    color: var(--muted);
    font-size: 12px;
}

.detail-summary strong {
    margin-top: 5px;
    overflow-wrap: anywhere;
    color: var(--ink-strong);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ---------- 进度 ---------- */

.progress-group + .progress-group {
    margin-top: 18px;
}

.progress-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.progress-heading span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.progress-heading strong {
    color: var(--ink-strong);
    font-variant-numeric: tabular-nums;
}

.progress-track {
    height: 11px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8ecf5;
    box-shadow: inset 0 1px 3px rgba(20, 27, 52, 0.08);
}

.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #4f46e5;
    background: linear-gradient(90deg, #4f46e5, #7c3aed 55%, #22d3ee 130%);
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.45);
    transition: width 0.3s ease;
}

.detail-invite-code {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.detail-invite-code strong {
    margin-left: 5px;
    color: var(--brand-dark);
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    letter-spacing: 0.12em;
}

/* ---------- 时间网格与事件 ---------- */

.time-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 22px 0 0;
}

.time-grid > div {
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-soft);
}

.time-grid dt {
    color: var(--muted);
    font-size: 11px;
}

.time-grid dd {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    color: var(--ink-strong);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.event-list {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.event-item {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
    padding: 8px 0;
    color: var(--muted);
    font-size: 12px;
}

.event-item time {
    color: var(--faint);
    font-variant-numeric: tabular-nums;
}

/* ---------- 弹窗 ---------- */

body.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding: 24px;
    background: rgba(13, 18, 40, 0.55);
}

@supports ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
    .modal-backdrop {
        background: rgba(13, 18, 40, 0.48);
        -webkit-backdrop-filter: blur(5px);
        backdrop-filter: blur(5px);
    }
}

.history-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 780px;
    width: min(780px, 100%);
    max-height: calc(100vh - 48px);
    max-height: min(760px, calc(100vh - 48px));
    overflow: hidden;
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-pop);
    animation: dialog-in 0.22s ease-out;
}

.checkout-confirm-dialog,
.payment-status-dialog,
.contact-service-dialog {
    width: 100%;
    max-width: 460px;
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-pop);
    animation: dialog-in 0.22s ease-out;
}

.checkout-confirm-dialog:focus,
.payment-status-dialog:focus,
.contact-service-dialog:focus {
    outline: none;
}

.checkout-confirm-dialog-header,
.payment-status-dialog-header,
.contact-service-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.checkout-confirm-dialog-header h2,
.payment-status-dialog-header h2,
.contact-service-dialog-header h2 {
    margin: 0;
    color: var(--ink-strong);
    font-size: 22px;
}

.checkout-confirm-summary {
    display: grid;
    gap: 10px;
    margin: 20px 0 0;
}

.checkout-confirm-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.checkout-confirm-summary dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.checkout-confirm-summary dd {
    margin: 0;
    color: var(--ink-strong);
    font-size: 17px;
    font-weight: 900;
    text-align: right;
}

.checkout-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.checkout-confirm-actions .button {
    flex: 1 1 180px;
}

.checkout-confirm-footnote {
    margin: 14px 0 0;
    color: var(--faint);
    font-size: 12px;
    line-height: 1.55;
    text-align: center;
}

.payment-status-order {
    margin: 16px 0 8px;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.payment-status-message {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.payment-status-message.error {
    color: var(--red);
}

.payment-status-message.success {
    color: var(--green);
}

.payment-status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.payment-status-actions .button {
    flex: 1 1 180px;
}

.payment-status-footnote {
    margin: 14px 0 0;
    color: var(--faint);
    font-size: 12px;
    line-height: 1.55;
}

.contact-service-copy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 20px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.contact-service-qq {
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.contact-service-qq strong {
    color: var(--ink-strong);
    font-size: 19px;
    font-weight: 900;
    letter-spacing: 0.02em;
    -webkit-user-select: all;
    user-select: all;
}

.contact-service-copy-button {
    flex: 0 0 auto;
    min-width: 88px;
}

.contact-service-copy-status {
    margin: 12px 2px 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.contact-service-copy-status.success {
    color: var(--green);
}

.contact-service-copy-status.error {
    color: var(--red);
}

@keyframes dialog-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.history-dialog:focus {
    outline: none;
}

.history-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.history-dialog-header h2 {
    margin: 0;
    color: var(--ink-strong);
    font-size: 22px;
}

.history-dialog-header p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.modal-close-button {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-soft);
    color: #475467;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.modal-close-button:hover {
    border-color: #c5ccf7;
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.history-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.history-dialog .orders-list {
    min-height: 0;
    overflow-y: auto;
    padding-right: 3px;
    scrollbar-width: thin;
    scrollbar-color: #c3cadf transparent;
}

.history-dialog .orders-list::-webkit-scrollbar {
    width: 8px;
}

.history-dialog .orders-list::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: #c3cadf;
}

.history-dialog .orders-loading,
.history-dialog .empty-state {
    min-height: 130px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

/* ---------- 响应式 ---------- */

@media (max-width: 720px) {
    .page-shell {
        padding-top: 24px;
    }
}

@media (max-width: 500px) {
    .page-shell {
        width: calc(100% - 20px);
        max-width: 920px;
        padding-bottom: 40px;
    }

    .site-header {
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 18px;
    }

    body.is-app .brand-lockup {
        flex: 1 1 100%;
    }

    .site-header-actions {
        width: 100%;
        gap: 6px;
    }

    .brand-lockup {
        align-items: flex-start;
        gap: 10px;
    }

    .brand-mark {
        width: 46px;
        height: 46px;
        border-radius: 14px;
        font-size: 16px;
    }

    .site-header h1 {
        font-size: 18px;
        line-height: 1.2;
    }

    .site-header p {
        font-size: 12px;
        line-height: 1.45;
    }

    .history-button {
        min-height: 36px;
        padding: 0 11px;
        font-size: 12px;
    }

    .card {
        margin-bottom: 12px;
        padding: 20px 16px;
        border-radius: 16px;
    }

    .login-card {
        margin-top: 22px;
    }

    .account-heading {
        display: block;
    }

    .account-actions {
        justify-content: flex-end;
        margin-top: 13px;
    }

    .metrics-grid {
        gap: 8px;
    }

    .metric {
        padding: 12px 11px;
    }

    .metric strong {
        font-size: 18px;
    }

    .snapshot-time {
        line-height: 1.5;
    }

    .order-summary {
        gap: 8px;
    }

    .order-summary > div {
        padding: 12px 10px;
    }

    .order-summary strong {
        font-size: 17px;
    }

    .payment-actions {
        grid-template-columns: 1fr;
    }

    .order-item {
        gap: 8px 10px;
        padding: 13px;
    }

    .time-grid {
        grid-template-columns: 1fr;
    }

    .event-item {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .modal-backdrop {
        -webkit-box-align: end;
        -ms-flex-align: end;
        align-items: flex-end;
        padding: 10px;
    }

    .history-dialog {
        max-height: calc(100vh - 20px);
        padding: 20px 16px 16px;
        border-radius: 18px;
    }

    .checkout-confirm-dialog,
    .payment-status-dialog,
    .contact-service-dialog {
        max-height: calc(100vh - 20px);
        padding: 20px 16px 16px;
        border-radius: 18px;
    }

    .password-help-dialog {
        max-height: calc(100vh - 20px);
        padding: 18px 14px 14px;
        border-radius: 18px;
    }

    .password-help-header h3 {
        font-size: 18px;
    }

    .history-dialog-header h2 {
        font-size: 20px;
    }

    .history-dialog .order-item {
        grid-template-columns: 1fr;
    }

    .history-dialog .order-item-side {
        text-align: left;
    }
}

/* ---------- 降低动态效果偏好 ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- 打印 ---------- */

@media print {
    body {
        background: #ffffff;
    }

    body::before {
        display: none;
    }

    .card {
        border: 1px solid #d8dde8;
        box-shadow: none;
    }

    .history-button,
    .account-actions,
    .payment-actions {
        display: none;
    }
}

/* ============================================================
   暗夜极光主题层（追加覆盖，布局与功能样式不变）
   整屏 Canvas 极光 + 夜幕压暗 + 大幕转场 + 分幕入场
   ============================================================ */

:root {
    color-scheme: dark;
    --page: #04060f;
    --surface: #0d1428;
    --surface-soft: rgba(10, 16, 33, 0.6);
    --surface-glass: rgba(13, 19, 38, 0.78);
    --ink: #dbe3f5;
    --ink-strong: #f3f7ff;
    --muted: #8b96b3;
    --faint: #66708d;
    --line: rgba(130, 155, 210, 0.18);
    --line-strong: rgba(130, 155, 210, 0.32);
    --brand: #22d3ee;
    --brand-2: #8b5cf6;
    --brand-dark: #67e8f9;
    --brand-soft: rgba(34, 211, 238, 0.1);
    --brand-ring: rgba(34, 211, 238, 0.25);
    --green: #4fe0a8;
    --green-soft: rgba(52, 211, 153, 0.12);
    --red: #f87171;
    --red-soft: rgba(248, 113, 113, 0.12);
    --amber: #fbbf24;
    --amber-soft: rgba(251, 191, 36, 0.12);
    --gradient-brand: linear-gradient(135deg, #22d3ee 0%, #8b5cf6 100%);
    --shadow-card: 0 26px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --shadow-pop: 0 40px 110px rgba(0, 0, 0, 0.65);
    --shadow-button: 0 0 30px rgba(34, 211, 238, 0.3), 0 14px 28px rgba(0, 0, 0, 0.4);
}

body {
    background: #04060f;
}

/* 隐藏浅色版的网格纹理，改由极光画布承担背景 */
body::before {
    display: none;
}

/* 胶片颗粒：压住色带断层、提升暗部质感 */
body::after {
    content: none;
    display: none;
}

/* 极光画布与夜幕 */
#aurora {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
    contain: strict;
}

#veil {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(120% 90% at 50% 108%, rgba(34, 211, 238, 0.1), rgba(4, 7, 16, 0) 55%),
        linear-gradient(180deg, rgba(4, 7, 16, 0.42) 0%, rgba(4, 7, 16, 0.78) 42%, rgba(4, 7, 16, 0.94) 100%);
    opacity: 0;
    transition: opacity 1.4s ease 0.3s;
}

body.is-app #veil {
    opacity: 1;
}

/* 登录态：内容垂直居中，卡片浮在极光之上 */
body:not(.is-app) .page-shell {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    min-height: 100vh;
    padding-top: 32px;
    padding-bottom: 32px;
}

body:not(.is-app) .login-card {
    margin-top: 0;
    /* A live canvas behind backdrop-filter forces the browser to blur a large
       moving surface every frame.  The slightly more opaque fill keeps the
       same glass-like separation without that continuous GPU cost. */
    background: rgba(13, 19, 38, 0.94);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* 登录页顶部导航不参与入场序列，保持常显 */
body:not(.is-app) .site-header.reveal {
    opacity: 1;
}

/* 登录后卡片更实，与远景极光拉开层次 */
body.is-app .card {
    background: linear-gradient(160deg, rgba(15, 22, 43, 0.9), rgba(8, 13, 27, 0.92));
}

/* ---- 大幕转场 ---- */
.curtain {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3000;
    pointer-events: none;
    visibility: hidden;
}

.curtain.sweep-in,
.curtain.sweep-out {
    visibility: visible;
}

.curtain-panel {
    position: absolute;
    top: -10%;
    bottom: -10%;
    left: -20%;
    width: 140%;
    -webkit-transform: translateX(-105%) skewX(-8deg);
    transform: translateX(-105%) skewX(-8deg);
}

.panel-a {
    background: linear-gradient(115deg, #0b1226, #112233);
}

.panel-b {
    background: linear-gradient(115deg, #22d3ee, #8b5cf6);
    opacity: 0.85;
}

.panel-c {
    background: linear-gradient(115deg, #8b5cf6, #ec4899);
    opacity: 0.55;
}

.sweep-in .panel-a {
    -webkit-animation: sweep 0.62s cubic-bezier(0.7, 0, 0.2, 1) forwards;
    animation: sweep 0.62s cubic-bezier(0.7, 0, 0.2, 1) forwards;
}

.sweep-in .panel-b {
    -webkit-animation: sweep 0.62s cubic-bezier(0.7, 0, 0.2, 1) 0.07s forwards;
    animation: sweep 0.62s cubic-bezier(0.7, 0, 0.2, 1) 0.07s forwards;
}

.sweep-in .panel-c {
    -webkit-animation: sweep 0.62s cubic-bezier(0.7, 0, 0.2, 1) 0.14s forwards;
    animation: sweep 0.62s cubic-bezier(0.7, 0, 0.2, 1) 0.14s forwards;
}

.sweep-out .panel-c {
    -webkit-animation: sweep-out 0.7s cubic-bezier(0.7, 0, 0.2, 1) forwards;
    animation: sweep-out 0.7s cubic-bezier(0.7, 0, 0.2, 1) forwards;
}

.sweep-out .panel-b {
    -webkit-animation: sweep-out 0.7s cubic-bezier(0.7, 0, 0.2, 1) 0.08s forwards;
    animation: sweep-out 0.7s cubic-bezier(0.7, 0, 0.2, 1) 0.08s forwards;
}

.sweep-out .panel-a {
    -webkit-animation: sweep-out 0.7s cubic-bezier(0.7, 0, 0.2, 1) 0.16s forwards;
    animation: sweep-out 0.7s cubic-bezier(0.7, 0, 0.2, 1) 0.16s forwards;
}

@-webkit-keyframes sweep {
    from { -webkit-transform: translateX(-105%) skewX(-8deg); }
    to { -webkit-transform: translateX(0) skewX(-8deg); }
}

@keyframes sweep {
    from { transform: translateX(-105%) skewX(-8deg); }
    to { transform: translateX(0) skewX(-8deg); }
}

@-webkit-keyframes sweep-out {
    from { -webkit-transform: translateX(0) skewX(-8deg); }
    to { -webkit-transform: translateX(108%) skewX(-8deg); }
}

@keyframes sweep-out {
    from { transform: translateX(0) skewX(-8deg); }
    to { transform: translateX(108%) skewX(-8deg); }
}

/* ---- 分幕入场 ---- */
.reveal {
    opacity: 0;
}

.reveal.play {
    -webkit-animation: scene-in 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation: scene-in 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Session 恢复时直接展示最终位置，只有用户主动登录才播放入场。 */
.reveal.is-settled {
    opacity: 1;
    -webkit-animation: none;
    animation: none;
}

@-webkit-keyframes scene-in {
    from { opacity: 0; -webkit-transform: translateY(44px) scale(0.985); }
    to { opacity: 1; -webkit-transform: translateY(0) scale(1); }
}

@keyframes scene-in {
    from { opacity: 0; transform: translateY(44px) scale(0.985); filter: blur(6px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ---- 组件暗色覆盖 ---- */

.brand-mark {
    box-shadow: 0 0 34px rgba(34, 211, 238, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    color: #05131c;
    text-shadow: none;
}

.brand-domain {
    background: linear-gradient(90deg, #67e8f9 0%, #60a5fa 34%, #a78bfa 66%, #f472b6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    filter: drop-shadow(0 1px 6px rgba(2, 4, 12, 0.9));
}

body.is-app .domain-ai,
body:not(.is-app) .domain-ai {
    color: #f87171;
    background: none;
    -webkit-text-fill-color: #f87171;
    filter: none;
}

.history-button {
    border-color: rgba(130, 155, 210, 0.32);
    background: rgba(15, 23, 44, 0.7);
    color: #c3cde6;
    box-shadow: none;
}

.history-button:hover:not(:disabled) {
    border-color: rgba(34, 211, 238, 0.5);
    background: rgba(21, 31, 58, 0.85);
    color: #67e8f9;
}

.global-message {
    border-color: rgba(130, 155, 210, 0.35);
}

.global-message.error {
    border-color: rgba(248, 113, 113, 0.5);
}

.global-message.success {
    border-color: rgba(52, 211, 153, 0.5);
}

.card {
    border-color: rgba(130, 155, 210, 0.2);
}

.eyebrow {
    background: linear-gradient(90deg, #22d3ee, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: #22d3ee;
    color: transparent;
}

/* 用户协议 */
.agree-box {
    border-color: rgba(130, 155, 210, 0.5);
    background: rgba(6, 10, 22, 0.75);
}

.agree-row input:checked + .agree-box {
    border-color: #22d3ee;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.45);
}

.agree-row input:focus + .agree-box {
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.28);
}

.agree-row input:checked + .agree-box::after {
    border-color: #05131c;
}

.agree-link {
    color: #67e8f9;
}

.agree-hint {
    color: #f87171;
}

.agree-dialog {
    border-color: rgba(130, 155, 210, 0.3);
    background: #0d1428;
    background: linear-gradient(165deg, #131b33, #0a0f20);
}

.agree-dialog h3 {
    border-bottom-color: rgba(130, 155, 210, 0.16);
}

.agree-dialog-body strong {
    color: #fbbf24;
}

.agree-dialog-body .agreement-critical {
    border-color: rgba(251, 191, 36, 0.4);
    border-left-color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    color: #fde68a;
}

.agree-dialog-actions {
    border-top-color: rgba(130, 155, 210, 0.16);
}

.login-card .section-heading {
    text-align: center;
}

.field-label {
    color: #c3cde6;
}

.password-help-link {
    color: #67e8f9;
}

.password-help-link:hover {
    color: #a5f3fc;
}

.password-help-dialog {
    border-color: rgba(130, 155, 210, 0.3);
    background: #0d1428;
    background: linear-gradient(165deg, #131b33, #0a0f20);
}

.password-help-header h3 {
    color: #f3f7ff;
}

.password-help-note {
    color: #c3cde6;
}

.password-help-image-wrap {
    border-color: rgba(130, 155, 210, 0.3);
}

.field > span,
.field-label {
    color: var(--ink-strong);
}

.package-label {
    color: #c3cde6;
}

input {
    border-color: rgba(130, 155, 210, 0.32);
    background: rgba(6, 10, 22, 0.75);
    color: #f3f7ff;
}

input:hover {
    border-color: rgba(130, 155, 210, 0.5);
}

input:focus {
    border-color: #22d3ee;
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.16);
}

.button-primary {
    color: #05131c;
    text-shadow: none;
}

.button-primary:hover:not(:disabled) {
    box-shadow: 0 0 40px rgba(34, 211, 238, 0.4), 0 16px 32px rgba(0, 0, 0, 0.45);
}

.button-secondary {
    color: #c3cde6;
}

.button-secondary:hover:not(:disabled) {
    background: rgba(21, 31, 58, 0.85);
}

.button-danger {
    border-color: rgba(248, 113, 113, 0.46);
    background: rgba(127, 29, 29, 0.22);
    color: #fca5a5;
}

.button-danger:hover:not(:disabled) {
    border-color: rgba(248, 113, 113, 0.7);
    background: rgba(153, 27, 27, 0.34);
}

.text-button:hover {
    color: #67e8f9;
}

.partner-badge {
    border-color: rgba(251, 191, 36, 0.55);
    background: rgba(251, 191, 36, 0.12);
    box-shadow: none;
    color: #fbbf24;
}

.eligibility-banner {
    border-color: rgba(52, 211, 153, 0.45);
}

.eligibility-banner.warning {
    border-color: rgba(251, 191, 36, 0.5);
}

.eligibility-banner.error {
    border-color: rgba(248, 113, 113, 0.5);
}

.metric:hover {
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}

.credit-package:hover:not(:disabled) {
    border-color: rgba(34, 211, 238, 0.6);
    background: rgba(34, 211, 238, 0.06);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.credit-package.selected {
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16), 0 12px 28px rgba(0, 0, 0, 0.45);
}

.order-summary > div {
    border-color: rgba(139, 92, 246, 0.35);
    background: linear-gradient(150deg, rgba(139, 92, 246, 0.18), rgba(34, 211, 238, 0.1));
}

.payment-note {
    color: #e6b325;
}

.order-milestone.is-active .milestone-marker {
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12), 0 0 18px rgba(34, 211, 238, 0.28);
}

.order-item:hover {
    border-color: rgba(34, 211, 238, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.progress-track {
    background: rgba(130, 155, 210, 0.18);
    box-shadow: none;
}

.progress-track span {
    background: linear-gradient(90deg, #22d3ee, #8b5cf6);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.7);
}

.history-dialog {
    border-color: rgba(130, 155, 210, 0.3);
}

.checkout-confirm-dialog,
.payment-status-dialog,
.contact-service-dialog {
    border-color: rgba(130, 155, 210, 0.3);
    background: #0d1428;
    background: linear-gradient(165deg, #131b33, #0a0f20);
}

.checkout-confirm-dialog-header h2,
.payment-status-dialog-header h2,
.contact-service-dialog-header h2,
.payment-status-order {
    color: #f3f7ff;
}

.checkout-confirm-summary > div {
    border-color: rgba(130, 155, 210, 0.24);
    background: rgba(130, 155, 210, 0.08);
}

.checkout-confirm-summary dt,
.checkout-confirm-footnote {
    color: #8292b5;
}

.checkout-confirm-summary dd {
    color: #f3f7ff;
}

.payment-status-message {
    color: #c3cde6;
}

.payment-status-footnote {
    color: #8292b5;
}

.contact-service-copy-row {
    border-color: rgba(130, 155, 210, 0.24);
    background: rgba(130, 155, 210, 0.08);
}

.contact-service-qq {
    color: #c3cde6;
}

.contact-service-qq strong {
    color: #f3f7ff;
}

.modal-close-button {
    color: #c3cde6;
}

.modal-close-button:hover {
    border-color: rgba(34, 211, 238, 0.4);
}

.history-dialog .orders-list {
    scrollbar-color: rgba(130, 155, 210, 0.4) transparent;
}

.history-dialog .orders-list::-webkit-scrollbar-thumb {
    background: rgba(130, 155, 210, 0.4);
}

/* 打印时回归浅色 */
@media print {
    body {
        background: #ffffff;
    }

    #aurora,
    #veil,
    .curtain,
    body::after {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1 !important;
    }

    .reveal.play {
        -webkit-animation: none !important;
        animation: none !important;
    }

    .reveal.is-settled {
        opacity: 1 !important;
    }

    .order-milestone.is-active .milestone-marker::after,
    .order-status-active::before {
        animation: none !important;
    }
}

/* ============================================================
   积分选择器与账号刷新（2026-08-20）

   这组覆盖只调整现有 DOM 的呈现，不改变积分选择、额度校验或订单
   逻辑。输入框占主位，细调按钮固定在右侧上下两行；大额快捷调节仍
   由合作伙伴专属的 ±1 万按钮提供。
   ============================================================ */

/* 合作伙伴旧的“大额套餐卡”不再占用页面空间。保留空容器是为了让
   现有 JS 的事件绑定和无障碍更新继续安全运行。 */
#credit-packages,
.credit-packages {
    display: none !important;
}

.credit-amount-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 104px;
    grid-template-rows: auto;
    grid-template-areas: "field adjust";
    align-items: stretch;
    gap: 7px;
    width: min(100%, 520px);
    min-height: 96px;
}

.credit-amount-field {
    grid-area: field;
    display: grid;
    height: auto;
    min-height: 96px;
    align-self: stretch;
}

.credit-amount-input {
    height: 100%;
    min-height: 96px;
    padding-inline: 64px;
    font-size: clamp(26px, 4vw, 32px);
    font-weight: 900;
    letter-spacing: 0.015em;
    text-align: center;
}

.credit-amount-unit {
    right: 18px;
    font-size: 14px;
    font-weight: 800;
}

.credit-adjust-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    height: auto;
    min-height: 44px;
    padding: 4px 6px;
    flex: 1 1 0;
}

.credit-adjust-stack {
    grid-area: adjust;
    display: grid;
    grid-auto-flow: row;
    grid-auto-rows: minmax(44px, 1fr);
    min-width: 0;
    min-height: 0;
    gap: 7px;
}

.credit-adjust-arrow {
    flex: 0 0 auto;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

.credit-adjust-button strong {
    font-size: 13px;
    line-height: 1;
}

/* 右上角刷新保留原有文字作为无障碍名称，视觉上改为紧凑图标按钮。
   disabled 由 JS 表示正在同步，此时换成静态旋转环，避免“同步中…”
   占据账号卡片的视觉焦点。 */
#refresh-button.refresh-button,
.refresh-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 42px;
    min-width: 42px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    overflow: visible;
    font-size: 0;
    line-height: 1;
}

#refresh-button.refresh-button::before,
.refresh-button::before {
    content: "↻";
    display: block;
    color: currentColor;
    font-family: Arial, sans-serif;
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
}

#refresh-button.refresh-button:disabled::before,
.refresh-button:disabled::before,
#refresh-button.refresh-button.is-refreshing::before,
.refresh-button.is-refreshing::before {
    content: "";
    width: 17px;
    height: 17px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: account-sync-spinner 0.8s linear infinite;
}

@keyframes account-sync-spinner {
    to { transform: rotate(360deg); }
}

/* :has() 让同步状态只在按钮正在刷新时把指标替换为旋转图标；正常
   数值不会被隐藏。不支持 :has() 的旧浏览器仍保留上一次数值，刷新
   按钮本身继续显示旋转状态。 */
.account-card:has(#refresh-button:disabled) .metric strong,
.account-card:has(#refresh-button.is-refreshing) .metric strong {
    display: grid;
    place-items: center;
    min-height: 32px;
    color: transparent;
    font-size: 0;
}

.account-card:has(#refresh-button:disabled) .metric strong::after,
.account-card:has(#refresh-button.is-refreshing) .metric strong::after {
    content: "";
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    color: #67e8f9;
    animation: account-sync-spinner 0.8s linear infinite;
}

@media (max-width: 520px) {
    .credit-amount-control {
        grid-template-columns: minmax(0, 1fr) 86px;
        grid-template-rows: auto;
        gap: 6px;
        min-height: 96px;
    }

    .credit-amount-field {
        height: auto;
        min-height: 96px;
    }

    .credit-amount-input {
        height: 100%;
        min-height: 96px;
        padding: 10px;
        font-size: clamp(23px, 7.5vw, 29px);
    }

    .credit-amount-unit {
        top: auto;
        right: 11px;
        bottom: 9px;
        font-size: 11px;
        transform: none;
    }

    .credit-adjust-button {
        gap: 3px;
        padding-inline: 4px;
    }

    .credit-adjust-stack {
        gap: 6px;
    }

    .credit-adjust-arrow {
        font-size: 18px;
    }

    .credit-adjust-button strong {
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #refresh-button.refresh-button:disabled::before,
    .refresh-button:disabled::before,
    #refresh-button.refresh-button.is-refreshing::before,
    .refresh-button.is-refreshing::before,
    .account-card:has(#refresh-button:disabled) .metric strong::after,
    .account-card:has(#refresh-button.is-refreshing) .metric strong::after {
        animation: none;
    }
}

/* 当前按钮保留一个 aria-hidden 的 .refresh-icon 作为图标载体；使用
   子元素时关闭前面的兼容伪元素，避免出现两个刷新符号。没有该子元素
   的旧页面仍可使用上面的 ::before 兼容图标。 */
.refresh-button .refresh-icon {
    display: block;
    color: currentColor;
    font-family: Arial, sans-serif;
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
}

#refresh-button.refresh-button:has(.refresh-icon)::before,
#refresh-button.refresh-button:has(.refresh-icon):disabled::before,
#refresh-button.refresh-button:has(.refresh-icon).is-refreshing::before,
.refresh-button:has(.refresh-icon)::before {
    display: none;
    content: none;
}

.refresh-button:disabled .refresh-icon,
.refresh-button.is-refreshing .refresh-icon {
    width: 17px;
    height: 17px;
    overflow: hidden;
    color: #67e8f9;
    font-size: 0;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: account-sync-spinner 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .refresh-button:disabled .refresh-icon,
    .refresh-button.is-refreshing .refresh-icon {
        animation: none;
    }
}

/* ============================================================
   商用购买区与支付返回页（2026-08-20）
   ============================================================ */

/* 首屏先保持不可见，脚本确认这是正常页面还是支付返回小窗后再展示。
   这样第三方收银台返回时不会短暂闪现登录主页。 */
.bootstrap-screen {
    display: none;
}

html.app-booting .bootstrap-screen {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #04060f;
    color: #c3cde6;
    font-size: 14px;
    font-weight: 700;
}

.bootstrap-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #8b96b3;
    border-top-color: transparent;
    border-radius: 50%;
    animation: order-status-spin 0.85s linear infinite;
}

html.app-booting #aurora,
html.app-booting #veil,
html.app-booting .curtain,
html.app-booting .page-shell {
    visibility: hidden;
}

html.payment-return-mode #aurora,
html.payment-return-mode #veil,
html.payment-return-mode .curtain,
html.payment-return-mode .page-shell,
body.payment-return-mode > .modal-backdrop {
    display: none !important;
}

body.payment-return-mode {
    overflow: hidden;
}

.payment-return-page {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    min-width: 320px;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(520px 300px at 50% 25%, rgba(34, 211, 238, 0.18), transparent 68%),
        #04060f;
}

.payment-return-card {
    width: min(100%, 430px);
    padding: 34px 30px 30px;
    border: 1px solid rgba(130, 155, 210, 0.34);
    border-radius: 22px;
    background: linear-gradient(165deg, rgba(19, 27, 51, 0.98), rgba(10, 15, 32, 0.98));
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.62);
    text-align: center;
}

.payment-return-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border: 1px solid rgba(52, 211, 153, 0.48);
    border-radius: 50%;
    background: rgba(52, 211, 153, 0.14);
    color: #6ee7b7;
    box-shadow: 0 0 28px rgba(52, 211, 153, 0.2);
    font-size: 30px;
    font-weight: 900;
}

.payment-return-card h1 {
    margin: 7px 0 10px;
    color: #f3f7ff;
    font-size: 26px;
    line-height: 1.3;
}

.payment-return-card > p {
    margin: 0;
    color: #aebbd5;
    line-height: 1.7;
}

.payment-return-countdown {
    margin-top: 18px !important;
    color: #8292b5 !important;
    font-size: 13px;
}

.payment-return-countdown strong {
    color: #67e8f9;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.payment-return-card .button {
    min-width: 138px;
    margin-top: 20px;
}

.payment-return-fallback {
    margin-top: 14px !important;
    color: #fbbf24 !important;
    font-size: 12px;
}

.purchase-heading {
    align-items: center;
    margin-bottom: 22px;
}

.purchase-heading-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.arrival-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 11px;
    border: 1px solid rgba(52, 211, 153, 0.38);
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.1);
    color: #6ee7b7;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.invite-rules-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid rgba(96, 165, 250, 0.46);
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.invite-rules-link:hover,
.invite-rules-link:focus-visible {
    border-color: #38bdf8;
    background: rgba(14, 165, 233, 0.2);
    color: #e0f2fe;
}

.invite-rules-icon {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.purchase-checkout {
    display: grid;
    grid-template-columns: minmax(0, 2.08fr) minmax(240px, 1fr);
    grid-template-areas:
        "credit amount"
        "payments payments";
    gap: 14px 18px;
    align-items: stretch;
}

.purchase-checkout .package-field,
.checkout-panel {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface-soft);
}

.purchase-checkout .package-field {
    grid-area: credit;
    min-height: 220px;
    border-block: 1px solid var(--line);
}

.package-label-row {
    position: absolute;
    top: 14px;
    right: 15px;
    left: 15px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.package-label {
    color: var(--ink-strong);
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 900;
    line-height: 1.3;
}

.package-label-row .purchase-limit {
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    text-align: right;
}

.package-label-row .purchase-limit.warning {
    color: #fbbf24;
}

.package-label-row .purchase-limit.error {
    color: #f87171;
}

.purchase-checkout .credit-amount-control {
    width: 100%;
    height: 100%;
    min-height: 192px;
    grid-template-columns: minmax(0, 1fr) 116px;
}

.purchase-checkout .credit-amount-field {
    min-height: 192px;
}

.purchase-checkout .credit-amount-input {
    min-height: 192px;
    padding: 48px 70px 22px;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.credit-amount-display {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    min-width: 0;
    padding: 48px 66px 22px 18px;
    color: var(--ink-strong);
    font-size: clamp(40px, 5vw, 52px);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    line-height: 1.1;
    pointer-events: none;
}

/* 非编辑态用 output 保留千分位展示；用户点入输入框后切回真实数值和
   光标，既能直接键入，也不会把带逗号的展示值塞进 number input。 */
.credit-amount-field:focus-within .credit-amount-input {
    color: var(--ink-strong);
    -webkit-text-fill-color: currentColor;
    caret-color: var(--brand);
}

.credit-amount-field:focus-within .credit-amount-display {
    visibility: hidden;
}

.credit-amount-input:disabled + .credit-amount-display {
    opacity: 0.55;
}

.purchase-checkout .credit-amount-unit {
    top: auto;
    right: 15px;
    bottom: 12px;
    z-index: 2;
    transform: none;
}

.checkout-panel {
    grid-area: amount;
    display: flex;
    min-height: 220px;
    padding: 0;
    overflow: hidden;
    align-items: stretch;
    border-color: rgba(139, 92, 246, 0.65);
}

.checkout-panel .order-summary {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    min-height: 220px;
    margin: 0;
}

.checkout-panel .order-amount-card {
    display: flex;
    min-height: 220px;
    padding: 20px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 0;
    border-radius: 14px;
}

.checkout-panel .order-amount-card span {
    color: var(--ink-strong);
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 900;
}

.checkout-panel #summary-amount {
    margin-top: 10px;
    font-size: clamp(40px, 5vw, 52px);
    line-height: 1.1;
}

.purchase-checkout > .payment-actions {
    grid-area: payments;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 0;
}

.purchase-checkout > .payment-actions .payment-button {
    min-height: 62px;
}

.purchase-checkout > .purchase-message {
    grid-column: 1 / -1;
    min-height: 0;
    margin: 0;
}

.purchase-checkout > .purchase-message:empty {
    display: none;
}

@media (max-width: 650px) {
    .purchase-checkout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "credit"
            "amount"
            "payments";
    }

    .checkout-panel,
    .checkout-panel .order-summary,
    .checkout-panel .order-amount-card {
        min-height: 108px;
    }
}

@media (max-width: 520px) {
    .detail-payment-actions {
        grid-template-columns: 1fr;
    }

    .detail-payment-action-message {
        grid-column: 1;
    }

    .purchase-price {
        display: flex;
        width: fit-content;
        margin: 8px 0 0;
        font-size: 11px;
    }

    .purchase-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .purchase-heading-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .arrival-badge {
        min-height: 28px;
        padding: 5px 9px;
        white-space: normal;
    }

    .invite-rules-link {
        min-height: 28px;
    }

    .purchase-checkout .package-field,
    .checkout-panel {
        padding: 14px;
    }

    .package-label-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .package-label-row .purchase-limit {
        text-align: left;
    }

    .purchase-checkout > .payment-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .payment-return-page {
        padding: 14px;
    }

    .payment-return-card {
        padding: 28px 20px 24px;
        border-radius: 18px;
    }

    .payment-return-card h1 {
        font-size: 23px;
    }
}

@media (max-width: 410px) {
    .purchase-checkout .credit-amount-control {
        grid-template-columns: minmax(0, 1fr) 88px;
    }

    .credit-amount-display {
        padding-right: 52px;
    }
}

/* ---------- 购买额度说明 ---------- */

.purchase-limit-wrap {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.purchase-limit-why {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #67e8f9;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.purchase-limit-why:hover,
.purchase-limit-why:focus-visible {
    color: #a5f3fc;
}

.purchase-limit-dialog {
    width: 100%;
    max-width: 460px;
    padding: 26px;
    border: 1px solid rgba(130, 155, 210, 0.3);
    border-radius: 20px;
    background: #0d1428;
    background: linear-gradient(165deg, #131b33, #0a0f20);
    box-shadow: var(--shadow-pop);
    animation: dialog-in 0.22s ease-out;
}

.purchase-limit-dialog:focus {
    outline: none;
}

.purchase-limit-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.purchase-limit-dialog-header h2 {
    margin: 0;
    color: #f3f7ff;
    font-size: 22px;
}

.purchase-limit-dialog-message {
    margin: 18px 0 0;
    color: #c3cde6;
    font-size: 14px;
    line-height: 1.75;
}

@media (max-width: 520px) {
    .purchase-limit-wrap {
        justify-content: flex-start;
    }

    .purchase-limit-dialog {
        max-height: calc(100vh - 20px);
        padding: 20px 16px 16px;
        border-radius: 18px;
    }

    .purchase-limit-dialog-header h2 {
        font-size: 20px;
    }
}
