/* C++ 主题配色：主色取 C++ 官方蓝（#00599C），点缀色取 C++ logo 的浅蓝
   （变量名沿用 sb_yncode 的 --orange / --orange-deep，只改取值，保证三站框架一致） */
/* ---------- 项目自带字体：JetBrains Mono（OFL-1.1，见 static/fonts/OFL.txt） ----------
   自托管，部署到服务器后无需用户本机安装 */
@font-face {
    font-family: "JetBrains Mono";
    src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("fonts/JetBrainsMono-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --orange: #00599c;
    --orange-deep: #00447c;
    --blue: #2a6bb0;
    --blue-deep: #1f4f83;
    --green: #2e9e6b;
    --green-deep: #237a52;
    --text-dark: #22324a;
    --text-gray: #8a8f9c;
    --line: #dfe8f2;
    --bg-soft: #eef5fb;
    --accent: #659ad2;
}

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

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    color: var(--text-dark);
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

/* ---------- 顶部横幅 ---------- */
.top-banner {
    background: linear-gradient(135deg, #6ba3d6 0%, var(--orange) 45%, #003a66 100%);
    padding: 22px 32px;
    box-shadow: 0 2px 10px rgba(0, 68, 124, 0.2);
}

.banner-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 22px;
}

.logo {
    position: relative;
    width: 72px;
    height: 72px;
    flex: none;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(44, 95, 138, 0.25);
}

.logo .block {
    position: absolute;
    border-radius: 5px;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}

.logo .b1 {
    left: 12px;
    top: 13px;
    width: 48px;
    height: 20px;
    background: #4b8bbe;
}

.logo .b2 {
    left: 12px;
    top: 34px;
    width: 20px;
    height: 20px;
    background: #ffd43b;
}

.logo .b3 {
    left: 34px;
    top: 34px;
    width: 26px;
    height: 20px;
    background: #306998;
}

.brand h1 {
    font-size: 26px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(40, 82, 125, 0.35);
    letter-spacing: 1px;
}

.brand p {
    margin-top: 6px;
    font-size: 14px;
    color: #fff5ea;
    letter-spacing: 6px;
}

/* ---------- 中部内容区 ---------- */
.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 42px 16px 30px;
    background:
        radial-gradient(circle at 12% 18%, rgba(244, 179, 130, 0.18) 0, transparent 30%),
        radial-gradient(circle at 88% 82%, rgba(86, 126, 207, 0.10) 0, transparent 32%),
        var(--bg-soft);
}

.login-card {
    width: 560px;
    max-width: 100%;
    padding: 38px 42px 30px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 12px 34px rgba(60, 72, 120, 0.10);
}

.login-card h2 {
    font-size: 22px;
    text-align: center;
}

.subtitle {
    margin: 8px 0 22px;
    text-align: center;
    font-size: 14px;
    color: var(--text-gray);
}

/* ---------- 提示信息 ---------- */
.alerts {
    margin-bottom: 18px;
}

.alert {
    margin-bottom: 8px;
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 10px;
}

.alert.error {
    color: #b3261e;
    background: #fdecea;
    border: 1px solid #f5c6c2;
}

.alert.success {
    color: #1e7a3c;
    background: #e7f6ec;
    border: 1px solid #bfe8cd;
}

/* ---------- 登录表单 ---------- */
.form-item {
    margin-bottom: 18px;
}

.form-item label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
}

.form-item input,
.form-item select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 15px;
    color: var(--text-dark);
    background: #fafbfe;
    border: 1px solid #d7dce8;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-item select {
    padding: 0 12px;
    cursor: pointer;
}

.form-item input:focus,
.form-item select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(86, 126, 207, 0.16);
    background: #ffffff;
}

/* ---------- 登录成功欢迎区 ---------- */
.welcome {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.avatar {
    width: 64px;
    height: 64px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #7fb2d8 0%, var(--orange-deep) 100%);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(44, 95, 138, 0.25);
}

.welcome-text h2 {
    font-size: 24px;
    text-align: left;
}

.welcome-text .subtitle {
    margin: 6px 0 0;
    text-align: left;
}

/* ---------- 板块选择 ---------- */
.modules {
    margin-top: 4px;
    border: none;
}

.modules legend {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.module-list {
    display: flex;
    gap: 12px;
}

.module {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 6px;
    cursor: pointer;
    background: #fafbfe;
    border: 2px solid #e0e4ee;
    border-radius: 12px;
    transition: all 0.2s;
}

.module input {
    display: none;
}

.module-icon {
    font-size: 22px;
    line-height: 1;
}

.module-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.module-name {
    font-size: 15px;
    font-weight: 600;
    color: #4b5468;
}

.module-note {
    color: #8891a3;
    font-size: 11px;
    line-height: 1.25;
}

.module:hover {
    border-color: var(--orange);
    background: #fffaf4;
}

.module input:checked + .module-icon + .module-text .module-name {
    color: var(--blue-deep);
}

.module input:checked + .module-icon + .module-text .module-note {
    color: #52709a;
}

.module:has(input:checked) {
    border-color: var(--blue);
    background: rgba(86, 126, 207, 0.08);
    box-shadow: 0 0 0 2px rgba(86, 126, 207, 0.15);
}

/* ---------- 按钮 ---------- */
.login-btn,
.enter-btn {
    width: 100%;
    height: 46px;
    margin-top: 24px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 8px;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.login-btn {
    background: linear-gradient(180deg, #6d93dd 0%, var(--blue) 100%);
    box-shadow: 0 6px 14px rgba(86, 126, 207, 0.32);
}

.login-btn:hover {
    background: linear-gradient(180deg, #5e87d8 0%, var(--blue-deep) 100%);
    box-shadow: 0 8px 18px rgba(86, 126, 207, 0.38);
}

.enter-btn {
    background: linear-gradient(180deg, #4bb584 0%, var(--green) 100%);
    box-shadow: 0 6px 14px rgba(46, 158, 107, 0.30);
}

.enter-btn:hover {
    background: linear-gradient(180deg, #3aa975 0%, var(--green-deep) 100%);
    box-shadow: 0 8px 18px rgba(46, 158, 107, 0.38);
}

.logout-form {
    margin-top: 14px;
    text-align: center;
}

.logout-btn {
    font-size: 13px;
    color: #9aa1b0;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.logout-btn:hover {
    color: var(--blue-deep);
}

/* ---------- 板块页 ---------- */
.board-tip {
    margin-bottom: 24px;
    padding: 18px;
    text-align: center;
    font-size: 14px;
    color: #5a6b85;
    background: #f7f9fc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
}

.back-btn {
    display: block;
    width: 100%;
    height: 44px;
    line-height: 44px;
    text-align: center;
    font-size: 15px;
    color: var(--blue-deep);
    background: #eef3fc;
    border: 1px solid #cfdcf5;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.2s;
}

.back-btn:hover {
    background: #e2ebfa;
}

/* ---------- 页脚 ---------- */
.page-footer {
    padding: 14px 0;
    text-align: center;
    font-size: 12px;
    color: #b0b5c2;
    background: #ffffff;
    border-top: 1px solid #f0f2f7;
}

@media (max-width: 640px) {
    .banner-inner {
        flex-direction: column;
        text-align: center;
    }

    .module-list {
        flex-direction: column;
    }
}

/* ==================== 选择题模块 ==================== */
.module-page {
    width: min(1080px, 100%);
    margin: 0 auto;
}

.choice-home-card {
    padding: 32px 38px 26px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 12px 34px rgba(60, 72, 120, 0.10);
}

.choice-home-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.choice-home-head h2 {
    font-size: 24px;
    text-align: left;
}

.choice-home-head .subtitle {
    margin: 6px 0 0;
    text-align: left;
}

.resume-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 22px 0 0;
    padding: 12px 16px;
    background: #fff8e1;
    border: 1px solid #f0dfa8;
    border-radius: 12px;
}

.resume-box strong {
    display: block;
    color: #9a6b00;
}

.resume-box span {
    font-size: 12px;
    color: #b58a2e;
}

.resume-btn {
    flex: none;
    padding: 8px 18px;
    color: #ffffff;
    background: var(--orange-deep);
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
}

.stats-row {
    display: flex;
    gap: 14px;
    margin-top: 22px;
}

.stat-card {
    flex: 1;
    padding: 18px 10px;
    text-align: center;
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.stat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--blue-deep);
}

.stat-label {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-gray);
}

.choice-actions {
    margin-top: 26px;
    text-align: center;
}

.start-btn {
    width: 320px;
    max-width: 100%;
    letter-spacing: 4px;
}

.start-tip {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-gray);
}

.choice-links {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed #e4e8f0;
    font-size: 14px;
}

.choice-links a {
    color: var(--blue-deep);
    text-decoration: none;
}

.choice-links a:hover {
    text-decoration: underline;
}

/* ---------- 答题页 ---------- */
.quiz-wrap {
    width: 100%;
    margin: 0 auto;
}

.quiz-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(60, 72, 120, 0.08);
}

.quiz-user strong {
    display: block;
    font-size: 15px;
}

.quiz-user span {
    font-size: 12px;
    color: var(--text-gray);
}

.quiz-timer {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 22px;
    background: #fdecea;
    border: 1px solid #f5c6c2;
    border-radius: 10px;
}

.timer-label {
    font-size: 13px;
    color: #b3261e;
}

.timer-num {
    font-size: 24px;
    font-weight: 700;
    color: #b3261e;
    font-variant-numeric: tabular-nums;
}

.quiz-submit-btn {
    padding: 10px 26px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(180deg, #6d93dd 0%, var(--blue) 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.quiz-submit-btn:hover {
    background: var(--blue-deep);
}

.quiz-body {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 16px;
}

.answer-card {
    position: sticky;
    top: 14px;
    flex: none;
    width: 230px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    /* 题号多时（考试 43 题）卡片限高在视口内，超出部分卡片自己滚动，
       不用再滚到页面底部才能看到下面的题号 */
    max-height: calc(100vh - 28px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c8d2de transparent;
}

.answer-card::-webkit-scrollbar {
    width: 8px;
}

.answer-card::-webkit-scrollbar-thumb {
    background: #c8d2de;
    border-radius: 4px;
}

.answer-card::-webkit-scrollbar-thumb:hover {
    background: #aebbc9;
}

.answer-card::-webkit-scrollbar-track {
    background: transparent;
}

/* 倒计时 + 交卷 常驻卡片顶部，滚动题号时不会被滚走 */
.answer-card .quiz-controls {
    position: sticky;
    top: 0;
    z-index: 2;
}

.answer-card h3 {
    font-size: 16px;
}

.card-type {
    margin: 8px 0;
    font-size: 12px;
    color: var(--text-gray);
}

.quiz-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0 14px;
    padding: 12px;
    background: var(--bg-soft);
    border: 1px solid #f0dcc8;
    border-radius: 10px;
}

.quiz-controls .quiz-timer {
    justify-content: center;
    padding: 8px 10px;
}

.quiz-controls .quiz-submit-btn {
    width: 100%;
    padding: 10px 0;
}

.num-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
}

.num-btn {
    height: 34px;
    font-size: 14px;
    color: #4b5468;
    background: #f2f4f8;
    border: 1px solid #dfe3ec;
    border-radius: 8px;
    cursor: pointer;
}

.num-btn:hover {
    border-color: var(--blue);
}

.num-btn.done {
    color: #ffffff;
    background: var(--green);
    border-color: var(--green);
}

.card-legend {
    display: flex;
    gap: 14px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-gray);
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 4px;
    background: #f2f4f8;
    border: 1px solid #dfe3ec;
    border-radius: 50%;
    vertical-align: -1px;
}

.dot.done {
    background: var(--green);
    border-color: var(--green);
}

.card-hint {
    margin-top: 10px;
    font-size: 11px;
    color: #b0b5c2;
}

.question-area {
    flex: 1;
    min-width: 0;
}

.q-card {
    margin-bottom: 16px;
    padding: 20px 22px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.q-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.q-no {
    font-size: 16px;
    font-weight: 700;
}

.q-type,
.q-tip {
    padding: 2px 10px;
    font-size: 12px;
    border-radius: 999px;
}

.q-type.single {
    color: #1e7a3c;
    background: #e7f6ec;
}

.q-type.multi {
    color: #6b46a1;
    background: #f3ecfd;
}

.q-tip {
    color: #b3261e;
    background: #fdecea;
}

.q-score {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-gray);
}

.q-images {
    min-width: 0;
    text-align: center;
}

.q-images img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: none;
    margin: 0 auto 8px;
    border: 1px solid #eef1f6;
    border-radius: 10px;
}

/* 选择题选项：竖排逐行，字母圆缩小、选项文字放大（用户批注 2026-10-17） */
.option-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.opt-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.opt-btn:hover {
    border-color: var(--accent);
    background: #f5f9fd;
}

.opt-btn:has(input:checked) {
    border-color: var(--blue);
    background: #eef5fb;
}

.opt-btn input {
    display: none;
}

.opt-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 32px;
    height: 32px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    background: #f7f9fc;
    border: 1px solid #d7dce8;
    border-radius: 50%;
    transition: all 0.15s;
}

.opt-btn:hover .opt-letter {
    border-color: var(--accent);
    background: #eef5fb;
}

.opt-btn:has(input:checked) .opt-letter {
    color: #ffffff;
    background: var(--blue);
    border-color: var(--blue);
    box-shadow: 0 3px 10px rgba(42, 107, 176, 0.3);
}

/* 选项文字：原来没有单独样式、继承到 15px，偏小；放大到 17px 并提高行高 */
.opt-btn .opt-text {
    font-size: 17px;
    line-height: 1.65;
    color: var(--text-dark);
}

.opt-btn.multi:has(input:checked) .opt-letter {
    background: #7b5cd6;
    border-color: #7b5cd6;
}

.quiz-bottom-actions {
    text-align: center;
    padding: 10px 0 26px;
}

/* ---------- 成绩单页 ---------- */
.result-card {
    padding: 34px 42px 28px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 12px 34px rgba(60, 72, 120, 0.10);
    text-align: center;
}

.result-score {
    margin: 12px 0 22px;
}

.score-num {
    font-size: 64px;
    font-weight: 800;
    color: var(--green);
}

.score-total {
    font-size: 24px;
    color: var(--text-gray);
}

.result-groups {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.result-group {
    flex: 1;
    padding: 16px;
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.result-group h3 {
    margin-bottom: 10px;
    font-size: 15px;
}

.result-row {
    display: flex;
    justify-content: space-around;
    font-size: 14px;
}

.result-row .ok {
    color: var(--green);
    font-size: 18px;
}

.result-row .bad {
    color: #b3261e;
    font-size: 18px;
}

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

.btn-primary,
.btn-ghost {
    padding: 11px 22px;
    font-size: 14px;
    border-radius: 10px;
    text-decoration: none;
}

.btn-primary {
    color: #ffffff;
    background: var(--blue);
}

.btn-primary:hover {
    background: var(--blue-deep);
}

.btn-ghost {
    color: var(--blue-deep);
    background: #eef3fc;
    border: 1px solid #cfdcf5;
}

.btn-ghost:hover {
    background: #e2ebfa;
}

.result-links {
    margin-top: 16px;
    font-size: 13px;
}

.result-links a {
    color: var(--text-gray);
    text-decoration: none;
}

/* ---------- 解析页 ---------- */
.review-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 18px 24px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.review-top h2 {
    text-align: left;
}

.review-top .subtitle {
    margin: 6px 0 0;
    text-align: left;
}

.review-switch a {
    padding: 8px 16px;
    color: var(--blue-deep);
    background: #eef3fc;
    border: 1px solid #cfdcf5;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
}

.review-card {
    margin-bottom: 14px;
    padding: 18px 22px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-left-width: 6px;
    border-radius: 12px;
}

.review-card.right {
    border-left-color: var(--green);
}

.review-card.wrong {
    border-left-color: #d64541;
}

.q-result.ok {
    color: #1e7a3c;
}

.q-result.bad {
    color: #b3261e;
}

.review-answers {
    display: flex;
    gap: 30px;
    margin: 12px 0;
    font-size: 14px;
}

.answer-line.ok {
    color: #1e7a3c;
}

.answer-line.bad {
    color: #b3261e;
}

.analysis {
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.7;
    color: #4b5468;
    background: #f7f9fc;
    border-radius: 8px;
}

.review-back {
    margin: 18px auto 0;
    max-width: 320px;
}

.empty-tip {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-gray);
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
}

/* ---------- 已做测验列表页 ---------- */
.history-page {
    width: min(1500px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 75px;
    padding: 0 22px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.history-title h2 {
    font-size: 20px;
    text-align: left;
}

.history-title span {
    margin-left: 12px;
    font-size: 13px;
    color: var(--text-gray);
}

.history-nav {
    display: flex;
    gap: 14px;
}

.history-nav a {
    color: var(--blue-deep);
    text-decoration: none;
    font-size: 14px;
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.history-actions form {
    margin: 0;
}

.history-start-btn {
    border: none;
    background: var(--blue-deep, #33537b);
    color: #ffffff;
    font-size: 14px;
    letter-spacing: 2px;
    padding: 9px 20px;
    border-radius: 8px;
    cursor: pointer;
}

.history-start-btn:hover {
    opacity: 0.88;
}

.history-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.rank-side {
    flex: none;
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rank-panel {
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.rank-panel h3 {
    margin-bottom: 10px;
    font-size: 15px;
}

.rank-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

/* 全校排行榜比本班排行榜多展示约 150px 的内容 */
.rank-side .rank-panel:last-child .rank-list {
    max-height: 450px;
}

.rank-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 14px;
}

.rank-list li:nth-child(odd) {
    background: #fafbfe;
}

.rank-list li.me {
    background: #fff3e2;
    font-weight: 700;
}

.rank-no {
    width: 24px;
    color: #b0b5c2;
    font-size: 13px;
}

.rank-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-score {
    font-weight: 700;
    color: var(--orange-deep);
}

.rank-empty {
    padding: 14px 4px;
    font-size: 13px;
    color: var(--text-gray);
    text-align: center;
}

.history-list {
    flex: 1;
    min-width: 0;
    padding: 16px 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.list-head h3 {
    margin-bottom: 10px;
    font-size: 15px;
}

.list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.list-head .mini-nav {
    font-size: 13px;
    color: var(--blue-deep);
    text-decoration: none;
}

.record-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.record-table th,
.record-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #eef1f6;
}

.record-table th {
    color: var(--text-gray);
    font-weight: 600;
    background: #fafbfe;
}

.record-table tbody tr:hover {
    background: #f7f9fc;
}

.table-link {
    color: var(--blue-deep);
    text-decoration: none;
}

.table-link:hover {
    text-decoration: underline;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-gray);
}

.pager-btns {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.pager-btns a {
    padding: 6px 14px;
    color: var(--blue-deep);
    background: #eef3fc;
    border: 1px solid #cfdcf5;
    border-radius: 8px;
    text-decoration: none;
}

.pager-btns a:hover {
    background: #e2ebfa;
}

.pager-btns a.page-number {
    min-width: 34px;
    padding-right: 10px;
    padding-left: 10px;
    text-align: center;
}

.pager-btns a.page-number.active {
    color: #ffffff;
    background: var(--blue-deep);
    border-color: var(--blue-deep);
}

.pager-btns a.page-number.active:hover {
    background: var(--blue-deep);
}

@media (max-width: 900px) {
    .quiz-body,
    .history-main {
        flex-direction: column;
    }

    .answer-card {
        position: static;
        width: 100%;
    }

    .rank-side {
        width: 100%;
    }

    .pager {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .pager-btns {
        justify-content: flex-start;
    }

    .result-groups {
        flex-direction: column;
    }
}

/* ---------- 答题页：单选/多选分页 + 答题卡分区 ---------- */
.q-page[hidden] {
    display: none;
}

.q-page-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.q-page-head em {
    font-style: normal;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-gray);
}

.answer-group {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e4e8f0;
}

.card-type-title {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #4b5468;
}

.page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 6px 0 26px;
}

.page-nav-btn {
    padding: 9px 26px;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(180deg, #6d93dd 0%, var(--blue) 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.page-nav-btn:hover:not(:disabled) {
    background: var(--blue-deep);
}

.page-nav-btn:disabled {
    background: #cfd6e4;
    cursor: not-allowed;
}

#pageIndicator {
    min-width: 76px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

/* ---------- 紧凑顶部横幅（整体约 2/3）：已做列表页与做题页共用 ---------- */
.compact-banner .top-banner {
    padding: 15px 32px;
    box-shadow: none;
}

.compact-banner .logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.compact-banner .logo .b1 {
    left: 8px;
    top: 9px;
    width: 32px;
    height: 13px;
}

.compact-banner .logo .b2 {
    left: 8px;
    top: 22px;
    width: 13px;
    height: 13px;
}

.compact-banner .logo .b3 {
    left: 22px;
    top: 22px;
    width: 17px;
    height: 13px;
}

.compact-banner .brand h1 {
    font-size: 18px;
}

.compact-banner .brand p {
    margin-top: 4px;
    font-size: 11px;
    letter-spacing: 4px;
}

.compact-banner .banner-inner {
    gap: 14px;
}

.quiz-page .container {
    padding-top: 10px;
    padding-left: 20px;
    padding-right: 20px;
    align-items: flex-start;
}

.review-page .container {
    padding-top: 10px;
    padding-left: 20px;
    padding-right: 20px;
    align-items: flex-start;
}

.review-page .module-page {
    width: 100%;
}

.review-page .review-top {
    height: 52px;
    padding: 0 20px;
    margin-bottom: 14px;
}

.review-page .review-top h2 {
    font-size: 15px;
    margin: 0;
}

.review-page .review-top .subtitle {
    font-size: 12px;
    margin: 0;
}

.review-page .review-switch a {
    padding: 4px 12px;
    font-size: 12px;
}

.history-compact .history-page {
    margin-top: 0;
}

.history-compact .history-top {
    margin-top: 0;
    height: 50px;
    padding: 0 18px;
}

.history-compact .history-title h2 {
    font-size: 14px;
}

.history-compact .history-title span {
    margin-left: 10px;
    font-size: 11px;
}

.history-compact .history-nav {
    gap: 10px;
}

.history-compact .history-nav a {
    font-size: 12px;
}

.history-compact .container {
    padding-top: 10px;
    align-items: flex-start;
}

.history-compact .history-page {
    gap: 10px;
}

/* ==================== 编程题板块（偏深橘色主题，仅 .prog-body 生效） ==================== */
body.prog-body .top-banner {
    background: linear-gradient(135deg, #eda468 0%, #d96f2b 45%, #b34912 100%);
    box-shadow: 0 2px 10px rgba(120, 45, 0, 0.18);
}

body.prog-body .brand h1 {
    text-shadow: 0 2px 4px rgba(120, 45, 0, 0.4);
}

body.prog-body .container {
    background:
        radial-gradient(circle at 12% 18%, rgba(217, 111, 43, 0.16) 0, transparent 30%),
        radial-gradient(circle at 88% 82%, rgba(86, 126, 207, 0.08) 0, transparent 32%),
        var(--bg-soft);
}

/* ---------- 答题页：题目条 + 编辑器全屏布局 ---------- */
body.prog-quiz-page {
    overflow: hidden;
}

/* 答题页让位给编辑器：隐藏平台横幅与页脚 */
body.prog-quiz-page .top-banner,
body.prog-quiz-page .page-footer {
    display: none;
}

body.prog-quiz-page .container {
    display: block;
    padding: 0;
    align-items: stretch;
}

.prog-quiz-wrap {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 4px 10px 6px;
}

.prog-quiz-top {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 3px 8px;
    margin-bottom: 4px;
    flex: none;
}

.prog-qimages {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.prog-qimages img {
    max-height: 46px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.prog-qmeta {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.prog-qno {
    background: #b34912;
    color: #fff;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 11px;
}

.prog-qscore {
    color: #b34912;
    font-size: 12px;
    font-weight: 700;
}

.prog-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff2e6;
    border: 1px solid #e9b28a;
    border-radius: 5px;
    padding: 2px 7px;
}

.prog-timer .timer-label {
    font-size: 10px;
    color: #8a4a20;
}

.prog-timer .timer-num {
    font-size: 13px;
    font-weight: 700;
    color: #b34912;
    font-variant-numeric: tabular-nums;
}

.prog-qmeta .quiz-submit-btn {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 5px;
}

.prog-save-state {
    flex: none;
    font-size: 11px;
    color: #a56633;
    margin: 0 2px 3px;
    min-height: 12px;
}

.prog-editor-frame {
    flex: 1;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.prog-editor-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- 解析页 ---------- */
.prog-review .container,
body.prog-review-page .container {
    align-items: flex-start;
}

body.prog-review-page .container {
    padding-top: 10px;
    padding-left: 20px;
    padding-right: 20px;
}

body.prog-review-page .module-page {
    width: 100%;
}

.prog-review-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 14px;
}

.prog-sec-title {
    margin: 18px 0 8px;
    font-size: 15px;
    color: #b34912;
    border-left: 4px solid #d96f2b;
    padding-left: 8px;
}

.prog-review-frame {
    height: 760px;
    flex: none;
}

.prog-answer-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.judge-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
    font-size: 14px;
}

.judge-table th,
.judge-table td {
    border: 1px solid var(--line);
    padding: 8px 10px;
    text-align: left;
}

.judge-table th {
    background: #fff2e6;
    color: #8a3d0f;
}

.judge-table .ok { color: var(--green-deep); font-weight: 600; }
.judge-table .bad { color: #c0392b; font-weight: 600; }

/* ---------- 答题页 v2：题目弹窗 + 右侧控制条 ---------- */
.prog-quiz-main {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.prog-quiz-main .prog-editor-frame {
    flex: 1;
    min-width: 0;
}

.prog-sidebar {
    flex: none;
    width: 128px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 6px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.prog-view-question {
    width: 100%;
    padding: 7px 4px;
    border: 1px solid #d96f2b;
    border-radius: 6px;
    background: #fff2e6;
    color: #b34912;
    font-size: 12px;
    cursor: pointer;
}

.prog-view-question:hover {
    background: #ffe3cc;
}

.prog-sidebar .prog-qscore {
    font-size: 12px;
}

.prog-sidebar .prog-timer {
    width: 100%;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
}

.prog-sidebar .quiz-submit-btn {
    width: 100%;
    padding: 8px 4px;
    font-size: 13px;
    border-radius: 6px;
}

.prog-sidebar .prog-save-state {
    margin: 0;
    text-align: center;
    line-height: 1.4;
    font-size: 10px;
}

/* 题目内容弹窗 */
.prog-modal {
    position: fixed;
    inset: 0;
    background: rgba(30, 20, 10, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.prog-modal[hidden] {
    display: none;
}

.prog-modal-box {
    background: #ffffff;
    border-radius: 12px;
    width: min(92vw, 1000px);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(80, 30, 0, 0.25);
}

.prog-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fff2e6;
    border-bottom: 1px solid #f0d2b8;
}

.prog-modal-head h3 {
    font-size: 15px;
    color: #8a3d0f;
}

.prog-modal-close {
    border: 0;
    background: transparent;
    color: #8a3d0f;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
}

.prog-modal-body {
    overflow: auto;
    padding: 14px;
    text-align: center;
}

.prog-modal-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ==================== 在线考试 ==================== */

/* ---------- 试卷列表页 ---------- */
.rank-paper-form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: var(--bg-soft);
    border: 1px solid #f0dcc8;
    border-radius: 10px;
    font-size: 12px;
    color: #6b4a2e;
}

.rank-paper-form select {
    flex: 1;
    min-width: 0;
    max-width: 170px;
    padding: 5px 6px;
    font-size: 12px;
    border: 1px solid #e2c6a8;
    border-radius: 6px;
    background: #ffffff;
    color: #4b5468;
}

.exam-table .exam-title-cell {
    min-width: 150px;
    max-width: 230px;
    font-weight: 600;
    color: #2c3454;
}

.exam-table .exam-type-stats {
    min-width: 150px;
    font-size: 12px;
    line-height: 1.5;
    color: #4b5468;
}

.exam-table .exam-score-cell b {
    font-size: 13px;
}

tr.exam-row {
    cursor: pointer;
}

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.status-badge.todo {
    color: #7a8499;
    background: #f0f2f6;
}

.status-badge.doing {
    color: #a34c08;
    background: #fff1e0;
}

.status-badge.done {
    color: #147d4c;
    background: #e4f6ec;
}

/* ---------- 考前准备页 ---------- */
.exam-ready-page .module-page {
    width: 100%;
}

.exam-ready-card {
    max-width: 720px;
    margin: 0 auto;
}

.exam-ready-title {
    margin: 14px 0 10px;
    padding: 14px 18px;
    font-size: 18px;
    font-weight: 700;
    color: #2c3454;
    text-align: center;
    background: #f7f9fc;
    border: 1px dashed #cfd8e8;
    border-radius: 10px;
}

.exam-ready-rows {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 4px 0 12px;
}

.exam-ready-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-soft);
    border: 1px solid #f0dcc8;
    border-radius: 10px;
}

.exam-ready-row .ready-label {
    font-size: 13px;
    color: #8a6b4a;
}

.exam-ready-row b {
    font-size: 16px;
    color: #b34912;
}

.exam-ready-types {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 6px 0 12px;
}

.exam-ready-type {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: #eef3fb;
    border-radius: 999px;
}

.exam-ready-type .type-name {
    font-size: 13px;
    color: #3d5c9b;
    font-weight: 600;
}

.exam-ready-type .type-count {
    font-size: 13px;
    color: #1f2c47;
}

.exam-ready-notes {
    margin: 8px 0 16px;
    padding: 12px 16px;
    background: #f7f9fc;
    border-radius: 10px;
    font-size: 13px;
    color: #5a6478;
    line-height: 1.8;
}

.exam-start-btn {
    display: block;
    margin: 0 auto;
    padding: 12px 64px;
    font-size: 18px;
}

.exam-countdown-page .module-page {
    width: 100%;
}

.exam-countdown-card {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.countdown {
    margin: 26px 0 8px;
    color: var(--text-dark);
    font-family: Consolas, "Courier New", monospace;
    font-size: 54px;
    font-weight: 700;
    letter-spacing: 4px;
}

.countdown-tip {
    margin-top: 6px;
    color: #8a93a6;
    font-size: 13px;
}

.exam-countdown-page #enterBtn[hidden] {
    display: none;
}

/* ---------- 考试答题页：编程题整页切换 ---------- */
.exam-quiz-page .quiz-wrap {
    display: block;
}

/* 选择题页容器直接子元素占满宽度；考试页多包一层，需同样撑满，避免内容被压缩居中 */
.exam-quiz-page #examQuizApp {
    width: 100%;
    min-width: 0;
}

#progStage {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 4px 10px 6px;
    box-sizing: border-box;
}

#progStage[hidden] {
    display: none;
}

#progStage .exam-prog-frame {
    flex: 1;
    min-height: 0;
}

body.exam-prog-active .top-banner,
body.exam-prog-active .page-footer {
    display: none;
}

body.exam-prog-active .container {
    display: block;
    padding: 0;
    align-items: stretch;
}

/* ---------- 考试通用弹窗 ---------- */
.exam-modal {
    position: fixed;
    inset: 0;
    background: rgba(30, 20, 10, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.exam-modal[hidden] {
    display: none;
}

.exam-modal-box {
    background: #ffffff;
    border-radius: 12px;
    width: min(92vw, 1000px);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(80, 30, 0, 0.25);
}

.exam-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-soft);
    border-bottom: 1px solid #f0dcc8;
}

.exam-modal-head h3 {
    font-size: 15px;
    color: #8a3d0f;
}

.exam-modal-close {
    border: 0;
    background: transparent;
    color: #8a3d0f;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
}

.exam-modal-body {
    overflow: auto;
    padding: 14px;
    text-align: center;
}

.exam-modal-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.exam-card-modal-box {
    width: min(92vw, 420px);
}

.exam-card-modal-box .exam-modal-body {
    text-align: left;
}

/* ---------- 解析页：左侧解析导航 + 右侧分页 ---------- */
.exam-review-page .module-page {
    width: 100%;
}

.exam-review-body {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.exam-review-body .exam-review-nav {
    flex: none;
    width: 230px;
}

.exam-review-pages {
    flex: 1;
    min-width: 0;
}

.exam-review-section[hidden],
.exam-review-section[hidden] .prog-review-card {
    display: none;
}

.exam-review-section {
    margin-bottom: 14px;
}

.prog-review-card-section {
    width: 100%;
}

/* 手机上榜单/解析导航自然堆叠 */
@media (max-width: 980px) {
    .exam-review-body {
        flex-direction: column;
    }

    .exam-review-body .exam-review-nav {
        width: 100%;
        position: static;
    }
}

/* ================= C++ 主题点缀（cpp_ynocde） =================
   布局、尺寸、交互沿用 sb_yncode / py_yncode，仅在本站换成 C++ 官方蓝
   （#00599C）主色 + C++ logo 浅蓝（#659AD2）点缀，
   使 C++ 题库与 Python（蓝黄）、Scratch（橙）题库一眼可区分。 */
body.cpp-theme .top-banner {
    border-bottom: 4px solid var(--accent);
}

body.cpp-theme .login-btn,
body.cpp-theme .enter-btn,
body.cpp-theme .start-btn,
body.cpp-theme .resume-btn,
body.cpp-theme .quiz-submit-btn {
    background: linear-gradient(180deg, #2c7cc0 0%, var(--orange) 100%);
    box-shadow: 0 6px 16px rgba(0, 68, 124, 0.22);
}

body.cpp-theme .q-card {
    border-top: 3px solid rgba(0, 89, 156, 0.35);
}

/* 多选题选中态用 C++ 浅蓝，与单选 / 判断区分更明显 */
body.cpp-theme .opt-btn.multi:has(input:checked) .opt-letter {
    background: var(--accent);
    border-color: #4a86c5;
    color: #ffffff;
}

body.cpp-theme .stat-num,
body.cpp-theme .score-num,
body.cpp-theme .rank-score {
    color: var(--orange-deep);
}

body.cpp-theme .num-btn.done {
    background: var(--orange);
    border-color: var(--orange-deep);
}

/* ---------- 顶部横幅右侧的登录身份（全站常驻） ---------- */
.banner-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
}

.banner-user-role {
    opacity: 0.85;
}

.banner-user-name {
    font-weight: 700;
}

.compact-banner .banner-user {
    padding: 4px 12px;
    font-size: 13px;
}

@media (max-width: 720px) {
    .banner-inner {
        gap: 12px;
    }

    .banner-user {
        padding: 4px 10px;
        font-size: 13px;
    }

    .banner-user-role {
        display: none;
    }
}

/* ================= Python 编程题板块（cppprog） =================
   数据表与判分口径沿用旧系统 program_editor_py，视觉按本站 Python 主题重做。 */
.cppprog {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* 编程题答题页：与做题页一样让内容顶端对齐，去掉上下居中带来的大片空白 */
.cppprog-page .container {
    padding-top: 10px;
    padding-left: 20px;
    padding-right: 20px;
    align-items: flex-start;
}

.cppprog-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(44, 95, 138, 0.06);
}

.cppprog-bar-left,
.cppprog-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* "← 题库" 用紧凑按钮样式（.back-btn 默认是整行块级，会撑成一条宽框） */
.cppprog-bar .back-btn {
    display: inline-flex;
    align-items: center;
    width: auto;
    height: 30px;
    line-height: 1;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 8px;
}

.cppprog-no {
    font-weight: 700;
    color: var(--orange-deep);
}

.cppprog-title {
    font-weight: 700;
    font-size: 16px;
}

.cppprog-meta {
    color: var(--text-gray);
    font-size: 13px;
}

.back-btn.small,
.btn-ghost.small {
    padding: 4px 10px;
    font-size: 13px;
}

.cppprog-fontsize {
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-dark);
    background: #ffffff;
}

.cppprog-body {
    display: flex;
    gap: 14px;
    align-items: stretch;
    width: 100%;
    /* 两栏共用同一工作高度：左侧内容多时在栏内滚动，右侧编辑器自动填满，不会留空白 */
    height: calc(100vh - 140px);
    min-height: 560px;
    max-height: 900px;
}

/* ---------- 编程题答题页：题目 / 代码 双视图切换（2026-10-17） ----------
   题目与结果、代码编辑各占一屏，切换显示，题面不再被固定 500px 压缩；
   视图切换用文字页签（不用大按钮），上下间距收紧 */
.cppprog-viewtabs {
    display: flex;
    gap: 24px;
    /* 上下间距按批注统一为 5px */
    margin: 5px 0;
    padding: 0 4px;
}

.cppprog-viewtab {
    padding: 0 2px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-gray);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.cppprog-viewtab:hover {
    color: var(--orange-deep);
}

.cppprog-viewtab.active {
    color: var(--orange-deep);
    border-bottom-color: var(--orange);
    font-weight: 700;
}

/* 题目视图铺满视口（内部滚动）；代码视图由编辑器高度撑开 */
body.prog-editor-page .container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

body.prog-editor-page #cppprogApp {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    /* 取消 .cppprog 默认的 12px 间隙，页签上下间距完全由 margin 控制（5px） */
    gap: 0;
}

body.prog-editor-page .cppprog-body {
    display: block;
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    max-height: none;
}

body.prog-editor-page .cppprog-view[hidden] {
    display: none !important;
}

body.prog-editor-page .cppprog-left {
    width: 100%;
    height: calc(100vh - 252px);
    min-height: 460px;
}

body.prog-editor-page .cppprog-right {
    width: 100%;
    height: auto;
}

/* 单视图下编辑器始终占满代码页（覆盖窄屏时固定 380px 的旧规则） */
body.prog-editor-page .cppprog-right .CodeMirror {
    flex: 1 1 auto;
    height: auto;
    min-height: 320px;
}

.cppprog-left {
    /* 左侧题面区固定 500px，不随窗口变化 */
    flex: none;
    width: 500px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.cppprog-right {
    /* 右侧编程区占满剩余宽度，随窗口增减 */
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    /* 编程区整体暗底（配合编辑器暗色主题） */
    background: #1f2933;
    border: 1px solid #2b3947;
    border-radius: 10px;
    padding: 10px;
}

.cppprog-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 10px 0;
    border-bottom: 1px solid var(--line);
    background: var(--bg-soft);
}

.cppprog-tab {
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    padding: 8px 14px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-gray);
}

.cppprog-tab:hover {
    color: var(--orange-deep);
}

.cppprog-tab.active {
    background: #ffffff;
    border-color: var(--line);
    color: var(--orange-deep);
    font-weight: 700;
}

.cppprog-panels {
    flex: 1;
    overflow: auto;
    padding: 12px;
    /* 左栏（题目描述 / 测试结果 / 提交记录）固定高度，超出用滚动条查看 */
    scrollbar-width: thin;
    scrollbar-color: #b9c7d6 transparent;
}

.cppprog-panels::-webkit-scrollbar {
    width: 10px;
}

.cppprog-panels::-webkit-scrollbar-thumb {
    background: #b9c7d6;
    border-radius: 5px;
}

.cppprog-panels::-webkit-scrollbar-thumb:hover {
    background: #9fb0c2;
}

.cppprog-panels::-webkit-scrollbar-track {
    background: transparent;
}

.cppprog-hint-text {
    color: var(--text-gray);
    line-height: 1.7;
    font-size: 14px;
}

/* 题面富文本：严格对齐 program_editor_cpp 的 templates/main/editor.html
   （内容底色改成白色；bghint / keyword / bgblack 等标签沿用旧项目的配色与内边距） */
.cppprog-content {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 16px; /* 旧项目 12pt */
    line-height: 1.5;
    color: #000;
    background: #ffffff;
    padding: 10px;
}

.cppprog-content bold {
    display: inline-block;
    font-weight: 700;
    padding: 3px 6px;
}

.cppprog-content keyword {
    display: inline-block;
    margin: 1px 0;
    padding: 0 1px;
    color: #ff0000;
    background: rgb(255, 221, 226);
}

.cppprog-content bgblack {
    display: block;
    margin: 8px 0;
    padding: 10px;
    border-radius: 5px;
    background: #000000;
    color: #ffffff;
    white-space: pre-wrap;
}

.cppprog-content bghint {
    display: block;
    margin: 8px 0;
    padding: 10px;
    border-radius: 5px;
    background: rgb(255, 221, 157);
    color: #000000;
    line-height: 1.5;
}

.cppprog-content bghintkeyword {
    display: inline-block;
    padding: 0 5px;
    color: #ff0000;
}

.cppprog-content sup {
    vertical-align: super;
    font-size: 70%;
}

/* 后台可能直接把题面做成图片：按题面宽度自适应，不撑破面板 */
.cppprog-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 8px 0;
}

/* 测试结果 */
.cppprog-result {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cppprog-case {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.cppprog-case.ok {
    border-left: 4px solid var(--green);
}

.cppprog-case.bad {
    border-left: 4px solid #d9534f;
}

.case-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-soft);
    cursor: pointer;
}

.case-no {
    font-weight: 700;
    font-size: 14px;
}

.case-flag {
    font-size: 12px;
    color: #b03a35;
}

.case-toggle {
    margin-left: auto;
    color: var(--text-gray);
    font-size: 13px;
}

.case-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
}

/* display:flex 会盖掉 [hidden] 的默认 display:none，这里显式声明，保证收起生效 */
.case-body[hidden] {
    display: none;
}

.case-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.case-label {
    flex: none;
    width: 70px;
    padding-top: 7px;
    color: var(--text-gray);
    font-size: 14px;
}

.case-value {
    flex: 1;
    margin: 0;
    min-height: 22px;
    padding: 10px 12px;
    background: #1f2933;
    color: #f5f7fa;
    border-radius: 6px;
    font-family: Consolas, "Courier New", monospace;
    /* 输入/输出黑框里的字号：13px（太小）→ 16px（当前） */
    font-size: 16px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 状态与难度徽章 */
.pass-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
}

.pass-badge.ok {
    background: #e6f6ee;
    color: var(--green-deep);
}

.pass-badge.fail {
    background: #fdeaea;
    color: #b03a35;
}

.pass-badge.none {
    background: #eef1f6;
    color: var(--text-gray);
}

.level-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
}

.level-badge.level-0 {
    background: #e6f6ee;
    color: var(--green-deep);
}

.level-badge.level-1 {
    background: #fff3d6;
    color: #9a6b00;
}

.level-badge.level-2 {
    background: #fdeaea;
    color: #b03a35;
}

/* 题目列表 */
.cppprog-table .topic-col {
    text-align: left;
}

.topic-link {
    color: var(--blue-deep);
    font-weight: 600;
    text-decoration: none;
}

.topic-link:hover {
    text-decoration: underline;
}

.topic-score {
    margin-left: 4px;
    color: var(--text-gray);
    font-size: 12px;
}

.list-tip {
    color: var(--text-gray);
    font-size: 12px;
}

/* 编辑器 */
.cppprog-right .CodeMirror {
    /* 由面板高度决定：占满按钮行以上的全部空间 */
    flex: 1 1 auto;
    height: auto;
    min-height: 200px;
    border: 1px solid #2b3947;
    border-radius: 8px;
    font-family: Consolas, "Courier New", monospace;
    line-height: 1.5;
}

.cppprog-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex: none;
}

/* 运行按钮固定 200px，不随编程区变宽而拉伸 */
.cppprog-actions .enter-btn {
    width: 200px;
    flex: none;
    height: 42px;
    margin-top: 0;
    font-size: 15px;
}

/* 暗底上的次要按钮 */
.cppprog-right .btn-ghost {
    flex: none;
    padding: 10px 16px;
    color: #cfe0f0;
    background: #2b3947;
    border: 1px solid #3b4c5e;
}

.cppprog-right .btn-ghost:hover {
    background: #35455a;
}

.cppprog-state {
    color: #9fb0c0;
    font-size: 13px;
}

.cppprog-state.ok {
    color: #6fd39a;
}

.cppprog-state.bad {
    color: #ff9a8f;
}

/* 弹窗 */
.cppprog-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(20, 30, 45, 0.45);
}

.cppprog-modal[hidden] {
    display: none;
}

.cppprog-modal-box {
    display: flex;
    flex-direction: column;
    width: min(880px, 96vw);
    max-height: 86vh;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(20, 40, 70, 0.25);
}

.cppprog-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
}

.cppprog-modal-head h3 {
    font-size: 16px;
}

.cppprog-modal-close {
    border: none;
    background: transparent;
    color: var(--text-gray);
    font-size: 16px;
    cursor: pointer;
}

.cppprog-modal-body {
    padding: 14px 16px;
    overflow: auto;
}

.pass-body {
    text-align: center;
}

.pass-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
}

/* 通过弹窗里的「下一题」固定 200px */
.pass-actions .enter-btn {
    width: 200px;
    flex: none;
    height: 42px;
    margin-top: 0;
    font-size: 15px;
}

#historyCode {
    width: 100%;
}

#codeModal .CodeMirror {
    height: 460px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: Consolas, "Courier New", monospace;
}

@media (max-width: 980px) {
    .cppprog-body {
        flex-direction: column;
        height: auto;
        max-height: none;
    }

    .cppprog-left {
        width: 100%;
        min-width: 0;
        max-height: 420px;
    }

    .cppprog-right .CodeMirror {
        height: 380px;
        flex: none;
    }
}

/* ================= Python 在线考试板块（exam） =================
   题源结构对齐 CSP-J1：选择题组 1 页、每个程序阅读/完善程序各 1 页。 */
.exam-table .topic-col,
.exam-ready-table .topic-col {
    text-align: left;
}

/* 操作列：查看解析 / 重做一次 竖排 */
.exam-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.retry-btn {
    padding: 0;
    font-size: 13px;
    color: var(--blue-deep);
    background: none;
    border: none;
    cursor: pointer;
}

.retry-btn:hover {
    text-decoration: underline;
}

.rank-tip {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-gray);
}

/* ---------- 考前准备页 ---------- */
.exam-ready-card {
    width: min(900px, 100%);
    margin: 0 auto;
    padding: 22px 26px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(44, 95, 138, 0.08);
}

.exam-ready-meta {
    display: flex;
    gap: 14px;
    margin: 18px 0;
}

.exam-ready-meta .stat-card {
    flex: 1;
}

.exam-ready-tip {
    margin-top: 14px;
    color: var(--text-gray);
    font-size: 13px;
    line-height: 1.7;
}

.exam-ready-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.exam-ready-actions .enter-btn {
    width: 220px;
    margin-top: 0;
}

/* ---------- 答题页 ---------- */
.exam-page-count {
    margin-left: auto;
    color: var(--text-gray);
    font-size: 12px;
}

.exam-group-content {
    margin-bottom: 10px;
    padding: 12px 14px;
    background: var(--bg-soft);
    border-radius: 8px;
    /* 大题说明文字：按用户批注整体 +3px */
    font-size: 18px;
    line-height: 1.75;
    white-space: pre-wrap;
}

.exam-q-content {
    margin: 6px 0 4px;
    /* 小题题干：15px -> 18px */
    font-size: 18px;
    line-height: 1.75;
    white-space: pre-wrap;
}

/* 考试题的选项：单选题竖排（字母 + 文字），判断题横排（√ / ×） */
.exam-q .option-buttons {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 10px;
}

.exam-q .option-buttons.judge-row {
    flex-direction: row;
}

.exam-q .opt-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    transition: all 0.15s;
}

.exam-q .opt-btn:hover {
    border-color: var(--orange);
    background: #fffaf4;
}

.exam-q .opt-btn:has(input:checked) {
    border-color: var(--blue);
    background: #eef3fc;
}

.exam-q .opt-letter {
    width: 30px;
    height: 30px;
    font-size: 17px;
    border-width: 1px;
    border-radius: 50%;
}

.exam-q .opt-btn:has(input:checked) .opt-letter {
    color: #ffffff;
    background: var(--blue);
    border-color: var(--blue);
    box-shadow: none;
}

.exam-q .opt-text {
    /* 选项文字：15px -> 18px */
    font-size: 18px;
    color: var(--text-dark);
}

.exam-q .opt-btn.judge {
    flex: 1;
    justify-content: center;
    padding: 12px 18px;
}

.exam-q .opt-judge {
    /* 判断题的 √ / × ：22px -> 25px */
    font-size: 25px;
    font-weight: 700;
    color: var(--text-dark);
}

.exam-q .opt-btn.judge:has(input:checked) .opt-judge {
    color: var(--blue-deep);
}

/* ---------- 解析页：大题分组 ---------- */
.review-group {
    margin-bottom: 16px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.review-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.review-group-head h3 {
    font-size: 16px;
}

.review-group-meta {
    color: var(--text-gray);
    font-size: 12px;
}

/* 考试解析页：我的答案 / 正确答案 与解析文字同步放大（与答题页字号一致） */
.review-group .answer-line {
    font-size: 18px;
}

.review-group .analysis {
    font-size: 17px;
}

/* ---------- 代码容器（程序阅读 / 完善程序的程序部分） ----------
   深色 IDE 风格：底色 #1e1f22，关键字橙、字符串黄、内置函数青、注释灰、数字蓝 */
.code-block {
    margin: 12px 0 14px;
    background: #1e1f22;
    border: 1px solid #2b2d31;
    border-radius: 10px;
    overflow: hidden;
}

.code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #26282c;
    border-bottom: 1px solid #2b2d31;
}

.code-lang {
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    color: #9da3ae;
}

.code-copy {
    padding: 2px 10px;
    font-size: 12px;
    color: #cfe0f0;
    background: #2f3136;
    border: 1px solid #3f4247;
    border-radius: 6px;
    cursor: pointer;
}

.code-copy:hover {
    background: #3a3d43;
}

/* 代码区：左侧行号列 + 右侧代码，二者在同一个滚动容器里（横向滚动时行号吸左） */
.code-scroll {
    display: flex;
    align-items: flex-start;
    /* 程序阅读材料要能一屏读完：放宽到 720px，更高的程序才出现卡内滚动 */
    max-height: 720px;
    overflow: auto;
    background: #1e1f22;
}

.code-gutter {
    position: sticky;
    left: 0;
    z-index: 1;
    flex: none;
    margin: 0;
    padding: 12px 10px 12px 14px;
    min-width: 2.6em;
    background: #1a1b1e;
    border-right: 1px solid #2b2d31;
    color: #5f6673;
    font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
    font-size: 16px;
    font-weight: 400;
    /* 与代码正文的行高严格对齐：21px × 1.7 = 35.7px */
    line-height: 35.7px;
    text-align: right;
    white-space: pre;
    user-select: none;
}

.code-body {
    flex: 0 0 auto;
    margin: 0;
    padding: 12px 14px;
    /* 滚动交给外层 .code-scroll，行号才能与代码同步滚动 */
    max-height: none;
    overflow: visible;
    /* 程序阅读/完善程序的代码正文：等宽字体，优先 JetBrains Mono */
    font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
    font-size: 21px;
    /* 按用户批注试验加粗：使用项目自带的 JetBrainsMono-Bold.woff2 */
    font-weight: 700;
    line-height: 1.7;
    color: #e6e6e6;
    white-space: pre;
    tab-size: 4;
}

.code-body .cm-keyword {
    color: #cc7832;
}

.code-body .cm-builtin {
    color: #56b6c2;
}

.code-body .cm-string {
    color: #e6db74;
}

.code-body .cm-number {
    color: #6897bb;
}

.code-body .cm-comment {
    color: #808080;
}

@media (max-width: 980px) {
    .exam-ready-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .exam-ready-actions .enter-btn {
        width: 100%;
    }

    .exam-q .option-buttons.judge-row {
        flex-direction: column;
    }
}

/* ==================================================================
   C++ 平台增补样式（cpp_ynocde）
   1) 程序阅读题（选择题板块）：材料卡片 + 题组
   2) 洛谷式判分结果：结果徽章（AC/WA/TLE/MLE/RE/CE/OLE）+ 测试点表格
   3) 在线考试：模式标签、编程题模式（题目列表 / 编辑器）
   ================================================================== */

/* ---------- 1) 程序阅读题材料 ---------- */
.reading-material {
    margin-bottom: 16px;
    padding: 14px 16px;
    background: #f7fbff;
    border: 1px solid #cfe0f2;
    border-left: 4px solid var(--orange);
    border-radius: 12px;
}

.reading-title {
    margin-bottom: 8px;
    font-size: 17px;
    font-weight: 700;
    color: var(--orange-deep);
}

.reading-desc {
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.7;
    color: #35435c;
    white-space: pre-wrap;
}

/* 题面文本（C++ 选择题为主的文本题干） */
.q-content {
    margin: 6px 0 4px;
    font-size: 17px;
    line-height: 1.75;
    color: var(--text-dark);
    white-space: pre-wrap;
}

/* 判断题标签与单选 / 多选并列 */
.q-type.judge {
    color: #1f5f8b;
    background: #e6f1fa;
}

.opt-btn.judge {
    flex: 1;
    justify-content: center;
}

.q-card .opt-btn.judge .opt-judge {
    font-size: 22px;
    font-weight: 700;
}

.q-card .option-buttons.judge-row {
    flex-direction: row;
    gap: 12px;
}

.q-card .opt-btn.multi:has(input:checked) .opt-letter {
    background: var(--accent);
    border-color: #4a86c5;
    color: #ffffff;
}

/* 分页指示器（选择题分页用） */
.page-indicator {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-gray);
    font-variant-numeric: tabular-nums;
}

/* 倒计时进入最后一分钟 */
.quiz-timer.danger {
    background: #fdddda;
    border-color: #e9a19b;
    animation: timer-pulse 1.2s ease-in-out infinite;
}

@keyframes timer-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(179, 38, 30, 0); }
    50% { box-shadow: 0 0 12px rgba(179, 38, 30, 0.35); }
}

/* 首页题库统计行 */
.bank-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin: 4px 0 14px;
    padding: 10px 14px;
    background: var(--bg-soft);
    border-radius: 10px;
    font-size: 14px;
    color: #35435c;
}

.bank-item b {
    color: var(--orange-deep);
    font-size: 16px;
}

/* 成绩单补充说明 */
.result-note {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-gray);
}

/* ---------- 2) 判分结果徽章（洛谷式） ---------- */
.verdict-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    color: #ffffff;
    background: #8a8f9c;
}

.verdict-badge.v-ac { background: #2e9e6b; }
.verdict-badge.v-wa { background: #d9534f; }
.verdict-badge.v-tle { background: #c8791b; }
.verdict-badge.v-mle { background: #8e5cc4; }
.verdict-badge.v-re  { background: #b3541e; }
.verdict-badge.v-ce  { background: #6b7280; }
.verdict-badge.v-ole { background: #0f7b8f; }

.case-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    padding: 10px 14px;
    background: #eef5fb;
    border: 1px solid #cfe0f2;
    border-radius: 10px;
}

.case-sum-no {
    font-weight: 700;
    font-size: 15px;
    color: var(--orange-deep);
}

.case-sum-meta {
    font-size: 13px;
    color: #4a5a72;
}

.case-metric {
    font-size: 12px;
    color: #4a5a72;
    font-variant-numeric: tabular-nums;
}

.ce-output {
    margin: 0;
    padding: 12px 14px;
    max-height: 420px;
    overflow: auto;
    background: #1e1f22;
    color: #ffb4a9;
    border-radius: 8px;
    font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.history-verdicts,
.review-verdicts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

/* 提交记录的用时/内存与题目列表的限制列 */
.limit-cell {
    font-size: 13px;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.limit-mem {
    color: var(--text-gray);
}

.topic-no {
    display: inline-block;
    margin-right: 4px;
    color: var(--orange-deep);
    font-variant-numeric: tabular-nums;
}

.topic-keywords {
    display: inline-flex;
    flex-wrap: wrap;
    vertical-align: middle;
    gap: 3px;
    margin-left: 4px;
}

.topic-keyword {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border: 1px solid #dce7f3;
    border-radius: 999px;
    background: #eef4fb;
    color: #33537b;
    font-size: 12px;
    line-height: 1.45;
    white-space: nowrap;
}

.cppprog-meta.limit {
    color: var(--orange-deep);
    font-weight: 700;
}

/* ---------- 3) 在线考试 ---------- */
.exam-type-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.exam-type-tag.type-1 {
    color: #1f5f8b;
    background: #e6f1fa;
}

.exam-type-tag.type-2 {
    color: #6b46a1;
    background: #f3ecfd;
}

.exam-ready-desc {
    margin: 4px 0 14px;
    padding: 12px 14px;
    background: var(--bg-soft);
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.75;
    white-space: pre-wrap;
}

.exam-q .opt-btn.judge:has(input:checked) .opt-judge {
    color: var(--orange-deep);
}

.result-prog-table {
    margin-top: 12px;
}

/* 编程题模式：左侧题目列表 + 右侧编辑器（沿用答题页两栏布局） */
.exam-prog-page .cppprog-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 考试（编程题模式）顶栏：压缩上下 padding，计时器与交卷按钮同步收紧 */
.exam-prog-page .cppprog-bar {
    padding: 5px 14px;
}

.exam-prog-page .cppprog-bar .quiz-timer {
    padding: 4px 14px;
    gap: 8px;
}

.exam-prog-page .cppprog-bar .timer-label {
    font-size: 12px;
}

.exam-prog-page .cppprog-bar .timer-num {
    font-size: 20px;
}

.exam-prog-page .cppprog-bar .quiz-submit-btn {
    padding: 7px 20px;
    font-size: 14px;
}

/* 第二轮考试：顶栏用下拉框选题（替代原来的题目卡片列表） */
.exam-problem-select {
    flex: 1 1 auto;
    min-width: 260px;
    max-width: 560px;
    padding: 5px 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--orange-deep);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}

.exam-problem-select:hover {
    border-color: var(--accent);
}

.exam-problem-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.exam-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 4px 8px;
    font-size: 14px;
    font-weight: 700;
    color: #d7dbe0;
}

.exam-editor-nav {
    display: flex;
    gap: 8px;
}

.exam-editor-nav .btn-ghost.small {
    padding: 5px 12px;
    font-size: 13px;
}

/* ---------- 第二轮考试：题目 / 代码 双视图（与编程题板块一致） ---------- */
body.exam-prog-page #examProgApp {
    gap: 0;
}

body.exam-prog-page .cppprog-body {
    display: block;
    height: auto;
}

body.exam-prog-page .cppprog-view[hidden] {
    display: none !important;
}

body.exam-prog-page .cppprog-left {
    width: 100%;
    height: calc(100vh - 250px);
    min-height: 460px;
}

body.exam-prog-page .cppprog-right {
    width: 100%;
    height: auto;
}

body.exam-prog-page .cppprog-right .CodeMirror {
    flex: 1 1 auto;
    height: auto;
    min-height: 320px;
}

/* 考试（编程题模式）：运行（自测）与提交本题用不同颜色区分
   运行（自测）用青绿（不计分），提交本题用主蓝（计分） */
body.exam-prog-page #runBtn {
    background: linear-gradient(180deg, #2f9bb5 0%, #1f7c94 100%);
    box-shadow: 0 6px 16px rgba(31, 124, 148, 0.28);
}

body.exam-prog-page #runBtn:hover {
    background: linear-gradient(180deg, #35a8c4 0%, #22879f 100%);
}

body.exam-prog-page #submitProblemBtn {
    background: linear-gradient(180deg, #2c7cc0 0%, #00599c 100%);
    box-shadow: 0 6px 16px rgba(0, 89, 156, 0.28);
}

@media (max-width: 900px) {
    .q-card .option-buttons.judge-row {
        flex-direction: column;
    }
}
