/**
 * HealthHub - Unified Frontend Design System
 * Dual Theme Architecture:
 * - [data-theme="swiss"]: Swiss Minimalist & Editorial Clarity (方案1)
 * - [data-theme="biotech"]: Clean Modern Bio-Tech & Vitality Orange (方案3)
 * Compliant with Google AdSense Policies & Core Web Vitals (CLS < 0.1)
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* ==========================================================================
   1. Theme Tokens & CSS Custom Properties
   ========================================================================== */

:root, [data-theme="swiss"] {
    /* Base Colors - Swiss Pure White & Graphite */
    --bg-body: #ffffff;
    --bg-surface: #f9fafb;
    --bg-surface-elevated: #ffffff;
    --bg-subtle: #f3f4f6;
    --bg-input: #ffffff;

    /* Text Hierarchy */
    --text-primary: #111827;      /* Deep Charcoal */
    --text-secondary: #4b5563;    /* Cool Slate */
    --text-muted: #9ca3af;        /* Neutral Gray */
    --text-inverse: #ffffff;

    /* Brand & Accent - Alpine Emerald Teal */
    --primary: #0d9488;
    --primary-hover: #0f766e;
    --primary-subtle: #f0fdfa;
    --primary-border: #ccfbf1;
    --primary-rgb: 13, 148, 136;
    --accent: #2563eb;

    /* Borders & Dividers */
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --border-card: 1px solid #e5e7eb;
    --border-hairline: 1px solid #e5e7eb;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-card-hover: 0 12px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-dropdown: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

    /* Geometry & Spacing */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    --badge-radius: 4px;

    /* Typography */
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Component Themes */
    --header-bg: rgba(255, 255, 255, 0.92);
    --header-border: 1px solid #e5e7eb;
    --hero-bg: linear-gradient(180deg, #f9fafb 0%, #ffffff 100%);
    --card-bg: #ffffff;
    --footer-bg: #f9fafb;
    --footer-border: 1px solid #e5e7eb;
    --ad-bg: #f9fafb;
    --ad-border: 1px dashed #d1d5db;
    --ad-label-color: #6b7280;
    --tag-bg: #f3f4f6;
    --tag-color: #374151;
}

[data-theme="biotech"] {
    /* Base Colors - Clean Crisp Biotech Light Canvas */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-subtle: #f1f5f9;
    --bg-input: #ffffff;

    /* Text Hierarchy */
    --text-primary: #0f172a;      /* Navy Midnight */
    --text-secondary: #475569;    /* Steel Slate */
    --text-muted: #94a3b8;        /* Soft Blue Gray */
    --text-inverse: #ffffff;

    /* Brand & Accent - Vitality Citrus Orange & Bio-Science Blue */
    --primary: #ff6b35;           /* Energetic Orange */
    --primary-hover: #ea580c;
    --primary-subtle: #fff7ed;
    --primary-border: #ffedd5;
    --primary-rgb: 255, 107, 53;
    --accent: #2563eb;            /* Digital Cobalt Blue */
    --accent-subtle: #eff6ff;

    /* Borders & Dividers */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-card: 1px solid rgba(226, 232, 240, 0.85);
    --border-hairline: 1px solid #e2e8f0;

    /* Shadows - Soft ambient glow with vitality hint */
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.03);
    --shadow-card: 0 8px 20px -4px rgba(15, 23, 42, 0.04), 0 4px 6px -2px rgba(15, 23, 42, 0.02);
    --shadow-card-hover: 0 20px 30px -8px rgba(255, 107, 53, 0.12), 0 8px 12px -4px rgba(15, 23, 42, 0.04);
    --shadow-dropdown: 0 15px 30px -5px rgba(15, 23, 42, 0.08);

    /* Geometry & Spacing - Friendly Modern Curves */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --badge-radius: 9999px;

    /* Typography */
    --font-main: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Outfit', sans-serif;

    /* Component Themes */
    --header-bg: rgba(255, 255, 255, 0.94);
    --header-border: 1px solid #e2e8f0;
    --hero-bg: linear-gradient(135deg, rgba(255, 107, 53, 0.05) 0%, rgba(37, 99, 235, 0.03) 100%);
    --card-bg: #ffffff;
    --footer-bg: #ffffff;
    --footer-border: 1px solid #e2e8f0;
    --ad-bg: #ffffff;
    --ad-border: 1px dashed #cbd5e1;
    --ad-label-color: #64748b;
    --tag-bg: #fff7ed;
    --tag-color: #c2410c;
}

/* ==========================================================================
   2. Reset & Global Base
   ========================================================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: clip;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
    transition: background-color 0.25s ease, color 0.25s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

button, a, input, select, textarea, [role="button"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

input, select, textarea {
    font-family: inherit;
    font-size: 16px; /* 阻止 iOS Safari 聚焦输入框时强制放大页面破坏视口 */
}

img, video, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-main {
    flex: 1 0 auto;
    padding-top: 80px; /* Offset for fixed header */
}

/* ==========================================================================
   3. Top Navigation Header
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: var(--header-border);
    z-index: 1000;
    padding-top: env(safe-area-inset-top, 0px);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 1.5rem;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.brand-logo:hover {
    color: var(--primary);
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.25);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.brand-logo:hover .brand-icon {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--primary-subtle);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-search-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.header-search-btn:hover {
    color: var(--primary);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    font-size: 1.5rem;
}

/* ==========================================================================
   4. Google AdSense Compliant Containers (CLS < 0.1 & Clear Labels)
   ========================================================================== */

.ad-wrapper {
    width: 100%;
    margin: 1.75rem auto;
    text-align: center;
    clear: both;
    position: relative;
}

.ad-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ad-label-color);
    margin-bottom: 6px;
    text-align: center;
    user-select: none;
}

.ad-slot-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--ad-bg);
    border: var(--ad-border);
    border-radius: var(--radius-md);
    padding: 10px;
    overflow: hidden;
    margin: 0 auto;
    transition: all 0.2s ease;
}

/* Explicit minimum heights preventing Cumulative Layout Shift */
.ad-slot-header {
    min-height: 90px;
    max-width: 970px;
}

.ad-slot-article-top {
    min-height: 250px;
    max-width: 800px;
}

.ad-slot-article-middle {
    min-height: 280px;
    max-width: 800px;
}

.ad-slot-article-bottom {
    min-height: 250px;
    max-width: 800px;
}

/* ==========================================================================
   5. Hero Section & Search
   ========================================================================== */

.hero-section {
    background: var(--hero-bg);
    padding: 3.5rem 0 2.5rem;
    border-bottom: var(--border-hairline);
    text-align: center;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-subtle);
    color: var(--primary);
    border: 1px solid var(--primary-border);
    padding: 4px 12px;
    border-radius: var(--badge-radius);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.25rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.search-box-wrap {
    max-width: 640px;
    margin: 0 auto;
}

.search-form-unified {
    display: flex;
    align-items: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 6px 8px 6px 18px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.search-form-unified:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.search-input-field {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    padding: 8px 0;
}

.search-input-field::placeholder {
    color: var(--text-muted);
}

.search-submit-btn {
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-full);
    padding: 10px 22px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.search-submit-btn:hover {
    background: var(--primary-hover);
}

.search-submit-btn:active {
    transform: scale(0.98);
}

.quick-category-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.category-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
}

/* ==========================================================================
   6. Article Grid & Bento Cards
   ========================================================================== */

.content-section {
    padding: 3rem 0;
}

.section-header-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: var(--border-hairline);
}

.section-heading {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.section-subtext {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.articles-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.article-card-item {
    background: var(--card-bg);
    border: var(--border-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    text-decoration: none;
    color: inherit;
}

.article-card-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary-border);
}

.card-media-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: var(--bg-subtle);
    overflow: hidden;
}

.card-media-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.article-card-item:hover .card-media-wrap img {
    transform: scale(1.04);
}

.card-body-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-category-badge {
    background: var(--tag-bg);
    color: var(--tag-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--badge-radius);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.article-card-item:hover .card-title-text {
    color: var(--primary);
}

.card-summary-text {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.card-footer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-top: var(--border-hairline);
    padding-top: 0.85rem;
    margin-top: auto;
}

.read-more-link {
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   7. Article Detail Page Layout
   ========================================================================== */

.article-hero-wrap {
    padding: calc(70px + 1.25rem) 0 0.5rem;
    border-bottom: var(--border-hairline);
    background: var(--hero-bg);
}

.article-hero-wrap + .site-main {
    padding-top: 0.5rem;
}

.breadcrumb-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.breadcrumb-nav a {
    color: var(--text-secondary);
}

.breadcrumb-nav a:hover {
    color: var(--primary);
}

.article-main-title {
    font-family: var(--font-heading);
    font-size: clamp(1.65rem, 3.5vw, 2.35rem);
    font-weight: 800;
    line-height: 1.28;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.article-lead-summary {
    font-size: 1.02rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.45rem;
    max-width: 880px;
}

/* Compact Unified Metadata & Share Strip */
.article-meta-compact-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem 1rem;
    margin-top: 0.45rem;
    padding: 0.45rem 0;
    border-top: 1px dashed var(--border-hairline);
}

.article-byline-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: 0;
    margin: 0;
}

.byline-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Article Layout Grid (Content + Table of Contents Sidebar) */
.article-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 2.5rem 0;
}

@media (min-width: 1024px) {
    .article-layout-grid {
        grid-template-columns: minmax(0, 1fr) 300px;
    }
}

.article-body-wrapper {
    min-width: 0; /* Prevents overflow */
}

/* Editorial Typography */
.article-rich-content {
    font-size: 1.08rem;
    line-height: 1.85;
    color: var(--text-primary);
}

.article-rich-content p {
    margin-bottom: 1.5rem;
}

.article-rich-content h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2.5rem 0 1rem;
    line-height: 1.35;
    letter-spacing: -0.015em;
    padding-bottom: 0.5rem;
    border-bottom: var(--border-hairline);
    scroll-margin-top: 100px;
}

.article-rich-content h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 0.75rem;
    line-height: 1.4;
    scroll-margin-top: 100px;
}

.article-rich-content ul, .article-rich-content ol {
    margin: 1.25rem 0 1.5rem 1.75rem;
}

.article-rich-content li {
    margin-bottom: 0.5rem;
}

.article-rich-content blockquote {
    border-left: 4px solid var(--primary);
    background: var(--bg-surface);
    padding: 1.25rem 1.75rem;
    margin: 2rem 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--text-secondary);
}

.article-rich-content figure {
    margin: 2rem 0;
}

.article-rich-content figure img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    width: 100%;
}

.article-rich-content figcaption {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
}

/* Table of Contents (TOC) - Compact Modern Card */
.toc-box {
    background: var(--bg-surface);
    border: var(--border-card);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.15rem;
    margin: 0.4rem 0 1.25rem;
}

.toc-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.55rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.toc-link {
    font-size: 0.86rem;
    color: var(--text-secondary);
    display: block;
    line-height: 1.35;
    transition: color 0.2s ease;
}

.toc-link:hover {
    color: var(--primary);
}

/* Sticky Sidebar Widget */
.sidebar-sticky-wrap {
    position: sticky;
    top: 90px;
}

/* FAQ Accordion Section */
.faq-block-section {
    margin: 3rem 0;
    background: var(--bg-surface);
    border: var(--border-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.faq-heading {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.faq-item-box {
    border-bottom: var(--border-hairline);
    padding: 1.25rem 0;
}

.faq-item-box:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-question-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-question-badge {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--primary-subtle);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.faq-answer-text {
    font-size: 0.98rem;
    color: var(--text-secondary);
    line-height: 1.7;
    padding-left: 32px;
}

/* Social Share Bar - Compact Inline Strip */
.share-actions-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    border: none;
}

.share-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 0.2rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    color: #ffffff;
    line-height: 1;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.share-btn-fb { background: #1877f2; }
.share-btn-pin { background: #e60023; }
.share-btn-tw { background: #0f1419; }
.share-btn-in { background: #0a66c2; }

/* ==========================================================================
   8. Multi-Column AdSense Compliance Footer
   ========================================================================== */

.site-footer {
    background: var(--footer-bg);
    border-top: var(--footer-border);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    font-size: 0.92rem;
}

.footer-columns-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col-brand .footer-brand-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-brand-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    max-width: 360px;
}

.footer-col-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.75px;
    margin-bottom: 1.25rem;
}

.footer-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-nav-link {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.footer-nav-link:hover {
    color: var(--primary);
}

.footer-disclaimer-box {
    background: var(--bg-surface);
    border: var(--border-hairline);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 2rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
    text-align: center;
}

.footer-bottom-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-top: var(--border-hairline);
    padding-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

/* ==========================================================================
   9. Pagination
   ========================================================================== */

.pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.pagination-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.pagination-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

/* ==========================================================================
   10. Legal & Compliance Content Pages (About, Privacy, Terms, Disclaimer)
   ========================================================================== */

.legal-article-card {
    background: var(--card-bg);
    border: var(--border-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 3rem 3.5rem;
    margin: 2.5rem 0 4rem;
}

.legal-article-card h1 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.legal-article-card .last-updated {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: var(--border-hairline);
}

.legal-article-card h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2rem 0 1rem;
}

.legal-article-card p {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.legal-article-card ul {
    margin: 1rem 0 1.5rem 2rem;
    color: var(--text-secondary);
}

.legal-article-card li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* ==========================================================================
   11. Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1024px) {
    .footer-columns-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none; /* Collapsed in mobile */
    }

    .mobile-menu-toggle {
        display: block;
    }

    .header-inner {
        height: 60px;
    }

    .site-main {
        padding-top: 65px;
    }

    .article-hero-wrap {
        padding: calc(60px + 0.65rem) 0 0.35rem;
    }

    .article-hero-wrap + .site-main {
        padding-top: 0.35rem;
    }

    .article-main-title {
        font-size: 1.45rem;
        line-height: 1.3;
        margin-bottom: 0.45rem;
    }

    .article-lead-summary {
        font-size: 0.92rem;
        line-height: 1.55;
        margin-bottom: 0.45rem;
    }

    .article-meta-compact-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.45rem;
        padding: 0.35rem 0 0.2rem;
    }

    .article-byline-bar {
        font-size: 0.75rem;
        gap: 0.25rem 0.65rem;
    }

    .share-actions-bar {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        gap: 0.4rem;
        margin: 0;
        padding: 0;
    }

    .share-btn {
        padding: 3px 9px;
        font-size: 0.72rem;
    }

    .toc-box {
        padding: 0.75rem 0.95rem;
        margin: 0.35rem 0 1rem;
    }

    .toc-title {
        font-size: 0.88rem;
        margin-bottom: 0.45rem;
    }

    .toc-link {
        font-size: 0.82rem;
        line-height: 1.3;
    }

    .articles-grid-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-columns-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom-bar {
        flex-direction: column;
        text-align: center;
    }

    .legal-article-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .search-form-unified {
        flex-direction: column;
        border-radius: var(--radius-lg);
        padding: 10px;
        gap: 8px;
    }

    .search-submit-btn {
        width: 100%;
        justify-content: center;
        border-radius: var(--radius-md);
    }
}

/* ==========================================================================
   12. Google AdSense Containers & CLS Prevention (< 0.1 CLS)
   ========================================================================== */
.ad-slot-wrapper,
.ad-wrapper {
    position: relative;
    width: 100%;
    margin: 2rem auto;
    padding: 1rem 0.5rem 0.75rem;
    background: var(--bg-surface);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-normal);
}

.ad-disclosure-label,
.ad-label {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    user-select: none;
}

.ad-responsive-header,
.ad-slot-header {
    min-height: 90px;
    max-width: 970px;
    width: 100%;
}

.ad-responsive-footer,
.ad-slot-article-bottom {
    min-height: 90px;
    max-width: 970px;
    width: 100%;
}

.ad-responsive-content,
.ad-slot-article-top,
.ad-slot-article-middle {
    min-height: 250px;
    max-width: 728px;
    width: 100%;
    margin: 1.5rem auto;
}

.ad-responsive-sidebar {
    min-height: 250px;
    max-width: 300px;
    width: 100%;
}
