/* 动画样式文件 */

/* 粒子动画 */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: particleFloat 8s infinite linear;
    opacity: 0.4;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0.3;
    }
    10% {
        transform: translateY(90vh) translateX(10px) scale(0.5);
        opacity: 0.5;
    }
    50% {
        transform: translateY(50vh) translateX(-20px) scale(1);
        opacity: 0.7;
    }
    90% {
        transform: translateY(10vh) translateX(15px) scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: translateY(-10vh) translateX(0) scale(0);
        opacity: 0.3;
    }
}

/* 几何形状动画 */
.shape {
    position: absolute;
    opacity: 0.25;
    animation: shapeRotate 12s infinite linear;
}

.shape-triangle {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid rgba(255, 255, 255, 0.3);
}

.shape-square {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(45deg);
}

.shape-diamond {
    width: 25px;
    height: 25px;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(45deg) skew(10deg, 10deg);
}

.shape-hexagon {
    width: 40px;
    height: 23px;
    background: rgba(255, 255, 255, 0.3);
    position: relative;
}

.shape-hexagon:before,
.shape-hexagon:after {
    content: "";
    position: absolute;
    width: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
}

.shape-hexagon:before {
    bottom: 100%;
    border-bottom: 12px solid rgba(255, 255, 255, 0.3);
}

.shape-hexagon:after {
    top: 100%;
    border-top: 12px solid rgba(255, 255, 255, 0.3);
}

@keyframes shapeRotate {
    0% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        transform: rotate(180deg) scale(0.9);
    }
    75% {
        transform: rotate(270deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* 波浪动画 */
.wave {
    position: absolute;
    width: 200%;
    height: 100px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: waveMotion 6s infinite linear;
}

@keyframes waveMotion {
    0% {
        transform: translateX(-50%);
        opacity: 0.2;
    }
    25% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.3;
    }
    75% {
        opacity: 0.5;
    }
    100% {
        transform: translateX(0%);
        opacity: 0.2;
    }
}

/* 网格动画 */
.grid-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.15;
}

.grid-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: gridMove 8s infinite linear;
}

.grid-line:nth-child(odd) {
    width: 1px;
    height: 100%;
    animation-duration: 10s;
}

.grid-line:nth-child(even) {
    width: 100%;
    height: 1px;
    animation-duration: 12s;
}

@keyframes gridMove {
    0% {
        transform: translateX(-100vw) translateY(-100vh);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100vw) translateY(100vh);
        opacity: 0;
    }
}

/* 流动线条动画 */
.flow-line {
    position: absolute;
    width: 2px;
    height: 100px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    animation: flowMotion 10s infinite linear;
    border-radius: 1px;
}

@keyframes flowMotion {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* 鼠标交互效果 */
.mouse-interactive {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 50%;
    pointer-events: none;
    transition: all 0.1s ease;
    z-index: 1;
}

/* 视差层 */
.parallax-layer {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
    transition: transform 0.1s ease-out;
    opacity: 0.6;
}

.parallax-layer.layer-1 {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent);
    z-index: 6;
}

.parallax-layer.layer-2 {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(200, 200, 255, 0.3), transparent);
    z-index: 7;
}

.parallax-layer.layer-3 {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255, 200, 255, 0.2), transparent);
    z-index: 8;
}

.mouse-trail {
    position: fixed;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: trailFade 1.5s ease-out forwards;
}

@keyframes trailFade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.3);
    }
}

/* 点击波纹效果 */
.click-ripple {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    animation: rippleEffect 0.8s ease-out forwards;
}

@keyframes rippleEffect {
    0% {
        transform: scale(0);
        opacity: 0.8;
        border: 2px solid rgba(255, 255, 255, 0.8);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.8);
    }
    50% {
        opacity: 0.6;
        border: 1px solid rgba(255, 255, 255, 0.6);
        box-shadow: 0 0 20px 5px rgba(255, 255, 255, 0.4);
    }
    100% {
        transform: scale(4);
        opacity: 0;
        border: 1px solid transparent;
        box-shadow: 0 0 40px 10px transparent;
    }
}

/* 粒子爆发效果 */
.burst-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(200, 200, 255, 0.6));
    border-radius: 50%;
    pointer-events: none;
    z-index: 9997;
    animation: burstParticle 1s ease-out forwards;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@keyframes burstParticle {
    0% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.2);
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    }
    100% {
        opacity: 0;
        transform: scale(0);
        box-shadow: 0 0 20px transparent;
    }
}

/* 视差层效果 */
.parallax-layer {
    will-change: transform;
}

.parallax-layer-0 {
    z-index: 1;
}

.parallax-layer-1 {
    z-index: 2;
}

.parallax-layer-2 {
    z-index: 3;
}

/* 脉冲动画 */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滑动动画 */
.slide-in-left {
    animation: slideInLeft 0.5s ease-out forwards;
}

@keyframes slideInLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out forwards;
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-top {
    animation: slideInTop 0.5s ease-out forwards;
}

@keyframes slideInTop {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 弹跳动画 */
.bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

/* 旋转动画 */
.rotate {
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 发光动画 */
.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 255, 255, 0.6);
    }
}

/* 颜色变换动画 */
.color-shift {
    animation: colorShift 8s infinite linear;
}

@keyframes colorShift {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

/* 波纹动画 */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
}

@keyframes rippleEffect {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* 延迟动画 */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

/* 动画性能优化 */
.animated {
    will-change: transform, opacity;
}

/* 硬件加速 */
.hardware-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}