/* ================================================================
   MHW 绘本市场 - Design System & Styles
   ================================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700;800;900&display=swap');

/* ---- CSS Variables / Design Tokens ---- */
:root {
    /* Primary Palette */
    --color-primary: #6366F1;
    --color-primary-light: #818CF8;
    --color-primary-dark: #4F46E5;
    --color-primary-50: #EEF2FF;
    --color-primary-100: #E0E7FF;
    --color-primary-200: #C7D2FE;

    /* Secondary */
    --color-secondary: #8B5CF6;
    --color-secondary-light: #A78BFA;

    /* Accent */
    --color-accent-green: #22C55E;
    --color-accent-green-dark: #16A34A;
    --color-accent-orange: #F97316;
    --color-accent-pink: #EC4899;
    --color-accent-cyan: #06B6D4;
    --color-accent-yellow: #EAB308;
    --color-accent-red: #EF4444;

    /* Neutrals */
    --color-bg: #F8FAFF;
    --color-bg-alt: #EEF2FF;
    --color-surface: #FFFFFF;
    --color-surface-hover: #F1F5F9;
    --color-text: #1E1B4B;
    --color-text-secondary: #475569;
    --color-text-muted: #64748B;
    --color-border: #E2E8F0;
    --color-border-light: #F1F5F9;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(99, 102, 241, 0.06);
    --shadow-md: 0 4px 12px rgba(99, 102, 241, 0.08);
    --shadow-lg: 0 8px 30px rgba(99, 102, 241, 0.12);
    --shadow-xl: 0 20px 60px rgba(99, 102, 241, 0.15);
    --shadow-card: 0 2px 8px rgba(99, 102, 241, 0.06), 0 0 0 1px rgba(99, 102, 241, 0.04);
    --shadow-card-hover: 0 12px 40px rgba(99, 102, 241, 0.15), 0 0 0 1px rgba(99, 102, 241, 0.08);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;

    /* Typography */
    --font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    --font-size-5xl: 3.5rem;

    /* Transition */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Z-index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 1000;
    --z-toast: 1100;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

ul,
ol {
    list-style: none;
}

/* ---- Layout ---- */
#app {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    overflow-x: hidden;
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-title h2 {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.section-title p {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

section {
    padding: var(--space-4xl) 0;
}

/* ---- Gradient Text ---- */
.gradient-text {
    color: var(--color-primary); /* Fallback: solid color when background-clip:text unsupported */
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
    .gradient-text {
        background: linear-gradient(135deg, var(--color-primary), var(--color-accent-pink), var(--color-accent-orange));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        color: transparent;
    }
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-primary);
    border: 2px solid var(--color-primary-200);
}

.btn-secondary:hover {
    background: var(--color-primary-50);
    border-color: var(--color-primary-light);
}

.btn-green {
    background: linear-gradient(135deg, var(--color-accent-green), var(--color-accent-green-dark));
    color: #fff;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.35);
}

.btn-green:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.45);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: #fff;
}

.btn-lg {
    padding: 16px 36px;
    font-size: var(--font-size-lg);
}

.btn-sm {
    padding: 8px 18px;
    font-size: var(--font-size-sm);
}

/* Constrain SVG icons inside buttons */
.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-lg svg {
    width: 20px;
    height: 20px;
}

/* ---- Page Header (shared across sub-pages) ---- */
.page-header {
    margin-bottom: var(--space-xl);
}

.page-header h1 {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-xs);
}

.page-header p {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
}

.page-header .btn {
    margin-bottom: var(--space-md);
}

/* ---- Category / Books Page ---- */
.category-page {
    padding-top: 120px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.category-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    width: 100%;
    max-width: 100%;
}

.filter-categories {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    max-width: 100%;
}

.filter-cat-btn {
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-cat-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-primary-200);
    background: var(--color-primary-50);
}

.filter-cat-btn.active {
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.filter-controls {
    display: flex;
    gap: var(--space-sm);
}

.filter-select {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: inherit;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary-light);
}

/* ---- Books Grid ---- */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
    gap: var(--space-lg);
    min-height: 200px;
    width: 100%;
}

/* ---- Loading Placeholder ---- */
.loading-placeholder {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4xl) 0;
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
}

/* ---- Empty State ---- */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-4xl) 0;
    text-align: center;
}

.empty-state h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
}

/* ---- Pagination ---- */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: var(--space-2xl);
}

/* ---- Floating Background Shapes ---- */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    animation: floatShape 20s ease-in-out infinite;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: var(--color-primary);
    top: -10%;
    right: -5%;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--color-accent-pink);
    top: 40%;
    left: -5%;
    animation-delay: -5s;
}

.shape-3 {
    width: 400px;
    height: 400px;
    background: var(--color-accent-cyan);
    bottom: -10%;
    right: 30%;
    animation-delay: -10s;
}

.shape-4 {
    width: 250px;
    height: 250px;
    background: var(--color-accent-orange);
    top: 60%;
    right: -3%;
    animation-delay: -15s;
}

@keyframes floatShape {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(30px, -30px) rotate(5deg);
    }

    50% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }

    75% {
        transform: translate(15px, 15px) rotate(3deg);
    }
}

/* ================================================================
   NAVIGATION
   ================================================================ */
.navbar {
    position: fixed;
    top: 12px;
    left: 16px;
    right: 16px;
    z-index: var(--z-sticky);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(99, 102, 241, 0.08);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-lg);
}

/* Fix: Raise navbar above overlay when mobile menu is open.
   backdrop-filter creates a stacking context, trapping nav-links
   below the overlay (z-index 202) on strict mobile browsers. */
.navbar.nav-menu-open {
    z-index: calc(var(--z-sticky) + 10);
}

/* Ensure nav-links and children are always interactive when open */
.nav-links.nav-open {
    pointer-events: auto;
    touch-action: auto;
}

.nav-links.nav-open a,
.nav-links.nav-open button {
    pointer-events: auto;
    touch-action: manipulation;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: var(--font-size-xl);
    color: var(--color-text);
}

.nav-brand img {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
}

.nav-brand-text {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.nav-links a:hover {
    color: var(--color-primary);
    background: var(--color-primary-50);
}

.nav-cta-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)) !important;
    color: #fff !important;
    padding: 10px 22px !important;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
    font-size: var(--font-size-sm);
    font-weight: 600;
    white-space: nowrap;
}

.nav-cta-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4) !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* ================================================================
   HERO SECTION
   ================================================================ */
.hero {
    padding: 160px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(180deg,
            var(--color-primary-50) 0%,
            var(--color-bg) 100%);
    z-index: -1;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--space-lg);
}

.hero-badge svg {
    width: 16px;
    height: 16px;
}

.hero-title {
    font-size: var(--font-size-5xl);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-lg);
    color: var(--color-text);
    -webkit-text-fill-color: var(--color-text); /* Ensure non-gradient text visible on all browsers */
}

.hero-description {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-xl);
    max-width: 540px;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}

.hero-search {
    display: flex;
    align-items: center;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 6px 6px 6px 20px;
    box-shadow: var(--shadow-lg);
    max-width: 520px;
    width: 100%;
    margin-bottom: var(--space-2xl);
    transition: border-color var(--transition-base);
}

.hero-search:focus-within {
    border-color: var(--color-primary-light);
}

.hero-search svg {
    width: 20px;
    height: 20px;
    color: var(--color-text-muted);
    flex-shrink: 0;
    margin-right: var(--space-sm);
}

.hero-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: var(--font-size-base);
    font-family: inherit;
    color: var(--color-text);
    background: transparent;
    padding: 10px 0;
}

.hero-search input::placeholder {
    color: var(--color-text-muted);
}

.hero-search .btn {
    flex-shrink: 0;
}

.hero-stats {
    display: flex;
    gap: var(--space-2xl);
}

.hero-stat {
    text-align: left;
}

.stat-number {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--color-primary);
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
}

.hero-image-wrapper {
    position: relative;
}

.hero-image-wrapper img {
    width: 100%;
    max-width: 560px;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
}

.hero-floating-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: floatCard 4s ease-in-out infinite;
}

.hero-floating-card .card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-floating-card .card-icon.indigo {
    background: rgba(99, 102, 241, 0.12);
    color: var(--color-primary);
}

.hero-floating-card .card-icon.pink {
    background: rgba(236, 72, 153, 0.12);
    color: var(--color-accent-pink);
}

.hero-floating-card .card-icon.green {
    background: rgba(34, 197, 94, 0.12);
    color: var(--color-accent-green);
}

.hero-floating-card .card-icon.orange {
    background: rgba(249, 115, 22, 0.12);
    color: var(--color-accent-orange);
}

.hero-floating-card .card-icon svg {
    width: 18px;
    height: 18px;
}

.hero-floating-card .card-text {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text);
}

.hero-floating-card .card-subtext {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.card-1 {
    top: 10%;
    left: -10%;
    animation-delay: 0s;
}

.card-2 {
    bottom: 20%;
    right: -5%;
    animation-delay: -1.3s;
}

.card-3 {
    bottom: 5%;
    left: 5%;
    animation-delay: -2.6s;
}

@keyframes floatCard {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

/* ================================================================
   CATEGORIES SECTION
   ================================================================ */
.categories {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-lg);
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-xl) var(--space-md);
    border-radius: var(--radius-xl);
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: all var(--transition-base);
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--color-primary-200);
}

.category-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-base);
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-icon svg {
    width: 28px;
    height: 28px;
}

.category-icon.ci-story {
    background: rgba(99, 102, 241, 0.12);
    color: var(--color-primary);
}

.category-icon.ci-education {
    background: rgba(34, 197, 94, 0.12);
    color: var(--color-accent-green);
}

.category-icon.ci-science {
    background: rgba(6, 182, 212, 0.12);
    color: var(--color-accent-cyan);
}

.category-icon.ci-art {
    background: rgba(236, 72, 153, 0.12);
    color: var(--color-accent-pink);
}

.category-icon.ci-culture {
    background: rgba(249, 115, 22, 0.12);
    color: var(--color-accent-orange);
}

.category-icon.ci-music {
    background: rgba(139, 92, 246, 0.12);
    color: var(--color-secondary);
}

.category-card h3 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
}

.category-card .cat-count {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: -8px;
}

/* ================================================================
   FEATURED / MARKETPLACE GRID
   ================================================================ */
.marketplace {
    background: var(--color-bg);
}

.marketplace-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.marketplace-tabs {
    display: flex;
    gap: 4px;
    background: var(--color-surface);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
}

.marketplace-tab {
    padding: 10px 22px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.marketplace-tab:hover {
    color: var(--color-text);
}

.marketplace-tab.active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.marketplace-sort {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.marketplace-sort select {
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    background: var(--color-surface);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition-fast);
}

.marketplace-sort select:focus {
    border-color: var(--color-primary-light);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.book-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
}

.book-card-image {
    position: relative;
    padding-top: 65%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-primary-50), var(--color-primary-100));
}

.book-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.book-card:hover .book-card-image img {
    transform: scale(1.06);
}

.book-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
    z-index: 2;
}

.book-badge.hot {
    background: linear-gradient(135deg, var(--color-accent-red), var(--color-accent-orange));
    color: #fff;
}

.book-badge.new {
    background: linear-gradient(135deg, var(--color-accent-green), var(--color-accent-cyan));
    color: #fff;
}

.book-badge.ad {
    background: linear-gradient(135deg, var(--color-accent-yellow), var(--color-accent-orange));
    color: #fff;
}

.book-badge.free {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
}

.book-card-body {
    padding: var(--space-md) var(--space-md) var(--space-lg);
}

.book-card-title {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card-author {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--space-sm);
}

.book-card-author img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.book-card-author span {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.book-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-sm);
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.book-rating .stars {
    display: flex;
    gap: 1px;
}

.book-rating .stars svg {
    width: 14px;
    height: 14px;
    fill: var(--color-accent-yellow);
    stroke: var(--color-accent-yellow);
}

.book-rating .stars svg.empty {
    fill: none;
    stroke: var(--color-border);
}

.book-rating .rating-count {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-left: 2px;
}

.book-price {
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: var(--color-accent-red);
}

.book-price.free {
    color: var(--color-accent-green);
    font-size: var(--font-size-base);
}

.book-card-stats {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border-light);
}

.book-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.book-stat svg {
    width: 13px;
    height: 13px;
}

/* ================================================================
   HOW IT WORKS
   ================================================================ */
.how-it-works {
    background: var(--color-surface);
}

.hiw-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
    position: relative;
}

.hiw-grid::before {
    content: '';
    position: absolute;
    top: 44px;
    left: 12.5%;
    right: 12.5%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent-pink), var(--color-accent-orange), var(--color-accent-green));
    border-radius: 3px;
    z-index: 0;
}

.hiw-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hiw-number {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-2xl);
    font-weight: 900;
    color: #fff;
    margin-bottom: var(--space-lg);
    position: relative;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.hiw-number::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--color-surface);
    z-index: -1;
}

.hiw-step:nth-child(1) .hiw-number {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

.hiw-step:nth-child(2) .hiw-number {
    background: linear-gradient(135deg, var(--color-accent-pink), #D946EF);
}

.hiw-step:nth-child(3) .hiw-number {
    background: linear-gradient(135deg, var(--color-accent-orange), var(--color-accent-red));
}

.hiw-step:nth-child(4) .hiw-number {
    background: linear-gradient(135deg, var(--color-accent-green), var(--color-accent-cyan));
}

.hiw-step h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}

.hiw-step p {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    max-width: 220px;
}

/* ================================================================
   RANKINGS / LEADERBOARD
   ================================================================ */
.rankings {
    background: var(--color-bg);
}

.rankings-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.ranking-panel {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border-light);
    overflow: hidden;
}

.ranking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--color-border-light);
}

.ranking-header h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.ranking-header h3 svg {
    width: 22px;
    height: 22px;
}

.ranking-header .see-all {
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.ranking-header .see-all:hover {
    opacity: 0.7;
}

.ranking-list {
    padding: var(--space-md) var(--space-xl);
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item:hover {
    background: var(--color-primary-50);
    margin: 0 calc(var(--space-xl) * -1);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
}

.rank-number {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 800;
    flex-shrink: 0;
}

.rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
}

.rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
    color: #fff;
}

.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
    color: #fff;
}

.rank-default {
    background: var(--color-bg);
    color: var(--color-text-muted);
}

.rank-info {
    flex: 1;
    min-width: 0;
}

.rank-info .rank-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-info .rank-detail {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.rank-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary-100), var(--color-primary-200));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-primary);
    flex-shrink: 0;
}

.rank-value {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-primary);
    flex-shrink: 0;
}

/* ================================================================
   CREATOR SECTION
   ================================================================ */
.creator-section {
    background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
}

.creator-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

.creator-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--color-border-light);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.creator-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
}

.creator-card.featured-creator {
    border-color: var(--color-primary-200);
    background: linear-gradient(180deg, var(--color-primary-50), var(--color-surface));
    position: relative;
}

.creator-card.featured-creator::before {
    content: '推荐作者';
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    font-size: var(--font-size-xs);
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.creator-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto var(--space-md);
    overflow: hidden;
    border: 3px solid var(--color-primary-200);
}

.creator-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.creator-name {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
}

.creator-bio {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
    line-height: 1.6;
}

.creator-stats-row {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-md);
    padding: var(--space-md) 0;
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
}

.creator-stat-item .cs-value {
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: var(--color-text);
}

.creator-stat-item .cs-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ================================================================
   COMMISSION / PRICING INFO
   ================================================================ */
.commission-section {
    background: var(--color-surface);
}

.commission-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-xl);
}

.commission-card {
    background: var(--color-bg);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-base);
    position: relative;
}

.commission-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.commission-card.recommended {
    border-color: var(--color-primary-200);
    background: linear-gradient(180deg, var(--color-primary-50), var(--color-bg));
}

.commission-card.recommended::before {
    content: '推荐';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: #fff;
    padding: 4px 16px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
}

.commission-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
}

.commission-icon svg {
    width: 32px;
    height: 32px;
}

.commission-icon.ci-basic {
    background: rgba(99, 102, 241, 0.12);
    color: var(--color-primary);
}

.commission-icon.ci-pro {
    background: rgba(34, 197, 94, 0.12);
    color: var(--color-accent-green);
}

.commission-icon.ci-premium {
    background: rgba(249, 115, 22, 0.12);
    color: var(--color-accent-orange);
}

.commission-card h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.commission-rate {
    font-size: var(--font-size-4xl);
    font-weight: 900;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.commission-rate span {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text-muted);
}

.commission-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
}

.commission-features {
    text-align: left;
}

.commission-features li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.commission-features li svg {
    width: 16px;
    height: 16px;
    color: var(--color-accent-green);
    flex-shrink: 0;
}

/* ================================================================
   ADVERTISEMENT PREVIEW
   ================================================================ */
.ad-section {
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-primary-50) 50%, var(--color-bg) 100%);
}

.ad-banner {
    background: linear-gradient(135deg, var(--color-primary), #7C3AED, var(--color-accent-pink));
    border-radius: var(--radius-2xl);
    padding: var(--space-3xl) var(--space-2xl);
    color: #fff;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.3);
}

.ad-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.ad-banner-text h3 {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    margin-bottom: var(--space-md);
    line-height: 1.3;
}

.ad-banner-text p {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

.ad-features-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.ad-feature-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.ad-feature-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.btn-white {
    background: #fff;
    color: var(--color-primary);
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.ad-banner-visual {
    display: flex;
    justify-content: center;
    position: relative;
}

.ad-mockup {
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ================================================================
   REVIEWS SECTION
   ================================================================ */
.reviews-section {
    background: var(--color-surface);
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

.review-card {
    background: var(--color-bg);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-base);
}

.review-card:hover {
    box-shadow: var(--shadow-md);
}

.review-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.review-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary-100), var(--color-primary-200));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--color-primary);
    flex-shrink: 0;
}

.review-user-info .review-name {
    font-size: var(--font-size-base);
    font-weight: 600;
}

.review-user-info .review-date {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.review-stars {
    display: flex;
    gap: 2px;
    margin-bottom: var(--space-md);
}

.review-stars svg {
    width: 16px;
    height: 16px;
    fill: var(--color-accent-yellow);
    stroke: var(--color-accent-yellow);
}

.review-book-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--color-primary-50);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.review-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.8;
}

/* ================================================================
   CTA / CALL TO ACTION
   ================================================================ */
.cta-section {
    padding: var(--space-4xl) 0;
}

.cta-box {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary), var(--color-accent-pink));
    border-radius: var(--radius-2xl);
    padding: var(--space-3xl) var(--space-2xl);
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent);
    border-radius: 50%;
}

.cta-box::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05), transparent);
    border-radius: 50%;
}

.cta-box h2 {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
}

.cta-box p {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin-bottom: var(--space-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    position: relative;
    z-index: 1;
}

.btn-white-outline {
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    background: transparent;
}

.btn-white-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.8);
}

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
    background: var(--color-text);
    color: rgba(255, 255, 255, 0.7);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-2xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--space-md);
}

.footer-brand img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
}

.footer-brand span {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: #fff;
}

.footer-desc {
    font-size: var(--font-size-sm);
    line-height: 1.8;
    margin-bottom: var(--space-lg);
}

.footer h4 {
    color: #fff;
    font-size: var(--font-size-base);
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-links a {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.6);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.4);
}

/* ================================================================
   SCROLL REVEAL ANIMATIONS
   ================================================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

.reveal-delay-4 {
    transition-delay: 0.4s;
}

.reveal-delay-5 {
    transition-delay: 0.5s;
}

.reveal-delay-6 {
    transition-delay: 0.6s;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-description {
        margin: 0 auto var(--space-xl);
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-visual {
        margin-top: var(--space-xl);
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .books-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .rankings-wrapper {
        grid-template-columns: 1fr;
    }

    .commission-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .ad-banner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .ad-features-list {
        justify-content: center;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --font-size-5xl: 2.5rem;
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.5rem;
    }

    /* Mobile nav: handled by T6.4 off-canvas hamburger below */
    .nav-toggle {
        display: flex;
    }

    .hero {
        padding: 130px 0 60px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .books-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hiw-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hiw-grid::before {
        display: none;
    }

    .creator-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .reviews-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }

    .cta-actions {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-md);
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: var(--space-md) var(--space-xl);
        justify-content: center;
    }

    .marketplace-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .marketplace-tabs {
        overflow-x: auto;
    }
}

/* ================================================================
   PAGE LOADING / SPINNER
   ================================================================ */
.page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-placeholder {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--color-text-muted);
    font-size: var(--font-size-lg);
}

.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    grid-column: 1 / -1;
}

.empty-state h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.empty-text {
    text-align: center;
    color: var(--color-text-muted);
    padding: var(--space-xl);
}

.section-more {
    text-align: center;
    margin-top: var(--space-xl);
}

/* ================================================================
   PAGE HEADER (shared across subpages)
   ================================================================ */
.page-header {
    padding: 120px 0 var(--space-xl);
}

.page-header h1 {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    margin: var(--space-md) 0 var(--space-sm);
}

.page-header p {
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
}

/* ================================================================
   AUTH PAGE (Login / Register)
   ================================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 0 60px;
}

.auth-card {
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-border-light);
    overflow-x: hidden;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-back {
    display: inline-flex;
    margin-bottom: var(--space-md);
}

.auth-back svg {
    width: 18px;
    height: 18px;
}

.auth-logo {
    margin-bottom: var(--space-md);
}

.auth-logo img {
    margin: 0 auto;
    border-radius: var(--radius-lg);
}

.auth-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    margin-bottom: var(--space-xs);
}

.auth-header p {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.auth-tabs {
    display: flex;
    background: var(--color-bg);
    border-radius: var(--radius-full);
    padding: 4px;
    margin-bottom: var(--space-xl);
    border: 1px solid var(--color-border-light);
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.auth-tab.active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.form-group label svg {
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-bg);
    transition: border-color var(--transition-fast);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-primary-light);
    background: var(--color-surface);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 4px;
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.auth-submit {
    width: 100%;
    justify-content: center;
    margin-top: var(--space-sm);
}

/* ---- Captcha ---- */
.captcha-row {
    display: flex;
    gap: var(--space-md);
    align-items: stretch;
}

.captcha-row .captcha-input {
    flex: 1;
    width: auto;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-bg);
    transition: border-color var(--transition-fast);
    outline: none;
}

.captcha-row .captcha-input:focus {
    border-color: var(--color-primary-light);
    background: var(--color-surface);
}

.captcha-img-wrap {
    position: relative;
    flex-shrink: 0;
    width: 140px;
    height: 48px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--color-border);
    background: #e6f0f5;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.captcha-img-wrap:hover {
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.captcha-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s ease;
}

.captcha-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(230, 240, 245, 0.7);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-xl);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.auth-footer a {
    color: var(--color-primary);
    font-weight: 600;
    margin-left: var(--space-xs);
}

/* ================================================================
   BOOK DETAIL PAGE
   ================================================================ */
.book-detail-page {
    padding-top: 80px;
}

.book-detail-back {
    margin-bottom: var(--space-xl);
    padding-top: var(--space-xl);
}

.book-detail-back svg {
    width: 16px;
    height: 16px;
}

.book-detail-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: var(--space-2xl);
    align-items: start;
}

.book-detail-cover {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.book-detail-cover img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
}

.book-detail-actions {
    margin-top: var(--space-lg);
    text-align: center;
}

.book-detail-buy {
    width: 100%;
    justify-content: center;
    font-size: var(--font-size-lg) !important;
    padding: 16px 24px !important;
}

.book-detail-buy svg {
    width: 20px;
    height: 20px;
}

.detail-original-price {
    display: block;
    text-decoration: line-through;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin-top: var(--space-sm);
}

.book-detail-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.detail-stat {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
}

.detail-stat svg {
    width: 20px;
    height: 20px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.ds-val {
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: var(--color-text);
}

.ds-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.book-detail-title {
    font-size: var(--font-size-3xl);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: var(--space-sm);
}

.book-detail-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
}

.book-detail-author {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
    margin-bottom: var(--space-lg);
}

.book-detail-author:hover {
    background: var(--color-primary-50);
}

.detail-author-name {
    font-weight: 700;
    font-size: var(--font-size-base);
}

.detail-author-level {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.book-detail-rating-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.detail-rating-num {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--color-accent-yellow);
}

.book-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.meta-item {
    display: flex;
    gap: var(--space-sm);
}

.meta-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    min-width: 48px;
}

.meta-value {
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.book-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.detail-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: var(--color-primary-50);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    color: var(--color-primary);
    font-weight: 600;
}

.detail-tag svg {
    width: 12px;
    height: 12px;
}

.book-detail-description {
    margin-bottom: var(--space-xl);
}

.book-detail-description h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.book-detail-description p {
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.book-detail-reviews h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--space-lg);
}

.review-total {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    font-weight: 400;
}

/* ================================================================
   PAYMENT MODAL
   ================================================================ */
.payment-options {
    padding: var(--space-md) 0;
}

.payment-amount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.payment-label {
    color: var(--color-text-secondary);
}

.payment-price {
    font-size: var(--font-size-2xl);
    font-weight: 900;
    color: var(--color-accent-red);
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.payment-method {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.payment-method.active {
    border-color: var(--color-primary);
    background: var(--color-primary-50);
}

.payment-method input {
    display: none;
}

.pm-icon {
    font-size: var(--font-size-2xl);
}

/* ================================================================
   CATEGORY / FILTER PAGE
   ================================================================ */
.category-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.filter-categories {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.filter-cat-btn {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-cat-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-primary-200);
}

.filter-cat-btn.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.filter-controls {
    display: flex;
    gap: var(--space-sm);
}

.filter-select {
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    background: var(--color-surface);
    cursor: pointer;
    outline: none;
}

.search-bar-inline {
    margin-bottom: var(--space-xl);
}

/* ================================================================
   RANKINGS PAGE
   ================================================================ */
.rankings-tabs {
    display: flex;
    gap: 4px;
    background: var(--color-surface);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    max-width: 300px;
    margin-bottom: var(--space-lg);
}

.rankings-filters {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.ranking-panel.full-width {
    grid-column: 1 / -1;
}

.rank-book-cover {
    width: 48px;
    height: 64px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.rank-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-stats-right {
    text-align: right;
    flex-shrink: 0;
}

.rank-sublabel {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ================================================================
   PROFILE PAGE
   ================================================================ */
.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.profile-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    border: 1px solid var(--color-border-light);
    margin-bottom: var(--space-lg);
}

.profile-avatar {
    margin-bottom: var(--space-md);
}

.profile-name {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.profile-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.profile-phone svg {
    width: 14px;
    height: 14px;
}

.profile-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
}

.creator-badge {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    color: var(--color-primary);
}

.profile-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
}

.profile-nav-item:hover {
    background: var(--color-primary-50);
    color: var(--color-primary);
}

.profile-nav-item.active {
    background: var(--color-primary-50);
    color: var(--color-primary);
    font-weight: 600;
}

.profile-nav-item svg {
    width: 18px;
    height: 18px;
}

.logout-btn {
    color: var(--color-accent-red) !important;
}

.profile-content {
    min-height: 400px;
}

.profile-section {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--color-border-light);
    margin-bottom: var(--space-lg);
}

.profile-section h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--space-lg);
}

.profile-form .btn {
    margin-top: var(--space-md);
}

/* ================================================================
   PURCHASES PAGE
   ================================================================ */
.purchases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.purchase-card {
    display: flex;
    gap: var(--space-md);
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    border: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: all var(--transition-base);
}

.purchase-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.purchase-cover {
    width: 80px;
    height: 100px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.purchase-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.purchase-info {
    flex: 1;
    min-width: 0;
}

.purchase-title {
    font-weight: 700;
    margin-bottom: var(--space-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.purchase-meta {
    display: flex;
    gap: var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.purchase-download svg {
    width: 14px;
    height: 14px;
}

/* ================================================================
   DASHBOARD PAGE (Creator Center) — Redesigned
   ================================================================ */
.dashboard-page {
    padding-top: 90px;
    padding-bottom: calc(var(--space-3xl) + 72px); /* Account for mobile bottom nav */
}

/* ---- Welcome Hero Banner ---- */
.dash-hero {
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    margin-bottom: var(--space-xl);
}

.dash-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary), var(--color-accent-pink));
    opacity: 0.92;
}

.dash-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
}

.dash-hero-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl) var(--space-2xl);
    z-index: 1;
}

.dash-hero-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.dash-hero-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.dash-hero-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.dash-hero-avatar span {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dash-hero-info h1 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dash-hero-level {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.dash-hero-back {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(8px);
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #fff !important;
    flex-shrink: 0;
}

.dash-hero-back:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

/* ---- Stats Overview (Redesigned) ---- */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.dash-stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-lg) var(--space-xl);
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.dash-stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--transition-base);
    border-radius: inherit;
}

.dash-stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.dash-stat-card:hover::before {
    opacity: 1;
}

.dash-stat-clickable {
    cursor: pointer;
}

.dash-stat-clickable:hover {
    border-color: rgba(34, 197, 94, 0.3);
}

.dash-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-stat-icon svg {
    width: 24px;
    height: 24px;
}

.ds-icon-primary {
    background: rgba(99, 102, 241, 0.12);
    color: var(--color-primary);
}

.ds-icon-green {
    background: rgba(34, 197, 94, 0.12);
    color: var(--color-accent-green);
}

.ds-icon-orange {
    background: rgba(249, 115, 22, 0.12);
    color: var(--color-accent-orange);
}

.ds-icon-pink {
    background: rgba(236, 72, 153, 0.12);
    color: var(--color-accent-pink);
}

.dash-stat-info {
    flex: 1;
    min-width: 0;
}

.dash-stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.dash-stat-action {
    font-size: 10px;
    color: var(--color-primary);
    font-weight: 600;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.dash-stat-clickable:hover .dash-stat-action {
    opacity: 1;
}

.dash-stat-val {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

/* ---- Quick Actions ---- */
.dashboard-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.dash-action-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.dash-action-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--color-primary-200);
}

.dash-action-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.dash-action-primary:hover {
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    border-color: transparent;
}

.dash-action-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-primary);
    flex-shrink: 0;
}

.dash-action-icon svg {
    width: 22px;
    height: 22px;
}

.dash-action-primary .dash-action-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.dash-action-text {
    display: flex;
    flex-direction: column;
}

.dash-action-text strong {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--color-text);
}

.dash-action-primary .dash-action-text strong {
    color: #fff;
}

.dash-action-text span {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.dash-action-primary .dash-action-text span {
    color: rgba(255, 255, 255, 0.8);
}

/* ---- Dashboard Section ---- */
.dashboard-section {
    margin-bottom: var(--space-xl);
}

.dashboard-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.dashboard-section-header h3 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
}

.dashboard-section-header h3 svg {
    width: 20px;
    height: 20px;
    color: var(--color-primary);
}

/* ---- Mobile Book Cards ---- */
.my-books-mobile {
    display: none;
    flex-direction: column;
    gap: var(--space-md);
}

.mb-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border-light);
    padding: var(--space-lg);
    transition: box-shadow var(--transition-base);
}

.mb-card:hover {
    box-shadow: var(--shadow-md);
}

.mb-card-top {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.mb-card-cover {
    width: 56px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    border: 1px solid var(--color-border-light);
}

.mb-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mb-card-title {
    font-weight: 700;
    font-size: var(--font-size-base);
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mb-card-id {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.mb-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.mb-card-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.mb-stat-label {
    font-size: 11px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.mb-stat-val {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text);
}

.mb-card-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.mb-card-actions .btn {
    flex: 1;
    justify-content: center;
    min-width: 0;
    white-space: nowrap;
}

/* ---- My Books Table ---- */
.my-books-table {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border-light);
    overflow: hidden;
}

.my-books-header {
    display: grid;
    grid-template-columns: 2fr 0.8fr 0.8fr 0.8fr 0.8fr 1.5fr;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-xl);
    background: var(--color-bg);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border-light);
}

.my-books-row {
    display: grid;
    grid-template-columns: 2fr 0.8fr 0.8fr 0.8fr 0.8fr 1.5fr;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-xl);
    align-items: center;
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition-fast);
    font-size: var(--font-size-sm);
}

.my-books-row:hover {
    background: var(--color-primary-50);
}

.my-books-row:last-child {
    border-bottom: none;
}

.my-book-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 0;
}

.my-book-thumb {
    width: 48px;
    height: 64px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.my-book-title {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.my-book-id {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
}

.status-draft {
    background: rgba(100, 116, 139, 0.1);
    color: var(--color-text-muted);
}

.status-pending {
    background: rgba(249, 115, 22, 0.1);
    color: var(--color-accent-orange);
}

.status-approved {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-accent-green);
}

.status-rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-accent-red);
}

.status-removed {
    background: rgba(100, 116, 139, 0.1);
    color: var(--color-text-muted);
}

.my-book-actions {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.my-book-actions .btn {
    white-space: nowrap;
    padding: 6px 12px;
    font-size: var(--font-size-xs);
}

.my-book-actions .btn svg {
    width: 14px;
    height: 14px;
}

/* ---- Warning Button ---- */
.btn-warning {
    background: linear-gradient(135deg, var(--color-accent-orange), #EA580C);
    color: #fff;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

.btn-warning:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ---- Danger Button ---- */
.btn-danger {
    background: linear-gradient(135deg, var(--color-accent-red), #DC2626);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ---- Delete Confirmation Modal ---- */
.modal-danger .modal-header {
    border-bottom-color: rgba(239, 68, 68, 0.15);
}

.delete-confirm-content {
    text-align: center;
    padding: var(--space-md) 0;
}

.delete-confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-accent-red);
    margin-bottom: var(--space-lg);
    animation: deleteIconPulse 2s ease-in-out infinite;
}

.delete-confirm-icon svg {
    width: 32px;
    height: 32px;
}

.delete-confirm-content p {
    font-size: var(--font-size-base);
    color: var(--color-text);
    margin-bottom: var(--space-sm);
    line-height: 1.6;
}

.delete-confirm-content p strong {
    color: var(--color-primary);
}

.delete-confirm-warning {
    font-size: var(--font-size-sm) !important;
    color: var(--color-accent-red) !important;
    font-weight: 500;
}

@keyframes deleteIconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

/* ================================================================
   UPLOAD PAGE
   ================================================================ */
.upload-form-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--space-xl);
}

.upload-form-main {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--color-border-light);
}

.upload-form-side {
    position: sticky;
    top: 100px;
}

.file-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-2xl);
    border: 3px dashed var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-bg);
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
    border-color: var(--color-primary);
    background: var(--color-primary-50);
}

.file-drop-zone svg {
    width: 48px;
    height: 48px;
    color: var(--color-primary);
}

.file-drop-zone p {
    color: var(--color-text-secondary);
    font-weight: 600;
}

.file-selected {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.file-selected svg {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.file-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.file-size {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.upload-preview {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    border: 1px solid var(--color-border-light);
    margin-top: var(--space-lg);
}

.upload-preview h4 {
    font-size: var(--font-size-base);
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.upload-preview-placeholder {
    text-align: center;
    padding: var(--space-xl);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.upload-form-footer {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border-light);
}

/* ---- Upload Progress Bar ---- */
.upload-progress-area {
    margin-top: var(--space-lg);
    padding: var(--space-lg) var(--space-xl);
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border-light);
    animation: progressFadeIn 0.3s ease-out;
}

@keyframes progressFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.upload-progress-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
}

.upload-progress-percent {
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}

.upload-progress-bar-track {
    width: 100%;
    height: 12px;
    background: var(--color-bg);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid var(--color-border-light);
}

.upload-progress-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light), var(--color-accent-cyan));
    background-size: 200% 100%;
    transition: width 0.35s ease;
    position: relative;
    animation: progressShimmer 2s linear infinite;
}

@keyframes progressShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.upload-progress-bar-fill.server-processing {
    animation: progressPulse 1.2s ease-in-out infinite;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent-cyan), var(--color-primary));
    background-size: 100% 100%;
}

@keyframes progressPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.55;
    }
}

.upload-progress-detail {
    margin-top: var(--space-xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

/* ================================================================
   CREATOR HOME PAGE
   ================================================================ */
.creator-hero {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    padding: var(--space-2xl);
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--color-border-light);
    margin-bottom: var(--space-2xl);
}

.creator-hero-info h1 {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    margin-bottom: var(--space-xs);
}

.creator-hero-level {
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.creator-hero-bio {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.6;
    margin-bottom: var(--space-lg);
}

.creator-hero-stats {
    display: flex;
    gap: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.chs-item {
    text-align: center;
}

.chs-val {
    font-size: var(--font-size-xl);
    font-weight: 800;
    display: block;
}

.chs-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.creator-works h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--space-lg);
}

/* ================================================================
   TOAST NOTIFICATIONS
   ================================================================ */
.toast-container {
    position: fixed;
    top: 80px;
    right: var(--space-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-border-light);
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s ease;
    min-width: 300px;
    max-width: 420px;
}

.toast.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast.toast-hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    flex-shrink: 0;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
}

.toast-success .toast-icon {
    color: var(--color-accent-green);
}

.toast-error .toast-icon {
    color: var(--color-accent-red);
}

.toast-warning .toast-icon {
    color: var(--color-accent-orange);
}

.toast-info .toast-icon {
    color: var(--color-primary);
}

.toast-message {
    flex: 1;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text);
}

.toast-close {
    flex-shrink: 0;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity var(--transition-fast);
    padding: 4px;
}

.toast-close:hover {
    opacity: 1;
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-overlay.modal-open {
    opacity: 1;
}

.modal-overlay.modal-closing {
    opacity: 0;
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    max-width: 480px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s ease;
}

.modal-open .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--color-border-light);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.modal-close {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
    padding: var(--space-xs);
}

.modal-close:hover {
    opacity: 1;
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: var(--space-lg) var(--space-xl);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--color-border-light);
}

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: var(--space-xl);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--color-primary-50);
    border-color: var(--color-primary-200);
    color: var(--color-primary);
}

.pagination-btn.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-dots {
    width: 40px;
    text-align: center;
    color: var(--color-text-muted);
}

/* ================================================================
   STAR RATING PICKER
   ================================================================ */
.rating-picker {
    display: flex;
    gap: 4px;
    margin-bottom: var(--space-md);
}

.rating-star {
    cursor: pointer;
    transition: transform var(--transition-fast);
    color: var(--color-border);
}

.rating-star.active {
    color: var(--color-accent-yellow);
}

.rating-star:hover {
    transform: scale(1.2);
}

.rating-star svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
    stroke: currentColor;
}

/* ================================================================
   REVIEW FORM
   ================================================================ */
.review-form-text {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-bg);
    resize: vertical;
    min-height: 100px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.review-form-text:focus {
    border-color: var(--color-primary-light);
}

/* ================================================================
   NAV USER AREA / DROPDOWN
   ================================================================ */
.nav-user-area {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-link-login {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link-login svg {
    width: 16px;
    height: 16px;
}

.nav-avatar-dropdown {
    position: relative;
}

.nav-avatar-btn {
    cursor: pointer;
    padding: 2px;
}

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: var(--font-size-sm);
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-border-light);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: var(--z-dropdown);
}

.nav-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
}

.nav-dropdown-name {
    font-weight: 700;
    font-size: var(--font-size-sm);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    text-align: left;
}

.nav-dropdown-item:hover {
    background: var(--color-primary-50);
    color: var(--color-primary);
}

.nav-dropdown-item svg {
    width: 16px;
    height: 16px;
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--color-border-light);
    margin: var(--space-xs) 0;
}

.nav-logout {
    color: var(--color-accent-red) !important;
}

/* ================================================================
   ANALYTICS DASHBOARD
   ================================================================ */
.analytics-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.analytics-period {
    display: flex;
    gap: 4px;
}

.analytics-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.analytics-chart-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--color-border-light);
}

.analytics-chart-card h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: var(--space-lg);
}

.chart-container {
    position: relative;
    width: 100%;
}

.chart-container canvas {
    width: 100%;
    cursor: crosshair;
}

/* ---- Top Books Table ---- */
.analytics-top-table {
    width: 100%;
}

.att-header {
    display: grid;
    grid-template-columns: 50px 2fr 1fr 1fr 1fr;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border-light);
}

.att-row {
    display: grid;
    grid-template-columns: 50px 2fr 1fr 1fr 1fr;
    gap: var(--space-md);
    padding: var(--space-md);
    align-items: center;
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition-fast);
}

.att-row:last-child {
    border-bottom: none;
}

.att-row:hover {
    background: var(--color-primary-50);
}

.att-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 800;
    font-size: var(--font-size-sm);
    background: var(--color-border-light);
    color: var(--color-text-muted);
}

.att-rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
}

.att-rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
    color: #fff;
}

.att-rank-3 {
    background: linear-gradient(135deg, #CD7F32, #B87333);
    color: #fff;
}

.att-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.att-revenue {
    font-weight: 700;
    color: var(--color-accent-green);
}

.att-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-accent-yellow);
    font-weight: 700;
}

.att-rating svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 768px) {
    .analytics-charts {
        grid-template-columns: 1fr;
    }

    .att-header,
    .att-row {
        grid-template-columns: 40px 2fr 1fr 1fr;
    }

    .att-header span:nth-child(5),
    .att-row span:nth-child(5) {
        display: none;
    }
}

/* ================================================================
   PROMOTION PAGE
   ================================================================ */
.promo-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: var(--space-lg);
}

.promo-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    border: 1px solid var(--color-border-light);
    transition: all var(--transition-base);
}

.promo-card:hover {
    box-shadow: var(--shadow-md);
}

.promo-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.promo-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 700;
}

.promo-book-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.promo-date {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.promo-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.promo-metric {
    text-align: center;
}

.pm-val {
    display: block;
    font-size: var(--font-size-base);
    font-weight: 800;
    color: var(--color-text);
}

.pm-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.promo-budget-bar {
    margin-bottom: var(--space-md);
}

.promo-budget-label {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.promo-progress {
    height: 6px;
    background: var(--color-border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.promo-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

.promo-card-footer {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

/* ---- Create Promotion Modal ---- */
.promo-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--font-size-base);
    background: var(--color-bg);
    color: var(--color-text);
    outline: none;
}

.promo-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.promo-type-option {
    cursor: pointer;
}

.promo-type-option input {
    display: none;
}

.promo-type-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-md);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-fast);
}

.promo-type-option.selected .promo-type-content,
.promo-type-option input:checked+.promo-type-content {
    border-color: var(--color-primary);
    background: var(--color-primary-50);
}

.promo-type-emoji {
    font-size: var(--font-size-2xl);
}

.promo-type-desc {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.promo-type-price {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-primary);
}

/* ================================================================
   CREATOR APPLICATION FORM
   ================================================================ */
.creator-apply-wrapper {
    max-width: 720px;
    margin: 0 auto;
    padding-bottom: var(--space-3xl);
}

.creator-apply-card {
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.creator-apply-header {
    text-align: center;
    padding: var(--space-2xl) var(--space-xl) var(--space-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(168, 85, 247, 0.06));
    border-bottom: 1px solid var(--color-border-light);
}

.creator-apply-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
}

.creator-apply-icon svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.creator-apply-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.creator-apply-desc {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Benefits grid */
.creator-apply-benefits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    padding: var(--space-xl);
    border-bottom: 1px solid var(--color-border-light);
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
    transition: all var(--transition-fast);
}

.benefit-item:hover {
    background: var(--color-primary-50);
    transform: translateY(-2px);
}

.benefit-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.12));
    color: var(--color-primary);
}

.benefit-icon svg {
    width: 20px;
    height: 20px;
}

.benefit-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.benefit-text strong {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text);
}

.benefit-text span {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* Form */
.creator-apply-form {
    padding: var(--space-xl);
}

.creator-apply-form .form-group {
    margin-bottom: var(--space-lg);
}

.creator-apply-form label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}

.required {
    color: var(--color-accent-red);
    font-weight: 700;
}

.form-hint-inline {
    font-weight: 400;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.creator-apply-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    resize: vertical;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.creator-apply-form textarea:focus {
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.creator-apply-form textarea::placeholder {
    color: var(--color-text-muted);
}

/* File upload area */
.file-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl) var(--space-lg);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--color-bg);
    text-align: center;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
    border-color: var(--color-primary-light);
    background: var(--color-primary-50);
}

.file-upload-area svg {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
    opacity: 0.6;
}

.file-upload-area p {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    margin: 0;
}

/* Attachment list */
.attachment-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    animation: fadeIn 0.25s ease;
}

.attachment-icon {
    font-size: var(--font-size-xl);
    flex-shrink: 0;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.attachment-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.attachment-remove:hover {
    background: var(--color-accent-red);
    color: #fff;
}

.attachment-remove svg {
    width: 14px;
    height: 14px;
}

/* Footer */
.creator-apply-footer {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border-light);
}

.creator-apply-footer .btn-lg {
    min-width: 200px;
}

.creator-apply-note {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-md);
}

@media (max-width: 480px) {
    .creator-apply-benefits {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   T6.4 — COMPREHENSIVE RESPONSIVE DESIGN
   Breakpoints: 1280px (xl), 1024px (lg), 768px (md), 480px (sm)
   ================================================================ */

/* ── Extra Large ≤ 1280px ── */
@media (max-width: 1280px) {
    .container {
        max-width: 100%;
        padding: 0 var(--space-lg);
    }

    .hero-content {
        gap: var(--space-2xl);
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .ranking-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .promo-list {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }
}

/* ── Large ≤ 1024px ── */
@media (max-width: 1024px) {

    /* Hero — supplement earlier 1024px responsive block */
    .hero-search {
        max-width: 480px;
        margin: 0 auto;
    }

    .hero-floating-card {
        display: none;
    }

    .hero-image-wrapper img {
        max-width: 400px;
    }

    /* Book detail — narrower cover */
    .book-detail-layout {
        grid-template-columns: 280px 1fr;
    }

    /* Dashboard */
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }

    .upload-form-grid {
        grid-template-columns: 1fr;
    }

    /* Creator Books Table — hide revenue col, keep actions */
    .my-books-header,
    .my-books-row {
        grid-template-columns: 2fr 0.8fr 0.8fr 0.8fr 1.5fr;
    }

    .my-books-header span:nth-child(5),
    .my-books-row>div:nth-child(5) {
        display: none;
    }

    /* Category section */
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Commission grid */
    .commission-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    /* Footer columns */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Ranking table */
    .ranking-table-header,
    .ranking-table-row {
        gap: var(--space-sm);
    }

    /* Promo type grid */
    .promo-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Medium ≤ 768px — Mobile Landscape / Tablet ── */
@media (max-width: 768px) {

    /* ---- Navigation: Hamburger Menu ---- */
    .nav-toggle {
        display: flex;
        cursor: pointer;
        z-index: calc(var(--z-sticky) + 10);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        flex-direction: column;
        background: var(--color-surface);
        padding: 80px var(--space-xl) var(--space-xl);
        box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        gap: var(--space-sm);
        overflow-y: auto;
        z-index: calc(var(--z-sticky) + 5);
    }

    .nav-links.nav-open {
        right: 0;
    }

    .nav-links a {
        width: 100%;
        padding: 14px var(--space-lg);
        border-radius: var(--radius-lg);
        font-size: var(--font-size-base);
    }

    .nav-cta-btn {
        width: 100%;
        text-align: center;
        margin-top: var(--space-md);
        justify-content: center;
    }

    /* User area in mobile menu */
    .nav-user-area {
        flex-direction: column;
        width: 100%;
        gap: var(--space-sm);
    }

    .nav-link-login {
        width: 100%;
        padding: 14px var(--space-lg);
        border-radius: var(--radius-lg);
        font-size: var(--font-size-base);
        justify-content: center;
    }

    /* Hamburger → X transform */
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Nav overlay */
    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: calc(var(--z-sticky) + 2);
    }

    .nav-overlay.active {
        display: block;
    }

    /* ---- Hero ---- */
    .hero {
        padding: 120px 0 60px;
    }

    .hero h1 {
        font-size: var(--font-size-3xl);
    }

    .hero-image-wrapper img {
        max-width: 320px;
    }

    /* ---- Section Title ---- */
    .section-title h2 {
        font-size: var(--font-size-2xl);
    }

    section {
        padding: var(--space-2xl) 0;
    }

    /* ---- Book Detail ---- */
    .book-detail-layout {
        grid-template-columns: 1fr;
    }

    .book-detail-left {
        max-width: 360px;
        margin: 0 auto;
    }

    .book-detail-meta {
        text-align: center;
    }

    .book-detail-actions {
        justify-content: center;
    }

    /* ---- Profile ---- */
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        position: static;
    }

    /* ---- Dashboard ---- */
    .dashboard-page {
        padding-top: 80px;
    }

    .dash-hero-content {
        padding: var(--space-lg);
    }

    .dash-hero-avatar {
        width: 52px;
        height: 52px;
    }

    .dash-hero-avatar span {
        font-size: var(--font-size-xl);
    }

    .dash-hero-info h1 {
        font-size: var(--font-size-lg);
    }

    .dash-hero-back {
        display: none;
    }

    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
    }

    .dash-stat-card {
        padding: var(--space-md);
    }

    .dash-stat-val {
        font-size: var(--font-size-xl);
    }

    .dashboard-quick-actions {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-sm);
    }

    .dash-action-card {
        padding: var(--space-md);
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
    }

    .dash-action-icon {
        width: 40px;
        height: 40px;
    }

    .dash-action-text span {
        display: none;
    }

    /* Switch to mobile card layout */
    .my-books-desktop {
        display: none !important;
    }

    .my-books-mobile {
        display: flex;
    }

    .dash-stat-action {
        display: none;
    }

    /* ---- Category ---- */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-filters {
        flex-direction: column;
        gap: var(--space-sm);
    }

    /* ---- Creator ---- */
    .creator-hero {
        flex-direction: column;
        text-align: center;
    }

    .creator-hero-avatar {
        margin: 0 auto;
    }

    .creator-stats {
        justify-content: center;
    }

    /* ---- Auth ---- */
    .auth-card {
        margin: 0 var(--space-md);
    }

    .auth-page {
        padding: 80px 0 40px;
    }

    .captcha-img-wrap {
        width: 110px;
        flex-shrink: 1;
    }

    .captcha-row .captcha-input {
        padding: 10px 12px;
    }

    /* ---- Page Header ---- */
    .page-header {
        padding-top: 100px;
        padding-bottom: var(--space-xl);
    }

    .page-header h1 {
        font-size: var(--font-size-2xl);
    }

    /* ---- Books Grid ---- */
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    /* ---- Book Card ---- */
    .book-card-cover img {
        height: 200px;
    }

    .book-card-body {
        padding: var(--space-sm) var(--space-md) var(--space-md);
    }

    /* ---- Rankings ---- */
    .ranking-tab-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ranking-grid {
        grid-template-columns: 1fr;
    }

    /* ---- Analytics ---- */
    .analytics-charts {
        grid-template-columns: 1fr;
    }

    .analytics-toolbar {
        flex-direction: column;
        gap: var(--space-md);
    }

    .att-header,
    .att-row {
        grid-template-columns: 40px 2fr 1fr 1fr;
    }

    .att-header span:nth-child(5),
    .att-row span:nth-child(5) {
        display: none;
    }

    /* ---- Promotion ---- */
    .promo-list {
        grid-template-columns: 1fr;
    }

    .promo-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .promo-type-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* ---- Footer ---- */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    /* ---- Modal ---- */
    .modal {
        width: 95%;
        margin: 0 var(--space-sm);
        max-height: 90vh;
        border-radius: var(--radius-xl);
    }

    .modal-header {
        padding: var(--space-md) var(--space-lg);
    }

    .modal-body {
        padding: var(--space-md) var(--space-lg);
    }

    .modal-footer {
        padding: var(--space-md) var(--space-lg);
    }

    /* ---- Toast position on mobile ---- */
    .toast-container {
        top: auto;
        bottom: var(--space-lg);
        right: var(--space-md);
        left: var(--space-md);
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }

    /* ---- Pagination ---- */
    .pagination-btn {
        min-width: 36px;
        height: 36px;
    }

    /* ---- Search bar ---- */
    .hero-search {
        max-width: 100%;
    }

    .hero-search input {
        font-size: 16px;
        /* Prevent iOS zoom on focus */
    }
}

/* ── Small ≤ 480px — Mobile Portrait ── */
@media (max-width: 480px) {

    /* ---- Root Spacing Overrides ---- */
    :root {
        --space-4xl: 48px;
        --space-3xl: 36px;
    }

    .container {
        padding: 0 var(--space-md);
    }

    /* ---- Hero ---- */
    .hero {
        padding: 100px 0 40px;
    }

    .hero h1 {
        font-size: var(--font-size-2xl);
    }

    .hero-text {
        font-size: var(--font-size-base);
    }

    .hero-stats {
        gap: var(--space-lg);
    }

    .stat-number {
        font-size: var(--font-size-xl);
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-image-wrapper img {
        max-width: 260px;
    }

    /* ---- Navbar ---- */
    .navbar {
        top: 8px;
        left: 8px;
        right: 8px;
    }

    .navbar .container {
        padding: 10px 16px;
    }

    .nav-brand {
        font-size: var(--font-size-base);
    }

    .nav-brand img {
        width: 32px;
        height: 32px;
    }

    /* ---- Book Grid — single column ---- */
    .books-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    /* ---- Category Grid ---- */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .category-card {
        padding: var(--space-md);
    }

    .category-card-icon {
        font-size: var(--font-size-2xl);
    }

    .category-card h3 {
        font-size: var(--font-size-sm);
    }

    /* ---- Dashboard ---- */
    .dashboard-page {
        padding-top: 70px;
    }

    .dash-hero {
        border-radius: var(--radius-xl);
    }

    .dash-hero-content {
        padding: var(--space-md);
    }

    .dash-hero-avatar {
        width: 44px;
        height: 44px;
        border-width: 2px;
    }

    .dash-hero-avatar span {
        font-size: var(--font-size-lg);
    }

    .dash-hero-info h1 {
        font-size: var(--font-size-base);
    }

    .dash-hero-level {
        font-size: var(--font-size-xs);
    }

    .dash-hero-left {
        gap: var(--space-md);
    }

    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
    }

    .dash-stat-card {
        padding: var(--space-sm) var(--space-md);
    }

    .dash-stat-icon {
        width: 40px;
        height: 40px;
    }

    .dash-stat-icon svg {
        width: 20px;
        height: 20px;
    }

    .dash-stat-val {
        font-size: var(--font-size-lg);
    }

    .dashboard-quick-actions {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-xs);
    }

    .dash-action-card {
        padding: var(--space-sm) var(--space-xs);
    }

    .dash-action-icon {
        width: 36px;
        height: 36px;
    }

    .dash-action-icon svg {
        width: 18px;
        height: 18px;
    }

    .dash-action-text strong {
        font-size: var(--font-size-xs);
    }

    /* Mobile card adjustments */
    .mb-card {
        padding: var(--space-md);
    }

    .mb-card-cover {
        width: 48px;
        height: 62px;
    }

    .mb-card-title {
        font-size: var(--font-size-sm);
    }

    .mb-card-actions .btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* ---- Form ---- */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* ---- My Books Table (already hidden on mobile, kept for safety) ---- */
    .my-books-header,
    .my-books-row {
        grid-template-columns: 1fr 0.8fr auto;
    }

    /* Hide price, downloads, revenue columns on mobile */
    .my-books-header span:nth-child(3),
    .my-books-header span:nth-child(4),
    .my-books-header span:nth-child(5),
    .my-books-row>div:nth-child(3),
    .my-books-row>div:nth-child(4),
    .my-books-row>div:nth-child(5) {
        display: none;
    }

    .my-book-actions {
        gap: 4px;
    }

    .my-book-actions .btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    /* ---- Book Detail ---- */
    .book-detail-left {
        max-width: 100%;
    }

    .book-detail-cover {
        max-height: 320px;
    }

    .book-detail-actions {
        flex-direction: column;
    }

    .book-detail-actions .btn {
        width: 100%;
    }

    /* ---- Reviews ---- */
    .review-item {
        padding: var(--space-md);
    }

    /* ---- Profile ---- */
    .profile-card {
        padding: var(--space-md);
    }

    /* ---- Auth ---- */
    .auth-card {
        margin: 0 var(--space-sm);
        padding: var(--space-md);
        border-radius: var(--radius-xl);
    }

    .auth-page {
        padding: 70px 0 30px;
    }

    .captcha-img-wrap {
        width: 90px;
        height: 42px;
        flex-shrink: 1;
    }

    .captcha-row {
        gap: var(--space-sm);
    }

    .captcha-row .captcha-input {
        min-width: 0;
        padding: 8px 10px;
        font-size: var(--font-size-sm);
    }

    .auth-header h2 {
        font-size: var(--font-size-xl);
    }

    .form-group {
        margin-bottom: var(--space-md);
    }

    .form-group input {
        padding: 10px 12px;
    }

    /* ---- Promotion ---- */
    .promo-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .promo-type-grid {
        grid-template-columns: 1fr;
    }

    /* ---- Pagination ---- */
    .pagination-btn {
        min-width: 32px;
        height: 32px;
        font-size: var(--font-size-xs);
    }

    .pagination-dots {
        width: 28px;
    }

    /* ---- Section Title ---- */
    .section-title h2 {
        font-size: var(--font-size-xl);
    }

    .section-title p {
        font-size: var(--font-size-base);
    }

    /* ---- Tab Buttons ---- */
    .tab-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        gap: 2px;
    }

    .tab-btn {
        flex-shrink: 0;
        font-size: var(--font-size-sm);
        padding: 8px 14px;
    }

    /* ---- Creator Hero ---- */
    .creator-hero-avatar {
        width: 80px;
        height: 80px;
    }

    .creator-hero h1 {
        font-size: var(--font-size-xl);
    }

    /* ---- Analytics ---- */
    .att-header,
    .att-row {
        grid-template-columns: 30px 1fr 1fr;
    }

    .att-header span:nth-child(n+4),
    .att-row span:nth-child(n+4) {
        display: none;
    }
}

/* ================================================================
   MOBILE BOTTOM NAVIGATION BAR
   ================================================================ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--color-border-light);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
}

.mobile-bottom-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    max-width: 480px;
    margin: 0 auto;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    min-width: 56px;
}

.mobile-nav-item svg {
    width: 22px;
    height: 22px;
    transition: transform var(--transition-fast);
}

.mobile-nav-item.active {
    color: var(--color-primary);
}

.mobile-nav-item:active svg {
    transform: scale(0.9);
}

/* ── Mobile-specific enhancements at 768px ── */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
    }

    /* Bottom padding so footer content isn't hidden behind bottom nav */
    .footer {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    /* Marketplace tabs — horizontal scroll */
    .marketplace-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 0;
        max-width: 100%;
    }

    .marketplace-tabs::-webkit-scrollbar {
        display: none;
    }

    .marketplace-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Marketplace controls — prevent overflow */
    .marketplace-controls {
        max-width: 100%;
        overflow: hidden;
    }

    /* Filter categories — horizontal scroll */
    .filter-categories {
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        max-width: 100%;
        width: 100%;
    }

    .filter-categories::-webkit-scrollbar {
        display: none;
    }

    .filter-cat-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Prevent category filters from overflowing viewport */
    .category-filters {
        max-width: 100%;
        overflow: hidden;
    }

    /* Rankings tabs & filters — horizontal scroll */
    .rankings-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        max-width: 100%;
    }

    .rankings-tabs::-webkit-scrollbar {
        display: none;
    }

    .rankings-filters {
        overflow-x: auto;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }

    .rankings-filters::-webkit-scrollbar {
        display: none;
    }

    /* Ranking list compact padding */
    .ranking-list {
        padding: var(--space-md);
    }

    .ranking-header {
        padding: var(--space-md);
    }

    .ranking-item:hover {
        margin: 0 calc(var(--space-md) * -1);
        padding: var(--space-md);
    }

    /* Ad banner — hide visual on mobile */
    .ad-banner-visual {
        display: none;
    }

    /* Upload page sticky side → static */
    .upload-form-side {
        position: static;
    }
}

/* ── Additional 480px mobile polish ── */
@media (max-width: 480px) {
    /* How-it-works — single column on phone */
    .hiw-grid {
        grid-template-columns: 1fr;
    }

    .hiw-number {
        width: 64px;
        height: 64px;
        font-size: var(--font-size-xl);
    }

    /* Marketplace controls stack */
    .marketplace-sort {
        width: 100%;
    }

    .marketplace-sort select {
        width: 100%;
    }

    .marketplace-tab {
        padding: 8px 16px;
        font-size: var(--font-size-xs);
    }

    /* Hero search compact */
    .hero-search {
        padding: 4px 4px 4px 14px;
    }

    .hero-search .btn {
        padding: 10px 16px;
        font-size: var(--font-size-sm);
    }

    /* Ad banner tighter */
    .ad-banner {
        padding: var(--space-lg) var(--space-md);
    }

    .ad-features-list {
        grid-template-columns: 1fr;
    }

    /* CTA compact */
    .cta-box {
        padding: var(--space-xl) var(--space-md);
    }

    .cta-box h2 {
        font-size: var(--font-size-xl);
    }

    .cta-box p {
        font-size: var(--font-size-sm);
    }

    .cta-actions .btn {
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }

    /* Cards compact padding */
    .commission-card {
        padding: var(--space-lg);
    }

    .review-card {
        padding: var(--space-md);
    }

    .creator-card {
        padding: var(--space-md);
    }

    /* Book detail compact */
    .book-detail-meta {
        grid-template-columns: 1fr;
    }

    .book-detail-stats-grid {
        grid-template-columns: 1fr;
    }

    /* Category icon compact */
    .category-icon {
        width: 44px;
        height: 44px;
    }

    .category-icon svg {
        width: 22px;
        height: 22px;
    }

    /* Bottom nav compact */
    .mobile-nav-item {
        padding: 4px 8px;
        font-size: 9px;
        min-width: 48px;
    }

    .mobile-nav-item svg {
        width: 20px;
        height: 20px;
    }
}

/* ================================================================
   T6.3 — TOUCH INTERACTION OPTIMIZATION
   ================================================================ */

/* Minimum 44px touch targets (Apple HIG / WCAG 2.5.5) */
@media (pointer: coarse) {
    .nav-links a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .btn {
        min-height: 44px;
    }

    .pagination-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .tab-btn {
        min-height: 44px;
    }

    .rating-star {
        padding: 4px;
    }

    .rating-star svg {
        width: 36px;
        height: 36px;
    }

    /* Disable hover effects on touch (use active instead) */
    .btn:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.97);
        transition-duration: 80ms;
    }

    .book-card:hover {
        transform: none;
        box-shadow: inherit;
    }

    .book-card:active {
        transform: scale(0.98);
    }

    .category-card:hover {
        transform: none;
    }

    .category-card:active {
        transform: scale(0.97);
    }

    /* Remove hover tooltips on touch */
    [title] {
        pointer-events: auto;
    }

    /* Scroll snap for horizontal lists */
    .tab-list,
    .ranking-tab-bar {
        scroll-snap-type: x mandatory;
    }

    .tab-btn {
        scroll-snap-align: start;
    }
}

/* Prevent iOS font-size zoom on input focus */
@media screen and (max-width: 768px) {

    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ================================================================
   T6.3 — PERFORMANCE: IMAGE LAZY LOADING & SKELETON
   ================================================================ */

/* Skeleton loading placeholder */
.skeleton {
    background: linear-gradient(90deg,
            var(--color-border-light) 25%,
            rgba(255, 255, 255, 0.5) 37%,
            var(--color-border-light) 63%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.4s ease infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-pulse {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-card {
    height: 300px;
    border-radius: var(--radius-xl);
}

/* Image lazy loading fade-in */
.lazy-img {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.lazy-img.loaded {
    opacity: 1;
}

/* ================================================================
   T5.1 — HOMEPAGE PROMO CAROUSEL
   ================================================================ */

.promo-banner-section {
    padding: var(--space-2xl) 0;
    background: linear-gradient(135deg, #EEF2FF 0%, #FDF2F8 50%, #FFF7ED 100%);
    position: relative;
    overflow: hidden;
}

.promo-banner-section::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.promo-banner-section::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(244, 114, 182, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.promo-carousel {
    display: flex;
    gap: var(--space-lg);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-md) var(--space-xs);
    scrollbar-width: none;
}

.promo-carousel::-webkit-scrollbar {
    display: none;
}

.promo-card {
    flex: 0 0 220px;
    scroll-snap-align: start;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    overflow: hidden;
    position: relative;
}

.promo-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.16), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.promo-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.promo-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.promo-card:hover .promo-card-image img {
    transform: scale(1.08);
}

.promo-card-image .book-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 2;
}

.promo-card-image .book-badge.ad {
    background: linear-gradient(135deg, var(--color-accent-orange), #F59E0B);
    color: #fff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.promo-card-body {
    padding: var(--space-md);
}

.promo-card-title {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.promo-card-author {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.promo-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.promo-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-accent-amber);
}

.promo-rating svg {
    width: 14px;
    height: 14px;
}

.promo-price {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-accent-pink);
}

.promo-price.free {
    color: var(--color-accent-green);
}

/* Responsive adjustments for promo carousel */
@media (max-width: 768px) {
    .promo-card {
        flex: 0 0 180px;
    }

    .promo-banner-section {
        padding: var(--space-lg) 0;
    }
}

@media (max-width: 480px) {
    .promo-card {
        flex: 0 0 160px;
    }

    .promo-card-body {
        padding: var(--space-sm);
    }

    .promo-card-title {
        font-size: var(--font-size-sm);
    }
}

/* ================================================================
   ACCESSIBILITY: Focus Visible
   ================================================================ */

*:focus-visible {
    outline: 3px solid var(--color-primary-light);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Remove outline for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* ---- Print Styles ---- */
@media print {

    .navbar,
    .nav-overlay,
    .toast-container,
    .modal-overlay,
    .footer {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
}

/* ---- Keyframe Animations ---- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .skeleton {
        animation: none;
    }
}