/**
 * 模拟考试页面样式 - 一比一复刻全安驾考
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    color: #333;
}

#app { min-height: 100vh; }

/* ========== 入口页面 ========== */
.exam-entrance {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
}

.entrance-content {
    background: #fff;
    border-radius: 12px;
    padding: 40px 60px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.entrance-content h2 {
    font-size: 24px;
    margin-bottom: 30px;
    color: #333;
}

.mode-cards {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.mode-card {
    flex: 1;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    padding: 25px 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-card:hover {
    border-color: #1890ff;
    box-shadow: 0 4px 12px rgba(24,144,255,0.2);
}

.mode-card.selected {
    border-color: #1890ff;
    background: #e6f7ff;
}

.mode-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.mode-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.mode-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.exam-info {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.info-item {
    margin: 8px 0;
    font-size: 15px;
}

.info-item .label { color: #666; }
.info-item .value { color: #1890ff; font-weight: bold; }

.start-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.start-btn:hover { background: #40a9ff; }

/* ========== 考试界面 ========== */
.exam-page {
    display: flex;
    min-height: 100vh;
}

/* 左侧信息栏 */
.info-sidebar {
    width: 200px;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.timer-box {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: #fff;
    margin-bottom: 20px;
}

.timer-label { font-size: 14px; opacity: 0.9; }
.timer-value { font-size: 32px; font-weight: bold; margin-top: 5px; }

.student-info {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin: 8px 0;
}

.info-row .label { color: #666; }

.score-box {
    text-align: center;
    padding: 20px;
    background: #f6ffed;
    border-radius: 8px;
    margin-bottom: 20px;
}

.score-label { font-size: 14px; color: #666; }
.score-value { font-size: 48px; font-weight: bold; color: #52c41a; }
.pass-info { font-size: 12px; color: #999; margin-top: 5px; }

.progress-box {
    display: flex;
    gap: 10px;
}

.progress-item {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
}

.progress-item span { display: block; color: #666; margin-bottom: 5px; }
.progress-item b { font-size: 20px; }
.progress-item.correct { background: #f6ffed; }
.progress-item.correct b { color: #52c41a; }
.progress-item.wrong { background: #fff2f0; }
.progress-item.wrong b { color: #ff4d4f; }
.progress-item.unanswered { background: #f5f5f5; }
.progress-item.unanswered b { color: #999; }

/* 中间题目区 */
.question-area {
    flex: 1;
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    background: #fff;
    margin: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.question-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.question-number {
    font-size: 18px;
    color: #1890ff;
    font-weight: bold;
}

.question-type {
    background: #e6f7ff;
    color: #1890ff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.question-content {
    flex: 1;
    overflow-y: auto;
}

.question-text {
    font-size: 20px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.question-image {
    text-align: center;
    margin: 20px 0;
}

.question-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

/* 选项 */
.options-area {
    margin-top: 20px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 12px;
    background: #fafafa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.option-item:hover:not(.disabled) {
    background: #e6f7ff;
    border-color: #91d5ff;
}

.option-item.selected {
    border-color: #1890ff;
}

.option-item.correct {
    background: #f6ffed !important;
    border-color: #52c41a !important;
}

.option-item.wrong {
    background: #fff2f0 !important;
    border-color: #ff4d4f !important;
}

.option-item.disabled {
    cursor: not-allowed;
}

.opt-label {
    width: 30px;
    font-weight: bold;
}

.opt-text { flex: 1; font-size: 16px; }

/* 答案解析 */
.answer-analysis {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.analysis-header {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
    font-size: 15px;
}

.your-answer em, .correct-answer em {
    font-style: normal;
    font-weight: bold;
}

.your-answer em.wrong { color: #ff4d4f; }
.correct-answer em { color: #52c41a; }

.analysis-content {
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* 导航按钮 */
.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.nav-btn {
    padding: 12px 40px;
    font-size: 16px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn.prev {
    background: #f5f5f5;
    color: #333;
}

.nav-btn.prev:hover { background: #e8e8e8; }

.nav-btn.next {
    background: #1890ff;
    color: #fff;
}

.nav-btn.next:hover { background: #40a9ff; }

/* 右侧答题卡 */
.answer-card {
    width: 280px;
    background: #fff;
    border-left: 1px solid #e8e8e8;
    padding: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: bold;
}

.submit-btn {
    background: #ff4d4f;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.submit-btn:hover { background: #ff7875; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.card-cell {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.card-cell:hover { background: #e6f7ff; }
.card-cell.current { background: #1890ff; color: #fff; }
.card-cell.correct { background: #52c41a; color: #fff; }
.card-cell.wrong { background: #ff4d4f; color: #fff; }

/* 底部工具栏 */
.exam-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e8e8e8;
    padding: 15px 30px;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.tool-btn {
    padding: 8px 20px;
    background: #f5f5f5;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.tool-btn:hover { background: #e6f7ff; color: #1890ff; }

/* ========== 弹窗 ========== */
.modal {
    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: 1000;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.btn-primary, .btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #1890ff;
    color: #fff;
}

.btn-primary:hover { background: #40a9ff; }

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover { background: #e8e8e8; }

/* 交卷统计 */
.submit-stats {
    text-align: left;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.submit-stats p { margin: 8px 0; font-size: 15px; }
.submit-stats span { color: #1890ff; font-weight: bold; }

/* 结果弹窗 */
.result-modal .modal-content { max-width: 500px; }

.result-icon { font-size: 60px; margin-bottom: 10px; }

.result-score-box {
    margin: 20px 0;
}

.score-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: #fff;
}

.score-ring.passed { background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%); }
.score-ring.failed { background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%); }

.score-num { font-size: 36px; font-weight: bold; }
.score-unit { font-size: 14px; opacity: 0.9; }

.result-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
}

.stat { text-align: center; }

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #1890ff;
}

.stat-label {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

/* 技巧/关键字弹窗内容 */
.skill-content, .keywords-content {
    text-align: left;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    line-height: 1.8;
    font-size: 15px;
    white-space: pre-wrap;
}

/* 响应式 */
@media (max-width: 1024px) {
    .info-sidebar { display: none; }
    .answer-card { width: 200px; }
    .card-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .exam-page { flex-direction: column; }
    .question-area { margin: 10px; padding: 20px; }
    .answer-card { width: 100%; border-left: none; border-top: 1px solid #e8e8e8; }
    .card-grid { grid-template-columns: repeat(10, 1fr); }
    .mode-cards { flex-direction: column; }
    .entrance-content { padding: 30px 20px; }
}
