/* 沉浸式答题界面 */

/* 隐藏头部和底部 */
.exam-mode .header,
.exam-mode .footer,
.exam-mode .mobile-menu {
    display: none !important;
}

.exam-mode main {
    margin-top: 0 !important;
}

/* 答题容器 */
.exam-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部状态栏 */
.exam-topbar {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.exam-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.exam-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.exam-progress-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.exam-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    max-width: 200px;
}

.exam-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.exam-actions-top {
    display: flex;
    gap: 8px;
}

.btn-exam-action {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-exam-action:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-exam-action.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-exam-action.primary:hover {
    background: var(--primary-dark);
}

/* 题目导航点 */
.question-dots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px 0;
}

.question-dot {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid transparent;
}

.question-dot:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.question-dot.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.question-dot.answered {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary-200);
}

.question-dot.correct {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success);
}

.question-dot.wrong {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

/* 题目区域 */
.question-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 32px 0;
}

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

.question-number {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.question-number-text {
    opacity: 0.9;
}

.question-number-index {
    font-size: 20px;
    font-weight: 700;
    margin: 0 2px;
}

.question-flag {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
}

.question-flag:hover,
.question-flag.flagged {
    border-color: var(--warning);
    color: var(--warning);
    background: var(--warning-light);
}

/* 题目文本 */
.question-text {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 32px;
}

.question-text p {
    margin-bottom: 12px;
}

.question-text code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 14px;
}

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

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.option-item:hover {
    border-color: var(--primary-200);
    background: var(--primary-50);
}

.option-item.selected {
    border-color: var(--primary);
    background: var(--primary-50);
}

.option-item.correct {
    border-color: var(--success);
    background: var(--success-light);
}

.option-item.wrong {
    border-color: var(--danger);
    background: var(--danger-light);
}

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

.option-item.disabled:hover {
    background: var(--bg-primary);
    border-color: var(--border);
}

.option-letter {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.15s;
}

.option-item.selected .option-letter {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.option-item.correct .option-letter {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.option-item.wrong .option-letter {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.option-text {
    flex: 1;
    font-size: 15px;
    line-height: 1.6;
    padding-top: 4px;
}

/* 答案反馈 */
.answer-feedback {
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    animation: slideUp 0.3s ease;
}

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

.answer-feedback.correct {
    background: var(--success-light);
    border: 1px solid var(--success);
    color: #065f46;
}

.answer-feedback.wrong {
    background: var(--danger-light);
    border: 1px solid var(--danger);
    color: #991b1b;
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.feedback-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.answer-feedback.correct .feedback-icon {
    background: var(--success);
    color: white;
}

.answer-feedback.wrong .feedback-icon {
    background: var(--danger);
    color: white;
}

.feedback-text {
    font-size: 16px;
    font-weight: 600;
}

.feedback-answer {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 4px;
}

/* 解析区域（可折叠） */
.explanation {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.explanation-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    user-select: none;
}

.explanation-title:hover {
    background: var(--bg-tertiary);
}

.explanation-toggle {
    transition: transform 0.2s;
    font-size: 12px;
}

.explanation.collapsed .explanation-toggle {
    transform: rotate(-90deg);
}

.explanation.collapsed .explanation-content {
    display: none;
}

.explanation-content {
    padding: 0 20px 20px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* 底部导航 */
.exam-bottombar {
    position: sticky;
    bottom: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding: 16px 0;
    z-index: 50;
}

.exam-bottombar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-nav.prev {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-nav.prev:hover:not(:disabled) {
    background: var(--border);
}

.btn-nav.next {
    background: var(--primary);
    color: white;
}

.btn-nav.next:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-nav.submit {
    background: var(--success);
    color: white;
}

.btn-nav.submit:hover:not(:disabled) {
    background: #059669;
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 8px;
}

/* 成绩页面 */
.result-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 60px 20px;
    text-align: center;
}

.result-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.result-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.result-score {
    font-size: 72px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.result-score-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.result-stat {
    text-align: center;
}

.result-stat-value {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.result-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 解析列表 */
.answers-review {
    max-width: 800px;
    margin: 40px auto 0;
    padding: 0 20px 60px;
    text-align: left;
}

.answers-review h3 {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.answer-item {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.answer-item.correct {
    border-color: var(--success);
    background: var(--success-light);
}

.answer-item.wrong {
    border-color: var(--danger);
    background: var(--danger-light);
}

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

.answer-item-number {
    font-weight: 600;
}

.answer-item-result {
    font-size: 14px;
    font-weight: 500;
}

.answer-item-text {
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.6;
}

.answer-item-correct {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.answer-item-explanation {
    font-size: 13px;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid var(--border);
    line-height: 1.6;
}

/* 响应式 */
@media (max-width: 640px) {
    .exam-topbar-inner {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .exam-progress {
        order: 2;
        width: 100%;
    }
    
    .exam-actions-top {
        order: 1;
    }
    
    .question-text {
        font-size: 16px;
    }
    
    .option-text {
        font-size: 14px;
    }
    
    .result-stats {
        grid-template-columns: 1fr;
    }
}

/* 列表页面样式 */
.page-header {
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.paper-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.paper-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.paper-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

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

.paper-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.paper-card-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.badge-primary {
    background: var(--primary-50);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

/* 科目选择 */
.subject-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.subject-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.subject-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.subject-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 14px;
}
