/**
 * 系统名称：ITeacherPlatform
 * 开发公司：斯帝姆智能科技有限公司
 * 程序名：feedback.css
 * 功能描述：思维训练中心通用反馈动画样式
 * 版本号：v1.0.0
 * 修订历史：
 *   - v1.0.0 (2026-05-31)：初始版本，实现正确/错误反馈动画效果
 */

/* 正确反馈 - 绿色脉冲扩散 */
.feedback-correct {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(40, 167, 69, 0.6) 0%, transparent 70%);
    pointer-events: none;
    animation: feedbackPulse 0.6s ease-out forwards;
    z-index: 9999;
}

@keyframes feedbackPulse {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* 正确反馈 - 元素闪烁 */
.feedback-flash-correct {
    animation: flashCorrect 0.4s ease;
}

@keyframes flashCorrect {
    0%, 100% { background-color: inherit; }
    50% { background-color: rgba(40, 167, 69, 0.3); }
}

/* 错误反馈 - 红色抖动 */
.feedback-wrong {
    animation: feedbackShake 0.5s ease;
}

@keyframes feedbackShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* 错误反馈 - 红色闪烁 */
.feedback-flash-wrong {
    animation: flashWrong 0.4s ease;
}

@keyframes flashWrong {
    0%, 100% { background-color: inherit; }
    50% { background-color: rgba(220, 53, 69, 0.3); }
}

/* 屏幕边缘闪光效果 */
.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99998;
    opacity: 0;
}

.screen-flash.correct {
    background: radial-gradient(circle at center, transparent 50%, rgba(40, 167, 69, 0.3) 100%);
    animation: screenFlashCorrect 0.5s ease-out;
}

.screen-flash.wrong {
    background: radial-gradient(circle at center, transparent 50%, rgba(220, 53, 69, 0.3) 100%);
    animation: screenFlashWrong 0.5s ease-out;
}

@keyframes screenFlashCorrect {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes screenFlashWrong {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* 粒子效果容器 */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99997;
}

/* 单个粒子 */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFly 1s ease-out forwards;
}

@keyframes particleFly {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* 完成特效 - 全屏庆祝 */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    animation: celebrationFadeIn 0.3s ease forwards;
}

@keyframes celebrationFadeIn {
    to { opacity: 1; }
}

.celebration-text {
    font-size: 80px;
    font-weight: bold;
    color: #ffc107;
    text-shadow: 0 0 30px rgba(255, 193, 7, 0.8);
    animation: celebrationBounce 0.6s ease;
}

@keyframes celebrationBounce {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* 音效控制按钮 */
.sound-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 123, 255, 0.9);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.sound-toggle-btn.muted {
    background: rgba(108, 117, 125, 0.9);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .celebration-text {
        font-size: 50px;
    }
    
    .sound-toggle-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
        bottom: 15px;
        right: 15px;
    }
}
