/**
 * A.I.D.E.N. v50.0 Ultimate - 顶级视觉动画库
 * 打造震撼人心的视觉体验
 */

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

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(102, 126, 234, 0.6);
    border-radius: 50%;
    animation: particleFloat 15s infinite;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) translateX(20px) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(10vh) translateX(-20px) scale(1);
    }
    100% {
        transform: translateY(0) translateX(0) scale(0);
        opacity: 0;
    }
}

/* ==================== 光效扫过动画 ==================== */
.light-sweep {
    position: relative;
    overflow: hidden;
}

.light-sweep::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: lightSweep 3s ease-in-out infinite;
}

@keyframes lightSweep {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

/* ==================== 呼吸光晕 ==================== */
.glow-breath {
    animation: glowBreath 4s ease-in-out infinite;
}

@keyframes glowBreath {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(102, 126, 234, 0.4),
            0 0 40px rgba(102, 126, 234, 0.2),
            0 0 60px rgba(102, 126, 234, 0.1);
    }
    50% {
        box-shadow: 
            0 0 40px rgba(102, 126, 234, 0.6),
            0 0 80px rgba(102, 126, 234, 0.4),
            0 0 120px rgba(102, 126, 234, 0.2);
    }
}

/* ==================== 渐变流动 ==================== */
.gradient-flow {
    background: linear-gradient(
        -45deg,
        #667eea,
        #764ba2,
        #f093fb,
        #667eea
    );
    background-size: 400% 400%;
    animation: gradientFlow 8s ease infinite;
}

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

/* ==================== 文字渐变出现 ==================== */
.text-reveal {
    opacity: 0;
    animation: textReveal 1s ease-out forwards;
}

@keyframes textReveal {
    0% {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* ==================== 数字滚动动画 ==================== */
.count-up {
    display: inline-block;
    font-weight: 900;
}

/* ==================== 卡片悬浮 3D 效果 ==================== */
.card-3d {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card-3d:hover {
    transform: 
        translateY(-10px) 
        rotateX(5deg) 
        rotateY(-5deg);
    box-shadow: 
        -20px 20px 60px rgba(102, 126, 234, 0.3),
        20px -20px 60px rgba(118, 75, 162, 0.3);
}

/* ==================== 边框流光 ==================== */
.border-flow {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
}

.border-flow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(
        45deg,
        #667eea,
        #764ba2,
        #f093fb,
        #667eea
    );
    background-size: 400%;
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
    animation: gradientFlow 8s ease infinite;
}

.border-flow:hover::before {
    opacity: 1;
}

/* ==================== 脉冲波纹 ==================== */
.pulse-ring {
    position: relative;
}

.pulse-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(102, 126, 234, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* ==================== 霓虹灯效果 ==================== */
.neon-text {
    color: #fff;
    text-shadow: 
        0 0 10px rgba(102, 126, 234, 0.8),
        0 0 20px rgba(102, 126, 234, 0.6),
        0 0 30px rgba(102, 126, 234, 0.4),
        0 0 40px rgba(102, 126, 234, 0.2);
    animation: neonFlicker 0.1s infinite;
}

@keyframes neonFlicker {
    0%, 100% {
        text-shadow: 
            0 0 10px rgba(102, 126, 234, 0.8),
            0 0 20px rgba(102, 126, 234, 0.6),
            0 0 30px rgba(102, 126, 234, 0.4),
            0 0 40px rgba(102, 126, 234, 0.2);
    }
    50% {
        text-shadow: 
            0 0 15px rgba(102, 126, 234, 1),
            0 0 30px rgba(102, 126, 234, 0.8),
            0 0 45px rgba(102, 126, 234, 0.6),
            0 0 60px rgba(102, 126, 234, 0.4);
    }
}

/* ==================== 星空背景 ==================== */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, #fff, transparent),
        radial-gradient(2px 2px at 50px 160px, #fff, transparent),
        radial-gradient(2px 2px at 90px 40px, #fff, transparent),
        radial-gradient(2px 2px at 130px 80px, #fff, transparent),
        radial-gradient(2px 2px at 160px 120px, #fff, transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: starsTwinkle 5s ease-in-out infinite;
    opacity: 0.3;
}

@keyframes starsTwinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* ==================== 数据流动画 ==================== */
.data-stream {
    position: relative;
    overflow: hidden;
}

.data-stream::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent,
        rgba(102, 126, 234, 0.8),
        transparent
    );
    animation: dataStream 2s linear infinite;
}

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

/* ==================== 爆炸入场 ==================== */
.explosion-enter {
    animation: explosionEnter 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes explosionEnter {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* ==================== 弹跳入场 ==================== */
.bounce-enter {
    animation: bounceEnter 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes bounceEnter {
    0% {
        opacity: 0;
        transform: translateY(-100px) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==================== 旋转入场 ==================== */
.spin-enter {
    animation: spinEnter 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes spinEnter {
    0% {
        opacity: 0;
        transform: rotate(-180deg) scale(0);
    }
    100% {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* ==================== 故障效果 ==================== */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch1 0.3s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    transform: translate(-2px, -2px);
    opacity: 0.8;
    background: rgba(239, 68, 68, 0.5);
}

.glitch::after {
    animation: glitch2 0.3s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
    transform: translate(2px, 2px);
    opacity: 0.8;
    background: rgba(102, 126, 234, 0.5);
}

@keyframes glitch1 {
    0%, 100% { transform: translate(0); }
    33% { transform: translate(-2px, -2px); }
    66% { transform: translate(2px, 2px); }
}

@keyframes glitch2 {
    0%, 100% { transform: translate(0); }
    33% { transform: translate(2px, 2px); }
    66% { transform: translate(-2px, -2px); }
}

/* ==================== 金属光泽 ==================== */
.metallic-shine {
    position: relative;
    overflow: hidden;
}

.metallic-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: metallicShine 3s ease-in-out infinite;
}

@keyframes metallicShine {
    0%, 100% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    50% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* ==================== 液态流动 ==================== */
.liquid-wave {
    position: relative;
    overflow: hidden;
}

.liquid-wave::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100px;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 1200 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,60 C150,120 350,0 600,60 C850,120 1050,0 1200,60 L1200,120 L0,120 Z' fill='rgba(102,126,234,0.1)'/%3E%3C/svg%3E");
    background-size: 50% 100%;
    animation: liquidWave 10s linear infinite;
}
