/* ===== 全局变量 & 重置 ===== */
:root {
    --primary: #6366f1;
    --primary-light: #8b5cf6;
    --primary-dark: #4f46e5;
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-soft: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
    --radius: 20px;
    --radius-sm: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 暗色模式 (默认跟随系统，也可手动切换) */
[data-theme="dark"] {
    --bg-body: #0b1120;
    --bg-card: #1e293b;
    --bg-soft: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border: #334155;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.6);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== 导航栏 ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

[data-theme="dark"] .navbar {
    background: rgba(15,23,42,0.75);
}

.navbar.scrolled {
    background: rgba(255,255,255,0.92);
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .navbar.scrolled {
    background: rgba(15,23,42,0.92);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--primary);
}

.logo i {
    font-size: 1.7rem;
}

.nav-links {
    display: flex;
    gap: 32px;
    font-weight: 500;
}

.nav-links a {
    position: relative;
    padding: 4px 0;
    color: var(--text-secondary);
    transition: color var(--transition);
}

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

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

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

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

#themeToggle {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

#themeToggle:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 2.5px;
    background: var(--text-primary);
    border-radius: 4px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99,102,241,0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.05rem;
}

/* ===== Hero ===== */
.hero {
    padding: 120px 0 60px;
    position: relative;
    background: linear-gradient(160deg, var(--bg-body) 0%, var(--bg-soft) 100%);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-content .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: white;
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 24px;
}

.hero-content h1 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin-bottom: 32px;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    gap: 40px;
}

.hero-stats div {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.hero-stats strong {
    font-size: 1.8rem;
    color: var(--text-primary);
    font-weight: 800;
}

/* Hero 右侧视觉 */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.hero-orb {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle at 30% 30%, var(--primary-light), var(--primary), var(--accent));
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.25;
    animation: orbFloat 8s ease-in-out infinite alternate;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -30px) scale(1.1); }
}

.hero-card-float {
    position: absolute;
    bottom: 20px;
    left: 10%;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    animation: floatCard 5s ease-in-out infinite;
    border: 1px solid var(--border);
}

@keyframes floatCard {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-16px); }
}

.hero-card-float i {
    font-size: 1.8rem;
    color: var(--primary);
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite both;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1.2); opacity: 1; }
}

.hero-bg-decor {
    position: absolute;
    opacity: 0.03;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.hero-wave {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    line-height: 0;
}

.hero-wave svg {
    display: block;
    width: 100%;
    height: 60px;
}

/* ===== Section 通用 ===== */
.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

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

/* ===== Features ===== */
.features {
    padding: 80px 0;
    background: var(--bg-body);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===== Chat 区域 ===== */
.chat-section {
    padding: 80px 0;
    background: var(--bg-soft);
}

.chat-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.chat-messages {
    height: 380px;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    max-width: 85%;
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.user .avatar {
    background: var(--accent);
}

.msg-content {
    background: var(--bg-soft);
    padding: 12px 18px;
    border-radius: 18px;
    border-top-left-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.message.user .msg-content {
    background: var(--primary);
    color: white;
    border-top-left-radius: 18px;
    border-top-right-radius: 4px;
    border-color: var(--primary);
}

.chat-input-area {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    gap: 12px;
    background: var(--bg-body);
}

.chat-input-area input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 50px;
    outline: none;
    font-size: 0.95rem;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: var(--transition);
}

.chat-input-area input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.btn-send {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-body);
}

.suggestion-chip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 6px 18px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.suggestion-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== Gallery ===== */
.gallery {
    padding: 80px 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.gallery-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}

.gallery-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-md);
}

.gallery-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-soft);
}

.gallery-card .card-body {
    padding: 16px 20px 20px;
}

.gallery-card .card-body h4 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.gallery-card .card-body p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== About ===== */
.about {
    padding: 80px 0;
    background: var(--bg-soft);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-text p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.about-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tech-badge {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
}

.tech-badge:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 40px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 30px;
}

.footer-brand {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-brand i {
    color: var(--primary);
}

.footer-brand p {
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    transition: var(--transition);
}

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

.footer-social {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    align-items: flex-start;
}

.footer-social a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary);
    color: white;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== 动画工具 ===== */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.7s ease forwards;
}

.fade-in-up:nth-child(2) { animation-delay: 0.1s; }
.fade-in-up:nth-child(3) { animation-delay: 0.2s; }
.fade-in-up:nth-child(4) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-content h1 {
        font-size: 2.6rem;
    }
    .hero-content p {
        margin: 0 auto 32px;
    }
    .hero-cta {
        justify-content: center;
    }
    .hero-stats {
        justify-content: center;
    }
    .hero-visual {
        min-height: 300px;
        order: -1;
    }
    .hero-orb {
        width: 240px;
        height: 240px;
    }
    .about-content {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 24px 32px;
        gap: 20px;
        border-bottom: 1px solid var(--border);
        transform: translateY(-120%);
        opacity: 0;
        transition: var(--transition);
        box-shadow: var(--shadow-md);
    }
    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
    }
    .hamburger {
        display: flex;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .hero-stats {
        flex-wrap: wrap;
        gap: 24px;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-social {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    .hero {
        padding: 100px 0 40px;
    }
    .hero-content h1 {
        font-size: 1.7rem;
    }
    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .chat-messages {
        height: 280px;
    }
}