* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #333;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #667eea;
    font-size: 2.5em;
    font-weight: 700;
}

/* 设置区域 */
.settings-section {
    margin-bottom: 30px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.setting-item input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.setting-item input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.setting-item input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
}

.file-info {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    color: #888;
}

.btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 练习区域 */
.practice-section {
    margin-bottom: 30px;
}

.progress-info {
    text-align: center;
    margin-bottom: 20px;
    font-size: 18px;
    color: #667eea;
    font-weight: 600;
}

.word-display {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 20px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.target-word {
    font-size: 3em;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
    letter-spacing: 0.1em;
    word-break: break-all;
    text-align: center;
}

.input-display {
    font-size: 3em;
    font-weight: 600;
    letter-spacing: 0.1em;
    min-height: 1.2em;
    text-align: center;
    word-break: break-all;
}

.input-display .char {
    display: inline-block;
    padding: 0 2px;
}

.input-display .char.correct {
    color: #4caf50;
}

.input-display .char.incorrect {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 3px;
}

.input-display .cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: #667eea;
    margin-left: 2px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hint {
    text-align: center;
    color: #888;
    font-size: 14px;
    font-style: italic;
}

/* 统计区域 */
.stats-section {
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: white;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
}

/* 完成提示 */
.result-section {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
}

.result-section h2 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2em;
}

.final-stats {
    margin-bottom: 30px;
}

.final-stat-item {
    margin-bottom: 15px;
    font-size: 18px;
}

.final-stat-label {
    color: #555;
    margin-right: 10px;
}

.final-stat-value {
    color: #667eea;
    font-weight: 700;
    font-size: 1.2em;
}

/* 模式切换 */
.mode-section {
    margin-bottom: 30px;
}

.mode-toggle {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.mode-btn {
    flex: 1;
    padding: 12px 24px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn:hover {
    background: #f0f0f0;
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* 复习计划显示 */
.review-plan-display {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.review-plan-display h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.plan-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.plan-item {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
}

.plan-label {
    color: #555;
}

.plan-value {
    color: #667eea;
    font-weight: 700;
}

.progress-bar-container {
    margin-top: 15px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

/* 背单词显示 */
.word-meaning {
    font-size: 2.5em;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    min-height: 1.5em;
    line-height: 1.5;
}

.word-meaning.both {
    font-size: 1.8em;
}

.word-meaning .meaning-line {
    display: block;
    line-height: 1.35;
}

.word-meaning .meaning-en {
    color: #333;
}

.word-meaning .meaning-zh {
    color: #555;
    margin-top: 10px;
}

.word-input-container {
    margin-bottom: 20px;
}

.word-input {
    width: 100%;
    padding: 20px;
    font-size: 2em;
    text-align: center;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.word-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.word-input.correct {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.05);
}

.word-input.incorrect {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.05);
}

.word-feedback {
    font-size: 1.2em;
    text-align: center;
    min-height: 1.5em;
    font-weight: 600;
}

.word-feedback.correct {
    color: #4caf50;
}

.word-feedback.incorrect {
    color: #f44336;
}

.file-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #888;
    font-style: italic;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    margin-top: 10px;
    padding: 10px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #5a6268;
}

.setting-item select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.setting-item select:focus {
    outline: none;
    border-color: #667eea;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2em;
    }

    .target-word,
    .input-display {
        font-size: 2em;
    }

    .word-meaning {
        font-size: 2em;
    }

    .word-input {
        font-size: 1.5em;
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 1.5em;
    }

    .mode-toggle {
        flex-direction: column;
    }
}
