/* ============================================
   XM娓告垙鍔╂墜 鈥?瀹樼綉鏍峰紡
   椋庢牸锛氭殫鑹插簳 + 闈掔豢寮鸿皟 / 绮捐嚧宸ュ叿鍨?   ============================================ */

:root {
    --bg: #08090d;
    --bg-elevated: #0e1017;
    --surface: #141620;
    --surface-hover: #1a1d2e;
    --border: #1e2235;
    --accent: #00e5a0;
    --accent-dim: rgba(0,229,160,0.12);
    --accent-glow: rgba(0,229,160,0.25);
    --secondary: #ff8c38;
    /* === Hero background image path (change this to swap champion wallpaper) === */
    --hero-bg-url: url('../images/hero-bg.jpg');
    --secondary-dim: rgba(255,140,56,0.12);
    --warning: #f5a623;
    --warning-dim: rgba(245,166,35,0.1);
    --danger: #ff4d6a;
    --text-primary: #e8e6e3;
    --text-secondary: #9a9bb0;
    --text-muted: #5c5e72;
    --radius: 12px;
    --radius-sm: 8px;
    /* 系统字体栈：不加载外部字体，跨平台统一观感 */
    --font-sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    --transition: 0.25s ease;
    /* === 字号变量（可在后台 网站设置-主题样式 覆盖）=== */
    --font-body: 15px;
    --font-title-min: 24px;
    --font-title-max: 36px;
    --font-section-sub: 15px;
    --hero-min: 42px;
    --hero-max: 68px;
}

[data-theme="light"] {
    --bg: #f5f6f8;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-hover: #f0f1f4;
    --border: #e2e4ea;
    --accent: #00b87a;
    --accent-dim: rgba(0,184,122,0.1);
    --accent-glow: rgba(0,184,122,0.18);
    --secondary: #e07020;
    --secondary-dim: rgba(224,112,32,0.1);
    --warning: #d4900a;
    --warning-dim: rgba(245,166,35,0.1);
    --danger: #e03e55;
    --text-primary: #1a1d2e;
    --text-secondary: #3f4357;
    --text-muted: #666b80;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    /* 不设固定 height：让 html 随内容增长（height:100% 会把 html 钉死在视口高度） */
    min-height: 100%;
    min-height: 100svh;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.8;
    font-size: var(--font-body);
    min-height: 100vh;
    /* iOS Safari: 100vh 含地址栏高度会偏大，改用 svh 精确贴住可见视口 */
    min-height: 100svh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.45s ease, color 0.35s ease;
    /* Sticky footer：flex 布局。
       注意：body 下有 JS 动态注入的弹窗层（公告/下载验证等），
       用 grid 会把样式失效的弹窗塞进固定 grid 行导致手机布局爆炸，
       所以用 flex（static 子项正常参与流，不破坏布局）。
       真正的 footer 贴底修复是上方 html 的 min-height 链。 */
    display: flex;
    flex-direction: column;
}
main {
    flex: 1 0 auto;
    width: 100%;
    min-height: 0;
}

/* Subtle background glow */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 800px 600px at 15% 10%, rgba(0,229,160,0.04) 0%, transparent 70%),
        radial-gradient(ellipse 600px 800px at 85% 80%, rgba(124,108,240,0.03) 0%, transparent 70%),
        radial-gradient(ellipse 400px 400px at 50% 50%, rgba(0,229,160,0.015) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Noise texture overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    opacity: 0.025;
    pointer-events: none;
    z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.container-sm { max-width: 920px; }

/* ============================================
   HEADER / TOPBAR
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(8,9,13,0.82);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 20px;
    max-width: none;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 800;
    font-size: 16px;
    border: 1px solid rgba(0,229,160,0.15);
}

.logo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.2;
}

.logo-title {
    font-size: var(--brand-size, 16px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--brand-color, var(--text-primary));
}

/* 白天主题下导航栏背景为深色，标题改白色确保对比度（可在后台 站点信息 覆盖） */
[data-theme="light"] .logo-title {
    color: var(--brand-color, #ffffff);
}

.logo-sub {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
/* 白天主题下副标题提亮，确保在深色导航栏上可读 */
[data-theme="light"] .logo-sub {
    color: rgba(255,255,255,0.65);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
    border: 1px solid transparent;
    font-family: var(--font-sans);
}

.header-link.nav-link {
    color: var(--nav-color, rgba(255,255,255,0.75));
    font-size: var(--nav-size, 12.5px);
    border-color: transparent;
}
.header-link.nav-link:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}
.header-link.nav-link svg {
    color: inherit;
}
/* 白天主题下导航栏背景为深色，提升链接对比度（可在后台 导航栏 覆盖） */
[data-theme="light"] .header-link.nav-link {
    color: var(--nav-color, rgba(255,255,255,0.85));
}
[data-theme="light"] .header-link.nav-link:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.2);
}

.header-link.download {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: rgba(0,229,160,0.15);
}
.header-link.download:hover {
    background: rgba(0,229,160,0.2);
    border-color: rgba(0,229,160,0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}
/* 白天主题下导航栏背景为深色，下载按钮使用实心填充确保高对比度 */
[data-theme="light"] .header-link.download {
    background: #00b87a;
    color: #ffffff;
    border-color: #00b87a;
}
[data-theme="light"] .header-link.download:hover {
    background: #00a06a;
    border-color: #00a06a;
    color: #ffffff;
}

.header-link.docs {
    background: rgba(59,130,246,0.12);
    color: #60a5fa;
    border-color: rgba(59,130,246,0.2);
}
.header-link.docs:hover {
    background: rgba(59,130,246,0.22);
    border-color: rgba(59,130,246,0.35);
    transform: translateY(-1px);
}

/* === 导航下拉菜单 === */
.nav-dropdown {
    position: relative;
    display: inline-flex;
}
.nav-dropdown .dropdown-arrow {
    transition: transform 0.2s ease;
    opacity: 0.6;
}
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    min-width: 160px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1000;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.menu-open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
    opacity: 1;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.dropdown-item:hover {
    background: var(--accent-dim);
    color: var(--accent);
}
.dropdown-item svg {
    flex-shrink: 0;
}

/* === 订单查询结果 === */
.query-result {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-top: 8px;
}
.qr-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.qr-row:last-child { border-bottom: none; }
.qr-label {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.qr-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.query-order-list {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}
.query-order-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 1fr) 18px;
    gap: 14px;
    align-items: center;
    width: 100%;
    min-height: 70px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.query-order-item:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
}
.query-order-main,
.query-order-meta {
    display: flex;
    min-width: 0;
}
.query-order-main {
    flex-direction: column;
    gap: 5px;
}
.query-order-plan {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.query-order-no {
    overflow: hidden;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.query-order-meta {
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}
.query-order-status {
    padding: 3px 7px;
    border-radius: 6px;
    background: var(--warning-dim);
    color: var(--warning);
    font-weight: 700;
}
.query-order-status.is-paid {
    background: var(--accent-dim);
    color: var(--accent);
}
.query-order-arrow {
    color: var(--text-muted);
    font-size: 24px;
    line-height: 1;
}
.query-pagination {
    display: grid;
    grid-template-columns: 90px 1fr 90px;
    gap: 10px;
    align-items: center;
    margin: 14px 0;
}
.query-pagination span {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}
.query-pagination button {
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.query-pagination button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}
.query-pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}
.query-list-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 180px;
    color: var(--text-secondary);
    font-size: 13px;
}

@media (max-width: 640px) {
    .query-order-item {
        grid-template-columns: minmax(0, 1fr) 16px;
        gap: 8px;
    }
    .query-order-meta {
        grid-column: 1;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 7px 10px;
        white-space: normal;
    }
    .query-order-arrow {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
    .query-pagination {
        grid-template-columns: 78px 1fr 78px;
        gap: 8px;
    }
}

.header-version {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--accent-dim);
    color: var(--accent);
    letter-spacing: 0.03em;
}

.hamburger {
    display: none;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    align-items: center;
    justify-content: center;
}

/* ============================================
   HAMBURGER MENU (MOBILE)
   ============================================ */
.mobile-menu {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(8,9,13,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    z-index: 99;
    flex-direction: column;
    gap: 12px;
}
.mobile-menu.active { display: flex; }
.mobile-menu a {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--nav-color, var(--text-secondary));
    transition: all var(--transition);
}
.mobile-menu a:hover { background: var(--surface); color: var(--text-primary); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    letter-spacing: 0.2px;
}

.btn-primary {
    background: var(--accent);
    color: #08090d;
    box-shadow: 0 2px 16px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(0,229,160,0.35);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: rgba(0,229,160,0.25);
    transform: translateY(-1px);
}

.btn-lg {
    padding: 16px 40px;
    font-size: 17px;
}

.btn-icon { flex-shrink: 0; }

/* ============================================
   HERO — Epic Champion Background
   ============================================ */

/* === Hero background layer === */
 .hero-bg-wrap {
     position: fixed;
     top: 0; left: 0; right: 0; bottom: 0;
     z-index: 0;
     overflow: hidden;
     pointer-events: none;
     /* 主题色兜底：切换主题/新媒体加载期间先显示对应主题底色，杜绝闪白屏 */
     background: var(--bg);
     background-size: cover;
     background-position: center;
     transition: background-color .3s ease;
 }
 .hero-bg-video {
     position: absolute;
     top: 0; left: 0;
     width: 100%; height: 100%;
     object-fit: cover;
     will-change: transform;
 }
 /* Dark gradient overlay for text readability */
 .hero-bg-overlay {
     position: absolute;
     inset: 0;
     background:
         linear-gradient(180deg,
             rgba(8,9,13,0.72) 0%,
             rgba(8,9,13,0.55) 30%,
             rgba(8,9,13,0.75) 60%,
             rgba(8,9,13,0.92) 100%),
         radial-gradient(ellipse 600px 400px at 30% 50%, rgba(0,0,0,0.4) 0%, transparent 70%);
     transition: background 0.6s ease;
 }
 /* Light theme: minimal overlay so EZ video is clearly visible */
 [data-theme="light"] .hero-bg-overlay {
     background:
         linear-gradient(180deg,
             rgba(7,25,17,0.58) 0%,
             rgba(7,25,17,0.3) 28%,
             rgba(7,25,17,0.42) 55%,
             rgba(7,25,17,0.72) 100%),
         radial-gradient(ellipse 720px 440px at 50% 44%, rgba(7,25,17,0.32) 0%, transparent 72%);
 }

/* === Ember particles === */
.ember {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
}
/* Light theme: reduce ember visibility for cooler look with EZ video */
[data-theme="light"] .ember-container {
    opacity: 0.35;
    transition: opacity 0.6s ease;
}
@keyframes ember-rise {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }
    10% { opacity: var(--ember-opacity, 0.8); }
    90% { opacity: var(--ember-opacity, 0.8); }
    100% {
        transform: translateY(-100vh) translateX(var(--ember-drift, 30px)) scale(0.3);
        opacity: 0;
    }
}

/* === Hero content entrance animation === */
.hero-anim {
    opacity: 0;
    transform: translateY(30px);
    animation: hero-fade-in 0.8s ease forwards;
}
.hero-anim:nth-child(1) { animation-delay: 0.1s; }
.hero-anim:nth-child(2) { animation-delay: 0.3s; }
.hero-anim:nth-child(3) { animation-delay: 0.5s; }
.hero-anim:nth-child(4) { animation-delay: 0.7s; }
@keyframes hero-fade-in {
    to { opacity: 1; transform: translateY(0); }
}

/* First-screen wrapper: hero + stats fill exactly one viewport */
.first-screen {
    min-height: calc(100svh - 64px + 65px);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.hero {
    position: relative;
    z-index: 1;
    padding: 40px 0 30px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 24px;
    border: 1px solid rgba(0,229,160,0.15);
}

.hero-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.hero h1 {
    font-size: var(--hero-title-size, clamp(var(--hero-min), 7vw, var(--hero-max)));
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.hero h1 .hl {
    background: linear-gradient(135deg, var(--hero-title-color, var(--accent)), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
/* Light theme: 白天主标题颜色可在后台 Hero 首屏 覆盖（默认纯白） */
[data-theme="light"] .hero h1 .hl {
    background: linear-gradient(135deg, var(--hero-title-color, #ffffff) 0%, var(--hero-title-color, #ffffff) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 2px 10px rgba(4,22,14,0.65)) drop-shadow(0 8px 30px rgba(4,22,14,0.5));
}

.hero-desc {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 40px;
    line-height: 1.9;
}
/* Light theme: dark text + white glow shadow for readability over EZ video */
[data-theme="light"] .hero-desc {
    color: #f2faf6;
    font-weight: 500;
    text-shadow: 0 1px 5px rgba(4,20,13,0.65), 0 2px 16px rgba(4,20,13,0.5);
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.hero-meta {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #f2e9ef;
    background: rgba(8,5,8,0.44);
    border: 1px solid rgba(255,255,255,0.16);
    padding: 7px 14px;
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-shadow: 0 1px 4px rgba(0,0,0,0.75);
}
/* Light theme: dark text + white glow for meta items over video bg */
[data-theme="light"] .meta-item {
    color: #eafff6;
    font-weight: 600;
    background: rgba(6,24,16,0.4);
    border-color: rgba(255,255,255,0.18);
    text-shadow: 0 1px 5px rgba(3,18,11,0.7), 0 2px 14px rgba(3,18,11,0.45);
}

.meta-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(0,229,160,0.8);
}

[data-theme="light"] .meta-dot {
    background: #3dffba;
    box-shadow: 0 0 10px rgba(61,255,186,0.9);
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lightbox-overlay.open {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    width: 85vw;
    max-width: 1100px;
    aspect-ratio: 16 / 9;
    max-height: 80vh;
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.08);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
}

.lightbox-overlay.open .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(20,20,35,0.8);
    backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.lightbox-close:hover {
    background: rgba(255,77,106,0.3);
    border-color: rgba(255,77,106,0.5);
    transform: rotate(90deg);
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(20,20,35,0.75);
    backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.lightbox-arrow:hover {
    background: rgba(40,40,65,0.95);
    transform: translateY(-50%) scale(1.1);
    border-color: rgba(0,229,160,0.3);
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
    padding: 6px 16px;
    border-radius: 20px;
    letter-spacing: 0.05em;
}

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
    position: relative;
    isolation: isolate;
    z-index: 1;
    overflow: hidden;
    padding: 18px 0;
    background: rgba(14,16,23,0.6);
    backdrop-filter: blur(12px) saturate(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
[data-theme="light"] .stats-bar {
    background: rgba(255,255,255,0.55);
}

/* Audio-reactive background layer. It is clipped to the stats band and never
   participates in layout or hit testing, so the existing stat cards remain
   fully interactive and readable. */
.stats-audio-visualizer {
    position: absolute;
    z-index: 0;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: .72;
    transition: opacity .35s ease;
}
.stats-audio-visualizer[data-state="empty"] {
    opacity: 0;
}
.stats-audio-visualizer[data-playing="0"] {
    opacity: .26;
}
html[data-theme="dark"] .stats-audio-visualizer[data-playing="1"] {
    opacity: .9;
}
html[data-theme="light"] .stats-audio-visualizer[data-playing="1"] {
    opacity: .96;
}
html[data-theme="light"] .stats-audio-visualizer[data-playing="0"] {
    opacity: .38;
}
.stats-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
    min-height: 160px;
    align-items: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.stat-item:hover {
    background: var(--surface);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-num {
    font-size: var(--stat-num-size, 28px);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--stat-num-color, var(--accent)), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
/* Light theme: 白天数字颜色可在后台 统计栏 覆盖（默认深色实心） */
[data-theme="light"] .stat-num {
    background: none;
    -webkit-text-fill-color: var(--stat-num-color, #1a1d2e);
    color: var(--stat-num-color, #1a1d2e);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}
/* Light theme: darker stat labels for readability */
[data-theme="light"] .stat-label {
    color: #27304a;
    font-weight: 600;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    position: relative;
    z-index: 1;
    padding: 100px 0;
    animation: fadeUp 0.6s ease both;
}
.section:nth-of-type(2) { animation-delay: 0.05s; }
.section:nth-of-type(3) { animation-delay: 0.1s; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-dark {
    background: rgba(14,16,23,0.55);
    backdrop-filter: blur(12px) saturate(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
}
[data-theme="light"] .section-dark {
    background: rgba(255,255,255,0.5);
}

.section-header {
    margin-bottom: 48px;
}

.section-header.center { text-align: center; }

.section-eyebrow {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 10px;
}

.section-title {
    font-size: var(--section-title-size, clamp(var(--font-title-min), 4vw, var(--font-title-max)));
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--section-title-color, inherit);
    line-height: 1.2;
    margin-bottom: 10px;
}

.section-sub {
    font-size: var(--font-section-sub);
    color: var(--text-secondary);
    max-width: 520px;
}

.section-header.center .section-sub { margin: 0 auto; }

[data-theme="light"] .section-eyebrow { color: #007a52; font-weight: 700; }
[data-theme="light"] .section-title { color: var(--section-title-color, #131627); }
[data-theme="light"] .section-sub { color: #3f4357; }

/* 白天主题：订阅/功能特性/下载区域文案指定配色（标题颜色可在后台 区块文案 覆盖） */
[data-theme="light"] #subscribe .section-eyebrow { color: #FFD54F; background: #000000; padding: 3px 16px; border-radius: 999px; font-weight: 700; display: inline-block; }
[data-theme="light"] #subscribe .section-title { color: var(--section-title-color, #ffffff); }
[data-theme="light"] #subscribe .section-sub { color: #FFFFFF; background: #E65100; padding: 4px 14px; border-radius: 6px; font-weight: 700; display: inline-block; }
[data-theme="light"] #features .section-eyebrow { color: #FFD54F; background: #000000; padding: 3px 16px; border-radius: 999px; font-weight: 700; display: inline-block; }
[data-theme="light"] #features .section-title { color: var(--section-title-color, #000000); }
[data-theme="light"] #features .section-sub { color: #FFFFFF; background: #1B5E20; padding: 4px 14px; border-radius: 6px; font-weight: 700; display: inline-block; }
[data-theme="light"] #download .section-eyebrow { color: #FFD54F; background: #000000; padding: 3px 16px; border-radius: 999px; font-weight: 700; display: inline-block; }
[data-theme="light"] #download .section-title { color: var(--section-title-color, #ffffff); }
[data-theme="light"] #download .section-sub { color: #FFD54F; background: #0D47A1; padding: 4px 14px; border-radius: 6px; font-weight: 700; display: inline-block; }

/* ============================================
   FEATURE GRID (HOME)
   ============================================ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: rgba(20,22,32,0.65);
    backdrop-filter: blur(10px) saturate(1.1);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all var(--transition);
}
[data-theme="light"] .feature-card {
    background: rgba(255,255,255,0.6);
}
.feature-card:hover {
    border-color: rgba(0,229,160,0.2);
    background: rgba(26,29,46,0.75);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
[data-theme="light"] .feature-card:hover {
    background: rgba(255,255,255,0.75);
}

.feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    margin-bottom: 16px;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(0,229,160,0.15);
}

.feature-icon.orange { background: var(--secondary-dim); color: var(--secondary); border-color: rgba(255,140,56,0.15); }
.feature-icon.blue { background: rgba(59,130,246,0.08); color: #60a5fa; border-color: rgba(59,130,246,0.15); }
.feature-icon.purple { background: rgba(124,108,240,0.08); color: #a78bfa; border-color: rgba(124,108,240,0.15); }

.feature-name {
    font-size: var(--feature-name-size, 16px);
    font-weight: 600;
    color: var(--feature-name-color, inherit);
    margin-bottom: 6px;
}
/* 白天主题卡片标题颜色（可在后台 功能特性卡片 覆盖，默认继承正文色） */
[data-theme="light"] .feature-name {
    color: var(--feature-name-color, #1a1d2e);
}

.feature-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============================================
   DOWNLOAD SECTION
   ============================================ */
.download-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    background: rgba(20,22,32,0.65);
    backdrop-filter: blur(10px) saturate(1.1);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 48px;
    max-width: 760px;
    margin: 0 auto;
    transition: border-color var(--transition);
}
[data-theme="light"] .download-card {
    background: rgba(255,255,255,0.6);
}
.download-card:hover { border-color: rgba(0,229,160,0.2); }

.dl-version {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.dl-value {
    font-family: var(--font-mono);
    font-size: var(--dl-value-size, 28px);
    font-weight: 800;
    color: var(--dl-value-color, var(--accent));
    letter-spacing: -1px;
}

/* 白天主题下版本号颜色（可在后台 下载区设置 覆盖） */
[data-theme="light"] .dl-value { color: var(--dl-value-color, #00FF4D); }

.dl-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 14px;
}

.dl-meta-item {
    font-size: 13px;
    color: var(--text-secondary);
}

.dl-note {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 12px;
}

.dl-note a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.download-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.dl-size {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   SIDEBAR (DOCS PAGE)
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), background 0.4s ease, border-color 0.4s ease;
}

.sidebar-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-group { margin-bottom: 8px; }

.nav-group-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 8px 12px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 400;
    transition: all var(--transition);
    position: relative;
}

.nav-link:hover { color: var(--text-primary); background: var(--surface); }

.nav-link.active {
    color: var(--accent);
    background: var(--accent-dim);
    font-weight: 500;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer span { color: var(--accent); font-weight: 600; }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.sidebar-overlay.show { visibility: visible; opacity: 1; }

/* ============================================
   MAIN (DOCS PAGE)
   ============================================ */
.main-docs { margin-left: 280px; position: relative; z-index: 1; min-height: 100vh; }

.topbar {
    position: sticky;
    top: 0;
    height: 64px;
    background: var(--topbar-bg, rgba(8,9,13,0.82));
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 50;
    transition: background 0.4s ease, border-color 0.4s ease;
}
[data-theme="light"] .topbar {
    --topbar-bg: rgba(255,255,255,0.82);
}
[data-theme="dark"] .topbar,
:root .topbar {
    --topbar-bg: rgba(8,9,13,0.82);
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    align-items: center;
    justify-content: center;
}

.breadcrumb { font-size: 13px; color: var(--text-muted); }
.breadcrumb span { color: var(--text-secondary); }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.content {
    max-width: 920px;
    margin: 0 auto;
    padding: 48px 40px 120px;
}

/* ============================================
   DOCS PAGE INTERNALS
   ============================================ */
.docs-section { margin-bottom: 64px; scroll-margin-top: 80px; }

.docs-section h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.docs-section h2 .section-num {
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(0,229,160,0.15);
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.docs-section h2 .anchor-link {
    margin-left: auto;
    font-size: 16px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    text-decoration: none;
    flex-shrink: 0;
}
.docs-section h2:hover .anchor-link { opacity: 1; }
.docs-section h2 .anchor-link:hover { color: var(--accent); }

.docs-section h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    position: relative;
    padding-left: 14px;
}
.docs-section h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: var(--accent);
}

.docs-section p {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 400;
    line-height: 1.9;
    margin-bottom: 16px;
}

.docs-section ol,
.docs-section ul {
    padding-left: 20px;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.9;
}

.docs-section li { margin-bottom: 6px; }

.docs-section code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    background: rgba(0,229,160,0.08);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0,229,160,0.12);
}

.docs-section pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.docs-section pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.7;
}

/* Callout */
.callout {
    display: flex;
    gap: 14px;
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    margin: 20px 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.8;
    color: var(--text-primary);
}

.callout.info {
    background: rgba(124,108,240,0.06);
    border: 1px solid rgba(124,108,240,0.12);
}

.callout.warn {
    background: var(--warning-dim);
    border: 1px solid rgba(245,166,35,0.15);
}

.callout-icon { font-size: 18px; flex-shrink: 0; line-height: 1.8; }

/* Feature accordion (docs) */
.feature-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fa-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.fa-card:hover {
    border-color: rgba(0,229,160,0.2);
}
.fa-card.open {
    border-color: rgba(0,229,160,0.25);
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.fa-header {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}
.fa-header:hover { background: var(--surface-hover); }

.fa-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
    background: var(--accent-dim);
    border: 1px solid rgba(0,229,160,0.15);
    color: var(--accent);
    transition: transform 0.3s ease;
}
.fa-card.open .fa-icon {
    transform: scale(1.05);
}

.fa-info { flex: 1; min-width: 0; }
.fa-name { font-size: 15.5px; font-weight: 700; margin-bottom: 2px; color: var(--text-primary); }
.fa-brief { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fa-arrow {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), color 0.3s ease;
    font-size: 11px;
    flex-shrink: 0;
}
.fa-card.open .fa-arrow { transform: rotate(180deg); color: var(--accent); }

/* Smooth height animation using grid-template-rows */
.fa-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.4,0,0.2,1);
}
.fa-card.open .fa-body { grid-template-rows: 1fr; }
.fa-body > .fa-body-inner { overflow: hidden; }

.fa-content {
    padding: 0 24px 24px;
    border-top: 1px solid var(--border);
}
.fa-content p {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 400;
    line-height: 1.9;
    margin-top: 16px;
}

/* Tags */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.tag {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(124,108,240,0.08);
    color: #a78bfa;
    border: 1px solid rgba(124,108,240,0.12);
}
.tag.green { background: var(--accent-dim); color: var(--accent); border-color: rgba(0,229,160,0.12); }
.tag.orange { background: var(--secondary-dim); color: var(--secondary); border-color: rgba(255,140,56,0.12); }

/* ============================================
   BOTTOM BAR
   ============================================ */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 280px;
    right: 0;
    height: 44px;
    background: var(--bottombar-bg, rgba(8,9,13,0.9));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 50;
    font-size: 12px;
    color: var(--text-muted);
    transition: background 0.4s ease, border-color 0.4s ease;
}
[data-theme="light"] .bottom-bar {
    --bottombar-bg: rgba(255,255,255,0.9);
}
[data-theme="dark"] .bottom-bar,
:root .bottom-bar {
    --bottombar-bg: rgba(8,9,13,0.9);
}

.bottom-bar .version { font-family: var(--font-mono); }
.bottom-bar .version span { color: var(--accent); }

/* ============================================
   READING PROGRESS
   ============================================ */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--secondary));
    z-index: 200;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 60px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--surface-hover); color: var(--text-primary); border-color: var(--accent); }

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
    position: fixed;
    bottom: 110px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    font-size: 16px;
    transition: all 0.3s ease;
}
.theme-toggle:hover { background: var(--surface-hover); border-color: var(--accent); }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: inline; }

/* ============================================
   MUSIC TOGGLE（主题音乐开关）
   ============================================ */
.music-toggle {
    position: fixed;
    bottom: 160px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    transition: all 0.3s ease;
}
.music-toggle:hover { background: var(--surface-hover); border-color: var(--accent); }
.music-toggle svg { width: 18px; height: 18px; color: var(--text-primary); }
.music-toggle .icon-music { display: none; }
.music-toggle .icon-music-off { display: block; }
.music-toggle.playing { border-color: var(--accent); }
.music-toggle.playing svg { color: var(--accent); }
.music-toggle.playing .icon-music { display: block; animation: xm-music-bounce 1.1s ease-in-out infinite; }
.music-toggle.playing .icon-music-off { display: none; }
.music-toggle.unavailable,
.music-toggle:disabled {
    cursor: not-allowed;
    opacity: .48;
    filter: grayscale(.65);
}
@keyframes xm-music-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.18); }
}

/* ============================================
   SEARCH (DOCS PAGE)
   ============================================ */
.topbar-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    transition: all var(--transition);
    white-space: nowrap;
}
.topbar-search-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: rgba(0,229,160,0.25);
}
.topbar-search-btn svg { color: inherit; flex-shrink: 0; }
.topbar-search-btn kbd {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    line-height: 1;
}

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.search-overlay.open { opacity: 1; visibility: visible; }

.search-panel {
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    width: 560px;
    max-width: 90vw;
    max-height: 65vh;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    z-index: 9001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.search-panel.open { opacity: 1; visibility: visible; transform: translateX(-50%) scale(1); }

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.search-icon { font-size: 16px; flex-shrink: 0; }
.search-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: var(--font-sans);
    color: var(--text-primary);
}
.search-input-wrap input::placeholder { color: var(--text-muted); }

.search-esc-btn {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}
.search-esc-btn:hover { background: var(--surface-hover); color: var(--text-primary); }

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease;
}
.search-result-item:hover,
.search-result-item.active {
    background: var(--surface);
}
.search-result-item.active { outline: 1px solid rgba(0,229,160,0.3); }

.sr-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.sr-info { flex: 1; min-width: 0; }
.sr-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.sr-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-result-item mark {
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 2px;
    padding: 0 2px;
}

.search-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
}
.search-footer kbd {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    line-height: 1;
}

/* ============================================
   FOOTER (HOME PAGE)
   ============================================ */
.footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    background: rgba(8,9,13,0.7);
    backdrop-filter: blur(12px) saturate(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
    border-top: 1px solid var(--border);
    padding: 40px 0;
}
[data-theme="light"] .footer {
    background: rgba(245,246,248,0.7);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 28px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-muted);
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--text-secondary); }

.footer-copy {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   SCROLL REVEAL (DOCS)
   Only applies when JS adds .reveal-ready to <html>
   ============================================ */
html.reveal-ready .docs-section {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
html.reveal-ready .docs-section.revealed {
    opacity: 1;
    transform: translateY(0);
}
html.reveal-ready .docs-section.revealed .fa-card {
    animation: fa-stagger 0.5s ease backwards;
}
html.reveal-ready .docs-section.revealed .fa-card:nth-child(1) { animation-delay: 0.05s; }
html.reveal-ready .docs-section.revealed .fa-card:nth-child(2) { animation-delay: 0.1s; }
html.reveal-ready .docs-section.revealed .fa-card:nth-child(3) { animation-delay: 0.15s; }
html.reveal-ready .docs-section.revealed .fa-card:nth-child(4) { animation-delay: 0.2s; }
html.reveal-ready .docs-section.revealed .fa-card:nth-child(5) { animation-delay: 0.25s; }
html.reveal-ready .docs-section.revealed .fa-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes fa-stagger {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    html.reveal-ready .docs-section { opacity: 1; transform: none; transition: none; }
    html.reveal-ready .docs-section.revealed .fa-card { animation: none; }
}

/* ============================================
   CODE COPY BUTTON (DOCS)
   ============================================ */
.code-block-wrap {
    position: relative;
    margin-bottom: 16px;
}
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-sans);
    background: var(--surface-hover);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 5;
}
.code-block-wrap:hover .code-copy-btn { opacity: 1; }
.code-copy-btn:hover {
    color: var(--accent);
    border-color: rgba(0,229,160,0.25);
}
.code-copy-btn.copied {
    color: var(--accent);
    border-color: rgba(0,229,160,0.3);
    background: var(--accent-dim);
}

/* ============================================
   TOPBAR SECTION INDICATOR
   ============================================ */
.topbar-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    transition: opacity 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-docs { margin-left: 0; }
    .menu-toggle { display: flex; }
    .bottom-bar { left: 0; padding: 0 20px; }
    .content { padding: 32px 20px 140px; }
    .topbar { padding: 0 20px; }
    .breadcrumb { display: none; }
    .topbar-section-title { max-width: 160px; font-size: 13px; }
    .topbar-search-btn span { display: none; }
    .topbar-search-btn kbd { display: none; }
    .feature-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; min-height: auto; }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }
    .header-right .header-link.nav-link:not(.download),
    .header-right .header-version { display: none; }
    .first-screen { min-height: auto; }
    .hero { padding: 80px 0 28px; }
    .hero h1 { font-size: 30px; }
    .lightbox-arrow { width: 40px; height: 40px; }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .download-card {
        flex-direction: column;
        text-align: center;
        padding: 32px 24px;
        gap: 24px;
    }
    .dl-meta { align-items: center; }
    .feature-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-num { font-size: 22px; }
    .stat-icon { font-size: 28px; }
    .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; justify-content: center; }
    .download-card { padding: 24px 18px; }
}

.feature-icon i {
    font-size: 22px;
    line-height: 1;
}
/* === 鎰忚鍙嶉寮圭獥 === */
.nav-feedback-btn {
  background: linear-gradient(135deg, rgba(0,229,160,.15), rgba(0,200,220,.12)) !important;
  color: #00e5a0 !important;
  border: 1px solid rgba(0,229,160,.25) !important;
  border-radius: 8px !important;
  padding: 6px 16px !important;
  font-weight: 600 !important;
  transition: all .2s !important;
}
.nav-feedback-btn:hover {
  background: linear-gradient(135deg, rgba(0,229,160,.25), rgba(0,200,220,.2)) !important;
  color: #00ffb3 !important;
  box-shadow: 0 0 16px rgba(0,229,160,.15) !important;
}
[data-theme="light"] .nav-feedback-btn {
  background: #ff8c38 !important;
  color: #ffffff !important;
  border-color: #ff8c38 !important;
}
[data-theme="light"] .nav-feedback-btn:hover {
  background: #e07020 !important;
  color: #ffffff !important;
  border-color: #e07020 !important;
  box-shadow: 0 0 14px rgba(255,140,56,.3) !important;
}

.fb-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999998;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}
.fb-modal-box {
  background: #0d1117;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  max-width: 540px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px 28px 24px;
  position: relative;
  animation: fbModalIn .25s ease;
}
[data-theme="light"] .fb-modal-box {
  background: #f6f8fa;
  border-color: rgba(0,0,0,.1);
}
@keyframes fbModalIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.fb-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: rgba(255,255,255,.4);
  font-size: 20px;
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all .15s;
  line-height: 1;
}
.fb-modal-close:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.8);
}
[data-theme="light"] .fb-modal-close { color: rgba(0,0,0,.65); }
[data-theme="light"] .fb-modal-close:hover { background: rgba(0,0,0,.05); color: rgba(0,0,0,.7); }
.fb-modal-header {
  text-align: center;
  margin-bottom: 22px;
}
.fb-modal-header .section-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,.35);
  margin-bottom: 4px;
}
[data-theme="light"] .fb-modal-header .section-eyebrow { color: rgba(0,0,0,.6); }
.fb-modal-header .section-title { color: #e6edf3; font-weight: 700; }
[data-theme="light"] .fb-modal-header .section-title { color: #1a1a2e; }

.fb-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.fb-form-row .fb-field { flex: 1; min-width: 140px; }
.fb-field { margin-bottom: 14px; }
.fb-field label {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
  color: rgba(255,255,255,.5);
}
[data-theme="light"] .fb-field label { color: rgba(0,0,0,.65); }
.fb-optional { color: rgba(255,255,255,.2); font-weight: 400; }
[data-theme="light"] .fb-optional { color: rgba(0,0,0,.6); }
.fb-field input,
.fb-field select,
.fb-field textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  color: #e6edf3;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color .15s;
}
.fb-field input:focus,
.fb-field select:focus,
.fb-field textarea:focus {
  border-color: rgba(0,229,160,.35);
}
.fb-field select {
  color-scheme: dark;
}
.fb-field select option {
  background: #11161d;
  color: #e6edf3;
}
[data-theme="light"] .fb-field input,
[data-theme="light"] .fb-field select,
[data-theme="light"] .fb-field textarea {
  background: #fff;
  border-color: rgba(0,0,0,.1);
  color: #1a1a2e;
}
[data-theme="light"] .fb-field select {
  color-scheme: light;
}
[data-theme="light"] .fb-field select option {
  background: #fff;
  color: #1a1a2e;
}
[data-theme="light"] .fb-field input:focus,
[data-theme="light"] .fb-field select:focus,
[data-theme="light"] .fb-field textarea:focus {
  border-color: rgba(0,180,120,.4);
}
.fb-field textarea {
  resize: vertical;
  min-height: 100px;
}

#fbDropZone { cursor: pointer;
  border: 2px dashed rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: rgba(255,255,255,.01);
}
#fbDropZone:hover { border-color: rgba(0,229,160,.25); background: rgba(0,229,160,.03); }
[data-theme="light"] #fbDropZone { cursor: pointer; border-color: rgba(0,0,0,.12); background: rgba(0,0,0,.01); }
[data-theme="light"] #fbDropZone:hover { border-color: rgba(0,180,120,.3); background: rgba(0,180,120,.03); }
.fb-dz-icon { font-size: 26px; margin-bottom: 6px; }
.fb-dz-text { font-size: 13px; color: rgba(255,255,255,.4); }
[data-theme="light"] .fb-dz-text { color: rgba(0,0,0,.6); }
.fb-dz-hint { font-size: 11px; color: rgba(255,255,255,.2); margin-top: 4px; }
[data-theme="light"] .fb-dz-hint { color: rgba(0,0,0,.6); }
#fbFileList { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }

.fb-submit-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  justify-content: center;
  margin-top: 4px;
}

#fbMsg {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* ============================================
   SUBSCRIPTION PLANS
   ============================================ */
/* ============================================
   锚点停靠微调（暗色 / 白天 可分别调）
   - 全局 html 已设 scroll-padding-top: 80px
   - 数值越大，跳转后停靠位置越往下；数值越小（越负）越往上
   - #subscribe 对应导航「订阅」，#features 对应导航「功能特性」
   - 当前值保持修改前效果；改完保存并刷新页面即可对比
   ============================================ */
#subscribe { scroll-margin-top: -45px; }
[data-theme="dark"] #subscribe { scroll-margin-top: -45px; }
[data-theme="light"] #subscribe { scroll-margin-top: -58px; }

#features { scroll-margin-top: 0px; }
[data-theme="dark"] #features { scroll-margin-top:  48px; }
[data-theme="light"] #features { scroll-margin-top: 45px; }

/* 扩展容器以容纳4张卡片，保持原始卡片宽度不变 */
#subscribe .container {
    max-width: 1600px;
}
.plans-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-top: 32px;
    padding-top: 8px;
}
/* 轮播模式：覆盖 grid 布局 */
.plans-grid.carousel-active {
    display: block;
    gap: 0;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

/* ============================================
   PLANS CAROUSEL (4+ plans)
   ============================================ */
.plans-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.plans-viewport {
    overflow: hidden;
    flex: 1;
    padding-top: 8px;
    margin-top: -8px;
}
.plans-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.plan-slide {
    flex: 0 0 calc(100% / 4);
    padding: 0 11px;
    box-sizing: border-box;
    display: flex;
}
.plan-slide > .plan-card {
    width: 100%;
}
.plans-arrow {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface, rgba(20,22,32,0.8));
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    z-index: 5;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.plans-arrow:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 2px 16px var(--accent-glow);
}
.plans-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex: 0 0 100%;
}
.plan-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted, rgba(255,255,255,0.2));
    cursor: pointer;
    transition: all var(--transition);
}
.plan-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--accent);
}
[data-theme="light"] .plan-dot {
    background: rgba(0,0,0,0.15);
}
[data-theme="light"] .plan-dot.active {
    background: var(--accent);
}

@media (max-width: 1024px) {
    .plan-slide { flex: 0 0 calc(100% / 3); }
}
@media (max-width: 480px) {
    .plan-slide { flex: 0 0 100%; }
}

.plan-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 56px 16px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
}
.plan-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 16px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
}
.plan-error .plan-retry {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 22px;
    background: var(--accent);
    color: #08090d;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
}
.plan-error .plan-retry:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px var(--accent-glow);
}

.plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: rgba(20, 22, 32, 0.65);
    backdrop-filter: blur(10px) saturate(1.1);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 26px 56px;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    overflow: hidden;
}
/* 背景图层 */
.plan-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    z-index: 0;
    transition: transform 0.6s ease;
}
.plan-card:hover .plan-card-bg {
    transform: scale(1.06);
}
/* 遮罩层: 底部深色渐变保证文字可读 */
.plan-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(10, 12, 18, 0.55) 0%,
        rgba(10, 12, 18, 0.75) 50%,
        rgba(10, 12, 18, 0.92) 100%);
    z-index: 0;
}
[data-theme="light"] .plan-card-overlay {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(245, 246, 250, 0.75) 50%,
        rgba(240, 242, 248, 0.92) 100%);
}
/* 有背景图时卡片自身背景透明 */
.plan-card[data-bg] {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
/* 卡片内所有直接子元素提升到背景上方 */
.plan-card > *:not(.plan-card-bg):not(.plan-card-overlay) {
    position: relative;
    z-index: 1;
}
[data-theme="light"] .plan-card {
    background: rgba(255, 255, 255, 0.7);
}
.plan-card:hover {
    transform: translateY(-4px);
    border-color: var(--pt-accent-dim, rgba(0, 229, 160, 0.25));
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.plan-card:hover .plan-icon-wrap {
    transform: scale(1.08) translateY(-2px);
}
.plan-card:hover .plan-card-glow {
    opacity: 1;
}

/* 顶部装饰光条 */
.plan-card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.6;
    transition: opacity var(--transition);
}
.plan-card.featured .plan-card-glow {
    background: linear-gradient(90deg, transparent, var(--pt-accent, var(--accent)), var(--pt-accent, var(--accent)), transparent);
    height: 4px;
    opacity: 1;
    box-shadow: 0 0 16px var(--pt-accent-glow, var(--accent-glow));
}
.plan-card.premium .plan-card-glow {
    background: linear-gradient(90deg, transparent, var(--pt-accent, var(--secondary)), var(--pt-accent, var(--secondary)), transparent);
    height: 4px;
    opacity: 1;
    box-shadow: 0 0 16px var(--pt-accent-glow, rgba(255, 140, 56, 0.4));
}

/* 方案图标容器 */
.plan-icon-wrap {
    overflow: hidden;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px auto 18px;
    background: var(--accent-dim);
    border: 1px solid rgba(0, 229, 160, 0.2);
    transition: transform var(--transition);
    position: relative;
}
.plan-icon-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, transparent 60%, var(--pt-accent-dim, var(--accent-dim)) 100%);
    pointer-events: none;
    z-index: 1;
}


.plan-icon-wrap i {
    position: relative;
    z-index: 0;
    font-size: 28px;
    color: var(--accent);
}
.plan-card.featured .plan-icon-wrap {
    background: linear-gradient(135deg, var(--pt-accent-dim, rgba(0, 229, 160, 0.2)), rgba(0, 229, 160, 0.08));
    border-color: var(--pt-accent, var(--accent));
    box-shadow: 0 4px 20px var(--pt-accent-glow, var(--accent-glow));
}
.plan-card.featured .plan-icon-wrap i {
    color: var(--pt-accent, var(--accent));
}
.plan-card.premium .plan-icon-wrap {
    background: linear-gradient(135deg, var(--pt-accent-dim, rgba(255, 140, 56, 0.2)), rgba(255, 140, 56, 0.08));
    border-color: var(--pt-accent, var(--secondary));
    box-shadow: 0 4px 20px var(--pt-accent-glow, rgba(255, 140, 56, 0.25));
}
.plan-card.premium .plan-icon-wrap i {
    color: var(--pt-accent, var(--secondary));
}
/* 白天主题下订阅卡片保持暗色主题配色不变 */
[data-theme="light"] #subscribe {
    --accent: #00e5a0;
    --accent-dim: rgba(0,229,160,0.12);
    --accent-glow: rgba(0,229,160,0.25);
    --secondary: #ff8c38;
    --secondary-dim: rgba(255,140,56,0.12);
    --text-primary: #e8e6e3;
    --text-secondary: #9a9bb0;
    --text-muted: #5c5e72;
    --border: #1e2235;
    --surface: #141620;
}
/* 白天主题下卡片遮罩层和背景也保持暗色 */
[data-theme="light"] #subscribe .plan-card-overlay {
    background: linear-gradient(180deg,
        rgba(10, 12, 18, 0.55) 0%,
        rgba(10, 12, 18, 0.75) 50%,
        rgba(10, 12, 18, 0.92) 100%);
}
[data-theme="light"] #subscribe .plan-card {
    background: rgba(20, 22, 32, 0.65);
}
[data-theme="light"] #subscribe .plan-loading,
[data-theme="light"] #subscribe .plan-error { color: #3f4357; }

/* Featured (推荐): highlighted border + glow */
.plan-card.featured {
    border-color: var(--pt-border, var(--pt-accent, var(--accent)));
    box-shadow: 0 0 0 1px var(--pt-accent-glow, var(--accent-glow)), 0 10px 40px rgba(0, 229, 160, 0.12);
}
.plan-card.featured:hover {
    box-shadow: 0 0 0 1px var(--pt-border, var(--pt-accent, var(--accent))), 0 16px 48px rgba(0, 229, 160, 0.22);
}

/* Premium (热门): secondary accent */
.plan-card.premium {
    border-color: var(--pt-border, var(--pt-accent, var(--secondary)));
    box-shadow: 0 0 0 1px var(--pt-accent-glow, rgba(255, 140, 56, 0.18)), 0 10px 40px rgba(255, 140, 56, 0.1);
}
.plan-card.premium:hover {
    box-shadow: 0 0 0 1px var(--pt-border, var(--pt-accent, var(--secondary))), 0 16px 48px rgba(255, 140, 56, 0.2);
}

/* Day (天卡): Captain Teemo — 蓝色主题 */
.plan-card.day {
    border-color: var(--pt-border, var(--pt-accent, #4dabf7));
    box-shadow: 0 0 0 1px var(--pt-accent-glow, rgba(77, 171, 247, 0.18)), 0 10px 40px rgba(77, 171, 247, 0.1);
}
.plan-card.day:hover {
    box-shadow: 0 0 0 1px var(--pt-border, var(--pt-accent, #4dabf7)), 0 16px 48px rgba(77, 171, 247, 0.2);
}
.plan-card.day .plan-card-glow {
    background: linear-gradient(90deg, transparent, var(--pt-accent, #4dabf7), var(--pt-accent, #4dabf7), transparent);
    height: 4px;
    opacity: 1;
    box-shadow: 0 0 16px var(--pt-accent-glow, rgba(77, 171, 247, 0.4));
}
.plan-card.day .plan-icon-wrap {
    background: linear-gradient(135deg, var(--pt-accent-dim, rgba(77, 171, 247, 0.2)), rgba(77, 171, 247, 0.08));
    border-color: var(--pt-accent, #4dabf7);
    box-shadow: 0 4px 20px var(--pt-accent-glow, rgba(77, 171, 247, 0.25));
}
.plan-card.day .plan-icon-wrap i {
    color: var(--pt-accent, #4dabf7);
}
.plan-card.day .plan-price .price-amount {
    color: #4dabf7;
}
.plan-card.day .plan-features li::before {
    background-color: rgba(77, 171, 247, 0.12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234dabf7' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
.plan-card.day .plan-btn {
    border-color: var(--pt-btn-bg, #4dabf7);
    background: var(--pt-btn-bg, #4dabf7);
    color: #08090d;
    box-shadow: 0 2px 16px rgba(77, 171, 247, 0.3);
}
.plan-card.day .plan-btn:hover {
    box-shadow: 0 6px 28px var(--pt-accent-glow, rgba(77, 171, 247, 0.45));
}

/* Week (周卡): Kai'Sa — 紫色主题 */
.plan-card.week {
    border-color: var(--pt-border, var(--pt-accent, #b366ff));
    box-shadow: 0 0 0 1px rgba(179, 102, 255, 0.18), 0 10px 40px rgba(179, 102, 255, 0.1);
}
.plan-card.week:hover {
    box-shadow: 0 0 0 1px var(--pt-border, var(--pt-accent, #b366ff)), 0 16px 48px rgba(179, 102, 255, 0.2);
}
.plan-card.week .plan-card-glow {
    background: linear-gradient(90deg, transparent, var(--pt-accent, #b366ff), var(--pt-accent, #b366ff), transparent);
    height: 4px;
    opacity: 1;
    box-shadow: 0 0 16px rgba(179, 102, 255, 0.4);
}
.plan-card.week .plan-icon-wrap {
    background: linear-gradient(135deg, var(--pt-accent-dim, rgba(179, 102, 255, 0.2)), rgba(179, 102, 255, 0.08));
    border-color: var(--pt-accent, #b366ff);
    box-shadow: 0 4px 20px var(--pt-accent-glow, rgba(179, 102, 255, 0.25));
}
.plan-card.week .plan-icon-wrap i {
    color: var(--pt-accent, #b366ff);
}
.plan-card.week .plan-price .price-amount {
    color: var(--pt-accent, #b366ff);
}
.plan-card.week .plan-features li::before {
    background-color: var(--pt-accent-dim, rgba(179, 102, 255, 0.12));
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b366ff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
.plan-card.week .plan-btn {
    border-color: var(--pt-btn-bg, #b366ff);
    background: var(--pt-btn-bg, #b366ff);
    color: #08090d;
    box-shadow: 0 2px 16px rgba(179, 102, 255, 0.3);
}
.plan-card.week .plan-btn:hover {
    box-shadow: 0 6px 28px var(--pt-accent-glow, rgba(179, 102, 255, 0.45));
}

.plan-badge {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 12px;
    border-radius: 0 0 12px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.4;
    z-index: 3;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.plan-badge.badge-featured {
    background: var(--accent);
    color: #08090d;
    box-shadow: 0 2px 10px var(--accent-glow);
}
.plan-badge.badge-premium {
    background: var(--secondary);
    color: #08090d;
    box-shadow: 0 2px 10px rgba(255, 140, 56, 0.3);
}
.plan-badge.badge-normal {
    background: var(--accent-dim);
    color: var(--accent);
}
.plan-badge.badge-day {
    background: #4dabf7;
    color: #08090d;
    box-shadow: 0 2px 10px rgba(77, 171, 247, 0.3);
}
.plan-badge.badge-week {
    background: #b366ff;
    color: #08090d;
    box-shadow: 0 2px 10px rgba(179, 102, 255, 0.3);
}

.plan-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
    padding-right: 64px;
    letter-spacing: -0.01em;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
}
.plan-price .price-symbol {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.plan-price .price-amount {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--accent);
    line-height: 1;
}
.plan-card.premium .plan-price .price-amount {
    color: var(--secondary);
}
[data-theme="light"] .plan-price .price-symbol,
[data-theme="light"] .plan-price .price-amount {
    /* keep accent but ensure weight */
    font-weight: 800;
}
.price-suffix {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 4px;
}

.plan-duration {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 22px;
}

.plan-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 11px;
    min-height: 165px;
    margin: 0 0 26px 0;
    padding: 22px 0 0;
    border-top: 1px solid var(--border);
    flex: 1;
}
.plan-features li {
    position: relative;
    padding-left: 26px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.55;
}
.plan-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-dim);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300e5a0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px 12px;
}
.plan-card.premium .plan-features li::before {
    background-color: var(--secondary-dim);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ff8c38' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.plan-stock {
    --stock-color: var(--accent);
    --stock-bg: var(--accent-dim);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    min-height: 26px;
    padding: 3px 9px;
    border: 1px solid color-mix(in srgb, var(--stock-color) 28%, transparent);
    border-radius: var(--radius-sm);
    background: var(--stock-bg);
    font-size: 12px;
    font-weight: 600;
    color: var(--stock-color);
    margin: 0 0 12px;
}
.plan-stock[hidden] { display: none; }
.plan-stock .stock-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--stock-color);
    box-shadow: 0 0 8px color-mix(in srgb, var(--stock-color) 55%, transparent);
}
.plan-stock .stock-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.plan-stock.high { --stock-color: var(--accent); --stock-bg: var(--accent-dim); }
.plan-stock.enough { --stock-color: #38bdf8; --stock-bg: rgba(56, 189, 248, 0.1); }
.plan-stock.normal { --stock-color: #94a3b8; --stock-bg: rgba(148, 163, 184, 0.1); }
.plan-stock.low { --stock-color: var(--warning); --stock-bg: var(--warning-dim); }
.plan-stock.out { --stock-color: var(--danger); --stock-bg: rgba(255, 77, 106, 0.1); }

.plan-btn {
    width: 100%;
    padding: 13px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    border: 1px solid var(--pt-btn-bg, var(--accent));
    background: var(--pt-btn-bg, var(--accent));
    color: #08090d;
    transition: all var(--transition);
    letter-spacing: 0.2px;
    box-shadow: 0 2px 16px var(--pt-accent-glow, var(--accent-glow));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.plan-btn i {
    font-size: 18px;
}
.plan-card.premium .plan-btn {
    border-color: var(--pt-btn-bg, var(--secondary));
    background: var(--pt-btn-bg, var(--secondary));
    color: #08090d;
    box-shadow: 0 2px 16px var(--pt-accent-glow, rgba(255, 140, 56, 0.3));
}
.plan-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px var(--pt-accent-glow, rgba(0, 229, 160, 0.4));
}
.plan-card.premium .plan-btn:hover {
    box-shadow: 0 6px 28px var(--pt-accent-glow, rgba(255, 140, 56, 0.45));
}
.plan-btn:active { transform: translateY(0); }
.plan-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background: var(--surface-hover);
    color: var(--text-secondary);
    border-color: var(--border);
}

.plan-btn-forbidden {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    filter: blur(0.4px);
    box-shadow: 0 2px 16px rgba(239, 68, 68, 0.2);
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    transition: opacity 0.3s ease, filter 0.3s ease;
}
.plan-btn-forbidden:hover {
    opacity: 0.65;
    filter: blur(0.2px);
}


/* ============================================
   PLAN CARD THEME SYSTEM (data-plan-theme)
   ============================================ */

/* --- 公共变量桥接 + 卡片外边框色 --- */
.plan-card[data-plan-theme] {
    --pt-accent: var(--accent, #00e5a0);
    --pt-accent-dim: var(--accent-dim, rgba(0,229,160,0.12));
    --pt-accent-glow: var(--accent-glow, rgba(0,229,160,0.25));
    --pt-btn-bg: var(--pt-accent, #00e5a0);
    --pt-btn-text: #08090d;
    border: 1px solid var(--pt-border, var(--pt-accent-dim));
    transition: border-color 0.3s ease;
}
.plan-card[data-plan-theme]:hover {
    border-color: var(--pt-border, var(--pt-accent));
}

/* --- 翠绿 Emerald (默认) --- */
.plan-card[data-plan-theme=emerald] {
    --pt-accent: #00e5a0;
    --pt-accent-dim: rgba(0,229,160,0.12);
    --pt-accent-glow: rgba(0,229,160,0.25);
    --pt-btn-bg: #00e5a0;
    --pt-btn-text: #08090d;
}

/* --- 海蓝 Ocean --- */
.plan-card[data-plan-theme=ocean] {
    --pt-accent: #3b82f6;
    --pt-accent-dim: rgba(59,130,246,0.12);
    --pt-accent-glow: rgba(59,130,246,0.25);
    --pt-btn-bg: #3b82f6;
    --pt-btn-text: #ffffff;
}

/* --- 罗兰紫 Amethyst --- */
.plan-card[data-plan-theme=amethyst] {
    --pt-accent: #a855f7;
    --pt-accent-dim: rgba(168,85,247,0.12);
    --pt-accent-glow: rgba(168,85,247,0.25);
    --pt-btn-bg: #a855f7;
    --pt-btn-text: #ffffff;
}

/* --- 日落橙 Sunset --- */
.plan-card[data-plan-theme=sunset] {
    --pt-accent: #f97316;
    --pt-accent-dim: rgba(249,115,22,0.12);
    --pt-accent-glow: rgba(249,115,22,0.25);
    --pt-btn-bg: #f97316;
    --pt-btn-text: #08090d;
}

/* --- 玫瑰粉 Rose --- */
.plan-card[data-plan-theme=rose] {
    --pt-accent: #ec4899;
    --pt-accent-dim: rgba(236,72,153,0.12);
    --pt-accent-glow: rgba(236,72,153,0.25);
    --pt-btn-bg: #ec4899;
    --pt-btn-text: #ffffff;
}

/* --- 暗夜金 Gold --- */
.plan-card[data-plan-theme=gold] {
    --pt-accent: #eab308;
    --pt-accent-dim: rgba(234,179,8,0.12);
    --pt-accent-glow: rgba(234,179,8,0.25);
    --pt-btn-bg: #eab308;
    --pt-btn-text: #08090d;
}

/* --- 应用主题色到所有卡片元素 --- */
.plan-card[data-plan-theme] .plan-card-glow {
    background: linear-gradient(90deg, transparent, var(--pt-accent), var(--pt-accent), transparent);
    height: 4px;
    opacity: 1;
    box-shadow: 0 0 16px var(--pt-accent-glow);
}
.plan-card[data-plan-theme] .plan-icon-wrap {
    background: linear-gradient(135deg, var(--pt-accent-dim), rgba(0,0,0,0.08));
    overflow: hidden;
    border-color: var(--pt-accent);
    box-shadow: 0 4px 20px var(--pt-accent-glow);
}
.plan-card[data-plan-theme] .plan-icon-wrap i {
    color: var(--pt-accent);
}
.plan-card[data-plan-theme] .plan-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    filter: drop-shadow(0 0 6px var(--pt-accent-glow));
    position: relative;
    z-index: 0;
}


}
.plan-card[data-plan-theme] .plan-features li::before {
    background-color: var(--pt-accent-dim);
}
/* 动态生成勾号 SVG（用 mask 方式，兼容所有主题） */
.plan-card[data-plan-theme] .plan-features li::after {
    content: ✓;
    position: absolute;
    left: 2px;
    top: 0;
    color: var(--pt-accent);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
}
.plan-card[data-plan-theme] .plan-btn {
    border-color: var(--pt-btn-bg);
    background: var(--pt-btn-bg);
    color: var(--pt-btn-text);
    box-shadow: 0 2px 16px var(--pt-accent-glow);
}
.plan-card[data-plan-theme] .plan-btn:hover {
    box-shadow: 0 6px 28px var(--pt-accent-glow);
}
.plan-card[data-plan-theme] .plan-badge.badge-normal {
    background: var(--pt-accent-dim);
    color: var(--pt-accent);
}
.plan-card[data-plan-theme] .plan-badge.badge-featured {
    background: var(--pt-accent);
    color: var(--pt-btn-text);
    box-shadow: 0 2px 10px var(--pt-accent-glow);
}

/* 禁售按钮保持红色不变 */
.plan-card[data-plan-theme] .plan-btn.plan-btn-forbidden {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    box-shadow: 0 2px 16px rgba(239, 68, 68, 0.2) !important;
}

/* ============================================ */

/* ============================================
   PAYMENT MODAL
   ============================================ */
.pay-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999997;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.pay-modal-overlay.show { display: flex; }

.pay-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #0d1017;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 28px 26px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
    animation: payModalIn 0.28s ease;
    max-height: 92vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.pay-modal.is-query-modal { max-width: 700px; }
[data-theme="light"] .pay-modal {
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
@keyframes payModalIn {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes payCheckoutModalIn {
    from { opacity: 0; transform: translateY(14px) scale(0.69); }
    to { opacity: 1; transform: translateY(0) scale(0.72); }
}

.pay-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.15s;
    z-index: 3;
}
.pay-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}
[data-theme="light"] .pay-modal-close {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.6);
}
[data-theme="light"] .pay-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.9);
}

.pay-modal-title {
    font-size: 23px;
    font-weight: 800;
    color: #e8e6e3;
    margin-bottom: 6px;
}
[data-theme="light"] .pay-modal-title { color: #1a1d2e; }

.pay-modal-sub {
    font-size: 13px;
    font-weight: 500;
    color: #9a9bb0;
    margin-bottom: 22px;
}
[data-theme="light"] .pay-modal-sub { color: var(--text-secondary); }

.pay-plan-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 22px;
}
[data-theme="light"] .pay-plan-summary {
    background: rgba(0, 0, 0, 0.02);
}
.pay-plan-summary .pps-name {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    color: #e8e6e3;
}
.pay-plan-summary .pps-name small {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
[data-theme="light"] .pay-plan-summary .pps-name { color: #1a1d2e; }
.pay-plan-summary .pps-price {
    flex: 0 0 auto;
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
}

.pay-purchase-panel {
    margin: 0 0 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
}
[data-theme="light"] .pay-purchase-panel { background: rgba(0, 0, 0, 0.015); }
.pay-stock-row,
.pay-quantity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 48px;
    padding: 9px 12px;
}
.pay-stock-row {
    --checkout-stock: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.pay-stock-row.high { --checkout-stock: var(--accent); }
.pay-stock-row.enough { --checkout-stock: #38bdf8; }
.pay-stock-row.normal { --checkout-stock: #94a3b8; }
.pay-stock-row.low { --checkout-stock: var(--warning); }
.pay-stock-row.out { --checkout-stock: var(--danger); }
.pay-stock-label,
.pay-quantity-label {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}
.pay-stock-value {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: var(--checkout-stock);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}
.pay-stock-dot {
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--checkout-stock);
    box-shadow: 0 0 7px color-mix(in srgb, var(--checkout-stock) 60%, transparent);
}
.pay-quantity-row > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.pay-quantity-row small {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}
.pay-quantity-stepper {
    display: grid;
    grid-template-columns: 34px 42px 34px;
    flex: 0 0 110px;
    height: 34px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--input-bg);
}
.pay-quantity-stepper button,
.pay-quantity-stepper output {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
}
.pay-quantity-stepper button {
    cursor: pointer;
    color: var(--accent);
    font-size: 18px;
    font-weight: 700;
    transition: background 0.15s ease, color 0.15s ease;
}
.pay-quantity-stepper button:first-child { border-right: 1px solid var(--border); }
.pay-quantity-stepper button:last-child { border-left: 1px solid var(--border); }
.pay-quantity-stepper button:hover:not(:disabled) { background: var(--accent-dim); }
.pay-quantity-stepper button:disabled { color: var(--text-muted); cursor: not-allowed; opacity: 0.45; }
.pay-quantity-stepper output { font-size: 14px; font-weight: 800; }

.pay-fee-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 16px;
    padding: 12px 14px;
    background: color-mix(in srgb, var(--accent) 6%, var(--input-bg));
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
    border-radius: 8px;
}
.pay-fee-breakdown > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}
.pay-fee-breakdown .fee-charge { color: var(--warning); }
.pay-fee-breakdown .fee-total {
    padding-top: 6px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.pay-field { margin-bottom: 18px; }
.pay-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #e8e6e3;
    margin-bottom: 8px;
}
[data-theme="light"] .pay-field label { color: #1a1d2e; }
.pay-field input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #e8e6e3;
    font-size: 15px;
    font-weight: 500;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.pay-field input::placeholder { color: #5c5e72; font-weight: 500; }
.pay-field input:focus { border-color: var(--accent); }
[data-theme="light"] .pay-field input {
    background: #ffffff;
    color: #1a1d2e;
    border-color: #e2e4ea;
}
[data-theme="light"] .pay-field input::placeholder { color: var(--text-muted); }
[data-theme="light"] .pay-field input:focus { border-color: var(--accent); }

.pay-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
}
.pay-method {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.15s;
}
[data-theme="light"] .pay-method { background: rgba(0, 0, 0, 0.01); }
.pay-method:hover { border-color: rgba(0, 229, 160, 0.4); }
.pay-method.active {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 0 1px var(--accent);
}
.pay-method .pm-icon {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 10px;
    font-size: 26px;
    line-height: 1;
}
.pay-method .pm-icon-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 20px;
    font-weight: 700;
}
.pay-method .pm-name {
    font-size: 14px;
    font-weight: 700;
    color: #e8e6e3;
}
[data-theme="light"] .pay-method .pm-name { color: #1a1d2e; }

.pay-submit-btn {
    width: 100%;
    padding: 14px;
    margin-top: 24px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #08090d;
    font-size: 19px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 16px var(--accent-glow);
}
.pay-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(0, 229, 160, 0.4);
}
.pay-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pay-form-grid {
    display: block;
}

/* Tablet / desktop: two-column payment form */
@media (min-width: 768px) {
    /* 保留确认订阅原有的宽屏双栏排版，再整体等比缩小，避免支付方式换行。 */
    .pay-modal.is-checkout-modal {
        max-width: 1040px;
        max-height: calc(100vh - 48px);
        padding: 28px 32px 24px;
        animation: payCheckoutModalIn 0.28s ease;
    }
    .pay-modal.is-checkout-modal .pay-modal-sub { margin-bottom: 16px; }
    .pay-form-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto auto auto auto auto;
        column-gap: 30px;
        align-items: start;
    }
    .pay-form-grid .pay-plan-summary,
    .pay-form-grid .pay-purchase-panel,
    .pay-form-grid .pay-fee-breakdown { margin-bottom: 12px; }
    .pay-form-grid .pay-plan-summary {
        grid-column: 1;
        grid-row: 1;
        margin-bottom: 16px;
    }
    .pay-form-grid .pay-fee-breakdown {
        grid-column: 1;
        grid-row: 3;
    }
    .pay-form-grid .pay-purchase-panel {
        grid-column: 1;
        grid-row: 2;
    }
    .pay-form-grid .pay-field-methods {
        grid-column: 1;
        grid-row: 4;
        margin-bottom: 0;
    }
    .pay-form-grid .pay-field-contact {
        grid-column: 2;
        grid-row: 1;
        margin-bottom: 14px;
    }
    .pay-form-grid .pay-field-password {
        grid-column: 2;
        grid-row: 2;
        margin-bottom: 14px;
    }
    .pay-form-grid .pay-field-captcha {
        grid-column: 2;
        grid-row: 3;
        margin-bottom: 0;
    }
    .pay-form-grid .pay-error-msg {
        grid-column: 2;
        grid-row: 5;
        margin-top: 2px;
    }
    .pay-form-grid .pay-submit-btn {
        grid-column: 2;
        grid-row: 4;
        align-self: end;
        min-height: 104px;
        padding: 24px 18px;
        margin-top: 0;
        font-size: 22px;
        letter-spacing: .01em;
    }
}
.pay-modal.is-query-modal #queryTurnstileBox { width: 100%; min-height: 76px; }

.pay-error-msg {
    display: none;
    margin-top: 14px;
    padding: 10px 14px;
    background: rgba(255, 77, 106, 0.1);
    border: 1px solid rgba(255, 77, 106, 0.3);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--danger);
}

/* QR state */
.pay-qr-state { text-align: center; }
.pay-qr-state .qr-amount {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}
.pay-qr-state .qr-hint {
    font-size: 13px;
    font-weight: 600;
    color: #9a9bb0;
    margin-bottom: 20px;
}
.pay-qr-state .qr-pay-name {
    display: inline-block;
    font-weight: 800;
    letter-spacing: 0.01em;
}
.pay-qr-state .qr-pay-name.alipay { color: #1677ff; }
.pay-qr-state .qr-pay-name.wechat { color: #07c160; }
[data-theme="light"] .pay-qr-state .qr-hint { color: #555870; }
.qr-img-wrap {
    display: flex;
    justify-content: center;
    padding: 16px;
    background: #ffffff;
    border-radius: 12px;
    width: 232px;
    height: 232px;
    margin: 0 auto 20px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
.qr-img-wrap img {
    width: 200px;
    height: 200px;
    display: block;
}
.qr-loading-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 232px;
    height: 232px;
    margin: 0 auto 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: #9a9bb0;
    font-size: 14px;
    font-weight: 600;
}
.pay-polling {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #e8e6e3;
    margin-bottom: 18px;
}
[data-theme="light"] .pay-polling { color: #1a1d2e; }
.pay-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 229, 160, 0.18);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: paySpin 0.7s linear infinite;
}
@keyframes paySpin { to { transform: rotate(360deg); } }
.pay-cancel-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: #9a9bb0;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition);
}
.pay-cancel-btn:hover { background: var(--surface-hover); color: #e8e6e3; }
[data-theme="light"] .pay-cancel-btn:hover { color: #1a1d2e; }

/* Success state */
.pay-success-state { text-align: center; padding-top: 4px; }
.pay-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    border: 2px solid var(--accent);
}
.pay-success-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 6px;
}
.pay-success-sub {
    font-size: 13px;
    font-weight: 600;
    color: #9a9bb0;
    margin-bottom: 22px;
}
[data-theme="light"] .pay-success-sub { color: #555870; }
.pay-card-key-box {
    background: rgba(0, 229, 160, 0.06);
    border: 1px solid rgba(0, 229, 160, 0.25);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}
.pay-card-key-label {
    font-size: 12px;
    font-weight: 700;
    color: #9a9bb0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}
[data-theme="light"] .pay-card-key-label { color: #555870; }
.pay-card-key-value {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: #e8e6e3;
    word-break: break-all;
    line-height: 1.5;
}
[data-theme="light"] .pay-card-key-value { color: #1a1d2e; }
.pay-card-key-item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 9px 0;
    border-top: 1px solid var(--border);
}
.pay-card-key-item:first-child { border-top: 0; padding-top: 0; }
.pay-card-key-item:last-child { padding-bottom: 0; }
.pay-card-key-item > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 800;
}
.pay-card-key-item > strong {
    min-width: 0;
    color: inherit;
    font: inherit;
    word-break: break-all;
}

/* 批量发卡：宽屏双列展示，避免大量卡密把成功弹窗拉成长条。 */
.pay-modal.is-bulk-success-modal {
    max-width: 760px;
    padding: 28px 30px 24px;
}
.pay-modal.is-bulk-success-modal .pay-success-state { text-align: left; }
.pay-modal.is-bulk-success-modal .pay-success-icon,
.pay-modal.is-bulk-success-modal .pay-success-title,
.pay-modal.is-bulk-success-modal .pay-success-sub { text-align: center; }
.pay-modal.is-bulk-success-modal .pay-card-key-box {
    padding: 14px;
    margin-bottom: 14px;
}
.pay-modal.is-bulk-success-modal .pay-card-key-label { margin-bottom: 10px; }
.pay-modal.is-bulk-success-modal .pay-card-key-value {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    max-height: min(52vh, 520px);
    overflow-y: auto;
    padding: 1px 5px 1px 1px;
    scrollbar-width: thin;
}
.pay-modal.is-bulk-success-modal .pay-card-key-item {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    gap: 8px;
}
.pay-modal.is-bulk-success-modal .pay-card-key-item:first-child,
.pay-modal.is-bulk-success-modal .pay-card-key-item:last-child { padding-top: 9px; padding-bottom: 9px; }
.pay-modal.is-bulk-success-modal .pay-card-key-item > strong {
    font-size: 14px;
    line-height: 1.4;
}
[data-theme="light"] .pay-modal.is-bulk-success-modal .pay-card-key-item { background: rgba(15, 23, 42, 0.025); }
.pay-success-actions {
    display: flex;
    gap: 10px;
}
.pay-success-actions .pay-copy-btn,
.pay-success-actions .pay-done-btn {
    width: auto;
    flex: 1 1 0;
    margin-bottom: 0;
}
.pay-order-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    min-height: 38px;
    margin: 14px auto 0;
    padding: 8px 15px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.035);
    color: #9a9bb0;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.pay-order-copy:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent);
    transform: translateY(-1px);
}
.pay-order-copy-label,
.pay-order-copy-hint {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
}
.pay-order-copy-label { color: #9a9bb0; }
.pay-order-copy-hint { color: var(--accent); }
.pay-order-copy strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #e8e6e3;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.015em;
}
.pay-order-copy.copied {
    border-color: var(--accent);
    background: var(--accent-dim);
}
[data-theme="light"] .pay-order-copy { background: rgba(15, 23, 42, 0.035); color: #555870; }
[data-theme="light"] .pay-order-copy-label { color: #555870; }
[data-theme="light"] .pay-order-copy strong { color: #1a1d2e; }

@media (max-width: 767px) {
    .pay-modal.is-bulk-success-modal {
        max-width: calc(100vw - 16px);
        padding: 22px 18px 18px;
    }
    .pay-modal.is-bulk-success-modal .pay-card-key-value {
        grid-template-columns: 1fr;
        max-height: 52vh;
    }
    .pay-order-copy { width: 100%; }
}

.pay-copy-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #08090d;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 16px var(--accent-glow);
    margin-bottom: 10px;
}
.pay-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(0, 229, 160, 0.4);
}
.pay-copy-btn.copied {
    background: var(--surface-hover);
    color: var(--accent);
    box-shadow: none;
}
.pay-done-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: #9a9bb0;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition);
}
.pay-done-btn:hover { background: var(--surface-hover); color: #e8e6e3; }
[data-theme="light"] .pay-done-btn:hover { color: #1a1d2e; }

/* Error state */
.pay-error-state { text-align: center; padding-top: 6px; }
.pay-error-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(255, 77, 106, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    border: 2px solid var(--danger);
}
.pay-error-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--danger);
    margin-bottom: 6px;
}
.pay-error-detail {
    font-size: 13px;
    font-weight: 600;
    color: #9a9bb0;
    margin-bottom: 22px;
    line-height: 1.6;
}
[data-theme="light"] .pay-error-detail { color: #555870; }
.pay-retry-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #08090d;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 10px;
    box-shadow: 0 2px 16px var(--accent-glow);
}
.pay-retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(0, 229, 160, 0.4);
}

/* Responsive */
/* iPad Pro 横屏（11"=1194px / 12.9"=1366px）及大屏触屏平板：
   触屏设备（pointer: coarse）在 1366px 内统一走平板紧凑布局 */
@media (max-width: 1366px) and (pointer: coarse) {
    .plans-grid { grid-template-columns: repeat(3, 1fr); }
    .plan-card { padding: 24px 20px 30px; }
    .plan-icon-wrap { width: 48px; height: 48px; border-radius: 14px; margin: 4px auto 12px; }
    .plan-icon-wrap i { font-size: 22px; }
    .plan-name { font-size: 18px; margin-bottom: 6px; }
    .plan-price .price-amount { font-size: 34px; }
    .plan-duration { font-size: 13px; margin-bottom: 12px; }
    .plan-features { gap: 8px; min-height: 120px; margin-bottom: 18px; padding-top: 14px; }
    .plan-features li { font-size: 13px; line-height: 1.5; }
    .plan-stock { margin-bottom: 10px; }
    .plan-btn { padding: 11px 16px; font-size: 14px; }
}
@media (max-width: 1024px) {
    .plans-grid { grid-template-columns: repeat(3, 1fr); }
    /* iPad 竖屏 / 平板：订阅卡片适度紧凑 */
    .plan-card { padding: 24px 20px 30px; }
    .plan-icon-wrap { width: 48px; height: 48px; border-radius: 14px; margin: 4px auto 12px; }
    .plan-icon-wrap i { font-size: 22px; }
    .plan-name { font-size: 18px; margin-bottom: 6px; }
    .plan-duration { margin-bottom: 12px; }
    .plan-features { gap: 8px; min-height: 120px; margin-bottom: 18px; padding-top: 14px; }
    .plan-features li { font-size: 13px; line-height: 1.5; }
    .plan-stock { margin-bottom: 10px; }
    .plan-btn { padding: 11px 16px; font-size: 14px; }
}
@media (max-width: 768px) {
    .plans-grid { grid-template-columns: repeat(2, 1fr); }
    .plan-card { padding: 22px 18px 24px; }
    .plan-icon-wrap { width: 44px; height: 44px; border-radius: 12px; margin: 2px auto 10px; }
    .plan-icon-wrap i { font-size: 20px; }
    .plan-name { font-size: 16px; margin-bottom: 4px; }
    .plan-price .price-symbol { font-size: 14px; }
    .plan-price .price-amount { font-size: 30px; }
    .price-suffix { font-size: 11px; }
    .plan-duration { font-size: 12px; margin-bottom: 10px; }
    .plan-features { gap: 6px; min-height: 105px; margin: 0 0 14px 0; padding: 12px 0 0; }
    .plan-features li { font-size: 12px; line-height: 1.45; padding-left: 22px; }
    .plan-stock { font-size: 11px; margin-bottom: 8px; }
    .plan-btn { padding: 10px 14px; font-size: 13px; }
    .plan-badge { font-size: 10px; padding: 2px 10px; }
}
@media (max-width: 480px) {
    .plans-grid { grid-template-columns: 1fr; max-width: 440px; margin-left: auto; margin-right: auto; gap: 16px; }
    /* 手机端订阅卡片紧凑化：降低卡片高度 */
    .plan-card { padding: 20px 20px 24px; }
    .plan-icon-wrap { width: 42px; height: 42px; border-radius: 12px; margin: 2px auto 10px; }
    .plan-icon-wrap i { font-size: 20px; }
    .plan-name { font-size: 16px; margin-bottom: 4px; }
    .plan-price .price-symbol { font-size: 14px; }
    .plan-price .price-amount { font-size: 32px; }
    .price-suffix { font-size: 11px; }
    .plan-duration { font-size: 12px; margin-bottom: 10px; }
    .plan-features { gap: 6px; min-height: 96px; margin: 0 0 14px 0; padding: 12px 0 0; }
    .plan-features li { font-size: 13px; line-height: 1.45; padding-left: 22px; }
    .plan-stock { font-size: 11px; margin-bottom: 8px; }
    .plan-btn { padding: 10px 16px; font-size: 14px; }
    .plan-badge { font-size: 10px; padding: 2px 10px; }
    .pay-modal-overlay { padding: 8px; align-items: center; }
    .pay-modal { padding: 16px 14px 12px; padding-bottom: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); max-height: calc(100svh - 16px); }
    #payModalBody { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
    .pay-modal-title { font-size: 18px; margin-bottom: 2px; }
    .pay-modal-sub { font-size: 12px; margin-bottom: 10px; }
    .pay-plan-summary { padding: 9px 11px; margin-bottom: 8px; }
    .pay-plan-summary .pps-name { font-size: 13px; }
    .pay-plan-summary .pps-price { font-size: 18px; }
    .pay-fee-breakdown { margin: 6px 0 !important; padding: 6px 10px !important; gap: 2px !important; }
    .pay-fee-breakdown div { font-size: 11px !important; }
    .pay-field { margin-bottom: 9px; }
    .pay-field label { font-size: 11px; margin-bottom: 5px; }
    .pay-field input { padding: 10px 11px; font-size: 14px; }
    .pay-methods { gap: 6px; }
    .pay-method { padding: 9px 6px; gap: 3px; }
    .pay-method .pm-icon { width: 30px !important; height: 30px !important; font-size: 15px !important; border-radius: 8px !important; }
    .pay-method .pm-name { font-size: 13px; }
    .pay-field-captcha img { width: 96px !important; height: 34px !important; }
    .pay-submit-btn { position: sticky; bottom: 0; z-index: 5; padding: 12px; margin-top: 10px; font-size: 15px; box-shadow: 0 -12px 18px -12px rgba(0,0,0,0.9); }
    .pay-form-grid { display: flex; flex-wrap: wrap; gap: 0 10px; }
    .pay-plan-summary, .pay-fee-breakdown, .pay-field-methods, .pay-field-captcha, .pay-error-msg, .pay-submit-btn { width: 100%; }
    .pay-field-contact, .pay-field-password { width: calc(50% - 5px); }
    .pay-label-hint { display: none; }
    .qr-img-wrap, .qr-loading-box { width: 200px; height: 200px; }
    .qr-img-wrap img { width: 168px; height: 168px; }
}

/* Short mobile screens: tighten spacing so the payment form fits */
@media (max-width: 480px) and (max-height: 640px) {
    .pay-modal { padding: 12px 12px 10px; padding-bottom: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
    .pay-modal-title { font-size: 17px; margin-bottom: 0; }
    .pay-modal-sub { font-size: 11px; margin-bottom: 8px; }
    .pay-plan-summary { padding: 8px 10px; margin-bottom: 6px; }
    .pay-fee-breakdown { margin: 4px 0 !important; padding: 5px 9px !important; gap: 2px !important; }
    .pay-field { margin-bottom: 7px; }
    .pay-field label { font-size: 11px; margin-bottom: 4px; }
    .pay-field input { padding: 9px 10px; font-size: 14px; }
    .pay-method { padding: 8px 6px; gap: 2px; }
    .pay-method .pm-icon { width: 28px !important; height: 28px !important; font-size: 14px !important; }
    .pay-method .pm-name { font-size: 12px; }
    .pay-field-captcha img { width: 90px !important; height: 32px !important; }
    .pay-submit-btn { padding: 11px; margin-top: 8px; }
}

/* ============================================
   ANNOUNCEMENT MODAL (from announcement.js)
   ============================================ */
.xm-ann-overlay{
      position:fixed;inset:0;z-index:999999;
      background:rgba(0,0,0,0.55);
      backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
      display:flex;align-items:center;justify-content:center;
      opacity:0;visibility:hidden;
      transition:opacity .3s ease,visibility .3s ease
    }
    .xm-ann-overlay.show{opacity:1;visibility:visible}
.xm-ann-modal{
      position:relative;
      width:var(--ann-w,min(580px,92vw));height:var(--ann-h,auto);
      max-height:85vh;max-height:min(85vh,85dvh);
      display:flex;flex-direction:column;
      border-radius:14px;overflow:hidden;
      transform:translateY(20px) scale(.97);opacity:0;
      transition:transform .35s cubic-bezier(.23,1,.32,1),opacity .3s ease;
  background:var(--surface,#0d1117);
      border:1px solid var(--border,rgba(0,229,160,.18));
      box-shadow:0 30px 80px rgba(0,0,0,.45),0 0 40px var(--accent-dim,rgba(0,229,160,.06))
    }
    .xm-ann-overlay.show .xm-ann-modal{transform:translateY(0) scale(1);opacity:1}
.xm-ann-titlebar{
      display:flex;align-items:center;gap:10px;
      padding:14px 48px 14px 20px;
      background:var(--bg,#08090d);
      border-bottom:1px solid var(--border,rgba(255,255,255,.06));
      flex-shrink:0;position:relative
    }
    .xm-ann-dots{display:flex;gap:6px}
    .xm-ann-dots span{width:10px;height:10px;border-radius:50%}
    .xm-ann-dots span:nth-child(1){background:#ff5f57}
    .xm-ann-dots span:nth-child(2){background:#febc2e}
    .xm-ann-dots span:nth-child(3){background:#28c840}
    .xm-ann-tab{
      display:flex;align-items:center;gap:6px;
      padding:5px 14px;border-radius:6px 6px 0 0;
      background:var(--surface,#0d1117);
      border:1px solid var(--border,rgba(255,255,255,.06));border-bottom:none;
      font-family:var(--font-mono,monospace);font-size:11.5px;
      color:var(--text-muted,#5c5e72);
      margin-left:12px;position:relative;top:1px
    }
    .xm-ann-tab .tab-icon{font-size:13px;color:var(--accent,#00e5a0)}
    .xm-ann-meta{flex:1;display:flex;align-items:center;gap:10px;margin-left:14px;justify-content:space-evenly}
    .xm-ann-version{
      font-family:var(--font-mono,monospace);font-size:10.5px;
      padding:3px 8px;border-radius:4px;
      background:rgba(0,229,160,.1);
      color:var(--accent,#00e5a0);
      border:1px solid rgba(0,229,160,.15)
    }
    .xm-ann-date{font-family:var(--font-mono,monospace);font-size:10.5px;color:var(--text-muted,#5c5e72)}
    .xm-ann-actions-right{display:flex;align-items:center;gap:10px;flex-shrink:0}
    .xm-ann-remain{
      font-family:var(--font-mono,monospace);font-size:10.5px;font-weight:600;
      padding:4px 10px;border-radius:999px;white-space:nowrap;
      color:var(--text-muted,#5c5e72);
      background:var(--surface,#0d1117);
      border:1px solid var(--border,#1e2235)
    }
.xm-ann-body{
      flex:1;overflow-y:auto;
      padding:20px 24px;font-size:13px;line-height:1.8;
      color:var(--text-muted,#9a9bb0)
    }
    .xm-ann-body::-webkit-scrollbar{width:5px}
    .xm-ann-body::-webkit-scrollbar-track{background:transparent}
    .xm-ann-body::-webkit-scrollbar-thumb{background:var(--border,#1e2235);border-radius:3px}
.xm-ann-heading{
      font-size:15px;font-weight:700;
      color:var(--text,#e6edf3);
      margin-bottom:16px;display:flex;align-items:center;gap:10px
    }
    .xm-ann-heading .hl-cmt{color:var(--accent,#6a9955);font-weight:400;font-size:13px}
.xm-ann-item{
      display:flex;align-items:flex-start;gap:12px;
      padding:10px 14px;border-radius:8px;margin-bottom:8px;
      background:var(--surface,rgba(255,255,255,.03));
      border:1px solid var(--border,rgba(255,255,255,.04));
      transition:background .2s ease,border-color .2s ease
    }
    .xm-ann-item:hover{
      background:var(--accent-dim,rgba(0,229,160,.04));
      border-color:var(--accent-glow,rgba(0,229,160,.12))
    }
    .xm-ann-line-num{
      font-size:11px;color:var(--text-muted,#5c5e72);
      min-width:20px;text-align:right;padding-top:1px;
      flex-shrink:0;user-select:none
    }
    .xm-ann-label{
      font-size:11px;font-weight:600;
      padding:2px 8px;border-radius:4px;
      flex-shrink:0;white-space:nowrap;letter-spacing:.03em
    }
    .xm-ann-label.type-info{
      background:rgba(86,156,214,.12);color:#569cd6;
      border:1px solid rgba(86,156,214,.18)
    }
    .xm-ann-label.type-feature{
      background:rgba(0,229,160,.1);
      color:var(--accent,#00e5a0);
      border:1px solid rgba(0,229,160,.15)
    }
    .xm-ann-label.type-warn{
      background:rgba(245,166,35,.1);
      color:#dcdcaa;
      border:1px solid rgba(245,166,35,.15)
    }
    .xm-ann-label.type-tip{
      background:rgba(124,108,240,.1);color:#c586c0;
      border:1px solid rgba(124,108,240,.15)
    }
    .xm-ann-text{
      flex:1;font-size:13px;
      color:var(--text-muted,#9a9bb0);
      line-height:1.8
    }
    .xm-ann-sep{height:1px;background:var(--border,#1e2235);margin:14px 0}
    .xm-ann-footer{font-size:11.5px;color:var(--accent,#6a9955);padding:0 4px;margin-top:4px}
/* 白天主题：标题改为纯黑，内容文字改为红色 */
    [data-theme="light"] .xm-ann-heading{color:#000000!important}
    [data-theme="light"] .xm-ann-body{color:#FF0000!important}
    [data-theme="light"] .xm-ann-text{color:#FF0000!important}
[data-theme="dark"] .xm-ann-body{color:#FFD700!important}
    [data-theme="dark"] .xm-ann-text{color:#FFD700!important}
.xm-ann-close{
      position:absolute;top:14px;right:16px;
      width:28px;height:28px;border-radius:6px;
      border:1px solid var(--border,rgba(255,255,255,.08));
      background:var(--surface,rgba(255,255,255,.03));
      color:var(--text-muted,#5c5e72);
      cursor:pointer;display:flex;align-items:center;justify-content:center;
      font-size:14px;transition:all .2s ease;z-index:2;outline:none;line-height:1
    }
    .xm-ann-close:hover{
      background:rgba(255,77,106,.12);color:#ff4d6a;
      border-color:rgba(255,77,106,.25)
    }
.xm-ann-actions{
      display:flex;align-items:center;justify-content:space-between;
      padding:14px 24px;
      border-top:1px solid var(--border,rgba(255,255,255,.06));
      flex-shrink:0
    }
    .xm-ann-remember{
      display:flex;align-items:center;gap:8px;
      font-size:12px;color:var(--text-muted,#5c5e72);
      cursor:pointer;user-select:none
    }
    .xm-ann-remember input{accent-color:var(--accent,#00e5a0);cursor:pointer}
    .xm-ann-ok{
      padding:8px 24px;border-radius:8px;
      border:1px solid var(--accent-glow,rgba(0,229,160,.25));
      background:rgba(0,229,160,.1);
      color:var(--accent,#00e5a0);
      font-family:var(--font-mono,monospace);font-size:12.5px;font-weight:600;
      cursor:pointer;transition:all .2s ease;outline:none
    }
    .xm-ann-ok:hover{
      background:rgba(0,229,160,.2);
      border-color:rgba(0,229,160,.4);
      transform:translateY(-1px);
      box-shadow:0 4px 16px rgba(0,229,160,.15)
    }
    .xm-ann-ok:active{transform:translateY(0)}
/* ===== 公告正文内容排版（html_content 渲染区） ===== */
.xm-ann-content{font-size:13px;line-height:1.75;color:var(--text,#d7dae8);word-break:break-word}
.xm-ann-content> :first-child{margin-top:0}
.xm-ann-content> :last-child{margin-bottom:0}
.xm-ann-content h1,.xm-ann-content h2,.xm-ann-content h3,.xm-ann-content h4,.xm-ann-content h5,.xm-ann-content h6{margin:18px 0 8px;line-height:1.4;color:var(--heading,#f2f4ff);font-weight:700}
.xm-ann-content h1{font-size:18px}
.xm-ann-content h2{font-size:16px;border-bottom:1px solid var(--border,#1e2235);padding-bottom:6px}
.xm-ann-content h3{font-size:14.5px}
.xm-ann-content h4,.xm-ann-content h5,.xm-ann-content h6{font-size:13.5px}
.xm-ann-content p{margin:8px 0}
.xm-ann-content ul,.xm-ann-content ol{margin:8px 0;padding-left:22px}
.xm-ann-content li{margin:4px 0}
.xm-ann-content a{color:var(--accent,#00e5a0);text-decoration:underline;text-underline-offset:2px}
.xm-ann-content a:hover{opacity:.85}
.xm-ann-content img{max-width:100%;border-radius:6px;display:block;margin:10px auto}
.xm-ann-content blockquote{margin:10px 0;padding:8px 14px;border-left:3px solid var(--accent,#00e5a0);background:rgba(255,255,255,.03);border-radius:0 6px 6px 0;color:var(--text-muted,#9aa0b5)}
.xm-ann-content code{font-family:var(--font-mono,Consolas,monospace);font-size:12px;background:rgba(255,255,255,.06);padding:2px 6px;border-radius:4px;color:#ff9ec7}
.xm-ann-content pre{margin:10px 0;padding:12px 14px;background:#0a0e14;border:1px solid var(--border,#1e2235);border-radius:8px;overflow-x:auto}
.xm-ann-content pre code{background:transparent;padding:0;color:#d7dae8;font-size:12.5px}
.xm-ann-content table{border-collapse:collapse;margin:10px 0;width:100%;font-size:12.5px}
.xm-ann-content th,.xm-ann-content td{border:1px solid var(--border,#1e2235);padding:7px 10px;text-align:left}
.xm-ann-content th{background:rgba(255,255,255,.05);color:var(--heading,#f2f4ff);font-weight:600}
.xm-ann-content hr{border:none;border-top:1px solid var(--border,#1e2235);margin:14px 0}
.xm-ann-content del{opacity:.6}
[data-theme="light"] .xm-ann-content{color:#333}
[data-theme="light"] .xm-ann-content h1,[data-theme="light"] .xm-ann-content h2,[data-theme="light"] .xm-ann-content h3,[data-theme="light"] .xm-ann-content h4{color:#111}
[data-theme="light"] .xm-ann-content pre{background:#f6f8fa;border-color:#e5e7eb}
[data-theme="light"] .xm-ann-content th{background:#f3f4f6}
@media(max-width:600px){
      .xm-ann-modal{width:96vw;max-height:85vh;max-height:85dvh}
      .xm-ann-body{padding:16px 18px;font-size:12px}
      .xm-ann-actions{padding:12px 18px}
      .xm-ann-titlebar{padding:12px 40px 12px 16px}
      /* 手机端空间有限：隐藏日期，只保留版本号 */
      .xm-ann-date{display:none}
    }
/* ===== SKU 档位选择器（多定价档位） ===== */
.plan-product-card .plan-sku-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px 0;
    padding: 0;
}
.plan-product-card .plan-sku-option {
    flex: 1;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    text-align: center;
}
.plan-product-card .plan-sku-option:hover {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
}
.plan-product-card .plan-sku-option.active {
    border-color: var(--pt-accent, var(--accent));
    background: var(--pt-accent-dim, rgba(56,189,248,0.12));
    box-shadow: 0 0 12px var(--pt-accent-glow, rgba(56,189,248,0.15));
}
.plan-product-card .plan-sku-option[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}
.plan-product-card .sku-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.plan-product-card .sku-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--pt-accent, var(--accent));
}
.plan-product-card .sku-original-price {
    font-size: 11px;
    color: var(--text-secondary);
    text-decoration: line-through;
}
.plan-product-card .sku-duration {
    font-size: 11px;
    color: var(--text-secondary);
}
.plan-product-card .sku-tag {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--warning);
    color: #000;
    line-height: 1.4;
}
.plan-product-card .sku-sold-out {
    font-size: 10px;
    color: var(--danger);
    font-weight: 600;
}
[data-theme="light"] .plan-product-card .plan-sku-option {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .plan-product-card .plan-sku-option:hover {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.2);
}
[data-theme="light"] .plan-product-card .plan-sku-option.active {
    border-color: var(--pt-accent, var(--accent));
    background: var(--pt-accent-dim, rgba(56,189,248,0.1));
}

/* 手机端 SKU 选择器 */
@media (max-width: 480px) {
    .plan-product-card .plan-sku-selector {
        gap: 4px;
    }
    .plan-product-card .plan-sku-option {
        min-width: 60px;
        padding: 6px 8px;
    }
    .plan-product-card .sku-name { font-size: 12px; }
    .plan-product-card .sku-price { font-size: 14px; }
}

/* 订阅卡片响应式轮播断点：手机单卡，平板三卡，桌面四卡。 */
@media (min-width: 768px) and (max-width: 1199px) {
    .plans-grid:not(.carousel-active) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .plans-grid.carousel-active .plan-slide {
        flex-basis: 33.333333%;
    }
}

@media (max-width: 767px) {
    .plans-grid:not(.carousel-active) {
        grid-template-columns: minmax(0, 1fr);
        max-width: 440px;
        margin-left: auto;
        margin-right: auto;
    }
    .plans-grid.carousel-active .plan-slide {
        flex-basis: 100%;
    }
}
