/* ============================================================
   豆芽 BeanSprout · 设计令牌与组件样式
   融合式：豆芽嫩绿 × 苹果健康（大圆角卡片、字阶层级、留白）
   ============================================================ */

:root {
  /* 色彩令牌（PRD §2.3） */
  --green: #72C460;
  --green-press: #5CA34C;
  --green-soft: #B2E29F;
  --green-bg: #EAF5E4;
  --orange: #FF9B42;
  --orange-dark: #E07E24;
  --orange-bg: #FFF3E5;
  --bg: #F8FAF4;
  --card: #FFFFFF;
  --ink: #1B2B22;
  --ink-2: #6F7A72;
  --ink-3: #9AA79C;
  --line: #E4EDDE;
  --divider: #EAF0E5;
  --cat-recycle: #4A9BD6;
  --cat-harmful: #E4695E;
  --cat-kitchen: #72C460;
  --cat-other: #8A968C;
  --cat-recycle-bg: #EAF4FB;
  --cat-harmful-bg: #FDEEEC;
  --cat-kitchen-bg: #EAF5E4;
  --cat-other-bg: #F0F2EF;

  /* 字阶（PRD §2.3） */
  --fs-h1: 28px;
  --fs-h2: 20px;
  --fs-num: 56px;
  --fs-body: 15px;
  --fs-note: 13px;
  --fs-label: 11px;

  --radius: 16px;
  --radius-lg: 20px;
  --pad-x: 20px;
  --nav-h: 64px;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "MiSans", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", ui-monospace, "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--fs-body);
  line-height: 1.5;
  overscroll-behavior-y: none;
}
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input { font-family: inherit; }
svg { display: block; }

#app { min-height: 100dvh; }

#view {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--pad-x) calc(var(--nav-h) + 44px + env(safe-area-inset-bottom));
}

/* 页面切换入场：fade-up 交错（refresh 重渲染不触发，见 app.js） */
.page-enter > * { animation: rise 0.32s ease both; }
.page-enter > *:nth-child(2) { animation-delay: 0.04s; }
.page-enter > *:nth-child(3) { animation-delay: 0.08s; }
.page-enter > *:nth-child(4) { animation-delay: 0.12s; }
.page-enter > *:nth-child(5) { animation-delay: 0.16s; }
.page-enter > *:nth-child(n+6) { animation-delay: 0.2s; }

/* ---------- 通用排版 ---------- */
.h1 { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -0.5px; }
.h2 { font-size: var(--fs-h2); font-weight: 600; }
.note { font-size: var(--fs-note); color: var(--ink-2); }
.label { font-size: var(--fs-label); color: var(--ink-3); }
.num-lg { font-size: var(--fs-num); font-weight: 700; letter-spacing: -2px; line-height: 1.05; }

/* ---------- 卡片：大圆角 + 极浅阴影，靠留白分层 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(27,43,34,0.03), 0 10px 28px rgba(27,43,34,0.04);
}
.card-title {
  font-size: var(--fs-h2); font-weight: 600; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
/* 品牌绿点（呼应参考图字标圆点） */
.card-title::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
}

/* ---------- 按钮（4px 底边按压感） ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  min-height: 54px;
  border-radius: 14px;
  font-size: 17px; font-weight: 600;
  transition: transform 0.06s ease, filter 0.15s ease;
  user-select: none;
}
.btn-primary {
  background: var(--green); color: #fff;
  box-shadow: 0 4px 0 var(--green-press);
}
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--green-press); }
.btn-primary:disabled { background: var(--green-soft); box-shadow: 0 4px 0 #9CC98B; color: #ffffffcc; }
.btn-orange {
  background: var(--orange); color: #fff;
  box-shadow: 0 4px 0 var(--orange-dark);
}
.btn-orange:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--orange-dark); }
.btn-ghost { background: transparent; color: var(--ink-2); box-shadow: none; min-height: 44px; font-size: var(--fs-body); }
.btn-ghost:active { color: var(--ink); }

/* ---------- 顶部页面头 ---------- */
.page-head { padding: 20px 0 14px; }
.page-head .h1 { margin-bottom: 2px; }
.subpage-head {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 0 12px; position: sticky; top: 0; z-index: 5;
  background: var(--bg);
}
.subpage-head .h2 { flex: 1; }
.back-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card);
}
.back-btn:active { background: var(--green-bg); }

/* ---------- 底部 Tab / 侧边栏 ---------- */
#tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--divider);
  padding-bottom: env(safe-area-inset-bottom);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
.tab-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3);
  font-size: var(--fs-label);
  font-weight: 500;
}
.tab-item.active { color: var(--green-press); font-weight: 600; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: var(--fs-note);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

/* ---------- 底部弹层（sheet） ---------- */
#overlay { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
#overlay.open { pointer-events: auto; }
.sheet-mask {
  position: absolute; inset: 0; background: rgba(27,43,34,0.35);
  opacity: 0; transition: opacity 0.2s ease;
}
#overlay.open .sheet-mask { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 640px; margin: 0 auto;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.24s cubic-bezier(0.32, 0.72, 0.35, 1);
}
#overlay.open .sheet { transform: translateY(0); }
.sheet h3 { font-size: var(--fs-h2); margin-bottom: 12px; }
.sheet-row { display: flex; justify-content: space-between; padding: 10px 0; font-size: var(--fs-body); }
.sheet-row .v { font-weight: 600; }
.sheet .btn { margin-top: 14px; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center; padding: 40px 24px;
  color: var(--ink-2);
}
.empty .empty-icon {
  width: 72px; height: 72px; margin: 0 auto 14px;
  border-radius: 24px; background: var(--green-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--green);
}
.empty p { margin-bottom: 16px; }

/* ---------- 页面占位（阶段1） ---------- */
.placeholder-body { padding: 30px 0; }

/* ---------- 首次引导 ---------- */
.ob { display: flex; flex-direction: column; min-height: calc(100dvh - 40px); padding-top: 12dvh; }
.ob-top { padding-top: 6dvh; }
.ob-mascot {
  width: 120px; height: 120px; margin: 0 auto 18px;
  background: var(--green); border-radius: 34px;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.ob-brand { text-align: center; font-size: var(--fs-h2); font-weight: 700; margin-bottom: 12px; }
.ob-title { font-size: var(--fs-h1); font-weight: 700; text-align: center; line-height: 1.35; margin-bottom: 12px; }
.ob-top .ob-title { margin-top: 6px; }
.ob .note { text-align: center; }
.ob-top > .note { text-align: left; margin-bottom: 18px; }
.ob-foot { margin-top: auto; padding: 24px 0 12px; }
.ob-opts { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.ob-opt {
  position: relative; text-align: left;
  background: var(--card); border: 2px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px 18px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ob-opt.sel { border-color: var(--green); background: var(--green-bg); }
.ob-opt-name { font-size: 17px; font-weight: 600; margin-bottom: 2px; }
.ob-check {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: none; align-items: center; justify-content: center;
}
.ob-opt.sel .ob-check { display: flex; }

/* ---------- 首页 ---------- */
.home-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.home-streak { display: flex; align-items: center; gap: 6px; font-size: 17px; }
.home-streak b { font-size: var(--fs-h2); }
.flame-wrap { color: var(--orange); display: flex; }
.home-leaves {
  display: flex; align-items: center; gap: 6px;
  background: var(--green-bg); color: var(--green-press);
  border-radius: 999px; padding: 6px 14px; font-size: var(--fs-note);
}
.miss-hint {
  display: flex; align-items: center; gap: 6px;
  color: var(--ink-2); font-size: var(--fs-note);
  margin-bottom: 12px; padding: 0 4px;
}
.greet-card { display: flex; justify-content: space-between; align-items: center; }

.checkin-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.checkin-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid transparent; border-radius: 14px;
  background: var(--bg); text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.checkin-row:active { transform: scale(0.985); }
.checkin-row.on { border-color: var(--green); background: var(--green-bg); }
.ci-icon {
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--green-bg); color: var(--green-press);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.checkin-row.on .ci-icon { background: #fff; }
.ci-body { flex: 1; display: flex; flex-direction: column; }
.ci-name { font-weight: 600; }
.ci-carbon { font-size: var(--fs-label); color: var(--ink-3); }
.ci-check {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.checkin-row.on .ci-check { background: var(--green); border-color: var(--green); }

.checkin-done .h2 { color: var(--green-press); }
.done-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.done-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--green-bg); color: var(--green-press);
  font-size: var(--fs-note); font-weight: 500;
  padding: 5px 11px; border-radius: 999px;
}

.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tool-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 0; text-align: left; }
.tool-icon { margin-bottom: 4px; }
.tool-card b { font-size: var(--fs-body); }

/* ---------- 打卡成功页（唯一演出） ---------- */
.success-cover {
  position: fixed; inset: 0; z-index: 30;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.25s ease;
}
.success-inner {
  width: 100%; max-width: 400px; padding: 32px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.success-flame {
  width: 128px; height: 128px; border-radius: 40px;
  background: var(--orange-bg); color: var(--orange);
  display: flex; align-items: center; justify-content: center;
  animation: pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.success-num {
  font-size: var(--fs-num); font-weight: 700; letter-spacing: -2px;
  color: var(--orange-dark);
  margin-top: 18px;
  animation: rise 0.7s 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.success-bonus {
  margin-top: 10px; background: var(--orange-bg); color: var(--orange-dark);
  font-size: var(--fs-note); font-weight: 600;
  padding: 6px 14px; border-radius: 999px;
}
.week-dots { display: flex; gap: 12px; margin: 26px 0 8px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.wd-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--divider);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.wd-dot.on { background: var(--green); animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.success-btns { width: 100%; margin-top: 22px; display: flex; flex-direction: column; gap: 4px; }
.success-btns .btn { animation: fadeIn 0.4s 0.9s ease both; }
.success-inner > .h2, .success-inner > .note, .success-inner > .success-bonus { animation: fadeIn 0.5s 0.55s ease both; }
.week-dots { animation: fadeIn 0.5s 0.7s ease both; }

@keyframes pop { 0% { transform: scale(0.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { 0% { transform: translateY(16px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .success-flame, .success-num, .wd-dot.on { animation: none; }
  .page-enter > * { animation: none; }
  .bar-tip-g { animation: none; }
}

/* ---------- 电脑端适配（≥768px）：左侧导航 ---------- */
@media (min-width: 768px) {
  #app { display: flex; max-width: 1100px; margin: 0 auto; min-height: 100dvh; }
  #tabbar {
    position: sticky; top: 0; left: 0;
    flex-direction: column;
    width: 200px; height: 100dvh;
    border-top: none; border-right: 1px solid var(--divider);
    padding: 28px 12px;
    gap: 4px;
    background: var(--card);
    backdrop-filter: none;
    align-self: flex-start;
  }
  .tab-item {
    flex-direction: row; justify-content: flex-start;
    gap: 12px; padding: 12px 14px;
    border-radius: 12px; font-size: var(--fs-body);
  }
  .tab-item.active { background: var(--green-bg); }
  .tab-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: var(--fs-h2); font-weight: 700;
    padding: 0 14px 22px;
  }
  #view { flex: 1; padding-top: 8px; }
}
@media (max-width: 767px) {
  .tab-logo { display: none; }
  /* 深色胶囊浮栏（参考图导航语言，色取自 --ink 不新增色值） */
  #tabbar {
    left: 14px; right: 14px; bottom: calc(10px + env(safe-area-inset-bottom));
    height: 62px; padding-bottom: 0;
    border-top: none; border-radius: 999px;
    background: rgba(27,43,34,0.96);
    box-shadow: 0 10px 28px rgba(27,43,34,0.22);
  }
  .tab-item { color: #8FA396; transition: color 0.15s ease, transform 0.15s ease; }
  .tab-item:active { transform: scale(0.94); }
  .tab-item.active { color: var(--green); }
}

/* ---------- 闯关：地图 ---------- */
.leaf-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--green-bg); color: var(--green-press);
  padding: 6px 12px; border-radius: 999px;
  font-size: var(--fs-note); font-weight: 600;
}
.chapter-card { padding: 16px; }
.chapter-card.locked { opacity: 0.62; }
.chapter-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.chapter-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: var(--green-bg); color: var(--green-press);
  display: flex; align-items: center; justify-content: center;
}
.chapter-done {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.lv-list { display: flex; flex-direction: column; gap: 8px; }
.lv-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 12px;
  border: 1.5px solid var(--divider); background: var(--card);
  font-size: var(--fs-body); color: var(--ink);
  cursor: pointer; text-align: left; transition: border-color 0.15s ease;
}
.lv-row.open { border-color: var(--green-soft); }
.lv-row.open:active { background: var(--green-bg); }
.lv-row.locked { color: var(--ink-3); cursor: not-allowed; }
.lv-badge {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-note); font-weight: 700;
  background: var(--divider); color: var(--ink-2);
}
.lv-row.open .lv-badge { background: var(--green); color: #fff; }
.lv-row.done .lv-badge { background: var(--green-bg); color: var(--green-press); }
.lv-row.locked .lv-badge { background: var(--divider); color: var(--ink-3); }
.lv-name { flex: 1; font-weight: 600; }
.lv-state { font-size: var(--fs-note); color: var(--ink-3); }
.lv-row.done .lv-state { color: var(--green-press); font-weight: 600; }

/* ---------- 闯关：答题页 ---------- */
.q-bar {
  height: 6px; border-radius: 3px; background: var(--divider);
  margin: 4px 0 14px; overflow: hidden;
}
.q-bar-fill {
  height: 100%; border-radius: 3px; background: var(--green);
  transition: width 0.3s ease;
}
.q-card { padding: 18px; }
.q-text { font-size: 17px; font-weight: 600; line-height: 1.5; margin-bottom: 14px; }
.opt-list { display: flex; flex-direction: column; gap: 10px; }
.opt-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; border-radius: 14px;
  border: 1.5px solid var(--divider); background: var(--card);
  font-size: var(--fs-body); color: var(--ink); text-align: left; line-height: 1.4;
  cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease;
}
.opt-btn .opt-tag {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg); color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-note); font-weight: 700;
}
.opt-btn span:nth-child(2) { flex: 1; }
.opt-btn.on { border-color: var(--green); background: var(--green-bg); }
.opt-btn.on .opt-tag { background: var(--green); color: #fff; }
.opt-btn.right { border-color: var(--green); background: var(--green-bg); color: var(--green-press); }
.opt-btn.right .opt-tag { background: var(--green); color: #fff; }
.opt-btn.wrong { border-color: var(--divider); background: var(--bg); color: var(--ink-2); }
.opt-btn.wrong .opt-tag { background: var(--divider); color: var(--ink-2); }

.fb-bar {
  position: sticky; bottom: 12px; margin-top: 14px;
  border-radius: 16px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  animation: rise 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
  box-shadow: 0 8px 24px rgba(27, 43, 34, 0.10);
}
.fb-bar.ok { background: var(--green-bg); border: 1.5px solid var(--green-soft); }
.fb-bar.no { background: var(--card); border: 1.5px solid var(--divider); }
.fb-title { font-weight: 700; font-size: var(--fs-body); }
.fb-bar.ok .fb-title { color: var(--green-press); }
.fb-exp { font-size: var(--fs-note); color: var(--ink-2); line-height: 1.5; }
.fb-bar .btn { margin-top: 6px; height: 46px; }

/* ---------- 闯关：结算页 ---------- */
.result-wrap {
  min-height: 70dvh; padding: 48px 8px 24px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.result-icon {
  width: 96px; height: 96px; border-radius: 32px;
  background: var(--green-bg); color: var(--green-press);
  display: flex; align-items: center; justify-content: center;
  animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.result-num {
  font-size: var(--fs-num); font-weight: 700; letter-spacing: -2px;
  color: var(--ink); margin-top: 18px; line-height: 1;
}
.result-total { font-size: 24px; color: var(--ink-3); letter-spacing: 0; }
.result-leaves {
  width: 100%; max-width: 320px; margin: 18px 0 12px;
  display: flex; align-items: center; gap: 10px; justify-content: center;
  color: var(--green-press);
}
.result-btns { width: 100%; max-width: 320px; margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
@media (prefers-reduced-motion: reduce) {
  .result-icon { animation: none; }
}

/* ---------- 周报 ---------- */
.ring-wrap { flex-shrink: 0; }
.week-unit { font-size: 18px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.week-chart { width: 100%; height: auto; }
.bar-g rect { transition: opacity 0.12s ease; }
.bar-g:active rect { opacity: 0.75; }
/* 柱顶黑色数值标签（参考图 tooltip 语言），仅当天/选中柱显示 */
.bar-tip-g { animation: fadeIn 0.25s ease both; pointer-events: none; }
.bar-tip-g rect { fill: var(--ink); }
.bar-tip-g text { fill: #fff; font-size: 10px; font-weight: 700; }
.dd-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dd-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--divider); }
.dd-row:first-of-type { border-top: none; }
.dd-icon {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  background: var(--green-bg); color: var(--green-press);
  display: flex; align-items: center; justify-content: center;
}
.conv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.conv-card {
  text-align: center; padding: 14px 6px; margin-bottom: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.conv-icon {
  width: 40px; height: 40px; border-radius: 14px;
  background: var(--green-bg); color: var(--green-press);
  display: flex; align-items: center; justify-content: center; margin-bottom: 6px;
}
.conv-card b { font-size: 20px; }
.top-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--divider); }
.top-row:first-of-type { border-top: none; }
.top-rank {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--green-bg); color: var(--green-press);
  font-size: var(--fs-label); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- 垃圾分类查询 ---------- */
.gb-search-wrap { position: relative; margin-bottom: 12px; }
.gb-search-wrap svg { position: absolute; left: 14px; top: 13px; color: var(--ink-3); }
.gb-search {
  width: 100%; height: 46px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card);
  padding: 0 16px 0 42px; font-size: var(--fs-body); color: var(--ink);
  outline: none;
}
.gb-search:focus { border-color: var(--green); }
.gb-tabs { display: flex; gap: 8px; margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.gb-tabs::-webkit-scrollbar { display: none; }
.gb-tab {
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  border: 1.5px solid var(--divider); background: var(--card);
  font-size: var(--fs-note); font-weight: 600; color: var(--ink-2);
}
.gb-item { border-bottom: 1px solid var(--divider); }
.gb-item:last-child { border-bottom: none; }
.gb-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 13px 2px; text-align: left;
  font-size: var(--fs-body); color: var(--ink);
}
.gb-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.gb-name { flex: 1; }
.gb-cat { font-size: var(--fs-label); font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.gb-note { font-size: var(--fs-note); color: var(--ink-2); padding: 0 2px 13px 20px; line-height: 1.5; }
.gb-tip { display: flex; gap: 8px; padding: 8px 0; border-top: 1px solid var(--divider); }
.gb-tip:first-of-type { border-top: none; }
.gb-tip-icon { color: var(--orange); flex-shrink: 0; margin-top: 2px; }

/* ---------- 商城 ---------- */
.shop-tabs {
  display: flex; gap: 4px; background: var(--divider);
  border-radius: 999px; padding: 4px; margin-bottom: 14px;
}
.shop-tab {
  flex: 1; padding: 9px 0; border-radius: 999px;
  font-size: var(--fs-note); font-weight: 600; color: var(--ink-2);
}
.shop-tab.on { background: var(--card); color: var(--green-press); }
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 768px) { .shop-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .checkin-list { display: grid; grid-template-columns: 1fr 1fr; } }
.prod-card {
  margin-bottom: 0; padding: 16px 14px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
}
.prod-icon {
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--green-bg); color: var(--green-press);
  display: flex; align-items: center; justify-content: center;
}
.prod-name { font-size: var(--fs-body); line-height: 1.35; }
.prod-leaves {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--green-press); font-size: var(--fs-note); font-weight: 600;
}
.prod-btn { min-height: 42px; height: 42px; font-size: var(--fs-body); border-radius: 12px; margin-top: 4px; }
.prod-btn:disabled { box-shadow: 0 4px 0 var(--divider); }

/* 券 */
.coupon-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 0; text-align: left; border-bottom: 1px solid var(--divider);
}
.coupon-row:last-child { border-bottom: none; }
.coupon-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: var(--orange-bg); color: var(--orange-dark);
  display: flex; align-items: center; justify-content: center;
}
.coupon-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.coupon-code { font-family: var(--mono); font-size: var(--fs-note); color: var(--ink-2); }
.coupon-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.coupon-status {
  font-size: var(--fs-label); font-weight: 600;
  color: var(--green-press); background: var(--green-bg);
  padding: 3px 9px; border-radius: 999px;
}
.coupon-big {
  font-family: var(--mono); font-size: 24px; font-weight: 700; letter-spacing: 2px;
  color: var(--ink); background: var(--bg); border: 1.5px dashed var(--green-soft);
  border-radius: 14px; padding: 16px 10px; margin: 14px 0 8px;
  word-break: break-all;
}

/* ---------- 我的 ---------- */
.ip-card { display: flex; gap: 14px; align-items: center; }
.ip-icon {
  width: 76px; height: 76px; border-radius: 24px; flex-shrink: 0;
  background: var(--green-bg); color: var(--green-press);
  display: flex; align-items: center; justify-content: center;
}
.ip-bar { height: 8px; border-radius: 999px; background: var(--divider); overflow: hidden; }
.ip-bar-fill {
  display: block; height: 100%; border-radius: 999px;
  background: var(--green); transition: width 0.4s ease;
}
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-cell {
  margin-bottom: 14px; padding: 14px 6px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.stat-icon {
  width: 36px; height: 36px; border-radius: 12px; margin-bottom: 6px;
  background: var(--green-bg); color: var(--green-press);
  display: flex; align-items: center; justify-content: center;
}
.stat-cell b { font-size: 22px; }
.stat-unit { font-size: var(--fs-note); font-weight: 500; color: var(--ink-3); }
.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.badge-cell {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px; border-radius: 14px; color: var(--ink-3);
}
.badge-cell:active { background: var(--bg); }
.badge-cell .badge-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--divider); color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
}
.badge-cell.earned { color: var(--ink); }
.badge-cell.earned .badge-icon { background: var(--orange-bg); color: var(--orange-dark); }
.badge-name { font-size: var(--fs-label); font-weight: 600; }
.badge-state { font-size: var(--fs-note); color: var(--ink-3); margin-top: 6px; }
.badge-state.on { color: var(--green-press); font-weight: 600; }

/* 设置行与开关 */
.set-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--divider);
}
.set-row:first-of-type { border-top: none; }
.toggle {
  width: 48px; height: 28px; border-radius: 999px; flex-shrink: 0;
  background: var(--divider); position: relative;
  transition: background 0.15s ease;
}
.toggle-dot {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(27,43,34,0.18);
  transition: left 0.15s ease;
}
.toggle.on { background: var(--green); }
.toggle.on .toggle-dot { left: 23px; }
.time-input {
  height: 36px; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 0 10px; font-size: var(--fs-body); color: var(--ink);
  background: var(--card); outline: none;
}
.time-input:focus { border-color: var(--green); }
.btn-danger {
  background: var(--cat-harmful); color: #fff;
  box-shadow: 0 4px 0 #C0503F;
}
.btn-danger:active { transform: translateY(3px); box-shadow: 0 1px 0 #C0503F; }
.about-row {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 10px 0; border-top: 1px solid var(--divider);
}
.about-row:first-of-type { border-top: none; }
