/* 动态背景效果 */

/* 动态渐变背景 */
body {
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(135deg, 
        #1a1a1d 0%, 
        #25252b 25%, 
        #1f2228 50%, 
        #2c2c32 75%, 
        #1a1a1d 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 粒子容器 */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

/* 星星粒子 */
.star-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(195, 161, 96, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(195, 161, 96, 0.5);
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* 漂浮粒子 */
.float-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, rgba(74, 111, 165, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatUp 20s linear infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(100px) scale(1);
        opacity: 0;
    }
}

/* 魔法光环 */
.magic-ring {
    position: absolute;
    border: 1px solid rgba(195, 161, 96, 0.3);
    border-radius: 50%;
    animation: expandRing 8s ease-out infinite;
}

@keyframes expandRing {
    0% {
        width: 0;
        height: 0;
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    100% {
        width: 600px;
        height: 600px;
        opacity: 0;
    }
}

/* 光线效果 */
.light-ray {
    position: absolute;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(195, 161, 96, 0.1) 50%, 
        transparent 100%);
    animation: rayMove 10s linear infinite;
}

@keyframes rayMove {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateX(100vw);
        opacity: 0;
    }
}

/* 魔法符文 */
.magic-rune {
    position: absolute;
    width: 30px;
    height: 30px;
    color: rgba(195, 161, 96, 0.3);
    font-size: 20px;
    animation: runeFloat 15s ease-in-out infinite;
}

@keyframes runeFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.2;
    }
    50% {
        transform: translateY(-50px) rotate(180deg);
        opacity: 0.6;
    }
}

/* 能量波纹 */
.energy-wave {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(74, 111, 165, 0.3) 50%, 
        transparent 100%);
    animation: waveMove 8s ease-in-out infinite;
}

@keyframes waveMove {
    0%, 100% {
        transform: translateY(0) scaleX(0.5);
        opacity: 0;
    }
    50% {
        transform: translateY(50vh) scaleX(1);
        opacity: 0.5;
    }
}

/* 流星效果 */
.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8);
    animation: shootingStar 3s linear infinite;
}

@keyframes shootingStar {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: translate(-300px, 300px);
        opacity: 0;
    }
}

.shooting-star::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        transparent 100%);
    transform: translateX(-100px);
}

/* 魔法粒子轨迹 */
.particle-trail {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(195, 161, 96, 0.6);
    border-radius: 50%;
    animation: trailMove 5s ease-in-out infinite;
}

@keyframes trailMove {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* 光晕效果 */
.glow-orb {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, 
        rgba(195, 161, 96, 0.2) 0%, 
        rgba(74, 111, 165, 0.1) 50%, 
        transparent 70%);
    border-radius: 50%;
    animation: orbFloat 12s ease-in-out infinite;
    filter: blur(20px);
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(100px, -50px) scale(1.2);
    }
    50% {
        transform: translate(50px, 100px) scale(0.8);
    }
    75% {
        transform: translate(-100px, 50px) scale(1.1);
    }
}

/* 响应式优化 */
@media (max-width: 768px) {
    .magic-ring {
        animation-duration: 10s;
    }
    
    .float-particle {
        animation-duration: 25s;
    }
    
    .glow-orb {
        width: 60px;
        height: 60px;
    }
}

/* 性能优化 - 减少动画复杂度 */
@media (prefers-reduced-motion: reduce) {
    body::before,
    .star-particle,
    .float-particle,
    .magic-ring,
    .light-ray,
    .magic-rune,
    .energy-wave,
    .shooting-star,
    .particle-trail,
    .glow-orb {
        animation: none;
    }
}