/**
 * 赛博朋克风格背景样式
 * 包含渐变赛博蓝、粒子动画、光束效果等
 */

/* 主背景层 */
.cyber-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: #000000;
}

/* 赛博蓝渐变层 */
.cyber-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        #000000 0%,
        #001122 15%,
        #002244 25%,
        #003366 35%,
        #0044aa 50%,
        #0066cc 65%,
        #002244 75%,
        #001122 85%,
        #000000 100%
    );
    opacity: 0.8;
    animation: cyberShift 15s infinite ease-in-out;
}

@keyframes cyberShift {
    0%, 100% {
        background: linear-gradient(135deg, 
            #000000 0%,
            #001122 15%,
            #002244 25%,
            #003366 35%,
            #0044aa 50%,
            #0066cc 65%,
            #002244 75%,
            #001122 85%,
            #000000 100%
        );
    }
    33% {
        background: linear-gradient(225deg, 
            #000011 0%,
            #002233 15%,
            #004455 25%,
            #0066aa 35%,
            #0088dd 50%,
            #00aaff 65%,
            #004455 75%,
            #002233 85%,
            #000011 100%
        );
    }
    66% {
        background: linear-gradient(45deg, 
            #000000 0%,
            #112244 15%,
            #224466 25%,
            #3366aa 35%,
            #4488dd 50%,
            #66aaff 65%,
            #224466 75%,
            #112244 85%,
            #000000 100%
        );
    }
}

/* 网格背景 */
.cyber-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 102, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 102, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    opacity: 0.3;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* 扫描线效果 */
.cyber-scan-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 150, 255, 0.03) 2px,
        rgba(0, 150, 255, 0.03) 4px
    );
    animation: scanMove 2s linear infinite;
    pointer-events: none;
}

@keyframes scanMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* 脉冲圆环 */
.cyber-pulse-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    pointer-events: none;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(0, 150, 255, 0.3);
    border-radius: 50%;
    animation: pulseExpand 4s infinite ease-out;
}

.pulse-ring:nth-child(1) { animation-delay: 0s; }
.pulse-ring:nth-child(2) { animation-delay: 1s; }
.pulse-ring:nth-child(3) { animation-delay: 2s; }
.pulse-ring:nth-child(4) { animation-delay: 3s; }

@keyframes pulseExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
        border-width: 3px;
    }
    50% {
        opacity: 0.7;
        border-width: 2px;
    }
    100% {
        width: 800px;
        height: 800px;
        opacity: 0;
        border-width: 0;
    }
}

/* 霓虹光束 */
.cyber-neon-beams {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.neon-beam {
    position: absolute;
    width: 2px;
    height: 200px;
    background: linear-gradient(to bottom, 
        transparent, 
        rgba(0, 150, 255, 0.8), 
        rgba(0, 200, 255, 1), 
        rgba(0, 150, 255, 0.8), 
        transparent
    );
    box-shadow: 
        0 0 10px rgba(0, 150, 255, 0.5),
        0 0 20px rgba(0, 150, 255, 0.3),
        0 0 30px rgba(0, 150, 255, 0.1);
    animation: beamMove 6s infinite linear;
}

.neon-beam:nth-child(1) {
    left: 10%;
    top: -200px;
    animation-delay: 0s;
    transform: rotate(15deg);
}

.neon-beam:nth-child(2) {
    left: 30%;
    top: -200px;
    animation-delay: 2s;
    transform: rotate(-10deg);
}

.neon-beam:nth-child(3) {
    left: 50%;
    top: -200px;
    animation-delay: 4s;
    transform: rotate(5deg);
}

.neon-beam:nth-child(4) {
    left: 70%;
    top: -200px;
    animation-delay: 1s;
    transform: rotate(-15deg);
}

.neon-beam:nth-child(5) {
    left: 90%;
    top: -200px;
    animation-delay: 3s;
    transform: rotate(10deg);
}

@keyframes beamMove {
    0% {
        top: -200px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100vh;
        opacity: 0;
    }
}

/* 数据流粒子 */
.cyber-data-stream {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.data-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(0, 200, 255, 0.8);
    border-radius: 50%;
    box-shadow: 
        0 0 6px rgba(0, 200, 255, 0.6),
        0 0 12px rgba(0, 200, 255, 0.4);
    animation: dataFlow 8s infinite linear;
}

@keyframes dataFlow {
    0% {
        transform: translateY(-10px) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(50px);
        opacity: 0;
    }
}

/* 电路板纹理 */
.cyber-circuit {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(0, 150, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(0, 200, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(0, 100, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 60% 20%, rgba(0, 180, 255, 0.1) 1px, transparent 1px);
    background-size: 300px 300px, 250px 250px, 200px 200px, 180px 180px;
    animation: circuitPulse 10s infinite ease-in-out;
    opacity: 0.4;
}

@keyframes circuitPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.6; }
}

/* 全息投影效果 */
.cyber-hologram {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent 48%,
        rgba(0, 255, 255, 0.03) 49%,
        rgba(0, 255, 255, 0.03) 51%,
        transparent 52%
    );
    background-size: 20px 20px;
    animation: hologramShift 8s infinite ease-in-out;
    pointer-events: none;
}

@keyframes hologramShift {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(10px) translateY(-5px); }
    50% { transform: translateX(-5px) translateY(10px); }
    75% { transform: translateX(5px) translateY(-10px); }
}

/* 能量波动 */
.cyber-energy-waves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(0, 150, 255, 0.1) 0%,
        rgba(0, 200, 255, 0.05) 30%,
        transparent 70%
    );
    animation: energyPulse 6s infinite ease-in-out;
    pointer-events: none;
}

@keyframes energyPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.6;
    }
}

/* 矩阵雨效果 */
.cyber-matrix {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 255, 150, 0.01) 30%,
        rgba(0, 200, 255, 0.02) 70%,
        transparent 100%
    );
    animation: matrixFlow 12s infinite linear;
    pointer-events: none;
    opacity: 0.5;
}

@keyframes matrixFlow {
    0% { background-position-y: 0%; }
    100% { background-position-y: 100%; }
}

/* 深度景深效果 */
.cyber-depth-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at 50% 50%,
        transparent 0%,
        rgba(0, 0, 0, 0.1) 70%,
        rgba(0, 0, 0, 0.3) 100%
    );
    pointer-events: none;
}

/* 光谱分析器效果 */
.cyber-spectrum {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 50px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    pointer-events: none;
    opacity: 0.3;
}

.spectrum-bar {
    width: 4px;
    background: linear-gradient(to top, 
        rgba(0, 150, 255, 1), 
        rgba(0, 200, 255, 0.8), 
        rgba(0, 255, 255, 0.6)
    );
    border-radius: 2px 2px 0 0;
    animation: spectrumDance 2s infinite ease-in-out;
}

.spectrum-bar:nth-child(odd) { animation-delay: 0s; }
.spectrum-bar:nth-child(even) { animation-delay: 0.1s; }

@keyframes spectrumDance {
    0%, 100% { height: 5px; }
    50% { height: 30px; }
}

/* 响应式优化 */
@media (max-width: 768px) {
    .cyber-grid {
        background-size: 30px 30px;
    }
    
    .cyber-neon-beams .neon-beam {
        width: 1px;
        height: 150px;
    }
    
    .cyber-spectrum {
        width: 200px;
        height: 30px;
    }
    
    .spectrum-bar {
        width: 3px;
    }
}

/* 性能优化 */
@media (prefers-reduced-motion: reduce) {
    .cyber-gradient,
    .cyber-grid,
    .cyber-scan-lines,
    .pulse-ring,
    .neon-beam,
    .data-particle,
    .cyber-circuit,
    .cyber-hologram,
    .cyber-energy-waves,
    .cyber-matrix,
    .spectrum-bar {
        animation: none !important;
    }
}

/* 深色模式优化 */
@media (prefers-color-scheme: dark) {
    .cyber-background {
        background: #000000;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .cyber-gradient {
        opacity: 1;
    }
    
    .cyber-grid,
    .cyber-scan-lines,
    .cyber-circuit {
        opacity: 0.6;
    }
}

/* GPU加速优化 */
.cyber-background,
.cyber-gradient,
.cyber-grid,
.cyber-scan-lines,
.cyber-pulse-rings,
.cyber-neon-beams,
.cyber-data-stream,
.cyber-circuit,
.cyber-hologram,
.cyber-energy-waves,
.cyber-matrix,
.cyber-depth-blur {
    transform: translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* 专门的粒子容器 */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background: transparent;
} 