/* ============================================
   暑假作业农场 · 蛋仔派对糖果卡通风格
   主色：糖果蓝 #7fd8ff + 果冻绿 #8ef0b2 + 奶油白 + 泡泡粉 #ffb6d9
   ============================================ */
:root {
  --blue: #aee6ff;
  --blue-deep: #3db6f5;
  --green: #a8f0c6;
  --green-deep: #3ecf7a;
  --cream: #fff8f0;
  --pink: #ffd0e6;
  --pink-deep: #ff8ac2;
  --yellow: #ffeb99;
  --yellow-deep: #ffc233;
  --purple: #c9a6ff;
  --purple-deep: #9d6ff0;
  --brown: #d09a66;
  --soil: #b07a4a;
  --text: #4a3b56;
  --text-light: #9a8aa8;
  --danger: #ff6b81;
  --white: #ffffff;
  --radius: 26px;
  --shadow: 0 6px 0 rgba(120, 90, 160, .14);
  --tabbar-h: 92px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 17px; }
body {
  font-family: "PingFang SC", "Yuanti SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 182, 217, .5) 0 180px, transparent 200px),
    radial-gradient(circle at 88% 20%, rgba(255, 235, 153, .55) 0 140px, transparent 160px),
    linear-gradient(180deg, var(--blue) 0%, #d2f0ff 34%, var(--cream) 70%);
  background-attachment: fixed;
  min-height: 100dvh;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.hidden { display: none !important; }
button { font-family: inherit; border: none; cursor: pointer; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 22px 10px;
  background: rgba(255, 248, 240, .85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 3px dashed rgba(120, 90, 160, .14);
}
.topbar-title { display: flex; align-items: center; gap: 12px; }
.logo-icon { width: 52px; height: 52px; display: inline-block; }
.logo-icon svg { width: 100%; height: 100%; }
.topbar-title h1 { font-size: 1.25rem; letter-spacing: 1px; }
.topbar-title p { font-size: .85rem; color: var(--text-light); }
.topbar-stats { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stat-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--white); border-radius: 999px;
  padding: 7px 16px 7px 9px; font-size: 1.05rem;
  box-shadow: var(--shadow); border: 2.5px solid rgba(120,90,160,.1);
}
.chip-icon { width: 28px; height: 28px; display: inline-block; }
.chip-icon svg, .tab-icon svg { width: 100%; height: 100%; display: block; }
.chip-sun b { color: #e8a200; }
.chip-coin b { color: #d98a00; }
.chip-streak b { color: #ff7a5c; }
.debug-btn { background: #eee; border-radius: 10px; padding: 6px 10px; font-size: .8rem; }

/* ---------- 页面容器 ---------- */
.pages { padding: 18px 22px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px); max-width: 1180px; margin: 0 auto; }
.page { display: none; animation: pageIn .35s cubic-bezier(.16,1,.3,1); }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-around; align-items: stretch; gap: 6px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 3px solid rgba(120,90,160,.1);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -8px 24px rgba(120,90,160,.12);
}
.tab {
  position: relative; flex: 1; max-width: 170px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: transparent; border-radius: 20px;
  font-size: .95rem; font-weight: 700; color: var(--text-light);
  transition: transform .15s, background .2s, color .2s;
}
.tab:active { transform: scale(.94); }
.tab .tab-icon { width: 40px; height: 40px; transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.tab.active { color: var(--text); background: linear-gradient(180deg, var(--yellow), #fff3cf); box-shadow: inset 0 -3px 0 rgba(120,90,160,.08); }
.tab.active .tab-icon { transform: translateY(-3px) scale(1.12); }
.tab-farm.active { background: linear-gradient(180deg, var(--green), #dff5df); }
.tab-badge {
  position: absolute; top: 6px; right: calc(50% - 34px);
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--danger); border: 2.5px solid #fff;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.3); } }

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--white); border-radius: var(--radius);
  border: 3px solid rgba(120,90,160,.1);
  box-shadow: var(--shadow);
  padding: 20px 22px; margin-bottom: 18px;
}
.card-title { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; margin-bottom: 14px; }
.card-title .t-icon { width: 34px; height: 34px; }
.card-title .t-icon svg { width: 100%; height: 100%; }
.section-tip { font-size: .9rem; color: var(--text-light); margin-bottom: 12px; line-height: 1.6; }

/* ---------- 大按钮 ---------- */
.big-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 10px 30px;
  border-radius: 999px; font-size: 1.1rem; font-weight: 800; letter-spacing: 1px;
  color: #fff; background: linear-gradient(180deg, #52d98a, #2fbf68);
  box-shadow: 0 5px 0 #26a356, 0 8px 14px rgba(62,207,122,.35);
  transition: transform .12s, box-shadow .12s;
}
.big-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #26a356; }
.big-btn.btn-blue { background: linear-gradient(180deg, #55c3f7, #2ba6e8); box-shadow: 0 5px 0 #1f8ecc, 0 8px 14px rgba(61,182,245,.35); }
.big-btn.btn-blue:active { box-shadow: 0 1px 0 #1f8ecc; }
.big-btn.btn-pink { background: linear-gradient(180deg, #ff9ecb, #ff74b4); box-shadow: 0 5px 0 #e85a9c, 0 8px 14px rgba(255,138,194,.4); }
.big-btn.btn-pink:active { box-shadow: 0 1px 0 #e85a9c; }
.big-btn.btn-yellow { background: linear-gradient(180deg, #ffd24d, #ffbb1f); box-shadow: 0 5px 0 #eba30f, 0 8px 14px rgba(255,194,51,.4); color: #7a5200; }
.big-btn.btn-yellow:active { box-shadow: 0 1px 0 #eba30f; }
.big-btn.btn-gray { background: linear-gradient(180deg, #cfc8d8, #b8aec7); box-shadow: 0 5px 0 #a094b3; }
.big-btn:disabled { filter: grayscale(.7); opacity: .6; pointer-events: none; }

/* ---------- 作业打卡 ---------- */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.task-card {
  position: relative; overflow: hidden;
  background: var(--white); border-radius: var(--radius);
  border: 3px solid rgba(120,90,160,.1); box-shadow: var(--shadow);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
  transition: transform .2s;
}
.task-card.done { border-color: var(--green-deep); background: linear-gradient(180deg, #f0fdf5, #fff); }
.task-head { display: flex; align-items: center; gap: 14px; }
.task-avatar { width: 64px; height: 64px; flex-shrink: 0; }
.task-avatar svg { width: 100%; height: 100%; }
.task-head h3 { font-size: 1.25rem; }
.task-head p { font-size: .88rem; color: var(--text-light); margin-top: 2px; }
.task-reward { display: flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--text-light); background: var(--cream); border-radius: 12px; padding: 8px 12px; flex-wrap: wrap; }
.task-reward .mini-icon { width: 22px; height: 22px; }
.task-reward .mini-icon svg { width: 100%; height: 100%; }
.task-card .big-btn { width: 100%; }
.done-stamp {
  position: absolute; right: 12px; top: 10px;
  transform: rotate(12deg);
  font-size: .95rem; font-weight: 900; color: var(--green-deep);
  border: 3px solid var(--green-deep); border-radius: 12px; padding: 3px 10px;
  background: rgba(255,255,255,.85);
  animation: stampIn .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes stampIn { from { transform: rotate(12deg) scale(2.2); opacity: 0; } to { transform: rotate(12deg) scale(1); opacity: 1; } }

/* 全部完成横幅 */
.all-done-banner {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(90deg, #fff6d4, #e2fbec);
  border: 3px solid var(--yellow-deep); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 18px;
}
.all-done-banner .banner-icon { width: 56px; height: 56px; flex-shrink: 0; animation: floatY 2.4s ease-in-out infinite; }
.all-done-banner .banner-icon svg { width: 100%; height: 100%; }
.all-done-banner h3 { font-size: 1.15rem; margin-bottom: 4px; }
.all-done-banner p { font-size: .9rem; color: var(--text-light); }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* 进度条 */
.progress-wrap { background: #f0e9f5; border-radius: 999px; height: 26px; overflow: hidden; border: 2.5px solid rgba(120,90,160,.12); }
.progress-bar {
  height: 100%; border-radius: 999px;
  background: repeating-linear-gradient(45deg, #3ecf7a 0 14px, #6fe097 14px 28px);
  transition: width .6s cubic-bezier(.16,1,.3,1);
  min-width: 0;
}
.progress-label { text-align: center; font-size: .92rem; color: var(--text-light); margin-top: 8px; }

/* ---------- 每日计划 ---------- */
.plan-list { display: flex; flex-direction: column; gap: 12px; }
.plan-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--cream); border-radius: 18px; padding: 14px 16px;
  border: 2.5px solid rgba(120,90,160,.08);
}
.plan-item .p-time { font-weight: 800; color: var(--blue-deep); font-size: 1rem; min-width: 108px; }
.plan-item .p-txt { flex: 1; font-size: 1rem; }
.plan-item .p-sub { width: 34px; height: 34px; flex-shrink: 0; }
.plan-item .p-sub svg { width: 100%; height: 100%; }

/* ---------- 学习统计 ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-block { text-align: center; background: var(--white); border-radius: 22px; border: 3px solid rgba(120,90,160,.1); box-shadow: var(--shadow); padding: 18px 10px; }
.stat-block .num { font-size: 2rem; font-weight: 900; }
.stat-block .lbl { font-size: .9rem; color: var(--text-light); margin-top: 4px; }
.week-chart { display: flex; align-items: flex-end; gap: 12px; height: 190px; padding: 10px 6px 0; }
.week-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.week-bar { width: 70%; max-width: 46px; border-radius: 12px 12px 6px 6px; background: linear-gradient(180deg, var(--blue-deep), var(--blue)); transition: height .7s cubic-bezier(.16,1,.3,1); position: relative; }
.week-bar.full { background: linear-gradient(180deg, var(--green-deep), var(--green)); }
.week-bar .bar-num { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); font-size: .82rem; font-weight: 800; color: var(--text-light); }
.week-col .day-lbl { font-size: .85rem; color: var(--text-light); }
.week-col.today .day-lbl { color: var(--blue-deep); font-weight: 900; }
.subject-rows { display: flex; flex-direction: column; gap: 10px; }
.subject-row { display: flex; align-items: center; gap: 12px; }
.subject-row .s-icon { width: 40px; height: 40px; flex-shrink: 0; }
.subject-row .s-icon svg { width: 100%; height: 100%; }
.subject-row .s-name { width: 76px; font-weight: 700; }
.subject-row .s-track { flex: 1; height: 20px; background: #f0e9f5; border-radius: 999px; overflow: hidden; }
.subject-row .s-fill { height: 100%; border-radius: 999px; transition: width .7s; }
.subject-row .s-pct { width: 60px; text-align: right; font-size: .9rem; color: var(--text-light); }

/* ---------- 错题本 ---------- */
.wrong-form { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: start; margin-bottom: 8px; }
.wrong-form select, .wrong-form textarea, .wrong-form input {
  font-family: inherit; font-size: 1rem; color: var(--text);
  border: 2.5px solid rgba(120,90,160,.15); border-radius: 16px;
  padding: 12px 14px; background: var(--cream); width: 100%;
  outline: none; resize: vertical;
}
.wrong-form textarea { min-height: 76px; grid-column: 1 / -1; }
.wrong-form select:focus, .wrong-form textarea:focus, .wrong-form input:focus { border-color: var(--blue-deep); }
.wrong-list { display: flex; flex-direction: column; gap: 12px; }
.wrong-item { background: var(--cream); border-radius: 18px; padding: 14px 16px; border-left: 8px solid var(--pink-deep); position: relative; }
.wrong-item.fixed { border-left-color: var(--green-deep); opacity: .75; }
.wrong-item .w-meta { display: flex; gap: 10px; align-items: center; font-size: .85rem; color: var(--text-light); margin-bottom: 6px; flex-wrap: wrap; }
.wrong-item .w-tag { background: var(--pink); color: #d14a8f; border-radius: 999px; padding: 2px 12px; font-weight: 700; }
.wrong-item.fixed .w-tag { background: var(--green); color: #1f8a4d; }
.wrong-item .w-content { font-size: 1.02rem; line-height: 1.6; white-space: pre-wrap; }
.wrong-item .w-actions { margin-top: 10px; display: flex; gap: 10px; }
.small-btn { border-radius: 999px; padding: 8px 18px; font-size: .92rem; font-weight: 700; min-height: 40px; }
.small-btn.sb-green { background: var(--green); color: #1f8a4d; }
.small-btn.sb-red { background: #ffe0e5; color: #d14a5e; }
.small-btn:active { transform: scale(.95); }

/* 空状态 */
.empty-state { text-align: center; padding: 34px 10px; color: var(--text-light); }
.empty-state .empty-art { width: 110px; height: 110px; margin: 0 auto 12px; opacity: .9; }
.empty-state .empty-art svg { width: 100%; height: 100%; }
.empty-state p { font-size: 1rem; line-height: 1.7; }

/* ---------- 农场 ---------- */
.farm-scene {
  position: relative; border-radius: 30px; overflow: hidden;
  border: 4px solid rgba(120,90,160,.14);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, #a8e4ff 0%, #d8f6e8 46%, #a8e79a 46.2%, #8fd97e 100%);
  padding: 14px 16px 20px;
  margin-bottom: 18px;
  min-height: 420px;
}
.farm-scene.night { background: linear-gradient(180deg, #3b3f7e 0%, #545a9e 44%, #47775a 44.2%, #3a6549 100%); }
.farm-sky { position: absolute; inset: 0 0 auto 0; height: 150px; pointer-events: none; }
.farm-sky .sun-art { position: absolute; right: 26px; top: 14px; width: 74px; height: 74px; animation: spinSlow 24s linear infinite; }
.farm-sky .sun-art svg, .farm-sky .cloud svg, .farm-sky .moon-art svg { width: 100%; height: 100%; }
.farm-sky .moon-art { position: absolute; right: 30px; top: 14px; width: 64px; height: 64px; }
.farm-sky .cloud { position: absolute; width: 90px; height: 54px; opacity: .95; animation: cloudMove 36s linear infinite; }
.farm-sky .cloud.c2 { width: 66px; top: 52px; animation-duration: 48s; animation-delay: -18s; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes cloudMove { from { left: -120px; } to { left: 105%; } }
.farm-title-row { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.farm-title-row h2 { font-size: 1.3rem; color: #2e6b3e; text-shadow: 0 2px 0 rgba(255,255,255,.5); }
.farm-scene.night .farm-title-row h2 { color: #e8f0ff; text-shadow: none; }
.day-night-tag { background: rgba(255,255,255,.85); border-radius: 999px; padding: 6px 16px; font-size: .9rem; font-weight: 800; color: var(--text); }

/* 地块网格 */
.plot-grid {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 16px;
  margin-top: 84px;
}
@media (min-width: 900px) { .plot-grid { grid-template-columns: repeat(6, 1fr); margin-top: 96px; } }
.plot {
  position: relative; aspect-ratio: 1 / .92;
  background: linear-gradient(180deg, #d2a06e, var(--soil));
  border-radius: 22px;
  border: 4px solid rgba(105,64,32,.35);
  box-shadow: inset 0 6px 10px rgba(105,64,32,.3), 0 4px 0 rgba(105,64,32,.25);
  display: flex; align-items: flex-end; justify-content: center;
  cursor: pointer; transition: transform .15s;
}
.plot:active { transform: scale(.95); }
.plot .soil-lines { position: absolute; bottom: 10px; left: 12%; right: 12%; height: 8px; border-radius: 999px; background: rgba(105,64,32,.28); }
.plot .plant-art { position: relative; width: 78%; height: 88%; display: flex; align-items: flex-end; justify-content: center; z-index: 2; }
.plot .plant-art svg { width: 100%; height: 100%; overflow: visible; }
.plot .plant-art.swaying svg { animation: sway 3.2s ease-in-out infinite; transform-origin: 50% 95%; }
@keyframes sway { 0%,100% { transform: rotate(-2.4deg); } 50% { transform: rotate(2.4deg); } }
.plot .plant-art.withered svg { filter: grayscale(.95) brightness(.82); animation: none; }
.plot.ready::after {
  content: ""; position: absolute; inset: -6px; border-radius: 26px;
  border: 3.5px dashed var(--yellow-deep);
  animation: readyBlink 1.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes readyBlink { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.plot .hp-wrap { position: absolute; top: 7px; left: 10%; right: 10%; height: 12px; background: rgba(0,0,0,.25); border-radius: 999px; overflow: hidden; z-index: 3; }
.plot .hp-bar { height: 100%; background: linear-gradient(90deg, #7ee07e, #3ecf7a); border-radius: 999px; transition: width .4s; }
.plot .hp-bar.low { background: linear-gradient(90deg, #ffb199, #ff7a5c); }
.plot .stage-tag {
  position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%);
  background: #fff; border-radius: 999px; font-size: .78rem; font-weight: 800;
  padding: 3px 12px; border: 2.5px solid rgba(120,90,160,.15); white-space: nowrap; z-index: 3;
}
.plot .shield-mark { position: absolute; top: -12px; left: -8px; width: 40px; height: 40px; z-index: 4; animation: floatY 2s ease-in-out infinite; }
.plot .shield-mark svg { width: 100%; height: 100%; }

/* 小狗熊 */
.bear-sprite { position: absolute; top: -44px; right: -14px; width: 82px; height: 82px; z-index: 5; pointer-events: none; }
.bear-sprite svg { width: 100%; height: 100%; overflow: visible; }
.bear-sprite.chomping svg { animation: chomp .55s ease-in-out infinite; transform-origin: 50% 88%; }
@keyframes chomp {
  0%,100% { transform: rotate(-7deg) translateY(0); }
  30% { transform: rotate(4deg) translateY(3px) scale(1.04, .94); }
  60% { transform: rotate(-3deg) translateY(-2px); }
}
.bear-sprite .bear-bubble {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  background: #fff; border-radius: 12px; padding: 3px 10px;
  font-size: .78rem; font-weight: 800; color: #b0563c; white-space: nowrap;
  border: 2px solid rgba(120,90,160,.2);
}
.bear-flee svg { animation: bearFlee 1s cubic-bezier(.7,0,.84,0) forwards !important; }
@keyframes bearFlee { to { transform: translateX(140px) translateY(-40px) rotate(28deg); opacity: 0; } }

/* 农场功能区标签 */
.farm-tabs { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.farm-tab-btn {
  flex: 1; min-width: 110px; min-height: 58px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 20px; font-size: 1.02rem; font-weight: 800; color: var(--text-light);
  background: var(--white); border: 3px solid rgba(120,90,160,.1); box-shadow: var(--shadow);
  transition: transform .15s;
}
.farm-tab-btn:active { transform: scale(.95); }
.farm-tab-btn.active { background: linear-gradient(180deg, var(--yellow), #fff3cf); color: var(--text); border-color: var(--yellow-deep); }
.farm-tab-btn .ft-icon { width: 30px; height: 30px; }
.farm-tab-btn .ft-icon svg { width: 100%; height: 100%; }
.farm-panel { display: none; }
.farm-panel.active { display: block; animation: pageIn .3s cubic-bezier(.16,1,.3,1); }

/* 背包/商店/仓库网格 */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.item-card {
  position: relative; text-align: center;
  background: var(--cream); border-radius: 20px;
  border: 3px solid rgba(120,90,160,.1);
  padding: 14px 10px 12px;
  transition: transform .15s;
}
.item-card:not(.disabled):active { transform: scale(.95); }
.item-card.disabled { filter: grayscale(.7); opacity: .6; }
.item-card .item-art { width: 64px; height: 64px; margin: 0 auto 8px; }
.item-card .item-art svg { width: 100%; height: 100%; }
.item-card h4 { font-size: 1rem; }
.item-card .item-desc { font-size: .8rem; color: var(--text-light); margin: 4px 0 8px; min-height: 2.1em; line-height: 1.35; }
.item-card .item-count {
  position: absolute; top: 8px; right: 10px;
  background: var(--blue-deep); color: #fff; font-size: .82rem; font-weight: 800;
  border-radius: 999px; min-width: 26px; height: 26px; line-height: 22px; padding: 0 7px;
  border: 2px solid #fff;
}
.item-card .small-btn { width: 90%; }
.price-tag { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: #d98a00; font-size: .95rem; margin-bottom: 8px; }
.price-tag .mini-icon { width: 20px; height: 20px; }
.price-tag .mini-icon svg { width: 100%; height: 100%; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(74, 56, 90, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .25s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--cream); border-radius: 30px;
  border: 4px solid rgba(120,90,160,.15);
  max-width: 480px; width: 100%; max-height: 86dvh; overflow-y: auto;
  padding: 26px 26px 24px; text-align: center;
  animation: modalPop .38s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalPop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-art { width: 130px; height: 130px; margin: 0 auto 10px; }
.modal-art:empty { display: none; }
.modal-art svg { width: 100%; height: 100%; }
.modal h2 { font-size: 1.3rem; margin-bottom: 10px; }
.modal-body { font-size: 1.02rem; line-height: 1.75; color: var(--text); }
.modal-body .hl { color: var(--danger); font-weight: 800; }
.modal-body .hl-green { color: var(--green-deep); font-weight: 800; }
.modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.reward-row { display: flex; justify-content: center; gap: 16px; margin: 12px 0; flex-wrap: wrap; }
.reward-cell { background: #fff; border-radius: 18px; padding: 12px 18px; border: 3px solid var(--yellow-deep); min-width: 96px; }
.reward-cell .r-art { width: 52px; height: 52px; margin: 0 auto 4px; }
.reward-cell .r-art svg { width: 100%; height: 100%; }
.reward-cell .r-txt { font-size: .9rem; font-weight: 800; }

/* 种子选择网格（弹窗内） */
.seed-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 8px; }
.seed-pick {
  background: #fff; border: 3px solid rgba(120,90,160,.12); border-radius: 18px;
  padding: 10px 6px; text-align: center; cursor: pointer; transition: transform .12s;
}
.seed-pick:active { transform: scale(.93); }
.seed-pick.disabled { filter: grayscale(.8); opacity: .5; pointer-events: none; }
.seed-pick .sp-art { width: 50px; height: 50px; margin: 0 auto 4px; }
.seed-pick .sp-art svg { width: 100%; height: 100%; }
.seed-pick .sp-name { font-size: .85rem; font-weight: 800; }
.seed-pick .sp-count { font-size: .78rem; color: var(--text-light); }

/* ---------- 特效层 ---------- */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.fx-item { position: absolute; width: 44px; height: 44px; animation: fxFall linear forwards; }
.fx-item svg { width: 100%; height: 100%; }
@keyframes fxFall {
  from { transform: translateY(-60px) rotate(0deg); opacity: 1; }
  to { transform: translateY(105vh) rotate(340deg); opacity: .7; }
}
.fx-pop { position: absolute; font-size: 1.3rem; font-weight: 900; animation: fxPop 1s cubic-bezier(.16,1,.3,1) forwards; text-shadow: 0 2px 0 #fff; }
@keyframes fxPop { from { transform: translateY(0) scale(.6); opacity: 0; } 30% { opacity: 1; transform: translateY(-24px) scale(1.15); } to { transform: translateY(-70px) scale(1); opacity: 0; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 30px);
  transform: translateX(-50%); z-index: 150;
  background: rgba(74,56,90,.92); color: #fff;
  border-radius: 999px; padding: 13px 26px; font-size: 1rem; font-weight: 700;
  animation: toastIn .3s cubic-bezier(.34,1.56,.64,1);
  max-width: 86vw; text-align: center;
}
@keyframes toastIn { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- 金币商城奖励 ---------- */
.mall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.mall-card {
  text-align: center; background: linear-gradient(180deg, #fff, var(--cream));
  border: 3px solid rgba(120,90,160,.12); border-radius: 22px; padding: 16px 12px;
  position: relative;
}
.mall-card.owned { border-color: var(--green-deep); }
.mall-card .m-art { width: 84px; height: 84px; margin: 0 auto 8px; }
.mall-card .m-art svg { width: 100%; height: 100%; }
.mall-card h4 { font-size: 1.02rem; margin-bottom: 4px; }
.owned-tag { position: absolute; top: 10px; right: 10px; background: var(--green); color: #1f8a4d; font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  html { font-size: 15.5px; }
  .topbar { padding-left: 14px; padding-right: 14px; }
  .topbar-title h1 { font-size: 1.05rem; }
  .pages { padding-left: 14px; padding-right: 14px; }
  .stat-chip { padding: 5px 12px 5px 7px; font-size: .95rem; }
  .wrong-form { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
