/* ==========================================
   Mandarinprints.com Core Design System & Styles
   ========================================== */

:root {
    /* Color Palette - Oriental Modern Fusion */
    --bg-main: #F9F6F0;          /* Xuan Paper Warm Light */
    --bg-card: #FFFFFF;
    --bg-dark: #16181A;          /* Ink Dark */
    --bg-dark-card: #202326;
    
    --primary-red: #C83E3D;      /* Vermilion Red (朱红) */
    --primary-red-hover: #B23332;
    --primary-red-light: #FDF2F2;
    
    --text-main: #22252A;        /* Deep Charcoal */
    --text-muted: #646E7A;
    --text-light: #F3F4F6;
    
    --border-color: #E6E2DA;
    --border-focus: #C83E3D;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
    --shadow-accent: 0 8px 25px rgba(200, 62, 61, 0.25);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', 'Noto Serif SC', sans-serif;
    --font-serif: 'Noto Serif SC', serif;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* Header & Navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(249, 246, 240, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    font-size: 28px;
    background: var(--primary-red-light);
    border: 1px solid rgba(200, 62, 61, 0.2);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.logo-text {
    display: flex;
    align-items: baseline;
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
}

.brand-name .accent {
    color: var(--primary-red);
}

.brand-domain {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-item {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s ease;
}

.nav-item:hover {
    color: var(--primary-red);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary-red);
    color: #FFFFFF;
    box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
    background-color: var(--primary-red-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--primary-red);
    color: var(--primary-red);
}

.btn-outline:visited {
    color: var(--primary-red);
}

.btn-outline:hover {
    background-color: var(--primary-red);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 62, 61, 0.15);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* Hero Section */
.hero-section {
    position: relative;
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 100px 0 90px;
    overflow: hidden;
    text-align: center;
}

.hero-bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(200, 62, 61, 0.2) 0%, rgba(22, 24, 26, 0) 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 820px;
}

.badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    color: #F3A4A4;
    margin-bottom: 24px;
    backdrop-filter: blur(8px);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 52px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.gradient-text {
    background: linear-gradient(135deg, #FF7B79 0%, #FFB6B5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 18px;
    color: #A0AEC0;
    margin-bottom: 36px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 60px;
}

.btn-hero-primary {
    background: linear-gradient(135deg, #D94645 0%, #C83E3D 100%);
    color: #FFF;
    padding: 14px 28px;
    font-size: 16px;
    box-shadow: 0 10px 30px rgba(200, 62, 61, 0.4);
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 35px rgba(200, 62, 61, 0.5);
}

.btn-hero-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #FFF;
    padding: 14px 28px;
    font-size: 16px;
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: #FFF;
}

.stat-label {
    font-size: 13px;
    color: #718096;
}

.stat-divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
}

/* Sections Common */
section {
    padding: 90px 0;
}

.section-header {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 50px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.section-desc {
    font-size: 16px;
    color: var(--text-muted);
}

/* Generator Workbench Card */
.generator-section {
    background-color: var(--bg-main);
}

.workbench-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 0;
    overflow: hidden;
}

.controls-panel {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hint-badge {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.form-textarea, .form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-serif);
    font-size: 16px;
    color: var(--text-main);
    background: #FAFAFA;
    transition: all 0.2s ease;
}

.form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--border-focus);
    background: #FFF;
    box-shadow: 0 0 0 3px rgba(200, 62, 61, 0.12);
}

.preset-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

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

.chip-btn {
    background: #F0EDE6;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.2s ease;
}

.chip-btn:hover {
    background: var(--primary-red-light);
    color: var(--primary-red);
}

.control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.radio-segmented {
    display: flex;
    background: #F0EDE6;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.segmented-option {
    flex: 1;
    cursor: pointer;
}

.segmented-option input {
    display: none;
}

.segmented-option .option-btn {
    display: block;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.segmented-option input:checked + .option-btn {
    background: #FFFFFF;
    color: var(--primary-red);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.action-box {
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-export {
    width: 100%;
    padding: 16px;
    font-size: 17px;
    background: linear-gradient(135deg, #D94645 0%, #C83E3D 100%);
    color: #FFF;
    box-shadow: var(--shadow-accent);
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(200, 62, 61, 0.35);
}

.export-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Preview Panel */
.preview-panel {
    background: #F3EFE6;
    border-left: 1px solid var(--border-color);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.preview-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.preview-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.preview-paper-tag {
    font-size: 11px;
    background: #E2DDD2;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-muted);
    font-weight: 600;
}

.canvas-wrapper {
    background: #FFFFFF;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 15px;
    max-width: 100%;
    display: flex;
    justify-content: center;
}

#previewCanvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Presets Section Grid */
.presets-section {
    background: #FFFFFF;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 24px;
}

.preset-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.preset-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(200, 62, 61, 0.3);
}

.preset-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.preset-icon {
    font-size: 32px;
    background: #FFF;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.preset-cat {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-red);
    background: var(--primary-red-light);
    padding: 4px 8px;
    border-radius: 4px;
}

.preset-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.preset-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex-grow: 1;
}

.preset-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

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

.btn-preset-download {
    background: #FFF;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    font-size: 13px;

}

.btn-preset-download:hover {
    background: var(--primary-red);
    color: #FFF;
    border-color: var(--primary-red);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    background: #FFF;
    border-radius: var(--radius-md);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.feature-icon {
    font-size: 36px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Footer */
.site-footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 60px 0 30px;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    text-align: center;
}

.footer-brand .brand-logo {
    justify-content: center;
}

.footer-brand .brand-name {
    color: #FFF;
}

.footer-desc {
    color: #718096;
    font-size: 14px;
    max-width: 500px;
    margin-top: 10px;
}

.footer-copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    padding-top: 25px;
    font-size: 13px;
    color: #4A5568;
}

/* Responsive Design */
@media (max-width: 992px) {
    .workbench-card {
        grid-template-columns: 1fr;
    }
    .preview-panel {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    .features-grid, .pricing-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   Monetization & HSK Vault New Styles
   ========================================== */

.nav-highlight {
    color: var(--primary-red) !important;
    font-weight: 600;
}

.btn-pro-badge {
    background: linear-gradient(135deg, #FFF6E5 0%, #FFE6B3 100%);
    border: 1px solid #F5C06B;
    color: #8A5300;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.btn-pro-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 192, 107, 0.4);
}

/* Teacher Pro Branding Box */
.pro-feature-box {
    background: #FFFBF5;
    border: 1px dashed #E6C89C;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 20px 0;
}

.pro-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pro-tag {
    font-size: 14px;
    font-weight: 600;
    color: #8A5300;
}

.pro-fields {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pro-fields.hidden {
    display: none;
}

.control-label-sm {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.form-input-sm {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
}
.form-input-sm:focus {
    border-color: var(--primary-red);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);

}

/* Toggle Switch */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
}
.switch-toggle input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #CCC; transition: .3s; border-radius: 22px;
}
.slider:before {
    position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px;
    background-color: white; transition: .3s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary-red); }
input:checked + .slider:before { transform: translateX(16px); }

/* HSK Vault Section */
.hsk-vault-section {
    padding: 80px 0;
    background: #FFF;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.hsk-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.hsk-tab-btn {
    padding: 10px 20px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.hsk-tab-btn.active, .hsk-tab-btn:hover {
    background: var(--primary-red);
    color: #FFF;
    border-color: var(--primary-red);
}
.badge-lock {
    background: #FFEDD5;
    color: #9A3412;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}
.hsk-tab-btn.active .badge-lock {
    background: rgba(255, 255, 255, 0.25);
    color: #FFF;
}

.vocab-vault-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
}

.vault-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.vault-title-group h3 {
    font-family: var(--font-heading);
    font-size: 20px;
}

.count-pill {
    font-size: 12px;
    background: rgba(200, 62, 61, 0.1);
    color: var(--primary-red);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.btn-vault-action {
    background: var(--bg-dark);
    color: #FFF;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-vault-action:hover {
    background: var(--primary-red);
}

.vocab-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 992px) {
    .vocab-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .vocab-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .vocab-grid {
        grid-template-columns: 1fr;
    }
}

/* Pagination Controls */
.vault-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

.pagination-btn {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-red);
    color: #FFFFFF;
    border-color: var(--primary-red);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(200, 62, 61, 0.15);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #F3F4F6;
    border-color: #E5E7EB;
    color: #9CA3AF;
}

.pagination-info {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.vocab-card {
    background: #FFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}
.vocab-hanzi {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-red);
}
.vocab-pinyin {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}
.vocab-meaning {
    font-size: 13px;
    color: var(--text-main);
}

/* Pricing Section */
.pricing-section {
    padding: 90px 0;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    align-items: stretch;
}

.pricing-card {
    background: #FFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 36px 28px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}
.pricing-card:hover {
    transform: translateY(-5px);
}
.pricing-card.featured {
    border: 2px solid var(--primary-red);
    box-shadow: var(--shadow-accent);
}

.popular-ribbon {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-red);
    color: #FFF;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-name {
    font-family: var(--font-heading);
    font-size: 22px;
    margin-bottom: 8px;
}
.plan-price {
    font-size: 38px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}
.plan-price span {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}
.plan-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    min-height: 38px;
}

.plan-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
    flex-grow: 1;
}
.plan-features li {
    font-size: 14px;
    color: var(--text-main);
}
.plan-features li.disabled {
    color: #A0AEC0;
    text-decoration: line-through;
}

.btn-plan {
    width: 100%;
    text-align: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;

}
.btn-gold {
    background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
    color: #FFF;
    border: none;
}
.btn-gold:hover { opacity: 0.9; }

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s;
}
.modal-overlay.hidden {
    display: none;
    opacity: 0;
}

.modal-card {
    background: #FFF;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    padding: 36px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 16px; right: 20px;
    background: none; border: none;
    font-size: 28px; color: var(--text-muted);
    cursor: pointer;
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}
.modal-icon { font-size: 44px; display: block; margin-bottom: 8px; }
.modal-title { font-family: var(--font-heading); font-size: 22px; }
.modal-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.checkout-summary-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 20px;
}
.summary-row { display: flex; justify-content: space-between; font-weight: 600; }
.summary-price { color: var(--primary-red); }
.summary-divider { height: 1px; background: var(--border-color); margin: 12px 0; }
.summary-perks { font-size: 12px; color: var(--text-muted); }

.btn-full { width: 100%; text-align: center; padding: 14px; }
.security-note { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 12px; }

/* ==========================================
   Multi-Page Subpage Layouts & Flashcards
   ========================================== */

.nav-item.active {
    color: var(--primary-red) !important;
    font-weight: 600;
}

.page-hero {
    padding: 60px 0 40px;
    background: linear-gradient(180deg, rgba(200, 62, 61, 0.04) 0%, rgba(249, 246, 240, 0) 100%);
    border-bottom: 1px solid var(--border-color);
}

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

/* HSK Hub Grid */
.hsk-hub-section {
    padding: 60px 0;
}

.hsk-levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.hsk-hub-card {
    background: #FFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}
.hsk-hub-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.hsk-hub-card.pro-card {
    border: 1px solid #F5C06B;
    background: #FFFDF9;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.level-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.free-pill { background: #E6F4EA; color: #137333; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.pro-pill { background: #FEF3C7; color: #92400E; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }

.level-title { font-family: var(--font-heading); font-size: 24px; margin-bottom: 8px; }
.level-stats-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--primary-red); font-weight: 600; margin-bottom: 12px; }
.stat .num { font-weight: 800; font-size: 16px; }
.stat-sep { color: var(--border-color); }
.level-desc { font-size: 13px; color: var(--text-muted); flex-grow: 1; margin-bottom: 20px; }

.card-footer { display: flex; gap: 10px; }

/* HSK Detail Page */
.detail-banner {
    background: #FFF;
    border-bottom: 1px solid var(--border-color);
    padding: 40px 0;
}
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--primary-red); text-decoration: none; }
.detail-header-card { display: flex; justify-content: space-between; align-items: center; gap: 40px; flex-wrap: wrap; }
.detail-info { max-width: 650px; }
.detail-info h1 { font-family: var(--font-heading); font-size: 32px; margin: 10px 0; }
.detail-info p { font-size: 15px; color: var(--text-muted); }
.meta-pills { display: flex; gap: 10px; margin-top: 16px; }
.pill { font-size: 12px; background: var(--bg-main); border: 1px solid var(--border-color); padding: 4px 12px; border-radius: 20px; font-weight: 600; }
.pill.pro { background: #FFF6E5; border-color: #F5C06B; color: #8A5300; }
.pill.free { background: #E6F4EA; border-color: #A8DADC; color: #137333; }

.detail-cta-box { background: var(--bg-main); border: 1px solid var(--border-color); padding: 24px; border-radius: var(--radius-md); width: 340px; }
.cta-note { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 8px; }

/* Vocabulary Table */
.vocab-table-section { padding: 60px 0; }
.align-left { text-align: left; margin-bottom: 24px; }
.table-card { background: #FFF; border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.vocab-table { width: 100%; border-collapse: collapse; text-align: left; }
.vocab-table th, .vocab-table td { padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.vocab-table th { background: var(--bg-main); font-size: 13px; color: var(--text-muted); font-weight: 600; }
.hanzi-cell { font-family: var(--font-serif); font-size: 26px; font-weight: 700; color: var(--primary-red); white-space: nowrap; }
.pinyin-cell { font-size: 15px; font-weight: 600; color: var(--text-main); white-space: nowrap; }
.meaning-cell { font-size: 14px; color: var(--text-muted); }
.stroke-cell { font-size: 12px; background: var(--bg-main); padding: 4px 8px; border-radius: 4px; }
.btn-table-drill { background: none; border: 1px solid var(--border-color); padding: 6px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; transition: all 0.2s; }
.btn-table-drill:hover { background: var(--primary-red); color: #FFF; border-color: var(--primary-red); }

/* Flashcards Studio */
.flashcards-workshop { padding: 50px 0 80px; }
.workshop-mode-switcher { display: flex; justify-content: center; gap: 16px; margin-bottom: 40px; }
.switch-mode-btn { padding: 12px 24px; font-size: 15px; font-weight: 600; background: #FFF; border: 1px solid var(--border-color); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; }
.switch-mode-btn.active, .switch-mode-btn:hover { background: var(--bg-dark); color: #FFF; border-color: var(--bg-dark); }

.memory-card-container { display: flex; justify-content: center; margin-bottom: 30px; }
.flip-card-wrapper { width: 360px; height: 240px; perspective: 1000px; cursor: pointer; }
.flip-card-inner { position: relative; width: 100%; height: 100%; text-align: center; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); transform-style: preserve-3d; }
.flip-card-wrapper.flipped .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: var(--shadow-md); border: 2px solid var(--border-color); background: #FFF; }
.flip-card-back { transform: rotateY(180deg); background: var(--bg-main); border-color: var(--primary-red); }
.card-hint { position: absolute; top: 12px; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.card-hanzi { font-family: var(--font-serif); font-size: 64px; font-weight: 700; color: var(--primary-red); }
.card-pinyin-sub { font-size: 18px; color: var(--text-muted); font-weight: 500; margin-top: 4px; }
.card-pinyin-main { font-size: 28px; font-weight: 700; color: var(--text-main); }
.card-meaning-main { font-size: 20px; color: var(--primary-red); margin-top: 8px; font-weight: 600; }

.flip-controls { display: flex; align-items: center; justify-content: center; gap: 20px; }
.progress-indicator { font-size: 14px; font-weight: 600; color: var(--text-muted); }

.printable-card-box { background: #FFF; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 36px; max-width: 600px; margin: 0 auto; box-shadow: var(--shadow-sm); }
.margin-top { margin-top: 16px; }

/* FAQ Section */
.faq-section { padding: 80px 0; background: #FFF; border-top: 1px solid var(--border-color); }
.faq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; margin-top: 40px; }
.faq-item h3 { font-family: var(--font-heading); font-size: 18px; margin-bottom: 8px; }
.faq-item p { font-size: 14px; color: var(--text-muted); }

/* Themed Worksheets Section */
.megapack-banner-section { padding: 40px 0 20px; }
.megapack-card { background: linear-gradient(135deg, #FFF8F0 0%, #FFF0E0 100%); border: 2px dashed #F5C06B; border-radius: var(--radius-lg); padding: 36px; display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap; box-shadow: var(--shadow-sm); }
.megapack-info h2 { font-family: var(--font-heading); font-size: 28px; color: #8A5300; margin: 8px 0; }
.megapack-info p { font-size: 14px; color: #664614; max-width: 600px; }
.sparkle-badge { font-size: 12px; font-weight: 700; background: #FFE0B2; color: #E65100; padding: 4px 12px; border-radius: 12px; text-transform: uppercase; }

.themes-grid-section { padding: 40px 0 80px; }
.themes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.theme-card { background: #FFF; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 28px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: all 0.3s ease; }
.theme-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.theme-card.pro-theme { border: 1px solid #F5C06B; background: #FFFDF9; }
.theme-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.theme-icon { font-size: 32px; }
.theme-category { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }
.theme-title { font-family: var(--font-heading); font-size: 22px; margin-bottom: 8px; }
.theme-desc { font-size: 13px; color: var(--text-muted); flex-grow: 1; margin-bottom: 20px; }
.theme-footer { display: flex; justify-content: space-between; align-items: center; }
.vocab-count-tag { font-size: 12px; font-weight: 600; color: var(--primary-red); }



