/* ================= 主题变量：按关卡切换昼夜 ================= */
:root {
  --sky1: #bfe3ff; --sky2: #eaf6ff; --ground: #ffffff; --ground2: #e3f1fb; --tree: #4f8a6b; --star: 0;
  --ink: #2b2b33; --muted: #6f7b8a; --card: rgba(255,255,255,.92);
  --mint: #3fae8a; --sky: #2f8fc9; --gold: #ffb300; --pink: #ff5c8d; --green: #43a047; --red: #ef5350;
  --shadow: 0 10px 30px rgba(20, 60, 110, .18);
  --font: "YouYuan", "幼圆", "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
}
body[data-palette="dawn"]  { --sky1: #ffd0b0; --sky2: #ffeedd; --ground: #fff; --ground2: #ffe7d6; --tree: #6b8f5e; }
body[data-palette="day"]   { --sky1: #9fd3ff; --sky2: #e6f5ff; --ground: #fff; --ground2: #dcefff; --tree: #4f8a6b; }
body[data-palette="dusk"]  { --sky1: #6a5acd; --sky2: #ffb5a0; --ground: #fdf4ff; --ground2: #e9d8ff; --tree: #3e5a6b; --star: 1; }
body[data-palette="night"] { --sky1: #14213d; --sky2: #3a5a8c; --ground: #eef4ff; --ground2: #c9d8f5; --tree: #1f3a4a; --star: 1; }
body[data-palette="aurora"]{ --sky1: #0b2545; --sky2: #1f7a6b; --ground: #eafff6; --ground2: #bfeee0; --tree: #123a3a; --star: 1; }
body[data-palette="peach"]  { --sky1: #ffc3a0; --sky2: #fff1e6; --ground: #fff; --ground2: #ffe0cc; --tree: #f48fb1; }
body[data-palette="candy"]  { --sky1: #ff9ec4; --sky2: #ffe3f0; --ground: #fff; --ground2: #ffd0e3; --tree: #f06292; }
body[data-palette="lavender"]{ --sky1: #b39ddb; --sky2: #ede7f6; --ground: #fff; --ground2: #e1d5f5; --tree: #9575cd; }
body[data-palette="jungle"] { --sky1: #6fbf73; --sky2: #e3f4dc; --ground: #f1f8e9; --ground2: #c5e1a5; --tree: #2e7d32; }
body[data-palette="volcano"]{ --sky1: #b71c1c; --sky2: #ff8a65; --ground: #ffe0b2; --ground2: #ef6c00; --tree: #4e342e; --star: 1; }
body[data-palette="cave"]   { --sky1: #1a1a2e; --sky2: #4a4e69; --ground: #cfd8dc; --ground2: #90a4ae; --tree: #263238; --star: 1; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font); color: var(--ink); min-height: 100vh; overflow-x: hidden; user-select: none;
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 70%); transition: background 1.2s;
}
button { font-family: inherit; cursor: pointer; border: 0; color: inherit; }
input, select, textarea { user-select: text; font-family: inherit; }
a { color: var(--sky); }
.hidden { display: none !important; }

/* ================= 场景：星星 / 雪 / 地面 / 树 ================= */
.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.stars { position: absolute; inset: 0; opacity: var(--star); transition: opacity 1.2s; }
.stars i { position: absolute; width: 3px; height: 3px; background: #fff; border-radius: 50%; animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .2; transform: scale(.6); } }
.snow i { position: absolute; top: -12px; color: #fff; font-size: 14px; opacity: .85; animation: snow linear infinite; text-shadow: 0 0 6px rgba(255,255,255,.8); }
@keyframes snow { to { transform: translate3d(var(--drift), 105vh, 0) rotate(360deg); } }
.hills { position: absolute; left: -10%; right: -10%; bottom: -8vh; height: 34vh; }
.hills::before, .hills::after { content: ""; position: absolute; border-radius: 50%; background: var(--ground2); transition: background 1.2s; }
.hills::before { left: -5%; width: 70%; height: 100%; top: 10%; }
.hills::after { right: -5%; width: 75%; height: 110%; top: 25%; background: var(--ground); }
.trees { position: absolute; bottom: 12vh; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 2vw; }
.trees svg { width: 90px; height: 120px; }
.trees svg:nth-child(2n) { width: 60px; height: 82px; margin-top: 30px; }
.trees .tree { fill: var(--tree); transition: fill 1.2s; }

/* ================= 布局 ================= */
.wrap { max-width: 1200px; margin: 0 auto; padding: 14px 24px 30px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.logo { font-size: 24px; font-weight: 900; letter-spacing: 1px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.18), 0 4px 14px rgba(0,0,0,.2); display: flex; align-items: center; gap: 8px; }
.logo small { font-size: 13px; font-weight: 400; opacity: .85; margin-left: 4px; }
.spacer { flex: 1; }
.pill { background: var(--card); border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: 18px; box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 8px; backdrop-filter: blur(6px); }
.pill.fish { color: #b26a00; }
.pill.bump { animation: bump .5s ease; }
@keyframes bump { 30% { transform: scale(1.3) rotate(-8deg); } }
.iconbtn { background: var(--card); border-radius: 999px; width: 44px; height: 44px; font-size: 20px; box-shadow: var(--shadow); transition: transform .15s; }
.iconbtn:hover { transform: scale(1.1) rotate(-6deg); }

.btn {
  font-size: 22px; font-weight: 900; padding: 16px 40px; border-radius: 999px; color: #fff; letter-spacing: 1px;
  background: linear-gradient(180deg, #ffb74d, #ff8f00); box-shadow: 0 6px 0 #c66900, 0 12px 24px rgba(0,0,0,.2);
  transition: transform .1s, box-shadow .1s; position: relative; top: 0;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { top: 6px; box-shadow: 0 0 0 #c66900, 0 4px 10px rgba(0,0,0,.2); }
.btn.blue { background: linear-gradient(180deg, #4fc3f7, #0288d1); box-shadow: 0 6px 0 #01579b, 0 12px 24px rgba(0,0,0,.2); }
.btn.blue:active { box-shadow: 0 0 0 #01579b; }
.btn.green { background: linear-gradient(180deg, #81c784, #388e3c); box-shadow: 0 6px 0 #1b5e20, 0 12px 24px rgba(0,0,0,.2); }
.btn.green:active { box-shadow: 0 0 0 #1b5e20; }
.btn.ghost { background: var(--card); color: var(--sky); box-shadow: 0 4px 0 #cfe3f0; font-size: 17px; padding: 10px 22px; }
.btn.ghost:active { box-shadow: none; }
.btn.small { font-size: 17px; padding: 10px 24px; box-shadow: 0 4px 0 #c66900; }

/* ================= 角色 ================= */
.char { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 10px 10px rgba(0,0,0,.18)); }
.char .eye { animation: blink 4.5s infinite; }
.char.owl .eye { animation-delay: 1.3s; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.08); } }
.char .mouth-open, .char .blush, .char .tears { opacity: 0; transition: opacity .2s; }
svg:not(.char) .mouth-open, svg:not(.char) .blush, svg:not(.char) .tears { display: none; }
.char.happy .mouth-open, .char.happy .blush { opacity: 1; }
.char.happy .mouth { opacity: 0; }
.char.happy .eye { animation: none; transform: scaleY(.55); }
.char.happy .body-wrap { animation: hop .7s ease; transform-origin: 110px 230px; }
.char.sad .tears { opacity: 1; }
.char.sad .mouth { transform: rotate(180deg); transform-origin: 110px 150px; }
.char.sad .body-wrap { animation: wobble .6s ease; transform-origin: 110px 200px; }
.char.think .pupil { animation: look 1.6s ease-in-out infinite alternate; }
@keyframes look { to { transform: translate(-8px, -6px); } }
@keyframes hop { 35% { transform: translateY(-34px) rotate(-5deg); } 60% { transform: translateY(0) scale(1.06, .94); } 80% { transform: translateY(-10px); } }
@keyframes wobble { 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
.char.owl .body-wrap { animation: breathe 3.6s ease-in-out infinite; transform-origin: 110px 235px; }
@keyframes breathe { 50% { transform: scale(1.02, .985); } }
.char.owl.talk .beak { animation: beak .25s ease-in-out 4; transform-origin: 110px 122px; }
@keyframes beak { 50% { transform: scaleY(1.6); } }
.char.owl.talk .wing.left { animation: flapL .5s ease 2; transform-origin: 60px 110px; }
.char.owl.talk .wing.right { animation: flapR .5s ease 2; transform-origin: 160px 110px; }
@keyframes flapL { 50% { transform: rotate(28deg); } }
@keyframes flapR { 50% { transform: rotate(-28deg); } }
.char.owl.happy .eye { transform: scaleY(.45); }
.char.owl.happy .body-wrap { animation: hop .7s ease; }

.bubble {
  position: relative; background: #fff; border-radius: 20px; padding: 12px 16px; font-size: 17px; line-height: 1.5; font-weight: 600;
  box-shadow: var(--shadow); min-height: 54px; text-align: center; animation: bubbleIn .3s ease;
}
@keyframes bubbleIn { from { transform: scale(.85); opacity: 0; } }
.bubble::after { content: ""; position: absolute; bottom: -12px; left: 50%; margin-left: -10px; border: 10px solid transparent; border-top-color: #fff; border-bottom: 0; }
.bubble.owl-bubble { background: #eefaf5; }
.bubble.owl-bubble::after { border-top-color: #eefaf5; }
.bubble.hint { background: #fff8e1; border: 2px solid var(--gold); }
.bubble.hint::after { border-top-color: #fff8e1; }

/* ================= 角色选择 / 头像 ================= */
.pavatar { width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 3px solid #fff; overflow: hidden; display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.pavatar img { width: 100%; height: 100%; object-fit: cover; }
.pavatar svg { width: 86%; height: 86%; }
.pavatar.big { width: 110px; height: 110px; border-width: 5px; margin: 0 auto 10px; }
.playerpill { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border-radius: 999px; padding: 4px 16px 4px 4px; font-weight: 800; font-size: 16px; box-shadow: var(--shadow); position: relative; }
.playerpill .crown { position: absolute; left: 22px; top: -14px; font-size: 18px; transform: rotate(-15deg); }
body[data-theme="snow"]  { --accent: #2f8fc9; --accent2: #8ecbec; }
body[data-theme="kitty"] { --accent: #ff4fa3; --accent2: #ffb3d1; }
body[data-theme="dino"]  { --accent: #43a047; --accent2: #a5d6a7; }
body { --accent: #2f8fc9; --accent2: #8ecbec; }

.pick { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 10px 0 20px; }
.pick-title { text-align: center; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.15), 0 8px 24px rgba(0,0,0,.25); animation: bubbleIn .6s cubic-bezier(.34,1.56,.64,1); }
.pick-title .t1 { display: block; font-size: 40px; font-weight: 900; letter-spacing: 2px; }
.pick-title .t2 { display: block; font-size: 16px; opacity: .9; margin-top: 4px; }
.pick-grid { display: flex; gap: 26px; flex-wrap: wrap; justify-content: center; }
.pick-card { position: relative; width: 250px; background: #fff; border-radius: 30px; padding: 0; box-shadow: 0 16px 40px rgba(20,60,110,.22); text-align: center; transition: transform .2s, box-shadow .2s; border: 0; font-family: inherit; overflow: visible; animation: cardIn .6s cubic-bezier(.34,1.56,.64,1) both; cursor: pointer; }
@keyframes cardIn { from { transform: translateY(40px) scale(.8); opacity: 0; } }
.pick-card:hover { transform: translateY(-10px) scale(1.04) rotate(-1deg); box-shadow: 0 26px 50px rgba(20,60,110,.3); }
.pick-card:hover .pc-go { background: var(--gold); color: #4e342e; }
.pc-scene { position: relative; height: 210px; border-radius: 30px 30px 0 0; overflow: hidden; }
.pick-card.theme-snow .pc-scene { background: linear-gradient(180deg, #9fd3ff, #eaf6ff 75%, #fff 76%); }
.pick-card.theme-kitty .pc-scene { background: linear-gradient(180deg, #ff9ec4, #ffe3f0 75%, #fff 76%); }
.pick-card.theme-dino .pc-scene { background: linear-gradient(180deg, #6fbf73, #e3f4dc 75%, #fff 76%); }
.pc-scene::after { content: ""; position: absolute; left: -20%; right: -20%; bottom: -30px; height: 70px; border-radius: 50%; background: rgba(255,255,255,.9); }
.pick-card.theme-dino .pc-scene::after { background: #c5e1a5; }
.pc-sky { position: absolute; inset: 0; pointer-events: none; }
.pc-sky i { position: absolute; top: -14px; font-size: 12px; opacity: .8; animation: snow linear infinite; --drift: 0px; color: #fff; }
.pc-buddy { position: absolute; left: 50%; bottom: 8px; width: 170px; transform: translateX(-50%); z-index: 1; }
.pc-buddy .char { filter: drop-shadow(0 8px 8px rgba(0,0,0,.2)); }
.pc-avatar { position: absolute; right: 12px; top: 12px; width: 56px; height: 56px; border: 3px solid #fff; z-index: 2; }
.pc-info { padding: 12px 16px 6px; }
.pc-info > b { display: block; font-size: 24px; letter-spacing: 1px; }
.pc-info > small { color: var(--muted); font-size: 13px; }
.pc-stats { display: flex; justify-content: center; gap: 10px; margin: 8px 0 8px; font-size: 13px; font-weight: 700; color: #4e342e; }
.pc-stats span { background: #fff3e0; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pc-stats b { color: #b26a00; }
.pc-goal { height: 8px; background: #eef3f7; border-radius: 4px; overflow: hidden; }
.pc-goal i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2, #8ecbec), var(--accent, #2f8fc9)); border-radius: 4px; }
.pick-card.theme-kitty .pc-goal i { background: linear-gradient(90deg, #ffb3d1, #ff4fa3); }
.pick-card.theme-dino .pc-goal i { background: linear-gradient(90deg, #a5d6a7, #43a047); }
.pc-goal-t { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.pc-go { margin: 10px 16px 16px; background: var(--ink); color: #fff; border-radius: 999px; padding: 10px; font-weight: 900; font-size: 17px; letter-spacing: 2px; transition: background .2s, color .2s; }
.pick-card.theme-snow .pc-go { background: #2f8fc9; } .pick-card.theme-kitty .pc-go { background: #ff4fa3; } .pick-card.theme-dino .pc-go { background: #43a047; }
.pick-card .crown-big { position: absolute; top: -30px; left: 50%; transform: translateX(-50%) rotate(-10deg); font-size: 44px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); animation: bob 1.4s ease-in-out infinite; z-index: 3; }
.pick-tip { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.3); margin: 0; }
.pick-tip a { color: #fff; }
.pick-empty { background: var(--card); border-radius: 20px; padding: 30px 40px; font-size: 18px; }
.podium { width: min(720px, 92vw); }

/* ================= 家庭榜小组件 ================= */
.rankw { width: 100%; }
.rw { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 12px 14px; backdrop-filter: blur(8px); border-top: 4px solid var(--accent); animation: bubbleIn .4s ease; }
.rw-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 900; font-size: 15px; margin-bottom: 8px; color: var(--accent); }
.rw-head small { font-size: 11px; color: var(--muted); font-weight: 600; }
.rw-rows { display: flex; flex-direction: column; gap: 6px; }
.rw-row { display: grid; grid-template-columns: 22px 30px 1fr 22px; grid-template-areas: "rank av name score" "rank av bar score"; align-items: center; gap: 2px 8px; padding: 6px 8px; border-radius: 14px; background: rgba(255,255,255,.6); transition: transform .3s; }
.rw-row.me { background: #fff8e1; box-shadow: inset 0 0 0 2px var(--gold); }
.rw-row.lead { background: linear-gradient(90deg, #fff3cd, rgba(255,255,255,.7)); }
.rw-rank { grid-area: rank; font-weight: 900; text-align: center; color: var(--accent); font-size: 15px; }
.rw-row .pavatar { grid-area: av; width: 30px; height: 30px; border-width: 2px; }
.rw-row.lead .pavatar { animation: bob 1.6s ease-in-out infinite; }
.rw-name { grid-area: name; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rw-name em { font-style: normal; font-size: 10px; background: var(--gold); color: #4e342e; border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.rw-bar { grid-area: bar; height: 6px; background: #e6eef4; border-radius: 3px; overflow: hidden; }
.rw-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 3px; transition: width .8s cubic-bezier(.34,1.56,.64,1); }
.rw-score { grid-area: score; font-weight: 900; font-size: 15px; color: #b26a00; text-align: right; }
.rw-tip { margin-top: 8px; font-size: 12px; font-weight: 700; color: #4e342e; background: #fff3e0; border-radius: 10px; padding: 6px 10px; text-align: center; }
.rw-h { border-top: 0; border-left: 6px solid var(--gold); }
.rw-h .rw-rows { flex-direction: row; }
.rw-h .rw-row { flex: 1; grid-template-columns: 22px 34px 1fr 30px; }
.rw-h .rw-head { color: #b26a00; }

/* ================= 排行榜 ================= */
.tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.tabs button { padding: 8px 18px; border-radius: 999px; background: #f0f4f8; font-weight: 800; font-size: 15px; }
.tabs button.on { background: var(--sky); color: #fff; }
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-row { display: flex; align-items: center; gap: 14px; background: #f5f9fc; border-radius: 18px; padding: 10px 16px; text-align: left; }
.rank-row.me { background: #fff8e1; box-shadow: inset 0 0 0 2px #ffd54f; }
.rank-row .rk { width: 34px; font-size: 24px; font-weight: 900; text-align: center; color: var(--sky); }
.rank-row .info { flex: 1; }
.rank-row .info b { font-size: 18px; display: block; }
.rank-row .info small { color: var(--muted); font-size: 12px; }
.rank-row .score { font-size: 26px; font-weight: 900; color: #b26a00; }
.rank-row .score small { font-size: 13px; }

/* ================= 盲盒 / 宝箱 ================= */
.box-stage { min-height: 200px; display: grid; place-items: center; }
.box-icon { font-size: 120px; filter: drop-shadow(0 12px 20px rgba(0,0,0,.25)); animation: bob 1.6s ease-in-out infinite; }
.box-icon.shake { animation: boxshake .25s ease-in-out infinite; }
@keyframes boxshake { 25% { transform: rotate(-10deg) scale(1.05); } 75% { transform: rotate(10deg) scale(1.05); } }
.reveal { position: relative; display: flex; flex-direction: column; align-items: center; animation: modalIn .6s cubic-bezier(.34,1.56,.64,1); padding: 10px 30px; }
.reveal svg { width: 150px; height: 150px; overflow: visible; position: relative; z-index: 1; }
.reveal .glowring { position: absolute; top: 10px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.9), transparent 70%); animation: pulse 1.4s ease-in-out infinite; }
.reveal.r-rare .glowring { background: radial-gradient(circle, rgba(66,165,245,.7), transparent 70%); }
.reveal.r-epic .glowring { background: radial-gradient(circle, rgba(171,71,188,.75), transparent 70%); }
.reveal.r-legendary .glowring { background: radial-gradient(circle, rgba(255,193,7,.95), rgba(255,235,59,.4) 50%, transparent 72%); animation: spin 3s linear infinite, pulse 1.2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal .rname { font-weight: 900; font-size: 15px; letter-spacing: 2px; }
.reveal b { font-size: 26px; }
.reveal small { color: var(--muted); }
.collect-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.collect-item { background: #f5f9fc; border-radius: 14px; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px solid transparent; }
.collect-item svg { width: 54px; height: 54px; overflow: visible; }
.collect-item .q { font-size: 32px; height: 54px; display: grid; place-items: center; color: #b0bec5; }
.collect-item small { font-size: 11px; color: var(--muted); }
.collect-item.has.r-rare { border-color: #42a5f5; } .collect-item.has.r-epic { border-color: #ab47bc; } .collect-item.has.r-legendary { border-color: #ffb300; background: #fff8e1; }
.shop-item.r-legendary { background: #fff8e1; }
.chest-anim { font-size: 110px; animation: boxshake .3s ease-in-out infinite; margin: 10px 0; }
.chest-reward { font-size: 40px; font-weight: 900; color: #b26a00; animation: modalIn .5s cubic-bezier(.34,1.56,.64,1); }
.chest-reward small { display: block; font-size: 14px; color: var(--muted); font-weight: 600; }
.goal .chest { font-size: 20px; cursor: help; filter: grayscale(1); opacity: .6; }
.goal .chest.open { filter: none; opacity: 1; animation: bob 1.4s ease-in-out infinite; }
.char .glow { filter: drop-shadow(0 0 8px #ffe082); animation: pulse 2s ease-in-out infinite; transform-origin: 110px -6px; }
.char .sparkle .sp { animation: twinkle 1.2s ease-in-out infinite; }
.char .sparkle .sp:nth-child(odd) { animation-delay: .6s; }

/* ================= 珂珂姐姐 ================= */
.char.kitty .eye { animation: blink 5s infinite .8s; }
.char.kitty.happy .eye { animation: none; transform: scaleY(.35); }
.char.kitty.happy .body-wrap { animation: hop .7s ease; transform-origin: 110px 226px; }
.char.kitty.talk .head { animation: nod .5s ease 2; transform-origin: 110px 160px; }
@keyframes nod { 50% { transform: rotate(-6deg); } }
.sister-panel { display: flex; gap: 14px; align-items: center; background: linear-gradient(90deg, #fff0f5, #fff8fb); border: 2px solid #ffd6e4; border-radius: 20px; padding: 10px 16px; margin-bottom: 14px; }
.sister-panel .avatar { width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 3px solid #ff8fb1; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; cursor: pointer; }
.sister-panel .avatar svg { width: 60px; height: 50px; }
.sister-panel .talk { flex: 1; }
.who { font-size: 12px; font-weight: 900; color: #e91e63; letter-spacing: 1px; }
.sister-panel .msg { font-size: 16px; font-weight: 700; line-height: 1.4; margin: 2px 0 6px; }
.goal { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.goalbar { flex: 1; height: 10px; background: #ffe3ec; border-radius: 6px; overflow: hidden; }
.goalbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff8fb1, #e91e63); border-radius: 6px; transition: width .8s ease; }
.sister-pop { position: fixed; top: 76px; left: 50%; transform: translate(-50%, -180px); z-index: 85; display: flex; gap: 12px; align-items: center; background: #fff; border: 3px solid #ff8fb1; border-radius: 999px; padding: 8px 22px 8px 8px; box-shadow: 0 14px 36px rgba(233,30,99,.25); transition: transform .5s cubic-bezier(.34,1.56,.64,1); max-width: 620px; }
.sister-pop.show { transform: translate(-50%, 0); }
.sister-pop .avatar { width: 54px; height: 54px; border-radius: 50%; background: #fff0f5; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.sister-pop .avatar svg { width: 50px; height: 42px; }
.sister-pop .msg { font-size: 16px; font-weight: 700; line-height: 1.35; }
.sister-line { display: flex; gap: 10px; align-items: center; background: #fff0f5; border-radius: 16px; padding: 8px 14px; margin: 6px 0 10px; text-align: left; font-weight: 700; font-size: 15px; }
.sister-line svg { width: 46px; height: 38px; flex-shrink: 0; }
.iconbtn.off { opacity: .5; filter: grayscale(1); }

/* ================= 首页 / 地图 ================= */
.home { flex: 1; display: grid; grid-template-columns: 230px 1fr 230px; gap: 16px; align-items: end; }
.home .side { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.home .side .char { max-width: 210px; }
.mapcard { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); padding: 22px 26px; backdrop-filter: blur(8px); }
.mapcard h2 { margin: 0 0 4px; font-size: 26px; text-align: center; }
.mapcard p.sub { margin: 0 0 12px; text-align: center; color: var(--muted); font-size: 15px; }
.map { position: relative; height: 300px; }
.map svg.path { position: absolute; inset: 0; width: 100%; height: 100%; }
.map svg.path path { fill: none; stroke: #c9dcea; stroke-width: 8; stroke-linecap: round; stroke-dasharray: 0.1 16; }
.map svg.path path.done { stroke: #ffd54f; stroke-dasharray: none; stroke-width: 7; }
.node { position: absolute; transform: translate(-50%, -50%); text-align: center; width: 110px; }
.node button {
  width: 66px; height: 66px; border-radius: 50%; font-size: 26px; font-weight: 900; color: #fff;
  background: linear-gradient(180deg, #4fc3f7, #0288d1); box-shadow: 0 5px 0 #01579b, 0 8px 16px rgba(0,0,0,.2); transition: transform .15s;
}
.node button:hover { transform: scale(1.1); }
.node.locked button { background: linear-gradient(180deg, #cfd8dc, #90a4ae); box-shadow: 0 5px 0 #607d8b; cursor: not-allowed; font-size: 22px; }
.node.done button { background: linear-gradient(180deg, #ffd54f, #ffa000); box-shadow: 0 5px 0 #c67c00, 0 8px 16px rgba(0,0,0,.2); }
.node.cur button { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); box-shadow: 0 5px 0 #01579b, 0 0 0 12px rgba(79,195,247,.35); } }
.node .name { font-size: 14px; font-weight: 700; margin-top: 6px; white-space: nowrap; }
.node .stars { font-size: 14px; letter-spacing: 1px; color: #ffb300; height: 18px; }
.node .stars .off { color: #cfd8dc; }
.node .here { position: absolute; top: -34px; left: 50%; transform: translateX(-50%); animation: bob 1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, -8px); } }
.homebtns { display: flex; justify-content: center; gap: 14px; margin-top: 8px; flex-wrap: wrap; }

/* ================= 答题 ================= */
.play { flex: 1; display: grid; grid-template-columns: 220px 1fr 240px; gap: 18px; align-items: end; }
.play .side { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.play .side .char { max-width: 200px; }
.hud { background: var(--card); border-radius: 18px; padding: 10px 16px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; margin-bottom: 12px; backdrop-filter: blur(8px); }
.hud .stage { font-weight: 900; font-size: 17px; }
.track { flex: 1; position: relative; height: 40px; }
.track .line { position: absolute; left: 17px; right: 17px; top: 50%; height: 6px; margin-top: -3px; background: #dbe7f0; border-radius: 3px; }
.track .dots { position: absolute; left: 0; right: 0; top: 50%; margin-top: -8px; display: flex; justify-content: space-between; padding: 0 10px; }
.track .dots i { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid #cfe3f0; transition: all .3s; }
.track .dots i.ok { background: var(--green); border-color: var(--green); transform: scale(1.15); }
.track .dots i.bad { background: var(--gold); border-color: var(--gold); }
.track .dots i.boss { border-color: #ff5c8d; }
.track .runner { position: absolute; top: -4px; left: 0; transition: left .6s cubic-bezier(.34,1.56,.64,1); width: 34px; margin-left: 1px; }
.track .goal-flag { position: absolute; right: -2px; top: -6px; font-size: 24px; }
.combo { font-weight: 900; color: #ff6f00; font-size: 17px; min-width: 90px; text-align: right; }

.card { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); padding: 24px 30px; min-height: 470px; display: flex; flex-direction: column; gap: 16px; backdrop-filter: blur(8px); position: relative; }
.card.boss { box-shadow: 0 0 0 4px #ff5c8d, var(--shadow); }
.card .ribbon { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: linear-gradient(90deg, #ff5c8d, #ff8a65); color: #fff; padding: 5px 20px; border-radius: 999px; font-weight: 900; font-size: 15px; box-shadow: 0 4px 12px rgba(255,92,141,.4); }
.tag { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.tag b { color: var(--mint); }
.qbody { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; min-height: 180px; }
.qtext { font-size: 31px; font-weight: 900; line-height: 1.5; text-align: center; min-height: 56px; animation: bubbleIn .3s ease; }
.visual { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 14px; min-height: 30px; }
.items-group { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px 6px; padding: 10px 12px; background: #f4f9fc; border: 2px dashed #bcd6e8; border-radius: 14px; font-size: 26px; line-height: 1.1; }
.items-group span { display: inline-block; animation: pop .35s ease both; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: auto; }
.opt {
  position: relative; font-size: 30px; font-weight: 900; padding: 20px 14px 20px 56px; border-radius: 20px; color: var(--ink); text-align: left;
  border: 4px solid #fff; box-shadow: 0 6px 0 rgba(0,0,0,.12), 0 8px 18px rgba(0,0,0,.08); transition: transform .12s, box-shadow .12s, filter .2s; animation: pop .35s ease both;
}
.opt:nth-child(1) { background: #ffe082; } .opt:nth-child(2) { background: #90caf9; }
.opt:nth-child(3) { background: #c5e1a5; } .opt:nth-child(4) { background: #f8bbd0; }
.opt:nth-child(2) { animation-delay: .05s; } .opt:nth-child(3) { animation-delay: .1s; } .opt:nth-child(4) { animation-delay: .15s; }
.opt::before { content: attr(data-k); position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.75); font-size: 16px; display: grid; place-items: center; }
.opt:hover:not(:disabled) { transform: translateY(-4px) rotate(-1deg) scale(1.02); }
.opt:disabled { cursor: default; }
.options.long { grid-template-columns: 1fr; gap: 10px; }
.options.long .opt { font-size: 19px; padding: 12px 16px 12px 56px; line-height: 1.4; }
.opt.right { background: #a5d6a7 !important; border-color: var(--green); animation: rightPop .5s ease; }
@keyframes rightPop { 40% { transform: scale(1.08); } }
.opt.wrong { filter: grayscale(.6); animation: shake .45s; }
.opt.wrong::after { content: "✕"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--red); font-size: 30px; }
.opt.dim { opacity: .4; filter: grayscale(.8); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.explain { background: #fff8e1; border-left: 6px solid var(--gold); border-radius: 12px; padding: 12px 16px; font-size: 19px; line-height: 1.5; animation: bubbleIn .3s; }
.fly { position: fixed; z-index: 60; font-size: 26px; font-weight: 900; color: #b26a00; text-shadow: 0 2px 0 #fff; pointer-events: none; animation: fly 1s ease-in forwards; }
@keyframes fly { 0% { transform: translate(0,0) scale(1.2); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(.6); opacity: 0; } }
.combo-pop { position: fixed; left: 50%; top: 32%; transform: translate(-50%, -50%); z-index: 60; font-size: 54px; font-weight: 900; color: #ff6f00; text-shadow: 0 3px 0 #fff, 0 6px 20px rgba(255,111,0,.4); animation: comboPop .9s ease forwards; pointer-events: none; }
@keyframes comboPop { 0% { transform: translate(-50%,-50%) scale(.3); opacity: 0; } 30% { transform: translate(-50%,-50%) scale(1.2); opacity: 1; } 100% { transform: translate(-50%,-90%) scale(1); opacity: 0; } }

/* ================= 结算 / 弹层 ================= */
.overlay { position: fixed; inset: 0; background: rgba(20, 40, 70, .45); display: grid; place-items: center; z-index: 80; animation: fade .3s; backdrop-filter: blur(3px); }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 30px; padding: 30px 36px; width: min(680px, 92vw); max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.35); text-align: center; animation: modalIn .4s cubic-bezier(.34,1.56,.64,1); position: relative; }
@keyframes modalIn { from { transform: scale(.6); opacity: 0; } }
.modal h2 { margin: 0 0 6px; font-size: 32px; }
.modal .close { position: absolute; right: 16px; top: 14px; background: #f0f4f8; width: 38px; height: 38px; border-radius: 50%; font-size: 18px; }
.bigstars { display: flex; justify-content: center; gap: 10px; margin: 12px 0; }
.bigstars svg { width: 82px; height: 82px; transform: scale(0); }
.bigstars svg.on { animation: starIn .5s cubic-bezier(.34,1.56,.64,1) forwards; }
.bigstars svg.off { transform: scale(1); opacity: .25; }
@keyframes starIn { to { transform: scale(1) rotate(0); } from { transform: scale(0) rotate(-120deg); } }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.result-grid div { background: #f2f7fb; border-radius: 16px; padding: 12px; }
.result-grid b { display: block; font-size: 32px; color: var(--sky); }
.result-grid span { font-size: 14px; color: var(--muted); }
.modal .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.badge-toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: linear-gradient(90deg, #ffd54f, #ffb300); color: #4e342e; padding: 12px 26px; border-radius: 999px; font-weight: 900; font-size: 18px; box-shadow: 0 10px 30px rgba(255,179,0,.5); z-index: 90; animation: toastIn .5s cubic-bezier(.34,1.56,.64,1), fade 4s reverse forwards 3s; }
@keyframes toastIn { from { transform: translate(-50%, -80px); } }

.shop-grid, .badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; }
.shop-item, .badge-item { background: #f5f9fc; border-radius: 18px; padding: 12px 10px; border: 3px solid transparent; }
.shop-item .pv { height: 90px; display: grid; place-items: center; }
.shop-item .pv svg { width: 86px; height: 86px; overflow: visible; }
.shop-item b { display: block; font-size: 15px; margin: 4px 0; }
.shop-item .price { color: #b26a00; font-weight: 800; font-size: 14px; }
.shop-item button { margin-top: 6px; font-size: 14px; font-weight: 800; padding: 7px 16px; border-radius: 999px; background: #ffb300; color: #fff; }
.shop-item button.owned { background: #4fc3f7; }
.shop-item.on { border-color: var(--green); background: #eaf7ea; }
.shop-item.on button { background: var(--green); }
.shop-item button:disabled { background: #cfd8dc; cursor: not-allowed; }
.shop-preview { display: flex; align-items: center; gap: 16px; justify-content: center; }
.shop-preview .char { width: 130px; }
.badge-item .ic { font-size: 40px; }
.badge-item b { display: block; font-size: 15px; margin: 4px 0 2px; }
.badge-item small { color: var(--muted); font-size: 12px; }
.badge-item.locked { opacity: .4; filter: grayscale(1); }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 70; }
.confetti i { position: absolute; top: -20px; width: 12px; height: 12px; border-radius: 3px; opacity: .95; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(600deg); opacity: 0; } }
.footer { text-align: center; font-size: 13px; padding: 10px; }
.footer a { color: var(--muted); background: rgba(255,255,255,.7); padding: 4px 12px; border-radius: 999px; text-decoration: none; }

/* ================= 家长页 ================= */
.parent { max-width: 1100px; margin: 0 auto; padding: 20px 28px 60px; display: grid; gap: 22px; }
.panel { background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 22px 26px; }
.panel h2 { margin: 0 0 14px; font-size: 20px; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.kpis div { background: #f2f7fb; border-radius: 14px; padding: 14px; text-align: center; }
.kpis b { display: block; font-size: 30px; color: var(--sky); }
.kpis span { font-size: 13px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid #eef3f7; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.bar { height: 10px; background: #e6eef4; border-radius: 6px; overflow: hidden; min-width: 120px; }
.bar i { display: block; height: 100%; background: var(--green); }
.bar.low i { background: var(--red); }
.bar.mid i { background: var(--gold); }
.lv { display: inline-flex; gap: 2px; }
.lv i { width: 10px; height: 10px; border-radius: 50%; background: #dde7ee; }
.lv i.on { background: var(--mint); }
.week { display: flex; gap: 12px; align-items: flex-end; height: 140px; padding-top: 10px; }
.week div { flex: 1; text-align: center; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.week b { display: block; background: #8ecbec; border-radius: 6px 6px 0 0; margin: 4px auto 6px; width: 60%; position: relative; }
.week b em { position: absolute; top: -18px; left: 0; right: 0; font-style: normal; font-size: 12px; color: var(--ink); }
.form { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 14px; align-items: end; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.form input, .form select { font-size: 16px; padding: 9px 12px; border: 2px solid #d9e8f2; border-radius: 10px; }
.wrong-list li { padding: 8px 0; border-bottom: 1px solid #eef3f7; font-size: 15px; line-height: 1.5; }
.wrong-list small { color: var(--muted); margin-right: 8px; }
.wrong-list .ans { color: var(--green); font-weight: 600; }
.wrong-list .chosen { color: var(--red); text-decoration: line-through; }
.gate { max-width: 420px; margin: 80px auto; text-align: center; }
.gate input { font-size: 26px; width: 140px; text-align: center; padding: 10px; border: 2px solid #8ecbec; border-radius: 12px; }
.danger { background: #fff; color: var(--red); border: 2px solid var(--red); box-shadow: none; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 22px; border-radius: 999px; font-size: 15px; z-index: 99; }

@media (max-width: 980px) {
  .home, .play { grid-template-columns: 1fr; }
  .side { flex-direction: row !important; justify-content: center; }
  .side .char { max-width: 120px !important; }
  .bubble::after { display: none; }
  .kpis, .form { grid-template-columns: 1fr 1fr; }
  .trees { display: none; }
}
