/* 陪学宠 — standalone PWA styles.
   Theme variables, keyframes and the pet-stage treatment are ported
   from the Muse version's theme.css; component classes replicate its
   Tailwind layout semantically (no framework at runtime). */

:root {
  color-scheme: light dark;
  --bg: #f3efff;
  --surface: #ffffff;
  --surface2: #ece4ff;
  --text: #2e2350;
  --dim: #7a6f9c;
  --border: #ddd2f7;
  --accent: #7c5cd6;
  --accent-deep: #5b34b8;
  --grape: #7fb069;
  --star: #ffb703;
  --danger: #c0392b;
  --font-sans: "Baloo 2", ui-rounded, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171129;
    --surface: #251b42;
    --surface2: #2f2350;
    --text: #f1eaff;
    --dim: #ab9cd2;
    --border: #40336a;
    --accent: #b18cff;
    --accent-deep: #8b5fe0;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
img { user-select: none; -webkit-user-drag: none; }

/* ---------- keyframes (from theme.css) ---------- */
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.pet-bob { animation: bob 3.2s ease-in-out infinite; }
@keyframes pop-in { 0% { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.pop-in { animation: pop-in 0.35s ease-out both; }
@keyframes float-up { 0% { transform: translateY(6px) scale(0.8); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(-46px) scale(1.1); opacity: 0; } }
.float-up { animation: float-up 1.4s ease-out both; }
@keyframes wiggle { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
.wiggle { animation: wiggle 0.6s ease-in-out infinite; }
@keyframes sway { from { transform: rotate(-1.8deg) translateX(-2px); } to { transform: rotate(1.8deg) translateX(2px); } }
.lulu-sway { animation: sway 4.8s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 96%; }
@keyframes toy-bounce { 0%,100% { transform: translateY(0); } 30% { transform: translateY(-16px); } 55% { transform: translateY(0); } 72% { transform: translateY(-8px); } }
.toy-bounce { animation: toy-bounce 1s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes toy-shake { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
.toy-shake { animation: toy-shake 0.3s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 20%; }
@keyframes toy-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.toy-spin { animation: toy-spin 0.55s linear infinite; transform-box: fill-box; transform-origin: 50% 55%; }
@keyframes toy-life { 0% { opacity: 0; transform: scale(0.5); } 8% { opacity: 1; transform: scale(1); } 86% { opacity: 1; } 100% { opacity: 0; transform: scale(0.7); } }
.toy-life { animation: toy-life 4.6s ease-in-out both; transform-box: fill-box; transform-origin: 50% 100%; }
.pet-stage { background: #ffffff; border-radius: 26px; overflow: hidden; }
@keyframes bubble-in { 0% { transform: translateX(-50%) scale(0.7) translateY(6px); opacity: 0; } 100% { transform: translateX(-50%) scale(1) translateY(0); opacity: 1; } }
.bubble-in { animation: bubble-in 0.25s ease-out both; }
@keyframes chew-pulse { from { transform: scale(1); } to { transform: scale(1.025); } }
.chew-pulse { animation: chew-pulse 0.26s ease-in-out infinite alternate; transform-origin: 50% 60%; }
@keyframes hop { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-11px); } }
.lulu-hop { animation: hop 0.5s ease-in-out 2; }
[data-paused="true"] * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .pet-bob, .wiggle, .lulu-sway, .chew-pulse, .lulu-hop, .toy-bounce, .toy-shake, .toy-spin, .toy-life { animation: none; }
}

/* ---------- generic ---------- */
.boot-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.boot-screen p { font-size: 18px; color: var(--dim); }
.boot-screen .col { flex-direction: column; gap: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; padding: 10px 20px; font-size: 16px; font-weight: 700;
}
.btn-accent { background: var(--accent); color: #fff; }
.btn-grape { background: var(--grape); color: #fff; }
.btn-star { background: var(--star); color: #5c4300; }
.btn-soft { background: var(--surface2); color: var(--text); }
.btn-surface { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(46,35,80,.12); }
.btn-danger { background: var(--danger); color: #fff; }
.btn[disabled], .small-btn[disabled] { opacity: .4; cursor: default; }
.small-btn {
  border-radius: 999px; background: var(--surface); padding: 8px 16px;
  font-size: 14px; font-weight: 700; white-space: nowrap;
}
.small-btn.danger-text { color: var(--danger); }
.small-btn.primary { background: var(--accent); color: #fff; }
.small-btn.danger-solid { background: var(--danger); color: #fff; }

.input {
  width: 100%; border-radius: 16px; border: 2px solid var(--border);
  background: var(--surface); padding: 10px 12px; font-size: 16px; color: var(--text);
}
.field label { display: block; font-size: 14px; font-weight: 700; color: var(--dim); margin-bottom: 4px; }
.field .hint { margin-top: 4px; font-size: 12px; color: var(--dim); }
.msg-ok { font-size: 14px; font-weight: 700; color: var(--grape); }
.msg-err { font-size: 14px; font-weight: 700; color: var(--danger); }

/* ---------- activation page ---------- */
.activation-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 24px; text-align: center;
}
.activation-wrap img.logo { width: 128px; height: 128px; border-radius: 28px; box-shadow: 0 8px 24px rgba(91,52,184,.25); }
.activation-wrap h1 { margin: 20px 0 4px; font-size: 34px; font-weight: 900; }
.activation-wrap .tagline { margin: 0 0 28px; font-size: 15px; color: var(--dim); }
.activation-card {
  width: 100%; max-width: 380px; background: var(--surface); border-radius: 28px;
  padding: 24px 20px; box-shadow: 0 2px 10px rgba(46,35,80,.08); text-align: left;
}
.activation-card label { display: block; font-size: 14px; font-weight: 700; color: var(--dim); margin-bottom: 6px; }
.activation-card input {
  width: 100%; border-radius: 16px; border: 2px solid var(--border); background: var(--surface);
  padding: 13px 14px; font-size: 19px; font-weight: 700; letter-spacing: 1px; color: var(--text);
  text-transform: uppercase; text-align: center;
}
.activation-card .btn { width: 100%; margin-top: 14px; padding: 14px; font-size: 18px; }
.activation-card .err { margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--danger); text-align: center; }
.activation-note { margin-top: 18px; max-width: 380px; font-size: 13px; line-height: 1.7; color: var(--dim); }

/* ---------- main layout ---------- */
.app-main { margin: 0 auto; width: 100%; max-width: 1024px; padding: 8px 12px 32px; }
@media (min-width: 1024px) { .app-main { padding: 8px 24px 32px; } }
.top-row { display: flex; align-items: center; justify-content: space-between; }
.greeting { font-size: 16px; font-weight: 700; margin: 0; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: flex; height: 44px; width: 44px; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--surface); color: var(--dim);
  box-shadow: 0 1px 3px rgba(46,35,80,.12);
}
.icon-btn svg { height: 20px; width: 20px; }
.grid-main { margin-top: 8px; display: grid; gap: 16px; }
@media (min-width: 1024px) { .grid-main { grid-template-columns: minmax(300px, 380px) 1fr; } }
.two-col { margin-top: 16px; display: grid; gap: 16px; }
@media (min-width: 1024px) { .two-col { grid-template-columns: 1fr 1fr; } }
.card { border-radius: 24px; background: var(--surface); padding: 16px; box-shadow: 0 1px 3px rgba(46,35,80,.08); position: relative; }
.card h2 { margin: 0; font-size: 18px; font-weight: 700; }
.mini-note { margin-top: 2px; font-size: 12px; color: var(--dim); }

/* pet panel */
.pet-col { position: relative; margin: 0 auto; max-width: 248px; }
@media (min-width: 1024px) { .pet-col { max-width: 280px; } }
.bubble {
  position: absolute; left: 50%; top: 4px; z-index: 30; width: max-content; max-width: 250px;
  transform: translateX(-50%); border-radius: 16px; background: var(--text);
  padding: 8px 14px; text-align: center; box-shadow: 0 6px 16px rgba(46,35,80,.25);
}
.bubble p { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--bg); }
.bubble .tail { position: absolute; bottom: -6px; left: 50%; height: 12px; width: 12px; transform: translateX(-50%) rotate(45deg); background: var(--text); }
.floater {
  pointer-events: none; position: absolute; left: 50%; top: 64px; transform: translateX(-50%);
  white-space: nowrap; border-radius: 999px; padding: 4px 12px; font-size: 16px; font-weight: 700; color: #fff; z-index: 31;
}
.mood-line {
  margin: -4px auto 0; max-width: 384px; border-radius: 16px; background: var(--surface2);
  padding: 8px 12px; text-align: center; transition: opacity 700ms;
}
.mood-line p { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.4; }
.chips { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.chip { border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.chip-accent { background: var(--accent); color: #fff; }
.chip-soft { background: var(--surface2); }
.bar { overflow: hidden; border-radius: 999px; background: var(--surface2); }
.bar-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width 300ms; }
.level-bar { margin: 8px auto 0; height: 10px; max-width: 384px; }
.gate-note { margin-top: 6px; text-align: center; font-size: 12px; color: var(--dim); }
.satiety { margin: 12px auto 0; max-width: 384px; }
.satiety .row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; }
.satiety .bar { margin-top: 4px; height: 12px; }
.backpack-row { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.pill { border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 700; }
.pill-grape { background: #eef7e8; color: #3c6e2f; }
.pill-star { background: #fff6dd; color: #8a6100; }
@media (prefers-color-scheme: dark) {
  .pill-grape { background: #22331c; color: #a5d68f; }
  .pill-star { background: #3a2f10; color: #ffd93d; }
}
.feed-row { margin-top: 10px; display: flex; justify-content: center; gap: 8px; }
.feed-row .btn { box-shadow: 0 2px 6px rgba(46,35,80,.18); }
.feed-row .btn[disabled] { background: #c9bfe8; box-shadow: none; opacity: 1; }

/* pomodoro */
.pomo-wrap { margin-top: 8px; text-align: center; }
.pomo-bar { margin: 0 auto 10px; height: 9px; width: 100%; max-width: 384px; overflow: hidden; border-radius: 999px; background: var(--surface2); }
.pomo-bar.thick { height: 22px; width: 86%; max-width: 576px; box-shadow: inset 0 2px 4px rgba(46,35,80,.15); }
.pomo-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width 1000ms linear, background-color 300ms ease; }
.pomo-fill.gold { background: var(--star); }
.capsule {
  display: inline-block; border-radius: 999px; padding: 6px 20px; font-weight: 900;
  font-variant-numeric: tabular-nums; line-height: 1; box-shadow: 0 4px 10px rgba(46,35,80,.25);
  background: #2e2350; color: #fff; font-size: 36px;
}
.capsule.gold { background: var(--star); color: #5c4300; font-size: 30px; }
.capsule-label { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--dim); }
.timeup-pill {
  display: inline-block; margin-bottom: 6px; border-radius: 999px; background: var(--star);
  padding: 4px 16px; font-size: 16px; font-weight: 900; color: #5c4300;
  box-shadow: 0 2px 6px rgba(46,35,80,.2);
}

/* tasks */
.tasks-head { display: flex; align-items: baseline; justify-content: space-between; }
.tasks-head .count { font-size: 14px; font-weight: 700; color: var(--dim); }
.banner { margin-top: 8px; border-radius: 12px; padding: 8px 12px; text-align: center; font-size: 14px; font-weight: 700; }
.banner-done { background: #fff6dd; color: #8a6100; }
.banner-active { background: #fff3d6; color: #8a6100; box-shadow: inset 0 0 0 1px var(--star); }
@media (prefers-color-scheme: dark) {
  .banner-done, .banner-active { background: #3a2f10; color: #ffd93d; }
}
.empty-note { margin-top: 16px; text-align: center; font-size: 14px; color: var(--dim); }
.anchor-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--accent-deep); margin: 12px 0 0; }
@media (prefers-color-scheme: dark) { .anchor-head { color: var(--accent); } }
.anchor-head .rule { height: 1px; flex: 1; background: var(--border); }
.anchor-head .frac { font-weight: 500; color: var(--dim); }
.task-list { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
@media (min-width: 1024px) { .task-list { grid-template-columns: 1fr 1fr; } }
.task-scroll { max-height: 544px; overflow-y: auto; padding-right: 4px; }
.task-item { display: flex; align-items: center; gap: 8px; border-radius: 12px; padding: 8px 12px; background: var(--surface2); }
.task-item.done { background: #eef7e8; }
.task-item.started { background: #fff3d6; box-shadow: inset 0 0 0 1px var(--star); flex-wrap: wrap; }
@media (prefers-color-scheme: dark) {
  .task-item.done { background: #22331c; }
  .task-item.started { background: #3a2f10; }
}
.task-main { min-width: 0; flex: 1; }
.task-item.started .task-main { flex-basis: 100%; }
.task-title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-item.done .task-title { color: var(--dim); text-decoration: line-through; }
.task-meta { margin: 0; font-size: 12px; line-height: 1.25; color: var(--dim); }
.check-badge {
  display: flex; height: 32px; width: 32px; flex-shrink: 0; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--grape); font-size: 16px; font-weight: 700; color: #fff;
}
.task-actions { margin-left: auto; display: flex; flex-shrink: 0; align-items: center; gap: 6px; }
.task-btn { height: 36px; border-radius: 999px; padding: 0 16px; font-size: 14px; font-weight: 700; box-shadow: 0 2px 6px rgba(46,35,80,.18); }
.task-btn[disabled] { opacity: .4; box-shadow: none; }

/* wardrobe + rewards */
.ward-grid { margin: 10px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ward-item { border-radius: 16px; background: var(--surface2); padding: 12px; }
.ward-item .name { margin: 0; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ward-item .meta { margin-top: 2px; font-size: 12px; color: var(--dim); }
.ward-item button { margin-top: 8px; width: 100%; border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 700; }
.reward-list { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.reward-item { display: flex; align-items: center; gap: 8px; border-radius: 12px; background: var(--surface2); padding: 8px 12px; }

/* overlays */
.toast {
  position: fixed; bottom: 24px; left: 50%; z-index: 90; width: calc(100% - 32px); max-width: 448px;
  transform: translateX(-50%); border-radius: 999px; background: var(--text); padding: 12px 20px;
  text-align: center; font-size: 16px; font-weight: 700; color: var(--bg); box-shadow: 0 8px 20px rgba(46,35,80,.3);
}
.overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; background: rgba(46,35,80,.8); padding: 24px; }
.overlay.soft { background: rgba(46,35,80,.7); }
.modal { width: 100%; max-width: 384px; border-radius: 32px; background: var(--surface); padding: 24px; text-align: center; }
.modal .meta { font-size: 16px; font-weight: 700; color: var(--dim); margin: 0; }
.modal .big { margin-top: 8px; font-size: 30px; font-weight: 700; line-height: 1.3; }
.modal .sub { margin-top: 8px; font-size: 16px; color: var(--dim); }
.modal .btn { margin-top: 24px; width: 100%; padding: 16px; font-size: 20px; }
.modal .pet-wrap { margin: 0 auto; max-width: 200px; }

/* focus screen */
.focus-screen {
  position: fixed; inset: 0; z-index: 85; display: flex; flex-direction: column; align-items: center;
  overflow-y: auto; background: var(--bg); padding: 32px 24px; color: var(--text);
}
.focus-pause { position: absolute; right: 16px; top: max(16px, env(safe-area-inset-top)); padding: 4px 8px; font-size: 14px; font-weight: 700; color: var(--dim); }
.focus-meta { margin-top: 24px; text-align: center; font-size: 14px; font-weight: 700; color: var(--dim); }
.focus-title { margin: 4px 0 0; max-width: 576px; text-align: center; font-size: 36px; font-weight: 900; line-height: 1.2; }
@media (min-width: 640px) { .focus-title { font-size: 48px; } }
.focus-pet { position: relative; margin-top: 16px; width: min(78vw, 360px); }
.focus-timer { margin-top: 20px; text-align: center; }
.focus-capsule {
  display: inline-flex; flex-direction: column; align-items: center; border-radius: 28px;
  padding: 12px 32px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1;
  box-shadow: 0 8px 20px rgba(46,35,80,.3); background: #2e2350; color: #fff;
}
.focus-capsule.gold { background: var(--star); color: #5c4300; }
.focus-capsule .up { margin-bottom: 4px; font-size: 24px; line-height: 1; }
.focus-capsule .num { font-size: 72px; line-height: 1; }
@media (min-width: 640px) { .focus-capsule .num { font-size: 96px; } }
@media (prefers-color-scheme: dark) { .focus-capsule { background: #fff; color: #2e2350; } .focus-capsule.gold { background: var(--star); color: #5c4300; } }
.focus-bar-wrap { margin-top: 20px; width: 100%; }
.focus-done {
  margin-top: 32px; width: 100%; max-width: 384px; border-radius: 999px; background: var(--grape);
  padding: 20px; font-size: 24px; font-weight: 900; color: #fff; box-shadow: 0 8px 20px rgba(46,35,80,.3);
}
.focus-done[disabled] { opacity: .4; }
.focus-hint { margin: 16px 0 8px; text-align: center; font-size: 14px; font-weight: 700; color: var(--dim); }

/* standby */
.standby {
  position: fixed; inset: 0; z-index: 70; display: flex; cursor: pointer; flex-direction: column;
  align-items: center; justify-content: center; background: var(--bg); padding: 32px 24px; color: var(--text);
}
.standby-clock { margin: 0; font-size: 60px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
@media (min-width: 640px) { .standby-clock { font-size: 72px; } }
.standby-date { margin-top: 8px; font-size: 16px; font-weight: 700; color: var(--dim); }
.standby-pet { position: relative; margin-top: 24px; width: min(68vw, 340px); }
.standby-info { margin-top: 24px; width: 100%; max-width: 384px; text-align: center; }
.standby-next { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.4; }
.standby-next .time { margin-left: 8px; font-size: 16px; font-weight: 700; color: var(--accent-deep); }
.standby-capsule {
  display: inline-block; border-radius: 999px; padding: 6px 16px; font-size: 24px; font-weight: 900;
  font-variant-numeric: tabular-nums; line-height: 1; box-shadow: 0 4px 10px rgba(46,35,80,.25);
  background: #2e2350; color: #fff;
}
.standby-capsule.gold { background: var(--star); color: #5c4300; }
@media (prefers-color-scheme: dark) { .standby-capsule { background: #fff; color: #2e2350; } .standby-capsule.gold { background: var(--star); color: #5c4300; } }
.standby-progress { margin: 8px auto 0; height: 12px; max-width: 320px; }
.standby-hint { margin-top: 32px; font-size: 14px; color: var(--dim); }

/* settings drawer */
.drawer { position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: var(--bg); }
.drawer-main { margin: 0 auto; width: 100%; max-width: 896px; padding: 12px 16px 40px; }
@media (min-width: 1024px) { .drawer-main { padding: 12px 32px 40px; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-head h1 { margin: 0; font-size: 20px; font-weight: 700; }
.last-sync { font-size: 12px; color: var(--dim); white-space: nowrap; }
.offline-badge { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); right: 12px; z-index: 55; padding: 4px 10px; border-radius: 999px; background: rgba(46,35,80,.72); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; }
.tabs { margin-top: 16px; display: flex; gap: 8px; }
.tab { border-radius: 999px; padding: 10px 16px; font-size: 16px; font-weight: 700; background: var(--surface); color: var(--dim); }
.tab.on { background: var(--accent); color: #fff; }
.drawer-body { margin-top: 20px; }
.section { border-radius: 28px; background: var(--surface); padding: 20px; box-shadow: 0 1px 3px rgba(46,35,80,.08); }
.section + .section { margin-top: 20px; }
.section h2 { margin: 0; font-size: 18px; font-weight: 700; }
.section h3 { font-size: 16px; font-weight: 700; }
.section .desc { margin-top: 4px; font-size: 14px; line-height: 1.6; color: var(--dim); }
.mod-cards { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 640px) { .mod-cards { grid-template-columns: repeat(4, 1fr); } }
.mod-card { border-radius: 24px; padding: 12px 16px; text-align: left; background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(46,35,80,.08); }
.mod-card.on { background: var(--accent); color: #fff; }
.mod-card .name { display: block; font-size: 16px; font-weight: 700; }
.mod-card .hint { display: block; font-size: 12px; color: var(--dim); }
.mod-card.on .hint { color: rgba(255,255,255,.8); }
.form-grid { margin-top: 12px; display: grid; gap: 12px; }
@media (min-width: 640px) { .form-grid.cols2 { grid-template-columns: 1fr 1fr; } .form-grid.cols4 { grid-template-columns: repeat(4, 1fr); } .form-grid.cols5 { grid-template-columns: repeat(5, 1fr); } }
.btn-row { margin-top: 16px; display: flex; gap: 12px; flex-wrap: wrap; }
.row-list { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.row-list.scroll { max-height: 416px; overflow-y: auto; padding-right: 4px; }
.row-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-radius: 16px; background: var(--surface2); padding: 8px 12px; }
.row-item .main { min-width: 0; flex: 1; }
.row-item .t { margin: 0; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .s { margin: 0; font-size: 14px; color: var(--dim); }
.row-item .s2 { display: block; font-size: 12px; color: var(--dim); }
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.weekday-picker { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.weekday-btn { height: 44px; width: 44px; border-radius: 999px; font-size: 16px; font-weight: 700; background: var(--surface2); }
.weekday-btn.on { background: var(--accent); color: #fff; }
.switch-row { margin-top: 16px; display: flex; cursor: pointer; align-items: center; gap: 12px; }
.switch-row input { height: 24px; width: 24px; accent-color: var(--accent); }
.switch-row span { font-size: 16px; font-weight: 700; }
.color-row { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 12px; }
.color-field { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.color-field input { height: 40px; width: 48px; cursor: pointer; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); padding: 2px; }
.mood-row { display: flex; align-items: center; gap: 12px; }
.mood-row .k { width: 80px; flex-shrink: 0; font-size: 14px; font-weight: 700; color: var(--dim); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 1024px) { .stat-grid { grid-template-columns: repeat(5, 1fr); } }
.stat-card { border-radius: 24px; background: var(--surface); padding: 16px; box-shadow: 0 1px 3px rgba(46,35,80,.08); }
.stat-card .label { margin: 0; font-size: 14px; font-weight: 700; color: var(--dim); }
.stat-card .value { margin-top: 4px; font-size: 30px; font-weight: 700; }
.stat-card .sub { margin-top: 2px; font-size: 14px; color: var(--dim); }
.week-bars { margin-top: 16px; display: flex; align-items: flex-end; gap: 8px; }
.week-col { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 4px; }
.week-col .n { font-size: 12px; font-weight: 700; color: var(--dim); }
.week-track { display: flex; height: 112px; width: 100%; align-items: flex-end; overflow: hidden; border-radius: 12px; background: var(--surface2); }
.week-fill { width: 100%; background: var(--accent); }
.week-col .d { font-size: 12px; color: var(--dim); }
.audio-preview { margin-top: 8px; width: 100%; }
.rec-note { margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--danger); }
.kv-note { font-size: 15px; line-height: 1.8; }
.kv-note b { color: var(--accent-deep); }
@media (prefers-color-scheme: dark) { .kv-note b { color: var(--accent); } }

/* ================= 宠物花园（统计页） =================
   美术移植自演示版 v2 定版：低饱和暖底、等距菱形土地、黏土植物。
   类名统一 g- 前缀，避免与 App 既有组件撞名。 */
.garden { --g-ink: #4c4237; --g-soft: #8d7f6e; --g-card: #fffdf8; --g-shadow: 0 10px 30px rgba(122,90,50,.13), 0 2px 6px rgba(122,90,50,.08); }
.garden button { font-family: inherit; }
.g-totals { margin: 8px 0 0; font-size: 14px; color: var(--dim); font-weight: 700; }
.g-intro { margin: 6px 0 0; font-size: 13.5px; color: var(--dim); line-height: 1.6; }
.g-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 14px 0 16px; }
.g-seg { display: flex; background: rgba(255,255,255,.72); border: 1px solid rgba(200,175,130,.25); border-radius: 999px; padding: 4px; box-shadow: 0 4px 14px rgba(150,115,60,.08); }
.g-seg-btn { border: 0; background: transparent; padding: 8px 24px; border-radius: 999px; font-size: 15px; font-weight: 700; color: #97836a; cursor: pointer; transition: all .2s; }
.g-seg-btn.on { background: linear-gradient(135deg, #a5c98c, #83ad63); color: #fff; box-shadow: 0 4px 12px rgba(120,160,90,.4); }
.g-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.g-legend span { font-size: 12.5px; color: #8d7c64; display: flex; align-items: center; gap: 5px; }
.g-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.g-scene { display: block; width: 100%; height: auto; }
.garden .iplant { cursor: pointer; transform-box: fill-box; transform-origin: 50% 100%; transition: transform .16s ease; }
.garden .iplant:hover { transform: scale(1.09); }
.garden svg .pit { cursor: pointer; }
.garden svg .pit:hover { filter: brightness(1.14); }
.g-navhead { display: flex; align-items: center; gap: 10px; margin: 0 2px 14px; flex-wrap: wrap; color: var(--g-ink); }
.g-navhead .g-ttl { font-size: 19px; font-weight: 800; }
.g-navhead .g-sub2 { color: var(--g-soft); font-size: 13.5px; }
.g-navbtn { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid rgba(228,213,184,.7); background: rgba(255,255,255,.8); color: #8a7452; font-size: 17px; cursor: pointer; line-height: 1; flex: 0 0 auto; }
.g-navbtn:hover:not(:disabled) { background: #fdf0d3; }
.g-navbtn:disabled { opacity: .35; cursor: default; }
.g-statbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.g-chip { background: rgba(255,255,255,.82); border: 1px solid rgba(190,160,110,.25); border-radius: 999px; padding: 8px 16px; font-size: 14px; color: #6d5b41; box-shadow: 0 3px 10px rgba(150,115,60,.08); display: flex; align-items: center; gap: 7px; }
.g-chip .num { font-size: 19px; font-weight: 800; color: #c07f22; }
.g-chip .dot { width: 9px; height: 9px; border-radius: 50%; }
/* 周视图 */
.g-week { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; padding-bottom: 16px; }
.g-day-card { background: var(--g-card); border-radius: 22px; box-shadow: var(--g-shadow); padding: 12px 11px 10px; position: relative; border: 1px solid rgba(200,170,120,.18); flex: 1 1 300px; max-width: 364px; color: var(--g-ink); }
@media (min-width: 900px) { .g-day-card:nth-child(even) { transform: translateY(14px); } }
.g-day-head { display: flex; align-items: baseline; gap: 6px; margin: 0 2px 7px; cursor: pointer; }
.g-day-head .wd { font-size: 16px; font-weight: 800; }
.g-day-head .dt { font-size: 12px; color: var(--g-soft); }
.g-day-head .cnt { margin-left: auto; font-size: 12.5px; color: #a08a67; }
.g-day-head .cnt b { color: #c07f22; font-size: 15px; }
.g-ribbon { position: absolute; top: -9px; right: 12px; background: linear-gradient(135deg, #ffc95e, #f2a03c); color: #fff; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; box-shadow: 0 4px 10px rgba(240,160,60,.45); letter-spacing: .08em; z-index: 5; }
.g-isle { background: linear-gradient(180deg, #f2f8f1 0%, #e4f0e4 78%, #dcead9 100%); border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(140,170,130,.18), inset 0 -14px 24px rgba(140,170,130,.12); }
/* 日视图 */
.g-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.g-pill { border: 1.5px solid rgba(228,213,184,.7); background: rgba(255,255,255,.85); color: #8a7452; border-radius: 999px; padding: 8px 17px; font-size: 14px; font-weight: 700; cursor: pointer; transition: all .18s; }
.g-pill small { font-weight: 400; color: #b3a186; margin-left: 4px; }
.g-pill.on { background: linear-gradient(135deg, #ffc95e, #f2a03c); border-color: transparent; color: #fff; box-shadow: 0 5px 14px rgba(240,160,60,.35); }
.g-pill.on small { color: #ffedd0; }
.g-cardbox { background: var(--g-card); border-radius: 26px; box-shadow: var(--g-shadow); padding: 20px 20px 16px; border: 1px solid rgba(200,170,120,.18); color: var(--g-ink); }
.g-dv-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.g-dv-head .big { font-size: 23px; font-weight: 800; }
.g-dv-head .sub { color: var(--g-soft); font-size: 14px; }
.g-dv-head .full { margin-left: auto; background: #fdf0d3; color: #b3762a; font-weight: 700; font-size: 13px; padding: 5px 13px; border-radius: 999px; }
.g-dv-wrap { position: relative; }
.g-lulu { position: absolute; right: .5%; bottom: 0; width: 13.5%; min-width: 74px; z-index: 6; pointer-events: none; filter: drop-shadow(0 4px 5px rgba(90,55,20,.18)); }
.g-lulu svg { width: 100%; height: auto; display: block; animation: gBob 3.6s ease-in-out infinite; }
@keyframes gBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.g-bfly { position: absolute; z-index: 5; animation: gFlutter 7s ease-in-out infinite; pointer-events: none; }
@keyframes gFlutter { 0%, 100% { transform: translate(0,0) rotate(-6deg); } 30% { transform: translate(16px,-13px) rotate(7deg); } 60% { transform: translate(-9px,-20px) rotate(-4deg); } }
.g-empty { margin-top: 10px; font-size: 14px; line-height: 1.65; color: var(--g-soft); }
/* 月视图 */
.g-monthcard { background: var(--g-card); border-radius: 26px; box-shadow: var(--g-shadow); padding: 20px 20px 16px; border: 1px solid rgba(200,170,120,.18); }
.g-wdrow { display: flex; justify-content: space-between; padding: 0 11%; margin-bottom: 0; }
.g-wdrow span { font-size: 12.5px; color: #a08a67; font-weight: 700; width: 40px; text-align: center; }
/* 植物小卡 */
.g-backdrop { position: fixed; inset: 0; background: rgba(84,64,40,.28); backdrop-filter: blur(2px); z-index: 80; }
.g-pop { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 0); width: min(400px, calc(100vw - 32px)); background: #fffdf8; border-radius: 24px; box-shadow: 0 24px 60px rgba(90,60,25,.3); z-index: 81; padding: 20px 22px 18px; color: var(--g-ink); }
.g-pop .row { display: flex; gap: 16px; align-items: center; }
.g-pop .mini { width: 86px; flex: 0 0 auto; background: linear-gradient(180deg, #f3e8d2, #e9dcc0); border-radius: 18px; padding: 6px 4px 0; }
.g-pop .mini svg { width: 100%; height: auto; display: block; }
.g-pop h3 { font-size: 19.5px; font-weight: 800; line-height: 1.35; margin: 0; }
.g-pop .plantline { margin-top: 5px; font-size: 13.5px; color: #a1815c; }
.g-pop .facts { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.g-pop .fact { background: #faf4e6; border-radius: 13px; padding: 9px 6px; text-align: center; }
.g-pop .fact .k { font-size: 11.5px; color: #a68f68; }
.g-pop .fact .v { font-size: 15.5px; font-weight: 800; margin-top: 2px; color: #6b5322; }
.g-pop-close { position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; background: #f3ead8; color: #9a825e; font-size: 16px; line-height: 1; }
.g-pop .gentle { margin-top: 12px; font-size: 14px; line-height: 1.65; color: #857453; }
