/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #4A90D9;
    --primary-dark: #3A7BC8;
    --success: #52C41A;
    --warning: #FAAD14;
    --danger: #F5222D;
    --bg-color: #F5F7FA;
    --card-bg: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --border-color: #E8E8E8;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    max-width: 100%;
    min-height: 100vh;
}

/* ==================== 页面切换 ==================== */
.page {
    display: none;
    min-height: 100vh;
    padding: 20px;
    padding-bottom: 100px;
}

.page.active {
    display: block;
}

/* ==================== 头部样式 ==================== */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 8px;
}

.header .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--card-bg);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    color: var(--primary);
    box-shadow: var(--shadow);
    cursor: pointer;
    z-index: 100;
}

.back-btn:hover {
    background: var(--primary);
    color: white;
}

/* ==================== 卡片网格 ==================== */
.grade-grid,
.semester-grid,
.module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.exercise-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 320px;
    margin: 0 auto;
}

.semester-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 300px;
}

.module-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* ==================== 卡片样式 ==================== */
.grade-card,
.semester-card,
.module-card,
.exercise-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 15px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
}

.grade-card:active,
.semester-card:active,
.module-card:active,
.exercise-card:active {
    transform: scale(0.95);
    background: var(--primary);
    color: white;
}

.grade-card:active .grade-words,
.semester-card:active .semester-words {
    color: rgba(255,255,255,0.8);
}

.grade-icon,
.semester-icon,
.module-icon,
.exercise-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
}

.grade-name,
.semester-name,
.module-name,
.exercise-name {
    font-size: 16px;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.grade-words,
.semester-words,
.module-desc,
.exercise-desc {
    font-size: 12px;
    color: var(--text-light);
}

.grade-card:active .grade-words,
.semester-card:active .semester-words {
    color: rgba(255,255,255,0.8);
}

/* ==================== 底部提示 ==================== */
.footer-tip {
    text-align: center;
    margin-top: 40px;
    font-size: 14px;
    color: var(--text-light);
}

/* ==================== 学习首页模块 ==================== */
.module-card {
    padding: 25px 15px;
}

.module-card[data-module="textbook"] { border-left: 4px solid #FF6B6B; }
.module-card[data-module="listening"] { border-left: 4px solid #4ECDC4; }
.module-card[data-module="search"] { border-left: 4px solid #45B7D1; }
.module-card[data-module="words"] { border-left: 4px solid #96CEB4; }
.module-card[data-module="favorites"] { border-left: 4px solid #FFEAA7; }
.module-card[data-module="exercise"] { border-left: 4px solid #DDA0DD; }

/* ==================== 单词详情页 ==================== */
.word-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.word-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

#word-english {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary);
}

.play-btn {
    background: var(--primary);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
}

.play-btn:active {
    transform: scale(0.9);
}

.word-phonetic {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.word-chinese {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.word-type {
    font-size: 14px;
    color: var(--text-light);
    background: var(--bg-color);
    padding: 5px 15px;
    border-radius: 15px;
    display: inline-block;
}

.word-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.action-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:active {
    transform: scale(0.95);
    opacity: 0.9;
}

.action-btn.collected {
    background: var(--warning);
}

/* ==================== 听音选义游戏 ==================== */
.game-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.score-display {
    text-align: center;
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 20px;
}

.question-display {
    text-align: center;
    margin-bottom: 25px;
}

.play-sound-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 20px 40px;
    border-radius: 30px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.play-sound-btn:active {
    transform: scale(0.95);
    opacity: 0.9;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.option-btn {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.option-btn.correct {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.option-btn.wrong {
    border-color: var(--danger);
    background: var(--danger);
    color: white;
}

.game-result {
    text-align: center;
    padding: 20px;
}

.game-result p {
    font-size: 20px;
    margin-bottom: 15px;
}

/* ==================== 搜索页 ==================== */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#search-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

#search-input:focus {
    border-color: var(--primary);
}

.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
}

.search-results {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    min-height: 200px;
}

.search-tip {
    text-align: center;
    color: var(--text-light);
    padding: 40px 0;
}

.search-result-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:active {
    background: var(--bg-color);
}

.result-english {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary);
}

.result-chinese {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==================== 单词表页 ==================== */
.words-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.filter-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* 单词表单元选择器 */
.unit-selector {
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.unit-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.unit-tab-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.unit-tab-btn.active {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

/* 听音选义单元列表按钮（竖版排列） */
.unit-list-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.unit-list-btn:active {
    background: var(--primary);
    color: white;
}

.unit-list-num {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary);
    margin-right: 12px;
    min-width: 70px;
}

.unit-list-btn:active .unit-list-num {
    color: white;
}

.unit-list-title {
    flex: 1;
    font-size: 14px;
    color: var(--text-color);
}

.unit-list-btn:active .unit-list-title {
    color: rgba(255,255,255,0.9);
}

.unit-list-count {
    font-size: 13px;
    color: var(--text-light);
    background: var(--bg-color);
    padding: 4px 10px;
    border-radius: 12px;
}

.unit-list-btn:active .unit-list-count {
    background: rgba(255,255,255,0.2);
    color: white;
}

.words-list {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: visible;
    position: relative;
    z-index: 1;
}

.word-list-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    background: var(--card-bg);
}

.word-list-item:last-child {
    border-bottom: none;
}

.word-list-item:active {
    background: var(--bg-color);
}

.word-list-english {
    flex: 1;
    font-size: 16px;
    font-weight: bold;
    color: var(--primary);
}

.word-list-chinese {
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
}

.word-list-play {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

/* ==================== 收藏页 ==================== */
.favorites-list {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-height: 300px;
}

.empty-tip {
    text-align: center;
    color: var(--text-light);
    padding: 60px 0;
}

/* ==================== 单元列表 ==================== */
.unit-list {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.unit-item {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.unit-item:last-child {
    border-bottom: none;
}

.unit-item:active {
    background: var(--bg-color);
}

.unit-number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
}

.unit-info {
    flex: 1;
}

.unit-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.unit-question {
    font-size: 12px;
    color: var(--text-light);
}

.unit-words-count {
    font-size: 11px;
    color: var(--primary);
    margin-top: 3px;
}

.unit-arrow {
    color: var(--text-light);
    font-size: 20px;
}

/* ==================== 单元单词列表页 ==================== */
.unit-words-list {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ==================== 单元内容页面 ==================== */
.unit-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 15px;
    overflow: hidden;
}

.section-title {
    padding: 15px 20px;
    font-size: 16px;
    font-weight: bold;
    color: var(--primary);
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.section-list {
    padding: 0;
}

/* 单词样式 */
.section-list .word-list-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.section-list .word-list-item:last-child {
    border-bottom: none;
}

.section-list .word-list-item:active {
    background: var(--bg-color);
}

.section-list .word-list-english {
    flex: 1;
    font-size: 15px;
    font-weight: bold;
    color: var(--primary);
}

.section-list .word-list-chinese {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

/* 句子样式 */
.section-list .sentence-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.section-list .sentence-item:last-child {
    border-bottom: none;
}

.section-list .sentence-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.section-list .sentence-chinese {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 10px;
}

/* ==================== 句子拼写练习 ==================== */
.spell-game {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.spell-score {
    text-align: center;
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 10px;
}

.spell-progress {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.spell-question {
    text-align: center;
    margin-bottom: 20px;
}

.play-sentence-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
    margin-bottom: 15px;
    transition: transform 0.2s;
}

.play-sentence-btn:active {
    transform: scale(0.95);
}

.spell-sentence {
    font-size: 24px;
    color: var(--text-primary);
    padding: 20px;
    background: var(--bg-color);
    border-radius: var(--radius);
    margin-bottom: 15px;
}

.spell-hint {
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
}

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

#spell-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 18px;
    text-align: center;
    outline: none;
}

#spell-input:focus {
    border-color: var(--primary);
}

.spell-submit-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
}

.spell-submit-btn:active {
    opacity: 0.8;
}

.spell-result {
    text-align: center;
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 15px;
    font-size: 18px;
}

.spell-result.correct {
    background: #E6F7E6;
    color: var(--success);
}

.spell-result.wrong {
    background: #FFF1F0;
    color: var(--danger);
}

.spell-next-btn {
    display: block;
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 15px;
}

.spell-next-btn:active {
    opacity: 0.8;
}

/* ==================== 连词成句 ==================== */
.order-game {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.order-score {
    text-align: center;
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 10px;
}

.order-progress {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.order-question {
    text-align: center;
    margin-bottom: 20px;
}

.order-sentence {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.order-words {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    min-height: 60px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.order-word-btn {
    background: var(--card-bg);
    border: 2px solid var(--primary);
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.order-word-btn:active {
    background: var(--primary);
    color: white;
}

.order-word-btn.selected {
    background: var(--primary);
    color: white;
}

.order-hint {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.order-result {
    text-align: center;
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 15px;
    font-size: 16px;
}

.order-result.correct {
    background: #E6F7E6;
    color: var(--success);
}

.order-result.wrong {
    background: #FFF1F0;
    color: var(--danger);
}

.order-submit-btn {
    display: block;
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
    margin-bottom: 10px;
}

.order-submit-btn:active {
    opacity: 0.8;
}

.order-next-btn {
    display: block;
    width: 100%;
    background: var(--card-bg);
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 15px;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
}

/* 正确答案高亮 */
.highlight-word {
    background: #FFE566;
    padding: 2px 8px;
    border-radius: 4px;
}

/* 对话样式 */
.section-list .dialogue-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.section-list .dialogue-item:last-child {
    border-bottom: none;
}

.section-list .dialogue-speaker {
    font-size: 13px;
    font-weight: bold;
    color: var(--primary);
    min-width: 60px;
}

.section-list .dialogue-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

/* Waiyan dialogue format */
.dialogue-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 500;
}

.dialogue-exchange {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dialogue-line {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.speaker-a {
    color: var(--primary);
    font-weight: 600;
    min-width: 50px;
}

.speaker-b {
    color: var(--success);
    font-weight: 600;
    min-width: 50px;
}

.dialogue-item .word-list-play {
    margin-top: 5px;
}

/* ==================== 加载动画 ==================== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
/* ==================== 单元选择页 ==================== */
.unit-select-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
}

.unit-select-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-align: left;
}

.unit-select-btn:active {
    opacity: 0.8;
    transform: scale(0.98);
}

.unit-select-btn .unit-num {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.unit-select-btn .unit-info {
    flex: 1;
}

.unit-select-btn .unit-title {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

.unit-select-btn .unit-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ==================== 配对游戏 ==================== */
.match-game {
    padding: 15px;
}

.match-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 15px;
    font-size: 15px;
    color: var(--text-primary);
}

.match-info span {
    color: var(--primary);
    font-weight: bold;
}

.match-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.match-card {
    aspect-ratio: 1;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    padding: 4px;
    word-break: break-all;
    overflow: hidden;
}

.match-card.flipped {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 2px solid var(--primary);
}

.match-card.matched {
    background: var(--success);
    color: white;
    cursor: default;
}

.match-card.wrong {
    background: var(--danger);
    color: white;
    animation: shake 0.3s;
}

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

.match-restart-btn {
    display: block;
    width: 100%;
    background: var(--card-bg);
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 12px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
}

.match-tip {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding: 8px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ==================== 配对游戏新样式 ==================== */
.match-mode-select {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match-mode-tip {
    text-align: center;
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.match-mode-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    border: none;
    text-align: left;
    transition: all 0.2s;
}

.match-mode-btn:active {
    opacity: 0.8;
    transform: scale(0.98);
}

.match-mode-btn .mode-icon {
    font-size: 32px;
}

.match-mode-btn .mode-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.match-mode-btn .mode-desc {
    font-size: 13px;
    color: var(--text-light);
}

.match-play-area .match-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    font-size: 15px;
}

.match-play-area .match-info span {
    color: var(--text-primary);
}

.match-play-area .match-info #match-score {
    color: var(--primary);
    font-weight: bold;
}

.match-question {
    text-align: center;
    padding: 30px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.match-question .q-word {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 8px;
}

.match-question .q-sub {
    font-size: 13px;
    color: var(--text-light);
}

.match-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.match-option-btn {
    padding: 18px 12px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.match-option-btn:active {
    opacity: 0.8;
}

.match-option-btn.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.match-option-btn.correct {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.match-option-btn.wrong {
    border-color: var(--danger);
    background: var(--danger);
    color: white;
}

.match-result {
    text-align: center;
    padding: 15px;
    border-radius: var(--radius);
    margin-top: 15px;
    font-size: 16px;
}

.match-result.correct {
    background: #E6F7E6;
    color: var(--success);
}

.match-result.wrong {
    background: #FFF1F0;
    color: var(--danger);
}

.match-next-btn {
    display: block;
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 15px;
}

/* ==================== 跟读练习 ==================== */
.reading-game {
    padding: 15px;
}

.reading-progress {
    text-align: center;
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.reading-sentence-area {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 20px;
}

.reading-sentence {
    font-size: 22px;
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 15px;
}

.reading-play-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    font-size: 15px;
    cursor: pointer;
}

.reading-record-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.reading-record-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
}

.reading-record-btn.recording {
    background: var(--danger);
    animation: pulse 1s infinite;
}

.reading-record-btn .record-icon {
    font-size: 28px;
}

.reading-record-btn .record-text {
    font-size: 11px;
    color: white;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.reading-status {
    font-size: 13px;
    color: var(--text-light);
    text-align: center;
}

.reading-status.listening {
    color: var(--primary);
    font-weight: 500;
}

.reading-status.no-support {
    color: var(--danger);
    font-size: 12px;
}

.reading-result {
    text-align: center;
    padding: 15px;
    border-radius: var(--radius);
    font-size: 15px;
}

.reading-result .result-score {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 8px;
}

.reading-result .result-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.reading-result .result-compare {
    margin-top: 10px;
    padding: 10px;
    background: var(--bg-color);
    border-radius: 8px;
    font-size: 13px;
}

.reading-result .result-detail {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.75;
}

.reading-next-btn {
    display: block;
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 15px;
}

/* ==================== 教材版本选择页 ==================== */
.version-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.version-card {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px 20px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.version-card:active {
    transform: scale(0.98);
    border-color: var(--primary);
}

.version-icon {
    font-size: 40px;
    margin-right: 20px;
}

.version-name {
    font-size: 22px;
    font-weight: bold;
    color: var(--text-primary);
    display: block;
}

.version-desc {
    font-size: 14px;
    color: var(--text-secondary);
    display: block;
    margin-top: 4px;
}

.version-tip {
    text-align: center;
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 20px;
}

.header #home-title {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
}

/* ==================== 字母点读页 ==================== */
.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.alphabet-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 12px 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    border: 1px solid var(--border-color);
}

.alphabet-card:active {
    transform: scale(0.96);
    background: var(--primary);
}

.alphabet-card:active .letter-main {
    color: white;
}

.alphabet-card:active .letter-lowercase {
    color: rgba(255,255,255,0.7);
}

.alphabet-card:active .letter-phonetic {
    background: rgba(255,255,255,0.2);
    color: white;
}

.letter-main {
    font-size: 36px;
    font-weight: bold;
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.2;
}

.letter-lowercase {
    font-size: 24px;
    font-style: italic;
    color: var(--text-secondary);
    margin-left: 2px;
}

.letter-phonetic {
    font-size: 13px;
    color: white;
    background: var(--primary);
    padding: 3px 10px;
    border-radius: 10px;
    margin-top: 6px;
    font-family: monospace;
}

.alphabet-tip {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 20px;
}

/* ==================== 字母点读入口 ==================== */
.letter-entry {
    margin-top: 30px;
}

.letter-entry-inner {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
}

.letter-entry-inner:active {
    transform: scale(0.98);
}

.letter-entry-icon {
    font-size: 36px;
    margin-right: 15px;
}

.letter-entry-text {
    flex: 1;
}

.letter-entry-title {
    font-size: 18px;
    font-weight: bold;
    color: white;
}

.letter-entry-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    margin-top: 2px;
}

.letter-entry-arrow {
    font-size: 24px;
    color: rgba(255,255,255,0.7);
}

/* ===== 语速设置弹窗 ===== */
.settings-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}
.settings-btn:hover { background: rgba(0,0,0,0.1); }

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 360px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f8f8;
}
.modal-header h3 { margin: 0; font-size: 1rem; color: #333; }
.modal-close {
    background: none; border: none; font-size: 1.2rem;
    cursor: pointer; color: #999; padding: 4px;
}
.modal-close:hover { color: #333; }
.modal-body { padding: 20px; }
.speed-tip { text-align: center; color: #666; margin-bottom: 16px; font-size: 0.9rem; }
.speed-options { display: flex; flex-direction: column; gap: 10px; }
.speed-option {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: 12px;
    border: 2px solid #e0e0e0; background: #fff;
    cursor: pointer; transition: all 0.2s;
    text-align: left;
}
.speed-option:hover { border-color: #4CAF50; background: #f9fff9; }
.speed-option.active { border-color: #4CAF50; background: #e8f5e9; }
.speed-icon { font-size: 1.5rem; }
.speed-label { font-weight: bold; color: #333; min-width: 50px; }
.speed-desc { color: #888; font-size: 0.85rem; }
