/* ==================== 基础变量 ==================== */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #0f0f23;
    --bg-card: #141428;
    --border-color: rgba(99, 102, 241, 0.15);
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --glow-color: rgba(99, 102, 241, 0.3);
    --text-primary: #f0f0ff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
}

/* ==================== 基础重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

ul {
    list-style: none;
}

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

/* ==================== 背景动画 ==================== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-primary), transparent);
    top: -100px;
    right: -100px;
    animation: orbFloat1 20s ease-in-out infinite;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent-secondary), transparent);
    bottom: -50px;
    left: -50px;
    animation: orbFloat2 25s ease-in-out infinite;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #ec4899, transparent);
    top: 50%;
    left: 50%;
    animation: orbFloat3 30s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-50px, 50px); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(50px, -30px); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(-40%, -60%); }
}

/* ==================== 导航栏 ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 700;
}

.logo-bracket {
    color: var(--accent-primary);
}

.logo-text {
    color: var(--text-primary);
    margin: 0 2px;
}

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

.nav-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 1px;
}

.cta-btn {
    padding: 10px 20px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--glow-color);
}

/* ==================== 通用按钮 ==================== */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--accent-gradient);
    border: none;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px var(--glow-color);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* ==================== 代码窗口 ==================== */
.code-window {
    width: 100%;
    max-width: 500px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    animation: codeFloat 6s ease-in-out infinite;
}

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

.window-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
}

.window-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27ca40; }

.window-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.code-content {
    padding: 20px;
    overflow-x: auto;
}

.code-content pre {
    margin: 0;
}

.code-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
}

.keyword { color: #c792ea; }
.property { color: #82aaff; }
.variable { color: #f78c6c; }
.string { color: #c3e88d; }

/* ==================== 页脚 ==================== */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    display: none;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 700;
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.social-link:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-3px);
}

.copyright {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==================== 鼠标追踪画布 ==================== */
#mouseCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ==================== 粒子特效开关 ==================== */
.particle-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    background: rgba(15, 15, 35, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.particle-toggle:hover {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 4px 25px rgba(99, 102, 241, 0.2);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-text {
    color: #e0e0f0;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #6366f1;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.toggle-label input:checked + .toggle-switch {
    background: rgba(99, 102, 241, 0.4);
}

.toggle-label input:checked + .toggle-switch::after {
    left: 23px;
    background: #818cf8;
    box-shadow: 0 2px 12px rgba(129, 140, 248, 0.6);
}

/* ==================== 通用页面结构 ==================== */
.page-section {
    padding: 120px 0 80px;
    min-height: 100vh;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-tag {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--accent-primary);
    margin-bottom: 16px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .code-window {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .btn-primary, .btn-secondary {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}
