/*
 * Hanzi Planet 1.4.0
 * A quiet, content-first learning surface inspired by the clarity of native apps.
 * This layer intentionally changes presentation only; all learning logic remains intact.
 */

:root {
  --bg: #f5f5f7;
  --paper: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, .12);
  --blue: #007aff;
  --blue2: #0066d6;
  --sky: #eaf3ff;
  --amber: #ff9f0a;
  --coral: #ff453a;
  --mint: #30b58a;
  --plum: #7b61d1;
  --surface-soft: #f2f2f7;
  --surface-blue: #edf5ff;
  --surface-green: #edf9f4;
  --surface-orange: #fff7e8;
  --surface-red: #fff1f0;
  --hairline: 1px solid rgba(60, 60, 67, .1);
  --shadow: 0 8px 28px rgba(0, 0, 0, .055);
  --shadow-raised: 0 14px 36px rgba(0, 0, 0, .075);
  --press: none;
}

html,
body {
  background: #e9e9ed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overscroll-behavior: none; }

.app {
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .025);
}

.screen,
.inner-screen,
.lesson-screen,
.write-screen,
.hunt-screen {
  background: var(--bg);
}

.app small,
.app em { font-size: 13px; }
.app p { font-size: 14px; }
.app input { font-size: 16px; }

.app button,
.app a {
  -webkit-tap-highlight-color: transparent;
}

.app button {
  min-height: 44px;
  touch-action: manipulation;
}

.app button:focus-visible,
.app a:focus-visible,
.app input:focus-visible {
  outline: 3px solid rgba(0, 122, 255, .28);
  outline-offset: 2px;
}

.primary-btn,
.outline-btn,
.danger-outline-btn,
.quiet-btn,
.lesson-tool,
.write-bot-btn {
  min-height: 52px;
  border-radius: 16px;
  box-shadow: none;
  font-weight: 700;
  letter-spacing: -.01em;
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease, opacity .16s ease;
}

.primary-btn,
.primary-btn.warm,
.smart-card .primary-btn,
.coop-hero .primary-btn,
.feedback .primary-btn,
.feedback .primary-btn.phase-next,
.feedback .primary-btn.finish-next,
.write-bot-btn {
  color: #fff;
  background: var(--blue);
  box-shadow: none;
}

.primary-btn:active,
.primary-btn.warm:active,
.outline-btn:active,
.danger-outline-btn:active,
.quiet-btn:active,
.lesson-tool:active,
.write-bot-btn:active {
  transform: scale(.98);
  box-shadow: none;
}

.outline-btn,
.quiet-btn {
  color: #333338;
  background: #fff;
  border: var(--hairline);
}

.danger-outline-btn {
  color: #d70015;
  background: #fff;
  border: 1px solid rgba(215, 0, 21, .2);
}

/* Header and persistent navigation */
.topbar {
  height: 76px;
  padding-left: 18px;
  padding-right: 18px;
}

.profile-pill { gap: 10px; }

.profile-pill .avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  box-shadow: none;
  font-size: 20px;
}

.profile-pill b {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.profile-pill small {
  color: var(--muted);
  font-size: 13px;
}

.top-stats { gap: 7px; }

.top-stats span {
  height: 36px;
  padding: 0 11px;
  border: var(--hairline);
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
  box-shadow: none;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}

.bottom-nav {
  height: 76px;
  border-top: .5px solid rgba(60, 60, 67, .18);
  background: rgba(249, 249, 249, .88);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, .045);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}

.nav-btn {
  gap: 2px;
  color: #8e8e93;
  font-size: 13px;
  font-weight: 600;
}

.nav-btn > span {
  width: 34px;
  height: 29px;
  border-radius: 11px;
  font-size: 22px;
  transition: background-color .16s ease, transform .16s ease;
}

.nav-btn.active { color: var(--blue); }
.nav-btn.active > span {
  color: var(--blue);
  background: rgba(0, 122, 255, .09);
  transform: none;
}

.inner-head {
  min-height: 72px;
  padding-left: 15px;
  padding-right: 15px;
  border-bottom: .5px solid rgba(60, 60, 67, .1);
  background: rgba(245, 245, 247, .86);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
}

.inner-head h2 {
  margin: 1px 0 0;
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.025em;
}

.inner-head small { color: var(--muted); font-size: 13px; }

.icon-btn,
.modal-close {
  width: 44px;
  height: 44px;
  border: var(--hairline);
  border-radius: 50%;
  color: #333338;
  background: rgba(255, 255, 255, .9);
  box-shadow: none;
  font-size: 27px;
}

.mini-rank,
.parent-mini,
.section-title button {
  color: var(--blue);
  font-size: 13px;
  font-weight: 650;
}

/* Home: one calm call to action, then progress */
.home-main { padding: 6px 16px 100px; }

.smart-card {
  min-height: 250px;
  padding: 24px 21px;
  overflow: hidden;
  border: var(--hairline);
  border-radius: 28px;
  color: var(--ink);
  background: linear-gradient(150deg, #fff 0%, #f6faff 58%, #eaf3ff 100%);
  box-shadow: var(--shadow-raised);
}

.smart-card::before,
.smart-card::after,
.brain-orbit { display: none; }

.smart-copy { width: 100%; }

.smart-kicker,
.kicker {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(0, 122, 255, .09);
  font-size: 13px;
  font-weight: 650;
}

.smart-card h1 {
  max-width: 330px;
  margin: 13px 0 9px;
  color: var(--ink);
  font-size: clamp(31px, 8.8vw, 38px);
  font-weight: 760;
  line-height: 1.14;
  letter-spacing: -.045em;
}

.smart-card h1 em { color: var(--blue); }

.smart-card p {
  max-width: 330px;
  min-height: 0;
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.weak-tags { gap: 6px; margin: 8px 0 16px; }
.weak-tags span {
  padding: 6px 9px;
  border: 0;
  border-radius: 999px;
  color: #56565c;
  background: rgba(118, 118, 128, .1);
  font-size: 13px;
}

.smart-card .primary-btn {
  width: min(210px, 100%);
  min-height: 52px;
  border-radius: 16px;
  font-size: 16px;
}

.mastery-card,
.reward-teaser,
.station-card,
.friend-banner {
  border: var(--hairline);
  background: #fff;
  box-shadow: var(--shadow);
}

.mastery-card {
  margin-top: 14px;
  padding: 18px;
  border-radius: 22px;
}

.mastery-head b {
  margin-top: 3px;
  color: var(--ink);
  font-size: 19px;
  letter-spacing: -.02em;
}

.mastery-track {
  height: 8px;
  margin: 15px 0 10px;
  background: #e9e9ed;
}

.mastery-track i { background: var(--blue); }
.mastery-meta { color: var(--muted); font-size: 13px; }
.kid-meta span { font-size: 13px; }

.parent-mini {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 18px;
  background: var(--surface-blue);
}

.reward-teaser {
  margin-top: 12px;
  padding: 14px;
  border-radius: 22px;
}

.reward-mini-art {
  width: 58px;
  height: 58px;
  flex-basis: 58px;
  border-radius: 17px;
  background: var(--surface-orange);
}

.reward-mini-art span { font-size: 35px; filter: none; }
.reward-mini-art i { background: rgba(255, 159, 10, .16); }
.reward-teaser small { color: #9a6700; font-size: 13px; }
.reward-teaser b { margin: 2px 0; color: var(--ink); font-size: 16px; }
.reward-teaser p { color: var(--muted); font-size: 13px; }
.reward-teaser strong { color: var(--blue); font-size: 13px; }

.section-title { margin: 27px 3px 12px; }
.section-title h2 {
  margin-top: 3px;
  font-size: 24px;
  font-weight: 740;
  letter-spacing: -.03em;
}
.section-title small { font-size: 13px; }

.station-list { gap: 9px; }
.station-card {
  min-height: 92px;
  padding: 13px 14px;
  border-radius: 21px;
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease;
}

.station-card:active { transform: scale(.985); }
.station-card .station-icon {
  width: 60px;
  height: 60px;
  flex-basis: 60px;
  border-radius: 18px;
  color: var(--blue);
  background: var(--surface-blue);
  font-size: 30px;
}
.station-card:nth-child(2) .station-icon { color: #14805f; background: var(--surface-green); }
.station-card:nth-child(3) .station-icon { color: #ba5b00; background: var(--surface-orange); }
.station-card:nth-child(4) .station-icon { color: #6648b5; background: #f2effb; }
.station-card .station-copy b { color: var(--ink); font-size: 17px; }
.station-card .station-copy small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.station-card .station-go { color: #c7c7cc; font-size: 22px; }

.station-status {
  min-height: 22px;
  margin-top: 7px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
}

.station-card.completed,
.station-card.current,
.station-card.available,
.station-card.locked {
  border-width: 1px;
  box-shadow: var(--shadow);
}
.station-card.completed { border-color: rgba(48, 181, 138, .22); background: #fff; }
.station-card.current { border-color: rgba(0, 122, 255, .35); background: #fff; }
.station-card.available { border-color: rgba(255, 159, 10, .24); background: #fff; }
.station-card.locked { border-color: var(--line); background: rgba(255, 255, 255, .7); }
.station-card.completed .station-status { color: #117552; background: var(--surface-green); }
.station-card.current .station-status { color: #0066d6; background: var(--surface-blue); }
.station-card.available .station-status { color: #9a6700; background: var(--surface-orange); }
.station-card.locked .station-status { color: var(--muted); background: var(--surface-soft); }

.course-path-note {
  margin: 12px 2px 21px;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  color: var(--muted);
  background: rgba(118, 118, 128, .08);
  font-size: 13px;
}

.friend-banner {
  margin-top: 17px;
  padding: 14px;
  border-radius: 22px;
}
.friend-faces span {
  border-color: #fff;
  border-radius: 50%;
  box-shadow: none;
}
.friend-banner small { color: var(--muted); font-size: 13px; }
.friend-banner .arrow { color: #c7c7cc; }

/* Focused lesson */
.lesson-top {
  height: 70px;
  gap: 10px;
  border-bottom: .5px solid rgba(60, 60, 67, .09);
  background: rgba(245, 245, 247, .88);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
}

.lesson-meter { height: 7px; background: #dedee3; }
.lesson-meter i { background: var(--blue); }
.combo-chip {
  height: 36px;
  padding: 0 11px;
  border-radius: 18px;
  color: #9a6700;
  background: var(--surface-orange);
  font-size: 13px;
}

.lesson-main { padding: 8px 14px 145px; }
.session-strip { margin: 2px 4px 10px; color: var(--muted); font-size: 13px; }
.surprise-meter { height: 6px; background: #dedee3; }
.surprise-meter i { background: var(--amber); }

.lesson-phase-card,
.lesson-phase-card.phase-practice,
.lesson-phase-card.phase-use,
.lesson-phase-card.phase-review,
.lesson-phase-card.phase-write {
  min-height: 68px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: var(--hairline);
  border-radius: 19px;
  background: #fff;
  box-shadow: none;
}
.lesson-phase-card > span {
  width: 43px;
  height: 43px;
  border-radius: 14px;
  color: var(--blue);
  background: var(--surface-blue);
  font-size: 23px;
}
.lesson-phase-card.phase-practice > span { color: #6648b5; background: #f2effb; }
.lesson-phase-card.phase-use > span { color: #9a6700; background: var(--surface-orange); }
.lesson-phase-card.phase-review > span { color: #c9342b; background: var(--surface-red); }
.lesson-phase-card.phase-write > span { color: #117552; background: var(--surface-green); }
.lesson-phase-card small { color: var(--muted); font-size: 13px; }
.lesson-phase-card b { color: var(--ink); font-size: 16px; }
.lesson-phase-card em { color: var(--muted); font-size: 13px; }
.lesson-phase-card > strong {
  padding: 7px 9px;
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
}

.lesson-actions { gap: 8px; margin: 0 0 10px; }
.lesson-tool {
  min-height: 48px;
  border: var(--hairline);
  border-radius: 15px;
  color: #3a3a3c;
  background: #fff;
  box-shadow: none;
  font-size: 14px;
}
.lesson-tool.audio-tool { color: var(--blue); border-color: rgba(0, 122, 255, .14); background: var(--surface-blue); }

.guide-row {
  align-items: center;
  gap: 9px;
  margin: 4px 2px 11px;
}
.guide-dot {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 50%;
  color: #fff;
  background: #3a3a3c;
  font-size: 20px;
}
.guide-text {
  min-height: 40px;
  padding: 10px 13px;
  border: 0;
  border-radius: 14px;
  color: #4a4a4f;
  background: rgba(118, 118, 128, .09);
  box-shadow: none;
  font-size: 14px;
}

.exercise-card {
  min-height: 410px;
  padding: 21px 16px 24px;
  border: var(--hairline);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.micro-badge {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--surface-blue);
  font-size: 13px;
}
.ex-title { color: var(--ink); font-size: 28px; letter-spacing: -.03em; }
.ex-sub { color: var(--muted); font-size: 14px; }

.option,
.find-tile,
.piece,
.radical-chip,
.pinyin-option,
.word-chip,
.match-column button,
.hunt-cell,
.quick-reactions button {
  border: var(--hairline);
  color: var(--ink);
  background: var(--surface-soft);
  box-shadow: none;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}

.option:active,
.find-tile:active,
.piece:active,
.radical-chip:active,
.pinyin-option:active,
.word-chip:active,
.match-column button:active,
.hunt-cell:active { transform: scale(.975); }

.option { min-height: 116px; border-radius: 22px; }
.option span { color: var(--muted); font-size: 13px; }
.find-tile { border-radius: 21px; }
.piece { border-radius: 24px; }
.piece.selected,
.radical-chip.selected,
.match-column button.selected { color: var(--blue); border-color: rgba(0, 122, 255, .32); background: var(--surface-blue); }

.option.correct,
.find-tile.found,
.pinyin-option.correct,
.match-column button.matched {
  color: #117552;
  border-color: rgba(48, 181, 138, .32);
  background: var(--surface-green);
}
.option.wrong,
.pinyin-option.wrong,
.word-chip.wrong,
.match-column button.wrong {
  border-color: rgba(255, 69, 58, .3);
  background: var(--surface-red);
}

.merge-zone,
.radical-target {
  border: 1.5px dashed rgba(60, 60, 67, .24);
  border-radius: 22px;
  color: var(--muted);
  background: var(--surface-soft);
}
.merge-zone.hot { border-color: var(--blue); background: var(--surface-blue); }
.radical-target b { color: var(--ink); }

.scene,
.listen-orb,
.pinyin-focus,
.lesson-write-preview {
  border: 0;
  border-radius: 23px;
  background: var(--surface-soft);
  box-shadow: none;
}
.listen-orb { color: var(--blue); }
.listen-orb small,
.pinyin-focus span { color: var(--muted); font-size: 13px; }
.word-pair .word-slot,
.word-build-slots span {
  border: var(--hairline);
  border-radius: 20px;
  background: var(--surface-soft);
  box-shadow: none;
}
.bubble-char {
  border: var(--hairline);
  background: var(--surface-blue);
  box-shadow: none;
  animation-duration: 4s;
}
.bubble-char:nth-child(2n) { background: var(--surface-orange); }
.bubble-char:nth-child(3n) { background: var(--surface-green); }

.feedback {
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  border-top: .5px solid rgba(60, 60, 67, .15);
  background: rgba(249, 249, 249, .94);
  box-shadow: 0 -14px 38px rgba(0, 0, 0, .09);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}
.feedback.wrong { border-color: rgba(255, 69, 58, .16); background: rgba(255, 249, 248, .96); }
.feedback-text strong { color: #117552; font-size: 18px; }
.feedback.wrong strong { color: #c9342b; }
.feedback-text span { color: var(--muted); font-size: 13px; }

/* Completion and supporting screens */
.result-screen { background: var(--bg); }
.result-orbit {
  width: 150px;
  height: 150px;
  margin-bottom: 18px;
  border: 0;
  border-radius: 48px;
  background: var(--surface-blue);
  animation: none;
}
.result-orbit b {
  width: 92px;
  height: 92px;
  border-radius: 30px;
  color: #fff;
  background: var(--blue);
  box-shadow: none;
}
.result-main > small { color: var(--blue); }
.result-main h2 { color: var(--ink); font-size: 28px; letter-spacing: -.035em; }
.result-main p { color: var(--muted); }
.result-rewards > div,
.profile-stats > div,
.parent-kpis > div {
  border: var(--hairline);
  border-radius: 18px;
  background: #fff;
  box-shadow: none;
}
.piece-reveal {
  border: 0;
  border-radius: 17px;
  background: var(--surface-orange);
}

.inner-main { padding: 14px 16px 36px; }
.coop-hero,
.parent-summary,
.profile-card {
  border: var(--hairline);
  border-radius: 25px;
  background: #fff;
  box-shadow: var(--shadow);
}
.coop-hero { padding: 22px 19px; }
.coop-hero .kicker { color: var(--blue); background: var(--surface-blue); }
.coop-hero h3 { color: var(--ink); font-size: 29px; letter-spacing: -.03em; }
.coop-hero p { color: var(--muted); }
.coop-preview span {
  border: var(--hairline);
  border-radius: 17px;
  background: var(--surface-soft);
  box-shadow: none;
}

.mode-list { gap: 9px; margin-top: 14px; }
.mode-card,
.profile-link,
.group-card,
.rank-row,
.team-rank-row,
.report-card,
.wp-card,
.group-detail,
.group-form,
.puzzle-card,
.collection-card {
  border: var(--hairline);
  background: #fff;
  box-shadow: var(--shadow);
}
.mode-card {
  min-height: 78px;
  padding: 11px 13px;
  border-radius: 20px;
}
.mode-card:active,
.profile-link:active,
.group-card:active,
.collection-card:active { transform: scale(.985); }
.mode-icon {
  width: 50px;
  height: 50px;
  flex-basis: 50px;
  border-radius: 16px;
  color: var(--blue);
  background: var(--surface-blue);
}
.writing-mode-card .mode-icon { color: #9a6700; background: var(--surface-orange); }
.mode-card b { color: var(--ink); font-size: 15px; }
.mode-card small { color: var(--muted); font-size: 13px; }
.mode-card em,
.writing-mode-card em {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
}

.safe-social,
.rank-note,
.guardian-card,
.report-card.soft,
.reward-next-hint,
.sync-diagnostic-text,
.sync-recovery-actions {
  border: 0;
  border-radius: 18px;
  color: var(--muted);
  background: rgba(118, 118, 128, .08);
}
.safe-social,
.rank-note,
.guardian-card { font-size: 13px; }
.reward-next-hint { font-size: 13px; }

.parent-summary { color: var(--ink); }
.parent-summary small,
.parent-summary p { color: var(--muted); }
.parent-summary > span {
  border-radius: 19px;
  color: var(--blue);
  background: var(--surface-blue);
}

.report-card { padding: 16px; border-radius: 20px; }
.report-card.soft p { font-size: 13px; }
.report-head small { color: var(--muted); font-size: 13px; }
.skill-row span,
.skill-row b { font-size: 13px; }
.skill-row div { height: 7px; background: #e5e5ea; }
.skill-row i { background: var(--blue); }
.weak-item,
.confusion-item {
  border-radius: 15px;
  background: var(--surface-soft);
}
.weak-item > span,
.confusion-item > span { border-radius: 13px; background: #fff; }
.weak-item b,
.confusion-item b,
.weak-item small,
.confusion-item small,
.weak-item em,
.confusion-item em { font-size: 13px; }

.rank-tabs,
.book-filter {
  gap: 4px;
  padding: 3px;
  border-radius: 14px;
  background: #e5e5ea;
}
.rank-tabs button,
.book-filter button {
  min-height: 42px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 13px;
}
.rank-tabs button { height: 44px; min-height: 44px; }
#bookScreen #bookCount,
#bookScreen .book-filter button { font-size: 13px; }
#bookScreen .book-filter button { height: 44px; min-height: 44px; }
.rank-tabs button.active,
.book-filter button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .1);
}
.rank-row { min-height: 64px; border-radius: 18px; }
.rank-row.you { border-color: rgba(0, 122, 255, .28); background: var(--surface-blue); }
.rank-avatar { border-radius: 50%; color: var(--blue); background: var(--surface-blue); }
.rank-copy b,
.rank-copy small,
.rank-score { font-size: 13px; }
.rank-score { color: var(--blue); }

.book-char {
  border: var(--hairline);
  border-radius: 18px;
  background: #fff;
  box-shadow: none;
}
.book-char:active { transform: scale(.96); box-shadow: none; }
.book-char small { color: var(--muted); font-size: 13px; }

.profile-card {
  padding: 17px;
  color: var(--ink);
}
.big-avatar {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
}
.profile-card b { font-size: 18px; }
.profile-card small { color: var(--muted); font-size: 13px; }
.profile-link {
  min-height: 72px;
  margin-bottom: 8px;
  padding: 10px 13px;
  border-radius: 19px;
}
.profile-link > span {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--surface-soft);
}
.profile-link b,
.profile-link small { font-size: 13px; }
.profile-link em { color: #c7c7cc; }

.wp-card { padding: 16px; border-radius: 20px; }
.wp-logo {
  border-radius: 15px;
  background: var(--blue);
}
.wp-card p,
.wp-card small { color: var(--muted); font-size: 13px; }

/* Group, cooperative and writing tools */
.group-intro {
  padding: 16px;
  border: var(--hairline);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}
.group-mark,
.group-avatar,
.partner-avatar {
  border-radius: 17px;
  color: var(--blue);
  background: var(--surface-blue);
  box-shadow: none;
}
.group-intro b { color: var(--ink); }
.group-intro p { color: var(--muted); font-size: 13px; }
.group-intro > small { color: var(--muted); background: var(--surface-soft); font-size: 13px; }
.group-form,
.group-detail { border-radius: 21px; }
.group-form input {
  height: 52px;
  border: var(--hairline);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 16px;
}
.group-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 122, 255, .12); }
.group-card { border-radius: 19px; }
.group-card small { color: var(--muted); font-size: 13px; }
.group-code-line { color: var(--muted); background: var(--surface-soft); }
.group-code-line b,
.group-code-line button { color: var(--blue); }
.team-rank-row { border-radius: 16px; box-shadow: none; }
.team-rank-row.top { border-color: rgba(255, 159, 10, .22); background: var(--surface-orange); }

.hunt-head {
  border-bottom: .5px solid rgba(60, 60, 67, .1);
  background: rgba(245, 245, 247, .9);
}
.team-score,
.partner-row {
  border: var(--hairline);
  border-radius: 18px;
  background: #fff;
  box-shadow: none;
}
.hunt-task h2 { color: var(--ink); letter-spacing: -.025em; }
.hunt-task p { color: var(--muted); font-size: 13px; }
.hunt-grid { gap: 10px; }
.hunt-cell { border-radius: 22px; background: #fff; }
.hunt-cell.mine { border-color: rgba(48, 181, 138, .3); background: var(--surface-green); }
.quick-reactions button { border-radius: 18px; background: #fff; }

.write-mode-tabs button {
  min-height: 72px;
  padding: 10px;
  border: var(--hairline);
  border-radius: 19px;
  background: #fff;
  box-shadow: none;
}
.write-mode-tabs button.active {
  border-color: rgba(0, 122, 255, .3);
  background: var(--surface-blue);
  box-shadow: none;
}
.write-mode-tabs b { color: var(--ink); }
.write-mode-tabs small { color: var(--muted); font-size: 13px; }
.write-mission {
  min-height: 106px;
  border: var(--hairline);
  border-radius: 23px;
  color: var(--ink);
  background: #fff;
}
.write-mission small,
.write-mission p { color: var(--muted); font-size: 13px; }
.write-mission h3 i { color: var(--blue); }
.write-turn-chip { color: #333338; background: var(--surface-soft); }
.write-turn-chip span { color: #fff; background: var(--blue); }
.write-pad-wrap {
  border: var(--hairline);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}
.write-grid {
  background: linear-gradient(90deg, transparent 49.7%, #dedee3 49.8% 50.2%, transparent 50.3%),
              linear-gradient(transparent 49.7%, #dedee3 49.8% 50.2%, transparent 50.3%),
              linear-gradient(45deg, transparent 49.8%, #eeeef2 49.9% 50.1%, transparent 50.2%),
              linear-gradient(-45deg, transparent 49.8%, #eeeef2 49.9% 50.1%, transparent 50.2%);
}
.write-status span,
.write-note { color: var(--muted); font-size: 13px; }
.write-pad-lock { background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); }
.lesson-write-complete {
  border: 0;
  border-radius: 23px;
  background: var(--surface-green);
}
.lesson-write-complete-mark {
  border-radius: 50%;
  background: var(--mint);
  box-shadow: none;
}

/* Rewards stay playful, while their containers become calmer. */
.puzzle-card { padding: 17px; border-radius: 23px; }
.puzzle-title h3 { color: var(--ink); }
.puzzle-title > b { color: #9a6700; background: var(--surface-orange); }
.panda-stage { border-radius: 22px; }
.collection-grid { gap: 9px; }
.collection-card { min-height: 122px; border-radius: 20px; }
.collection-card.active { border-color: rgba(0, 122, 255, .3); background: var(--surface-blue); box-shadow: none; }
.collection-card.completed { border-color: rgba(48, 181, 138, .25); background: var(--surface-green); box-shadow: none; }
.collection-card.locked { filter: grayscale(.6); opacity: .6; }
.reward-emoji-art > span { animation: none; filter: none; }

/* Sheets and transient feedback */
.modal {
  background: rgba(0, 0, 0, .28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-card {
  padding: 24px 19px 22px;
  border-radius: 28px 28px 0 0;
  color: var(--ink);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -18px 60px rgba(0, 0, 0, .14);
}
.modal-card > small,
.modal-card > p { color: var(--muted); font-size: 13px; }
.grade-plan div,
.review-answer,
.sync-compare section,
.sync-confirm-panel {
  border: var(--hairline);
  border-radius: 17px;
  background: var(--surface-soft);
}
.sync-strategies .primary-btn,
.sync-strategies .outline-btn,
.sync-recovery-actions .primary-btn,
.sync-recovery-actions .outline-btn,
.sync-recovery-actions .quiet-btn { min-height: 50px; border-radius: 15px; }

.toast {
  bottom: 92px;
  max-width: calc(100% - 32px);
  padding: 11px 15px;
  overflow: hidden;
  border-radius: 999px;
  color: #fff;
  background: rgba(29, 29, 31, .9);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 13px;
  text-overflow: ellipsis;
}

/* Keep motion purposeful and short. */
.station-card,
.mode-card,
.profile-link,
.group-card,
.book-char,
.collection-card { transition-duration: .16s; }

@media (max-width: 390px) {
  .home-main,
  .inner-main { padding-left: 13px; padding-right: 13px; }
  .smart-card { min-height: 238px; padding: 21px 18px; }
  .smart-card h1 { font-size: 31px; }
  .exercise-card { min-height: 390px; padding-left: 13px; padding-right: 13px; }
  .lesson-main { padding-left: 11px; padding-right: 11px; }
  .option { min-height: 106px; }
  .mode-card { padding-left: 11px; padding-right: 11px; }
  .book-filter { overflow-x: auto; justify-content: flex-start; }
  .book-filter button { flex: 0 0 auto; padding: 0 11px; }
}

@media (max-width: 350px) {
  .topbar { padding-left: 13px; padding-right: 13px; }
  .top-stats span { padding: 0 8px; }
  .smart-card h1 { font-size: 28px; }
  .smart-card p { font-size: 13px; }
  .reward-teaser p { display: none; }
  .station-card .station-icon { width: 54px; height: 54px; flex-basis: 54px; }
  .lesson-phase-card { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; }
  .lesson-phase-card > span { width: 40px; height: 40px; }
}

@media (min-width: 481px) {
  .app { border-left: var(--hairline); border-right: var(--hairline); }
}

/* 1.4.0 primary-school curriculum progress */
.writing-track {
  height: 7px;
  margin: -3px 0 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #ececf0;
}

.writing-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--mint);
  transition: width .45s ease;
}

.curriculum-overview {
  display: grid;
  gap: 8px;
  max-height: 34vh;
  margin-top: 12px;
  padding-right: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.curriculum-grade-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: var(--hairline);
  border-radius: 16px;
  background: var(--paper);
}

.curriculum-grade-row > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-blue);
  color: var(--blue2);
  font-size: 20px;
  font-weight: 800;
}

.curriculum-grade-row b,
.curriculum-grade-row small {
  display: block;
}

.curriculum-grade-row b { font-size: 15px; }
.curriculum-grade-row small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.curriculum-grade-row i {
  display: block;
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #ececf0;
}
.curriculum-grade-row i em { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.stage-goals span { line-height: 1.45; }

@media (prefers-reduced-motion: reduce) {
  .app *,
  .app *::before,
  .app *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
