:root {
  --bg: #f5f2ea;
  --paper: #fffdf8;
  --ink: #18332f;
  --muted: #687975;
  --line: #dfe5df;
  --brand: #0e7c66;
  --brand-2: #19a985;
  --brand-soft: #dff3ec;
  --sun: #f4b942;
  --sun-soft: #fff0c9;
  --coral: #e56b5d;
  --coral-soft: #ffe6e2;
  --blue: #4d77ba;
  --blue-soft: #e7eefb;
  --shadow: 0 18px 50px rgba(30, 63, 54, .10);
  --shadow-sm: 0 8px 24px rgba(30, 63, 54, .08);
  --radius: 24px;
  --radius-sm: 15px;
  --sidebar: 258px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 10% 0%, rgba(244,185,66,.14), transparent 28rem),
    radial-gradient(circle at 100% 20%, rgba(14,124,102,.10), transparent 32rem),
    var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--brand); }
.skip-link {
  position: fixed; left: 8px; top: -80px; z-index: 999;
  padding: 12px 18px; border-radius: 12px; background: var(--ink); color: white;
}
.skip-link:focus { top: 8px; }

.app-shell { display: flex; min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  padding: 26px 18px 20px; display: flex; flex-direction: column; gap: 22px;
  background: rgba(255, 253, 248, .86);
  backdrop-filter: blur(18px);
  border-right: 1px solid rgba(24, 51, 47, .08);
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; }
.brand img { border-radius: 14px; box-shadow: 0 8px 18px rgba(14,124,102,.22); }
.brand strong { display: block; font-size: 23px; letter-spacing: .08em; }
.brand span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; letter-spacing: .12em; }
.profile-picker {
  display: grid; gap: 7px; padding: 14px; border-radius: 18px;
  background: var(--brand-soft); border: 1px solid rgba(14,124,102,.10);
}
.profile-picker span { font-size: 12px; color: var(--brand); font-weight: 700; }
.profile-picker select {
  width: 100%; border: 0; background: transparent; color: var(--ink);
  font-weight: 800; outline: 0; padding: 2px 0;
}
.nav-list { display: grid; gap: 7px; }
.nav-item {
  appearance: none; border: 0; width: 100%; display: flex; align-items: center; gap: 12px;
  border-radius: 15px; padding: 13px 14px; background: transparent; color: #4f625e;
  text-align: left; font-weight: 720; transition: .2s ease;
}
.nav-item:hover { background: rgba(14,124,102,.07); color: var(--brand); }
.nav-item.active { background: var(--brand); color: white; box-shadow: 0 10px 22px rgba(14,124,102,.20); }
.nav-icon { width: 23px; text-align: center; font-size: 18px; }
.nav-badge, .bottom-item i {
  margin-left: auto; min-width: 23px; height: 23px; border-radius: 999px;
  display: inline-grid; place-items: center; padding: 0 7px; font-style: normal;
  font-size: 11px; font-weight: 850; background: var(--sun); color: #4e3500;
}
.nav-item.active .nav-badge { background: white; color: var(--brand); }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; color: var(--muted); }
.offline-dot { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 13px; }
.offline-dot span { width: 9px; height: 9px; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 0 5px rgba(25,169,133,.12); }
.sidebar-foot small { font-size: 11px; }

.main-wrap { width: 100%; margin-left: var(--sidebar); min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; min-height: 88px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 17px clamp(18px, 4vw, 54px);
  background: rgba(245,242,234,.84); backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(24,51,47,.06);
}
.top-title .eyebrow { margin: 0 0 3px; color: var(--brand); font-weight: 800; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.top-title h1 { margin: 0; font-size: clamp(21px, 2.4vw, 30px); line-height: 1.2; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.menu-button { display: none; }
.avatar-button {
  width: 42px; height: 42px; border-radius: 14px; border: 1px solid rgba(14,124,102,.16);
  background: var(--brand-soft); color: var(--brand); font-weight: 900;
}
.ghost-button, .primary-button, .secondary-button, .soft-button, .danger-button {
  border: 0; border-radius: 13px; padding: 11px 16px; font-weight: 800; transition: .18s ease;
}
.ghost-button { background: var(--paper); border: 1px solid var(--line); color: var(--ink); }
.ghost-button:hover, .secondary-button:hover, .soft-button:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.primary-button { background: var(--brand); color: white; box-shadow: 0 10px 24px rgba(14,124,102,.20); }
.primary-button:hover { background: #0b6d5a; transform: translateY(-1px); }
.secondary-button { background: var(--ink); color: white; }
.soft-button { background: var(--brand-soft); color: var(--brand); }
.danger-button { background: var(--coral-soft); color: #a3382d; }
.view-container { max-width: 1380px; margin: 0 auto; padding: clamp(20px, 3vw, 42px) clamp(16px, 4vw, 54px) 80px; }
.page { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero {
  position: relative; overflow: hidden; min-height: 270px; display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr); gap: 24px;
  padding: clamp(25px, 4vw, 42px); border-radius: 32px;
  color: white; background: linear-gradient(125deg, #0b6d5a, #18a27f 58%, #75c7a6);
  box-shadow: 0 22px 60px rgba(14,124,102,.23);
}
.hero:after {
  content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%;
  right: -130px; top: -170px; background: rgba(255,255,255,.12);
}
.hero:before {
  content: ""; position: absolute; width: 200px; height: 200px; border-radius: 50%;
  right: 16%; bottom: -160px; background: rgba(244,185,66,.23);
}
.hero-content { position: relative; z-index: 1; align-self: center; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 99px; background: rgba(255,255,255,.14); font-size: 12px; font-weight: 800; }
.hero h2 { margin: 14px 0 11px; font-size: clamp(28px, 5vw, 52px); line-height: 1.12; letter-spacing: -.025em; }
.hero p { margin: 0; max-width: 650px; color: rgba(255,255,255,.82); font-size: clamp(14px, 1.7vw, 17px); line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero .primary-button { background: white; color: var(--brand); }
.hero .ghost-button { background: rgba(255,255,255,.12); color: white; border-color: rgba(255,255,255,.22); }
.hero-orbit { position: relative; z-index: 1; display: grid; place-items: center; }
.orbit-card {
  width: min(230px, 70vw); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; text-align: center; padding: 25px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  box-shadow: inset 0 0 60px rgba(255,255,255,.08), 0 18px 40px rgba(0,60,45,.16);
  backdrop-filter: blur(8px);
}
.orbit-card strong { font-size: clamp(42px, 8vw, 68px); line-height: 1; display: block; }
.orbit-card span { display: block; margin-top: 8px; color: rgba(255,255,255,.78); font-size: 13px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.metric-card {
  background: var(--paper); border: 1px solid rgba(24,51,47,.07); border-radius: 20px;
  padding: 20px; box-shadow: var(--shadow-sm); min-width: 0;
}
.metric-card .metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.metric-card span { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-card i { font-style: normal; width: 35px; height: 35px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.metric-card strong { display: block; margin-top: 14px; font-size: clamp(26px, 4vw, 36px); line-height: 1; }
.metric-card small { display: block; margin-top: 8px; color: var(--muted); }
.metric-card.warm i { background: var(--sun-soft); color: #9b6700; }
.metric-card.alert i { background: var(--coral-soft); color: var(--coral); }
.metric-card.blue i { background: var(--blue-soft); color: var(--blue); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 20px; margin-top: 20px; }
.panel {
  background: rgba(255,253,248,.92); border: 1px solid rgba(24,51,47,.07);
  border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow-sm);
}
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.section-head h2, .section-head h3 { margin: 0; font-size: 20px; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.text-button { border: 0; background: transparent; color: var(--brand); font-weight: 800; padding: 5px; }
.task-list, .review-list, .wrong-list, .paper-list { display: grid; gap: 11px; }
.task-card, .review-card, .wrong-card, .paper-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 15px;
  border: 1px solid var(--line); border-radius: 16px; background: white;
}
.task-icon, .review-icon {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  flex: 0 0 auto; background: var(--brand-soft); color: var(--brand); font-weight: 900;
}
.task-card h3, .review-card h3, .wrong-card h3 { margin: 0 0 4px; font-size: 15px; }
.task-card p, .review-card p, .wrong-card p, .paper-item p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.task-action { margin-left: auto; flex: 0 0 auto; }
.empty-state { text-align: center; padding: 38px 18px; color: var(--muted); }
.empty-state .empty-icon { font-size: 44px; display: block; margin-bottom: 12px; opacity: .8; }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 6px; }

.pill-row, .filter-bar { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.pill, .chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; background: var(--brand-soft); color: var(--brand);
}
.chip.sun { background: var(--sun-soft); color: #925f00; }
.chip.coral { background: var(--coral-soft); color: #a3382d; }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.source { background:#f2eee3; color:#78684c; }
.filter-bar { margin: 18px 0; }
.field { display: grid; gap: 6px; min-width: 150px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 800; }
.field select, .field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  background: white; color: var(--ink); outline: none;
}
.field select:focus, .field input:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,124,102,.10); }

.practice-wrap { max-width: 940px; margin: 0 auto; }
.practice-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.progress-track { width: 100%; height: 8px; border-radius: 99px; background: #dfe7e2; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .3s ease; }
.question-card {
  margin-top: 18px; padding: clamp(22px, 4vw, 38px); background: var(--paper);
  border: 1px solid rgba(24,51,47,.08); border-radius: 28px; box-shadow: var(--shadow);
}
.question-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 17px; }
.question-stem { font-size: clamp(19px, 2.6vw, 25px); line-height: 1.8; font-weight: 750; white-space: pre-wrap; }
.option-list { display: grid; gap: 11px; margin-top: 22px; }
.option {
  width: 100%; appearance: none; text-align: left; display: flex; gap: 13px; align-items: flex-start;
  padding: 15px 16px; border: 1.5px solid var(--line); border-radius: 16px; background: white; color: var(--ink);
  font-size: 16px; line-height: 1.65; transition: .18s ease;
}
.option:hover { border-color: rgba(14,124,102,.35); background: #fbfffd; }
.option .label {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  background: #eef2ef; color: var(--muted); font-weight: 900;
}
.option.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(14,124,102,.08); }
.option.selected .label { background: var(--brand); color: white; }
.option.correct { border-color: #24a476; background: #e6f8ef; }
.option.correct .label { background: #24a476; color: white; }
.option.wrong { border-color: var(--coral); background: var(--coral-soft); }
.option.wrong .label { background: var(--coral); color: white; }
.option:disabled { opacity: 1; }
.pinyin-target { position:relative; display:inline-block; font-weight:900; }
.pinyin-target:after { content:""; position:absolute; left:50%; bottom:-.12em; width:.22em; height:.22em; border-radius:50%; background:#e56b5d; transform:translateX(-50%); }
.target-legend { display:flex; align-items:center; gap:8px; margin-top:14px; color:var(--muted); font-size:12px; }
.target-legend i { width:6px; height:6px; border-radius:50%; background:#e56b5d; box-shadow:0 0 0 4px rgba(229,107,93,.10); }
.practice-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 24px; }
.answer-panel { margin-top: 20px; padding: 18px; border-radius: 18px; background: #f3f7f4; border: 1px solid #dce7df; }
.answer-panel.good { background: #e9f8f0; border-color: #bfe8d3; }
.answer-panel.bad { background: #fff0ed; border-color: #f3c9c2; }
.answer-panel h3 { margin: 0 0 10px; font-size: 18px; }
.answer-panel p { margin: 7px 0; line-height: 1.75; }
.answer-panel .analysis { color: #435750; font-size: 14px; }
.mode-banner {
  display: flex; align-items: center; gap: 11px; padding: 12px 15px; border-radius: 15px;
  background: var(--sun-soft); color: #6b4a04; font-size: 13px; font-weight: 750;
}
.mode-banner.paper { background: var(--blue-soft); color: #31578f; }

.dashboard-split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.mini-chart { display: flex; gap: 8px; align-items: end; height: 150px; padding-top: 12px; }
.mini-chart .day { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 6px; height: 100%; color: var(--muted); font-size: 10px; }
.mini-chart .bar { width: min(26px, 70%); min-height: 4px; border-radius: 7px 7px 3px 3px; background: linear-gradient(var(--brand-2), var(--brand)); }
.mini-chart .bar.zero { background: #dfe8e2; }
.review-hero { padding: 22px; border-radius: 20px; background: linear-gradient(145deg, #fff3cf, #fffaf0); border: 1px solid #f0dfa9; }
.review-hero strong { font-size: 32px; display: block; }
.review-hero p { color: #755d26; line-height: 1.6; }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.stat-box { padding: 20px; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); }
.stat-box span { color: var(--muted); font-size: 12px; font-weight: 750; }
.stat-box strong { display: block; font-size: 31px; margin-top: 10px; }
.chart-card { margin-top: 20px; }
.chart-bars { display: grid; grid-template-columns: repeat(14, minmax(8px, 1fr)); gap: 7px; align-items: end; height: 220px; padding: 18px 4px 0; }
.chart-bars .col { display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; height: 100%; font-size: 9px; color: var(--muted); }
.chart-bars .col i { width: 100%; border-radius: 7px 7px 3px 3px; background: linear-gradient(var(--brand-2), var(--brand)); min-height: 3px; }
.tag-table { width: 100%; border-collapse: collapse; }
.tag-table th, .tag-table td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.tag-table th { color: var(--muted); font-size: 11px; }
.accuracy { height: 7px; border-radius: 99px; background: #e5ebe7; overflow: hidden; min-width: 90px; }
.accuracy i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }

.wrong-card { align-items: flex-start; }
.wrong-card .wrong-main { min-width: 0; flex: 1; }
.wrong-card .wrong-stats { flex: 0 0 auto; text-align: right; }
.wrong-stats b { display: block; color: var(--coral); font-size: 20px; }
.wrong-stats span { font-size: 11px; color: var(--muted); }
.wrong-card .question-snippet { margin-top: 8px; font-size: 14px; color: #334944; line-height: 1.65; }
.wrong-card .card-actions { display: flex; gap: 8px; margin-top: 12px; }

.paper-layout { display: grid; grid-template-columns: minmax(300px, .78fr) minmax(0, 1.22fr); gap: 20px; }
.paper-settings { position: sticky; top: 106px; align-self: start; }
.paper-item { align-items: flex-start; }
.paper-item input { margin-top: 5px; accent-color: var(--brand); width: 18px; height: 18px; }
.paper-item .paper-copy { min-width: 0; flex: 1; }
.paper-item h3 { font-size: 14px; line-height: 1.55; }
.paper-item label { cursor: pointer; }
.paper-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.paper-counter { padding: 9px 12px; border-radius: 13px; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 13px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.profile-list { display: grid; gap: 9px; }
.profile-row { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.profile-row i { width: 34px; height: 34px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-style: normal; font-weight: 900; }
.profile-row span { font-weight: 750; }
.profile-row button { margin-left: auto; }
.drop-zone {
  border: 1.5px dashed #a9c3ba; background: #f8fcfa; border-radius: 18px; padding: 26px 18px;
  text-align: center; color: var(--muted); transition: .18s ease;
}
.drop-zone.drag { border-color: var(--brand); background: var(--brand-soft); }
.drop-zone strong { display: block; color: var(--ink); margin: 8px 0 5px; }
.import-note { font-size: 12px; color: var(--muted); line-height: 1.7; }
.key-value { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; }
.key-value dt { color: var(--muted); }
.key-value dd { margin: 0; font-weight: 750; }

.toast {
  position: fixed; z-index: 100; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translate(-50%, 20px);
  padding: 12px 19px; border-radius: 13px; background: var(--ink); color: white; font-weight: 750;
  opacity: 0; pointer-events: none; transition: .22s ease; max-width: calc(100vw - 30px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 18px; background: rgba(9,31,26,.48); backdrop-filter: blur(5px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(560px, 100%); max-height: 88dvh; overflow: auto; background: var(--paper); border-radius: 24px; padding: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal h2 { margin: 0 0 8px; }
.modal p { color: var(--muted); line-height: 1.65; }
.modal-close { float: right; border: 0; background: #eef2ef; width: 34px; height: 34px; border-radius: 10px; }

.bottom-nav { display: none; }
.fatal { padding: 30px; background: var(--coral-soft); color: #80261d; border-radius: 20px; }

/* Child learning experience */
.child-home { display: grid; gap: 20px; }
.mission-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(240px, .55fr);
  gap: 20px; padding: clamp(24px, 4vw, 42px); border-radius: 34px; color: white;
  background: linear-gradient(132deg, #147c67 0%, #28a97d 55%, #8ed9a9 100%);
  box-shadow: 0 24px 64px rgba(14,124,102,.22);
}
.mission-hero:before { content:""; position:absolute; inset:auto -90px -170px auto; width:360px; height:360px; border-radius:50%; background:rgba(255,226,120,.18); }
.mission-hero-copy { position:relative; z-index:1; align-self:center; }
.child-kicker { display:inline-flex; align-items:center; gap:6px; padding:7px 11px; border-radius:999px; background:rgba(255,255,255,.16); font-size:11px; letter-spacing:.12em; font-weight:850; }
.mission-hero h2 { margin:14px 0 10px; font-size:clamp(29px,4.8vw,50px); line-height:1.18; letter-spacing:-.025em; }
.mission-hero p { margin:0; max-width:600px; color:rgba(255,255,255,.86); font-size:16px; line-height:1.75; }
.hero-start { background:#fff7dc !important; color:#145f50 !important; box-shadow:0 12px 30px rgba(7,72,57,.22) !important; }
.hero-soft { color:white !important; background:rgba(255,255,255,.12) !important; border-color:rgba(255,255,255,.25) !important; }
.goal-line { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:22px; font-size:12px; font-weight:800; color:rgba(255,255,255,.88); }
.star-line { color:#ffe27a; letter-spacing:.14em; font-size:16px; }
.goal-track { height:9px; margin-top:7px; border-radius:99px; background:rgba(255,255,255,.18); overflow:hidden; }
.goal-track i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#ffe27a,#fff6d7); transition:width .3s ease; }
.daily-plan { display:inline-flex; align-items:center; gap:9px; margin-top:14px; padding:9px 12px; border-radius:12px; background:rgba(255,255,255,.13); border:1px solid rgba(255,255,255,.15); color:rgba(255,255,255,.86); font-size:12px; }
.daily-plan span { opacity:.72; }
.daily-plan b { color:#fff4c5; letter-spacing:.02em; }
.buddy-wrap { position:relative; display:grid; place-items:center; min-height:230px; z-index:1; }
.learning-buddy { width:min(220px,62vw); filter:drop-shadow(0 18px 22px rgba(7,68,53,.20)); animation:floaty 3.4s ease-in-out infinite; }
@keyframes floaty { 0%,100%{transform:translateY(0) rotate(-1deg)} 50%{transform:translateY(-9px) rotate(1deg)} }
.buddy-bubble { position:absolute; top:0; right:0; max-width:190px; padding:10px 13px; border-radius:16px 16px 4px 16px; background:#fff8e6; color:#4a3a13; font-size:12px; font-weight:800; line-height:1.55; box-shadow:0 8px 24px rgba(5,69,54,.16); }
.child-section-title { display:flex; align-items:end; justify-content:space-between; gap:16px; padding:2px 4px 0; }
.child-section-title span { color:var(--brand); font-size:11px; font-weight:900; letter-spacing:.12em; }
.child-section-title h2 { margin:4px 0 0; font-size:clamp(21px,3vw,30px); }
.child-section-title small { color:var(--muted); font-size:12px; }
.mission-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; }
.child-mission { appearance:none; width:100%; display:flex; align-items:center; gap:13px; padding:17px; border:1px solid rgba(24,51,47,.08); border-radius:20px; background:var(--paper); color:var(--ink); text-align:left; box-shadow:var(--shadow-sm); transition:.18s ease; }
.child-mission:hover { transform:translateY(-3px); box-shadow:0 16px 34px rgba(24,51,47,.12); }
.child-mission.mint { background:linear-gradient(145deg,#effaf3,#fffdf8); }
.child-mission.sun { background:linear-gradient(145deg,#fff5d8,#fffdf8); }
.child-mission.blue { background:linear-gradient(145deg,#edf4ff,#fffdf8); }
.mission-icon { flex:0 0 46px; width:46px; height:46px; display:grid; place-items:center; border-radius:15px; background:#fff; font-size:24px; box-shadow:0 7px 18px rgba(24,51,47,.09); }
.mission-copy { display:grid; gap:4px; min-width:0; }
.mission-copy b { font-size:16px; }
.mission-copy small { color:var(--muted); font-size:12px; line-height:1.5; }
.mission-arrow { margin-left:auto; flex:0 0 auto; color:var(--brand); font-size:20px; font-weight:900; }
.child-progress-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.child-progress-strip div { padding:14px 16px; border-radius:18px; background:rgba(255,253,248,.88); border:1px solid rgba(24,51,47,.07); }
.child-progress-strip span { display:block; color:var(--muted); font-size:11px; font-weight:750; }
.child-progress-strip strong { display:inline-block; margin-top:5px; font-size:27px; line-height:1; }
.child-progress-strip small { margin-left:4px; color:var(--muted); }
.session-intro { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:17px; padding:24px 28px; border-radius:25px; background:linear-gradient(125deg,#e9f8f0,#fff8e4); border:1px solid rgba(24,51,47,.07); }
.session-intro h2 { margin:9px 0 5px; font-size:clamp(24px,3.6vw,36px); }
.session-intro p { margin:0; color:var(--muted); }
.session-intro .child-kicker { background:var(--brand-soft); color:var(--brand); }
.session-orbit { flex:0 0 140px; aspect-ratio:1; border-radius:50%; display:grid; place-items:center; align-content:center; background:#fff; box-shadow:var(--shadow-sm); text-align:center; }
.session-orbit b { font-size:37px; line-height:1; }.session-orbit span { color:var(--muted); font-size:11px; margin-top:6px; }
.child-choice-panel .mission-grid { grid-template-columns:1fr 1fr; margin-top:13px; }
.combo-chip { display:inline-flex; align-items:center; padding:6px 10px; border-radius:999px; background:#fff1bf; color:#7b5500; font-size:11px; font-weight:900; }
.feedback-tip { margin-top:12px !important; padding:10px 12px; border-radius:11px; background:rgba(255,255,255,.55); font-size:13px; }
.self-check { padding:11px 13px; border-radius:12px; background:rgba(255,255,255,.64); border:1px dashed rgba(24,51,47,.16); font-size:13px; color:#42564f; }
.reveal-button { margin-top:10px; background:#fffdf8; }
.study-strategy { padding:12px 13px; border-radius:13px; background:#fff8df; color:#5a4714; font-size:13px; border:1px solid #ecdba4; }
.analysis-empty { padding:12px 13px; border-radius:13px; background:#f2f6f3; color:#5d6b66; font-size:13px; border:1px solid #dde7e0; }
.result-stars { color:#efb52e; font-size:36px; letter-spacing:.16em; margin-bottom:8px; }
.result-encourage { margin:17px auto 0; max-width:560px; color:var(--muted); }
body.practice-active .sidebar, body.practice-active .topbar, body.practice-active .bottom-nav { display:none !important; }
body.practice-active .main-wrap { margin-left:0; }
body.practice-active .view-container { max-width:900px; padding-top:18px; padding-bottom:24px; }
.parent-hero { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:28px; border-radius:28px; background:linear-gradient(125deg,#173f38,#256f60); color:white; box-shadow:var(--shadow); }
.parent-hero .child-kicker { background:rgba(255,255,255,.14); }
.parent-hero h2 { margin:10px 0 7px; font-size:clamp(25px,3.5vw,38px); }
.parent-hero p { margin:0; color:rgba(255,255,255,.78); max-width:760px; }
.parent-scope { margin-top:18px; }
.parent-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-top:18px; }
.parent-card { appearance:none; text-align:left; border:1px solid rgba(24,51,47,.08); border-radius:22px; padding:20px; background:var(--paper); color:var(--ink); box-shadow:var(--shadow-sm); transition:.18s ease; }
.parent-card:hover { transform:translateY(-2px); box-shadow:var(--shadow); }
.parent-card > span { font-size:29px; }.parent-card b { display:block; margin-top:12px; font-size:18px; }.parent-card p { color:var(--muted); font-size:13px; line-height:1.6; }.parent-card i { color:var(--brand); font-style:normal; font-size:12px; font-weight:850; }
.parent-note { margin-top:18px; padding:18px 20px; border-radius:19px; background:#fff8e4; border:1px solid #ebdba6; color:#594818; }.parent-note p { margin:6px 0 0; line-height:1.7; font-size:13px; }

/* Print paper */
.print-root { display: none; }
.paper-sheet { background: white; color: #111; padding: 24mm 18mm; font-family: "SimSun", "Songti SC", serif; }
.paper-sheet header { text-align: center; margin-bottom: 20px; }
.paper-sheet h1 { font-size: 22pt; margin: 0 0 8px; letter-spacing: .1em; }
.paper-meta { display: flex; justify-content: space-between; font-size: 10.5pt; border-bottom: 1px solid #333; padding-bottom: 8px; }
.paper-question { margin: 16px 0; break-inside: avoid; font-size: 11pt; line-height: 1.9; }
.paper-question .options { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 24px; margin-top: 5px; }
.paper-answer-space { height: 42mm; border-bottom: 1px dashed #aaa; margin: 10px 0 24px; }
.answer-key { page-break-before: always; }
.answer-key h2 { text-align: center; }
.answer-key-grid { columns: 3; column-gap: 20px; font-size: 10.5pt; line-height: 2; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .content-grid, .dashboard-split, .paper-layout { grid-template-columns: 1fr; }
  .paper-settings { position: static; }
  .hero { grid-template-columns: 1fr .55fr; }
}
@media (max-width: 900px) {
  :root { --sidebar: 0px; }
  .sidebar { transform: translateX(-105%); width: 280px; transition: transform .25s ease; box-shadow: var(--shadow); }
  body.menu-open .sidebar { transform: none; }
  .main-wrap { margin-left: 0; }
  .menu-button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); color: var(--ink); font-size: 20px; }
  .topbar { min-height: 76px; padding: 12px 16px; }
  .top-actions .ghost-button { display: none; }
  .top-title .eyebrow { display: none; }
  .view-container { padding: 18px 14px calc(92px + var(--safe-bottom)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(4,1fr); position: fixed; z-index: 50;
    left: 12px; right: 12px; bottom: calc(10px + var(--safe-bottom)); padding: 7px;
    border: 1px solid rgba(24,51,47,.08); border-radius: 22px; background: rgba(255,253,248,.94);
    backdrop-filter: blur(18px); box-shadow: 0 15px 35px rgba(24,51,47,.16);
  }
  .bottom-item { position: relative; border: 0; background: transparent; color: var(--muted); border-radius: 15px; padding: 8px 2px 7px; display: grid; justify-items: center; gap: 2px; }
  .bottom-item span { font-size: 19px; line-height: 1.1; }
  .bottom-item b { font-size: 10px; }
  .bottom-item.active { background: var(--brand-soft); color: var(--brand); }
  .bottom-item i { position: absolute; top: 2px; right: calc(50% - 24px); margin: 0; min-width: 18px; height: 18px; font-size: 9px; }
  body.practice-active .bottom-nav { display: none; }
  body.practice-active .view-container { padding-bottom: calc(24px + var(--safe-bottom)); }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 90dvh; border-radius: 24px 24px 0 0; padding-bottom: calc(24px + var(--safe-bottom)); }
}
@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; min-height: auto; border-radius: 25px; padding: 24px 20px; }
  .hero-orbit { display: none; }
  .hero h2 { font-size: 31px; }
  .metric-grid, .stats-grid, .settings-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 16px; }
  .metric-card strong { font-size: 27px; }
  .content-grid { margin-top: 15px; }
  .panel { border-radius: 20px; padding: 17px; }
  .section-head h2 { font-size: 18px; }
  .filter-bar { align-items: stretch; }
  .field { flex: 1 1 140px; }
  .option { font-size: 15px; padding: 13px; }
  .option .label { flex-basis: 27px; width: 27px; height: 27px; }
  .practice-actions .primary-button, .practice-actions .secondary-button { flex: 1 1 140px; }
  .chart-bars { height: 170px; gap: 4px; }
  .tag-table th:nth-child(3), .tag-table td:nth-child(3) { display: none; }
  .paper-question .options { grid-template-columns: 1fr; }
  .paper-sheet { padding: 16mm 10mm; }
  .mission-hero { grid-template-columns:1fr; padding:24px 20px; border-radius:26px; }
  .buddy-wrap { min-height:180px; }.learning-buddy { width:150px; }.buddy-bubble { top:8px; right:4px; }
  .mission-grid,.child-choice-panel .mission-grid,.parent-grid { grid-template-columns:1fr; }
  .child-progress-strip { grid-template-columns:1fr 1fr; }
  .child-section-title { align-items:flex-start; flex-direction:column; gap:4px; }
  .session-intro { align-items:flex-start; padding:21px; }.session-orbit { display:none; }
  .daily-plan { display:flex; width:100%; justify-content:space-between; }
  .parent-hero { align-items:flex-start; flex-direction:column; padding:22px; }
}
@media (max-width: 420px) {
  .metric-grid, .stats-grid, .settings-grid { grid-template-columns: 1fr; }
  .hero h2 { font-size: 27px; }
  .hero-actions button { flex: 1 1 100%; }
  .task-card, .review-card { align-items: flex-start; }
  .task-action { margin-left: 0; }
}

@media print {
  @page { size: A4; margin: 0; }
  body { background: white !important; }
  .app-shell, .bottom-nav, .toast, .modal-backdrop, .skip-link { display: none !important; }
  .print-root { display: block !important; }
  .print-root[aria-hidden="true"] { display: block !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
