/* ===== 基础设置 ===== */
:root {
    --primary: #FF8C42;
    --primary-light: #FFB347;
    --secondary: #4ECDC4;
    --success: #6BCB77;
    --danger: #FF6B6B;
    --warning: #FFD93D;
    --bg: #FFF8F0;
    --card-bg: #ffffff;
    --text: #2D3436;
    --text-light: #636E72;
    --shadow: 0 8px 32px rgba(0,0,0,0.1);
    --radius: 20px;
    --radius-sm: 12px;
}

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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* ===== 页面切换 ===== */
.screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

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

/* ===== 首页 ===== */
.hero {
    text-align: center;
    padding: 40px 20px;
}

.mascot {
    font-size: 80px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.hero h1 {
    font-size: 36px;
    background: linear-gradient(135deg, var(--primary), var(--warning));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 15px 0;
}

.subtitle {
    font-size: 18px;
    color: var(--text-light);
}

.upload-area {
    background: var(--card-bg);
    border: 3px dashed var(--primary-light);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    margin: 20px 0;
    transition: all 0.3s;
}

.upload-area.dragover {
    background: #FFF3E0;
    border-color: var(--primary);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.upload-or {
    color: var(--text-light);
    margin: 10px 0;
    font-size: 14px;
}

.upload-hint {
    font-size: 12px;
    color: #aaa;
    margin-top: 15px;
}

.quick-start {
    text-align: center;
    padding: 20px;
}

.quick-start p {
    color: var(--text-light);
    margin-bottom: 15px;
}

/* ===== 按钮 ===== */
.btn {
    border: none;
    border-radius: 50px;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    outline: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), #45B7AA);
    color: white;
}

.btn-large {
    padding: 16px 36px;
    font-size: 18px;
}

.btn-back {
    background: #f0f0f0;
    color: var(--text);
    padding: 8px 16px;
    font-size: 14px;
}

.btn-nav {
    background: #f0f0f0;
    color: var(--text);
    font-size: 14px;
}

.btn-next {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.btn-card {
    background: var(--warning);
    color: var(--text);
    padding: 8px 16px;
    font-size: 14px;
    margin: 10px 0;
}

.btn-submit {
    width: 100%;
    margin-top: 20px;
    padding: 16px;
    font-size: 20px;
}

.btn-reference {
    background: linear-gradient(135deg, #9B59B6, #8E44AD);
    color: white;
    padding: 14px 32px;
    font-size: 16px;
}

.btn-close {
    background: none;
    font-size: 24px;
    padding: 0;
    width: 40px;
    height: 40px;
}

.btn-option {
    flex: 1;
    min-width: 0;
    text-align: left;
    background: var(--card-bg);
    border: 3px solid #E8E8E8;
    border-radius: var(--radius-sm);
    padding: 16px 12px;
    margin: 0;
    font-size: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: normal;
    overflow: hidden;
    word-break: break-word;
}

.btn-option img {
    max-width: 100%;
    max-height: 150px;
    vertical-align: middle;
    pointer-events: none;
    user-select: none;
    display: block;
    margin: 5px auto;
}

/* 包含图片的选项按钮使用垂直布局 */
.btn-option.has-image {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding-top: 8px;
    padding-bottom: 8px;
    min-height: unset;
}

.btn-option.has-image .opt-label {
    margin-bottom: 4px;
}

.btn-option:hover {
    border-color: var(--primary-light);
    background: #FFF8F0;
}

.btn-option.selected {
    border-color: var(--primary);
    background: #FFF3E0;
}

.btn-option.correct {
    border-color: var(--success);
    background: #E8F5E9;
    animation: correctPop 0.5s ease;
}

.btn-option.wrong {
    border-color: var(--danger);
    background: #FFEBEE;
    animation: shake 0.5s ease;
}

.btn-option .opt-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    font-weight: bold;
    flex-shrink: 0;
}

.btn-option.selected .opt-label {
    background: var(--primary);
    color: white;
}

.btn-option.correct .opt-label {
    background: var(--success);
    color: white;
}

.btn-option.wrong .opt-label {
    background: var(--danger);
    color: white;
}

@keyframes correctPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

/* ===== 加载页 ===== */
.loader {
    text-align: center;
    padding: 80px 20px;
}

.loader-robot {
    font-size: 80px;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loader p {
    margin: 20px 0;
    font-size: 18px;
    color: var(--text-light);
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #E8E8E8;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-bar.thin {
    height: 10px;
}

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

/* ===== 答题页 ===== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 10px;
}

.exam-title {
    font-weight: bold;
    font-size: 16px;
    color: var(--text-light);
}

.timer, .stars-counter {
    background: var(--card-bg);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: var(--shadow);
}

.timer {
    color: var(--primary);
}

.timer.overtime {
    color: var(--danger);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.stars-counter {
    color: var(--warning);
}

.progress-section {
    margin-bottom: 15px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.question-area {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    margin: 15px 0;
    box-shadow: var(--shadow);
}

.question-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--secondary), #45B7AA);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 15px;
}

.question-text {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 15px;
    color: var(--text);
}

.question-images {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 15px 0;
    align-items: center;
}

.question-images img,
.question-content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: block;
    margin: 10px auto;
}

.question-images img.opt-img {
    max-height: 150px;
}

.btn-option img {
    max-height: 150px;
    vertical-align: middle;
}

.options-area {
    margin-top: 20px;
    display: flex;
    flex-direction: row;
    gap: 12px;
    flex-wrap: nowrap;
}

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

.reference-content {
    padding: 15px;
    margin-top: 10px;
    text-align: left;
}

.reference-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.program-area {
    margin-top: 20px;
    text-align: center;
}

/* ===== 用户输入区域（填空/简答/作文等） ===== */
.user-input-fill {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #E8E8E8;
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text);
    transition: border-color 0.3s;
    font-family: inherit;
}

.user-input-fill:focus {
    outline: none;
    border-color: var(--primary);
}

.user-input-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #E8E8E8;
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text);
    transition: border-color 0.3s;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.user-input-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.reference-images {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    align-items: center;
}

.reference-images img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* ===== 反馈区域 ===== */
.feedback-area {
    margin-top: 20px;
    display: none;
}

.feedback-area.show {
    display: block;
    animation: slideUp 0.4s ease;
}

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

.feedback-content {
    padding: 20px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.feedback-content.correct {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border: 2px solid var(--success);
}

.feedback-content.wrong {
    background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
    border: 2px solid var(--danger);
}

.feedback-emoji {
    font-size: 48px;
    margin-bottom: 10px;
}

.feedback-text {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.feedback-content.correct .feedback-text {
    color: #2E7D32;
}

.feedback-content.wrong .feedback-text {
    color: #C62828;
}

.feedback-analysis {
    font-size: 16px;
    color: var(--text);
    margin-top: 10px;
}

/* ===== AI 加载动画 ===== */
.ai-thinking {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
}

.ai-thinking-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    animation: aiBounce 1.4s ease-in-out infinite both;
}

.ai-thinking-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-thinking-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes aiBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.feedback-hint {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 5px;
}

/* ===== 解题思路展示 ===== */
.solution-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--danger), transparent);
    margin: 16px 0;
    border-radius: 1px;
}

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

.solution-icon {
    font-size: 22px;
}

.solution-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--danger);
}

.solution-body {
    text-align: left;
    background: rgba(255,255,255,0.7);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 8px;
}

.solution-section-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary);
    margin: 14px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 2px dashed var(--primary-light);
}

.solution-section-title:first-child {
    margin-top: 0;
}

.solution-list {
    margin: 8px 0 8px 20px;
    padding-left: 0;
    list-style: none;
}

.solution-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 6px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
}

.solution-list li::before {
    content: '🔹';
    position: absolute;
    left: 0;
    top: 0;
}

.solution-para {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 8px;
}

.solution-para strong {
    color: var(--primary);
}

.feedback-analysis-pdf {
    background: rgba(255,255,255,0.5);
    padding: 10px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--secondary);
}

/* ===== 确认弹窗 ===== */
.confirm-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    max-width: 400px;
    width: 90%;
    margin: auto;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: popIn 0.3s ease;
}

.confirm-message {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 30px;
}

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

.confirm-actions .btn {
    min-width: 120px;
}

/* ===== 这题我不会按钮 ===== */
.ask-ai-area {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.btn-ask-ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    font-size: 15px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.btn-ask-ai:active {
    transform: translateY(0);
}

/* ===== 答题卡/交卷弹窗 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

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

.card-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    border: 2px solid #E8E8E8;
    background: var(--card-bg);
}

.card-item:hover {
    border-color: var(--primary);
}

.card-item.answered {
    background: var(--primary-light);
    border-color: var(--primary);
    color: white;
}

.card-item.current {
    border-color: var(--warning);
    border-width: 3px;
}

/* ===== 结果页 ===== */
.result-hero {
    text-align: center;
    padding: 40px 20px;
}

.trophy {
    font-size: 80px;
    animation: trophyBounce 1s ease infinite;
}

@keyframes trophyBounce {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.result-hero h1 {
    font-size: 28px;
    margin: 15px 0;
    color: var(--text);
}

.score-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--warning));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    box-shadow: var(--shadow);
    color: white;
}

.score-num {
    font-size: 48px;
    font-weight: bold;
}

.score-total {
    font-size: 20px;
}

.result-message {
    font-size: 18px;
    color: var(--text-light);
    margin: 10px 0;
}

.result-stars {
    font-size: 32px;
    margin: 10px 0;
    animation: bounce 1s infinite;
}

.result-stats {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 20px;
}

/* ===== 错题回顾 ===== */
.review-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 0;
}

.review-section-header {
    font-size: 18px;
    font-weight: bold;
    color: var(--accent);
    padding: 12px 0 4px;
    border-bottom: 2px solid var(--accent);
    margin-bottom: 4px;
}

.review-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--danger);
}

.review-item.correct {
    border-left-color: var(--success);
}

.review-header {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--danger);
}

.review-question-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-break: break-word;
}

.review-question-label {
    font-weight: bold;
    font-size: 20px;
    color: #333;
    margin: 12px 0 4px;
}

.review-question-img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
    display: block;
}

.review-options {
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.review-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #f8f9fa;
    position: relative;
}

.review-option.correct {
    background: #E8F5E9;
    border: 1px solid #A5D6A7;
}

.review-option.wrong-selected {
    background: #FFEBEE;
    border: 1px solid #EF9A9A;
}

.review-option-label {
    font-weight: bold;
    min-width: 24px;
    color: var(--accent);
    flex-shrink: 0;
}

.review-option-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.review-option-text img {
    max-width: 100%;
    border-radius: 6px;
    display: block;
}

.review-option-img {
    max-width: 100%;
    border-radius: 6px;
    margin: 6px 0;
    display: block;
}

.review-option-badge {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 16px;
}

.review-answer-bar {
    margin: 12px 0;
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
}

.review-answer-bar.answered {
    background: #FFEBEE;
}

.review-answer-bar.unanswered {
    background: #FFF8E1;
}

.review-correct-answer {
    color: var(--success);
    font-weight: bold;
}

.review-reference {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.review-reference-title {
    font-weight: bold;
    color: var(--text-light);
    margin-bottom: 4px;
}

.review-reference-content {
    white-space: pre-wrap;
    color: var(--text);
}

.review-analysis {
    margin-top: 10px;
    color: var(--text-light);
}

.review-explanation-title {
    font-weight: bold;
    color: var(--danger);
    margin-top: 12px;
    margin-bottom: 4px;
}

.review-item.correct .review-header {
    color: var(--success);
}

.review-explanation {
    background: rgba(255,255,255,0.8);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.review-explanation .solution-section-title {
    font-size: 14px;
    margin: 10px 0 6px 0;
}

.review-explanation .solution-list {
    margin: 6px 0 6px 16px;
}

.review-explanation .solution-list li {
    font-size: 14px;
    margin-bottom: 4px;
}

.review-explanation .solution-para {
    font-size: 14px;
    margin-bottom: 6px;
}

/* ===== 彩带Canvas ===== */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* ===== 鼓励气泡 ===== */
.encourage-bubble {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 24px;
    font-weight: bold;
    box-shadow: var(--shadow);
    z-index: 998;
    display: none;
    pointer-events: none;
}

.encourage-bubble.show {
    display: block;
    animation: bubblePop 1s ease forwards;
}

@keyframes bubblePop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ===== 声音按钮 ===== */
.sound-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 100;
}

/* ===== 左侧题号导航 ===== */
.question-sidebar {
    position: fixed;
    top: 100px;
    left: calc(50% - 550px - 110px);
    width: 90px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 15px 8px;
    box-shadow: var(--shadow);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.sidebar-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid #E8E8E8;
    background: white;
    transition: all 0.2s;
    color: var(--text);
    flex-shrink: 0;
}

.sidebar-number:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

.sidebar-number.current {
    border-color: var(--warning);
    border-width: 3px;
    box-shadow: 0 0 0 3px rgba(255, 217, 61, 0.3);
}

.sidebar-number.correct {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.sidebar-number.wrong {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.sidebar-number.ai-helped {
    background: #FFD700;
    border-color: #FFC107;
    color: white;
}

.sidebar-number.unanswered {
    background: #f5f5f5;
    border-color: #ddd;
    color: #aaa;
}

/* 小屏幕隐藏左侧导航 */
@media (max-width: 1100px) {
    .question-sidebar {
        display: none;
    }
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
    .hero h1 {
        font-size: 28px;
    }

    .ai-tagline {
        font-size: 16px;
        letter-spacing: 2px;
    }

    .ai-tagline .ai-badge {
        font-size: 16px;
    }
    
    .question-text {
        font-size: 16px;
    }
    
    .card-body {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .top-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .exam-title {
        order: 3;
        width: 100%;
        text-align: center;
    }
}

/* ===== 图片放大弹窗 ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: var(--radius-md);
    padding: 20px;
    overflow: auto;
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0,0,0,0.5);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(0,0,0,0.7);
}

.lightbox-images {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.lightbox-images img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-sm);
}

.lightbox-hint {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin-top: 10px;
}

/* 选项图片放大图标 */
.btn-option {
    position: relative;
}

.img-zoom-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0,0,0,0.4);
    color: white;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-option:hover .img-zoom-btn {
    opacity: 1;
}

.img-zoom-btn:hover {
    background: rgba(0,0,0,0.7);
    transform: scale(1.1);
}

/* 移动端始终显示放大图标 */
@media (max-width: 700px) {
    .img-zoom-btn {
        opacity: 1;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* 移动端选项图片更大 */
@media (max-width: 700px) {
    .btn-option img {
        max-height: 200px;
    }
}

/* ===== 复合题子题样式 ===== */
.sub-question {
    margin-bottom: 20px;
    padding: 16px;
    background: #fafafa;
    border-radius: 12px;
    border: 2px solid #eee;
    transition: border-color 0.3s;
}

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

.sub-question-header {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--primary);
    font-size: 16px;
}

.sub-options-area {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.sub-options-area .btn-option {
    flex: 1;
    min-width: 120px;
}

.sub-feedback {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 15px;
}

.sub-feedback.correct {
    background: #E8F5E9;
    color: #2E7D32;
}

.sub-feedback.wrong {
    background: #FFEBEE;
    color: #C62828;
}

@media (max-width: 700px) {
    .sub-options-area {
        flex-direction: column;
    }
    .sub-options-area .btn-option {
        min-width: unset;
    }
}

/* ========== 用户栏 ========== */
.user-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    margin: 0 20px 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #666;
}

.btn-login-small {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-login-small:hover {
    background: #e67a3a;
    transform: scale(1.05);
}

.btn-mistake-book {
    background: var(--secondary);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.btn-mistake-book:hover {
    background: #3bb8b0;
}

.btn-logout-small {
    background: #999;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
}

.btn-logout-small:hover {
    background: #777;
}

/* ========== 登录页 ========== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 24px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow);
}

.login-tabs {
    display: flex;
    background: #f0f0f0;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.login-tabs .tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    transition: all 0.3s;
}

.login-tabs .tab.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-form-wrap {
    min-height: 200px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    font-size: 16px;
}

.error-msg {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 10px;
    min-height: 18px;
    text-align: center;
}

.btn-back-home {
    width: 100%;
    margin-top: 16px;
}

/* ===== 微信登录 ===== */
.wechat-login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0 12px;
    gap: 12px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.divider-text {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}

.btn-wechat {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    border: 2px solid #07c160;
    border-radius: 12px;
    background: #fff;
    color: #07c160;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    gap: 8px;
}

.btn-wechat:hover {
    background: #f0fff4;
    transform: scale(1.02);
}

.btn-wechat-icon {
    font-size: 20px;
}

/* ========== 错题本弹窗 ========== */
.mistake-content {
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.mistake-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.mistake-modal-header h2 {
    font-size: 18px;
    margin: 0;
}

.btn-mistake-quiz {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-mistake-quiz:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.mistake-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.mistake-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #ff6b6b;
}

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

.mistake-item-meta {
    font-size: 12px;
    color: #999;
}

.mistake-item-question {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.5;
}

.mistake-item-answer {
    display: flex;
    gap: 16px;
    font-size: 13px;
    margin-bottom: 10px;
}

.mistake-wrong {
    color: #e74c3c;
    font-weight: 600;
}

.mistake-correct {
    color: #2ecc71;
    font-weight: 600;
}

.mistake-analysis {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    margin-top: 8px;
}

.mistake-analysis .analysis-section-header {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

/* ===== 错题详细展示 ===== */
.mistake-question-content {
    margin-bottom: 12px;
}

.mistake-question-text {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.mistake-question-label {
    font-weight: bold;
    font-size: 18px;
    color: #333;
    margin: 10px 0 4px;
}

.mistake-question-image {
    margin: 8px 0;
    cursor: pointer;
}

.mistake-question-image img {
    max-width: 100%;
    border-radius: 8px;
    display: block;
}

.mistake-img {
    max-width: 100%;
    border-radius: 8px;
}

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

.mistake-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.mistake-option.correct {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.mistake-option .opt-label {
    font-weight: bold;
    min-width: 24px;
    color: var(--primary);
}

.mistake-option.correct .opt-label {
    color: #2e7d32;
}

.mistake-option .opt-content {
    flex: 1;
}

.mistake-option .opt-content.opt-has-image {
    display: block;
}

.mistake-option .opt-content.opt-has-image img {
    max-width: 100%;
    border-radius: 6px;
    margin-top: 4px;
}

.mistake-ai-analysis {
    margin-top: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    border-left: 3px solid var(--danger);
}

.mistake-ai-analysis .analysis-section-header {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.mistake-ai-analysis .analysis-section-body {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.btn-small-analysis {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.3s;
}

.btn-small-analysis:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.mistake-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 13px;
    color: #666;
}

.mistake-pagination .btn-small {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.mistake-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid #eee;
}

/* ========== AI 解析渲染样式 ========== */
.analysis-section {
    margin-bottom: 12px;
}

.analysis-section.analysis-error { border-left: 3px solid #e74c3c; padding-left: 10px; }
.analysis-section.analysis-correct { border-left: 3px solid #2ecc71; padding-left: 10px; }
.analysis-section.analysis-idea { border-left: 3px solid #3498db; padding-left: 10px; }
.analysis-section.analysis-option { border-left: 3px solid #9b59b6; padding-left: 10px; }
.analysis-section.analysis-tips { border-left: 3px solid #f39c12; padding-left: 10px; }
.analysis-section.analysis-knowledge { border-left: 3px solid #1abc9c; padding-left: 10px; }
.analysis-section.analysis-similar { border-left: 3px solid #e67e22; padding-left: 10px; }
.analysis-section.analysis-title { border-left: 3px solid var(--primary); padding-left: 10px; }

.analysis-section-header {
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 4px;
}

.analysis-section-body {
    font-size: 13px;
    line-height: 1.7;
    color: #555;
}

.analysis-list {
    padding-left: 20px;
    margin: 6px 0;
}

.analysis-list li {
    margin-bottom: 4px;
}

.analysis-para {
    margin: 6px 0;
}

/* ===== GESP 本地题库弹窗 ===== */
.gesp-modal-content {
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
}

.gesp-subject-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.gesp-subject-tab {
    padding: 10px 24px;
    border-radius: 20px;
    border: 2px solid var(--primary-light, #FFB74D);
    background: var(--card-bg, #fff);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
    color: var(--text-light, #999);
}

.gesp-subject-tab:hover {
    border-color: var(--primary, #FF9800);
}

.gesp-subject-tab.active {
    background: linear-gradient(135deg, var(--primary, #FF9800), var(--primary-light, #FFB74D));
    color: white;
    border-color: var(--primary, #FF9800);
}

.gesp-level-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.gesp-level-tab {
    padding: 8px 16px;
    border-radius: 16px;
    border: 2px solid #e0e0e0;
    background: var(--card-bg, #fff);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    color: var(--text-light, #999);
}

.gesp-level-tab:hover {
    border-color: var(--secondary, #4CAF50);
}

.gesp-level-tab.active {
    background: linear-gradient(135deg, var(--secondary, #4CAF50), #45B7AA);
    color: white;
    border-color: var(--secondary, #4CAF50);
}

.gesp-paper-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

.gesp-paper-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.gesp-paper-item:hover {
    background: #FFF3E0;
    border-color: var(--primary-light, #FFB74D);
}

.gesp-paper-name {
    font-size: 15px;
    font-weight: 500;
}

.gesp-paper-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 10px;
    background: #E8F5E9;
    color: #2E7D32;
    font-weight: 600;
    white-space: nowrap;
}

.upload-divider {
    color: var(--text-light, #999);
    margin: 14px 0 10px;
    font-size: 14px;
    text-align: center;
}

.btn-gesp-browse {
    display: block;
    margin: 0 auto;
}

/* ===== 登录提示弹窗 ===== */
.login-prompt-content {
    max-width: 380px;
    text-align: center;
    padding: 40px 30px;
}

.login-prompt-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.login-prompt-title {
    font-size: 22px;
    color: var(--text, #333);
    margin-bottom: 12px;
}

.login-prompt-text {
    color: var(--text-light, #666);
    font-size: 15px;
    margin-bottom: 28px;
    line-height: 1.6;
}

.login-prompt-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.login-prompt-actions .btn {
    min-width: 110px;
    padding: 10px 24px;
    font-size: 15px;
}

/* ===== 继续答题确认弹窗 ===== */
.resume-confirm-content {
    max-width: 400px;
    text-align: center;
    padding: 36px 30px 28px;
}

.resume-confirm-message {
    font-size: 16px;
    color: var(--text, #333);
    line-height: 1.8;
    margin-bottom: 28px;
}

.resume-confirm-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.resume-confirm-actions .btn {
    min-width: 100px;
    padding: 10px 28px;
    font-size: 16px;
}

/* ===== 意见反馈按钮 + 微信二维码弹窗 ===== */
.btn-feedback {
    position: fixed;
    bottom: 30px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 24px;
    border: none;
    background: linear-gradient(135deg, #07c160, #06ad56);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(7, 193, 96, 0.35);
    z-index: 900;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-feedback:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(7, 193, 96, 0.45);
}

.btn-feedback:active {
    transform: scale(0.96);
}

.feedback-content {
    max-width: 330px;
    text-align: center;
    position: relative;
    padding: 26px 24px 24px;
}

.feedback-close {
    position: absolute;
    top: 4px;
    right: 4px;
    color: #94a3b8;
    z-index: 1;
}

/* 二维码弹窗：右下角弹出，悬浮在意见反馈按钮上方（不居中） */
#feedback-modal {
    justify-content: flex-end;
    align-items: flex-end;
    padding: 20px 20px 92px;
}

#feedback-modal .modal-content {
    margin: 0;
}

.feedback-qr {
    width: 220px;
    height: 220px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: white;
    object-fit: contain;
}

.feedback-tip {
    margin-top: 14px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.9;
}

/* ===== 主页标语：错题 AI 自动讲解 ===== */
.ai-tagline {
    margin: 8px 0 2px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #ff6b35, #ff2d78);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-tagline .ai-badge {
    display: inline-block;
    margin: 0 6px;
    padding: 0 12px 2px;
    font-size: 21px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, #ff512f, #dd2476);
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(221, 36, 118, 0.4);
    letter-spacing: 1px;
    -webkit-background-clip: padding-box;
    -webkit-text-fill-color: #fff;
}
