/* 星云漩涡背景 */
.nebula-vortex-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -9999;
    background: radial-gradient(ellipse at center, #0a0a16 0%, #050510 50%, #000000 100%);
    overflow: hidden;
}

/* 主漩涡 */
.main-vortex {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150vmax;
    height: 150vmax;
    transform: translate(-50%, -50%);
    animation: vortexRotate 30s linear infinite;
}

/* 漩涡臂 */
.vortex-arm {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 800px;
    height: 300px;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(106, 17, 203, 0.8) 20%,
        rgba(37, 117, 252, 0.9) 50%,
        rgba(106, 17, 203, 0.8) 80%,
        transparent 100%);
    border-radius: 50%;
    transform-origin: left center;
    filter: blur(15px);
    animation: armPulse 8s ease-in-out infinite;
}

.vortex-arm:nth-child(1) { transform: translate(-50%, -50%) rotate(0deg); animation-delay: 0s; }
.vortex-arm:nth-child(2) { transform: translate(-50%, -50%) rotate(60deg); animation-delay: -1s; }
.vortex-arm:nth-child(3) { transform: translate(-50%, -50%) rotate(120deg); animation-delay: -2s; }
.vortex-arm:nth-child(4) { transform: translate(-50%, -50%) rotate(180deg); animation-delay: -3s; }
.vortex-arm:nth-child(5) { transform: translate(-50%, -50%) rotate(240deg); animation-delay: -4s; }
.vortex-arm:nth-child(6) { transform: translate(-50%, -50%) rotate(300deg); animation-delay: -5s; }

/* 漩涡核心 */
.vortex-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 1) 0%,
        rgba(37, 117, 252, 0.9) 30%,
        rgba(106, 17, 203, 0.8) 60%,
        transparent 80%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: corePulse 4s ease-in-out infinite;
    box-shadow: 0 0 100px rgba(37, 117, 252, 0.8), 0 0 200px rgba(106, 17, 203, 0.6);
}

/* 漂浮星云 */
.floating-nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: nebulaFloat 40s ease-in-out infinite;
}

.nebula-1 {
    top: 10%;
    left: 10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(106, 17, 203, 0.6), transparent 70%);
    animation-delay: 0s;
}

.nebula-2 {
    top: 70%;
    right: 10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 117, 252, 0.5), transparent 70%);
    animation-delay: -10s;
}

.nebula-3 {
    bottom: 20%;
    left: 20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 119, 198, 0.4), transparent 70%);
    animation-delay: -20s;
}

.nebula-4 {
    top: 30%;
    right: 30%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(100, 255, 218, 0.3), transparent 70%);
    animation-delay: -30s;
}

/* 闪烁的星星 */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: starTwinkle 5s ease-in-out infinite;
}

.star:nth-child(1) { top: 15%; left: 25%; width: 3px; height: 3px; animation-delay: 0s; }
.star:nth-child(2) { top: 40%; left: 80%; width: 2px; height: 2px; animation-delay: 1s; }
.star:nth-child(3) { top: 70%; left: 15%; width: 4px; height: 4px; animation-delay: 2s; }
.star:nth-child(4) { top: 25%; left: 60%; width: 2px; height: 2px; animation-delay: 3s; }
.star:nth-child(5) { top: 85%; left: 45%; width: 3px; height: 3px; animation-delay: 4s; }
.star:nth-child(6) { top: 55%; left: 35%; width: 2px; height: 2px; animation-delay: 5s; }

/* 星际尘埃 */
.cosmic-dust {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(2px);
    animation: dustFloat 20s linear infinite;
}

.dust-1 { top: 20%; left: 40%; width: 100px; height: 100px; animation-delay: 0s; }
.dust-2 { top: 60%; left: 70%; width: 150px; height: 150px; animation-delay: -5s; }
.dust-3 { top: 80%; left: 20%; width: 80px; height: 80px; animation-delay: -10s; }
.dust-4 { top: 30%; left: 85%; width: 120px; height: 120px; animation-delay: -15s; }

/* 动画关键帧 */
@keyframes vortexRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes armPulse {
    0%, 100% { 
        opacity: 0.7;
        transform: translate(-50%, -50%) rotate(var(--rotation, 0deg)) scaleX(1);
    }
    50% { 
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--rotation, 0deg)) scaleX(1.2);
    }
}

@keyframes corePulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 100px rgba(37, 117, 252, 0.8), 0 0 200px rgba(106, 17, 203, 0.6);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 150px rgba(37, 117, 252, 1), 0 0 300px rgba(106, 17, 203, 0.8);
    }
}

@keyframes nebulaFloat {
    0%, 100% { 
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% { 
        transform: translate(100px, -80px) scale(1.1) rotate(90deg);
    }
    50% { 
        transform: translate(-60px, 100px) scale(0.9) rotate(180deg);
    }
    75% { 
        transform: translate(-100px, -60px) scale(1.05) rotate(270deg);
    }
}

@keyframes starTwinkle {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.5);
        box-shadow: 0 0 10px white;
    }
}

@keyframes dustFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.1;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        transform: translate(200px, 100px) rotate(180deg);
        opacity: 0;
    }
}

/* 手机端优化 */
@media (max-width: 768px) {
    .vortex-arm {
        width: 400px;
        height: 150px;
        filter: blur(10px);
    }
    
    .vortex-core {
        width: 100px;
        height: 100px;
    }
    
    .floating-nebula {
        filter: blur(40px);
    }
    
    .nebula-1, .nebula-2, .nebula-3, .nebula-4 {
        width: 250px;
        height: 250px;
    }
}