/* ============================================================
   WDA AI R6 — 全頁垂直滾動
   目的：首頁與考試操作頁都使用瀏覽器視窗本身的垂直 scrollbar。
   僅掛載於 AI 第一層；不改題庫、答案、評分或 API。
   ============================================================ */

/*
 * 舊主樣式 body 使用 overflow:hidden，並把題目區做成內層 scroll。
 * R3 已將正式作答區恢復 normal document flow；R6 統一把捲動責任
 * 交還給 html viewport，首頁與考試頁都保留右側垂直 scrollbar。
 */
html {
  min-height: 100% !important;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  scrollbar-gutter: stable;
}

body {
  min-height: 100vh !important;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
}

/* ===== 首頁／模式選擇 ===== */
#modeSelectScreen {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  min-height: 100vh !important;
  height: auto !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

/* 內容超過視窗高度時讓父層自然長高，不建立第二條內層 scrollbar。 */
#modeSelectScreen .mode-card {
  max-height: none !important;
  overflow: visible !important;
  flex-shrink: 0 !important;
}

/* ===== 考試操作頁 ===== */
body.wda-r1-exam,
body.wda-stage1-exam {
  min-height: 100vh !important;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
}

body.wda-r1-exam #id_header,
body.wda-stage1-exam #id_header {
  max-height: none !important;
  overflow: visible !important;
}

body.wda-r1-exam #id_middle,
body.wda-stage1-exam #id_middle {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

body.wda-r1-exam #id_middle .question-container,
body.wda-stage1-exam #id_middle .question-container,
body.wda-r1-exam #questionCard,
body.wda-stage1-exam #questionCard {
  overflow: visible !important;
}

/* 計算機、小畫家與作答總覽仍維持自己的 fixed/overlay 行為。 */
#mathmatics,
#memo,
#wdaOfficialToolbox,
#overlay {
  overscroll-behavior: contain;
}
