/* app-quiz.css — parte 7 del split de styles-professional.css (2026-07-18).
   Módulo Quiz: setup, preguntas, opciones, resultados.
   ORDEN DE CARGA OBLIGATORIO: app-base → header-nav → home → practice →
   browse → strokes → quiz → stats → enhancements → dashboard-extras.
   La cascada depende de este orden; no reordenar los <link>. */

/* ============================================================================
   10. QUIZ MODULE
   ============================================================================ */
.quiz-setup {
    max-width: 640px;
    margin: 28px auto;
    background: var(--bg-panel);
    padding: 32px 36px;
    border-radius: var(--radius-lg, 16px);
    border: 1px solid var(--color-border);
    text-align: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.quiz-header-banner {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}

.quiz-title-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quiz-main-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.quiz-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(225, 29, 72, 0.1);
    color: var(--primary);
    flex-shrink: 0;
}

.quiz-subtitle {
    margin: 0;
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.quiz-progress-bar-track {
    width: 100%;
    height: 6px;
    background: rgba(128, 128, 128, 0.15);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 16px;
}

.quiz-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #f43f5e 100%);
    border-radius: 999px;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-setup h2,
.quiz-results h2 {
    margin-bottom: 24px;
    color: var(--text-main);
    font-size: 1.6rem;
    font-weight: 800;
}

.control-group {
    margin-bottom: 20px;
    text-align: left;
}

.control-group-checkbox {
    margin-top: -4px;
}

.control-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
}

.control-checkbox-input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.control-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.onboarding-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--bg-panel);
}

.onboarding-hint-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.onboarding-hint-icon {
    line-height: 1;
}

.onboarding-hint-text {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
}

.onboarding-hint-close {
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}

.onboarding-hint-close:hover {
    color: var(--text-main);
}

.onboarding-hint--home {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.08);
}

.onboarding-hint--module {
    border-color: rgba(244, 63, 94, 0.35);
    background: rgba(244, 63, 94, 0.08);
}

.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 14px 20px;
    background: var(--bg-panel);
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--color-border);
}

.quiz-progress,
.quiz-score-display {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
}

.quiz-progress span,
.quiz-score-display span {
    color: var(--text-main);
    font-weight: 700;
}

.quiz-content {
    background: var(--bg-panel);
    padding: 36px 32px;
    border-radius: var(--radius-lg, 16px);
    border: 1px solid var(--color-border);
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.question-text {
    margin-bottom: 28px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.quiz-question-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.quiz-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(225, 29, 72, 0.08);
    border: 1px solid rgba(225, 29, 72, 0.2);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.quiz-question-text {
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 600;
}

.quiz-character {
    font-family: var(--font-chinese);
    font-size: clamp(3rem, 9vw, 4.5rem);
    line-height: 1.1;
    color: var(--text-main);
}

.quiz-pinyin {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 700;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 28px;
}

.quiz-option {
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    padding: 18px 20px;
    border-radius: var(--radius-md, 12px);
    cursor: pointer;
    transition: all var(--transition-fast, 0.15s ease);
    color: var(--text-main);
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.quiz-option:hover {
    background: rgba(225, 29, 72, 0.05);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: rgba(225, 29, 72, 0.12);
    color: var(--primary);
    font-weight: 700;
}

.quiz-option.correct {
    border-color: var(--success, #10b981);
    background: rgba(16, 185, 129, 0.14);
    color: var(--success, #10b981);
    font-weight: 700;
}

.quiz-option.incorrect {
    border-color: var(--error, #ef4444);
    background: rgba(239, 68, 68, 0.14);
    color: var(--error, #ef4444);
    font-weight: 700;
}

.quiz-results {
    text-align: center;
    padding: 36px 32px;
    background: var(--bg-panel);
    border-radius: var(--radius-lg, 16px);
    max-width: 640px;
    margin: 28px auto;
    border: 1px solid var(--color-border);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.btn-primary {
    /* Rojo más oscuro que --primary: white sobre #c62828 ≈ 5.2:1 (WCAG AA) */
    background: #c62828;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: #b71c1c;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

/* --- Enhanced Quiz Setup & Controls --- */
.quiz-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

/* --- Countdown Timer Badge --- */
.quiz-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    font-size: 0.88rem;
    font-weight: 700;
}

.quiz-timer-badge.is-warning {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.5);
    color: #d97706;
}

.quiz-timer-badge.is-danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
    animation: quizPulse 0.8s infinite alternate;
}

@keyframes quizPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.06); }
}

/* --- Multidimensional Mode Elements --- */
.quiz-character-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.quiz-audio-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.quiz-audio-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.08);
}

.quiz-reverse-meaning {
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    font-weight: 700;
    color: var(--text-main);
    margin: 10px 0;
}

.quiz-listening-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 14px 0;
}

.quiz-big-audio-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.12), rgba(225, 29, 72, 0.22));
    border: 1px solid rgba(225, 29, 72, 0.35);
    color: var(--primary);
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quiz-big-audio-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.2), rgba(225, 29, 72, 0.32));
    box-shadow: 0 4px 16px rgba(225, 29, 72, 0.25);
}

.quiz-masked-char {
    filter: blur(8px);
    opacity: 0.35;
    user-select: none;
    transition: all 0.3s ease;
}

.quiz-masked-pinyin {
    opacity: 0;
    transition: all 0.3s ease;
}

.quiz-mode-hint,
.quiz-pinyin-meaning {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

/* --- Results & Grade Performance --- */
.results-score-box {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.results-score-box strong {
    font-size: 1.7rem;
    color: var(--text-main);
}

.quiz-grade-banner {
    margin: 14px 0 24px;
}

.grade-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.grade-excellent {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
}

.grade-good {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #38bdf8;
}

.grade-practice {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #f59e0b;
}

.btn-warning {
    background: #d97706;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-warning:hover {
    background: #b45309;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* --- Review Breakdown Section --- */
.quiz-breakdown-wrapper {
    margin-top: 32px;
    text-align: left;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 24px;
}

.breakdown-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
}

.quiz-breakdown-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}

.quiz-breakdown-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid #71717a;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: background var(--transition-fast);
}

.quiz-breakdown-card.is-correct {
    border-left-color: var(--success, #10b981);
    background: rgba(16, 185, 129, 0.04);
}

.quiz-breakdown-card.is-wrong {
    border-left-color: var(--error, #ef4444);
    background: rgba(239, 68, 68, 0.05);
}

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

.breakdown-status-badge {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.breakdown-hsk-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
}

.breakdown-char-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.breakdown-char {
    font-family: var(--font-chinese);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
}

.breakdown-pinyin {
    font-size: 1rem;
    color: var(--text-dim);
    font-weight: 500;
}

.breakdown-audio-btn {
    border: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
}

.breakdown-meaning {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.breakdown-answers-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.86rem;
    padding-top: 6px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.breakdown-user-ans,
.breakdown-correct-ans {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.breakdown-user-ans .label,
.breakdown-correct-ans .label {
    color: var(--text-dim);
}

.val-ok {
    color: #10b981;
    font-weight: 600;
}

.val-err {
    color: #ef4444;
    font-weight: 600;
}

.val-correct {
    color: #10b981;
    font-weight: 700;
}

/* ============================================================================
   MOBILE RESPONSIVE QUIZ STYLES
   ============================================================================ */
@media (max-width: 640px) {
    .quiz-setup,
    .quiz-content,
    .quiz-results {
        padding: 20px 14px;
        margin: 16px auto;
        border-radius: var(--radius-md);
    }

    .quiz-setup h2,
    .quiz-results h2 {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }

    .quiz-options {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 20px;
    }

    .quiz-option {
        padding: 14px 16px;
        font-size: 1rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .question-text {
        margin-bottom: 20px;
        gap: 8px;
    }

    .quiz-header {
        padding: 10px 14px;
        margin-bottom: 14px;
    }

    .quiz-actions,
    .results-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        min-height: 46px;
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .control-group {
        margin-bottom: 14px;
    }

    .control-group .select-input {
        width: 100%;
        max-width: 100%;
        min-height: 44px;
    }

    .control-checkbox-label {
        font-size: 0.85rem;
        gap: 8px;
    }
}

/* ==========================================================================
   Past Exams HSK Official Simulation & Module Styling
   ========================================================================== */

/* Past Exams Header Banner */
.past-exams-header-banner {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.past-exams-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.past-exams-main-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.past-exams-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(225, 29, 72, 0.1);
    color: var(--primary);
}

/* Navigator Grid */
.past-exam-nav-wrapper {
    margin: 12px 0 16px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 12px);
}

.past-exam-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.88rem;
}

.past-exam-nav-header .nav-title {
    font-weight: 700;
    color: var(--text-main);
}

.past-exam-nav-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.current {
    background: var(--primary);
    box-shadow: 0 0 8px rgba(225, 29, 72, 0.6);
}

.legend-dot.answered {
    background: var(--color-success, #10b981);
}

.legend-dot.flagged {
    background: #ef4444;
}

.past-exam-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 6px;
}

.past-exam-grid-btn {
    aspect-ratio: 1;
    min-height: 36px;
    background: var(--bg-panel);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.past-exam-grid-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.past-exam-grid-btn.current {
    border: 2px solid var(--primary);
    box-shadow: 0 0 10px rgba(225, 29, 72, 0.4);
    color: var(--primary);
}

.past-exam-grid-btn.answered {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--color-success, #10b981);
}

.past-exam-grid-btn.flagged::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.8);
}

/* Audio Player Box */
.past-exam-audio-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: rgba(225, 29, 72, 0.06);
    border: 1px solid rgba(225, 29, 72, 0.2);
    border-radius: var(--radius-md, 10px);
}

.past-exam-audio-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.9rem;
}

.past-exam-audio-plays {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Action Bar */
.past-exam-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.past-exam-flag-btn {
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
    transition: all 0.15s ease;
}

.past-exam-flag-btn:hover,
.past-exam-flag-btn.active {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
}

.past-exam-nav-btns {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.past-exam-finish-btn {
    background: #dc2626;
    color: #fff;
    border: none;
}

.past-exam-finish-btn:hover {
    background: #b91c1c;
}

/* Results & Scaled Score Card */
.past-exams-results-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.past-exam-score-card {
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg, 16px);
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

.past-exam-score-card .score-main {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.past-exam-scaled-score {
    margin: 14px 0 16px;
    padding: 14px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-md, 10px);
}

.scaled-points-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.scaled-points-val {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    margin: 4px 0;
}

.scaled-threshold-note {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.past-exam-grade-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    border-radius: 10px;
    margin-top: 8px;
}

.past-exam-grade-badge.pass {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: var(--success, #10b981);
}

.past-exam-grade-badge.fail {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.past-exam-grade-badge .badge-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.past-exam-grade-badge .badge-desc {
    font-size: 0.85rem;
    opacity: 0.88;
    margin-top: 4px;
}

/* Section Breakdown */
.past-exam-sections-breakdown {
    text-align: left;
    margin-top: 10px;
}

.breakdown-subtitle {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.section-bars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.section-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 10px);
    padding: 12px 14px;
}

.section-stat-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.section-stat-bar-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.section-stat-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.section-stat-card.good .section-stat-bar-fill {
    background: var(--color-success, #10b981);
}

.section-stat-card.needs-work .section-stat-bar-fill {
    background: #f59e0b;
}

/* Question-by-Question Review Breakdown */
.past-exam-review-wrapper {
    margin-top: 36px;
    text-align: left;
    border-top: 1px solid var(--color-border);
    padding-top: 24px;
}

.past-exam-review-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-main);
}

.past-exam-review-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 550px;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
}

.past-exam-review-card {
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-border);
    border-radius: var(--radius-md, 12px);
    padding: 16px 18px;
}

.past-exam-review-card.correct {
    border-left-color: var(--color-success, #10b981);
    background: rgba(16, 185, 129, 0.04);
}

.past-exam-review-card.incorrect {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.04);
}

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

.review-qnum {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

.review-status-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
}

.review-status-pill.correct {
    background: rgba(16, 185, 129, 0.2);
    color: var(--color-success, #10b981);
}

.review-status-pill.incorrect {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.review-qprompt {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-main);
}

.review-audio-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.review-audio-btn {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.review-audio-script {
    font-size: 0.88rem;
    font-style: italic;
    color: var(--text-muted);
}

.review-answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.88rem;
}

.review-user-answer,
.review-correct-answer {
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--bg-panel);
    border: 1px solid var(--color-border);
}

.review-user-answer.incorrect {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.review-user-answer.correct,
.review-correct-answer {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success, #10b981);
    border-color: rgba(16, 185, 129, 0.3);
}

.review-explanation {
    display: flex;
    gap: 8px;
    font-size: 0.86rem;
    line-height: 1.45;
    background: rgba(225, 29, 72, 0.05);
    border: 1px solid rgba(225, 29, 72, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-main);
}

.review-explanation .exp-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Certificate Modal & Card */
.past-exam-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.past-exam-modal-content {
    position: relative;
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.past-exam-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: #a1a1aa;
    cursor: pointer;
    z-index: 2;
    transition: color 0.15s;
}

.past-exam-modal-close:hover {
    color: #fff;
}

.hsk-certificate-card {
    background: #fffdfa;
    color: #27272a;
    border: 4px double #b45309;
    border-radius: 12px;
    padding: 32px 28px;
    position: relative;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
    font-family: 'Noto Serif SC', serif, -apple-system;
}

.cert-header {
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 2px solid #b45309;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.cert-emblem {
    font-size: 1.8rem;
    font-weight: 900;
    color: #b45309;
    width: 56px;
    height: 56px;
    border: 2px solid #b45309;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(180, 83, 9, 0.08);
}

.cert-titles h4 {
    margin: 0;
    font-size: 1.25rem;
    color: #78350f;
    letter-spacing: 1px;
}

.cert-titles h5 {
    margin: 2px 0 0;
    font-size: 0.82rem;
    color: #92400e;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
}

.cert-titles .cert-sub {
    margin: 2px 0 0;
    font-size: 0.75rem;
    color: #a1a1aa;
    font-family: 'Inter', sans-serif;
}

.cert-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: 'Inter', sans-serif;
}

.cert-field {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #e4e4e7;
    padding-bottom: 6px;
    font-size: 0.95rem;
}

.cert-label {
    color: #71717a;
}

.cert-scores-table {
    margin: 10px 0;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    overflow: hidden;
}

.cert-scores-table .table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    background: #f4f4f5;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 0.85rem;
    color: #3f3f46;
}

.cert-scores-table .table-rows .table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    padding: 8px 12px;
    border-top: 1px solid #e4e4e7;
    font-size: 0.88rem;
}

.cert-scores-table .table-footer {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    background: #fef3c7;
    padding: 10px 12px;
    font-weight: 800;
    border-top: 2px solid #b45309;
    color: #92400e;
}

.cert-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.cert-badge.pass {
    background: #10b981;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 800;
    letter-spacing: 1px;
}

.cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e4e4e7;
}

.cert-seal {
    width: 84px;
    height: 84px;
    border: 3px double #dc2626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #dc2626;
    font-size: 0.68rem;
    font-weight: 900;
    transform: rotate(-12deg);
}

.cert-disclaimer {
    margin: 0;
    font-size: 0.72rem;
    color: #a1a1aa;
    font-family: 'Inter', sans-serif;
    max-width: 320px;
}

/* Responsive adjustments for Past Exams & Certificates on Mobile */
@media (max-width: 640px) {
    .past-exam-nav-wrapper {
        position: static !important;
        margin-bottom: 14px;
    }

    .past-exam-nav-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 6px;
    }

    .past-exam-audio-box {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .past-exam-audio-btn {
        width: 100%;
        min-height: 48px;
        justify-content: center;
    }

    .past-exam-actions-bar {
        flex-direction: column;
        gap: 10px;
    }

    .past-exam-nav-btns {
        width: 100%;
        justify-content: space-between;
    }

    .past-exam-finish-btn,
    .past-exam-flag-btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .hsk-certificate-card {
        padding: 20px 16px;
    }

    .cert-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .cert-table th,
    .cert-table td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }

    .cert-footer {
        flex-direction: column;
        align-items: center;
        gap: 14px;
        text-align: center;
    }
}



