/* 僅供「AI 出卷 / AI 改卷」列印與試卷版面；不覆蓋 V3 原有分頁外觀 */
/* 頁面與字級跟排版規格：A4 595.44×841.68 pt，正文 10pt，橫額 11pt，封面主標題 16pt */

.exam-sheet {
  font-family: "PMingLiU", "MingLiU", "新細明體", "細明體", "Songti TC", "Noto Serif CJK TC", "Times New Roman", serif;
  font-size: 10pt;
  line-height: 1.58;
  color: #000;
  text-align: justify;
  background: #fff;
}

.exam-school,
.exam-title,
.exam-unit,
.exam-subhead,
.exam-instr-h,
.exam-q-num,
.exam-rubric-part-h,
.exam-disclaimer {
  font-family: "LiHei Pro", "蘋方-繁", "Heiti TC", "Microsoft JhengHei", "Noto Sans CJK TC", "Noto Sans TC", sans-serif;
}

.exam-school {
  text-align: center;
  font-weight: 700;
  font-size: 11pt;
  letter-spacing: 0.28em;
  margin: 0 0 0.45em;
  line-height: 1.4;
}

.exam-title {
  text-align: center;
  font-size: 16pt;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin: 0.15em 0 0.45em;
  line-height: 1.35;
}

.exam-subtitle {
  text-align: center;
  font-size: 10pt;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin: 0 0 0.7em;
  font-family: "PMingLiU", "MingLiU", "新細明體", "細明體", "Songti TC", "Noto Serif CJK TC", "Times New Roman", serif;
}

.exam-rubric-title {
  text-align: center;
  font-size: 16pt;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0.1em 0 0.6em;
  line-height: 1.35;
}

.exam-duration {
  text-align: center;
  font-size: 10pt;
  font-weight: 400;
  letter-spacing: 0.42em;
  margin: 0.7em 0 1.3em;
  font-family: "PMingLiU", "MingLiU", "新細明體", "細明體", "Songti TC", "Noto Serif CJK TC", "Times New Roman", serif;
}

.exam-applicable-note {
  text-align: center;
  font-size: 10pt;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 0.95em;
  line-height: 1.45;
}

.exam-instructions {
  white-space: normal;
  margin: 0 0 1.1em;
  font-size: 10pt;
  text-align: justify;
  line-height: 1.58;
}

.exam-instr-h {
  font-size: 10pt;
  font-weight: 700;
  margin: 0 0 0.35em;
  text-align: left;
  letter-spacing: 0.06em;
}

.exam-overview {
  font-weight: 700;
  font-size: 10pt;
  margin: 0 0 0.9em;
}

.exam-unit {
  text-align: center;
  font-size: 11pt;
  font-weight: 700;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 0.22em 0.3em;
  margin: 1.2em 0 0.85em;
  page-break-after: avoid;
  line-height: 1.45;
}

.exam-subhead {
  text-align: left;
  font-size: 11pt;
  font-weight: 700;
  margin: 1em 0 0.55em;
  page-break-after: avoid;
}

.exam-q-num {
  font-size: 10pt;
  font-weight: 700;
  margin: 0.85em 0 0.4em;
  page-break-after: avoid;
}

.exam-question,
.exam-rubric-q {
  margin-bottom: 1.1em;
  page-break-inside: avoid;
}

.exam-source {
  margin: 0.35em 0 0.7em;
}

.exam-source-label {
  font-weight: 700;
  font-size: 10pt;
  margin: 0;
}

.exam-source-attr {
  font-size: 10pt;
  margin: 0.08em 0 0.28em;
}

.exam-source-body {
  margin: 0 0 0.35em 0;
  border: 1px solid #000;
  padding: 0.4em 0.65em;
  font-size: 10pt;
  line-height: 1.58;
  font-family: "DFKaiShu-SB-Estd-BF", "標楷體", "Kaiti TC", "STKaiti", "KaiTi", "PMingLiU", "MingLiU", "Songti TC", serif;
}

.exam-source-body img,
.exam-source-body table {
  max-width: 100%;
  height: auto;
}

.exam-stem-lead {
  font-weight: 600;
  margin: 0.35em 0 0.28em;
  font-size: 10pt;
}

.exam-stem {
  margin: 0 0 0.3em;
  font-size: 10pt;
}

.exam-part {
  margin: 0.2em 0 0.2em 1.25em;
  text-indent: -1.25em;
  padding-left: 1.25em;
  font-size: 10pt;
}

.exam-part-label {
  font-weight: 700;
}

.exam-marks {
  font-weight: 400;
  white-space: nowrap;
  font-size: 10pt;
}

.exam-mcq-opt {
  margin: 0.12em 0 0.12em 1.6em;
  text-indent: -1.15em;
  padding-left: 1.15em;
  font-size: 10pt;
}

.exam-end {
  text-align: center;
  font-weight: 700;
  font-size: 10pt;
  margin: 1.4em 0 0.9em;
  letter-spacing: 0.18em;
}

.exam-disclaimer {
  border: 1px solid #000;
  padding: 0.4em 0.7em;
  font-weight: 700;
  font-size: 10pt;
  text-align: center;
  margin: 0 0 0.85em;
  background: #fff;
}

.exam-sub {
  text-align: center;
  margin: 0 0 0.9em;
  font-size: 10pt;
}

.exam-stem-brief {
  margin: 0 0 0.5em;
  font-size: 10pt;
}

.exam-rubric-part {
  margin: 0.45em 0 0.8em;
}

.exam-rubric-part-h,
.exam-rubric-sub {
  font-weight: 700;
  margin: 0.45em 0 0.2em;
  font-size: 10pt;
}

.exam-points,
.exam-examples {
  list-style: none;
  padding-left: 0;
  margin: 0.15em 0 0.4em;
  font-size: 10pt;
}

.exam-points li,
.exam-examples li {
  margin: 0.12em 0;
}

.exam-mcq-key {
  width: 100%;
  border-collapse: collapse;
  margin: 0.4em 0 1em;
  font-size: 10pt;
}

.exam-mcq-key th,
.exam-mcq-key td {
  border: 1px solid #000;
  padding: 0.22em 0.4em;
  text-align: center;
}

.exam-mcq-key th {
  font-weight: 700;
  background: #f6f6f6;
}

.exam-criteria {
  width: 100%;
  border-collapse: collapse;
  margin: 0.35em 0 0.7em;
  font-size: 10pt;
  page-break-inside: avoid;
  background: #fff;
}

.exam-criteria th,
.exam-criteria td {
  border: 1px solid #000;
  padding: 0.3em 0.45em;
  vertical-align: top;
  text-align: left;
}

.exam-criteria th {
  font-weight: 700;
  background: #f6f6f6;
}

.exam-criteria th:last-child,
.exam-criteria td:last-child {
  width: 5.5em;
  text-align: center;
  white-space: nowrap;
}

.exam-watermark {
  text-align: center;
  font-weight: 700;
  font-size: 10pt;
  color: #000;
  border: 1px dashed #000;
  padding: 0.28em;
  margin: 0 0 0.7em;
}

.exam-running-footer {
  margin-top: 1.2em;
  padding-top: 0.2em;
  font-size: 10pt;
  text-align: left;
}

.exam-cover {
  page-break-after: avoid;
}

@media screen {
  #ai-exam-print-root {
    display: none;
  }

  #ai-exam-preview-paper,
  #ai-exam-preview-rubric,
  #ai-exam-imported-rubric-preview {
    background: #e8e8e8;
    padding: 16px 0;
  }

  #ai-exam-preview-paper .exam-sheet,
  #ai-exam-preview-rubric .exam-sheet,
  #ai-exam-imported-rubric-preview .exam-sheet {
    background: #fff;
    width: 210mm;
    max-width: 100%;
    min-height: 297mm;
    margin: 0 auto;
    padding: 24mm 22mm 20mm;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    color: #000;
  }
}

@page {
  size: 595.44pt 841.68pt;
  margin: 24mm 22mm 20mm 22mm;
}

@page p1 {
  size: 595.44pt 841.68pt;
  margin: 24mm 22mm 20mm 22mm;
  @bottom-left {
    content: "校本中史試卷一 – " counter(page);
    font-family: "PMingLiU", "MingLiU", "新細明體", "細明體", "Songti TC", "Times New Roman", serif;
    font-size: 10pt;
    color: #000;
  }
}
@page p1r {
  size: 595.44pt 841.68pt;
  margin: 24mm 22mm 20mm 22mm;
  @bottom-left {
    content: "校本中史試卷一 評分參考 – " counter(page);
    font-family: "PMingLiU", "MingLiU", "新細明體", "細明體", "Songti TC", "Times New Roman", serif;
    font-size: 10pt;
    color: #000;
  }
}
@page p2 {
  size: 595.44pt 841.68pt;
  margin: 24mm 22mm 20mm 22mm;
  @bottom-left {
    content: "校本中史試卷二 – " counter(page);
    font-family: "PMingLiU", "MingLiU", "新細明體", "細明體", "Songti TC", "Times New Roman", serif;
    font-size: 10pt;
    color: #000;
  }
}
@page p2r {
  size: 595.44pt 841.68pt;
  margin: 24mm 22mm 20mm 22mm;
  @bottom-left {
    content: "校本中史試卷二 評分參考 – " counter(page);
    font-family: "PMingLiU", "MingLiU", "新細明體", "細明體", "Songti TC", "Times New Roman", serif;
    font-size: 10pt;
    color: #000;
  }
}
@page pother {
  size: 595.44pt 841.68pt;
  margin: 24mm 22mm 20mm 22mm;
  @bottom-left {
    content: "校本中史試卷 – " counter(page);
    font-family: "PMingLiU", "MingLiU", "新細明體", "細明體", "Songti TC", "Times New Roman", serif;
    font-size: 10pt;
    color: #000;
  }
}
@page potherr {
  size: 595.44pt 841.68pt;
  margin: 24mm 22mm 20mm 22mm;
  @bottom-left {
    content: "校本中史試卷 評分參考 – " counter(page);
    font-family: "PMingLiU", "MingLiU", "新細明體", "細明體", "Songti TC", "Times New Roman", serif;
    font-size: 10pt;
    color: #000;
  }
}

@media print {
  @page {
    size: 595.44pt 841.68pt;
    margin: 24mm 22mm 20mm 22mm;
  }

  html, body, .canvas, .stage {
    background: #fff !important;
    color: #000 !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .masthead,
  .login-art,
  .illus-wrap,
  .chrome-deco,
  #top-nav,
  #toast-banner,
  #view-login,
  #view-student,
  #view-teacher,
  #view-admin,
  #error-mark-modal,
  #ai-exam-zoom-modal,
  #admin-account-modal,
  #student-analysis-drawer,
  #bottom-nav {
    display: none !important;
  }

  #ai-exam-print-root {
    display: block !important;
    color: #000;
    background: #fff !important;
    max-width: none;
    width: auto;
  }

  #ai-exam-print-root .exam-sheet {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: #fff;
  }

  #ai-exam-print-root .exam-watermark {
    display: none;
  }

  #ai-exam-print-root .exam-running-footer {
    display: none !important;
  }
  #ai-exam-print-root .exam-sheet[data-footer="校本中史試卷一"] { page: p1; }
  #ai-exam-print-root .exam-sheet[data-footer="校本中史試卷一 評分參考"] { page: p1r; }
  #ai-exam-print-root .exam-sheet[data-footer="校本中史試卷二"] { page: p2; }
  #ai-exam-print-root .exam-sheet[data-footer="校本中史試卷二 評分參考"] { page: p2r; }
  #ai-exam-print-root .exam-sheet[data-footer="校本中史試卷"] { page: pother; }
  #ai-exam-print-root .exam-sheet[data-footer="校本中史試卷 評分參考"] { page: potherr; }

  #ai-exam-print-root .exam-paper-sheet .exam-cover {
    page-break-after: always;
  }

  #ai-exam-print-root .exam-question,
  #ai-exam-print-root .exam-rubric-q,
  #ai-exam-print-root .exam-criteria {
    page-break-inside: avoid;
  }
}

.ai-exam-thumb-btn.is-active {
  outline: 2px solid #000;
  outline-offset: 1px;
}

.ai-exam-image-zoom {
  transform-origin: center center;
}

.exam-answer-rule-hint {
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid #000;
  background: #FFF6C9;
  font-size: 11pt;
  font-weight: 700;
}
