:root{--exam-muted:#526c6b;--exam-error:#993d32;--exam-selected:#e6f3ee;--exam-warm:#fff5df}
.exam-page-top{padding-bottom:24px}.exam-page-top p{color:var(--exam-muted)}
.exam-setup-card,.exam-map-card,.exam-identity,.exam-breakdown,.exam-image-card{background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:28px}
.exam-section-head,.exam-run-top{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.exam-section-head h2,.exam-run-top h2{font-size:24px}.exam-section-head p,.exam-run-top p{margin-top:8px;font-size:13px;color:var(--exam-muted);line-height:1.85}.exam-section-head>.text-button{flex-shrink:0}
.exam-chapter-fieldset{padding:0;border:0;margin:28px 0}.exam-chapter-fieldset legend{font-weight:800;font-size:15px;padding:0}.exam-selection-tools{display:flex;align-items:center;flex-wrap:wrap;gap:16px;margin:16px 0}.exam-selection-tools>span{margin-left:auto;color:var(--exam-muted);font-size:12px}
.exam-work-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.exam-work-choice{position:relative;display:flex;align-items:flex-start;gap:10px;padding:16px 12px;border:1px solid var(--line);border-radius:12px;cursor:pointer;min-width:0}.exam-work-choice:has(input:checked){background:var(--exam-selected);border-color:var(--primary-dark)}.exam-work-choice input{width:20px;height:20px;accent-color:var(--primary-dark);flex-shrink:0;margin:2px 0 0}.exam-work-choice strong{display:block;line-height:1.65;font-size:13px;overflow-wrap:anywhere}.exam-work-choice small{display:block;font-size:11px;color:var(--exam-muted);margin-top:4px}
.exam-count-row{display:grid;grid-template-columns:minmax(180px,280px) 1fr;gap:24px;align-items:center;border-top:1px solid var(--line);padding-top:24px}.exam-field{display:flex;flex-direction:column;gap:8px;min-width:0}.exam-field label{font-size:14px;font-weight:800}.exam-field input{border:1px solid #b6cbc2;border-radius:10px;padding:12px 14px;background:var(--surface);color:var(--ink);width:100%;min-height:48px;font-size:16px}.exam-field input[aria-invalid=true]{border-color:var(--exam-error)}.exam-field p,.exam-count-note{font-size:12px;line-height:1.8;color:var(--exam-muted)}.exam-start-row{display:flex;justify-content:space-between;align-items:center;gap:24px;padding-top:24px}.exam-start-row p{font-size:12px;color:var(--exam-muted)}.exam-start-row .btn{flex-shrink:0}.exam-error{color:var(--exam-error);font-weight:700;font-size:13px;margin-top:16px}.exam-notice{background:var(--exam-warm);border:1px solid #d3b879;color:#66501f;border-radius:12px;padding:16px;margin-bottom:24px;font-size:13px}.exam-resume{display:flex;align-items:center;justify-content:space-between;gap:24px;border:1px solid #b7d7c9;background:var(--exam-selected);padding:24px;border-radius:16px;margin-bottom:20px}.exam-resume p{font-size:13px;margin-top:4px;color:var(--exam-muted)}
.exam-run-top{align-items:center;margin-bottom:24px}.exam-progress-summary{display:flex;justify-content:space-between;gap:16px;font-size:12px;color:var(--exam-muted);margin-bottom:8px}.exam-progress-summary>span:first-child{color:var(--ink);font-weight:800}.exam-progress{height:8px;border-radius:8px;background:#dfece5;overflow:hidden;margin-bottom:24px}.exam-progress>span{display:block;height:100%;background:var(--primary-dark);width:0;transition:width .16s}.exam-run-layout{display:grid;grid-template-columns:minmax(0,1fr) 260px;align-items:start;gap:24px}.exam-quiz-card{min-width:0}.exam-quiz-card .question-helper{color:var(--exam-muted)}.exam-quiz-card .answer-button{width:100%;text-align:left;color:var(--ink)}.exam-answer-button.is-selected{border-color:var(--primary-dark);background:var(--exam-selected);box-shadow:inset 0 0 0 1px var(--primary-dark)}.exam-answer-button .exam-chosen{margin-left:auto;color:var(--primary-dark);font-size:12px;white-space:nowrap;font-weight:800}.exam-answer-button.is-selected .answer-letter{background:var(--primary-dark);color:#fff}.exam-question-nav{display:flex;justify-content:space-between;gap:16px;margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}.exam-question-nav>.btn{min-width:110px}.exam-map-card{padding:20px;position:sticky;top:24px}.exam-map-head{margin-bottom:16px}.exam-map-head h3{font-size:16px}.exam-map-head span{font-size:11px;color:var(--exam-muted);display:block;margin-top:4px}.exam-question-map{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;max-height:360px;overflow:auto;padding:4px}.exam-question-map button{border:1px solid #b6cbc2;background:#fff;color:var(--ink);border-radius:8px;min-height:38px;font-size:12px;font-weight:800}.exam-question-map button.is-answered{background:var(--primary-dark);border-color:var(--primary-dark);color:#fff}.exam-question-map button[aria-current=true]{outline:3px solid #d69a38;outline-offset:1px}.exam-save-note{font-size:11px;line-height:1.8;color:var(--exam-muted);margin-top:16px}.exam-map-card>.text-button{margin-top:12px}.exam-map-card .text-button{font-size:12px}
.exam-identity{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 24px;margin-bottom:20px}.exam-identity>p{grid-column:1/-1;font-size:12px;color:var(--exam-muted)}.exam-score-summary{display:grid;grid-template-columns:1.5fr repeat(2,1fr);gap:16px;margin-bottom:24px}.exam-score-box{border:1px solid var(--line);border-radius:16px;padding:24px;background:var(--surface)}.exam-score-box:first-child{background:var(--exam-selected);border-color:#b7d7c9}.exam-score-box>span{font-size:13px;color:var(--exam-muted)}.exam-score-box>strong{font-size:36px;line-height:1.4;display:block;margin:4px 0;color:var(--ink)}.exam-score-box:first-child>strong{color:var(--primary-dark)}.exam-score-box small{font-size:12px;color:var(--exam-muted)}.exam-breakdown{margin-bottom:24px}.exam-breakdown h3{font-size:18px;margin-bottom:16px}.exam-table-scroll{overflow-x:auto}.exam-breakdown table{border-collapse:collapse;width:100%;font-size:13px}.exam-breakdown th,.exam-breakdown td{text-align:center;padding:14px 12px;border-bottom:1px solid var(--line);white-space:nowrap}.exam-breakdown th:first-child,.exam-breakdown td:first-child{text-align:left;white-space:normal;min-width:160px}.exam-breakdown th{color:var(--exam-muted);font-size:12px}.exam-breakdown tr:last-child td{border-bottom:0}
.exam-image-card{margin-bottom:32px}.exam-image-card h3{font-size:20px}.exam-export-actions{display:flex;gap:12px;flex-wrap:wrap;flex-shrink:0}.exam-export-status{font-size:13px;color:var(--primary-dark);min-height:24px;margin:12px 0}.exam-image-preview{max-width:520px;margin:0 auto;background:#edf1ed;padding:12px;border-radius:12px}.exam-image-preview canvas{display:block;width:100%;height:auto;background:white;box-shadow:var(--soft-shadow)}.exam-image-pagination{display:flex;align-items:center;justify-content:center;gap:16px;margin-top:16px}.exam-image-pagination span{font-size:12px;color:var(--exam-muted)}
.exam-review{margin-bottom:28px}.exam-review>.exam-section-head{margin-bottom:16px}.exam-review h3{font-size:22px}.exam-mistake{background:#fff;border:1px solid var(--line);border-radius:16px;margin-bottom:12px;overflow:hidden}.exam-mistake>summary{padding:20px;cursor:pointer;list-style:none}.exam-mistake>summary::-webkit-details-marker{display:none}.exam-mistake>summary:after{content:'展開答案與解析 ＋';display:block;font-size:12px;color:var(--primary-dark);font-weight:800;margin-top:12px}.exam-mistake[open]>summary:after{content:'收起 −'}.exam-mistake-title{font-size:12px;color:var(--exam-muted);display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:12px}.exam-mistake-title .exam-status{color:var(--exam-error);font-weight:800}.exam-mistake-stem{font-size:16px;font-weight:700;line-height:1.9;white-space:pre-line;overflow-wrap:anywhere}.exam-mistake-body{padding:0 20px 20px}.exam-review-choices{list-style:none;padding:0;margin:0 0 16px;display:grid;gap:8px}.exam-review-choices li{padding:12px;border:1px solid var(--line);border-radius:8px;font-size:13px;overflow-wrap:anywhere}.exam-review-choices li.is-correct{background:#edf7f1;border-color:#b0d2c0}.exam-review-choices li.is-wrong{background:#fff2ed;border-color:#e2bdb3}.exam-review-choices strong{margin-right:8px}.exam-review-marker{display:inline-block;margin-left:8px;font-size:11px;font-weight:800;color:var(--primary-dark)}.is-wrong .exam-review-marker{color:var(--exam-error)}.exam-mistake-explanation{font-size:13px;line-height:1.9;color:var(--ink)}.exam-mistake-body blockquote{margin:14px 0;padding:12px 16px;background:#f6faf8;border-left:3px solid #b9d2c7;font-size:13px;color:var(--exam-muted);line-height:1.9;white-space:pre-line}.exam-empty{border:1px solid #b7d7c9;border-radius:16px;background:var(--exam-selected);padding:28px;color:var(--primary-dark);font-weight:800}
.exam-submit-dialog{border:1px solid var(--line);border-radius:20px;max-width:560px;width:calc(100% - 32px);max-height:90dvh;padding:28px;color:var(--ink);box-shadow:var(--shadow)}.exam-submit-dialog::backdrop{background:rgba(15,39,32,.4)}.exam-submit-dialog h2{font-size:24px;margin-bottom:16px}.exam-submit-dialog p{font-size:13px;line-height:1.9;color:var(--exam-muted);margin-bottom:12px}.exam-submit-dialog .exam-question-map{grid-template-columns:repeat(8,minmax(0,1fr));max-height:220px;margin-top:16px}.exam-dialog-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}
@media(max-width:1000px){.exam-work-options{grid-template-columns:repeat(3,minmax(0,1fr))}.exam-run-layout{grid-template-columns:minmax(0,1fr) 220px;gap:16px}.exam-section-head{flex-wrap:wrap}.exam-export-actions{flex-shrink:1}}
@media(max-width:760px){.exam-work-options{grid-template-columns:repeat(2,minmax(0,1fr))}.exam-run-layout{grid-template-columns:1fr}.exam-map-card{position:static}.exam-question-map{grid-template-columns:repeat(10,minmax(0,1fr));max-height:200px}.exam-count-row{grid-template-columns:1fr}.exam-count-note{margin-top:-8px}.exam-score-summary{gap:10px}.exam-score-box{padding:18px}.exam-score-box>strong{font-size:30px}}
@media(max-width:620px){.header-inner{flex-wrap:wrap;padding-block:12px;gap:12px}.header-inner>.brand{margin-inline:auto}.header-inner>.nav{width:100%;justify-content:space-between}.header-inner .nav-link{flex:1;justify-content:center;font-size:12px;min-height:40px;padding:8px 4px}.exam-setup-card,.exam-identity,.exam-breakdown,.exam-image-card{padding:20px 16px;border-radius:16px}.exam-page-top{padding-bottom:20px}.exam-section-head h2,.exam-run-top h2{font-size:21px}.exam-section-head,.exam-run-top{gap:16px}.exam-run-top{align-items:flex-start;flex-wrap:wrap}.exam-chapter-fieldset{margin-top:24px}.exam-work-choice{padding:12px 10px;gap:8px}.exam-work-choice strong{font-size:12px}.exam-start-row,.exam-resume{flex-direction:column;align-items:stretch;gap:16px}.exam-start-row .btn{width:100%}.exam-resume{padding:20px}.exam-identity{grid-template-columns:1fr}.exam-score-summary{grid-template-columns:1fr 1fr}.exam-score-box:first-child{grid-column:1/-1}.exam-score-box>strong{font-size:30px}.exam-progress-summary{flex-wrap:wrap;gap:4px}.exam-question-map{grid-template-columns:repeat(7,minmax(0,1fr))}.exam-answer-button .exam-chosen{font-size:10px}.exam-question-nav>.btn{flex:1;min-width:0;padding-inline:10px}.exam-export-actions{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:8px}.exam-export-actions .btn{padding:12px 8px;font-size:12px}.exam-image-preview{padding:6px}.exam-image-pagination{gap:8px;flex-wrap:wrap}.exam-mistake>summary{padding:16px}.exam-mistake-body{padding:0 16px 16px}.exam-submit-dialog{padding:24px 16px}.exam-submit-dialog .exam-question-map{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.exam-progress>span{transition:none}}
