/* 学习乐园：手机优先的单栏卡片；单词写在“四线三格”上 */
:root {
  --bg: #EDF2F7;
  --surface: #FFFFFF;
  --soft: #F5F8FB;
  --ink: #1B2440;
  --muted: #5E6A85;
  --line: #D3DCE8;
  --grid: #B6C3D6;
  --grid-base: #E8604C;
  --accent: #E8604C;
  --accent-ink: #FFFFFF;
  --good: #1F9D5A;
  --hard: #C77C00;
  --bad: #C8463A;
  --easy: #2F6FD6;
  --star: #F2AE00;
  --c-blue: #3F74E0; --c-pink: #DB4F7B; --c-teal: #13907F; --c-purple: #7E52E0;
  --c-orange: #DC7F0E; --c-red: #D0433B; --c-green: #388F44;
  --font-word: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Varela Round", "Nunito", system-ui, sans-serif;
  --font-ui: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font-word);
  --r: 22px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1524; --surface: #1A2236; --soft: #151C2E; --ink: #EEF2FA; --muted: #9BA7BF;
    --line: #2B3550; --grid: #3D4A6A; --grid-base: #FF7A63; --accent: #FF7A63; --accent-ink: #1A0D0A;
    --good: #3CC97E; --hard: #F2B23A; --bad: #FF7A6E; --easy: #6E98F5; --star: #FFC933;
    --c-blue: #6E98F5; --c-pink: #F27BA0; --c-teal: #3CC2AE; --c-purple: #A585F5; --c-orange: #F5A443; --c-red: #F27069; --c-green: #5FC06B;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font-ui); -webkit-tap-highlight-color: transparent; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
a.who, a.tab, a.mode, a.kid, a.back, a.brand, a.icon-btn { text-decoration: none; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.app {
  max-width: 680px; margin: 0 auto;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* 顶栏 */
.bar { display: flex; align-items: center; gap: 10px; padding-block: 14px 12px; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.who {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px 4px 5px; font-weight: 700; font-size: 15px;
}
.who .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: 18px; font-family: var(--emoji); }
.who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 7em; }
.icon-btn { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; padding: 0; }
.icon-btn svg { width: 20px; height: 20px; }

/* 通用 */
.sec-title { font-size: 13px; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 22px 2px 10px; }
.panel { background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: 0 1px 0 var(--line); }
.btn { border: 0; border-radius: 999px; padding: 11px 20px; font-weight: 800; font-size: 16px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.btn.dark { background: var(--ink); color: var(--bg); box-shadow: none; }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.danger { color: var(--bad); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }
.note { font-size: 13px; color: var(--muted); }
.top-row { display: flex; align-items: center; gap: 10px; padding-block: 2px 12px; }
.back { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px 7px 10px; font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; }
.crumb { font-weight: 700; color: var(--muted); font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 15px; white-space: nowrap; }
.toggle { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 14px; }
.toggle.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.loading { text-align: center; padding: 60px 16px; color: var(--muted); }

/* 首页“今天” */
.today { background: var(--ink); color: var(--bg); border-radius: var(--r); padding: 18px; display: grid; gap: 10px; }
.today h2 { margin: 0; font-size: 22px; line-height: 1.3; text-wrap: balance; }
.today p { margin: 0; font-size: 14px; opacity: .8; }
.today .row { margin-top: 2px; }
.today .btn.primary { font-size: 17px; }
.today .btn.ghost { background: transparent; color: var(--bg); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.3); }
.streak { display: inline-flex; gap: 6px; align-items: center; font-weight: 800; font-size: 14px; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.12); justify-self: start; }

/* 资源卡片 */
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.res {
  --c: var(--c-blue);
  position: relative; display: grid; gap: 4px; align-content: start; min-width: 0;
  background: var(--surface); border-radius: var(--r); padding: 14px; text-decoration: none; color: inherit;
  box-shadow: inset 0 5px 0 var(--c), 0 1px 0 var(--line);
}
.res:active { transform: scale(.98); }
.res:only-child { grid-column: 1 / -1; grid-template-columns: auto 1fr; column-gap: 14px; }
.res:only-child .ic { grid-row: 1 / span 3; margin: 0; align-self: center; }
.res:only-child > :not(.ic):not(.due) { grid-column: 2; }
.res .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); font-family: var(--font-word); font-weight: 800; font-size: 18px; margin: 6px 0 4px; }
.res b { font-size: 17px; line-height: 1.25; text-wrap: balance; }
.res span { font-size: 13px; color: var(--muted); }
.res .meter { margin-top: 8px; }
.meter { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 3px; }
.res .due { position: absolute; top: 12px; right: 12px; font-size: 12px; font-weight: 800; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }

/* 选孩子 */
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.kid { border: 0; background: var(--surface); border-radius: var(--r); padding: 18px 10px 14px; display: grid; justify-items: center; gap: 8px; box-shadow: 0 1px 0 var(--line); }
.kid .av { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-size: 44px; background: var(--soft); font-family: var(--emoji); }
.kid b { font-size: 18px; }
.kid.on { box-shadow: 0 0 0 3px var(--accent); }
.kid.add .av { font-size: 34px; color: var(--muted); font-family: var(--font-word); }

/* 卡组页 */
.deck-head { --c: var(--c-blue); border-radius: var(--r); padding: 18px; background: var(--c); color: #fff; display: grid; gap: 4px; }
.deck-head .lb { font-size: 13px; font-weight: 800; letter-spacing: .06em; opacity: .85; }
.deck-head h1 { margin: 0; font-family: var(--font-word); font-size: 26px; line-height: 1.15; text-wrap: balance; }
.deck-head p { margin: 0; font-size: 14px; opacity: .92; font-variant-numeric: tabular-nums; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-block: 14px 6px; }
.mode { border: 0; border-radius: var(--r); background: var(--surface); padding: 14px; text-align: left; display: grid; gap: 2px; box-shadow: 0 1px 0 var(--line); text-decoration: none; }
.mode b { font-size: 18px; }
.mode span { font-size: 13px; color: var(--muted); }
.mode svg { width: 28px; height: 28px; color: var(--accent); margin-bottom: 2px; }
.mode.on { background: var(--ink); color: var(--bg); }
.mode.on span { color: inherit; opacity: .75; }
.mode .pill { justify-self: start; font-size: 12px; font-weight: 800; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 8px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 14px -2px 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.tab.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.list-head { display: flex; align-items: center; gap: 10px; margin: 4px 2px 10px; }
.list-head .t { font-weight: 800; min-width: 0; }
.list-head .t small { display: block; font-weight: 600; color: var(--muted); font-size: 13px; }
.list-head .toggle { margin-left: auto; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding-bottom: 150px; }
.chip {
  position: relative; overflow: hidden; min-width: 0;
  border: 1px solid var(--line); background: var(--surface); border-radius: 18px;
  padding: 10px 12px 12px; text-align: left;
  display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: center;
  transition: box-shadow .15s, transform .1s; scroll-margin-bottom: 150px; scroll-margin-top: 12px;
}
.chip:active { transform: scale(.97); }
.c-pic { grid-row: 1 / span 2; width: 34px; text-align: center; font-size: 30px; line-height: 1; font-family: var(--emoji); }
.c-pic.num, .pic.num, .now-pic.num { font-family: var(--font-word); font-weight: 800; color: var(--accent); }
.c-pic.num { font-size: 24px; }
.chip b { font-family: var(--font-word); font-size: 19px; line-height: 1.2; min-width: 0; overflow-wrap: normal; word-break: keep-all; hyphens: none; }
.chip.long b { font-size: 16px; }
.chip small { font-size: 13px; line-height: 1.35; color: var(--muted); min-width: 0; }
.chip.no-pic { grid-template-columns: 1fr; }
.chip.no-pic .c-pic { display: none; }
.c-stars { position: absolute; bottom: 9px; right: 10px; font-size: 11px; letter-spacing: 1px; color: var(--line); }
.c-stars .on { color: var(--star); }
.pop { animation: pop .5s ease; }
@keyframes pop { 40% { transform: scale(1.35); } }
.c-mem { position: absolute; top: 8px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.c-mem.learn { background: var(--hard); }
.c-mem.ok { background: var(--good); }
.c-turn { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; }
.c-turn i { display: block; height: 100%; width: 0; background: var(--accent); }
.chip[data-phase] { box-shadow: 0 0 0 3px var(--accent); border-color: var(--accent); }
.chip[data-phase="say"] .c-turn i { animation: fill linear forwards; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 0 2px 10px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

/* 底部“正在读”条 */
.now {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding-top: 12px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--ink); color: var(--bg); box-shadow: 0 -10px 30px -12px rgba(15,21,36,.45); border-radius: 24px 24px 0 0;
}
.now-in { max-width: 680px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center; }
.now-pic { grid-row: 1 / span 2; font-size: 48px; line-height: 1; font-family: var(--emoji); }
.now-word { font-family: var(--font-word); font-weight: 800; font-size: 34px; line-height: 1.1; min-width: 0; }
.now-sub { font-size: 14px; opacity: .8; min-width: 0; }
.now-cue { grid-row: 1 / span 2; grid-column: 3; justify-self: end; font-weight: 800; font-size: 18px; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.12); white-space: nowrap; }
.now-cue.say { background: var(--accent); color: var(--accent-ink); }
.now-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); overflow: hidden; margin-top: 8px; }
.now-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.now-bar.run i { animation: fill linear forwards; }
@keyframes fill { to { width: 100%; } }

/* 复习 */
.progress { height: 6px; border-radius: 3px; background: var(--surface); overflow: hidden; margin-bottom: 12px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .3s; }
.card {
  background: var(--surface); border-radius: 28px; padding: 18px 16px 16px;
  display: grid; justify-items: center; align-content: center; gap: 6px; text-align: center;
  min-height: 330px; box-shadow: 0 1px 0 var(--line), 0 12px 30px -18px rgba(27,36,64,.35);
}
.pic { font-size: 76px; line-height: 1.1; font-family: var(--emoji); }
.pic:empty { display: none; }
.lined-wrap { width: 100%; }
canvas.lined { display: block; width: 100%; }
.extra { font-family: var(--font-word); font-size: 19px; color: var(--muted); font-weight: 700; }
.extra:empty { display: none; }
.zh { font-size: 40px; font-weight: 800; line-height: 1.3; }
.say-btn { border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: 6px 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.say-btn svg { width: 18px; height: 18px; }
.ans-word { font-family: var(--font-word); font-weight: 800; font-size: 26px; color: var(--muted); }
.ex { font-family: var(--font-word); font-size: 15px; line-height: 1.45; color: var(--muted); max-width: 30em; margin-top: 6px; font-style: italic; }
.kind { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.flip { perspective: 1400px; }
.flip-inner { display: grid; transition: transform .45s ease; transform-style: preserve-3d; cursor: pointer; }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.face { grid-area: 1 / 1; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.face.back { transform: rotateY(180deg); }
.hint { text-align: center; color: var(--muted); font-size: 14px; margin-top: 10px; min-height: 21px; }
.rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.rate button { height: 66px; border-radius: 18px; border: 0; font-weight: 800; font-size: 16px; color: #fff; display: grid; place-content: center; line-height: 1.25; padding: 0 4px; }
.rate button small { font-size: 12px; font-weight: 700; opacity: .9; font-variant-numeric: tabular-nums; }
.rate .r1 { background: var(--bad); }
.rate .r2 { background: var(--hard); }
.rate .r3 { background: var(--good); }
.rate .r4 { background: var(--easy); }
.under { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; min-height: 36px; }
.under .btn { font-size: 14px; padding: 7px 14px; }

/* 完成 */
.done { text-align: center; padding-block: 30px 10px; display: grid; gap: 12px; justify-items: center; }
.done .bigstar { font-size: 92px; line-height: 1; color: var(--star); animation: pop .8s ease; }
.done h2 { margin: 0; font-size: 26px; text-wrap: balance; }
.done p { margin: 0; color: var(--muted); font-size: 16px; font-variant-numeric: tabular-nums; }
.done .actions { display: grid; gap: 10px; width: 100%; max-width: 340px; margin-top: 10px; }
.done .actions .btn { height: 52px; font-size: 17px; }

/* 歌曲 */
.song-list { display: grid; gap: 6px; }
.song { border: 0; background: var(--surface); border-radius: 16px; padding: 10px 12px; display: grid; grid-template-columns: 34px 1fr; gap: 0 10px; align-items: center; text-align: left; box-shadow: 0 1px 0 var(--line); }
.song .n { grid-row: 1 / span 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: color-mix(in srgb, var(--c-pink) 16%, transparent); color: var(--c-pink); font-variant-numeric: tabular-nums; }
.song b { font-family: var(--font-word); font-size: 17px; line-height: 1.25; }
.song small { color: var(--muted); font-size: 13px; }
.song.on { box-shadow: 0 0 0 2.5px var(--c-pink); }
.player { position: relative; padding-bottom: 6px; }
.try-here { position: absolute; right: 10px; bottom: 10px; border: 0; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.16); color: #fff; }
.player-box { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 18px; overflow: hidden; background: #14110e; }
.player-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.veil { position: absolute; inset: 0; border: 0; width: 100%; cursor: pointer; font: inherit; display: grid; place-items: center; text-align: center; padding: 16px; color: #fff; background: radial-gradient(circle at 50% 45%, #3a2f25, #14110e); transition: opacity .35s; }
.veil.gone { opacity: 0; pointer-events: none; }
.veil .t { font-size: 18px; font-weight: 800; margin-top: 12px; }
.veil .s { font-size: 13px; opacity: .75; margin-top: 4px; max-width: 26em; }
.spin { width: 40px; height: 40px; margin: 0 auto; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--c-pink); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cover { position: absolute; inset: 0; text-decoration: none; display: grid; place-items: center; cursor: pointer; color: #fff; text-align: center; padding: 12px; border: 0; background: radial-gradient(circle at 50% 45%, #3a2f25, #14110e); width: 100%; }
.cover .play { width: 72px; height: 72px; border-radius: 50%; background: var(--c-pink); margin: 0 auto 12px; display: grid; place-items: center; font-size: 30px; padding-left: 6px; }
.cover .t { font-size: 20px; font-weight: 800; font-family: var(--font-word); }
.cover .s { font-size: 13px; opacity: .75; margin-top: 4px; }
.song-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.song-meta h2 { margin: 0; font-family: var(--font-word); font-size: 22px; line-height: 1.2; flex: 1 1 100%; }
.song-meta .tag { font-size: 13px; color: var(--muted); }
.vers { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.search { width: 100%; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); margin-block: 6px 10px; }
.tip { margin-top: 10px; padding: 10px 14px; background: var(--surface); border-radius: 14px; font-size: 14px; color: var(--muted); }
.tip.warn { box-shadow: inset 3px 0 0 var(--hard); }

/* 动画台词 */
.eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ep { background: var(--surface); border-radius: 16px; padding: 10px 12px 12px; text-decoration: none; display: grid; gap: 2px; box-shadow: 0 1px 0 var(--line); min-width: 0; }
.ep .n { font-weight: 800; font-size: 13px; color: var(--c-pink); font-variant-numeric: tabular-nums; }
.ep b { font-family: var(--font-word); font-size: 16px; line-height: 1.25; }
.ep .meta { font-size: 12px; color: var(--muted); }
.ep .meter { margin-top: 4px; --c: var(--c-pink); }
.ep-title { margin: 0 2px; font-family: var(--font-word); font-size: 26px; line-height: 1.2; text-wrap: balance; }
.lines { display: grid; gap: 8px; }
.line { --c: var(--c-blue); position: relative; overflow: hidden; display: grid; gap: 2px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 9px 40px 11px 12px; box-shadow: inset 4px 0 0 var(--c); scroll-margin: 140px 0 160px; }
.line .sp { font-size: 13px; font-weight: 800; color: var(--c); }
.line .sp small { font-weight: 700; color: var(--muted); font-size: 12px; }
.line .say { font-family: var(--font-word); font-size: 18px; line-height: 1.4; }
.line .mark { position: absolute; top: 9px; right: 12px; font-weight: 800; color: var(--good); }
.line.mine { background: color-mix(in srgb, var(--c) 10%, var(--surface)); border-color: var(--c); }
.line[data-phase] { box-shadow: inset 4px 0 0 var(--c), 0 0 0 3px var(--accent); border-color: var(--accent); }
.line[data-phase="say"] .c-turn i { animation: fill linear forwards; }
:root { --c-muted: var(--muted); }
.now.sentence .now-word { font-size: 20px; line-height: 1.35; font-weight: 700; }
.now.sentence .now-pic { display: none; }
.now.sentence .now-in { grid-template-columns: 1fr auto; }
.now.sentence .now-cue { grid-column: 2; }
.mode:disabled { opacity: .5; }

/* 家长 */
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.form input[type=text], .form select { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); }
.form input[type=range] { width: 100%; accent-color: var(--accent); }
.form .inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 14px; }
.form input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); }
.avatars { display: flex; flex-wrap: wrap; gap: 6px; }
.avatars button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); font-size: 24px; font-family: var(--emoji); padding: 0; }
.avatars button.on { box-shadow: 0 0 0 3px var(--accent); border-color: transparent; }
.kid-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.kid-row:first-child { border-top: 0; }
.kid-row .av { font-size: 32px; font-family: var(--emoji); width: 48px; text-align: center; }
.kid-row .t { min-width: 0; flex: 1; }
.kid-row .t b { display: block; }
.kid-row .t span { font-size: 13px; color: var(--muted); }

/* 学习记录 */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { background: var(--surface); border-radius: 18px; padding: 12px 14px; box-shadow: 0 1px 0 var(--line); }
.tile .v { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .v small { font-size: 14px; font-weight: 700; color: var(--muted); margin-left: 2px; }
.tile .k { font-size: 13px; color: var(--muted); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .tt { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -100%); font-variant-numeric: tabular-nums; }
.chart-axis { font-size: 11px; font-family: var(--font-ui); fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-bar { fill: var(--accent); }
.chart-bar.dim { fill: color-mix(in srgb, var(--accent) 35%, var(--surface)); }
.chart-hit { fill: transparent; }
.chart-hit:hover + .chart-bar, .chart-hit:focus + .chart-bar { fill: var(--ink); }
.groups { display: grid; gap: 10px; }
.grp { display: grid; grid-template-columns: 5.5em 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.grp .lbl { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--soft); gap: 2px; }
.stack i { display: block; height: 100%; }
.stack .ok { background: var(--good); }
.stack .learn { background: var(--hard); }
.grp .num { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; max-width: calc(100vw - 32px); text-align: center; z-index: 30; }
.sync { font-size: 12px; color: var(--muted); text-align: center; margin-top: 18px; }

@media (max-width: 370px) {
  .rate button { font-size: 14px; }
  .pic { font-size: 64px; }
  .zh { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
