:root{--ink:#102d67;--text:#273b5d;--muted:#74839c;--line:#dfe7f2;--blue:#3979ee;--blue-soft:#eef5ff;--green:#15945d;--green-soft:#eaf8f1;--red:#d94d50;--red-soft:#fff0f1;--surface:#fff;--radius:16px;--question-size:16px}
*{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:92px}
body{min-height:100vh;margin:0;color:var(--text);font-family:Inter,"PingFang SC","Microsoft YaHei",sans-serif;background:#f5f7fb}
button,a,input{font:inherit}
button,a,label{cursor:pointer}
button:focus-visible,a:focus-visible,input:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(57,121,238,.25)}
a{color:inherit;text-decoration:none}
.svg-sprite{position:absolute;width:0;height:0}
svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.skip-link{position:fixed;z-index:200;top:8px;left:50%;padding:9px 16px;border-radius:9px;color:#fff;background:var(--ink);transform:translate(-50%,-150%)}
.skip-link:focus{transform:translate(-50%,0)}
.exam-header{display:grid;position:sticky;z-index:100;top:0;grid-template-columns:1fr minmax(280px,2fr) 1fr;min-height:64px;align-items:center;padding:0 5vw;border-bottom:1px solid #edf1f7;background:rgba(255,255,255,.94);backdrop-filter:blur(18px)}
.exam-header h1{margin:0;overflow:hidden;color:#18243b;font-size:15px;font-weight:600;text-align:center;text-overflow:ellipsis;white-space:nowrap}
.header-left,.header-actions{display:flex;align-items:center;gap:8px}.header-actions{justify-content:flex-end}
.header-icon,.header-action{display:flex;min-width:42px;min-height:42px;align-items:center;justify-content:center;padding:0;border:0;border-radius:10px;color:#4d5c73;background:transparent}
.header-icon:hover,.header-action:hover{color:var(--blue);background:#f1f5fb}
.header-action{gap:7px;padding:0 10px}.submit-action{color:#33445d}
.timer{display:flex;align-items:center;gap:6px;color:#4d5c73;font-variant-numeric:tabular-nums}.timer svg{width:18px}.timer strong{font-size:14px}
.settings-panel{position:absolute;top:56px;right:9vw;width:190px;padding:16px;border:1px solid var(--line);border-radius:13px;background:#fff;box-shadow:0 16px 50px rgba(37,57,91,.16)}
.settings-panel p{margin:0 0 11px;font-size:13px;font-weight:700}.font-controls{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}.font-controls button{min-height:38px;border:0;border-radius:9px;color:var(--muted);background:#f4f6fa}.font-controls button.active{color:var(--ink);background:#eaf1fc;font-weight:700}
.exam-shell{width:min(1500px,calc(100% - 48px));margin:22px auto 70px}
.paper-intro{display:flex;min-height:104px;align-items:center;justify-content:space-between;padding:20px 24px;border:1px solid #dbe7f7;border-radius:13px;background:linear-gradient(120deg,#eaf3ff,#f5f9ff 70%,#eef8ff)}
.eyebrow{margin:0 0 5px;color:#6a82a8;font-size:10px;font-weight:800;letter-spacing:.18em}.paper-intro h2{margin:0;color:#172d53;font-size:19px}.paper-intro p:last-child{margin:7px 0 0;color:#6f83a2;font-size:13px}.intro-stat{min-width:88px;text-align:center}.intro-stat strong{display:block;color:var(--blue);font-size:28px}.intro-stat span{color:var(--muted);font-size:11px}
.exam-layout{display:block;margin-top:18px}
.question-area{display:flex;min-width:0;flex-direction:column;gap:16px}
.loading-card{padding:60px;border-radius:var(--radius);background:#fff;color:var(--muted);text-align:center}
.question-card{scroll-margin-top:84px;padding:22px 24px 24px;border:1px solid transparent;border-radius:var(--radius);background:var(--surface);box-shadow:0 8px 24px rgba(47,67,100,.035)}
.question-card.is-current{border-color:#b9cff3}.question-card.is-wrong{border-color:#f1bdc0}.question-card.is-correct{border-color:#b9e1cf}
.question-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:14px}.question-number{display:flex;align-items:center;gap:9px;color:#18243b;font-weight:700}.type-tag{padding:4px 7px;border-radius:5px;color:#3979ee;background:#eff5ff;font-size:11px;font-weight:600}.question-tools{display:flex;gap:7px}.tool-button{display:grid;width:36px;height:36px;padding:0;place-items:center;border:1px solid var(--line);border-radius:9px;color:#61728d;background:#fff}.tool-button:hover,.tool-button.active{border-color:#ffcf6f;color:#d89113;background:#fff9ea}.tool-button.active svg{fill:currentColor}
.question-stem{margin:0 0 16px;color:#121b2b;font-size:var(--question-size);font-weight:500;line-height:1.85;white-space:pre-wrap}
.question-images,.option-images{display:flex;flex-wrap:wrap;align-items:flex-start;gap:10px}
.question-images{margin:-4px 0 18px}
.question-images img,.option-images img{display:block;max-width:100%;height:auto;border:1px solid #e3e9f2;border-radius:10px;background:#fff;object-fit:contain}
.question-images img{max-height:420px}
.option-images{margin-top:9px}
.option-images img{max-height:240px}
.options{display:grid;gap:8px}.option{display:grid;position:relative;grid-template-columns:34px 1fr;align-items:start;gap:10px;min-height:44px;padding:6px 10px 6px 5px;border:1px solid transparent;border-radius:11px;transition:.15s}.option:hover{background:#f7f9fc}.option input{position:absolute;opacity:0;pointer-events:none}.option-key{display:grid;width:32px;height:32px;place-items:center;border:1px solid #dbe4f1;border-radius:50%;color:#71829d;background:#fff;font-size:14px}.option-text{padding-top:5px;color:#1c2738;font-size:calc(var(--question-size) - 1px);line-height:1.55}.option.selected{background:#f2f6ff}.option.selected .option-key{border-color:var(--blue);color:#fff;background:var(--blue)}.option.correct-answer{background:var(--green-soft)}.option.correct-answer .option-key{border-color:var(--green);color:#fff;background:var(--green)}.option.wrong-answer{background:var(--red-soft)}.option.wrong-answer .option-key{border-color:var(--red);color:#fff;background:var(--red)}
.answer-review{display:grid;grid-template-columns:auto 1fr;gap:6px 16px;margin-top:18px;padding:14px 16px;border-radius:12px;background:#f7f9fc;font-size:13px}.answer-review strong{color:#425471}.answer-review p{grid-column:1/-1;margin:4px 0 0;color:#60708a;line-height:1.65}.answer-good{color:var(--green)}.answer-bad{color:var(--red)}
.answer-sheet{position:sticky;top:82px;max-height:calc(100vh - 102px);overflow:auto;padding:18px;border:1px solid #edf1f6;border-radius:var(--radius);background:#fff;box-shadow:0 8px 28px rgba(47,67,100,.05)}
.answer-sheet-heading{display:flex;align-items:end;justify-content:space-between}.answer-sheet-heading h2{margin:0;color:#172d53;font-size:18px}.answer-sheet-heading strong{color:#6b7c96;font-size:13px}.answer-sheet-heading strong span:first-child{color:var(--blue);font-size:19px}.sheet-legend{display:flex;gap:12px;margin:15px 0;color:#73819a;font-size:10px}.sheet-legend span{display:flex;align-items:center;gap:4px}.sheet-legend i{width:9px;height:9px;border:1px solid #dbe3ef;border-radius:3px;background:#f3f5f8}.sheet-legend i.answered{border-color:var(--blue);background:var(--blue)}.sheet-legend i.wrong{border-color:var(--red);background:var(--red)}.result-only{display:none!important}body.is-result .result-only{display:flex!important}
.sheet-section{margin-top:16px}.sheet-section h3{margin:0 0 9px;color:#7688a5;font-size:11px;font-weight:600}.sheet-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:7px}.sheet-number{display:grid;min-height:34px;padding:0;place-items:center;border:0;border-radius:7px;color:#47566c;background:#f3f5f8;font-size:12px}.sheet-number.answered{color:#fff;background:var(--blue)}.sheet-number.wrong{color:#fff;background:var(--red)}.sheet-number.correct{color:#fff;background:var(--green)}.sheet-submit{width:100%;min-height:44px;margin-top:20px;border:0;border-radius:10px;color:#fff;background:var(--ink);font-weight:700}.sheet-submit:hover{background:#193c7a}.sheet-submit:disabled{background:#aeb9ca}
.result-summary{display:grid;grid-template-columns:1fr repeat(3,120px);align-items:center;gap:16px;margin-top:18px;padding:22px 26px;border-radius:var(--radius);color:#fff;background:linear-gradient(120deg,#143576,#315fc2);box-shadow:0 14px 40px rgba(27,61,130,.2)}.result-summary h2{margin:0 0 6px;font-size:23px}.result-summary p{margin:0;color:#dbe7ff;font-size:13px}.result-stat{text-align:center}.result-stat strong{display:block;font-size:26px}.result-stat span{color:#dbe7ff;font-size:11px}
.result-summary[hidden]{display:none}
.pause-overlay,.dialog-backdrop{display:grid;position:fixed;z-index:300;inset:0;padding:20px;place-items:center;background:rgba(19,34,58,.42);backdrop-filter:blur(8px)}.pause-overlay[hidden],.dialog-backdrop[hidden]{display:none}.pause-overlay>div,.dialog{width:min(390px,100%);padding:30px;border-radius:18px;background:#fff;box-shadow:0 25px 80px rgba(18,37,70,.25);text-align:center}.pause-overlay svg{width:42px;height:42px;color:var(--blue)}.pause-overlay h2,.dialog h2{margin:15px 0 7px;color:var(--ink)}.pause-overlay p,.dialog p{margin:0 0 22px;color:var(--muted);font-size:13px}.pause-overlay button,.dialog button{min-height:44px;padding:0 22px;border:0;border-radius:10px;font-weight:700}.pause-overlay button,#confirmSubmit{color:#fff;background:var(--ink)}.dialog>div{display:flex;justify-content:center;gap:10px}#cancelSubmit{color:var(--text);background:#edf1f6}
.toast{position:fixed;z-index:400;right:22px;bottom:22px;padding:12px 18px;border-radius:10px;color:#fff;background:#172d53;box-shadow:0 12px 30px rgba(15,35,70,.2);opacity:0;pointer-events:none;transform:translateY(10px);transition:.2s}.toast.show{opacity:1;transform:none}
body.is-paused{overflow:hidden}body.is-result .submit-action,body.is-result .sheet-submit,body.is-result #pauseButton{display:none}

@media(max-width:900px){.exam-header{grid-template-columns:auto 1fr auto;padding:0 12px}.exam-header h1{padding:0 10px}.header-action span{display:none}.header-icon,.header-action{min-width:44px;min-height:44px}.exam-shell{width:calc(100% - 24px)}.exam-layout{grid-template-columns:1fr}.answer-sheet{position:static;max-height:220px;overflow:hidden;order:-1}.answer-sheet #answerSections{max-height:98px;overflow:auto;padding-right:3px}.sheet-grid{grid-template-columns:repeat(10,1fr)}.sheet-number{min-height:38px}.sheet-submit{display:none}.result-summary{grid-template-columns:1fr repeat(3,90px)}}
@media(max-width:600px){.timer svg{display:none}.exam-header h1{font-size:13px}.paper-intro{padding:17px}.paper-intro p:last-child{display:none}.intro-stat{min-width:60px}.question-card{padding:18px 15px}.question-stem{line-height:1.72}.question-images img{max-height:300px}.option-images img{max-height:200px}.option{grid-template-columns:32px 1fr;padding-right:4px}.tool-button{width:44px;height:44px}.answer-review{grid-template-columns:1fr}.answer-review p{grid-column:auto}.sheet-grid{grid-template-columns:repeat(6,1fr)}.sheet-number{min-height:44px}.result-summary{grid-template-columns:repeat(3,1fr);padding:20px 16px}.result-summary>div:first-child{grid-column:1/-1}.result-stat strong{font-size:22px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

/* Sliding answer sheet, text questions and manual grading */
.answer-sheet{position:fixed;z-index:230;top:0;right:0;width:min(390px,92vw);height:100vh;max-height:none;overflow:auto;padding:24px;border:0;border-left:1px solid #edf1f6;border-radius:0;background:#fff;box-shadow:-18px 0 60px rgba(24,45,80,.16);transform:translateX(105%);transition:transform .22s ease}.answer-sheet.open{transform:none}.sheet-backdrop{position:fixed;z-index:220;inset:0;background:rgba(20,36,61,.28);backdrop-filter:blur(3px)}.sheet-backdrop[hidden]{display:none}.sheet-head-actions{display:flex;align-items:center;gap:12px}.sheet-head-actions button{display:grid;width:38px;height:38px;padding:0;place-items:center;border:0;border-radius:50%;color:#657793;background:#f2f5fa;font-size:24px}body.sheet-open{overflow:hidden}
.answer-review .answer-good{color:var(--green)}.answer-review .answer-bad{color:var(--red)}.answer-review .answer-pending{color:#b36b08}.question-card.is-pending{border-color:#efd59d}.score-tag{color:#8492a8;font-size:11px;font-weight:500}.text-answers{display:grid;gap:10px}.text-answers label,.essay-answer{display:grid;gap:7px;color:#60708a;font-size:12px}.text-answers input,.essay-answer textarea{width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:10px;outline:0;color:#17243a;background:#fbfcfe;resize:vertical}.text-answers input:focus,.essay-answer textarea:focus{border-color:#79a4e8;box-shadow:0 0 0 3px rgba(57,121,238,.12)}.reveal-button{min-height:42px;margin-top:12px;padding:0 18px;border:0;border-radius:10px;color:#fff;background:var(--blue);font-weight:700}.manual-score{grid-column:1/-1;display:flex!important;align-items:center;gap:10px;margin-top:8px;color:#735613!important}.manual-score input{width:90px;min-height:38px;padding:0 10px;border:1px solid #dbc78d;border-radius:8px}.manual-banner{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:16px 20px;border:1px solid #e9d49c;border-radius:13px;color:#715716;background:#fff9e9;font-size:13px}.manual-banner button{min-height:40px;padding:0 16px;border:0;border-radius:9px;color:#fff;background:#9b7018;font-weight:700}
.rubric-review{grid-column:1/-1;display:grid;gap:7px;margin-top:6px;padding:12px;border:1px solid #dce7f5;border-radius:10px;background:#fff}.rubric-row{display:grid;grid-template-columns:1fr auto auto;gap:10px;align-items:center;padding:7px 0;border-bottom:1px solid #edf1f6}.rubric-row:last-child{border-bottom:0}.rubric-row span{color:#334762}.rubric-row small{color:#7888a0}.rubric-row b{color:#2563a9;font-size:12px}.suggested-score{grid-column:1/-1;margin-top:5px;padding:10px 12px;border-radius:9px;color:#735613;background:#fff8e7}.suggested-score strong{color:#9b6810!important;font-size:18px}
input:focus,input:focus-visible,select:focus,select:focus-visible,textarea:focus,textarea:focus-visible{outline:none;-webkit-tap-highlight-color:transparent}
@media(max-width:900px){.answer-sheet{position:fixed;max-height:none;overflow:auto}.answer-sheet #answerSections{max-height:none}.sheet-submit{display:block}.sheet-grid{grid-template-columns:repeat(6,1fr)}}
@media(max-width:600px){.manual-banner{align-items:stretch;flex-direction:column}.manual-score{align-items:flex-start;flex-direction:column}}
