/* 
 * 旺商聊 - Modern SaaS Dark Theme (Fixed & Optimized)
 */

:root {
    /* Color System */
    --bg-body: #050505;
    --bg-surface: #0f1012;
    --bg-surface-hover: #18181b;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    
    --primary-accent: #3b82f6;
    --secondary-accent: #8b5cf6;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.15);
    --border-subtle: rgba(255, 255, 255, 0.04);

    /* Spacing & Layout */
    --container-width: 1200px;
    --header-height: 70px;
    
    /* Radius System */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 40px;
    
    /* Animation */
    --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
}

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

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

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

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

ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* Performance Optimized Ambient Lighting */
.ambient-light {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    background: 
        radial-gradient(circle at 20% 10%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 90%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
}

/* Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

.center-text { text-align: center; }

/* Navigation - FIXED LAYOUT LOGIC */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    background-color: rgba(5, 5, 5, 0.95);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px; /* Ensure spacing between items */
}

/* Left, Center, Right sections */
.nav-left {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Prevent shrinking */
    width: 140px;
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0; /* Prevent shrinking */
    width: 140px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    white-space: nowrap;
}

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

/* Simplified Nav Menu to avoid overflow */
.nav-menu {
    display: flex;
    gap: 8px; /* Reduced gap */
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
}

.nav-menu li {
    display: flex;
    align-items: center;
}

.nav-menu a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 100px;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-menu a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}
.btn-text:hover { color: var(--text-primary); }

.btn-primary {
    background: white;
    color: black;
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform 0.2s;
    white-space: nowrap;
}
.btn-primary:hover { transform: translateY(-1px); }

/* Hero Section */
.hero {
    padding-top: 160px;
    padding-bottom: 120px;
}

.hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.hero-title {
    font-size: 5rem;
    line-height: 1.05;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.04em;
}

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin-bottom: 48px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 100px;
}

.btn-lg {
    padding: 14px 36px;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-weight: 500;
    transition: background 0.2s;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.08); }

/* Interface Mockup */
.hero-visual-wrapper {
    width: 100%;
    max-width: 1080px;
    perspective: 1200px;
}

.interface-mockup {
    background: #0f1012;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 0 0 1px #000, 0 40px 100px -20px rgba(0,0,0,0.5);
    overflow: hidden;
    position: relative;
    transform: rotateX(2deg);
}

.mockup-header {
    height: 44px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
}

.traffic-lights { display: flex; gap: 8px; }
.traffic-lights span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.mockup-tabs { display: flex; gap: 24px; margin-left: 20px; }
.mockup-tabs span { font-size: 0.8rem; color: var(--text-tertiary); }
.mockup-tabs span.active { color: var(--text-primary); }

.mockup-body { height: 600px; display: flex; }

.sidebar {
    width: 70px;
    border-right: 1px solid var(--border-subtle);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: rgba(0,0,0,0.2);
}

.nav-item {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
}
.nav-item.active { background: rgba(59, 130, 246, 0.1); }

.chat-list {
    width: 280px;
    border-right: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.01);
}

.list-item {
    padding: 18px 24px;
    display: flex;
    gap: 14px;
    border-bottom: 1px solid var(--border-subtle);
}
.list-item.active {
    background: rgba(255, 255, 255, 0.03);
    border-left: 2px solid var(--primary-accent);
}

.avatar { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,0.08); }
.lines { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.line { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.08); }
.line.md { width: 60%; } .line.sm { width: 40%; }

.chat-area {
    flex: 1;
    background: #080808;
    position: relative;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.msg { display: flex; max-width: 80%; }
.msg.incoming { align-self: flex-start; }
.msg.outgoing { align-self: flex-end; }

.bubble { padding: 16px 24px; border-radius: 16px; font-size: 0.95rem; line-height: 1.6; }
.msg.incoming .bubble { background: rgba(255,255,255,0.06); border-bottom-left-radius: 4px; }
.msg.outgoing .bubble { background: var(--primary-accent); color: white; border-bottom-right-radius: 4px; }

.bubble.ai-generated {
    background: linear-gradient(135deg, rgba(30,30,36,0.9), rgba(21,21,24,0.9));
    border: 1px solid rgba(139, 92, 246, 0.2);
}
.ai-sparkle { display: block; font-size: 0.8rem; color: var(--secondary-accent); margin-bottom: 6px; font-weight: 600; }

.floating-card {
    position: absolute;
    background: rgba(20, 20, 23, 0.9);
    border: 1px solid var(--border-highlight);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    z-index: 10;
}
.card-1 { top: 35%; right: -60px; }
.card-2 { bottom: 15%; left: 180px; }
.icon-box { width: 48px; height: 48px; background: rgba(255,255,255,0.05); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.text-box { display: flex; flex-direction: column; }
.text-box strong { font-size: 1.1rem; }

.trusted-brands { margin-top: 100px; }
.trusted-brands p { font-size: 0.8rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.2em; margin-bottom: 32px; }
.brand-grid { display: flex; gap: 60px; justify-content: center; flex-wrap: wrap; opacity: 0.4; font-weight: 800; font-size: 1.4rem; }

/* Bento Grid */
.section { padding: 120px 0; }
.section-header { margin-bottom: 80px; }
.section-title { font-size: 3rem; font-weight: 700; margin-bottom: 20px; color: white; }
.bento-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 340px); gap: 24px; }
.bento-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}
.bento-card:hover { transform: translateY(-4px); border-color: var(--border-highlight); }
.bento-card.span-2 { grid-column: span 2; }
.bento-card.span-3 { grid-column: span 3; }
.bento-card.row-2 { grid-row: span 1; }
.card-content { padding: 40px; height: 100%; display: flex; flex-direction: column; position: relative; z-index: 2; }
.card-content h3 { font-size: 1.6rem; margin-bottom: 16px; }
.card-content p { color: var(--text-secondary); line-height: 1.7; }
.card-icon { font-size: 2.5rem; margin-bottom: 24px; width: 64px; height: 64px; background: rgba(255,255,255,0.05); border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.feature-tags { display: flex; gap: 12px; margin-top: 32px; }
.feature-tags li { padding: 6px 14px; background: rgba(255,255,255,0.03); border-radius: 100px; font-size: 0.85rem; border: 1px solid var(--border-color); }

/* Solutions */
.split-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.sol-btn { text-align: left; padding: 16px 24px; color: var(--text-secondary); font-size: 1.1rem; border-left: 2px solid transparent; width: 100%; }
.sol-btn.active { color: var(--text-primary); border-left-color: var(--primary-accent); background: linear-gradient(90deg, rgba(59,130,246,0.1), transparent); }
.solution-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 48px; }
.card-header { display: flex; justify-content: space-between; margin-bottom: 24px; align-items: center; }
.card-header h3 { font-size: 1.8rem; }
.badge { background: rgba(234,179,8,0.15); color: #facc15; padding: 6px 14px; border-radius: 100px; font-size: 0.8rem; font-weight: 600; }
.data-points { display: flex; gap: 60px; padding-top: 40px; border-top: 1px solid var(--border-color); margin-top: 40px; }
.point strong { display: block; font-size: 2.5rem; color: white; line-height: 1; margin-bottom: 8px; }

/* CTA & Download - FIXED */
.cta-section { position: relative; padding: 160px 0; overflow: hidden; }
.cta-title { font-size: 4rem; line-height: 1.1; margin-bottom: 24px; }
.cta-desc { font-size: 1.25rem; color: var(--text-secondary); }

.download-options {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 60px;
    flex-wrap: wrap; /* Ensure wrapping on smaller screens */
}

.dl-card {
    display: flex;
    align-items: center; /* Vertical center alignment */
    gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 24px 32px;
    border-radius: 20px;
    min-width: 280px;
    text-align: left; /* Ensure text aligns left */
    transition: all 0.2s;
    text-decoration: none; /* Remove underline */
    color: var(--text-primary);
}

.dl-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-highlight);
    transform: translateY(-4px);
}

.dl-icon {
    width: 40px;
    height: 40px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.dl-info {
    display: flex;
    flex-direction: column;
    flex: 1; /* Take remaining space */
}

.os-name { font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; }
.os-ver { font-size: 0.8rem; color: var(--text-tertiary); }
.dl-arrow { color: var(--text-tertiary); font-size: 1.2rem; }

/* SEO Articles */
.seo-section {
    padding: 120px 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.01);
}

.seo-section .section-title {
    font-size: 2.6rem;
}

.seo-articles {
    display: grid;
    gap: 28px;
}

.seo-article {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.seo-article h1 {
    font-size: 1.9rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.seo-article h2 {
    font-size: 1.3rem;
    margin-top: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.seo-article h3 {
    font-size: 1.05rem;
    margin-top: 14px;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.seo-article p {
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.75;
}

.key-points,
.steps-list {
    margin: 8px 0 14px;
    padding-left: 18px;
    color: var(--text-secondary);
}

.key-points li,
.steps-list li {
    margin-bottom: 6px;
}

.faq-list {
    margin-top: 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
}

.faq-list dt {
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 10px;
}

.faq-list dd {
    color: var(--text-secondary);
    margin: 6px 0 10px;
}

/* Blog Section */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.blog-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all 0.2s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
}

.blog-date {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.blog-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.blog-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-link {
    font-size: 0.9rem;
    color: var(--primary-accent);
    font-weight: 500;
    transition: color 0.2s;
}

.blog-link:hover {
    color: var(--secondary-accent);
}

@media (max-width: 900px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer - FIXED */
.site-footer { border-top: 1px solid var(--border-color); padding: 100px 0 60px; color: var(--text-tertiary); }

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Align top */
    margin-bottom: 80px;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-brand p { margin-top: 12px; font-size: 0.9rem; }

.footer-nav-wrapper {
    display: flex;
    gap: 80px;
    flex-wrap: wrap;
}

.footer-col h4 { color: white; margin-bottom: 24px; font-size: 1rem; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col a:hover { color: white; }

/* Responsive Fixes - Breakpoints Logic */
@media (max-width: 1024px) {
    /* Hide desktop nav menu earlier to prevent overlap */
    .nav-center { display: none; }
    .mobile-menu-toggle { display: block; }
    .hero-title { font-size: 4rem; }
}

@media (max-width: 900px) {
    .hero-title { font-size: 3.5rem; }
    .bento-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
    .bento-card.span-2, .bento-card.span-3 { grid-column: span 1; }
    .split-layout { grid-template-columns: 1fr; }
    .interface-mockup { transform: none; }
    .floating-card { display: none; }
    /* Ensure no overlap on smaller screens */
    .nav-left { width: auto; }
    .nav-right { width: auto; }
    .nav-actions { gap: 10px; }
    .btn-primary { padding: 6px 16px; font-size: 0.85rem; }
    
    .footer-top { flex-direction: column; }
    .footer-nav-wrapper { gap: 40px; width: 100%; justify-content: space-between; }
}

@media (max-width: 600px) {
    .hero-title { font-size: 2.5rem; }
    .footer-nav-wrapper { flex-direction: column; }
    .dl-card { width: 100%; }
}

.mobile-menu-toggle {
    display: none;
    cursor: pointer;
    width: 24px;
    height: 24px;
    position: relative;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    position: absolute;
    left: 0;
    transition: all 0.3s;
}

.mobile-menu-toggle span:first-child { top: 6px; }
.mobile-menu-toggle span:last-child { bottom: 6px; }
