:root {
  color-scheme: light;
  --ink: #292d2e;
  --muted: #64696a;
  --line: #c9cccb;
  --line-soft: #e0e2e1;
  --cement: #d9dbda;
  --paper: #f7f7f5;
  --white: #fff;
  --charcoal: #414648;
  --focus: #7f888b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #e7e9e8;
}
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.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;
}
.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 1200;
  padding: .7rem 1rem;
  border-radius: 10px;
  color: #fff;
  background: var(--charcoal);
}
.skip-link:focus { top: 1rem; }

/* The slim, full-width beam is shared with the other learning systems. */
.site-header.edmund-system-header {
  margin: 0;
  width: 100%;
  border-bottom: 1px solid #bdc0bf;
  background: linear-gradient(180deg, rgba(248,248,247,.97), rgba(226,228,227,.96));
  box-shadow: 0 8px 28px rgba(39,43,44,.1);
}
.site-header .header-inner {
  width: min(1480px, calc(100% - 36px));
  min-height: 68px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-header .edmund-system-switcher__trigger { color: var(--ink); }
.site-header .edmund-system-switcher__trigger:hover,
.site-header .edmund-system-switcher__trigger:focus-visible,
.site-header .edmund-system-switcher[data-open="true"] .edmund-system-switcher__trigger {
  background: #dfe2e0;
  box-shadow: 0 8px 22px rgba(45,50,52,.11);
}
.site-header .edmund-system-switcher__logo {
  border-color: #bfc3c1;
  box-shadow: 0 7px 18px rgba(40,44,45,.16);
}
.site-header .edmund-system-switcher__copy strong { color: #292d2e; }
.site-header .edmund-system-switcher__copy small { color: #666b6d; }
.site-header .edmund-system-switcher__chevron {
  border-color: #c0c4c3;
  color: #4c5355;
}
.site-header .edmund-system-switcher__homebase {
  border-color: #bcc1bd;
  color: #3e4642;
  background: linear-gradient(145deg, #f9f9f7, #e5e8e5);
  box-shadow: 0 7px 18px rgba(43,48,45,.1);
}
.header-context {
  display: none;
}
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.account-label { color: #4d5555; font-size: .82rem; font-weight: 800; }
.header-action { min-height: 44px; padding: 7px 14px; border: 1px solid #b6bcba; border-radius: 999px; color: #303637; background: #f8f9f8; font-weight: 800; }
.header-action:hover { background: #e6e9e7; }
.edmund-system-header .edmund-system-tools .edmund-pomodoro-header-button,
.edmund-system-header .edmund-system-tools .edmund-music-header-button,
.edmund-system-header .edmund-system-tools [data-answer-sound-toggle] {
  border-color: #c1c5c3 !important;
  color: #383e3f !important;
  background: linear-gradient(145deg, #f7f8f7, #e2e5e3) !important;
}
.edmund-system-header .edmund-system-tools .edmund-pomodoro-header-button small { color: #676e6f; }
.edmund-system-header .edmund-system-tools .edmund-pomodoro-header-button:hover,
.edmund-system-header .edmund-system-tools .edmund-music-header-button:hover,
.edmund-system-header .edmund-system-tools [data-answer-sound-toggle]:hover {
  border-color: #8f9795 !important;
  background: #d7dcda !important;
}

.shell { width: min(1500px, calc(100% - 36px)); margin: auto; padding: 22px 0 68px; }
.login-gate { width: min(980px, 100%); min-height: min(70vh, 690px); margin: 28px auto 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, .82fr); align-items: center; gap: clamp(24px, 5vw, 72px); padding: clamp(26px, 5vw, 72px); border: 1px solid #c4c9c6; border-radius: 25px; background: linear-gradient(145deg, #f8f9f7, #e8ebe9); box-shadow: 0 20px 55px rgba(44, 50, 48, .12); }
.login-gate-intro h2 { margin: 10px 0 18px; font-family: Georgia, "Noto Serif TC", serif; font-size: clamp(2.15rem, 4vw, 3.8rem); line-height: 1.22; }
.login-gate-intro > p:last-child { max-width: 38ch; color: #586160; font-size: 1.07rem; line-height: 1.8; }
.gate-form-host { border: 1px solid #cbd0cd; border-radius: 18px; background: #fff; box-shadow: 0 12px 30px rgba(44, 50, 48, .08); }
.gate-form-host .dialog-close { display: none; }
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.tab {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 12px 20px;
  border: 1px solid #bec2c0;
  border-radius: 15px;
  text-align: left;
  color: var(--ink);
  background: linear-gradient(145deg, #fafaf9, #e9ebea);
  box-shadow: 0 3px 12px rgba(50,54,55,.05);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.tab:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(50,54,55,.12); }
.tab.is-active {
  color: #fff;
  border-color: #3b4042;
  background: linear-gradient(125deg, #3b4042, #5d6364);
  box-shadow: 0 6px 18px rgba(45,49,50,.14);
}
.tab-index {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  flex: none;
  border: 1px solid #d0d3d1;
  border-radius: 13px;
  background: #e1e4e2;
  color: #4b5253;
  font-weight: 850;
}
.tab.is-active .tab-index { border-color: #93999a; background: #6a7172; color: #fff; }
.tab strong { display: block; font-family: Georgia, "Noto Serif TC", serif; font-size: 1.3rem; }
.tab small { display: block; margin-top: .25rem; color: #6d7373; font-size: .88rem; }
.tab.is-active small { color: #dce0df; }

.panel {
  padding: clamp(18px, 2.5vw, 34px);
  border: 1px solid #c7cac8;
  border-radius: 18px;
  background: rgba(248,248,246,.96);
  box-shadow: 0 10px 35px rgba(45,49,50,.08);
}
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; color: #6f7575; font-size: .72rem; font-weight: 850; letter-spacing: .15em; }
.panel-heading h2 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.2; }
.panel-heading p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }
.count {
  flex: none;
  padding: 10px 15px;
  border: 1px solid #c3c7c5;
  border-radius: 999px;
  color: #4c5252;
  background: #ebedeb;
  font-weight: 850;
  white-space: nowrap;
}
.progress-block { display: grid; justify-items: end; gap: 9px; min-width: 132px; }
.progress-track { width: 100%; height: 5px; overflow: hidden; border-radius: 999px; background: #d8dedb; }
.progress-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: #426457; transition: width .25s ease; }
.study-tools { margin-bottom: 16px; padding: 16px; border: 1px solid #d5d9d6; border-radius: 14px; background: #fdfdfb; }
.study-tools .toolbar { margin-bottom: 12px; }
.study-tools .toolbar-actions { display: flex; align-items: end; flex-wrap: wrap; gap: 11px; }
.study-tools .toolbar-actions .filter { width: 16rem; }
.study-tools-toggle { display: none; }
.study-tools__lower { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; padding-top: 12px; border-top: 1px solid #e6e9e6; }
.study-tools__lower .reading-controls { margin-left: auto; }
.task2-view-filters { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid #d1d7d3; border-radius: 10px; background: #f0f2f0; }
.task2-view-filters button { min-height: 44px; padding: 6px 13px; border: 0; border-radius: 8px; color: #59615f; background: transparent; font-size: .82rem; font-weight: 800; }
.task2-view-filters button[aria-pressed="true"] { color: #fff; background: #414e49; box-shadow: 0 2px 6px #25322b23; }
.task2-view-filters button:hover:not([aria-pressed="true"]) { color: #303b37; background: #e0e6e1; }
#panel-task2.is-admin .task2-view-filters { display: none; }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 11px; margin-bottom: 17px; }
.toolbar label, .toolbar .filter { display: flex; flex-direction: column; gap: 7px; color: #555c5d; font-size: .82rem; font-weight: 800; }
.toolbar .search { flex: 1 1 22rem; }
.toolbar .filter { flex: 0 1 16rem; }
.toolbar input, .menu-trigger, .translation-toggle {
  min-height: 48px;
  border: 1px solid #bfc3c2;
  border-radius: 12px;
  color: var(--ink);
  background: #fdfdfc;
  box-shadow: inset 0 1px 2px rgba(50,54,55,.04);
}
.toolbar input { width: 100%; padding: 11px 15px; }
.toolbar input::placeholder { color: #8b9090; }
.menu-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  padding: 10px 15px;
  text-align: left;
  font-weight: 750;
}
.menu-trigger:hover, .answer-trigger:hover { border-color: #71797a; background: #f2f3f2; }
.menu-trigger[aria-expanded="true"], .answer-trigger[aria-expanded="true"] { border-color: #596163; box-shadow: 0 0 0 3px rgba(84,92,94,.13); }
.menu-chevron { width: 9px; height: 9px; flex: none; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .65; }
.translation-toggle { align-self: end; padding: 11px 17px; font-weight: 800; }
.translation-toggle[aria-pressed="true"] { border-color: #555d5e; color: #fff; background: #555d5e; }
.translation-toggle:hover { box-shadow: 0 5px 14px rgba(45,50,51,.1); }
.admin-label-status { margin: -4px 0 13px; color: #4b5653; font-size: .82rem; font-weight: 700; }
.admin-label-status[hidden] { display: none; }
#admin-labels-toggle[aria-pressed="true"] { border-color: #555d5e; color: #fff; background: #555d5e; }

.table-scroll {
  height: min(72vh, 840px);
  min-height: 360px;
  overflow: auto;
  border: 1px solid #c9cdcb;
  border-radius: 12px;
  background: #fff;
  scrollbar-color: #aeb3b1 #e8eae9;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 13px 18px;
  border-bottom: 1px solid #c3c7c5;
  color: #4c5354;
  background: #edf0ed;
  text-align: left;
  font-size: .82rem;
  letter-spacing: .045em;
}
thead th:first-child { width: 15%; }
#panel-task2 thead th:nth-child(1) { width: 15%; }
#panel-task2 thead th:nth-child(2) { width: 62%; }
#panel-task2 thead th:nth-child(3) { width: 23%; }
#panel-task2.is-admin table { width: max(100%, var(--admin-table-min-width, 915px)); table-layout: fixed; }
#panel-task2.is-admin thead th:nth-child(1) { min-width: 160px; width: 160px; }
#panel-task2.is-admin thead th:nth-child(2) { min-width: 480px; width: 480px; }
#panel-task2.is-admin thead th:nth-child(n+3) { min-width: 190px; width: 190px; }
#panel-task1 thead th:first-child { width: 46%; }
#panel-task1 thead th:nth-child(2) { width: 18%; }
#panel-task1 thead th:nth-child(3) { width: 17%; }
#panel-task1 thead th:nth-child(4) { width: 19%; }
tbody td { padding: 19px 18px; border-bottom: 1px solid #e2e4e3; vertical-align: top; line-height: 1.65; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #fafbfa; }
tbody tr:hover { background: #f0f4f1; }
tbody tr[hidden] { display: none; }
.row-id { display: block; color: #535b5c; font-size: .84rem; font-weight: 850; white-space: nowrap; }
.topic { display: block; margin-top: 5px; color: #797e7e; font-size: .78rem; }
.question { margin: 0; color: #292e2f; font-family: Georgia, "Noto Serif TC", serif; font-size: calc(1.07rem * var(--question-scale, 1)); line-height: 1.65; }
#panel-task2 .row-id, #panel-task2 .topic { color: #b7b7b7; }
#panel-task2 .question { font-size: calc(1.25rem * var(--question-scale, 1)); }
#panel-task2 .task2-meta-cell { vertical-align: top; }
#panel-task2 .task2-meta-cell .question-audio { margin-top: 16px; }
#panel-task2 .prompt-cell, #panel-task2 .question { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
#panel-task2 .question > span { display: block; }
#panel-task2 .question > span + span { margin-top: .45em; }
#panel-task2 .prompt-task-line { font-weight: 600; }
.preview-highlight-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 0; }
.highlight-toggle, .highlight-clear { min-height: 44px; padding: 7px 13px; border: 1px solid #bfc6c3; border-radius: 10px; color: #34403d; background: #e9efec; font-weight: 750; }
.highlight-toggle[aria-pressed="true"] { color: #fff; background: #465954; }
.highlight-clear { color: #993d32; background: #fff1ec; border-color: #e9b9ad; }
.preview-highlight-colors { display: flex; align-items: center; gap: 5px; padding: 4px 7px; border: 1px solid #d2ddd8; border-radius: 999px; background: #fff; }
.preview-highlight-colors button { width: 44px; height: 44px; display: grid; place-items: center; padding: 8px; border: 2px solid transparent; border-radius: 50%; background: transparent; cursor: pointer; }
.preview-highlight-colors button span { width: 100%; height: 100%; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 1px 2px #ffffffaa, 0 1px 3px #122f2522; }
.preview-highlight-colors button[data-preview-color="yellow"] { --swatch: #ffe766; }
.preview-highlight-colors button[data-preview-color="green"] { --swatch: #9de7aa; }
.preview-highlight-colors button[data-preview-color="blue"] { --swatch: #a8d9ff; }
.preview-highlight-colors button[data-preview-color="purple"] { --swatch: #dcc9fa; }
.preview-highlight-colors button[data-preview-color="red"] { --swatch: #ffaca9; }
.preview-highlight-colors button[aria-pressed="true"] { border-color: #465954; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #9cbcb1; }
.preview-highlight-colors button[data-preview-color="hide"] span { position: relative; border: 3px solid #d91d18; background: #fff; }
.preview-highlight-colors button[data-preview-color="hide"] span::after { content: ""; position: absolute; top: 50%; left: 50%; width: 113%; height: 3px; border-radius: 4px; background: #d91d18; transform: translate(-50%, -50%) rotate(45deg); }
::highlight(preview-yellow), mark.preview-highlight[data-preview-highlight="yellow"] { background: #ffe766; color: #1b251f; }
::highlight(preview-green), mark.preview-highlight[data-preview-highlight="green"] { background: #9de7aa; color: #1b251f; }
::highlight(preview-blue), mark.preview-highlight[data-preview-highlight="blue"] { background: #a8d9ff; color: #1b251f; }
::highlight(preview-purple), mark.preview-highlight[data-preview-highlight="purple"] { background: #dcc9fa; color: #1b251f; }
::highlight(preview-red), mark.preview-highlight[data-preview-highlight="red"] { background: #ffaca9; color: #1b251f; }
.preview-hidden-words { position: relative; display: inline; border-radius: 4px; color: transparent !important; background: #24493f; cursor: pointer; user-select: none; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.preview-hidden-words::after { content: ""; position: absolute; inset: 0; z-index: 5; border-radius: 4px; background: repeating-linear-gradient(135deg,#24493f,#24493f 8px,#326051 8px,#326051 16px); }
.preview-hidden-words:focus-visible { outline: 3px solid #f0b941; outline-offset: 3px; }
.highlight-dialog { width: min(430px, calc(100vw - 32px)); padding: 28px; }
.highlight-dialog h2 { margin: 0; font-family: Georgia, "Noto Serif TC", serif; }
.highlight-dialog p { line-height: 1.6; }
.highlight-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.highlight-dialog-actions button { min-height: 40px; padding: 8px 14px; border: 1px solid #aeb7b3; border-radius: 9px; background: #fff; }
.highlight-dialog-actions button:last-child { border-color: #a64a3b; color: #fff; background: #a64a3b; }
.reading-controls { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reading-control { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.reading-control__label { color: #65706d; font-size: .74rem; font-weight: 800; letter-spacing: 0; }
.reading-control__trigger { min-width: 71px; min-height: 44px; display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 9px 5px 12px; border: 1px solid #b9c1bd; border-radius: 10px; color: #303b38; background: linear-gradient(145deg, #fff, #edf1ee); box-shadow: 0 2px 5px rgba(43,52,48,.07); font-size: .82rem; font-weight: 850; }
.reading-control__trigger:hover, .reading-control__trigger[aria-expanded="true"] { border-color: #64736c; background: #e6ece8; box-shadow: 0 0 0 3px rgba(84,107,95,.12); }
.reading-control__trigger .menu-chevron { width: 7px; height: 7px; }
.student-head { display: grid; gap: 7px; }
.student-head__top { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.student-head__actions { display: inline-flex; gap: 4px; }
.student-head button { min-width: 27px; min-height: 27px; border: 1px solid #aeb5b2; border-radius: 8px; color: #323939; background: #f7f8f7; font-weight: 900; }
.student-head select { width: 100%; min-height: 36px; border: 1px solid #b5bbb8; border-radius: 8px; padding: 5px; color: #303637; background: #fafbfa; font-size: .78rem; }
.student-answer { color: #3e4747; font-size: .83rem; font-weight: 750; overflow-wrap: anywhere; }
.student-answer.is-empty { color: #919898; font-weight: 500; }
.chart-cell .question { margin: 8px 0 12px; font-size: 1.11rem; font-weight: 600; }
.chart-cell .diagram-button { margin-top: 12px; }
.task1-answer-cell { padding-top: 28px; }
.question-audio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid #aeb5b2;
  border-radius: 999px;
  color: #404849;
  background: #f1f3f1;
  font-size: .8rem;
  font-weight: 800;
}
.question-audio:hover, .question-audio.is-playing { border-color: #5d6766; background: #e0e5e2; }
.question-audio:disabled { opacity: .5; cursor: not-allowed; }
.question-audio__icon { width: 16px; height: 16px; flex: none; border: 2px solid currentColor; border-radius: 50%; position: relative; }
.question-audio__icon::after { content: ''; position: absolute; top: 3px; left: 5px; border-top: 3px solid transparent; border-bottom: 3px solid transparent; border-left: 5px solid currentColor; }
.question-audio.is-playing .question-audio__icon::after { top: 3px; left: 4px; width: 5px; height: 6px; border: 0; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }
.translation { margin: 12px 0 0; padding: 11px 14px; border-left: 3px solid #929999; border-radius: 0 8px 8px 0; color: #4b5152; background: #eff1ef; line-height: 1.8; }
.answer-trigger {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border: 1px solid #b9c3be;
  border-radius: 13px;
  color: #555d5e;
  background: linear-gradient(145deg, #fff, #f0f3f1);
  text-align: left;
  font-size: .88rem;
  font-weight: 750;
  box-shadow: 0 3px 8px rgba(41,52,46,.06);
  transition: border-color .18s, background .18s, box-shadow .18s, transform .18s;
}
.answer-trigger.is-selected { border-color: #73837a; color: #24342d; background: linear-gradient(145deg, #e9f0eb, #dfe9e2); box-shadow: 0 3px 11px rgba(58,84,67,.1); }
.answer-trigger:hover { transform: translateY(-1px); }
.answer-marker { color: #b8bebc; font-size: .55rem; }
.answer-trigger.is-selected .answer-marker { color: #596264; }
.answer-label { min-width: 0; flex: 1; }
.answer-trigger .menu-chevron { margin-left: auto; }
.task2-feedback {
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid #cbd1ce;
  border-radius: 10px;
  color: #4f5a57;
  background: #f2f4f2;
  font-size: .82rem;
  font-weight: 750;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.task2-feedback[hidden] { display: none; }
.task2-feedback.is-correct { border-color: #a5cbb5; color: #235a3d; background: #edf7f0; }
.task2-feedback.is-wrong { border-color: #dfb5ae; color: #913f36; background: #fff1ed; }
.choice-menu {
  position: fixed;
  z-index: 1500;
  overflow: auto;
  padding: 7px;
  border: 1px solid #b9bfbc;
  border-radius: 15px;
  background: #f9faf8;
  box-shadow: 0 20px 60px rgba(33,38,39,.22), 0 3px 10px rgba(33,38,39,.08);
  scrollbar-color: #aeb4b1 #eef0ee;
}
.choice-menu__option {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  color: #353b3c;
  background: transparent;
  text-align: left;
  font-size: .89rem;
  line-height: 1.35;
}
.choice-menu__option:hover, .choice-menu__option:focus-visible { outline: 0; background: #e6e9e7; }
.choice-menu__option[aria-checked="true"] { color: #fff; background: #525a5c; }
.choice-menu__check { width: 17px; flex: none; font-weight: 900; }
.choice-menu.is-compact { border-color: #bbc6bf; background: rgba(251,253,251,.98); backdrop-filter: blur(12px); }
.choice-menu.is-compact .choice-menu__option { min-height: 38px; padding: 7px 9px; font-size: .82rem; font-weight: 750; }
.choice-menu.is-compact .choice-menu__option[aria-checked="true"] { background: #43594c; }

.diagram-button { display: block; width: 100%; padding: 8px; border: 1px solid #c6cbc8; border-radius: 11px; background: #f9faf9; }
.diagram-button:hover { border-color: #7b8383; background: #eceeed; }
.diagram-button img { display: block; width: 100%; max-height: 260px; object-fit: contain; }
.diagram-button span { display: block; margin-top: 4px; color: #535b5c; font-size: .77rem; font-weight: 800; }
dialog { width: min(92vw, 900px); max-height: 90vh; padding: 0; border: 1px solid #c4c9c6; border-radius: 21px; color: var(--ink); background: #f7f8f6; box-shadow: 0 30px 80px rgba(0,0,0,.29); }
dialog::backdrop { background: rgba(23,27,28,.65); backdrop-filter: blur(5px); }
.dialog-inner { position: relative; overflow: auto; max-height: 90vh; padding: clamp(20px,3vw,34px); }
.dialog-inner h2 { margin: .1rem 2.5rem .5rem 0; font-family: Georgia, "Noto Serif TC", serif; }
.dialog-inner p { line-height: 1.7; }
.dialog-inner img { display: block; max-width: 100%; max-height: 58vh; margin: auto; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; }
.dialog-close { position: absolute; right: 16px; top: 16px; width: 42px; height: 42px; border: 0; border-radius: 50%; color: var(--ink); background: #e4e7e5; font-size: 1.7rem; }
.login-dialog { width: min(92vw, 430px); }
.login-form { position: relative; display: grid; gap: 16px; padding: 30px; }
.login-form h2 { margin: 0 44px 0 0; font-family: Georgia, "Noto Serif TC", serif; font-size: 1.5rem; }
.login-form > label { display: grid; gap: 6px; color: #444b4b; font-weight: 800; }
.login-form input[type="text"], .login-form input[type="password"] { width: 100%; min-height: 46px; border: 1px solid #b7bfbb; border-radius: 10px; padding: 10px; background: #fff; }
.login-modes { display: flex; gap: 18px; font-weight: 750; }
.login-modes label { display: inline-flex; align-items: center; gap: 5px; }
.login-submit { min-height: 46px; border: 0; border-radius: 10px; color: #fff; background: #474f50; font-weight: 850; }
#login-error { margin: 0; color: #a22b2b; font-weight: 700; }

.pwa-notice { border-color: #bfc5c2; color: #2b3031; background: #f7f8f6; box-shadow: 0 22px 62px rgba(30,35,36,.23); }
.pwa-notice strong { font-family: Georgia, "Noto Serif TC", serif; font-size: 1.15rem; }
.pwa-notice p { color: #5b6262; }
.pwa-notice__actions button { border-color: #c4cac7; color: #404748; background: #fff; }
.pwa-notice__actions button[data-pwa-primary] { border-color: #485052; color: #fff; background: #485052; }
.pwa-install-button { background: #454c4e; }

:is(.tab,.menu-trigger,.translation-toggle,.answer-trigger,.reading-control__trigger,.diagram-button,.dialog-close,.question-audio):focus-visible,
.table-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

@media (max-width: 1100px) {
  .study-tools__lower .reading-controls { margin-left: 0; }
  #panel-task2.is-admin .table-scroll { overflow-x: hidden; }
  #panel-task2.is-admin table,
  #panel-task2.is-admin tbody,
  #panel-task2.is-admin tr,
  #panel-task2.is-admin td { display: block; width: 100%; min-width: 0; max-width: 100%; }
  #panel-task2.is-admin table { table-layout: auto; }
  #panel-task2.is-admin thead { position: absolute; left: -9999px; }
  #panel-task2.is-admin tbody tr { padding: 17px; border-bottom: 1px solid var(--line); }
  #panel-task2.is-admin tbody td { padding: 0; border: 0; }
  #panel-task2.is-admin tbody td + td { margin-top: 11px; }
  #panel-task2.is-admin tbody td[data-student-label] { padding: 10px 12px; border: 1px solid #d8dfda; border-radius: 10px; background: #f3f5f3; }
  #panel-task2.is-admin tbody td[data-student-label]::before { content: attr(data-student-label); display: block; margin-bottom: 3px; color: #66706b; font-size: .72rem; font-weight: 850; }
}

@media (max-width: 900px) {
  #panel-task2 .table-scroll { overflow-x: hidden; }
  #panel-task2 table, #panel-task2 tbody, #panel-task2 tr, #panel-task2 td { display: block; width: 100%; min-width: 0; max-width: 100%; }
  #panel-task2 table { table-layout: auto; }
  #panel-task2 thead { position: absolute; left: -9999px; }
  #panel-task2 tbody tr { padding: 18px; border-bottom: 1px solid var(--line-soft); }
  #panel-task2 tbody td { padding: 0; border: 0; }
  #panel-task2 tbody td + td { margin-top: 13px; }
  #panel-task2 .task2-meta-cell { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 10px; }
  #panel-task2 .task2-meta-cell .topic { display: inline; margin: 0; }
  #panel-task2 .task2-meta-cell .question-audio { margin: 0 0 0 auto; }
  #panel-task2 .question { font-size: calc(1.18rem * var(--question-scale, 1)); }
  #panel-task2 tbody td:last-child { max-width: 100%; }
}

@media (max-width: 700px) {
  .login-gate { min-height: 0; margin-top: 0; grid-template-columns: 1fr; gap: 20px; padding: 22px; }
  .site-header .header-inner { width: calc(100% - 20px); min-height: 66px; }
  .site-header .edmund-system-switcher__copy strong { font-size: 16px; }
  .site-header .edmund-system-switcher__copy small { font-size: 9px; max-width: 180px; }
  .site-header .edmund-system-switcher__logo { width: 40px; height: 40px; flex-basis: 40px; }
  .header-context { display: none; }
  .shell { width: calc(100% - 20px); padding: 16px 0 36px; }
  .tabs { gap: 8px; margin-bottom: 12px; }
  .tab { gap: 9px; min-height: 76px; padding: 11px; border-radius: 14px; }
  .tab-index { width: 32px; height: 32px; border-radius: 10px; font-size: .78rem; }
  .tab strong { font-size: 1.08rem; }
  .tab small { font-size: .73rem; }
  .panel { padding: 14px; border-radius: 16px; }
  .panel-heading { align-items: start; gap: 8px; margin-bottom: 17px; }
  .panel-heading p:not(.eyebrow) { font-size: .85rem; }
  .count { padding: 7px 10px; font-size: .76rem; }
  .study-tools { padding: 12px; margin-bottom: 12px; }
  .study-tools .toolbar { margin-bottom: 0; }
  .study-tools .toolbar-actions, .study-tools .study-tools-extra { display: none; }
  .study-tools-toggle { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 7px 12px; border: 1px solid #c4cbc7; border-radius: 10px; color: #35413c; background: #eff3ef; text-align: left; font-size: .85rem; font-weight: 800; }
  .study-tools.is-open .toolbar-actions { display: flex; flex-direction: column; align-items: stretch; width: 100%; margin-top: 10px; }
  .study-tools.is-open .toolbar-actions .filter { width: 100%; }
  .study-tools.is-open .study-tools-extra { display: block; }
  .study-tools.is-open .study-tools-toggle .menu-chevron { transform: translateY(2px) rotate(225deg); }
  .study-tools .study-tools__lower { margin-top: 12px; }
  .toolbar .search, .toolbar .filter { flex-basis: 100%; }
  .translation-toggle { width: 100%; }
  .table-scroll { height: 68vh; }
  table, thead, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; left: -9999px; }
  tbody tr { padding: 16px; border-bottom: 1px solid var(--line); }
  tbody td { padding: 0; border: 0; }
  tbody td + td { margin-top: 10px; }
  .question { font-size: calc(1rem * var(--question-scale, 1)); }
  #panel-task2 .question { font-size: calc(1.15rem * var(--question-scale, 1)); }
  .topic { display: inline; margin-left: 8px; }
  .diagram-button { max-width: 100%; }
  .diagram-button img { max-height: 220px; }
  .task1-answer-cell { padding-top: 0; }
  .task1-answer-cell::before { display: block; margin: 0 0 5px; color: #697170; font-size: .76rem; font-weight: 800; }
  .task1-answer-cell:nth-child(2)::before { content: '圖表類型'; }
  .task1-answer-cell:nth-child(3)::before { content: '動態 / 靜態'; }
  .task1-answer-cell:nth-child(4)::before { content: '適用時態（可多選）'; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tab, .answer-trigger, .progress-track > span { transition: none; }
}
