/* 高级动画效果 */

/* 页面加载动画 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.page-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(96, 165, 250, 0.3);
    border-top: 3px solid #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 滚动触发动画 */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* 鼠标悬停发光效果 */
.glow-on-hover {
    position: relative;
    overflow: hidden;
}

.glow-on-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.4), transparent);
    transition: left 0.5s ease;
}

.glow-on-hover:hover::before {
    left: 100%;
}

/* 文字打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #60a5fa;
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

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

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #60a5fa;
    border-radius: 50%;
    animation: particleFloat 8s linear infinite;
    opacity: 0.7;
}

.particle:nth-child(2n) {
    background: #10b981;
    animation-duration: 10s;
    animation-delay: 2s;
}

.particle:nth-child(3n) {
    background: #ffffff;
    animation-duration: 6s;
    animation-delay: 4s;
    width: 2px;
    height: 2px;
}

/* 波浪动画 */
.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z" fill="%2360a5fa" fill-opacity="0.1"></path></svg>') repeat-x;
    animation: wave 10s ease-in-out infinite;
}

.wave:nth-child(2) {
    bottom: 10px;
    animation: wave 8s ease-in-out infinite reverse;
    opacity: 0.5;
}

.wave:nth-child(3) {
    bottom: 15px;
    animation: wave 12s ease-in-out infinite;
    opacity: 0.3;
}

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

.pulse-slow {
    animation: pulse 3s ease-in-out infinite;
}

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

.rotate-reverse {
    animation: rotate 10s linear infinite reverse;
}

/* 悬浮动画 */
.hover-float {
    transition: transform 0.3s ease;
}

.hover-float:hover {
    transform: translateY(-5px);
}

/* 渐变背景动画 */
.gradient-bg {
    background: linear-gradient(-45deg, #1e3a8a, #0a1628, #1e40af, #0f172a);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* 边框动画 */
.animated-border {
    position: relative;
    background: linear-gradient(45deg, transparent, transparent);
}

.animated-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #60a5fa, #10b981, #60a5fa, #10b981);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: gradientShift 3s ease infinite;
}

.animated-border::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: inherit;
    border-radius: inherit;
    z-index: -1;
}

/* 数字计数动画 */
.counter {
    font-weight: bold;
    color: #60a5fa;
}

/* 进度条动画 */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa, #10b981);
    border-radius: 2px;
    transform: translateX(-100%);
    animation: progressFill 2s ease-out forwards;
}

/* 关键帧动画定义 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #60a5fa; }
}

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

@keyframes wave {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-25%);
    }
}

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

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

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

@keyframes progressFill {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(0);
    }
}

/* 特殊效果 */
.neon-text {
    color: #60a5fa;
    text-shadow: 
        0 0 5px #60a5fa,
        0 0 10px #60a5fa,
        0 0 15px #60a5fa,
        0 0 20px #60a5fa;
    animation: neonFlicker 2s ease-in-out infinite alternate;
}

@keyframes neonFlicker {
    0%, 100% {
        text-shadow: 
            0 0 5px #60a5fa,
            0 0 10px #60a5fa,
            0 0 15px #60a5fa,
            0 0 20px #60a5fa;
    }
    50% {
        text-shadow: 
            0 0 2px #60a5fa,
            0 0 5px #60a5fa,
            0 0 8px #60a5fa,
            0 0 12px #60a5fa;
    }
}

/* 玻璃态效果 */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* 悬停时的3D效果 */
.card-3d {
    perspective: 1000px;
    transition: transform 0.3s ease;
}

.card-3d:hover {
    transform: rotateY(5deg) rotateX(5deg);
}

/* 延迟动画类 */
.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; }