/* ==========================================
   Design Tokens & Variables
   ========================================== */
:root {
    /* Color Palette */
    --bg-main: #09090b; /* zinc-950 */
    --bg-secondary: #18181b; /* zinc-900 */
    --text-primary: #fafafa; /* zinc-50 */
    --text-secondary: #a1a1aa; /* zinc-400 */
    
    --accent-gradient-1: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); /* blue-500 to blue-700 */
    --accent-gradient-2: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%); /* blue-400 to blue-600 */
    --accent-glow: rgba(59, 130, 246, 0.5); /* blue-500 */
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(16px);
    
    /* Spacing & Layout */
    --container-max: 1200px;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;
    
    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.light-mode {
    --bg-main: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --accent-glow: rgba(59, 130, 246, 0.2);
}

body.light-mode .navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
}

/* Fix global links inline colors for light mode */
body.light-mode .global-links a:first-child {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #0f172a !important;
}
body.light-mode .global-links a:not(:first-child) {
    color: #475569 !important;
}
body.light-mode .global-links a:not(:first-child):hover {
    background: rgba(0, 0, 0, 0.05) !important;
}
body.light-mode .global-links {
    border-left-color: rgba(0, 0, 0, 0.1) !important;
}

/* ==========================================
   Base Reset
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 5%;
}

/* ==========================================
   Dynamic Background Effects
   ========================================== */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: #3b82f6; /* blue-500 */
    animation-delay: 0s;
}

.orb-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: #1d4ed8; /* blue-700 */
    animation-delay: -5s;
}

.orb-3 {
    top: 40%;
    left: 50%;
    width: 40vw;
    height: 40vw;
    background: #1e40af; /* blue-800 */
    transform: translateX(-50%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 10%) scale(1.1); }
}

/* ==========================================
   Navigation
   ========================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1.5rem 0;
    transition: all var(--transition-smooth);
}

.navbar.scrolled {
    padding: 1rem 0;
    background: rgba(6, 9, 19, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--text-primary);
    transition: width var(--transition-fast);
}

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

.nav-links a:hover::after {
    width: 100%;
}

/* ==========================================
   Hero Section
   ========================================== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px; /* offset for nav */
    position: relative;
}

.hero-content {
    max-width: 800px;
    text-align: center;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    color: var(--text-secondary);
    text-transform: uppercase;
    animation: slideUpFade 0.8s ease forwards;
}

.hero-section h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    animation: slideUpFade 0.8s ease 0.1s forwards;
    opacity: 0;
}

.text-gradient {
    background: var(--accent-gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 600px;
    animation: slideUpFade 0.8s ease 0.2s forwards;
    opacity: 0;
}

.hero-actions {
    margin-top: 1rem;
    animation: slideUpFade 0.8s ease 0.3s forwards;
    opacity: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--accent-gradient-1);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255,255,255,0.1), rgba(255,255,255,0));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.btn-primary:hover::before {
    opacity: 1;
}

@keyframes slideUpFade {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* ==========================================
   Products Section & Glass Cards
   ========================================== */
.products-section {
    padding: var(--spacing-xl) 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    padding: 2.5rem;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity var(--transition-smooth);
    pointer-events: none;
}

.glass-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        800px circle at var(--mouse-x, 0) var(--mouse-y, 0), 
        rgba(255, 255, 255, 0.06),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.glass-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.glass-card:hover::before,
.glass-card:hover::after {
    opacity: 1;
}

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.icon-ai {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.icon-pdf {
    background: rgba(14, 165, 233, 0.1);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.card-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.card-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.feature-list {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex-grow: 1;
}

.feature-list li {
    color: var(--text-primary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    transition: all var(--transition-fast);
}

.glass-card:hover .card-btn {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================
   Footer (Unified Design)
   ========================================== */
.main-footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
    background-color: var(--bg-main);
    transition: background-color var(--transition-smooth);
}

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

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 3rem;
    }
    .brand-col {
        grid-column: span 2;
    }
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 8px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.brand-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.7;
    max-width: 320px;
}

.footer-col h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-col ul a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.footer-col ul a:hover {
    color: #3b82f6; /* blue-500 */
}

.qrcode-wrapper {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.qrcode-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.qrcode-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    padding: 4px;
    background: #fff;
}

.qrcode-item span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.75rem;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
    }
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 768px) {
    .nav-links {
        display: none; /* simple mobile hide for now */
    }
    .hero-section h1 {
        font-size: 2.2rem;
    }
    .section-header h2 {
        font-size: 2rem;
    }
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

.footer-bottom-left { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.beian-link { color: #a1a1aa; text-decoration: none; transition: color 0.3s; }
.beian-link:hover { color: #18181b; }
