:root {
  color-scheme: light;
  --navy: #000f4f;
  --navy-soft: #153a79;
  --blue: #005ded;
  --blue-dark: #004ed1;
  --ice: #dff4ff;
  --ice-strong: #d8efff;
  --paper: #fff;
  --text: #193654;
  --muted: #61788d;
  --line: #b9d2e4;
  --line-strong: #7ca8c7;
  --error: #b52d42;
  --warning: #8a5a05;
  --warning-soft: #fff5d8;
  --shadow: 0 18px 42px rgba(24, 77, 116, 0.13);
  --radius-card: 26px;
  --radius-control: 12px;
  --focus: #0054df;
  --transition-fast: 180ms ease;
  --transition: 240ms cubic-bezier(0.2, 0.75, 0.25, 1);
  --transition-page: 300ms cubic-bezier(0.16, 1, 0.3, 1);
  --page-gutter: clamp(14px, 3vw, 48px);
  font-family: Avenir, "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 0; min-height: 100%; background: var(--ice); }
body {
  display: flex;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  flex-direction: column;
  color: var(--text);
  background: var(--ice);
  font-size: 1rem;
  line-height: 1.5;
}
.assessment-active {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.assessment-active .site-header { flex: 0 0 auto; }
.assessment-active .site-footer { display: none; }
button, input { max-width: 100%; font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button, a { overflow-wrap: anywhere; }
a { border-radius: 4px; transition: color var(--transition-fast), background-color var(--transition-fast), text-decoration-color var(--transition-fast), box-shadow var(--transition-fast); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
#question-prompt:focus, .completion-card h1:focus { outline: none; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--navy);
  transition: transform var(--transition-fast);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  display: flex;
  z-index: 2;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 108px;
  padding: 10px max(var(--page-gutter), env(safe-area-inset-right)) 10px max(var(--page-gutter), env(safe-area-inset-left));
  gap: 28px;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(25, 75, 111, 0.1);
}
.brand { display: inline-flex; min-width: 0; min-height: 44px; align-items: center; }
.booknook-logo { display: block; width: clamp(200px, 23.6vw, 374px); max-width: 100%; height: auto; }
.header-meta { display: flex; align-items: center; gap: 18px; }
.lexile-brand { display: flex; width: clamp(164px, 14.2vw, 224px); min-width: max-content; align-items: center; justify-content: flex-end; gap: clamp(8px, 1.5vw, 24px); color: #151515; }
.lexile-mark { display: block; width: 84px; height: 84px; flex: 0 0 auto; object-fit: contain; }
.lexile-name { display: flex; min-width: 0; flex-direction: column; font-family: Arial, Helvetica, sans-serif; font-size: 1.375rem; font-weight: 400; letter-spacing: -0.025em; line-height: 1; }
.lexile-name span { display: block; white-space: nowrap; }

.page-shell {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 178px);
  min-height: calc(100dvh - 178px);
  flex: 1;
  padding: clamp(32px, 3.8vw, 60px) var(--page-gutter) clamp(24px, 3vw, 48px);
  background: var(--ice);
  container-type: inline-size;
}
.login-layout {
  display: grid;
  width: min(1474px, 100%);
  min-height: 730px;
  margin: 0 auto;
  grid-template-columns: minmax(0, 1.238fr) minmax(500px, 1fr);
  gap: clamp(32px, 3.2vw, 50px);
}
.welcome-panel {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  padding: 23px 0 15px clamp(0px, 2.35vw, 37px);
}
.welcome-copy-block h1 {
  max-width: 12ch;
  margin: 0 0 18px;
  color: var(--navy);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: clamp(4.5rem, 5.68vw, 5.625rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.98;
}
.welcome-copy-block p {
  margin: 0;
  color: var(--navy-soft);
  font-size: clamp(1.45rem, 2.02vw, 2rem);
  font-weight: 500;
}
html[lang="es"] .welcome-copy-block h1 { max-width: 14ch; font-size: clamp(3.7rem, 4.6vw, 4.6rem); }
.book-hero {
  position: absolute;
  top: 262px;
  left: clamp(-56px, -3.5vw, -28px);
  width: min(885px, calc(100% + 6.7vw - 10px));
  max-width: none;
  height: auto;
  aspect-ratio: 885 / 459;
  overflow: hidden;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%),
    linear-gradient(to right, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%),
    linear-gradient(to right, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
  mask-composite: intersect;
}
.book-hero > .hero-static,
.book-hero > .hero-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-cloud-extension { display: none; pointer-events: none; }
.book-hero-source {
  position: absolute;
  top: -93.6819%;
  left: 0;
  display: block;
  width: 179.209%;
  max-width: none;
  height: auto;
}
.login-column { position: relative; display: flex; min-width: 0; align-items: center; flex-direction: column; justify-content: flex-start; }
.login-card {
  width: min(100%, 630px);
  min-height: 700px;
  padding: clamp(34px, 2.8vw, 44px) clamp(28px, 2.8vw, 44px) 30px;
  border: 1px solid #b9dcf3;
  border-radius: var(--radius-card);
  background: var(--paper);
  box-shadow: 0 12px 30px rgba(24, 77, 116, 0.08);
}

.eyebrow, .section-label {
  margin: 0 0 9px;
  color: var(--blue-dark);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
h1, h2, p { overflow-wrap: break-word; }
h1, h2 {
  color: var(--navy);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  letter-spacing: -0.025em;
}
.form-heading { text-align: center; }
.login-book-icon {
  display: block;
  width: 89px;
  height: 85px;
  margin: -4px auto 15px;
  background: url("/assets/product-reference.png") -1155px -206px / 1586px 992px no-repeat;
}
.form-heading h2 { margin: 0; font-size: 2.9rem; line-height: 1.1; }
.field-group { margin: 82px 0 0; }
.field-group label { display: block; margin-bottom: 7px; color: var(--navy); font-size: 1.375rem; font-weight: 700; line-height: 1.1; }
.field-group input {
  width: 100%;
  min-height: 68px;
  padding: 15px 20px;
  border: 2px solid #9fbfd4;
  border-radius: var(--radius-control);
  color: var(--navy);
  background: #fff;
  font-size: 1.45rem;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}
.field-group input:focus { border-color: var(--blue-dark); box-shadow: 0 0 0 4px rgba(21, 151, 229, 0.14); outline: none; }
.field-group input[aria-invalid="true"] { border-color: var(--error); }
.field-feedback {
  display: grid;
  min-block-size: calc(1.5em + 30px);
  margin-top: 9px;
  padding-bottom: 8px;
  font-size: 1.18rem;
}
.field-feedback > *, .field-feedback-size > span { grid-area: 1 / 1; min-width: 0; }
.field-hint, .field-error { align-self: start; margin: 0; font-size: inherit; }
/* Reserve the shared hint/error slot for every localized response before validation. */
/* 校验前为各语言的提示与错误信息预留共享空间。 */
.field-feedback-size { display: grid; visibility: hidden; pointer-events: none; user-select: none; font-weight: 700; }
.field-hint { color: var(--muted); }
.field-error, .answer-error { color: var(--error); font-weight: 700; }

.primary-button, .secondary-button, .text-button {
  min-height: 48px;
  border-radius: var(--radius-control);
  font-weight: 750;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), opacity var(--transition), transform var(--transition-fast);
}
.primary-button {
  position: relative;
  width: 100%;
  padding: 12px 22px;
  border: 2px solid var(--blue);
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(21, 151, 229, 0.19);
}
.login-card .primary-button { min-height: 68px; font-size: 1.6rem; }
.login-card .primary-button { display: flex; align-items: center; justify-content: center; gap: 16px; }
.continue-arrow {
  width: 22px;
  height: 22px;
  background: currentColor;
  -webkit-mask: url("/assets/arrow-right.svg") center / contain no-repeat;
  mask: url("/assets/arrow-right.svg") center / contain no-repeat;
}
.primary-button:active:not(:disabled), .secondary-button:active:not(:disabled), .text-button:active:not(:disabled) { box-shadow: none; transform: scale(0.985); }
button:disabled { cursor: not-allowed; opacity: 0.62; }
.button-spinner {
  display: none;
  width: 20px;
  height: 20px;
  margin: auto;
  border: 3px solid rgba(255, 255, 255, 0.42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.is-loading .button-label { visibility: hidden; }
.is-loading .continue-arrow { visibility: hidden; }
.is-loading .button-spinner { position: absolute; inset: 0; display: block; }
.teacher-help { display: flex; align-items: center; margin: 28px 0 31px; gap: 18px; color: var(--muted); text-align: center; font-size: 1.1rem; font-weight: 400; }
.teacher-help p { min-width: 0; margin: 0; }
.teacher-rule { height: 1px; flex: 1; background: #cfdeea; }
.login-tip { display: flex; height: auto; min-height: 77px; padding: 15px 20px; align-items: center; justify-content: center; gap: 18px; border-radius: 12px; color: var(--navy); background: #e3f2fd; font-size: 1.125rem; font-weight: 400; }
.tip-icon {
  width: 50px;
  height: 56px;
  flex: 0 0 50px;
  background: url("/assets/product-reference.png") -1017px -772px / 1586px 992px no-repeat;
}

.state-card {
  width: min(620px, 100%);
  margin: auto;
  padding: clamp(38px, 6vw, 64px);
  border: 1px solid #c4ddec;
  border-radius: var(--radius-card);
  text-align: center;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.compact-card { max-width: 560px; }
.state-card h1 { margin: 0 0 14px; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; }
.supporting-copy, .completion-copy { max-width: 46ch; margin: 0 auto 28px; color: var(--muted); font-size: 1.05rem; }
.completion-copy { margin-bottom: 0; }
.loading-mark { width: 44px; height: 44px; margin: 0 auto 25px; border: 5px solid #cdeafa; border-top-color: var(--blue); border-radius: 50%; animation: spin 800ms linear infinite; }
.state-card .primary-button { max-width: 270px; }
.text-button { display: block; margin: 14px auto 0; padding: 10px 16px; border: 0; color: var(--blue-dark); background: transparent; text-decoration: underline; text-underline-offset: 3px; }

.assessment-active .site-header {
  min-height: 70px;
  padding-block: 7px;
}
.assessment-active .booknook-logo { width: clamp(164px, 18vw, 232px); }
.assessment-active .lexile-brand { width: clamp(134px, 12vw, 178px); gap: 10px; }
.assessment-active .lexile-mark { width: 54px; height: 54px; }
.assessment-active .lexile-name { font-size: 1rem; }
.assessment-active .page-shell {
  min-height: 0;
  padding: clamp(10px, 1.5vh, 18px) var(--page-gutter);
}
.assessment-layout {
  display: grid;
  width: min(1400px, 100%);
  min-height: 0;
  margin: 0 auto;
  flex: 1;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(8px, 1.2vh, 14px);
}
.assessment-toolbar {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  padding-inline: 4px;
  gap: 24px;
}
.assessment-toolbar .eyebrow { margin: 0; font-size: 0.74rem; }
.question-number { margin: 0; color: var(--navy-soft); font-size: 0.93rem; font-weight: 750; }
.assessment-workspace {
  display: grid;
  min-height: 0;
  overflow: visible;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: clamp(14px, 1.8vw, 24px);
}
.secondary-button { padding: 10px 18px; border: 2px solid #9fc4dc; color: var(--navy); background: #fff; }
.stimulus-card, .question-card {
  min-width: 0;
  min-height: 0;
  padding: clamp(18px, 2.2vw, 30px);
  border: 1px solid #c4ddec;
  border-radius: var(--radius-card);
  background: var(--paper);
  box-shadow: 0 12px 34px rgba(24, 77, 116, 0.09);
}
.stimulus-card {
  display: flex;
  flex-direction: column;
  border-top: 5px solid var(--blue);
}
.stimulus-card .section-label, .question-card .section-label { margin-bottom: clamp(8px, 1.4vh, 14px); }
.passage-text {
  margin: 0;
  white-space: pre-wrap;
  color: #243d55;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  font-size: clamp(1.125rem, min(1.7vw, 2.8dvh), 1.5rem);
  line-height: 1.62;
}
.cloze-blank {
  display: inline-block;
  width: clamp(88px, 9vw, 138px);
  height: 1.05em;
  margin-inline: 0.18em;
  vertical-align: -0.08em;
  border-bottom: 3px solid var(--blue-dark);
  background: linear-gradient(to top, rgba(0, 93, 237, 0.08), transparent 58%);
}
.stimulus-image {
  display: block;
  width: min(100%, 480px);
  min-height: 0;
  max-height: min(44vh, 390px);
  margin: auto;
  flex: 1 1 auto;
  object-fit: contain;
}
.audio-player { margin: 0 0 16px; flex: 0 0 auto; }
.audio-control { display: flex; min-width: 0; align-items: center; }
.audio-button {
  display: inline-flex;
  min-width: 144px;
  min-height: 52px;
  padding: 10px 18px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px solid #9fc8e2;
  border-radius: 999px;
  color: var(--navy);
  background: #eef8ff;
  font-weight: 750;
  transition: border-color var(--transition), background-color var(--transition), transform var(--transition-fast), box-shadow var(--transition);
}
.audio-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  background: currentColor;
  clip-path: polygon(12% 4%, 96% 50%, 12% 96%);
}
.audio-control[data-state="pause"] .audio-icon { clip-path: polygon(10% 4%, 40% 4%, 40% 96%, 10% 96%, 10% 4%, 60% 4%, 90% 4%, 90% 96%, 60% 96%, 60% 4%); }
.audio-control[data-state="replay"] .audio-icon { border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; background: transparent; clip-path: none; }
/* Align with the label row without moving the image below. */
/* 与标签行对齐，同时不移动下方图片。 */
#main-audio .audio-control { position: relative; top: calc(-1.155rem - clamp(8px, 1.4vh, 14px)); flex-direction: row-reverse; }
#main-audio .audio-button {
  width: 88px;
  height: 88px;
  min-width: 88px;
  min-height: 88px;
  padding: 0;
  flex: 0 0 auto;
  border-radius: 50%;
}
#main-audio .audio-icon { width: 30px; height: 30px; }
#main-audio .audio-button span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.audio-status { margin-left: 10px; color: var(--error); font-size: 0.86rem; font-weight: 700; }
.audio-status:empty { display: none; }
#main-audio .audio-status { margin-right: 10px; margin-left: 0; }
.question-card {
  display: flex;
  flex-direction: column;
  container-type: inline-size;
}
.question-card fieldset { margin: 0; padding: 0; border: 0; }
.question-card legend { width: 100%; padding: 0; color: var(--navy); font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif; font-size: clamp(1.15rem, 1.65vw, 1.55rem); font-weight: 750; line-height: 1.25; }
.answer-instruction { margin: 6px 0 clamp(10px, 1.6vh, 16px); color: var(--muted); font-size: clamp(0.82rem, 1vw, 0.98rem); }
.option-list { display: grid; gap: clamp(8px, 1.15vh, 12px); }
.option-card { display: flex; min-width: 0; align-items: stretch; gap: 8px; }
.option-label {
  display: grid;
  min-width: 0;
  min-height: 56px;
  padding: clamp(8px, 1.2vh, 13px) clamp(12px, 1.35vw, 18px);
  flex: 1;
  grid-template-columns: 32px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 12px;
  border: 2px solid #c6dbe9;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition), transform var(--transition-fast);
}
.option-label:has(input:checked) { border-color: var(--blue-dark); background: var(--ice-strong); box-shadow: 0 0 0 2px rgba(21, 151, 229, 0.08); }
.option-label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.option-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.option-marker {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  color: var(--navy-soft);
  background: #edf6fc;
  font-size: 0.84rem;
  font-weight: 800;
}
.option-content { display: flex; min-width: 0; align-items: center; gap: 12px; }
.option-text { font-size: 1.125rem; font-size: clamp(1.125rem, min(1.65vw, 2.8dvh), 1.4rem); font-weight: 650; line-height: 1.4; }
.option-image { display: block; width: 100%; min-height: 0; max-height: 96px; object-fit: contain; }
.option-check { color: var(--blue-dark); font-size: 1.15rem; font-weight: 900; opacity: 0; }
.option-label:has(input:checked) .option-marker { color: #fff; background: var(--blue-dark); }
.option-label:has(input:checked) .option-check { opacity: 1; }
.option-label:has(input:disabled) { cursor: default; opacity: 0.74; }
.option-card > .audio-control .audio-button { min-width: 52px; width: 52px; padding: 0; }
.option-card > .audio-control .audio-button span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.option-list.has-images { grid-template-columns: 1fr; gap: clamp(6px, 0.9vh, 10px); }
.option-list.has-images .option-card { min-width: 0; }
.option-list.has-images .option-label {
  min-height: clamp(84px, calc((100dvh - 440px) / 3), 132px);
  padding: clamp(6px, 0.8vh, 10px) 12px;
  grid-template-columns: 30px minmax(0, 1fr) 20px;
  align-items: center;
}
.option-list.has-images .option-marker { width: 30px; height: 30px; }
.option-list.has-images .option-content { height: 100%; flex-direction: row; justify-content: flex-start; }
.option-list.has-images .option-image {
  width: clamp(96px, 10vw, 142px);
  max-width: 100%;
  max-height: clamp(72px, calc((100dvh - 456px) / 3), 108px);
  flex: 0 1 auto;
}
.option-list.has-images .option-text:empty { display: none; }
.assessment-layout[data-template="listening-picture"] .question-card .section-label { margin-bottom: 4px; }
.assessment-layout[data-template="listening-picture"] .answer-instruction { margin: 2px 0 5px; font-size: 0.82rem; line-height: 1.2; }
.assessment-layout[data-template="listening-picture"] .answer-feedback { height: calc(2.4em + 8px); min-height: calc(2.4em + 8px); padding-top: 4px; }
.assessment-layout[data-template="listening-picture"] .answer-actions { margin-top: 4px; }
.answer-feedback { height: calc(2.5em + 8px); min-height: calc(2.5em + 8px); margin-top: auto; padding-top: 4px; }
.answer-error, .save-status { min-height: 0; margin: 0; font-size: 0.88rem; line-height: 1.25; }
.answer-error:empty, .save-status:empty { display: none; }
.save-status { color: var(--muted); font-weight: 700; }
.save-status.is-warning { padding: 4px 8px; border-radius: 8px; color: var(--warning); background: var(--warning-soft); }
.answer-actions { display: flex; align-items: center; margin-top: clamp(6px, 1vh, 10px); gap: 12px; }
.answer-actions > button { height: 54px; min-height: 54px; padding-block: 0; }
.answer-actions .primary-button { display: flex; min-height: 54px; max-width: none; align-items: center; justify-content: center; gap: 12px; }
.answer-actions .secondary-button { width: 100%; min-height: 54px; }
.mobile-step-button { display: none; }

.site-footer { position: relative; display: flex; align-items: baseline; justify-content: space-between; min-height: 70px; padding: 22px max(var(--page-gutter), env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(var(--page-gutter), env(safe-area-inset-left)); gap: 24px; color: #718699; background: var(--ice); font-size: 1rem; line-height: 24px; }
.site-footer::before { position: absolute; top: 0; right: clamp(30px, 3.55vw, 56px); left: clamp(30px, 3.55vw, 56px); height: 1px; background: #8dcdf5; content: ""; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--blue); font-size: 1rem; text-decoration: none; }
.site-footer a { min-height: 44px; margin-block: -10px; padding-block: 10px; }

.privacy-shell { display: flex; width: 100%; min-height: calc(100vh - 178px); min-height: calc(100dvh - 178px); flex: 1; padding: clamp(32px, 6vw, 84px) var(--page-gutter); background: var(--ice); }
.privacy-card { width: min(860px, 100%); margin: 0 auto; padding: clamp(38px, 6vw, 68px); align-self: flex-start; border: 1px solid #c4ddec; border-radius: var(--radius-card); background: #fff; box-shadow: var(--shadow); }
.privacy-card h1 { margin: 0 0 20px; font-size: clamp(2.4rem, 5vw, 4rem); }
.privacy-card p { margin: 0 0 32px; color: var(--muted); font-size: 1.08rem; }
.privacy-card .privacy-intro { max-width: 66ch; color: var(--navy-soft); font-size: 1.16rem; }
.privacy-sections { display: grid; margin: 8px 0 32px; gap: 0; }
.privacy-sections section { padding: 24px 0; border-top: 1px solid #d5e6f1; }
.privacy-sections h2 { margin: 0 0 8px; color: var(--navy); font-size: 1.28rem; letter-spacing: -0.01em; }
.privacy-sections p { margin: 0; font-size: 1rem; }
.privacy-policy-link { display: inline-flex; min-height: 44px; margin-top: 8px; align-items: center; color: var(--blue); font-weight: 700; text-underline-offset: 3px; }
.privacy-card .secondary-button { display: inline-flex; align-items: center; text-decoration: none; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

#main-content > section:not([hidden]),
.privacy-card {
  animation: page-enter var(--transition-page) both;
}

@media (hover: hover) and (pointer: fine) {
  .field-group input:hover { border-color: var(--line-strong); background: #fbfdff; }
  .primary-button:hover:not(:disabled) { border-color: var(--blue-dark); background: var(--blue-dark); box-shadow: 0 10px 24px rgba(0, 78, 209, 0.22); transform: translateY(-1px); }
  .secondary-button:hover:not(:disabled) { border-color: var(--blue-dark); background: #f3faff; box-shadow: 0 6px 14px rgba(24, 77, 116, 0.09); transform: translateY(-1px); }
  .text-button:hover:not(:disabled), .site-footer a:hover, .privacy-policy-link:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
  .option-label:hover { border-color: var(--line-strong); background: #f9fdff; box-shadow: 0 5px 14px rgba(24, 77, 116, 0.07); transform: translateY(-1px); }
  .audio-button:hover { border-color: var(--blue-dark); background: #dff1ff; box-shadow: 0 5px 14px rgba(24, 77, 116, 0.08); transform: translateY(-1px); }
}

@media (min-width: 1316px) {
  .book-hero {
    -webkit-mask-image:
      linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%),
      linear-gradient(to right, transparent 0, #000 7%, #000 94.5%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%),
      linear-gradient(to right, transparent 0, #000 7%, #000 94.5%, transparent 100%);
    mask-composite: intersect;
  }
  @container (min-width: 76.251rem) {
    .book-hero { overflow: visible; -webkit-mask-image: none; mask-image: none; }
    .book-hero > .hero-static,
    .book-hero > .hero-scene {
      overflow: hidden;
      -webkit-mask-image:
        linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%),
        linear-gradient(to right, transparent 0, #000 7%, #000 94.5%, transparent 100%);
      -webkit-mask-composite: source-in;
      mask-image:
        linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%),
        linear-gradient(to right, transparent 0, #000 7%, #000 94.5%, transparent 100%);
      mask-composite: intersect;
    }
    .hero-cloud-extension {
      position: absolute;
      z-index: 0;
      top: 0;
      left: -29.378531%;
      display: block;
      width: 36.610169%;
      height: 100%;
      background: url("/assets/hero-scene/cloud-left-continuation-v1.svg") left top / 100% 100% no-repeat;
      -webkit-mask-image:
        linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%),
        linear-gradient(to right, transparent 0, #000 28%, #000 100%);
      -webkit-mask-composite: source-in;
      mask-image:
        linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%),
        linear-gradient(to right, transparent 0, #000 28%, #000 100%);
      mask-composite: intersect;
    }
  }
}

@container (max-width: 900px) {
  .login-layout { min-height: auto; grid-template-columns: 1fr; gap: clamp(28px, 4vw, 42px); }
  .welcome-panel { display: grid; min-height: 0; grid-template-columns: minmax(0, 1fr) minmax(240px, 0.78fr); align-items: center; padding: 4px 12px; gap: clamp(20px, 4vw, 44px); }
  .welcome-copy-block h1 { font-size: clamp(3rem, 7vw, 5rem); }
  .book-hero { position: relative; inset: auto; width: 100%; max-width: 620px; margin: 0 auto; }
  .login-card { width: min(100%, 630px); min-height: 0; }
}

@container (max-width: 620px) {
  .welcome-panel { display: flex; padding: 0 10px; }
  .welcome-copy-block h1 { font-size: clamp(2.35rem, 12cqw, 3.25rem); }
  .welcome-copy-block p { font-size: 1.08rem; }
  .book-hero { width: min(390px, 100%); margin: 18px auto 0; }
}

@media (max-width: 1315px) {
  .site-header { min-height: 92px; padding-inline: 24px; }
  .booknook-logo { width: 240px; }
  .lexile-brand { width: 190px; gap: 8px; }
  .lexile-mark { width: 60px; height: 62px; }
  .lexile-name { font-size: 0.9rem; }
}

/* Older WebViews use equivalent viewport bands without overriding container queries. */
/* 较早的 WebView 使用对应视口区间，不覆盖容器查询。 */
@supports not ((container-type: inline-size) and selector(:has(*))) {
  @media (max-width: 959px) {
    .login-layout { min-height: 0; grid-template-columns: 1fr; gap: 34px; }
    .welcome-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 0.75fr); align-items: center; padding: 4px 12px; gap: 24px; }
    .welcome-copy-block h1 { font-size: clamp(2.6rem, 7vw, 4rem); }
    .book-hero { position: relative; inset: auto; width: 100%; margin: 0; }
    .login-card { width: min(100%, 630px); min-height: 0; }
  }
  @media (min-width: 960px) and (max-width: 1315px) {
    .login-layout { min-height: 0; grid-template-columns: minmax(0, 1.12fr) minmax(350px, 1fr); align-items: start; gap: 24px; }
    .welcome-panel { min-height: 0; padding: 12px 0 0; gap: 26px; }
    .welcome-copy-block h1 { max-width: 12ch; margin-bottom: 16px; font-size: clamp(2.5rem, 5.2vw, 4rem); line-height: 1; }
    html[lang="es"] .welcome-copy-block h1 { max-width: 14ch; font-size: clamp(2rem, 4.2vw, 3rem); }
    .welcome-copy-block p { font-size: clamp(1.1rem, 1.9vw, 1.5rem); line-height: 1.4; }
    .book-hero { position: relative; inset: auto; width: 100%; max-width: none; margin: 0; }
    .login-card { width: 100%; min-height: 0; padding: 24px; }
    .login-book-icon { width: 64px; height: 61px; margin: 0 auto 10px; background-position: -830.562px -148.135px; background-size: 1140.494px 713.348px; }
    .form-heading h2 { font-size: clamp(1.9rem, 3.2vw, 2.5rem); line-height: 1.12; }
    .field-group { margin-top: 30px; }
    .field-group label { font-size: 1.1rem; }
    .field-group input { min-height: 54px; padding: 12px 16px; font-size: 1.15rem; }
    .field-feedback { min-block-size: calc(1.5em + 18px); margin-top: 8px; padding-bottom: 4px; font-size: 0.94rem; }
    .login-card .primary-button { min-height: 54px; font-size: 1.25rem; }
    .teacher-help { margin: 20px 0; gap: 10px; font-size: 0.9rem; }
    .login-tip { min-height: 64px; padding: 12px 14px; gap: 12px; font-size: 1rem; }
    .tip-icon { width: 36px; height: 40px; flex-basis: 36px; background-position: -732.24px -555.84px; background-size: 1141.92px 714.24px; }
  }
  @media (max-height: 720px) and (min-width: 1316px) {
    .login-layout { min-height: 650px; }
    .welcome-panel { padding-top: 0; }
    .login-card { min-height: 0; padding-top: 30px; }
    .field-group { margin-top: 48px; }
  }
}

@media (max-width: 700px) {
  .assessment-active { height: auto; min-height: 100vh; min-height: 100dvh; overflow: auto; }
  .assessment-active .assessment-workspace { overflow: visible; grid-template-columns: minmax(0, 1fr); }
  .assessment-layout[data-mobile-step="stimulus"] .question-card,
  .assessment-layout[data-mobile-step="answers"] .stimulus-card { display: none; }
  .mobile-step-button { display: inline-flex; width: 100%; min-height: 52px; margin-top: 16px; align-items: center; justify-content: center; }
  .question-card .mobile-step-button { width: auto; flex: 0 0 auto; margin-top: 0; }
}

@media (max-width: 620px) {
  .site-header { min-height: 78px; padding: 10px 16px; gap: 10px; }
  .brand { min-width: 0; }
  .booknook-logo { width: clamp(102px, 39vw, 176px); }
  .header-meta { gap: 6px; }
  .lexile-brand { width: clamp(86px, 32vw, 132px); gap: 4px; }
  .lexile-mark { width: clamp(32px, 12vw, 48px); height: auto; aspect-ratio: 1; }
  .lexile-name { font-size: clamp(0.42rem, 1.75vw, 0.64rem); line-height: 1.06; }
  .page-shell { min-height: calc(100vh - 142px); min-height: calc(100dvh - 142px); padding: 24px var(--page-gutter); }
  .welcome-panel { display: flex; padding: 0 10px; }
  .welcome-copy-block h1 { font-size: clamp(2.35rem, 12vw, 3.25rem); }
  html[lang="es"] .welcome-copy-block h1 { font-size: clamp(2.15rem, 10.5vw, 3rem); }
  .welcome-copy-block p { font-size: 1.08rem; }
  .book-hero { width: min(390px, 100%); height: auto; margin: 18px auto 0; aspect-ratio: 885 / 459; }
  .login-card, .state-card { padding: clamp(24px, 7vw, 32px) clamp(16px, 5.5vw, 22px); border-radius: 20px; }
  .login-card { min-height: 0; }
  .login-book-icon { width: 59px; height: 56px; background-position: -761px -136px; background-size: 1045px 654px; }
  .form-heading h2 { font-size: 2.25rem; }
  .field-group { margin: 38px 0 0; }
  .field-group label { font-size: 1.12rem; }
  .field-group input { min-height: 60px; padding-inline: 16px; font-size: 1.12rem; }
  .field-feedback { min-block-size: calc(1.5em + 26px); font-size: 1rem; }
  .login-card .primary-button { min-height: 60px; font-size: 1.25rem; }
  .assessment-active .site-header { min-height: 62px; padding-block: 7px; }
  .assessment-active .page-shell { min-height: 0; padding: 8px 12px; }
  .assessment-toolbar { min-height: 28px; align-items: center; flex-direction: row; gap: 10px; }
  .assessment-workspace { overflow: visible; }
  .stimulus-card, .question-card { padding: 18px 16px; border-radius: 20px; }
  .stimulus-card { min-height: 240px; }
  .option-list.has-images .option-label { min-height: 112px; }
  .answer-actions { align-items: stretch; flex-direction: column; }
  .answer-actions .primary-button, .answer-actions .secondary-button { width: 100%; max-width: none; }
  .teacher-help { margin: 24px 0; gap: 10px; font-size: 0.88rem; }
  .teacher-help p { max-width: 18ch; }
  .login-tip { height: auto; min-height: 72px; padding: 12px 14px; gap: 10px; text-align: left; }
  .tip-icon { transform: scale(0.82); transform-origin: center; }
  .site-footer { min-height: 64px; padding: 18px max(16px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); gap: 12px; font-size: 0.8rem; line-height: 1.35; }
  .site-footer::before { right: max(16px, env(safe-area-inset-right)); left: max(16px, env(safe-area-inset-left)); }
  .site-footer a { font-size: inherit; }
  .privacy-shell { min-height: calc(100vh - 142px); min-height: calc(100dvh - 142px); padding: 28px var(--page-gutter); }
  .privacy-card { padding: 32px 22px; border-radius: 20px; }
}

@media (max-height: 760px) and (min-width: 621px) {
  .assessment-active .site-header { min-height: 62px; }
  .assessment-active .booknook-logo { width: 178px; }
  .assessment-active .lexile-brand { width: 138px; }
  .assessment-active .lexile-mark { width: 46px; height: 46px; }
  .assessment-active .page-shell { padding-block: 8px; }
  .assessment-layout { gap: 6px; }
  .assessment-toolbar { min-height: 28px; }
  .stimulus-card, .question-card { padding: 16px 18px; }
  .stimulus-card .section-label, .question-card .section-label { margin-bottom: 7px; }
  #main-audio .audio-control { top: calc(-1.155rem - 7px); }
  .answer-instruction { margin-block: 4px 8px; }
  .option-list { gap: 7px; }
  .option-label { min-height: 50px; padding-block: 7px; }
  .answer-actions .primary-button, .answer-actions .secondary-button { height: 54px; min-height: 54px; }
}

@media (max-height: 700px) and (min-width: 701px) {
  .passage-text { font-size: clamp(1rem, min(1.7vw, 2.6dvh), 1.5rem); }
}

@media (max-width: 380px) {
  .site-header { min-height: 72px; padding-inline: 12px; }
  .booknook-logo { width: clamp(96px, 38vw, 136px); }
  .lexile-brand { width: clamp(82px, 31vw, 106px); }
  .lexile-name { font-size: clamp(0.39rem, 1.7vw, 0.51rem); }
  .page-shell { padding-top: 20px; }
  .welcome-panel { padding-inline: 0; }
  .welcome-copy-block h1 { font-size: clamp(2.15rem, 11.8vw, 2.8rem); }
  .welcome-copy-block p { font-size: 1rem; }
  .form-heading h2 { font-size: clamp(1.9rem, 10vw, 2.25rem); }
  .teacher-rule { min-width: 16px; }
  .teacher-help p { font-size: 0.82rem; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 2px; }
  .site-footer a { margin-block: 0 -10px; }
  .privacy-card { padding-inline: 18px; }
}

/* Size the entry composition from both available dimensions, without scaling hit targets. */
/* 按可用宽高协调入口页比例，同时保留触控区域的最小尺寸。 */
@supports (container-type: inline-size) and selector(:has(*)) {
@media (min-width: 950px) {
  body:has(#login-view:not([hidden])) {
    --entry-header-height: clamp(72px, 10dvh, 108px);
    --entry-footer-height: calc(60px + max(0px, env(safe-area-inset-bottom) - 18px));
    --entry-padding: clamp(12px, 2.4dvh, 38px);
  }
  body:has(#login-view:not([hidden])) .site-header {
    min-height: var(--entry-header-height);
    flex: 0 0 var(--entry-header-height);
  }
  body:has(#login-view:not([hidden])) .booknook-logo { width: min(374px, 23.6vw, calc((var(--entry-header-height) - 20px) * 4.32)); }
  body:has(#login-view:not([hidden])) .lexile-mark { width: min(84px, calc(var(--entry-header-height) - 20px)); height: min(84px, calc(var(--entry-header-height) - 20px)); }
  body:has(#login-view:not([hidden])) .lexile-name { font-size: clamp(0.9rem, 2.2dvh, 1.375rem); }
  .page-shell:has(#login-view:not([hidden])) { min-height: 0; padding-block: var(--entry-padding); align-items: center; }
  body:has(#login-view:not([hidden])) .site-footer { min-height: var(--entry-footer-height); padding-block: 18px max(18px, env(safe-area-inset-bottom)); font-size: 0.875rem; }
  body:has(#login-view:not([hidden])) .site-footer a { font-size: inherit; }
}

@container (width > 900px) {
  .login-layout {
    --entry-unit: clamp(0.64px, min(calc(100cqw / 1474), calc((100dvh - var(--entry-header-height) - var(--entry-footer-height) - 2 * var(--entry-padding)) / 760)), 1px);
    width: min(100%, calc(1474 * var(--entry-unit)));
    min-height: calc(730 * var(--entry-unit));
    grid-template-columns: minmax(0, 1.238fr) minmax(0, 1fr);
    align-items: start;
    gap: calc(50 * var(--entry-unit));
  }
  .welcome-panel { min-height: calc(730 * var(--entry-unit)); padding: calc(23 * var(--entry-unit)) 0 calc(15 * var(--entry-unit)) calc(37 * var(--entry-unit)); gap: 0; }
  .welcome-copy-block h1 { margin-bottom: calc(18 * var(--entry-unit)); font-size: calc(90 * var(--entry-unit)); line-height: 0.98; }
  html[lang="es"] .welcome-copy-block h1 { font-size: calc(73.6 * var(--entry-unit)); }
  .welcome-copy-block p { font-size: max(1rem, calc(32 * var(--entry-unit))); line-height: 1.5; }
  .book-hero { position: absolute; top: calc(262 * var(--entry-unit)); left: calc(-30 * var(--entry-unit)); width: calc(100% + 70 * var(--entry-unit)); max-width: none; margin: 0; }
  .login-card { width: 100%; min-height: calc(700 * var(--entry-unit)); padding: calc(44 * var(--entry-unit)) calc(44 * var(--entry-unit)) calc(30 * var(--entry-unit)); border-radius: calc(26 * var(--entry-unit)); }
  .login-book-icon { width: calc(89 * var(--entry-unit)); height: calc(85 * var(--entry-unit)); margin: calc(-4 * var(--entry-unit)) auto calc(15 * var(--entry-unit)); background-position: calc(-1155 * var(--entry-unit)) calc(-206 * var(--entry-unit)); background-size: calc(1586 * var(--entry-unit)) calc(992 * var(--entry-unit)); }
  .form-heading h2 { font-size: calc(46.4 * var(--entry-unit)); line-height: 1.1; }
  .field-group { margin-top: calc(66 * var(--entry-unit)); }
  .field-group label { margin-bottom: calc(7 * var(--entry-unit)); font-size: max(1rem, calc(22 * var(--entry-unit))); }
  .field-group input { min-height: max(44px, calc(68 * var(--entry-unit))); padding: calc(15 * var(--entry-unit)) calc(20 * var(--entry-unit)); font-size: max(1rem, calc(23.2 * var(--entry-unit))); }
  .field-feedback { min-block-size: calc(1.5em + 24 * var(--entry-unit)); margin-top: calc(9 * var(--entry-unit)); padding-bottom: calc(8 * var(--entry-unit)); font-size: max(0.875rem, calc(18.88 * var(--entry-unit))); }
  .login-card .primary-button { min-height: max(44px, calc(68 * var(--entry-unit))); padding: calc(12 * var(--entry-unit)) calc(22 * var(--entry-unit)); font-size: max(1rem, calc(25.6 * var(--entry-unit))); }
  .teacher-help { margin: calc(28 * var(--entry-unit)) 0 calc(31 * var(--entry-unit)); gap: calc(18 * var(--entry-unit)); font-size: max(0.875rem, calc(17.6 * var(--entry-unit))); }
  .login-tip { min-height: calc(77 * var(--entry-unit)); padding: calc(15 * var(--entry-unit)) calc(20 * var(--entry-unit)); gap: calc(18 * var(--entry-unit)); font-size: max(0.875rem, calc(18 * var(--entry-unit))); }
  .tip-icon { width: calc(50 * var(--entry-unit)); height: calc(56 * var(--entry-unit)); flex-basis: calc(50 * var(--entry-unit)); background-position: calc(-1017 * var(--entry-unit)) calc(-772 * var(--entry-unit)); background-size: calc(1586 * var(--entry-unit)) calc(992 * var(--entry-unit)); }
}

}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  #main-content > section:not([hidden]),
  .privacy-card,
  .primary-button,
  .secondary-button,
  .text-button,
  .option-label { transform: none !important; }
}

@media (forced-colors: active) {
  .option-label:has(input:checked) { outline: 3px solid Highlight; }
}
