:root {
    /* Color Palette - Rational Deep Blue & Warm Grey (Dark Mode Default) */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    /* Navbar & Footer Specific Backgrounds */
    --bg-navbar: rgba(15, 23, 42, 0.95);
    --bg-navbar-scrolled: rgba(15, 23, 42, 0.98);
    --bg-footer: #020617;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-secondary: #f59e0b; /* Amber for warmth/community */
    --accent-tertiary: #8b5cf6; /* Purple for free/trial/alliance */
    
    --border-color: #334155;
    --border-highlight: #475569;
    
    /* Spacing */
    --container-padding: 20px;
    --section-spacing: 60px; /* Mobile default */
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --line-height-base: 1.6;
    --line-height-relaxed: 1.8; /* Requirement: 1.8 line-height for Chinese */
    
    /* Effects */
    --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);
    --glow: 0 0 20px rgba(59, 130, 246, 0.15);
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    
    /* Light Mode Navbar & Footer */
    --bg-navbar: rgba(255, 255, 255, 0.95);
    --bg-navbar-scrolled: rgba(255, 255, 255, 0.98);
    --bg-footer: #f1f5f9; /* Slate 100 */
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b; /* Slightly darker for better readability in light mode */
    
    --border-color: #e2e8f0;
    --border-highlight: #cbd5e1;
    
    /* Keep accents same for consistency, or adjust if needed */
    /* --accent-primary: #2563eb; */
    
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: var(--line-height-base);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* The System Grid Background */
    background-image: 
        linear-gradient(rgba(51, 65, 85, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(51, 65, 85, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

ul {
    list-style: none;
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
    font-size: 1rem; /* Min 15px requirement met (16px default) */
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-primary); }

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section {
    padding: var(--section-spacing) 0;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.theme-toggle:hover {
    color: var(--accent-primary);
}

.theme-toggle svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* Navbar - Mobile First */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--bg-navbar);
    border-bottom: 1px solid var(--border-color); /* Use variable instead of hardcoded */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
    background-color: var(--bg-navbar-scrolled);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.logo img {
    height: 32px;
    width: auto;
}



/* Ensure footer text is legible in light mode */
[data-theme="light"] .footer {
    color: var(--text-secondary);
}

/* Mobile Nav: Hidden by default, absolute positioned */
.nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background-color: var(--bg-primary);
    width: 100%;
    height: calc(100vh - 70px);
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    padding-top: 2rem;
    gap: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
}

.nav-menu.active {
    left: 0;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.1rem; /* Larger for mobile touch */
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

/* Hamburger - Visible on Mobile */
.hamburger {
    display: block;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}

.bar {
    display: block;
    width: 25px;
    height: 2px;
    margin: 5px auto;
    background-color: var(--text-primary);
    transition: all 0.3s ease-in-out;
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}
.hamburger.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    width: 100%; /* Mobile full width */
}

.btn-primary {
    background-color: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-highlight);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

/* Hero Section */
.hero {
    min-height: 60vh; /* Reduced from 80vh to reduce vertical whitespace */
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 100px;
    padding-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    opacity: 0.6; /* Softer gradient */
}

/* Light mode specific overrides for hero */
[data-theme="light"] .hero::before {
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-buttons {
    display: flex;
    flex-direction: column; /* Mobile stack */
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Grid System - Mobile First (1 column) */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

/* Footer - Mobile First */
.footer {
    background-color: var(--bg-footer);
    padding: 4rem 0 2rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-qr-group {
    display: flex;
    flex-direction: column; /* Mobile stack QRs usually, or row wrap */
    gap: 2rem;
    justify-content: center;
    align-items: center;
}

@media (min-width: 480px) {
    .footer-qr-group {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.qr-item {
    text-align: center;
}

.qr-img {
    width: 120px;
    height: 120px;
    background-color: white;
    padding: 5px;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.qr-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Desktop Adaptation (min-width: 768px) */
@media (min-width: 768px) {
    :root {
        --section-spacing: 80px;
    }

    /* Navbar Desktop */
    .hamburger {
        display: none;
    }

    /* Adjust navbar container to accommodate toggle */
    .navbar-container {
        gap: 1rem;
    }

    .nav-menu {
        position: static;
        flex-direction: row;
        background-color: transparent;
        width: auto;
        height: auto;
        box-shadow: none;
        padding-top: 0;
        gap: 30px;
        border-top: none;
        display: flex;
    }

    .nav-link {
        font-size: 0.95rem;
    }
    
    .btn {
        width: auto; /* Revert full width */
    }

    .btn-nav {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* Hero Desktop */
    .hero-buttons {
        flex-direction: row;
    }

    /* Grid Desktop */
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    /* Footer Desktop */
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }

    .footer-qr-group {
        justify-content: flex-end;
    }
    
    /* Button Group Desktop */
    .btn-group {
        flex-direction: row;
    }
}

/* Floating Button (Mobile Only - Hidden on Desktop) */
.floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    z-index: 999;
    cursor: pointer;
    transition: transform 0.2s ease;
}

@media (min-width: 769px) {
    .floating-btn {
        display: none;
    }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    max-width: 300px;
    width: 100%;
    position: relative;
    border: 1px solid var(--border-color);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

/* Feature List */
.feature-list {
    margin-top: 1rem;
    padding-left: 0;
}

.feature-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.feature-list li::before {
    content: "•";
    color: var(--accent-primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Section Header */
.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
}

/* Comparison Table */
.comparison-table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.comparison-table th, .comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
}

.comparison-table td {
    color: var(--text-secondary);
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    padding: 1rem 0 1rem 2rem;
    position: relative;
    border-left: 2px solid var(--border-color);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 1.5rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--accent-primary);
}

/* FAQ */
.faq-item {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1.5rem;
}

.faq-question {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.faq-answer {
    color: var(--text-secondary);
    padding-left: 1.5rem;
}

/* Mobile Centering Overrides */
@media (max-width: 767px) {
    .section-header, 
    .hero-content, 
    .footer-content, 
    .footer-qr-group,
    .card,
    .intro-text,
    .about-text {
        text-align: center;
    }

    .card {
        align-items: center;
    }

    /* Keep lists left-aligned but centered as a block if needed, 
       or just let them be left-aligned inside the centered card */
    .feature-list {
        display: inline-block;
        text-align: left;
        max-width: 100%;
    }
    
    .timeline {
        padding-left: 1rem;
    }
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Optimization Styles */
.text-highlight {
    color: var(--accent-secondary);
    font-weight: 600;
    border-bottom: 1px dashed rgba(245, 158, 11, 0.5);
    padding-bottom: 1px;
}

.icon-svg {
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
}

.card-icon svg {
    width: 3rem;
    height: 3rem;
    color: var(--accent-primary);
}

.feature-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    color: var(--accent-secondary);
    /* Ensure icon doesn't shrink */
    flex-shrink: 0;
}

/* Remove default bullet for list items using icons */
.feature-list li.feature-icon-wrapper {
    padding-left: 0;
    display: flex; /* Use flex for better alignment */
    text-align: left; /* Ensure text aligns left even if parent is centered */
}

.feature-list li.feature-icon-wrapper::before {
    content: none;
}

.feature-icon-wrapper svg {
    width: 1.25rem;
    height: 1.25rem;
}

.timeline-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    color: var(--accent-primary);
}

.timeline-icon-wrapper svg {
    width: 1.25rem;
    height: 1.25rem;
}
