/* 卡通装饰元素 */

/* 添加浮动的装饰元素 */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

/* 星星装饰 */
.star {
    position: absolute;
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    animation: twinkle 3s ease-in-out infinite;
}

.star:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.star:nth-child(2) { top: 20%; right: 15%; animation-delay: 1s; }
.star:nth-child(3) { top: 70%; left: 20%; animation-delay: 2s; }
.star:nth-child(4) { bottom: 20%; right: 20%; animation-delay: 1.5s; }

@keyframes twinkle {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(1); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2); 
    }
}

/* 云朵装饰 */
.cloud {
    position: absolute;
    color: rgba(255, 255, 255, 0.6);
    font-size: 30px;
    animation: float-cloud 8s ease-in-out infinite;
}

.cloud:nth-child(5) { top: 5%; left: -10%; animation-delay: 0s; }
.cloud:nth-child(6) { top: 60%; left: -10%; animation-delay: 4s; }

@keyframes float-cloud {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(100vw + 50px)); }
}

/* 彩虹装饰 */
.rainbow {
    position: absolute;
    top: 15%;
    right: -100px;
    width: 200px;
    height: 100px;
    border-radius: 200px 200px 0 0;
    background: linear-gradient(
        90deg,
        #ff0000,
        #ff8c00,
        #ffd700,
        #90ee90,
        #00bfff,
        #9370db
    );
    opacity: 0.3;
    animation: rainbow-appear 10s ease-in-out infinite;
}

@keyframes rainbow-appear {
    0%, 90%, 100% { opacity: 0; transform: translateX(0); }
    50% { opacity: 0.5; transform: translateX(-150px); }
}

/* 泡泡装饰 */
.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.2));
    animation: float-up 6s ease-in-out infinite;
}

.bubble:nth-child(9) { 
    width: 20px; 
    height: 20px; 
    bottom: -30px; 
    left: 10%; 
    animation-delay: 0s; 
}
.bubble:nth-child(10) { 
    width: 15px; 
    height: 15px; 
    bottom: -30px; 
    left: 30%; 
    animation-delay: 2s; 
}
.bubble:nth-child(11) { 
    width: 25px; 
    height: 25px; 
    bottom: -30px; 
    right: 20%; 
    animation-delay: 4s; 
}

@keyframes float-up {
    0% { 
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }
    100% { 
        transform: translateY(-100vh) scale(0.5);
        opacity: 0;
    }
}

/* 心形装饰 */
.heart {
    position: absolute;
    color: #ff6b9d;
    font-size: 16px;
    animation: heart-beat 2s ease-in-out infinite;
}

.heart:nth-child(12) { top: 30%; left: 5%; animation-delay: 0s; }
.heart:nth-child(13) { top: 50%; right: 10%; animation-delay: 1s; }

@keyframes heart-beat {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.6;
    }
    50% { 
        transform: scale(1.3);
        opacity: 1;
    }
}

/* 闪电装饰 */
.lightning {
    position: absolute;
    color: #ffe66d;
    font-size: 24px;
    animation: lightning-flash 4s ease-in-out infinite;
}

.lightning:nth-child(14) { top: 40%; right: 5%; animation-delay: 0s; }

@keyframes lightning-flash {
    0%, 90%, 100% { 
        opacity: 0.3;
        transform: rotate(0deg);
    }
    5%, 10% { 
        opacity: 1;
        transform: rotate(10deg);
    }
}

/* 页面特定的装饰 */
.login-page-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.quiz-page-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* 移动端优化 */
@media screen and (max-width: 768px) {
    .star, .heart, .lightning {
        font-size: 16px;
    }
    
    .cloud {
        font-size: 24px;
    }
    
    .rainbow {
        width: 150px;
        height: 75px;
    }
    
    .bubble {
        display: none; /* 在移动端隐藏泡泡以提高性能 */
    }
}
