/* Design System - Color Palette */
:root {
    /* Primary Colors */
    --primary-50: #f0f4ff;
    --primary-100: #e0e7ff;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;

    /* Neutral Colors */
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;

    /* Semantic Colors */
    --success-50: #f0fdf4;
    --success-500: #22c55e;
    --success-600: #16a34a;
    --success-700: #15803d;

    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;

    --error-50: #fef2f2;
    --error-500: #ef4444;
    --error-600: #dc2626;
    --error-700: #b91c1c;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

.g_id_signin {
    display: inline-block;
    width: auto;
}

.email-banner .g_id_signin {
    margin: 0 auto;
}

.email-banner .g_id_signin>div {
    margin: 0 auto;
}

/* User Menu */
.user-menu {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    object-fit: cover;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #f1f1f1
}

.user-menu:hover .dropdown-content {
    display: block;
}

/* Share menu in nav */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.share-menu {
    position: relative;
    display: inline-block;
}

.share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
}

.share-icon:hover {
    background: var(--primary-50);
    border-color: var(--primary-200, #c7d2fe);
}

.share-dropdown {
    min-width: 200px;
}

.share-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-menu.open .share-dropdown {
    display: block;
}

/* Theme toggle */
.theme-toggle {
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
}
.theme-toggle:hover {
    background: var(--primary-50);
}
.theme-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--neutral-800);
    background-color: var(--neutral-50);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
    color: white;
    padding: var(--space-12) 0;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.03"><circle cx="30" cy="30" r="2"/></g></svg>');
    pointer-events: none;
}

.header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    margin-bottom: var(--space-4);
    position: relative;
    z-index: 1;
}

.logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.brand-text h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.125rem;
    font-weight: 500;
    opacity: 0.95;
    margin: 0;
    letter-spacing: 0.01em;
}

.disclaimer {
    font-size: 0.85rem;
    opacity: 0.7;
    font-style: italic;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

/* Navigation */
.main-nav {
    background: white;
    border-bottom: 1px solid var(--neutral-200);
    padding: var(--space-4) 0;
    box-shadow: var(--shadow-sm);
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: var(--space-8);
    margin: 0;
    padding: 0;
    justify-content: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--neutral-600);
    font-weight: 500;
    font-size: 0.95rem;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}

.nav-links a.active {
    color: var(--primary-600);
    background: var(--primary-50);
    font-weight: 600;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary-600);
    border-radius: 50%;
}

/* Email Banner */
.email-banner {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    padding: var(--space-16) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.email-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><path d="M20 20c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10zm10 0c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z"/></g></svg>');
    pointer-events: none;
}

.email-content {
    position: relative;
    z-index: 1;
}

.email-hero h2 {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.email-tagline {
    font-size: 1.25rem;
    margin-bottom: var(--space-10);
    opacity: 0.95;
    font-weight: 500;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.email-benefits {
    display: flex;
    justify-content: center;
    gap: var(--space-8);
    margin-bottom: var(--space-10);
    flex-wrap: wrap;
}

.benefit {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.125rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.benefit-icon {
    font-size: 1.25rem;
}

.email-form {
    margin-bottom: var(--space-6);
}

.form-group {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    max-width: 500px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.email-form input {
    flex: 1;
    padding: var(--space-5) var(--space-6);
    font-size: 1.125rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    min-width: 280px;
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    color: var(--neutral-800);
    font-weight: 500;
    transition: all 0.2s ease;
}

.email-form input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.email-form button {
    padding: var(--space-5) var(--space-8);
    font-size: 1.125rem;
    background: var(--neutral-900);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
}

.email-form button:hover {
    background: var(--neutral-800);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.email-note {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Main Content */
main {
    padding: 3rem 0;
}

/* Highlights */
.highlights {
    background: white;
    padding: var(--space-10);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-12);
    text-align: center;
    border: 1px solid var(--neutral-100);
}

.highlights h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-8);
    color: var(--neutral-900);
    letter-spacing: -0.01em;
}

.highlight-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-12);
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    background: var(--neutral-50);
    min-width: 120px;
    transition: all 0.2s ease;
}

.stat:hover {
    background: var(--primary-50);
    transform: translateY(-2px);
}

.stat .number {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--primary-600);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.stat .label {
    font-size: 0.95rem;
    color: var(--neutral-600);
    font-weight: 500;
    text-align: center;
}

/* Categories */
.categories {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-12);
    border: 1px solid var(--neutral-100);
}

.category-tabs {
    display: flex;
    background: var(--neutral-50);
    overflow-x: auto;
    border-bottom: 1px solid var(--neutral-200);
    position: sticky;
    top: 0;
    z-index: 999;
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
}

.tab-btn {
    flex: 1;
    padding: var(--space-6) var(--space-4);
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    color: var(--neutral-600);
    position: relative;
}

.tab-btn:hover {
    background: var(--neutral-100);
    color: var(--neutral-800);
}

.tab-btn.active {
    background: white;
    color: var(--primary-600);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-600);
}

.category-content {
    padding: var(--space-8);
}

.category-panel {
    display: none;
}

.category-panel.active {
    display: block;
}

/* Dark mode styling for category tabs */
[data-theme="dark"] .categories {
  background: var(--neutral-100);
  border-color: var(--neutral-200);
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}
[data-theme="dark"] .category-tabs {
  background: var(--neutral-100);
  border-bottom-color: var(--neutral-200);
}
[data-theme="dark"] .tab-btn {
  color: var(--neutral-600);
}
[data-theme="dark"] .tab-btn:hover {
  background: var(--neutral-200);
  color: var(--neutral-900);
}
[data-theme="dark"] .tab-btn.active {
  background: var(--neutral-200);
  color: var(--neutral-900);
  box-shadow: inset 0 -1px 0 0 rgba(255,255,255,0.04);
}
[data-theme="dark"] .tab-btn.active::after {
  background: var(--primary-600);
}

/* Books Grid */
/* 响应式书籍网格 */
.books-grid {
    display: grid;
    gap: var(--space-8);
}

/* 真正的响应式网格布局 */
/* 小屏手机：单列布局 */
@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }
}

/* 大屏手机：单列布局 */
@media (min-width: 481px) and (max-width: 768px) {
    .books-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
}

/* 平板端：双列布局 */
@media (min-width: 769px) and (max-width: 1024px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* 桌面端：三列布局 */
@media (min-width: 1025px) and (max-width: 1399px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* 大屏幕：四列布局 */
@media (min-width: 1400px) {
    .books-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* 新的响应式书籍卡片设计 */
.book-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--neutral-200);
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 100%;
    position: relative;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-300);
}

/* 图片容器 - 真正的响应式设计 */
.book-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .book-image-container {
        aspect-ratio: 3/4;
        /* 保持书籍封面比例，不是1:1 */
        min-height: 200px;
        /* 最小高度确保一致性 */
    }

    .book-cover {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        transition: transform 0.3s ease;
        cursor: pointer;
        /* 指示可点击 */
    }
}

/* 平板和桌面端 */
@media (min-width: 769px) {
    .book-image-container {
        aspect-ratio: 2/3;
        /* 书籍封面的标准比例 */
    }

    .book-cover {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        transition: transform 0.3s ease;
    }
}

.book-card:hover .book-cover {
    transform: scale(1.03);
}

/* 改进的悬停覆盖层 - 更好的可读性 */
.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.2) 40%,
            rgba(0, 0, 0, 0.7) 80%,
            rgba(0, 0, 0, 0.9) 100%);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    color: white;
    backdrop-filter: blur(1px);
}

/* 只在桌面端显示悬停效果 */
@media (min-width: 769px) {
    .book-card:hover .book-overlay {
        opacity: 1;
    }
}

/* 移动端隐藏悬停效果 */
@media (max-width: 768px) {
    .book-overlay {
        display: none;
    }
}

.book-overlay-content {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.overlay-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    color: white;
}

.overlay-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* History page overlay readability improvements */
.historical-content .book-overlay-content {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.historical-content .overlay-title {
  color: #F9FAFB;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.7);
  font-weight: 800;
}
.historical-content .overlay-description {
  color: rgba(255,255,255,0.96);
}

/* 书籍内容区域 */
.book-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 1rem;
}
/* Title row with badges inline */
.book-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}
.book-title-row .book-title { flex: 1; margin: 0; }

[data-theme="dark"] .book-card {
    background: var(--neutral-100);
    border-color: var(--neutral-200);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] .book-image-container {
    background: linear-gradient(135deg, #0b1220 0%, #111827 100%);
}
[data-theme="dark"] .book-content {
    background: var(--neutral-100);
}
[data-theme="dark"] .book-description {
    background: var(--neutral-200);
    color: var(--neutral-700);
    border-left-color: var(--primary-600);
}
[data-theme="dark"] .book-description:hover {
    background: var(--neutral-300);
}

/* 移动端内容优化 */
@media (max-width: 768px) {
    .book-content {
        padding: 1rem;
        gap: 0.75rem;
    }
    .book-title-row { align-items: flex-start; gap: 6px; }
}

.book-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--neutral-900);
    line-height: 1.35;
    display: block !important;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
    white-space: normal;
    margin: 0;
}

/* 移动端标题优化 */
@media (max-width: 768px) {
    .book-title {
        font-size: 1rem;
        line-height: 1.35;
    }
}

display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}

.book-rank {
    font-size: 0.875rem;
    color: var(--neutral-500);
    margin-bottom: var(--space-1);
    font-weight: 500;
}

/* Remove extra space below badges now that they inline with title */
.book-badges { margin-bottom: 0; }

.badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.5rem;
    color: #fff;
}

.badge.new {
    background-color: #3498db;
}

.badge.rising {
    background-color: #e67e22;
}

.badge.hot {
    background-color: #e74c3c;
}

.badge.sponsored {
    background-color: #9b59b6;
}

.badge.house {
    background-color: #1abc9c;
}

.badge.quality {
    background-color: #8e44ad;
}

.badge.fresh {
    background-color: #f39c12;
}

.badge.recommended {
    background-color: #27ae60;
}

/* 书籍徽章样式 */
.book-badges { display: flex; flex-wrap: nowrap; gap: 0; margin: 0; line-height: 1; font-size: 0; }
.book-badges .badge { margin: 0 !important; }
.book-badges .badge + .badge { margin-left: 0 !important; }
.badges-top { margin-bottom: 0; }

/* Compact icon-only badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  font-size: 12px;
  line-height: 1;
  background: transparent;
  color: inherit;
  border: none;
  box-shadow: none;
  margin: 0;
}
.badge.new,
.badge.rising,
.badge.trendup,
.badge.highrank,
.badge.hot,
.badge.sponsored,
.badge.house,
.badge.quality,
.badge.fresh,
.badge.recommended { background: transparent !important; border: none !important; }

/* Dark mode badges */
[data-theme="dark"] .badge { background: transparent; border: none; }

.badge.quality {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.badge.fresh {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.badge.recommended {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.badge.highrank {
    background: linear-gradient(135deg, #f9a825 0%, #f57f17 100%);
}

.badge.trendup {
    background: linear-gradient(135deg, #29b6f6 0%, #0288d1 100%);
}

/* Pretty custom tooltip for badges */
.badge[data-tip] { position: relative; }
.badge[data-tip]:hover::after, .badge[data-tip]:focus-visible::after,
.badge[data-tip]:hover::before, .badge[data-tip]:focus-visible::before {
  opacity: 1; transform: translate(-50%, -2px);
}
.badge[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: 130%;
  transform: translateX(-50%);
  background: var(--tooltip-bg, #111827);
  color: var(--tooltip-text, #F9FAFB);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  border: 1px solid var(--tooltip-border, #1f2937);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}
.badge[data-tip]::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 122%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--tooltip-bg, #111827);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 9;
}

[data-theme="dark"] .badge[data-tip]::after {
  --tooltip-bg: #374151; /* slate-700 */
  --tooltip-text: #F3F4F6; /* gray-100 */
  --tooltip-border: #4b5563; /* slate-600 */
}

/* Final badge appearance overrides to ensure compact icon-only style */
.badge.quality { background: #eef2ff; color: #4f46e5; border-color: #c7d2fe; }
.badge.fresh { background: #ecfeff; color: #06b6d4; border-color: #a5f3fc; }
.badge.recommended { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
.badge.highrank { background: #fefce8; color: #ca8a04; border-color: #fde68a; }
.badge.trendup { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

[data-theme="dark"] .badge.quality { background: #0b1220; color: #c7d2fe; border-color: #1f2937; }
[data-theme="dark"] .badge.fresh { background: #06161a; color: #a5f3fc; border-color: #1f2937; }
[data-theme="dark"] .badge.recommended { background: #0f172a; color: #e2e8f0; border-color: #1f2937; }
[data-theme="dark"] .badge.highrank { background: #16140a; color: #fde68a; border-color: #1f2937; }
[data-theme="dark"] .badge.trendup { background: #1a0b0b; color: #fca5a5; border-color: #1f2937; }

/* 专业的书籍描述样式 */
.book-description {
    font-size: 0.9rem;
    color: var(--neutral-700);
    line-height: 1.5;
    flex-grow: 1;
    text-align: left;
    font-style: italic;
    background: var(--neutral-50);
    padding: 0.75rem;
    border-radius: 0.5rem;
    border-left: 3px solid var(--primary-200);
    margin: 0;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.book-description.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-description.expanded {
    display: block;
    max-height: none;
    overflow: visible;
}

.book-description:hover {
    background: var(--neutral-100);
    border-left-color: var(--primary-400);
}

/* 展开/收起按钮 */
.description-toggle {
    display: inline-block;
    color: var(--primary-600);
    font-weight: 600;
    font-style: normal;
    margin-left: 0.5rem;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.85rem;
}

.description-toggle:hover {
    color: var(--primary-700);
}

/* New robust toggle button */
.description-toggle-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--primary-600);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: underline;
  padding: 0;
  margin-top: 6px;
  cursor: pointer;
}
.description-toggle-btn:hover { color: var(--primary-700); }
[data-theme="dark"] .description-toggle-btn { color: var(--neutral-700); }
[data-theme="dark"] .description-toggle-btn:hover { color: var(--neutral-800); }

/* 移动端描述优化 */
@media (max-width: 768px) {
    .book-description {
        font-size: 0.875rem;
        line-height: 1.4;
        padding: 0.5rem;
    }

    .book-description.truncated {
        -webkit-line-clamp: 2;
    }
}

/* 书籍评分样式 */
.book-scores {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--primary-700);
    margin-bottom: var(--space-5);
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
    border-radius: var(--radius-lg);
    font-weight: 500;
    border: 1px solid var(--primary-200);
}

.book-scores span {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* 赞助标签特殊样式 */
.book-scores.sponsored-tag {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-color: #f59e0b;
    justify-content: center;
    font-weight: 600;
}

/* Amazon链接样式 */
.amazon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    background: linear-gradient(135deg, #ff9500 0%, #e8890b 100%);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.amazon-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.amazon-link:hover::before {
    left: 100%;
}

.amazon-link:hover {
    background: linear-gradient(135deg, #e8890b 0%, #d97706 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.amazon-link:active {
    transform: translateY(0);
}

/* Price Notice */
.price-notice {
    background: var(--warning-50);
    border: 1px solid var(--warning-100);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-6);
    margin: var(--space-6) 0;
    box-shadow: var(--shadow-sm);
}

.notice-content {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    justify-content: center;
}

.notice-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    color: var(--warning-600);
}

.notice-text {
    font-size: 0.95rem;
    color: var(--warning-600);
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
}

/* Email Reminder */
.email-reminder {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 3rem;
}

.reminder-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.reminder-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.subscribe-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    background: white;
    color: #6c5ce7;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.3s;
}

.subscribe-btn:hover {
    transform: scale(1.05);
}

/* Footer */
footer {
    background: var(--neutral-900);
    color: white;
    padding: var(--space-8) 0 var(--space-4);
    margin-top: var(--space-16);
}

.footer-disclaimer {
    text-align: center;
    padding: var(--space-6) 0;
    border-bottom: 1px solid var(--neutral-700);
    margin-bottom: var(--space-8);
}

.footer-disclaimer p {
    font-size: 0.9rem;
    color: var(--neutral-400);
    margin: 0;
    font-style: italic;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-12);
    margin-bottom: var(--space-8);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo {
    height: 50px;
    width: auto;
    margin-bottom: var(--space-4);
    opacity: 0.9;
}

.footer-brand p {
    color: var(--neutral-400);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
}

.link-group h4 {
    color: white;
    margin-bottom: var(--space-4);
    font-size: 1.1rem;
    font-weight: 600;
}

.link-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.link-group li {
    margin-bottom: var(--space-2);
}

.link-group a {
    color: var(--neutral-400);
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.95rem;
}

.link-group a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid var(--neutral-700);
    padding-top: var(--space-4);
    text-align: center;
}

.footer-bottom p {
    margin: var(--space-2) 0;
    color: var(--neutral-400);
    font-size: 0.9rem;
}

/* Dark mode overrides for footer */
[data-theme="dark"] footer {
  background: var(--neutral-100);
  color: var(--neutral-900);
}
[data-theme="dark"] .footer-disclaimer {
  border-bottom-color: var(--neutral-200);
}
[data-theme="dark"] .footer-disclaimer p,
[data-theme="dark"] .footer-brand p,
[data-theme="dark"] .link-group a,
[data-theme="dark"] .footer-bottom p {
  color: var(--neutral-600);
}
[data-theme="dark"] .link-group a:hover {
  color: var(--neutral-900);
}
[data-theme="dark"] .footer-bottom {
  border-top-color: var(--neutral-200);
}

.affiliate-notice {
    font-size: 0.8rem !important;
    opacity: 0.8;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: #00b894;
}

.modal-content p {
    margin-bottom: 2rem;
    color: #636e72;
}

.modal-content button {
    padding: 0.8rem 2rem;
    background: #00b894;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: #636e72;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Prevent horizontal overflow */
    body {
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 var(--space-4);
        max-width: 100%;
        overflow-x: hidden;
    }

    header {
        padding: var(--space-8) 0;
    }

    .header-brand {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    /* Fix navigation on mobile */
    .main-nav .container {
        flex-wrap: wrap;
        gap: var(--space-3);
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-3);
        width: 100%;
    }
    
    .nav-links li {
        flex: 0 1 auto;
    }
    
    .nav-actions {
        gap: 12px;
        justify-content: center;
        width: 100%;
    }
    
    /* Fix user menu and avatar */
    .user-menu {
        position: relative;
    }
    
    .avatar {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }
    
    .dropdown-content {
        right: 0;
        left: auto;
        min-width: 160px;
    }
    
    /* Fix share menu dropdown */
    .share-dropdown {
        right: 0;
        left: auto;
        min-width: 180px;
    }

    .brand-text h1 {
        font-size: 2.25rem;
    }

    .email-hero h2 {
        font-size: 2.25rem;
    }

    .email-tagline {
        font-size: 1.125rem;
    }

    .email-benefits {
        flex-direction: column;
        gap: var(--space-4);
    }

    .form-group {
        flex-direction: column;
        align-items: stretch;
    }

    .email-form input {
        min-width: auto;
        width: 100%;
    }

    .email-form button {
        width: 100%;
    }

    .highlights {
        padding: var(--space-6);
    }

    .highlight-stats {
        gap: var(--space-6);
    }

    .stat {
        min-width: 100px;
    }

    .category-tabs {
        flex-wrap: wrap;
    }

    .category-content {
        padding: var(--space-6);
    }

    .books-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .book-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .price-notice {
        margin: var(--space-4) 0;
        padding: var(--space-4);
    }

    .notice-content {
        flex-direction: column;
        gap: var(--space-2);
    }

    .notice-text {
        font-size: 0.875rem;
    }
}

/* Historical Picks Page */
.page-header {
    text-align: center;
    padding: 2rem 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 2rem;
    color: #2d3436;
    margin-bottom: 1rem;
}

.page-header p {
    color: #636e72;
    font-size: 1.1rem;
}

/* Date Filter */
.date-filter {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-controls label {
    font-weight: 500;
    color: #2d3436;
}

.filter-controls input[type="date"] {
    padding: 0.8rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.filter-controls input[type="date"]:focus {
    border-color: #667eea;
}

.filter-btn {
    padding: 0.8rem 2rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.filter-btn:hover {
    background: #5a67d8;
}

/* Historical Content */
.historical-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.date-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f2f6;
}

.date-header h3 {
    font-size: 1.5rem;
    color: #2d3436;
    margin-bottom: 1rem;
}

.date-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

/* Dark mode overrides for History page containers */
[data-theme="dark"] .page-header,
[data-theme="dark"] .date-filter,
[data-theme="dark"] .historical-content {
  background: var(--neutral-100);
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}

[data-theme="dark"] .page-header h2,
[data-theme="dark"] .date-header h3,
[data-theme="dark"] .filter-controls label {
  color: var(--neutral-900);
}

[data-theme="dark"] .page-header p,
[data-theme="dark"] .date-stats,
[data-theme="dark"] .historical-content p {
  color: var(--neutral-600);
}

[data-theme="dark"] .date-header {
  border-bottom-color: var(--neutral-200);
}

[data-theme="dark"] .filter-controls input[type="date"] {
  background: var(--neutral-200);
  border-color: var(--neutral-300);
  color: var(--neutral-900);
  color-scheme: dark; /* let UA controls adapt */
}

[data-theme="dark"] .filter-controls input[type="date"]:focus {
  border-color: var(--primary-600);
}

/* Improve date picker icon visibility in dark mode (webkit) */
[data-theme="dark"] .filter-controls input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.25);
  opacity: 0.9;
  cursor: pointer;
}
[data-theme="dark"] .filter-controls input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Dark mode button styling for Load Picks */
[data-theme="dark"] .filter-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #e2e8f0;
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
}
[data-theme="dark"] .filter-btn:hover {
  background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
}
[data-theme="dark"] .filter-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
[data-theme="dark"] .filter-btn:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.stat-item {
    color: #636e72;
    font-size: 0.9rem;
}

.stat-item span {
    font-weight: bold;
    color: #667eea;
}

/* Historical Categories */
.historical-categories {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.category-section {
    border-left: 4px solid #667eea;
    padding-left: 2rem;
}

.category-section h4 {
    font-size: 1.3rem;
    color: #2d3436;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

/* 历史页面使用相同的响应式网格 */
.category-section .books-grid {
    display: grid;
}

/* 小屏手机：单列布局 */
@media (max-width: 480px) {
    .category-section .books-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }
}

/* 大屏手机：单列布局 */
@media (min-width: 481px) and (max-width: 768px) {
    .category-section .books-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
}

/* 平板端：双列布局 */
@media (min-width: 769px) and (max-width: 1024px) {
    .category-section .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* 桌面端：三列布局 */
@media (min-width: 1025px) and (max-width: 1399px) {
    .category-section .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* 大屏幕：四列布局 */
@media (min-width: 1400px) {
    .category-section .books-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* No Data Message */
.no-data {
    text-align: center;
    padding: 4rem 2rem;
    color: #636e72;
}

.no-data h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2d3436;
}

.no-data p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Loading State for Historical */
.loading-historical {
    text-align: center;
    padding: 3rem;
    color: #636e72;
}

.loading-historical::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

/* Historical Book Cards */
.book-card-historical {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all 0.3s ease;
    border: 1px solid var(--neutral-200);
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.book-card-historical:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-300);
}

.book-header-historical {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.book-cover-historical {
    width: 70px;
    height: 105px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.book-info-historical h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--neutral-900);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-badges-historical {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.book-description-historical {
    font-size: 0.9rem;
    color: var(--neutral-600);
    line-height: 1.5;
    margin-bottom: var(--space-4);
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-scores-historical {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--primary-600);
    margin-bottom: var(--space-4);
    padding: var(--space-3);
    background: var(--primary-50);
    border-radius: var(--radius-md);
    font-weight: 500;
}

.book-actions-historical {
    margin-top: auto;
}

.amazon-btn-historical {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    background: linear-gradient(135deg, #ff9500 0%, #e8890b 100%);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    box-shadow: var(--shadow-md);
    border: none;
    cursor: pointer;
}

.amazon-btn-historical:hover {
    background: linear-gradient(135deg, #e8890b 0%, #d17a0a 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.amazon-btn-historical .btn-icon {
    font-size: 1.1rem;
}

.amazon-btn-historical .btn-text {
    font-weight: 600;
}

/* Responsive adjustments for historical page */
@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-controls input[type="date"],
    .filter-btn {
        width: 100%;
    }

    .date-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .category-section {
        border-left: none;
        border-top: 4px solid #667eea;
        padding-left: 0;
        padding-top: 1rem;
    }

    .historical-categories {
        gap: 2rem;
    }

    .book-header-historical {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .book-cover-historical {
        align-self: center;
    }
}

/* Content Pages Styles */
.content-page {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: var(--space-12);
    margin-bottom: var(--space-12);
    border: 1px solid var(--neutral-100);
}

.content-page .page-header {
    text-align: center;
    margin-bottom: var(--space-12);
    padding-bottom: var(--space-8);
    border-bottom: 2px solid var(--neutral-100);
}

.content-page .page-header h1 {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--neutral-900);
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
}

.content-page .lead {
    font-size: 1.25rem;
    color: var(--neutral-600);
    margin: 0;
    font-weight: 500;
    line-height: 1.6;
}

/* Special styling for about page lead text on header background */
.page-header .lead {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* 404 Error Page Styles */
.error-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-16) 0;
    text-align: center;
}

.error-content {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--space-16) var(--space-8);
    margin-bottom: var(--space-12);
    border: 1px solid var(--neutral-100);
}

.error-illustration {
    position: relative;
    margin-bottom: var(--space-8);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-number {
    font-size: 8rem;
    font-weight: 800;
    color: var(--primary-600);
    opacity: 0.1;
    position: absolute;
    z-index: 1;
    font-family: var(--font-display);
}

.error-books {
    position: relative;
    z-index: 2;
}

.floating-book {
    position: absolute;
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

.book-1 {
    top: -20px;
    left: -40px;
    animation-delay: 0s;
}

.book-2 {
    top: -30px;
    right: -30px;
    animation-delay: 0.5s;
}

.book-3 {
    bottom: -20px;
    left: -20px;
    animation-delay: 1s;
}

.book-4 {
    bottom: -30px;
    right: -40px;
    animation-delay: 1.5s;
}

.book-5 {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 2s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.error-text h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
}

.error-description {
    font-size: 1.125rem;
    color: var(--neutral-600);
    margin-bottom: var(--space-8);
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.error-suggestions {
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-8);
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.error-suggestions h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--neutral-900);
    margin-bottom: var(--space-3);
    text-align: center;
}

.error-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-suggestions li {
    padding: var(--space-2) 0;
    color: var(--neutral-700);
    position: relative;
    padding-left: var(--space-6);
}

.error-suggestions li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-600);
    font-weight: bold;
}

.error-suggestions a {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.error-suggestions a:hover {
    border-bottom-color: var(--primary-600);
    color: var(--primary-700);
}

.error-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
}

.primary-btn {
    display: inline-block;
    padding: var(--space-4) var(--space-8);
    background: var(--primary-600);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1.125rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.primary-btn:hover {
    background: var(--primary-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.secondary-btn {
    padding: var(--space-4) var(--space-8);
    background: white;
    color: var(--neutral-700);
    border: 2px solid var(--neutral-300);
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

.secondary-btn:hover {
    border-color: var(--neutral-400);
    background: var(--neutral-50);
    transform: translateY(-2px);
}

.error-featured {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: var(--space-8);
    border: 1px solid var(--neutral-100);
}

.error-featured h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--neutral-900);
    margin-bottom: var(--space-6);
}

.featured-books {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
}

.featured-book {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
    text-align: left;
    transition: all 0.2s ease;
}

.featured-book:hover {
    background: var(--primary-50);
    transform: translateY(-2px);
}

.featured-book-cover {
    width: 40px;
    height: 60px;
    background: var(--primary-600);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.featured-book-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--neutral-900);
    margin-bottom: var(--space-1);
    line-height: 1.3;
}

.featured-book-info p {
    font-size: 0.8rem;
    color: var(--neutral-600);
    margin: 0;
}

/* Responsive adjustments for 404 page */
@media (max-width: 768px) {
    .error-page {
        padding: var(--space-8) 0;
    }

    .error-content {
        padding: var(--space-8) var(--space-4);
    }

    .error-number {
        font-size: 6rem;
    }

    .error-text h1 {
        font-size: 2rem;
    }

    .error-actions {
        flex-direction: column;
        align-items: center;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }

    .featured-books {
        grid-template-columns: 1fr;
    }
}

/* Subscribe Setup Page Styles */
.setup-form {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--space-12);
    margin-bottom: var(--space-12);
    border: 1px solid var(--neutral-100);
}

.setup-content h2 {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: var(--space-4);
    text-align: center;
    letter-spacing: -0.02em;
}

.setup-description {
    font-size: 1.125rem;
    color: var(--neutral-600);
    text-align: center;
    margin-bottom: var(--space-12);
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.form-section {
    margin-bottom: var(--space-10);
}

.form-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--neutral-900);
    margin-bottom: var(--space-6);
    text-align: center;
}

.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.genre-option {
    cursor: pointer;
}

.genre-option input {
    display: none;
}

.genre-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-6);
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    background: white;
    transition: all 0.3s ease;
    text-align: center;
}

.genre-card:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.genre-option input:checked+.genre-card {
    border-color: var(--primary-600);
    background: var(--primary-100);
    box-shadow: var(--shadow-lg);
}

.genre-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-3);
}

.genre-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--neutral-800);
}

.email-option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-6);
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.email-option:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
}

.email-option input:checked~.checkmark {
    background: var(--primary-600);
    border-color: var(--primary-600);
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--neutral-300);
    border-radius: var(--radius-sm);
    background: white;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.3s ease;
}

.checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.email-option input:checked~.checkmark::after {
    opacity: 1;
}

.email-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.email-text strong {
    font-size: 1.125rem;
    color: var(--neutral-900);
}

.email-text small {
    font-size: 0.95rem;
    color: var(--neutral-600);
    line-height: 1.4;
}

.form-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: var(--space-12);
}

.setup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-10);
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    min-width: 280px;
}

.setup-btn:hover:not(.disabled) {
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-800) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.setup-btn.disabled {
    background: var(--neutral-300);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.setup-btn .btn-icon {
    font-size: 1.25rem;
}

.skip-btn {
    background: none;
    border: none;
    color: var(--neutral-500);
    font-size: 1rem;
    cursor: pointer;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.skip-btn:hover {
    color: var(--neutral-700);
    background: var(--neutral-100);
}

.setup-loading,
.setup-success {
    text-align: center;
    padding: var(--space-12);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--neutral-200);
    border-top: 4px solid var(--primary-600);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-6);
}

.success-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
}

.setup-success h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--success-600);
    margin-bottom: var(--space-4);
}

.setup-success p {
    font-size: 1.125rem;
    color: var(--neutral-600);
}

/* Responsive adjustments for setup page */
@media (max-width: 768px) {
    .setup-form {
        padding: var(--space-8) var(--space-6);
        margin: var(--space-4);
    }

    .setup-content h2 {
        font-size: 1.875rem;
    }

    .genre-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .genre-card {
        padding: var(--space-4);
    }

    .email-option {
        padding: var(--space-4);
    }

    .setup-btn {
        width: 100%;
        min-width: auto;
    }
}

.last-updated {
    color: var(--neutral-500);
    font-style: italic;
    margin: 0;
    font-size: 0.9rem;
}

.content-section {
    margin-bottom: var(--space-10);
}

.content-section h2 {
    color: var(--neutral-900);
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--primary-600);
    letter-spacing: -0.01em;
}

.content-section h3 {
    color: var(--neutral-800);
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: var(--space-3);
    margin-top: var(--space-6);
}

.content-section p {
    line-height: 1.7;
    color: var(--neutral-700);
    margin-bottom: var(--space-4);
    font-size: 1rem;
}

.content-section ul {
    margin-bottom: var(--space-4);
    padding-left: var(--space-8);
}

.content-section li {
    line-height: 1.6;
    color: var(--neutral-700);
    margin-bottom: var(--space-2);
}

.content-section a {
    color: var(--primary-600);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.content-section a:hover {
    border-bottom-color: var(--primary-600);
    color: var(--primary-700);
}

/* Dark mode overrides for content pages (About/Privacy/Terms/Contact) */
[data-theme="dark"] .content-page {
  background: var(--neutral-100);
  border-color: var(--neutral-200);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .content-page .page-header {
  border-bottom-color: var(--neutral-200);
}

/* Process Steps (About Page) */
.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-8);
    margin: var(--space-8) 0;
}

.step {
    text-align: center;
    padding: var(--space-8) var(--space-6);
    background: white;
    border-radius: var(--radius-xl);
    transition: all 0.2s ease;
    border: 1px solid var(--neutral-200);
    box-shadow: var(--shadow-sm);
}

.step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-300);
}

.step-number {
    display: inline-block;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    border-radius: 50%;
    line-height: 60px;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-md);
}

.step h3 {
    color: var(--neutral-900);
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: var(--space-3);
    margin-top: 0;
}

.step p {
    color: var(--neutral-600);
    margin: 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Features Grid (About Page) */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-6);
    margin: var(--space-8) 0;
}

.feature {
    padding: var(--space-6);
    background: white;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-600);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    transition: all 0.2s ease;
}

.feature:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.feature h3 {
    color: var(--neutral-900);
    font-weight: 600;
    margin-bottom: var(--space-3);
    margin-top: 0;
    font-size: 1.125rem;
}

.feature p {
    color: var(--neutral-600);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Responsive adjustments for content pages */
@media (max-width: 768px) {
    .content-page {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .content-page .page-header h1 {
        font-size: 2rem;
    }

    .process-steps {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .step {
        padding: 1.5rem 1rem;
    }
}

/* Header brand responsive */
@media (max-width: 768px) {
    .header-brand {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .logo {
        height: 45px;
    }

    .brand-text h1 {
        font-size: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-links {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .footer-links {
        grid-template-columns: 1fr;
    }
}

/* Additional Mobile Responsiveness Fixes */
@media (max-width: 768px) {
    /* Prevent any element from causing horizontal overflow */
    * {
        max-width: 100vw;
    }
    
    /* Fix images and media elements */
    img, video, iframe {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix Google Sign-In button */
    .g_id_signin {
        max-width: 100%;
        overflow: hidden;
    }
    
    .g_id_signin > div {
        max-width: 100% !important;
    }
    
    /* Fix sticky banners */
    .sticky-login-banner,
    .sticky-subscribe-banner {
        width: 100%;
        left: 0;
        right: 0;
    }
    
    /* Fix header and navigation */
    header .container,
    .main-nav .container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    /* Fix book cards */
    .book-card {
        max-width: 100%;
    }
    
    /* Fix forms and inputs */
    input, textarea, select, button {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix email form */
    .email-form {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .form-group {
        flex-direction: column;
        width: 100%;
    }
    
    /* Theme toggle button */
    .theme-toggle {
        width: 36px;
        height: 36px;
    }
    
    /* Share menu button */
    .share-icon {
        width: 36px;
        height: 36px;
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    /* Further reduce padding on very small screens */
    .container {
        padding: 0 0.75rem;
    }
    
    .brand-text h1 {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 0.875rem;
    }
    
    /* Smaller avatar on very small screens */
    .avatar {
        width: 32px;
        height: 32px;
    }
    
    .nav-actions {
        gap: 8px;
    }
}

/*
 Contact Page Styles */
.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-6);
    margin: var(--space-8) 0;
}

.contact-method {
    padding: var(--space-8);
    background: white;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-600);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    transition: all 0.2s ease;
}

.contact-method:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.contact-method h3 {
    color: var(--neutral-900);
    font-weight: 600;
    margin-bottom: var(--space-4);
    margin-top: 0;
    font-size: 1.125rem;
}

.contact-method p {
    margin-bottom: var(--space-2);
    color: var(--neutral-600);
    line-height: 1.6;
}

.contact-method:last-child p:last-child {
    margin-bottom: 0;
}

/* FAQ Styles */
.faq-item {
    margin-bottom: var(--space-6);
    padding: var(--space-6);
    background: white;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--success-600);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    transition: all 0.2s ease;
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.faq-item h3 {
    color: var(--neutral-900);
    font-weight: 600;
    margin-bottom: var(--space-3);
    margin-top: 0;
    font-size: 1.125rem;
}

.faq-item p {
    margin: 0;
    color: var(--neutral-700);
    line-height: 1.6;
}

.faq-item a {
    color: var(--primary-600);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.faq-item a:hover {
    border-bottom-color: var(--primary-600);
    color: var(--primary-700);
}

/* Dark mode: contact + FAQ cards */
[data-theme="dark"] .contact-method {
  background: var(--neutral-100);
  border-color: var(--neutral-200);
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}
[data-theme="dark"] .contact-method h3 {
  color: var(--neutral-900);
}
[data-theme="dark"] .contact-method p {
  color: var(--neutral-600);
}

[data-theme="dark"] .faq-item {
  background: var(--neutral-100);
  border-color: var(--neutral-200);
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}
[data-theme="dark"] .faq-item h3 {
  color: var(--neutral-900);
}
[data-theme="dark"] .faq-item p {
  color: var(--neutral-600);
}

/* Responsive adjustments for contact page */
@media (max-width: 768px) {
    .contact-methods {
        grid-template-columns: 1fr;
    }

    .contact-method {
        padding: var(--space-6);
    }

    .faq-item {
        padding: var(--space-5);
    }
}

/*
 Affiliate Disclosure Page Styles */
.affiliate-highlight {
    background: var(--warning-50);
    border: 1px solid var(--warning-100);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin: var(--space-6) 0;
    box-shadow: var(--shadow-sm);
}

.affiliate-highlight p {
    font-size: 1.125rem;
    color: var(--warning-600);
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

.affiliate-highlight p strong {
    color: var(--warning-700);
}

/*
 Privacy Policy & Terms of Use Page Styles */
.policy-section {
    margin-bottom: var(--space-8);
}

.policy-section h2 {
    color: var(--neutral-900);
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--primary-600);
    letter-spacing: -0.01em;
}

.policy-section h3 {
    color: var(--neutral-800);
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: var(--space-3);
    margin-top: var(--space-6);
}

.policy-section p {
    line-height: 1.7;
    color: var(--neutral-700);
    margin-bottom: var(--space-4);
    font-size: 1rem;
}

.policy-section ul {
    margin-bottom: var(--space-4);
    padding-left: var(--space-8);
}

.policy-section li {
    line-height: 1.6;
    color: var(--neutral-700);
    margin-bottom: var(--space-2);
}

.policy-section a {
    color: var(--primary-600);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.policy-section a:hover {
    border-bottom-color: var(--primary-600);
    color: var(--primary-700);
}

.policy-section .last-updated {
    color: var(--neutral-500);
    font-style: italic;
    margin: 0;
    font-size: 0.9rem;
}

/* Responsive adjustments for policy pages */
@media (max-width: 768px) {
    .policy-section h2 {
        font-size: 1.5rem;
    }

    .policy-section h3 {
        font-size: 1.25rem;
    }
}

/* Sticky Login Banner */
.sticky-login-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary-600);
    color: white;
    padding: var(--space-3) 0;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.sticky-login-banner .container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    padding: 0 var(--space-3);
}

/* Google Login Section */
.google-login-section {
    padding: var(--space-16) 0;
    text-align: center;
    overflow: hidden;
    background: var(--neutral-100);
}

.google-login-section h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
}

.google-login-section p {
    font-size: 1.125rem;
    color: var(--neutral-600);
    margin-bottom: var(--space-8);
}

/* Missing Data Styles for History Cards */
.book-card-historical.missing-data {
    border: 2px dashed var(--neutral-300);
    background: linear-gradient(135deg, var(--neutral-50) 0%, var(--neutral-100) 100%);
    opacity: 0.9;
}

.book-card-historical.missing-data .book-cover-historical {
    filter: grayscale(20%) opacity(0.8);
    border: 2px solid var(--neutral-200);
}

.book-card-historical.missing-data .book-description-historical {
    font-style: italic;
    color: var(--neutral-600);
    background: var(--neutral-50);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    border-left: 3px solid var(--neutral-300);
}

.book-card-historical.missing-data .description-note {
    display: block;
    margin-top: var(--space-3);
    font-size: 0.875rem;
    color: var(--neutral-500);
    font-style: normal;
}

.book-card-historical.missing-data::before {
    content: "📋 Limited Info";
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    background: var(--neutral-200);
    color: var(--neutral-600);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 1;
}

.book-card-historical {
    position: relative;
}

/* Improved fallback image styling */
.book-cover-historical[src*="boocu-logo.svg"] {
    background: linear-gradient(135deg, var(--primary-100) 0%, var(--primary-200) 100%);
    padding: var(--space-4);
    border-radius: var(--radius-md);
}

/* Category placeholder images styling */
.book-cover-historical[src^="data:image/svg+xml"] {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--neutral-200);
}

.book-card-historical.missing-data .book-cover-historical[src^="data:image/svg+xml"] {
    opacity: 0.9;
    filter: brightness(0.95);
}
/* Landin
g Page Styles */
.sticky-subscribe-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
    color: white;
    padding: var(--space-3) 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.sticky-subscribe-banner.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.sticky-subscribe-banner .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

.sticky-subscribe-banner span {
    font-weight: 600;
    font-size: 0.95rem;
}

.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #8a2387 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Animated background elements */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Navigation */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 700;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.google-signin {
    background: white;
    color: #333;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.google-signin:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--space-16) 0;
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: var(--space-6);
    line-height: 1.1;
    letter-spacing: -0.02em;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-6);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-icon {
    font-size: 1.2rem;
}

.badge-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.hero-content .subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: var(--space-8);
    opacity: 0.95;
    max-width: 600px;
    line-height: 1.4;
}

.value-props {
    display: flex;
    justify-content: center;
    gap: var(--space-8);
    margin-bottom: var(--space-10);
    flex-wrap: wrap;
}

.value-prop {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: white;
    font-weight: 500;
}

.prop-icon {
    font-size: 1.2rem;
}

.cta-section {
    text-align: center;
}

.cta-button {
    margin-bottom: var(--space-4);
}

.cta-subtext {
    font-size: 0.95rem;
    opacity: 0.8;
    margin: 0;
}

.how-it-works {
    padding: var(--space-16) 0;
    background: white;
}

.how-it-works h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-12);
    color: var(--neutral-800);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-10);
    max-width: 1000px;
    margin: 0 auto;
}

.step {
    text-align: center;
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    transition: all 0.3s ease;
}

.step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-200);
}

.step-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
}

.step h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--neutral-800);
}

.step p {
    color: var(--neutral-600);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Why Choose Boocu Section - Beautiful Design */
.value-proposition {
    padding: 5rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
    overflow: hidden;
}

.value-proposition::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236366f1' fill-opacity='0.03'%3E%3Ccircle cx='20' cy='20' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    pointer-events: none;
}

.value-proposition .container {
    position: relative;
    z-index: 2;
}

.value-proposition h2 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    color: #1e293b;
    letter-spacing: -0.02em;
    position: relative;
}

.value-proposition h2::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 2px;
}

.value-proposition .subtitle {
    text-align: center;
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 4rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.benefit {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.1);
    text-align: left;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.benefit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.benefit:hover::before {
    transform: scaleX(1);
}

.benefit:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.2);
}

.benefit-icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.benefit-icon-wrapper::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: white;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.benefit-icon {
    font-size: 2.5rem;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.benefit h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1e293b;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.benefit p {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
    font-weight: 400;
}

/* Special styling for different benefit cards */
.benefit:nth-child(1) .benefit-icon-wrapper {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

.benefit:nth-child(1) .benefit-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.benefit:nth-child(2) .benefit-icon-wrapper {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.benefit:nth-child(2) .benefit-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.benefit:nth-child(3) .benefit-icon-wrapper {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.benefit:nth-child(3) .benefit-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.benefit:nth-child(4) .benefit-icon-wrapper {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

.benefit:nth-child(4) .benefit-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.urgency-section {
    padding: var(--space-16) 0;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.urgency-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    pointer-events: none;
}

.urgency-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-12);
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.urgency-text h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
    line-height: 1.2;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.urgency-text p {
    font-size: 1.25rem;
    margin-bottom: var(--space-6);
    line-height: 1.5;
    color: #e2e8f0;
}

.urgency-stats {
    display: flex;
    gap: 1.5rem;
}

.stat {
    text-align: center;
    background: white;
    padding: 1.5rem 1rem;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    transition: all 0.3s ease;
}

.stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    color: #1e293b;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.3;
}

.urgency-cta {
    text-align: center;
}

.urgency-note {
    font-size: 0.9rem;
    margin-top: var(--space-3);
    margin-bottom: 0;
    color: #e2e8f0;
    font-weight: 500;
}

.book-showcase {
    padding: var(--space-16) 0;
    background: white;
}

.book-showcase h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-12);
    color: var(--neutral-800);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.showcase-book-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.showcase-book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    border-color: rgba(99, 102, 241, 0.2);
}

.showcase-book-image {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.showcase-book-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.showcase-book-card:hover .showcase-book-image img {
    transform: scale(1.05);
}

.showcase-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(139, 92, 246, 0.9) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s ease;
    backdrop-filter: blur(4px);
}

/* Invisible full-area Google Sign-In capture for dynamic cards */
.gsi-click-capture {
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 2;
}

.showcase-book-card:hover .showcase-overlay {
    opacity: 1;
}

.signup-prompt {
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.overlay-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

.showcase-book-info {
    padding: 1.5rem;
    background: white;
    position: relative; /* allow invisible GSI capture overlay */
}

.showcase-book-info h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #1e293b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.showcase-description {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.showcase-cta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.free-badge {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.signup-text {
    color: #6366f1;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
}

.final-cta {
    padding: var(--space-16) 0;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
    color: white;
    text-align: center;
}

.final-cta h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
}

.final-cta p {
    font-size: 1.25rem;
    margin-bottom: var(--space-8);
    opacity: 0.95;
}

.loading, .error {
    text-align: center;
    padding: var(--space-8);
    color: var(--neutral-600);
    font-style: italic;
}

.error {
    color: var(--error-600);
}

/* Pulse animation for CTA button */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content .subtitle {
        font-size: 1.25rem;
    }
    
    .value-props {
        flex-direction: column;
        gap: var(--space-4);
        align-items: center;
    }
    
    .how-it-works h2,
    .value-proposition h2,
    .book-showcase h2,
    .final-cta h2 {
        font-size: 2rem;
    }
    
    .urgency-text h2 {
        font-size: 2rem;
    }
    
    .steps {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .benefit {
        padding: 2rem 1.5rem;
    }
    
    .benefit-icon-wrapper {
        width: 70px;
        height: 70px;
    }
    
    .benefit-icon {
        font-size: 2rem;
    }
    
    .benefit h3 {
        font-size: 1.25rem;
    }
    
    .features {
        gap: 1.5rem;
    }
    
    .feature {
        font-size: 0.9rem !important;
    }
    
    .urgency-content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        text-align: center;
    }
    
    .urgency-stats {
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .stat {
        min-width: 100px;
        padding: 1.25rem 0.75rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    .showcase-book-info {
        padding: 1.25rem;
    }
    
    .showcase-book-info h4 {
        font-size: 1rem;
    }
    
    .showcase-description {
        font-size: 0.85rem;
    }
    
    .sticky-subscribe-banner .container {
        flex-direction: column;
        gap: var(--space-2);
        text-align: center;
    }
    
    .hero-section .main-nav .container {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .nav-brand {
        order: 1;
    }
    
    #g_id_signin_header {
        order: 2;
    }
}/*
 Floating book elements */
.floating-books {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.book {
    position: absolute;
    width: 40px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    animation: floatBooks 15s infinite linear;
}

.book:nth-child(1) { left: 10%; animation-delay: 0s; }
.book:nth-child(2) { left: 20%; animation-delay: -3s; }
.book:nth-child(3) { left: 80%; animation-delay: -6s; }
.book:nth-child(4) { left: 90%; animation-delay: -9s; }

@keyframes floatBooks {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Override existing hero styles with new design */
.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 5%;
    position: relative;
    z-index: 5;
}

.hero-badge {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.8s ease-out;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 800;
    color: white;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    animation: slideUp 0.8s ease-out 0.2s both;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
    max-width: 600px;
    animation: slideUp 0.8s ease-out 0.4s both;
}

.features {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    justify-content: center;
    animation: slideUp 0.8s ease-out 0.6s both;
}

.feature {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.95rem !important;
    font-weight: 500;
    background: none !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.feature-icon {
    font-size: 1.2rem;
}

.cta-section {
    animation: slideUp 0.8s ease-out 0.8s both;
}

.cta-button {
    background: white;
    color: #333;
    padding: 18px 36px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    margin-bottom: 1.5rem;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.social-proof {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Medium screens - maintain 2+2 layout */
@media (max-width: 1024px) and (min-width: 769px) {
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        max-width: 800px;
    }
    
    .benefit {
        padding: 2rem 1.5rem;
    }
}

/* Updated responsive design for new hero layout */
@media (max-width: 768px) {
    .nav {
        padding: 1.5rem 4%;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .google-signin {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .hero-content {
        padding: 2rem 4%;
    }
    
    .features {
        gap: 1.5rem;
    }
    
    .feature {
        font-size: 0.9rem;
    }
    
    .cta-button {
        padding: 16px 32px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .features {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Dark Mode: explicit toggle (light is default) */
[data-theme="dark"] {
  /* Neutral remap for dark surfaces with high readability */
  --neutral-50: #0f172a;   /* page bg */
  --neutral-100: #111827;  /* surfaces */
  --neutral-200: #1f2937;  /* borders */
  --neutral-300: #334155;
  --neutral-400: #475569;
  --neutral-500: #64748b;
  --neutral-600: #94a3b8;  /* muted text */
  --neutral-700: #cbd5e1;
  --neutral-800: #e2e8f0;  /* primary text */
  --neutral-900: #f1f5f9;

  /* Component tokens */
  --card-bg: #111827;
  --border-color: #1f2937;
  --muted-text: #94a3b8;
}

[data-theme="dark"] body {
  background-color: var(--neutral-50);
  color: var(--neutral-800);
}

[data-theme="dark"] .main-nav {
  background: var(--neutral-100);
  border-bottom-color: var(--neutral-200);
}

[data-theme="dark"] .nav-links a {
  color: var(--neutral-600);
}
[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active {
  background: rgba(99, 102, 241, 0.18);
  color: var(--neutral-800);
}

[data-theme="dark"] .dropdown-content {
  background-color: var(--neutral-100);
  box-shadow: 0 12px 24px rgba(0,0,0,0.5);
}
[data-theme="dark"] .dropdown-content a {
  color: var(--neutral-800);
}
[data-theme="dark"] .dropdown-content a:hover {
  background-color: var(--neutral-200);
}

[data-theme="dark"] .share-icon {
  background: var(--neutral-200);
  border-color: var(--neutral-300);
  color: var(--neutral-800);
}

/* Cards/sections using white backgrounds */
[data-theme="dark"] .share-section {
  background: var(--card-bg);
  border-color: var(--border-color);
}

/* Dark mode readability fixes */
[data-theme="dark"] .highlights {
  background: var(--card-bg);
  border-color: var(--border-color);
}
[data-theme="dark"] .highlights h2 {
  color: var(--neutral-900);
}
[data-theme="dark"] .stat {
  background: var(--neutral-200);
}
[data-theme="dark"] .stat .number {
  color: var(--neutral-900);
}
[data-theme="dark"] .stat .label {
  color: var(--neutral-600);
}

[data-theme="dark"] .book-title {
  color: var(--neutral-900);
}
/* Share section */
.share-section {
  margin: 40px 0 20px;
  padding: 24px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  background: var(--card-bg, #fff);
}
.share-section h2 {
  margin: 0 0 8px;
}
.share-subtitle {
  margin: 0 0 16px;
  color: var(--muted-text, #6b7280);
}
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
}
.share-x { background: #000; }
.share-facebook { background: #1877F2; }
.share-reddit { background: #ff4500; }
.share-whatsapp { background: #25D366; }
.share-copy { background: #6b7280; }
.share-copy-feedback {
  margin-left: 12px;
  color: #059669;
  font-weight: 600;
}
