:root {
  --void: #070b14;
  --panel: #101826;
  --card: #162033;
  --line: #2a3d5c;
  --ice: #2ee9d6;
  --lime: #d6ff3c;
  --rose: #ff5a7a;
  --ink: #e8f4ff;
  --mute: #93a6c4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(46, 233, 214, 0.22), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(214, 255, 60, 0.12), transparent 28%),
    linear-gradient(180deg, #0b1220 0%, var(--void) 58%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(30deg, transparent 46%, rgba(46, 233, 214, 0.18) 47%, transparent 49%),
    linear-gradient(150deg, transparent 46%, rgba(46, 233, 214, 0.12) 47%, transparent 49%);
  background-size: 42px 72px;
}

.site-switch {
  display: flex;
  width: min(920px, calc(100% - 32px));
  margin: 18px auto 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(16, 24, 38, 0.88);
  position: relative;
  z-index: 1;
}

.site-switch a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-align: center;
  padding: 11px 12px;
  color: var(--mute);
  text-decoration: none;
  font-family: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
}

.site-switch a.on {
  background: var(--ice);
  color: #06201c;
}

.wrap {
  width: min(920px, calc(100% - 32px));
  margin: 22px auto 48px;
  position: relative;
  z-index: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.brand-mark {
  width: 12px;
  height: 28px;
  background: var(--lime);
  box-shadow: 6px 0 0 var(--ice);
}

h1 {
  margin: 0;
  font-family: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  letter-spacing: 0.12em;
  color: #f4fbff;
  text-shadow: 0 0 24px rgba(46, 233, 214, 0.35);
}

.subtitle, .grade { color: var(--mute); }
.subtitle { margin: 8px 0 0; font-size: 1.02rem; line-height: 1.55; }
.grade { margin: 10px 0 0; letter-spacing: 0.16em; color: var(--lime); }
.grade span { margin-left: 8px; letter-spacing: 0; color: var(--mute); }

.back { margin: 0 0 10px; }
.back a {
  color: var(--ice);
  text-decoration: none;
  border-bottom: 1px dashed rgba(46, 233, 214, 0.45);
}

.sheet {
  margin-top: 20px;
  background: rgba(16, 24, 38, 0.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 0 0 1px rgba(46, 233, 214, 0.08), 0 18px 40px rgba(0, 0, 0, 0.28);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

label.field { display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem; color: var(--mute); }

select, button {
  font: inherit;
  border: 0;
  cursor: pointer;
  /* iPad touch target: at least 44 x 44 CSS px. */
  min-height: 44px;
}

button {
  min-width: 44px;
}

select {
  background: var(--card);
  color: var(--ink);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

button {
  font-family: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--ice);
  color: #06201c;
}

button.ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

button.berry {
  background: var(--lime);
  color: #142000;
}

.board {
  background: #0a111d;
  color: var(--ink);
  padding: 18px;
  min-height: 180px;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.eqs { display: grid; gap: 10px; font-size: 1.2rem; }
.eq { background: rgba(46, 233, 214, 0.06); padding: 10px 12px; border-radius: 10px; }

.hint { margin: 12px 0 0; color: var(--mute); }
.status { min-height: 1.5em; margin-top: 12px; color: var(--lime); }

.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.choice {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 8px;
  font-size: 1.15rem;
}

.choice.picture {
  border-radius: 18px;
  padding: 12px 10px 10px;
  text-align: left;
}

.scene {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.scene-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.glyph {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: block;
}

.glyph svg { width: 100%; height: 100%; display: block; }

.scene-lab {
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.scene-lab i {
  font-style: normal;
  color: var(--ice);
  margin-left: 2px;
}

.scene-yi {
  margin-top: 8px;
  font-size: 1.2rem;
  color: var(--lime);
}

.yao {
  font-size: 1.05rem;
  line-height: 1.55;
  letter-spacing: 0.08em;
}

.eq .scene { padding: 4px 0; }

.teach-name {
  font-family: "ZCOOL QingKe HuangYou", sans-serif;
  font-size: 2rem;
  letter-spacing: 0.12em;
}

.teach-yi {
  margin-top: 4px;
  color: var(--lime);
  font-size: 1.35rem;
}

.teach-lesson {
  margin: 10px 0 0;
  line-height: 1.6;
  color: var(--ink);
}

.teach-ask {
  margin: 12px 0 0;
  color: var(--ice);
}

.choice.picked { box-shadow: inset 0 0 0 2px var(--ice); }
.choice.ok { background: #1d3a1c; box-shadow: inset 0 0 0 2px var(--lime); }
.choice.bad { background: #3a1620; box-shadow: inset 0 0 0 2px var(--rose); }

.howto { margin-top: 12px; color: var(--mute); }
.howto summary {
  cursor: pointer;
  font-family: "ZCOOL QingKe HuangYou", sans-serif;
  font-size: 1.2rem;
  color: var(--ice);
}

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

a.card, .card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

a.card:hover {
  border-color: var(--ice);
  transform: translateY(-2px);
}

a.card b, .card b {
  display: block;
  font-family: "ZCOOL QingKe HuangYou", sans-serif;
  font-size: 1.45rem;
  margin: 6px 0;
  letter-spacing: 0.04em;
}

a.card p { margin: 0; color: var(--mute); line-height: 1.5; }

.stars { color: var(--lime); letter-spacing: 0.12em; }
.note { margin-top: 16px; color: var(--mute); }
h2 {
  font-family: "ZCOOL QingKe HuangYou", sans-serif;
  margin: 0 0 14px;
  letter-spacing: 0.08em;
}

.sheet h2 + .grid + h2 { margin-top: 22px; }

.lookup {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}

.lookup.twelve { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.lookup span, .jiazi-cell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  font-size: 0.95rem;
}

.step {
  background: #0a111d;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 12px 0 0;
  line-height: 1.65;
}

.step b { color: var(--lime); }

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

.go-teach {
  display: inline-block;
  margin-top: 12px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--lime);
  color: #142000;
  text-decoration: none;
  font-family: "ZCOOL QingKe HuangYou", sans-serif;
}

.print-area { display: none; }

@media print {
  body { background: white; color: black; }
  body::before, .site-switch, .toolbar, .sheet, header { display: none !important; }
  .print-area { display: block; }
  .print-item { border: 1px solid #333; padding: 12px; margin-bottom: 12px; }
}
