/* ================= 基础 ================= */
:root {
  --bg: #FFF7F0;
  --bg-2: #FDF0E4;
  --surface: #FFFFFF;
  --ink: #2C2438;
  --ink-2: #6E6784;
  --ink-3: #A49DB4;
  --primary: #FF7A45;
  --primary-dark: #E85E2A;
  --primary-soft: #FFEDE3;
  --mint: #1FB6A6;
  --mint-soft: #E3F7F3;
  --sky: #4C9AFF;
  --sky-soft: #EAF2FF;
  --sun: #FFC53D;
  --sun-soft: #FFF6DE;
  --grape: #8B7BE8;
  --grape-soft: #F0ECFF;
  --line: #F1E7DB;
  --shadow-sm: 0 2px 8px rgba(120, 90, 60, .06);
  --shadow: 0 10px 30px rgba(120, 90, 60, .09);
  --shadow-lg: 0 24px 60px rgba(120, 90, 60, .14);
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-en: "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 8% -10%, #FFE9D6 0%, transparent 55%),
    radial-gradient(900px 500px at 95% 0%, #E8F6F2 0%, transparent 50%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
.hidden { display: none !important; }

/* ================= 登录 ================= */
.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 20px;
  overflow: hidden;
}
.login-deco {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .55;
  pointer-events: none;
}
.login-deco.d1 { width: 320px; height: 320px; background: #FFD9C0; top: -110px; left: -90px; }
.login-deco.d2 { width: 240px; height: 240px; background: #CDEFE8; bottom: -80px; right: -60px; }
.login-deco.d3 { width: 120px; height: 120px; background: #FFE9A8; top: 18%; right: 12%; }

.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 32px;
  padding: 32px 30px 26px;
  box-shadow: var(--shadow-lg);
  animation: rise .5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: linear-gradient(140deg, #FF9B6A, #FF6B3D);
  color: #fff;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.5px;
  box-shadow: 0 8px 18px rgba(255, 122, 69, .35);
}
.brand h1 { font-size: 19px; letter-spacing: .3px; }
.brand-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.brand.small .brand-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; }
.brand.small h1 { font-size: 16px; }

.login-lead {
  margin: 22px 0 20px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-2);
}

.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #F6EFE6;
  border-radius: 14px;
  margin-bottom: 18px;
}
.seg.small { margin-bottom: 0; }
.seg-btn {
  flex: 1;
  padding: 9px 0;
  font-size: 13.5px;
  color: var(--ink-2);
  border-radius: 11px;
  transition: .18s;
}
.seg-btn.active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 7px;
  font-weight: 500;
}
.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--ink);
  background: #FFFDFB;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  outline: none;
  transition: .18s;
}
.field input::placeholder { color: #C6BFCE; }
.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 122, 69, .12);
  background: #fff;
}
.code-row { display: flex; gap: 9px; }
.code-row input { flex: 1; }
.btn-code {
  flex: 0 0 auto;
  padding: 0 14px;
  height: 46px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 13px;
  white-space: nowrap;
  transition: .18s;
}
.btn-code:hover:not(:disabled) { background: #FFE0D0; }
.btn-code:disabled { color: var(--ink-3); background: #F4EFE9; cursor: default; }

.btn-primary {
  width: 100%;
  height: 50px;
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .5px;
  border-radius: 15px;
  background: linear-gradient(135deg, #FF8F5E, #FF6B34);
  box-shadow: 0 12px 24px rgba(255, 107, 52, .3);
  transition: .18s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 28px rgba(255, 107, 52, .34); }
.btn-primary:active { transform: none; }
.btn-primary:disabled { opacity: .6; cursor: default; transform: none; }

.form-error {
  font-size: 12.5px;
  color: #D9492F;
  background: #FFF0EC;
  padding: 9px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  line-height: 1.5;
}
.login-tip {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.6;
}
.login-foot {
  position: relative;
  margin-top: 22px;
  font-size: 11.5px;
  color: #B3AABE;
  text-align: center;
}

/* ================= 布局 ================= */
.app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: rgba(255, 255, 255, .6);
  border-right: 1px solid rgba(241, 231, 219, .9);
  backdrop-filter: blur(10px);
}

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  font-size: 14px;
  color: var(--ink-2);
  border-radius: 12px;
  text-align: left;
  transition: .16s;
}
.nav-item:hover { background: rgba(255, 255, 255, .8); color: var(--ink); }
.nav-item.active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.nav-ico { font-size: 16px; }

.side-kid {
  margin-top: auto;
  padding: 14px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.side-kid .sk-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.side-kid .sk-emoji {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--sun-soft); border-radius: 11px; font-size: 18px;
}
.side-kid .sk-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.side-kid .sk-meta { font-size: 11px; color: var(--ink-3); }
.side-out {
  padding: 9px;
  font-size: 12px;
  color: var(--ink-3);
  border-radius: 10px;
  border: 1px dashed var(--line);
  transition: .16s;
}
.side-out:hover { color: var(--ink-2); border-color: #E2D5C6; }

.main {
  padding: 26px 34px 60px;
  max-width: 1120px;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}
.topbar h2 { font-size: 24px; letter-spacing: .5px; }
.page-date { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.streak-pill {
  padding: 8px 13px;
  font-size: 11.5px;
  color: #B4632B;
  background: #FFEFD9;
  border-radius: 999px;
  border: 1px solid #FFE0BC;
}
.streak-pill b { font-size: 14px; }
.avatar {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-size: 21px;
  background: #fff;
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.view { animation: fade .3s ease both; }
@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ================= 通用卡片 ================= */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .8);
}
.card-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title h3 { font-size: 15px; letter-spacing: .3px; }
.card-title .hint { font-size: 11.5px; color: var(--ink-3); }

.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ================= 今日 ================= */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  padding: 26px 28px;
  background: linear-gradient(135deg, #FFF3E9 0%, #FFE7D6 55%, #FFDFC9 100%);
  border: 1px solid #FFE3CF;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  width: 220px; height: 220px;
  right: -60px; top: -70px;
  background: radial-gradient(circle, rgba(255, 255, 255, .8), transparent 65%);
  border-radius: 50%;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .75);
  color: #B4632B;
  margin-bottom: 12px;
}
.hero h3 { font-size: 22px; letter-spacing: .3px; }
.hero .hero-en {
  font-family: var(--font-en);
  font-size: 17px;
  color: #8A5A38;
  margin-top: 6px;
  letter-spacing: .3px;
}
.hero-meta { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.chip {
  font-size: 11.5px;
  padding: 5px 11px;
  background: rgba(255, 255, 255, .82);
  border-radius: 999px;
  color: #7A5B44;
}
.hero-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.btn-start {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(135deg, #FF8F5E, #FF6B34);
  box-shadow: 0 10px 22px rgba(255, 107, 52, .3);
  transition: .18s;
}
.btn-start:hover { transform: translateY(-1px); }
.btn-ghost {
  padding: 11px 18px;
  font-size: 13px;
  color: #8A5A38;
  border-radius: 13px;
  background: rgba(255, 255, 255, .7);
  transition: .16s;
}
.btn-ghost:hover { background: #fff; }

.ring-wrap { position: relative; width: 120px; height: 120px; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-center {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  text-align: center;
}
.ring-center b { font-size: 21px; display: block; line-height: 1.1; }
.ring-center span { font-size: 10.5px; color: #9A7455; }

.stat-card {
  background: #fff;
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, .9);
}
.stat-card .sc-label { font-size: 11.5px; color: var(--ink-3); }
.stat-card .sc-value { font-size: 22px; font-weight: 700; margin-top: 6px; letter-spacing: .5px; }
.stat-card .sc-value small { font-size: 11.5px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.stat-card .sc-sub { font-size: 11px; color: var(--ink-3); margin-top: 4px; }

.week-dots { display: flex; gap: 6px; margin-top: 4px; }
.wd {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--ink-3);
}
.wd i {
  display: block;
  height: 26px;
  margin-bottom: 6px;
  border-radius: 9px;
  background: #F6F1EA;
  font-style: normal;
  line-height: 26px;
  font-size: 11px;
  color: #C9C2D2;
}
.wd.on i { background: linear-gradient(160deg, #FFB685, #FF8A56); color: #fff; }
.wd.today i { box-shadow: 0 0 0 2px #FFD9C4 inset; }

/* 复习预告 */
.review-teaser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--r);
  background: linear-gradient(135deg, #EAF7F4, #DFF3EE);
  border: 1px solid #D2EDE6;
}
.review-teaser h4 { font-size: 14px; }
.review-teaser p { font-size: 11.5px; color: #4F7F77; margin-top: 4px; }
.word-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.word-chip {
  font-family: var(--font-en);
  font-size: 12px;
  padding: 4px 10px;
  background: #fff;
  border-radius: 8px;
  color: #2F6B62;
}
.btn-sm {
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #33C6B4, #16A493);
  border-radius: 11px;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(31, 182, 166, .25);
  transition: .16s;
}
.btn-sm:hover { transform: translateY(-1px); }
.btn-sm.plain {
  background: #fff; color: var(--ink-2); box-shadow: var(--shadow-sm); font-weight: 500;
}

/* ================= 课程表 ================= */
.course-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.course-head p { font-size: 12.5px; color: var(--ink-2); }

.unit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.unit-card {
  background: #fff;
  border-radius: var(--r);
  padding: 16px 16px 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, .9);
  transition: .18s;
}
.unit-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.unit-head { display: flex; align-items: center; gap: 11px; }
.unit-no {
  width: 38px; height: 38px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 12px;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.unit-head h4 { font-size: 14px; }
.unit-head .unit-zh { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.unit-prog { margin-left: auto; font-size: 11px; color: var(--ink-3); }

.lesson-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: .15s;
  border-top: 1px dashed #F5EDE4;
}
.lesson-row:first-of-type { margin-top: 8px; }
.lesson-row:hover { background: #FFFAF5; }
.lesson-dot {
  width: 22px; height: 22px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 10px;
  background: #F6F1EA;
  color: #B9B1C4;
  border: 1.5px solid #EFE6DA;
}
.lesson-row.done .lesson-dot:not(.next) { background: var(--mint); border-color: var(--mint); color: #fff; }
.lesson-dot.next { background: var(--primary); border-color: var(--primary); color: #fff; }
.lesson-name { font-size: 12.5px; color: var(--ink); }
.lesson-row.done .lesson-name { color: var(--ink-2); }
.lesson-type { margin-left: auto; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.lesson-stars { font-size: 9.5px; color: var(--sun); letter-spacing: 1px; }

/* ================= 复习 ================= */
.review-stage { max-width: 560px; margin: 0 auto; }
.review-card {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 32px 28px 24px;
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.review-top {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; color: var(--ink-3); margin-bottom: 18px;
}
.review-emoji { font-size: 66px; line-height: 1; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .07)); }
.review-zh { font-size: 20px; margin-top: 14px; letter-spacing: 1px; }
.review-en {
  font-family: var(--font-en);
  font-size: 26px;
  color: var(--primary-dark);
  margin-top: 8px;
  letter-spacing: 1px;
  min-height: 34px;
}
.review-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 10px; }
.review-btns { display: flex; gap: 10px; margin-top: 22px; }
.review-btns button {
  flex: 1;
  height: 46px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 14px;
  transition: .16s;
}
.btn-know { color: #fff; background: linear-gradient(135deg, #33C6B4, #16A493); box-shadow: 0 10px 20px rgba(31, 182, 166, .22); }
.btn-again { color: #9A5B3A; background: #FFF1E6; }
.btn-play {
  width: 54px; height: 54px;
  margin: 16px auto 0;
  display: grid; place-items: center;
  font-size: 20px;
  border-radius: 50%;
  background: var(--sky-soft);
  transition: .16s;
}
.btn-play:hover { transform: scale(1.05); }

.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--ink-2);
}
.empty .emoji { font-size: 46px; }
.empty h3 { margin: 14px 0 6px; font-size: 16px; }
.empty p { font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }

/* ================= 家长看板 ================= */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 150px;
  padding-top: 10px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%;
  max-width: 34px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #FFB07C, #FF8A56);
  min-height: 4px;
  transition: height .5s cubic-bezier(.2, .8, .2, 1);
}
.bar.zero { background: #F5EFE7; }
.bar-label { font-size: 10px; color: var(--ink-3); }
.bar-val { font-size: 9.5px; color: var(--ink-3); }

.unit-bars { display: flex; flex-direction: column; gap: 9px; }
.ub-row { display: flex; align-items: center; gap: 10px; font-size: 11.5px; }
.ub-name { width: 116px; flex: 0 0 auto; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ub-track { flex: 1; height: 7px; border-radius: 99px; background: #F5EFE7; overflow: hidden; }
.ub-fill { height: 100%; border-radius: 99px; transition: width .4s; }
.ub-num { width: 30px; text-align: right; color: var(--ink-3); font-size: 10.5px; }

.log-list { display: flex; flex-direction: column; }
.log-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed #F5EDE4;
  font-size: 12.5px;
}
.log-row:last-child { border-bottom: none; }
.log-row .lr-ico { width: 26px; height: 26px; display: grid; place-items: center; background: #FFF7EE; border-radius: 8px; font-size: 13px; }
.log-row .lr-main { flex: 1; }
.log-row .lr-sub { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; }
.log-row .lr-time { font-size: 10.5px; color: var(--ink-3); }

.kid-edit { display: flex; align-items: center; gap: 12px; }
.kid-edit .ke-emoji {
  width: 52px; height: 52px; display: grid; place-items: center;
  font-size: 26px; background: var(--sun-soft); border-radius: 16px;
}
.kid-edit h3 { font-size: 16px; }
.kid-edit p { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.goal-row { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.goal-pill {
  padding: 7px 13px;
  font-size: 11.5px;
  border-radius: 999px;
  background: #F7F2EC;
  color: var(--ink-2);
  transition: .16s;
}
.goal-pill.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }

/* ================= 上课浮层 ================= */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(44, 36, 56, .38);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade .2s both;
}
.overlay-inner {
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  overflow-y: auto;
  background: #FFFCF8;
  border-radius: 30px;
  padding: 26px 26px 22px;
  box-shadow: var(--shadow-lg);
  animation: pop .28s cubic-bezier(.2, .9, .3, 1.1) both;
}
@keyframes pop {
  from { opacity: 0; transform: scale(.96) translateY(10px); }
  to { opacity: 1; transform: none; }
}
.ses-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ses-kicker { font-size: 11px; color: var(--ink-3); letter-spacing: .5px; }
.ses-close {
  width: 32px; height: 32px; border-radius: 10px;
  background: #F5EFE7; color: var(--ink-2); font-size: 15px;
}
.steps { display: flex; gap: 6px; margin-bottom: 20px; }
.step {
  flex: 1; height: 5px; border-radius: 99px; background: #F1E8DD;
  transition: .2s;
}
.step.on { background: linear-gradient(90deg, #FFB07C, #FF7A45); }

.ses-title { font-size: 19px; letter-spacing: .3px; }
.ses-sub { font-family: var(--font-en); font-size: 13px; color: var(--ink-3); margin-top: 5px; }

.story { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.story-line {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: .16s;
}
.story-line:hover { transform: translateX(2px); }
.story-line .sl-play {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--sky-soft);
  font-size: 13px;
}
.story-line .sl-en { font-family: var(--font-en); font-size: 15px; letter-spacing: .2px; }
.story-line .sl-zh { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 10px; margin: 16px 0; }
.word-tile {
  background: #fff;
  border-radius: 16px;
  padding: 16px 12px 13px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: .16s;
  border: 1.5px solid transparent;
}
.word-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.word-tile.spoken { border-color: #FFD9C4; }
.word-tile .wt-emoji { font-size: 30px; line-height: 1; }
.word-tile .wt-en { font-family: var(--font-en); font-size: 14px; margin-top: 9px; letter-spacing: .2px; }
.word-tile .wt-zh { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; }

.quiz-q { text-align: center; margin: 6px 0 18px; }
.quiz-q .qq-emoji { font-size: 54px; }
.quiz-q .qq-text { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.quiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-opt {
  padding: 15px;
  font-family: var(--font-en);
  font-size: 15px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: .15s;
  border: 1.5px solid transparent;
}
.quiz-opt:hover { transform: translateY(-1px); }
.quiz-opt.right { background: var(--mint-soft); border-color: #9BE0D5; color: #16796D; }
.quiz-opt.wrong { background: #FFEDE9; border-color: #FFC2B5; color: #C0432A; }

.spell-slots { display: flex; justify-content: center; gap: 8px; margin: 22px 0; flex-wrap: wrap; }
.slot {
  width: 44px; height: 54px;
  display: grid; place-items: center;
  font-family: var(--font-en);
  font-size: 22px;
  background: #fff;
  border-bottom: 3px solid #E9DED2;
  border-radius: 10px 10px 4px 4px;
  color: var(--ink);
}
.slot.filled { border-bottom-color: var(--primary); background: #FFF6EF; }
.tiles { display: flex; justify-content: center; gap: 9px; flex-wrap: wrap; }
.tile {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-family: var(--font-en);
  font-size: 19px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: .14s;
}
.tile:hover { transform: translateY(-2px); }
.tile.used { opacity: .22; pointer-events: none; }

.write-guide { text-align: center; }
.write-guide .wg-letter {
  font-family: var(--font-en);
  font-size: 76px;
  color: #EFE3D6;
  line-height: 1;
  letter-spacing: 4px;
  margin-top: 34px;
}
canvas.trace {
  width: 100%;
  height: 170px;
  margin-top: -110px;
  border-radius: 16px;
  touch-action: none;
  cursor: crosshair;
}
.trace-tip { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; }

.ses-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.ses-foot .foot-hint { font-size: 11.5px; color: var(--ink-3); }
.btn-next {
  padding: 12px 26px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(135deg, #FF8F5E, #FF6B34);
  box-shadow: 0 10px 20px rgba(255, 107, 52, .26);
  transition: .16s;
}
.btn-next:hover { transform: translateY(-1px); }
.btn-next:disabled { opacity: .45; box-shadow: none; transform: none; }

.done-box { text-align: center; padding: 14px 0 4px; }
.done-box .db-emoji { font-size: 62px; }
.done-box h3 { font-size: 21px; margin-top: 12px; }
.done-box .db-stars { font-size: 26px; letter-spacing: 6px; color: var(--sun); margin: 10px 0; }
.done-box p { font-size: 12.5px; color: var(--ink-2); line-height: 1.8; }
.done-stats { display: flex; justify-content: center; gap: 26px; margin: 18px 0 4px; }
.done-stats div { text-align: center; }
.done-stats b { display: block; font-size: 19px; }
.done-stats span { font-size: 10.5px; color: var(--ink-3); }

/* ================= 弹窗 ================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(44, 36, 56, .36);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 26px;
  padding: 26px 24px 22px;
  box-shadow: var(--shadow-lg);
  animation: pop .26s cubic-bezier(.2, .9, .3, 1.1) both;
}
.modal-card h3 { font-size: 18px; }
.modal-sub { font-size: 12px; color: var(--ink-3); margin: 7px 0 18px; line-height: 1.6; }
.emoji-row { display: flex; gap: 8px; flex-wrap: wrap; }
.emoji-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-size: 22px;
  background: #F8F3EC;
  border-radius: 13px;
  border: 2px solid transparent;
  transition: .15s;
}
.emoji-btn.active { background: #FFF0E5; border-color: #FFB98F; }

/* ================= Toast ================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  z-index: 120;
  padding: 12px 20px;
  font-size: 13px;
  color: #fff;
  background: rgba(44, 36, 56, .92);
  border-radius: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  max-width: 80vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.tabbar { display: none; }

/* ================= 响应式 ================= */
@media (max-width: 940px) {
  .grid-2 { grid-template-columns: 1fr; }
  .unit-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 18px 16px 96px; }
  .topbar h2 { font-size: 20px; }
  .hero { padding: 20px; }
  .hero-grid { grid-template-columns: 1fr; }
  .ring-wrap { display: none; }
  .hero h3 { font-size: 19px; }
  .grid-3 { grid-template-columns: 1fr; }
  .tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 10.5px; color: var(--ink-3);
    padding: 4px 0;
  }
  .tab span { font-size: 18px; }
  .tab.active { color: var(--primary-dark); font-weight: 600; }
  .overlay { padding: 0; align-items: flex-end; }
  .overlay-inner { max-height: 94vh; border-radius: 26px 26px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); }
  .quiz-opts { grid-template-columns: 1fr 1fr; }
  .word-grid { grid-template-columns: repeat(2, 1fr); }
}
