/* ============================================================
   阳光成长打卡 — 样式表 v1.8「三主题」
   主题：森林秘境 / 樱花物语 / 海洋奇遇，可在顶栏切换
   契约：全部 DOM 结构 / ID / class / data 属性 / 响应式断点与 v1.7 一致
   机制：主色系颜色用 hsl(var(--bh), S%, L%) 表达，主题只切换色相 --bh
   ============================================================ */

/* ---------- 主题令牌：三款主题定义色相与辅助色 ---------- */
:root,
html[data-theme="forest"] {
  --bh: 152;              /* 主色相：森林绿 */
  --mist: #7FD8E8;        /* 晨露蓝 */
  --bloom: #FFB7B2;       /* 花朵粉 */
}
html[data-theme="sakura"] {
  --bh: 340;              /* 主色相：樱花粉 */
  --mist: #C9B8F0;        /* 薰衣草紫 */
  --bloom: #FFD1A9;       /* 蜜桃橙 */
}
html[data-theme="ocean"] {
  --bh: 202;              /* 主色相：海洋蓝 */
  --mist: #8FD6D2;        /* 浅海青 */
  --bloom: #FFC9A3;       /* 珊瑚橙 */
}

:root {
  /* 主色（色相由 --bh 决定，随主题联动） */
  --leaf: hsl(var(--bh), 47%, 46%);
  --leaf-deep: hsl(var(--bh), 50%, 36%);
  --leaf-soft: hsl(var(--bh), 47%, 93%);
  --leaf-border: hsl(var(--bh), 47%, 76%);
  /* 辅助色：阳光黄（三主题通用）；晨露蓝/花朵粉由上方主题块覆盖 */
  --sun: #FFC93C;
  --sun-deep: #E8A317;
  --sun-soft: #FFF4D6;
  /* 文字（深墨色，保证浅底对比度） */
  --ink: hsl(var(--bh), 25%, 23%);
  --ink-2: hsl(var(--bh), 12%, 43%);
  --ink-3: hsl(var(--bh), 11%, 62%);
  /* 背景与材质 */
  --bg: hsl(var(--bh), 43%, 97%);
  --card: rgba(255, 255, 255, .93);
  --line: hsla(var(--bh), 47%, 46%, .16);
  --radius: 26px;
  --radius-sm: 18px;
  --shadow: 0 8px 28px hsla(var(--bh), 50%, 36%, .10);
  --shadow-hover: 0 14px 38px hsla(var(--bh), 50%, 36%, .18);
  --glow: 0 0 18px hsla(var(--bh), 47%, 46%, .22);
  --gap: 16px;
  --nav-w: 78px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* 森林雾霭光晕：薄荷绿 + 晨露蓝 + 暖阳黄 */
  background-image:
    radial-gradient(ellipse 55% 35% at 6% 0%, rgba(127, 216, 232, .20), transparent 70%),
    radial-gradient(ellipse 50% 40% at 96% 8%, rgba(255, 201, 60, .14), transparent 70%),
    radial-gradient(ellipse 60% 45% at 50% 100%, hsla(var(--bh), 47%, 46%, .12), transparent 70%);
  background-attachment: fixed;
  padding-left: var(--nav-w); /* 为左侧固定导航留出空间 */
}

/* 萤火虫微光层：纯装饰、不拦截交互 */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 236, 160, .75) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(160, 235, 190, .6) 0 1.5px, transparent 3px),
    radial-gradient(circle, rgba(255, 255, 255, .8) 0 1px, transparent 2px),
    radial-gradient(ellipse 3px 2px, rgba(255, 183, 178, .7) 0 2px, transparent 3px); /* 飘落花瓣 */
  background-size: 180px 180px, 240px 240px, 130px 130px, 300px 300px;
  background-position: 12px 30px, 80px 120px, 40px 90px, 150px 200px;
  animation: fireflyDrift 26s ease-in-out infinite alternate;
  opacity: .6;
}
@keyframes fireflyDrift {
  from { background-position: 12px 30px, 80px 120px, 40px 90px, 150px 200px; }
  to { background-position: 40px 10px, 40px 160px, 90px 40px, 110px 120px; }
}

button, textarea, input { font-family: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }

.app {
  position: relative; z-index: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 12px;
}

/* ---------------- 顶部栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  /* 森林玻璃拟态 */
  background: linear-gradient(120deg, hsla(var(--bh), 47%, 46%, .94) 0%, hsla(var(--bh), 50%, 36%, .96) 100%);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 20px 16px;
  box-shadow: 0 8px 26px hsla(var(--bh), 50%, 36%, .28);
  border-bottom-left-radius: 26px;
  border-bottom-right-radius: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, .35);
  overflow: hidden;
}
/* 顶栏叶片光斑装饰 */
.topbar::after {
  content: '';
  position: absolute; right: -30px; top: -50px;
  width: 170px; height: 170px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 65%);
  pointer-events: none;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 100%; position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-sun { font-size: 30px; line-height: 1; animation: spin 18s linear infinite; filter: drop-shadow(0 0 8px rgba(255, 236, 160, .7)); }
@keyframes spin { to { transform: rotate(360deg); } }
.brand-text h1 { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: .5px; white-space: nowrap; text-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.brand-text p { font-size: 12px; color: rgba(255, 255, 255, .88); font-weight: 600; }
.sun-balance {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255, 255, 255, .95);
  padding: 7px 14px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .10), inset 0 0 0 1px hsla(var(--bh), 47%, 46%, .25);
}
.sun-balance-icon { font-size: 16px; }
.sun-balance-num { font-weight: 800; font-size: 16px; color: var(--sun-deep); min-width: 16px; text-align: center; }
.sun-balance-label { font-size: 11px; color: #8A6600; font-weight: 700; }
.sun-balance.bump { animation: bump .5s ease; }
@keyframes bump { 0%{transform:scale(1)} 40%{transform:scale(1.18)} 100%{transform:scale(1)} }

/* ---------------- 主内容 ---------------- */
.main { padding: 18px 16px 8px; }
.page { animation: fadeIn .35s cubic-bezier(.22, 1, .36, 1); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* 统一卡片：玻璃质感 + 柔光阴影 + 白边 */
.card {
  position: relative;
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .9);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; min-height: 26px; }
.card-head h3, .section-title { font-size: 16px; font-weight: 800; color: var(--ink); }
.muted { font-size: 12px; color: var(--ink-3); }
.section-title { margin: 4px 2px 12px; }

/* 自定义图片图标 */
.img-icon { display: block; object-fit: contain; }
.task-icon.img-icon { padding: 4px; }
.shop-icon.img-icon, .inv-icon.img-icon { width: 30px; height: 30px; }
.plot-plant.img-icon { width: 52px; height: 52px; }
.proof-emoji.img-icon { width: 28px; height: 28px; }

.duo-grid { display: grid; grid-template-columns: 1fr; gap: var(--gap); margin-bottom: var(--gap); }

/* ---------------- 首页 Hero：森林晨曦 ---------------- */
.hero-card {
  position: relative;
  background: linear-gradient(125deg, hsl(var(--bh), 45%, 91%) 0%, hsl(var(--bh), 43%, 86%) 45%, var(--mist) 100%);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: var(--gap);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: var(--shadow);
  min-height: 132px;
}
/* 藤蔓叶片装饰（CSS 绘制，非 emoji） */
.hero-card::before {
  content: ''; position: absolute; left: -18px; bottom: -30px;
  width: 150px; height: 150px; border-radius: 50%;
  border: 14px solid hsla(var(--bh), 47%, 46%, .13);
  box-shadow: 26px -20px 0 -8px rgba(127, 216, 232, .12);
  pointer-events: none;
}
.hero-card::after {
  content: ''; position: absolute; right: -40px; top: -60px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .55), transparent 70%);
  pointer-events: none;
}
.hero-left { position: relative; z-index: 1; }
.hero-date-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 999px; padding: 4px 6px 4px 11px; margin-bottom: 9px;
  box-shadow: 0 3px 10px hsla(var(--bh), 50%, 36%, .12);
  max-width: 100%;
}
.hero-date-icon { font-size: 14px; line-height: 1; }
.hero-date-full { font-size: 14px; font-weight: 800; color: hsl(var(--bh), 48%, 30%); white-space: nowrap; }
.hero-date-weekday {
  font-size: 12px; font-weight: 800; color: #fff; white-space: nowrap;
  background: linear-gradient(135deg, hsl(var(--bh), 47%, 50%), hsl(var(--bh), 50%, 40%));
  padding: 3px 10px; border-radius: 999px;
  box-shadow: 0 2px 6px hsla(var(--bh), 50%, 36%, .25);
}
.hero-greeting { font-size: 13px; color: var(--leaf-deep); font-weight: 700; margin-bottom: 4px; }
.hero-title { font-size: 21px; font-weight: 800; color: hsl(var(--bh), 55%, 27%); line-height: 1.3; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.hero-sub { font-size: 12px; color: hsl(var(--bh), 34%, 37%); margin-top: 8px; max-width: 300px; }
.hero-deco { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 74px; opacity: .92; filter: drop-shadow(0 6px 12px hsla(var(--bh), 47%, 46%, .25)); z-index: 1; }

.streak-pill {
  background: rgba(255, 255, 255, .82); color: #C2691E; font-size: 12px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 2px 8px hsla(var(--bh), 50%, 36%, .10);
}
.streak-pill b { font-size: 14px; }

.progress-ring-row { display: flex; align-items: center; gap: 18px; }
.ring-wrap { position: relative; width: 112px; height: 112px; flex: 0 0 112px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: hsl(var(--bh), 35%, 92%); stroke-width: 11; }
.ring-fg {
  fill: none; stroke: var(--leaf); stroke-width: 11; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  filter: drop-shadow(0 0 5px hsla(var(--bh), 47%, 46%, .45));
  transition: stroke-dashoffset .8s cubic-bezier(.22, 1, .36, 1);
}
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center b { font-size: 24px; color: var(--leaf-deep); font-weight: 800; }
.ring-center span { font-size: 11px; color: var(--ink-3); }
.progress-info { flex: 1; min-width: 0; }
.progress-count b { font-size: 30px; font-weight: 800; color: var(--ink); }
.progress-count span { font-size: 14px; color: var(--ink-2); }
.progress-count em { font-style: normal; font-weight: 700; }
.progress-info p { color: var(--ink-2); font-size: 13px; margin-top: 6px; }

/* ---------------- 护眼提醒卡 ---------------- */
.eye-card { display: flex; flex-direction: column; }
.eye-card .card-head { margin-bottom: 10px; }
.eye-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.eye-timer {
  font-size: 38px; font-weight: 800; color: var(--leaf-deep);
  font-variant-numeric: tabular-nums; letter-spacing: 1px; line-height: 1.1;
  text-shadow: 0 0 16px hsla(var(--bh), 47%, 46%, .25);
}
.eye-caption { font-size: 12px; color: var(--ink-2); margin: 8px 0 14px; max-width: 240px; }
.eye-actions { display: flex; gap: 8px; }
.eye-btn {
  background: var(--leaf-soft); color: var(--leaf-deep);
  font-size: 12px; font-weight: 700; padding: 8px 14px; border-radius: 999px;
  border: 1px solid hsla(var(--bh), 47%, 46%, .18);
  transition: transform .15s ease, background .2s ease;
}
.eye-btn:hover { background: hsl(var(--bh), 47%, 88%); transform: translateY(-1px); }
.eye-btn-ghost { background: hsl(var(--bh), 26%, 95%); color: var(--ink-2); border-color: transparent; }
.eye-btn-ghost:hover { background: hsl(var(--bh), 23%, 91%); }

/* 开关 */
.switch { position: relative; display: inline-block; width: 44px; height: 25px; flex: 0 0 44px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: hsl(var(--bh), 17%, 84%); border-radius: 999px; transition: .25s; }
.slider::before {
  content: ''; position: absolute; width: 19px; height: 19px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .25s; box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.switch input:checked + .slider { background: linear-gradient(135deg, var(--leaf), var(--leaf-deep)); box-shadow: var(--glow); }
.switch input:checked + .slider::before { transform: translateX(19px); }

/* ---------------- 快捷操作 ---------------- */
.quick-section { margin-bottom: var(--gap); }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--card); border-radius: var(--radius-sm);
  padding: 14px 4px; box-shadow: var(--shadow);
  font-size: 12px; font-weight: 700; color: var(--ink-2);
  border: 1px solid rgba(255, 255, 255, .9);
  transition: transform .18s ease, box-shadow .18s ease;
}
.quick-btn:active { transform: scale(.94); }
.quick-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.quick-icon { font-size: 26px; filter: drop-shadow(0 3px 6px hsla(var(--bh), 47%, 46%, .25)); }

/* ---------------- 统计 ---------------- */
.stat-overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: var(--gap); }
.overview-card {
  background: var(--card); border: 1px solid rgba(255, 255, 255, .9);
  border-radius: var(--radius-sm); padding: 12px 6px; text-align: center; box-shadow: var(--shadow);
  transition: transform .18s ease;
}
.overview-card:hover { transform: translateY(-2px); }
.overview-card b {
  display: block; font-size: 24px; line-height: 1.2; font-weight: 800;
  color: var(--leaf-deep); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px hsla(var(--bh), 47%, 46%, .18);
}
.overview-card span { display: block; margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.stats-card { margin-bottom: var(--gap); }
.stat-tab-row { margin-bottom: 12px; }
.stat-tab-row .segmented { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.stat-tab-row .seg { text-align: center; padding: 8px 4px; font-size: 13px; }
.stat-tab-row .seg.active {
  background: linear-gradient(135deg, var(--leaf), var(--leaf-deep));
  color: #fff; box-shadow: 0 4px 12px hsla(var(--bh), 50%, 36%, .30);
}
.segmented { background: hsl(var(--bh), 27%, 94%); border-radius: 999px; padding: 3px; display: flex; }
.seg { padding: 5px 14px; font-size: 12px; font-weight: 700; color: var(--ink-2); border-radius: 999px; transition: all .2s ease; }
.seg.active { background: #fff; color: var(--leaf-deep); box-shadow: 0 2px 8px hsla(var(--bh), 50%, 36%, .12); }

.stat-datebar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(120deg, hsl(var(--bh), 43%, 96%), var(--mist));
  border-radius: 14px; padding: 8px 10px; margin-bottom: 12px;
  border: 1px solid hsla(var(--bh), 47%, 46%, .12);
}
.date-nav {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  background: #fff; color: var(--leaf-deep); font-size: 20px; line-height: 1;
  box-shadow: 0 2px 8px hsla(var(--bh), 50%, 36%, .14);
  transition: transform .15s ease;
}
.date-nav:hover { background: var(--leaf-soft); transform: scale(1.08); }
.date-nav:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.stat-date-center { text-align: center; flex: 1; min-width: 0; }
.stat-range { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: .2px; }
.stat-today { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-top: 3px; }

.stat-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-box { background: hsl(var(--bh), 37%, 96%); border-radius: 14px; padding: 10px 6px; text-align: center; border: 1px solid hsla(var(--bh), 47%, 46%, .10); }
.stat-box b { display: block; font-size: 24px; color: var(--leaf-deep); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-box span { display: block; font-size: 13px; color: var(--ink-2); font-weight: 600; margin-top: 2px; }

/* 打卡日历：森林嫩芽四级配色 */
.calendar-wrap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-weekday { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 2px 0 4px; }
.cal-cell {
  position: relative; min-height: 58px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: hsl(var(--bh), 26%, 96%); border: 1px solid hsla(var(--bh), 47%, 46%, .07);
  transition: transform .18s ease, box-shadow .18s ease;
}
.cal-cell.blank { background: transparent; border-color: transparent; }
.cal-date { font-size: 15px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.cal-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: var(--leaf-deep); font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px hsla(var(--bh), 50%, 36%, .12);
}
.cal-cell.level-1 { background: hsl(var(--bh), 50%, 93%); }
.cal-cell.level-2 { background: hsl(var(--bh), 47%, 87%); }
.cal-cell.level-3 { background: hsl(var(--bh), 43%, 76%); box-shadow: inset 0 0 12px rgba(255, 255, 255, .4); }
.cal-cell.level-4 { background: linear-gradient(145deg, hsl(var(--bh), 45%, 65%), hsl(var(--bh), 41%, 53%)); }
.cal-cell.level-1 .cal-date { color: hsl(var(--bh), 34%, 37%); }
.cal-cell.level-2 .cal-date { color: hsl(var(--bh), 40%, 30%); }
.cal-cell.level-3 .cal-date { color: hsl(var(--bh), 49%, 24%); }
.cal-cell.level-4 .cal-date { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.cal-cell.level-4 .cal-badge { color: var(--leaf-deep); }
.cal-cell.future { background: hsl(var(--bh), 12%, 97%); }
.cal-cell.future .cal-date { color: hsl(var(--bh), 12%, 76%); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--sun-deep), 0 0 14px rgba(255, 201, 60, .25); }
.cal-cell.clickable { cursor: pointer; }
.cal-cell.clickable:hover { transform: translateY(-3px); box-shadow: 0 8px 18px hsla(var(--bh), 50%, 36%, .20); }
.cal-cell.today.clickable:hover { box-shadow: inset 0 0 0 2px var(--sun-deep), 0 8px 18px rgba(255, 201, 60, .28); }
.calendar-legend {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 14px;
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed hsla(var(--bh), 47%, 46%, .22);
}
.legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.legend-swatch { width: 14px; height: 14px; border-radius: 4px; background: hsl(var(--bh), 26%, 96%); border: 1px solid rgba(0, 0, 0, .05); }
.legend-swatch.level-1 { background: hsl(var(--bh), 50%, 93%); }
.legend-swatch.level-2 { background: hsl(var(--bh), 47%, 87%); }
.legend-swatch.level-3 { background: hsl(var(--bh), 43%, 76%); }
.legend-swatch.level-4 { background: hsl(var(--bh), 42%, 60%); }

/* 当日详情弹窗 */
.day-modal { max-width: 460px; }
.day-modal .modal-body { max-height: 52vh; overflow-y: auto; }
.day-task { padding: 10px 12px; border-radius: 14px; margin-bottom: 8px; background: hsl(var(--bh), 29%, 97%); border-left: 3px solid hsl(var(--bh), 29%, 87%); }
.day-task.done { background: hsl(var(--bh), 43%, 95%); border-left-color: var(--leaf); }
.day-task:last-child { margin-bottom: 0; }
.day-task-head { display: flex; align-items: center; gap: 8px; }
.day-task-icon { font-size: 20px; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.day-task-icon.img-icon { object-fit: contain; }
.day-task-name { font-size: 14px; font-weight: 800; color: var(--ink); flex: 1; }
.day-task-status { font-size: 11px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.day-task.done .day-task-status { color: var(--leaf-deep); }
.day-task-meta { font-size: 12px; color: var(--ink-2); margin-top: 4px; font-variant-numeric: tabular-nums; }
.day-task-note { font-size: 12px; color: var(--ink-2); margin-top: 5px; line-height: 1.5; word-break: break-word; }

@media (max-width: 559px) {
  .stat-overview { grid-template-columns: repeat(2, 1fr); }
  .calendar-wrap { gap: 5px; }
  .cal-cell { min-height: 48px; border-radius: 11px; }
  .cal-date { font-size: 13px; }
  .cal-badge { min-width: 16px; height: 16px; font-size: 9px; }
  .legend-item { font-size: 11px; }
}

.chart { display: flex; align-items: flex-end; gap: 5px; height: 140px; padding-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar {
  width: 100%; max-width: 24px; border-radius: 8px 8px 4px 4px;
  background: hsl(var(--bh), 22%, 92%); min-height: 3px; transition: height .6s cubic-bezier(.22, 1, .36, 1);
}
.chart-bar.has-data { background: linear-gradient(180deg, hsl(var(--bh), 52%, 71%), var(--leaf)); box-shadow: 0 0 12px hsla(var(--bh), 47%, 46%, .25); }
.chart-bar.today { box-shadow: 0 0 0 2px var(--sun-deep), 0 0 12px rgba(255, 201, 60, .3); }
.chart-bar.future { background: hsl(var(--bh), 15%, 95%); }
.chart-label { font-size: 12px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.chart-col.today .chart-label { color: var(--sun-deep); font-weight: 800; }

/* ---------------- 历史 ---------------- */
.history-card { margin-bottom: var(--gap); }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: hsl(var(--bh), 33%, 96%); border-radius: 14px; border: 1px solid hsla(var(--bh), 47%, 46%, .10); }
.history-item.expandable { flex-wrap: wrap; cursor: pointer; }
.history-item.expandable:hover { background: hsl(var(--bh), 40%, 94%); transform: translateX(2px); }
.history-date { font-size: 13px; font-weight: 700; flex: 1; }
.history-date small { display: block; color: var(--ink-2); font-weight: 500; font-size: 12px; }
.history-rate { font-size: 13px; font-weight: 800; color: var(--leaf-deep); }
.history-mini-bar { width: 60px; height: 6px; background: hsl(var(--bh), 22%, 89%); border-radius: 999px; overflow: hidden; }
.history-mini-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--leaf), hsl(var(--bh), 53%, 67%)); border-radius: 999px; }
.history-detail { display: none; flex: 0 0 100%; margin-top: 8px; padding-top: 8px; border-top: 1px dashed hsla(var(--bh), 47%, 46%, .25); }
.history-item.expanded .history-detail { display: block; }
.history-task { display: flex; justify-content: space-between; gap: 10px; padding: 3px 2px; font-size: 12px; color: var(--ink-2); }
.history-task b { color: var(--leaf-deep); font-weight: 700; white-space: nowrap; }
.empty-tip { text-align: center; color: var(--ink-3); font-size: 13px; padding: 22px 0; }

/* ---------------- 今日任务顶部 ---------------- */
.task-top { display: flex; align-items: center; gap: 16px; margin-bottom: var(--gap); }
.task-top-left { flex: 0 0 auto; }
.task-top-label { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.task-top-count b { font-size: 30px; font-weight: 800; color: var(--ink); }
.task-top-count span, .task-top-count em { font-size: 14px; color: var(--ink-2); font-style: normal; }
.task-top-mid { flex: 1; min-width: 0; }
.bar-wrap { height: 12px; background: hsl(var(--bh), 26%, 92%); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--leaf), hsl(var(--bh), 57%, 72%)); box-shadow: 0 0 12px hsla(var(--bh), 47%, 46%, .4); transition: width .6s cubic-bezier(.22, 1, .36, 1); }
.bar-caption { font-size: 12px; color: var(--ink-2); margin-top: 6px; text-align: right; }
.bar-caption b { color: var(--leaf-deep); }
.task-top-right { flex: 0 0 auto; }
.streak-box { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .9); border: 1px solid hsla(var(--bh), 47%, 46%, .15); border-radius: 16px; padding: 8px 12px; box-shadow: var(--shadow); }
.streak-box > span { font-size: 22px; }
.streak-box b { font-size: 20px; color: #C2691E; display: block; line-height: 1; }
.streak-box small { font-size: 10px; color: var(--ink-2); }

/* ---------------- 任务卡片 ---------------- */
.task-list { display: flex; flex-direction: column; gap: 12px; }
.task-card {
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 2px solid rgba(255, 255, 255, .9);
  display: flex;
  gap: 14px;
  transition: transform .2s ease, box-shadow .2s ease, background .3s ease, border-color .3s ease;
}
.task-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.task-card.done { background: linear-gradient(120deg, hsl(var(--bh), 45%, 94%), hsl(var(--bh), 46%, 93%)); border-color: var(--leaf-border); box-shadow: var(--shadow), 0 0 20px hsla(var(--bh), 47%, 46%, .12); }
.task-icon {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 17px;
  display: grid; place-items: center; font-size: 27px; background: hsl(var(--bh), 36%, 96%);
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, .8);
}
.task-card.done .task-icon { background: #fff; box-shadow: var(--glow); }
.task-main { flex: 1; min-width: 0; }
.task-title-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.task-name { font-size: 16px; font-weight: 800; }
.task-subtitle { font-size: 11px; color: var(--ink-3); }
.task-meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.tag-time { background: #E4F4F8; color: #3E8FA8; }
.tag-sun { background: var(--sun-soft); color: #C88A00; }
.tag-proof { background: #F3ECFB; color: #8A63C9; }
.tag-range { background: hsl(var(--bh), 47%, 91%); color: var(--leaf-deep); white-space: nowrap; }
.task-desc { font-size: 12px; color: var(--ink-2); margin-top: 8px; line-height: 1.5; }
.task-proof-note {
  margin-top: 8px; padding: 8px 10px; background: rgba(255, 255, 255, .78);
  border-radius: 12px; font-size: 12px; color: var(--ink-2);
  border-left: 3px solid var(--leaf-border);
}
.proof-thumbs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.proof-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; border: 1px solid hsla(var(--bh), 47%, 46%, .25); }

.check-btn {
  width: 36px; height: 36px; flex: 0 0 36px; align-self: center;
  border-radius: 50%; border: 2.5px solid hsl(var(--bh), 22%, 81%); background: #fff;
  display: grid; place-items: center; color: #fff; font-size: 18px;
  transition: all .22s ease;
}
.check-btn:hover { border-color: var(--leaf); box-shadow: var(--glow); transform: scale(1.08); }
.check-btn.checked {
  background: linear-gradient(135deg, var(--leaf), var(--leaf-deep));
  border-color: var(--leaf);
  box-shadow: 0 4px 14px hsla(var(--bh), 50%, 36%, .4), 0 0 18px hsla(var(--bh), 47%, 46%, .35);
  animation: pop .4s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes pop { 0%{transform:scale(.5)} 60%{transform:scale(1.2)} 100%{transform:scale(1)} }
.task-action-hint { font-size: 10px; color: var(--ink-3); text-align: center; margin-top: 4px; width: 36px; flex: 0 0 36px; word-break: keep-all; }
.task-right { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.task-tip { text-align: center; font-size: 12px; color: var(--ink-3); padding: 8px 12px 20px; }

/* ---------------- 花园页 ---------------- */
.garden-hero {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(125deg, hsl(var(--bh), 59%, 91%) 0%, hsl(var(--bh), 46%, 89%) 50%, hsl(var(--bh), 53%, 92%) 100%);
  border: 1px solid rgba(255, 255, 255, .8); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: var(--gap); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.garden-hero::after {
  content: ''; position: absolute; right: -20px; bottom: -40px;
  width: 130px; height: 130px; border-radius: 50%;
  border: 12px solid hsla(var(--bh), 47%, 46%, .10); pointer-events: none;
}
.garden-hero-icon { font-size: 42px; filter: drop-shadow(0 4px 8px hsla(var(--bh), 47%, 46%, .3)); }
.garden-hero h2 { font-size: 18px; font-weight: 800; color: hsl(var(--bh), 46%, 34%); }
.garden-hero p { font-size: 12px; color: hsl(var(--bh), 27%, 43%); margin-top: 3px; }
#page-garden .card { margin-bottom: var(--gap); }

.garden-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plot {
  aspect-ratio: 1 / .9;
  border-radius: 18px;
  background: linear-gradient(180deg, hsl(var(--bh), 56%, 94%) 0%, hsl(var(--bh), 55%, 86%) 100%);
  border: 2px dashed hsl(var(--bh), 45%, 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; position: relative; transition: transform .2s ease, box-shadow .2s ease;
}
.plot.empty { cursor: pointer; }
.plot.empty:hover { border-color: var(--leaf); box-shadow: var(--glow); }
.plot.empty:active { transform: scale(.95); }
.plot.filled { border-style: solid; border-color: var(--leaf-border); background: linear-gradient(180deg, hsl(var(--bh), 64%, 95%) 0%, hsl(var(--bh), 58%, 86%) 100%); box-shadow: inset 0 2px 12px rgba(255, 255, 255, .6); }
.plot-plant { font-size: 38px; line-height: 1; animation: sprout .6s cubic-bezier(.34, 1.56, .64, 1); filter: drop-shadow(0 4px 6px hsla(var(--bh), 50%, 36%, .2)); }
@keyframes sprout { from { transform: scale(0) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.plot-name { font-size: 11px; font-weight: 700; color: hsl(var(--bh), 24%, 38%); }
.plot-add { font-size: 24px; color: hsl(var(--bh), 36%, 57%); }
.plot-add-label { font-size: 10px; color: hsl(var(--bh), 25%, 48%); font-weight: 700; }
.plot-remove {
  position: absolute; top: 4px; right: 6px; font-size: 12px; color: hsl(var(--bh), 22%, 60%);
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
}
.plot-remove:hover { background: rgba(255, 255, 255, .7); color: #C0392B; }

.inventory-grid { display: flex; flex-wrap: wrap; gap: 10px; min-height: 44px; }
.inv-item {
  display: flex; align-items: center; gap: 6px; background: hsl(var(--bh), 33%, 96%);
  border: 1px solid hsla(var(--bh), 47%, 46%, .16); border-radius: 999px; padding: 8px 14px;
  cursor: pointer; transition: transform .18s ease, background .2s ease, box-shadow .2s ease;
}
.inv-item:hover { background: var(--leaf-soft); box-shadow: var(--glow); transform: translateY(-2px); }
.inv-item:active { transform: scale(.95); }
.inv-icon { font-size: 22px; }
.inv-name { font-size: 13px; font-weight: 700; }
.inv-count { font-size: 11px; color: var(--ink-3); }

.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.shop-item { display: flex; align-items: center; gap: 10px; background: hsl(var(--bh), 33%, 96%); border-radius: 16px; padding: 10px; border: 1px solid hsla(var(--bh), 47%, 46%, .14); transition: transform .18s ease, box-shadow .18s ease; }
.shop-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.shop-icon { font-size: 30px; flex: 0 0 auto; }
.shop-info { flex: 1; min-width: 0; }
.shop-name { font-size: 13px; font-weight: 800; }
.shop-own { font-size: 11px; color: var(--ink-3); }
.buy-btn {
  background: linear-gradient(135deg, var(--sun), #FFDB73); color: #7A5200; font-weight: 800; font-size: 12px;
  padding: 7px 10px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(255, 201, 60, .3);
  transition: transform .15s ease, filter .15s ease;
}
.buy-btn:hover { filter: brightness(1.05); }
.buy-btn:active { transform: scale(.94); }
.buy-btn:disabled { background: hsl(var(--bh), 15%, 92%); color: var(--ink-3); cursor: not-allowed; box-shadow: none; }

/* ---------------- 成就面板 ---------------- */
.achievement-card {
  position: relative; overflow: hidden;
  background: linear-gradient(125deg, hsl(var(--bh), 50%, 93%) 0%, hsl(var(--bh), 43%, 90%) 45%, #FFF3D2 100%);
  border: 1px solid rgba(255, 255, 255, .8); border-radius: var(--radius);
  padding: 20px; margin-bottom: var(--gap); box-shadow: var(--shadow);
}
.achievement-card::after {
  content: ''; position: absolute; right: -30px; bottom: -50px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .5), transparent 70%); pointer-events: none;
}
.ach-top { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.trophy {
  width: 76px; height: 76px; flex: 0 0 76px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); display: grid; place-items: center; font-size: 42px;
  box-shadow: 0 6px 18px hsla(var(--bh), 50%, 36%, .22), inset 0 2px 6px #fff;
  border: 2px solid rgba(255, 255, 255, .9);
}
.ach-info { flex: 1; min-width: 0; }
.ach-kicker { font-size: 12px; color: var(--leaf-deep); font-weight: 700; }
.ach-title { font-size: 22px; font-weight: 800; color: hsl(var(--bh), 51%, 28%); margin: 2px 0 4px; }
.ach-desc { font-size: 13px; color: hsl(var(--bh), 32%, 37%); }
.ach-desc b { font-size: 16px; color: var(--leaf-deep); }
.ach-bar { height: 8px; background: rgba(255, 255, 255, .8); border-radius: 999px; margin-top: 10px; overflow: hidden; }
.ach-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--leaf), hsl(var(--bh), 57%, 72%)); border-radius: 999px; transition: width .7s cubic-bezier(.22, 1, .36, 1); box-shadow: 0 0 10px hsla(var(--bh), 47%, 46%, .4); }
.ach-sparkles { position: absolute; right: 14px; top: 10px; font-size: 22px; opacity: .7; }

/* ---------------- 勋章 ---------------- */
#page-rewards .card { margin-bottom: var(--gap); }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 8px; }
.badge-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.badge-medal {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center; font-size: 34px;
  background: linear-gradient(145deg, #FFE9A0, var(--sun));
  box-shadow: 0 6px 16px rgba(232, 163, 23, .32), 0 0 18px rgba(255, 201, 60, .25), inset 0 2px 6px rgba(255,255,255,.7);
  border: 3px solid #fff; position: relative;
  animation: medalIn .5s cubic-bezier(.34, 1.56, .64, 1) backwards;
}
.badge-medal.locked { background: hsl(var(--bh), 14%, 93%); box-shadow: none; border-color: hsl(var(--bh), 16%, 96%); filter: grayscale(1); opacity: .55; }
@keyframes medalIn { from { transform: scale(.6) rotate(-15deg); opacity: 0; } to { transform: none; opacity: 1; } }
.badge-name { font-size: 12px; font-weight: 800; color: var(--ink); }
.badge-item.locked .badge-name { color: var(--ink-3); }
.badge-desc { font-size: 10px; color: var(--ink-3); line-height: 1.3; }
.reward-tip { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.goto-garden-btn { width: 100%; margin-top: 14px; }

/* ---------------- 左侧导航（森林精灵侧栏） ---------------- */
.bottom-nav {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--nav-w);
  background: linear-gradient(168deg, rgba(255,255,255,.97) 0%, rgba(238,250,243,.96) 58%, rgba(232,246,255,.94) 100%);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border-top: none; border-right: 1px solid hsla(var(--bh), 47%, 46%, .16);
  display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 8px calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  box-shadow: 4px 0 26px hsla(var(--bh), 50%, 36%, .11);
  overflow-y: auto; overflow-x: hidden;
}
/* 品牌徽章头部 */
.nav-brand {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 4px 0 14px; margin-bottom: 12px;
  border-bottom: 1px dashed hsla(var(--bh), 47%, 46%, .24);
}
.nav-brand-badge {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(145deg, hsl(var(--bh), 56%, 95%), hsl(var(--bh), 48%, 88%));
  border: 2px solid rgba(255,255,255,.95);
  box-shadow: 0 4px 12px hsla(var(--bh), 47%, 46%, .24), 0 0 16px rgba(127,216,232,.28), inset 0 2px 5px rgba(255,255,255,.9);
  animation: navBadgeFloat 4s ease-in-out infinite;
}
@keyframes navBadgeFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.nav-brand-texts { display: flex; flex-direction: column; align-items: center; }
.nav-brand-name { font-size: 12px; font-weight: 900; color: var(--leaf-deep); letter-spacing: .5px; white-space: nowrap; }
.nav-brand-sub { display: none; font-size: 10px; color: var(--ink-3); margin-top: 1px; }
/* 导航项分组 */
.nav-links { display: flex; flex-direction: column; gap: 7px; }
.nav-item {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 9px 2px 8px; border-radius: 16px;
  font-size: 11px; color: var(--ink-2); font-weight: 700; position: relative;
  text-align: center;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), background .25s ease, color .25s ease, box-shadow .25s ease;
}
.nav-icon {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(145deg, #FFFFFF, hsl(var(--bh), 30%, 96%));
  box-shadow: 0 2px 8px hsla(var(--bh), 50%, 36%, .09), inset 0 0 0 1px rgba(255,255,255,.8);
  transition: all .25s ease;
}
.nav-label { line-height: 1.2; }
.nav-item:hover { transform: translateY(-2px); color: var(--leaf-deep); }
.nav-item:hover .nav-icon { background: var(--leaf-soft); }
.nav-item.active {
  color: var(--leaf-deep);
  background: linear-gradient(135deg, rgba(230,246,237,.95), rgba(214,240,226,.92));
  box-shadow: inset 0 0 0 1px hsla(var(--bh), 47%, 46%, .22), 0 4px 14px hsla(var(--bh), 50%, 36%, .13);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%; width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--mist), var(--leaf));
  box-shadow: 0 0 8px hsla(var(--bh), 47%, 46%, .55);
}
.nav-item.active .nav-icon {
  background: #FFFFFF;
  box-shadow: 0 0 0 2px var(--leaf-soft), 0 4px 12px hsla(var(--bh), 50%, 36%, .22), 0 0 16px hsla(var(--bh), 47%, 46%, .32);
  transform: translateY(-1px) scale(1.05);
}
.nav-dot { position: absolute; top: 5px; right: 9px; width: 9px; height: 9px; background: #FF6B6B; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 8px rgba(255,107,107,.6); }
/* 底部鼓励语 */
.nav-footer {
  margin-top: auto; padding-top: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border-top: 1px dashed hsla(var(--bh), 47%, 46%, .24);
}
.nav-footer-sprout { font-size: 18px; filter: drop-shadow(0 2px 5px hsla(var(--bh), 47%, 46%, .3)); }
.nav-footer-text { display: none; font-size: 10px; color: var(--ink-3); text-align: center; line-height: 1.4; }
@media (prefers-reduced-motion: reduce) {
  .nav-brand-badge { animation: none; }
}

/* ---------------- 主题切换器 ---------------- */
.topbar-right { display: flex; align-items: center; gap: 8px; }
.theme-btn {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .38);
  display: grid; place-items: center;
  transition: transform .18s ease, background .2s ease;
}
.theme-btn:hover { background: rgba(255, 255, 255, .32); transform: rotate(-12deg) scale(1.06); }
.theme-btn:active { transform: scale(.92); }
.theme-btn-icon { font-size: 18px; line-height: 1; filter: drop-shadow(0 1px 3px rgba(0,0,0,.18)); }

.theme-popover {
  position: fixed; z-index: 60;
  top: calc(60px + env(safe-area-inset-top, 0px));
  right: 14px; width: 274px;
  background: var(--card);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-radius: 22px; padding: 16px;
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 18px 48px hsla(var(--bh), 50%, 24%, .26);
  animation: themePopIn .26s cubic-bezier(.22, 1, .36, 1);
}
@keyframes themePopIn { from { opacity: 0; transform: translateY(-10px) scale(.95); } to { opacity: 1; transform: none; } }
.theme-pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.theme-pop-title { font-size: 15px; font-weight: 800; color: var(--ink); }
.theme-pop-close { width: 26px; height: 26px; border-radius: 50%; font-size: 19px; color: var(--ink-3); line-height: 1; transition: background .2s ease; }
.theme-pop-close:hover { background: var(--leaf-soft); }
.theme-options { display: flex; flex-direction: column; gap: 8px; }
.theme-option {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 11px; border-radius: 14px; text-align: left;
  background: hsl(var(--bh), 30%, 97%);
  border: 2px solid transparent;
  transition: border-color .2s ease, background .2s ease, transform .15s ease;
}
.theme-option:hover { transform: translateX(2px); background: var(--leaf-soft); }
.theme-option.active { border-color: var(--leaf); background: var(--leaf-soft); }
.theme-swatches { display: inline-flex; flex: 0 0 auto; }
.theme-swatches i { width: 18px; height: 30px; display: block; border: 1.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.theme-swatches i:first-child { border-radius: 9px 0 0 9px; }
.theme-swatches i:last-child { border-radius: 0 9px 9px 0; }
.sw-forest i:nth-child(1) { background: #3FAE7D; }
.sw-forest i:nth-child(2) { background: #A7DFC2; }
.sw-forest i:nth-child(3) { background: #7FD8E8; }
.sw-sakura i:nth-child(1) { background: #F2789F; }
.sw-sakura i:nth-child(2) { background: #FFC4D6; }
.sw-sakura i:nth-child(3) { background: #C9B8F0; }
.sw-ocean i:nth-child(1) { background: #3E9BC9; }
.sw-ocean i:nth-child(2) { background: #A7DDEF; }
.sw-ocean i:nth-child(3) { background: #8FD6D2; }
.theme-option-name { flex: 1; font-size: 14px; font-weight: 700; color: var(--ink); }
.theme-check { font-size: 15px; font-weight: 800; color: var(--leaf-deep); opacity: 0; transition: opacity .2s ease; }
.theme-option.active .theme-check { opacity: 1; }
.theme-pop-hint { font-size: 11px; color: var(--ink-3); margin-top: 12px; text-align: center; line-height: 1.4; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(28, 58, 42, .48);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; backdrop-filter: blur(5px);
}
.modal {
  background: linear-gradient(160deg, #FFFFFF 0%, hsl(var(--bh), 33%, 98%) 100%);
  border-radius: 26px; width: 100%; max-width: 420px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 70px rgba(24, 70, 48, .32);
  border: 1px solid rgba(255, 255, 255, .9);
  animation: modalIn .32s cubic-bezier(.22, 1, .36, 1);
}
@keyframes modalIn { from { transform: translateY(24px) scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 12px; border-bottom: 1px solid hsla(var(--bh), 47%, 46%, .14); }
.modal-title { display: flex; align-items: center; gap: 10px; }
.modal-task-icon { font-size: 28px; }
.modal-title h3 { font-size: 17px; font-weight: 800; }
.modal-title p { font-size: 12px; color: var(--ink-3); }
.modal-close { font-size: 16px; color: var(--ink-3); width: 30px; height: 30px; border-radius: 50%; transition: background .2s ease; }
.modal-close:hover { background: var(--leaf-soft); }
.modal-body { padding: 16px 18px; }
.field-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.field-hint { font-size: 11px; color: var(--ink-3); margin: 6px 0 16px; }
.time-section { margin-bottom: 18px; padding: 12px; background: hsl(var(--bh), 40%, 96%); border: 1px solid hsla(var(--bh), 47%, 46%, .20); border-radius: 16px; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-label-row .field-label { margin-bottom: 0; }
.time-now-btn { border: 1px solid hsla(var(--bh), 47%, 46%, .28); background: #fff; color: var(--leaf-deep); font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: background .2s ease; }
.time-now-btn:hover { background: var(--leaf-soft); }
.time-range-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.time-input { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; color: var(--ink); padding: 9px 10px; border: 1.5px solid hsla(var(--bh), 47%, 46%, .28); border-radius: 12px; background: #fff; font-family: inherit; }
.time-input:focus { outline: none; border-color: var(--leaf); box-shadow: var(--glow); }
.time-sep { font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.time-section .field-hint { margin: 7px 0 0; }
.upload-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.upload-thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; position: relative; }
.upload-thumb i {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%;
  background: #E4574C; color: #fff; font-size: 11px; display: grid; place-items: center; cursor: pointer; font-style: normal;
}
.upload-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 2px dashed hsla(var(--bh), 47%, 46%, .35); border-radius: 14px; padding: 10px 16px;
  font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.upload-btn:hover { border-color: var(--leaf); color: var(--leaf-deep); background: var(--leaf-soft); }
textarea {
  width: 100%; border: 1.5px solid hsla(var(--bh), 47%, 46%, .24); border-radius: 14px;
  padding: 12px; font-size: 14px; resize: vertical; outline: none; transition: border-color .2s ease, box-shadow .2s ease;
}
textarea:focus { border-color: var(--leaf); box-shadow: var(--glow); }
.char-count { text-align: right; font-size: 11px; color: var(--ink-3); }
.modal-foot { display: flex; gap: 10px; padding: 14px 18px 18px; border-top: 1px solid hsla(var(--bh), 47%, 46%, .14); }
.btn { flex: 1; padding: 12px; border-radius: 14px; font-size: 14px; font-weight: 800; transition: transform .15s ease, box-shadow .2s ease; }
.btn-ghost { background: hsl(var(--bh), 24%, 94%); color: var(--ink-2); }
.btn-ghost:hover { background: hsl(var(--bh), 23%, 91%); }
.btn-primary { background: linear-gradient(135deg, var(--leaf), var(--leaf-deep)); color: #fff; box-shadow: 0 5px 16px hsla(var(--bh), 50%, 36%, .32); }
.btn-primary:hover { box-shadow: 0 7px 22px hsla(var(--bh), 50%, 36%, .42); }
.btn-primary:active { transform: scale(.97); }

/* 护眼提醒弹窗 */
.eye-modal { max-width: 360px; text-align: center; padding: 26px 22px 22px; }
.eye-modal-icon { font-size: 62px; animation: eyePulse 1.8s ease-in-out infinite; filter: drop-shadow(0 0 14px hsla(var(--bh), 47%, 46%, .35)); }
@keyframes eyePulse { 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.1); } }
.eye-modal h3 { font-size: 20px; font-weight: 800; margin: 12px 0 8px; color: var(--ink); }
.eye-modal p { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin-bottom: 20px; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%);
  background: linear-gradient(135deg, hsla(var(--bh), 50%, 36%, .96), rgba(36, 110, 78, .96));
  color: #fff;
  padding: 12px 22px; border-radius: 999px; font-size: 14px; font-weight: 600;
  z-index: 200; box-shadow: 0 10px 28px rgba(24, 70, 48, .3);
  max-width: 88%; text-align: center; animation: toastIn .3s cubic-bezier(.22, 1, .36, 1);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px) scale(.95); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

/* ============================================================
   自适应：平板（>=560px）
   ============================================================ */
@media (min-width: 560px) {
  .app { max-width: 760px; }
  .duo-grid { grid-template-columns: 1fr 1fr; }
  .badge-medal { width: 84px; height: 84px; font-size: 40px; }
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   自适应：桌面（>=900px）— 左侧导航加宽 + 双栏
   ============================================================ */
@media (min-width: 900px) {
  :root { --nav-w: 208px; }
  .app { max-width: 1080px; }
  .topbar { border-radius: 0 0 30px 30px; padding: 16px 32px; }
  .brand-text h1 { font-size: 20px; }
  .main { padding: 24px 32px; }
  .duo-grid { grid-template-columns: 1fr 1fr; }

  .bottom-nav { padding: 20px 14px; }
  .nav-brand { flex-direction: row; gap: 10px; padding: 4px 6px 20px; margin-bottom: 14px; }
  .nav-brand-badge { width: 46px; height: 46px; font-size: 25px; flex: 0 0 auto; }
  .nav-brand-texts { align-items: flex-start; }
  .nav-brand-name { font-size: 15px; }
  .nav-brand-sub { display: block; }
  .nav-links { gap: 8px; }
  .nav-item {
    flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 10px 12px; border-radius: 16px; font-size: 14px;
  }
  .nav-icon { width: 40px; height: 40px; font-size: 21px; border-radius: 12px; flex: 0 0 auto; }
  .nav-item.active::before { top: 18%; bottom: 18%; }
  .nav-dot { top: 50%; right: 12px; transform: translateY(-50%); }
  .nav-footer { flex-direction: row; gap: 8px; padding-top: 14px; }
  .nav-footer-text { display: block; font-size: 11px; }

  /* 首页：进度+护眼双栏，统计与历史双栏对齐 */
  #page-home { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; }
  #page-home .hero-card, #page-home .quick-section,
  #page-home .duo-grid, #page-home .stats-card, #page-home .history-card { grid-column: 1 / -1; }
  #page-home .duo-grid { margin-bottom: 0; }
  #page-home .stats-card, #page-home .history-card { margin-bottom: 0; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }

  /* 任务双栏 */
  #page-tasks .task-top { margin-bottom: 18px; }
  .task-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .task-tip { grid-column: 1 / -1; }

  /* 花园：分栏统一由 #garden-mine 处理（见文件末尾栅格修正），避免重复 grid 规则互相打架 */
  .shop-grid { grid-template-columns: repeat(4, 1fr); }

  /* 奖励：勋章全宽 */
  #page-rewards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; }
  #page-rewards .achievement-card, #page-rewards #badges-section { grid-column: 1 / -1; }
  #page-rewards .card { margin-bottom: 0; }
}

@media (min-width: 1200px) {
  .app { max-width: 1180px; }
}

/* 尊重系统的减少动效设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============================================================
   v2.0 多用户扩展：登录 / 用户chip / 排行榜 / 后台 / 好友花园
   全部使用 --bh 主题色相令牌，三主题通用
   ============================================================ */

/* ---------- 顶栏用户 chip ---------- */
.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px; padding: 3px 10px 3px 3px; color: #fff; font-weight: 700;
  font-size: 12px; cursor: pointer; transition: background .2s ease, transform .18s ease;
}
.user-chip:hover { background: rgba(255,255,255,.3); transform: translateY(-1px); }
.user-chip-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.9);
  font-size: 15px; line-height: 1;
}
.user-chip-name { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 登录页 ---------- */
.login-screen {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 20% 15%, hsl(var(--bh), 55%, 88%), transparent 45%),
              radial-gradient(circle at 85% 85%, hsla(200, 80%, 82%, .7), transparent 45%),
              hsl(var(--bh), 43%, 96%);
}
.login-card {
  width: 100%; max-width: 460px; background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.9); border-radius: 30px;
  padding: 30px 24px 22px; box-shadow: 0 20px 60px hsla(var(--bh), 50%, 30%, .18);
  text-align: center; max-height: 92vh; overflow-y: auto;
}
.login-logo-sun { font-size: 52px; display: block; filter: drop-shadow(0 6px 12px hsla(42,95%,55%,.4)); }
.login-logo h1 { font-size: 24px; margin: 6px 0 4px; color: hsl(var(--bh), 50%, 32%); }
.login-logo p { font-size: 13px; color: var(--ink-2); margin-bottom: 20px; }
.login-users { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.login-user {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; padding: 6px;
  border-radius: 16px; transition: transform .18s ease, background .2s ease;
}
.login-user:hover { transform: translateY(-3px); background: hsl(var(--bh), 47%, 95%); }
.login-user-avatar {
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 30px; box-shadow: 0 4px 14px hsla(var(--bh), 50%, 36%, .18);
  border: 3px solid #fff;
}
.login-user-name { font-size: 12px; font-weight: 700; color: var(--ink); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-user-sim { font-size: 10px; color: var(--ink-3); }
.login-pin-box { margin-top: 18px; }
.login-pin-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin-bottom: 18px; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid hsl(var(--bh), 47%, 70%); background: #fff; transition: all .15s ease; }
.pin-dot.filled { background: hsl(var(--bh), 47%, 46%); border-color: hsl(var(--bh), 47%, 46%); transform: scale(1.1); }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 260px; margin: 0 auto; }
.pin-key {
  padding: 12px 0; font-size: 20px; font-weight: 700; color: hsl(var(--bh), 50%, 36%);
  background: hsl(var(--bh), 47%, 95%); border: 1px solid hsl(var(--bh), 47%, 86%);
  border-radius: 14px; cursor: pointer; transition: transform .12s ease, background .2s ease;
}
.pin-key:hover { background: hsl(var(--bh), 47%, 90%); }
.pin-key:active { transform: scale(.94); }
.pin-key.fn { font-size: 14px; color: var(--ink-2); background: transparent; border-color: transparent; }
.login-error { min-height: 18px; color: #E4574C; font-size: 12px; font-weight: 700; margin: 8px 0; }
.login-foot { margin-top: 16px; font-size: 11px; color: var(--ink-3); }

/* ---------- 分段切换（花园模式） ---------- */
.garden-mode-tabs { margin-bottom: var(--gap); }

/* ---------- 好友花园 ---------- */
.friend-picker { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; margin-bottom: 4px; }
.friend-chip {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: #fff; border: 2px solid hsl(var(--bh), 47%, 88%); border-radius: 16px;
  padding: 8px 12px; cursor: pointer; min-width: 66px; transition: all .2s ease;
}
.friend-chip:hover { border-color: hsl(var(--bh), 47%, 60%); transform: translateY(-2px); }
.friend-chip.active { border-color: hsl(var(--bh), 47%, 46%); background: hsl(var(--bh), 47%, 95%); box-shadow: 0 0 0 3px hsla(var(--bh), 47%, 46%, .15); }
.friend-chip-av { font-size: 26px; line-height: 1; }
.friend-chip-name { font-size: 11px; font-weight: 700; color: var(--ink); }
.friend-garden-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.friend-meta-pill { background: hsl(var(--bh), 47%, 95%); color: hsl(var(--bh), 50%, 32%); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }

/* ---------- 排行榜 ---------- */
.lb-hero, .admin-hero {
  display: flex; align-items: center; gap: 14px; margin-bottom: var(--gap);
  background: linear-gradient(125deg, hsl(var(--bh), 45%, 91%), hsl(var(--bh), 43%, 87%));
  border-radius: var(--radius); padding: 18px 20px; border: 1px solid rgba(255,255,255,.75);
  box-shadow: var(--shadow);
}
.lb-hero-icon, .admin-hero-icon { font-size: 42px; filter: drop-shadow(0 4px 8px hsla(var(--bh),50%,36%,.25)); }
.lb-hero h2, .admin-hero h2 { font-size: 19px; color: hsl(var(--bh), 55%, 27%); margin: 0 0 3px; }
.lb-hero p, .admin-hero p { font-size: 12px; color: var(--ink-2); margin: 0; }
.lb-podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin: 20px 0 22px; min-height: 120px; }
.podium-item { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; max-width: 110px; }
.podium-rank { font-size: 20px; }
.podium-avatar {
  width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 28px; background: hsl(var(--bh), 47%, 93%); border: 3px solid #fff;
  box-shadow: 0 4px 12px hsla(var(--bh),50%,36%,.2);
}
.podium-item.rank-1 .podium-avatar { width: 66px; height: 66px; font-size: 34px; border-color: #FFD76A; box-shadow: 0 4px 18px rgba(255,200,60,.5); }
.podium-item.rank-2 .podium-avatar { border-color: #C9D2DC; }
.podium-item.rank-3 .podium-avatar { border-color: #E0A878; }
.podium-name { font-size: 12px; font-weight: 700; color: var(--ink); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-val { font-size: 12px; font-weight: 800; color: hsl(var(--bh), 50%, 36%); }
.podium-bar { width: 100%; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, hsl(var(--bh),47%,65%), hsl(var(--bh),47%,80%)); }
.podium-item.rank-1 .podium-bar { height: 56px; }
.podium-item.rank-2 .podium-bar { height: 40px; }
.podium-item.rank-3 .podium-bar { height: 28px; }
.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: hsl(var(--bh), 43%, 97%); border-radius: 14px; border: 1px solid hsl(var(--bh), 47%, 90%);
}
.lb-row.is-me { background: hsl(var(--bh), 47%, 92%); border-color: hsl(var(--bh), 47%, 60%); box-shadow: 0 0 0 2px hsla(var(--bh),47%,46%,.12); }
.lb-rank { font-size: 15px; font-weight: 800; color: var(--ink-2); width: 26px; text-align: center; }
.lb-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; background: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px hsla(var(--bh),50%,36%,.15); }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-size: 13px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.lb-badge-me { font-size: 10px; background: hsl(var(--bh),47%,46%); color: #fff; padding: 1px 7px; border-radius: 999px; }
.lb-sub { font-size: 11px; color: var(--ink-3); }
.lb-value { font-size: 16px; font-weight: 800; color: hsl(var(--bh),50%,36%); white-space: nowrap; }
.lb-note { text-align: center; font-size: 11px; color: var(--ink-3); margin: 14px 0 2px; }

/* ---------- 管理后台 ---------- */
.admin-card { margin-bottom: var(--gap); }
.admin-user-list { display: flex; flex-direction: column; gap: 8px; }
.admin-user-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: hsl(var(--bh), 43%, 97%); border-radius: 12px; }
.admin-user-av { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 19px; background: #fff; }
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.admin-user-meta { font-size: 11px; color: var(--ink-3); }
.admin-del { background: transparent; border: none; color: #E4574C; font-size: 12px; font-weight: 700; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.admin-del:hover { background: rgba(228,87,76,.1); }
.admin-form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.form-row input {
  padding: 10px 12px; border: 1px solid hsl(var(--bh), 47%, 82%); border-radius: 12px;
  font-size: 14px; color: var(--ink); background: #fff; outline: none;
}
.form-row input:focus { border-color: hsl(var(--bh), 47%, 46%); box-shadow: 0 0 0 3px hsla(var(--bh),47%,46%,.12); }
.avatar-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-opt {
  width: 38px; height: 38px; border-radius: 10px; font-size: 20px; cursor: pointer;
  background: #fff; border: 2px solid hsl(var(--bh), 47%, 86%); display: flex; align-items: center; justify-content: center;
}
.avatar-opt.active { border-color: hsl(var(--bh), 47%, 46%); background: hsl(var(--bh), 47%, 93%); }
.admin-note { font-size: 12px; color: var(--ink-2); line-height: 1.6; margin: 0 0 12px; }
.sim-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sim-controls select, .sim-controls input {
  padding: 9px 10px; border: 1px solid hsl(var(--bh), 47%, 82%); border-radius: 12px;
  font-size: 13px; color: var(--ink); background: #fff; outline: none;
}
.sim-controls select { flex: 1; min-width: 180px; }
.sim-controls input { width: 64px; }
.btn-danger { color: #E4574C !important; }

/* ---------- 用户切换弹窗 ---------- */
.usermenu-modal { max-width: 420px; }
.usermenu-list { display: flex; flex-direction: column; gap: 8px; }
.usermenu-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; width: 100%;
  background: hsl(var(--bh), 43%, 97%); border: 2px solid transparent; border-radius: 14px; cursor: pointer;
  transition: all .2s ease; text-align: left;
}
.usermenu-item:hover { border-color: hsl(var(--bh), 47%, 70%); }
.usermenu-item.is-current { border-color: hsl(var(--bh), 47%, 46%); background: hsl(var(--bh), 47%, 93%); }
.usermenu-av { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 21px; background: #fff; }
.usermenu-name { flex: 1; font-size: 13px; font-weight: 700; color: var(--ink); }
.usermenu-cur-tag { font-size: 10px; color: hsl(var(--bh), 50%, 36%); font-weight: 700; }

/* ---------- v2.24 花园页桌面端栅格：宽度统一、左右对齐、无孤立半宽卡 ---------- */
@media (min-width: 900px) {
  /* 页面回到块级，只让卡片容器参与分栏，避免标签栏/容器被误当网格列 */
  #page-garden { display: block; }
  #garden-mine {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap);
    align-items: stretch; /* 同一行的种子袋与抽奖等高，底部齐平 */
  }
  /* 花园、种子商店、植物图鉴整行铺满；种子袋与抽奖并排占满两列 */
  #garden-mine #garden-section,
  #garden-mine #shop-section,
  #garden-mine #collection-section { grid-column: 1 / -1; }
  #garden-mine .card { margin-bottom: 0; display: flex; flex-direction: column; }
  /* 种子袋内容少时垂直填充，等高后不留大片空白 */
  #inventory-section .inventory-grid {
    flex: 1; align-content: center;
  }
  /* 图鉴整行后恢复 6 列图标网格，不再挤在半宽里 */
  #collection-section .collection-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #page-leaderboard, #page-admin { display: block; }
  #page-leaderboard .card, #page-admin .card { max-width: 760px; }
}

/* ============================================================
   v2.1 扩展：全新前台登录 + 动态小伙伴 + 首页实时动态
   全部使用 --bh 色相令牌，森林 / 樱花 / 海洋三主题通用
   ============================================================ */

/* 登录页在最上层，提示条要能盖过它 */
.toast { z-index: 400; }

/* ---------- 登录背景场景 ---------- */
.login-screen {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 28px; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 14% 8%, hsla(var(--bh), 62%, 84%, .78), transparent 72%),
    radial-gradient(ellipse 55% 45% at 92% 18%, hsla(42, 96%, 78%, .55), transparent 72%),
    linear-gradient(160deg, hsl(var(--bh), 48%, 94%) 0%, hsl(var(--bh), 38%, 97%) 58%, hsl(var(--bh), 52%, 90%) 100%);
}
.login-sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.login-star {
  position: absolute; color: #fff; font-size: 22px; opacity: .85;
  filter: drop-shadow(0 0 8px hsla(42, 95%, 70%, .9));
  animation: login-twinkle 3.2s ease-in-out infinite;
}
.login-star.st1 { left: 9%;  top: 16%; animation-delay: 0s; }
.login-star.st2 { left: 26%; top: 9%;  animation-delay: .5s; font-size: 16px; }
.login-star.st3 { left: 69%; top: 13%; animation-delay: 1.1s; }
.login-star.st4 { left: 88%; top: 30%; animation-delay: 1.6s; font-size: 18px; }
.login-star.st5 { left: 45%; top: 24%; animation-delay: 2.1s; font-size: 14px; }
.login-star.st6 { left: 78%; top: 6%;  animation-delay: 2.6s; font-size: 14px; }
@keyframes login-twinkle {
  0%, 100% { opacity: .35; transform: translateY(0) scale(.85); }
  50%      { opacity: 1;   transform: translateY(-8px) scale(1.15); }
}
.login-hill { position: absolute; bottom: -18%; width: 78%; height: 52%; border-radius: 50% 50% 0 0; }
.hill-back  { left: -22%; background: hsla(var(--bh), 45%, 74%, .24); transform: rotate(-7deg); }
.hill-front { right: -24%; background: hsla(var(--bh), 42%, 66%, .22); transform: rotate(6deg); }
.login-trees {
  position: absolute; bottom: 22px; left: 0; right: 0; text-align: center;
  font-size: 30px; letter-spacing: 26px; opacity: .22; white-space: nowrap;
}

.login-theme {
  position: absolute; top: 22px; right: 26px; z-index: 3;
  width: 42px; height: 42px; border-radius: 50%; font-size: 19px; cursor: pointer;
  background: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 6px 18px hsla(var(--bh), 50%, 36%, .16);
  transition: transform .18s ease, background .2s ease;
}
.login-theme:hover { transform: rotate(20deg) scale(1.08); background: #fff; }

/* ---------- 登录双栏布局 ---------- */
.login-shell {
  position: relative; z-index: 2;
  width: 100%; max-width: 980px;
  display: flex; align-items: center; gap: 40px;
}
.login-story { flex: 1 1 0; min-width: 0; color: var(--ink); padding-left: 6px; }
.login-story-title {
  font-size: clamp(38px, 5vw, 64px); line-height: 1.06; margin: 18px 0 14px;
  font-weight: 900; letter-spacing: 2px; color: hsl(var(--bh), 52%, 30%);
  text-shadow: 0 6px 18px hsla(var(--bh), 60%, 92%, .9);
}
.login-story-title em {
  font-style: normal;
  background: linear-gradient(100deg, hsl(var(--bh), 58%, 46%), hsl(42, 92%, 56%));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-story-desc { font-size: 14px; line-height: 1.9; color: var(--ink-2); max-width: 420px; }

.login-live-card {
  margin-top: 24px; max-width: 420px; padding: 14px 16px;
  background: rgba(255,255,255,.68); border: 1px solid rgba(255,255,255,.92);
  border-radius: 20px; box-shadow: 0 10px 30px hsla(var(--bh), 50%, 36%, .10);
  backdrop-filter: blur(8px);
}
.login-live-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 800; color: hsl(var(--bh), 50%, 34%); margin-bottom: 9px;
}
.login-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #42C77A; box-shadow: 0 0 0 4px rgba(66,199,122,.18); animation: login-pulse 1.8s infinite; }
@keyframes login-pulse { 50% { box-shadow: 0 0 0 8px rgba(66,199,122,0); } }
.login-live-sub { margin-left: auto; font-size: 10px; color: var(--ink-3); font-weight: 600; }
.login-live-feed { display: flex; flex-direction: column; gap: 7px; min-height: 66px; }
.login-live-item {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2);
  animation: login-slide .35s ease both;
}
@keyframes login-slide { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.login-live-av { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.login-live-item b { color: var(--ink); }
.login-live-item .live-time { margin-left: auto; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.login-live-empty { font-size: 12px; color: var(--ink-3); padding: 8px 0; }
.login-story-foot { margin-top: 14px; font-size: 12px; color: var(--ink-2); }
.login-story-foot b { color: hsl(var(--bh), 56%, 40%); font-size: 16px; }

/* ---------- 登录卡 ---------- */
.login-card {
  width: 400px; flex: 0 0 400px; max-height: 90vh; overflow-y: auto;
  background: rgba(255,255,255,.93); border: 1px solid rgba(255,255,255,.95);
  border-radius: 32px; padding: 28px 26px 20px; text-align: center;
  box-shadow: 0 26px 70px hsla(var(--bh), 50%, 30%, .20), inset 0 1px 0 #fff;
  backdrop-filter: blur(14px);
}
.login-card-top { margin-bottom: 18px; }
.login-card-sun {
  display: inline-flex; align-items: center; justify-content: center;
  width: 62px; height: 62px; border-radius: 50%; font-size: 32px;
  background: radial-gradient(circle at 35% 30%, #FFF0B8, #FFD75E);
  box-shadow: 0 10px 24px hsla(42, 96%, 58%, .38);
}
.login-card-top h2 { font-size: 22px; margin-top: 10px; color: hsl(var(--bh), 50%, 28%); font-weight: 900; }
.login-card-top p { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

.login-users { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.login-user {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: hsl(var(--bh), 40%, 97%); border: 2px solid hsl(var(--bh), 45%, 91%);
  border-radius: 18px; cursor: pointer; padding: 12px 4px 10px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.login-user:hover {
  transform: translateY(-4px); border-color: hsl(var(--bh), 55%, 66%);
  box-shadow: 0 10px 22px hsla(var(--bh), 50%, 40%, .16);
}
.login-user-avatar {
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 28px; border: 3px solid #fff; box-shadow: 0 4px 12px hsla(var(--bh), 50%, 36%, .16);
}
.login-user-name { font-size: 13px; font-weight: 800; color: var(--ink); }
.login-user-tag { font-size: 10px; color: var(--ink-3); }

.login-pin-box { margin-top: 8px; }
.login-pin-avatar {
  width: 66px; height: 66px; margin: 2px auto 8px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 34px;
  background: hsl(var(--bh), 43%, 94%); border: 3px solid #fff;
  box-shadow: 0 6px 18px hsla(var(--bh), 50%, 36%, .16);
}
.login-pin-title { font-size: 14px; font-weight: 800; color: var(--ink); margin-bottom: 12px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin-bottom: 16px; }
.pin-dot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid hsl(var(--bh), 47%, 70%); background: #fff; transition: all .15s ease; }
.pin-dot.filled { background: hsl(var(--bh), 47%, 46%); border-color: hsl(var(--bh), 47%, 46%); transform: scale(1.12); }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; max-width: 268px; margin: 0 auto; }
.pin-key {
  padding: 12px 0; font-size: 20px; font-weight: 800; color: hsl(var(--bh), 50%, 34%);
  background: hsl(var(--bh), 45%, 95%); border: 1px solid hsl(var(--bh), 45%, 87%);
  border-radius: 15px; cursor: pointer; transition: transform .12s ease, background .2s ease;
}
.pin-key:hover { background: hsl(var(--bh), 48%, 90%); }
.pin-key:active { transform: scale(.94); }
.pin-key.fn { font-size: 14px; color: var(--ink-2); background: transparent; border-color: transparent; }
.login-error { min-height: 18px; color: #E4574C; font-size: 12px; font-weight: 700; margin: 8px 0 4px; }
.login-parent {
  margin-top: 14px; background: none; border: none; cursor: pointer;
  font-size: 11px; color: var(--ink-3); text-decoration: underline dotted;
}
.login-parent:hover { color: hsl(var(--bh), 50%, 36%); }
.login-foot { margin-top: 12px; font-size: 10px; color: var(--ink-3); }

/* ---------- 首页：小伙伴实时动态 ---------- */
.buddy-feed-card { margin-bottom: var(--gap); }
.buddy-live { font-size: 11px; font-weight: 700; color: #2EA968; }
.buddy-summary { font-size: 12px; color: var(--ink-2); margin: 2px 0 10px; }
.buddy-summary b { color: hsl(var(--bh), 55%, 38%); font-size: 15px; }
.buddy-feed { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.buddy-feed-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: hsl(var(--bh), 42%, 96%); border: 1px solid hsl(var(--bh), 45%, 88%);
  border-radius: 14px; font-size: 12px; color: var(--ink-2); min-width: 0;
}
.buddy-feed-av { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.buddy-feed-item b { color: var(--ink); }
.buddy-feed-item .buddy-task { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buddy-feed-item .buddy-ago { margin-left: auto; flex: 0 0 auto; font-size: 10px; color: var(--ink-3); }
.buddy-feed-empty { font-size: 12px; color: var(--ink-3); padding: 8px; }

/* ---------- 后台：小伙伴配置 ---------- */
.sim-controls label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
#admin-sim-status { margin-top: 8px; color: hsl(var(--bh), 50%, 36%); font-weight: 700; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .login-screen { padding: 18px 14px; align-items: flex-start; overflow-y: auto; }
  .login-shell { flex-direction: column; gap: 18px; max-width: 520px; margin: 30px auto; }
  .login-story { width: 100%; padding: 0 4px; }
  .login-story-title { font-size: 38px; margin: 10px 0 6px; }
  .login-story-desc { font-size: 12px; line-height: 1.7; }
  .login-live-card { margin-top: 14px; max-width: none; padding: 11px 13px; }
  .login-live-feed { min-height: 0; }
  .login-story-foot { margin-top: 8px; }
  .login-card { width: 100%; flex: none; padding: 22px 20px 18px; border-radius: 26px; max-height: none; }
  .login-theme { top: 14px; right: 14px; width: 38px; height: 38px; }
  .login-trees { font-size: 22px; }
}
@media (max-width: 380px) {
  .login-users { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .login-user-avatar { width: 44px; height: 44px; font-size: 24px; }
  .pin-keypad { gap: 7px; }
}

/* v2.2 数据模式标识 */
.mode-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800;
  color: #fff; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35);
  white-space: nowrap;
}
.mode-badge.is-server { background: hsla(150, 60%, 42%, .55); border-color: hsla(150, 70%, 70%, .55); }
.mode-badge.is-demo { background: rgba(160,160,170,.45); }
@media (max-width: 620px) { .mode-badge { display: none; } }

/* ============================================================
   v2.6 扩展：右上角退出按钮 + 用户名密码登录表单
   全部使用 --bh 色相令牌，三主题通用
   ============================================================ */
.logout-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  font-size: 12px; font-weight: 800; white-space: nowrap;
  color: hsl(var(--bh), 45%, 34%);
  background: hsl(var(--bh), 42%, 96%);
  border: 1px solid hsl(var(--bh), 45%, 84%);
  transition: transform .16s ease, background .2s ease, border-color .2s ease;
}
.logout-btn:hover {
  background: hsl(var(--bh), 48%, 90%);
  border-color: hsl(var(--bh), 50%, 70%);
  transform: translateY(-1px);
}
.logout-btn:active { transform: scale(.96); }

.login-form { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.login-field { display: flex; flex-direction: column; gap: 5px; text-align: left; }
.login-field > span {
  font-size: 12px; font-weight: 800; color: hsl(var(--bh), 45%, 34%);
  padding-left: 2px;
}
.login-field input {
  width: 100%; box-sizing: border-box;
  padding: 11px 13px; border-radius: 14px;
  font-size: 14px; color: var(--ink);
  background: hsl(var(--bh), 40%, 98%);
  border: 1px solid hsl(var(--bh), 42%, 84%);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.login-field input:focus {
  border-color: hsl(var(--bh), 55%, 58%);
  box-shadow: 0 0 0 3px hsla(var(--bh), 55%, 60%, .18);
}
.login-field input::placeholder { color: var(--ink-3); }
.login-submit {
  width: 100%; margin-top: 2px; padding: 12px;
  font-size: 14px; font-weight: 900; letter-spacing: .5px;
}
.login-back {
  width: 100%;
  flex: 0 0 auto;
  margin-top: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 700;
}
.login-parent { margin-top: 14px; }
.usermenu-note {
  margin: 10px 2px 0; font-size: 12px; line-height: 1.6;
  color: var(--ink-3); text-align: center;
}

@media (max-width: 520px) {
  .login-card { padding: 22px 18px 18px; }
}

/* ============================================================
   v2.7 扩展：登录标题单行 + 首页排版重排
   全部使用 --bh 色相令牌，森林 / 樱花 / 海洋三主题通用
   ============================================================ */

/* ---------- 登录标题：阳光成长打卡 单行显示 ---------- */
.login-story-title {
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.15;
  letter-spacing: 1px;
  white-space: nowrap;
}
.login-title-gap { display: inline-block; width: .24em; }
@media (max-width: 860px) {
  .login-story-title { font-size: clamp(26px, 7vw, 34px); }
}
@media (max-width: 380px) {
  .login-story-title { font-size: 24px; }
}

/* ---------- 首页：桌面端统一单列分区，消除半宽空缺 ---------- */
@media (min-width: 900px) {
  #page-home {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap);
    align-items: stretch;
  }
  #page-home > * { grid-column: 1 / -1; }
  #page-home > .hero-card       { order: 1; }
  #page-home > .duo-grid        { order: 2; }
  #page-home > .stat-overview   { order: 3; }
  #page-home > .quick-section   { order: 4; }
  #page-home > .buddy-feed-card { order: 5; }
  #page-home > .stats-card      { order: 6; }
  #page-home > .history-card    { order: 7; }
  #page-home .duo-grid,
  #page-home .stats-card,
  #page-home .history-card { margin-bottom: 0; }

  /* 顶部进度区两卡等高；概览四卡等宽 */
  #page-home .duo-grid > .card { min-height: 214px; }
  #page-home .stat-overview { grid-template-columns: repeat(4, 1fr); }
  #page-home .quick-grid { grid-template-columns: repeat(4, 1fr); }
  #page-home .buddy-feed { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}

/* ============================================================
   v2.8 扩展：登录页左右内容上下对齐（桌面端）
   左侧品牌区与右侧登录卡等高，顶部/底部边界齐平
   ============================================================ */
@media (min-width: 861px) {
  .login-shell { align-items: stretch; gap: 44px; }
  .login-story {
    display: flex;
    flex-direction: column;
    padding: 6px 0 4px;
  }
  /* 顶部一组：标题 + 描述 */
  .login-story > .login-story-title,
  .login-story > .login-story-desc { flex: 0 0 auto; }
  /* 动态卡与统计行推到底部，底部与登录卡底部齐平 */
  .login-live-card { margin-top: auto; margin-bottom: 0; }
  .login-story-foot { margin-top: 16px; margin-bottom: 0; }
}

/* 屏幕很矮时（<600px）改为紧凑排布，避免左侧内容被压扁 */
@media (min-width: 861px) and (max-height: 600px) {
  .login-story { justify-content: flex-start; }
  .login-live-card { margin-top: 18px; }
  .login-story-foot { margin-top: 12px; }
}

/* ============================================================
   v2.9 扩展：登录页重新排版
   去掉顶部徽章与卡片内「他们也在打卡」后，左右两栏需要重新找平衡：
   左栏 = 标题组 → 实时卡片（吃掉剩余高度）→ 统计行
   右栏 = 图标标题 → 表单 → 家长入口（贴底）
   两栏上下边界齐平，中间不再留大片空白
   ============================================================ */
@media (min-width: 861px) {
  .login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    align-items: stretch;
    gap: 48px;
  }

  .login-story {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    padding: 12px 0 22px;
  }
  .login-story-title { margin: 0 0 12px; }
  .login-story-desc { margin: 0; }

  /* 第 3 行吃掉剩余高度，实时卡片随之撑满，条目均匀分布 */
  .login-live-card {
    margin: 22px 0 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    align-self: stretch;
  }
  .login-live-feed {
    flex: 1 1 auto;
    min-height: 0;
    justify-content: space-between;
    gap: 4px;
    overflow: hidden;
  }
  .login-live-item { flex: 0 0 auto; }
  .login-story-foot { margin: 14px 0 0; }

  /* 右卡纵向分布：头部与表单靠上，家长入口贴底，与左栏统计行同高 */
  .login-card {
    display: flex;
    flex-direction: column;
    padding: 28px 26px 22px;
  }
  .login-card-top,
  .login-form,
  .login-back { flex: 0 0 auto; }
  .login-error { min-height: 16px; margin: 6px 0 2px; }
  .login-parent { margin-top: auto; padding-top: 18px; }
}

/* 屏幕偏矮时压缩留白，行高仍由 grid 自适应 */
@media (min-width: 861px) and (max-height: 660px) {
  .login-story { padding: 6px 0 4px; }
  .login-live-card { margin-top: 16px; }
  .login-live-feed { gap: 2px; }
  .login-story-foot { margin-top: 10px; }
  .login-card { padding: 22px 24px 18px; }
  .login-card-top { margin-bottom: 14px; }
}

/* ---------- v2.9：窄屏（手机）登录卡宽度收敛，避免横向溢出 ---------- */
@media (max-width: 860px) {
  .login-screen { overflow-x: hidden; }
  .login-shell {
    width: 100%;
    max-width: 520px;
    margin: 22px auto;
  }
  .login-card {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    box-sizing: border-box;
    padding: 24px 20px 20px;
  }
  .login-form input,
  .login-field { width: 100%; box-sizing: border-box; }
  .login-story-title { margin: 0 0 8px; }
  .login-story-desc { margin: 0; }
}

/* ============================================================
   v2.10 扩展：登录页底部装饰随主题换形象
   森林秘境 = 树木 / 樱花物语 = 花朵 / 海洋奇遇 = 鲸鱼
   具体文案由 app.js 的 THEME_SCENERY 切换，这里只负责过渡
   ============================================================ */
.login-trees { transition: opacity .3s ease; }

.login-trees.scenery-in {
  animation: scenery-fade .55s cubic-bezier(.22, .61, .36, 1) both;
}

@keyframes scenery-fade {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to   { opacity: .22; transform: none; }
}

/* 鲸鱼/花朵字形比树宽一点，海洋与樱花主题适当收紧字距，避免贴边 */
html[data-theme="ocean"] .login-trees,
html[data-theme="sakura"] .login-trees { letter-spacing: 22px; }

@media (max-width: 860px) {
  html[data-theme="ocean"] .login-trees,
  html[data-theme="sakura"] .login-trees { letter-spacing: 16px; }
}

/* ============================================================
   v2.11：登录页左侧内容整体右移，离屏幕左边缘留出呼吸
   只缩进左栏内容，列宽不变，与右侧登录卡的间距保持原样
   ============================================================ */
@media (min-width: 861px) {
  .login-story { padding-left: 36px; }
}

/* 中等宽度（861–1080）稍微收一点，避免标题贴近登录卡 */
@media (min-width: 861px) and (max-width: 1100px) {
  .login-story { padding-left: 30px; }
}

/* ============================================================
   v2.13 扩展：后台可修改密码
   ① 用户列表每行加「改密码」，点击后在该行下方展开输入框
   ② 管理员自己的密码单独一张卡片（当前密码 + 新密码 + 确认）
   ============================================================ */
.admin-user-row { flex-wrap: wrap; }
.admin-user-ops { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.admin-pwd {
  background: transparent; border: none; cursor: pointer;
  padding: 6px 8px; border-radius: 8px;
  font-size: 12px; font-weight: 700;
  color: hsl(var(--bh), 45%, 38%);
  transition: background .18s ease;
}
.admin-pwd:hover { background: hsl(var(--bh), 46%, 92%); }

/* 行内改密码表单：占满整行，与上方信息用虚线分隔 */
.admin-pwd-form {
  flex: 0 0 100%;
  display: flex; align-items: center; gap: 8px;
  margin-top: 2px; padding-top: 10px;
  border-top: 1px dashed hsl(var(--bh), 40%, 86%);
}
.admin-pwd-input {
  flex: 1 1 auto; min-width: 0; box-sizing: border-box;
  padding: 8px 11px; border-radius: 10px;
  font-size: 13px; color: var(--ink);
  background: #fff; border: 1px solid hsl(var(--bh), 42%, 84%);
  outline: none; transition: border-color .18s ease, box-shadow .18s ease;
}
.admin-pwd-input:focus {
  border-color: hsl(var(--bh), 55%, 58%);
  box-shadow: 0 0 0 3px hsla(var(--bh), 55%, 60%, .16);
}
.admin-pwd-save, .admin-pwd-cancel {
  flex: 0 0 auto; cursor: pointer; border: none;
  padding: 8px 14px; border-radius: 10px;
  font-size: 12px; font-weight: 800;
  transition: transform .12s ease, background .18s ease;
}
.admin-pwd-save { color: #fff; background: linear-gradient(135deg, var(--leaf), var(--leaf-deep)); }
.admin-pwd-save:active { transform: scale(.96); }
.admin-pwd-save:disabled { opacity: .6; cursor: default; }
.admin-pwd-cancel { color: var(--ink-3); background: hsl(var(--bh), 24%, 93%); }
.admin-pwd-cancel:hover { background: hsl(var(--bh), 25%, 89%); }

/* 管理员改密码卡片：状态行不再额外占位 */
#admin-password-status { margin: 0; min-height: 0; }

/* 窄屏：输入框单独占一行，按钮靠右，避免挤成一条 */
@media (max-width: 520px) {
  .admin-pwd-form { flex-wrap: wrap; }
  .admin-pwd-input { flex: 1 0 100%; }
  .admin-pwd-save { flex: 1 1 auto; }
  .admin-pwd-cancel { flex: 0 0 auto; }
}

/* ============================================================
   v2.14 扩展：手机端顶栏重排
   问题：顶栏把「品牌 + 头像 + 退出登录 + 主题 + 阳光」全部塞在一行，
        393px 宽的手机上可用宽度只有约 275px（还要减去 78px 左侧导航），
        一行需要 430px+，flex 只能硬挤 → 标题、日期、按钮互相压住。
   做法：<=599px 时顶栏拆成两行
        第一行：品牌（太阳 + 标题 + 日期）
        第二行：头像靠左，退出登录 / 主题 / 阳光靠右
        同时收窄左侧导航，把宽度还给内容区。
   ============================================================ */
@media (max-width: 599px) {
  .topbar {
    padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 12px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
  }
  .topbar-inner {
    flex-wrap: wrap;
    row-gap: 9px;
    column-gap: 8px;
  }

  .brand { flex: 1 1 auto; gap: 8px; }
  .brand-sun { font-size: 25px; }
  .brand-text h1 { font-size: 15.5px; letter-spacing: .2px; }
  .brand-text p { font-size: 11px; }

  /* 操作控件整体换到第二行；头像顶左，其余三项一起靠右
     注意 auto 外边距要加在「头像」上：DOM 顺序是 头像 → 退出 → 主题 → 阳光，
     如果加在退出按钮上，后面两项会被推出右边界裁掉。 */
  .topbar-right {
    flex: 1 0 100%;
    justify-content: flex-start;
    gap: 7px;
  }
  .user-chip { margin-right: auto; padding: 3px 9px 3px 3px; font-size: 11px; }
  .user-chip-avatar { width: 22px; height: 22px; font-size: 14px; }
  .user-chip-name { max-width: 56px; }
  .theme-btn { width: 32px; height: 32px; flex: 0 0 32px; }
  .theme-btn-icon { font-size: 15px; }
  .sun-balance { padding: 4px 9px; gap: 3px; }
  .sun-balance-icon { font-size: 14px; }
  .sun-balance-num { font-size: 14px; min-width: 12px; }
  .sun-balance-label { display: none; }

  /* 左侧导航收窄，内容区更宽 */
  :root { --nav-w: 68px; }
  .bottom-nav {
    padding: calc(10px + env(safe-area-inset-top, 0px)) 6px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .nav-brand { padding: 2px 0 10px; margin-bottom: 10px; gap: 4px; }
  .nav-brand-badge { width: 34px; height: 34px; font-size: 18px; }
  .nav-brand-name { font-size: 10.5px; letter-spacing: 0; }
  .nav-links { gap: 5px; }
  .nav-item { padding: 7px 1px 6px; font-size: 10px; gap: 3px; border-radius: 13px; }
  .nav-icon { width: 30px; height: 30px; font-size: 17px; border-radius: 10px; }
}

/* 超窄屏（老机型 / 分屏）：再压一档，保证第二行也放得下 */
@media (max-width: 359px) {
  .topbar { padding-left: 10px; padding-right: 10px; }
  .brand-text h1 { font-size: 14.5px; }
  .user-chip-name { max-width: 44px; }
  :root { --nav-w: 60px; }
  .nav-item { font-size: 9.5px; }
}

/* ============================================================
   v2.14 扩展：退出登录移到左侧导航栏左下角
   —— 顶栏少一个按钮，两行布局更宽松；退出属于低频操作，放导航底部更合理。
      窄屏导航只有 68px，按钮竖排（图标 + 文字）；桌面 208px 时横排。
   ============================================================ */
.nav-logout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  margin: 10px 0 0;
  padding: 7px 4px;
  border-radius: 12px;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.nav-logout-icon { font-size: 15px; line-height: 1; }
.nav-logout-text { font-size: 9.5px; }
.nav-logout:hover { background: hsl(var(--bh), 42%, 93%); }

@media (min-width: 900px) {
  /* 桌面导航变宽，鼓励语与退出按钮改为纵向堆叠，避免一行挤在一起 */
  .nav-footer { flex-direction: column; align-items: center; gap: 6px; padding-top: 12px; }
  .nav-logout {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding: 9px 10px;
    font-size: 12px;
  }
  .nav-logout-icon { font-size: 16px; }
  .nav-logout-text { font-size: 12px; }
}

/* ============================================================
   v2.15 扩展：手机端首页问候卡的彩虹不再压住文字
   实测（375 视口）：卡片内容区只有 233px 宽，彩虹 74px 居中摆放时
   占 x240-342 / y158-269，正好盖住标题（文字排到 x≈315）和副标题。
   做法：手机上把彩虹缩到角落（右下），副标题给右侧留白提前换行，
   文字与装饰各占一块，互不遮挡；桌面规则不变。
   ============================================================ */
@media (max-width: 599px) {
  .hero-card {
    padding: 18px 16px 12px;
    min-height: 0;
  }
  .hero-deco {
    top: auto;
    bottom: 9px;
    right: 12px;
    transform: none;
    font-size: 46px;
    opacity: .95;
    line-height: 1;
  }
  /* 副标题右侧留出彩虹的位置，让它提前换行，不与装饰重叠 */
  .hero-sub {
    max-width: 100%;
    padding-right: 86px;
  }
  /* 标题在手机上略收一号，避免刚好顶到彩虹的横向范围 */
  .hero-title { font-size: 20px; }
}

/* 超窄屏再收一档 */
@media (max-width: 359px) {
  .hero-deco { font-size: 38px; bottom: 10px; right: 12px; }
  .hero-sub { padding-right: 76px; }
  .hero-title { font-size: 19px; }
}

/* ============================================================
   v2.16 扩展：打卡必填 + 家长审核
   ① 弹窗底部的必填提示，未填时闪一下红
   ② 任务卡上的审核状态标签、被退回的说明条
   ③ 后台「打卡审核」卡片
   ============================================================ */

/* ① 必填提示 */
.proof-require {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: #C2691E;
  background: #FFF6E8;
  border: 1px solid #F6DFBC;
  border-radius: 10px;
  padding: 8px 11px;
  line-height: 1.45;
}
.proof-require.warn { animation: require-shake .5s ease; border-color: #E4677E; color: #C2455C; background: #FDEEF1; }
@keyframes require-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* ② 审核状态标签 */
.tag-review-pending { background: #FFF4DA; color: #A9761A; font-weight: 700; }
.tag-review-ok { background: #E4F5EA; color: #2C7A4B; font-weight: 700; }
.tag-review-bad { background: #FDECEF; color: #C2455C; font-weight: 700; }

.task-card.rejected { border-color: #F3C3CE; background: #FFFBFC; }
.task-rejected {
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: 11px;
  background: #FDEEF1;
  border: 1px solid #F6CFDA;
  color: #A83550;
  font-size: 12.5px;
  line-height: 1.55;
}
.task-rejected b { font-weight: 800; }
.task-rejected span { display: block; margin-top: 3px; color: #B06579; font-size: 11.5px; }

/* ③ 后台审核卡片 */
.review-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.review-tab {
  border: 1px solid hsl(var(--bh), 40%, 86%);
  background: #fff;
  color: var(--ink-3);
  font-size: 12.5px; font-weight: 700;
  padding: 8px 14px; border-radius: 999px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.review-tab b { font-weight: 800; }
.review-tab.active {
  background: linear-gradient(135deg, var(--leaf), var(--leaf-deep));
  border-color: transparent; color: #fff;
}
.review-refresh {
  margin-left: auto;
  border: 1px solid hsl(var(--bh), 40%, 86%);
  background: #fff; color: hsl(var(--bh), 40%, 36%);
  font-size: 12px; font-weight: 700;
  padding: 8px 12px; border-radius: 999px; cursor: pointer;
}
.review-refresh:hover { background: hsl(var(--bh), 44%, 95%); }

.review-list { display: flex; flex-direction: column; gap: 10px; }
.review-empty {
  padding: 22px 12px; text-align: center;
  color: var(--ink-3); font-size: 13px;
  background: hsl(var(--bh), 40%, 97%);
  border: 1px dashed hsl(var(--bh), 36%, 86%);
  border-radius: 14px;
}
.review-item {
  border: 1px solid hsl(var(--bh), 36%, 89%);
  border-radius: 14px;
  padding: 12px 13px;
  background: #fff;
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px;
}
.review-item.is-rejected { border-color: #F3C3CE; background: #FFFBFC; }
.review-item.is-leaving {
  opacity: 0; transform: translateX(14px) scale(.985);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.review-main { flex: 1 1 220px; min-width: 0; }
.review-who { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 800; color: var(--ink); }
.review-av { font-size: 17px; line-height: 1; }
.review-task { color: hsl(var(--bh), 48%, 34%); }
.review-when { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-left: auto; white-space: nowrap; }
.review-note {
  margin-top: 6px;
  font-size: 12.5px; color: var(--ink-2); line-height: 1.55;
  background: hsl(var(--bh), 44%, 97%);
  border-radius: 9px; padding: 7px 9px;
  word-break: break-word;
}
.review-note.none { color: #A8AFB8; font-style: normal; }
.review-meta { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; }
.review-ops { display: flex; gap: 6px; flex: 0 0 auto; align-self: center; }
.review-btn {
  border: none; cursor: pointer; border-radius: 10px;
  font-size: 12px; font-weight: 800; padding: 8px 12px;
  background: hsl(var(--bh), 40%, 94%); color: hsl(var(--bh), 42%, 34%);
  transition: transform .12s ease, background .18s ease;
}
.review-btn:active { transform: scale(.96); }
.review-btn.ok { background: linear-gradient(135deg, var(--leaf), var(--leaf-deep)); color: #fff; }
.review-btn.no { background: #FDECEF; color: #C2455C; }
.review-btn.ghost { background: transparent; border: 1px solid hsl(var(--bh), 34%, 86%); }

.review-detail {
  flex: 0 0 100%;
  display: none;
  padding-top: 10px;
  border-top: 1px dashed hsl(var(--bh), 34%, 88%);
}
.review-detail.open { display: block; }
.review-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.review-thumb {
  width: 92px; height: 92px; object-fit: cover;
  border-radius: 10px; border: 1px solid hsl(var(--bh), 34%, 88%);
  cursor: zoom-in; background: #f4f6f5;
}
.review-detail-empty { font-size: 12px; color: var(--ink-3); }

.review-reject-row {
  flex: 0 0 100%;
  display: none;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed hsl(var(--bh), 34%, 88%);
  flex-wrap: wrap;
}
.review-reject-row.open { display: flex; }
.review-reject-input {
  flex: 1 1 200px; min-width: 0;
  padding: 9px 11px; border-radius: 10px;
  border: 1px solid hsl(var(--bh), 42%, 84%);
  font-size: 13px; color: var(--ink); outline: none;
}
.review-reject-input:focus {
  border-color: #E4677E;
  box-shadow: 0 0 0 3px rgba(228, 103, 126, .15);
}
.review-reject-hint { flex: 0 0 100%; font-size: 11.5px; color: var(--ink-3); margin: 0; }
.review-reject-confirm, .review-reject-cancel {
  border: none; cursor: pointer; border-radius: 10px;
  font-size: 12px; font-weight: 800; padding: 9px 14px;
}
.review-reject-confirm { background: #E4677E; color: #fff; }
.review-reject-confirm:disabled { opacity: .6; cursor: default; }
.review-reject-cancel { background: hsl(var(--bh), 30%, 93%); color: var(--ink-3); }

.review-status-rejected { font-size: 11.5px; color: #C2455C; font-weight: 700; margin-top: 6px; }

@media (max-width: 599px) {
  .review-item { padding: 11px 12px; }
  .review-ops { flex: 1 1 100%; justify-content: flex-end; }
  .review-when { font-size: 11px; }
}

/* ---------- v2.16：审核条目在窄屏的换行修正 ---------- */
.review-title { flex: 1 1 auto; min-width: 0; }
.review-who { flex-wrap: wrap; row-gap: 2px; }
.review-when { flex: 0 0 auto; }

@media (max-width: 599px) {
  /* 卡片标题在窄屏不再被右侧说明挤成两行 */
  .card-head { flex-wrap: wrap; row-gap: 2px; }
  .card-head h3 { white-space: nowrap; }
  .review-title { flex: 1 1 auto; }
  /* 窄屏把时间单独放一行，避免把任务名从中间挤断 */
  .review-when { flex: 1 1 100%; margin-left: 0; padding-left: 24px; }
}

/* ==================== v2.18：植物成长 / 抽奖 / 图鉴 ==================== */

/* 花园页装饰圆与多列卡片在窄屏可能多算 20–40px 滚动宽度，裁掉横向溢出 */
#page-garden { overflow-x: clip; }

/* 水滴余额与花园格 */
.garden-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.water-pill {
  background: linear-gradient(135deg, #E7F5FF, #CDEBFF); color: #1E6FA8;
  font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid #A8D8F5; white-space: nowrap;
}
.garden-hint { margin: 0 0 10px; }
.plot { min-height: 134px; aspect-ratio: auto; padding: 8px 5px; justify-content: flex-end; }
.plot-stage-label {
  position: absolute; top: 5px; left: 5px; font-size: 9.5px; font-weight: 800;
  color: hsl(var(--bh), 28%, 40%); background: rgba(255, 255, 255, .8);
  border-radius: 999px; padding: 1px 6px; white-space: nowrap;
}
.plot-plant { font-size: 30px; }
.plot-plant.stage-0 { font-size: 19px; opacity: .8; }
.plot-plant.stage-1 { font-size: 23px; }
.plot-plant.stage-2 { font-size: 26px; }
.plot-plant.stage-3 { font-size: 29px; }
.plot-plant.stage-4 { font-size: 32px; }
.plot.is-grown .plot-plant { font-size: 37px; filter: drop-shadow(0 4px 7px var(--pc)); }
.water-dots { display: flex; gap: 3px; margin: 2px 0 1px; }
.water-dot { width: 6px; height: 6px; border-radius: 50%; background: hsla(var(--bh), 25%, 75%, .6); }
.water-dot.on { background: #4AA8E0; box-shadow: 0 0 4px #8CCDF5; }
.plot-actions { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.plot-water, .plot-dig {
  font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 3px 8px; cursor: pointer;
  border: 1px solid hsla(var(--bh), 40%, 60%, .35);
  background: rgba(255, 255, 255, .85); color: hsl(var(--bh), 38%, 34%);
}
.plot-water { background: linear-gradient(135deg, #E7F5FF, #CDEBFF); color: #1E6FA8; border-color: #A8D8F5; }
.plot-water:hover { filter: brightness(1.04); }
.plot-dig:hover { background: #FFF0ED; color: #C0392B; border-color: #F0BDB5; }
.dig-icon { width: 12px; height: 12px; vertical-align: -2px; margin-right: 1px; }
.plot-grown { font-size: 10px; font-weight: 800; color: #B27A00; }
.plot.r-common { border-color: #A8CE94; }
.plot.r-rare { border-color: #94BEEA; }
.plot.r-epic { border-color: #C4A2E8; }
.plot.r-legendary { border-color: #F0C274; background: linear-gradient(180deg, #FFF8E8 0%, #FBEAC7 100%); }
.plot.r-gold {
  border-color: #F5D24B; background: linear-gradient(180deg, #FFFBEA 0%, #FFEFAF 100%);
  box-shadow: 0 0 14px rgba(245, 197, 24, .35), inset 0 2px 12px rgba(255, 255, 255, .7);
}
.inv-item.r-rare { border-color: #A8C9EE; }
.inv-item.r-epic { border-color: #CFB2EC; }
.inv-item.r-legendary, .inv-item.r-gold { border-color: #F0C274; background: #FFF9E8; }

/* 稀有度徽章 */
.rarity-badge {
  display: inline-block; font-size: 9.5px; font-weight: 800; line-height: 1;
  padding: 3px 6px; border-radius: 6px; margin-right: 6px; vertical-align: 1px;
  background: hsl(var(--bh), 28%, 93%); color: hsl(var(--bh), 35%, 38%);
}
.rarity-badge.r-rare, .odds-chip.r-rare, .collection-group-title.r-rare { background: #E8F2FE; color: #2C6CB0; }
.rarity-badge.r-epic, .odds-chip.r-epic, .collection-group-title.r-epic { background: #F2EAFB; color: #7C4BB0; }
.rarity-badge.r-legendary, .odds-chip.r-legendary, .collection-group-title.r-legendary { background: #FFF2DC; color: #A56B10; }
.rarity-badge.r-gold, .odds-chip.r-gold, .collection-group-title.r-gold { background: linear-gradient(135deg, #FFF3B8, #FFE07A); color: #8A6100; }
.shop-item.r-rare { border-color: #BBD6F2; }
.shop-item.r-epic { border-color: #D8BFF2; }
.shop-item.r-legendary { border-color: #F2CE8D; background: #FFFCF4; }
.shop-item.r-gold { border-color: #F0CD55; background: #FFFBE8; box-shadow: 0 0 12px rgba(245, 197, 24, .25); }
.shop-name { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.shop-gold-tag { font-size: 11px; font-weight: 800; color: #9A7000; white-space: nowrap; }
.shop-tabs { margin-bottom: 12px; flex-wrap: wrap; }

/* 抽奖卡片 */
.lottery-box {
  display: flex; align-items: center; gap: 16px; padding: 16px;
  border-radius: 18px; border: 1px solid #F0D994;
  background: linear-gradient(125deg, #FFF9E8 0%, #FFEFC4 55%, #FFF6DD 100%);
}
.lottery-ball {
  flex: 0 0 auto; width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center; font-size: 40px;
  background: radial-gradient(circle at 32% 28%, #FFF6C9 0%, #F5D24B 55%, #D9A421 100%);
  box-shadow: 0 8px 18px rgba(216, 164, 33, .35), inset 0 -6px 12px rgba(160, 108, 0, .2);
}
.lottery-ball.spinning { animation: lottery-spin .9s cubic-bezier(.2, .8, .3, 1); }
@keyframes lottery-spin {
  0% { transform: rotate(0) scale(1); }
  55% { transform: rotate(540deg) scale(1.18); }
  100% { transform: rotate(720deg) scale(1); }
}
.lottery-info { flex: 1; min-width: 0; }
.lottery-title { font-size: 16px; font-weight: 800; color: #8A6100; }
.lottery-desc { font-size: 12px; line-height: 1.55; color: #8B6B32; margin: 4px 0 10px; }
.lottery-desc b { color: #C2455C; }
.lottery-btn {
  background: linear-gradient(135deg, #FFD85E, #F0A91E); color: #6B4600;
  font-weight: 800; padding: 9px 16px; border: none; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(240, 169, 30, .35); cursor: pointer;
}
.lottery-btn:disabled { background: hsl(var(--bh), 15%, 91%); color: var(--ink-3); box-shadow: none; cursor: not-allowed; }
.lottery-odds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.odds-chip { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: hsl(var(--bh), 28%, 93%); color: hsl(var(--bh), 35%, 38%); }
.odds-chip.r-sun { background: #FFF3D6; color: #9B6B10; }
.odds-chip.r-water { background: #E7F5FF; color: #1E6FA8; }

/* 抽奖结果弹窗 */
.lottery-result-modal { text-align: left; }
.lottery-result-body { text-align: center; }
.lottery-prize {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 12px; border-radius: 18px;
  background: hsl(var(--bh), 32%, 96%); border: 2px dashed hsl(var(--bh), 40%, 78%);
}
.lottery-prize.r-gold { background: linear-gradient(135deg, #FFF9E0, #FFE9A3); border-color: #F0CD55; box-shadow: 0 0 18px rgba(245, 197, 24, .3); }
.lottery-prize.r-legendary { background: #FFF8EC; border-color: #F0C274; }
.lottery-prize-icon { font-size: 60px; line-height: 1; animation: sprout .6s cubic-bezier(.34, 1.56, .64, 1); }
.lottery-prize strong { font-size: 17px; color: var(--ink); }
.lottery-prize-label { font-size: 14px; font-weight: 800; color: #B27A00; }
.lottery-prize-hint { font-size: 11px; color: var(--ink-3); }
.lottery-prize-note { font-size: 11.5px; color: var(--ink-3); text-align: center; margin: 12px 0 0; }

/* 植物图鉴 */
.collection-group { margin-bottom: 14px; }
.collection-group:last-child { margin-bottom: 0; }
.collection-group-title {
  font-size: 12px; font-weight: 800; margin-bottom: 7px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 9px; border-radius: 8px; background: hsl(var(--bh), 28%, 94%); color: hsl(var(--bh), 36%, 36%);
}
.collection-group-title span { font-size: 11px; }
.collection-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.collection-item {
  border-radius: 12px; padding: 8px 3px; text-align: center;
  background: hsl(var(--bh), 30%, 96%); border: 1px solid hsla(var(--bh), 36%, 70%, .3);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.collection-item.locked { opacity: .55; filter: grayscale(1); }
.collection-item.r-legendary { border-color: #F0C274; }
.collection-item.r-gold { border-color: #F0CD55; background: #FFFBE8; }
.collection-icon { font-size: 23px; line-height: 1; }
.collection-name { font-size: 9.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* 窄屏修正 */
@media (max-width: 599px) {
  .lottery-box { gap: 11px; padding: 12px; }
  .lottery-ball { width: 62px; height: 62px; font-size: 30px; }
  .lottery-title { font-size: 14px; }
  .lottery-desc { font-size: 11px; }
  .lottery-btn { width: 100%; padding: 9px 10px; }
  .collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plot { min-height: 128px; }
  .plot-name { font-size: 10px; }
  .plot-water, .plot-dig { font-size: 10px; padding: 3px 6px; }
  .shop-item { padding: 8px; gap: 7px; }
  .shop-icon { font-size: 25px; }
}
@media (min-width: 600px) and (max-width: 899px) {
  .collection-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ==================== v2.20：种子袋弹窗 / 5阶段生长 / 转盘抽奖 ==================== */

/* ---------- 种子袋选择弹窗 ---------- */
.seedbag-modal { max-width: 560px; }
.seedbag-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px; max-height: 56vh; overflow-y: auto; padding: 2px;
}
.seedbag-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 6px 10px; border-radius: 14px; cursor: pointer;
  border: 2px solid hsl(var(--bh), 30%, 82%); background: hsl(var(--bh), 30%, 97%);
  transition: transform .16s, box-shadow .16s, border-color .16s;
  color: var(--ink);
}
.seedbag-item:hover { transform: translateY(-4px) scale(1.04); border-color: var(--pc); box-shadow: 0 8px 18px rgba(0,0,0,.12); }
.seedbag-item:active { transform: translateY(-1px) scale(.98); }
.seedbag-item.r-rare { border-color: #94BEEA; }
.seedbag-item.r-epic { border-color: #C4A2E8; }
.seedbag-item.r-legendary { border-color: #F0C274; background: #FFFBEF; }
.seedbag-item.r-gold { border-color: #F5D24B; background: #FFFAE6; }
.seedbag-own {
  position: absolute; top: 5px; right: 6px; font-size: 10.5px; font-weight: 800;
  color: #fff; background: hsl(var(--bh), 40%, 45%); border-radius: 999px; padding: 1px 7px;
}
.seedbag-icon { font-size: 32px; line-height: 1; filter: drop-shadow(0 3px 4px rgba(0,0,0,.15)); }
.seedbag-name { font-size: 11.5px; font-weight: 800; }
.seedbag-item .rarity-badge { margin: 1px 0 0; font-size: 8.5px; }
.seedbag-empty {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 34px 10px; font-size: 40px; color: var(--ink-3);
}
.seedbag-empty p { font-size: 13px; margin: 0; }

/* ---------- 生长阶段说明 ---------- */
.stage-desc {
  display: block; font-size: 8.5px; font-weight: 600; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}
.plot-stage-label.s-seed    { background: rgba(255,244,224,.9); color: #9A6B2E; }
.plot-stage-label.s-sprout  { background: rgba(230,248,225,.92); color: #3E8B3A; }
.plot-stage-label.s-seedling{ background: rgba(224,246,238,.92); color: #2E8562; }
.plot-stage-label.s-mature  { background: rgba(222,240,220,.92); color: #2F7A34; }
.plot-stage-label.s-bloom   { background: rgba(255,232,242,.94); color: #B84A74; }
.plot-stage-label.s-fruit   { background: rgba(255,244,214,.95); color: #A9741A; }

/* 各生长阶段专属动画：让 5 个过程明显区分 */
.plot-plant.s-seed    { animation: stage-seed 2.4s ease-in-out infinite; }
.plot-plant.s-sprout  { animation: stage-sprout 1.8s ease-in-out infinite; transform-origin: 50% 90%; }
.plot-plant.s-seedling{ animation: stage-sway 2.6s ease-in-out infinite; transform-origin: 50% 92%; }
.plot-plant.s-mature  { animation: stage-sway 3.2s ease-in-out infinite; transform-origin: 50% 92%; }
.plot-plant.s-bloom   { animation: stage-bloom 2.8s ease-in-out infinite; transform-origin: 50% 92%; }
.plot-plant.s-fruit   { animation: stage-fruit 2.2s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes stage-seed { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-2px) scale(1.06); } }
@keyframes stage-sprout { 0%,100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(5deg) scale(1.05); } }
@keyframes stage-sway { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes stage-bloom { 0%,100% { transform: rotate(-2deg) scale(1); filter: drop-shadow(0 0 3px rgba(255,140,180,.5)); } 50% { transform: rotate(2deg) scale(1.08); filter: drop-shadow(0 0 9px rgba(255,140,180,.85)); } }
@keyframes stage-fruit { 0%,100% { transform: translateY(0) scale(1); filter: drop-shadow(0 3px 6px var(--pc)); } 50% { transform: translateY(-3px) scale(1.07); filter: drop-shadow(0 0 12px var(--pc)); } }

/* 种下瞬间：破土弹出 */
.plot.just-planted { animation: plot-pop .7s cubic-bezier(.34,1.56,.64,1); }
.plot.just-planted .plot-plant { animation: sprout-in .8s cubic-bezier(.34,1.56,.64,1); }
@keyframes plot-pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes sprout-in { 0% { transform: translateY(14px) scale(.2); opacity: 0; } 70% { transform: translateY(-3px) scale(1.15); } 100% { transform: translateY(0) scale(1); opacity: 1; } }

/* ---------- 抽奖转盘 ---------- */
.lottery-wheel-wrap { position: relative; flex: 0 0 auto; width: 92px; height: 92px; }
.lottery-wheel {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  border: 3px solid #E0AE2E; box-shadow: 0 6px 16px rgba(180,130,20,.4), inset 0 0 0 4px rgba(255,255,255,.5);
  transform: rotate(0deg);
}
.wheel-inner { position: absolute; inset: 0; }
.wheel-label {
  position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  display: grid; place-items: center; font-size: 14px;
  /* rotate 让图标朝外，translateY 把它推到扇区外圈 */
}
.wheel-hub {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%; display: grid; place-items: center; font-size: 16px;
  background: radial-gradient(circle at 35% 30%, #FFF8D8, #F2C94C 70%);
  border: 2px solid #D9A421; box-shadow: 0 2px 6px rgba(0,0,0,.25); z-index: 2;
}
.lottery-pointer {
  position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  color: #C0392B; font-size: 18px; z-index: 3;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.2));
}
/* 抽奖中指针抖动 */
.lottery-wheel:active ~ .lottery-pointer, .lottery-wheel.spinning ~ .lottery-pointer { animation: pointer-tick .12s linear infinite; }
@keyframes pointer-tick { 0%,100% { transform: translateX(-50%) rotate(0); } 50% { transform: translateX(-50%) rotate(-12deg); } }

/* 结果弹窗弹入 */
.modal.pop-in { animation: modal-pop .45s cubic-bezier(.34,1.56,.64,1); }
@keyframes modal-pop { 0% { transform: scale(.82) translateY(16px); opacity: 0; } 100% { transform: scale(1) translateY(0); opacity: 1; } }
.lottery-prize { position: relative; overflow: hidden; }
.lottery-prize-icon { animation: prize-reveal .7s cubic-bezier(.34,1.56,.64,1); }
@keyframes prize-reveal { 0% { transform: scale(.2) rotate(-30deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.prize-confetti { position: absolute; inset: 0; pointer-events: none; }
.prize-confetti i {
  position: absolute; left: 50%; top: 40%; font-size: 18px; font-style: normal;
  animation: confetti-fly 1.4s ease-out forwards;
  animation-delay: calc(var(--i) * 60ms);
}
@keyframes confetti-fly {
  0% { transform: translate(-50%,-50%) scale(.3); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx, 0px)), 46px) scale(1.15) rotate(120deg); opacity: 0; }
}
.prize-confetti i:nth-child(1) { --dx: -110px; }
.prize-confetti i:nth-child(2) { --dx: -66px; }
.prize-confetti i:nth-child(3) { --dx: -22px; }
.prize-confetti i:nth-child(4) { --dx: 22px; }
.prize-confetti i:nth-child(5) { --dx: 66px; }
.prize-confetti i:nth-child(6) { --dx: 110px; }

/* 窄屏：转盘缩小 */
@media (max-width: 599px) {
  .lottery-wheel-wrap { width: 76px; height: 76px; }
  .wheel-label { font-size: 12px; width: 16px; height: 16px; margin: -8px 0 0 -8px; }
  .wheel-hub { width: 26px; height: 26px; margin: -13px 0 0 -13px; font-size: 14px; }
  .seedbag-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
  .seedbag-icon { font-size: 27px; }
}

/* ==================== v2.21：独立抽奖舞台 + 结算动画 ==================== */
.draw-modal { max-width: 440px; width: calc(100vw - 28px); }
.draw-body { padding: 14px 18px 10px; text-align: center; }
.draw-balance { display: flex; justify-content: center; gap: 10px; margin-bottom: 8px; }
.draw-bal-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800;
  padding: 4px 12px; border-radius: 999px; color: var(--ink);
  background: hsl(var(--bh), 40%, 95%); border: 1px solid hsl(var(--bh), 35%, 82%);
}

/* 大转盘舞台 */
.draw-stage {
  position: relative; width: 240px; height: 258px; margin: 0 auto;
  display: flex; align-items: flex-end; justify-content: center;
}
.draw-stage::before {
  content: ''; position: absolute; left: 50%; top: 30px; width: 220px; height: 220px; margin-left: -110px;
  border-radius: 50%; background: radial-gradient(circle, rgba(245,197,24,.18), transparent 68%);
}
.draw-rays {
  position: absolute; left: 50%; top: 13px; width: 254px; height: 254px; margin-left: -127px;
  border-radius: 50%; pointer-events: none; opacity: 0;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(255,244,180,.8) 12deg, transparent 24deg,
    transparent 60deg, rgba(255,244,180,.6) 72deg, transparent 84deg,
    transparent 120deg, rgba(255,244,180,.8) 132deg, transparent 144deg,
    transparent 180deg, rgba(255,244,180,.6) 192deg, transparent 204deg,
    transparent 240deg, rgba(255,244,180,.8) 252deg, transparent 264deg,
    transparent 300deg, rgba(255,244,180,.6) 312deg, transparent 324deg);
  -webkit-mask: radial-gradient(circle, transparent 34%, #000 36%, #000 50%, transparent 52%);
  mask: radial-gradient(circle, transparent 34%, #000 36%, #000 50%, transparent 52%);
}
.draw-stage.spinning .draw-rays { opacity: .9; animation: rays-spin .45s linear infinite; }
.draw-stage.settled .draw-rays { opacity: .35; animation: rays-spin 3.5s linear infinite; }
@keyframes rays-spin { to { transform: rotate(360deg); } }

.draw-pointer {
  position: absolute; left: 50%; top: -2px; z-index: 5; transform: translateX(-50%);
  font-size: 28px; line-height: 1; color: #C0392B;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.25));
}
.draw-stage.spinning .draw-pointer { animation: draw-pointer-tick .12s linear infinite; }
@keyframes draw-pointer-tick {
  0%,100% { transform: translateX(-50%) rotate(0); }
  50% { transform: translateX(-50%) rotate(-14deg); }
}

.draw-wheel {
  position: relative; width: 240px; height: 240px; border-radius: 50%; overflow: hidden;
  border: 5px solid #E0AE2E; transform: rotate(0deg);
  box-shadow: 0 10px 26px rgba(160,110,10,.42), inset 0 0 0 5px rgba(255,255,255,.55);
}
.draw-wheel .wheel-label { width: 34px; height: 34px; margin: -17px 0 0 -17px; font-size: 24px; }
.draw-wheel .wheel-label.hit { filter: drop-shadow(0 0 9px #fff) brightness(1.25); }
.draw-wheel .wheel-hub {
  width: 56px; height: 56px; margin: -28px 0 0 -28px; font-size: 28px;
  border-width: 3px; box-shadow: 0 3px 10px rgba(0,0,0,.3);
}
.draw-stage.settled .draw-wheel {
  box-shadow: 0 0 0 4px rgba(245,197,24,.35), 0 10px 26px rgba(160,110,10,.42), inset 0 0 0 5px rgba(255,255,255,.55);
}
.draw-stage.gold-hit .draw-wheel { animation: gold-pulse .95s ease-out 2; }
@keyframes gold-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(245,197,24,0), 0 10px 26px rgba(160,110,10,.42); }
  50% { box-shadow: 0 0 0 12px rgba(245,197,24,.55), 0 10px 42px rgba(245,197,24,.72); }
}
.draw-flash {
  position: absolute; left: 50%; top: 18px; width: 240px; height: 240px; margin-left: -120px;
  border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(255,255,255,.96) 0%, rgba(255,238,160,.72) 38%, transparent 70%);
}
.draw-flash.fire { animation: draw-flash .75s ease-out; }
@keyframes draw-flash {
  0% { opacity: 0; transform: scale(.5); }
  35% { opacity: .95; }
  100% { opacity: 0; transform: scale(1.4); }
}

/* 结算卡片 */
.draw-result {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 80px; margin: 8px 0 4px; padding: 10px 14px; border-radius: 16px;
  border: 2px solid #EFD27A; background: linear-gradient(135deg, #FFFDF2, #FFF4D2);
}
.draw-result.show { animation: draw-result-in .7s cubic-bezier(.34,1.56,.64,1); }
@keyframes draw-result-in {
  0% { transform: translateY(70px) scale(.65); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.draw-result.is-legendary { border-color: #F0C274; background: linear-gradient(135deg, #FFF9EC, #FFEFC9); }
.draw-result.is-gold {
  border-color: #F5D24B; background: linear-gradient(135deg, #FFFBEA, #FFE689);
  box-shadow: 0 0 20px rgba(245,197,24,.5), inset 0 0 14px rgba(255,255,255,.7);
  animation: draw-result-in .7s cubic-bezier(.34,1.56,.64,1), gold-breathe 2s ease-in-out .7s infinite;
}
@keyframes gold-breathe {
  0%,100% { box-shadow: 0 0 16px rgba(245,197,24,.4), inset 0 0 14px rgba(255,255,255,.7); }
  50% { box-shadow: 0 0 30px rgba(245,197,24,.8), inset 0 0 18px rgba(255,255,255,.9); }
}
.draw-result-icon { font-size: 52px; line-height: 1; animation: prize-fly-in .85s cubic-bezier(.34,1.56,.64,1); }
@keyframes prize-fly-in {
  0% { transform: translateY(-130px) scale(.2) rotate(-25deg); opacity: 0; }
  70% { transform: translateY(6px) scale(1.18) rotate(6deg); opacity: 1; }
  100% { transform: translateY(0) scale(1) rotate(0); }
}
.draw-result-info { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.draw-result-info strong { font-size: 18px; color: var(--ink); }
.draw-result-info span { font-size: 12.5px; font-weight: 700; color: #B27A00; }
.draw-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: 14px; }
.draw-confetti i {
  position: absolute; left: 50%; top: 55%; font-size: 17px; font-style: normal;
  animation: draw-confetti-fly 1.5s ease-out forwards; animation-delay: calc(var(--i) * 45ms);
}
@keyframes draw-confetti-fly {
  0% { transform: translate(-50%,-50%) scale(.3) rotate(0); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx,0px)), -70px) scale(1.1) rotate(180deg); opacity: 0; }
}
.draw-confetti i:nth-child(1) { --dx: -130px; }
.draw-confetti i:nth-child(2) { --dx: -108px; }
.draw-confetti i:nth-child(3) { --dx: -86px; }
.draw-confetti i:nth-child(4) { --dx: -64px; }
.draw-confetti i:nth-child(5) { --dx: -42px; }
.draw-confetti i:nth-child(6) { --dx: -20px; }
.draw-confetti i:nth-child(7) { --dx: 20px; }
.draw-confetti i:nth-child(8) { --dx: 42px; }
.draw-confetti i:nth-child(9) { --dx: 64px; }
.draw-confetti i:nth-child(10) { --dx: 86px; }
.draw-confetti i:nth-child(11) { --dx: 108px; }
.draw-confetti i:nth-child(12) { --dx: 130px; }

.draw-hint { font-size: 11.5px; color: var(--ink-3); margin: 6px 0 0; }
.draw-hint.done { color: #B27A00; font-weight: 800; }
.draw-foot { justify-content: center; }
.draw-foot .btn { flex: 1 1 0; }

@media (max-width: 599px) {
  .draw-body { padding: 12px 12px 8px; }
  .draw-stage { width: 208px; height: 226px; }
  .draw-wheel { width: 208px; height: 208px; border-width: 4px; }
  .draw-wheel .wheel-label { width: 28px; height: 28px; margin: -14px 0 0 -14px; font-size: 20px; }
  .draw-wheel .wheel-hub { width: 48px; height: 48px; margin: -24px 0 0 -24px; font-size: 24px; }
  .draw-rays { top: 13px; width: 222px; height: 222px; margin-left: -111px; }
  .draw-flash { top: 18px; width: 208px; height: 208px; margin-left: -104px; }
  .draw-stage::before { width: 190px; height: 190px; margin-left: -95px; }
  .draw-pointer { font-size: 25px; }
  .draw-result { gap: 9px; padding: 9px 10px; }
  .draw-result-icon { font-size: 42px; }
  .draw-result-info strong { font-size: 16px; }
  .draw-result-info span { font-size: 11.5px; }
}

/* 窄屏按钮文案不换行 */
@media (max-width: 599px) {
  .draw-foot .btn { font-size: 12px; padding-left: 6px; padding-right: 6px; white-space: nowrap; }
}

/* ==================== v2.22：转盘本身可点击抽奖 ==================== */
.draw-stage, .draw-wheel { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.draw-wheel { transition: filter .2s ease, box-shadow .2s ease; }
/* 待机时轻呼吸 + 悬停高亮，提示「点我转」 */
.draw-stage:not(.settled) .draw-wheel .wheel-hub { animation: hub-ready 1.7s ease-in-out infinite; }
@keyframes hub-ready {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.09); }
}
.draw-stage:not(.spinning):not(.settled) .draw-wheel:hover {
  filter: brightness(1.07);
  box-shadow: 0 0 0 5px rgba(245,197,24,.45), 0 12px 30px rgba(160,110,10,.5), inset 0 0 0 5px rgba(255,255,255,.6);
}
.draw-stage:not(.spinning):not(.settled) .draw-wheel:hover .wheel-hub { transform: scale(1.14); }
.draw-stage:not(.spinning):not(.settled) .draw-pointer { animation: pointer-invite .9s ease-in-out infinite; }
@keyframes pointer-invite {
  0%, 100% { transform: translateX(-50%) rotate(0); }
  50% { transform: translateX(-50%) rotate(10deg); }
}
/* 转动中禁用悬停反馈，避免干扰动画 */
.draw-stage.spinning { cursor: progress; }
.draw-stage.spinning .draw-wheel { cursor: progress; filter: none; }
.draw-stage.spinning .draw-wheel:hover { box-shadow: 0 10px 26px rgba(160,110,10,.42), inset 0 0 0 5px rgba(255,255,255,.55); }
.draw-stage.spinning .wheel-hub, .draw-stage.settled .wheel-hub { animation: none; }
.draw-stage:focus-visible { outline: 3px solid #F5C518; outline-offset: 3px; border-radius: 50%; }

/* ============================================================
   v2.25 家长注册体系：登录入口 / 注册弹窗 / 家长端 / 账号管理 / 登录日志
   ============================================================ */
.login-entrances { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.login-parent, .login-admin {
  margin-top: 0; background: hsl(var(--bh), 40%, 96%); border: 1px solid hsl(var(--bh), 45%, 86%);
  border-radius: 999px; cursor: pointer; padding: 8px 14px;
  font-size: 12px; font-weight: 700; color: hsl(var(--bh), 38%, 40%); text-decoration: none;
  transition: transform .16s ease, background .2s ease;
}
.login-parent:hover, .login-admin:hover { background: var(--leaf-soft); color: hsl(var(--bh), 50%, 32%); transform: translateY(-1px); }
.login-admin { background: #FFF7E8; border-color: #F0D994; color: #9A6B10; }
.login-admin:hover { background: #FFEFC4; color: #7A5200; }
.login-register-line { text-align: center; font-size: 11.5px; color: var(--ink-3); margin: 12px 0 0; }
.login-register-link {
  background: none; border: none; cursor: pointer; font-weight: 800; font-size: 12px;
  color: hsl(var(--bh), 52%, 38%); text-decoration: underline dotted; padding: 0 2px;
}
.login-register-link:hover { color: hsl(var(--bh), 55%, 30%); }
/* 三种登录模式里，返回按钮与入口按钮的显隐由 JS 控制，这里只保证不挤 */
.login-card .login-back + .login-entrances { margin-top: 6px; }

.parent-hero { background: linear-gradient(125deg, #FFF0F4 0%, #FFE3EC 55%, #FFF2F6 100%); }
.parent-hero .admin-hero-icon { filter: none; }
.parent-child-card-body { display: flex; flex-direction: column; gap: 12px; }
.child-profile { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: hsl(var(--bh), 35%, 96%); border: 1px solid hsl(var(--bh), 45%, 86%); }
.child-profile-av { font-size: 40px; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #fff; flex: 0 0 auto; }
.child-profile-info { flex: 1; min-width: 0; }
.child-profile-name { font-size: 15px; font-weight: 800; color: var(--ink); }
.child-profile-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.child-ops { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.child-ops .mini-btn, .account-row .mini-btn {
  font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid hsl(var(--bh), 45%, 80%); background: #fff; color: hsl(var(--bh), 40%, 36%);
}
.child-ops .mini-btn:hover, .account-row .mini-btn:hover { background: var(--leaf-soft); }
.child-ops .mini-btn.danger, .account-row .mini-btn.danger { color: #C0392B; border-color: #F0BDB5; }
.child-ops .mini-btn.danger:hover, .account-row .mini-btn.danger:hover { background: #FFF0ED; }
.parent-empty { text-align: center; padding: 18px 10px; color: var(--ink-3); font-size: 12.5px; }

.account-subhead { font-size: 12px; font-weight: 800; color: hsl(var(--bh), 40%, 38%); margin: 14px 0 8px; }
.account-subhead span { font-weight: 600; color: var(--ink-3); }
.account-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: hsl(var(--bh), 43%, 97%); border-radius: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.account-row .account-av { font-size: 24px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; flex: 0 0 auto; }
.account-row .account-info { flex: 1; min-width: 120px; }
.account-row .account-name { font-size: 13px; font-weight: 800; }
.account-row .account-meta { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.account-row .account-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.account-create-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.account-create-row input { flex: 1 1 160px; min-width: 0; padding: 9px 11px; border-radius: 10px; border: 1px solid hsl(var(--bh), 40%, 82%); font-size: 13px; }
.account-create-row .btn { white-space: nowrap; }

.login-log-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.login-log-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: hsl(var(--bh), 40%, 97%); font-size: 11.5px; flex-wrap: wrap; }
.login-log-badge { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; flex: 0 0 auto; }
.login-log-badge.role-admin { background: #FFF0D6; color: #9B6B10; }
.login-log-badge.role-parent { background: #FFE3EC; color: #B23A5B; }
.login-log-badge.role-user { background: #E7F5FF; color: #1E6FA8; }
.login-log-badge.ok-yes { background: #E4F5EA; color: #247A45; }
.login-log-badge.ok-no { background: #FDE8E6; color: #C0392B; }
.login-log-name { font-weight: 800; color: var(--ink); }
.login-log-detail { color: var(--ink-3); }
.login-log-meta { margin-left: auto; color: var(--ink-3); font-size: 10.5px; }

.register-modal { max-width: 420px; }
@media (max-width: 599px) {
  .child-ops, .account-row .account-ops { width: 100%; }
  .account-create-row .btn { width: 100%; }
  .login-entrances { flex-direction: column; }
  .login-entrances button { width: 100%; }
}

/* v2.26：注册弹窗从登录页上弹出，必须盖过全屏登录遮罩（z-index:300） */
#register-modal { z-index: 500; }

/* v2.27 注册邀请码 */
.form-hint { font-size: 11px; color: var(--ink-3); margin-top: 4px; }

/* v2.28 植物手绘 SVG 图标：跟随 1em 尺寸，各处 font-size 直接生效 */
/* v2.29 植物图标改为 PNG：1em 自适应字号，contain 保证不变形 */
.plant-svg { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; overflow: visible; }
.plant-img { object-fit: contain; vertical-align: -0.14em; }
.plant-svg.img-icon { width: 30px; height: 30px; }
.invite-gen-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.invite-gen-row select { padding: 9px 11px; border-radius: 10px; border: 1px solid hsl(var(--bh), 40%, 82%); font-size: 13px; background: #fff; }
.invite-gen-row .btn { white-space: nowrap; }
.invite-new-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.invite-new-head { width: 100%; font-size: 12px; font-weight: 700; color: #247A45; margin-bottom: 2px; }
.invite-new-code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; font-weight: 800; letter-spacing: 1px; padding: 6px 10px; border-radius: 8px; border: 1px dashed #2E9B5B; background: #EAF8F0; color: #1C7A43; cursor: pointer; }
.invite-new-code:hover { background: #D6F2E3; }
.invite-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.invite-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: hsl(var(--bh), 43%, 97%); flex-wrap: wrap; }
.invite-row.used { opacity: .62; }
.invite-code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--ink); }
.invite-badge { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; flex: 0 0 auto; }
.invite-badge.badge-unused { background: #E4F5EA; color: #247A45; }
.invite-badge.badge-used { background: #FDE8E6; color: #C0392B; }
.invite-meta { margin-left: auto; font-size: 10.5px; color: var(--ink-3); }
@media (max-width: 599px) {
  .invite-gen-row select, .invite-gen-row .btn { width: 100%; }
  .invite-meta { margin-left: 0; width: 100%; }
}

/* v2.30 后台二级导航：7 个功能各自独立，窄屏横向滚动 */
.admin-subnav { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin-bottom: 2px; scrollbar-width: thin; }
.admin-subnav-item { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border: 1px solid hsl(var(--bh), 36%, 84%); background: #fff; color: var(--ink-2); border-radius: 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .16s, color .16s, border-color .16s; }
.admin-subnav-item span { font-size: 15px; line-height: 1; }
.admin-subnav-item:hover { background: hsl(var(--bh), 50%, 95%); color: hsl(var(--bh), 55%, 30%); }
.admin-subnav-item.active { background: hsl(var(--bh), 58%, 94%); border-color: hsl(var(--bh), 48%, 62%); color: hsl(var(--bh), 60%, 26%); box-shadow: 0 2px 8px hsla(var(--bh), 45%, 45%, .12); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* v2.30 邀请码删除按钮 */
.invite-del { flex: 0 0 auto; border: 1px solid #F3C9C4; background: #FFF5F4; color: #C0392B; border-radius: 8px; padding: 3px 9px; font-size: 10.5px; font-weight: 700; cursor: pointer; }
.invite-del:hover { background: #FDE8E6; }
.invite-del:disabled { opacity: .5; cursor: default; }

/* v2.30 登录 IP 统计 */
.ip-stat-box { margin: 12px 0; padding: 12px; border-radius: 12px; background: hsl(var(--bh), 45%, 97%); border: 1px solid hsl(var(--bh), 35%, 89%); }
.ip-stat-box h4 { margin: 0; font-size: 13px; }
.ip-stat-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ip-stat-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 9px; border-radius: 9px; background: #fff; font-size: 11.5px; }
.ip-stat-ip { font-family: ui-monospace, Consolas, monospace; font-weight: 800; color: var(--ink); }
.ip-stat-count { font-weight: 700; color: hsl(var(--bh), 55%, 30%); }
.ip-stat-ok { color: #247A45; font-weight: 700; }
.ip-stat-no { color: #C0392B; font-weight: 700; }
.ip-stat-time { margin-left: auto; color: var(--ink-3); font-size: 10.5px; }
@media (max-width: 599px) {
  .admin-subnav-item { padding: 8px 10px; font-size: 11.5px; }
  .ip-stat-time { margin-left: 0; width: 100%; }
}
