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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: #faf8ef;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.tab-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 25px;
    font-size: 1.1rem;
    border: 2px solid #4facfe;
    border-radius: 25px;
    background: white;
    color: #4facfe;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.tab-btn.active,
.tab-btn:hover {
    background: #4facfe;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.2);
}

.screen {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease;
}

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

.screen.active {
    display: block;
}

/* 单元选择页面 */
#unit-select-screen h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
}

.unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.unit-btn {
    padding: 22px;
    font-size: 1.1rem;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.unit-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(79, 172, 254, 0.4);
}

/* 通用卡片样式 */
.learn-card, .practice-card, .game-card {
    background: #ffffff;
    border: 3px solid #4facfe;
    border-radius: 20px;
    padding: 40px;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

/* 学习模块 */
.word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.english-word {
    font-size: 3rem;
    font-weight: bold;
}

.pronounce-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.pronounce-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.phonetic {
    font-size: 1.5rem;
    margin-bottom: 15px;
    opacity: 0.9;
    font-family: 'Courier New', monospace;
}

.chinese-meaning {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 25px;
}

.example-section {
    background: #f0f8ff;
    padding: 20px;
    border-radius: 12px;
    text-align: left;
    border-left: 4px solid #4facfe;
}

.example-section h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.example-en {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-style: italic;
}

.example-zh {
    font-size: 1rem;
    opacity: 0.9;
}

.learn-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.control-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.learn-progress {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4facfe;
}

/* 练习测试模块 */
.stats {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 25px;
    color: white;
}

.stat .label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.stat .value {
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
}

.input-area {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#practice-input {
    flex: 1;
    min-width: 200px;
    padding: 18px;
    font-size: 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.3s ease;
}

#practice-input:focus {
    border-color: #4facfe;
}

.input-area button {
    padding: 0 25px;
    font-size: 1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#practice-submit {
    background: linear-gradient(135deg, #4caf50, #8bc34a);
    color: white;
}

#practice-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.feedback {
    text-align: center;
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 20px;
    min-height: 35px;
}

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

.feedback.wrong {
    color: #f44336;
}

.progress-bar {
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    width: 0%;
    transition: width 0.3s ease;
}

/* 拼词游戏模块 */
.letter-bank {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0;
    min-height: 60px;
}

.letter-tile {
    width: 55px;
    height: 55px;
    background: #e3f2fd;
    border: 2px solid #4facfe;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    color: #1976d2;
}

.letter-tile:hover {
    background: #bbdefb;
    transform: translateY(-3px);
}

.letter-tile.used {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.answer-slot {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    min-height: 60px;
}

.slot {
    width: 55px;
    height: 55px;
    border-bottom: 3px solid #4facfe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.game-controls button {
    padding: 12px 25px;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#game-reset {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

#game-skip {
    background: linear-gradient(135deg, #9e9e9e, #757575);
}

.game-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 完成页面 */
#complete-screen h2 {
    text-align: center;
    color: #4caf50;
    margin-bottom: 30px;
}

.result-stats {
    background: #f5f5f5;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.result-stats p {
    font-size: 1.2rem;
    margin: 10px 0;
}

.wrong-words {
    background: #ffebee;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.wrong-words h3 {
    color: #d32f2f;
    margin-bottom: 15px;
}

.wrong-words ul {
    list-style: none;
}

.wrong-words li {
    padding: 10px 0;
    border-bottom: 1px solid #ffcdd2;
    font-size: 1.1rem;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-buttons button {
    padding: 15px 30px;
    font-size: 1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#restart-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

#practice-wrong-btn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
}

#back-to-unit-btn {
    background: linear-gradient(135deg, #9e9e9e, #757575);
    color: white;
}

.action-buttons button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.back-btn {
    display: block;
    margin: 0 auto;
    padding: 12px 25px;
    background: linear-gradient(135deg, #9e9e9e, #757575);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.back-btn:hover {
    background: linear-gradient(135deg, #757575, #616161);
    transform: translateY(-2px);
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .screen {
        padding: 25px 20px;
    }
    
    .english-word {
        font-size: 2rem;
    }
    
    .chinese-meaning {
        font-size: 1.5rem;
    }
    
    .learn-card, .practice-card, .game-card {
        padding: 25px 20px;
    }
    
    .stats {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .input-area {
        flex-direction: column;
    }
    
    .input-area button {
        padding: 15px;
    }
    
    .letter-tile, .slot {
        width: 45px;
        height: 45px;
        font-size: 1.4rem;
    }
}