/* ===== 全局重置与基础 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #ffffff;
    color: #1a1a1a;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}


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

.page.active {
    display: block;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== 首页 ===== */
.home-header {
    text-align: center;
    padding: 64px 0 40px;
}

.home-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #111;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 15px;
    color: #666;
}

/* ===== 阶段卡片横向排版 ===== */
.stages-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    padding-bottom: 48px;
}

.stage-card {
    flex: 0 0 calc(33.333% - 12px);
    min-width: 260px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 28px 24px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.stage-card:hover {
    border-color: #333;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.stage-number {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.stage-title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin-bottom: 10px;
}

.stage-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.5;
}

.stage-meta {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

/* ===== 首页底部 ===== */
.home-footer {
    text-align: center;
    padding: 32px 0 48px;
    border-top: 1px solid #eee;
}

.home-footer p {
    font-size: 13px;
    color: #999;
}

/* ===== 答题页顶栏 ===== */
.quiz-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 32px;
}

.btn-back {
    background: none;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.btn-back:hover {
    border-color: #333;
    color: #000;
}

.quiz-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #555;
}

.stat-sep {
    color: #ddd;
}

.stat-item {
    font-weight: 500;
}

/* ===== 题目卡片 ===== */
.question-card {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 40px;
}

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

.question-index {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.question-type {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 4px;
    background: #eee;
    color: #555;
}

.question-type.single {
    background: #e8f0fe;
    color: #1a56db;
}

.question-type.multiple {
    background: #fef3e2;
    color: #b45309;
}

.question-type.truefalse {
    background: #e8fbe8;
    color: #15803d;
}

/* ===== 标签 ===== */
.question-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.tag {
    font-size: 11px;
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 3px;
    color: #666;
}

/* ===== 题目文字 ===== */
.question-text {
    font-size: 16px;
    font-weight: 500;
    color: #111;
    margin-bottom: 24px;
    line-height: 1.7;
    white-space: pre-wrap;
}

/* ===== 选项列表 ===== */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: #fff;
}

.option-item:hover:not(.disabled) {
    border-color: #999;
}

.option-item.selected {
    border-color: #333;
    background: #f5f5f5;
}

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

.option-item.correct {
    border-color: #16a34a;
    background: #f0fdf4;
}

.option-item.wrong {
    border-color: #dc2626;
    background: #fef2f2;
}

.option-marker {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition: border-color 0.15s;
    font-size: 11px;
    color: transparent;
}

.option-item.selected .option-marker {
    border-color: #333;
    background: #333;
    color: #fff;
}

.option-item.correct .option-marker {
    border-color: #16a34a;
    background: #16a34a;
    color: #fff;
}

.option-item.wrong .option-marker {
    border-color: #dc2626;
    background: #dc2626;
    color: #fff;
}

/* 多选题方形标记 */
.option-marker.checkbox {
    border-radius: 4px;
}

.option-text {
    font-size: 15px;
    color: #333;
    line-height: 1.5;
}

/* ===== 提交按钮 ===== */
.submit-area {
    text-align: center;
}

.btn-submit {
    background: #111;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 36px;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-submit:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-submit:not(:disabled):hover {
    opacity: 0.85;
}

/* ===== 反馈区 ===== */
.feedback-area {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.feedback-result {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 6px;
}

.feedback-result.correct {
    background: #f0fdf4;
    color: #15803d;
}

.feedback-result.wrong {
    background: #fef2f2;
    color: #dc2626;
}

.feedback-explanation {
    margin-bottom: 24px;
}

.explanation-block {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.7;
}

.explanation-block.correct-exp {
    background: #f8faf8;
    border-left: 3px solid #16a34a;
}

.explanation-block.wrong-exp {
    background: #faf8f8;
    border-left: 3px solid #dc2626;
}

.explanation-block .exp-label {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
}

.explanation-block .exp-text {
    color: #444;
}

.btn-next {
    background: #111;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 36px;
    font-size: 15px;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    transition: opacity 0.2s;
}

.btn-next:hover {
    opacity: 0.85;
}

/* ===== 完成页 ===== */
.quiz-complete {
    text-align: center;
    padding: 80px 0;
}

.quiz-complete h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 32px;
    color: #111;
}

.complete-stats {
    font-size: 16px;
    color: #444;
    margin-bottom: 40px;
    line-height: 2;
}

.complete-stats .stat-line {
    margin-bottom: 8px;
}

.complete-stats .highlight {
    font-weight: 700;
    color: #111;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .stage-card {
        flex: 0 0 100%;
    }

    .home-header h1 {
        font-size: 24px;
    }

    .quiz-top-bar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .question-card {
        padding: 20px;
    }
}
