/* 中文学习游戏样式 */
#chinese-learning-game {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.game-header h2 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: bold;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 300px;
    margin: 0 auto;
}

.game-info span {
    background: #3498db;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.current-question {
    background: #e74c3c !important;
}

.score {
    background: #27ae60 !important;
}

.game-content {
    margin-bottom: 30px;
    position: relative;
}

.question-area {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#sentence-display {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1.5;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

.character {
    display: inline-block;
    margin: 0 2px;
    position: relative;
}

.missing-character {
    width: 40px;
    height: 40px;
    border: 2px dashed #3498db;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ecf0f1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.missing-character:hover {
    background: #d5dbdb;
    border-color: #2980b9;
}

.missing-character.filled {
    background: #2ecc71;
    border-color: #27ae60;
    color: white;
    border-style: solid;
}

.missing-character.wrong {
    background: #e74c3c;
    border-color: #c0392b;
    color: white;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.options-area {
    text-align: center;
    margin-bottom: 30px;
}

.options-area h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
}

#character-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.character-option {
    width: 60px;
    height: 60px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.character-option:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.character-option:active {
    transform: translateY(0);
}

.character-option.used {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.character-option.used:hover {
    background: #95a5a6;
    transform: none;
}

.game-controls {
    text-align: center;
    margin-top: 30px;
}

.game-controls button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
}

.game-controls button:hover {
    background: #229954;
    transform: translateY(-2px);
}

#restart-game {
    background: #e74c3c !important;
}

#restart-game:hover {
    background: #c0392b !important;
}

.game-result {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-result h3 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 20px;
}

.game-result p {
    font-size: 18px;
    color: #34495e;
    margin-bottom: 25px;
}

#final-score {
    color: #e74c3c;
    font-weight: bold;
    font-size: 22px;
}

#play-again {
    background: #3498db;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#play-again:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    #chinese-learning-game {
        margin: 10px;
        padding: 15px;
    }
    
    .game-header h2 {
        font-size: 24px;
    }
    
    #sentence-display {
        font-size: 24px;
    }
    
    .missing-character {
        width: 35px;
        height: 35px;
    }
    
    .character-option {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    #character-options {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    #sentence-display {
        font-size: 20px;
    }
    
    .missing-character {
        width: 30px;
        height: 30px;
    }
    
    .character-option {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.success-animation {
    animation: success 0.6s ease;
}

@keyframes success {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Loading 样式 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 10px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 15px;
    color: #3498db;
    font-weight: bold;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.celebration-text {
    animation: celebration 2s ease-in-out infinite;
    color: #ff6b35;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

@keyframes celebration {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(-2deg); }
    50% { transform: scale(1.05); }
    75% { transform: scale(1.1) rotate(2deg); }
}