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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* 顶部导航 */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.header-content {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.logo-icon {
    font-size: 20px;
}

.logo-text {
    font-weight: 600;
    font-size: 16px;
    color: #1e293b;
}

.nav {
    display: flex;
    gap: 4px;
}

.nav-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    color: #1e293b;
    background-color: #f1f5f9;
}

.nav-btn.active {
    color: #2563eb;
    background-color: rgba(37, 99, 235, 0.1);
}

/* 页面切换 */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* 首页 Hero 区域 */
.hero {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #4f46e5 100%);
    padding: 48px 24px 64px;
}

.hero-content {
    max-width: 1024px;
    margin: 0 auto;
    text-align: center;
}

.hero-title {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.hero-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 32px;
}

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

.stat-card {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 20px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin: 0 auto 8px;
}

.stat-icon.blue { background-color: #eff6ff; }
.stat-icon.green { background-color: #f0fdf4; }
.stat-icon.amber { background-color: #fffbeb; }
.stat-icon.red { background-color: #fef2f2; }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
}

/* 模式选择区域 */
.mode-section {
    max-width: 1024px;
    margin: 0 auto;
    padding: 48px 24px 64px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    margin-bottom: 8px;
}

.section-subtitle {
    font-size: 14px;
    color: #64748b;
    text-align: center;
    margin-bottom: 40px;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.mode-card {
    background-color: white;
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(37, 99, 235, 0.3);
}

.mode-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 16px;
    transition: transform 0.2s;
}

.mode-card:hover .mode-icon {
    transform: scale(1.05);
}

.mode-icon.blue { background-color: #eff6ff; }
.mode-icon.purple { background-color: #faf5ff; }
.mode-icon.orange { background-color: #fff7ed; }

.mode-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.mode-desc {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
    line-height: 1.6;
}

.mode-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #2563eb;
    opacity: 0;
    transition: opacity 0.2s;
}

.mode-card:hover .mode-action {
    opacity: 1;
}

/* 刷题页 */
.quiz-header {
    position: sticky;
    top: 56px;
    z-index: 40;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.4);
    padding: 12px 24px;
}

.quiz-nav {
    max-width: 672px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-ghost {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    color: #1e293b;
    background-color: #f1f5f9;
}

.quiz-progress {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
}

.quiz-progress span:first-child {
    color: #1e293b;
    font-weight: 600;
}

.quiz-spacer {
    width: 60px;
}

.progress-bar-container {
    max-width: 672px;
    margin: 0 auto 8px;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-info {
    max-width: 672px;
    margin: 0 auto 12px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #94a3b8;
}

.progress-info span:first-child span {
    font-weight: 600;
    color: #1e293b;
}

.quiz-buttons {
    max-width: 672px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
}

.btn-outline, .btn-primary {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-outline {
    border: 1px solid #e2e8f0;
    background-color: white;
    color: #64748b;
}

.btn-outline:hover:not(:disabled) {
    border-color: #cbd5e1;
    color: #1e293b;
}

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

.btn-primary {
    border: none;
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

/* 题目卡片 */
.quiz-content {
    max-width: 672px;
    margin: 0 auto;
    padding: 24px;
}

.question-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.question-header {
    padding: 20px 24px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.question-badges {
    display: flex;
    gap: 8px;
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    font-family: monospace;
}

.badge-secondary {
    background-color: #f1f5f9;
    color: #64748b;
}

.badge-outline {
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.badge-success {
    background-color: #16a34a;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-error {
    background-color: #dc2626;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.question-body {
    padding: 0 24px 24px;
}

.question-text {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.7;
    color: #1e293b;
    margin-bottom: 20px;
}

/* 选项 */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    background-color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 15px;
    color: #1e293b;
}

.option-btn:hover:not(:disabled) {
    border-color: rgba(37, 99, 235, 0.5);
    background-color: rgba(37, 99, 235, 0.05);
}

.option-btn:disabled {
    cursor: default;
}

.option-label {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.option-btn.correct {
    border-color: #16a34a;
    background-color: rgba(22, 163, 74, 0.1);
}

.option-btn.correct .option-label {
    background-color: #16a34a;
    color: white;
}

.option-btn.wrong {
    border-color: #dc2626;
    background-color: rgba(220, 38, 38, 0.1);
}

.option-btn.wrong .option-label {
    background-color: #dc2626;
    color: white;
}

.option-btn.disabled {
    opacity: 0.6;
}

.option-text {
    flex: 1;
    line-height: 1.5;
}

/* 答案解析 */
.answer-explanation {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

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

.explanation-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 10px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
}

.explanation-card.correct-answer {
    background-color: rgba(22, 163, 74, 0.05);
    border-color: rgba(22, 163, 74, 0.3);
}

.explanation-card.tip-card {
    background-color: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.3);
}

.explanation-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.explanation-label {
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    display: block;
    margin-bottom: 4px;
}

.correct-answer .explanation-label {
    color: #16a34a;
}

.tip-card .explanation-label {
    color: #d97706;
}

.explanation-text {
    font-size: 14px;
    color: #1e293b;
    font-weight: 500;
}

.explanation-content {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

.tip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.tip-toggle {
    padding: 2px 8px;
    border: none;
    background: transparent;
    font-size: 12px;
    color: #94a3b8;
    text-decoration: underline;
    cursor: pointer;
}

.tip-toggle:hover {
    color: #64748b;
}

.tip-content {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

/* 错题本 */
.wrong-book-container {
    max-width: 672px;
    margin: 0 auto;
    padding: 32px 24px;
}

.wrong-book-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.wrong-book-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: rgba(220, 38, 38, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.wrong-book-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}

.wrong-book-subtitle {
    font-size: 14px;
    color: #64748b;
}

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

.wrong-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s;
}

.wrong-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.wrong-item-id {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.wrong-item-content {
    flex: 1;
    min-width: 0;
}

.wrong-item-question {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.wrong-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wrong-item-type {
    padding: 2px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 11px;
    color: #64748b;
}

.wrong-item-answer {
    font-size: 12px;
    color: #64748b;
}

.wrong-item-answer span {
    font-weight: 600;
    color: #16a34a;
}

.wrong-item-btn {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    background-color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #2563eb;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wrong-item-btn:hover {
    border-color: #2563eb;
    background-color: rgba(37, 99, 235, 0.05);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
    background-color: #f8fafc;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
    color: #64748b;
}

/* 响应式 */
@media (max-width: 768px) {
    .hero {
        padding: 32px 16px 48px;
    }

    .hero-title {
        font-size: 24px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

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

    .stat-card {
        padding: 16px 12px;
    }

    .stat-value {
        font-size: 24px;
    }

    .mode-section {
        padding: 32px 16px 48px;
    }

    .mode-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .mode-card {
        padding: 24px 20px;
    }

    .quiz-header {
        padding: 12px 16px;
        top: 56px;
    }

    .quiz-content {
        padding: 16px;
    }

    .question-header {
        padding: 16px 20px 10px;
    }

    .question-body {
        padding: 0 20px 20px;
    }

    .question-text {
        font-size: 16px;
    }

    .option-btn {
        padding: 12px 14px;
        font-size: 14px;
    }

    .wrong-book-container {
        padding: 24px 16px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 16px;
    }

    .logo-text {
        display: none;
    }

    .btn-outline span:last-child,
    .btn-primary span:first-child {
        display: none;
    }
}

/* 题目图片样式 */
.question-image {
    max-width: 100%;
    max-height: 220px;
    margin-top: 14px;
    border-radius: 10px;
    display: block;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.2s;
}

.question-image:hover {
    transform: scale(1.02);
}

/* 图片放大预览模态框 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
}

.image-modal.show {
    display: flex;
}

.image-modal img {
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* 响应式图片 */
@media (max-width: 768px) {
    .question-image {
        max-height: 180px;
    }
}

@media (max-width: 480px) {
    .question-image {
        max-height: 160px;
    }
}
