/* User-facing light theme overrides. Dark mode remains the base theme. */

html[data-theme="light"] {
    color-scheme: light;

    /* Tokens from css/global.css */
    --primary-bg: #f3f7fb;
    --secondary-bg: #eaf2f9;
    --card-bg: #ffffff;
    --card-bg-light: #f7fbff;
    --accent-blue: #086fbd;
    --accent-blue-dark: #075895;
    --accent-blue-light: #1b9cda;
    --accent-blue-glow: rgba(8, 111, 189, 0.18);
    --gold: #a86e12;
    --gold-dark: #84540a;
    --success: #138255;
    --danger: #c63f52;
    --warning: #a86e12;
    --info: #087b9d;
    --text-primary: #142d47;
    --text-secondary: #526b83;
    --text-muted: #71859a;
    --text-link: #086fbd;
    --border-color: rgba(13, 91, 151, 0.16);
    --border-glow: rgba(8, 111, 189, 0.38);
    --shadow-sm: 0 2px 8px rgba(24, 65, 101, 0.08);
    --shadow-md: 0 8px 24px rgba(24, 65, 101, 0.12);
    --shadow-lg: 0 16px 42px rgba(24, 65, 101, 0.16);

    /* Tokens from user/css/style.css and page-local styles */
    --bg-dark: #f3f7fb;
    --bg-card: rgba(255, 255, 255, 0.94);
    --bg-card-hover: #ffffff;
    --primary: #0874c4;
    --primary-light: #1596d3;
    --primary-gradient: linear-gradient(135deg, #0874c4, #20a5df);
    --primary-glow: rgba(8, 116, 196, 0.2);
    --primary-glow-strong: rgba(32, 165, 223, 0.3);
    --border-glow-strong: rgba(8, 116, 196, 0.42);

    /* Legacy component aliases used by header/footer and page-local CSS. */
    --card: #ffffff;
    --border: rgba(13, 91, 151, 0.16);
    --hover-bg: #edf5fb;
    --bg-input: #ffffff;
}

html[data-theme="light"] body {
    background: var(--primary-bg) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(50, 157, 220, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(111, 195, 232, 0.08), transparent);
}

html[data-theme="light"] ::selection {
    color: #ffffff;
    background: #0a78c9;
}

html[data-theme="light"] ::-webkit-scrollbar-track { background: #e7f0f7; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #72afd2; }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #0874c4; }

/* Theme switcher */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
    background: var(--card-bg);
    color: var(--text-secondary);
    line-height: 1;
    cursor: pointer;
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    background: var(--hover-bg);
    transform: translateY(-1px);
}

.theme-toggle-icon { font-size: 21px; line-height: 1; }
.theme-toggle-text { font-size: 12px; white-space: nowrap; }

.theme-toggle-floating {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10001;
    box-shadow: var(--shadow-md);
}

.header-actions .theme-toggle { flex: 0 0 auto; }

/* Shared surfaces and navigation */
html[data-theme="light"] .header,
html[data-theme="light"] .header.scrolled {
    background: rgba(255, 255, 255, 0.94);
    border-bottom-color: var(--border-color);
    box-shadow: 0 4px 18px rgba(28, 79, 116, 0.08);
}

html[data-theme="light"] .header-nav-item,
html[data-theme="light"] .header-user-name,
html[data-theme="light"] .header-user-role { color: var(--text-secondary); }
html[data-theme="light"] .header-nav-item:hover,
html[data-theme="light"] .header-nav-item.active { color: var(--accent-blue); background: #eaf4fb; }
html[data-theme="light"] .header-logo-text { color: var(--text-primary); }
html[data-theme="light"] .header-logo-icon { box-shadow: 0 4px 16px rgba(8, 116, 196, .2); }
html[data-theme="light"] .header-user-avatar { background: #e1f0fa; color: var(--accent-blue); }
html[data-theme="light"] .user-dropdown,
html[data-theme="light"] .mobile-nav { background: #ffffff; border-color: var(--border-color); box-shadow: var(--shadow-lg); }
html[data-theme="light"] .dropdown-item,
html[data-theme="light"] .mobile-nav-item { color: var(--text-secondary); }
html[data-theme="light"] .dropdown-item:hover,
html[data-theme="light"] .mobile-nav-item:hover,
html[data-theme="light"] .mobile-nav-item.active { color: var(--accent-blue); background: #edf5fb; }
html[data-theme="light"] .header-wechat { color: var(--text-secondary); border-color: var(--border-color); }

html[data-theme="light"] .footer {
    background: #e8f1f8;
    border-top-color: var(--border-color);
}
html[data-theme="light"] .footer-logo-text { color: var(--text-primary); }
html[data-theme="light"] .footer-slogan,
html[data-theme="light"] .footer-links a,
html[data-theme="light"] .footer-copyright,
html[data-theme="light"] .footer-brand-desc { color: var(--text-muted); }
html[data-theme="light"] .footer-column h4 { color: var(--text-primary); }
html[data-theme="light"] .social-icon,
html[data-theme="light"] .footer-social-item { background: rgba(255,255,255,.7); border-color: var(--border-color); color: var(--text-secondary); }

html[data-theme="light"] .card,
html[data-theme="light"] .modal,
html[data-theme="light"] .modal-overlay .modal,
html[data-theme="light"] .service-panel,
html[data-theme="light"] .user-dropdown { color: var(--text-primary); }
html[data-theme="light"] .modal-overlay,
html[data-theme="light"] .disclaimer-modal,
html[data-theme="light"] .case-modal { background: rgba(16, 52, 84, 0.28); }
html[data-theme="light"] .modal-header,
html[data-theme="light"] .modal-footer,
html[data-theme="light"] .modal-overlay .modal-header,
html[data-theme="light"] .modal-overlay .modal-footer { border-color: var(--border-color); }
html[data-theme="light"] .modal-close,
html[data-theme="light"] .modal-overlay .modal-close { color: var(--text-muted); }
html[data-theme="light"] .modal-close:hover,
html[data-theme="light"] .modal-overlay .modal-close:hover { color: var(--text-primary); }
html[data-theme="light"] .form-input,
html[data-theme="light"] .form-select,
html[data-theme="light"] .form-textarea,
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select { color: var(--text-primary); background: #ffffff; border-color: var(--border-color); }
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: #91a2b2; }

/* Authentication pages */
html[data-theme="light"] .auth-left {
    background: linear-gradient(135deg, #dfeff9 0%, #f5fbff 52%, #d8edf9 100%);
}
html[data-theme="light"] .auth-left-bg {
    background:
        radial-gradient(circle at 30% 70%, rgba(8, 116, 196, .14) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(32, 165, 223, .12) 0%, transparent 50%);
}
html[data-theme="light"] .auth-right { background: var(--primary-bg); }
html[data-theme="light"] .auth-logo-text h1,
html[data-theme="light"] .auth-title { color: var(--text-primary); }
html[data-theme="light"] .auth-input { color: var(--text-primary); background: #ffffff; border-color: var(--border-color); }
html[data-theme="light"] .auth-input:focus { box-shadow: 0 0 0 3px var(--accent-blue-glow); }
html[data-theme="light"] .auth-submit { background: var(--primary-gradient); box-shadow: 0 8px 20px var(--primary-glow); }
html[data-theme="light"] .auth-footer,
html[data-theme="light"] .auth-footer a { color: var(--text-secondary); }
html[data-theme="light"] .disclaimer-content { background: #ffffff; }
html[data-theme="light"] .disclaimer-header,
html[data-theme="light"] .disclaimer-footer { border-color: var(--border-color); }
html[data-theme="light"] .disclaimer-header h3 { color: var(--text-primary); }
html[data-theme="light"] .disclaimer-body p { color: var(--text-secondary); }

/* Homepage v2 */
html[data-theme="light"] .side-nav,
html[data-theme="light"] .side-nav-toggle { background: rgba(255,255,255,.94); border-color: var(--border-color); color: var(--text-secondary); }
html[data-theme="light"] .side-nav-item { color: var(--text-secondary); }
html[data-theme="light"] .side-nav-item:hover,
html[data-theme="light"] .side-nav-item.active { color: var(--accent-blue); background: #eaf4fb; }
html[data-theme="light"] .hero-section,
html[data-theme="light"] .section { color: var(--text-primary); }
html[data-theme="light"] .hero-section::before,
html[data-theme="light"] .section::before { opacity: .2; }
html[data-theme="light"] .process-card,
html[data-theme="light"] .advantage-card,
html[data-theme="light"] .scene-card,
html[data-theme="light"] .benefit-card,
html[data-theme="light"] .faq-item,
html[data-theme="light"] .product-card,
html[data-theme="light"] .stats-card { background: var(--bg-card); border-color: var(--border-color); }
html[data-theme="light"] .process-card:hover,
html[data-theme="light"] .advantage-card:hover,
html[data-theme="light"] .scene-card:hover,
html[data-theme="light"] .benefit-card:hover,
html[data-theme="light"] .product-card:hover { box-shadow: var(--shadow-md); }
html[data-theme="light"] .vip-card { background: linear-gradient(135deg, #ffffff, #eaf5fc); }
html[data-theme="light"] .hero-content p,
html[data-theme="light"] .section-subtitle,
html[data-theme="light"] .card-description,
html[data-theme="light"] .faq-answer { color: var(--text-secondary); }
html[data-theme="light"] .service-toggle { color: #ffffff; }
html[data-theme="light"] .hero-slide-overlay {
    background: linear-gradient(90deg, rgba(10, 37, 62, .58) 0%, rgba(10, 37, 62, .22) 58%, transparent 100%),
        linear-gradient(180deg, rgba(10, 37, 62, .08) 0%, transparent 35%, rgba(10, 37, 62, .34) 100%);
}
html[data-theme="light"] .carousel-arrow { color: #ffffff; background: rgba(14, 48, 76, .48); }
html[data-theme="light"] .vip-section {
    background: linear-gradient(90deg, #e5f1f8 0%, #f5fafe 50%, #e5f1f8 100%) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="light"] .vip-title,
html[data-theme="light"] .vip-feature-value,
html[data-theme="light"] .vip-info h3 { color: var(--text-primary) !important; }
html[data-theme="light"] .vip-desc,
html[data-theme="light"] .vip-feature { color: var(--text-secondary) !important; }
html[data-theme="light"] .vip-feature-label { color: var(--text-muted) !important; }
html[data-theme="light"] .vip-member-info .vip-feature,
html[data-theme="light"] .vip-status-card { background: #ffffff !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .channel-card,
html[data-theme="light"] .process-step,
html[data-theme="light"] .about-feature-item,
html[data-theme="light"] .about-stat-card,
html[data-theme="light"] .faq-item,
html[data-theme="light"] .cta-card { background: #ffffff !important; border-color: var(--border-color) !important; color: var(--text-primary); }
html[data-theme="light"] .channel-title,
html[data-theme="light"] .advantage-title,
html[data-theme="light"] .scene-title,
html[data-theme="light"] .step-title,
html[data-theme="light"] .benefit-title,
html[data-theme="light"] .faq-q-text,
html[data-theme="light"] .cta-title { color: var(--text-primary) !important; }
html[data-theme="light"] .channel-desc,
html[data-theme="light"] .advantage-desc,
html[data-theme="light"] .scene-card,
html[data-theme="light"] .step-desc,
html[data-theme="light"] .benefit-list li,
html[data-theme="light"] .faq-a-text,
html[data-theme="light"] .cta-desc { color: var(--text-secondary) !important; }

/* Common page-specific hard-coded dark surfaces */
html[data-theme="light"] .about-page { background: linear-gradient(135deg, #f5f9fc 0%, #e4f1f9 100%) !important; }
html[data-theme="light"] .about-card,
html[data-theme="light"] .about-section,
html[data-theme="light"] .change-pwd-card { background: #ffffff !important; border-color: var(--border-color) !important; color: var(--text-primary); box-shadow: var(--shadow-md); }
html[data-theme="light"] .about-title,
html[data-theme="light"] .feature-name { color: var(--text-primary) !important; }
html[data-theme="light"] .about-subtitle,
html[data-theme="light"] .about-text,
html[data-theme="light"] .feature-desc,
html[data-theme="light"] .stat-label { color: var(--text-secondary) !important; }
html[data-theme="light"] .about-section-title,
html[data-theme="light"] .stat-num { color: var(--accent-blue) !important; }
html[data-theme="light"] .feature-item { background: #f2f8fc !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .products-banner,
html[data-theme="light"] .academy-banner { background: linear-gradient(135deg, #e4f2fb 0%, #f7fbfe 50%, #dceefa 100%) !important; }
html[data-theme="light"] .products-content,
html[data-theme="light"] .academy-content { color: var(--text-primary); }
html[data-theme="light"] .products-card,
html[data-theme="light"] .course-card,
html[data-theme="light"] .product-detail-card { background: #ffffff !important; border-color: var(--border-color) !important; color: var(--text-primary); box-shadow: var(--shadow-sm); }
html[data-theme="light"] .feedback-card { background: #ffffff !important; color: var(--text-primary) !important; border-color: var(--border-color) !important; box-shadow: var(--shadow-md); }
html[data-theme="light"] .feedback-card label,
html[data-theme="light"] .hint { color: var(--text-secondary) !important; }
html[data-theme="light"] .feedback-card input,
html[data-theme="light"] .feedback-card textarea { color: var(--text-primary) !important; background: #ffffff !important; border-color: var(--border-color) !important; }

/* Cases page */
html[data-theme="light"] .cases-filter-section { background: #edf5fb !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .cases-filter-btn,
html[data-theme="light"] .pagination-btn { color: var(--text-secondary) !important; background: #ffffff !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .cases-filter-btn:hover,
html[data-theme="light"] .pagination-btn:hover { color: var(--accent-blue) !important; background: #eef7fd !important; }
html[data-theme="light"] .case-card,
html[data-theme="light"] .cases-login-tip,
html[data-theme="light"] .case-modal-content { background: #ffffff !important; border-color: var(--border-color) !important; box-shadow: var(--shadow-md); }
html[data-theme="light"] .case-card-title,
html[data-theme="light"] .case-modal-title,
html[data-theme="light"] .cases-login-tip h3 { color: var(--text-primary) !important; }
html[data-theme="light"] .case-card-intro,
html[data-theme="light"] .case-modal-desc,
html[data-theme="light"] .cases-login-tip p { color: var(--text-secondary) !important; }
html[data-theme="light"] .case-card-metrics { background: #f0f7fc !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .case-modal-image { background: #eaf2f8 !important; }
html[data-theme="light"] .case-modal-close { color: var(--text-secondary) !important; background: #edf5fb !important; }

/* Member, points and profile workspaces */
html[data-theme="light"] .member-page,
html[data-theme="light"] .scale-page,
html[data-theme="light"] .profile-page { background: linear-gradient(180deg, #f4f8fb 0%, #e8f2f9 58%, #f4f8fb 100%) !important; }
html[data-theme="light"] .member-card,
html[data-theme="light"] .scale-panel,
html[data-theme="light"] .profile-sidebar,
html[data-theme="light"] .profile-main,
html[data-theme="light"] .profile-card { background: #ffffff !important; border-color: var(--border-color) !important; color: var(--text-primary); box-shadow: var(--shadow-sm); }
html[data-theme="light"] .member-intro,
html[data-theme="light"] .member-summary,
html[data-theme="light"] .member-note,
html[data-theme="light"] .scale-muted,
html[data-theme="light"] .profile-sidebar-label { color: var(--text-muted) !important; }
html[data-theme="light"] .member-table,
html[data-theme="light"] .recharge-table { color: var(--text-primary); border-color: var(--border-color); }
html[data-theme="light"] .member-table tbody tr,
html[data-theme="light"] .recharge-table tbody tr,
html[data-theme="light"] .member-courses li { background: #f9fcfe !important; border-color: var(--border-color) !important; }

/* Course player intentionally keeps the video viewport black. Surrounding UI follows the theme. */
html[data-theme="light"] .course-player-container,
html[data-theme="light"] .course-info,
html[data-theme="light"] .course-sidebar { color: var(--text-primary); }
html[data-theme="light"] .course-info,
html[data-theme="light"] .course-sidebar { background: #ffffff !important; border-color: var(--border-color) !important; }

/* News pages and WordPress article surfaces */
html[data-theme="light"] .banner-section { background: linear-gradient(135deg, #e3f1fa 0%, #f7fbfe 100%) !important; }
html[data-theme="light"] .news-container,
html[data-theme="light"] .detail-page { color: var(--text-primary); }
html[data-theme="light"] .category-tab,
html[data-theme="light"] .news-card,
html[data-theme="light"] .sidebar-widget,
html[data-theme="light"] .page-btn { background: #ffffff !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .category-tab,
html[data-theme="light"] .news-card-excerpt { color: var(--text-secondary) !important; }
html[data-theme="light"] .news-card-title,
html[data-theme="light"] .hot-news-title,
html[data-theme="light"] .recommend-title { color: var(--text-primary) !important; }
html[data-theme="light"] .detail-content { color: var(--text-primary); }
html[data-theme="light"] .detail-content .has-foreground-color,
html[data-theme="light"] .detail-content .has-dark-gray-color,
html[data-theme="light"] .detail-content .has-black-color { color: var(--text-primary) !important; }
html[data-theme="light"] .detail-content .has-background-color,
html[data-theme="light"] .detail-content .has-white-color { color: #ffffff !important; }

/* AI customer page is a standalone surface but uses the same tokens. */
html[data-theme="light"] .ai-customer-page,
html[data-theme="light"] .ai-customer-shell { background: #f3f7fb !important; color: var(--text-primary); }
html[data-theme="light"] .ai-customer-sidebar,
html[data-theme="light"] .ai-chat-panel { background: #ffffff !important; border-color: var(--border-color) !important; color: var(--text-primary); }
html[data-theme="light"] .ai-customer-page {
    --ai-bg: #f3f7fb;
    --ai-panel: #ffffff;
    --ai-panel-soft: #f5f9fc;
    --ai-line: rgba(13, 91, 151, .16);
    --ai-blue: #086fbd;
    --ai-cyan: #0874c4;
    --ai-text: #142d47;
    --ai-muted: #526b83;
    --ai-dim: #71859a;
}
html[data-theme="light"] .ai-message-user .ai-message-body,
html[data-theme="light"] .ai-agent-mark,
html[data-theme="light"] .ai-send-button { color: #ffffff !important; }
html[data-theme="light"] .ai-qr-panel { background: #ffffff !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .ai-qr-header h3 { color: var(--text-primary) !important; }
html[data-theme="light"] .ai-qr-close { color: var(--text-muted) !important; }

html[data-theme="light"] .course-player-container { color: var(--text-primary); }
html[data-theme="light"] .course-info-section,
html[data-theme="light"] .course-player-placeholder { color: var(--text-primary) !important; background: #ffffff !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .course-player-noauth { color: var(--text-secondary) !important; background: linear-gradient(135deg, #f0f7fb, #e8f3fa) !important; }
html[data-theme="light"] .course-player-noauth h2,
html[data-theme="light"] .course-player-noauth h3 { color: var(--text-primary) !important; }

/* Product catalogue and course library */
html[data-theme="light"] .products-section,
html[data-theme="light"] .academy-course-section,
html[data-theme="light"] .academy-course-list-section { background: transparent !important; }
html[data-theme="light"] .product-card-new,
html[data-theme="light"] .academy-course-row,
html[data-theme="light"] .academy-course-results-panel,
html[data-theme="light"] .academy-course-sidebar,
html[data-theme="light"] .category-popup-inner,
html[data-theme="light"] .product-detail-main,
html[data-theme="light"] .product-detail-info,
html[data-theme="light"] .card-category-item,
html[data-theme="light"] .card-records-section,
html[data-theme="light"] .card-vip-card { background: #ffffff !important; border-color: var(--border-color) !important; color: var(--text-primary); box-shadow: var(--shadow-sm); }
html[data-theme="light"] .products-banner,
html[data-theme="light"] .academy-banner,
html[data-theme="light"] .card-banner { background-color: #e8f3fa !important; }
html[data-theme="light"] .products-banner-overlay { background: linear-gradient(90deg, rgba(11, 42, 68, .58), rgba(11, 42, 68, .12)) !important; }
html[data-theme="light"] .products-banner-subtitle,
html[data-theme="light"] .academy-banner-subtitle { color: #ffffff !important; text-shadow: 0 1px 8px rgba(0,0,0,.55); }
html[data-theme="light"] .academy-course-copy,
html[data-theme="light"] .academy-course-no-filter-results,
html[data-theme="light"] .academy-empty,
html[data-theme="light"] .products-empty,
html[data-theme="light"] .login-required-tip { color: var(--text-secondary) !important; }
html[data-theme="light"] .academy-course-category-list,
html[data-theme="light"] .academy-course-type-filters,
html[data-theme="light"] .academy-filter-tags { color: var(--text-secondary); }
html[data-theme="light"] .academy-course-category-toggle:not([hidden]) {
    color: var(--text-secondary) !important;
    border-top-color: var(--border-color) !important;
}
html[data-theme="light"] .academy-course-category-toggle:not([hidden])::before { color: var(--text-muted) !important; }
html[data-theme="light"] .product-detail,
html[data-theme="light"] .product-detail-main { color: var(--text-primary); }
html[data-theme="light"] .product-detail-desc,
html[data-theme="light"] .product-detail-brief { color: var(--text-secondary) !important; }
html[data-theme="light"] .product-card-new .product-name,
html[data-theme="light"] .academy-course-name,
html[data-theme="light"] .card-category-title,
html[data-theme="light"] .card-divider-title,
html[data-theme="light"] .card-records-title,
html[data-theme="light"] .product-detail-info h1,
html[data-theme="light"] .product-detail-brief,
html[data-theme="light"] .product-detail-desc { color: var(--text-primary) !important; }
html[data-theme="light"] .product-card-new .product-desc,
html[data-theme="light"] .academy-course-meta,
html[data-theme="light"] .academy-course-toolbar-desc,
html[data-theme="light"] .card-category-desc,
html[data-theme="light"] .card-banner-subtitle,
html[data-theme="light"] .card-banner-desc,
html[data-theme="light"] .card-vip-desc,
html[data-theme="light"] .card-records-table td { color: var(--text-secondary) !important; }
html[data-theme="light"] .academy-course-filter-row,
html[data-theme="light"] .academy-course-toolbar,
html[data-theme="light"] .academy-course-list-heading,
html[data-theme="light"] .category-popup { background: #f4f8fb !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .academy-course-category,
html[data-theme="light"] .academy-filter-tag,
html[data-theme="light"] .academy-course-type-filter,
html[data-theme="light"] .category-popup-item,
html[data-theme="light"] .card-pagination-btn,
html[data-theme="light"] .card-records-tab { color: var(--text-secondary) !important; background: #ffffff !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .academy-course-category.active,
html[data-theme="light"] .academy-filter-tag.active,
html[data-theme="light"] .category-popup-item.active,
html[data-theme="light"] .card-pagination-btn.active,
html[data-theme="light"] .card-records-tab.active { color: #ffffff !important; background: var(--primary-gradient) !important; border-color: var(--primary) !important; }
html[data-theme="light"] .card-records-table,
html[data-theme="light"] .member-table,
html[data-theme="light"] .recharge-table { color: var(--text-primary); }
html[data-theme="light"] .card-records-table thead,
html[data-theme="light"] .member-table thead,
html[data-theme="light"] .recharge-table thead { background: #eaf3f9 !important; }
html[data-theme="light"] .card-records-table th,
html[data-theme="light"] .card-key-masked { color: var(--text-primary) !important; }
html[data-theme="light"] .exchange-modal-content,
html[data-theme="light"] .exchange-modal-header,
html[data-theme="light"] .exchange-modal-body,
html[data-theme="light"] .exchange-modal-footer { color: var(--text-primary) !important; background: #ffffff !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .exchange-modal-close,
html[data-theme="light"] .exchange-tip,
html[data-theme="light"] .form-group label { color: var(--text-secondary) !important; }
html[data-theme="light"] .exchange-modal .form-input { color: var(--text-primary) !important; background: #ffffff !important; border-color: var(--border-color) !important; }

/* Membership detail */
html[data-theme="light"] .member-banner { background: linear-gradient(135deg, #e2f0f9, #f6fbfe) !important; }
html[data-theme="light"] .member-banner .banner-title { color: var(--text-primary) !important; }
html[data-theme="light"] .member-banner .banner-subtitle { color: var(--text-secondary) !important; }
html[data-theme="light"] .member-intro,
html[data-theme="light"] .member-summary,
html[data-theme="light"] .member-note { color: var(--text-secondary) !important; }
html[data-theme="light"] .member-table,
html[data-theme="light"] .recharge-table { background: #ffffff !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .member-table th,
html[data-theme="light"] .member-table td,
html[data-theme="light"] .recharge-table th,
html[data-theme="light"] .recharge-table td { color: var(--text-secondary) !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .member-table tbody th[scope="row"],
html[data-theme="light"] .recharge-table tbody th[scope="row"],
html[data-theme="light"] .benefit-name { color: var(--text-primary) !important; }
html[data-theme="light"] .benefit-desc,
html[data-theme="light"] .member-muted { color: var(--text-muted) !important; }
html[data-theme="light"] .member-table tbody .benefit-group th { color: #075c9c !important; background: #e8f4fb !important; }
html[data-theme="light"] .member-courses li,
html[data-theme="light"] .member-table tbody tr,
html[data-theme="light"] .recharge-table tbody tr { background: #ffffff !important; border-color: var(--border-color) !important; }

/* Points center: keep the custom finance layout readable in either theme. */
html[data-theme="light"] .scale-page {
    --scale-panel: #ffffff;
    --scale-panel-deep: #f4f8fb;
    --scale-line: rgba(13, 91, 151, .16);
    --scale-line-bright: rgba(8, 111, 189, .34);
    --scale-text: #142d47;
    --scale-muted: #71859a;
    --scale-blue: #0874c4;
    --scale-gold: #94610d;
    background: linear-gradient(180deg, #f5f9fc 0%, #eaf3f9 58%, #f5f9fc 100%) !important;
}
html[data-theme="light"] .scale-sidebar,
html[data-theme="light"] .scale-section,
html[data-theme="light"] .modal-inner { color: var(--text-primary) !important; background: #ffffff !important; border-color: var(--border-color) !important; box-shadow: var(--shadow-sm); }
html[data-theme="light"] .scale-sidebar-label,
html[data-theme="light"] .scale-sidebar-note,
html[data-theme="light"] .scale-breadcrumb,
html[data-theme="light"] .scale-section-heading p,
html[data-theme="light"] .asset-card .label,
html[data-theme="light"] .asset-exchange p,
html[data-theme="light"] .activity-row,
html[data-theme="light"] .order-meta div,
html[data-theme="light"] .order-detail,
html[data-theme="light"] .muted,
html[data-theme="light"] .calendar-legend { color: var(--text-secondary) !important; }
html[data-theme="light"] .scale-section h2,
html[data-theme="light"] .asset-card .number,
html[data-theme="light"] .asset-exchange h3,
html[data-theme="light"] .calendar-toolbar strong,
html[data-theme="light"] .goods h3,
html[data-theme="light"] .order-no,
html[data-theme="light"] .modal-inner h2 { color: var(--text-primary) !important; }
html[data-theme="light"] .scale-nav a { color: var(--text-secondary) !important; }
html[data-theme="light"] .scale-nav a.active { color: #075c9c !important; background: #eaf4fb !important; border-color: #c6deef !important; }
html[data-theme="light"] .scale-nav-icon { color: #0874c4 !important; background: #e8f4fb !important; }
html[data-theme="light"] .asset-card { background: linear-gradient(140deg, #f1f8fc, #e9f3f9) !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .asset-card .number,
html[data-theme="light"] .asset-card.fish .number { color: #0874c4 !important; }
html[data-theme="light"] .asset-card .label,
html[data-theme="light"] .goods p,
html[data-theme="light"] .modal-inner label { color: var(--text-secondary) !important; }
html[data-theme="light"] .asset-exchange,
html[data-theme="light"] .signin-hero { background: #f0f7fc !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .calendar-day,
html[data-theme="light"] .goods,
html[data-theme="light"] .order-detail { color: var(--text-secondary) !important; background: #f7fafc !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .calendar-day.is-signed { color: #176c4b !important; background: #e5f5ed !important; }
html[data-theme="light"] .modal-inner input,
html[data-theme="light"] .modal-inner textarea { color: var(--text-primary) !important; background: #ffffff !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .case-feedback-callout {
    background: linear-gradient(100deg, #edf5fb, #f3f6fc) !important;
    border-color: #c9d9e8 !important;
}
html[data-theme="light"] .case-feedback-callout h3 { color: #17334d !important; }
html[data-theme="light"] .case-feedback-callout p { color: #4c657b !important; }
html[data-theme="light"] .feedback-upload {
    background: #f8fbfd !important;
    border-color: #adc6d8 !important;
}
html[data-theme="light"] .feedback-field label,
html[data-theme="light"] .feedback-upload h3 { color: #29465f !important; }
html[data-theme="light"] .feedback-field input,
html[data-theme="light"] .feedback-field textarea {
    color: #18354e !important;
    background: #ffffff !important;
    border-color: #b8cddd !important;
}
html[data-theme="light"] .feedback-upload p,
html[data-theme="light"] .feedback-upload input { color: #526b80 !important; }

/* Profile workspace */
html[data-theme="light"] .profile-page {
    --pc-panel: #ffffff;
    --pc-line: rgba(13, 91, 151, .16);
    --pc-blue: #0874c4;
    --pc-text: #142d47;
    --pc-muted: #71859a;
    --pc-gold: #94610d;
}
html[data-theme="light"] .profile-sidebar,
html[data-theme="light"] .profile-section { color: var(--text-primary) !important; background: #ffffff !important; border-color: var(--border-color) !important; box-shadow: var(--shadow-sm); }
html[data-theme="light"] .profile-sidebar-label,
html[data-theme="light"] .profile-sidebar-note,
html[data-theme="light"] .profile-subtitle,
html[data-theme="light"] .profile-section-heading p,
html[data-theme="light"] .profile-muted,
html[data-theme="light"] .password-help { color: var(--text-secondary) !important; }
html[data-theme="light"] .profile-section h2,
html[data-theme="light"] .profile-sidebar-note strong { color: var(--text-primary) !important; }
html[data-theme="light"] .profile-nav a { color: var(--text-secondary) !important; }
html[data-theme="light"] .profile-nav a.active { color: #075c9c !important; background: #eaf4fb !important; border-color: #c6deef !important; }
html[data-theme="light"] .identity-strip,
html[data-theme="light"] .detail-item,
html[data-theme="light"] .record-row,
html[data-theme="light"] .signin-day,
html[data-theme="light"] .signin-record-item { background: #f7fafc !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .identity-name,
html[data-theme="light"] .detail-value,
html[data-theme="light"] .record-title { color: var(--text-primary) !important; }
html[data-theme="light"] .identity-signature,
html[data-theme="light"] .detail-label,
html[data-theme="light"] .record-meta,
html[data-theme="light"] .record-time,
html[data-theme="light"] .signin-week { color: var(--text-muted) !important; }
html[data-theme="light"] .profile-form input,
html[data-theme="light"] .password-form input { color: var(--text-primary) !important; background: #ffffff !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .profile-form label,
html[data-theme="light"] .password-form label { color: var(--text-secondary) !important; }
html[data-theme="light"] .pagination button,
html[data-theme="light"] .signin-toolbar button { color: var(--text-secondary) !important; background: #f3f8fb !important; border-color: var(--border-color) !important; }

/* Editorial theme tokens used by both news list and article detail pages. */
html[data-theme="light"] .detail-page,
html[data-theme="light"] .article-wrapper { color: var(--text-primary); }
html[data-theme="light"] .toc-nav,
html[data-theme="light"] .detail-content { color: var(--text-primary) !important; background: #ffffff !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .toc-nav-title,
html[data-theme="light"] .detail-content a { color: #086fbd !important; }
html[data-theme="light"] .toc-item,
html[data-theme="light"] .detail-meta,
html[data-theme="light"] .detail-breadcrumb,
html[data-theme="light"] .detail-content p,
html[data-theme="light"] .detail-content span,
html[data-theme="light"] .detail-content div,
html[data-theme="light"] .detail-content li,
html[data-theme="light"] .detail-content ul,
html[data-theme="light"] .detail-content ol { color: var(--text-secondary) !important; }
html[data-theme="light"] .detail-title,
html[data-theme="light"] .detail-content h1,
html[data-theme="light"] .detail-content h2,
html[data-theme="light"] .detail-content h3,
html[data-theme="light"] .detail-content h4,
html[data-theme="light"] .detail-content h5,
html[data-theme="light"] .detail-content h6 { color: var(--text-primary) !important; }

/* General dark utility surfaces should transition without flashing on navigation. */
html, body,
.header, .footer,
.theme-toggle,
.card, .modal-overlay .modal,
.auth-page, .auth-right,
.products-section, .academy-course-row,
.case-card, .profile-section, .scale-section {
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

@media (max-width: 768px) {
    .theme-toggle-floating { top: 12px; right: 12px; }
    .header-actions .theme-toggle { min-width: 38px; height: 38px; padding: 0 8px; }
    .header-actions .theme-toggle-text { display: none; }
}

/* Readability fixes for page-specific dark styles in light mode. */
html[data-theme="light"] .hero-slide-overlay {
    background: linear-gradient(90deg, rgba(8, 30, 50, .78) 0%, rgba(8, 30, 50, .46) 58%, rgba(8, 30, 50, .08) 100%),
        linear-gradient(180deg, rgba(8, 30, 50, .12) 0%, transparent 38%, rgba(8, 30, 50, .28) 100%);
}
html[data-theme="light"] .hero-title { color: #ffffff !important; text-shadow: 0 2px 14px rgba(3, 20, 36, .5); }
html[data-theme="light"] .hero-title .gradient-text {
    color: #8ddfff !important;
    background: none !important;
    -webkit-text-fill-color: #8ddfff !important;
    text-shadow: 0 2px 12px rgba(3, 20, 36, .48);
}
html[data-theme="light"] .hero-subtitle { color: #f1f7fb !important; text-shadow: 0 1px 5px rgba(3, 20, 36, .6); }
html[data-theme="light"] .hero-badge { color: #f1f7fb !important; background: rgba(8, 35, 58, .64) !important; border-color: rgba(190, 230, 250, .5) !important; }

html[data-theme="light"] .products-banner {
    background: linear-gradient(135deg, #dceefa 0%, #f8fcff 54%, #e3f1fa 100%) !important;
}
html[data-theme="light"] .products-banner-bg { opacity: .18 !important; filter: saturate(.78) contrast(1.04); }
html[data-theme="light"] .products-banner-overlay {
    display: block !important;
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(239, 248, 253, .82), rgba(248, 252, 255, .76)) !important;
}
html[data-theme="light"] .products-banner-title {
    color: #142d47 !important;
    background: none !important;
    -webkit-text-fill-color: #142d47 !important;
    text-shadow: none !important;
}
html[data-theme="light"] .products-banner-subtitle { color: #355670 !important; opacity: 1; text-shadow: none; }

html[data-theme="light"] .academy-banner {
    background: linear-gradient(110deg, #e2f1fa 0%, #f7fbfe 60%, #e5f2fa 100%) !important;
}
html[data-theme="light"] .academy-banner-bg { opacity: .34 !important; filter: saturate(.9) contrast(1.05); }
html[data-theme="light"] .academy-banner::before,
html[data-theme="light"] .academy-banner::after { opacity: .18; }
html[data-theme="light"] .academy-banner-title {
    color: #16334d !important;
    background: none !important;
    -webkit-text-fill-color: #16334d !important;
    text-shadow: none !important;
}
html[data-theme="light"] .academy-banner-subtitle,
html[data-theme="light"] .academy-banner-desc { color: #355670 !important; opacity: 1; }
html[data-theme="light"] .academy-banner-tag { color: var(--text-primary) !important; background: rgba(255, 255, 255, .82) !important; border-color: var(--border-color) !important; backdrop-filter: none; }
html[data-theme="light"] .academy-banner-tag .tag-title { color: var(--text-primary) !important; }
html[data-theme="light"] .academy-banner-tag .tag-desc { color: var(--text-secondary) !important; }
html[data-theme="light"] .academy-banner-content::after { color: #355670 !important; }

html[data-theme="light"] .cases-banner {
    background: linear-gradient(120deg, #e1f0f9, #f7fbfe 56%, #e5f2fa) !important;
}
html[data-theme="light"] .cases-banner-bg { opacity: .16; filter: saturate(.8) contrast(1.04); }
html[data-theme="light"] .cases-banner-title {
    color: #142d47 !important;
    background: none !important;
    -webkit-text-fill-color: #142d47 !important;
    text-shadow: none !important;
}
html[data-theme="light"] .cases-banner-subtitle { color: #355670 !important; }

html[data-theme="light"] .banner-section::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(5, 21, 38, .72), rgba(5, 21, 38, .28) 72%, rgba(5, 21, 38, .18));
}
html[data-theme="light"] .banner-title {
    color: #ffffff !important;
    background: none !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 2px 16px rgba(0, 12, 24, .62) !important;
    animation: none !important;
}
html[data-theme="light"] .banner-subtitle { color: #e7f3fb !important; text-shadow: 0 1px 6px rgba(0, 12, 24, .7); }

html[data-theme="light"] .scale-status { color: #355670 !important; background: #edf7fc !important; border-color: #bedced !important; }
html[data-theme="light"] .scale-status strong { color: #142d47 !important; }
html[data-theme="light"] .calendar-day.is-signed { color: #176344 !important; background: #e2f5eb !important; border-color: #9bd4b6 !important; }

html[data-theme="light"] .card-records-section { color: var(--text-primary); }
html[data-theme="light"] .card-records-title { color: var(--text-primary) !important; }
html[data-theme="light"] .card-records-table { color: var(--text-primary) !important; background: #ffffff !important; border: 1px solid var(--border-color); }
html[data-theme="light"] .card-records-table thead { background: #eaf3f9 !important; }
html[data-theme="light"] .card-records-table th { color: #183852 !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .card-records-table tbody tr,
html[data-theme="light"] .card-records-table tbody td { color: #355670 !important; background: #ffffff !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .card-records-table tbody tr:nth-child(even),
html[data-theme="light"] .card-records-table tbody tr:nth-child(even) td { background: #f6fafe !important; }
html[data-theme="light"] .card-records-table tbody tr:hover,
html[data-theme="light"] .card-records-table tbody tr:hover td { background: #edf6fc !important; }
html[data-theme="light"] .card-key-masked { color: #183852 !important; }
html[data-theme="light"] .card-status-badge.used { color: #166b49 !important; background: #e1f4ea !important; }
html[data-theme="light"] .card-status-badge.expired { color: #596c7d !important; background: #edf1f4 !important; }

html[data-theme="light"] .comparison-table,
html[data-theme="light"] .member-table,
html[data-theme="light"] .recharge-table { color: var(--text-primary) !important; background: #ffffff !important; border-color: var(--border-color) !important; box-shadow: var(--shadow-sm) !important; }
html[data-theme="light"] .comparison-table thead,
html[data-theme="light"] .member-table thead,
html[data-theme="light"] .recharge-table thead { background: #eaf3f9 !important; }
html[data-theme="light"] .comparison-table th,
html[data-theme="light"] .comparison-table td,
html[data-theme="light"] .member-table th,
html[data-theme="light"] .member-table td,
html[data-theme="light"] .recharge-table th,
html[data-theme="light"] .recharge-table td { color: #355670 !important; border-color: var(--border-color) !important; }
html[data-theme="light"] .comparison-table th:first-child,
html[data-theme="light"] .member-table tbody th[scope="row"],
html[data-theme="light"] .member-table tbody th[scope="row"]:first-child,
html[data-theme="light"] .benefit-name { color: #183852 !important; }
html[data-theme="light"] .plan-price,
html[data-theme="light"] .benefit-desc,
html[data-theme="light"] .comparison-table td::before,
html[data-theme="light"] .member-table td::before,
html[data-theme="light"] .recharge-table td::before { color: #526b83 !important; }
html[data-theme="light"] .normal-color { color: #086fbd !important; text-shadow: none !important; }
html[data-theme="light"] .vip-color { color: #84540a !important; text-shadow: none !important; }
html[data-theme="light"] .check-normal { color: #0874c4 !important; text-shadow: none !important; }
html[data-theme="light"] .check-vip { color: #94610d !important; text-shadow: none !important; }
html[data-theme="light"] .cross-icon { color: #8193a3 !important; }
html[data-theme="light"] .member-table tbody .benefit-group th { color: #075c9c !important; background: #e8f4fb !important; }
html[data-theme="light"] .member-extra { color: #075c9c !important; font-weight: 600; }
html[data-theme="light"] .member-table tbody tr,
html[data-theme="light"] .recharge-table tbody tr { background: #ffffff !important; }
html[data-theme="light"] .member-table tbody tr:hover,
html[data-theme="light"] .recharge-table tbody tr:hover { background: #f3f8fc !important; }
html[data-theme="light"] .privilege-card,
html[data-theme="light"] .contact-card { color: var(--text-primary) !important; background: #ffffff !important; border-color: var(--border-color) !important; box-shadow: var(--shadow-sm) !important; }
html[data-theme="light"] .privilege-title,
html[data-theme="light"] .contact-title { color: #183852 !important; text-shadow: none !important; }
html[data-theme="light"] .privilege-desc { color: #526b83 !important; }
html[data-theme="light"] .privilege-icon { background: #eaf4fb !important; border-color: #b8d9ed !important; box-shadow: none !important; }

html[data-theme="light"] .profile-status { color: #355670 !important; background: #edf7fc !important; border-color: #bedced !important; }
html[data-theme="light"] .profile-status strong { color: #142d47 !important; }
html[data-theme="light"] .copy-card-btn { color: #075c9c !important; background: #eaf4fb !important; border-color: #a9cfe7 !important; }
html[data-theme="light"] .copy-card-btn:hover { color: #064a7d !important; background: #dceefa !important; }
html[data-theme="light"] .copy-card-btn.copied { color: #176344 !important; background: #e2f5eb !important; border-color: #9bd4b6 !important; }
html[data-theme="light"] .signin-day.signed { color: #176344 !important; background: #e2f5eb !important; border-color: #9bd4b6 !important; }
html[data-theme="light"] .signin-day.signed::after { color: #176344 !important; }
html[data-theme="light"] .signin-day.today { color: #183852 !important; border-color: #0874c4 !important; }
