/* ============================
   全局样式与水印
   ============================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background-color: #fafafa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}


/* ============================
   视图切换
   ============================ */

.view {
    display: none;
    position: relative;
    z-index: 1;
}

.view.active {
    display: block;
}

/* ============================
   首页样式
   ============================ */

.home-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 80px 24px 60px;
    text-align: center;
}

.main-title {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.sub-title {
    font-size: 20px;
    font-weight: 400;
    color: #555;
    margin-bottom: 12px;
}

.description {
    font-size: 15px;
    color: #888;
    margin-bottom: 48px;
}

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

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

.stage-card:hover {
    border-color: #1a1a2e;
    box-shadow: 0 2px 12px rgba(74, 108, 247, 0.1);
}

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

.stage-card-title {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.stage-card-chapters {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
    line-height: 1.5;
}

.stage-card-count {
    font-size: 13px;
    color: #aaa;
}

/* ============================
   答题页样式
   ============================ */

.quiz-container {
    max-width: 780px;
    margin: 0 auto;
    padding: 24px 24px 60px;
}

/* 顶部状态栏 */
.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

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

.btn-back:hover {
    border-color: #1a1a2e;
    color: #1a1a2e;
}

.quiz-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.stage-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

.progress-label,
.accuracy-label {
    font-size: 14px;
    color: #666;
}

/* 进度条 */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background: #e8e8e8;
    border-radius: 2px;
    margin-bottom: 32px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: #1a1a2e;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* 题目区域 */
.question-area {
    margin-bottom: 24px;
}

.question-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.question-type-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    color: #fff;
    flex-shrink: 0;
}

.question-type-badge.single {
    background: #4a6cf7;
}

.question-type-badge.multiple {
    background: #e67e22;
}

.question-type-badge.judge {
    background: #2ecc71;
}

.question-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

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

.question-text {
    font-size: 17px;
    font-weight: 500;
    color: #1a1a2e;
    line-height: 1.7;
}

/* 选项区域 */
.options-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.option-btn {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    line-height: 1.6;
}

.option-btn:hover:not(.disabled) {
    border-color: #4a6cf7;
    background: #f8f9ff;
}

.option-btn.selected {
    border-color: #4a6cf7;
    background: #f0f3ff;
}

.option-btn.correct {
    border-color: #2ecc71;
    background: #eafaf1;
    color: #1a7a3a;
}

.option-btn.wrong {
    border-color: #e74c3c;
    background: #fdf0ef;
    color: #a93226;
}

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

.option-btn.missed-correct {
    border-color: #2ecc71;
    background: #eafaf1;
    color: #1a7a3a;
    border-style: dashed;
}

.option-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    border: 1px solid #ccc;
    color: #666;
    margin-top: 1px;
}

.option-btn.selected .option-label {
    border-color: #4a6cf7;
    background: #4a6cf7;
    color: #fff;
}

.option-btn.correct .option-label {
    border-color: #2ecc71;
    background: #2ecc71;
    color: #fff;
}

.option-btn.wrong .option-label {
    border-color: #e74c3c;
    background: #e74c3c;
    color: #fff;
}

.option-btn.missed-correct .option-label {
    border-color: #2ecc71;
    background: #2ecc71;
    color: #fff;
}

.option-text {
    flex: 1;
}

/* 多选复选框样式 */
.option-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    border: 1px solid #ccc;
    color: #666;
    margin-top: 1px;
}

.option-btn.selected .option-checkbox {
    border-color: #4a6cf7;
    background: #4a6cf7;
    color: #fff;
}

.option-btn.correct .option-checkbox {
    border-color: #2ecc71;
    background: #2ecc71;
    color: #fff;
}

.option-btn.wrong .option-checkbox {
    border-color: #e74c3c;
    background: #e74c3c;
    color: #fff;
}

.option-btn.missed-correct .option-checkbox {
    border-color: #2ecc71;
    background: #2ecc71;
    color: #fff;
}

/* 多选确认按钮 */
.multi-confirm-area {
    text-align: center;
    margin-bottom: 16px;
}

.btn-confirm {
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 40px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-confirm:hover {
    background: #1a1a2e;
}

.btn-confirm:disabled {
    background: #b0b0b0;
    cursor: not-allowed;
}

/* 解析区域 */
.explanation-area {
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.result-banner {
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
}

.result-banner.correct {
    background: #eafaf1;
    color: #1a7a3a;
}

.result-banner.wrong {
    background: #fdf0ef;
    color: #a93226;
}

.explanation-content {
    background: #f9f9f9;
    border: 1px solid #e8e8e8;
    border-top: none;
    padding: 20px;
    border-radius: 0 0 8px 8px;
}

.explanation-title {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.explanation-text {
    font-size: 14px;
    color: #444;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* 下一题按钮 */
.next-area {
    text-align: center;
    margin-top: 24px;
}

.btn-next {
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 48px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-next:hover {
    background: #2a2a4e;
}

/* 完成页面 */
.complete-area {
    text-align: center;
    padding: 60px 20px;
}

.complete-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 24px;
}

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

.complete-stats .stat-row {
    margin-bottom: 4px;
}

.complete-stats .stat-value {
    font-weight: 600;
    color: #1a1a2e;
}

.btn-home {
    background: #4a6cf7;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 40px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-home:hover {
    background: #1a1a2e;
}

/* ============================
   响应式
   ============================ */

@media (max-width: 768px) {
    .main-title {
        font-size: 26px;
    }

    .stage-card {
        flex: 0 0 100%;
    }

    .quiz-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .quiz-info {
        gap: 10px;
    }

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

@media (max-width: 480px) {
    .home-container {
        padding: 40px 16px 40px;
    }

    .quiz-container {
        padding: 16px 16px 40px;
    }
}
