/* 填充练习页面样式 */
body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f9f9f9;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.control-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f0f8ff;
    border-radius: 8px;
}

.mode-selector {
    display: flex;
    gap: 15px;
}

.mode-btn {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.mode-btn:hover {
    background-color: #f1f1f1;
}

.mode-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.difficulty-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

#difficulty {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 16px;
}

.generate-btn {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.generate-btn:hover {
    background-color: #2980b9;
}

.exercise-area {
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 8px;
    min-height: 200px;
    background-color: #fafafa;
}

.question-display {
    font-size: 28px;
    margin-bottom: 30px;
    min-height: 60px;
    text-align: center;
    color: #34495e;
    font-weight: bold;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.char-with-pinyin {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin: 0 5px;
}

.pinyin {
    font-size: 14px;
    color: #666;
    margin-bottom: 2px;
}

.char {
    font-size: 28px;
}

.stroke-order {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.stroke-order h3 {
    margin-top: 0;
    color: #495057;
}

.stroke-order p {
    font-size: 24px;
    margin-bottom: 0;
    line-height: 1.5;
}

.answer-input {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
}

#user-answer {
    flex-grow: 1;
    max-width: 400px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 18px;
    transition: border-color 0.3s;
}

#user-answer:focus {
    border-color: #3498db;
    outline: none;
}

#submit-btn {
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.3s;
}

#submit-btn:hover {
    background-color: #45a049;
}

.result-feedback {
    min-height: 40px;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-size: 18px;
    margin-top: 20px;
}

.result-feedback.correct {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result-feedback.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 新增动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.result-feedback {
    animation: fadeIn 0.5s ease-in-out;
}