:root {
  --teal: #0f766e;
  --teal-dark: #115e59;
  --sand: #f4efe6;
  --ink: #1f2937;
  --card: #ffffff;
  --tab: 64px;
}
html, body {
  background: var(--sand);
  color: var(--ink);
  font-family: "PingFang SC", "Noto Sans SC", "Helvetica Neue", sans-serif;
}
body {
  padding-bottom: calc(var(--tab) + env(safe-area-inset-bottom));
}
.container-narrow {
  width: min(720px, 100%);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
.app-top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--teal);
  color: #fff;
  padding: 12px 0;
}
.brand {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  font-size: 1.1rem;
}
.child-select {
  max-width: 140px;
}
.app-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tab) + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
}
.tab-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
}
.tab-item.active {
  color: var(--teal);
}
.card-soft {
  background: var(--card);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.08);
}
.hero {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
}
.hero .text-muted { color: rgba(255,255,255,.85) !important; }
.eyebrow { letter-spacing: .08em; font-size: .8rem; opacity: .85; }
.stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  text-align: center;
}
.stat-num { font-size: 1.6rem; font-weight: 800; color: var(--teal-dark); }
.stat-label { color: #6b7280; font-size: .85rem; }
.section-title { font-size: 1rem; font-weight: 700; margin: 8px 0 10px; }
.mode-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  min-height: 88px;
  box-shadow: 0 6px 16px rgba(0,0,0,.04);
}
.mode-card span { color: #6b7280; font-size: .9rem; }
.mode-review { background: #ecfdf5; }
.kind-song { background: #fff7ed; }
.kind-word { background: #eff6ff; }
.kind-vocab { background: #f5f3ff; }
.kind-expr { background: #fdf2f8; }
.lyric-box {
  white-space: pre-wrap;
  text-align: left;
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 1.05rem;
  line-height: 1.55;
}
.app-tabbar .tab-item { font-size: .82rem; }
.grade-bar {
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
}
.bar-track {
  height: 8px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill { height: 100%; background: var(--teal); }
.train-card { min-height: 280px; }
.en-word {
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  font-weight: 800;
  letter-spacing: .02em;
  word-break: break-word;
}
.flash-face {
  display: block;
  width: 100%;
  border: 0;
  background: #f8fafc;
  border-radius: 16px;
  padding: 18px 12px;
  text-align: center;
  min-height: 140px;
  -webkit-tap-highlight-color: rgba(15,118,110,.18);
}
.zh-prompt {
  font-size: clamp(1.4rem, 6vw, 2rem);
  font-weight: 700;
}
.phonetic { color: #6b7280; }
.choice-btn, .flash-btn, .big-action {
  min-height: 52px;
  font-size: 1.05rem;
  border-radius: 14px;
}
.spell-input {
  font-size: 1.4rem;
  text-align: center;
  letter-spacing: .04em;
  min-height: 56px;
}
.feedback {
  min-height: 28px;
  font-weight: 600;
  text-align: center;
}
.ok { color: #047857; }
.bad { color: #b91c1c; }
.word-item {
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
}
.speak-btn {
  border: 0;
  background: #ecfdf5;
  color: var(--teal-dark);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  font-weight: 700;
}
.child-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
}
.panel-mask {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 40;
  pointer-events: none;
}
.panel-mask.show {
  display: block;
  pointer-events: auto;
}
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 86vw);
  height: 100%;
  background: #fff;
  z-index: 50;
  transform: translateX(100%);
  transition: transform .2s ease;
  box-shadow: -8px 0 24px rgba(0,0,0,.12);
}
.side-panel.show { transform: translateX(0); }
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
}
.side-head h5 { margin: 0; font-size: 1.05rem; }
.side-body { padding: 16px; overflow-y: auto; height: calc(100% - 60px); }
.mode-card, .tab-item, .btn, .speak-btn {
  -webkit-tap-highlight-color: rgba(15,118,110,.18);
  cursor: pointer;
  touch-action: manipulation;
}
@media (min-width: 768px) {
  .train-card { min-height: 340px; padding: 28px; }
}
