:root {
  --ink: #17372e;
  --muted: #5c7068;
  --green: #176b52;
  --green-dark: #0f4f3d;
  --green-soft: #e6f3ec;
  --paper: #fffdf6;
  --surface: #ffffff;
  --line: #c7d9d0;
  --gold: #dda625;
  --gold-soft: #fff3c9;
  --coral: #d95d4d;
  --coral-soft: #fff0ec;
  --sky: #dceff0;
  --warning-bg: #fff3cf;
  --warning-ink: #72500f;
  --error: #a83d35;
  --success: #176b52;
  --shadow: 0 16px 38px rgba(23, 55, 46, 0.1);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: #edf4ef;
  font-size: 18px;
  line-height: 1.65;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: #edf4ef;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 8px 12px;
  transform: translateY(-150%);
  background: var(--surface);
  border: 2px solid var(--green);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 10;
  width: 100%;
  border-bottom: 1px solid var(--line);
  border-top: 5px solid var(--coral);
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(23, 55, 46, 0.06);
}

.header-inner {
  width: min(100% - 40px, 1080px);
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--green-dark);
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border-bottom: 4px solid var(--gold);
  background: var(--green);
  color: #ffffff;
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1;
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  line-height: 1.25;
}

.brand-copy strong {
  font-size: 1.16rem;
  font-weight: 900;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.header-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.institution-name {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
}

.stage-label,
.placeholder-label {
  color: #724b0d;
  font-size: 0.78rem;
  font-weight: 700;
}

.stage-label {
  padding: 5px 9px;
  border: 1px solid #e4c36f;
  border-radius: 999px;
  background: var(--gold-soft);
  white-space: nowrap;
}

.page-shell {
  width: min(100% - 40px, 940px);
  margin: 0 auto;
  padding: 48px 0 72px;
  flex: 1;
}

.page-shell.drawing-question-page {
  width: min(100% - 24px, 1920px);
}

.drawing-question-page .question-panel {
  padding: clamp(22px, 2vw, 34px);
}

.site-footer {
  padding: 24px 20px 30px;
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.site-footer strong {
  color: var(--green-dark);
  font-size: 0.84rem;
}

.welcome-panel,
.form-panel,
.question-panel,
.review-panel,
.confirmation-panel,
.completion-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.welcome-panel {
  position: relative;
  min-height: 520px;
  padding: 70px clamp(28px, 8vw, 88px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  border-left: 8px solid var(--green);
  border-top-color: var(--gold);
}

.welcome-accent {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 10px;
  display: grid;
  grid-template-columns: 45fr 25fr 30fr;
}

.welcome-accent span:nth-child(1) {
  background: var(--green);
}

.welcome-accent span:nth-child(2) {
  background: var(--gold);
}

.welcome-accent span:nth-child(3) {
  background: var(--coral);
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 16px;
  font-size: 2.35rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: none;
}

.institution-credit {
  margin: 0 0 28px;
  padding: 7px 11px;
  border-left: 4px solid var(--coral);
  background: var(--coral-soft);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.start-page h1 {
  margin-bottom: 8px;
  color: var(--green-dark);
  font-size: clamp(2.8rem, 8vw, 4.2rem);
  font-weight: 900;
  line-height: 1.05;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--coral);
  font-size: 1.25rem;
  font-weight: 800;
}

.lead {
  max-width: 640px;
  margin: 0 0 24px;
  color: var(--ink);
  font-size: 1.02rem;
}

.development-notice,
.warning-box {
  width: 100%;
  margin: 0 0 28px;
  padding: 14px 16px;
  border-left: 5px solid var(--gold);
  border-radius: 0 6px 6px 0;
  background: var(--warning-bg);
  color: var(--warning-ink);
}

.button {
  min-height: 50px;
  padding: 11px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.review-row:focus-visible {
  outline: 3px solid #d9a84f;
  outline-offset: 3px;
}

.button-primary {
  background: var(--green);
  color: white;
  box-shadow: 0 4px 0 var(--green-dark);
}

.button-primary:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.button-secondary {
  border-color: var(--green);
  background: var(--surface);
  color: var(--green-dark);
}

.button-secondary:hover {
  background: var(--green-soft);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button-large {
  min-width: 180px;
  min-height: 56px;
}

.start-button {
  min-width: 210px;
}

.form-panel,
.review-panel,
.confirmation-panel,
.completion-panel {
  padding: clamp(28px, 6vw, 58px);
  border-top: 5px solid var(--gold);
}

.section-heading {
  margin-bottom: 30px;
}

.section-heading p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 10px;
}

.stack-form label,
.response-label {
  margin-top: 10px;
  font-weight: 800;
}

input[type="text"],
textarea {
  width: 100%;
  max-width: 100%;
  border: 2px solid #aebeb4;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

input[type="text"] {
  min-height: 54px;
  padding: 10px 14px;
}

input[type="text"]:hover,
textarea:hover {
  border-color: #769787;
}

textarea {
  min-height: 220px;
  padding: 16px;
  resize: vertical;
}

.privacy-note {
  margin: 16px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.flash-stack {
  margin-bottom: 20px;
}

.flash {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.flash-error {
  border-color: #d99e98;
  color: var(--error);
}

.test-toolbar {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr);
  align-items: center;
  gap: 24px;
}

.question-counter {
  color: var(--green-dark);
  font-weight: 700;
  white-space: nowrap;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 6px;
  background: #d9e7df;
}

.progress-track span {
  height: 100%;
  display: block;
  border-right: 5px solid var(--gold);
  background: var(--green);
}

.question-panel {
  min-height: 490px;
  padding: clamp(26px, 5vw, 52px);
  border-top: 5px solid var(--gold);
}

.question-heading {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.question-heading h1 {
  margin-bottom: 0;
  color: var(--green-dark);
  font-size: 1.55rem;
}

.question-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.read-aloud-button {
  min-height: 48px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid #9dbca8;
  border-radius: 8px;
  background: #e8f3eb;
  color: #1d6845;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.read-aloud-button:hover,
.read-aloud-button:focus-visible,
.read-aloud-button.is-playing {
  border-color: #176b52;
  background: #d2ead9;
  outline: 3px solid rgba(23, 107, 82, 0.16);
}

.prompt-area {
  margin: 26px 0;
}

.question-prompt {
  margin: 0 0 8px;
  font-size: 1.16rem;
  color: #112f27;
  font-weight: 800;
}

.question-instructions {
  margin: 0;
  color: var(--muted);
  padding-left: 12px;
  border-left: 4px solid var(--coral);
  font-size: 0.88rem;
}

#response-root {
  display: grid;
  gap: 8px;
}

.mark-task {
  display: grid;
  gap: 16px;
}

.mark-image-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 3px solid #78998a;
  border-radius: 6px;
  background: #dfeae4;
  box-shadow: 0 8px 22px rgba(23, 55, 46, 0.12);
  cursor: crosshair;
  touch-action: manipulation;
  user-select: none;
}

.mark-image {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
}

.mark-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mark-circle {
  position: absolute;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 4px solid #d72f3f;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 2px 8px rgba(0, 0, 0, 0.28);
}

.mark-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mark-count {
  color: var(--green-dark);
  padding: 6px 10px;
  border-left: 4px solid var(--gold);
  background: var(--gold-soft);
  white-space: nowrap;
}

.mark-actions {
  display: flex;
  gap: 10px;
}

.mark-action {
  min-height: 46px;
  padding: 8px 16px;
  font-size: 0.88rem;
}

.mark-message {
  min-height: 28px;
  color: var(--warning-ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.save-status {
  min-height: 30px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
}

.save-pending {
  color: #76501c;
}

.save-success {
  color: var(--success);
}

.save-error {
  color: var(--error);
  font-weight: 700;
}

.audio-stage {
  min-height: 360px;
  padding: clamp(24px, 5vw, 44px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  text-align: center;
}

.audio-stage-label {
  margin: 0;
  color: var(--green-dark);
  font-size: 1.45rem;
  font-weight: 900;
}

.audio-stage-text {
  width: min(100%, 720px);
  margin: 0;
  color: #111;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.8;
}

.audio-stage-actions {
  width: min(100%, 620px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.audio-action {
  min-width: 190px;
}

.audio-inline-status {
  min-height: 30px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.audio-instruction-note {
  margin: 0;
  padding: 9px 14px;
  border-left: 4px solid var(--gold);
  background: var(--gold-soft);
  color: var(--warning-ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.audio-stage-instruction {
  align-items: stretch;
  text-align: left;
}

.audio-stage-instruction .audio-stage-label {
  padding-inline: clamp(8px, 2.5vw, 28px);
  text-align: left;
}

.audio-stage-instruction .audio-stage-text {
  width: 100%;
  max-width: none;
  padding-inline: clamp(8px, 2.5vw, 28px);
  text-align: left;
  text-indent: 2em;
}

.audio-stage-instruction .audio-instruction-note {
  margin-inline: clamp(8px, 2.5vw, 28px);
}

.audio-stage-instruction .audio-stage-actions {
  align-self: center;
}

.audio-countdown {
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  border: 8px solid var(--green-soft);
  border-radius: 50%;
  background: var(--green);
  color: #ffffff;
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 26px rgba(23, 107, 82, 0.22);
}

.audio-response-button {
  width: 230px;
  height: 230px;
  padding: 30px;
  display: grid;
  place-items: center;
  border: 9px solid #b9ddce;
  border-radius: 50%;
  background: var(--green);
  color: #ffffff;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.45;
  box-shadow: 0 10px 0 var(--green-dark), 0 18px 34px rgba(23, 55, 46, 0.2);
  transition: background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.audio-response-button:hover {
  background: var(--green-dark);
}

.audio-response-button:focus-visible {
  outline: 5px solid var(--gold);
  outline-offset: 6px;
}

.audio-response-button.audio-response-active {
  transform: translateY(5px) scale(0.97);
  background: #b64f42;
  box-shadow: 0 5px 0 #81372f, 0 12px 24px rgba(23, 55, 46, 0.18);
}

.audio-stage-aborted,
.audio-stage-error {
  border-color: #d99e98;
  background: var(--coral-soft);
}

.audio-stage-completed {
  border-color: #9dc7b4;
  background: var(--green-soft);
}

/* Q03 drawing task */
.question-prompt {
  white-space: pre-line;
}

.drawing-task {
  width: 100%;
}

.drawing-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(16px, 1.5vw, 28px);
  align-items: start;
}

.reference-image-button {
  max-width: none;
}

.reference-pane,
.canvas-pane {
  min-width: 0;
}

.pane-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pane-heading h2 {
  margin: 0;
  color: #233c2e;
  font-size: 1.05rem;
}

.pane-heading span {
  color: #68766d;
  font-size: 0.88rem;
}

.reference-image-button {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid #cad7ce;
  border-radius: 8px;
  background: #f7faf7;
  cursor: zoom-in;
}

.drawing-reference {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
}

.drawing-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px;
  border: 1px solid #cad7ce;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #f3f7f3;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-tools {
  margin-left: auto;
}

.icon-tool,
.width-choice,
.color-swatch {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #b9c9bd;
  border-radius: 6px;
  background: #ffffff;
  color: #25372c;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tool-glyph {
  display: grid;
  place-items: center;
  font-size: 1.65rem;
  line-height: 1;
}

.tool-glyph-eraser {
  transform: rotate(-24deg);
  font-size: 1.8rem;
}

.tool-glyph-text {
  font-family: Georgia, serif;
  font-size: 1.45rem;
  font-weight: 800;
}

.tool-with-label {
  min-width: 58px;
  padding-inline: 10px;
}

.width-choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
}

.width-preview {
  display: block;
  width: 26px;
  border-radius: 999px;
  background: currentColor;
}

.width-preview-4 { height: 2px; }
.width-preview-9 { height: 5px; }
.width-preview-18 { height: 9px; }

.icon-tool:hover,
.width-choice:hover,
.icon-tool.active,
.width-choice.active {
  border-color: #34734c;
  background: #e2efe5;
}

.icon-tool:disabled,
.width-choice:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.color-swatch {
  min-width: 44px;
  width: 44px;
  min-height: 44px;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px #a8b8ad;
}

.color-swatch.active {
  box-shadow: 0 0 0 3px #2e7148;
}

.danger-tool {
  color: #8d332d;
}

.canvas-shell {
  width: 100%;
  overflow: hidden;
  border: 1px solid #aebfb3;
  border-radius: 0 0 8px 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(31, 55, 40, 0.08);
}

#q03-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  background: #ffffff;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.drawing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #dce5de;
}

.drawing-tip {
  margin: 0;
  color: #56675d;
}

.drawing-submit {
  min-width: 172px;
}

.image-lightbox,
.submit-dialog {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 31, 24, 0.72);
}

.image-lightbox[hidden],
.submit-dialog[hidden] {
  display: none;
}

.image-lightbox img {
  display: block;
  max-width: min(1200px, 94vw);
  max-height: 90vh;
  width: auto;
  height: auto;
  border: 5px solid #ffffff;
  border-radius: 6px;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #22352a;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.submit-dialog-card {
  width: min(460px, 100%);
  padding: 26px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(10, 24, 15, 0.28);
}

.submit-dialog-card h2 {
  margin: 0 0 8px;
  color: #254631;
}

.submit-dialog-card p {
  margin: 0 0 22px;
}

.submit-dialog-card > div {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 1000px) {
  .drawing-workspace {
    grid-template-columns: 1fr;
  }

  .reference-image-button {
    max-width: 1000px;
    margin-inline: auto;
  }
}

@media (max-width: 620px) {
  .page-shell.drawing-question-page {
    width: min(100% - 28px, 1500px);
  }

  .question-heading-row {
    align-items: flex-start;
  }

  .read-aloud-button {
    min-height: 46px;
    padding-inline: 11px;
    font-size: 0.94rem;
  }
  .drawing-toolbar {
    gap: 8px;
  }

  .tool-group,
  .history-tools {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .color-tools,
  .width-tools {
    width: auto;
    justify-content: flex-start;
  }

  .drawing-footer,
  .submit-dialog-card > div {
    align-items: stretch;
    flex-direction: column;
  }

  .drawing-submit,
  .submit-dialog-card .button {
    width: 100%;
  }
}

.admin-login-panel {
  max-width: 560px;
  margin: 40px auto;
}

.admin-login-form,
.manual-score-form {
  display: grid;
  gap: 16px;
}

.admin-login-form input,
.admin-review select,
.admin-review textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px;
  border: 1px solid #b8c8bd;
  border-radius: 6px;
  background: #ffffff;
  font: inherit;
}

.admin-review-header,
.admin-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.data-filter {
  display: flex;
  align-items: end;
  gap: 14px;
  margin: 22px 0;
}

.data-filter label { flex: 1; }
.data-filter input { width: 100%; min-height: 46px; padding: 10px; }
.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; }
.data-table th, .data-table td { padding: 12px; border: 1px solid #d7e1da; text-align: left; vertical-align: top; }
.data-table th { background: #eef5ef; color: #244631; }

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.compact-button {
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}

.admin-meta-grid,
.admin-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-meta-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 22px 0;
}

.admin-meta-grid > div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #d7e1da;
  background: #f8fbf8;
}

.admin-meta-grid strong,
.admin-section h3 {
  color: #244631;
}

.admin-section {
  margin-top: 24px;
  padding: 22px;
  border: 1px solid #d7e1da;
  background: #ffffff;
}

.admin-section h2 {
  margin-top: 0;
}

.admin-section pre {
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border: 1px solid #d7e1da;
  background: #f7f9f7;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-section details {
  margin-top: 16px;
}

.admin-section summary {
  cursor: pointer;
  font-weight: 700;
}

.admin-drawing {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #c5d2c9;
  background: #ffffff;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 24px 0 0;
}

.admin-nav {
  margin: 20px 0;
}

.admin-image-grid,
.score-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-image-grid figure {
  margin: 0;
}

.admin-image-grid figcaption {
  margin-bottom: 8px;
  font-weight: 700;
}

.admin-image-grid img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #c5d2c9;
  background: #ffffff;
}

.glm-suggestion,
.manual-score-form {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid #d7e1da;
}

.manual-score-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.manual-score-form h2,
.manual-score-form .notes-field,
.manual-score-form p,
.manual-score-form button {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .admin-review-header,
  .admin-image-grid,
  .score-summary,
  .manual-score-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .manual-score-form > * {
    grid-column: 1;
  }

  .admin-actions {
    justify-content: flex-start;
  }

  .data-filter,
  .admin-meta-grid,
  .admin-two-col {
    display: grid;
    grid-template-columns: 1fr;
  }
}

body.audio-task-active .page-shell {
  padding-top: 22px;
  padding-bottom: 24px;
}

body.audio-task-active .question-panel {
  min-height: 0;
}

.question-navigation,
.form-actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.review-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.review-row {
  min-height: 68px;
  padding: 12px 4px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.review-row:hover {
  background: var(--green-soft);
}

.question-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #b3d1c2;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 800;
}

.answer-state {
  color: var(--success);
  font-size: 0.86rem;
  font-weight: 800;
}

.review-unanswered .answer-state,
.warning-text {
  color: var(--error);
}

.review-unanswered .question-number {
  background: var(--warning-bg);
  color: var(--warning-ink);
}

.success-text {
  color: var(--success) !important;
}

.form-actions form {
  margin: 0;
}

.completion-panel {
  text-align: center;
}

.completion-mark {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 6px solid var(--gold-soft);
  background: var(--green);
  color: white;
  font-size: 2rem;
  font-weight: 800;
}

.submission-summary {
  width: min(100%, 580px);
  margin: 32px auto 0;
  text-align: left;
}

.submission-summary div {
  padding: 12px 0;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.submission-summary dt {
  color: var(--muted);
}

.submission-summary dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  :root {
    font-size: 17px;
  }

  .header-inner,
  .page-shell {
    width: min(100% - 28px, 940px);
  }

  .header-inner {
    min-height: 72px;
    gap: 10px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .brand-copy strong {
    font-size: 1rem;
  }

  .brand-copy small {
    display: none;
  }

  .header-meta {
    max-width: 52%;
    display: grid;
    justify-items: end;
    gap: 3px;
  }

  .institution-name {
    font-size: 0.68rem;
    line-height: 1.35;
  }

  .stage-label {
    padding: 2px 7px;
    font-size: 0.62rem;
  }

  .page-shell {
    padding: 28px 0 48px;
  }

  h1 {
    font-size: 1.9rem;
  }

  .welcome-panel {
    min-height: 0;
    padding: 42px 24px 50px;
    border-left-width: 5px;
  }

  .institution-credit {
    margin-bottom: 22px;
  }

  .test-toolbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .question-panel {
    min-height: 0;
  }

  .mark-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .mark-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mark-circle {
    width: 44px;
    height: 44px;
    border-width: 3px;
    font-size: 0.78rem;
  }

  .audio-stage {
    min-height: 330px;
    padding: 24px 18px;
  }

  .audio-stage-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .audio-action {
    width: 100%;
    min-width: 0;
  }

  .audio-response-button {
    width: min(64vw, 220px);
    height: min(64vw, 220px);
    padding: 24px;
    font-size: 1.08rem;
  }

  .question-navigation,
  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .question-navigation .button,
  .form-actions .button,
  .form-actions form,
  .form-actions form .button {
    width: 100%;
  }

  .question-navigation span:empty {
    display: none;
  }

  .review-row {
    grid-template-columns: 42px 1fr;
  }

  .answer-state {
    grid-column: 2;
  }

  .submission-summary div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .audio-response-button,
  .button {
    transition: none;
  }
}

@media (min-width: 721px) and (max-width: 1100px) {
  .page-shell {
    width: min(100% - 56px, 940px);
  }

  .question-panel {
    padding: 44px;
  }
}

@media (pointer: coarse) {
  .button,
  input[type="text"] {
    min-height: 56px;
  }

  .review-row {
    min-height: 74px;
  }
}

/* Q03 mobile toolbar layout fix */
@media (max-width: 620px) {
  .drawing-toolbar {
    align-items: stretch;
  }

  .color-tools {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .color-swatch {
    width: 100%;
    min-width: 0;
  }

  .width-tools {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

/* Q03 in-page fullscreen drawing mode */
.canvas-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawing-fullscreen-toggle {
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid #34734c;
  border-radius: 6px;
  background: #ffffff;
  color: #285c3b;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

body.drawing-fullscreen-active {
  overflow: hidden;
}

.canvas-pane.drawing-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding:
    max(8px, env(safe-area-inset-top))
    max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left));
  box-sizing: border-box;
  background: #f3f7f3;
  display: flex;
  flex-direction: column;
}

.canvas-pane.drawing-fullscreen .pane-heading {
  flex: 0 0 auto;
}

.canvas-pane.drawing-fullscreen .drawing-toolbar {
  flex: 0 0 auto;
  max-height: 42vh;
  overflow-y: auto;
}

.canvas-pane.drawing-fullscreen .canvas-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #aebfb3;
  border-radius: 0 0 8px 8px;
}

.canvas-pane.drawing-fullscreen #q03-canvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

@media (max-width: 620px) {
  .canvas-heading-actions {
    gap: 6px;
  }

  .drawing-fullscreen-toggle {
    min-height: 40px;
    padding-inline: 10px;
  }

  .canvas-pane.drawing-fullscreen .drawing-toolbar {
    gap: 6px;
    padding: 7px;
  }
}
