/* ===== CSS Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

::-webkit-scrollbar {
    display: none;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 10px 30px rgba(0,0,0,.08);
    --transition: 0.18s ease;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 
                 'Segoe UI', sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

/* ===== Layout ===== */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.container--narrow {
    max-width: 760px;
}

.main-content {
    flex: 1;
    padding: 0 0 60px;
}

/* ===== Header ===== */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 var(--gray-100);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--gray-900);
}

.logo-icon {
    font-size: 1.4rem;
}

.back-link {
    color: var(--gray-500);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
    white-space: nowrap;
}

.back-link:hover {
    color: var(--primary);
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--gray-500);
    font-weight: 500;
    white-space: nowrap;
}

/* ===== Progress Bar ===== */
.progress-bar-wrap {
    height: 3px;
    background: var(--gray-200);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #60a5fa);
    transition: width 0.4s ease;
}

/* ===== Footer ===== */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--gray-200);
    padding: 20px 0;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.85rem;
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 48px 0 32px;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

.hero-sub {
    margin-top: 10px;
    color: var(--gray-500);
    font-size: 1.05rem;
}

/* ===== Stats Bar ===== */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 36px;
}

.stat-item {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Mode Cards ===== */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.mode-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition);
    cursor: pointer;
    color: inherit;
}

.mode-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.mode-card--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.mode-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: var(--radius);
}

.mode-info {
    flex: 1;
    min-width: 0;
}

.mode-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.mode-desc {
    font-size: 0.85rem;
    color: var(--gray-500);
    line-height: 1.5;
    margin-bottom: 8px;
}

.mode-meta {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-light);
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
}

.mode-arrow {
    color: var(--gray-300);
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: color var(--transition), transform var(--transition);
}

.mode-card:hover .mode-arrow {
    color: var(--primary);
    transform: translateX(4px);
}

/* ===== Action Bar ===== */
.action-bar {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #15803d;
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1.5px solid var(--danger);
}

.btn-danger:hover {
    background: var(--danger-light);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-500);
    border: 1.5px solid var(--gray-200);
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
    border-radius: var(--radius);
}

.btn-sm {
    padding: 7px 16px;
    font-size: 0.85rem;
}

/* ===== Mode Badge ===== */
.mode-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

/* ===== Type Badge ===== */
.type-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.type-badge--single {
    background: #eff6ff;
    color: #2563eb;
}

.type-badge--multi {
    background: #fdf4ff;
    color: #9333ea;
}

.type-badge--judge {
    background: #fff7ed;
    color: #ea580c;
}

/* ===== Question Card ===== */
.question-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 36px;
    margin-bottom: 24px;
}

.question-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.question-num {
    font-size: 0.82rem;
    color: var(--gray-400);
    font-weight: 500;
}

/* ===== Question Stem ===== */
.question-stem {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.7;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-100);
}

/* ===== Options ===== */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.option-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-item:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.85rem;
    font-weight: 700;
    transition: all var(--transition);
}

.option-item:has(input:checked) .option-key {
    background: var(--primary);
    color: #fff;
}

.option-text {
    flex: 1;
    font-size: 0.95rem;
    color: var(--gray-700);
    line-height: 1.6;
    padding-top: 3px;
}

/* Correct / Wrong states */
.option-correct {
    border-color: var(--success) !important;
    background: var(--success-light) !important;
}

.option-correct .option-key {
    background: var(--success) !important;
    color: #fff !important;
}

.option-wrong {
    border-color: var(--danger) !important;
    background: var(--danger-light) !important;
}

.option-wrong .option-key {
    background: var(--danger) !important;
    color: #fff !important;
}

.opt-icon {
    font-size: 1rem;
    font-weight: 700;
    margin-left: auto;
    flex-shrink: 0;
}

.opt-icon--correct {
    color: var(--success);
}

.opt-icon--wrong {
    color: var(--danger);
}

/* ===== Form Actions ===== */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== Result Panel ===== */
.result-panel {
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    border: 1.5px solid;
}

.result-panel--correct {
    background: var(--success-light);
    border-color: #86efac;
}

.result-panel--wrong {
    background: var(--danger-light);
    border-color: #fca5a5;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.result-icon {
    font-size: 1.3rem;
}

.result-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
}

.result-answer {
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.answer-label {
    color: var(--gray-500);
    font-weight: 500;
}

.answer-value {
    font-weight: 700;
    color: var(--success);
    font-size: 1rem;
}

.result-analysis {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.6;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,.06);
    margin-top: 10px;
}

.analysis-label {
    font-weight: 600;
    color: var(--gray-700);
}

/* ===== Result Summary ===== */
.result-summary-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 48px 36px;
    text-align: center;
}

.result-trophy {
    font-size: 4rem;
    margin-bottom: 16px;
}

.result-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.result-subtitle {
    color: var(--gray-400);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

/* Score Ring */
.score-ring {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 32px;
}

.ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: var(--gray-100);
    stroke-width: 10;
}

.ring-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dashoffset: 0;
    transition: stroke-dasharray 1s ease;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-num {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.score-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 4px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 36px;
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.result-stat {
    text-align: center;
}

.rstat-num {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.rstat-num--total { color: var(--gray-700); }
.rstat-num--correct { color: var(--success); }
.rstat-num--wrong { color: var(--danger); }

.rstat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-top: 6px;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Wrong List ===== */
.wrong-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
}

.wrong-actions {
    display: flex;
    gap: 10px;
}

.wrong-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wrong-item {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.wrong-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.wrong-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wrong-stem {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.6;
    margin-bottom: 16px;
}

.wrong-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.wrong-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--gray-600);
    background: var(--gray-50);
}

.wrong-option--correct {
    background: var(--success-light);
    color: var(--success);
    font-weight: 600;
}

.wrong-answer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    padding: 10px 0;
    border-top: 1px solid var(--gray-100);
    flex-wrap: wrap;
}

.wrong-label {
    color: var(--gray-400);
}

.wrong-user-ans {
    color: var(--danger);
    font-weight: 700;
}

.wrong-correct-ans {
    color: var(--success);
    font-weight: 700;
}

.wrong-sep {
    color: var(--gray-300);
}

.wrong-analysis {
    font-size: 0.88rem;
    color: var(--gray-500);
    line-height: 1.6;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
    margin-top: 10px;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-400);
    margin-bottom: 24px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .question-card {
        padding: 24px 18px;
    }

    .hero-title {
        font-size: 1.7rem;
    }

    .mode-grid {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        gap: 28px;
    }

    .result-stats {
        gap: 20px;
    }

    .result-summary-card {
        padding: 32px 20px;
    }

    .wrong-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Gold / 菁英班 Theme ===== */
.mode-badge--gold {
    background: #fef9c3;
    color: #92400e;
}

.mode-card--gold {
    border-color: #fde68a;
    background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
}

.mode-card--gold:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 20px rgba(245,158,11,.2);
}

.mode-icon--gold {
    background: #fef3c7;
}

.mode-meta--gold {
    background: #fef3c7;
    color: #92400e;
}

.progress-bar-fill--gold {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* ===== Essay Question ===== */
.type-badge--essay {
    background: #fdf4ff;
    color: #7c3aed;
}

/* Score bar at top */
.jy-score-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1.5px solid #fde68a;
    border-radius: var(--radius);
    padding: 12px 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.jy-score-label {
    color: var(--gray-500);
    font-weight: 500;
}

.jy-score-val {
    font-weight: 800;
    color: #92400e;
    font-size: 1.05rem;
}

.jy-score-hint {
    color: var(--gray-400);
    font-size: 0.82rem;
    margin-left: auto;
}

/* Score badge on question */
.jy-score-badge {
    margin-left: auto;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
}

/* Think area (before reveal) */
.essay-think-area {
    text-align: center;
    padding: 40px 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.essay-think-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.essay-think-text {
    color: var(--gray-500);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Answer panel */
.essay-answer-panel {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.essay-answer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #fde68a;
}

.essay-answer-icon {
    font-size: 1.1rem;
}

.essay-answer-title {
    font-weight: 700;
    color: #92400e;
    font-size: 0.95rem;
}

.essay-answer-body {
    font-size: 0.95rem;
    color: var(--gray-700);
    line-height: 1.8;
}

.essay-analysis {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #fde68a;
    font-size: 0.88rem;
    color: var(--gray-500);
    line-height: 1.6;
}

/* Self-score panel */
.self-score-panel {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.self-score-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 16px;
    text-align: center;
}

.score-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.score-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 10px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    background: #fff;
}

.score-opt input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.score-opt:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.score-opt--full:has(input:checked) {
    border-color: var(--success);
    background: var(--success-light);
}

.score-opt--half:has(input:checked) {
    border-color: #f59e0b;
    background: #fffbeb;
}

.score-opt--zero:has(input:checked) {
    border-color: var(--danger);
    background: var(--danger-light);
}

.score-opt:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.score-opt-icon {
    font-size: 1.6rem;
}

.score-opt-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-600);
}

.score-opt-pts {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--gray-800);
}

/* Scored display */
.scored-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 1rem;
}

.scored-display--full {
    background: var(--success-light);
    border: 1.5px solid #86efac;
}

.scored-display--half {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
}

.scored-display--zero {
    background: var(--danger-light);
    border: 1.5px solid #fca5a5;
}

.scored-icon {
    font-size: 1.3rem;
}

.scored-text {
    font-size: 0.95rem;
    color: var(--gray-700);
}

/* Question nav grid */
.jy-nav-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
    padding: 16px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.jy-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--gray-100);
    color: var(--gray-500);
    transition: all var(--transition);
    text-decoration: none;
}

.jy-nav-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.jy-nav-btn--active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37,99,235,.3);
}

.jy-nav-btn--full {
    background: var(--success-light);
    color: var(--success);
    border: 1.5px solid #86efac;
}

.jy-nav-btn--half {
    background: #fffbeb;
    color: #92400e;
    border: 1.5px solid #fde68a;
}

.jy-nav-btn--zero {
    background: var(--danger-light);
    color: var(--danger);
    border: 1.5px solid #fca5a5;
}

.jy-nav-btn--revealed {
    background: var(--gray-200);
    color: var(--gray-600);
}

/* ===== Result page - Grade Badge ===== */
.grade-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0 auto 28px;
    padding: 16px 32px;
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--grade-color) 10%, white);
    border: 2px solid color-mix(in srgb, var(--grade-color) 30%, white);
}

.grade-letter {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--grade-color);
    line-height: 1;
}

.grade-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--grade-color);
}

.ring-fill--gold {
    stroke: #f59e0b;
}

/* Detail list */
.jy-detail-list {
    margin: 28px 0;
    text-align: left;
}

.jy-detail-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 0.88rem;
    background: var(--gray-50);
}

.detail-item--full { background: var(--success-light); }
.detail-item--half { background: #fffbeb; }
.detail-item--zero { background: var(--danger-light); }
.detail-item--skip { background: var(--gray-100); opacity: 0.7; }

.detail-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.detail-name {
    flex: 1;
    color: var(--gray-700);
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.detail-score {
    font-weight: 700;
    color: var(--gray-700);
    flex-shrink: 0;
    font-size: 0.9rem;
}

/* Responsive for score options */
@media (max-width: 480px) {
    .score-options {
        grid-template-columns: 1fr;
    }
    .jy-nav-grid {
        gap: 6px;
    }
    .jy-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 0.78rem;
    }
}

/* ===== Browse Theme ===== */
.mode-card--browse {
    border-color: #d1fae5;
    background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
}

.mode-card--browse:hover {
    border-color: #34d399;
    box-shadow: 0 4px 20px rgba(52,211,153,.2);
}

.mode-icon--browse {
    background: #d1fae5;
}

.mode-meta--browse {
    background: #d1fae5;
    color: #065f46;
}

/* ===== Browse Toolbar ===== */
.browse-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.browse-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    transition: border-color var(--transition);
}

.browse-search:focus-within {
    border-color: var(--primary);
    background: #fff;
}

.search-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--gray-800);
    outline: none;
    min-width: 0;
}

.search-input::placeholder {
    color: var(--gray-400);
}

.search-clear {
    color: var(--gray-400);
    font-size: 0.85rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: color var(--transition);
}

.search-clear:hover {
    color: var(--danger);
}

.browse-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-100);
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.filter-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.filter-btn--active {
    background: var(--primary);
    color: #fff;
}

.filter-btn--active:hover {
    background: var(--primary-dark);
    color: #fff;
}

.filter-count {
    background: rgba(255,255,255,.25);
    border-radius: 10px;
    padding: 0 6px;
    font-size: 0.75rem;
}

.filter-btn--active .filter-count {
    background: rgba(255,255,255,.3);
}

/* ===== Browse List ===== */
.browse-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.browse-item {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    transition: box-shadow var(--transition);
}

.browse-item:hover {
    box-shadow: var(--shadow-md);
}

.browse-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.browse-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toggle-answer-btn {
    margin-left: auto;
    background: var(--gray-100);
    border: none;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.toggle-answer-btn:hover,
.toggle-answer-btn--open {
    background: var(--primary-light);
    color: var(--primary);
}

/* Browse stem */
.browse-stem {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.7;
    margin-bottom: 12px;
}

.browse-stem mark {
    background: #fef08a;
    color: inherit;
    border-radius: 2px;
    padding: 0 2px;
}

/* Browse options */
.browse-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0;
}

.browse-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--gray-600);
    background: var(--gray-50);
    transition: all 0.25s ease;
}

.browse-option--hidden {
    display: none;
}

.browse-option--correct {
    background: var(--success-light);
    color: var(--success);
    font-weight: 600;
    border-left: 3px solid var(--success);
}

.browse-option-text {
    flex: 1;
    line-height: 1.5;
}

.browse-option-text mark {
    background: #fef08a;
    color: inherit;
    border-radius: 2px;
    padding: 0 2px;
}

/* Browse answer */
.browse-answer {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--success-light);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--success);
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.browse-answer--hidden {
    display: none;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 20px 0;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-600);
    background: #fff;
    border: 1.5px solid var(--gray-200);
    text-decoration: none;
    transition: all var(--transition);
}

.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.page-btn--active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-info {
    font-size: 0.82rem;
    color: var(--gray-400);
    margin-left: 8px;
}
