:root {
  --bg: #f6f5ef;
  --paper: #fffefa;
  --ink: #253a31;
  --muted: #7c8378;
  --green: #215b47;
  --green-soft: #e8eee1;
  --line: #e4e5da;
  --gold: #c79a4b;
  --red: #b56b4e;
  --shadow: 0 12px 40px #293e3010;
  --serif: 'Songti SC', 'STSong', 'Noto Serif CJK SC', serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button,
input,
select,
textarea {
  outline-offset: 4px;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
}
a {
  color: inherit;
  text-decoration: none;
}
svg {
  flex-shrink: 0;
  vertical-align: middle;
}
button {
  border: 0;
  background: none;
}
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  padding: 11px 13px;
  min-width: 0;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #215b4733;
  border-color: #6c9c83;
}
input::placeholder {
  color: #a0a396;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.35;
}
h1,
h2 {
  font-weight: 650;
}
button {
  transition:
    background 0.18s,
    transform 0.18s,
    box-shadow 0.18s;
}
button:not(:disabled):active {
  transform: translateY(1px);
}
.site-shell {
  max-width: 1440px;
  margin: auto;
  padding: 0 48px;
}
#header {
  height: 99px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.brand img {
  width: 41px;
  height: 41px;
}
.brand strong {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 3px;
}
.brand small {
  display: block;
  letter-spacing: 2px;
  font-size: 8px;
  margin-top: -5px;
  color: var(--muted);
}
.nav {
  display: flex;
  gap: 35px;
  height: 100%;
  align-items: center;
}
.nav button {
  height: 100%;
  font-size: 14px;
  position: relative;
  color: var(--muted);
  padding: 0 3px;
}
.nav button.active {
  color: var(--green);
  font-weight: 600;
}
.nav button.active:after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--green);
  border-radius: 4px;
}
.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: end;
  min-width: 175px;
}
.date-pill {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn {
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 550;
  background: var(--paper);
  line-height: 1.5;
  white-space: nowrap;
}
.btn:hover {
  background: #eeefe7;
}
.btn-primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  box-shadow: 0 5px 12px #215b4712;
}
.btn-primary:hover {
  background: #174633;
}
.btn-gold {
  background: #ddbd7f;
  border-color: #ddbd7f;
  color: #4f3e22;
}
.btn-quiet {
  background: transparent;
  border-color: transparent;
  padding: 8px;
}
.btn-small {
  font-size: 12px;
  padding: 7px 12px;
}
.btn-wide {
  width: 100%;
}
.btn-outline {
  background: transparent;
  border-color: #9ab29c;
  color: var(--green);
}
.avatar {
  height: 33px;
  width: 33px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dfe8d8;
  color: var(--green);
  font-family: var(--serif);
  font-weight: bold;
}
.user-button {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  max-width: 180px;
}
.user-button span:not(.avatar) {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#app {
  min-height: calc(100vh - 180px);
  padding: 28px 0 60px;
  outline: 0;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: #839079;
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow:before {
  content: '';
  height: 5px;
  width: 5px;
  border-radius: 50%;
  background: #9eb78d;
}
.hero {
  position: relative;
  overflow: hidden;
  background: #edeee2;
  border: 1px solid #e2e5d5;
  border-radius: 18px;
  min-height: 328px;
  display: flex;
  align-items: center;
  padding: 38px 42px;
  margin-bottom: 28px;
}
.hero-copy {
  position: relative;
  z-index: 1;
  width: 52%;
}
.hero h1 {
  font-family: var(--serif);
  font-size: 39px;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1.5;
  margin: 12px 0 10px;
}
.hero h1 span {
  color: var(--green);
  position: relative;
}
.hero p {
  font-size: 13px;
  line-height: 1.9;
  color: #788474;
  max-width: 370px;
}
.hero .btn {
  margin-top: 24px;
  font-size: 13px;
  padding: 11px 21px;
}
.hero-art {
  position: absolute;
  width: 64%;
  height: auto;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.hero-stamp {
  position: absolute;
  right: 26px;
  bottom: 21px;
  color: #839079;
  letter-spacing: 2px;
  font-size: 10px;
  writing-mode: vertical-rl;
}
.hero-tags {
  display: flex;
  gap: 17px;
  align-items: center;
  margin-top: 24px;
  color: #6f7f6e;
  font-size: 11px;
}
.hero-tags span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 294px;
  gap: 28px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 18px;
}
.section-title h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 750;
  letter-spacing: 1px;
}
.section-title h2 span {
  font-family: system-ui;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  margin-left: 12px;
  color: #92998a;
}
.section-title .text-link {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 17px;
}
.tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: #eceee4;
  border-radius: 10px;
  flex-wrap: wrap;
}
.tabs button {
  padding: 7px 15px;
  border-radius: 7px;
  color: #858b7e;
  font-size: 12px;
}
.tabs button.active {
  background: var(--paper);
  color: var(--green);
  box-shadow: 0 1px 4px #293e3010;
  font-weight: 600;
}
.search-wrap {
  display: flex;
  align-items: center;
  position: relative;
  max-width: 180px;
}
.search-wrap svg {
  position: absolute;
  left: 12px;
  color: #8c9485;
}
.search-wrap input {
  background: transparent;
  padding: 9px 10px 9px 35px;
  width: 100%;
  font-size: 12px;
}
.route-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8b9384;
  font-size: 11px;
  margin: 0 0 16px;
}
.route-line span:last-child {
  margin-left: auto;
}
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.chapter-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-align: left;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: 229px;
  width: 100%;
}
.chapter-card:hover {
  box-shadow: var(--shadow);
  border-color: #a9b79d;
  transform: translateY(-3px);
}
.chapter-art {
  height: 94px;
  background: #eff1e8;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.chapter-art:before {
  content: '';
  position: absolute;
  inset: 14px 30px;
  background: radial-gradient(ellipse, #dde4cf 0, transparent 65%);
}
.chapter-art svg {
  position: relative;
  width: 120px;
  height: 82px;
  color: #6d8262;
}
.chapter-art.gold {
  background: #f3eee1;
}
.chapter-art.gold:before {
  background: radial-gradient(ellipse, #e7dbba 0, transparent 65%);
}
.chapter-art.gold svg {
  color: #9c8655;
}
.chapter-art.red {
  background: #f3e8df;
}
.chapter-art.red svg {
  color: #ab7c61;
}
.chapter-number {
  position: absolute;
  left: 12px;
  top: 10px;
  font-size: 9px;
  letter-spacing: 1px;
  color: #86917d;
  z-index: 1;
}
.completed-chip {
  position: absolute;
  right: 10px;
  top: 9px;
  background: #fff9;
  color: var(--green);
  font-size: 10px;
  border-radius: 12px;
  padding: 2px 7px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.chapter-body {
  padding: 16px 15px 13px;
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
}
.chapter-subtitle {
  font-size: 10px;
  color: #9a9d8e;
  margin-bottom: 4px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.chapter-body h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  min-height: 43px;
  letter-spacing: 0.1px;
  margin-bottom: 10px;
}
.chapter-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #8c9485;
  font-size: 10px;
  border-top: 1px dashed #e5e7db;
  padding-top: 10px;
  margin-top: auto;
}
.chapter-bottom .arrow {
  color: var(--green);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #dbe4d3;
}
.chapter-progress {
  height: 3px;
  position: absolute;
  bottom: 0;
  left: 0;
  background: #6d9471;
}
.side-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.challenge-card {
  position: relative;
  background: #244e3f;
  color: #f4f3e5;
  border: 1px solid #244e3f;
  border-radius: 12px;
  padding: 23px 22px;
  overflow: hidden;
}
.challenge-card:after {
  content: '✧';
  font-family: var(--serif);
  font-size: 100px;
  color: #ffffff08;
  position: absolute;
  right: -4px;
  top: 25px;
  line-height: 1;
  pointer-events: none;
}
.challenge-label {
  font-size: 10px;
  color: #b9c6a9;
  display: flex;
  gap: 7px;
  align-items: center;
  letter-spacing: 1px;
}
.challenge-card h3 {
  font-family: var(--serif);
  font-size: 24px;
  margin: 12px 0 10px;
  letter-spacing: 1px;
}
.challenge-card p {
  font-size: 11px;
  line-height: 1.9;
  color: #b7c8b7;
}
.challenge-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #ced9c5;
  font-size: 10px;
  margin: 20px 0;
}
.challenge-card .btn {
  border: 1px solid #597764;
  background: #365e4a;
  color: #edf0dc;
  border-radius: 6px;
  font-size: 12px;
}
.challenge-card .btn:hover {
  background: #416d56;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 21px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.panel-head h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 750;
  display: flex;
  gap: 8px;
  align-items: center;
}
.panel-head .text-link {
  font-size: 10px;
  color: #919884;
}
.board-mini-empty {
  text-align: center;
  padding: 16px 5px;
  color: #979d8c;
  font-size: 11px;
}
.board-mini-empty .empty-icon {
  color: #c1ad7b;
  margin: 0 0 8px;
}
.mini-rank {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #efefe7;
}
.mini-rank:last-child {
  border: 0;
}
.rank-no {
  width: 20px;
  color: #acb39f;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 800;
}
.rank-no.top {
  color: #b58d48;
}
.mini-rank .avatar {
  width: 29px;
  height: 29px;
  font-size: 12px;
}
.mini-rank .rank-person {
  flex: 1;
  min-width: 0;
}
.rank-person strong {
  font-size: 11px;
  display: block;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-person small {
  font-size: 9px;
  color: #99a08e;
}
.mini-score {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
}
.board-note {
  font-size: 10px;
  color: #929986;
  padding: 13px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 5px;
}
.board-note svg {
  margin-top: 2px;
}
.progress-panel {
  background: #eeeee3;
  border-color: #e2e5d5;
  padding: 20px;
}
.progress-panel h3 {
  font-family: var(--serif);
  font-size: 16px;
  margin-bottom: 10px;
}
.progress-panel p {
  font-size: 11px;
  color: #8b947e;
  line-height: 1.9;
}
.progress-panel .btn {
  margin-top: 15px;
  font-size: 11px;
  background: #ffffff77;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.stat {
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #fffefa9c;
  border-radius: 10px;
}
.stat small {
  display: block;
  font-size: 10px;
  color: #949b8c;
  margin-bottom: 5px;
}
.stat strong {
  font-size: 23px;
  font-family: var(--serif);
  font-weight: 750;
  color: var(--green);
}
.stat strong span {
  font: 10px system-ui;
  margin-left: 4px;
  color: #9a9f90;
}
.page-top {
  margin: 10px 0 29px;
}
.page-top .eyebrow {
  margin-bottom: 12px;
}
.page-top h1 {
  font-family: var(--serif);
  font-size: 33px;
  letter-spacing: 1px;
}
.page-top p {
  color: #8b9485;
  font-size: 13px;
  margin-top: 10px;
}
.page-top.split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.board-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 26px;
}
.podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: end;
  gap: 16px;
  margin-bottom: 26px;
  padding-top: 18px;
}
.podium-card {
  background: #f0f0e5;
  border: 1px solid #e1e4d5;
  border-radius: 12px;
  padding: 25px 10px 21px;
  display: flex;
  align-items: center;
  flex-direction: column;
  position: relative;
  text-align: center;
  min-height: 185px;
}
.podium-card.first {
  min-height: 211px;
  background: #eee6d3;
  border-color: #e1d6b7;
}
.podium-card .avatar {
  width: 43px;
  height: 43px;
  margin: 10px 0;
  background: #ffffff90;
  font-size: 18px;
}
.podium-card.first .avatar {
  width: 52px;
  height: 52px;
}
.podium-card .ribbon {
  position: absolute;
  top: -14px;
  background: #778b6c;
  color: #fff;
  font-size: 11px;
  padding: 3px 12px;
  border-radius: 5px;
}
.podium-card.first .ribbon {
  background: #b69a5f;
}
.podium-card strong {
  font-size: 14px;
}
.podium-card small {
  font-size: 10px;
  color: #8d937f;
  margin-top: 2px;
}
.podium-score {
  color: var(--green);
  font-size: 24px;
  font-family: var(--serif);
  font-weight: 800;
  margin-top: 6px;
}
.board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.board-table th {
  background: #eff0e7;
  color: #8b9484;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  padding: 14px 18px;
  white-space: nowrap;
}
.board-table td {
  padding: 16px 18px;
  border-bottom: 1px solid #eaece1;
}
.board-table td strong {
  font-weight: 550;
}
.board-table .is-me {
  background: #e9eee0;
}
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  background: var(--paper);
}
.board-table .person-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.person-cell small {
  display: block;
  color: #929c88;
  font-size: 10px;
}
.person-cell .avatar {
  height: 30px;
  width: 30px;
}
.board-rules p,
.board-rules li {
  font-size: 12px;
  color: #86927f;
  line-height: 2;
}
.board-rules ol {
  padding-left: 18px;
  margin: 0;
}
.board-rules h3 {
  font-family: var(--serif);
  font-size: 18px;
  margin-bottom: 14px;
}
.my-rank {
  background: #e7eddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border: 1px solid #d8e1c9;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 12px;
}
.my-rank strong {
  font-size: 17px;
  color: var(--green);
}
.empty-state {
  text-align: center;
  padding: 70px 24px;
  border: 1px dashed #cdd6c0;
  border-radius: 14px;
  background: #fffefa90;
}
.empty-state .empty-icon {
  color: #a6b394;
  margin: 0 auto 18px;
}
.empty-state h2 {
  font-family: var(--serif);
  font-size: 25px;
  margin-bottom: 10px;
}
.empty-state p {
  color: #8c9780;
  font-size: 13px;
  max-width: 400px;
  margin: auto;
}
.empty-state .btn {
  margin-top: 23px;
}
.rules-callout {
  border: 1px dashed #ccd5bb;
  background: #ecefe2;
  padding: 17px 20px;
  border-radius: 10px;
  color: #7f8e72;
  font-size: 12px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.mistake-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.mistake-card {
  background: var(--paper);
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.mistake-card h3 {
  font-size: 16px;
  font-family: var(--serif);
  margin: 12px 0;
}
.mistake-card p {
  font-size: 12px;
  color: #858f7c;
  margin-bottom: 13px;
}
.mistake-card summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--green);
}
.mistake-answer {
  white-space: pre-line;
  background: #f0f2e8;
  padding: 13px;
  border-radius: 8px;
  font-size: 12px;
  margin: 12px 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 5px;
  color: #7e8c71;
  background: #eef1e5;
}
.pill.gold {
  background: #f2e9d4;
  color: #a18449;
}
.pill.red {
  background: #f4e8df;
  color: #b37959;
}
.source {
  color: #9ba28f;
  font-size: 10px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  margin-top: 12px;
}
.source summary {
  font-size: 10px;
  color: #9ba28f;
}
.game-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 0 0 23px;
}
.back {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #8e9781;
  font-size: 12px;
  padding: 0;
}
.game-title {
  font-family: var(--serif);
  font-size: 19px;
  margin-top: 10px;
}
.game-status {
  display: flex;
  align-items: center;
  gap: 18px;
}
.game-status .score-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  color: var(--green);
  font-family: var(--serif);
  font-weight: 800;
}
.timer {
  font-family: system-ui;
  font-variant-numeric: tabular-nums;
  padding: 7px 12px;
  border: 1px solid #d7dfc9;
  border-radius: 20px;
  color: #7b896c;
  font-size: 12px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.timer.urgent {
  color: var(--red);
  border-color: #d9aa8d;
  background: #f7eade;
}
.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 255px;
  gap: 26px;
  align-items: start;
  max-width: 1120px;
  margin: auto;
}
.question-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
}
.question-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #939e86;
  margin-bottom: 19px;
}
.question-title {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.75;
  white-space: pre-line;
  margin-bottom: 24px;
}
.question-card .instruction {
  font-size: 12px;
  color: #8f9b82;
  margin: -8px 0 20px;
}
.choice-list {
  display: grid;
  gap: 12px;
}
.choice {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid #e2e6d8;
  border-radius: 10px;
  text-align: left;
  background: #fafbf4;
  font-size: 14px;
}
.choice:hover {
  border-color: #8eaa81;
  background: #f1f5e9;
}
.choice-letter {
  border: 1px solid #dce3d1;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font: 500 13px system-ui;
  flex-shrink: 0;
  color: #99a38c;
  background: #fffefa;
}
.choice.selected {
  border-color: #5a855d;
  background: #ebf1e2;
  color: var(--green);
}
.choice.selected .choice-letter {
  color: #fff;
  background: #3b6c4b;
  border-color: #3b6c4b;
}
.choice.answer-correct {
  border-color: #5e9569;
  background: #e8f0de;
}
.choice.answer-wrong {
  border-color: #c79b7c;
  background: #f7eee4;
}
.game-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-top: 27px;
  padding-top: 22px;
}
.game-actions small {
  font-size: 11px;
  color: #9aa38d;
}
.route-panel {
  background: #ecf0e3;
  border: 1px solid #dfe6d2;
  border-radius: 12px;
  padding: 23px 22px;
}
.route-panel h3 {
  font-family: var(--serif);
  font-size: 17px;
  margin-bottom: 24px;
}
.route-node {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  padding-bottom: 24px;
  font-size: 12px;
  color: #9ba58f;
}
.route-node:last-child {
  padding-bottom: 0;
}
.route-node:not(:last-child):after {
  content: '';
  height: 24px;
  position: absolute;
  left: 13px;
  bottom: 0;
  width: 1px;
  background: #d8e0cb;
}
.node-circle {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #d0dac1;
  background: #f9fbf1;
  font: 11px system-ui;
  flex-shrink: 0;
}
.route-node.current {
  color: var(--green);
  font-weight: 600;
}
.route-node.current .node-circle {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 0 0 4px #dfe8d1;
}
.route-node.done .node-circle {
  background: #d9e5ce;
  color: #5a8052;
}
.journey-help {
  margin-top: 17px;
  background: #fffefa80;
  font-size: 11px;
  color: #8f9a7d;
  border: 1px dashed #d3dcc5;
  border-radius: 10px;
  padding: 16px;
  line-height: 1.9;
}
.journey-help strong {
  display: block;
  color: #718363;
  margin-bottom: 6px;
  font-size: 12px;
}
.feedback {
  background: #edf3e4;
  border: 1px solid #d6e3c9;
  border-radius: 10px;
  padding: 21px;
  margin-top: 23px;
}
.feedback.wrong {
  background: #f8f0e5;
  border-color: #ead8bd;
}
.feedback-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #52764a;
  font-weight: 650;
}
.feedback.wrong .feedback-heading {
  color: #a37547;
}
.feedback p {
  font-size: 12px;
  line-height: 1.9;
  color: #78856a;
  margin-top: 12px;
}
.feedback .answer-detail {
  font-size: 12px;
  white-space: pre-line;
  border-top: 1px solid #dbe4ce;
  margin-top: 14px;
  padding-top: 13px;
  line-height: 1.9;
}
.feedback.wrong .answer-detail {
  border-color: #eadbc6;
}
.knowledge-title {
  font-weight: 650;
  font-size: 12px;
  margin-top: 17px;
  color: #668357;
}
.fill-passage {
  font-size: 16px;
  line-height: 3;
  color: #5b6f50;
  background: #f4f6eb;
  border: 1px solid #e3e8d6;
  border-radius: 10px;
  padding: 19px 23px;
}
.blank-input {
  padding: 6px 9px;
  max-width: 100%;
  width: 150px;
  border-color: #bccbb0;
  background: #fffefa;
  margin: 3px 5px;
  border-radius: 5px;
  font-size: 14px;
}
.blank-input::placeholder {
  font-size: 11px;
}
.judge-list {
  display: grid;
  gap: 12px;
}
.judge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px;
  background: #f6f7ef;
  border: 1px solid #e2e8d7;
  border-radius: 9px;
  font-size: 13px;
}
.judge-buttons {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.judge-buttons button {
  padding: 6px 12px;
  border: 1px solid #d8e2cb;
  border-radius: 6px;
  font-size: 12px;
  background: #fffef8;
}
.judge-buttons button.selected {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.sort-list {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}
.sort-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px;
  background: #f6f8ef;
  border: 1px solid #dfe6d2;
  border-radius: 8px;
  font-size: 13px;
}
.sort-item .order {
  width: 25px;
  height: 25px;
  border-radius: 5px;
  background: #e6eddc;
  color: #6d8c5b;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font: 12px system-ui;
}
.sort-item .sort-text {
  flex: 1;
}
.sort-tools {
  display: flex;
  gap: 2px;
}
.sort-tools button {
  padding: 6px;
  color: #92a47b;
  border-radius: 5px;
}
.sort-tools button:hover {
  background: #e8eedf;
}
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
.match-col {
  display: grid;
  gap: 10px;
  align-content: start;
}
.match-item {
  border: 1px solid #dce5cd;
  border-radius: 8px;
  padding: 12px;
  background: #f9fbf2;
  text-align: left;
  min-height: 56px;
  font-size: 12px;
  display: flex;
  gap: 9px;
  align-items: center;
  position: relative;
}
.match-item.selected {
  background: #e6efda;
  border-color: #759562;
}
.match-item.matched {
  background: #edf1e5;
}
.match-item .match-num {
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 10px;
  background: #e1e9d5;
}
.match-item small {
  display: block;
  color: #7b925f;
  font-size: 10px;
  margin-top: 4px;
}
.match-col-label {
  font-size: 10px;
  color: #98a789;
  margin-bottom: 4px;
}
.match-count {
  font-size: 11px;
  color: #9aab86;
  margin-top: 12px;
}
.result-layout {
  max-width: 930px;
  margin: 12px auto;
}
.result-card {
  text-align: center;
  border: 1px solid #dfe5d3;
  border-radius: 16px;
  background: var(--paper);
  padding: 39px;
  position: relative;
  overflow: hidden;
}
.result-emblem {
  font-size: 40px;
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #efe8d1;
  color: #ac9455;
  margin: 0 auto 22px;
  border: 1px solid #dfd6b7;
  box-shadow: 0 0 0 9px #f7f4e8;
}
.result-card h1 {
  font-family: var(--serif);
  font-size: 30px;
  margin: 10px 0;
}
.result-card .result-sub {
  font-size: 13px;
  color: #8c9980;
}
.result-score {
  font-family: var(--serif);
  font-size: 55px;
  color: var(--green);
  line-height: 1.1;
  margin: 25px 0 9px;
}
.result-score span {
  font: 11px system-ui;
  display: block;
  color: #929e83;
  margin-top: 9px;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 520px;
  margin: 26px auto;
  gap: 12px;
}
.result-stats strong {
  display: block;
  font-size: 24px;
  font-family: var(--serif);
  color: #638453;
}
.result-stats small {
  font-size: 11px;
  color: #a0aa92;
}
.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.result-note {
  font-size: 11px;
  color: #a3aa98;
  margin-top: 18px;
}
.review-results {
  margin-top: 26px;
}
.review-results h2 {
  font-family: var(--serif);
  font-size: 21px;
  margin-bottom: 18px;
}
.review-row {
  padding: 17px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 9px;
  display: flex;
  gap: 13px;
  align-items: flex-start;
}
.review-row .row-icon {
  margin-top: 2px;
  color: #70945b;
}
.review-row.wrong .row-icon {
  color: #bd8c5e;
}
.review-row strong {
  font-size: 13px;
  font-weight: 550;
}
.review-row p {
  font-size: 11px;
  color: #99a58a;
  line-height: 1.8;
  margin-top: 5px;
}
.review-row details {
  font-size: 12px;
  color: #7f906d;
  margin-top: 8px;
}
.review-row details div {
  white-space: pre-line;
  margin-top: 10px;
}
#modal {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px;
  width: 430px;
  max-width: calc(100vw - 32px);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 30px 100px #1d3b3a30;
}
#modal::backdrop {
  background: #293c315e;
  backdrop-filter: blur(4px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}
.modal-head h2 {
  font-family: var(--serif);
  font-size: 24px;
}
.modal-head button {
  color: #a0ab93;
  padding: 5px;
}
.modal-intro {
  font-size: 12px;
  color: #939f88;
  margin-bottom: 23px;
}
#modal .tabs {
  margin-bottom: 22px;
}
#modal .tabs button {
  flex: 1;
}
label.field {
  display: block;
  margin-bottom: 14px;
  font-size: 12px;
  color: #7b8c6c;
}
.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-size: 13px;
}
.field small {
  font-size: 10px;
  color: #a3ab98;
}
.form-error {
  font-size: 12px;
  color: #b36e4b;
  margin-bottom: 13px;
  min-height: 0;
}
.modal-bottom {
  font-size: 10px;
  color: #a4ad98;
  margin-top: 17px;
  text-align: center;
}
.account-info {
  background: #eff3e7;
  padding: 16px;
  border-radius: 10px;
  margin: 18px 0;
  font-size: 13px;
}
.account-info p {
  color: #8f9e80;
  margin-top: 6px;
  font-size: 12px;
}
.teacher-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.teacher-grid h2 {
  font-family: var(--serif);
  font-size: 21px;
  margin-bottom: 12px;
}
.teacher-grid p {
  font-size: 12px;
  line-height: 1.9;
  color: #8b9980;
}
.upload-box {
  border: 1px dashed #becdaf;
  border-radius: 11px;
  background: #f2f5e9;
  padding: 30px;
  margin-top: 20px;
  text-align: center;
}
.upload-box input {
  max-width: 100%;
  font-size: 11px;
  border: 0;
  margin-top: 12px;
}
.upload-preview {
  border: 1px solid #d4dfc6;
  background: #eff5e8;
  border-radius: 10px;
  padding: 20px;
  margin-top: 18px;
  font-size: 12px;
}
.upload-preview strong {
  font-size: 15px;
  display: block;
  margin-bottom: 9px;
}
.upload-preview .btn {
  margin-top: 15px;
}
.source-list {
  max-height: 260px;
  overflow: auto;
  margin-top: 15px;
  font-size: 11px;
  color: #869774;
  padding: 0 0 0 18px;
}
.source-list li {
  margin-bottom: 8px;
}
.loading {
  text-align: center;
  padding: 120px 20px;
  color: #8c9a7b;
}
.loading-mark {
  font-size: 40px;
  font-family: var(--serif);
  border: 1px solid #c4d0b3;
  padding: 15px;
  display: inline-grid;
  width: 82px;
  height: 82px;
  border-radius: 20px;
  margin-bottom: 18px;
  color: var(--green);
}
#footer {
  padding: 22px 0 26px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #a0a694;
  font-size: 10px;
  gap: 15px;
}
.footer-mark {
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: 1px;
}
.footer-mark img {
  width: 18px;
  height: 18px;
  opacity: 0.5;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.footer-links button {
  padding: 0;
  font-size: 10px;
  color: #929c84;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #244f3f;
  color: #f9faf1;
  border: 1px solid #3b6850;
  border-radius: 9px;
  box-shadow: var(--shadow);
  padding: 12px 22px;
  max-width: calc(100vw - 30px);
  z-index: 100;
  opacity: 0;
  transition:
    opacity 0.2s,
    transform 0.2s;
  pointer-events: none;
  font-size: 12px;
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.mini-label {
  font-size: 10px;
  color: #9ca78f;
}
.mobile-only {
  display: none;
}
.book-progress {
  height: 5px;
  border-radius: 5px;
  overflow: hidden;
  background: #dfe6d2;
  margin: 15px 0;
}
.book-progress span {
  display: block;
  height: 100%;
  background: #7e9b69;
}
.continue-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #edf2e3;
  border: 1px solid #d9e3ca;
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 12px;
  color: #7b9068;
  margin-bottom: 20px;
  gap: 15px;
}
.load-error {
  max-width: 500px;
  margin: 60px auto;
}
.sound-toggle {
  color: #99a68a;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.question-form[aria-busy='true'] {
  opacity: 0.7;
  pointer-events: none;
}
.end-marker {
  font-size: 11px;
  color: #a4ad97;
  text-align: center;
  padding: 25px 0 0;
}
.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 1600px) {
  .site-shell {
    padding: 0 60px;
  }
  .hero {
    min-height: 350px;
  }
  .hero h1 {
    font-size: 43px;
  }
}
@media (max-width: 1150px) {
  .site-shell {
    padding: 0 30px;
  }
  .home-grid {
    grid-template-columns: 1fr 260px;
    gap: 22px;
  }
  .chapter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero {
    padding: 34px;
    min-height: 300px;
  }
  .hero h1 {
    font-size: 34px;
  }
  .hero-art {
    right: -65px;
    width: 66%;
  }
  .hero-copy {
    width: 54%;
  }
  .nav {
    gap: 23px;
  }
  .date-pill {
    display: none;
  }
  .header-actions {
    min-width: 120px;
  }
  .game-grid {
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 18px;
  }
  .question-card {
    padding: 25px;
  }
  .board-layout {
    grid-template-columns: 1fr 230px;
  }
  .search-wrap {
    max-width: 150px;
  }
  .tabs button {
    padding: 7px 11px;
  }
}
@media (max-width: 820px) {
  .site-shell {
    padding: 0 22px;
  }
  #header {
    height: 80px;
  }
  .brand strong {
    font-size: 24px;
  }
  .brand img {
    width: 35px;
    height: 35px;
  }
  .brand small {
    font-size: 7px;
  }
  .nav {
    gap: 18px;
  }
  .header-actions {
    min-width: 0;
  }
  .header-actions .btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  .hero {
    min-height: 300px;
  }
  .hero-copy {
    width: 60%;
  }
  .hero h1 {
    font-size: 31px;
    letter-spacing: 0;
  }
  .hero-art {
    width: 77%;
    right: -160px;
    opacity: 0.9;
  }
  .hero-copy p {
    max-width: 280px;
    font-size: 12px;
  }
  .hero-tags {
    gap: 10px;
    font-size: 10px;
  }
  .home-grid {
    grid-template-columns: 1fr 230px;
    gap: 18px;
  }
  .section-title h2 {
    font-size: 22px;
  }
  .section-title h2 span {
    display: none;
  }
  .filters {
    flex-wrap: wrap;
  }
  .search-wrap {
    width: 100%;
    max-width: none;
  }
  .chapter-body {
    padding: 14px 12px;
  }
  .chapter-body h3 {
    font-size: 14px;
  }
  .challenge-card {
    padding: 20px 17px;
  }
  .challenge-card h3 {
    font-size: 22px;
  }
  .panel {
    padding: 18px;
  }
  .chapter-art {
    height: 84px;
  }
  .stats-row .stat {
    padding: 12px;
  }
  .stat strong {
    font-size: 19px;
  }
  .stat small {
    font-size: 9px;
  }
  .board-layout {
    grid-template-columns: 1fr;
  }
  .board-sidebar {
    display: none;
  }
  .game-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .route-panel {
    display: none;
  }
  .journey-help {
    margin-top: 0;
  }
  .game-aside {
    display: none;
  }
  .game-top {
    max-width: 1120px;
  }
  .question-title {
    font-size: 22px;
  }
  .teacher-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .site-shell {
    padding: 0 16px;
  }
  #header {
    height: 110px;
    flex-wrap: wrap;
    gap: 0;
    padding-top: 12px;
    align-content: space-between;
  }
  .brand {
    order: 1;
  }
  .brand img {
    width: 33px;
    height: 33px;
  }
  .brand strong {
    font-size: 25px;
  }
  .brand small {
    display: none;
  }
  .header-actions {
    order: 2;
    margin-left: auto;
    gap: 8px;
  }
  .nav {
    order: 3;
    height: 43px;
    width: 100%;
    gap: 28px;
    justify-content: center;
  }
  .nav button {
    font-size: 12px;
    height: 43px;
  }
  .nav button.active:after {
    height: 2px;
  }
  .user-button .avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .user-button span:not(.avatar) {
    max-width: 82px;
    font-size: 12px;
  }
  #app {
    padding-top: 18px;
    padding-bottom: 38px;
  }
  .hero {
    padding: 24px 24px 120px;
    min-height: 385px;
    border-radius: 12px;
    margin-bottom: 20px;
    align-items: flex-start;
  }
  .hero-copy {
    width: 100%;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 1.4px;
  }
  .hero h1 {
    font-size: 31px;
    line-height: 1.5;
    margin: 10px 0 8px;
  }
  .hero p {
    font-size: 11px;
    max-width: 255px;
  }
  .hero .btn {
    margin-top: 17px;
    padding: 10px 16px;
    font-size: 12px;
  }
  .hero-art {
    width: 360px;
    right: -80px;
    top: auto;
    bottom: -60px;
    transform: none;
    opacity: 0.85;
  }
  .hero-tags {
    position: relative;
    z-index: 2;
    gap: 13px;
    margin-top: 19px;
    font-size: 9px;
    max-width: 260px;
  }
  .hero-tags span:last-child {
    display: none;
  }
  .hero-stamp {
    right: 17px;
    bottom: 14px;
    font-size: 8px;
  }
  .home-grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
  }
  .home-main {
    display: contents;
  }
  .stats-row {
    order: 1;
    margin-bottom: 0;
    gap: 9px;
  }
  .stat {
    padding: 13px 14px;
    background: var(--paper);
  }
  .stat small {
    font-size: 10px !important;
  }
  .stat strong {
    font-size: 23px;
  }
  .explore-section {
    order: 3;
  }
  .side-stack {
    display: contents;
  }
  .challenge-card {
    order: 2;
    padding: 20px 22px;
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 12px;
    align-items: center;
  }
  .challenge-card .challenge-label {
    grid-column: 1/3;
  }
  .challenge-card h3 {
    font-size: 24px;
    margin: 8px 0 5px;
  }
  .challenge-card p {
    grid-column: 1/3;
    font-size: 10px;
    max-width: 260px;
  }
  .challenge-card .challenge-meta {
    grid-column: 1;
    margin: 13px 0 0;
    font-size: 10px;
    gap: 10px;
  }
  .challenge-card .btn {
    grid-column: 2;
    grid-row: 4;
    width: auto;
    margin-top: 13px;
    padding: 8px 10px;
    font-size: 11px;
  }
  .home-ranks {
    order: 4;
  }
  .progress-panel {
    order: 5;
  }
  .section-title h2 {
    font-size: 23px;
  }
  .section-title h2 span {
    display: inline;
    font-size: 9px;
    margin-left: 7px;
  }
  .section-title .text-link {
    font-size: 10px;
  }
  .tabs {
    gap: 3px;
  }
  .tabs button {
    font-size: 11px;
    padding: 7px 11px;
  }
  .filters {
    gap: 10px;
  }
  .filters .tabs {
    flex: 1;
    justify-content: center;
  }
  .search-wrap {
    max-width: 150px;
  }
  .search-wrap input {
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 11px;
  }
  .route-line {
    font-size: 10px;
    margin-bottom: 13px;
  }
  .chapter-grid {
    gap: 12px;
  }
  .chapter-card {
    border-radius: 10px;
    min-height: 219px;
  }
  .chapter-art {
    height: 82px;
  }
  .chapter-art svg {
    height: 73px;
    width: 108px;
  }
  .chapter-body h3 {
    font-size: 15px;
    min-height: 43px;
  }
  .chapter-body {
    padding: 13px 13px 10px;
  }
  .chapter-subtitle {
    font-size: 9px;
  }
  .chapter-bottom {
    font-size: 9px;
    padding-top: 8px;
  }
  .chapter-number {
    font-size: 8px;
  }
  .board-mini-empty {
    padding: 22px 10px;
  }
  .page-top {
    margin: 9px 0 22px;
  }
  .page-top h1 {
    font-size: 29px;
  }
  .page-top p {
    font-size: 12px;
  }
  .page-top.split {
    display: block;
  }
  .page-top.split .btn {
    margin-top: 18px;
  }
  .podium {
    gap: 8px;
    margin: 24px 0;
  }
  .podium-card {
    padding: 25px 8px 17px;
    min-height: 175px;
  }
  .podium-card.first {
    min-height: 197px;
  }
  .podium-card strong {
    font-size: 12px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .podium-card small {
    font-size: 9px;
  }
  .podium-score {
    font-size: 22px;
  }
  .podium-card .avatar {
    height: 37px;
    width: 37px;
    font-size: 16px;
  }
  .podium-card.first .avatar {
    height: 45px;
    width: 45px;
  }
  .board-table th {
    font-size: 10px;
    padding: 13px 10px;
  }
  .board-table td {
    font-size: 12px;
    padding: 14px 10px;
  }
  .board-table .optional-col {
    display: none;
  }
  .board-table .person-cell {
    gap: 8px;
  }
  .person-cell .avatar {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }
  .board-table td:nth-child(2) {
    min-width: 120px;
  }
  .my-rank {
    font-size: 10px;
    padding: 12px;
  }
  .my-rank strong {
    font-size: 15px;
  }
  .board-filters {
    align-items: center;
    flex-wrap: wrap;
  }
  .board-filters select {
    padding: 8px 11px;
    font-size: 11px;
  }
  .mistake-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }
  .mistake-card {
    padding: 20px;
  }
  .rules-callout {
    font-size: 11px;
    padding: 14px;
    align-items: start;
  }
  .rules-callout svg {
    margin-top: 3px;
  }
  .game-top {
    gap: 12px;
    margin-bottom: 19px;
  }
  .game-title {
    font-size: 16px;
    max-width: 225px;
    line-height: 1.5;
  }
  .game-status {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .game-status .score-badge {
    font-size: 13px;
  }
  .timer {
    font-size: 11px;
    padding: 5px 9px;
  }
  .back {
    font-size: 10px;
  }
  .question-card {
    padding: 23px 19px;
    border-radius: 11px;
  }
  .question-head {
    font-size: 10px;
    margin-bottom: 14px;
  }
  .question-title {
    font-size: 19px;
    line-height: 1.8;
    margin-bottom: 21px;
  }
  .choice {
    padding: 14px 12px;
    gap: 10px;
    font-size: 13px;
  }
  .choice-letter {
    height: 27px;
    width: 27px;
    font-size: 12px;
  }
  .game-actions {
    gap: 10px;
    align-items: flex-start;
  }
  .game-actions small {
    font-size: 10px;
    padding-top: 7px;
    max-width: 150px;
  }
  .game-actions .btn {
    padding: 10px 15px;
    font-size: 12px;
  }
  .match-grid {
    gap: 14px;
  }
  .match-item {
    font-size: 11px;
    padding: 11px 9px;
    gap: 6px;
    min-height: 60px;
  }
  .match-item .match-num {
    width: 17px;
    height: 17px;
    font-size: 9px;
  }
  .match-item small {
    font-size: 9px;
  }
  .judge-item {
    font-size: 12px;
    gap: 12px;
    align-items: start;
    padding: 12px;
  }
  .judge-buttons {
    flex-direction: column;
  }
  .judge-buttons button {
    font-size: 10px;
    padding: 4px 8px;
  }
  .fill-passage {
    padding: 14px 15px;
    font-size: 14px;
    line-height: 3.1;
  }
  .blank-input {
    width: 126px;
    font-size: 13px;
  }
  .sort-item {
    font-size: 12px;
    padding: 10px;
    gap: 10px;
  }
  .sort-tools button {
    padding: 5px;
  }
  .sort-tools svg {
    height: 14px;
    width: 14px;
  }
  .feedback {
    padding: 17px;
  }
  .feedback-heading {
    font-size: 14px;
  }
  .feedback p {
    font-size: 11px;
  }
  .feedback .answer-detail {
    font-size: 11px;
  }
  .result-card {
    padding: 32px 18px;
  }
  .result-card h1 {
    font-size: 27px;
  }
  .result-sub {
    font-size: 12px !important;
  }
  .result-score {
    font-size: 50px;
  }
  .result-stats {
    margin: 23px 0;
  }
  .result-stats strong {
    font-size: 22px;
  }
  .result-stats small {
    font-size: 10px;
  }
  .result-actions {
    gap: 8px;
  }
  .result-actions .btn {
    font-size: 12px;
    padding: 10px 12px;
  }
  .result-note {
    font-size: 10px;
  }
  .review-row {
    padding: 15px;
  }
  .review-row strong {
    font-size: 12px;
  }
  .review-row p {
    font-size: 10px;
  }
  #modal {
    padding: 25px 22px;
  }
  .modal-head h2 {
    font-size: 23px;
  }
  .teacher-grid .panel {
    padding: 21px;
  }
  #footer {
    font-size: 9px;
    flex-direction: column;
    gap: 10px;
    padding: 22px 0;
  }
  .footer-links {
    gap: 22px;
  }
  .footer-links button {
    font-size: 9px;
  }
  .end-marker {
    font-size: 10px;
  }
  .sound-toggle span {
    display: none;
  }
  .continue-banner {
    font-size: 11px;
    padding: 11px 13px;
  }
  .continue-banner .btn {
    font-size: 10px;
    padding: 7px 10px;
  }
  .mobile-only {
    display: block;
  }
  .empty-state {
    padding: 44px 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* Chapter-based AI tutor */
[hidden]{display:none!important}.ai-beta{font:10px/1.5 system-ui;letter-spacing:.12em;color:var(--green);vertical-align:middle;background:#e7ede4;padding:5px 9px;border-radius:5px;margin-left:14px}.ai-layout{display:grid;grid-template-columns:240px minmax(0,1fr);gap:22px}.ai-sidebar h3{margin:28px 0 12px}.ai-history{max-height:380px;overflow:auto}.ai-history button{width:100%;text-align:left;padding:13px 10px;border-radius:9px;display:block}.ai-history button.selected{background:#e8eee4}.ai-history strong{display:block;font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-history small{font-size:11px;color:var(--muted);display:block;margin-top:6px}.ai-help{font-size:12px;color:var(--muted);line-height:1.9;padding-top:25px;border-top:1px solid var(--line);margin-top:25px}.ai-chat{padding:0;overflow:hidden;min-width:0}.ai-chat-top{display:flex;align-items:center;justify-content:space-between;padding:22px 26px;border-bottom:1px solid var(--line);font-weight:600}.ai-chat-top small{font:11px system-ui;display:block;color:var(--muted);margin:7px 0 0 16px}.ai-presence{display:inline-block;width:7px;height:7px;border-radius:50%;background:#728a60;margin-right:9px}.ai-topic{display:flex;gap:15px;align-items:center;padding:14px 26px;background:#f4f4ed;font-size:12px}.ai-topic select{max-width:75%;padding:8px;border:1px solid var(--line);border-radius:7px;background:white;min-width:0}.ai-messages{height:460px;overflow:auto;padding:24px 26px;scroll-behavior:smooth}.ai-welcome{padding:22px 5px}.ai-welcome h2{font-family:serif;font-size:24px;margin:20px 0 12px}.ai-welcome p{font-size:13px;line-height:1.9;color:var(--muted)}.ai-suggestions{display:grid;gap:8px;margin-top:24px}.ai-suggestions button{display:flex;justify-content:space-between;align-items:center;text-align:left;background:#f4f4ef;border:1px solid var(--line);border-radius:9px;padding:12px 16px;font-size:13px}.ai-message{margin:0 0 22px;max-width:94%}.ai-message-role{display:block;font-size:11px;color:var(--muted);margin:0 0 7px 2px}.ai-message>div{font-size:14px;line-height:1.95;padding:15px 18px;border-radius:2px 14px 14px;background:#f1f3ed;white-space:pre-wrap;overflow-wrap:anywhere}.ai-message.student{margin-left:auto}.ai-message.student .ai-message-role{text-align:right}.ai-message.student>div{background:#e6eddf;border-radius:14px 2px 14px 14px}.ai-error{margin:10px 26px;color:#9b492f;background:#fbf0e8;padding:12px;border-radius:7px;font-size:12px;line-height:1.8}.ai-composer{padding:18px 26px;border-top:1px solid var(--line)}.ai-composer textarea{resize:vertical;width:100%;background:#fafaf6;border:1px solid var(--line);border-radius:10px;padding:13px;font:14px/1.7 inherit;color:var(--ink)}.ai-composer>div{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:11px}.ai-composer small{font-size:11px;color:var(--muted)}.site-announcement{white-space:pre-wrap}.ai-thinking{color:var(--green)}
@media(max-width:820px){.ai-layout{grid-template-columns:1fr}.ai-sidebar{display:none}.ai-messages{height:430px}.nav{gap:24px}}@media(max-width:620px){.nav{justify-content:space-between;gap:10px}.nav button{font-size:12px}.ai-chat-top,.ai-topic,.ai-composer{padding:16px}.ai-messages{padding:16px;height:420px}.ai-composer>div{align-items:flex-end}.ai-composer small{max-width:50%}.ai-beta{margin-left:8px;font-size:9px}.ai-error{margin:10px 16px}.ai-chat-top .text-link{font-size:11px}.ai-topic{gap:10px}.ai-topic select{flex:1}}
/* Source-aware question library, compact on classroom phones. */
.bank-intro{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;margin:20px 0;color:var(--muted);font-size:12px}.bank-filters{display:grid;grid-template-columns:1fr 2fr 1fr 1.3fr;gap:12px;margin-bottom:18px}.bank-filters>label{display:flex;flex-direction:column;gap:6px;min-width:0;font-size:11px;color:var(--muted)}.bank-filters select{width:100%;max-width:100%;min-width:0;height:40px;background:#fff;border:1px solid var(--line,#dde2d8);border-radius:8px;padding:0 9px;color:var(--ink);font-size:12px}.bank-filters .source-filter{grid-column:span 2}.bank-filters .search-wrap{grid-column:span 2;flex-direction:row;align-items:center;align-self:end;height:40px}.bank-filters .search-wrap input{width:100%;min-width:0}.finder-heading{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;margin:16px 0;font-size:12px;color:var(--muted)}.question-preview-list{display:grid;gap:12px}.question-preview{padding:20px;border:1px solid var(--line,#dde2d8);border-radius:12px;background:#fff;min-width:0}.question-preview .row{gap:10px;flex-wrap:wrap}.question-preview small{font-size:11px;color:var(--muted)}.question-preview h3{font-size:15px;line-height:1.8;margin:12px 0 6px;white-space:pre-line;overflow-wrap:anywhere}.question-preview p{font-size:13px;line-height:1.8;color:var(--muted)}.question-preview .source{margin:10px 0;overflow-wrap:anywhere}.finder-pagination{display:flex;justify-content:center;align-items:center;gap:18px;margin-top:22px;font-size:12px}.metric-tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:0 0 24px}.metric-tabs button{display:flex;gap:10px;align-items:center;justify-content:center;min-height:62px;border:1px solid #dce2d6;background:#fff;border-radius:12px;color:var(--green);font:inherit;font-size:14px;cursor:pointer}.metric-tabs button.active{background:var(--green);color:#fff;border-color:var(--green)}.board-rules p{font-size:13px;line-height:1.9;margin:16px 0}.question-media{margin:14px 0;text-align:center}.question-media img{max-width:100%;height:auto;max-height:600px;object-fit:contain}.question-media figcaption{font-size:11px;color:var(--muted)}
@media(max-width:650px){.bank-filters{grid-template-columns:1fr 1fr;gap:10px}.bank-filters .source-filter,.bank-filters .search-wrap{grid-column:span 2}.bank-intro .tabs{width:100%}.bank-intro .tabs button{flex:1}.metric-tabs{grid-template-columns:1fr 1fr;gap:8px}.metric-tabs button{min-height:52px;font-size:13px}.board-table th,.board-table td{padding:13px 9px;font-size:11px}.person-cell{gap:7px}.board-table .avatar{width:26px;height:26px}.question-preview{padding:16px}.bank-filters select{font-size:12px}.bank-intro>span{font-size:11px}}
.paper-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.paper-grid h2{margin:14px 0}.paper-grid .row{flex-wrap:wrap;gap:8px}.paper-reader{max-width:900px;margin:25px auto;overflow-wrap:anywhere}.paper-reader p{line-height:1.95;white-space:pre-wrap;font-size:15px;margin:10px 0}.paper-reader .question-media img{max-height:900px}@media(max-width:850px){.paper-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:520px){.paper-grid{grid-template-columns:1fr}.bank-intro .tabs{display:flex;flex-wrap:wrap}.bank-intro .tabs button{white-space:nowrap;font-size:11px;padding:10px}}
