/* 背景样式 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #0c0c20;
    will-change: transform;
    transform: translateZ(0);
}

/* 星星样式 */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    perspective: 1000px;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

.star {
    position: absolute;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    background: #fff;
    animation: twinkle 2s infinite alternate;
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* 根据大小设置不同的光晕效果 */
.star[style*="--glow-size: small"] {
    box-shadow: 0 0 8px #fff,
                0 0 16px rgba(200, 190, 255, 0.7);
}

.star[style*="--glow-size: medium"] {
    box-shadow: 0 0 12px #fff,
                0 0 24px #fff,
                0 0 36px rgba(190, 180, 255, 0.8);
}

.star[style*="--glow-size: large"] {
    box-shadow: 0 0 15px #fff,
                0 0 30px #fff,
                0 0 45px #fff,
                0 0 60px rgba(200, 180, 255, 0.9),
                0 0 75px rgba(180, 160, 255, 0.7);
}

@keyframes twinkle {
    from {
        opacity: var(--min-opacity, 0.6);
        transform: scale(0.8) rotate(0deg) translateZ(var(--star-depth, 0));
    }
    to {
        opacity: var(--max-opacity, 1);
        transform: scale(1.2) rotate(180deg) translateZ(var(--star-depth, 0));
    }
}

/* 流星样式 */
.shooting-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.shooting-star {
    position: absolute;
    height: 2px;
    background: linear-gradient(-90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
    animation: shooting 4s ease-in-out infinite;
    opacity: 0;
    will-change: transform, opacity, width;
    transform: translateZ(0);
}

@keyframes shooting {
    0% {
        transform: translateX(0) translateY(0) rotate(-45deg);
        opacity: 1;
        width: 0;
    }
    10% {
        width: 100px;
        opacity: 1;
    }
    70% {
        width: 50px;
        opacity: 0.8;
    }
    100% {
        transform: translateX(-1000px) translateY(1000px) rotate(-45deg);
        opacity: 0;
        width: 0;
    }
}

/* 星云效果 */
.nebula {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.85;
    mix-blend-mode: screen;
    will-change: background;
    transform: translateZ(0);
    backface-visibility: hidden;
    transition: background 1s ease-in-out;
}

/* 优化动画性能 */
@media (prefers-reduced-motion: reduce) {
    .star {
        animation-duration: 4s;
    }
    
    .shooting-star {
        animation-duration: 6s;
    }
    
    .nebula {
        transition-duration: 2s;
    }
}

/* 移动设备优化 */
@media (max-width: 768px) {
    .star[style*="--glow-size: large"] {
        box-shadow: 0 0 10px #fff,
                    0 0 20px #fff,
                    0 0 30px rgba(200, 180, 255, 0.9);
    }
    
    .shooting-star {
        height: 1px;
    }
} 