/* ================================================
   蜗牛壳初中英语课堂 - 前台样式
   Design: 简约大气 / 教育专业 / 两套主题
   Theme: light (白色主色) / eye-care (护眼模式)
   ================================================ */

/* ================================================
   CSS Variables - Light Theme (默认)
   ================================================ */
:root,
[data-theme="light"] {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --primary-bg: #eef2ff;
    --accent: #0891b2;
    --accent-light: #06b6d4;

    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-elevated: #ffffff;

    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --success: #22c55e;
    --success-bg: #f0fdf4;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --info: #3b82f6;
    --info-bg: #eff6ff;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
    --shadow-glow: 0 0 24px rgba(79, 70, 229, 0.25);

    --header-h: 64px;
    --container-w: 1100px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --gradient-primary: linear-gradient(135deg, #4f46e5, #6366f1);
    --gradient-warm: linear-gradient(135deg, #4f46e5, #0891b2);
    --gradient-hero: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 50%, #fdf2f8 100%);
}

/* ================================================
   Eye-care Theme (护眼模式)
   ================================================ */
[data-theme="eye-care"] {
    --primary: #5b7b5a;
    --primary-light: #7a9a79;
    --primary-dark: #3d5c3c;
    --primary-bg: #eaf7ea;
    --accent: #6b8c6a;
    --accent-light: #8aaa89;

    --bg: #f5f0e8;
    --bg-alt: #efe9de;
    --bg-card: #faf6ef;
    --bg-hover: #f0eade;
    --bg-elevated: #fcf9f4;

    --text: #3d3d3d;
    --text-secondary: #5c5c5c;
    --text-muted: #8a8a8a;

    --border: #d5cec0;
    --border-light: #e5dfd2;

    --success: #5c9a5c;
    --success-bg: #eef6ee;
    --danger: #c4716b;
    --danger-bg: #fcf0ef;
    --warning: #bc9249;
    --warning-bg: #fcf7ee;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.06);

    --gradient-primary: linear-gradient(135deg, #5b7b5a, #7a9a79);
    --gradient-warm: linear-gradient(135deg, #5b7b5a, #8aaa89);
    --gradient-hero: linear-gradient(135deg, #eaf7ea 0%, #f5f0e8 50%, #f5f0e8 100%);
}

/* ================================================
   Reset & Base
   ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
    min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }
img { max-width: 100%; height: auto; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }

/* ================================================
   Typography
   ================================================ */
h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }

/* ================================================
   Header
   ================================================ */
.study-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 200;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background var(--transition), border-color var(--transition);
}
.header-inner {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text) !important;
    white-space: nowrap;
}
.logo-icon { font-size: 26px; }
.logo-text { letter-spacing: -0.5px; }
.logo-highlight { color: var(--primary); }

/* Navigation */
.header-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary) !important;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
}
.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text) !important;
}
.nav-item.active {
    background: var(--primary-bg);
    color: var(--primary) !important;
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

/* 整站首页入口 */
.site-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}
.site-home-btn:hover {
    color: #fff;
    background: var(--gradient-primary);
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.site-home-btn svg { width: 15px; height: 15px; }

/* Theme Toggle */
.theme-toggle {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.icon-moon { display: none; }
[data-theme="eye-care"] .icon-sun { display: none; }
[data-theme="eye-care"] .icon-moon { display: block; }

/* User Area */
.user-dropdown { position: relative; }
.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.user-btn:hover { background: var(--bg-hover); }
.user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}
.user-name { font-size: 14px; color: var(--text); }

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 160px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: none;
    z-index: 100;
}
.user-dropdown:hover .dropdown-menu,
.user-dropdown:focus-within .dropdown-menu { display: block; }
.dropdown-item {
    display: block;
    padding: 8px 14px;
    border-radius: 6px;
    color: var(--text-secondary) !important;
    font-size: 14px;
    transition: all var(--transition);
}
.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text) !important;
}
.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* ================================================
   Buttons
   ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius); }
.btn-primary {
    background: var(--gradient-primary);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(79,70,229,0.25);
}
.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(79,70,229,0.35);
    transform: translateY(-1px);
    color: #fff !important;
}
.btn-outline {
    background: transparent;
    color: var(--text) !important;
    border: 1.5px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary) !important;
}
.btn-ghost {
    background: transparent;
    color: var(--text-secondary) !important;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text) !important; }
.btn-success {
    background: var(--success);
    color: #fff !important;
}
.btn-success:hover { opacity: 0.9; }
.btn-glow { box-shadow: 0 4px 24px rgba(79,70,229,0.3); }
.btn-text { color: var(--text-muted); font-size: 13px; padding: 4px 8px; border-radius: 4px; }
.btn-text:hover { background: var(--bg-hover); color: var(--text); }

/* ================================================
   Form Elements
   ================================================ */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    transition: all var(--transition);
    outline: none;
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}
.form-input-lg { padding: 16px 20px; font-size: 18px; border-radius: var(--radius-lg); }
.form-input::placeholder { color: var(--text-muted); }
.input-hint { border-color: var(--warning); }
.form-select {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: all var(--transition);
}
.form-select:focus { border-color: var(--primary); }
.form-select-sm { padding: 5px 10px; font-size: 13px; }

/* ================================================
   Main Content
   ================================================ */
.study-main {
    padding-top: var(--header-h);
    min-height: calc(100vh - var(--header-h) - 60px);
}

/* ================================================
   Footer
   ================================================ */
.study-footer {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}
.footer-inner {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 24px;
}
.footer-motto { margin-top: 4px; }
.footer-links {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
}
.footer-links a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--primary-hover); text-decoration: underline; }
.footer-links .dot { color: var(--border); }

/* ================================================
   Hero Section (首页)
   ================================================ */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 60px 24px 80px;
    gap: 60px;
    min-height: 70vh;
}
.hero-content { flex: 1; max-width: 560px; }
.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}
.hero-title {
    font-size: 44px;
    line-height: 1.15;
    margin-bottom: 16px;
}
.hero-word { color: var(--text); }
.hero-highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-desc {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}
.hero-actions { display: flex; gap: 12px; }
.hero-reminder {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 20px;
    background: var(--warning-bg);
    color: var(--warning);
    border-radius: var(--radius);
    font-size: 14px;
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }

/* 首页浮动卡片 */
.hero-illustration { flex: 0 0 320px; position: relative; height: 400px; }
.floating-cards { position: relative; width: 100%; height: 100%; }
.float-card {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 130px;
    height: 130px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    animation: float 3s ease-in-out infinite;
}
.card-emoji { font-size: 36px; }
.card-1 { top: 20px; left: 10px; animation-delay: 0s; }
.card-2 { top: 60px; right: 10px; animation-delay: 0.5s; }
.card-3 { bottom: 40px; left: 30px; animation-delay: 1s; }
.card-4 { bottom: 80px; right: 20px; animation-delay: 1.5s; }
@keyframes float {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ================================================
   Section Common
   ================================================ */
.section-title {
    text-align: center;
    font-size: 28px;
    margin-bottom: 40px;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
    margin: 12px auto 0;
}

/* ================================================
   Features Section
   ================================================ */
.features-section {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 60px 24px;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    transition: all var(--transition);
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-bg);
}
.feature-icon { font-size: 40px; margin-bottom: 16px; }
.feature-card h3 { font-size: 18px; margin-bottom: 10px; }
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* ================================================
   Quick Start Section
   ================================================ */
.quickstart-section {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 60px 24px;
}
.steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
}
.step {
    text-align: center;
    flex: 1;
    max-width: 200px;
}
.step-num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    margin: 0 auto 12px;
}
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.step-arrow {
    font-size: 24px;
    color: var(--text-muted);
    padding-top: 12px;
}

/* ================================================
   CTA Section
   ================================================ */
.cta-section {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 40px 24px 80px;
}
.cta-card {
    text-align: center;
    background: var(--gradient-hero);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 60px 40px;
}
.cta-card h2 { font-size: 28px; margin-bottom: 12px; }
.cta-card p { color: var(--text-secondary); margin-bottom: 28px; }

/* ================================================
   Exercise Page
   ================================================ */
.exercise-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - var(--header-h) - 60px);
}
.exercise-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.grade-selector { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); }
.progress-info { flex: 1; max-width: 200px; }
.progress-info span { font-size: 13px; color: var(--text-muted); }
.progress-bar {
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.score-display { font-size: 14px; font-weight: 600; color: var(--primary); }

/* Question Card */
.question-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    margin-bottom: 16px;
}
.question-type-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.badge-word, .badge-sentence, .badge-phrase {
    display: inline-flex;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}
.badge-word { background: #eef2ff; color: #4f46e5; }
[data-theme="eye-care"] .badge-word { background: #eaf7ea; color: #5b7b5a; }
.badge-sentence { background: #f0f9ff; color: #0891b2; }
[data-theme="eye-care"] .badge-sentence { background: #eef6ee; color: #6b8c6a; }
.badge-phrase { background: #fef3c7; color: #b45309; }
[data-theme="eye-care"] .badge-phrase { background: #fbf0d8; color: #8a6d3b; }
.question-number { color: var(--text-muted); font-size: 13px; }
.question-content { margin-bottom: 28px; }
.question-chinese {
    font-size: 24px;
    line-height: 1.4;
    margin-bottom: 12px;
}
.question-hint {
    font-size: 14px;
    color: var(--text-muted);
}
.phonetic { color: var(--accent); font-style: italic; }
.pos { color: var(--text-muted); }
.answer-area { margin-bottom: 8px; }
.input-group {
    display: flex;
    gap: 12px;
}
.input-group .form-input { flex: 1; }
.input-group .btn { white-space: nowrap; }
.answer-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Feedback Area */
.feedback-area { margin-bottom: 16px; }
.feedback-card {
    padding: 20px 24px;
    border-radius: var(--radius);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    animation: fadeSlideIn 0.3s ease;
}
.feedback-card.result-correct { background: var(--success-bg); border: 1px solid var(--success); }
.feedback-card.result-wrong { background: var(--danger-bg); border: 1px solid var(--danger); }
.feedback-icon { font-size: 28px; }
.feedback-text { font-weight: 600; margin-bottom: 4px; }
.feedback-detail { font-size: 14px; color: var(--text-secondary); }
.feedback-ai {
    margin-top: 8px;
    padding: 10px 14px;
    background: var(--info-bg);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--info);
}

/* Exercise Footer */
.exercise-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}
.stats-row { display: flex; gap: 20px; font-size: 14px; }
.stat-item { }
.stat-correct strong { color: var(--success); }
.stat-wrong strong { color: var(--danger); }

/* ================================================
   Result Page
   ================================================ */
.result-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 24px;
}
.result-header { text-align: center; margin-bottom: 32px; }
.result-big-icon { font-size: 56px; margin-bottom: 8px; }
.result-score-circle { margin: 20px auto; }
.result-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    text-align: center;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.stat-number { font-size: 28px; font-weight: 700; }
.stat-number.correct { color: var(--success); }
.stat-number.wrong { color: var(--danger); }
.stat-number.score { color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.answer-list { margin-bottom: 32px; }
.answer-list h2 { font-size: 18px; margin-bottom: 16px; }
.answer-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    border: 1px solid var(--border);
}
.answer-item.item-correct { background: var(--success-bg); }
.answer-item.item-wrong { background: var(--danger-bg); }
.answer-icon { font-size: 20px; padding-top: 2px; }
.answer-body { flex: 1; }
.answer-type { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.answer-q { font-weight: 600; margin-bottom: 6px; }
.answer-user { font-size: 14px; color: var(--text-secondary); }
.answer-correct { font-size: 14px; margin-top: 4px; }
.text-wrong { color: var(--danger); }
.text-correct { color: var(--success); font-weight: 600; }
.answer-ai {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--info-bg);
    border-radius: 6px;
    font-size: 13px;
    color: var(--info);
}
.answer-score {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}
.result-actions { display: flex; gap: 12px; justify-content: center; }

/* ================================================
   Wrong Book Page
   ================================================ */
.wrong-book-page {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 32px 24px;
}
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
}
.page-desc { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.wrong-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.stat-mini-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 100px;
}
.stat-mini-num { font-size: 22px; font-weight: 700; color: var(--text); }
.stat-mini-num.warn { color: var(--warning); }
.stat-mini-num.success { color: var(--success); }
.stat-mini-label { font-size: 12px; color: var(--text-muted); }

.filter-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}
.filter-item { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-secondary); }

.wrong-list { margin-bottom: 32px; }
.wrong-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 12px;
    transition: all var(--transition);
}
.wrong-item:hover { box-shadow: var(--shadow); }
.wrong-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.wrong-grade { font-size: 12px; padding: 2px 10px; border-radius: 10px; background: var(--bg-hover); color: var(--text-muted); }
.wrong-mastery { display: flex; gap: 1px; }
.star { color: var(--border); font-size: 13px; }
.star.filled { color: var(--warning); }
.wrong-count { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.wrong-body { margin-bottom: 12px; }
.wrong-question { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.wrong-answers { font-size: 14px; }
.wrong-answers .label { color: var(--text-muted); }
.wrong-value { color: var(--danger); }
.correct-value { color: var(--success); font-weight: 600; }
.wrong-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}
.review-time { font-size: 13px; color: var(--text-muted); }
.wrong-actions { display: flex; gap: 8px; }

/* ================================================
   Dashboard Page
   ================================================ */
.dashboard-page {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 32px 24px;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.dashboard-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.dsc-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 24px;
}
.dsc-icon.streak { background: #fff7ed; }
.dsc-icon.total { background: #eef2ff; }
.dsc-icon.correct { background: #f0fdf4; }
.dsc-icon.score { background: #fffbeb; }
.dsc-icon.mastered { background: #fdf2f8; }
.dsc-icon.days { background: #f0f9ff; }
.dsc-value { font-size: 24px; font-weight: 700; display: block; }
.dsc-label { font-size: 13px; color: var(--text-muted); }

/* Chart Section */
.chart-section { margin-bottom: 28px; }
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    gap: 8px;
}
.chart-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}
.chart-value { font-size: 11px; color: var(--text-muted); }
.chart-bar-wrap {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.chart-bar {
    width: 60%;
    max-width: 40px;
    background: var(--gradient-primary);
    border-radius: 4px 4px 0 0;
    transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.chart-day { font-size: 12px; color: var(--text-muted); }
.chart-empty { text-align: center; color: var(--text-muted); padding: 60px 0; }

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}
.stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.stats-card h3 { font-size: 16px; margin-bottom: 16px; }
.stats-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.stats-item:last-child { border-bottom: none; }
.stat-val { font-weight: 600; }
.stat-val.warn { color: var(--warning); }
.stat-val.success { color: var(--success); }

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.history-item:last-child { border-bottom: none; }
.history-type { padding: 2px 8px; border-radius: 4px; background: var(--bg-hover); font-size: 12px; }
.history-date { color: var(--text-muted); font-size: 12px; margin-left: 8px; }
.history-result { display: flex; align-items: center; gap: 4px; }
.history-correct { color: var(--success); font-weight: 600; }
.history-divider { color: var(--text-muted); }
.history-rate { color: var(--text-muted); font-size: 13px; }

.dashboard-actions { display: flex; gap: 12px; justify-content: center; }
.empty-mini { color: var(--text-muted); font-size: 14px; padding: 20px 0; text-align: center; }

/* ================================================
   Modal
   ================================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-sm { max-width: 360px; }
.modal-icon { font-size: 48px; margin-bottom: 12px; }
.modal-content h2 { margin-bottom: 16px; }
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { font-size: 18px; }
.modal-close { font-size: 24px; color: var(--text-muted); padding: 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { margin-bottom: 20px; text-align: left; }
.review-question { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; }

.result-summary {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 20px 0;
}
.result-item { text-align: center; }
.result-label { font-size: 13px; color: var(--text-muted); }
.result-value { font-size: 32px; font-weight: 700; }
.result-value.correct { color: var(--success); }
.result-value.wrong { color: var(--danger); }
.result-value.score { color: var(--primary); }
.modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }

/* ================================================
   Empty State
   ================================================ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}
.empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); margin-bottom: 20px; }

/* ================================================
   Toast
   ================================================ */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    z-index: 999;
    animation: fadeSlideIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

/* ================================================
   移动端顶栏组件（仅移动/平板显示，PC 隐藏）
   ================================================ */
.study-only-mobile { display: none; }

/* 会员图标按钮（移动/平板） */
.study-member-icon {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); border: 1px solid var(--border);
    transition: all var(--transition);
}
.study-member-icon:hover { background: var(--bg-hover); color: var(--primary); }
.study-member-icon svg { width: 20px; height: 20px; }

/* 菜单按钮（移动/平板） */
.study-menu-toggle {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text); border: 1px solid var(--border);
    transition: all var(--transition);
}
.study-menu-toggle:hover { background: var(--bg-hover); }
.study-menu-toggle span {
    display: block; width: 18px; height: 2px; background: var(--text);
    border-radius: 2px; position: relative; transition: .25s;
}
.study-menu-toggle span::before, .study-menu-toggle span::after {
    content: ''; position: absolute; left: 0; width: 18px; height: 2px;
    background: var(--text); border-radius: 2px; transition: .25s;
}
.study-menu-toggle span::before { top: -6px; }
.study-menu-toggle span::after { top: 6px; }

/* 移动端抽屉 */
.study-drawer-overlay {
    position: fixed; inset: 0; background: rgba(8,12,24,.5);
    opacity: 0; visibility: hidden; transition: .3s; z-index: 290;
}
.study-drawer-overlay.open { opacity: 1; visibility: visible; }
.study-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: 84%; max-width: 340px;
    background: var(--bg-elevated); z-index: 300;
    transform: translateX(100%); transition: transform .32s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.study-drawer.open { transform: translateX(0); }
.study-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.study-drawer-close {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; color: var(--text);
}
.study-drawer-close:hover { background: var(--bg-hover); }
.study-drawer-nav { flex: 1; overflow-y: auto; padding: 10px 14px; }
.study-drawer-nav > li { border-bottom: 1px solid var(--border-light); }
.study-drawer-nav > li:last-child { border-bottom: none; }
.study-drawer-link {
    display: flex; align-items: center; gap: 14px; width: 100%;
    padding: 15px 10px; color: var(--text) !important; font-size: 16px; font-weight: 600;
    border-radius: var(--radius-sm); transition: background var(--transition);
}
.study-drawer-link:hover { background: var(--bg-hover); }
.study-drawer-link.active { color: var(--primary) !important; background: var(--primary-bg); }
.study-drawer-link .drawer-ico { display: flex; align-items: center; justify-content: center; color: var(--primary); }
.study-drawer-site { margin-top: 8px; }
.study-drawer-site .drawer-ico { color: var(--accent); }

/* 练习页设置区：每个筛选字段独立成行，便于窄屏堆叠 */
.grade-field { display: flex; align-items: center; gap: 6px; }
.grade-field select { flex: 1; min-width: 0; }
.grade-field label { color: var(--text-secondary); white-space: nowrap; }

/* ================================================
   Responsive
   ================================================ */
@media (max-width: 1024px) {
    /* 移动/平板：隐藏内联导航与 PC 专属元素，顶栏仅留 主题/会员/菜单 三图标 */
    .header-nav,
    .study-only-pc { display: none !important; }
    .study-only-mobile {
        display: inline-flex !important; align-items: center; justify-content: center;
    }
    .header-right { gap: 8px; }
    .header-inner { gap: 12px; }
}

@media (max-width: 900px) {
    .hero-section { flex-direction: column; padding: 40px 24px; text-align: center; }
    .hero-illustration { display: none; }
    .hero-actions { justify-content: center; }
    .features-grid { grid-template-columns: 1fr 1fr; }
    .steps { flex-direction: column; align-items: center; }
    .step-arrow { transform: rotate(90deg); }
    .result-stats { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-section { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .header-inner { gap: 10px; padding: 0 14px; }
    .features-grid { grid-template-columns: 1fr; }
    .wrong-stats { justify-content: center; }
    .input-group { flex-direction: column; }
    .result-stats { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .user-name { display: none; }
    .hero-title { font-size: 32px; }

    /* 练习页设置区：窄屏纵向堆叠，避免文字挤行换行 */
    .exercise-header { flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
    .grade-selector { flex: 1 1 100%; flex-direction: column; align-items: stretch; gap: 10px; }
    .grade-field { width: 100%; }
    .progress-info { flex: 1 1 auto; max-width: none; }
    .score-display { white-space: nowrap; }
}

@media (min-width: 641px) and (max-width: 900px) {
    /* 平板：设置区字段两列排布 */
    .grade-selector { flex-wrap: wrap; }
    .grade-field { flex: 1 1 calc(50% - 6px); }
}
