/* ============================================================
 * AI Upgrade — Single-Screen Minimalist SPA Portal
 * 简洁、一屏完整展示、无刷新切换、支持 ChatGPT / Claude / Grok
 * ============================================================ */

:root {
    --product-accent: #10a37f;
    --product-accent-hover: #0d8f6e;
    --product-soft: rgba(16, 163, 127, 0.11);
    --product-glow: rgba(16, 163, 127, 0.24);
    --product-ring: rgba(16, 163, 127, 0.24);
    --product-page-bg: #e8f5f0;
    --product-shell-border: rgba(16, 163, 127, 0.2);
    --product-shell-shadow:
        0 2px 6px rgba(15, 23, 42, 0.04),
        0 26px 58px -20px rgba(16, 163, 127, 0.28);
    --product-rail-tint: rgba(16, 163, 127, 0.07);
    --topbar-height: 58px;
    --product-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-product='gpt'] {
    --product-accent: #10a37f;
    --product-accent-hover: #0c8a6b;
    --product-soft: rgba(16, 163, 127, 0.11);
    --product-glow: rgba(16, 163, 127, 0.26);
    --product-ring: rgba(16, 163, 127, 0.24);
    --product-page-bg: #e8f5f0;
    --product-shell-border: rgba(16, 163, 127, 0.2);
    --product-shell-shadow:
        0 2px 6px rgba(15, 23, 42, 0.04),
        0 26px 58px -20px rgba(16, 163, 127, 0.28);
    --product-rail-tint: rgba(16, 163, 127, 0.07);
}

:root[data-product='claude'] {
    --product-accent: #d97757;
    --product-accent-hover: #c56242;
    --product-soft: rgba(217, 119, 87, 0.12);
    --product-glow: rgba(217, 119, 87, 0.28);
    --product-ring: rgba(217, 119, 87, 0.26);
    --product-page-bg: #f9eee8;
    --product-shell-border: rgba(217, 119, 87, 0.24);
    --product-shell-shadow:
        0 2px 6px rgba(15, 23, 42, 0.04),
        0 26px 58px -20px rgba(217, 119, 87, 0.3);
    --product-rail-tint: rgba(217, 119, 87, 0.075);
}

:root[data-product='grok'] {
    --product-accent: #0284c7;
    --product-accent-hover: #0369a1;
    --product-soft: rgba(2, 132, 199, 0.11);
    --product-glow: rgba(2, 132, 199, 0.26);
    --product-ring: rgba(2, 132, 199, 0.24);
    --product-page-bg: #e7f2fc;
    --product-shell-border: rgba(2, 132, 199, 0.22);
    --product-shell-shadow:
        0 2px 6px rgba(15, 23, 42, 0.04),
        0 26px 58px -20px rgba(2, 132, 199, 0.28);
    --product-rail-tint: rgba(2, 132, 199, 0.07);
}

:root[data-theme='dark'][data-product='gpt'] {
    --product-page-bg: #071612;
    --product-glow: rgba(16, 163, 127, 0.34);
    --product-shell-border: rgba(16, 163, 127, 0.28);
    --product-shell-shadow:
        0 24px 60px -16px rgba(0, 0, 0, 0.58),
        0 20px 56px -18px rgba(16, 163, 127, 0.34);
    --product-rail-tint: rgba(16, 163, 127, 0.1);
}

:root[data-theme='dark'][data-product='claude'] {
    --product-page-bg: #180f0b;
    --product-glow: rgba(217, 119, 87, 0.34);
    --product-shell-border: rgba(217, 119, 87, 0.3);
    --product-shell-shadow:
        0 24px 60px -16px rgba(0, 0, 0, 0.58),
        0 20px 56px -18px rgba(217, 119, 87, 0.34);
    --product-rail-tint: rgba(217, 119, 87, 0.11);
}

:root[data-theme='dark'][data-product='grok'] {
    --product-accent: #38bdf8;
    --product-accent-hover: #0ea5e9;
    --product-soft: rgba(56, 189, 248, 0.14);
    --product-glow: rgba(56, 189, 248, 0.34);
    --product-ring: rgba(56, 189, 248, 0.28);
    --product-page-bg: #07111e;
    --product-shell-border: rgba(56, 189, 248, 0.28);
    --product-shell-shadow:
        0 24px 60px -16px rgba(0, 0, 0, 0.58),
        0 20px 56px -18px rgba(56, 189, 248, 0.34);
    --product-rail-tint: rgba(56, 189, 248, 0.1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family:
        'Inter',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        'PingFang SC',
        'Hiragino Sans GB',
        'Microsoft YaHei',
        sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-main);
    background-color: var(--product-page-bg, var(--bg-page));
    transition: background-color 380ms var(--product-ease);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.spa-portal {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* 随所选 AI 品牌联动的大范围柔和氛围背景光（三层预光栅化 GPU 合成交叉淡入淡出，零全屏重绘卡顿） */
.portal-ambient {
    position: fixed;
    inset: -12%;
    z-index: 0;
    pointer-events: none;
    animation: ambientDrift 18s ease-in-out infinite alternate;
    will-change: transform;
    contain: layout paint;
}

.ambient-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 420ms var(--product-ease);
    will-change: opacity;
    pointer-events: none;
}

.ambient-layer.ambient-gpt {
    background:
        radial-gradient(980px 620px at 14% 12%, rgba(16, 163, 127, 0.28), transparent 66%),
        radial-gradient(880px 580px at 88% 86%, rgba(20, 184, 166, 0.2), transparent 68%),
        radial-gradient(720px 480px at 78% 18%, rgba(52, 211, 153, 0.14), transparent 70%);
}

.ambient-layer.ambient-claude {
    background:
        radial-gradient(980px 620px at 14% 12%, rgba(217, 119, 87, 0.3), transparent 66%),
        radial-gradient(880px 580px at 88% 86%, rgba(245, 158, 11, 0.19), transparent 68%),
        radial-gradient(720px 480px at 78% 18%, rgba(234, 88, 12, 0.13), transparent 70%);
}

.ambient-layer.ambient-grok {
    background:
        radial-gradient(980px 620px at 14% 12%, rgba(2, 132, 199, 0.28), transparent 66%),
        radial-gradient(880px 580px at 88% 86%, rgba(99, 102, 241, 0.19), transparent 68%),
        radial-gradient(720px 480px at 78% 18%, rgba(56, 189, 248, 0.16), transparent 70%);
}

:root[data-theme='dark'] .ambient-layer.ambient-gpt {
    background:
        radial-gradient(980px 620px at 14% 12%, rgba(16, 163, 127, 0.32), transparent 66%),
        radial-gradient(880px 580px at 88% 86%, rgba(20, 184, 166, 0.2), transparent 68%),
        radial-gradient(720px 480px at 78% 18%, rgba(52, 211, 153, 0.14), transparent 70%);
}

:root[data-theme='dark'] .ambient-layer.ambient-claude {
    background:
        radial-gradient(980px 620px at 14% 12%, rgba(217, 119, 87, 0.34), transparent 66%),
        radial-gradient(880px 580px at 88% 86%, rgba(245, 158, 11, 0.18), transparent 68%),
        radial-gradient(720px 480px at 78% 18%, rgba(251, 146, 60, 0.14), transparent 70%);
}

:root[data-theme='dark'] .ambient-layer.ambient-grok {
    background:
        radial-gradient(980px 620px at 14% 12%, rgba(56, 189, 248, 0.32), transparent 66%),
        radial-gradient(880px 580px at 88% 86%, rgba(99, 102, 241, 0.22), transparent 68%),
        radial-gradient(720px 480px at 78% 18%, rgba(14, 165, 233, 0.16), transparent 70%);
}

:root:not([data-product]) .ambient-layer.ambient-gpt,
:root[data-product='gpt'] .ambient-layer.ambient-gpt,
:root[data-product='claude'] .ambient-layer.ambient-claude,
:root[data-product='grok'] .ambient-layer.ambient-grok {
    opacity: 1;
}

@keyframes ambientDrift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(1.5%, -1.2%, 0) scale(1.03);
    }
    100% {
        transform: translate3d(-1.2%, 1.4%, 0) scale(1.01);
    }
}

/* ============ 顶部极简导航栏（58px） ============ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--topbar-height);
    flex-shrink: 0;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--product-shell-border, var(--border));
    transition: border-color 180ms ease;
}

.topbar-inner {
    max-width: 1080px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background-color: var(--product-accent);
    background-image:
        radial-gradient(
            circle at 24% 16%,
            rgba(255, 255, 255, 0.3),
            transparent 65%
        ),
        linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(15, 23, 42, 0.18));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.24),
        0 6px 14px -4px var(--product-glow);
    transition:
        background-color 320ms var(--product-ease),
        box-shadow 320ms var(--product-ease),
        transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover .brand-mark {
    transform: scale(1.05);
}

.brand-mark svg {
    width: 100%;
    height: 100%;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.15;
}

.brand-text strong {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.brand-text span {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 0.04em;
}

.spa-nav {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.spa-nav-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    height: 32px;
    width: 0;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    pointer-events: none;
    opacity: 0;
    transition:
        transform 340ms cubic-bezier(0.34, 1.28, 0.64, 1),
        width 300ms cubic-bezier(0.34, 1.28, 0.64, 1),
        opacity 180ms ease;
    will-change: transform, width;
}

.spa-nav-indicator.ready {
    opacity: 1;
}

.spa-nav-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-dim);
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    transition:
        color 180ms ease,
        transform 140ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spa-nav-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition:
        color 220ms ease,
        transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spa-nav-btn:hover:not(:disabled) {
    color: var(--text-main);
}

.spa-nav-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.spa-nav-btn.active {
    color: var(--text-main);
    font-weight: 600;
}

.spa-nav-btn.active svg {
    color: var(--product-accent);
    transform: scale(1.08);
}

.spa-nav-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.topbar-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.runtime-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.runtime-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}

.runtime-pill.online-24h .runtime-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--success);
    opacity: 0.45;
    animation: pulseHalo 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes pulseHalo {
    0% {
        transform: scale(0.75);
        opacity: 0.55;
    }
    70% {
        transform: scale(2.1);
        opacity: 0;
    }
    100% {
        transform: scale(2.1);
        opacity: 0;
    }
}

.lang-dropdown {
    position: relative;
}

.lang-trigger {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition:
        border-color 180ms ease,
        background-color 180ms ease,
        color 180ms ease,
        transform 140ms ease;
}

.lang-trigger:hover {
    border-color: var(--border-strong);
    color: var(--text-main);
    background: var(--surface-soft);
}

.lang-trigger:active {
    transform: scale(0.96);
}

.lang-trigger svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.lang-trigger .lang-chevron {
    width: 13px;
    height: 13px;
    color: var(--text-dim);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lang-dropdown.open .lang-trigger {
    border-color: var(--product-accent);
    color: var(--text-main);
    box-shadow: 0 0 0 3px var(--product-ring);
}

.lang-dropdown.open .lang-chevron {
    transform: rotate(180deg);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    min-width: 142px;
    padding: 5px;
    border-radius: 13px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 60;
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
    transform-origin: top right;
    pointer-events: none;
    transition:
        opacity 180ms ease,
        transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lang-dropdown.open .lang-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.lang-option {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        background-color 150ms ease,
        color 150ms ease;
}

.lang-option small {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.lang-option:hover {
    background: var(--surface-soft);
    color: var(--text-main);
}

.lang-option.active {
    background: var(--product-soft);
    color: var(--product-accent);
    font-weight: 650;
}

.lang-option.active small {
    color: var(--product-accent);
}

.topbar .theme-toggle {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
}

/* ============ 主舞台（一屏居中展示） ============ */
.spa-stage {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px 8px;
    min-height: calc(100dvh - var(--topbar-height) - 38px);
}

.portal-minimal-footer {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    text-align: center;
    padding: 4px 16px 14px;
    font-size: 11.5px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.spa-view {
    display: none;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}

.spa-view.active {
    display: block;
    animation: viewEnter 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes viewEnter {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes iconPop {
    0% {
        transform: scale(0.84) rotate(-8deg);
    }
    60% {
        transform: scale(1.12) rotate(3deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

@keyframes rippleExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.42;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

@keyframes progressSheen {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 36px 0;
    }
}

.click-ripple {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: currentColor;
    opacity: 0.25;
    animation: rippleExpand 540ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
    z-index: 2;
}

.btn-cta .click-ripple {
    background: rgba(255, 255, 255, 0.55);
}

.product-card .click-ripple {
    background: var(--product-accent);
}

.inline-brand-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inline-brand-icon svg {
    width: 14px;
    height: 14px;
}

.inline-brand-icon.gpt {
    background: rgba(16, 163, 127, 0.12);
    color: #10a37f;
}

.inline-brand-icon.claude {
    background: rgba(217, 119, 87, 0.13);
    color: #d97757;
}

.inline-brand-icon.grok {
    background: rgba(2, 132, 199, 0.12);
    color: #0284c7;
}

:root[data-theme='dark'] .inline-brand-icon.grok {
    background: rgba(56, 189, 248, 0.16);
    color: #38bdf8;
}

/* ============ 视图 1：自助充值 Bento 卡片 ============ */
.redeem-shell {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    background: var(--surface);
    border: 1px solid var(--product-shell-border, var(--border));
    border-radius: 20px;
    box-shadow: var(--product-shell-shadow, var(--shadow-lg));
    overflow: hidden;
    min-height: 468px;
    transition:
        border-color 320ms var(--product-ease),
        box-shadow 360ms var(--product-ease);
}

/* 左侧栏：产品切换 + 紧凑步骤条 */
.redeem-rail {
    background-color: color-mix(in srgb, var(--product-accent) 4.5%, var(--sidebar-bg));
    border-right: 1px solid var(--border);
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: background-color 340ms var(--product-ease);
}

.rail-section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 8px;
    padding: 0 2px;
}

.product-switcher {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

/* 丝滑跟随选中产品的悬浮白卡滑块（纯 GPU transform 移动，告别硬切瞬移） */
.product-switcher-indicator {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--product-accent) 44%, var(--border));
    box-shadow:
        0 4px 14px -3px var(--product-glow),
        0 0 0 1px color-mix(in srgb, var(--product-accent) 20%, transparent);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transform: translate3d(0, 0, 0);
    will-change: transform, width, height;
    transition:
        transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
        width 280ms cubic-bezier(0.22, 1, 0.36, 1),
        height 280ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 300ms var(--product-ease),
        box-shadow 300ms var(--product-ease),
        opacity 180ms ease;
}

.product-switcher-indicator.ready {
    opacity: 1;
}

.product-switcher-indicator.no-anim {
    transition: none !important;
}

.product-card {
    position: relative;
    z-index: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
        background-color 220ms ease,
        color 240ms ease,
        transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.product-card:hover:not(:disabled):not(.active) {
    background: color-mix(in srgb, var(--surface) 64%, transparent);
}

.product-card:active:not(:disabled) {
    transform: scale(0.985);
}

.product-card.active {
    color: var(--text-main);
}

/* 若滑块尚未就绪时的降级兜底样式 */
.product-switcher:not(.has-indicator) .product-card.active {
    background: var(--surface);
    border-color: color-mix(in srgb, var(--product-accent) 44%, var(--border));
    box-shadow:
        0 4px 14px -3px var(--product-glow),
        0 0 0 1px color-mix(in srgb, var(--product-accent) 22%, transparent);
}

.product-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--surface-soft);
    color: var(--text-secondary);
    transition:
        background-color 260ms var(--product-ease),
        color 260ms var(--product-ease),
        transform 260ms var(--product-ease);
}

.product-card.active .product-icon {
    transform: scale(1.04);
}

.product-icon svg {
    width: 18px;
    height: 18px;
}

.product-card[data-product='gpt'].active .product-icon {
    background: rgba(16, 163, 127, 0.14);
    color: #10a37f;
}

.product-card[data-product='claude'].active .product-icon {
    background: rgba(217, 119, 87, 0.14);
    color: #d97757;
}

.product-card[data-product='grok'].active .product-icon {
    background: rgba(2, 132, 199, 0.14);
    color: #0284c7;
}

:root[data-theme='dark'] .product-card[data-product='grok'].active .product-icon {
    background: rgba(56, 189, 248, 0.16);
    color: #38bdf8;
}

.product-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.product-meta strong {
    font-size: 13.5px;
    font-weight: 650;
    color: var(--text-main);
    line-height: 1.25;
}

.product-meta small {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-check {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 180ms ease;
}

.product-check svg {
    width: 10px;
    height: 10px;
    opacity: 0;
    transform: scale(0.6);
    transition: all 180ms ease;
}

.product-card.active .product-check {
    border-color: var(--product-accent);
    background: var(--product-accent);
    color: #fff;
}

.product-card.active .product-check svg {
    opacity: 1;
    transform: scale(1);
}

/* 紧凑 4 步流程条 */
.rail-divider {
    height: 1px;
    background: var(--divider);
}

.compact-stepper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.step-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 9px;
    color: var(--text-dim);
    font-size: 12.5px;
    font-weight: 500;
    transition:
        background-color 200ms ease,
        color 200ms ease;
}

.step-row.active {
    background: var(--product-soft);
    color: var(--text-main);
    font-weight: 600;
}

.step-row.done {
    color: var(--text-secondary);
}

.step-dot {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: var(--surface-soft);
    color: var(--text-dim);
    flex-shrink: 0;
    transition: all 200ms ease;
}

.step-row.active .step-dot {
    background: var(--product-accent);
    color: #fff;
}

.step-row.done .step-dot {
    background: var(--success-soft);
    color: var(--success);
}

.rail-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--divider);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--text-dim);
}

.rail-footer svg {
    width: 14px;
    height: 14px;
    color: var(--product-accent);
    flex-shrink: 0;
    transition: color 300ms var(--product-ease);
}

/* 右侧主操作区 */
.redeem-main {
    padding: 26px 30px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: color-mix(in srgb, var(--product-accent) 1.6%, var(--surface));
    transition: background-color 340ms var(--product-ease);
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--divider);
}

.panel-head-left {
    min-width: 0;
}

.product-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--product-soft);
    color: var(--product-accent);
    font-size: 11.5px;
    font-weight: 600;
    margin-bottom: 6px;
    transition:
        background-color 300ms var(--product-ease),
        color 300ms var(--product-ease);
}

.panel-head h1,
.panel-head h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
    line-height: 1.3;
}

.panel-head-sub {
    font-size: 12.5px;
    color: var(--text-dim);
    margin-top: 3px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    background: var(--surface-soft);
    color: var(--text-dim);
}

.status-pill.cdk_ok,
.status-pill.review,
.status-pill.running {
    background: var(--product-soft);
    color: var(--product-accent);
}

.status-pill.success {
    background: var(--success-soft);
    color: var(--success);
}

.status-pill.failed,
.status-pill.manual {
    background: var(--error-soft);
    color: var(--error);
}

/* 表单元素 */
.step-panel {
    display: none;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.step-panel.active {
    display: flex;
    animation: viewEnter 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}

.field-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 0;
    padding: 0;
    color: var(--product-accent);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: color 300ms var(--product-ease);
}

.link-btn:hover {
    text-decoration: underline;
}

.link-btn svg {
    width: 13px;
    height: 13px;
}

.text-input,
.text-area {
    display: block;
    width: 100%;
    background: var(--field-background);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 11px 14px;
    color: var(--text-main);
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background-color 160ms ease;
}

.text-input {
    height: 46px;
}

.text-input.mono {
    font-family:
        'JetBrains Mono', 'SF Mono', 'Cascadia Mono', Consolas, monospace;
    letter-spacing: 0.02em;
}

.text-area {
    resize: none;
    line-height: 1.55;
    min-height: 118px;
    font-family:
        'JetBrains Mono', 'SF Mono', 'Cascadia Mono', Consolas, monospace;
    font-size: 12.5px;
}

.text-input:hover,
.text-area:hover {
    border-color: var(--border-strong);
}

.text-input:focus,
.text-area:focus {
    border-color: var(--product-accent);
    box-shadow: 0 0 0 3px var(--product-ring);
}

.text-input::placeholder,
.text-area::placeholder {
    color: var(--text-muted);
    font-family: inherit;
}

.textarea-wrap {
    position: relative;
}

.textarea-wrap.has-action .text-area {
    padding-bottom: 44px;
}

.floating-action-link {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    background: var(--product-accent);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 8px var(--product-glow);
    transition:
        background-color 160ms ease,
        transform 140ms ease;
}

.floating-action-link:hover {
    background: var(--product-accent-hover);
    transform: translateY(-1px);
}

.floating-action-link svg {
    width: 12px;
    height: 12px;
}

/* 按钮 */
.btn-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-row .btn-cta {
    flex: 1;
}

.btn-cta,
.btn-ghost {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition:
        background-color 300ms var(--product-ease),
        border-color 300ms var(--product-ease),
        box-shadow 300ms var(--product-ease),
        color 240ms ease,
        transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 180ms ease;
}

.btn-cta {
    border: 1px solid transparent;
    background: var(--product-accent);
    color: #fff;
    box-shadow: 0 4px 14px -2px var(--product-glow);
}

.btn-cta::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        transparent 25%,
        rgba(255, 255, 255, 0.24) 50%,
        transparent 75%
    );
    transform: translateX(-120%);
    transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.btn-cta:hover:not(:disabled)::after {
    transform: translateX(120%);
}

.btn-cta:hover:not(:disabled) {
    background: var(--product-accent-hover);
    box-shadow: 0 10px 24px -6px var(--product-glow);
    transform: translateY(-1.5px);
}

.btn-cta:active:not(:disabled),
.btn-ghost:active:not(:disabled) {
    transform: scale(0.965);
}

.btn-cta:disabled,
.btn-ghost:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-ghost {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--surface-soft);
    color: var(--text-main);
}

.btn-sm {
    height: 34px;
    padding: 0 13px;
    border-radius: 9px;
    font-size: 12.5px;
}

.btn-cta svg,
.btn-ghost svg {
    width: 15px;
    height: 15px;
}

.spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 提示卡与信息条 */
.product-quick-tip {
    margin-top: auto;
    min-height: 62px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.5;
    transition:
        border-color 300ms var(--product-ease),
        background-color 300ms var(--product-ease);
}

.product-context-swap {
    animation: productSwapIn 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes productSwapIn {
    from {
        opacity: 0.55;
        transform: translateY(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-quick-tip strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.verified-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.verified-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
}

.verified-chip strong,
.verified-chip code {
    color: var(--text-main);
    font-weight: 600;
    background: none;
    padding: 0;
}

.verified-chip.accent {
    background: var(--product-soft);
    border-color: transparent;
    color: var(--product-accent);
}

.verified-chip.accent strong {
    color: var(--product-accent);
}

.field-hint {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.5;
}

/* Step 3 紧凑 2x2 确认网格 */
.confirm-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.confirm-cell {
    padding: 11px 13px;
    border-radius: 11px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    min-width: 0;
}

.confirm-cell dt {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 3px;
}

.confirm-cell dd {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    overflow-wrap: anywhere;
}

.overwrite-warning {
    display: none;
    padding: 10px 12px;
    border-radius: 11px;
    border: 1px solid rgba(217, 119, 6, 0.35);
    background: var(--warning-soft);
}

.overwrite-warning p {
    font-size: 12px;
    font-weight: 600;
    color: var(--warning);
    margin-bottom: 6px;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.check-row input[type='checkbox'] {
    width: 15px;
    height: 15px;
    margin-top: 2px;
    accent-color: var(--product-accent);
    flex-shrink: 0;
    cursor: pointer;
}

.check-row.subtle {
    font-size: 12px;
    color: var(--text-dim);
}

/* Step 4 圆形进度展示与阶段里程碑 */
.progress-card {
    display: none;
    flex-direction: column;
    gap: 14px;
    padding: 0;
    border: 0;
    background: transparent;
}

.recharge-hero-card {
    --hero-accent: var(--product-accent);
    --hero-accent-soft: var(--product-soft);
    --hero-accent-glow: var(--product-glow);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 22px;
    border-radius: 18px;
    background:
        radial-gradient(
            circle at 92% 96%,
            color-mix(in srgb, var(--hero-accent) 13%, transparent) 0%,
            transparent 58%
        ),
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--hero-accent) 6%, var(--surface)) 0%,
            var(--surface) 58%,
            color-mix(in srgb, var(--hero-accent) 4%, var(--surface-soft)) 100%
        );
    border: 1px solid color-mix(in srgb, var(--hero-accent) 20%, var(--border));
    box-shadow:
        0 10px 28px -18px color-mix(in srgb, var(--hero-accent) 34%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    transition:
        border-color 280ms ease,
        background 280ms ease,
        box-shadow 280ms ease;
}

:root[data-theme='dark'] .recharge-hero-card {
    box-shadow:
        0 14px 32px -18px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.recharge-hero-card::after {
    content: '';
    position: absolute;
    right: -34px;
    bottom: -44px;
    width: 148px;
    height: 148px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        color-mix(in srgb, var(--hero-accent) 14%, transparent) 0%,
        transparent 72%
    );
    pointer-events: none;
}

.recharge-hero-card[data-state='success'] {
    --hero-accent: var(--success);
    --hero-accent-soft: var(--success-soft);
}

.recharge-hero-card[data-state='failed'] {
    --hero-accent: var(--error);
    --hero-accent-soft: var(--error-soft);
}

.recharge-hero-card[data-state='manual'] {
    --hero-accent: #d97706;
    --hero-accent-soft: rgba(217, 119, 6, 0.12);
}

:root[data-theme='dark'] .recharge-hero-card[data-state='manual'] {
    --hero-accent: #f59e0b;
    --hero-accent-soft: rgba(245, 158, 11, 0.16);
}

/* 圆形轨道进度环 */
.ring-gauge {
    position: relative;
    width: 98px;
    height: 98px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}

.ring-orbit {
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    border: 1px dashed color-mix(in srgb, var(--hero-accent) 26%, var(--border));
    animation: ringOrbitSpin 14s linear infinite;
    pointer-events: none;
}

.ring-orbit-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.ring-orbit-dot.dot-a {
    top: -2.5px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--hero-accent);
    color: var(--hero-accent);
}

.ring-orbit-dot.dot-b {
    bottom: 12px;
    left: 4px;
    width: 4px;
    height: 4px;
    background: #38bdf8;
    color: #38bdf8;
    opacity: 0.85;
}

.ring-orbit-dot.dot-c {
    right: 6px;
    top: 18px;
    width: 4px;
    height: 4px;
    background: #34d399;
    color: #34d399;
    opacity: 0.85;
}

.recharge-hero-card:not([data-state='running']) .ring-orbit {
    animation-play-state: paused;
    opacity: 0.65;
}

.ring-svg {
    width: 82px;
    height: 82px;
    transform: rotate(-90deg);
    overflow: visible;
    position: relative;
    z-index: 1;
}

.ring-track {
    fill: none;
    stroke: color-mix(in srgb, var(--hero-accent) 14%, var(--border));
    stroke-width: 6.5;
}

.ring-progress {
    fill: none;
    stroke: var(--hero-accent);
    stroke-width: 6.5;
    stroke-linecap: round;
    stroke-dasharray: 226.195;
    stroke-dashoffset: 226.195;
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--hero-accent) 36%, transparent));
    transition:
        stroke-dashoffset 520ms cubic-bezier(0.22, 1, 0.36, 1),
        stroke 240ms ease;
}

.ring-center {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ring-percent {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
}

.ring-unit-label {
    margin-top: 2px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.ring-state-badge {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: var(--hero-accent);
    color: #ffffff;
    box-shadow:
        0 8px 18px -6px color-mix(in srgb, var(--hero-accent) 68%, transparent),
        0 0 0 6px color-mix(in srgb, var(--hero-accent) 14%, transparent);
    animation: ringBadgePop 320ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.ring-state-badge svg {
    width: 20px;
    height: 20px;
}

.recharge-hero-card:not([data-state='running']) .ring-percent,
.recharge-hero-card:not([data-state='running']) .ring-unit-label {
    display: none;
}

.recharge-hero-card:not([data-state='running']) .ring-state-badge {
    display: inline-flex;
}

/* 英雄卡片右侧文案 */
.recharge-hero-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
    flex: 1;
}

.recharge-eyebrow-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.recharge-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--hero-accent);
}

.recharge-stage-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: var(--hero-accent);
    background: color-mix(in srgb, var(--hero-accent) 11%, transparent);
    border: 1px solid color-mix(in srgb, var(--hero-accent) 18%, transparent);
}

.recharge-stage-pill:empty {
    display: none;
}

.recharge-hero-title {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
    color: var(--text-main);
}

.recharge-hero-desc {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.58;
    color: var(--text-secondary);
}

.recharge-hero-card[data-state='failed'] .recharge-hero-desc {
    color: color-mix(in srgb, var(--error) 82%, var(--text-main));
    font-weight: 500;
}

/* 4 节点阶段里程碑卡片 */
.recharge-stages-card {
    padding: 16px 18px 15px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px -12px rgba(15, 23, 42, 0.14);
}

.recharge-stages {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    position: relative;
}

.stage-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 4px;
    z-index: 1;
}

.stage-node:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: calc(50% + 18px);
    right: calc(-50% + 18px);
    height: 2px;
    border-radius: 999px;
    background: var(--border);
    transition: background-color 300ms ease;
    z-index: 0;
}

.stage-node.done:not(:last-child)::after {
    background: var(--product-accent);
}

.recharge-stages[data-state='success'] .stage-node.done:not(:last-child)::after {
    background: var(--success);
}

.stage-circle {
    position: relative;
    z-index: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: var(--surface-soft);
    color: var(--text-dim);
    border: 1.5px solid var(--border);
    transition:
        background-color 240ms ease,
        border-color 240ms ease,
        color 240ms ease,
        box-shadow 240ms ease,
        transform 240ms ease;
}

.stage-node.done .stage-circle {
    background: var(--product-accent);
    border-color: var(--product-accent);
    color: #ffffff;
}

.recharge-stages[data-state='success'] .stage-node.done .stage-circle {
    background: var(--success);
    border-color: var(--success);
}

.stage-node.active .stage-circle {
    background: var(--product-accent);
    border-color: var(--product-accent);
    color: #ffffff;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--product-accent) 18%, transparent);
    animation: stageNodePulse 1.8s ease-in-out infinite;
}

.stage-node.error .stage-circle {
    background: var(--error);
    border-color: var(--error);
    color: #ffffff;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--error) 18%, transparent);
}

.stage-node.warning .stage-circle {
    background: #d97706;
    border-color: #d97706;
    color: #ffffff;
    box-shadow: 0 0 0 5px rgba(217, 119, 6, 0.18);
}

.stage-label {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    line-height: 1.3;
}

.stage-sub {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-dim);
    opacity: 0.85;
}

.stage-node.active .stage-label,
.stage-node.done .stage-label {
    color: var(--text-main);
}

.stage-node.error .stage-label {
    color: var(--error);
}

.stage-node.warning .stage-label {
    color: #b45309;
}

:root[data-theme='dark'] .stage-node.warning .stage-label {
    color: #fbbf24;
}

/* 简洁脱敏摘要条（无上游敏感细节） */
.recharge-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.recharge-meta-cell {
    padding: 11px 13px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    min-width: 0;
}

.recharge-meta-cell span {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.recharge-meta-cell strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recharge-meta-cell strong[data-status='running'] {
    color: var(--product-accent);
}

.recharge-meta-cell strong[data-status='success'] {
    color: var(--success);
}

.recharge-meta-cell strong[data-status='failed'] {
    color: var(--error);
}

.recharge-meta-cell strong[data-status='manual'] {
    color: #d97706;
}

:root[data-theme='dark'] .recharge-meta-cell strong[data-status='manual'] {
    color: #fbbf24;
}

@keyframes ringOrbitSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes ringBadgePop {
    from {
        opacity: 0;
        transform: scale(0.72);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes stageNodePulse {
    0%,
    100% {
        box-shadow: 0 0 0 4px color-mix(in srgb, var(--product-accent) 18%, transparent);
    }
    50% {
        box-shadow: 0 0 0 8px color-mix(in srgb, var(--product-accent) 6%, transparent);
    }
}

/* 状态消息 */
.status-banner {
    display: none;
    padding: 11px 14px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    animation: viewEnter 180ms ease both;
}

.status-banner.success {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid color-mix(in srgb, var(--success) 22%, transparent);
}

.status-banner.error {
    background: var(--error-soft);
    color: var(--error);
    border: 1px solid color-mix(in srgb, var(--error) 22%, transparent);
}

.status-banner.info {
    background: var(--product-soft);
    color: var(--product-accent);
    border: 1px solid color-mix(in srgb, var(--product-accent) 22%, transparent);
}

/* ============ 视图 2：进度查询 ============ */
.focused-card {
    max-width: 640px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--product-shell-border, var(--border));
    border-radius: 20px;
    padding: 26px 30px;
    box-shadow: var(--product-shell-shadow, var(--shadow-lg));
}

.wide-card {
    max-width: 900px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--product-shell-border, var(--border));
    border-radius: 20px;
    padding: 24px 28px;
    box-shadow: var(--product-shell-shadow, var(--shadow-lg));
}

.inline-search {
    display: flex;
    gap: 10px;
    align-items: center;
}

.inline-search .text-input {
    flex: 1;
}

.query-result-card {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-soft);
    padding: 4px 16px;
}

.query-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--divider);
    font-size: 13px;
}

.query-row:last-child {
    border-bottom: 0;
}

.query-row span {
    color: var(--text-dim);
    flex-shrink: 0;
}

.query-row strong {
    color: var(--text-main);
    text-align: right;
    word-break: break-word;
}

.query-row .status-unused {
    color: var(--success);
}

.query-row .status-processing {
    color: var(--warning);
}

.query-row .status-used {
    color: var(--error);
}

/* ============ 自助换卡视图 ============ */
.replace-rules-box {
    padding: 13px 15px;
    border-radius: 13px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.replace-rules-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 7px;
}

.replace-rules-list {
    list-style: disc;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.replace-result-card {
    margin-top: 4px;
    padding: 18px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid color-mix(in srgb, var(--success) 32%, var(--border));
    animation: viewEnter 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.replace-result-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.replace-new-code-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    flex-wrap: wrap;
}

.replace-new-code-box code {
    font-family:
        'JetBrains Mono', 'SF Mono', 'Cascadia Mono', Consolas, monospace;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text-main);
    background: none;
    padding: 0;
    word-break: break-all;
}

/* ============ 视图 3：账单订阅 ============ */
.sub-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border-radius: 10px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.sub-tab-btn {
    height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-dim);
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 160ms ease;
}

.sub-tab-btn.active {
    background: var(--surface);
    color: var(--text-main);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.billing-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.billing-metric {
    padding: 12px 13px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.billing-metric h3 {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 600;
}

.billing-metric strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin: 4px 0 2px;
}

.billing-metric p {
    font-size: 11px;
    color: var(--text-dim);
}

.billing-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.billing-result-head h3 {
    font-size: 16px;
    font-weight: 700;
}

.billing-result-head small {
    font-size: 11.5px;
    color: var(--text-dim);
}

.billing-invoices-box {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    max-height: 170px;
    overflow-y: auto;
}

.invoice-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--divider);
    font-size: 12.5px;
}

.invoice-row:last-child {
    border-bottom: 0;
}

.invoice-row p {
    font-size: 11px;
    color: var(--text-dim);
}

.provider-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 6px;
}

.provider-card {
    padding: 16px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.provider-card h3 {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.provider-card p {
    font-size: 12.5px;
    color: var(--text-dim);
    line-height: 1.55;
    flex: 1;
}

/* ============ 视图 4：使用教程 ============ */
.tutorial-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 18px;
    margin-top: 16px;
    align-items: start;
}

.tutorial-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tutorial-steps li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 13px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tutorial-steps li .num {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: var(--product-soft);
    color: var(--product-accent);
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.tutorial-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.code-sample {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    font-family:
        'JetBrains Mono', 'SF Mono', 'Cascadia Mono', Consolas, monospace;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--text-secondary);
    overflow-x: auto;
    white-space: pre;
}

.tutorial-note {
    padding: 11px 13px;
    border-radius: 11px;
    background: var(--product-soft);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.tutorial-note strong {
    color: var(--product-accent);
}

/* ============ 响应式适配 ============ */
@media (max-width: 960px) {
    .topbar {
        height: auto;
        padding: 10px 0;
    }
    .topbar-inner {
        flex-wrap: wrap;
        gap: 10px;
    }
    .spa-nav {
        order: 3;
        width: 100%;
        justify-content: space-between;
    }
    .spa-nav-btn {
        flex: 1;
        justify-content: center;
        padding: 0 6px;
        font-size: 12px;
    }
}

@media (max-width: 860px) {
    .spa-stage {
        align-items: flex-start;
        padding: 14px;
        min-height: auto;
    }
    .redeem-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .redeem-rail {
        border-right: 0;
        border-bottom: 1px solid var(--border);
        padding: 16px;
        gap: 12px;
    }
    .product-switcher {
        flex-direction: row;
        gap: 8px;
    }
    .product-card {
        flex: 1;
        padding: 9px 10px;
        gap: 8px;
    }
    .product-meta small,
    .product-check,
    .rail-footer {
        display: none;
    }
    .compact-stepper {
        flex-direction: row;
        gap: 4px;
    }
    .step-row {
        flex: 1;
        justify-content: center;
        padding: 6px 4px;
        font-size: 11.5px;
    }
    .step-row span:last-child {
        display: none;
    }
    .redeem-main,
    .focused-card,
    .wide-card {
        padding: 20px 18px;
    }
    .confirm-grid,
    .billing-metrics,
    .provider-grid,
    .tutorial-grid,
    .recharge-meta-grid {
        grid-template-columns: 1fr;
    }
    .recharge-hero-card {
        flex-direction: column;
        text-align: center;
        padding: 18px 16px;
        gap: 14px;
    }
    .recharge-eyebrow-row {
        justify-content: center;
    }
    .recharge-stages-card {
        padding: 14px 10px;
    }
    .stage-label {
        font-size: 11px;
    }
    .stage-sub {
        display: none;
    }
    .inline-search {
        flex-direction: column;
        align-items: stretch;
    }
    .runtime-pill {
        padding: 0 9px;
        font-size: 11px;
    }
}

.sub-tab-btn {
    position: relative;
    overflow: hidden;
    transition:
        background-color 180ms ease,
        color 180ms ease,
        box-shadow 180ms ease,
        transform 140ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sub-tab-btn:active {
    transform: scale(0.95);
}

@media (prefers-reduced-motion: reduce) {
    .portal-ambient,
    .runtime-pill.online-24h .runtime-dot::after,
    .ring-orbit,
    .stage-node.active .stage-circle,
    .ring-state-badge,
    .click-ripple,
    .product-card.active .product-icon svg {
        animation: none !important;
    }
}
