:root {
  --bg: #FFF7EA;
  --card: #FFFFFF;
  --ink: #3A2E26;
  --muted: #8A7A6C;
  --orange: #FF8A3D;
  --green: #2FA866;
  --red: #E5534B;
  --blue: #3D8BFF;
  --yellow: #FFD43B;
  --skin: #F9CBA4;
  --skin-line: #C98B62;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 19px;
  line-height: 1.75;
}
main { max-width: 760px; margin: 0 auto; padding: 0 14px 30px; }
b { color: #C2410C; }
ruby rt { font-size: 0.55em; color: var(--muted); }

.hero { text-align: center; padding: 34px 16px 18px; }
.hero h1 { font-size: 40px; margin: 6px 0 0; letter-spacing: 4px; }
.hero .sub { margin: 4px 0 14px; color: var(--muted); }
.hero-pencil { font-size: 64px; display: inline-block; animation: wiggle 2.4s ease-in-out infinite; transform-origin: 30% 80%; }
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg) translateX(0); }
  25% { transform: rotate(-12deg) translateX(-6px); }
  50% { transform: rotate(4deg) translateX(6px); }
  75% { transform: rotate(-8deg) translateX(-2px); }
}

.card {
  background: var(--card);
  border-radius: 22px;
  padding: 18px 18px 20px;
  margin: 18px 0;
  box-shadow: 0 4px 0 rgba(58, 46, 38, 0.08), 0 8px 24px rgba(58, 46, 38, 0.06);
}
.card h2 { font-size: 24px; margin: 0 0 8px; line-height: 1.5; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.praise { background: #EAF8EF; }

button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.say {
  border: 0; background: #FFF0E3; color: #C2410C; border-radius: 999px;
  padding: 6px 14px; font-size: 17px; white-space: nowrap; flex-shrink: 0;
}
.say:active { transform: scale(0.95); }
.btn {
  border: 2px solid #E8DCCD; background: #fff; color: var(--ink);
  border-radius: 14px; padding: 8px 14px; font-size: 17px;
}
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; }
.controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

.stage { width: 100%; background: #FFFBF4; border-radius: 16px; border: 2px dashed #F1E3D0; overflow: hidden; }
.stage svg { display: block; width: 100%; height: auto; }
.stage.small { max-width: 520px; margin: 8px auto; }

.steps { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.steps button {
  width: 64px; height: 64px; border-radius: 50%; border: 3px solid #E8DCCD; background: #fff;
  font-size: 26px; font-weight: 700; color: var(--muted); line-height: 1;
  transition: all .3s;
}
.steps button.active { border-color: var(--orange); background: var(--orange); color: #fff; transform: scale(1.08); }
.steps button.done { border-color: var(--orange); color: var(--orange); }
.step-text {
  margin-top: 12px; background: #FFF4E8; border-radius: 14px; padding: 12px 16px; min-height: 150px;
  font-size: 20px;
}
.step-text .t { font-size: 24px; font-weight: 800; color: var(--orange); margin-right: 6px; }
.tip { font-size: 16px; color: var(--muted); margin: 12px 0 0; }

.fix { border-top: 2px dashed #F1E3D0; padding-top: 14px; margin-top: 14px; }
.fix:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.fix-head { display: flex; align-items: center; gap: 10px; }
.fix-head h3 { margin: 0; font-size: 21px; flex: 1; }
.num {
  width: 32px; height: 32px; border-radius: 50%; background: var(--red); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0;
}
.fix-caption { text-align: center; font-weight: 700; font-size: 20px; margin: 6px 0; min-height: 1.75em; transition: color .3s; }
.fix-caption.bad { color: var(--red); }
.fix-caption.ok { color: var(--green); }
.good { background: #EAF8EF; border-radius: 12px; padding: 8px 12px; }
.good b { color: #1E7A47; }
.hl-yellow { background: var(--yellow); color: var(--ink) !important; padding: 0 4px; border-radius: 4px; }

.good-btn.on { background: var(--green); border-color: var(--green); color: #fff; }
.bad-btn.on { background: var(--red); border-color: var(--red); color: #fff; }

.rules { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.rules li { display: flex; gap: 12px; align-items: center; background: #F3F8FF; border-radius: 14px; padding: 10px 14px; }
.rules .big { font-size: 34px; }
.rules b { font-size: 21px; color: #1D4ED8; display: block; }
.rules small { color: var(--muted); font-size: 16px; display: block; line-height: 1.5; }

/* quiz */
.q { margin: 14px 0; padding: 12px 14px; border-radius: 16px; background: #FFFBF4; }
.q p { margin: 0 0 8px; font-weight: 700; }
.q .opts { display: grid; gap: 8px; }
.q .opt { text-align: left; border: 2px solid #E8DCCD; background: #fff; border-radius: 12px; padding: 8px 12px; font-size: 18px; transition: all .25s; }
.q .opt.right { border-color: var(--green); background: #EAF8EF; }
.q .opt.wrong { border-color: var(--red); background: #FDECEB; animation: shake .4s; }
.q .fb { min-height: 1.6em; margin-top: 6px; font-size: 17px; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
.quiz-result { text-align: center; font-size: 22px; font-weight: 800; color: var(--green); min-height: 1.5em; }

/* checklist */
.check { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin: 8px 0;
  border: 2px solid #E8DCCD; background: #fff; border-radius: 14px; padding: 10px 14px; font-size: 19px; transition: all .25s; }
.check .box { width: 32px; height: 32px; border-radius: 10px; border: 3px solid #D6C6B3; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; transition: all .25s; }
.check.on { border-color: var(--green); background: #EAF8EF; }
.check.on .box { background: var(--green); border-color: var(--green); }
.star-msg { text-align: center; font-size: 22px; font-weight: 800; min-height: 1.6em; color: #D97706; }
.star-msg.pop { animation: pop .6s; }
@keyframes pop { 0%{transform:scale(.6);opacity:0} 60%{transform:scale(1.15);opacity:1} 100%{transform:scale(1)} }
.streak-title { font-size: 18px; margin: 10px 0 6px; color: var(--muted); }
.stars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.stars span { aspect-ratio: 1; border-radius: 12px; background: #F4EDE3; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.stars span.got { background: #FFF3C4; }

.parents summary { font-size: 21px; font-weight: 700; cursor: pointer; }
.parents li { margin: 8px 0; font-size: 17px; }

footer { text-align: center; color: var(--muted); padding: 10px 0 40px; }

/* ---------- SVG hand ---------- */
.hand .part { transition: opacity .7s ease, transform .7s ease; }
.hand:not(.r1) .f1,
.hand:not(.r2) .f2,
.hand:not(.r3) .f3,
.hand:not(.r4) .f4 { opacity: 0; transform: translate(26px, 14px); }
.hand.r4 .tucked { opacity: 0; }
.hand .pencil-rot { transform: rotate(-72deg); transition: transform 1.1s cubic-bezier(.5,1.6,.5,1); }
.hand.r3 .pencil-rot { transform: rotate(-55deg); }
.hand .pulse { animation: pulse 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.35); } }
.hand .stress { opacity: 0; transition: opacity .5s; }
.hand.fist .tucked { opacity: 1; }
.hand.fist .relaxed { opacity: 0; }
.hand.fist .stress { opacity: 1; }
.hand .now { opacity: 0; transition: opacity .4s; }
.hand.s1 .now1, .hand.s2 .now2, .hand.s3 .now3, .hand.s4 .now4 { opacity: 1; }

/* 手：写字、捏得太低、表情 */
.hand .part { transition: opacity .5s ease, transform .8s cubic-bezier(.34,1.56,.64,1); }
.hand .mv, .hand .pmv { transition: transform 1s ease-in-out; }
.hand.low .mv { transform: translate(-26px, 37px); }
.hand.sightmode .pencil-rot { transform: rotate(-55deg); }
.hand.sightmode .egg, .hand.sightmode .ink { display: none; }
.hand .ink { stroke-dasharray: 44; stroke-dashoffset: 44; }
.hand.writing .mv, .hand.writing .pmv { animation: writeMove 2.8s ease-in-out; }
.hand.writing .ink { animation: ink 2.8s ease-in-out forwards; }
@keyframes writeMove { 0% { transform: translate(0,0); } 12% { transform: translate(-20px,-10px); } 25% { transform: translate(-44px,0); } 80%, 100% { transform: translate(0,0); } }
@keyframes ink { 0%, 25% { stroke-dashoffset: 44; } 80%, 100% { stroke-dashoffset: 0; } }
.hand .face-sad, .hand .egg-bad { opacity: 0; transition: opacity .4s; }
.hand .face-ok, .hand .egg-ok { transition: opacity .4s; }
.hand.fist .face-sad, .hand.low .face-sad, .hand.fist .egg-bad { opacity: 1; }
.hand.fist .face-ok, .hand.low .face-ok, .hand.fist .egg-ok { opacity: 0; }
.hand.fist .egg { animation: squeeze .5s ease-in-out 3; transform-box: fill-box; transform-origin: center; }
@keyframes squeeze { 0%,100% { transform: scale(1); } 50% { transform: scale(.88, 1.06); } }
.hand .ray { stroke: var(--green); transition: stroke .4s; }
.hand.low .ray { stroke: var(--red); stroke-dasharray: 8 7; }
.hand .mark-bad { opacity: 0; transition: opacity .4s; }
.hand.low .mark-bad { opacity: 1; }
.hand .mark-ok { transition: opacity .4s; }
.hand.low .mark-ok { opacity: 0; }
.rhyme { font-size: 23px; font-weight: 800; color: #1D4ED8; margin: 2px 0 4px; letter-spacing: 1px; }

/* angle demo */
.angle .rot { transition: transform 1.2s cubic-bezier(.5,1.5,.5,1); transform: rotate(-90deg); }
.angle.ok .rot { transform: rotate(-52deg); }
.angle .okonly { opacity: 0; transition: opacity .5s; }
.angle.ok .okonly { opacity: 1; }
.angle .badonly { opacity: 1; transition: opacity .5s; }
.angle.ok .badonly { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .hero-pencil, .hand .pulse { animation: none; }
}
@media (max-width: 420px) {
  body { font-size: 18px; }
  .hero h1 { font-size: 34px; }
  .card { padding: 14px 13px 16px; border-radius: 18px; }
  .card h2 { font-size: 21px; }
  .steps button { width: 56px; height: 56px; font-size: 23px; }
}

.song { background: #F3F8FF; border-radius: 14px; padding: 10px 14px; margin: 12px 0 0; text-align: center; font-size: 19px; line-height: 1.9; }
.song b { color: #1D4ED8; }

/* 真人照片 */
.photo .pp { opacity: .0; transition: opacity .5s; }
.photo.on0 .pp0, .photo.on1 .pp1, .photo.on2 .pp2, .photo.on3 .pp3 { opacity: 1; }
.photo .pulse { animation: pulse 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.photo-tabs { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.photo-tabs button { min-width: 64px; height: 48px; padding: 0 14px; border-radius: 999px; border: 3px solid #E8DCCD; background: #fff; font-size: 21px; font-weight: 700; color: var(--muted); }
.photo-tabs button.active { border-color: var(--orange); background: var(--orange); color: #fff; }
.credit { font-size: 13px; color: var(--muted); text-align: center; margin: 4px 0 0; }
