:root {
  color-scheme: light;
  --ink: #263238;
  --muted: #6d7877;
  --cream: #fff9ed;
  --surface: #ffffff;
  --yellow: #ffc93d;
  --orange: #f47b3c;
  --green: #42a56f;
  --blue: #3178b7;
  --navy: #153552;
  --mint: #dff5e7;
  --shadow: 0 16px 42px rgba(48, 70, 61, .12);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: linear-gradient(180deg, #fff7e7 0, #f3fbf7 42%, #eef7fb 100%); }
button { font: inherit; }
.filing-landing { display: grid; min-height: 100vh; place-items: center; padding: 28px 18px; background: radial-gradient(circle at 80% 10%, #fff0b7 0, transparent 30%), linear-gradient(160deg, #fffaf0, #eef9f3); }
.filing-card { width: min(100%, 660px); padding: clamp(28px, 7vw, 58px); border: 1px solid rgba(104, 164, 126, .2); border-radius: 34px; background: rgba(255,255,255,.94); box-shadow: 0 24px 70px rgba(43, 83, 65, .14); }
.filing-brand { display: flex; align-items: center; gap: 12px; color: var(--navy); font-size: 17px; }
.filing-brand span { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 15px; color: #fff; background: linear-gradient(145deg, #f69b3f, #ef7040); font-size: 22px; font-weight: 900; }
.filing-kicker { margin: 34px 0 10px; color: var(--green); font-size: 13px; font-weight: 900; letter-spacing: .08em; }
.filing-card h1 { max-width: 520px; font-size: clamp(30px, 7vw, 48px); line-height: 1.25; }
.filing-intro { margin: 22px 0; color: #596862; font-size: 16px; line-height: 1.9; }
.filing-notice { margin: 25px 0; padding: 18px 20px; border: 1px solid #ead58c; border-radius: 18px; color: #6e5c31; background: #fff9e4; }
.filing-notice strong { font-size: 14px; }
.filing-notice p { margin: 7px 0 0; font-size: 13px; line-height: 1.75; }
.family-login { width: 100%; padding: 15px; border: 0; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #48ad76, #278b62); font-weight: 900; cursor: pointer; }
.filing-footer { margin: 18px 0 0; color: #8a9490; font-size: 11px; text-align: center; }
.filing-footer a { color: inherit; text-decoration: none; }
.filing-footer a:hover, .filing-footer a:focus-visible { color: #477d66; text-decoration: underline; }
.app-shell { width: min(100%, 760px); min-height: 100vh; margin: 0 auto; padding: 20px 18px 112px; }
.topbar, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar { margin-bottom: 18px; }
.ip-mode-banner { display: grid; gap: 3px; margin: -5px 0 14px; padding: 10px 13px; border: 1px solid #f0d27b; border-radius: 14px; color: #735b2f; background: #fff7dc; }
.ip-mode-banner strong { font-size: 12px; }
.ip-mode-banner span { font-size: 10px; line-height: 1.45; }
.eyebrow { margin: 0 0 5px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(22px, 5vw, 30px); }
h2 { margin-bottom: 8px; font-size: 21px; line-height: 1.3; }
.profile { border: 0; border-radius: 999px; padding: 10px 14px; color: var(--navy); background: #fff; box-shadow: 0 8px 24px rgba(49, 93, 90, .10); font-weight: 800; }

.hero-card { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.15fr .85fr; min-height: 310px; padding: 27px; border-radius: 30px; color: #fff; background: linear-gradient(140deg, #f69b3f, #f36d3e 55%, #df4f48); box-shadow: 0 22px 48px rgba(214, 92, 49, .26); }
.hero-card::after { content: ""; position: absolute; width: 210px; height: 210px; right: -70px; bottom: -85px; border: 30px solid rgba(255,255,255,.12); border-radius: 50%; }
.hero-copy { position: relative; z-index: 2; }
.chapter-pill { display: inline-block; padding: 7px 11px; border-radius: 999px; background: rgba(255,255,255,.18); font-size: 12px; font-weight: 800; }
.hero-card h2 { margin-top: 18px; font-size: clamp(24px, 6vw, 34px); }
.hero-card p { color: rgba(255,255,255,.86); }
.reward-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 20px 0; font-size: 11px; }
.reward-row strong, .reward-row span { padding: 6px 9px; border-radius: 10px; background: rgba(255,255,255,.14); }
.primary-action { border: 0; border-radius: 16px; padding: 14px 18px; color: #cf4b2d; background: #fff; font-weight: 900; box-shadow: 0 10px 24px rgba(91, 38, 23, .14); cursor: pointer; }
.primary-action span { margin-left: 12px; }
.voice-picker-trigger { display: block; margin-top: 9px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.36); border-radius: 999px; color: rgba(255,255,255,.94); background: rgba(112,45,25,.14); font-size: 10px; cursor: pointer; }
.voice-picker-trigger strong { color: #fff7b6; }
.doudou-stage { align-self: end; position: relative; z-index: 1; min-width: 0; padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; }
.doudou-stage img { display: block; width: 88%; max-height: 210px; margin: 0 0 0 auto; object-fit: contain; object-position: bottom; filter: drop-shadow(0 14px 16px rgba(69, 34, 15, .22)); mix-blend-mode: multiply; }
.doudou-stage:focus-visible { outline: 3px solid rgba(255,255,255,.9); outline-offset: 7px; border-radius: 18px; }
.doudou-stage.talking img { animation: doudou-talk .34s ease-in-out infinite alternate; }
.doudou-stage.talking .speech { background: #fff4a9; animation: speech-breathe .68s ease-in-out infinite alternate; }
.speech { position: absolute; top: 0; right: 0; z-index: 2; max-width: 190px; padding: 9px 11px; border-radius: 14px 14px 4px 14px; color: var(--navy); background: #fff9e8; font-size: 11px; font-weight: 800; box-shadow: 0 8px 22px rgba(59, 34, 18, .16); opacity: 0; visibility: hidden; transform: translateY(4px) scale(.96); transform-origin: right bottom; transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s; }
.doudou-stage.speech-visible .speech, .doudou-stage.talking .speech { opacity: 1; visibility: visible; transform: translateY(0) scale(1); transition-delay: 0s; }
.voice-waves { position: absolute; z-index: 3; left: 0; top: 42%; display: flex; align-items: center; gap: 3px; height: 30px; padding: 5px 7px; border-radius: 999px; background: rgba(255,255,255,.88); box-shadow: 0 7px 18px rgba(74, 39, 20, .16); opacity: 0; transform: translateX(-8px) scale(.8); transition: opacity .18s ease, transform .18s ease; }
.voice-waves i { display: block; width: 3px; height: 7px; border-radius: 999px; background: var(--orange); transform-origin: center; }
.doudou-stage.talking .voice-waves { opacity: 1; transform: translateX(0) scale(1); }
.doudou-stage.talking .voice-waves i { animation: voice-wave .48s ease-in-out infinite alternate; }
.doudou-stage.talking .voice-waves i:nth-child(2) { animation-delay: -.24s; height: 15px; }
.doudou-stage.talking .voice-waves i:nth-child(3) { animation-delay: -.36s; height: 22px; }
.doudou-stage.talking .voice-waves i:nth-child(4) { animation-delay: -.12s; height: 12px; }
.doudou-image-unavailable::after { content: '🦜'; display: grid; place-items: center; min-width: 76px; min-height: 82px; font-size: 58px; line-height: 1; }

@keyframes doudou-talk {
  from { transform: rotate(-1.2deg) translateY(1px); }
  to { transform: rotate(1.2deg) translateY(-5px); }
}

@keyframes speech-breathe {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-3px) scale(1.025); }
}

@keyframes voice-wave {
  from { transform: scaleY(.45); opacity: .55; }
  to { transform: scaleY(1.15); opacity: 1; }
}

.progress-section, .world-preview { margin-top: 30px; }
.section-heading h2 { margin-bottom: 0; }
.time-badge { padding: 8px 12px; border-radius: 12px; color: var(--green); background: var(--mint); font-size: 13px; font-weight: 900; }
.due-review-section { padding: 18px; border-radius: 24px; background: rgba(255,255,255,.82); box-shadow: var(--shadow); }
.due-review-list { display: grid; gap: 9px; margin-top: 14px; }
.due-review-card { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid #dcebe3; border-radius: 16px; background: #f7fcf9; }
.due-review-card > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: #e4f6ea; font-size: 21px; }
.due-review-card > div { display: grid; gap: 3px; min-width: 0; }
.due-review-card strong { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.due-review-card small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.due-review-card button { padding: 9px 10px; border: 0; border-radius: 11px; color: #fff; background: var(--green); font-size: 10px; font-weight: 900; }

@media (max-width: 430px) {
  .due-review-card { grid-template-columns: 38px 1fr; }
  .due-review-card > span { width: 38px; height: 38px; }
  .due-review-card button { grid-column: 2; justify-self: start; }
}
.quest-list { display: grid; gap: 11px; margin-top: 15px; }
.quest-card { display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 13px; width: 100%; padding: 13px; border: 2px solid transparent; border-radius: 20px; text-align: left; color: var(--ink); background: rgba(255,255,255,.88); box-shadow: 0 9px 25px rgba(46, 83, 72, .08); cursor: pointer; }
.quest-card.current { border-color: #ffd36c; background: #fffdf5; }
.quest-card.done { border-color: #94d7ae; background: #f4fff8; }
.quest-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; background: #fff0bd; font-size: 24px; }
.quest-card:nth-child(2) .quest-icon { background: #dff2ff; }
.quest-card:nth-child(3) .quest-icon { background: #e5f6e9; }
.quest-main { display: grid; gap: 4px; }
.quest-main small { color: var(--muted); }
.quest-state { color: var(--orange); font-size: 12px; font-weight: 900; }

.insight-card { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 13px; margin-top: 24px; padding: 19px; border-radius: 22px; background: #183f5d; color: #fff; box-shadow: var(--shadow); }
.insight-card .eyebrow { color: #7ed5e7; }
.insight-card h2 { margin-bottom: 4px; font-size: 17px; }
.insight-card p:last-child { margin-bottom: 0; color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.6; }
.insight-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: rgba(255,255,255,.12); color: #ffd55b; font-size: 25px; }
.insight-card button { border: 0; color: #fff; background: transparent; font-size: 30px; }
.text-action { border: 0; color: var(--green); background: transparent; font-weight: 900; }
.island-card { position: relative; overflow: hidden; min-height: 190px; margin-top: 14px; padding: 22px; border-radius: 26px; background: linear-gradient(#cceefe 0 55%, #9ddc98 56%); box-shadow: var(--shadow); }
.birdhouse, .windmill { position: absolute; bottom: 52px; display: grid; place-items: center; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.08); }
.birdhouse { left: 20%; width: 78px; height: 74px; border-radius: 30px 30px 10px 10px; background: #e68b42; font-size: 48px; }
.windmill { right: 22%; color: #fff5cc; font-size: 75px; transform: rotate(12deg); }
.island-card p { position: absolute; right: 20px; bottom: 19px; margin: 0; color: #315d4d; font-size: 12px; }
.meter { position: absolute; left: 20px; right: 20px; bottom: 16px; height: 7px; border-radius: 999px; background: rgba(255,255,255,.56); }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--yellow); }

.bottom-nav { position: fixed; z-index: 10; left: 50%; bottom: 12px; display: grid; grid-template-columns: repeat(4, 1fr); width: min(calc(100% - 24px), 720px); padding: 9px 6px calc(9px + env(safe-area-inset-bottom)); border: 1px solid rgba(255,255,255,.8); border-radius: 24px; background: rgba(255,255,255,.94); box-shadow: 0 18px 45px rgba(30, 64, 64, .18); backdrop-filter: blur(16px); transform: translateX(-50%); }
.bottom-nav button { display: grid; gap: 4px; justify-items: center; border: 0; color: #7f8988; background: transparent; font-size: 10px; font-weight: 800; }
.bottom-nav span { font-size: 20px; }
.bottom-nav .active { color: var(--orange); }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 96px; max-width: calc(100% - 40px); padding: 11px 16px; border-radius: 999px; color: #fff; background: #213b44; opacity: 0; transform: translate(-50%, 15px); transition: .22s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .app-shell { padding-inline: 13px; }
  .hero-card { grid-template-columns: 1fr .68fr; min-height: 330px; padding: 22px 18px; }
  .hero-card h2 { max-width: 240px; }
  .doudou-stage img { width: 108%; max-height: 195px; margin-left: -8%; }
  .speech { top: -28px; right: -2px; }
  .reward-row { max-width: 235px; }
  .quest-card { grid-template-columns: 46px 1fr; }
  .quest-icon { width: 46px; height: 46px; }
  .quest-state { grid-column: 2; }
}

/* Diagnostic flow */
[hidden] { display: none !important; }
.diagnostic-view { min-height: calc(100vh - 140px); padding-top: 4px; }
.subpage-header { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; }
.subpage-header > button { width: 42px; height: 42px; border: 0; border-radius: 14px; color: var(--navy); background: #fff; box-shadow: 0 8px 22px rgba(42, 74, 71, .10); font-size: 21px; }
.subpage-header h1 { font-size: 23px; }
.subpage-header > span { padding: 7px 10px; border-radius: 999px; color: var(--green); background: var(--mint); font-size: 12px; font-weight: 900; }
.diagnostic-meter { height: 8px; margin: 18px 0 24px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.8); }
.diagnostic-meter span { display: block; width: 33.333%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--yellow), var(--orange)); transition: width .24s ease; }
.diagnostic-card { padding: 24px; border-radius: 28px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.question-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--green); font-size: 11px; font-weight: 800; }
.question-meta b { color: #899391; font-weight: 600; }
.diagnostic-card h2 { min-height: 70px; margin: 25px 0 20px; font-size: clamp(22px, 6vw, 30px); line-height: 1.5; }
.answer-options { display: grid; gap: 12px; }
.diagnostic-answer-input { box-sizing: border-box; width: 100%; min-height: 58px; padding: 12px 16px; border: 2px solid #dfe8e3; border-radius: 18px; outline: 0; color: var(--ink); background: #fbfdfc; font: inherit; font-size: 18px; font-weight: 800; }
.diagnostic-answer-input:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(238, 145, 59, .13); }
.diagnostic-answer-input.correct { border-color: #55a878; color: #28714c; background: #eaf8ef; }
.diagnostic-answer-input.wrong { border-color: #e77769; color: #b34135; background: #fff0ed; }
.diagnostic-answer-input:disabled { opacity: 1; -webkit-text-fill-color: currentColor; }
.answer-option { min-height: 58px; padding: 12px; border: 2px solid #e9eeec; border-radius: 18px; color: var(--ink); background: #fbfdfc; font-size: 17px; font-weight: 800; }
.answer-option.selected { border-color: var(--orange); color: #c8512b; background: #fff6e8; }
.answer-option.correct { border-color: #55a878; color: #28714c; background: #eaf8ef; }
.answer-option.wrong { border-color: #e77769; color: #b34135; background: #fff0ed; }
.answer-option:disabled { opacity: 1; }
.learning-reasons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 12px; }
.learning-reasons button { min-height: 46px; padding: 7px 4px; border: 1px dashed #78b895; border-radius: 13px; color: #327552; background: #f0faf4; font-size: 10px; font-weight: 800; }
.learning-reasons button.selected { border-style: solid; color: #fff; background: #55a878; }
.learning-reasons button:disabled { opacity: .72; }
.answer-feedback { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: start; margin-top: 16px; padding: 13px; border-radius: 17px; text-align: left; }
.answer-feedback.success { color: #28714c; background: #eaf8ef; }
.answer-feedback.retry { color: #9c4a2e; background: #fff3e6; }
.answer-feedback > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #fff; font-weight: 900; }
.answer-feedback.success > span { background: #55a878; }
.answer-feedback.retry > span { background: #e18455; }
.answer-feedback strong { font-size: 14px; }
.answer-feedback p { margin: 4px 0 0; color: #596762; font-size: 12px; line-height: 1.55; }
.question-tip { margin: 18px 0 12px; color: var(--muted); font-size: 12px; text-align: center; }
.diagnostic-next { width: 100%; padding: 14px; border: 0; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--orange), #e95142); font-weight: 900; }
.diagnostic-next:disabled { color: #9aa39f; background: #e9edeb; }
.diagnostic-result { padding: 28px 24px; border-radius: 30px; text-align: center; background: #fff; box-shadow: var(--shadow); }
.result-doudou { position: relative; width: 130px; height: 145px; margin: 0 auto 8px; }
.result-doudou img { width: 100%; height: 100%; object-fit: contain; }
.result-doudou span { position: absolute; top: 10px; right: -4px; color: var(--yellow); font-size: 28px; }
.diagnostic-result h2 { font-size: 23px; }
.diagnostic-result > p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }
.diagnostic-reward { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; margin: 18px 0; padding: 15px; border: 1px solid #f2cb67; border-radius: 18px; text-align: left; background: linear-gradient(135deg, #fff8cf, #fff0d8); }
.diagnostic-reward[hidden] { display: none; }
.diagnostic-reward > span { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; font-size: 28px; background: #fff; box-shadow: 0 8px 20px rgba(225, 152, 44, .16); }
.diagnostic-reward strong { color: #9a5a17; }
.diagnostic-reward p { margin: 4px 0 0; color: #735d43; font-size: 13px; }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0; }
.result-stats div { display: grid; gap: 5px; padding: 15px; border-radius: 18px; background: #f3faf6; }
.result-stats strong { color: var(--green); font-size: 24px; }
.result-stats span { color: var(--muted); font-size: 11px; }

/* Account and learning-stage flow */
.auth-view { min-height: calc(100vh - 80px); }
.auth-card { overflow: hidden; margin-top: 22px; padding: 22px; border-radius: 28px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.auth-doudou { display: grid; grid-template-columns: 1fr 76px; align-items: center; gap: 13px; margin: -8px 0 16px; padding: 9px 13px; border-radius: 20px; background: #fff7dc; }
.auth-doudou img { grid-column: 2; grid-row: 1; width: 76px; height: 82px; object-fit: contain; }
.auth-doudou p { grid-column: 1; grid-row: 1; margin: 0; color: #73572b; font-size: 13px; font-weight: 800; line-height: 1.55; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 16px; background: #f0f4f2; }
.auth-tabs button { padding: 11px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-weight: 900; }
.auth-tabs button.active { color: var(--green); background: #fff; box-shadow: 0 5px 15px rgba(43,76,62,.09); }
.auth-card form { display: grid; gap: 15px; margin-top: 18px; }
.auth-card label { display: grid; gap: 7px; color: var(--navy); font-size: 13px; font-weight: 800; }
.auth-card input:not([type="checkbox"]), .auth-card select { width: 100%; min-height: 48px; padding: 11px 13px; border: 2px solid #e8eeeb; border-radius: 14px; color: var(--ink); background: #fbfdfc; outline: 0; font-size: 15px; }
.auth-card input:focus, .auth-card select:focus { border-color: #73bd91; box-shadow: 0 0 0 3px rgba(66,165,111,.11); }
.register-fields { display: grid; gap: 15px; }
.stage-note { display: grid; gap: 4px; padding: 12px 14px; border-radius: 15px; color: #73572b; background: #fff7dc; }
.stage-note strong { font-size: 13px; }
.stage-note span { font-size: 11px; line-height: 1.55; }
.auth-card .preview-choice { display: flex; grid-template-columns: none; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.preview-choice input { width: 18px; height: 18px; accent-color: var(--green); }
.auth-error { min-height: 18px; margin: 0; color: #bd493b; font-size: 12px; text-align: center; }
.auth-submit { width: 100%; padding: 14px; border: 0; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #48ad76, #278b62); font-weight: 900; box-shadow: 0 10px 22px rgba(41,137,95,.2); }
.auth-submit:disabled { opacity: .6; }
.invite-gate { display: grid; gap: 8px; padding: 16px; border: 2px solid #f0d580; border-radius: 18px; background: #fff9e8; }
.invite-gate p { margin: 0; color: #806b3f; font-size: 11px; text-align: center; }
.account-summary { display: grid; gap: 8px; margin-top: 18px; padding: 18px; border-radius: 19px; text-align: center; background: #f0faf4; }
.account-summary strong { color: var(--navy); font-size: 20px; }
.account-summary span { color: var(--green); font-size: 13px; font-weight: 800; }
.account-summary .account-access { justify-self: center; padding: 5px 10px; border-radius: 999px; color: #7c5a20; background: #fff0bd; font-size: 11px; }
.account-summary button { margin-top: 8px; padding: 11px; border: 1px solid #dce8e1; border-radius: 13px; color: var(--muted); background: #fff; font-weight: 800; }
.account-summary label { text-align: left; }
.account-summary select { min-height: 44px; }
.account-summary .save-profile { border: 0; color: #fff; background: linear-gradient(135deg, #48ad76, #278b62); }
.textbook-picker { display: grid; gap: 10px; padding: 13px; border: 1px solid #dcebe3; border-radius: 17px; background: #f5fbf7; }
.auth-card .textbook-photo-button { position: relative; display: block; padding: 11px 12px; border: 1px dashed #68b58a; border-radius: 13px; color: #317653; text-align: center; background: #fff; cursor: pointer; }
.textbook-photo-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.textbook-message { margin: 0; color: #75827d; font-size: 10px; line-height: 1.5; text-align: center; }

/* Doudou voice picker */
.voice-picker { position: fixed; z-index: 40; inset: 0; display: grid; place-items: end center; padding: 18px; background: rgba(17,43,52,.42); backdrop-filter: blur(6px); }
.voice-picker-panel { width: min(100%, 560px); max-height: min(78vh, 650px); overflow: auto; padding: 21px; border-radius: 28px; background: #fffdf6; box-shadow: 0 24px 70px rgba(14,41,49,.28); }
.voice-picker-panel header { display: grid; grid-template-columns: 1fr 38px; gap: 12px; align-items: start; }
.voice-picker-panel header h2 { margin-bottom: 0; font-size: 21px; }
.voice-picker-panel header > button { width: 38px; height: 38px; border: 0; border-radius: 50%; color: #687773; background: #edf3ef; font-size: 24px; }
.voice-style-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.voice-style-grid > button { position: relative; display: grid; gap: 5px; min-height: 126px; padding: 15px; border: 2px solid transparent; border-radius: 20px; text-align: left; color: var(--ink); background: #fff; box-shadow: 0 8px 24px rgba(47,79,69,.08); }
.voice-style-grid > button > span { font-size: 25px; }
.voice-style-grid > button strong { font-size: 15px; }
.voice-style-grid > button small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.voice-style-grid > button b { margin-top: auto; color: var(--orange); font-size: 10px; }
.voice-style-grid > button.selected { border-color: #f4a448; background: #fff8e7; }
.voice-style-grid > button.selected::after { content: '已选择'; position: absolute; top: 9px; right: 9px; padding: 3px 6px; border-radius: 999px; color: #fff; background: var(--orange); font-size: 8px; }
.voice-picker-note { margin: 15px 0 0; color: #7c8985; font-size: 10px; line-height: 1.55; text-align: center; }

/* Class review photo upload */
.upload-view { min-height: calc(100vh - 90px); }
.upload-card { margin-top: 22px; padding: 22px; border-radius: 28px; background: #fff; box-shadow: var(--shadow); }
.upload-intro { display: grid; grid-template-columns: 52px 1fr; gap: 13px; align-items: center; }
.upload-intro > span { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 17px; background: #fff2be; font-size: 26px; }
.upload-intro h2 { margin-bottom: 4px; font-size: 18px; }
.upload-intro p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.camera-zone { position: relative; overflow: hidden; display: grid; min-height: 230px; margin-top: 20px; place-items: center; border: 2px dashed #8ec8a6; border-radius: 22px; text-align: center; background: #f5fcf8; cursor: pointer; }
.camera-zone input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.camera-zone input:disabled { cursor: not-allowed; }
.camera-zone > span { display: grid; gap: 8px; padding: 24px; pointer-events: none; }
.camera-zone.is-disabled { border-color: #d5d0c5; background: #f8f5ee; cursor: not-allowed; }
.camera-zone.is-disabled strong { color: #756e63; }
.camera-zone b { font-size: 40px; }
.camera-zone strong { color: var(--green); }
.camera-zone small { color: var(--muted); font-weight: 500; }
.camera-zone img { width: 100%; max-height: 340px; object-fit: contain; pointer-events: none; }
.photo-source-actions { display: grid; margin-top: 10px; }
.photo-source-action { position: relative; overflow: hidden; display: grid; min-height: 52px; place-items: center; border: 1px solid #b9dac8; border-radius: 16px; color: #317653; background: #f5fcf8; font-size: 14px; font-weight: 900; cursor: pointer; }
.photo-source-action input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.photo-source-action.is-disabled { color: #8e8a82; border-color: #d8d3c9; background: #f7f4ed; cursor: not-allowed; }
.photo-source-action input:disabled { cursor: not-allowed; }
.privacy-check { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.privacy-check input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--green); }
.upload-message { min-height: 18px; margin: 12px 0 4px; color: #b84b3e; font-size: 12px; text-align: center; }
.upload-submit { width: 100%; padding: 14px; border: 0; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--orange), #e65542); font-weight: 900; }
.upload-submit:disabled { color: #929d98; background: #e8eeeb; }
.privacy-note { margin: 12px 0 0; color: #8a9491; font-size: 10px; line-height: 1.5; text-align: center; }
.review-task-progress { display: grid; gap: 0; margin-top: 18px; padding: 15px; border-radius: 18px; background: #f6faf8; }
.review-task-progress > div { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 10px; min-height: 54px; }
.review-task-progress > div:not(:last-child)::after { content: ''; position: absolute; left: 14px; top: 30px; width: 2px; height: 24px; background: #d9e5de; }
.review-task-progress b { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: #87938e; background: #e4ebe7; font-size: 12px; }
.review-task-progress .done b { color: #fff; background: var(--green); }
.review-task-progress span { display: grid; align-content: start; gap: 3px; padding-top: 3px; text-align: left; }
.review-task-progress strong { font-size: 13px; }
.review-task-progress small { color: var(--muted); font-size: 10px; }
.ocr-confirmation { display: grid; gap: 8px; margin-top: 16px; padding: 15px; border-radius: 18px; background: #fff8e6; }
.ocr-confirmation label { display: grid; gap: 8px; color: #72572c; font-size: 13px; font-weight: 900; }
.ocr-confirmation textarea { width: 100%; min-height: clamp(260px, 38vh, 420px); padding: 14px; border: 1px solid #efd89c; border-radius: 12px; color: var(--ink); background: #fff; font: 16px/1.7 inherit; resize: vertical; }
.ocr-confirmation p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.confirm-review { width: 100%; margin-top: 4px; padding: 13px; border: 0; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--green), #43a875); font-weight: 900; }
.confirm-review:disabled { color: #929d98; background: #e8eeeb; }
.generated-review { display: grid; gap: 16px; margin-top: 20px; padding: 18px; border: 1px solid #dcece2; border-radius: 22px; background: linear-gradient(180deg, #f8fffa, #fff); }
.generated-review > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.generated-review > header h2 { margin: 3px 0 0; font-size: 19px; }
.generated-review > header > span { display: grid; min-width: 48px; height: 48px; place-items: center; border-radius: 16px; color: #fff; background: var(--green); font-size: 13px; font-weight: 900; }
.review-topic-list { display: flex; flex-wrap: wrap; gap: 7px; }
.review-topic-list span { padding: 6px 10px; border-radius: 999px; color: #8d4e20; background: #fff0c9; font-size: 11px; font-weight: 900; }
.review-plan { display: grid; gap: 7px; margin: 0; padding: 13px 13px 13px 31px; border-radius: 15px; color: #52635d; background: #eff8f3; font-size: 11px; line-height: 1.5; }
.review-question-list { display: grid; gap: 15px; }
.review-question { padding: 16px; border: 1px solid #e4ece7; border-radius: 18px; background: #fff; box-shadow: 0 8px 22px rgba(48,83,71,.07); }
.review-question-meta { margin: 0 0 8px; color: var(--green); font-size: 10px; font-weight: 900; }
.review-question h3 { margin: 0; font-size: 15px; line-height: 1.55; }
.cube-diagram { display: grid; gap: 5px; margin: 12px 0 5px; padding: 10px 10px 7px; border: 1px solid #e4ddd0; border-radius: 16px; background: linear-gradient(180deg, #fffcf3, #f8fbf9); }
.cube-diagram svg { display: block; width: 100%; height: clamp(170px, 36vw, 230px); }
.cube-diagram polygon { stroke: #304a56; stroke-width: 2.2; stroke-linejoin: round; }
.cube-diagram .cube-top { fill: #fff4bf; }
.cube-diagram .cube-left { fill: #cfe8df; }
.cube-diagram .cube-right { fill: #8fcdb8; }
.cube-diagram .cube-front-arrow { fill: #d65f3e; font-size: 17px; font-weight: 900; }
.cube-diagram figcaption { color: #67736e; font-size: 11px; text-align: center; }
.projection-set { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.projection-item { display: grid; justify-items: center; padding: 5px 2px 7px; border: 1px solid #dce6e0; border-radius: 12px; background: #fff; }
.projection-item svg { width: 100%; height: 82px; }
.projection-item strong { color: #3f5950; font-size: 12px; }
.projection-cell { fill: #e8f5ef; stroke: #304a56; stroke-width: 2; }
.review-fill-area { display: grid; gap: 10px; margin-top: 13px; padding: 12px; border-radius: 15px; background: #f5faf7; }
.review-fill-row { display: grid; grid-template-columns: minmax(88px, auto) 70px minmax(110px, 1fr); align-items: center; gap: 8px; color: #34443e; font-size: 13px; font-weight: 800; }
.review-fill-row input { width: 70px; min-height: 44px; padding: 6px; border: 2px solid #cbd9d1; border-radius: 11px; color: var(--ink); background: #fff; font: 900 19px/1 inherit; text-align: center; }
.review-fill-row input:focus { border-color: var(--green); outline: 3px solid rgba(68,166,112,.14); }
.review-fill-row input.correct { border-color: #49a978; color: #26764f; background: #e7f7ed; }
.review-fill-row input.wrong { border-color: #ec8c7e; color: #a63e32; background: #fff0ed; }
.review-fill-submit { min-height: 46px; margin-top: 2px; border: 0; border-radius: 13px; color: #fff; background: var(--green); font-weight: 900; }
.review-fill-submit:disabled { opacity: .65; }
.review-worked-area { display: grid; gap: 11px; margin-top: 13px; padding: 14px; border-radius: 16px; background: #f5faf7; }
.review-worked-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.review-worked-row strong { color: #34443e; font-size: 14px; }
.review-worked-row strong::after { content: '：'; }
.review-worked-row input { width: 100%; min-height: 48px; padding: 9px 12px; border: 2px solid #cbd9d1; border-radius: 12px; color: var(--ink); background: #fff; font: 800 16px/1.2 inherit; }
.review-worked-row input:focus { border-color: var(--green); outline: 3px solid rgba(68,166,112,.14); }
.review-worked-row input.correct { border-color: #49a978; color: #26764f; background: #e7f7ed; }
.review-worked-row input.wrong { border-color: #ec8c7e; color: #a63e32; background: #fff0ed; }
.review-worked-row span { min-width: 24px; color: #52635d; font-size: 13px; font-weight: 800; }
.review-worked-submit { min-height: 48px; border: 0; border-radius: 13px; color: #fff; background: var(--green); font-weight: 900; }
.review-worked-submit:disabled { opacity: .65; }
.review-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }
.review-options button { min-height: 44px; padding: 9px; border: 1px solid #dfe8e3; border-radius: 13px; color: var(--ink); background: #f8fbf9; font-weight: 800; }
.review-options button:not(:disabled):active { transform: scale(.98); }
.review-options button.correct { border-color: #49a978; color: #26764f; background: #e7f7ed; }
.review-options button.wrong { border-color: #ec8c7e; color: #a63e32; background: #fff0ed; }
.review-feedback { margin: 12px 0 0; padding: 11px; border-radius: 12px; font-size: 11px; line-height: 1.55; }
.review-feedback.correct { color: #26764f; background: #e7f7ed; }
.review-feedback.wrong { color: #98463c; background: #fff0ed; }

@media (max-width: 430px) {
  .review-fill-row { grid-template-columns: minmax(76px, auto) 62px 1fr; gap: 6px; font-size: 12px; }
  .review-fill-row input { width: 62px; }
  .review-worked-row { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 6px; }
}
.review-complete { padding: 17px; border-radius: 18px; text-align: center; background: #fff4ce; }
.review-complete strong { font-size: 18px; }
.review-complete p { margin: 7px 0 13px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.review-complete button { width: 100%; padding: 12px; border: 0; border-radius: 14px; color: #fff; background: var(--orange); font-weight: 900; }

/* Mistake insight list */
.mistakes-view { min-height: calc(100vh - 80px); }
.mistakes-summary { margin-top: 20px; padding: 16px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.mistakes-summary > div { display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 11px; }
.mistakes-summary > div > span { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 15px; background: #e4f7eb; font-size: 23px; }
.mistakes-summary p { display: grid; gap: 4px; margin: 0; }
.mistakes-summary strong { font-size: 14px; }
.mistakes-summary small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.mistake-filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 14px; padding: 5px; border-radius: 14px; background: #f0f4f2; }
.mistake-filters button { min-height: 36px; padding: 7px 4px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 800; }
.mistake-filters button.active { color: #fff; background: var(--green); }
.mistakes-message { margin: 18px 0; color: var(--muted); text-align: center; font-size: 12px; }
.mistake-list { display: grid; gap: 12px; margin-top: 16px; }
.mistake-card { padding: 17px; border: 1px solid #e1ebe5; border-radius: 20px; background: #fff; box-shadow: 0 9px 26px rgba(46,83,72,.08); }
.mistake-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mistake-meta span { color: var(--green); font-size: 11px; font-weight: 900; }
.mistake-meta b { padding: 4px 7px; border-radius: 999px; color: #8b5522; background: #fff0c9; font-size: 9px; }
.mistake-card h2 { margin: 12px 0 8px; font-size: 16px; line-height: 1.55; }
.mistake-card > p { margin-bottom: 13px; padding: 9px 11px; border-radius: 11px; color: #9a463b; background: #fff1ee; font-size: 11px; }
.mistake-card > div:last-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mistake-card small { color: var(--muted); font-size: 10px; }
.mistake-card button { padding: 9px 11px; border: 0; border-radius: 11px; color: #fff; background: var(--green); font-size: 11px; font-weight: 900; }
.mistakes-empty { display: grid; justify-items: center; gap: 7px; padding: 38px 20px; border-radius: 22px; text-align: center; background: rgba(255,255,255,.8); }
.mistakes-empty span { font-size: 38px; }
.mistakes-empty p { margin: 0; color: var(--muted); font-size: 11px; }
.mistake-detail-view { min-height: calc(100vh - 80px); }
.mistake-detail-card { display: grid; gap: 15px; margin-top: 20px; }
.mistake-original, .answer-comparison, .mistake-explanation, .mistake-reason-form { padding: 18px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.mistake-original h2 { margin: 8px 0 12px; font-size: 18px; line-height: 1.65; }
#mistakeDetailDiagram:empty { display: none; }
#mistakeDetailDiagram .cube-diagram { margin: 12px 0 0; }
.answer-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer-comparison > div { display: grid; gap: 7px; padding: 13px; border-radius: 15px; }
.answer-comparison small { font-size: 10px; font-weight: 800; }
.answer-comparison strong { font-size: 16px; line-height: 1.45; }
.student-answer { color: #9a463b; background: #fff1ee; }
.correct-answer { color: #23734c; background: #e7f7ed; }
.mistake-explanation { color: var(--ink); background: #fff8dc; }
.mistake-explanation > p:last-child { margin: 8px 0 0; font-size: 13px; line-height: 1.75; }
.mistake-reason-form { display: grid; gap: 14px; }
.mistake-reason-form fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 0; padding: 0; border: 0; }
.mistake-reason-form legend { grid-column: 1 / -1; margin-bottom: 4px; font-size: 17px; font-weight: 900; }
.mistake-reason-form fieldset label { display: flex; min-height: 48px; align-items: center; gap: 8px; padding: 11px; border: 1px solid #dfe8e3; border-radius: 14px; font-size: 12px; line-height: 1.45; }
.mistake-reason-form input { accent-color: var(--green); }
.mistake-note { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 800; }
.mistake-note textarea { width: 100%; resize: vertical; padding: 11px; border: 1px solid #dfe8e3; border-radius: 13px; font: 13px/1.6 inherit; }
.mistake-reason-form > button { min-height: 50px; border: 0; border-radius: 15px; color: #fff; background: var(--green); font-size: 14px; font-weight: 900; }
.mistake-reason-form > .start-mistake-correction { background: linear-gradient(135deg, var(--orange), #e65b39); }

@media (max-width: 520px) {
  .mistake-reason-form fieldset { grid-template-columns: 1fr; }
  .answer-comparison { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .doudou-stage.talking img, .doudou-stage.talking .speech, .doudou-stage.talking .voice-waves i { animation: none !important; }
}

/* Home dashboard v2 */
.home-dashboard { display: grid; gap: 28px; }
.home-dashboard .hero-card { display: block; min-height: 268px; padding: 24px 24px 20px; }
.home-dashboard .hero-copy { width: 66%; }
.home-dashboard .hero-card h2 { margin: 14px 0 6px; font-size: clamp(27px, 6vw, 38px); }
.home-dashboard .hero-card p { margin-bottom: 14px; font-size: 13px; }
.home-dashboard .doudou-stage { position: absolute; z-index: 3; top: 18px; right: 18px; bottom: 18px; display: flex; width: 34%; min-width: 118px; align-items: flex-end; justify-content: flex-end; padding: 68px 0 0; }
.home-dashboard .doudou-stage img { width: auto; height: auto; max-width: 132px; max-height: 158px; margin: 0; object-fit: contain; mix-blend-mode: normal; }
.home-dashboard .speech { top: 0; right: 0; width: min(190px, calc(100vw - 74px)); max-width: none; line-height: 1.45; }
.home-dashboard .voice-waves { top: 53px; right: 5px; left: auto; height: 25px; padding: 4px 6px; }
.hero-progress { width: min(100%, 310px); height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.24); }
.hero-progress span { display: block; width: 8%; height: 100%; border-radius: inherit; background: #fff3a7; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 16px; color: rgba(255,255,255,.82); font-size: 11px; }
.hero-meta strong { color: #fff; }

.module-section { margin-top: 0; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.module-card { position: relative; display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 10px; min-height: 92px; padding: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,.9); border-radius: 21px; text-align: left; color: var(--ink); background: #fff; box-shadow: 0 10px 28px rgba(50, 81, 72, .09); cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.module-card:hover, .module-card:focus-visible { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(50, 81, 72, .14); }
.module-card > span:nth-child(2) { display: grid; gap: 5px; min-width: 0; }
.module-card strong { font-size: 15px; }
.module-card small { overflow: hidden; color: var(--muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.module-card b { position: absolute; top: 7px; right: 7px; padding: 3px 6px; border-radius: 999px; color: #fff; background: var(--orange); font-size: 9px; }
.module-card.homework b, .module-card.ai-questions b { color: #68726f; background: #edf1ef; }
.module-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: #fff1c8; font-size: 24px; }
.practice .module-icon { background: #dff4ff; }
.homework .module-icon { background: #e8e1ff; }
.mistakes .module-icon { background: #e0f6e9; }
.ai-questions .module-icon { background: #ffe6ef; }
.challenge .module-icon { background: #fff0d9; }
.homework-help .module-icon { background: #e7f0ff; }

.home-dashboard .progress-section { margin-top: 0; padding: 20px; border-radius: 26px; background: rgba(255,255,255,.66); box-shadow: 0 12px 34px rgba(50, 81, 72, .07); }
.home-dashboard .quest-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-dashboard .quest-card { grid-template-columns: 42px 1fr; min-height: 88px; }
.home-dashboard .quest-icon { width: 42px; height: 42px; font-size: 20px; }
.home-dashboard .quest-state { grid-column: 2; }

.home-lower-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; }
.home-lower-grid .insight-card { margin-top: 0; }
.birdhouse-card { position: relative; display: grid; grid-template-columns: 1fr 72px; gap: 10px; min-height: 145px; padding: 18px; overflow: hidden; border-radius: 22px; background: linear-gradient(145deg, #dff4ff, #dff6e5); box-shadow: var(--shadow); }
.birdhouse-card h2 { margin-bottom: 4px; font-size: 18px; }
.birdhouse-card p:last-child { color: #58726b; font-size: 11px; line-height: 1.5; }
.birdhouse-visual { display: grid; align-content: center; justify-items: center; color: #d87d35; }
.birdhouse-visual span { font-size: 56px; line-height: .8; }
.birdhouse-visual b { margin-top: 8px; color: var(--green); font-size: 11px; }
.birdhouse-card .meter { left: 18px; right: 18px; bottom: 14px; background: rgba(255,255,255,.8); }
.birdhouse-view { min-height: 100vh; padding: 18px 16px 96px; background: linear-gradient(#dff5ff, #f8f2cf 58%, #d8f0cf); }
.birdhouse-wallet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 16px 0; }
.birdhouse-wallet div { display: grid; justify-items: center; gap: 2px; padding: 12px 6px; border-radius: 18px; background: rgba(255,255,255,.88); box-shadow: var(--shadow); }
.birdhouse-wallet span { font-size: 24px; }.birdhouse-wallet strong { color: var(--green); font-size: 20px; }.birdhouse-wallet small { color: #60736b; font-size: 10px; }
.birdhouse-doudou { width: 100%; display: grid; justify-items: center; gap: 3px; padding: 16px; border: 0; border-radius: 24px; background: #fff8da; color: var(--ink); box-shadow: var(--shadow); }
.birdhouse-doudou span { font-size: 58px; }.birdhouse-doudou small,.birdhouse-message { color: #60736b; }
.birdhouse-message { margin: 14px 0 8px; text-align: center; font-size: 12px; }
.birdhouse-tutor-action { width: 100%; min-height: 44px; margin: 0 0 14px; border: 0; border-radius: 16px; background: var(--primary); color: white; font-weight: 800; }
.birdhouse-experiment-action { width: 100%; min-height: 48px; margin: 0 0 14px; border: 2px dashed #bd9252; border-radius: 16px; background: #fff8dd; color: #6b4d29; font-weight: 900; }
.birdhouse-experiment-action small { display: block; margin-top: 2px; color: #8a765b; font-size: 10px; font-weight: 700; }
.birdhouse-projects { display: grid; gap: 12px; }
.birdhouse-project { display: grid; grid-template-columns: 60px 1fr; gap: 12px; padding: 16px; border-radius: 22px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.birdhouse-project > span { display: grid; place-items: center; font-size: 42px; }.birdhouse-project h2 { margin: 0 0 3px; font-size: 18px; }.birdhouse-project p { color: #60736b; font-size: 12px; }
.birdhouse-project button { grid-column: 1 / -1; min-height: 44px; border: 0; border-radius: 13px; color: #fff; background: var(--green); font-weight: 900; }
.birdhouse-project button:disabled { color: #6d7a75; background: #dce4e0; }

@media (max-width: 680px) {
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-dashboard .quest-list { grid-template-columns: 1fr; }
  .home-lower-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .home-dashboard { gap: 24px; }
  .home-dashboard .hero-card { min-height: 278px; padding: 20px 16px; }
  .home-dashboard .hero-copy { width: 70%; min-width: 0; }
  .home-dashboard .hero-card h2 { max-width: none; font-size: clamp(23px, 7vw, 27px); white-space: nowrap; }
  .home-dashboard .hero-card p { font-size: 11px; white-space: nowrap; }
  .home-dashboard .doudou-stage { top: 16px; right: 14px; bottom: 18px; width: 34%; min-width: 108px; padding-top: 72px; }
  .home-dashboard .doudou-stage img { width: auto; height: auto; max-width: 122px; max-height: 142px; margin: 0; }
  .home-dashboard .speech { top: 0; right: 0; width: min(190px, calc(100vw - 70px)); padding: 8px 10px; font-size: 10px; line-height: 1.45; }
  .home-dashboard .voice-waves { top: 58px; right: 0; }
  .voice-picker-trigger { max-width: 190px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .voice-picker { padding: 10px; }
  .voice-picker-panel { padding: 18px 15px; border-radius: 24px; }
  .voice-style-grid > button { min-height: 120px; padding: 13px; }
  .module-card { grid-template-columns: 42px 1fr; min-height: 88px; padding: 12px 10px; }
  .module-icon { width: 42px; height: 42px; font-size: 21px; }
  .module-card strong { font-size: 14px; }
  .home-dashboard .progress-section { padding: 16px; }
}
.homework-question-editor { display: grid; gap: 12px; margin: 16px 0; }
.homework-edit-card, .homework-result-card { display: grid; gap: 8px; padding: 14px; border: 1px solid #e5dccb; border-radius: 16px; background: #fffdf8; }
.homework-edit-card label { display: grid; gap: 6px; font-size: 13px; color: #62594d; }
.homework-edit-card textarea, .homework-edit-card input { width: 100%; box-sizing: border-box; border: 1px solid #d8cdbc; border-radius: 10px; padding: 10px; font: inherit; background: white; }
.homework-working-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.homework-working-list { display: grid; gap: 5px; }
.homework-working-list small.incorrect { color: #a33d32; }
.homework-working-list small.needs_review { color: #83611c; }
.homework-summary { margin: 12px 0 18px; padding: 12px; border-radius: 12px; background: #f3eee3; font-weight: 700; color: #4f473c; }
.homework-audit-report { margin: 14px 0; padding: 16px; border-radius: 18px; background: #fffaf0; border: 1px solid #ead9b8; color: #493d2e; }
.homework-audit-report h3 { margin: 0 0 8px; }
.homework-audit-report > p { margin: 6px 0; line-height: 1.55; }
.homework-followup { margin: 12px 0; padding: 12px; border-radius: 14px; background: #f2f7f3; }
.homework-followup-actions { display: grid; gap: 9px; margin-top: 9px; }
.homework-followup-action { display: grid; gap: 4px; }
.homework-followup-action button { justify-self: start; border: 0; border-radius: 10px; padding: 9px 12px; color: white; background: #4f8b6c; font-weight: 800; }
.homework-followup-action button:disabled { opacity: .65; }
.homework-followup-action small { color: #695b48; line-height: 1.45; }
.homework-audit-item { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #d8c7a7; }
.homework-audit-item strong, .homework-audit-item small { display: block; }
.homework-audit-item small { margin-top: 5px; line-height: 1.5; color: #695b48; }
.homework-history { margin: 12px 0; padding: 12px; border-radius: 14px; background: #f8f3e8; }
.homework-history h2 { margin: 0 0 8px; font-size: 15px; }
.homework-history-list, #homeworkHistoryList { display: grid; gap: 7px; }
.homework-history button { display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 12px; border: 1px solid #e0d5c2; border-radius: 11px; background: white; color: #4f473c; text-align: left; }
.homework-result-card { margin-bottom: 10px; border-left-width: 5px; }
.homework-result-card.correct { border-left-color: #48a868; }
.homework-result-card.incorrect { border-left-color: #e36b5d; }
.homework-result-card.unanswered { border-left-color: #c89a43; }
.homework-result-card.needs_review { border-left-color: #6d82c9; }
.homework-result-card p { margin: 0; }
.homework-result-card small { color: #6f665a; line-height: 1.5; }
.danger-action { display: block; margin: 14px auto 0; color: #a84b43; }
.homework-page-list { display: grid; gap: 6px; margin: 8px 0 12px; }
.homework-page-list > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #f6f1e7; color: #655d52; font-size: 12px; }
.homework-page-controls { display: flex; gap: 4px; }
.homework-page-controls button { border: 0; border-radius: 7px; padding: 5px 7px; color: #51655e; background: white; font-size: 11px; }
.homework-page-controls button:disabled { opacity: .35; }
.ai-feedback-button { justify-self: start; border: 0; padding: 6px 0; color: #697a9c; background: transparent; font-size: 12px; text-decoration: underline; }
.homework-evidence-button { justify-self: start; border: 0; padding: 5px 0; color: #8a681f; background: transparent; font-size: 12px; text-decoration: underline; }
.homework-photo-evidence { display: grid; gap: 6px; margin: 4px 0 0; }
.homework-photo-stage { position: relative; overflow: hidden; border-radius: 12px; background: #eee7da; }
.homework-photo-stage small { display: block; padding: 7px 10px; color: #695b48; font-weight: 700; }
.homework-photo-stage img { display: block; width: 100%; height: auto; }
.homework-photo-box { position: absolute; box-sizing: border-box; border: 3px solid #ffd84e; border-radius: 7px; background: rgba(255, 216, 78, .13); box-shadow: 0 0 0 9999px rgba(35, 30, 22, .28); pointer-events: none; }
.homework-photo-evidence figcaption { color: #695b48; font-size: 11px; line-height: 1.45; }
.homework-retry-button { justify-self: start; border: 0; border-radius: 10px; padding: 9px 12px; color: white; background: #4f8b6c; font-weight: 800; }
.homework-coaching-panel { display: grid; gap: 8px; margin-top: 5px; padding: 12px; border-radius: 12px; background: #f2f7f3; }
.homework-coaching-panel.correct { background: #e7f7eb; }
.homework-coaching-panel p { margin: 0; line-height: 1.5; }
.homework-coaching-panel input { border: 1px solid #b9cfc0; border-radius: 9px; padding: 10px; font: inherit; }
.homework-coaching-panel button { border: 0; border-radius: 9px; padding: 9px; color: #456255; background: white; font-weight: 750; }
.homework-help-view .ocr-confirmation label { display: grid; gap: 6px; margin: 10px 0; color: #62594d; font-size: 13px; }
.homework-help-question-picker { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: #fffdf7; border: 1px solid #eadfcb; }
.homework-help-question-picker > small { color: #756d61; }
.homework-help-question-picker > div { display: grid; gap: 8px; }
.homework-help-question-choice { display: grid; grid-template-columns: auto auto 1fr; gap: 9px; align-items: start; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #d8cdbc; border-radius: 12px; background: white; color: #3f3a33; text-align: left; font: inherit; }
.homework-help-question-choice.is-selected { border-color: #4e9b70; background: #edf8f0; box-shadow: 0 0 0 2px rgb(78 155 112 / 16%); }
.homework-help-question-choice b { color: #4e755f; white-space: nowrap; }
.homework-help-question-status { padding: 2px 7px; border-radius: 999px; background: #f3efe4; color: #756d61; font-size: 12px; line-height: 1.45; white-space: nowrap; }
.homework-help-question-choice span { line-height: 1.45; }
.homework-help-view textarea,
.homework-help-view input:not([type="checkbox"]):not([type="file"]) { box-sizing: border-box; width: 100%; border: 1px solid #d8cdbc; border-radius: 11px; padding: 10px; font: inherit; background: white; }
.homework-help-tutor { display: grid; gap: 13px; margin-top: 18px; padding: 16px; border-radius: 20px; background: linear-gradient(150deg, #f5fbff, #fff9e7); border: 1px solid #dbe7dd; }
.homework-help-tutor > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.homework-help-tutor > header h2 { margin: 0; }.homework-help-tutor > header span { padding: 6px 9px; border-radius: 999px; background: #e2f2e6; color: #3f7059; font-size: 11px; font-weight: 800; }
.homework-help-question { margin: 0; padding: 12px; border-radius: 13px; background: white; color: #3f3a33; font-weight: 750; line-height: 1.55; }
.homework-help-transcript { display: grid; gap: 9px; }
.homework-help-line { max-width: 92%; padding: 10px 12px; border-radius: 14px 14px 14px 4px; background: #e8f5ec; }
.homework-help-line.student_attempted { justify-self: end; border-radius: 14px 14px 4px 14px; background: #fff0d7; }
.homework-help-line strong { font-size: 11px; color: #4e755f; }.homework-help-line p { margin: 3px 0 0; line-height: 1.55; }
.homework-help-actions { display: grid; gap: 7px; }.homework-help-actions button { min-height: 44px; }
.homework-help-attempt { display: grid; gap: 9px; padding: 12px; border-radius: 14px; background: white; }.homework-help-attempt label { display: grid; gap: 6px; color: #62594d; font-size: 13px; }
.homework-help-solution { display: grid; gap: 7px; padding: 14px; border-radius: 14px; background: #e8f6e8; }.homework-help-solution p, .homework-help-solution small { margin: 0; line-height: 1.55; }.homework-help-solution small { color: #5c6c61; }

@media (max-width: 560px) {
  .homework-page-list > div { align-items: stretch; flex-direction: column; }
  .homework-page-controls { flex-wrap: wrap; }
  .homework-page-controls button { min-height: 44px; padding: 8px 11px; }
  .homework-working-row { grid-template-columns: 1fr; }
  .homework-edit-card textarea, .homework-edit-card input, .homework-coaching-panel input,
  .homework-help-view textarea,
  .homework-help-view input:not([type="checkbox"]):not([type="file"]) { font-size: 16px; }
  .ai-feedback-button, .homework-evidence-button, .homework-retry-button,
  .homework-coaching-panel button, .homework-followup-action button,
  .homework-help-view button { min-height: 44px; }
  .homework-help-question-choice { grid-template-columns: auto 1fr; }
  .homework-help-question-status { justify-self: start; }
  .homework-help-question-choice span { grid-column: 1 / -1; }
}
