:root {
  --bg: #f4efe6;
  --paper: #fffdf8;
  --ink: #1c1916;
  --muted: #6b6258;
  --line: #e4d8c6;
  --accent: #8b4513;
  --accent-2: #0f6b5c;
  --ok: #1b7f4a;
  --bad: #b42318;
  --fill: #f0e6d4;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font: 17px/1.7 "Songti SC", "Source Han Serif SC", "Noto Serif SC", "Iowan Old Style", Palatino, serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse at top, #faf6ee 0%, transparent 55%),
    linear-gradient(180deg, #efe7da, var(--bg));
  min-height: 100vh;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.4rem;
  background: #3d2b1f;
  color: #f6f1e7;
}
.brand-row { display: flex; align-items: baseline; gap: 0.75rem; }
.portal { color: inherit; text-decoration: none; opacity: 0.7; font-size: 0.92rem; }
.brand { color: inherit; text-decoration: none; font-weight: 700; letter-spacing: 0.04em; }
.wrap { max-width: 820px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }
/* 听写页：宽屏 / 横屏尽量铺满，压缩两侧留白 */
body:has(#dict-stage) .wrap {
  max-width: min(1280px, 98vw);
  padding: 0.75rem 0.45rem 1.5rem;
}
body:has(#dict-stage) .lesson-hd {
  margin-bottom: 0.55rem;
}
body:has(#dict-stage) .lesson-hd h1 {
  font-size: 1.35rem;
}
body:has(#dict-stage) .crumb {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
}
.hero-block h1 { margin: 0 0 0.4rem; font-size: 2rem; }
.lead, .muted, .hint, .crumb { color: var(--muted); }
.crumb a { color: var(--accent); text-decoration: none; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.9rem;
  margin-top: 1.4rem;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}
.card.on { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.card.muted { opacity: 0.55; }
.card strong { font-size: 1.05rem; }
.card span { color: var(--muted); font-size: 0.9rem; }
.en-hub.hero-block h1 { font-size: 2.15rem; }
.en-hub.hero-block .lead { font-size: 1.05rem; }
.en-hub.card-grid .card strong { font-size: 1.14rem; }
.en-hub.card-grid .card span { font-size: 0.96rem; }
.en-units-title { margin: 0 0 0.35rem; font-size: 1.85rem; }
.en-units-lead { font-size: 1.05rem; }
.en-unit-list a { font-size: 1.08rem; }
.en-unit-list span { font-size: 0.98rem; }
.lesson-list { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.lesson-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  margin-bottom: 0.55rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}
.lesson-hd {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.lesson-hd h1 { margin: 0; }
.en-unit-hd { margin-bottom: 0.55rem; }
.en-unit-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.25;
}
.en-loop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--accent-2);
  border-radius: 999px;
  background: var(--paper);
  color: var(--accent-2);
  cursor: pointer;
}
.en-loop-btn .ico-pause { display: none; }
.en-loop-btn.on {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
}
.en-loop-btn.on .ico-play { display: none; }
.en-loop-btn.on .ico-pause { display: block; }
.en-loop-btn:active { transform: scale(0.96); }
.mode-tabs { display: flex; gap: 0.4rem; }
.mode-tab, .word-chip, .dict-confirm, .dict-skip, .speaker-btn, .idx-dot, .linkish {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
}
.mode-tab {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 0.35rem 0.9rem;
}
.mode-tab.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.mode-panel[hidden] { display: none !important; }
.dict-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.seg {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  cursor: pointer;
}
.seg:has(input:checked) {
  border-color: var(--accent-2);
  background: #e8f4f1;
}
.dict-stage { max-width: none; width: 100%; margin: 0 auto; }
.dict-card {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  min-height: min(70vh, 620px);
  padding: 0.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
}
@media (orientation: landscape), (min-width: 900px) {
  body:has(#dict-stage) .dict-card {
    min-height: calc(100dvh - 8.5rem);
  }
  body:has(#dict-stage) .write-pad {
    flex: 1 1 auto;
    min-height: 52vh;
  }
  body:has(#dict-stage) .dict-toolbar {
    margin-bottom: 0.45rem;
  }
}
.dict-index {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 3rem;
  padding-right: 0.75rem;
  border-right: 1px solid var(--line);
}
.idx-dot {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0;
}
.idx-dot.on {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.idx-dot.ok {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.idx-dot.bad {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.idx-dot.on.ok,
.idx-dot.on.bad {
  box-shadow: inset 0 0 0 2px #3d2b1f;
}
.dict-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.dict-head { display: flex; flex-direction: column; gap: 0.2rem; }
.dict-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.dict-word-label { font-weight: 700; font-size: 1.05rem; }
.speaker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-2);
}
.speaker-btn:active { transform: scale(0.96); }
.dict-pinyin {
  margin: 0.15rem 0 0;
  font-size: 1.45rem;
  letter-spacing: 0.1em;
  color: var(--accent-2);
}
.dict-progress-mini {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.write-pad {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 0;
}
.write-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.recog-preview { color: var(--accent-2); }
.write-canvas {
  width: 100%;
  touch-action: none;
  border: 1.5px dashed #c9b79a;
  border-radius: 12px;
  background: #fffef9;
  cursor: crosshair;
}
.write-tools { display: flex; justify-content: flex-end; }
.linkish {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.2rem 0.4rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.dict-judge {
  min-height: 1.4rem;
  margin: 0;
  text-align: center;
  font-weight: 700;
}
.dict-judge.ok { color: var(--ok); }
.dict-judge.bad { color: var(--bad); }
.dict-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding-top: 0.2rem;
}
.dict-confirm, .dict-skip {
  min-width: 6.5rem;
  padding: 0.65rem 1.2rem;
  font-size: 1rem;
  border-radius: 999px;
}
.dict-confirm {
  border: 0;
  background: var(--accent);
  color: #fff;
}
.dict-skip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.dict-confirm:disabled, .dict-skip:disabled { opacity: 0.55; cursor: default; }
.dict-done {
  text-align: center;
  padding: 2.5rem 1.2rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.dict-done h2 { margin: 0 0 0.5rem; }
@media (max-width: 640px) {
  .dict-card {
    flex-direction: column;
    min-height: auto;
  }
  .dict-index {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    flex: none;
    padding: 0 0 0.6rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    justify-content: center;
  }
}
.word-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.35rem 0 0.85rem;
}
.word-chip {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 0.35rem 0.8rem;
}
#en-chips .word-chip {
  font-size: 1.08rem;
  padding: 0.42rem 0.92rem;
}
.word-chip.on {
  border-color: var(--accent);
  background: var(--fill);
}
.word-chip.looping {
  border-color: var(--accent-2);
  background: #e4f3ee;
}
.en-card.looping {
  box-shadow: inset 3px 0 0 var(--accent-2);
}
.etym-result { display: grid; gap: 0.8rem; }
.char-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.char-hd {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  margin-bottom: 0.35rem;
}
.char-big {
  font-size: 2.6rem;
  line-height: 1;
  font-weight: 700;
}
.char-meta { display: grid; gap: 0.15rem; }
.char-card .py { color: var(--accent-2); margin: 0; }
.char-card .py-alt {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.char-sec { margin-top: 0.85rem; }
.char-card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: var(--accent);
}
.char-card p { margin: 0; }
.form-story { line-height: 1.55; }
.benyi { font-size: 1.05rem; }
.benyi-ex {
  margin-top: 0.35rem !important;
  color: var(--muted);
  font-size: 0.92rem;
}
.split-box { margin-top: 0.2rem; }
.split-visual {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  font-size: 1.15rem;
}
.split-part, .split-whole {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 2.2rem;
}
.split-part b, .split-whole b { font-size: 1.35rem; font-weight: 700; }
.split-part small { font-size: 0.7rem; color: var(--muted); }
.split-plus, .split-eq { color: var(--muted); }
.split-note {
  margin-top: 0.35rem !important;
  font-size: 0.88rem;
  color: var(--muted);
}
.form-parts-box {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.form-parts-box li {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.35rem 0.55rem;
  align-items: baseline;
  padding: 0.35rem 0.55rem;
  background: var(--fill);
  border-radius: 8px;
}
.fp-char { font-weight: 700; font-size: 1.05rem; }
.fp-role {
  font-size: 0.78rem;
  color: var(--accent);
  white-space: nowrap;
}
.fp-hint { font-size: 0.9rem; color: var(--ink); }
.yinyi-list {
  margin: 0;
  padding-left: 1.2rem;
}
.yinyi-list li { margin: 0.15rem 0; }
.yinyi-steps {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.45rem;
}
.yinyi-steps li strong { display: block; }
.yinyi-steps li span {
  display: block;
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.form-parts {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.2rem;
}
.form-parts li { margin: 0.2rem 0; }
.glyph-evolve {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.15rem;
  margin: 0.55rem 0 0.35rem;
}
.glyph-step {
  margin: 0;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
}
.glyph-step img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
}
.glyph-char {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  line-height: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}
.glyph-arrow {
  color: var(--line);
  font-size: 0.85rem;
  padding: 0 0.1rem;
  margin-bottom: 1rem;
}
.glyph-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.glyph-row figure {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}
.glyph-row img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.word-empty { color: var(--muted); }
.source-link {
  display: inline-block;
  margin-top: 0.6rem;
  color: var(--accent);
  font-size: 0.88rem;
}
/* 音标知识库 */
body:has(.ipa-kb) .wrap {
  max-width: 64rem;
}
.ipa-kb {
  --ipa-card: #fffdf9;
  --ipa-mark: #f3e3a2;
  --ipa-color: #7a3410;
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 2.5rem;
  margin-top: 0.5rem;
}
.ipa-kb .ipa, .ipa-kb i.ipa, .ipa-kb b.ipa, .ipa-kb td.ipa {
  font-family: "STIX Two Text", "Times New Roman", "Lucida Grande", serif;
  font-style: normal;
  font-weight: 400;
  color: var(--ipa-color);
}
.ipa-nav {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.92rem;
}
.ipa-nav a {
  text-decoration: none;
  color: var(--muted);
}
.ipa-nav a:hover { color: var(--ink); }
.ipa-main h1 {
  font-size: 1.85rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  letter-spacing: 0.02em;
}
.ipa-main h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2.75rem 0 0.6rem;
  padding-top: 0.2rem;
}
.ipa-main h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.4rem 0 0.45rem;
}
.ipa-main p { margin: 0.45rem 0; }
.ipa-main .lead { margin-bottom: 1.4rem; }
.ipa-main .note { color: var(--muted); font-size: 0.92rem; }
.ipa-main section { scroll-margin-top: 1.25rem; }
.ipa-kb .band {
  background: var(--ipa-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 0.6rem 1rem;
  padding: 0.9rem 1rem;
  margin: 0.7rem 0;
}
.ipa-kb .band > strong { align-self: center; }
.ipa-kb .rows { display: flex; flex-direction: column; gap: 0.55rem; }
.ipa-kb .row {
  display: grid;
  grid-template-columns: 4.6rem 1fr;
  gap: 0.6rem;
  align-items: center;
}
.ipa-kb .row span.label { color: var(--muted); font-size: 0.86rem; }
.ipa-kb .cells { display: grid; gap: 0.35rem; }
.ipa-kb .cells b {
  display: block;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.15rem;
  font-weight: 500;
  background: #fff;
}
.ipa-kb .cells b.mark {
  background: var(--ipa-mark);
  border-color: #e2cd78;
}
.ipa-kb .c7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ipa-kb .c8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.ipa-kb .c10 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.ipa-kb .c3 { grid-template-columns: repeat(3, minmax(0, 5.2rem)); justify-content: start; }
.ipa-kb .c2 { grid-template-columns: repeat(2, minmax(0, 5.2rem)); justify-content: start; }
.ipa-kb .group-label { font-size: 0.86rem; color: var(--muted); margin: 0.15rem 0 0; }
.ipa-kb audio { width: min(100%, 22rem); margin: 0.4rem 0 0.8rem; }
.ipa-kb .split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  border-left: 3px solid var(--accent);
  padding: 0.2rem 0 0.2rem 1rem;
  margin: 1.2rem 0 0.4rem;
}
.ipa-kb .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ipa-kb .chips span {
  border: 1px solid var(--line);
  background: var(--ipa-card);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
}
.ipa-kb table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 0.8rem;
  font-size: 0.95rem;
}
.ipa-kb th, .ipa-kb td {
  text-align: left;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.ipa-kb th { color: var(--muted); font-weight: 600; font-size: 0.82rem; }
.ipa-kb tr:last-child td { border-bottom: 0; }
.ipa-kb ol.steps { margin: 0.4rem 0; padding-left: 1.3rem; }
.ipa-kb ol.steps li { margin: 0.25rem 0; }
.ipa-kb .strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.6rem 0;
}
.ipa-kb .strip.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ipa-kb .tile {
  background: var(--ipa-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.6rem 0.45rem;
}
.ipa-kb .tile strong { display: block; font-size: 1.05rem; }
.ipa-kb .tile small { display: block; color: var(--muted); font-size: 0.78rem; line-height: 1.35; }
.ipa-kb .callout {
  background: #f3ecdf;
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  margin: 0.6rem 0;
}
@media (max-width: 800px) {
  .ipa-kb { grid-template-columns: 1fr; gap: 1rem; }
  .ipa-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
  }
  .ipa-kb .split,
  .ipa-kb .strip,
  .ipa-kb .strip.four { grid-template-columns: 1fr 1fr; }
  .ipa-kb .c10,
  .ipa-kb .c8,
  .ipa-kb .c7 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.en-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.2rem 1.3rem;
  margin-top: 0.4rem;
}
.en-card[hidden] { display: none !important; }
.en-spell {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.45rem;
  line-height: 1.25;
  letter-spacing: 0.02em;
  margin: 0 0 0.35rem;
}
.en-spell .vowel { color: #c62828; font-weight: 700; }
.en-spell .speaker-btn {
  width: 1.95rem;
  height: 1.95rem;
}
.en-ipa {
  font-family: "Charis SIL", "Doulos SIL", "Noto Sans", Georgia, serif;
  font-size: 1.42rem;
  color: var(--accent-2);
  margin: 0 0 0.45rem;
  letter-spacing: 0.04em;
}
.en-zh {
  margin: 0 0 0.95rem;
  color: var(--ink);
  font-size: 1.18rem;
}
.en-ex {
  margin: 0;
  padding: 0.75rem 0 0.15rem 0.95rem;
  border-left: 3px solid var(--accent);
  font-size: 1.18rem;
}
.en-ex b, .en-ex .ex-w.focus { font-weight: 700; }
.ex-hd { margin-bottom: 0.3rem; }
.ex-label {
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
}
.ex-line {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
  line-height: 1.65;
}
.ex-accents {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.55rem;
  vertical-align: middle;
}
.ex-w {
  display: inline;
  margin: 0;
  padding: 0 0.05em;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  border-radius: 3px;
}
.ex-w:hover, .ex-w.on { background: #efe4cf; }
.ex-w:focus { outline: none; }
.ex-w:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.ex-p { color: var(--ink); }
.ex-ipa {
  margin: 0.4rem 0 0;
  font-family: "Charis SIL", "Doulos SIL", "Noto Sans", Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.en-card .word-speak {
  font-size: 0.92rem;
  padding: 0.28rem 0.62rem;
}
.ipa-v { color: var(--accent-2); }
.word-chip sup { color: var(--accent); font-size: 0.7em; }
.en-head { cursor: pointer; }
#word-sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
}
.word-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(28, 25, 22, 0.45);
  cursor: pointer;
}
.word-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(76vh, 560px);
  overflow: auto;
  background: var(--paper);
  border-radius: 16px 16px 0 0;
  padding: 1rem 1.2rem 1.6rem;
  box-shadow: 0 -8px 28px rgba(28, 25, 22, 0.16);
}
.word-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}
.word-hd h2 { margin: 0; font-size: 1.4rem; }
.word-ipa-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.2rem 0 0;
  min-height: 1.4rem;
}
.word-ipa { margin: 0; color: var(--accent-2); font-family: Georgia, "Times New Roman", serif; }
.word-speak {
  font: inherit;
  font-size: 0.82rem;
  line-height: 1;
  border: 1px solid var(--accent-2);
  background: var(--fill);
  color: var(--accent-2);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  cursor: pointer;
  min-width: 2rem;
}
.word-speak:disabled { opacity: 0.5; cursor: default; }
.word-speak.playing { background: var(--accent-2); color: #fff; }
.word-close {
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0.2rem;
}
.word-sense { margin: 0.7rem 0; }
.word-sense .pos { color: var(--accent-2); font-style: italic; margin-right: 0.35rem; }
.word-sense .zh { color: var(--ink); }
.word-sense .en { margin: 0.2rem 0 0; color: #3c342c; }
.word-sense .ex { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.92rem; }
.word-note { margin: 0 0 0.6rem; color: var(--accent); font-size: 0.88rem; }
@media (min-width: 720px) {
  .word-panel {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 12vh;
    width: min(420px, 90vw);
    transform: translateX(-50%);
    border-radius: 16px;
    max-height: min(70vh, 560px);
  }
}

@media (max-width: 640px) {
  .wrap { padding: 1.1rem 0.9rem 3rem; }
  .hero-block h1 { font-size: 1.6rem; }
  .en-hub.hero-block h1 { font-size: 1.72rem; }
  .en-units-title { font-size: 1.65rem; }
  .en-spell { font-size: 2rem; }
  .en-unit-title { font-size: 1.55rem; }
}
