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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding-bottom: 15px;
}

.admin-only {
}

.test-header,
.ai-review-container,
.wrong-ai-diagnosis {
    width: 100%;
}

.ai-config-modal {
    max-width: 560px;
}

.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f4f6fb;
}

.auth-panel {
    width: min(380px, 100%);
    background: white;
    border-radius: 10px;
    padding: 26px;
    box-shadow: 0 16px 50px rgba(34, 42, 70, 0.18);
}

.auth-panel h2 {
    color: #333;
    margin-bottom: 8px;
}

.auth-panel p {
    color: #666;
    margin-bottom: 18px;
}

.auth-panel input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d8dce6;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.auth-panel input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.14);
}

.auth-message {
    min-height: 22px;
    color: #b42318;
    font-size: 14px;
    margin-bottom: 10px;
}

.auth-actions {
    display: flex;
    gap: 10px;
}

.auth-actions button {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: #667eea;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.auth-actions button:last-child {
    background: #eef2ff;
    color: #4f63d7;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    margin-bottom: 30px;
}

.header h1 {
    text-align: center;
    color: #333;
    font-size: 28px;
    margin-bottom: 20px;
}

.ai-config-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ai-config-status {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #666;
}

.ai-config-status.enabled {
    background: #e8f5e9;
    color: #1b7f3a;
    border-color: #a8ddb5;
}

.ai-config-status.disabled {
    background: #fff8e1;
    color: #8a6d1f;
    border-color: #f3d27a;
}

.ai-config-btn {
    padding: 7px 14px;
    border: 1px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #4f63d7;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-config-btn:hover {
    background: #eef2ff;
}

.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.nav-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 25px;
    border-radius: 25px;
    background: #f0f0f0;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #e0e0e0;
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.question-info {
    text-align: center;
    margin-bottom: 15px;
    color: white;
    font-size: 18px;
}

.bank-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    color: white;
    font-size: 16px;
}

.bank-selector select {
    min-width: 180px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 16px;
    cursor: pointer;
}

.question-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.question-stem {
    font-size: 20px;
    color: #333;
    line-height: 1.8;
    flex: 1;
}

.favorite-btn {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 2px solid #ffc107;
    border-radius: 50%;
    cursor: pointer;
    padding: 10px;
    font-size: 22px;
    color: #ffc107;
    transition: all 0.3s ease;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.favorite-btn:hover {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.5);
}

.favorite-btn.active {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.5);
}

.favorite-btn.active .favorite-icon::before {
    content: '★';
}

.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    padding: 18px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.option-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.option-item.selected {
    border-color: #667eea;
    background: #e8edff;
}

.option-item.multi-option.selected {
    border-color: #17a2b8;
    background: #e3f7fb;
}

.option-item.multi-option .option-letter::after {
    content: '✓';
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.8;
}

.option-item.correct {
    border-color: #28a745;
    background: #d4edda;
}

.option-item.wrong {
    border-color: #dc3545;
    background: #f8d7da;
}

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

.option-item.loading {
    color: #999;
}

.option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.option-text {
    font-size: 16px;
    color: #444;
    line-height: 1.6;
    flex: 1;
}

.multi-answer-hint {
    padding: 10px 14px;
    border-radius: 8px;
    background: #e3f7fb;
    border: 1px solid #17a2b8;
    color: #0c5460;
    font-size: 14px;
    font-weight: 600;
}

.answer-result {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    font-size: 18px;
    font-weight: bold;
}

.answer-result.correct {
    background: #d4edda;
    color: #155724;
    display: block;
}

.answer-result.wrong {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

.explanation {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    border-radius: 0 8px 8px 0;
    display: none;
}

.explanation h4 {
    color: #856404;
    margin-bottom: 10px;
    font-size: 16px;
}

.explanation p {
    color: #856404;
    line-height: 1.8;
    font-size: 15px;
}

.explanation.show {
    display: block;
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#submit-btn {
    display: none;
}

.submit-btn-original {
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

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

.submit-exam-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-exam-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(220, 53, 69, 0.4);
}

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

.hide-btn, .show-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hide-btn {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.hide-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(108, 117, 125, 0.4);
}

.show-btn {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.show-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(23, 162, 184, 0.4);
}

.hide-btn:disabled, .show-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cache-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cache-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.4);
}

.exam-options {
    text-align: center;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: white;
    font-size: 14px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background: rgba(255, 255, 255, 0.3);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.exam-result-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* exam-result-section 在非专注模式下，限制在视口内可滚动 */
body:not(.exam-focus-mode) .exam-result-section {
    max-height: calc(100vh - 160px);
}

/* 专注模式下，结果区占据中央并可滚动 */
body.exam-focus-mode .exam-result-section {
    max-height: calc(100vh - 140px);
}

.exam-result-header {
    text-align: center;
    margin-bottom: 30px;
}

.exam-score {
    font-size: 48px;
    font-weight: bold;
    color: #667eea;
}

.exam-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.exam-stat-item {
    text-align: center;
}

.exam-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.exam-stat-label {
    font-size: 14px;
    color: #666;
}

.review-questions-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.review-questions-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

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

.restart-btn,
.clear-btn {
    border: none;
    border-radius: 30px;
    padding: 15px 34px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.restart-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(34, 197, 94, 0.35);
}

.clear-btn {
    background: #eef2ff;
    color: #4f63d7;
}

.clear-btn:hover {
    background: #e0e7ff;
}

.quiz-result-summary {
    background: white;
    border-radius: 12px;
    padding: 26px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
    text-align: center;
}

.quiz-score-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 18px;
}

.quiz-score-banner strong {
    font-size: 42px;
    color: #667eea;
}

.quiz-score-banner span {
    color: #555;
    font-weight: 600;
}

.quiz-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.quiz-summary-grid div {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    font-weight: 600;
    color: #374151;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    color: white;
    font-size: 18px;
}

.stats span {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 25px;
    border-radius: 25px;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.wrong-list {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.wrong-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.3s ease;
}

.wrong-item.focus {
    border-left: 5px solid #ff9800;
    background: #fffaf0;
}

.wrong-item.critical {
    border-left: 5px solid #dc3545;
    background: #fff5f5;
}

.wrong-priority {
    display: inline-block;
    margin-bottom: 10px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.wrong-priority.normal {
    background: #e9ecef;
    color: #495057;
}

.wrong-priority.focus {
    background: #fff3cd;
    color: #856404;
}

.wrong-priority.critical {
    background: #f8d7da;
    color: #721c24;
}

.wrong-memory-tip {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff3cd;
    color: #664d03;
    font-size: 14px;
    font-weight: 600;
}

.wrong-item:hover {
    background: #f8f9fa;
}

.wrong-item:last-child {
    border-bottom: none;
}

.wrong-item h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.6;
    font-weight: 600;
}

.wrong-streak {
    display: inline-block;
    margin-bottom: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff3cd;
    color: #856404;
    font-size: 13px;
    font-weight: 600;
}

.wrong-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.wrong-option {
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    border: 2px solid #e0e0e0;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wrong-options.interactive .wrong-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.wrong-option.selected {
    border-color: #667eea;
    background: #e8edff;
}

.wrong-option.correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.wrong-option.wrong {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.wrong-result {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 500;
}

.wrong-result.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}

.wrong-result.wrong {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
}

.wrong-actions,
.favorite-actions,
.search-actions,
.question-ai-actions,
.quiz-ai-actions,
.review-ai-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.goto-question-btn, .remove-wrong-btn, .remove-favorite-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.goto-question-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.goto-question-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.remove-wrong-btn {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

.remove-wrong-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.favorite-wrong-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff9e6;
    color: #ffc107;
    border: 1px solid #ffc107;
}

.favorite-wrong-btn:hover {
    background: #ffc107;
    color: white;
}

.favorite-wrong-btn.active {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
    border-color: #ff9800;
}

.ai-analyze-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #20c997, #0dcaf0);
    color: white;
}

.ai-analyze-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(13, 202, 240, 0.3);
}

.ai-analyze-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.ai-analysis {
    margin-top: 12px;
    margin-bottom: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #eefbf8;
    border: 1px solid #20c997;
    color: #114d44;
}

.ai-analysis-title {
    font-weight: 700;
    margin-bottom: 10px;
    color: #087f6f;
}

.ai-analysis-toggle-row,
.ai-report-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.ai-toggle-btn {
    border: none;
    border-radius: 16px;
    padding: 5px 14px;
    background: #d9f7ef;
    color: #087f6f;
    font-size: 13px;
    cursor: pointer;
}

.ai-toggle-btn:hover {
    background: #c0f0e4;
}

.ai-analysis-body .ai-analysis {
    margin: 10px 0 0;
}

.ai-analysis-grid {
    display: grid;
    gap: 8px;
    font-size: 14px;
    line-height: 1.7;
}

.ai-analysis-tip {
    margin-top: 10px;
    font-size: 12px;
    color: #5f746f;
}

.ai-analysis-loading {
    color: #087f6f;
    font-size: 14px;
}

.ai-analysis-error {
    color: #842029;
    background: #f8d7da;
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
}

.ai-exam-report {
    margin: 24px 0;
    padding: 20px;
    border-radius: 12px;
    background: #f8fbff;
    border: 1px solid #b8d4ff;
    text-align: left;
}

.ai-exam-report h3,
.ai-exam-report h4 {
    color: #1f4f8f;
    margin-bottom: 12px;
}

.ai-report-summary {
    background: white;
    border-left: 4px solid #667eea;
    padding: 12px 14px;
    border-radius: 8px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.ai-convergence-status {
    background: #ecfdf3;
    border: 1px solid #7bd99f;
    border-left: 4px solid #22c55e;
    border-radius: 8px;
    padding: 12px 14px;
    line-height: 1.7;
    margin-bottom: 16px;
    color: #14532d;
}

.trend-status {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e8edff;
    color: #3849a6;
    font-size: 12px;
    font-weight: 600;
}

.ai-report-block {
    margin-top: 16px;
}

.ai-report-card,
.ai-report-row {
    background: white;
    border: 1px solid #e1ecff;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    line-height: 1.7;
}

.ai-report-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
}

.ai-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.ai-keyword {
    background: #e8edff;
    color: #3849a6;
    border: 1px solid #b7c4ff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
}

.ai-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: white;
}

.ai-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    line-height: 1.7;
}

.ai-profile-grid > div {
    background: white;
    border: 1px solid #e1ecff;
    border-radius: 8px;
    padding: 12px;
}

.ai-history-item {
    border-top: 1px solid #dbe7ff;
    padding-top: 16px;
    margin-top: 16px;
}

.ai-history-header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    background: #eef4ff;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    color: #1f4f8f;
}

.wrong-item .meta {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
}

.wrong-item .meta .user-answer {
    color: #dc3545;
}

.wrong-item .meta .correct-answer {
    color: #28a745;
}

.wrong-explanation {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    padding: 12px 15px;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    line-height: 1.7;
    color: #856404;
}

.wrong-explanation strong {
    color: #856404;
}

.wrong-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: white;
    font-size: 18px;
}

.favorite-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: white;
    font-size: 18px;
}

.favorite-list {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.favorite-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.3s ease;
}

.favorite-item:hover {
    background: #f8f9fa;
}

.favorite-item:last-child {
    border-bottom: none;
}

.favorite-item h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.6;
    font-weight: 600;
}

.favorite-answer {
    display: inline-block;
    margin-bottom: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #d4edda;
    color: #155724;
    font-size: 13px;
    font-weight: 600;
}

.favorite-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.favorite-option {
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    border: 2px solid #e0e0e0;
    background: white;
    transition: all 0.2s ease;
}

.favorite-explanation {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    padding: 12px 15px;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    line-height: 1.7;
    color: #856404;
    margin-bottom: 15px;
}

.favorite-explanation strong {
    color: #856404;
}

.favorite-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.remove-favorite-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

.remove-favorite-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.danger-btn {
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.danger-btn:hover {
    background: #c82333;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px;
}

.timer-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.timer-label {
    color: white;
    font-size: 16px;
}

.timer {
    background: white;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    color: #667eea;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.timer-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#start-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

#start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

#pause-btn {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: white;
}

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

.question-area {
    display: flex;
    gap: 25px;
}

.question-card {
    flex: 1;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.side-panel {
    width: 300px;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

.panel-header {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.selected-answer {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    min-height: 60px;
}

.no-selection {
    color: #999;
    font-style: italic;
}

.selected-option {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.progress-stats {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.progress-stats div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}

.progress-stats div:last-child {
    margin-bottom: 0;
}

.answer-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding: 4px 8px 14px 2px;
    box-sizing: border-box;
    align-content: start;
    scroll-padding-bottom: 14px;
}

.answer-grid::-webkit-scrollbar {
    width: 6px;
}

.answer-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.answer-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.answer-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.grid-item {
    aspect-ratio: 1;
    min-width: 20px;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #e0e0e0;
    color: #666;
}

.grid-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.grid-item.answered {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.grid-item.correct {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.grid-item.wrong {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.grid-item.current {
    box-shadow: inset 0 0 0 2px rgba(102, 126, 234, 0.45);
}

.paused-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.paused-content {
    background: white;
    padding: 40px 60px;
    border-radius: 20px;
    text-align: center;
}

.paused-content h2 {
    color: #ffc107;
    margin-bottom: 20px;
}

.paused-content button {
    padding: 15px 40px;
    background: linear-gradient(135deg, #007bff, #0069d9);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.paused-content button:hover {
    transform: translateY(-2px);
}

.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(18, 24, 40, 0.55);
}

.modal-card {
    width: min(520px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
    padding: 24px;
}

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

.modal-header h3 {
    color: #333;
    font-size: 20px;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #f1f3f5;
    color: #555;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.modal-close-btn:hover {
    background: #e4e7eb;
}

.ai-config-tip {
    color: #555;
    line-height: 1.7;
    font-size: 14px;
    margin-bottom: 14px;
}

.ai-config-current {
    padding: 10px 12px;
    border-radius: 8px;
    background: #f6f7fb;
    color: #444;
    font-size: 14px;
    margin-bottom: 14px;
}

.ai-config-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.ai-config-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d5dae3;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.ai-config-field input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.14);
}

.ai-config-message {
    min-height: 22px;
    margin: 6px 0 14px;
    font-size: 14px;
}

.ai-config-message.error {
    color: #b42318;
}

.ai-config-message.success {
    color: #1b7f3a;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .question-area {
        flex-direction: column;
    }

    .side-panel {
        width: 100%;
        position: relative;
    }

    .answer-grid {
        grid-template-columns: repeat(10, 1fr);
        max-height: 200px;
    }

    .grid-item {
        min-width: 28px;
        min-height: 28px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .question-card {
        padding: 20px;
    }

    .question-stem {
        font-size: 18px;
    }

    .option-item {
        padding: 15px;
    }

    .option-letter {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .navigation {
        flex-direction: column;
        gap: 15px;
    }

    .submit-btn {
        width: 100%;
    }

    .answer-grid {
        grid-template-columns: repeat(8, 1fr);
        max-height: 180px;
        gap: 6px;
    }

    .grid-item {
        min-width: 32px;
        min-height: 32px;
        font-size: 12px;
        border-radius: 6px;
    }

    .stats {
        gap: 15px;
        font-size: 16px;
    }

    .stats span {
        padding: 8px 15px;
    }
}

@media (max-width: 480px) {
    .answer-grid {
        grid-template-columns: repeat(6, 1fr);
        max-height: 160px;
        gap: 5px;
    }

    .grid-item {
        min-width: 36px;
        min-height: 36px;
        font-size: 13px;
    }
}

/* ===== 知识点标签 ===== */
.question-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
}

/* ===== 笔记功能 ===== */
.question-note {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 15px;
    color: #555;
}

.note-toggle-btn {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #667eea;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.note-toggle-btn:hover {
    background: #f0f4ff;
    border-color: #667eea;
}

.note-content textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 10px;
}

.note-content textarea:focus {
    outline: none;
    border-color: #667eea;
}

.save-note-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-note-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

.note-display {
    background: #fff9e6;
    border-left: 3px solid #ffc107;
    padding: 12px 15px;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    line-height: 1.7;
    color: #856404;
}

/* ===== 知识点掌握度报告 ===== */
.tag-report {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.tag-report h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.tag-report-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
}

.tag-report-legend .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}

.tag-report-legend .dot.good { background: #28a745; }
.tag-report-legend .dot.medium { background: #ffc107; }
.tag-report-legend .dot.bad { background: #dc3545; }

.tag-report-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.tag-report-row:last-child {
    border-bottom: none;
}

.tag-name {
    width: 100px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.tag-bar {
    flex: 1;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.tag-bar-fill {
    display: block;
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.tag-report-row.good .tag-bar-fill { background: #28a745; }
.tag-report-row.medium .tag-bar-fill { background: #ffc107; }
.tag-report-row.bad .tag-bar-fill { background: #dc3545; }

.tag-rate {
    width: 50px;
    text-align: right;
    font-size: 14px;
    font-weight: bold;
}

.tag-count {
    width: 60px;
    text-align: right;
    font-size: 13px;
    color: #666;
}

/* ===== 背题模式 ===== */
.review-header {
    margin-bottom: 20px;
}

.review-header h2 {
    color: white;
    margin-bottom: 15px;
}

.review-filter {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    font-size: 16px;
}

.review-filter select {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
}

.review-start-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.review-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.review-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
    min-height: 200px;
}

.review-card {
    animation: fadeIn 0.3s ease;
}

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

.review-card h3 {
    font-size: 18px;
    color: #333;
    line-height: 1.8;
    margin-bottom: 20px;
}

.review-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.review-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.review-option {
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    font-size: 15px;
    line-height: 1.6;
}

.review-option.correct {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
    font-weight: 600;
}

.review-answer {
    font-size: 16px;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: #d4edda;
    border-radius: 8px;
}

.review-explanation {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px 18px;
    border-radius: 0 8px 8px 0;
    font-size: 15px;
    line-height: 1.8;
    color: #856404;
    margin-bottom: 15px;
}

.review-note {
    background: #fff9e6;
    border-left: 3px solid #ffc107;
    padding: 12px 15px;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    line-height: 1.7;
    color: #856404;
}

.review-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.review-nav .nav-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.review-nav span {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

/* ===== 复习提醒角标 ===== */
.review-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    background: #dc3545;
    color: white;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ===== 快速测验模式 ===== */
.quiz-header {
    margin-bottom: 20px;
}

.quiz-header h2 {
    color: white;
    margin-bottom: 15px;
}

.quiz-setup {
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
    font-size: 16px;
    flex-wrap: wrap;
}

.quiz-setup-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-setup select {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
}

.quiz-start-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.quiz-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
    min-height: 200px;
}

.quiz-card {
    animation: fadeIn 0.3s ease;
}

.quiz-card h3 {
    font-size: 18px;
    color: #333;
    line-height: 1.8;
    margin-bottom: 20px;
}

.quiz-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.quiz-option {
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 15px;
    line-height: 1.6;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.quiz-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.quiz-result {
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
}

.quiz-result.correct {
    background: #d4edda;
    color: #155724;
}

.quiz-result.wrong {
    background: #f8d7da;
    color: #721c24;
}

.quiz-answer {
    font-size: 15px;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 12px;
    padding: 10px 15px;
    background: #d4edda;
    border-radius: 8px;
}

.quiz-explanation {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px 18px;
    border-radius: 0 8px 8px 0;
    font-size: 15px;
    line-height: 1.8;
    color: #856404;
}

.quiz-score-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease;
}

.quiz-score {
    font-size: 42px;
    font-weight: bold;
    margin-bottom: 5px;
}

.quiz-score-detail {
    font-size: 15px;
    opacity: 0.9;
}

.quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    gap: 15px;
}

.quiz-nav .nav-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.quiz-nav .nav-btn.submit-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
}

.quiz-nav span {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

/* ===== 题目搜索 ===== */
.search-header {
    margin-bottom: 20px;
}

.search-header h2 {
    color: white;
    margin-bottom: 15px;
}

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

.search-box input {
    flex: 1;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
}

.search-box input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.search-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.search-results {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-height: 200px;
}

.search-result-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 14px;
    background: #fff;
}

.search-result-card h3 {
    margin: 10px 0;
    color: #222;
    font-size: 17px;
    line-height: 1.5;
}

.search-options {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.search-option {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f8fafc;
    color: #333;
}

.ai-report-body {
    display: grid;
    gap: 10px;
}

.search-count {
    font-size: 15px;
    color: #666;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.search-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item h3 {
    font-size: 16px;
    color: #333;
    line-height: 1.7;
    margin-bottom: 12px;
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.search-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.search-option {
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    font-size: 14px;
}

.search-option.correct {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
    font-weight: 600;
}

.search-answer {
    font-size: 14px;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #d4edda;
    border-radius: 6px;
}

.search-explanation {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    padding: 12px 15px;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    line-height: 1.7;
    color: #856404;
    margin-bottom: 12px;
}

.search-note {
    background: #fff9e6;
    border-left: 3px solid #ffc107;
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    line-height: 1.6;
    color: #856404;
    margin-bottom: 12px;
}

.search-actions {
    margin-top: 12px;
}
/* Admin account management */
.admin-header,
.admin-create,
.user-row,
.user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header {
    justify-content: space-between;
    margin-bottom: 16px;
}

.admin-create {
    flex-wrap: wrap;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 16px;
}

.admin-create input,
.admin-create select {
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.users-list {
    display: grid;
    gap: 8px;
}

.user-row {
    justify-content: space-between;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
}

.user-row > div:first-child {
    min-width: 160px;
}

.user-row span {
    margin-left: 8px;
    color: #6b7280;
    font-size: 12px;
}

/* ===== 第一阶段：现代化学习平台视觉基底 ===== */
:root {
    --bg: #eef3f8;
    --bg-deep: #dfe9f3;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-solid: #ffffff;
    --surface-muted: #f6f8fb;
    --text: #172033;
    --text-muted: #667085;
    --border: #dbe3ef;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eaf1ff;
    --accent: #0f766e;
    --accent-soft: #e6f6f3;
    --success: #16a34a;
    --success-soft: #e9f8ef;
    --warning: #d97706;
    --warning-soft: #fff7e8;
    --danger: #dc2626;
    --danger-soft: #fff1f2;
    --shadow-sm: 0 8px 24px rgba(31, 41, 55, 0.08);
    --shadow-md: 0 18px 48px rgba(31, 41, 55, 0.12);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 8% 10%, rgba(37, 99, 235, 0.14), transparent 28%),
        radial-gradient(circle at 92% 0%, rgba(15, 118, 110, 0.12), transparent 30%),
        linear-gradient(135deg, var(--bg) 0%, #f8fbff 44%, var(--bg-deep) 100%);
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    opacity: 0.34;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.055) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.container {
    max-width: 1240px;
}

.header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(219, 227, 239, 0.9);
    box-shadow: 0 10px 30px rgba(31, 41, 55, 0.06);
    padding: 18px 0 16px;
    margin-bottom: 28px;
}

.header h1 {
    color: var(--text);
    letter-spacing: -0.03em;
    font-size: clamp(24px, 3vw, 34px);
    margin-bottom: 14px;
}

.ai-config-status {
    border-color: var(--border);
    background: var(--surface-muted);
    color: var(--text-muted);
}

.ai-config-btn,
.nav-btn,
.timer-btn,
.search-btn,
.review-start-btn,
.quiz-start-btn,
.submit-exam-btn,
.cache-btn,
.hide-btn,
.show-btn,
.review-questions-btn,
.restart-btn,
.clear-btn,
.danger-btn,
.ai-analyze-btn,
.goto-question-btn,
.remove-wrong-btn,
.remove-favorite-btn,
.favorite-wrong-btn,
.note-toggle-btn,
.save-note-btn {
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.nav-tabs {
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 1px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(246, 248, 251, 0.82);
}

.nav-btn {
    padding: 10px 18px;
    background: transparent;
    color: var(--text-muted);
    font-size: 15px;
}

.nav-btn:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.nav-btn.active,
.review-nav .nav-btn,
.quiz-nav .nav-btn,
.search-btn,
.goto-question-btn {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.section h2,
.review-header h2,
.quiz-header h2,
.search-header h2,
.ai-review-header h2 {
    color: var(--text);
    letter-spacing: -0.02em;
}

.test-header,
.review-filter,
.quiz-setup,
.wrong-stats,
.favorite-stats,
.ai-review-header,
.search-header {
    color: var(--text);
}

.test-header {
    padding: 5px;
    margin-bottom: 10px;
    border: 1px solid rgba(219, 227, 239, 0.85);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.56);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
}

.timer-label,
.question-info,
.bank-selector,
.checkbox-label,
.review-filter,
.quiz-setup,
.wrong-stats,
.favorite-stats {
    color: var(--text);
}

.timer {
    color: var(--primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.progress-bar {
    height: 10px;
    background: #dce5f1;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.question-card,
.side-panel,
.review-container,
.quiz-container,
.search-results,
.wrong-list,
.favorite-list,
.exam-result-section,
.quiz-result-summary,
.review-nav,
.quiz-nav,
.auth-panel,
.modal-card {
    background: var(--surface);
    border: 1px solid rgba(219, 227, 239, 0.92);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
}

.question-card,
.review-container,
.quiz-container,
.search-results,
.wrong-list,
.favorite-list {
    padding: clamp(22px, 3vw, 34px);
}

.question-header {
    border-bottom-color: var(--border);
}

.question-stem,
.review-card h3,
.quiz-card h3,
.wrong-item h3,
.favorite-item h3,
.search-item h3,
.search-result-card h3 {
    color: var(--text);
    letter-spacing: -0.01em;
}

.option-item,
.review-option,
.quiz-option,
.wrong-option,
.favorite-option,
.search-option {
    border-color: var(--border);
    background: var(--surface-solid);
    border-radius: var(--radius-md);
    box-shadow: 0 3px 10px rgba(31, 41, 55, 0.035);
}

.option-item:hover,
.quiz-option:hover,
.wrong-options.interactive .wrong-option:hover {
    border-color: rgba(37, 99, 235, 0.58);
    background: var(--primary-soft);
    transform: translateY(-1px);
}

.option-item.selected,
.quiz-option.selected,
.wrong-option.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--text);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.option-letter {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.22);
}

.option-item.correct,
.review-option.correct,
.wrong-option.correct,
.search-option.correct {
    border-color: var(--success);
    background: var(--success-soft);
    color: #14532d;
}

.option-item.wrong,
.wrong-option.wrong {
    border-color: var(--danger);
    background: var(--danger-soft);
    color: #7f1d1d;
}

.explanation,
.review-explanation,
.quiz-explanation,
.wrong-explanation,
.favorite-explanation,
.search-explanation,
.note-display,
.review-note,
.search-note {
    background: var(--warning-soft);
    border-left-color: var(--warning);
    color: #78350f;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.answer-result.correct,
.quiz-result.correct,
.wrong-result.correct,
.search-answer,
.favorite-answer,
.review-answer {
    background: var(--success-soft);
    color: #14532d;
}

.answer-result.wrong,
.quiz-result.wrong,
.wrong-result.wrong {
    background: var(--danger-soft);
    color: #7f1d1d;
}


.panel-header {
    color: var(--primary);
    border-bottom-color: var(--border);
}

.selected-answer,
.progress-stats,
.tag-report,
.wrong-options,
.favorite-options,
.ai-config-current,
.search-option {
    background: var(--surface-muted);
}

.grid-item {
    border-color: var(--border);
    background: var(--surface-solid);
    color: var(--text-muted);
}

.grid-item:hover,
.grid-item.current {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.grid-item.answered {
    background: var(--primary);
    border-color: var(--primary);
}

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

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

.tag,
.ai-keyword,
.trend-status,
.wrong-priority.normal {
    color: var(--primary-dark);
    background: var(--primary-soft);
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.ai-analysis,
.ai-exam-report {
    background: var(--accent-soft);
    border-color: rgba(15, 118, 110, 0.22);
    color: #134e4a;
}

.ai-analysis-title,
.ai-exam-report h3,
.ai-exam-report h4 {
    color: var(--accent);
}

input,
select,
textarea,
.search-box input,
.auth-panel input,
.ai-config-field input,
.admin-create input,
.admin-create select {
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-solid);
}

input:focus,
select:focus,
textarea:focus,
.search-box input:focus,
.auth-panel input:focus,
.ai-config-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.checkbox-label {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
}

.favorite-btn {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #d97706;
}

.favorite-btn:hover,
.favorite-btn.active,
.favorite-wrong-btn.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.review-start-btn,
.cache-btn,
.restart-btn,
.save-note-btn,
#start-btn {
    background: linear-gradient(135deg, var(--success), #059669);
    color: #fff;
}

.quiz-start-btn,
.submit-exam-btn,
.danger-btn,
.quiz-nav .nav-btn.submit-btn {
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    color: #fff;
}

.ai-analyze-btn,
.review-questions-btn {
    background: linear-gradient(135deg, var(--accent), #0891b2);
    color: #fff;
}

.hide-btn,
.show-btn,
.clear-btn,
.remove-wrong-btn,
.remove-favorite-btn,
.note-toggle-btn {
    background: var(--surface-muted);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

button:hover:not(:disabled),
.nav-btn:hover:not(:disabled),
.timer-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.empty-state {
    color: var(--text-muted);
}

.wrong-item,
.favorite-item,
.search-item,
.search-result-card,
.ai-report-card,
.ai-report-row,
.ai-profile-grid > div,
.user-row {
    border-color: var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-solid);
}

.wrong-item,
.favorite-item,
.search-item {
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.wrong-item:hover,
.favorite-item:hover {
    background: var(--primary-soft);
}

.modal-mask,
.paused-overlay {
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(8px);
}

.auth-screen {
    background:
        radial-gradient(circle at 30% 20%, rgba(37, 99, 235, 0.16), transparent 30%),
        linear-gradient(135deg, #eef3f8, #f8fbff);
}

@media (max-width: 768px) {
    .header {
        position: static;
    }

    .nav-tabs {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        border-radius: var(--radius-md);
    }

    .nav-btn {
        flex: 0 0 auto;
        padding: 9px 14px;
        font-size: 11px;
    }

    .test-header {
        padding: 10px;
    }

    .question-card,
    .review-container,
    .quiz-container,
    .search-results,
    .wrong-list,
    .favorite-list {
        padding: 18px;
        border-radius: var(--radius-md);
    }

    .side-panel {
        top: 0;
    }

    .search-box,
    .review-filter,
    .quiz-setup {
        flex-direction: column;
        align-items: stretch;
    }

    .search-btn,
    .review-start-btn,
    .quiz-start-btn {
        width: 100%;
    }
}

.navigation .nav-btn {
    color: var(--primary-dark);
    background: var(--surface-solid);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.navigation .nav-btn:hover:not(:disabled) {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.navigation .nav-btn:disabled {
    color: var(--text-muted);
    background: var(--surface-muted);
    box-shadow: none;
}

.timer-section .cache-btn,
.timer-section .danger-btn {
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    border: 0;
    cursor: pointer;
}

.timer-section .danger-btn {
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.platform-cache-btn {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
}

.focus-header-toggle-dock {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 8px;
}

.focus-header-toggle-dock .focus-header-toggle-btn {
    min-width: 34px;
    width: 34px;
    height: 28px;
    padding: 0;
    border-radius: 999px;
    line-height: 1;
}

.timer-section .danger-btn:hover,
.timer-section .cache-btn:hover,
.platform-cache-btn:hover {
    transform: translateY(-1px);
}

.favorite-answer-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 10px;
    font-weight: 700;
}

.favorite-options.interactive .favorite-option {
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.favorite-options.interactive .favorite-option:hover {
    transform: translateX(3px);
    border-color: var(--primary, #2563eb);
    background: rgba(37, 99, 235, 0.08);
}

.favorite-option.correct {
    border-color: #16a34a !important;
    background: #dcfce7 !important;
    color: #166534;
    font-weight: 700;
}

.favorite-option.wrong {
    border-color: #dc2626 !important;
    background: #fee2e2 !important;
    color: #991b1b;
    font-weight: 700;
}

/* ===== 非专注模式布局压缩与固定题框 ===== */
body:not(.exam-focus-mode) .header {
    width: 100%;
    margin: 0 0 15px;
    padding: 10px 0;
    border-radius: 0 0 18px 18px;
}

body:not(.exam-focus-mode) .header h1 {
    margin-bottom: 8px;
    font-size: 18px;
    line-height: 1.2;
}

body:not(.exam-focus-mode) .header .container {
    padding: 0 14px;
}

body:not(.exam-focus-mode) .ai-config-bar {
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
}

body:not(.exam-focus-mode) .ai-config-btn,
body:not(.exam-focus-mode) .platform-cache-btn {
    padding: 6px 10px;
    font-size: 12px;
}

body:not(.exam-focus-mode) .nav-tabs {
    gap: 6px;
}

body:not(.exam-focus-mode) .tab-btn {
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 999px;
}

body:not(.exam-focus-mode) .test-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 5px 10px;
}

body:not(.exam-focus-mode) .timer-section {
    grid-column: 1 / -1;
    justify-content: flex-start;
    margin-bottom: 0;
    gap: 10px;
}

body:not(.exam-focus-mode) .bank-selector {
    justify-content: flex-start;
    margin: 0 8px 0 0;
    color: var(--text, #1f2937);
    font-size: 13px;
}

body:not(.exam-focus-mode) .bank-selector select {
    min-width: 168px;
    padding: 7px 10px;
    font-size: 13px;
}

body:not(.exam-focus-mode) .progress-bar {
    grid-column: 1;
    margin: 0;
}

body:not(.exam-focus-mode) .question-info {
    grid-column: 2;
    margin: 0;
    white-space: nowrap;
}

body:not(.exam-focus-mode) .exam-options,
body:not(.exam-focus-mode) .focus-header-toggle-dock {
    grid-column: 1 / -1;
}

body:not(.exam-focus-mode) .question-area {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: stretch;
    gap: 18px;
    height: 620px;
    overflow: hidden;
}

body:not(.exam-focus-mode) .question-card {
    height: 100%;
    min-height: 0;
    margin-bottom: 0;
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

body:not(.exam-focus-mode) .question-stem {
    font-size: 14px;
    line-height: 1.65;
}

body:not(.exam-focus-mode) .option-item {
    padding: 11px 13px;
    border-radius: 12px;
}

body:not(.exam-focus-mode) .option-letter {
    width: 26px;
    height: 26px;
    margin-right: 10px;
    font-size: 12px;
}

body:not(.exam-focus-mode) .option-text {
    font-size: 11px;
    line-height: 1.45;
}

body:not(.exam-focus-mode) .side-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
    gap: 4px;
}

body:not(.exam-focus-mode) .answer-grid {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 10px 16px 8px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    align-content: start;
}

body:not(.exam-focus-mode) .panel-header {
    margin-bottom: 6px;
    padding-bottom: 4px;
    font-size: 13px;
    flex-shrink: 0;
}

body:not(.exam-focus-mode) .selected-answer {
    margin-bottom: 4px;
    padding: 6px 8px;
    min-height: auto;
    font-size: 12px;
    flex-shrink: 0;
}

body:not(.exam-focus-mode) .selected-option {
    font-size: 16px;
}

body:not(.exam-focus-mode) .progress-stats {
    margin-bottom: 4px;
    padding: 6px 8px;
    font-size: 12px;
    flex-shrink: 0;
}

body:not(.exam-focus-mode) .progress-stats div {
    margin-bottom: 2px;
    font-size: 11px;
}

@media (max-width: 900px) {
    body:not(.exam-focus-mode) .question-area {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    body:not(.exam-focus-mode) .question-card {
        height: 560px;
    }

    body:not(.exam-focus-mode) .side-panel {
        height: 360px;
    }
}

/* ===== 第二阶段：正式考试舱第一步 ===== */
body.exam-focus-mode {
    height: 100vh;
    padding-bottom: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% -10%, rgba(37, 99, 235, 0.12), transparent 34%),
        linear-gradient(135deg, #edf4fb 0%, #f8fbff 52%, #e8f0f7 100%);
}

body.exam-focus-mode .header {
    transform: translateY(-100%);
    height: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    box-shadow: none;
}

body.exam-focus-mode main.container {
    position: fixed;
    inset: 0;
    max-width: none;
    width: 100%;
    height: 100vh;
    padding: 10px 12px 76px;
    overflow: hidden;
}

/* 考试结果展示时，底部给导航条留更多空间 */
body.exam-focus-mode main.container:has(.exam-result-section) {
    padding-bottom: 100px;
}

body.exam-focus-mode .test-header {
    position: relative;
    top: auto;
    z-index: 850;
    display: grid;
    grid-template-columns: minmax(280px, auto) 1fr auto;
    align-items: center;
    gap: 7px 9px;
    padding: 10px 14px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.13);
}

body.exam-focus-mode .test-header::before {
    content: "专注考试模式";
    grid-column: 1 / -1;
    justify-self: start;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

body.exam-focus-mode .timer-section {
    justify-content: flex-start;
    margin: 0;
    gap: 10px;
}

body.exam-focus-mode .timer-label {
    font-size: 13px;
    color: var(--text-muted);
}

body.exam-focus-mode .timer {
    padding: 9px 18px;
    font-size: 22px;
    color: var(--primary-dark);
    background: var(--primary-soft);
}

body.exam-focus-mode .progress-bar {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
}

body.exam-focus-mode .question-info {
    grid-column: 3;
    grid-row: 2;
    margin: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

body.exam-focus-mode .focus-header-toggle-dock {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: -4px;
}

body.exam-focus-mode .focus-header-toggle-dock .focus-header-toggle-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

body.exam-focus-mode .bank-selector,
body.exam-focus-mode .exam-options,
body.exam-focus-mode #start-btn,
body.exam-focus-mode #reset-exam-btn {
    display: none;
}

body.exam-focus-mode .focus-exit-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: var(--surface-muted);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

body.exam-focus-mode .question-area {
    display: flex;
    align-items: stretch;
    gap: 12px;
    height: calc(100vh - 176px);
    margin-top: 8px;
    overflow: hidden;
}

body.exam-focus-mode.focus-header-collapsed .test-header {
    grid-template-columns: auto 1fr;
    gap: 8px 12px;
    padding: 9px 12px;
    border-radius: 18px;
}

body.exam-focus-mode.focus-header-collapsed .test-header::before,
body.exam-focus-mode.focus-header-collapsed .timer-label,
body.exam-focus-mode.focus-header-collapsed .question-info,
body.exam-focus-mode.focus-header-collapsed #reset-exam-btn,
body.exam-focus-mode.focus-header-collapsed #exit-exam-btn,
body.exam-focus-mode.focus-header-collapsed #pause-btn,
body.exam-focus-mode.focus-header-collapsed .focus-tools-btn,
body.exam-focus-mode.focus-header-collapsed .answer-panel-toggle-btn,
body.exam-focus-mode.focus-header-collapsed .focus-exit-btn {
    display: none !important;
}

body.exam-focus-mode.focus-header-collapsed .timer-section {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    gap: 8px;
    margin: 0;
}

body.exam-focus-mode.focus-header-collapsed .timer {
    padding: 7px 14px;
    font-size: 18px;
}

body.exam-focus-mode.focus-header-collapsed .focus-header-toggle-btn {
    display: inline-flex !important;
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    font-size: 16px;
}

body.exam-focus-mode.focus-header-collapsed .progress-bar {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin: 0;
}

body.exam-focus-mode.focus-header-collapsed .question-area,
body.exam-focus-mode.focus-header-collapsed.answer-panel-collapsed .question-area {
    height: calc(100vh - 154px);
    margin-top: 10px;
}

body.exam-focus-mode .question-card {
    min-height: 0;
    height: 100%;
    padding: 18px 20px;
    border-radius: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

body.exam-focus-mode .question-card::-webkit-scrollbar,
body.exam-focus-mode .side-panel::-webkit-scrollbar {
    width: 8px;
}

body.exam-focus-mode .question-card::-webkit-scrollbar-track,
body.exam-focus-mode .side-panel::-webkit-scrollbar-track {
    background: transparent;
}

body.exam-focus-mode .question-card::-webkit-scrollbar-thumb,
body.exam-focus-mode .side-panel::-webkit-scrollbar-thumb {
    background: rgba(102, 112, 133, 0.28);
    border-radius: 999px;
}

body.exam-focus-mode .question-card::-webkit-scrollbar-thumb:hover,
body.exam-focus-mode .side-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 112, 133, 0.46);
}

body.exam-focus-mode .question-header {
    gap: 14px;
    margin-bottom: 14px;
    padding-bottom: 14px;
}

body.exam-focus-mode .question-stem {
    font-size: clamp(14px, 1.3vw, 17px);
    line-height: 1.65;
}

body.exam-focus-mode .options {
    gap: 10px;
}

body.exam-focus-mode .option-item {
    padding: 12px 14px;
    border-radius: 14px;
}

body.exam-focus-mode .option-letter {
    width: 28px;
    height: 28px;
    margin-right: 10px;
    font-size: 13px;
}

body.exam-focus-mode .option-text {
    font-size: 13px;
    line-height: 1.55;
}

body.exam-focus-mode .question-ai-actions,
body.exam-focus-mode .question-note,
body.exam-focus-mode .ai-analysis {
    display: none !important;
}

body.exam-focus-mode.focus-tools-open .question-ai-actions,
body.exam-focus-mode.focus-tools-open .question-note {
    display: flex !important;
    opacity: 1;
}

body.exam-focus-mode.focus-tools-open .question-note {
    display: block !important;
}

body.exam-focus-mode.focus-tools-open .ai-analysis {
    display: block !important;
}

body.exam-focus-mode .side-panel {
    width: 300px;
    height: calc(100% - 76px);
    top: auto;
    align-self: flex-start;
    flex: 0 0 300px;
    border-radius: 24px;
    overflow: hidden;
    box-sizing: border-box;
    transition: width 0.2s ease, padding 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

body.exam-focus-mode.answer-panel-collapsed .question-area {
    display: block;
    height: calc(100vh - 176px);
    overflow: hidden;
}

body.exam-focus-mode.answer-panel-collapsed .question-card {
    width: min(980px, 100%);
    height: 100%;
    margin: 0 auto;
}

body.exam-focus-mode.answer-panel-collapsed .side-panel {
    width: 0;
    height: 0;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateX(18px);
}

body.exam-focus-mode .focus-tools-btn,
body.exam-focus-mode .answer-panel-toggle-btn,
body.exam-focus-mode .focus-header-toggle-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: #eef6ff;
    color: var(--primary-dark);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

body.exam-focus-mode.focus-tools-open .focus-tools-btn,
body.exam-focus-mode.answer-panel-collapsed .answer-panel-toggle-btn {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

body.exam-focus-mode.focus-tools-open .question-card {
    border-color: rgba(15, 118, 110, 0.25);
}

body.exam-focus-mode.focus-tools-open .question-note,
body.exam-focus-mode.focus-tools-open .question-ai-actions,
body.exam-focus-mode.focus-tools-open .ai-analysis {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

.answer-panel-close-btn {
    display: none;
}

.answer-panel-summary {
    display: block;
}

body.exam-focus-mode .panel-header {
    font-size: 14px;
}

body.exam-focus-mode .answer-grid {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 10px 16px 8px;
    align-content: start;
}

body.exam-focus-mode .navigation {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 860;
    width: min(820px, calc(100vw - 32px));
    transform: translateX(-50%);
    justify-content: center;
    gap: 12px;
    margin: 0;
    padding: 12px;
    border: 1px solid rgba(219, 227, 239, 0.92);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(18px);
}

/* 考试结果展示时，导航条贴底且不抢结果区空间 */
body.exam-focus-mode:has(.exam-result-section) .navigation {
    padding: 6px 10px;
    gap: 6px;
    width: auto;
    bottom: 12px;
}

body.exam-focus-mode .navigation #hide-answered-btn,
body.exam-focus-mode .navigation #show-all-btn,
body.exam-focus-mode .navigation #clear-cache-btn {
    display: none !important;
}

body.exam-focus-mode .navigation .nav-btn,
body.exam-focus-mode .navigation .submit-exam-btn {
    min-width: 120px;
    padding: 12px 22px;
}

body.exam-focus-mode .navigation #next-btn {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

@media (max-width: 900px) {
    body.exam-focus-mode main.container {
        padding: 10px 10px 104px;
    }

    body.exam-focus-mode .test-header {
        position: relative;
        top: 0;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    body.exam-focus-mode .progress-bar,
    body.exam-focus-mode .question-info {
        grid-column: 1;
        grid-row: auto;
    }

    body.exam-focus-mode .question-area {
        height: calc(100vh - 270px);
        flex-direction: column;
        overflow: hidden;
    }

    body.exam-focus-mode .question-card {
        min-height: 0;
        height: 100%;
        padding: 16px;
    }

    body.exam-focus-mode .side-panel {
        width: 100%;
        height: 220px;
        flex: 0 0 220px;
        top: 0;
    }

    body.exam-focus-mode.answer-panel-collapsed .question-area {
        height: calc(100vh - 270px);
    }

    body.exam-focus-mode .navigation {
        border-radius: 22px;
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    body.exam-focus-mode main.container {
        padding: 8px 8px 94px;
    }

    body.exam-focus-mode .test-header {
        gap: 8px;
        padding: 10px;
        border-radius: 16px;
    }

    body.exam-focus-mode .test-header::before {
        display: none;
    }

    body.exam-focus-mode .timer-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    body.exam-focus-mode .timer-label {
        display: none;
    }

    body.exam-focus-mode .timer {
        grid-column: 1 / -1;
        width: 100%;
        padding: 8px 10px;
        border-radius: 14px;
        font-size: 18px;
        text-align: center;
    }

    body.exam-focus-mode .timer-btn {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 12px;
        border-radius: 14px;
    }

    body.exam-focus-mode .progress-bar {
        height: 8px;
    }

    body.exam-focus-mode .question-info {
        justify-self: stretch;
        text-align: center;
        padding: 7px 10px;
        font-size: 13px;
    }

    body.exam-focus-mode .question-area,
    body.exam-focus-mode.answer-panel-collapsed .question-area {
        height: calc(100vh - 280px);
        margin-top: 8px;
        display: block;
    }

    body.exam-focus-mode.focus-header-collapsed .test-header {
        grid-template-columns: auto 1fr;
        padding: 8px 10px;
    }

    body.exam-focus-mode.focus-header-collapsed .timer-section {
        display: flex;
        grid-template-columns: none;
        width: auto;
    }

    body.exam-focus-mode.focus-header-collapsed .timer {
        width: auto;
        min-width: 118px;
        font-size: 16px;
    }

    body.exam-focus-mode.focus-header-collapsed .progress-bar {
        grid-column: 2;
        grid-row: 1;
    }

    body.exam-focus-mode.focus-header-collapsed .question-area,
    body.exam-focus-mode.focus-header-collapsed.answer-panel-collapsed .question-area {
        height: calc(100vh - 176px);
    }

    body.exam-focus-mode .question-card,
    body.exam-focus-mode.answer-panel-collapsed .question-card {
        width: 100%;
        height: 100%;
        padding: 14px;
        border-radius: 18px;
    }

    body.exam-focus-mode .question-header {
        gap: 10px;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    body.exam-focus-mode .question-stem {
        font-size: 13px;
        line-height: 1.6;
    }

    body.exam-focus-mode .question-tags {
        gap: 6px;
        margin-bottom: 10px;
    }

    body.exam-focus-mode .tag {
        padding: 3px 8px;
        font-size: 11px;
    }

    body.exam-focus-mode .options {
        gap: 8px;
    }

    body.exam-focus-mode .option-item {
        padding: 10px;
        border-radius: 12px;
    }

    body.exam-focus-mode .option-letter {
        width: 26px;
        height: 26px;
        margin-right: 8px;
        font-size: 12px;
    }

    body.exam-focus-mode .option-text {
        font-size: 12px;
        line-height: 1.5;
    }

    body.exam-focus-mode .favorite-btn {
        width: 38px;
        height: 38px;
        padding: 7px;
        font-size: 18px;
    }

    body.exam-focus-mode .answer-panel-toggle-btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    body.exam-focus-mode .side-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 980;
        display: flex;
        flex-direction: column;
        width: auto;
        height: min(56vh, 430px);
        padding: 14px 14px 16px;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -18px 54px rgba(15, 23, 42, 0.24);
        transform: translateY(0);
    }

    body.exam-focus-mode.answer-panel-collapsed .side-panel {
        width: auto;
        height: min(56vh, 430px);
        padding: 14px 14px 16px;
        opacity: 0;
        pointer-events: none;
        transform: translateY(calc(100% + 32px));
    }

    body.exam-focus-mode .answer-panel-close-btn {
        position: absolute;
        top: 10px;
        right: 12px;
        z-index: 2;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        border: 0;
        border-radius: 999px;
        color: var(--text-muted);
        background: var(--surface-muted);
        font-size: 20px;
        font-weight: 800;
        cursor: pointer;
    }

    body.exam-focus-mode .answer-panel-summary {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        flex: 0 0 20%;
        min-height: 68px;
        max-height: 20%;
        padding-right: 34px;
        overflow: hidden;
    }

    body.exam-focus-mode .answer-summary-block {
        min-width: 0;
        padding: 8px;
        border-radius: 14px;
        background: var(--surface-muted);
        overflow: hidden;
    }

    body.exam-focus-mode .answer-summary-block .panel-header {
        margin-bottom: 4px;
        font-size: 11px;
        line-height: 1.2;
        white-space: nowrap;
    }

    body.exam-focus-mode .selected-answer,
    body.exam-focus-mode .progress-stats {
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        font-size: 11px;
        line-height: 1.35;
    }

    body.exam-focus-mode .progress-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
    }

    body.exam-focus-mode .answer-grid-title {
        flex: 0 0 auto;
        margin: 10px 0 8px;
        font-size: 12px;
    }

    body.exam-focus-mode .answer-grid {
        flex: 1 1 auto;
        grid-template-columns: repeat(8, minmax(0, 1fr));
        gap: 6px;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        padding-right: 4px;
    }

    body.exam-focus-mode .grid-item {
        min-width: 30px;
        min-height: 30px;
        font-size: 11px;
        border-radius: 8px;
    }

    body.exam-focus-mode .navigation {
        left: 8px;
        right: 8px;
        bottom: 8px;
        width: auto;
        transform: none;
        display: grid;
        grid-template-columns: 1fr 1fr 1.2fr;
        gap: 8px;
        padding: 8px;
        border-radius: 18px;
    }

    body.exam-focus-mode .navigation .nav-btn,
    body.exam-focus-mode .navigation .submit-exam-btn {
        min-width: 0;
        width: 100%;
        min-height: 42px;
        padding: 9px 8px;
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    body.exam-focus-mode .timer-section {
        grid-template-columns: 1fr;
    }

    body.exam-focus-mode .timer {
        font-size: 17px;
    }

    body.exam-focus-mode .question-area,
    body.exam-focus-mode.answer-panel-collapsed .question-area {
        height: calc(100vh - 332px);
    }

    body.exam-focus-mode.focus-header-collapsed .timer-section {
        flex-direction: row;
    }

    body.exam-focus-mode.focus-header-collapsed .question-area,
    body.exam-focus-mode.focus-header-collapsed.answer-panel-collapsed .question-area {
        height: calc(100vh - 214px);
    }

    body.exam-focus-mode .navigation {
        grid-template-columns: 1fr;
    }
}

/* ===== 备案信息 Footer ===== */
.site-footer {
    margin-top: 30px;
    padding: 16px 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
}

.site-footer .footer-beian {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.site-footer .footer-beian a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer .footer-beian a:hover {
    color: #fff;
    text-decoration: underline;
}

.site-footer .footer-separator {
    color: rgba(255, 255, 255, 0.35);
}

.site-footer .footer-info {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}


