/* ============================================================
   css/mobile/framework.css - 手机端基础样式
   ============================================================ */

/* ===== 基础重置 & 全局 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: #eef2ff;
    min-height: 100vh;
    color: #1a1a2e;
    padding-bottom: 20px;
}

/* ===== 顶部导航栏 ===== */
.header {
    background: #eef2ff;
    padding: 14px 20px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    cursor: pointer;
    user-select: none;
    padding: 4px 8px;
    border-radius: 10px;
    transition: background 0.15s;
}
.header .brand:active {
    background: rgba(0, 0, 0, 0.04);
}
.header .brand .logo-icon {
    color: #4f6ef7;
    font-size: 26px;
}
.header .brand .brand-name {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a2e;
}

.header .right-group {
    display: flex;
    align-items: center;
    gap: 14px;
}
.header .user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
    min-height: 44px;
}
.header .user-info .user-name {
    font-size: 16px;
    font-weight: 700;
    color: #4f6ef7;
    text-align: center;
    white-space: nowrap;
}
.header .user-info .user-role {
    font-size: 9px;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 2px;
    text-align: center;
    white-space: nowrap;
}
.header .icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    color: #64748b;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
    flex-shrink: 0;
}
.header .icon-btn:active {
    transform: scale(0.88);
    background: rgba(0, 0, 0, 0.08);
}
.header .icon-btn.parent-mode {
    color: #8b5cf6;
}
.header .icon-btn.logout {
    color: #ef4444;
}

/* ===== 页面容器 ===== */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
    padding-bottom: 20px;
}
.page.active {
    display: block;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #4f6ef7;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    margin: 4px 0 12px;
    transition: opacity 0.15s;
}
.back-btn:active {
    opacity: 0.6;
}

/* ===== 首页样式 ===== */
.home-page { padding: 0 20px; }

.dashboard-card {
    background: white;
    margin: 12px 0 16px;
    border-radius: 20px;
    padding: 18px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.02);
    cursor: pointer;
    transition: 0.15s;
}
.dashboard-card:active { transform: scale(0.98); }
.dashboard-card .dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.dashboard-card .dash-header .title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}
.dashboard-card .dash-header .title i {
    color: #4f6ef7;
    margin-right: 6px;
}
.dashboard-card .dash-header .arrow {
    color: #94a3b8;
    font-size: 14px;
}
.dashboard-card .dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 6px;
}
.dashboard-card .dash-grid:first-child { margin-bottom: 6px; }
.dashboard-card .dash-grid .dash-item {
    text-align: center;
    padding: 6px 2px;
    border-radius: 10px;
    background: #f8fafc;
}
.dashboard-card .dash-grid .dash-item .num {
    font-size: 20px;
    font-weight: 700;
}
.dashboard-card .dash-grid .dash-item .num.orange { color: #f97316; }
.dashboard-card .dash-grid .dash-item .num.blue { color: #4f6ef7; }
.dashboard-card .dash-grid .dash-item .num.red { color: #ef4444; }
.dashboard-card .dash-grid .dash-item .num.green { color: #22c55e; }
.dashboard-card .dash-grid .dash-item .num.purple { color: #8b5cf6; }
.dashboard-card .dash-grid .dash-item .num.gold { color: #f59e0b; }
.dashboard-card .dash-grid .dash-item .num.teal { color: #14b8a6; }
.dashboard-card .dash-grid .dash-item .label {
    font-size: 9px;
    color: #94a3b8;
    margin-top: 1px;
}

/* ===== 积分卡片 ===== */
.points-card {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    margin: 0 0 16px;
    border-radius: 20px;
    padding: 16px 20px;
    border: 1px solid #fcd34d;
    cursor: pointer;
    transition: 0.15s;
}
.points-card:active { transform: scale(0.98); }
.points-card .points-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.points-card .points-header .title {
    font-size: 15px;
    font-weight: 600;
    color: #92400e;
}
.points-card .points-header .title i {
    color: #f59e0b;
    margin-right: 6px;
}
.points-card .points-header .arrow {
    color: #92400e;
    font-size: 14px;
    opacity: 0.6;
}
.points-card .points-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}
.points-card .points-body .point-item {
    text-align: center;
    background: rgba(255,255,255,0.6);
    border-radius: 12px;
    padding: 8px 4px;
    backdrop-filter: blur(4px);
}
.points-card .points-body .point-item .num {
    font-size: 22px;
    font-weight: 700;
    color: #92400e;
}
.points-card .points-body .point-item .label {
    font-size: 10px;
    color: #92400e;
    opacity: 0.7;
    margin-top: 1px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.grid-4 .item {
    background: white;
    border-radius: 14px;
    padding: 14px 2px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.02);
    cursor: pointer;
    transition: 0.15s;
}
.grid-4 .item:active { transform: scale(0.94); }
.grid-4 .item .icon { font-size: 24px; display: block; margin-bottom: 2px; }
.grid-4 .item .label { font-size: 11px; font-weight: 600; color: #1a1a2e; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}
.grid-2 .item {
    background: white;
    border-radius: 14px;
    padding: 14px 2px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.02);
    cursor: pointer;
    transition: 0.15s;
}
.grid-2 .item:active { transform: scale(0.94); }
.grid-2 .item .icon { font-size: 22px; display: block; margin-bottom: 2px; }
.grid-2 .item .label { font-size: 12px; font-weight: 600; color: #1a1a2e; }

.game-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    margin-top: 4px;
}
.game-section-header h3 { font-size: 16px; font-weight: 600; color: #1a1a2e; }
.game-section-header .game-count {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 20px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.game-grid .game-item {
    background: white;
    border-radius: 14px;
    padding: 12px 2px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.02);
    cursor: pointer;
    transition: 0.15s;
}
.game-grid .game-item:active { transform: scale(0.94); }
.game-grid .game-item .icon { font-size: 26px; display: block; margin-bottom: 2px; }
.game-grid .game-item .label { font-size: 9px; font-weight: 500; color: #1a1a2e; line-height: 1.2; }

/* ===== 词库统计 ===== */
.library-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    margin-top: 8px;
}
.library-section-header h3 { font-size: 16px; font-weight: 600; color: #1a1a2e; }
.library-section-header .library-count {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 20px;
}
.library-card {
    background: white;
    margin: 0 0 16px;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.02);
}
.library-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.library-stats .lib-item {
    text-align: center;
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 4px;
}
.library-stats .lib-item .num { font-size: 26px; font-weight: 700; color: #4f6ef7; }
.library-stats .lib-item .label { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.library-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: 4px;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
}
.library-status-grid .status-item {
    text-align: center;
    padding: 4px 2px;
    border-radius: 8px;
    background: #fafafa;
}
.library-status-grid .status-item .num {
    font-size: 15px;        /* 适当缩小，确保 3 位数字不溢出 */
    font-weight: 700;
    white-space: nowrap;    /* 强制不换行 */
}
.library-status-grid .status-item .num.gray { color: #9ca3af; }
.library-status-grid .status-item .num.blue { color: #4f6ef7; }
.library-status-grid .status-item .num.indigo { color: #6366f1; }
.library-status-grid .status-item .num.green { color: #22c55e; }
.library-status-grid .status-item .num.gold { color: #f59e0b; }
.library-status-grid .status-item .label { font-size: 8px; color: #94a3b8; margin-top: 1px; }

/* ===== 日读页面 ===== */
.dailyread-page { padding: 0 20px 20px; }

.theme-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 12px;
    margin-bottom: 4px;
}
.theme-scroll::-webkit-scrollbar { display: none; }
.theme-scroll .theme-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.theme-scroll .theme-btn:active { transform: scale(0.94); }
.theme-scroll .theme-btn.active {
    background: #4f6ef7;
    color: white;
    border-color: #4f6ef7;
}

.generate-btn-wrap { margin-bottom: 16px; }
.generate-btn-wrap .btn-gen {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #4f6ef7, #7c5cfc);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
    box-shadow: 0 4px 16px rgba(79,110,247,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.generate-btn-wrap .btn-gen:active { transform: scale(0.96); }
.generate-btn-wrap .btn-gen:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.generate-status {
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
    margin-top: 8px;
    min-height: 24px;
}

.history-list { margin-top: 4px; }
.history-item {
    background: white;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: 0.15s;
}
.history-item:active { transform: scale(0.97); background: #f8fafc; }
.history-item .info .title { font-size: 14px; font-weight: 600; color: #1a1a2e; }
.history-item .info .meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.history-item .info .meta .score { color: #22c55e; font-weight: 600; }
.history-item .action-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: none;
    background: #4f6ef7;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
}
.history-item .action-btn:active { transform: scale(0.92); }
.history-item .action-btn.secondary {
    background: #f1f5f9;
    color: #64748b;
}

/* ===== 错题页面 ===== */
.mistake-page { padding: 0 20px 20px; }

.filter-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 12px;
    margin-bottom: 4px;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-scroll .filter-btn {
    flex-shrink: 0;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.filter-scroll .filter-btn:active { transform: scale(0.94); }
.filter-scroll .filter-btn.active {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.mistake-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.mistake-summary .stat {
    background: white;
    border-radius: 14px;
    padding: 12px 4px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.02);
}
.mistake-summary .stat .num { font-size: 22px; font-weight: 700; }
.mistake-summary .stat .num.red { color: #ef4444; }
.mistake-summary .stat .num.orange { color: #f97316; }
.mistake-summary .stat .num.blue { color: #4f6ef7; }
.mistake-summary .stat .label { font-size: 10px; color: #94a3b8; margin-top: 2px; }

.mistake-main-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}
.mistake-main-actions .main-btn {
    padding: 12px 16px;
    border-radius: 14px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    user-select: none;
}
.mistake-main-actions .main-btn:active { transform: scale(0.96); }
.mistake-main-actions .main-btn.learn {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239,68,68,0.25);
}
.mistake-main-actions .main-btn.spell {
    background: #22c55e;
    color: white;
    box-shadow: 0 4px 12px rgba(34,197,94,0.25);
}

.mistake-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.mistake-actions .action-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}
.mistake-actions .action-btn:active { transform: scale(0.94); }

/* ===== 复习页面 ===== */
.review-page { padding: 0 20px 20px; }

.type-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.type-switch .type-btn {
    flex: 1;
    padding: 10px 6px;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    background: white;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    user-select: none;
}
.type-switch .type-btn:active { transform: scale(0.94); }
.type-switch .type-btn.active {
    border-color: #4f6ef7;
    background: #eff6ff;
    color: #1d4ed8;
}

.review-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.review-summary .stat {
    background: white;
    border-radius: 14px;
    padding: 12px 4px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.02);
}
.review-summary .stat .num { font-size: 22px; font-weight: 700; }
.review-summary .stat .num.blue { color: #4f6ef7; }
.review-summary .stat .num.green { color: #22c55e; }
.review-summary .stat .num.orange { color: #f97316; }
.review-summary .stat .label { font-size: 10px; color: #94a3b8; margin-top: 2px; }

.review-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.review-actions .action-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
    transition: 0.15s;
}
.review-actions .action-btn:active { transform: scale(0.94); }
.review-actions .action-btn.primary {
    background: #4f6ef7;
    color: white;
    border-color: #4f6ef7;
}

.word-list { margin-bottom: 16px; }

/* ===== 单词/错题列表项 ===== */
.word-item, .mistake-item {
    background: white;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}
.word-item:active, .mistake-item:active {
    transform: scale(0.98);
    background: #f8fafc;
}
.word-item .checkbox, .mistake-item .checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: transparent;
    transition: all 0.2s;
}
.word-item .checkbox.checked, .mistake-item .checkbox.checked {
    background: #4f6ef7;
    border-color: #4f6ef7;
    color: white;
}
.word-item .word-info, .mistake-item .word-info {
    flex: 1;
    min-width: 0;
}
.word-item .word-info .word, .mistake-item .word-info .word {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    letter-spacing: -0.3px;
    margin-bottom: 6px;
    line-height: 1.3;
}
.word-item .word-info .meaning, .mistake-item .word-info .meaning {
    font-size: 14px;
    color: #64748b;
    line-height: 1.4;
}
.word-item .status-tag, .mistake-item .source-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    flex-shrink: 0;
}
.word-item .status-tag.due { background: #fef3c7; color: #d97706; }
.word-item .status-tag.learning { background: #dbeafe; color: #1d4ed8; }
.word-item .status-tag.mastered { background: #dcfce7; color: #16a34a; }
.word-item .status-tag.unlearned { background: #f1f5f9; color: #64748b; }

.mistake-item .source-tag.spell { background: #fef3c7; color: #d97706; }
.mistake-item .source-tag.review { background: #dbeafe; color: #1d4ed8; }
.mistake-item .source-tag.game { background: #f3e8ff; color: #7c3aed; }

.word-item .speak-btn, .mistake-item .speak-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #eef2ff;
    color: #4f6ef7;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: 0.15s;
}
.word-item .speak-btn:active, .mistake-item .speak-btn:active {
    transform: scale(0.88);
    background: #dbeafe;
}

.mistake-item .ignore-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #fee2e2;
    color: #ef4444;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: 0.15s;
}
.mistake-item .ignore-btn:active {
    transform: scale(0.88);
    background: #fecaca;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #94a3b8;
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state .title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

/* ===== 学习页面 ===== */
#page-learn { padding: 0 20px 20px; }
#page-learn .learn-page {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
}
#page-learn .top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0 14px;
    flex-shrink: 0;
}
#page-learn .top-bar .title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    flex: 1;
}
#page-learn .top-bar .title i { color: #4f6ef7; margin-right: 8px; }
#page-learn .top-bar .count-badge {
    font-size: 12px;
    font-weight: 600;
    background: #4f6ef7;
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    flex-shrink: 0;
}

#page-learn .learn-type-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-shrink: 0;
}
#page-learn .learn-type-switch .type-btn {
    flex: 1;
    padding: 12px 6px;
    border-radius: 14px;
    border: none;
    background: white;
    font-size: 15px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    border: 1px solid transparent;
    user-select: none;
}
#page-learn .learn-type-switch .type-btn:active { transform: scale(0.96); }
#page-learn .learn-type-switch .type-btn.active {
    background: #4f6ef7;
    color: white;
    box-shadow: 0 4px 12px rgba(79,110,247,0.25);
    border-color: #4f6ef7;
}

#page-learn .group-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.03);
    margin-bottom: 12px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
#page-learn .group-panel .group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    flex-shrink: 0;
}
#page-learn .group-panel .group-header .label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}
#page-learn .group-panel .group-header .label i { color: #f59e0b; }
#page-learn .group-panel .group-header .label .selected-info {
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 0 10px;
    border-radius: 12px;
}
#page-learn .group-body {
    padding: 0 16px;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    max-height: 600px;
}
#page-learn .group-body.collapsed {
    max-height: 0 !important;
    padding: 0 16px;
}
#page-learn .group-tree {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}
#page-learn .group-tree::-webkit-scrollbar { width: 3px; }
#page-learn .group-tree::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
#page-learn .group-row {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 6px;
}
#page-learn .group-row:active { background: #f1f5f9; }
#page-learn .group-row .ck {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid #d1d5db;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: transparent;
    transition: 0.2s;
}
#page-learn .group-row .ck.on {
    background: #4f6ef7;
    border-color: #4f6ef7;
    color: white;
}
#page-learn .group-row .toggle {
    width: 18px;
    text-align: center;
    color: #94a3b8;
    font-size: 11px;
    flex-shrink: 0;
    cursor: pointer;
}
#page-learn .group-row .gname {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
#page-learn .group-row .gcount {
    font-size: 10px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 0 8px;
    border-radius: 10px;
    flex-shrink: 0;
}
#page-learn .group-children { padding-left: 4px; }

#page-learn .group-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px 0 10px;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    border-top: 1px solid #f1f5f9;
    margin-top: 2px;
    transition: background 0.15s;
}
#page-learn .group-footer:active { background: #f8fafc; }
#page-learn .group-footer .collapse-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #4f6ef7;
}
#page-learn .group-footer .collapse-btn:active { opacity: 0.6; }
#page-learn .group-footer .collapse-btn .arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}
#page-learn .group-footer .collapse-btn .arrow.collapsed { transform: rotate(180deg); }
#page-learn .group-footer .collapse-btn .label-text { font-size: 12px; }

#page-learn .word-panel {
    background: white;
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.03);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 14px;
    overflow: hidden;
}
#page-learn .word-panel .word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}
#page-learn .word-panel .word-header .label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}
#page-learn .word-panel .word-header .label i {
    color: #4f6ef7;
    margin-right: 6px;
}
#page-learn .word-panel .word-header .actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}
#page-learn .word-panel .word-header .actions button {
    background: none;
    border: none;
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    padding: 4px 10px;
    cursor: pointer;
    transition: 0.15s;
    border-radius: 0;
    box-shadow: none;
}
#page-learn .word-panel .word-header .actions button:active {
    color: #4f6ef7;
}
#page-learn .word-panel .word-header .actions .filter-btn {
    color: #4f6ef7;
    display: flex;
    align-items: center;
    gap: 4px;
}
#page-learn .word-panel .word-header .actions .filter-btn .dot {
    background: #4f6ef7;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#page-learn .word-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    min-height: 0;
    max-height: 420px;
}
#page-learn .word-list::-webkit-scrollbar { width: 3px; }
#page-learn .word-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

#page-learn .word-row {
    display: flex;
    align-items: center;
    padding: 8px 4px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
    gap: 10px;
}
#page-learn .word-row:active { background: #f8fafc; }
#page-learn .word-row:last-child { border-bottom: none; }
#page-learn .word-row .ck {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid #d1d5db;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: transparent;
    transition: 0.2s;
}
#page-learn .word-row .ck.on {
    background: #4f6ef7;
    border-color: #4f6ef7;
    color: white;
}
#page-learn .word-row .info { flex: 1; min-width: 0; }
#page-learn .word-row .info .en {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.3;
    word-break: break-word;
}
#page-learn .word-row .info .zh {
    font-size: 13px;
    color: #94a3b8;
}
#page-learn .word-row .status-tag {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}
#page-learn .word-row .status-tag.s0 { background: #f1f5f9; color: #94a3b8; }
#page-learn .word-row .status-tag.s1 { background: #dbeafe; color: #1d4ed8; }
#page-learn .word-row .status-tag.s2 { background: #e0e7ff; color: #4f46e5; }
#page-learn .word-row .status-tag.s3 { background: #dcfce7; color: #16a34a; }
#page-learn .word-row .status-tag.s4 { background: #fef3c7; color: #d97706; }
#page-learn .word-row .speak {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #eef2ff;
    color: #4f6ef7;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: 0.15s;
}
#page-learn .word-row .speak:active {
    transform: scale(0.88);
    background: #dbeafe;
}
#page-learn .empty {
    text-align: center;
    padding: 30px 10px;
    color: #94a3b8;
}
#page-learn .empty .icon { font-size: 36px; margin-bottom: 8px; opacity: 0.4; }
#page-learn .empty .title { font-size: 15px; font-weight: 600; color: #1a1a2e; }

#page-learn .action-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    flex-shrink: 0;
    padding-top: 4px;
}
#page-learn .action-bar .btn {
    padding: 14px 6px;
    border-radius: 16px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: white;
    user-select: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
#page-learn .action-bar .btn:active { transform: scale(0.94); }
#page-learn .action-bar .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}
#page-learn .action-bar .btn .sub {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.85;
}
#page-learn .action-bar .btn-learn {
    background: linear-gradient(135deg, #4f6ef7, #7c5cfc);
}
#page-learn .action-bar .btn-ear {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
}
#page-learn .action-bar .btn-spell {
    background: linear-gradient(135deg, #fb923c, #ef4444);
}

/* ===== 彩色音节 ===== */
.syl-0 { color: #F53F3F !important; }
.syl-1 { color: #165DFF !important; }
.syl-2 { color: #722ED1 !important; }
.syl-3 { color: #00B42A !important; }
.syl-4 { color: #FF7D00 !important; }
.syl-5 { color: #F5319D !important; }

/* ===== 闯关页面 ===== */
.spell-page {
    padding: 0 20px 20px;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
}
.spell-top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0 14px;
    flex-shrink: 0;
}
.spell-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    flex: 1;
}
.spell-title i { color: #4f6ef7; margin-right: 8px; }
.spell-progress-badge {
    font-size: 12px;
    font-weight: 600;
    background: #4f6ef7;
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    flex-shrink: 0;
}
.spell-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-shrink: 0;
}
.spell-mode-tabs .tab-btn {
    flex: 1;
    padding: 10px 6px;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    background: white;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    user-select: none;
}
.spell-mode-tabs .tab-btn:active { transform: scale(0.94); }
.spell-mode-tabs .tab-btn.active {
    border-color: #4f6ef7;
    background: #eff6ff;
    color: #1d4ed8;
}
.spell-filter-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.03);
    margin-bottom: 12px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.spell-filter-panel .filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    flex-shrink: 0;
}
.spell-filter-panel .filter-header .label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}
.spell-filter-panel .filter-header .label i { color: #f59e0b; }
.spell-filter-body {
    padding: 0 16px;
    display: block;
    transition: all 0.3s ease;
}
.spell-filter-body.collapsed { display: none !important; }
.filter-node { margin-bottom: 1px; }
.filter-row {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 6px;
}
.filter-row:active { background: #f1f5f9; }
.filter-row .ck {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid #d1d5db;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: transparent;
    transition: 0.2s;
}
.filter-row .ck.on {
    background: #4f6ef7;
    border-color: #4f6ef7;
    color: white;
}
.filter-row .fname {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.filter-row .fcount {
    font-size: 10px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 0 8px;
    border-radius: 10px;
    flex-shrink: 0;
}
.filter-footer {
    display: flex;
    justify-content: center;
    padding: 6px 0 10px;
    border-top: 1px solid #f1f5f9;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}
.filter-footer .collapse-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #4f6ef7;
}
.filter-footer .collapse-btn:active { opacity: 0.6; }
.filter-footer .collapse-btn .arrow { transition: transform 0.3s ease; display: inline-block; }
.filter-footer .collapse-btn .arrow.collapsed { transform: rotate(180deg); }
.filter-footer .collapse-btn .label-text { font-size: 12px; }

.spell-word-panel {
    background: white;
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.03);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 14px;
    overflow: hidden;
}
.spell-word-panel .word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.spell-word-panel .word-header .label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}
.spell-word-panel .word-header .label i { color: #4f6ef7; margin-right: 6px; }
.spell-word-panel .word-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    min-height: 0;
    max-height: 420px;
}
.spell-word-panel .word-list::-webkit-scrollbar { width: 3px; }
.spell-word-panel .word-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
.spell-word-panel .word-row {
    display: flex;
    align-items: center;
    padding: 8px 4px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
    gap: 10px;
}
.spell-word-panel .word-row:active { background: #f8fafc; }
.spell-word-panel .word-row:last-child { border-bottom: none; }
.spell-word-panel .word-row .ck {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid #d1d5db;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: transparent;
    transition: 0.2s;
}
.spell-word-panel .word-row .ck.on {
    background: #4f6ef7;
    border-color: #4f6ef7;
    color: white;
}
.spell-word-panel .word-row .info { flex: 1; min-width: 0; }
.spell-word-panel .word-row .info .en {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.3;
    word-break: break-word;
}
.spell-word-panel .word-row .info .en .syl-0 { color: #F53F3F; }
.spell-word-panel .word-row .info .en .syl-1 { color: #165DFF; }
.spell-word-panel .word-row .info .en .syl-2 { color: #722ED1; }
.spell-word-panel .word-row .info .en .syl-3 { color: #00B42A; }
.spell-word-panel .word-row .info .en .syl-4 { color: #FF7D00; }
.spell-word-panel .word-row .info .en .syl-5 { color: #F5319D; }
.spell-word-panel .word-row .info .zh {
    font-size: 13px;
    color: #94a3b8;
}
.spell-word-panel .word-row .status-tag {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}
.spell-word-panel .word-row .status-tag.s0 { background: #f1f5f9; color: #94a3b8; }
.spell-word-panel .word-row .status-tag.s1 { background: #dbeafe; color: #1d4ed8; }
.spell-word-panel .word-row .status-tag.s2 { background: #e0e7ff; color: #4f46e5; }
.spell-word-panel .word-row .status-tag.s3 { background: #dcfce7; color: #16a34a; }
.spell-word-panel .word-row .status-tag.s4 { background: #fef3c7; color: #d97706; }
.spell-word-panel .word-row .speak {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #eef2ff;
    color: #4f6ef7;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: 0.15s;
}
.spell-word-panel .word-row .speak:active {
    transform: scale(0.88);
    background: #dbeafe;
}
.spell-action-bar {
    flex-shrink: 0;
    padding-top: 4px;
}
.spell-action-bar .btn-start {
    width: 100%;
    padding: 16px 6px;
    border-radius: 16px;
    border: none;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: white;
    user-select: none;
    background: linear-gradient(135deg, #fb923c, #ef4444);
    box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}
.spell-action-bar .btn-start:active { transform: scale(0.94); }
.spell-action-bar .btn-start:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}
.spell-action-bar .btn-start .sub {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.85;
}
.spell-empty {
    text-align: center;
    padding: 30px 10px;
    color: #94a3b8;
}
.spell-empty .icon { font-size: 36px; margin-bottom: 8px; opacity: 0.4; }
.spell-empty .title { font-size: 15px; font-weight: 600; color: #1a1a2e; }

/* ===== 暗色模式 ===== */
@media (prefers-color-scheme: dark) {
    body { background: #0f0f1a; color: #e8e8f0; }
    .header { background: #0f0f1a; }
    .header .brand .brand-name { color: #e8e8f0; }
    .header .user-info .user-name { color: #60a5fa; }
    .header .icon-btn { background: rgba(255,255,255,0.05); color: #94a3b8; }
    .dashboard-card { background: #1a1a2e; border-color: #2a2a3e; }
    .dashboard-card .dash-header .title { color: #e8e8f0; }
    .dashboard-card .dash-grid .dash-item { background: #2a2a3e; }
    .points-card { background: linear-gradient(135deg, #451a03, #78350f); border-color: #92400e; }
    .points-card .points-header .title { color: #fcd34d; }
    .points-card .points-body .point-item { background: rgba(0,0,0,0.3); }
    .points-card .points-body .point-item .num { color: #fcd34d; }
    .grid-4 .item, .grid-2 .item, .game-grid .game-item { background: #1a1a2e; border-color: #2a2a3e; }
    .grid-4 .item .label, .grid-2 .item .label, .game-grid .game-item .label { color: #e8e8f0; }
    .library-card { background: #1a1a2e; border-color: #2a2a3e; }
    .library-stats .lib-item { background: #2a2a3e; }
    .library-stats .lib-item .num { color: #60a5fa; }
    .library-status-grid .status-item { background: #2a2a3e; }
    .history-item, .word-item, .mistake-item { background: #1a1a2e; border-color: #2a2a3e; }
    .history-item .info .title, .word-item .word-info .word, .mistake-item .word-info .word { color: #e8e8f0; }
    .word-item .speak-btn, .mistake-item .speak-btn { background: #1e3a5f; color: #60a5fa; }
    .theme-scroll .theme-btn { background: #1a1a2e; border-color: #2a2a3e; color: #94a3b8; }
    .theme-scroll .theme-btn.active { background: #4f6ef7; color: white; }
    .filter-scroll .filter-btn { background: #1a1a2e; border-color: #2a2a3e; color: #94a3b8; }
    .filter-scroll .filter-btn.active { background: #ef4444; color: white; }
    .mistake-summary .stat { background: #1a1a2e; border-color: #2a2a3e; }
    .review-summary .stat { background: #1a1a2e; border-color: #2a2a3e; }
    .type-switch .type-btn { background: #1a1a2e; border-color: #2a2a3e; color: #94a3b8; }
    .type-switch .type-btn.active { background: #1e3a5f; border-color: #4f6ef7; color: #60a5fa; }
    .review-actions .action-btn { background: #1a1a2e; border-color: #2a2a3e; color: #94a3b8; }
    .review-actions .action-btn.primary { background: #4f6ef7; color: white; }
    .word-item .status-tag.due { background: #451a03; color: #fbbf24; }
    .word-item .status-tag.learning { background: #1e3a5f; color: #60a5fa; }
    .word-item .status-tag.mastered { background: #064e3b; color: #34d399; }
    .word-item .status-tag.unlearned { background: #2a2a3e; color: #94a3b8; }
    .mistake-item .source-tag.spell { background: #451a03; color: #fbbf24; }
    .mistake-item .source-tag.review { background: #1e3a5f; color: #60a5fa; }
    .mistake-item .source-tag.game { background: #2e1065; color: #a78bfa; }
    .mistake-item .ignore-btn { background: #450a0a; color: #f87171; }
    #page-learn .top-bar .title { color: #e8e8f0; }
    #page-learn .top-bar .count-badge { background: #4f6ef7; }
    #page-learn .learn-type-switch .type-btn { background: #1a1a2e; color: #94a3b8; }
    #page-learn .learn-type-switch .type-btn.active { background: #4f6ef7; color: white; }
    #page-learn .group-panel { background: #1a1a2e; border-color: #2a2a3e; }
    #page-learn .group-panel .group-header .label { color: #e8e8f0; }
    #page-learn .group-panel .group-header .label .selected-info { background: #2a2a3e; color: #94a3b8; }
    #page-learn .group-row:active { background: #2a2a3e; }
    #page-learn .group-row .gname { color: #e8e8f0; }
    #page-learn .group-footer { border-top-color: #2a2a3e; }
    #page-learn .group-footer .collapse-btn { color: #60a5fa; }
    #page-learn .word-panel { background: #1a1a2e; border-color: #2a2a3e; }
    #page-learn .word-panel .word-header .label { color: #e8e8f0; }
    #page-learn .word-panel .word-header .actions .filter-btn { background: #1e3a5f; color: #60a5fa; }
    #page-learn .word-panel .word-header .actions .filter-btn .dot { background: #60a5fa; color: #0f0f1a; }
    #page-learn .word-row:active { background: #2a2a3e; }
    #page-learn .word-row .info .en { color: #e8e8f0; }
    #page-learn .word-row .info .zh { color: #94a3b8; }
    #page-learn .word-row .speak { background: #1e3a5f; color: #60a5fa; }
    #page-learn .word-row .status-tag.s0 { background: #2a2a3e; color: #94a3b8; }
    #page-learn .word-row .status-tag.s1 { background: #1e3a5f; color: #60a5fa; }
    #page-learn .word-row .status-tag.s2 { background: #1e1b4b; color: #818cf8; }
    #page-learn .word-row .status-tag.s3 { background: #064e3b; color: #34d399; }
    #page-learn .word-row .status-tag.s4 { background: #451a03; color: #fbbf24; }
    .spell-title { color: #e8e8f0; }
    .spell-progress-badge { background: #4f6ef7; }
    .spell-mode-tabs .tab-btn { background: #1a1a2e; border-color: #2a2a3e; color: #94a3b8; }
    .spell-mode-tabs .tab-btn.active { background: #1e3a5f; border-color: #4f6ef7; color: #60a5fa; }
    .spell-filter-panel { background: #1a1a2e; border-color: #2a2a3e; }
    .spell-filter-panel .filter-header .label { color: #e8e8f0; }
    .filter-row:active { background: #2a2a3e; }
    .filter-row .fname { color: #e8e8f0; }
    .filter-row .fcount { background: #2a2a3e; color: #94a3b8; }
    .filter-footer { border-top-color: #2a2a3e; }
    .filter-footer .collapse-btn { color: #60a5fa; }
    .spell-word-panel { background: #1a1a2e; border-color: #2a2a3e; }
    .spell-word-panel .word-header .label { color: #e8e8f0; }
    .spell-word-panel .word-header .actions .filter-btn { background: #1e3a5f; color: #60a5fa; }
    .spell-word-panel .word-row:active { background: #2a2a3e; }
    .spell-word-panel .word-row .info .en { color: #e8e8f0; }
    .spell-word-panel .word-row .info .zh { color: #94a3b8; }
    .spell-word-panel .word-row .status-tag.s0 { background: #2a2a3e; color: #94a3b8; }
    .spell-word-panel .word-row .status-tag.s1 { background: #1e3a5f; color: #60a5fa; }
    .spell-word-panel .word-row .status-tag.s2 { background: #1e1b4b; color: #818cf8; }
    .spell-word-panel .word-row .status-tag.s3 { background: #064e3b; color: #34d399; }
    .spell-word-panel .word-row .status-tag.s4 { background: #451a03; color: #fbbf24; }
    .spell-word-panel .word-row .speak { background: #1e3a5f; color: #60a5fa; }
}
/* ===== 修复学习页面全选/清空按钮样式 ===== */
#page-learn .word-panel .word-header .actions button {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #94a3b8 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    padding: 4px 10px !important;
    border-radius: 0 !important;
    cursor: pointer;
    transition: color 0.15s;
}

#page-learn .word-panel .word-header .actions button:active {
    color: #4f6ef7 !important;
}

/* 状态筛选按钮保留蓝色 */
#page-learn .word-panel .word-header .actions .filter-btn {
    color: #4f6ef7 !important;
}
/* ===== 分组面板全选/清空按钮样式（与单词列表统一） ===== */
#page-learn .group-panel .group-header .right .actions button {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #94a3b8 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    padding: 4px 8px !important;
    border-radius: 0 !important;
    cursor: pointer;
    transition: color 0.15s;
}

#page-learn .group-panel .group-header .right .actions button:active {
    color: #4f6ef7 !important;
}
/* ===== 强制恢复喇叭按钮样式 ===== */
#page-learn .word-row .speak {
    background: #eef2ff !important;
    color: #4f6ef7 !important;
    border: none !important;
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
}
/* 分组面板的"全选"按钮保持与单词列表一致，不加特殊颜色 */
/* ===== 全屏时页面高度自适应 ===== */
#app-mobile.hide-header .page.active {
    height: 100vh;
    height: 100dvh; /* 动态视口高度，移动端更友好 */
    padding-top: 0 !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.sentence-en {
    word-break: normal !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
}
/* 强制日读全屏样式 */
#daily-read-view {
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#daily-read-view .sentence-en {
    word-break: normal !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    display: block !important;
    width: 100% !important;
}

#daily-read-view .story-word {
    display: inline !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

#daily-read-view .sentence-block {
    margin-bottom: 2rem !important;
    text-align: center !important;
    padding: 6px 0 !important;
}


/* ============================================================
   平板 / 折叠屏（宽屏移动端）适配
   ============================================================ */

@media (min-width: 600px) {
    /* 所有内层页面容器：居中 + 收窄到 720px */
    .home-page,
    .dailyread-page,
    .mistake-page,
    .review-page,
    #page-learn .learn-page,
    .spell-page {
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 24px;
        padding-right: 24px;
    }

    .header {
        padding: 16px 28px 10px;
    }
}

@media (min-width: 900px) {
    /* Mate X5 展开 / MatePad Pro 竖屏 / 大平板横屏：进一步放大到 900px */
    .home-page,
    .dailyread-page,
    .mistake-page,
    .review-page,
    #page-learn .learn-page,
    .spell-page {
        max-width: 900px;
    }

    /* 首页四宫格：拉大图标和间距 */
    .grid-4 {
        gap: 12px;
    }
    .grid-4 .item,
    .grid-2 .item {
        padding: 18px 4px;
    }
    .grid-4 .item .icon {
        font-size: 30px;
    }
    .grid-4 .item .label {
        font-size: 13px;
    }
    .grid-2 .item .icon {
        font-size: 28px;
    }
    .grid-2 .item .label {
        font-size: 14px;
    }

    /* 游戏大厅：拉大图标 */
    .game-grid {
        gap: 12px;
    }
    .game-grid .game-item {
        padding: 16px 4px;
    }
    .game-grid .game-item .icon {
        font-size: 32px;
    }
    .game-grid .game-item .label {
        font-size: 11px;
    }

    /* 今日数据卡片：字大一点 */
    .dashboard-card .dash-grid .dash-item .num {
        font-size: 26px;
    }
    .dashboard-card .dash-grid .dash-item .label {
        font-size: 11px;
    }

    /* 学习 / 闯关列表字号放大 */
    #page-learn .word-row .info .en,
    .spell-word-panel .word-row .info .en {
        font-size: 18px;
    }
    #page-learn .word-row .info .zh,
    .spell-word-panel .word-row .info .zh {
        font-size: 14px;
    }

    /* 底部三个操作按钮更大 */
    #page-learn .action-bar .btn {
        padding: 18px 8px;
        font-size: 16px;
    }

    /* 列表可以显示更多行 */
    #page-learn .word-list,
    .spell-word-panel .word-list {
        max-height: 560px;
    }
}


/* ============================================================
   PC 端容器撑满屏幕（消除下方大面积空白）
   ============================================================ */
#app-pc {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* 第二个直接子级（含 tab-bar 和 tab-content 的那个容器）撑满 */
#app-pc > .max-w-7xl:last-of-type {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* tab-content 弹性撑开，保留 550px 保底 */
#app-pc #tab-content {
    flex: 1;
    min-height: 550px;
}