/* 赛博朋克动画效果 */

/* 页面加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 应用动画到元素 */
.cyber-header {
    animation: fadeInUp 0.8s ease-out;
}

.side-panel {
    animation: fadeInLeft 0.8s ease-out 0.2s both;
}

.side-panel.right {
    animation: fadeInRight 0.8s ease-out 0.2s both;
}

.main-content {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.auth-card {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.function-panels .function-panel:nth-child(1) {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.function-panels .function-panel:nth-child(2) {
    animation: fadeInUp 0.8s ease-out 1s both;
}

.function-panels .function-panel:nth-child(3) {
    animation: fadeInUp 0.8s ease-out 1.2s both;
}

/* 霓虹灯闪烁效果 */
@keyframes neonFlicker {
    0%, 100% {
        text-shadow: 
            0 0 5px var(--neon-color),
            0 0 10px var(--neon-color),
            0 0 15px var(--neon-color),
            0 0 20px var(--neon-color);
    }
    50% {
        text-shadow: 
            0 0 2px var(--neon-color),
            0 0 5px var(--neon-color),
            0 0 8px var(--neon-color),
            0 0 12px var(--neon-color);
    }
}

.neon-flicker {
    animation: neonFlicker 2s infinite alternate;
}

/* 数据流动画 */
@keyframes dataFlow {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

.data-flow {
    position: relative;
    overflow: hidden;
}

.data-flow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-color), transparent);
    animation: dataFlow 3s infinite;
}

/* 电路板动画 */
@keyframes circuitPulse {
    0%, 100% {
        box-shadow: 
            inset 0 0 10px rgba(0, 255, 255, 0.1),
            0 0 10px rgba(0, 255, 255, 0.1);
    }
    50% {
        box-shadow: 
            inset 0 0 20px rgba(0, 255, 255, 0.3),
            0 0 20px rgba(0, 255, 255, 0.3);
    }
}

.circuit-pulse {
    animation: circuitPulse 3s infinite;
}

/* 全息投影效果 */
@keyframes hologram {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

.hologram {
    animation: hologram 4s infinite;
    background: linear-gradient(45deg, transparent 30%, rgba(0, 255, 255, 0.1) 50%, transparent 70%);
    background-size: 200% 200%;
    animation: hologram 4s infinite, shimmerMove 3s infinite;
}

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

/* 代码雨效果增强 */
@keyframes matrixDrop {
    0% {
        transform: translateY(-100vh);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.matrix-char {
    position: absolute;
    color: var(--neon-color);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    animation: matrixDrop linear infinite;
    text-shadow: 0 0 5px var(--neon-color);
}

/* 能量波动画 */
@keyframes energyWave {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.energy-wave {
    position: relative;
}

.energy-wave::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid var(--neon-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: energyWave 2s infinite;
}

/* 系统启动动画 */
@keyframes systemBoot {
    0% {
        width: 0%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        width: 100%;
        opacity: 1;
    }
}

.boot-sequence {
    position: relative;
    overflow: hidden;
}

.boot-sequence::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--neon-color);
    animation: systemBoot 2s ease-out;
    box-shadow: 0 0 10px var(--neon-color);
}

/* 数字雨效果 */
@keyframes digitalRain {
    0% {
        transform: translateY(-100%);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.digital-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.rain-drop {
    position: absolute;
    color: var(--neon-color);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    animation: digitalRain linear infinite;
    text-shadow: 0 0 3px var(--neon-color);
}

/* 终端光标闪烁 */
@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.terminal-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--neon-color);
    animation: cursorBlink 1s infinite;
    margin-left: 2px;
}

/* 网格背景动画 */
@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 20px); }
}

.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: gridMove 10s linear infinite;
    z-index: -3;
    opacity: 0.3;
}

/* 悬浮动画 */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* 旋转动画 */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotating {
    animation: rotate 10s linear infinite;
}

/* 呼吸灯效果 */
@keyframes breathe {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.breathing {
    animation: breathe 3s ease-in-out infinite;
}

/* 电流效果 */
@keyframes electricity {
    0%, 100% {
        box-shadow: 
            0 0 5px var(--neon-color),
            inset 0 0 5px var(--neon-color);
    }
    25% {
        box-shadow: 
            0 0 20px var(--neon-color),
            inset 0 0 20px var(--neon-color);
    }
    50% {
        box-shadow: 
            0 0 5px var(--neon-secondary),
            inset 0 0 5px var(--neon-secondary);
    }
    75% {
        box-shadow: 
            0 0 20px var(--neon-secondary),
            inset 0 0 20px var(--neon-secondary);
    }
}

.electric {
    animation: electricity 2s infinite;
}

/* 响应式动画调整 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 性能优化 */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}