:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5b6472;
  --paper: #f7f9f7;
  --surface: #ffffff;
  --line: #dce4df;
  --teal: #0f6a73;
  --teal-dark: #0a4d55;
  --leaf: #477a4d;
  --coral: #b84f2e;
  --gold: #c7952e;
  --blue-soft: #e7f0f4;
  --green-soft: #eaf3ec;
  --coral-soft: #fbebe4;
  --shadow: 0 18px 46px rgba(23, 32, 42, 0.11);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(247, 249, 247, 0.2), var(--paper) 430px),
    var(--paper);
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hero {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background: #d8e3df;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 29, 33, 0.82), rgba(9, 29, 33, 0.38) 48%, rgba(9, 29, 33, 0.04)),
    linear-gradient(180deg, rgba(9, 29, 33, 0.05), rgba(9, 29, 33, 0.2));
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1120px, calc(100% - 40px));
  min-height: 360px;
  margin: 0 auto;
  padding: 52px 0 74px;
  color: #fff;
  flex-direction: column;
  justify-content: flex-end;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.84rem;
  font-weight: 700;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: 3rem;
  line-height: 1.14;
  font-weight: 800;
}

.hero__stats {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.hero__stats div,
.score-pill,
.metric-panel {
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
}

.hero__stats div {
  min-width: 116px;
  padding: 12px 16px;
}

.hero__stats strong {
  display: block;
  font-size: 1.75rem;
  line-height: 1;
}

.hero__stats span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.86rem;
}

.view-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 249, 247, 0.92);
  backdrop-filter: blur(14px);
  scrollbar-width: none;
}

.view-tabs::-webkit-scrollbar {
  display: none;
}

.view-tab,
.segment,
.primary-button,
.ghost-button,
.option-button,
.icon-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.view-tab {
  min-width: 104px;
  padding: 0 16px;
  font-weight: 700;
}

.view-tab[data-view="learn"],
.view-tab[data-view="challenge"] {
  min-width: 148px;
  min-height: 54px;
  font-size: 1.15rem;
  font-weight: 900;
}

.view-tab:not([data-view="learn"]):not([data-view="challenge"]) {
  min-width: 82px;
  min-height: 38px;
  padding: 0 12px;
  border-color: rgba(220, 228, 223, 0.8);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 0.9rem;
}

.view-tab span {
  color: var(--teal);
}

.view-tab:not([data-view="learn"]):not([data-view="challenge"]) span {
  color: var(--muted);
}

.view-tab:hover,
.segment:hover,
.ghost-button:hover,
.option-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 106, 115, 0.45);
}

.view-tab.is-active,
.segment.is-active,
.primary-button {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.view-tab:not([data-view="learn"]):not([data-view="challenge"]).is-active {
  border-color: rgba(15, 106, 115, 0.28);
  background: var(--blue-soft);
  color: var(--teal-dark);
}

.view-tab:not([data-view="learn"]):not([data-view="challenge"]).is-active span {
  color: var(--teal-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.account-strip {
  display: grid;
  grid-template-columns: minmax(160px, auto) minmax(280px, 1fr) minmax(260px, auto);
  align-items: center;
  gap: 12px;
  width: min(1120px, calc(100% - 40px));
  margin: 16px auto 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.06);
}

.account-current {
  display: grid;
  gap: 2px;
}

.account-current span,
.account-form span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.account-current strong {
  color: var(--teal-dark);
  font-size: 1.2rem;
}

.account-form,
.account-switcher {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.account-form label {
  display: grid;
  gap: 4px;
  flex: 1;
}

.account-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.danger-button {
  border-color: rgba(184, 79, 46, 0.32);
  color: var(--coral);
}

main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-kicker {
  color: var(--teal);
}

h2,
h3,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.8rem;
  line-height: 1.22;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-field {
  display: flex;
  align-items: center;
  width: min(360px, 100%);
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.search-field span {
  margin-right: 8px;
  color: var(--teal);
  font-weight: 700;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

select {
  min-height: 44px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.segmented {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef4f1;
}

.segment {
  min-width: 82px;
  min-height: 36px;
  padding: 0 14px;
  border-color: transparent;
  background: transparent;
  font-weight: 700;
}

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

.word-card,
.level-card,
.wrong-card,
.report-row,
.coverage-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.06);
}

.word-card {
  display: flex;
  min-height: 242px;
  padding: 16px;
  flex-direction: column;
}

.word-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.word-card__word {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.word-card__word strong {
  font-size: 1.7rem;
  line-height: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.badge.real {
  background: var(--green-soft);
  color: var(--leaf);
}

.badge.virtual {
  background: var(--coral-soft);
  color: var(--coral);
}

.word-card__body {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.sense-list,
.detail-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.sense-list li,
.detail-list li {
  padding-left: 10px;
  border-left: 3px solid rgba(15, 106, 115, 0.25);
}

.word-card__actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.primary-button,
.ghost-button {
  min-width: 96px;
  padding: 0 16px;
  font-weight: 800;
}

.ghost-button {
  background: var(--surface);
  color: var(--teal-dark);
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 16px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

.score-pill strong {
  color: var(--teal);
  font-size: 1.35rem;
}

.quest-section {
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.06);
}

.quest-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.quest-section__head h3 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.textbook-panel {
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.06);
}

.custom-upload-panel {
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.06);
}

.textbook-panel__top,
.lesson-study__title,
.lesson-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.textbook-panel__top {
  margin-bottom: 14px;
}

.textbook-panel__top h3 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.lesson-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.upload-button input {
  display: none;
}

.custom-upload-hint {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.custom-set-list {
  display: grid;
  gap: 10px;
}

.custom-set-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.custom-set-card strong,
.custom-set-card span {
  display: block;
}

.custom-set-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.custom-set-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.textbook-controls {
  display: grid;
  grid-template-columns: minmax(160px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
}

.textbook-controls label {
  display: grid;
  gap: 6px;
}

.textbook-controls span,
.lesson-study__title span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.lesson-summary {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.lesson-study {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.lesson-study__title strong {
  font-size: 1.1rem;
  line-height: 1.35;
}

.lesson-study__section h4 {
  margin: 0 0 10px;
  color: var(--teal-dark);
  font-size: 0.96rem;
}

.lesson-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lesson-card {
  display: grid;
  gap: 10px;
  min-height: 132px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.lesson-card__head strong {
  color: var(--teal-dark);
  font-size: 1.08rem;
}

.lesson-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.lesson-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.lesson-list li {
  display: grid;
  gap: 4px;
  padding-left: 9px;
  border-left: 3px solid rgba(15, 106, 115, 0.2);
  color: var(--muted);
  font-size: 0.9rem;
}

.lesson-list strong {
  color: var(--ink);
}

.challenge-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.challenge-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.level-card {
  display: grid;
  min-height: 210px;
  padding: 16px;
  align-content: space-between;
}

.level-card h3 {
  min-height: 52px;
  margin: 0;
  line-height: 1.35;
}

.level-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e9e5;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--leaf));
}

.quiz-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}

.quiz-panel,
.quiz-side {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.quiz-panel {
  min-height: 470px;
  padding: 22px;
}

.quiz-side {
  padding: 18px;
}

.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.quiz-count {
  color: var(--muted);
  font-weight: 800;
}

.quiz-stem {
  margin-bottom: 12px;
  font-size: 1.25rem;
  font-weight: 800;
}

.quiz-clue {
  min-height: 96px;
  padding: 16px;
  border: 1px solid rgba(15, 106, 115, 0.18);
  border-radius: var(--radius);
  background: #f3f8f7;
  color: var(--ink);
}

.key-word {
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(184, 79, 46, 0.14);
  color: var(--coral);
  font-weight: 900;
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.option-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
}

.option-button.has-pair {
  min-height: 68px;
}

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--teal-dark);
  font-weight: 900;
}

.option-text {
  min-width: 0;
  padding-top: 3px;
  overflow-wrap: anywhere;
}

.option-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.option-pair__example {
  min-width: 0;
}

.option-pair__separator {
  color: var(--muted);
  font-weight: 900;
}

.option-button.is-correct {
  border-color: #2f8b57;
  background: #e7f5ed;
  color: #135b32;
}

.option-button.is-correct .option-letter {
  background: #2f8b57;
  color: #fff;
}

.option-button.is-wrong {
  border-color: #bd4b38;
  background: #fff0ec;
  color: #92301f;
}

.option-button.is-wrong .option-letter {
  background: #bd4b38;
  color: #fff;
}

.match-board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 72px;
  margin-top: 18px;
  padding: 4px 0;
}

.match-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.match-line {
  stroke: var(--gold);
  stroke-width: 1.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.match-line.is-correct {
  stroke: #2f8b57;
}

.match-line.is-wrong {
  stroke: #bd4b38;
  stroke-dasharray: 5 4;
}

.match-column {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.match-card {
  display: grid;
  gap: 7px;
  min-height: 92px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.05);
}

.match-card:hover {
  border-color: rgba(15, 106, 115, 0.45);
}

.match-card.is-selected {
  border-color: var(--teal);
  background: #eef8f7;
  box-shadow: inset 0 0 0 2px rgba(15, 106, 115, 0.12);
}

.match-card.is-linked {
  border-color: rgba(199, 149, 46, 0.48);
  background: #fffaf0;
}

.match-card.is-correct {
  border-color: #2f8b57;
  background: #e7f5ed;
}

.match-card.is-wrong {
  border-color: #bd4b38;
  background: #fff0ec;
}

.match-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.match-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.match-actions span {
  margin-right: auto;
  color: var(--muted);
  font-weight: 800;
}

.feedback {
  min-height: 74px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #f5f1e8;
  color: var(--ink);
}

.feedback:empty {
  display: none;
}

.quiz-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.stack {
  display: grid;
  gap: 10px;
}

.side-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  color: var(--muted);
}

.side-stat strong {
  color: var(--ink);
}

.question-map {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.question-dot {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-weight: 900;
}

.question-dot.is-current {
  border-color: var(--teal);
  color: var(--teal-dark);
  box-shadow: inset 0 0 0 2px rgba(15, 106, 115, 0.14);
}

.question-dot.is-correct {
  background: #e7f5ed;
  color: #135b32;
}

.question-dot.is-wrong {
  background: #fff0ec;
  color: #92301f;
}

.side-clear {
  width: 100%;
  margin-top: 16px;
}

.wrong-card {
  min-height: 230px;
  padding: 16px;
}

.wrong-card h3 {
  margin-bottom: 8px;
}

.wrong-card p {
  color: var(--muted);
}

.report-layout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.metric-panel {
  min-height: 112px;
  padding: 18px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.06);
}

.metric-panel strong {
  display: block;
  margin-top: 8px;
  color: var(--teal);
  font-size: 2rem;
  line-height: 1;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.teacher-account-panel {
  margin-bottom: 24px;
}

.account-list {
  display: grid;
  gap: 8px;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 90px 80px 90px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.account-row.is-active {
  border-color: rgba(15, 106, 115, 0.42);
  background: #f1f8f7;
}

.account-row strong,
.account-row span {
  display: block;
}

.account-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

.report-row,
.coverage-row {
  padding: 14px;
}

.row-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-weight: 800;
}

.row-sub {
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 36px 22px;
  border: 1px dashed #b9c8c2;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  text-align: center;
}

.detail-dialog {
  width: min(760px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
}

.detail-dialog::backdrop {
  background: rgba(10, 24, 29, 0.54);
}

.dialog-shell {
  position: relative;
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dialog-close {
  position: sticky;
  top: 0;
  float: right;
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
}

.detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-title strong {
  font-size: 2.2rem;
}

.dictionary-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(15, 106, 115, 0.24);
  border-radius: var(--radius);
  background: #f1f8f7;
  color: var(--teal-dark);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.dictionary-link:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.detail-section {
  margin-top: 18px;
}

.detail-section h3 {
  color: var(--teal-dark);
}

@media (max-width: 980px) {
  .account-strip {
    grid-template-columns: 1fr;
  }

  .content-grid,
  .report-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .level-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quiz-shell,
  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .hero {
    min-height: 330px;
  }

  .hero__shade {
    background: linear-gradient(180deg, rgba(9, 29, 33, 0.68), rgba(9, 29, 33, 0.32));
  }

  .hero__content {
    width: min(100% - 28px, 1120px);
    min-height: 330px;
    padding-bottom: 56px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero__stats div {
    min-width: calc(33.333% - 8px);
    padding: 10px;
  }

  .hero__stats strong {
    font-size: 1.35rem;
  }

  .view-tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    justify-content: stretch;
    overflow-x: hidden;
    padding-inline: 12px;
  }

  .view-tab {
    min-width: 0;
    padding-inline: 4px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .view-tab[data-view="learn"],
  .view-tab[data-view="challenge"] {
    grid-column: span 3;
    min-height: 48px;
    font-size: 1rem;
  }

  .view-tab:not([data-view="learn"]):not([data-view="challenge"]) {
    grid-column: span 2;
    min-height: 36px;
    font-size: 0.78rem;
  }

  main {
    width: min(100% - 24px, 1120px);
    padding-top: 24px;
  }

  .account-strip {
    width: min(100% - 24px, 1120px);
  }

  .account-form,
  .account-switcher {
    align-items: stretch;
    flex-direction: column;
  }

  .account-row {
    grid-template-columns: 1fr 1fr;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    justify-content: stretch;
  }

  .search-field,
  select {
    width: 100%;
  }

  .content-grid,
  .level-grid,
  .lesson-card-grid,
  .report-layout {
    grid-template-columns: 1fr;
  }

  .quest-section,
  .textbook-panel {
    padding: 14px;
  }

  .custom-upload-panel {
    padding: 14px;
  }

  .textbook-panel__top,
  .lesson-study__title,
  .textbook-controls {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .lesson-actions {
    flex-direction: column;
  }

  .custom-set-card {
    grid-template-columns: 1fr;
  }

  .custom-set-actions {
    justify-content: stretch;
  }

  .segmented {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .segment {
    min-width: 0;
  }

  .quiz-panel {
    min-height: auto;
    padding: 16px;
  }

  .option-pair {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .option-pair__separator {
    line-height: 1;
  }

  .match-board {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .match-lines {
    display: none;
  }

  .match-card {
    min-height: 78px;
  }

  .match-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .match-actions span {
    margin-right: 0;
  }

  .quiz-actions,
  .word-card__actions {
    flex-direction: column;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }
}
