/* ===== CSS Variables - 主题系统 ===== */
:root {
    /* Light Theme Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 1);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent-primary: #3b82f6;
    --accent-secondary: #2563eb;
    --accent-gradient: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 50%, #60a5fa 100%);
    
    --card-border: rgba(148, 163, 184, 0.2);
    --card-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08), 
                   0 8px 20px -4px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 8px 24px -4px rgba(99, 102, 241, 0.2),
                         0 16px 40px -8px rgba(99, 102, 241, 0.15);
    
    --glass-blur: 16px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(30, 30, 50, 0.7);
    --bg-card-hover: rgba(40, 40, 70, 0.85);
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    --accent-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
    
    --card-border: rgba(148, 163, 184, 0.1);
    --card-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.3), 
                   0 8px 20px -4px rgba(0, 0, 0, 0.2);
    --card-shadow-hover: 0 8px 24px -4px rgba(129, 140, 248, 0.25),
                         0 16px 40px -8px rgba(129, 140, 248, 0.2);
}

/* ===== 基础重置 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
    transition: background var(--transition-smooth), color var(--transition-smooth);
}

/* ===== 动态背景层 ===== */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* 渐变光球 */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0%, transparent 70%);
    top: -20%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.25) 0%, transparent 70%);
    bottom: -10%;
    right: -5%;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.2) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

[data-theme="dark"] .gradient-orb {
    opacity: 0.35;
}

[data-theme="dark"] .orb-1 {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
}

[data-theme="dark"] .orb-2 {
    background: radial-gradient(circle, rgba(37, 99, 235, 0.2) 0%, transparent 70%);
}

[data-theme="dark"] .orb-3 {
    background: radial-gradient(circle, rgba(96, 165, 250, 0.15) 0%, transparent 70%);
}

/* 网格背景 */
.grid-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse 70% 50% at 50% 50%, black 30%, transparent 100%);
}

[data-theme="dark"] .grid-pattern {
    background-image: 
        linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
}

/* 浮动粒子 */
.particles {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0.25;
    animation: particle-float 18s linear infinite;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.05);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.25;
    }
    90% {
        opacity: 0.25;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ===== 主题切换按钮 ===== */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-smooth);
    box-shadow: var(--card-shadow);
}

.theme-toggle:hover {
    transform: scale(1.05);
    border-color: var(--accent-primary);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: all var(--transition-smooth);
}

.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

/* ===== 主容器 ===== */
.container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    position: relative;
    z-index: 10;
}

/* ===== 头部区域 ===== */
.header-section {
    text-align: center;
    animation: header-reveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

@keyframes header-reveal {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-title {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.title-line {
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.35));
}

.title-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.18em;
}

/* ===== 功能卡片区域 - 横向排列 ===== */
.features-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
    animation: cards-reveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.15s forwards;
    opacity: 0;
}

@keyframes cards-reveal {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 功能按钮卡片 */
.feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 28px 24px;
    min-width: 160px;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-smooth);
    box-shadow: var(--card-shadow);
}

.feature-card:hover {
    transform: translateY(-6px);
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    box-shadow: var(--card-shadow-hover);
}

.feature-card:hover .card-icon {
    color: var(--accent-primary);
    transform: scale(1.1);
}

.card-icon {
    width: 40px;
    height: 40px;
    color: var(--accent-secondary);
    transition: all var(--transition-smooth);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    transition: color var(--transition-fast);
}

.feature-card:hover .card-title {
    color: var(--accent-primary);
}

/* ===== 页脚 ===== */
.footer {
    animation: footer-reveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
    opacity: 0;
}

@keyframes footer-reveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer-content {
    text-align: center;
    padding: 16px;
}

.copyright {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.footer-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== 滚动条样式 ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    body {
        padding: 20px;
    }
    
    .container {
        gap: 40px;
    }
    
    .theme-toggle {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }
    
    .theme-toggle svg {
        width: 18px;
        height: 18px;
    }
    
    .main-title {
        gap: 12px;
    }
    
    .features-section {
        gap: 16px;
    }
    
    .feature-card {
        min-width: 140px;
        padding: 22px 18px;
        gap: 12px;
    }
    
    .card-icon {
        width: 34px;
        height: 34px;
    }
    
    .card-title {
        font-size: 0.88rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .container {
        gap: 32px;
    }
    
    .main-title {
        gap: 10px;
    }
    
    .features-section {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        width: 100%;
    }
    
    .feature-card {
        min-width: auto;
        width: 100%;
        padding: 20px 12px;
        gap: 10px;
    }
    
    .card-icon {
        width: 30px;
        height: 30px;
    }
    
    .card-title {
        font-size: 0.82rem;
    }
}

/* ===== 选择高亮 ===== */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* ===== 无障碍优化 ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .gradient-orb,
    .particle {
        animation: none;
    }
    
    .particle {
        display: none;
    }
}

/* ===== 打印样式 ===== */
@media print {
    .bg-layer,
    .particles,
    .theme-toggle {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .feature-card {
        break-inside: avoid;
    }
}