/* 
 * 英语单词记忆网站 - 主样式文件
 * 专为英语学习者设计的友好界面
 */

/* ========== CSS 变量 ========== */
:root {
    /* 主色调 - 柔和蓝色系 */
    --primary-color: #4A90D9;
    --primary-light: #6BA5E7;
    --primary-dark: #3A7BC8;
    
    /* 辅助色 */
    --success-color: #7ED321;
    --success-light: #A3E977;
    --warning-color: #F5A623;
    --danger-color: #E02020;
    --danger-light: #FF6B6B;
    
    /* 背景色 */
    --bg-primary: #F5F7FA;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    
    /* 文字颜色 */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --text-white: #FFFFFF;
    
    /* 边框和阴影 */
    --border-color: #E8E8E8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    /* 过渡动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* 字体 */
    --font-primary: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    --font-english: Arial, Helvetica, sans-serif;
    
    /* iPad 底部安全区域 */
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
}

/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* 移除 iOS 点击高亮 */
    tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%; /* 防止 iOS 字体自动调整 */
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100%;
    overflow: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    height: 100svh; /* Safari mobile */
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}

/* ========== 头部导航 ========== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 0 24px;
    box-shadow: var(--shadow-md);
    position: sticky;
    position: -webkit-sticky;
    top: 0;
    z-index: 100;
    -webkit-backface-visibility: hidden; /* Fix iOS rendering */
    backface-visibility: hidden;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 1.5rem;
    color: var(--text-white);
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-family: inherit;
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-white);
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.25);
    color: var(--text-white);
    font-weight: 600;
}

/* ========== 主内容区域 ========== */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
    padding-bottom: max(140px, calc(env(safe-area-inset-bottom, 0px) + 120px));
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
    min-height: 0;
}

.page.active {
    display: block;
    min-height: 0;
}

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

/* ========== 首页样式 ========== */
.hero-section {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-xl);
    color: var(--text-white);
    margin-bottom: 32px;
}

.hero-section h2 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.hero-section p {
    font-size: 1.1rem;
    opacity: 0.9;
}

#daily-joke {
    font-style: italic;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-top: 12px;
    line-height: 1.6;
}

#daily-joke.loading {
    color: var(--text-light);
}

#daily-joke.error {
    display: none;
}

/* 功能卡片 */
.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 阅读列表样式 */
.readings-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.readings-unit-section {
    margin-bottom: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
}

.readings-unit-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.readings-unit-section .reading-card {
    margin-bottom: 0;
    background: var(--bg-card);
}

.readings-unit-section .reading-card:last-child {
    margin-bottom: 0;
}

.reading-card {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}

.reading-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.reading-card-icon {
    font-size: 2rem;
    margin-right: 16px;
    flex-shrink: 0;
}

.reading-card-info {
    flex: 1;
    min-width: 0;
}

.reading-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.reading-card-title-cn {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.reading-card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.reading-card-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 12px;
}

/* 阅读页面样式 */
#page-readings {
    padding: 24px;
}

#page-readings .page-header {
    margin-bottom: 24px;
}

#page-readings .page-subtitle {
    color: var(--text-white);
    margin-top: 8px;
}

/* 今日统计 */
.today-stats {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.today-stats h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

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

.stat-item {
    text-align: center;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* AI 知识问答 */
.ai-qa-section {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-top: 24px;
    margin-bottom: 32px;
    color: white;
}

.ai-qa-section h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.qa-desc {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.qa-input-area {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

#qa-input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
}

#qa-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

#qa-input::placeholder {
    color: #999;
}

/* 联网搜索开关 */
.qa-options {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: 0.3s;
    border-radius: 26px;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: rgba(255, 255, 255, 0.6);
    border-color: white;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.toggle-label {
    font-size: 0.9rem;
    opacity: 0.95;
    user-select: none;
}

#qa-submit-btn {
    padding: 14px 28px;
    background: white;
    color: #11998e;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

#qa-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#qa-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.qa-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
}

.qa-result {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-md);
    padding: 20px;
    color: var(--text-primary);
    max-height: 400px;
    overflow-y: auto;
}

.qa-answer {
    line-height: 1.8;
    font-size: 1rem;
}

.qa-answer h1,
.qa-answer h2,
.qa-answer h3,
.qa-answer h4 {
    color: #11998e;
    margin: 16px 0 8px 0;
}

.qa-answer h1:first-child,
.qa-answer h2:first-child,
.qa-answer h3:first-child,
.qa-answer h4:first-child {
    margin-top: 0;
}

.qa-answer h1 { font-size: 1.5rem; }
.qa-answer h2 { font-size: 1.35rem; }
.qa-answer h3 { font-size: 1.2rem; }
.qa-answer h4 { font-size: 1.1rem; }

.qa-answer p {
    margin: 8px 0;
}

.qa-answer ul,
.qa-answer ol {
    margin: 8px 0;
    padding-left: 24px;
}

.qa-answer li {
    margin: 6px 0;
}

.qa-answer blockquote {
    border-left: 4px solid #11998e;
    margin: 12px 0;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 0 4px 4px 0;
}

.qa-answer code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-english);
    font-size: 0.9em;
}

.qa-answer pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.qa-answer pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.qa-answer table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.qa-answer th,
.qa-answer td {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    text-align: left;
}

.qa-answer th {
    background: #f7fafc;
    font-weight: 600;
}

.qa-answer tr:nth-child(even) {
    background: #f8f9fa;
}

.qa-answer a {
    color: #11998e;
    text-decoration: none;
}

.qa-answer a:hover {
    text-decoration: underline;
}

.qa-answer hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 20px 0;
}

/* ========== 单词列表页样式 ========== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h2 {
    font-size: 1.5rem;
}

.search-box {
    display: flex;
    gap: 8px;
}

.search-box input {
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: inherit;
    width: 280px;
    transition: border-color var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    padding: 12px 20px;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 1.1rem;
    transition: background var(--transition-fast);
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* 词书选择器 */
.wordbook-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.wordbook-selector label {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.wordbook-selector select {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    background: white;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.wordbook-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.wordbook-selector select:disabled {
    background: var(--bg-primary);
    cursor: not-allowed;
}

/* 语句页面按钮区域 */
#page-sentences .setup-actions {
    margin-top: 24px;
}

#page-sentences .setup-actions .btn-primary {
    width: 100%;
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* 听写页面样式 */
#page-dictation {
    padding: 24px;
}

#page-dictation-result {
    padding: 24px;
}

.dictation-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    gap: 20px;
}

.dictation-word-info {
    flex: 1;
    text-align: left;
}

.dictation-word {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.dictation-content .audio-btn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.dictation-content .audio-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.dictation-input-area {
    margin-bottom: 24px;
    text-align: center;
}

.dictation-input {
    width: 100%;
    max-width: 500px;
    padding: 16px 24px;
    font-size: 1.5rem;
    border: 3px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: border-color var(--transition-fast);
    /* 确保默认边框颜色正确 */
    color: var(--text-primary);
    background: var(--bg-primary);
}

.dictation-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* 输入框错误状态 - 明确使用 !important 确保优先级 */
.dictation-input.input-error {
    border-color: var(--danger-color) !important;
}

/* 输入框正确状态 */
.dictation-input.input-correct {
    border-color: var(--success-color) !important;
}

.dictation-feedback {
    text-align: center;
    margin-bottom: 24px;
}

.dictation-feedback .feedback-correct {
    font-size: 1.3rem;
    color: var(--success-color);
    font-weight: 600;
}

.dictation-feedback .feedback-wrong {
    font-size: 1.1rem;
    color: var(--danger-color);
}

/* 听写页面答案显示 */
#dictation-answer-display {
    text-align: center;
}

#dictation-answer-display .answer-word {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 12px 0;
}

#dictation-answer-display .answer-phonetic {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.dictation-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 16px;
}

.dictation-skip {
    text-align: center;
}

.dictation-skip .btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 8px 16px;
    transition: color var(--transition-fast);
}

.dictation-skip .btn-text:hover {
    color: var(--primary-color);
}

/* 听写结果页面 */
.result-card {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 24px;
}

.result-stat {
    text-align: center;
}

.result-stat .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.result-stat .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
}

.result-actions .btn-primary,
.result-actions .btn-secondary {
    min-width: 150px;
}

/* 错误单词列表 */
.wrong-words-section {
    margin-top: 32px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.wrong-words-section h3 {
    font-size: 1.1rem;
    color: var(--danger-color);
    margin-bottom: 16px;
    text-align: center;
}

.wrong-words-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wrong-word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--danger-color);
}

.wrong-word-en {
    font-weight: 600;
    color: var(--text-primary);
}

.wrong-word-cn {
    color: var(--text-secondary);
}

/* 闪卡词书选择器 */
.wordbook-selector-flashcard {
    margin-bottom: 20px;
}

.wordbook-selector-flashcard select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    background: white;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.wordbook-selector-flashcard select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 单元标签页 */
.unit-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    margin-bottom: 24px;
    scrollbar-width: thin;
}

.unit-tab {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-family: inherit;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.unit-tab:hover {
    border-color: var(--primary-light);
    background: #F0F7FF;
}

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

/* 单词列表 */
.word-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.word-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all var(--transition-fast);
}

.word-card:hover {
    box-shadow: var(--shadow-md);
}

.word-main {
    flex: 1;
}

.word-text {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-color);
    font-family: var(--font-english);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.word-phonetic {
    font-size: 0.9rem;
    color: var(--text-light);
    font-family: var(--font-english);
}

.word-meaning {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.word-example {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.word-example .audio-btn.small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0.6;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.word-example .audio-btn.small:hover {
    opacity: 1;
    background: var(--primary-light);
    transform: scale(1.1);
}

.word-tip {
    font-size: 0.9rem;
    color: #e67e22;
    background: #fef9f3;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
    border-left: 3px solid #e67e22;
    line-height: 1.4;
}

.word-actions {
    display: flex;
    gap: 8px;
}

/* ========== 分页样式 ========== */
.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-num {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-num:hover {
    background: var(--primary-light);
}

.pagination-num.active {
    background: var(--primary-color);
    color: white;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.word-action-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--bg-primary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-action-btn:hover {
    background: var(--primary-light);
    transform: scale(1.1);
}

.word-action-btn.favorited {
    background: #FFF3E0;
}

/* ========== 闪卡测试页样式 ========== */
.setup-section {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-md);
}

.setup-section h2 {
    text-align: center;
    margin-bottom: 32px;
    color: var(--text-primary);
}

.setup-group {
    margin-bottom: 32px;
}

.setup-group h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.unit-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.unit-select-item {
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.unit-select-item:hover {
    border-color: var(--primary-light);
}

.unit-select-item.selected {
    background: #E3F2FD;
    border-color: var(--primary-color);
}

.unit-select-item .unit-name {
    font-weight: 600;
    color: var(--text-primary);
}

.unit-select-item .unit-count {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}

.select-actions {
    display: flex;
    gap: 12px;
}

/* 测试模式选择 */
.mode-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.mode-option {
    flex: 1;
    min-width: 140px;
    cursor: pointer;
}

.mode-option input {
    display: none;
}

.mode-label {
    display: block;
    padding: 16px 20px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-fast);
}

.mode-option input:checked + .mode-label {
    background: #E3F2FD;
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

/* 语句练习页面 */
#page-sentences {
    padding: 24px;
}

#page-sentence-practice {
    padding: 24px;
}

#page-sentence-result {
    padding: 24px;
}

.sentence-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    gap: 16px;
}

.sentence-chinese {
    flex: 1;
    font-size: 1.4rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.sentence-content .play-btn {
    flex-shrink: 0;
}

.sentence-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
}

.word-input-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sentence-word-input {
    width: 100px;
    padding: 12px 16px;
    font-size: 1.1rem;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.sentence-word-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.sentence-word-input.correct {
    border-color: var(--success-color);
    background: var(--success-light);
}

.sentence-word-input.wrong {
    border-color: var(--danger-color);
    background: var(--danger-light);
}

.word-input-wrapper .punctuation {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.sentence-feedback {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.3rem;
    font-weight: 600;
    min-height: 40px;
}

.feedback-correct {
    color: var(--success-color);
}

.feedback-wrong {
    color: var(--danger-color);
}

.feedback-answer {
    color: var(--primary-color);
}

.answer-display {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 2px dashed var(--primary-color);
}

.answer-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.answer-words {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.answer-word {
    padding: 8px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    white-space: nowrap;
    min-width: max-content;
}

.answer-word.correct {
    background: var(--success-light);
    border-color: var(--success-color);
    color: var(--success-color);
}

/* 语句练习页面的答案样式 - 更紧凑 */
#page-sentence-practice .answer-words {
    gap: 6px;
    justify-content: flex-start;
}

#page-sentence-practice .answer-word {
    padding: 6px 10px;
    font-size: 1rem;
    border-radius: 6px;
}

/* 听写页面的答案样式 */
#dictation-answer-display {
    text-align: center;
}

#dictation-answer-display .answer-words {
    justify-content: center;
    flex-wrap: wrap;
}

#dictation-answer-display .answer-word {
    font-size: 1.4rem;
    padding: 10px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--primary-color);
    font-weight: 600;
}

#dictation-answer-display .answer-phonetic {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 12px;
}

/* 闪卡答案单词包装器 */
.answer-word-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 收藏按钮 */
.favorite-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.favorite-btn:hover {
    border-color: var(--danger-color);
    transform: scale(1.1);
}

.favorite-btn.favorited {
    border-color: var(--danger-color);
    background: #FFEBEE;
}

.favorite-btn.favorited .favorite-icon {
    color: var(--danger-color);
}

.practice-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.practice-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width var(--transition-normal);
}

.progress-text {
    font-size: 1rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.result-container {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.result-container h2 {
    font-size: 1.8rem;
    margin-bottom: 32px;
    color: var(--text-primary);
}

.sentence-result .result-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
}

.sentence-result .result-row {
    display: flex;
    justify-content: space-between;
    width: 200px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.sentence-result .result-label {
    color: var(--text-secondary);
}

.sentence-result .result-value {
    font-weight: 600;
}

.sentence-result .result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sentence-result .result-actions .btn {
    width: 100%;
}

.unit-select-grid .unit-name {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
}

.unit-select-grid .unit-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 测试区域 */
.test-section {
    max-width: 600px;
    margin: 0 auto;
}

/* 进度条 */
.test-progress {
    margin-bottom: 24px;
}

.progress-bar {
    height: 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 6px;
    width: 10%;
    transition: width var(--transition-normal);
}

.progress-text {
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
}

/* 闪卡样式 */
.flashcard {
    width: 100%;
    min-height: 480px;
    perspective: 1000px;
    margin-bottom: 24px;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    min-height: 480px;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    border-radius: var(--radius-xl);
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    min-height: 480px;
    backface-visibility: hidden;
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.flashcard-front {
    background: linear-gradient(145deg, #ffffff 0%, #f0f4f8 100%);
}

.flashcard-back {
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: rotateY(180deg);
    /* 内容过多时允许内部滚动 */
    overflow-y: auto;
    overflow-x: hidden;
}

/* 闪卡背面内容滚动时的样式调整 */
.flashcard-back.scrolling {
    justify-content: flex-start;
    padding-top: 24px;
}

.question-label {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.question-text {
    font-size: 3.5rem;
    font-weight: bold;
    font-family: var(--font-english);
    color: var(--primary-color);
    word-break: break-word;
}

.btn-reveal {
    margin-top: 32px;
    padding: 16px 48px;
    font-size: 1.2rem;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
}

.btn-reveal:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 217, 0.4);
}

/* 答案背面样式 */
.answer-word {
    font-size: 2.8rem;
    font-weight: bold;
    font-family: var(--font-english);
    margin-bottom: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-fast);
}

.answer-word:hover {
    color: var(--primary-color);
    transform: scale(1.05);
}

.answer-word:active {
    transform: scale(0.98);
}

.speak-hint {
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.answer-word:hover .speak-hint {
    opacity: 1;
}

.answer-phonetic {
    font-size: 1.2rem;
    font-family: var(--font-english);
    opacity: 0.8;
    margin-bottom: 16px;
}

.answer-phonetic-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.phonetic-audio-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary-light);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.phonetic-audio-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.phonetic-audio-btn:active {
    transform: scale(0.95);
}

.answer-meaning {
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.answer-example {
    background: rgba(255, 255, 255, 0.15);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.answer-example .example-en {
    font-family: var(--font-english);
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.answer-example .audio-btn.small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.answer-example .audio-btn.small:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

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

.answer-tip {
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.answer-source {
    font-size: 0.9rem;
    color: #FFFFFF;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
}

.answer-source .source-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.answer-source .source-label {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.answer-source .source-value {
    font-weight: 700;
    color: #FFAB91;
    font-size: 0.95rem;
}

.answer-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.answer-actions button {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    min-width: 100px;
    max-width: 200px;
}

.btn-known {
    background: var(--success-color);
    color: white;
    box-shadow: 0 4px 12px rgba(126, 211, 33, 0.3);
}

.btn-known:hover {
    background: #6BC119;
    transform: translateY(-2px);
}

.btn-unknown {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 4px 12px rgba(224, 32, 32, 0.3);
}

.btn-unknown:hover {
    background: #C81818;
    transform: translateY(-2px);
}

.btn-review {
    background: var(--warning-color);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3);
}

.btn-review:hover {
    background: #E0960D;
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1.2rem;
}

/* 退出测试按钮 */
.btn-exit {
    display: block;
    margin: 24px auto 0;
    padding: 12px 32px;
    background: transparent;
    border: 2px solid var(--text-light);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-exit:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* 测试结果 */
.result-section {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.result-section h2 {
    margin-bottom: 32px;
    color: var(--text-primary);
}

.result-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.result-circle {
    position: relative;
    width: 160px;
    height: 160px;
}

.result-circle svg {
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: var(--bg-primary);
    stroke-width: 10;
}

.circle-progress {
    fill: none;
    stroke: var(--success-color);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s ease;
}

.result-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.result-details {
    text-align: left;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    min-width: 180px;
}

.result-row.correct .result-value {
    color: var(--success-color);
}

.result-row.wrong .result-value {
    color: var(--danger-color);
}

.result-label {
    color: var(--text-secondary);
}

.result-value {
    font-weight: 600;
    color: var(--text-primary);
}

.result-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========== 学习进度页样式 ========== */
.overall-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 单元进度 */
.unit-progress-section,
.wrong-words-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.unit-progress-section h3,
.wrong-words-section h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.unit-progress-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.unit-progress-info {
    display: flex;
    flex-direction: column;
    width: 140px;
    flex-shrink: 0;
}

.unit-progress-book {
    font-size: 0.75rem;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.unit-progress-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.unit-progress-bar {
    flex: 1;
    height: 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    overflow: hidden;
    margin: 0 16px;
}

.unit-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 6px;
    transition: width var(--transition-normal);
}

.unit-progress-count {
    width: 80px;
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 错词列表 */
.wrong-words-list {
    max-height: 400px;
    overflow-y: auto;
}

.wrong-word-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #FFF5F5;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.wrong-word-item .word-info {
    flex: 1;
}

.wrong-word-item .word-text {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.wrong-word-item .word-meaning {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.wrong-word-item .wrong-count {
    background: var(--danger-light);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.empty-message {
    text-align: center;
    color: var(--text-light);
    padding: 40px;
}

/* 错题本页面 */
/* 标签页切换 */
.wrongbook-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.wrongbook-tabs .tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.wrongbook-tabs .tab-btn:hover {
    color: var(--primary-color);
}

.wrongbook-tabs .tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* 标签页内容 */
.wrongbook-tab-content {
    display: none;
}

.wrongbook-tab-content.active {
    display: block;
}

/* 错句列表项 */
.wrong-sentence-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.wrong-sentence-item:last-child {
    margin-bottom: 0;
}

.wrong-sentence-item .sentence-info {
    margin-bottom: 12px;
}

.wrong-sentence-item .english {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.5;
}

.wrong-sentence-item .chinese {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.wrong-sentence-item .sentence-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.wrong-sentence-item .reading-title {
    color: var(--primary-color);
}

.wrong-sentence-item .wrong-count {
    color: var(--danger-color);
    font-weight: 500;
}

.wrong-sentence-item .remove-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.wrong-sentence-item .remove-btn:hover {
    background: var(--danger-color);
    color: white;
}

.wrongbook-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.wrongbook-stats .stat-card {
    flex: 1;
    min-width: 200px;
}

.mastery-legend {
    background: var(--bg-secondary);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 0.9rem;
}

.legend-title {
    font-weight: 600;
    color: var(--text-primary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-badge {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.legend-badge.mastered {
    background: var(--success-color);
    color: white;
}

.legend-badge.learning {
    background: var(--warning-color);
    color: white;
}

.legend-badge.review {
    background: var(--danger-color);
    color: white;
}

.legend-note {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-left: auto;
}

.wrongbook-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.wrongbook-actions .btn-primary,
.wrongbook-actions .btn-secondary {
    flex: 1;
    min-width: 200px;
}

.wrongbook-list-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.wrongbook-list-section h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.wrongbook-words {
    min-height: 100px;
}

/* 分页信息 */
.wrongbook-pagination-info {
    text-align: center;
    padding: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

/* 单词卡片网格布局 */
.wrongbook-word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 8px 0;
}

/* 错词卡片样式 */
.wrongbook-word-card {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border: 2px solid #90CAF9;
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wrongbook-word-card:hover {
    border-color: #64B5F6;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.wrongbook-word-card.mastered {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-color: #81C784;
}

.wrongbook-word-card.learning {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    border-color: #FFD54F;
}

/* 卡片头部 */
.word-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}

.word-index {
    background: var(--primary-light);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

/* 移除按钮（小） */
.remove-btn-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.remove-btn-small:hover {
    background: var(--danger-light);
    color: white;
}

/* 卡片内容 */
.word-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.word-card-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.word-card-main .word-text {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.word-card-main .word-phonetic {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.word-card-main .word-meaning {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.4;
}

/* 发音按钮（小） */
.audio-btn-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--primary-light);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all var(--transition-fast);
}

.audio-btn-small:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* 例句样式 */
.word-card-example {
    background: rgba(0, 0, 0, 0.03);
    padding: 10px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-light);
    margin-top: 4px;
}

.word-card-example .example-label {
    font-weight: 500;
    color: var(--primary-color);
    font-size: 0.85rem;
}

.word-card-example .example-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    font-style: italic;
    margin-top: 4px;
}

.word-card-example .example-translation {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
    padding-left: 12px;
}

/* 记忆提示样式 */
.word-card-tip {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    background: #FFF8F0;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border-left: 3px solid #E67E22;
    font-size: 0.85rem;
    color: #E67E22;
    line-height: 1.4;
}

.word-card-tip .tip-icon {
    flex-shrink: 0;
}

/* 卡片底部 */
.word-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}

/* 熟练度徽章 */
.mastery-badge {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.mastery-badge.mastered {
    background: var(--success-color);
    color: white;
}

.mastery-badge.learning {
    background: #FFA000;
    color: white;
}

.mastery-badge.review {
    background: var(--danger-color);
    color: white;
}

/* 错词次数徽章 */
.wrong-count-badge {
    background: var(--bg-primary);
    color: var(--danger-color);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

/* 错句卡片网格 */
.wrongsentence-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 8px 0;
}

/* 错句卡片样式 */
.wrongsentence-card {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border: 2px solid #90CAF9;
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wrongsentence-card:hover {
    border-color: #64B5F6;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 错句卡片头部 */
.sentence-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}

.sentence-index {
    background: #1976D2;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.sentence-card-actions {
    display: flex;
    gap: 6px;
}

/* 错句卡片内容 */
.sentence-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sentence-english {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.5;
    font-weight: 500;
}

.sentence-chinese {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-left: 12px;
    border-left: 3px solid #90CAF9;
}

/* 错句卡片底部 */
.sentence-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
    flex-wrap: wrap;
}

/* 阅读来源徽章 */
.reading-badge {
    background: rgba(25, 118, 210, 0.1);
    color: #1976D2;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

/* 分页导航 */
.wrongbook-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.wrongbook-word-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #FFF5F5;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    transition: all var(--transition-fast);
}

.wrongbook-word-item:hover {
    background: #FFE8E8;
    transform: translateX(4px);
}

.wrongbook-word-item .word-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.wrongbook-word-item .word-text {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.wrongbook-word-item .word-phonetic {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.wrongbook-word-item .word-meaning {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-top: 4px;
}

.wrongbook-word-item .wrongbook-example {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.5;
    font-style: italic;
}

.wrongbook-word-item .wrongbook-memory-tip {
    font-size: 0.85rem;
    color: #E67E22;
    background: #FFF8F0;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 8px;
    border-left: 3px solid #E67E22;
}

.wrongbook-word-item .word-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wrongbook-word-item .mastery-badge {
    background: var(--success-light);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.wrongbook-word-item .audio-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary-light);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.wrongbook-word-item .audio-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.wrongbook-word-item .remove-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.wrongbook-word-item .remove-btn:hover {
    background: var(--danger-light);
    color: white;
}

/* 收藏单词页面 */
#page-favorites .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

#page-favorites .page-header h2 {
    margin: 0;
}

.favorites-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ========== 按钮样式 ========== */
.btn-primary {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-large {
    padding: 18px 48px;
    font-size: 1.2rem;
}

/* ========== 底部 ========== */
.footer {
    background: var(--bg-secondary);
    padding: 20px;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* ========== 加载动画 ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-primary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ========== 服务错误提示 ========== */
.error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.error-overlay.show {
    opacity: 1;
    visibility: visible;
}

.error-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-content h2 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.error-content p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.error-hint {
    font-size: 0.9rem;
    color: var(--text-light);
}

.error-content .btn-primary {
    margin-top: 24px;
}

/* ========== 响应式设计 ========== */

/* iPad 专用优化 */
@media only screen and (min-width: 768px) and (max-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) {
    /* iPad 竖屏和横屏优化 */
    .header-content {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .main-content {
        padding: 20px 24px;
        padding-bottom: max(140px, calc(env(safe-area-inset-bottom, 0px) + 100px));
    }
    
    .feature-cards {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    /* 优化导航菜单在 iPad 上的显示 */
    .nav-menu {
        gap: 4px;
    }
    
    .nav-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    /* 统计网格优化 */
    .stats-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 16px;
    }
    
    .stat-item {
        padding: 20px 12px;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
}

/* iPad Pro 专用优化 */
@media only screen and (min-width: 1024px) and (max-width: 1366px) and (-webkit-min-device-pixel-ratio: 2) {
    .main-content {
        max-width: 1000px;
        padding: 28px 32px;
    }
    
    .hero-section {
        padding: 48px 32px;
    }
    
    .hero-section h2 {
        font-size: 1.8rem;
    }
}

/* 平板设备 (768px 以下) */
@media (max-width: 768px) {
    /* 头部导航 */
    .header {
        padding: 0 12px;
    }
    
    .header-content {
        flex-direction: column;
        height: auto;
        padding: 12px 0;
        gap: 10px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }
    
    .nav-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    /* 主内容区域 */
    .main-content {
        padding: 16px 12px;
        padding-bottom: max(130px, calc(env(safe-area-inset-bottom, 0px) + 100px));
    }
    
    /* 首页 */
    .hero-section {
        padding: 28px 16px;
        margin-bottom: 24px;
    }
    
    .hero-section h2 {
        font-size: 1.4rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .feature-cards {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 16px;
    }
    
    .feature-card {
        padding: 24px 20px;
    }
    
    .card-icon {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }
    
    .feature-card h3 {
        font-size: 1.15rem;
    }
    
    /* 今日统计 */
    .today-stats {
        padding: 20px 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .stat-item {
        padding: 12px 8px;
    }
    
    .stat-number {
        font-size: 1.6rem;
    }
    
    /* AI 问答 */
    .ai-qa-section {
        padding: 20px 16px;
    }
    
    .ai-qa-section h3 {
        font-size: 1.2rem;
    }
    
    .qa-input-area {
        flex-direction: column;
    }
    
    #qa-input {
        padding: 12px 14px;
    }
    
    #qa-submit-btn {
        padding: 12px 24px;
        width: 100%;
    }
    
    /* 阅读列表样式 */
    .reading-card {
        padding: 12px 16px;
    }
    
    .reading-card-icon {
        font-size: 1.5rem;
        margin-right: 12px;
    }
    
    .reading-card-title {
        font-size: 1rem;
    }
    
    .reading-card-title-cn {
        font-size: 0.9rem;
    }
    
    .reading-card-arrow {
        font-size: 1.2rem;
    }
    
    /* 单元分组样式 */
    .readings-unit-section {
        margin-bottom: 16px;
        padding: 12px;
    }
    
    .readings-unit-title {
        font-size: 0.9rem;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }
    
    .readings-grid {
        gap: 8px;
    }
    
    #page-readings {
        padding: 16px;
    }
    
    /* 页面头部 */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .page-header h2 {
        font-size: 1.3rem;
        text-align: center;
    }
    
    /* 搜索框 */
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        flex: 1;
        width: auto;
        padding: 10px 16px;
    }
    
    .search-btn {
        padding: 10px 16px;
        font-size: 1rem;
    }
    
    /* 词书选择器 */
    .wordbook-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px;
    }
    
    .wordbook-selector label {
        text-align: center;
    }
    
    .wordbook-selector select {
        width: 100%;
    }
    
    /* 单元标签页 */
    .unit-tabs {
        gap: 6px;
        padding: 6px 0;
        margin-bottom: 16px;
    }
    
    .unit-tab {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    /* 单词列表容器 */
    .word-list {
        gap: 12px;
    }
    
    /* 单词卡片 */
    .word-card {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
        gap: 16px;
    }
    
    .word-main {
        width: 100%;
    }
    
    .word-text {
        font-size: 1.3rem;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .word-phonetic {
        font-size: 0.85rem;
    }
    
    .word-meaning {
        font-size: 1rem;
    }
    
    .word-example {
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }
    
    .word-tip {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
    
    .word-actions {
        width: 100%;
        justify-content: center;
        gap: 12px;
    }
    
    /* 分页 */
    .pagination {
        padding: 16px;
        gap: 12px;
    }
    
    .pagination-controls {
        gap: 6px;
    }
    
    .pagination-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .pagination-num {
        min-width: 32px;
        height: 32px;
    }
    
    /* 单词卡片 */
    .word-card {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
        gap: 16px;
    }
    
    .word-text {
        font-size: 1.3rem;
        justify-content: center;
    }
    
    .word-phonetic {
        font-size: 0.85rem;
    }
    
    .word-meaning {
        font-size: 1rem;
    }
    
    .word-example {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .word-actions {
        margin-top: 8px;
    }
    
    /* 分页 */
    .pagination {
        padding: 16px;
        gap: 12px;
    }
    
    /* 闪卡测试设置 */
    .setup-section {
        max-width: 100%;
        padding: 24px 20px;
        margin: 0 8px;
    }
    
    .setup-section h2 {
        font-size: 1.3rem;
        margin-bottom: 24px;
    }
    
    .unit-select-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .unit-select-item {
        padding: 10px 12px;
    }
    
    .mode-options {
        flex-direction: column;
        gap: 12px;
    }
    
    .mode-option {
        min-width: 100%;
    }
    
    .select-actions {
        flex-direction: column;
    }
    
    .select-actions button {
        width: 100%;
    }
    
    /* 闪卡答案页面完整适配 */
    .flashcard-back {
        padding: 20px 16px;
    }
    
    .answer-source {
        font-size: 0.8rem;
        padding: 10px 14px;
        gap: 16px;
        margin-bottom: 12px;
        width: 100%;
    }
    
    .answer-source .source-item {
        gap: 6px;
    }
    
    .answer-source .source-label {
        font-size: 0.75rem;
    }
    
    .answer-source .source-value {
        font-size: 0.85rem;
    }
    
    .answer-word {
        font-size: 1.8rem;
        gap: 10px;
        margin-bottom: 6px;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .speak-hint {
        font-size: 1.1rem;
    }
    
    .answer-phonetic-wrapper {
        gap: 10px;
        margin-bottom: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .answer-phonetic {
        font-size: 1rem;
        width: 100%;
        text-align: center;
        margin-bottom: 4px;
    }
    
    .phonetic-audio-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .answer-meaning {
        font-size: 1.3rem;
        margin-bottom: 16px;
        width: 100%;
        text-align: center;
    }
    
    .answer-example {
        padding: 12px 14px;
        margin-bottom: 12px;
        width: 100%;
    }
    
    .answer-example .example-en {
        font-size: 0.95rem;
        margin-bottom: 8px;
        flex-wrap: wrap;
    }
    
    .answer-example .example-zh {
        font-size: 0.9rem;
    }
    
    .answer-example .audio-btn.small {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        flex-shrink: 0;
    }
    
    .answer-tip {
        font-size: 0.85rem;
        padding: 10px 12px;
        margin-bottom: 14px;
        width: 100%;
    }
    
    .answer-actions {
        gap: 10px;
        width: 100%;
        justify-content: center;
    }
    
    .answer-actions button {
        flex: 1;
        min-width: 80px;
        max-width: none;
        padding: 12px 16px;
        font-size: 0.95rem;
        white-space: nowrap;
    }
    
    .btn-icon {
        font-size: 1.1rem;
    }
    
    .btn-exit {
        margin-top: 16px;
        padding: 10px 24px;
        font-size: 0.9rem;
        width: 100%;
    }
    
    /* 闪卡 */
    .test-section {
        max-width: 100%;
        padding: 0 8px;
    }

    .flashcard {
        min-height: 420px;
        margin-bottom: 20px;
    }

    .flashcard-inner {
        min-height: 420px;
    }

    .flashcard-front,
    .flashcard-back {
        min-height: 420px;
        padding: 20px 16px;
    }
    
    .answer-word {
        font-size: 1.8rem;
    }
    
    .answer-meaning {
        font-size: 1.3rem;
    }
    
    .btn-reveal {
        padding: 14px 36px;
        font-size: 1.1rem;
    }
    
    .answer-actions {
        gap: 10px;
    }
    
    .answer-actions button {
        flex: 1;
        padding: 12px 20px;
        justify-content: center;
    }
    
    /* 测试结果 */
    .result-section {
        max-width: 100%;
        padding: 24px 20px;
        margin: 0 8px;
    }
    
    .result-stats {
        gap: 24px;
    }
    
    .result-circle {
        width: 140px;
        height: 140px;
    }
    
    .result-percent {
        font-size: 2rem;
    }

    /* 语句练习页面 */
    #page-sentences {
        padding: 16px;
    }

    #page-sentence-practice {
        padding: 16px;
    }

    #page-sentence-result {
        padding: 16px;
    }

    .sentence-content {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }

    .sentence-chinese {
        font-size: 1.2rem;
    }

    .sentence-word-input {
        width: 70px;
        padding: 10px 12px;
        font-size: 1rem;
    }

    .sentence-inputs {
        gap: 8px;
    }

    .word-input-wrapper .punctuation {
        font-size: 1rem;
    }

    .sentence-feedback {
        font-size: 1.1rem;
    }

    .practice-actions {
        flex-direction: column;
        gap: 12px;
    }

    .practice-actions .btn {
        width: 100%;
    }

    /* 答案显示区域 */
    .answer-display {
        padding: 16px;
    }

    .answer-words {
        gap: 6px;
    }

    .answer-word {
        padding: 6px 12px;
        font-size: 1rem;
    }

    .answer-word-wrapper {
        flex-direction: row;
        gap: 6px;
    }

    .favorite-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    /* 学习进度 */
    .overall-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 20px 16px;
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-value {
        font-size: 1.6rem;
    }
    
    /* 单元进度 */
    .unit-progress-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .unit-progress-info {
        width: 100%;
    }
    
    .unit-progress-book {
        font-size: 0.7rem;
    }
    
    .unit-progress-name {
        width: 100%;
        margin-bottom: 4px;
    }
    
    .unit-progress-bar {
        flex: 1;
        min-width: 120px;
        margin: 0;
    }
    
    .unit-progress-count {
        width: auto;
        font-size: 0.85rem;
    }
    
    /* 按钮 */
    .btn-primary,
    .btn-secondary {
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    
    .btn-large {
        padding: 16px 36px;
        font-size: 1.1rem;
    }

    /* 听写页面 */
    #page-dictation {
        padding: 16px;
    }

    .dictation-content {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }

    .dictation-word-info {
        text-align: center;
    }

    .dictation-word {
        font-size: 1.8rem;
    }

    .dictation-content .audio-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        margin: 0 auto;
    }

    .dictation-input {
        padding: 12px 16px;
        font-size: 1.2rem;
    }

    .dictation-actions {
        flex-direction: column;
        gap: 12px;
    }

    .dictation-actions .btn {
        width: 100%;
    }

    /* 听写结果页面 */
    #page-dictation-result {
        padding: 16px;
    }

    .result-card {
        padding: 24px 16px;
    }

    .result-stats {
        flex-direction: column;
        gap: 24px;
    }

    .result-actions {
        flex-direction: column;
        gap: 12px;
    }

    .result-actions .btn {
        width: 100%;
    }

    .wrong-words-section {
        padding: 16px;
    }

    .wrong-words-list {
        gap: 8px;
    }

    .wrong-word-item {
        padding: 12px;
    }
}

/* 手机设备 (480px 以下) */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    body {
        line-height: 1.5;
    }
    
    /* 头部 */
    .header {
        padding: 0 8px;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .nav-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        border-radius: var(--radius-md);
    }
    
    /* 内容区域 */
    .main-content {
        padding: 12px 10px;
        padding-bottom: max(120px, calc(env(safe-area-inset-bottom, 0px) + 90px));
    }
    
    /* 首页 */
    .hero-section {
        padding: 20px 14px;
        border-radius: var(--radius-lg);
    }
    
    .hero-section h2 {
        font-size: 1.2rem;
    }
    
    .feature-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .feature-card {
        padding: 20px 16px;
    }
    
    .card-icon {
        font-size: 2.2rem;
    }
    
    /* 统计 */
    .today-stats {
        padding: 16px 12px;
    }
    
    .stats-grid {
        gap: 10px;
    }
    
    .stat-number {
        font-size: 1.4rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    /* AI 问答 */
    .ai-qa-section {
        padding: 16px 12px;
        border-radius: var(--radius-md);
    }
    
    .ai-qa-section h3 {
        font-size: 1.1rem;
    }
    
    #qa-input {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
    
    #qa-submit-btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    /* 阅读列表样式 */
    .reading-card {
        padding: 10px 12px;
    }
    
    .reading-card-icon {
        font-size: 1.3rem;
        margin-right: 10px;
    }
    
    .reading-card-title {
        font-size: 0.9rem;
    }
    
    .reading-card-title-cn {
        font-size: 0.85rem;
    }
    
    .readings-unit-title {
        font-size: 0.9rem;
        margin-bottom: 6px;
        padding-bottom: 4px;
    }
    
    .readings-unit-section {
        margin-bottom: 12px;
        padding: 10px;
    }
    
    .readings-grid {
        gap: 6px;
    }
    
    /* 页面头部 */
    .page-header h2 {
        font-size: 1.15rem;
    }
    
    /* 搜索框 */
    .search-box {
        flex-direction: column;
    }
    
    .search-box input,
    .search-btn {
        width: 100%;
        padding: 10px 14px;
    }
    
    /* 词书选择器 */
    .wordbook-selector {
        padding: 12px;
        gap: 10px;
    }
    
    /* 闪卡词书选择器 */
    .wordbook-selector-flashcard select {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
    
    /* 单元标签 */
    .unit-tabs {
        margin-bottom: 16px;
    }
    
    .unit-tab {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    /* 单词卡片 */
    .word-card {
        padding: 16px 12px;
        gap: 12px;
    }
    
    .word-text {
        font-size: 1.2rem;
        gap: 8px;
    }
    
    .word-phonetic {
        font-size: 0.8rem;
    }
    
    .word-meaning {
        font-size: 0.95rem;
    }
    
    .word-example {
        font-size: 0.9rem;
    }
    
    .word-action-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    /* 单词列表页面 */
    .page-header {
        gap: 10px;
    }
    
    .page-header h2 {
        font-size: 1.15rem;
    }
    
    /* 搜索框 */
    .search-box {
        flex-direction: column;
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
        padding: 10px 14px;
        font-size: 0.95rem;
    }
    
    .search-btn {
        width: 100%;
        padding: 10px;
        font-size: 0.95rem;
    }
    
    /* 词书选择器 */
    .wordbook-selector {
        padding: 12px;
        gap: 10px;
    }
    
    .wordbook-selector label {
        font-size: 0.9rem;
    }
    
    .wordbook-selector select {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    /* 闪卡词书选择器 */
    .wordbook-selector-flashcard select {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    /* 单元标签页 */
    .unit-tabs {
        gap: 4px;
        margin-bottom: 12px;
        padding: 4px 0;
    }
    
    .unit-tab {
        padding: 6px 10px;
        font-size: 0.8rem;
        border-radius: var(--radius-md);
    }
    
    /* 单词列表容器 */
    .word-list {
        gap: 10px;
    }
    
    /* 单词卡片 */
    .word-card {
        padding: 16px 12px;
        gap: 12px;
    }
    
    .word-text {
        font-size: 1.2rem;
        gap: 8px;
    }
    
    .word-phonetic {
        font-size: 0.8rem;
    }
    
    .word-meaning {
        font-size: 0.95rem;
    }
    
    .word-example {
        font-size: 0.9rem;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .word-tip {
        font-size: 0.8rem;
        padding: 6px 8px;
    }
    
    .word-actions {
        width: 100%;
        gap: 10px;
    }
    
    .word-action-btn {
        flex: 1;
        max-width: 50px;
    }
    
    /* 分页 */
    .pagination {
        padding: 12px;
        gap: 10px;
    }
    
    .pagination-info {
        font-size: 0.85rem;
    }
    
    .pagination-controls {
        gap: 4px;
    }
    
    .pagination-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .pagination-num {
        min-width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    /* 闪卡测试设置 */
    .setup-section {
        padding: 20px 14px;
        margin: 0 4px;
    }
    
    .setup-section h2 {
        font-size: 1.15rem;
        margin-bottom: 20px;
    }
    
    .setup-group {
        margin-bottom: 24px;
    }
    
    .setup-group h3 {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .unit-select-item {
        padding: 8px 10px;
    }
    
    .unit-select-item .unit-name {
        font-size: 0.9rem;
    }
    
    .unit-select-item .unit-count {
        font-size: 0.75rem;
    }
    
    .mode-label {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    .select-actions {
        gap: 8px;
        flex-direction: column;
    }
    
    .select-actions button {
        width: 100%;
    }
    
    /* 闪卡答案页面完整适配 */
    .flashcard-back {
        padding: 16px 12px;
    }
    
    .answer-source {
        font-size: 0.7rem;
        padding: 8px 10px;
        gap: 10px;
        margin-bottom: 10px;
        width: 100%;
    }
    
    .answer-source .source-item {
        gap: 4px;
    }
    
    .answer-source .source-label {
        font-size: 0.65rem;
    }
    
    .answer-source .source-value {
        font-size: 0.75rem;
    }
    
    .answer-word {
        font-size: 1.4rem;
        gap: 6px;
        margin-bottom: 4px;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .speak-hint {
        font-size: 1rem;
    }
    
    .answer-phonetic-wrapper {
        gap: 6px;
        margin-bottom: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .answer-phonetic {
        font-size: 0.85rem;
        width: 100%;
        text-align: center;
        margin-bottom: 2px;
    }
    
    .phonetic-audio-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .answer-meaning {
        font-size: 1.1rem;
        margin-bottom: 10px;
        width: 100%;
        text-align: center;
    }
    
    .answer-example {
        padding: 10px 12px;
        margin-bottom: 10px;
        width: 100%;
    }
    
    .answer-example .example-en {
        font-size: 0.85rem;
        margin-bottom: 6px;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .answer-example .example-zh {
        font-size: 0.8rem;
    }
    
    .answer-example .audio-btn.small {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
        flex-shrink: 0;
    }
    
    .answer-tip {
        font-size: 0.75rem;
        padding: 8px 10px;
        margin-bottom: 10px;
        width: 100%;
    }

    .answer-word-wrapper {
        flex-direction: column;
        gap: 8px;
    }

    .favorite-btn {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .answer-actions {
        gap: 6px;
        width: 100%;
        justify-content: center;
    }
    
    .answer-actions button {
        width: 100%;
        padding: 10px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .btn-icon {
        font-size: 1rem;
    }
    
    .btn-exit {
        margin-top: 12px;
        padding: 8px 16px;
        font-size: 0.8rem;
        width: 100%;
    }
    
    /* 闪卡 */
    .flashcard {
        min-height: 380px;
    }

    .flashcard-inner {
        min-height: 380px;
    }

    .flashcard-front,
    .flashcard-back {
        min-height: 380px;
        padding: 20px 16px;
    }

    .question-text {
        font-size: 1.6rem;
    }
    
    .question-label {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
    
    .btn-reveal {
        padding: 12px 28px;
        font-size: 1rem;
        margin-top: 20px;
    }
    
    .answer-word {
        font-size: 1.5rem;
    }
    
    .answer-phonetic {
        font-size: 1rem;
    }
    
    .answer-meaning {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .answer-example {
        padding: 12px 14px;
    }
    
    .answer-example .example-en {
        font-size: 0.95rem;
    }
    
    .answer-example .example-zh {
        font-size: 0.9rem;
    }
    
    .answer-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .answer-actions button {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    .btn-exit {
        margin-top: 16px;
        padding: 10px 24px;
        font-size: 0.9rem;
    }
    
    /* 测试结果 */
    .result-section {
        padding: 20px 14px;
        margin: 0 4px;
    }
    
    .result-section h2 {
        font-size: 1.15rem;
        margin-bottom: 24px;
    }
    
    .result-circle {
        width: 120px;
        height: 120px;
    }
    
    .result-percent {
        font-size: 1.8rem;
    }
    
    .result-details {
        text-align: center;
    }
    
    .result-row {
        justify-content: center;
        gap: 12px;
    }
    
    .result-actions {
        gap: 10px;
    }
    
    .result-actions button {
        width: 100%;
    }

    /* 语句练习页面 */
    .sentence-chinese {
        font-size: 1.1rem;
    }

    .sentence-word-input {
        width: 55px;
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .word-input-wrapper {
        gap: 2px;
    }

    .sentence-content {
        padding: 12px;
        margin-bottom: 24px;
    }

    .practice-progress {
        gap: 12px;
        margin-bottom: 16px;
    }

    /* 答案显示区域 */
    .answer-display {
        padding: 12px;
    }

    .answer-word {
        padding: 5px 10px;
        font-size: 0.9rem;
    }

    /* 错题本页面完整适配 */
    .wrongbook-tabs {
        gap: 4px;
        margin-bottom: 16px;
    }

    .wrongbook-tabs .tab-btn {
        padding: 10px 16px;
        font-size: 0.95rem;
    }

    .wrong-sentence-item {
        padding: 12px;
    }

    .wrong-sentence-item .english {
        font-size: 0.95rem;
    }

    .wrong-sentence-item .chinese {
        font-size: 0.85rem;
    }

    .wrong-sentence-item .sentence-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    #page-wrongbook h2 {
        font-size: 1.3rem;
        text-align: center;
        margin-bottom: 16px;
    }
    
    .wrongbook-stats {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .wrongbook-stats .stat-card {
        min-width: 100%;
        flex-direction: row;
        text-align: left;
        padding: 16px;
        gap: 12px;
    }
    
    .wrongbook-stats .stat-icon {
        font-size: 1.8rem;
    }
    
    .wrongbook-stats .stat-value {
        font-size: 1.4rem;
    }
    
    .wrongbook-stats .stat-desc {
        font-size: 0.85rem;
    }
    
    .mastery-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
        margin-bottom: 16px;
        font-size: 0.8rem;
    }
    
    .legend-title {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }
    
    .legend-item {
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .legend-badge {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .legend-note {
        margin-left: 0;
        font-size: 0.75rem;
        margin-top: 4px;
    }
    
    .wrongbook-actions {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 16px;
    }
    
    .wrongbook-actions .btn-primary,
    .wrongbook-actions .btn-secondary {
        min-width: 100%;
        width: 100%;
        padding: 14px 16px;
        font-size: 0.95rem;
        border-radius: var(--radius-md);
    }
    
    .wrongbook-list-section {
        padding: 14px;
        margin-bottom: 14px;
        border-radius: var(--radius-md);
    }
    
    .wrongbook-list-section h3 {
        font-size: 1.05rem;
        margin-bottom: 14px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .wrongbook-words {
        max-height: 400px;
        padding-right: 4px;
    }
    
    .wrongbook-word-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
        border-radius: 10px;
    }
    
    .wrongbook-word-item .word-main {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .wrongbook-word-item .word-header {
        display: flex;
        align-items: baseline;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .wrongbook-word-item .word-text {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--text-primary);
    }
    
    .wrongbook-word-item .word-phonetic {
        font-size: 0.85rem;
        color: var(--text-secondary);
        font-family: var(--font-mono);
    }
    
    .wrongbook-word-item .word-meaning {
        font-size: 0.95rem;
        color: var(--text-primary);
        line-height: 1.4;
    }
    
    .wrongbook-word-item .wrongbook-example {
        font-size: 0.85rem;
        color: var(--text-secondary);
        line-height: 1.5;
        padding: 8px 10px;
        background: rgba(0, 0, 0, 0.02);
        border-radius: 6px;
        border-left: 3px solid var(--primary-light);
        margin-top: 4px;
    }
    
    .wrongbook-word-item .wrongbook-example::before {
        content: "例句：";
        font-weight: 500;
        color: var(--primary-color);
    }
    
    .wrongbook-word-item .wrongbook-memory-tip {
        font-size: 0.8rem;
        color: #E67E22;
        background: #FFF8F0;
        padding: 8px 10px;
        border-radius: 6px;
        border-left: 3px solid #E67E22;
        margin-top: 6px;
        line-height: 1.4;
    }
    
    .wrongbook-word-item .word-actions {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px dashed var(--border-color);
    }
    
    .wrongbook-word-item .action-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .wrongbook-word-item .mastery-badge {
        font-size: 0.75rem;
        padding: 4px 10px;
        border-radius: 10px;
        font-weight: 500;
    }
    
    .wrongbook-word-item .audio-btn,
    .wrongbook-word-item .remove-btn {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        font-size: 1rem;
        flex-shrink: 0;
    }

    /* 错词卡片布局响应式 */
    .wrongbook-word-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .wrongbook-word-card {
        padding: 14px;
    }

    .wrongbook-word-card .word-text {
        font-size: 1.1rem;
    }

    .wrongbook-word-card .word-phonetic {
        font-size: 0.85rem;
    }

    .wrongbook-word-card .word-meaning {
        font-size: 0.95rem;
    }

    .wrongbook-pagination {
        flex-wrap: wrap;
        gap: 6px;
    }

    .page-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .page-info {
        padding: 6px 12px;
        font-size: 0.85rem;
        order: -1;
        width: 100%;
        text-align: center;
    }

    /* 错句卡片响应式 */
    .wrongsentence-card-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .wrongsentence-card {
        padding: 14px;
    }

    .sentence-english {
        font-size: 0.95rem;
    }

    .sentence-chinese {
        font-size: 0.85rem;
    }

    /* 错题本页面完整适配 */
    .wrongbook-tabs {
        gap: 2px;
        margin-bottom: 14px;
    }

    .wrongbook-tabs .tab-btn {
        padding: 8px 14px;
        font-size: 0.9rem;
    }

    .wrong-sentence-item {
        padding: 10px;
    }

    .wrong-sentence-item .english {
        font-size: 0.9rem;
    }

    .wrong-sentence-item .chinese {
        font-size: 0.8rem;
    }

    .wrong-sentence-item .sentence-meta {
        font-size: 0.8rem;
    }

    #page-wrongbook h2 {
        font-size: 1.2rem;
        margin-bottom: 14px;
    }
    
    .wrongbook-stats {
        gap: 10px;
        margin-bottom: 16px;
    }
    
    .wrongbook-stats .stat-card {
        padding: 14px;
        gap: 10px;
    }
    
    .wrongbook-stats .stat-icon {
        font-size: 1.6rem;
    }
    
    .wrongbook-stats .stat-value {
        font-size: 1.3rem;
    }
    
    .wrongbook-stats .stat-desc {
        font-size: 0.8rem;
    }
    
    .mastery-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 12px;
        font-size: 0.75rem;
    }
    
    .legend-title {
        font-size: 0.8rem;
        margin-bottom: 2px;
    }
    
    .legend-item {
        gap: 4px;
        flex-wrap: wrap;
    }
    
    .legend-badge {
        padding: 3px 6px;
        font-size: 0.7rem;
    }
    
    .legend-note {
        margin-left: 0;
        font-size: 0.7rem;
        margin-top: 2px;
    }
    
    .wrongbook-actions {
        gap: 8px;
        margin-bottom: 14px;
    }
    
    .wrongbook-actions .btn-primary,
    .wrongbook-actions .btn-secondary {
        padding: 12px 16px;
        font-size: 0.9rem;
        border-radius: var(--radius-sm);
    }
    
    .wrongbook-list-section {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: var(--radius-sm);
    }
    
    .wrongbook-list-section h3 {
        font-size: 0.95rem;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .wrongbook-words {
        max-height: 320px;
        padding-right: 4px;
    }
    
    .wrongbook-word-item {
        padding: 10px;
        gap: 8px;
    }
    
    .wrongbook-word-item .word-text {
        font-size: 1rem;
    }
    
    .wrongbook-word-item .word-phonetic {
        font-size: 0.8rem;
    }
    
    .wrongbook-word-item .word-meaning {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .wrongbook-word-item .wrongbook-example {
        font-size: 0.8rem;
        padding: 6px 8px;
    }
    
    .wrongbook-word-item .wrongbook-memory-tip {
        font-size: 0.75rem;
        padding: 6px 8px;
    }
    
    .wrongbook-word-item .word-actions {
        gap: 8px;
        margin-top: 6px;
        padding-top: 6px;
    }
    
    .wrongbook-word-item .audio-btn,
    .wrongbook-word-item .remove-btn {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
    
    /* 学习进度 */
    .overall-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        flex-direction: row;
        text-align: left;
        gap: 12px;
    }
    
    .stat-icon {
        font-size: 1.8rem;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    /* 单元进度 */
    .unit-progress-section,
    .wrong-words-section {
        padding: 16px 12px;
    }
    
    .unit-progress-item {
        padding: 12px 0;
    }
    
    /* 错词列表 */
    .wrong-words-list {
        max-height: 300px;
    }
    
    .wrong-word-item {
        padding: 12px;
    }
    
    /* 收藏页面完整适配 */
    #page-favorites .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }
    
    #page-favorites .page-header h2 {
        font-size: 1.3rem;
        margin: 0;
    }
    
    .favorites-stats {
        width: 100%;
    }
    
    .stat-badge {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .favorites-list {
        gap: 10px;
        padding: 0 4px;
    }
    
    /* 按钮 */
    .btn-primary,
    .btn-secondary {
        padding: 10px 20px;
        font-size: 0.9rem;
        border-radius: var(--radius-md);
    }
    
    .btn-large {
        padding: 14px 28px;
        font-size: 1rem;
    }
    
    /* 收藏页面完整适配 */
    #page-favorites .page-header {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        padding: 20px;
    }
    
    #page-favorites .page-header h2 {
        font-size: 1.4rem;
        margin: 0;
    }
    
    .favorites-stats {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    
    .stat-badge {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .favorites-list {
        gap: 12px;
        padding: 0 8px;
    }
    
    /* 底部 */
    .footer {
        padding: 14px 10px;
        font-size: 0.75rem;
    }

    /* 错题本页面完整适配 */
    .wrongbook-tabs {
        gap: 0;
        margin-bottom: 12px;
    }

    .wrongbook-tabs .tab-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        flex: 1;
    }

    .wrong-sentence-item {
        padding: 8px;
    }

    .wrong-sentence-item .english {
        font-size: 0.85rem;
    }

    .wrong-sentence-item .chinese {
        font-size: 0.75rem;
    }

    .wrong-sentence-item .sentence-meta {
        font-size: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    #page-wrongbook h2 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .wrongbook-stats {
        gap: 8px;
        margin-bottom: 14px;
    }
    
    .wrongbook-stats .stat-card {
        padding: 12px;
        gap: 8px;
    }
    
    .wrongbook-stats .stat-icon {
        font-size: 1.4rem;
    }
    
    .wrongbook-stats .stat-value {
        font-size: 1.2rem;
    }
    
    .wrongbook-stats .stat-desc {
        font-size: 0.75rem;
    }
    
    .mastery-legend {
        gap: 8px;
        padding: 10px;
        font-size: 0.75rem;
    }
    
    .legend-title {
        font-size: 0.8rem;
    }
    
    .legend-item {
        gap: 4px;
    }
    
    .legend-badge {
        padding: 2px 5px;
        font-size: 0.7rem;
    }
    
    .legend-note {
        font-size: 0.7rem;
    }
    
    .wrongbook-actions {
        gap: 8px;
        margin-bottom: 14px;
    }
    
    .wrongbook-actions .btn-primary,
    .wrongbook-actions .btn-secondary {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .wrongbook-list-section {
        padding: 12px;
    }
    
    .wrongbook-list-section h3 {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }
    
    .wrongbook-words {
        max-height: 300px;
    }
    
    .wrongbook-word-item {
        padding: 10px;
        gap: 8px;
    }
    
    .wrongbook-word-item .word-main {
        gap: 6px;
    }
    
    .wrongbook-word-item .word-text {
        font-size: 0.9rem;
    }
    
    .wrongbook-word-item .word-phonetic {
        font-size: 0.75rem;
    }
    
    .wrongbook-word-item .word-meaning {
        font-size: 0.8rem;
    }
    
    .wrongbook-word-item .wrongbook-example {
        font-size: 0.75rem;
        margin-top: 4px;
    }
    
    .wrongbook-word-item .wrongbook-memory-tip {
        font-size: 0.7rem;
        padding: 4px 6px;
        margin-top: 4px;
    }
    
    .wrongbook-word-item .word-actions {
        gap: 6px;
    }
    
    .wrongbook-word-item .mastery-badge {
        font-size: 0.65rem;
        padding: 2px 5px;
    }
    
    .wrongbook-word-item .audio-btn,
    .wrongbook-word-item .remove-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

/* 小屏幕手机 (360px 以下) */
@media (max-width: 360px) {
    .nav-btn {
        padding: 4px 6px;
        font-size: 0.65rem;
    }
    
    .hero-section h2 {
        font-size: 0.95rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-item {
        padding: 10px 6px;
    }
    
    .stat-number {
        font-size: 1.2rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }

    /* 语句练习页面 */
    .sentence-word-input {
        width: 45px;
        padding: 6px 8px;
        font-size: 0.85rem;
    }

    .sentence-inputs {
        gap: 6px;
    }

    .sentence-chinese {
        font-size: 1rem;
    }

    /* 答案显示区域 */
    .answer-display {
        padding: 10px;
    }

    .answer-word {
        padding: 4px 8px;
        font-size: 0.85rem;
    }

    /* 错题本页面完整适配 */
    .wrongbook-tabs {
        margin-bottom: 10px;
    }

    .wrongbook-tabs .tab-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .wrong-sentence-item {
        padding: 6px;
    }

    .wrong-sentence-item .english {
        font-size: 0.8rem;
    }

    .wrong-sentence-item .chinese {
        font-size: 0.7rem;
    }

    #page-wrongbook h2 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .wrongbook-stats {
        gap: 6px;
        margin-bottom: 12px;
    }
    
    .wrongbook-stats .stat-card {
        padding: 10px;
        gap: 6px;
    }
    
    .wrongbook-stats .stat-icon {
        font-size: 1.2rem;
    }
    
    .wrongbook-stats .stat-value {
        font-size: 1.1rem;
    }
    
    .wrongbook-stats .stat-desc {
        font-size: 0.7rem;
    }
    
    .mastery-legend {
        gap: 6px;
        padding: 8px;
        font-size: 0.7rem;
        flex-direction: column;
    }
    
    .legend-title {
        font-size: 0.7rem;
        margin-bottom: 2px;
    }
    
    .legend-item {
        gap: 2px;
        flex-wrap: wrap;
    }
    
    .legend-badge {
        padding: 2px 4px;
        font-size: 0.6rem;
    }
    
    .legend-note {
        margin-left: 0;
        font-size: 0.6rem;
        margin-top: 2px;
    }
    
    .wrongbook-actions {
        gap: 6px;
        margin-bottom: 10px;
    }
    
    .wrongbook-actions .btn-primary,
    .wrongbook-actions .btn-secondary {
        padding: 10px 12px;
        font-size: 0.8rem;
        border-radius: var(--radius-sm);
    }
    
    .wrongbook-list-section {
        padding: 8px;
        margin-bottom: 10px;
        border-radius: var(--radius-sm);
    }
    
    .wrongbook-list-section h3 {
        font-size: 0.85rem;
        margin-bottom: 8px;
        padding-bottom: 6px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .wrongbook-words {
        max-height: 220px;
        padding-right: 2px;
    }
    
    .wrongbook-word-item {
        padding: 8px;
        gap: 6px;
    }
    
    .wrongbook-word-item .word-header {
        gap: 6px;
    }
    
    .wrongbook-word-item .word-text {
        font-size: 0.9rem;
        font-weight: 600;
    }
    
    .wrongbook-word-item .word-phonetic {
        font-size: 0.7rem;
    }
    
    .wrongbook-word-item .word-meaning {
        font-size: 0.75rem;
    }
    
    .wrongbook-word-item .wrongbook-example {
        font-size: 0.7rem;
        padding: 6px 8px;
        margin-top: 4px;
    }
    
    .wrongbook-word-item .wrongbook-memory-tip {
        font-size: 0.65rem;
        padding: 5px 8px;
        margin-top: 4px;
    }
    
    .wrongbook-word-item .word-actions {
        gap: 6px;
        margin-top: 6px;
        padding-top: 6px;
    }
    
    .wrongbook-word-item .mastery-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
    }
    
    .wrongbook-word-item .audio-btn,
    .wrongbook-word-item .remove-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    /* 错词卡片布局移动端适配 */
    .wrongbook-pagination-info {
        font-size: 0.8rem;
        padding: 10px;
    }

    .wrongbook-word-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .wrongbook-word-card {
        padding: 12px;
    }

    .word-card-header {
        padding-bottom: 6px;
        margin-bottom: 8px;
    }

    .word-index {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .wrongbook-word-card .word-text {
        font-size: 1rem;
    }

    .wrongbook-word-card .word-phonetic {
        font-size: 0.8rem;
    }

    .wrongbook-word-card .word-meaning {
        font-size: 0.9rem;
    }

    .word-card-example {
        padding: 8px;
    }

    .word-card-example .example-label {
        font-size: 0.8rem;
    }

    .word-card-example .example-content {
        font-size: 0.85rem;
    }

    .word-card-example .example-translation {
        font-size: 0.8rem;
    }

    .word-card-tip {
        font-size: 0.8rem;
        padding: 6px 8px;
    }

    .wrongbook-pagination {
        margin-top: 16px;
        padding-top: 12px;
        gap: 4px;
    }

    .page-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .page-info {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    /* 错句卡片移动端适配 */
    .wrongsentence-pagination-info {
        font-size: 0.8rem;
        padding: 10px;
    }

    .wrongsentence-card-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .wrongsentence-card {
        padding: 12px;
    }

    .sentence-index {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .sentence-english {
        font-size: 0.9rem;
    }

    .sentence-chinese {
        font-size: 0.8rem;
        padding-left: 10px;
    }

    .reading-badge {
        font-size: 0.75rem;
        padding: 3px 8px;
    }

    /* 闪卡答案页面完整适配 */
    .flashcard-back {
        padding: 12px 10px;
    }
    
    .answer-source {
        font-size: 0.65rem;
        padding: 6px 8px;
        gap: 8px;
        margin-bottom: 8px;
        width: 100%;
    }
    
    .answer-source .source-item {
        gap: 4px;
    }
    
    .answer-source .source-label {
        font-size: 0.6rem;
    }
    
    .answer-source .source-value {
        font-size: 0.7rem;
    }
    
    .answer-word {
        font-size: 1.2rem;
        gap: 4px;
        margin-bottom: 2px;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .speak-hint {
        font-size: 0.9rem;
    }
    
    .answer-phonetic-wrapper {
        gap: 4px;
        margin-bottom: 6px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .answer-phonetic {
        font-size: 0.75rem;
        width: 100%;
        text-align: center;
        margin-bottom: 2px;
    }
    
    .phonetic-audio-btn {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
    
    .answer-meaning {
        font-size: 1rem;
        margin-bottom: 8px;
        width: 100%;
        text-align: center;
    }
    
    .answer-example {
        padding: 8px 10px;
        margin-bottom: 8px;
        width: 100%;
    }
    
    .answer-example .example-en {
        font-size: 0.8rem;
        margin-bottom: 4px;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .answer-example .example-zh {
        font-size: 0.75rem;
    }
    
    .answer-example .audio-btn.small {
        width: 22px;
        height: 22px;
        font-size: 0.65rem;
        flex-shrink: 0;
    }
    
    .answer-tip {
        font-size: 0.7rem;
        padding: 6px 8px;
        margin-bottom: 8px;
        width: 100%;
    }
    
    .answer-actions {
        gap: 4px;
        width: 100%;
        justify-content: center;
    }
    
    .answer-actions button {
        width: 100%;
        padding: 8px 10px;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .btn-icon {
        font-size: 0.9rem;
    }
    
    .btn-exit {
        margin-top: 10px;
        padding: 6px 12px;
        font-size: 0.75rem;
        width: 100%;
    }
    
    /* 闪卡 */
    .flashcard {
        min-height: 320px;
    }

    .flashcard-inner {
        min-height: 320px;
    }

    .flashcard-front,
    .flashcard-back {
        min-height: 320px;
        padding: 16px 12px;
    }

    .question-text {
        font-size: 1.2rem;
    }
    
    .question-label {
        font-size: 0.7rem;
        margin-bottom: 8px;
    }
    
    .btn-reveal {
        padding: 8px 20px;
        font-size: 0.85rem;
        margin-top: 12px;
    }
    
    /* 服务错误提示 */
    .error-content {
        padding: 32px 24px;
        margin: 20px;
    }
    
    .error-icon {
        font-size: 3rem;
    }
    
    .error-content h2 {
        font-size: 1.3rem;
    }
    
    /* 收藏页面完整适配 (360px) */
    #page-favorites .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }
    
    #page-favorites .page-header h2 {
        font-size: 1.2rem;
        margin: 0;
    }
    
    .favorites-stats {
        width: 100%;
    }
    
    .stat-badge {
        width: 100%;
        justify-content: center;
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .favorites-list {
        gap: 8px;
        padding: 0 2px;
    }
}

/* 阅读进度样式 */
.reading-progress-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.reading-progress-section h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

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

.reading-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    text-align: center;
}

.reading-stat-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.reading-stat-info {
    display: flex;
    flex-direction: column;
}

.reading-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.reading-stat-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .reading-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .reading-stat-card {
        padding: 12px;
    }
    
    .reading-stat-icon {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }
    
    .reading-stat-value {
        font-size: 1.2rem;
    }
    
    .reading-stat-desc {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .reading-progress-section {
        padding: 16px;
    }
    
    .reading-progress-section h3 {
        font-size: 1rem;
        margin-bottom: 16px;
    }
    
    .reading-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .reading-stat-card {
        flex-direction: row;
        justify-content: flex-start;
        padding: 12px 16px;
        text-align: left;
    }
    
    .reading-stat-icon {
        font-size: 1.5rem;
        margin-bottom: 0;
        margin-right: 12px;
    }
    
    .reading-stat-info {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    .reading-stat-value {
        font-size: 1.2rem;
    }
    
    .reading-stat-desc {
        margin-top: 0;
        font-size: 0.85rem;
    }
}

/* 工具页面样式 */
#page-tool .page-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

#page-tool .page-header h1 {
    font-size: 1.8rem;
    margin: 0;
}

#page-tool .page-subtitle {
    color: var(--text-white);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

#page-tool .upload-text {
    color: #333;
    font-size: 16px;
}

#page-tool .upload-hint {
    color: #666;
    font-size: 12px;
    margin-top: 10px;
}

.tool-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.tool-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    border-bottom: 2px solid #eee;
    padding-bottom: 12px;
}

.tool-tab {
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: 1rem;
    color: #666;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.tool-tab:hover {
    background: #f5f5f5;
}

.tool-tab.active {
    background: #667eea;
    color: white;
}

.tool-content {
    display: none;
}

.tool-content.active {
    display: block;
}

#page-tool .upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

#page-tool .upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

#page-tool .upload-area.reading {
    border-color: #27ae60;
}

#page-tool .upload-area.reading:hover {
    background: #e8f8f0;
}

#page-tool .upload-area.json {
    border-color: #e67e22;
    background: #fff8f0;
}

#page-tool .upload-area.json:hover {
    border-color: #d35400;
    background: #ffeadd;
}

#page-tool .upload-area.json.reading {
    border-color: #27ae60;
    background: #e8f8f0;
}

#page-tool .upload-area.json.reading:hover {
    border-color: #1e8449;
    background: #d5f5e3;
}

#page-tool .upload-section {
    margin-bottom: 30px;
}

#page-tool .upload-section:last-child {
    margin-bottom: 0;
}

#page-tool .upload-section h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#page-tool .format-help {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

#page-tool .format-help h4 {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#page-tool .format-example {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
}

#page-tool .format-example pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #f8f8f2;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#page-tool .upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

#page-tool .upload-text {
    color: #666;
    font-size: 16px;
}

#page-tool .upload-hint {
    color: #999;
    font-size: 12px;
    margin-top: 10px;
}

#page-tool .file-info {
    padding: 15px;
    background: #e7f3ff;
    border-radius: 8px;
    margin-bottom: 20px;
}

#page-tool .file-name {
    font-weight: bold;
    color: #667eea;
}

#page-tool .file-name.reading {
    color: #27ae60;
}

#page-tool .file-size {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

#page-tool .preview {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

#page-tool .preview-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

#page-tool .wordbook-list,
#page-tool .reading-list {
    list-style: none;
}

#page-tool .wordbook-item,
#page-tool .reading-item {
    padding: 10px;
    margin: 5px 0;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

#page-tool .reading-item {
    border-left-color: #27ae60;
}

#page-tool .unit-list {
    margin-left: 20px;
    margin-top: 10px;
}

#page-tool .unit-item {
    padding: 8px;
    margin: 3px 0;
    background: #f0f2ff;
    border-radius: 4px;
    font-size: 14px;
}

#page-tool .actions {
    margin-top: 20px;
}

#page-tool .actions.show {
    display: block;
}

#page-tool .status {
    margin: 20px 0;
    padding: 20px;
    border-radius: 8px;
    display: none;
}

#page-tool .status.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

#page-tool .status.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

/* 工具页面移动端适配 */
@media (max-width: 768px) {
    #page-tool .tool-container {
        padding: 16px;
    }
    
    #page-tool .page-header h1 {
        font-size: 1.5rem;
    }
    
    #page-tool .upload-area {
        padding: 30px 20px;
    }
    
    #page-tool .upload-icon {
        font-size: 36px;
    }
    
    #page-tool .tool-tabs {
        gap: 8px;
    }
    
    #page-tool .tool-tab {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    #page-tool .format-help {
        padding: 16px;
    }
    
    #page-tool .format-help h4 {
        font-size: 0.9rem;
    }
    
    #page-tool .format-example {
        padding: 12px;
    }
    
    #page-tool .format-example pre {
        font-size: 11px;
    }
}

/* 工具页面移动端适配 - 平板 */
@media (max-width: 768px) {
    #page-tool .tool-container {
        padding: 16px;
        border-radius: 12px;
    }
    
    #page-tool .page-header {
        gap: 6px;
    }
    
    #page-tool .page-header h1 {
        font-size: 1.5rem;
    }
    
    #page-tool .page-subtitle {
        font-size: 0.9rem;
    }
    
    #page-tool .upload-area {
        padding: 24px 16px;
        margin-bottom: 16px;
    }
    
    #page-tool .upload-icon {
        font-size: 32px;
    }
    
    #page-tool .upload-text {
        font-size: 14px;
    }
    
    #page-tool .upload-hint {
        font-size: 11px;
        margin-top: 6px;
    }
    
    #page-tool .upload-section {
        margin-bottom: 20px;
    }
    
    #page-tool .upload-section h3 {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
    
    .tool-tabs {
        gap: 8px;
        margin-bottom: 16px;
        padding-bottom: 10px;
    }
    
    #page-tool .tool-tab {
        padding: 8px 14px;
        font-size: 0.9rem;
        border-radius: 6px;
    }
    
    #page-tool .format-help {
        padding: 14px;
        margin-bottom: 16px;
        border-radius: 10px;
    }
    
    #page-tool .format-help h4 {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    #page-tool .format-example {
        padding: 12px;
        border-radius: 6px;
    }
    
    #page-tool .format-example pre {
        font-size: 11px;
        line-height: 1.5;
    }
    
    #page-tool .file-info {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    #page-tool .preview {
        padding: 14px;
        margin: 16px 0;
        max-height: 250px;
    }
    
    #page-tool .preview-title {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    #page-tool .wordbook-item,
    #page-tool .reading-item {
        padding: 8px;
    }
    
    #page-tool .unit-list {
        margin-left: 12px;
        margin-top: 6px;
    }
    
    #page-tool .unit-item {
        padding: 6px;
        font-size: 12px;
    }
    
    #page-tool .actions {
        margin-top: 16px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    #page-tool .actions.show {
        display: flex;
    }
    
    #page-tool .btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    #page-tool .status {
        padding: 14px;
        margin: 16px 0;
        font-size: 0.85rem;
    }
}

/* 工具页面移动端适配 - 手机 */
@media (max-width: 480px) {
    #page-tool .tool-container {
        padding: 12px;
        border-radius: 10px;
    }
    
    #page-tool .page-header h1 {
        font-size: 1.25rem;
    }
    
    #page-tool .page-subtitle {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    #page-tool .upload-area {
        padding: 20px 12px;
        margin-bottom: 12px;
        border-radius: 8px;
    }
    
    #page-tool .upload-icon {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    #page-tool .upload-text {
        font-size: 13px;
    }
    
    #page-tool .upload-hint {
        font-size: 10px;
    }
    
    #page-tool .upload-section {
        margin-bottom: 16px;
    }
    
    #page-tool .upload-section h3 {
        font-size: 0.85rem;
        margin-bottom: 8px;
        gap: 6px;
    }
    
    .tool-tabs {
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 14px;
        padding-bottom: 8px;
    }
    
    #page-tool .tool-tab {
        padding: 8px 10px;
        font-size: 0.8rem;
        border-radius: 6px;
        flex: 1 1 45%;
    }
    
    #page-tool .format-help {
        padding: 12px;
        margin-bottom: 14px;
        border-radius: 8px;
    }
    
    #page-tool .format-help h4 {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    #page-tool .format-example {
        padding: 10px;
        border-radius: 6px;
    }
    
    #page-tool .format-example pre {
        font-size: 10px;
        line-height: 1.4;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
    
    #page-tool .file-info {
        padding: 10px;
        margin-bottom: 12px;
        border-radius: 6px;
    }
    
    #page-tool .file-name {
        font-size: 0.85rem;
    }
    
    #page-tool .file-size {
        font-size: 11px;
    }
    
    #page-tool .preview {
        padding: 12px;
        margin: 12px 0;
        max-height: 200px;
    }
    
    #page-tool .preview-title {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    #page-tool .wordbook-item,
    #page-tool .reading-item {
        padding: 8px;
        font-size: 0.85rem;
    }
    
    #page-tool .unit-list {
        margin-left: 10px;
        margin-top: 4px;
    }
    
    #page-tool .unit-item {
        padding: 4px 8px;
        font-size: 11px;
        border-radius: 4px;
    }
    
    #page-tool .actions {
        margin-top: 12px;
        gap: 6px;
    }
    
    #page-tool .actions.show {
        display: flex;
    }
    
    #page-tool .btn {
        width: 100%;
        padding: 10px 14px;
        font-size: 0.85rem;
        border-radius: 6px;
    }
    
    #page-tool .status {
        padding: 12px;
        margin: 12px 0;
        font-size: 0.8rem;
        border-radius: 6px;
    }
    
    #page-tool .status.success {
        background: #d4edda;
        padding: 10px 12px;
    }
    
    #page-tool .status.error {
        background: #f8d7da;
        padding: 10px 12px;
    }

    /* 听写页面 - 小屏幕手机 */
    .dictation-word {
        font-size: 1.6rem;
    }

    .dictation-word-info {
        text-align: center;
    }

    .dictation-content {
        padding: 12px;
        gap: 10px;
    }

    .dictation-content .audio-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        margin: 0 auto;
    }

    .dictation-input {
        padding: 10px 12px;
        font-size: 1.1rem;
    }

    .dictation-content {
        padding: 16px 12px;
    }
}

/* 工具页面移动端适配 - 小屏手机 */
@media (max-width: 360px) {
    #page-tool .tool-container {
        padding: 10px;
        border-radius: 8px;
    }
    
    #page-tool .page-header h1 {
        font-size: 1.1rem;
    }
    
    #page-tool .page-subtitle {
        font-size: 0.8rem;
    }
    
    #page-tool .upload-area {
        padding: 16px 10px;
        margin-bottom: 10px;
    }
    
    #page-tool .upload-icon {
        font-size: 24px;
    }
    
    #page-tool .upload-text {
        font-size: 12px;
    }
    
    #page-tool .upload-hint {
        font-size: 9px;
    }
    
    #page-tool .upload-section h3 {
        font-size: 0.8rem;
    }
    
    #page-tool .tool-tab {
        padding: 6px 8px;
        font-size: 0.75rem;
        flex: 1 1 45%;
    }
    
    #page-tool .format-help {
        padding: 10px;
    }
    
    #page-tool .format-help h4 {
        font-size: 0.8rem;
    }
    
    #page-tool .format-example {
        padding: 8px;
    }
    
    #page-tool .format-example pre {
        font-size: 9px;
    }
    
    #page-tool .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}



