/* 我的家人 · 第十单元：全班投屏用的课堂版式（跟“我有”单元同一套纸张色调）。 */
@font-face {
  font-family: "KaiTi-CJK";
  src: local("STKaiti-SC-Regular"), local("STKaiti"), local("Kaiti SC"), local("BiauKai"), local("KaiTi"), local("楷体");
  unicode-range: U+2E80-2EFF,U+2F00-2FDF,U+3000-303F,U+3040-30FF,U+31F0-31FF,U+3200-32FF,U+3400-4DBF,U+4E00-9FFF,U+F900-FAFF,U+FE30-FE4F,U+FF00-FFEF,U+20000-2A6DF;
}
:root {
  color-scheme: light;
  font-size: clamp(15px, 1.25vw, 20px);
  --ink: #263e36;
  --ink-soft: #66705f;
  --paper: #fff6e3;
  --card: #fffdf5;
  --line: #d6d3bd;
  --jade: #365c4b;
  --jade-soft: #e5eadb;
  --red: #b0412f;          /* 大 · 有 · 一个/两个 */
  --red-soft: #f6e2d8;
  --blue: #2f6c9c;         /* 小 */
  --blue-soft: #e2edf6;
  --gold: #c98a1c;
  --gold-soft: #fbefd2;
  --plum: #8c4a78;
  --radius: 18px;
  --shadow: 0 4px 14px rgba(70, 52, 25, .08);
  --font-zh: "KaiTi-CJK", "LXGW WenKai Lite", "LXGW WenKai", serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { color: var(--ink); background: var(--paper); font-family: var(--font-zh); -webkit-font-smoothing: antialiased; overflow: hidden; user-select: none; }
button, a { touch-action: manipulation; font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
img { -webkit-user-drag: none; user-select: none; }
[hidden] { display: none !important; }

#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 10px; padding: 12px 20px 12px; }

/* ---------------- 顶栏 ---------------- */
.topbar { flex: 0 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; min-height: 42px; }
.nav-left, .nav-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nav-right { justify-content: flex-end; }
.nav-center { display: flex; align-items: center; gap: 10px; color: var(--jade); }
.nav-title { font-size: clamp(20px, 1.7vw, 28px); font-weight: 700; white-space: nowrap; }
.chip { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: .3em; padding: 6px 14px; border: 1px solid var(--line); border-radius: 8px; background: transparent; font-size: .86rem; font-weight: 700; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.chip:hover:not(:disabled) { background: var(--jade-soft); border-color: var(--jade); }
.chip.on { background: var(--jade); border-color: var(--jade); color: #fffdf5; }
.chip:active:not(:disabled) { transform: translateY(1px); }
.day-pills { display: flex; gap: 4px; }
.day-pill { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: transparent; font-weight: 700; font-size: .95rem; }
.day-pill.on { background: var(--jade); color: #fffdf5; border-color: var(--jade); }
.day-pill:hover:not(.on) { background: var(--jade-soft); }
.crumb { font-size: .9rem; color: var(--ink-soft); white-space: nowrap; }
.step-nav { display: flex; align-items: center; gap: 4px; }
.step-pill { height: 34px; min-width: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 17px; background: transparent; font-weight: 700; font-size: .86rem; white-space: nowrap; }
.step-pill .nm { display: none; }
.step-pill.on { background: var(--jade); border-color: var(--jade); color: #fffdf5; padding: 0 14px; }
.step-pill.on .nm { display: inline; }
.step-pill.seen:not(.on) { background: var(--jade-soft); }
@media (max-width: 1100px) { .crumb { display: none; } }
@media (max-width: 820px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .day-pills { display: none; }
  .chip .lbl { display: none; }
}

/* ---------------- 舞台 ---------------- */
.stage { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.act { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.act-head { flex: 0 0 auto; text-align: center; }
.act-tag { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em; color: var(--red); border: 1px solid #e3c2b5; border-radius: 999px; padding: 2px 12px; margin-bottom: 4px; background: var(--card); }
.act-title { margin: 0; font-size: clamp(28px, 2.9vw, 46px); line-height: 1.2; color: var(--jade); font-weight: 700; }
.act-sub { margin: 4px 0 0; font-size: .9rem; color: var(--ink-soft); }
.act-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 14px; overflow: auto; padding: 4px 2px; }
.act-foot { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.act-foot .mid { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.nav-btn { min-height: 46px; padding: 8px 22px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 1.02rem; font-weight: 700; box-shadow: var(--shadow); white-space: nowrap; }
.nav-btn.primary { background: var(--jade); border-color: var(--jade); color: #fffdf5; }
.nav-btn:active:not(:disabled) { transform: translateY(1px); }
.nav-btn:disabled { visibility: hidden; }
.tool-btn { min-height: 44px; padding: 8px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 1rem; font-weight: 700; display: inline-flex; align-items: center; gap: .35em; text-decoration: none; box-shadow: var(--shadow); }
.tool-btn:hover { border-color: var(--jade); }
.tool-btn.red { color: var(--red); border-color: #e0bfb2; }
.tool-btn.on { background: var(--jade); color: #fffdf5; border-color: var(--jade); }

/* 句子与高亮 */
.sent { font-size: clamp(30px, 3.2vw, 52px); font-weight: 700; line-height: 1.35; text-align: center; min-height: 1.35em; cursor: pointer; }
.sent.sm { font-size: clamp(24px, 2.3vw, 36px); }
span.da, span.you, span.num { color: var(--red); }
span.xiao { color: var(--blue); }
span.fam { color: var(--plum); }
.sent:empty::before { content: "\00a0"; }
.say-btn { width: 58px; height: 58px; border-radius: 50%; border: none; background: var(--red); color: #fff; font-size: 1.6rem; box-shadow: var(--shadow); flex: 0 0 auto; }
.say-btn.big { width: 96px; height: 96px; font-size: 2.6rem; }
.say-btn:active { transform: scale(.95); }
.sent-row { display: flex; align-items: center; justify-content: center; gap: 16px; }

/* 进度星星 */
.stars { display: flex; gap: 6px; justify-content: center; font-size: 1.5rem; min-height: 1.8rem; }
.stars span { opacity: .22; filter: grayscale(1); transition: all .25s; }
.stars span.on { opacity: 1; filter: none; transform: scale(1.12); }
.page-dots { display: flex; gap: 8px; justify-content: center; align-items: center; }
.page-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); display: block; }
.page-dots i.on { background: var(--jade); transform: scale(1.25); }
.pager { display: flex; align-items: center; gap: 14px; }
.round-btn { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 1.6rem; font-weight: 700; box-shadow: var(--shadow); display: inline-flex; align-items: center; justify-content: center; }
.round-btn:disabled { opacity: .25; }

/* 熊猫人物 */
.fig { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; position: relative; }
.fig img { height: calc(var(--ph, 200px) * var(--k, 1)); width: auto; display: block; filter: drop-shadow(0 6px 6px rgba(60, 40, 20, .14)); }
.fig figcaption { font-size: clamp(20px, 1.8vw, 30px); font-weight: 700; line-height: 1.2; min-height: 1.2em; }
.fig.me img { border-radius: 50%; border: 4px dashed var(--jade); background: #fffdf5; object-fit: cover; aspect-ratio: 1; padding: 4px; filter: none; }

@keyframes popIn { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.pop { animation: popIn .34s cubic-bezier(.22, 1.2, .4, 1); }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.shake { animation: shake .35s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.bob { animation: bob .6s ease 2; }

/* ---------------- 封面 ---------------- */
.home { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-bottom: 8px; }
.home-title { text-align: center; }
.home-title h1 { margin: 0; font-size: clamp(46px, 5.4vw, 84px); letter-spacing: .14em; color: var(--jade); line-height: 1.05; }
.home-title p { margin: 6px 0 0; color: var(--ink-soft); font-size: .95rem; letter-spacing: .08em; }
.lineup { --ph: min(25vh, 21vw, 230px); max-width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: clamp(2px, .8vw, 14px); padding: 6px 18px 0; border-bottom: 3px solid #e7d9b6; }
.lineup .fig { cursor: pointer; }
.lineup .fig figcaption { font-size: clamp(16px, 1.3vw, 22px); color: var(--ink-soft); }
.lineup .fig:hover img { transform: translateY(-4px); }
.lineup .fig img { transition: transform .2s; }
.days { width: min(100%, 1160px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.day-card { text-align: left; border: 1px solid var(--line); border-top: 5px solid var(--dc, var(--jade)); background: var(--card); border-radius: 16px; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); min-width: 0; }
.day-card:hover { background: #fffaea; border-color: var(--dc); }
.day-card .dname { font-size: .85rem; font-weight: 700; color: var(--dc); letter-spacing: .14em; }
.day-card b { font-size: 1.55rem; line-height: 1.25; }
.day-card .target { font-size: 1rem; color: var(--ink); line-height: 1.45; }
.day-card ol { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: .82rem; color: var(--ink-soft); }
.day-card ol li span { display: inline-block; min-width: 3.3em; color: var(--dc); font-weight: 700; }
.write-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; font-size: .9rem; color: var(--ink-soft); }
.write-row a { font-size: 1.5rem; font-weight: 700; color: var(--red); text-decoration: none; border: 1px solid #e0bfb2; background: var(--card); border-radius: 10px; width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
@media (max-width: 980px) { .days { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .nav-title { display: none; } .days { grid-template-columns: 1fr; } .lineup .fig figcaption { display: none; } }

/* ---------------- 老师教案抽屉 ---------------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); background: #fffdf5; border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(50, 40, 20, .14); z-index: 30; display: flex; flex-direction: column; transform: translateX(105%); transition: transform .25s ease; }
.drawer.open { transform: none; }
@media (min-width: 1100px) { body.drawer-open #app { margin-right: min(380px, 92vw); } }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--jade); }
.drawer .dbody { flex: 1; overflow: auto; padding: 12px 18px 24px; font-size: .9rem; line-height: 1.65; user-select: text; }
.drawer h3 { margin: 14px 0 4px; font-size: .95rem; color: var(--red); }
.drawer h3:first-child { margin-top: 0; }
.drawer ul, .drawer ol { margin: 0; padding-left: 1.2em; }
.drawer li { margin: 2px 0; }
.drawer table { border-collapse: collapse; width: 100%; font-size: .82rem; }
.drawer td, .drawer th { border: 1px solid var(--line); padding: 4px 6px; vertical-align: top; text-align: left; }
.drawer .src { margin-top: 12px; font-size: .8rem; color: var(--ink-soft); border-top: 1px dashed var(--line); padding-top: 8px; }

/* ---------------- 卡片通用 ---------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pick { border: 3px solid transparent; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.pick:hover { border-color: #e2d6b7; }
.pick.lit { border-color: var(--gold); background: var(--gold-soft); }
.pick.good { border-color: var(--jade); background: var(--jade-soft); }
.pick.bad { border-color: var(--red); background: var(--red-soft); }
.pick:active { transform: scale(.98); }

/* 星期一：身体 */
.body-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; width: min(100%, 1000px); }
.body-grid .pick img { width: 100%; max-width: 160px; aspect-ratio: 1; object-fit: contain; border-radius: 12px; }
.body-grid .pick b { font-size: clamp(22px, 2vw, 32px); }
.vs { display: flex; gap: 22px; align-items: stretch; justify-content: center; width: min(100%, 960px); }
.vs .pick { flex: 1 1 0; min-width: 0; position: relative; justify-content: center; padding: 14px 10px 12px; }
.vs .imgs { height: clamp(150px, 30vh, 270px); display: flex; align-items: center; justify-content: center; gap: 4px; }
.vs .imgs img { height: 100%; max-width: 100%; object-fit: contain; border-radius: 14px; transition: height .3s; }
.vs .imgs.two img { max-width: 49%; }
.vs .imgs.small img { height: 44%; }
.vs .imgs img.flip { transform: scaleX(-1); }
.badge { position: absolute; top: 10px; left: 12px; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; font-weight: 700; color: #fff; background: var(--red); }
.badge.xiao { background: var(--blue); }
.vs .cap { font-size: clamp(20px, 1.9vw, 30px); font-weight: 700; text-align: center; min-height: 1.4em; }
.vs .cap .da { color: var(--red); } .vs .cap .xiao { color: var(--blue); }

/* 星期一：画怪物 */
.monster-wrap { display: flex; gap: 24px; align-items: center; justify-content: center; width: min(100%, 1080px); }
.monster-box { flex: 0 0 auto; width: clamp(220px, 34vw, 420px); aspect-ratio: 1; border-radius: 24px; background: radial-gradient(circle at 50% 40%, #fffdf5, #f6ead0); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.monster-box svg { width: 96%; height: 96%; }
.sheet { flex: 1 1 auto; min-width: 0; max-width: 680px; padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; background: #fffef9; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed #e8dfc6; }
.sheet-row:last-child { border-bottom: none; }
.sheet-row .sent { font-size: clamp(22px, 2vw, 32px); text-align: left; }
.sheet-row.lit { background: var(--gold-soft); border-radius: 10px; }
.ctrls { display: flex; gap: 8px; flex: 0 0 auto; align-items: center; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.stepper button { border: none; background: transparent; width: 42px; min-height: 44px; font-size: 1.5rem; font-weight: 700; color: var(--jade); }
.stepper button:disabled { opacity: .2; }
.stepper .n { min-width: 2.2em; text-align: center; font-size: 1.35rem; font-weight: 700; color: var(--red); border-left: 1px solid var(--line); border-right: 1px solid var(--line); line-height: 44px; }
.stepper.fixed button { visibility: hidden; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; flex: 0 0 auto; }
.seg button { border: none; background: transparent; min-width: 52px; min-height: 44px; font-size: 1.35rem; font-weight: 700; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on.da { background: var(--red); color: #fff; }
.seg button.on.xiao { background: var(--blue); color: #fff; }

/* 星期二：家 */
.home-intro { display: flex; gap: 26px; align-items: center; justify-content: center; width: min(100%, 1100px); }
.gate { position: relative; flex: 1 1 auto; max-width: 640px; border-radius: 20px; overflow: hidden; border: none; padding: 0; box-shadow: var(--shadow); background: #e9dcc0; }
.gate img { width: 100%; display: block; }
.gate .tap-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(255, 253, 245, .92); padding: 4px 14px; border-radius: 999px; font-weight: 700; font-size: .9rem; }
.jia-card { flex: 0 0 auto; width: clamp(180px, 22vw, 280px); aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 22px; background: var(--card); border: 2px solid #e0bfb2; }
.jia-card .ch { font-size: clamp(100px, 12vw, 170px); line-height: 1; color: var(--red); font-weight: 700; }
.jia-card.empty .ch { color: #eadfc6; }

/* 家庭照片 */
.photo { --ph: clamp(140px, 30vh, 260px); position: relative; display: flex; align-items: flex-end; justify-content: center; gap: clamp(4px, 1.2vw, 18px); min-height: calc(var(--ph) + 3.6rem); padding: 18px 26px 12px; border-radius: 18px; background: linear-gradient(#fdf7e8 0 72%, #efe1bf 72% 100%); border: 10px solid #c99f69; box-shadow: inset 0 0 0 2px #f3e3c0, var(--shadow); width: fit-content; max-width: 100%; }
.photo .fig { cursor: pointer; }
.photo .fig figcaption { font-size: clamp(16px, 1.4vw, 22px); }
.photo .fig.counted img { filter: drop-shadow(0 0 0 transparent) brightness(1.02); }
.count-badge { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 700; font-size: 1.4rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.num-choices { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.num-btn { min-width: 92px; min-height: 76px; border-radius: 16px; border: 3px solid var(--line); background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.num-btn b { font-size: 2.2rem; font-family: system-ui, sans-serif; }
.num-btn span { font-size: 1.15rem; font-weight: 700; color: var(--ink-soft); }
.num-btn.good { border-color: var(--jade); background: var(--jade-soft); }
.num-btn.bad { border-color: var(--red); background: var(--red-soft); }

/* 搭一搭我的家 */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 330px); gap: 16px; width: min(100%, 1240px); flex: 1 1 auto; min-height: 0; }
.builder-left { display: flex; flex-direction: column; gap: 14px; min-height: 0; align-items: center; justify-content: safe center; overflow: auto; padding-top: 10px; }
.builder .photo { min-width: min(100%, 420px); }
.tray { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 78px)); max-width: 100%; gap: 8px; justify-content: center; }
.tray button { position: relative; width: 100%; height: 92px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 4px 2px 3px; box-shadow: var(--shadow); }
.tray button img { height: 58px; width: auto; max-width: 74px; object-fit: contain; }
.tray button b { font-size: 1.05rem; }
.tray button .n { position: absolute; top: -8px; right: -8px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--red); color: #fff; font-size: .9rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.tray button:active { transform: scale(.96); }
.say-panel { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; overflow: auto; min-height: 0; }
.say-panel .sent { font-size: clamp(20px, 1.8vw, 30px); text-align: left; padding: 3px 8px; border-radius: 8px; }
.say-panel .sent.lit { background: var(--gold-soft); }
.say-panel .sent.total { font-size: clamp(24px, 2.2vw, 36px); }
.say-panel .hint { color: var(--ink-soft); font-size: .85rem; }
.say-panel .tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.photo .fig .x { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; background: #fffdf5; border: 1px solid var(--line); font-size: .9rem; line-height: 1; display: flex; align-items: center; justify-content: center; color: var(--ink-soft); }
@media (max-width: 900px) { .builder { display: flex; flex-direction: column; flex: 0 0 auto; } .builder-left { overflow: visible; } }

/* 星期三：家谱 */
.tree { --ph: 120px; max-width: 100%; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 28px; border-radius: 22px; background: radial-gradient(ellipse at 50% 0, #eef3e4, transparent 70%), var(--card); border: 1px solid var(--line); }
.tree-row { display: flex; align-items: flex-end; justify-content: center; gap: clamp(8px, 2vw, 34px); position: relative; }
.tree-top { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tree-top + .tree-row, .tree-top .tree-row + .tree-row { padding-top: 4px; border-top: 2px dashed #d6dcc5; }
.tree.compact .tree-top { flex-direction: row; align-items: flex-end; gap: clamp(16px, 3vw, 48px); }
.tree.compact .tree-top .tree-row + .tree-row { border-top: none; padding-top: 0; border-left: 2px dashed #d6dcc5; padding-left: clamp(16px, 3vw, 48px); }
.tree .fig { cursor: pointer; padding: 2px 6px; border-radius: 14px; }
.tree .fig figcaption { color: transparent; transition: color .2s; }
.tree .fig.shown figcaption { color: var(--plum); }
.tree .fig.lit { background: var(--gold-soft); }
.tree .group { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tree .group .lab { font-size: 1rem; font-weight: 700; padding: 0 12px; border-radius: 999px; }
.tree .group .lab.da { color: var(--red); background: var(--red-soft); }
.tree .group .lab.xiao { color: var(--blue); background: var(--blue-soft); }
.tree .group .members { display: flex; align-items: flex-end; gap: clamp(6px, 1.4vw, 22px); }

.find-grid { --ph: clamp(130px, 28vh, 240px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; width: min(100%, 1000px); }
.find-grid .pick { min-height: calc(var(--ph) + 3rem); }
.find-grid .pick figcaption { color: transparent; }
.find-grid .pick.good figcaption { color: var(--jade); }

/* 敲敲门 */
.door-scene { display: flex; gap: 30px; align-items: center; justify-content: center; width: min(100%, 1000px); }
.doorway { --ph: clamp(170px, 38vh, 330px); position: relative; width: clamp(220px, 28vw, 360px); height: calc(var(--ph) + 40px); border-radius: 16px 16px 6px 6px; background: linear-gradient(#fbf2dc, #f3e3bd); border: 12px solid #7b3e2a; border-bottom-width: 8px; display: flex; align-items: flex-end; justify-content: center; perspective: 900px; overflow: hidden; box-shadow: var(--shadow); cursor: pointer; }
.doorway .fig { padding-bottom: 6px; }
.doorway .fig figcaption { display: none; }
.leaf { position: absolute; top: 0; bottom: 0; width: 50%; background: repeating-linear-gradient(0deg, #b9432f 0 30px, #a83a28 30px 32px); transition: transform .8s cubic-bezier(.3, .8, .3, 1); z-index: 2; box-shadow: inset 0 0 0 3px #8e301f; }
.leaf.l { left: 0; transform-origin: left center; }
.leaf.r { right: 0; transform-origin: right center; }
.leaf::after { content: ""; position: absolute; top: 50%; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe08a, #c9921c); }
.leaf.l::after { right: 10px; } .leaf.r::after { left: 10px; }
.doorway.open .leaf.l { transform: rotateY(-100deg); }
.doorway.open .leaf.r { transform: rotateY(100deg); }
.door-side { display: flex; flex-direction: column; align-items: center; gap: 14px; width: clamp(300px, 36vw, 480px); flex: 0 0 auto; }
.door-side .sent { font-size: clamp(26px, 2.7vw, 44px); white-space: nowrap; }
.knock { font-size: 3rem; }

/* 故事书 */
.book { width: min(100%, 980px); flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.page { --ph: clamp(160px, 38vh, 330px); flex: 1 1 auto; min-height: 0; width: 100%; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px; background: var(--pg, #fde7ec); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.page .figs { display: flex; align-items: flex-end; justify-content: center; gap: clamp(2px, .8vw, 12px); }
.page .fig figcaption { display: none; }
.page .title { font-size: clamp(40px, 4.6vw, 70px); font-weight: 700; color: var(--jade); letter-spacing: .1em; }
.page .pno { position: absolute; right: 16px; bottom: 10px; font-size: .85rem; color: var(--ink-soft); }
.page .hearts { position: absolute; inset: 0; pointer-events: none; font-size: 2rem; }
.page .hearts span { position: absolute; animation: bob 1.6s ease-in-out infinite; }

/* 星期四 */
.flash { --ph: clamp(180px, 40vh, 340px); width: clamp(280px, 36vw, 460px); min-height: calc(var(--ph) + 5rem); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; padding: 16px; cursor: pointer; }
.flash .fig figcaption { display: none; }
.flash .q { font-size: clamp(80px, 10vw, 150px); color: #e7dcc1; font-weight: 700; line-height: 1; margin: auto; }
.have-scene { --ph: clamp(150px, 34vh, 290px); display: flex; align-items: flex-end; justify-content: center; gap: clamp(14px, 3vw, 46px); }
.have-scene .plus { align-self: center; font-size: 2.4rem; color: #d9606e; }
.have-scene .fig.me img { height: calc(var(--ph) * .55); }
.have-scene .grp { display: flex; align-items: flex-end; gap: 6px; padding: 10px 16px 6px; border-radius: 18px; background: var(--card); border: 2px solid var(--line); }
.quiz-opts { --ph: clamp(120px, 26vh, 220px); display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; width: min(100%, 1000px); }
.quiz-opts .pick { min-width: 200px; min-height: calc(var(--ph) + 2.5rem); flex-direction: row; align-items: flex-end; gap: 6px; padding: 14px 18px; }
.quiz-opts .pick .fig figcaption { display: none; }
.result { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.result .big { font-size: clamp(40px, 5vw, 72px); font-weight: 700; color: var(--jade); }

/* 彩纸 */
.confetti-piece { position: fixed; top: -1rem; width: .7rem; height: .7rem; pointer-events: none; z-index: 40; border-radius: 2px; animation: confettiFall 1.6s ease-in forwards; }
@keyframes confettiFall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(102vh) rotate(420deg); opacity: 0; } }

@media (max-width: 760px) {
  #app { padding: 10px 10px; }
  .body-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vs { gap: 10px; }
  .monster-wrap, .home-intro, .door-scene { flex-direction: column; }
  .door-side { width: 100%; }
  .sheet-row { flex-wrap: wrap; }
  .find-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tree { padding: 8px 10px; }
  .tree .group .members, .tree-row { gap: 4px; }
  .photo { padding: 12px 10px 8px; border-width: 7px; }
  .tray button { height: 80px; }
  .tray button img { height: 48px; }
  .act-foot .nav-btn { padding: 8px 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
