/* Shared exam workspace. Highlight and focus styling belongs to the engines. */
body.reading-exam-layout {
  --reading-font-size: 20px;
  --reading-split: 58%;
  background: var(--panel);
}
body.reading-exam-layout.text-large { --reading-font-size: 28px; }
body.reading-exam-layout.text-xl { --reading-font-size: 34px; }

body.reading-exam-layout #app {
  display: flex !important;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}
body.reading-exam-layout #app[style*="display:none"],
body.reading-exam-layout #app[style*="display: none"] { display: none !important; }

body.reading-exam-layout .topbar {
  flex: 0 0 auto;
  box-shadow: none !important;
  backdrop-filter: none;
  background: var(--panel) !important;
}
body.reading-exam-layout .topbar .btn,
body.reading-exam-layout .topbar .icon { border-radius: 5px !important; }
body.reading-exam-layout .topbar .btn:hover,
body.reading-exam-layout .topbar .icon:hover { transform: none; }

body.reading-exam-layout .part-banner {
  flex: 0 0 auto;
  margin: 0;
  padding: 7px 24px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: none !important;
  align-items: baseline;
}
body.reading-exam-layout .part-title { font-size: 14px; }
body.reading-exam-layout .part-text { font-size: 13px; }

body.reading-exam-layout .main {
  flex: 1 1 0;
  display: flex;
  min-height: 0;
  height: auto;
  margin: 0;
  gap: 0;
}
body.reading-exam-layout .pane {
  min-width: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
  background: var(--panel);
}
body.reading-exam-layout .pane.left { flex: 0 0 calc(var(--reading-split) - 7px); }
body.reading-exam-layout .pane.right { flex: 1 1 0; }
body.reading-exam-layout .pane-header {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 24px;
  border-bottom: 0;
  background: var(--panel) !important;
  font-size: 13px;
}
body.reading-exam-layout .pane-header-actions { flex-wrap: wrap; }
body.reading-exam-layout .pane-body {
  flex: 1 1 0;
  height: auto;
  min-height: 0;
  padding: 18px clamp(20px, 2.4vw, 46px) 48px;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: var(--reading-font-size);
  line-height: 1.5;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
body.reading-exam-layout #passage h1,
body.reading-exam-layout #passage h2 {
  font-size: 1.08em;
  line-height: 1.35;
  text-align: center;
  margin: 0 0 1.25em;
}
body.reading-exam-layout #passage .reading-repeated-heading { display: none; }
body.reading-exam-layout #passage h3 { font-size: 1em; margin-bottom: 1.8em; }
body.reading-exam-layout #passage p { margin-bottom: 1.4em; }
body.reading-exam-layout .questions-section { max-width: none; margin: 0; }
body.reading-exam-layout #questionsPane .question-group,
body.reading-exam-layout #questionsPane .qblock,
body.reading-exam-layout #questionsPane .summary-original {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0 0 1.8em;
  background: transparent;
}
body.reading-exam-layout #questionsPane .summary-original { margin-top: 1.4em; }
body.reading-exam-layout #questionsPane .questions-section > h2,
body.reading-exam-layout #questionsPane .question-group > h3,
body.reading-exam-layout #questionsPane .qblock > h3,
body.reading-exam-layout #questionsPane .summary-original-title {
  font-size: 1em;
  margin-bottom: .85em;
}
body.reading-exam-layout #questionsPane .question-group > p,
body.reading-exam-layout #questionsPane .qblock > p {
  font-size: 1em;
  color: var(--text);
  margin-bottom: .6em;
}
body.reading-exam-layout #questionsPane .summary-original-text,
body.reading-exam-layout #questionsPane .summary,
body.reading-exam-layout #questionsPane .feature-qtext,
body.reading-exam-layout #questionsPane .option-label,
body.reading-exam-layout #questionsPane .question-title,
body.reading-exam-layout #questionsPane .match-table th,
body.reading-exam-layout #questionsPane .match-table td {
  font-size: var(--reading-font-size);
  line-height: 1.5;
}
body.reading-exam-layout #questionsPane .question {
  margin-top: 1em;
  padding-top: .65em;
}
body.reading-exam-layout #questionsPane ul,
body.reading-exam-layout #questionsPane ol { padding-left: 1.6em; }
body.reading-exam-layout #questionsPane li { margin-bottom: .45em; }
body.reading-exam-layout #questionsPane .option-label { align-items: baseline; }
body.reading-exam-layout #questionsPane .blank,
body.reading-exam-layout #questionsPane .feature-input {
  font-size: var(--reading-font-size) !important;
  height: 1.9em;
  min-height: 36px;
  max-width: 100%;
  vertical-align: baseline;
}
body.reading-exam-layout #questionsPane .blank {
  width: 9em;
  min-width: 0;
  max-width: min(250px, 100%);
  padding: .08em .3em;
}
body.reading-exam-layout #questionsPane .inline-blank { display: inline-block; max-width: 100%; }
body.reading-exam-layout #questionsPane .feature-row { flex-wrap: wrap; }
body.reading-exam-layout #questionsPane .feature-qtext { flex-basis: 12em; min-width: 0; }
body.reading-exam-layout #questionsPane .feature-input { min-width: 0; }
body.reading-exam-layout #questionsPane .match-table { display: block; max-width: 100%; overflow-x: auto; }
body.reading-exam-layout #questionsPane .reading-flowchart__title,
body.reading-exam-layout #questionsPane .reading-flowchart__node,
body.reading-exam-layout #questionsPane .questions-section .q22-flow-title { font-size: var(--reading-font-size) !important; }
body.reading-exam-layout #questionsPane .questions-section input.blank.q22-blank,
body.reading-exam-layout #questionsPane .reading-flowchart input.blank.reading-flowchart__input {
  font-size: var(--reading-font-size) !important;
  height: 1.9em !important;
  line-height: 1.5 !important;
}
body.reading-exam-layout #questionsPane .inline-dropzone,
body.reading-exam-layout #questionsPane .summary-blank,
body.reading-exam-layout #questionsPane .drag-blank {
  font-size: var(--reading-font-size);
  height: auto;
  min-height: 1.9em;
  max-width: 100%;
  white-space: normal;
}

.reading-splitter {
  flex: 0 0 14px;
  position: relative;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
  z-index: 2;
}
.reading-splitter::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 6px;
  width: 2px;
  background: var(--line);
}
.reading-splitter span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 30px;
  height: 36px;
  border: 1px solid var(--muted);
  border-radius: 2px;
  background: var(--panel);
  color: var(--text);
  font: 20px Arial, sans-serif;
}
body.reading-resizing, body.reading-resizing * { cursor: col-resize !important; user-select: none !important; }

body.reading-exam-layout .bottombar {
  position: relative;
  flex: 0 0 auto;
  height: auto;
  min-height: 60px;
  padding: 9px 20px;
  gap: 18px;
  box-shadow: none !important;
  backdrop-filter: none;
  background: var(--panel) !important;
}
body.reading-exam-layout .part-summary-wrap {
  gap: 8px;
  padding: 8px 2px 2px;
  flex-shrink: 0;
  overflow: auto;
}
body.reading-exam-layout .part-chip,
body.reading-exam-layout .part-summary-chip { border-radius: 3px !important; font-size: 14px; }
body.reading-exam-layout .qnums { min-width: 0; gap: 6px; padding: 9px 3px 3px; }
body.reading-exam-layout .qbtn {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 16px;
  font-weight: 500 !important;
  border-radius: 2px !important;
}
body.reading-exam-layout .qbtn.done:not(.active):not(.correct):not(.incorrect) {
  color: var(--text);
  background: var(--green-bg);
  border-color: var(--green);
}
@media (max-width: 1100px) {
  body.reading-exam-layout .bottombar { flex-wrap: wrap; gap: 0 14px; padding: 5px 12px; }
  body.reading-exam-layout .part-summary-wrap { flex-shrink: 1; max-width: 100%; }
  body.reading-exam-layout .part-summary-wrap + .qnums { flex-basis: 100%; }
  body.reading-exam-layout .pane-body { padding-left: 18px; padding-right: 18px; }
  body.reading-exam-layout .pane-header { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 620px) {
  body.reading-exam-layout .pane-body { padding: 12px 10px 32px; }
  body.reading-exam-layout .pane-header { padding: 5px 10px; }
  body.reading-exam-layout .part-banner { padding: 6px 10px; }
  body.reading-exam-layout .topbar .actions .btn { flex: 0 0 auto; }
}
