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

body {
    background: #000;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
}

.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
    transform: translateZ(0); /* 启用硬件加速 */
    backface-visibility: hidden;
    will-change: transform, opacity;
}

.mode-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    font-family: monospace;
    z-index: 100;
    transition: all 0.3s ease;
}

/* 粒子模式样式 */
/* 经典模式 - 白色粒子 */
.classic .particle {
    background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0.4) 100%);
    box-shadow:
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(255, 255, 255, 0.6),
        0 0 30px rgba(255, 255, 255, 0.4);
    animation: particleGlow 2s ease-in-out infinite alternate;
}

@keyframes particleGlow {
    0% {
        filter: brightness(1) blur(0px);
        transform: scale(1);
    }
    100% {
        filter: brightness(1.3) blur(1px);
        transform: scale(1.1);
    }
}

/* 彩虹模式 - 彩色粒子 */
.rainbow .particle {
    background: hsl(var(--hue), 70%, 60%);
    box-shadow: 0 0 15px hsl(var(--hue), 70%, 60%);
}

/* 火焰模式 - 红橙黄粒子 */
.fire .particle {
    background: linear-gradient(45deg, #ff4757, #ff6348, #ffa502);
    box-shadow: 0 0 20px #ff4757;
}

/* 海洋模式 - 蓝青粒子 */
.ocean .particle {
    background: linear-gradient(45deg, #3742fa, #2f3542, #40407a);
    box-shadow: 0 0 20px #3742fa;
}

/* 霓虹模式 - 紫粉粒子 */
.neon .particle {
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00);
    box-shadow: 0 0 25px currentColor;
    animation: neonPulse 2s ease-in-out infinite alternate;
}

@keyframes neonPulse {
    0% {
        filter: brightness(1) blur(0px);
    }
    100% {
        filter: brightness(1.5) blur(1px);
    }
}

/* 星系模式 - 星形粒子 */
.galaxy .particle {
    background: radial-gradient(circle, #fff 0%, #87ceeb 50%, transparent 70%);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    box-shadow: 0 0 30px #87ceeb;
}

/* 矩阵模式 - 绿色代码雨 */
.matrix .particle {
    background: #00ff41;
    box-shadow: 0 0 10px #00ff41;
    border-radius: 0;
    width: 2px !important;
    height: 15px !important;
}

/* 极光模式 - 渐变粒子 */
.aurora .particle {
    background: linear-gradient(45deg, 
        rgba(0, 255, 127, 0.8), 
        rgba(0, 191, 255, 0.8), 
        rgba(138, 43, 226, 0.8));
    box-shadow: 0 0 20px rgba(0, 255, 127, 0.6);
    animation: auroraWave 3s ease-in-out infinite;
}

@keyframes auroraWave {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
}

/* 背景模式 */
body.classic {
    background: radial-gradient(circle at center, #1a1a2e 0%, #16213e 50%, #0f0f0f 100%);
}

body.rainbow {
    background: linear-gradient(45deg, 
        #667eea 0%, #764ba2 25%, 
        #f093fb 50%, #f5576c 75%, 
        #4facfe 100%);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

body.fire {
    background: radial-gradient(circle at bottom, #ff4757 0%, #c44569 30%, #2c2c54 70%);
    animation: fireFlicker 2s ease-in-out infinite alternate;
}

body.ocean {
    background: linear-gradient(180deg, #3742fa 0%, #2f3542 50%, #40407a 100%);
    animation: oceanWave 4s ease-in-out infinite;
}

body.neon {
    background: radial-gradient(circle at center, #2c003e 0%, #1a1a1a 100%);
    animation: neonGlow 3s ease-in-out infinite alternate;
}

body.galaxy {
    background: radial-gradient(circle at 20% 50%, #0c0c0c 0%, #1a1a2e 40%, #16213e 70%, #0f0f0f 100%);
    position: relative;
}

body.galaxy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #ddd, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: starTwinkle 3s linear infinite;
}

body.matrix {
    background: #000;
    position: relative;
}

body.matrix::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, transparent 0%, rgba(0, 255, 65, 0.03) 50%, transparent 100%);
    animation: matrixRain 0.5s linear infinite;
}

body.aurora {
    background: linear-gradient(45deg, 
        #0c0c0c 0%, #1a472a 25%, 
        #2d5016 50%, #1a472a 75%, 
        #0c0c0c 100%);
    animation: auroraDance 6s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes fireFlicker {
    0% {
        filter: brightness(1) saturate(1);
    }
    100% {
        filter: brightness(1.2) saturate(1.3);
    }
}

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

@keyframes neonGlow {
    0% {
        filter: brightness(1);
    }
    100% {
        filter: brightness(1.3) hue-rotate(30deg);
    }
}

@keyframes starTwinkle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

@keyframes matrixRain {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

@keyframes auroraDance {
    0%, 100% {
        filter: hue-rotate(0deg) brightness(1);
    }
    25% {
        filter: hue-rotate(90deg) brightness(1.2);
    }
    50% {
        filter: hue-rotate(180deg) brightness(0.8);
    }
    75% {
        filter: hue-rotate(270deg) brightness(1.1);
    }
}
