:root {
  --paper: #fffaf0;
  --paper-bright: #fffdf6;
  --ink: #12211c;
  --muted: #66746f;
  --green: #0d4b37;
  --green-deep: #073225;
  --red: #c2392d;
  --gold: #efbd37;
  --black: #151515;
  --line: rgba(20, 34, 30, 0.13);
  --glass: rgba(255, 255, 255, 0.36);
  --border: rgba(255, 255, 255, 0.66);
  --shadow: 0 26px 70px rgba(13, 39, 31, 0.18);
  --radius: 8px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background: #efe6d3;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(220px, 0.5fr) minmax(560px, 1.2fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 10px 36px;
  background: rgba(255, 253, 246, 0.86);
  border-bottom: 1px solid rgba(20, 34, 30, 0.12);
  box-shadow: 0 10px 30px rgba(18, 34, 28, 0.08);
  backdrop-filter: blur(18px) saturate(1.2);
}

.site-header.scrolled {
  background: rgba(255, 253, 246, 0.94);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #fff;
  background: linear-gradient(145deg, var(--green), var(--green-deep));
  border: 1px solid rgba(239, 189, 55, 0.66);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(13, 75, 55, 0.22);
}

.brand-mark svg {
  width: 37px;
  height: 37px;
}

.mark-shield {
  fill: var(--green);
  stroke: #f7f0d9;
  stroke-width: 2.6;
}

.mark-book-left,
.mark-book-right {
  fill: #f7f0d9;
  stroke: rgba(255, 255, 255, 0.74);
  stroke-width: 1.3;
}

.mark-line {
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-width: 2;
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-copy strong {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0;
}

.brand-copy small {
  color: #2f3d38;
  font-size: 12px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.nav-links button,
.practice-card,
.menu-toggle {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-links button {
  position: relative;
  min-height: 42px;
  padding: 0 12px;
  color: #25352f;
  background: transparent;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 840;
  white-space: nowrap;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.nav-links button:hover,
.nav-links button.active {
  color: var(--green);
  background: rgba(13, 75, 55, 0.08);
  transform: translateY(-1px);
}

.nav-links button::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 0;
  height: 3px;
  opacity: 0;
  background: var(--green);
  border-radius: 999px 999px 0 0;
}

.nav-links button.active::after {
  opacity: 1;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(20, 34, 30, 0.16);
  border-radius: var(--radius);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--green);
}

.auth-widget {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.auth-login-button,
.auth-user-card button,
.auth-submit,
.auth-dialog-close {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 850;
  -webkit-tap-highlight-color: transparent;
}

.auth-login-button {
  min-height: 40px;
  padding: 0 15px;
  color: #fffdf6;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(13, 75, 55, 0.18);
  white-space: nowrap;
}

.auth-user-card {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 232px;
  min-height: 44px;
  padding: 5px 6px 5px 12px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(13, 75, 55, 0.16);
  border-radius: var(--radius);
  box-shadow: 0 12px 26px rgba(13, 39, 31, 0.08);
}

.auth-user-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.auth-user-copy strong,
.auth-user-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-copy strong {
  color: var(--green-deep);
  font-size: 14px;
}

.auth-user-copy span {
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
}

.auth-user-card button {
  flex: none;
  min-height: 32px;
  padding: 0 9px;
  color: var(--green);
  background: rgba(13, 75, 55, 0.09);
}

body.auth-open {
  overflow: hidden;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 33, 28, 0.5);
  backdrop-filter: blur(12px);
}

.auth-dialog {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(420px, calc(100vw - 32px));
  padding: 26px;
  color: var(--ink);
  background: var(--paper-bright);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(5, 24, 18, 0.28);
}

.auth-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 32px;
  padding: 0 10px;
  color: var(--green);
  background: rgba(13, 75, 55, 0.08);
  font-size: 13px;
}

.auth-dialog-copy {
  display: grid;
  gap: 4px;
  padding-right: 58px;
}

.auth-dialog-copy p {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-dialog-copy h2 {
  margin: 0;
  color: var(--green-deep);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 30px;
  line-height: 1.12;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: #384741;
  font-size: 13px;
  font-weight: 850;
}

.auth-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(20, 34, 30, 0.18);
  border-radius: var(--radius);
  font: inherit;
}

.auth-form input:focus {
  border-color: rgba(13, 75, 55, 0.54);
  box-shadow: 0 0 0 3px rgba(13, 75, 55, 0.12);
  outline: 0;
}

.auth-submit {
  min-height: 46px;
  color: #fffdf6;
  background: var(--green);
  box-shadow: 0 14px 30px rgba(13, 75, 55, 0.2);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.auth-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-status[data-tone="error"] {
  color: var(--red);
  font-weight: 800;
}

.home-shell {
  min-height: calc(100svh - 76px);
}

[hidden] {
  display: none !important;
}

.hero {
  position: relative;
  min-height: calc(100svh - 76px);
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: #d7c8aa;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.04);
  filter: saturate(1.04) contrast(1.02);
  animation: campusDrift 24s ease-in-out infinite alternate;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 250, 240, 0.94) 0%, rgba(255, 250, 240, 0.76) 44%, rgba(255, 250, 240, 0.18) 100%),
    linear-gradient(0deg, rgba(13, 39, 31, 0.35) 0%, rgba(13, 39, 31, 0.05) 42%, rgba(255, 250, 240, 0.76) 100%);
}

.flag-sweep {
  position: absolute;
  left: -18px;
  top: -18px;
  z-index: 2;
  display: grid;
  width: 210px;
  height: 122px;
  overflow: hidden;
  border-radius: 0 0 105px 0;
  transform: rotate(-12deg);
  box-shadow: 0 14px 32px rgba(15, 24, 22, 0.16);
}

.flag-sweep span:nth-child(1) {
  background: var(--black);
}

.flag-sweep span:nth-child(2) {
  background: var(--red);
}

.flag-sweep span:nth-child(3) {
  background: var(--gold);
}

.hero-content {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(360px, 0.86fr) minmax(560px, 1.14fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  width: min(1240px, calc(100vw - 64px));
  min-height: calc(100svh - 76px);
  margin: 0 auto;
  padding: 72px 0 56px;
}

.hero-copy {
  max-width: 560px;
}

.hero-copy h1 {
  margin: 0;
  color: var(--green);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(48px, 5.2vw, 76px);
  line-height: 1.04;
  letter-spacing: 0;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.38);
}

.hero-copy p {
  max-width: 520px;
  margin: 24px 0 0;
  color: #20342d;
  font-size: 20px;
  line-height: 1.72;
  font-weight: 760;
}

.practice-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.practice-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  grid-template-areas:
    "icon title"
    "icon copy";
  gap: 6px 14px;
  min-height: 118px;
  padding: 20px;
  overflow: hidden;
  text-align: left;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.52), rgba(255, 250, 240, 0.24)),
    var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 18px 42px rgba(17, 31, 27, 0.13);
  backdrop-filter: blur(24px) saturate(1.16);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.practice-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  opacity: 0;
  background: linear-gradient(90deg, var(--black), var(--red), var(--gold));
  transition: opacity 180ms ease;
}

.practice-card:hover,
.practice-card.active {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 250, 240, 0.34)),
    rgba(255, 255, 255, 0.42);
  border-color: rgba(239, 189, 55, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 24px 54px rgba(17, 31, 27, 0.18);
  transform: translateY(-3px);
}

.practice-card.active::after {
  opacity: 1;
}

.practice-card.featured {
  border-color: rgba(13, 75, 55, 0.22);
}

.practice-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #fff;
  background: linear-gradient(145deg, var(--green), #0a6044);
  border-radius: var(--radius);
  box-shadow: 0 12px 24px rgba(13, 75, 55, 0.22);
  font-size: 16px;
  font-weight: 950;
}

.practice-card strong {
  grid-area: title;
  align-self: end;
  color: var(--green);
  font-size: 22px;
  line-height: 1.2;
}

.practice-card small {
  grid-area: copy;
  color: #40534d;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 720;
}

.vocab-shell,
.reading-shell,
.listening-shell {
  min-height: calc(100svh - 76px);
  background:
    radial-gradient(circle at 8% 0%, rgba(239, 189, 55, 0.2), transparent 28%),
    linear-gradient(135deg, #fffdf6 0%, #f1e5ce 48%, #dfceb2 100%);
}

.vocab-page,
.reading-page,
.listening-page {
  width: min(1280px, calc(100vw - 64px));
  min-height: calc(100svh - 76px);
  margin: 0 auto;
  padding: 28px 0 34px;
}

.vocab-header,
.reading-header,
.listening-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.vocab-title,
.reading-title,
.listening-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.vocab-mark,
.reading-mark,
.listening-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 54px;
  height: 54px;
  color: #fff;
  background: linear-gradient(145deg, var(--green), #0a6044);
  border: 1px solid rgba(239, 189, 55, 0.64);
  border-radius: var(--radius);
  box-shadow: 0 15px 30px rgba(13, 75, 55, 0.2);
  font-size: 17px;
  font-weight: 950;
}

.vocab-title h1,
.reading-title h1,
.listening-title h1 {
  margin: 0;
  color: var(--green);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

.vocab-title p,
.reading-title p,
.listening-title p {
  margin: 4px 0 0;
  color: #41524d;
  font-size: 15px;
  font-weight: 780;
}

.reading-console,
.reading-score,
.reading-exam-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 250, 240, 0.44)),
    rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 22px 58px rgba(17, 31, 27, 0.14);
  backdrop-filter: blur(22px) saturate(1.15);
}

.reading-console {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 0.72fr) minmax(170px, auto);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 22px;
  overflow: hidden;
}

.reading-console::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--black), var(--red), var(--gold));
}

.reading-console-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.reading-console-main h2 {
  margin: 0;
  color: var(--green);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(26px, 2.4vw, 38px);
  line-height: 1.12;
  letter-spacing: 0;
}

.reading-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  max-width: 640px;
}

.reading-settings label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #31453e;
  font-size: 13px;
  font-weight: 850;
}

.reading-settings select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.86);
  border: 1px solid rgba(20, 34, 30, 0.16);
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  font-weight: 760;
}

.reading-settings select:focus-visible {
  outline: 3px solid rgba(239, 189, 55, 0.42);
  outline-offset: 2px;
}

.reading-brief {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.reading-brief div {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 92px;
  padding: 14px;
  background: rgba(13, 75, 55, 0.08);
  border: 1px solid rgba(13, 75, 55, 0.12);
  border-radius: var(--radius);
}

.reading-brief strong {
  color: var(--green);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 33px;
  line-height: 1;
}

.reading-brief span {
  color: #31453e;
  font-size: 12px;
  font-weight: 900;
}

.reading-controls {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
}

.reading-controls .pack-action,
.reading-controls .back-home {
  width: 100%;
  min-width: 160px;
}

.reading-controls button:disabled {
  cursor: not-allowed;
  filter: saturate(0.2);
  opacity: 0.54;
  transform: none;
}

.reading-progress {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 253, 246, 0.58);
  border: 1px solid rgba(20, 34, 30, 0.11);
  border-radius: var(--radius);
}

.reading-progress-track {
  height: 9px;
  overflow: hidden;
  background: rgba(13, 75, 55, 0.13);
  border-radius: 999px;
}

.reading-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: inherit;
  transition: width 420ms ease;
}

.reading-progress ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reading-progress li {
  position: relative;
  min-height: 30px;
  padding: 8px 10px 8px 28px;
  color: #52625d;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(20, 34, 30, 0.09);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 880;
}

.reading-progress li::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 9px;
  height: 9px;
  background: rgba(13, 75, 55, 0.24);
  border-radius: 999px;
  transform: translateY(-50%);
}

.reading-progress li.is-active {
  color: var(--green);
  background: rgba(13, 75, 55, 0.08);
  border-color: rgba(13, 75, 55, 0.2);
}

.reading-progress li.is-active::before {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(239, 189, 55, 0.2);
}

.reading-progress li.is-complete {
  color: #214338;
}

.reading-progress li.is-complete::before {
  background: var(--green);
}

.reading-status {
  grid-column: 1 / -1;
  min-height: 42px;
  margin: 0;
  padding: 12px 14px;
  color: #334840;
  background: rgba(13, 75, 55, 0.07);
  border: 1px solid rgba(13, 75, 55, 0.12);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.5;
}

.reading-status[data-tone="ok"] {
  color: #0b4b36;
  background: rgba(13, 75, 55, 0.1);
  border-color: rgba(13, 75, 55, 0.22);
}

.reading-status[data-tone="error"] {
  color: #8f241c;
  background: rgba(194, 57, 45, 0.09);
  border-color: rgba(194, 57, 45, 0.22);
}

.reading-exercise {
  display: grid;
  gap: 18px;
}

.reading-exam-card {
  position: relative;
  display: grid;
  gap: 18px;
  overflow: hidden;
  padding: 24px;
}

.reading-exam-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--black), var(--red), var(--gold));
}

.reading-overview {
  gap: 8px;
}

.reading-kicker {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reading-exam-card h2,
.score-summary h2 {
  margin: 0;
  color: var(--green);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(25px, 2.2vw, 34px);
  line-height: 1.18;
  letter-spacing: 0;
}

.reading-exam-card p,
.score-summary p {
  margin: 0;
  color: #344840;
  line-height: 1.72;
  font-weight: 710;
}

.reading-example {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 14px;
  color: #2e4a40;
  background: rgba(239, 189, 55, 0.13);
  border: 1px solid rgba(239, 189, 55, 0.28);
  border-radius: var(--radius);
  font-weight: 820;
}

.matching-texts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.matching-text {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  background: rgba(255, 253, 246, 0.74);
  border: 1px solid rgba(20, 34, 30, 0.12);
  border-radius: var(--radius);
}

.matching-text strong,
.reading-article h3 {
  color: var(--green);
  font-size: 17px;
  line-height: 1.36;
}

.matching-text p {
  font-size: 14px;
}

.reading-article {
  display: grid;
  gap: 13px;
  padding: 20px;
  background: rgba(255, 253, 246, 0.74);
  border: 1px solid rgba(20, 34, 30, 0.12);
  border-radius: var(--radius);
}

.reading-article h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 24px;
  letter-spacing: 0;
}

.reading-article p {
  color: #20342d;
  font-size: 16px;
  line-height: 1.78;
  font-weight: 650;
}

.reading-question-list {
  display: grid;
  gap: 12px;
}

.reading-question {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(20, 34, 30, 0.13);
  border-radius: var(--radius);
}

.reading-question.is-correct {
  border-color: rgba(13, 75, 55, 0.34);
  box-shadow: inset 4px 0 0 rgba(13, 75, 55, 0.75);
}

.reading-question.is-wrong {
  border-color: rgba(194, 57, 45, 0.28);
  box-shadow: inset 4px 0 0 rgba(194, 57, 45, 0.75);
}

.reading-question legend {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 0;
  color: #1d312a;
  font-weight: 820;
  line-height: 1.55;
}

.question-number {
  display: grid;
  place-items: center;
  width: 30px;
  min-height: 30px;
  color: #fffdf6;
  background: var(--green);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 950;
}

.question-prompt {
  min-width: 0;
}

.reading-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.reading-options label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  min-height: 42px;
  padding: 10px 11px;
  color: #23362f;
  background: rgba(255, 253, 246, 0.82);
  border: 1px solid rgba(20, 34, 30, 0.13);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 730;
  line-height: 1.45;
}

.reading-options input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--green);
}

.reading-options label:has(input:checked) {
  color: var(--green);
  background: rgba(13, 75, 55, 0.09);
  border-color: rgba(13, 75, 55, 0.34);
}

.question-feedback {
  display: grid;
  gap: 6px;
  padding: 12px 13px;
  background: rgba(255, 250, 240, 0.76);
  border: 1px solid rgba(20, 34, 30, 0.11);
  border-radius: var(--radius);
}

.question-feedback strong {
  color: var(--green);
}

.question-feedback p,
.question-feedback small {
  color: #3c514a;
  line-height: 1.65;
  font-weight: 710;
}

.question-feedback small {
  font-size: 12px;
}

.reading-score {
  margin-bottom: 16px;
  padding: 20px;
}

.score-summary {
  display: grid;
  gap: 10px;
}

.score-parts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.score-parts div {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: rgba(13, 75, 55, 0.08);
  border: 1px solid rgba(13, 75, 55, 0.13);
  border-radius: var(--radius);
}

.score-parts strong {
  color: var(--green);
  font-size: 13px;
}

.score-parts span {
  color: #20342d;
  font-size: 20px;
  font-weight: 950;
}

.listening-test-progress ol {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.listening-test-overview {
  gap: 14px;
}

.lt-audio-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.lt-audio-item {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  background: rgba(255, 253, 246, 0.78);
  border: 1px solid rgba(20, 34, 30, 0.12);
  border-radius: var(--radius);
}

.lt-audio-item strong {
  color: var(--green);
  font-size: 15px;
  line-height: 1.35;
}

.lt-audio-item span {
  color: #52625d;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

.lt-audio-item audio {
  width: 100%;
  min-height: 36px;
}

.lt-situation {
  padding: 12px 14px;
  background: rgba(13, 75, 55, 0.07);
  border: 1px solid rgba(13, 75, 55, 0.12);
  border-radius: var(--radius);
}

.lt-short-question input[type="text"] {
  width: min(480px, 100%);
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 253, 246, 0.9);
  border: 1px solid rgba(20, 34, 30, 0.16);
  border-radius: var(--radius);
  font: inherit;
  font-size: 15px;
  font-weight: 720;
}

.lt-short-question input[type="text"]:focus {
  border-color: rgba(13, 75, 55, 0.54);
  box-shadow: 0 0 0 3px rgba(13, 75, 55, 0.12);
  outline: 0;
}

.lt-transcripts {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.lt-transcripts details {
  overflow: hidden;
  background: rgba(255, 253, 246, 0.74);
  border: 1px solid rgba(20, 34, 30, 0.12);
  border-radius: var(--radius);
}

.lt-transcripts summary {
  min-height: 42px;
  padding: 12px 14px;
  color: var(--green);
  cursor: pointer;
  font-weight: 860;
}

.lt-transcripts pre {
  max-height: 340px;
  margin: 0;
  padding: 0 14px 14px;
  overflow: auto;
  color: #243a32;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.72;
  white-space: pre-wrap;
}

.vocab-library {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.vocab-pack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 310px;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 250, 240, 0.42)),
    rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 22px 58px rgba(17, 31, 27, 0.16);
  backdrop-filter: blur(22px) saturate(1.15);
}

.vocab-pack::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--black), var(--red), var(--gold));
}

.vocab-pack.available {
  min-height: 340px;
}

.vocab-pack.pending {
  opacity: 0.72;
}

.vocab-pack-main {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.pack-level {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #fff;
  background: linear-gradient(145deg, var(--green), #0a6044);
  border-radius: var(--radius);
  box-shadow: 0 14px 28px rgba(13, 75, 55, 0.22);
  font-size: 17px;
  font-weight: 950;
}

.vocab-pack h2 {
  margin: 0;
  color: var(--green);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: 0;
}

.vocab-pack p {
  margin: 10px 0 0;
  color: #3f504b;
  font-size: 15px;
  line-height: 1.72;
  font-weight: 720;
}

.pack-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.pack-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: #2e4a40;
  background: rgba(13, 75, 55, 0.08);
  border: 1px solid rgba(13, 75, 55, 0.12);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 820;
}

.pack-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  width: fit-content;
  padding: 0 18px;
  color: #fffdf6;
  background: linear-gradient(145deg, var(--green), var(--green-deep));
  border: 1px solid rgba(239, 189, 55, 0.62);
  border-radius: var(--radius);
  box-shadow: 0 14px 28px rgba(13, 75, 55, 0.18);
  cursor: pointer;
  font-size: 15px;
  font-weight: 880;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.pack-action:hover,
.pack-action:focus-visible {
  box-shadow: 0 18px 34px rgba(13, 75, 55, 0.24);
  outline: 0;
  transform: translateY(-1px);
}

.trainer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.back-home {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 16px;
  color: #fffdf6;
  background: linear-gradient(145deg, var(--green), var(--green-deep));
  border: 1px solid rgba(239, 189, 55, 0.62);
  border-radius: var(--radius);
  box-shadow: 0 14px 28px rgba(13, 75, 55, 0.18);
  cursor: pointer;
  font-size: 14px;
  font-weight: 850;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.back-home:hover {
  box-shadow: 0 18px 34px rgba(13, 75, 55, 0.24);
  transform: translateY(-1px);
}

.vocab-frame-shell,
.listening-frame-shell {
  position: relative;
  overflow: hidden;
  min-height: min(820px, calc(100svh - 172px));
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 250, 240, 0.46)),
    rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 28px 72px rgba(17, 31, 27, 0.2);
  backdrop-filter: blur(22px) saturate(1.15);
}

.vocab-frame-shell::before,
.listening-frame-shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 4px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--black), var(--red), var(--gold));
}

.vocab-frame-shell iframe,
.listening-frame-shell iframe {
  display: block;
  width: 100%;
  height: min(820px, calc(100svh - 172px));
  min-height: 660px;
  background: #fff;
  border: 0;
}

@keyframes campusDrift {
  from {
    transform: scale(1.04) translateX(0);
  }
  to {
    transform: scale(1.075) translateX(-1.4%);
  }
}

@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 10px 20px;
    gap: 12px;
  }

  .menu-toggle {
    display: block;
    justify-self: end;
    grid-column: 3;
  }

  .auth-widget {
    grid-column: 2;
    justify-self: end;
  }

  .nav-links {
    position: fixed;
    top: 84px;
    left: 18px;
    right: 18px;
    z-index: 50;
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    padding: 12px;
    background: rgba(255, 253, 246, 0.96);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: grid;
  }

  .nav-links button {
    background: rgba(13, 75, 55, 0.05);
  }

  .hero-content {
    grid-template-columns: 1fr;
    width: min(880px, calc(100vw - 40px));
    padding-top: 92px;
  }

  .hero-copy {
    max-width: 720px;
  }

  .vocab-page,
  .reading-page,
  .listening-page {
    width: min(920px, calc(100vw - 40px));
    padding-top: 24px;
  }

  .vocab-library {
    grid-template-columns: 1fr;
  }

  .vocab-pack,
  .vocab-pack.available {
    min-height: auto;
  }

  .reading-console {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .reading-controls {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .reading-controls .pack-action,
  .reading-controls .back-home {
    width: auto;
  }

  .matching-texts {
    grid-template-columns: 1fr;
  }

  .lt-audio-list {
    grid-template-columns: 1fr;
  }

  .vocab-frame-shell,
  .vocab-frame-shell iframe,
  .listening-frame-shell,
  .listening-frame-shell iframe {
    height: calc(100svh - 166px);
    min-height: 620px;
  }

}

@media (max-width: 680px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto 42px;
    min-height: 70px;
    padding: 8px 16px;
    gap: 8px;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 10px 24px rgba(13, 39, 31, 0.1);
  }

  .auth-widget {
    grid-column: 2;
  }

  .auth-login-button {
    min-height: 36px;
    padding: 0 11px;
    font-size: 13px;
  }

  .auth-user-card {
    max-width: 154px;
    min-height: 38px;
    gap: 5px;
    padding: 4px 5px 4px 8px;
  }

  .auth-user-copy {
    max-width: 86px;
  }

  .auth-user-copy strong {
    font-size: 12px;
  }

  .auth-user-copy span {
    font-size: 11px;
  }

  .auth-user-card button {
    min-height: 29px;
    padding: 0 7px;
    font-size: 12px;
  }

  .auth-dialog {
    padding: 22px;
  }

  .auth-dialog-copy h2 {
    font-size: 26px;
  }

  .menu-toggle span {
    flex: none;
    margin: 0;
  }

  .menu-toggle span + span {
    margin-top: 4px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-copy strong {
    font-size: 21px;
  }

  .brand-copy small {
    display: none;
  }

  .nav-links {
    top: 76px;
    grid-template-columns: 1fr;
  }

  .flag-sweep {
    width: 166px;
    height: 96px;
  }

  .hero {
    min-height: calc(100svh - 70px);
  }

  .hero-content {
    width: calc(100vw - 28px);
    min-height: calc(100svh - 70px);
    padding: 98px 0 22px;
  }

  .hero-copy h1 {
    font-size: 38px;
  }

  .hero-copy p {
    margin-top: 18px;
    font-size: 16px;
    line-height: 1.62;
  }

  .practice-board {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .practice-card {
    min-height: 106px;
    padding: 16px;
  }

  .practice-card strong {
    font-size: 20px;
  }

  .vocab-shell,
  .reading-shell,
  .listening-shell {
    min-height: calc(100svh - 70px);
  }

  .vocab-page,
  .reading-page,
  .listening-page {
    width: calc(100vw - 20px);
    min-height: calc(100svh - 70px);
    padding: 14px 0 18px;
  }

  .vocab-header,
  .reading-header,
  .listening-header {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
  }

  .vocab-title,
  .reading-title,
  .listening-title {
    gap: 10px;
  }

  .vocab-mark,
  .reading-mark,
  .listening-mark {
    width: 46px;
    height: 46px;
  }

  .vocab-title h1,
  .reading-title h1,
  .listening-title h1 {
    font-size: 30px;
  }

  .vocab-title p,
  .reading-title p,
  .listening-title p {
    font-size: 13px;
  }

  .reading-console {
    gap: 12px;
    margin-bottom: 12px;
    padding: 14px;
  }

  .reading-settings {
    grid-template-columns: 1fr;
  }

  .reading-brief {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .reading-brief div {
    min-height: 72px;
    padding: 11px;
  }

  .reading-brief strong {
    font-size: 27px;
  }

  .reading-brief span {
    font-size: 11px;
  }

  .reading-controls {
    flex-direction: row;
    width: 100%;
  }

  .reading-controls .pack-action,
  .reading-controls .back-home {
    flex: 1 1 150px;
    min-width: 0;
  }

  .reading-status {
    font-size: 13px;
  }

  .reading-progress {
    padding: 11px;
  }

  .reading-progress ol {
    grid-template-columns: 1fr 1fr;
  }

  .listening-test-progress ol {
    grid-template-columns: 1fr 1fr;
  }

  .reading-exercise {
    gap: 12px;
  }

  .reading-score,
  .reading-exam-card {
    padding: 16px;
  }

  .reading-exam-card {
    gap: 14px;
  }

  .reading-exam-card h2,
  .score-summary h2 {
    font-size: 24px;
  }

  .reading-article {
    padding: 14px;
  }

  .reading-article h3 {
    font-size: 21px;
  }

  .reading-article p {
    font-size: 15px;
    line-height: 1.7;
  }

  .reading-question {
    padding: 13px;
  }

  .reading-options {
    grid-template-columns: 1fr;
  }

  .score-parts {
    grid-template-columns: 1fr;
  }

  .vocab-library {
    gap: 12px;
  }

  .vocab-pack {
    padding: 18px;
  }

  .vocab-pack-main {
    gap: 12px;
  }

  .pack-level {
    width: 48px;
    height: 48px;
    font-size: 15px;
  }

  .vocab-pack h2 {
    font-size: 23px;
  }

  .vocab-pack p {
    font-size: 14px;
  }

  .pack-action {
    width: 100%;
  }

  .trainer-actions {
    width: 100%;
    justify-content: stretch;
  }

  .trainer-actions .back-home {
    flex: 1 1 140px;
  }

  .back-home {
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }

  .vocab-frame-shell,
  .listening-frame-shell {
    min-height: calc(100svh - 146px);
  }

  .vocab-frame-shell iframe,
  .listening-frame-shell iframe {
    height: calc(100svh - 146px);
    min-height: 640px;
  }

}

@media (max-width: 420px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .menu-toggle {
    grid-column: 2;
    grid-row: 1;
  }

  .auth-widget {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
  }

  .nav-links {
    top: 118px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
