/* =========================================================
 * app.css —— 移动端小程序风格视觉系统
 * 主题：植物绿 · 生长环 · 卡片化
 * ========================================================= */

:root {
  --green: #2E7D46;
  --green-2: #58A36B;
  --green-3: #7BC47F;
  --green-bg: #F2F5EE;
  --amber: #E9A23B;
  --blue: #3E7CB1;
  --brown: #8D6E63;
  --red: #C0504D;
  --ink: #22301F;
  --ink-2: #5C6B58;
  --ink-3: #93A08D;
  --card: #FFFFFF;
  --line: #E4EADF;
  --radius: 16px;
  --shadow: 0 2px 14px rgba(46, 94, 56, 0.07);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  background: #E8EDE3;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.ic { display: inline-block; vertical-align: -3px; }

/* ---------- 应用外壳 ---------- */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--green-bg);
  position: relative;
  padding-bottom: 84px;
  box-shadow: 0 0 40px rgba(40, 70, 48, 0.08);
}

#view { padding: 14px 14px 20px; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 底部导航 ---------- */
#tabbar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: rgba(255,255,255,.97);
  border-top: 1px solid var(--line);
  display: flex;
  padding: 6px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--ink-3); font-size: 11px; cursor: pointer;
  padding: 4px 0; user-select: none;
}
.tab .ic { transition: transform .2s; }
.tab.active { color: var(--green); font-weight: 600; }
.tab.active .ic { transform: translateY(-1px); }

/* ---------- 通用按钮 ---------- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--green); color: #fff; border: none;
  border-radius: 22px; padding: 11px 22px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity .15s, transform .1s;
  box-shadow: 0 4px 14px rgba(46, 125, 70, .25);
}
.btn-primary:active { opacity: .85; transform: scale(.98); }
.btn-block { display: flex; width: 100%; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: #fff; color: var(--green); border: 1.5px solid var(--green);
  border-radius: 22px; padding: 10px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-mini { background: var(--green); color: #fff; border: none; border-radius: 14px; padding: 6px 14px; font-size: 12px; cursor: pointer; }
.btn-add {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--green-3); color: var(--green); border: none;
  border-radius: 16px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  background: #FDF1F0; color: var(--red); border: 1px solid #EDD3D1;
  border-radius: 14px; padding: 8px 16px; font-size: 12px; cursor: pointer;
}
.btn-row-2 { display: flex; gap: 12px; margin-top: 16px; }
.btn-row-2 > * { flex: 1; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 10px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge.healthy { background: #E3F2E6; color: var(--green); }
.badge.thirsty { background: #E4F0FA; color: var(--blue); }
.badge.sick { background: #FBE7E6; color: var(--red); }
.badge.dormant { background: #EDF0EB; color: var(--ink-2); }
.badge.dead { background: #EFEFED; color: var(--ink-3); }

/* ---------- 标题 ---------- */
.section-title { font-size: 16px; font-weight: 700; margin: 18px 2px 10px; display: flex; align-items: baseline; gap: 6px; }
.title-num { color: var(--amber); font-size: 14px; }
.title-sub { color: var(--ink-3); font-size: 12px; font-weight: 400; }

/* ---------- 首页 Header ---------- */
.home-header { display: flex; gap: 10px; }
.weather-card {
  flex: 1; background: linear-gradient(135deg, #2E7D46 0%, #3F9A5B 100%);
  border-radius: var(--radius); color: #fff; padding: 14px;
  box-shadow: 0 6px 18px rgba(46, 125, 70, .22);
}
.weather-top { display: flex; gap: 12px; align-items: center; }
.weather-icon { background: rgba(255,255,255,.16); border-radius: 12px; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.weather-city { font-size: 13px; opacity: .92; }
.weather-temp { font-size: 26px; font-weight: 800; line-height: 1.2; letter-spacing: .5px; }
.weather-range { font-size: 13px; font-weight: 500; opacity: .85; }
.weather-meta { font-size: 11.5px; opacity: .85; }
.weather-tip { margin-top: 10px; font-size: 12px; line-height: 1.5; background: rgba(255,255,255,.14); border-radius: 10px; padding: 7px 9px; }
.me-block { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0 2px; cursor: pointer; }
.me-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.me-avatar-svg { background: linear-gradient(135deg, #7BC47F, #3F9A5B); color: #fff; display: flex; align-items: center; justify-content: center; }
.me-level { font-size: 10.5px; color: var(--ink-2); background: #fff; border-radius: 9px; padding: 2px 7px; font-weight: 600; }

/* ---------- 今日卡（阳历/农历/节气/时钟） ---------- */
.today-card {
  margin-top: 12px; background: var(--card); border-radius: 14px;
  padding: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  box-shadow: var(--shadow); border: 1px solid rgba(46, 125, 70, .08);
}
.today-date { font-size: 19px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.today-week {
  font-size: 12px; font-weight: 700; color: var(--green-2);
  background: rgba(88, 163, 107, .12); border-radius: 8px; padding: 2px 8px;
  margin-left: 4px; vertical-align: 2px;
}
.today-lunar { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.today-badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.today-badge { font-size: 11px; font-weight: 700; border-radius: 8px; padding: 2px 9px; color: #fff; }
.today-badge.term { background: var(--amber); }
.today-badge.lunar { background: var(--red); }
.today-badge.solar { background: var(--blue); }
.today-badge.week { background: var(--green-2); }
.today-badge.plain { background: #B8C4B4; }
.today-next { font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.today-clock { text-align: right; flex-shrink: 0; }
.clock-time {
  font-size: 24px; font-weight: 800; color: var(--green);
  font-variant-numeric: tabular-nums; letter-spacing: 1.5px; line-height: 1.15;
}
.clock-label { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; }

/* ---------- 季节贴士 ---------- */
.season-tip {
  margin-top: 12px; background: #FFF8EC; border: 1px solid #F3E5C2;
  border-radius: 12px; padding: 10px 12px; font-size: 12.5px; color: #7A6438;
  display: flex; gap: 8px; line-height: 1.6;
}
.season-tag { background: var(--amber); color: #fff; border-radius: 8px; padding: 1px 8px; font-size: 11px; font-weight: 700; white-space: nowrap; height: fit-content; }

/* ---------- 快捷入口 ---------- */
.quick-row { display: flex; gap: 10px; margin-top: 12px; }
.quick-item {
  flex: 1; background: var(--card); border-radius: 14px; padding: 12px 0 10px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--ink); cursor: pointer;
  box-shadow: var(--shadow);
}
.quick-ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; }
.quick-ic-book { background: linear-gradient(135deg, #58A36B, #2E7D46); }
.quick-ic-tools { background: linear-gradient(135deg, #E9A23B, #D98A1F); }
.quick-ic-community { background: linear-gradient(135deg, #7BC47F, #3E7CB1); }

/* ---------- 任务列表 ---------- */
.task-list { display: flex; flex-direction: column; gap: 9px; }
.task-item {
  background: var(--card); border-radius: 14px; padding: 12px 12px;
  display: flex; align-items: center; gap: 11px; box-shadow: var(--shadow);
  border-left: 3px solid transparent;
}
.task-item.overdue { border-left-color: var(--red); background: #FDF7F6; }
.task-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.task-icon.drop { background: linear-gradient(135deg, #4A90D9, #3E7CB1); }
.task-icon.nutri { background: linear-gradient(135deg, #8D6E63, #6F5247); }
.task-icon.loosen { background: linear-gradient(135deg, #E9A23B, #D98A1F); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 600; }
.task-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.txt-warn { color: var(--red); font-weight: 600; }
.btn-done {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--green); color: #fff; border: none; border-radius: 16px;
  padding: 7px 12px; font-size: 12px; font-weight: 600; cursor: pointer; flex-shrink: 0;
}

/* ---------- 花园 ---------- */
.garden-head { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.plant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.plant-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .12s;
}
.plant-card:active { transform: scale(.97); }
.plant-card-img { position: relative; aspect-ratio: 1; background: #EAF0E4; }
.plant-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plant-card-state { position: absolute; top: 8px; left: 8px; }
.plant-card-body { padding: 9px 10px 11px; display: flex; flex-direction: column; gap: 2px; }
.plant-card-name { font-size: 14px; font-weight: 700; }
.plant-card-species { font-size: 11.5px; color: var(--ink-3); }
.plant-card-ring { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.ring-mini { font-size: 12px; font-weight: 800; fill: var(--ink); }
.plant-card-days { font-size: 11px; font-weight: 600; }
.plant-card-days.ok { color: var(--green-2); }
.plant-card-days.soon { color: var(--amber); }
.plant-card-days.due { color: var(--red); }

/* ---------- 空态 ---------- */
.empty-state { background: var(--card); border-radius: var(--radius); padding: 34px 20px; text-align: center; box-shadow: var(--shadow); }
.empty-icon { color: var(--green-3); margin-bottom: 8px; }
.empty-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.empty-desc { font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }
.empty-mini { background: var(--card); border-radius: 12px; padding: 16px; text-align: center; color: var(--ink-3); font-size: 13px; box-shadow: var(--shadow); }

/* ---------- 首页统计 ---------- */
.home-stats { display: flex; background: var(--card); border-radius: var(--radius); margin-top: 14px; padding: 14px 0; box-shadow: var(--shadow); }
.stat { flex: 1; text-align: center; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-num { font-size: 20px; font-weight: 800; color: var(--green); }
.stat-label { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* ---------- 通用页头 ---------- */
.page-title-row { display: flex; flex-direction: column; gap: 2px; padding: 6px 2px 12px; }
.page-title { font-size: 22px; font-weight: 800; }
.page-sub { font-size: 13px; color: var(--ink-3); }

/* ---------- 搜索 ---------- */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border-radius: 14px; padding: 11px 14px;
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.search-ic { color: var(--ink-3); }
.search-bar input { flex: 1; border: none; outline: none; font-size: 14px; background: transparent; color: var(--ink); }

/* ---------- 分类 Tabs ---------- */
.cat-tabs { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  background: var(--card); border: none; border-radius: 16px; padding: 8px 18px;
  font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; font-weight: 500;
}
.cat-tab.active { background: var(--green); color: #fff; font-weight: 600; }

/* ---------- 百科列表 ---------- */
.wiki-list, .add-list { display: flex; flex-direction: column; gap: 10px; }
.wiki-row {
  background: var(--card); border-radius: 14px; padding: 10px;
  display: flex; align-items: center; gap: 11px; box-shadow: var(--shadow); cursor: pointer;
}
.wiki-thumb { width: 66px; height: 66px; border-radius: 11px; overflow: hidden; flex-shrink: 0; background: #EAF0E4; }
.wiki-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wiki-info { flex: 1; min-width: 0; }
.wiki-name { font-size: 14.5px; font-weight: 700; display: flex; align-items: baseline; gap: 6px; }
.wiki-latin { font-size: 10.5px; color: var(--ink-3); font-weight: 400; }
.wiki-desc { font-size: 12px; color: var(--ink-2); margin: 2px 0 5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.wiki-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.wiki-tag {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--green-bg); color: var(--ink-2); border-radius: 8px;
  padding: 2px 7px; font-size: 11px;
}
.cat-观叶 { background: #E3F2E6; color: var(--green); }
.cat-观花 { background: #FDEBF0; color: #C0507E; }
.cat-多肉 { background: #EDF0FA; color: #4A5FA8; }
.cat-香草 { background: #FFF6E5; color: #B07A1F; }
.wiki-arrow { color: var(--ink-3); }

/* ---------- 详情页 ---------- */
.detail-hero { position: relative; border-radius: var(--radius); overflow: hidden; background: #EAF0E4; }
.detail-hero img { width: 100%; aspect-ratio: 16/11; object-fit: cover; display: block; }
.nav-back {
  position: fixed; top: 12px; left: max(12px, calc(50% - 240px + 12px)); z-index: 20;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: none; color: var(--ink);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.detail-body { padding: 16px 2px 10px; }
.detail-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.detail-name { font-size: 20px; font-weight: 800; }
.detail-latin { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.detail-desc { font-size: 13px; color: var(--ink-2); margin-top: 8px; line-height: 1.65; }

/* 仪表盘 */
.dash-row { display: flex; justify-content: space-around; background: var(--card); border-radius: var(--radius); padding: 14px 6px; margin-top: 12px; box-shadow: var(--shadow); }
.ring { text-align: center; }
.ring-num { font-size: 13px; font-weight: 800; }
.ring-label { font-size: 12px; font-weight: 600; color: var(--ink); margin-top: 5px; }
.ring-sub { font-size: 10px; color: var(--ink-3); margin-top: 1px; }

/* 植物档案 */
.plant-meta-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.pm { background: var(--card); border-radius: 12px; padding: 9px 6px; text-align: center; box-shadow: var(--shadow); }
.pm-k { font-size: 10.5px; color: var(--ink-3); }
.pm-v { font-size: 12.5px; font-weight: 700; margin-top: 1px; }

/* 快捷操作 */
.act-row { display: flex; gap: 9px; margin-top: 12px; }
.act-main {
  flex: 1.4; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, #4A90D9, #3E7CB1); color: #fff; border: none;
  border-radius: 14px; padding: 13px 0; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 12px rgba(62, 124, 177, .25);
}
.act-sub {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 14px; padding: 13px 0; font-size: 12.5px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow);
}

/* 下次任务 */
.next-task-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.nt {
  flex: 1; min-width: 100px; background: var(--card); border-radius: 12px; padding: 9px 10px;
  font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; box-shadow: var(--shadow);
}
.nt b { color: var(--ink); font-size: 12.5px; margin-left: auto; }
.nt-ic { color: var(--green-2); }

/* 时间轴 */
.timeline { position: relative; padding-left: 4px; }
.tl-item { display: flex; gap: 12px; position: relative; }
.tl-rail { width: 30px; display: flex; flex-direction: column; align-items: center; }
.tl-dot {
  width: 28px; height: 28px; border-radius: 50%; margin-top: 2px;
  display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.tl-dot.type-浇水 { background: linear-gradient(135deg, #4A90D9, #3E7CB1); }
.tl-dot.type-施肥 { background: linear-gradient(135deg, #8D6E63, #6F5247); }
.tl-dot.type-松土 { background: linear-gradient(135deg, #E9A23B, #D98A1F); }
.tl-dot.type-修剪 { background: linear-gradient(135deg, #7BC47F, #58A36B); }
.tl-dot.type-记录 { background: linear-gradient(135deg, #9AA7A0, #7C8A83); }
.tl-body { flex: 1; background: var(--card); border-radius: 12px; padding: 9px 11px; margin-bottom: 10px; box-shadow: var(--shadow); }
.tl-head { display: flex; align-items: center; gap: 8px; }
.tl-type { font-size: 12.5px; font-weight: 700; color: var(--green); }
.tl-date { font-size: 11px; color: var(--ink-3); margin-left: auto; }
.tl-note { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.tl-photo { margin-top: 6px; border-radius: 8px; overflow: hidden; }
.tl-photo img { width: 100%; max-height: 150px; object-fit: cover; display: block; }

/* 养护指南 */
.guide-panel { background: var(--card); border-radius: var(--radius); margin-top: 14px; box-shadow: var(--shadow); overflow: hidden; }
.guide-head { display: flex; align-items: center; gap: 8px; padding: 14px; font-size: 15px; font-weight: 700; cursor: pointer; color: var(--green); }
.guide-arrow { margin-left: auto; transition: transform .2s; }
.guide-arrow.open { transform: rotate(90deg); }
.guide-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.guide-card { background: var(--card); border-radius: var(--radius); padding: 6px 14px; margin-top: 12px; box-shadow: var(--shadow); }
.guide-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; }
.guide-item + .guide-item { border-top: 1px solid var(--line); }
.guide-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--green-bg); color: var(--green); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.guide-c { flex: 1; }
.guide-k { font-size: 12.5px; font-weight: 700; }
.guide-v { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }

/* 季节卡 */
.season-card { background: #FFF8EC; border: 1px solid #F3E5C2; border-radius: var(--radius); padding: 13px; margin-top: 12px; }
.season-card-t { font-size: 13px; font-weight: 700; color: #7A6438; display: flex; align-items: center; gap: 6px; }
.season-card-b { font-size: 12.5px; color: #6E5B33; margin-top: 6px; line-height: 1.65; }

.detail-tip { background: var(--green-bg); border-radius: 12px; padding: 11px 13px; font-size: 12.5px; color: var(--ink-2); margin-top: 12px; display: flex; gap: 7px; line-height: 1.6; }

.danger-row { display: flex; gap: 8px; margin-top: 14px; }
.danger-row > * { flex: 1; }

/* ---------- 添加流程 ---------- */
.add-steps { display: flex; align-items: flex-start; margin: 12px 0 16px; }
.add-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; }
.add-step + .add-step::before {
  content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px;
  background: var(--line); z-index: 0;
}
.add-step.done + .add-step::before, .add-step.done::before { background: var(--green-3); }
.add-step-dot {
  width: 26px; height: 26px; border-radius: 50%; background: var(--line); color: var(--ink-3);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; z-index: 1;
}
.add-step.cur .add-step-dot { background: var(--green); color: #fff; box-shadow: 0 0 0 4px rgba(46,125,70,.15); }
.add-step.done .add-step-dot { background: var(--green-3); color: #fff; }
.add-step-t { font-size: 11px; color: var(--ink-3); }
.add-step.cur .add-step-t { color: var(--green); font-weight: 700; }

.add-scan {
  background: linear-gradient(135deg, #2E7D46, #3F9A5B); border-radius: var(--radius);
  padding: 26px; text-align: center; color: #fff; cursor: pointer; box-shadow: 0 8px 20px rgba(46,125,70,.25);
}
.scan-circle {
  width: 74px; height: 74px; margin: 0 auto 10px; border-radius: 50%;
  background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center;
  border: 2px dashed rgba(255,255,255,.55);
}
.scan-t { font-size: 16px; font-weight: 800; }
.scan-d { font-size: 12px; opacity: .85; margin-top: 3px; }
.or-divider { text-align: center; color: var(--ink-3); font-size: 12px; margin: 16px 0 12px; position: relative; }
.hot-row { margin-bottom: 12px; }
.hot-label { font-size: 13px; font-weight: 700; margin-bottom: 8px; display: block; }
.hot-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hot-chip {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 6px 14px; font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.hot-chip:active { background: var(--green); color: #fff; border-color: var(--green); }

.pick-preview { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); margin-bottom: 12px; }
.pick-preview img { width: 62px; height: 62px; border-radius: 11px; object-fit: cover; }
.pick-name { font-size: 15px; font-weight: 700; }
.pick-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

.form-card { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.form-row input[type="text"], .form-row input[type="number"], .form-row input[type="date"] {
  width: 100%; border: 1.5px solid var(--line); border-radius: 11px; padding: 10px 12px;
  font-size: 14px; outline: none; background: #FBFCF9; color: var(--ink);
}
.form-row input:focus { border-color: var(--green); background: #fff; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: #FBFCF9; border: 1.5px solid var(--line); border-radius: 16px;
  padding: 6px 14px; font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.chip.active { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }

.plan-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.plan-title { font-size: 15px; font-weight: 800; color: var(--green); display: flex; align-items: center; gap: 7px; }
.plan-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.plan-row { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.plan-item { display: flex; gap: 10px; align-items: center; background: var(--green-bg); border-radius: 12px; padding: 10px 12px; }
.plan-ic { color: var(--green); }
.plan-k { font-size: 11.5px; color: var(--ink-3); }
.plan-v { font-size: 13.5px; font-weight: 700; }
.plan-note { font-size: 11.5px; color: var(--ink-3); margin-top: 12px; }

/* ---------- 工具 ---------- */
.tool-card {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); margin-bottom: 10px; cursor: pointer;
}
.tool-ic { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.tool-ic-sun { background: linear-gradient(135deg, #E9A23B, #D9821F); }
.tool-ic-drop { background: linear-gradient(135deg, #4A90D9, #3E7CB1); }
.tool-ic-pin { background: linear-gradient(135deg, #58A36B, #2E7D46); }
.tool-c { flex: 1; }
.tool-t { font-size: 15px; font-weight: 700; }
.tool-d { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.tool-arrow { color: var(--ink-3); }

.tool-panel { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-top: 14px; }
.scene-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.scene-item { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 14px; padding: 13px; cursor: pointer; }
.scene-item:active { border-color: var(--green); background: var(--green-bg); }
.scene-ic { color: var(--amber); }
.scene-c { flex: 1; }
.scene-t { font-size: 13.5px; font-weight: 700; }
.scene-d { font-size: 12px; color: var(--ink-3); }
.scene-arrow { color: var(--ink-3); }
.scene-result { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 13px; }
.scene-result-t { font-size: 13.5px; font-weight: 700; margin-bottom: 9px; }
.rec-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rec-chip {
  background: var(--green-bg); color: var(--green); border: 1px solid var(--green-3);
  border-radius: 16px; padding: 6px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}

.water-result { margin-top: 14px; background: var(--green-bg); border-radius: 12px; padding: 14px; text-align: center; }
.water-num { font-size: 30px; font-weight: 800; color: var(--green); }
.water-num span { font-size: 14px; }
.water-desc { font-size: 12px; color: var(--ink-2); margin-top: 4px; line-height: 1.6; text-align: left; }

.map-head { display: flex; align-items: center; gap: 7px; background: var(--green); color: #fff; border-radius: 12px; padding: 11px 13px; font-size: 13px; font-weight: 600; }
.market-list { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.market-row { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.market-pin { width: 34px; height: 34px; border-radius: 10px; background: var(--green-bg); color: var(--green); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.market-c { flex: 1; min-width: 0; }
.market-name { font-size: 14px; font-weight: 700; }
.market-rating { font-size: 11px; color: var(--amber); font-weight: 600; margin-left: 5px; }
.market-addr { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.market-dist { font-size: 12.5px; color: var(--green); font-weight: 700; }

/* ---------- 社区 ---------- */
.topic-row { background: var(--card); border-radius: var(--radius); padding: 13px; box-shadow: var(--shadow); margin-bottom: 12px; }
.topic-row-t { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.topic-list { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-chip {
  background: var(--green-bg); border: 1px solid var(--green-3); color: var(--green);
  border-radius: 16px; padding: 6px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.topic-chip.hot { background: #FFF6E5; border-color: #F0D9A8; color: #B07A1F; }
.topic-count { font-size: 10.5px; opacity: .8; margin-left: 3px; }
.post-list { display: flex; flex-direction: column; gap: 11px; }
.post-card { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.post-head { display: flex; gap: 10px; align-items: center; }
.post-avatar { width: 38px; height: 38px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.post-name { font-size: 13.5px; font-weight: 700; }
.post-level { font-size: 11px; color: var(--ink-3); }
.post-topic { margin-top: 9px; font-size: 12px; font-weight: 700; color: var(--green); background: var(--green-bg); border-radius: 8px; padding: 4px 9px; display: inline-block; }
.post-text { font-size: 13.5px; margin-top: 8px; line-height: 1.65; }
.post-img { margin-top: 10px; border-radius: 11px; overflow: hidden; }
.post-img img { width: 100%; max-height: 240px; object-fit: cover; display: block; }
.post-actions { display: flex; gap: 18px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.post-act { display: inline-flex; align-items: center; gap: 4px; background: none; border: none; color: var(--ink-3); font-size: 12.5px; cursor: pointer; }
.post-act.liked { color: #D96B5F; }
.comment-box { margin-top: 10px; background: var(--green-bg); border-radius: 11px; padding: 9px 11px; display: flex; flex-direction: column; gap: 7px; }
.comment-row { font-size: 12.5px; color: var(--ink-2); }
.cmt-user { font-weight: 700; color: var(--green); }
.comment-input-row { display: flex; gap: 7px; margin-top: 3px; }
.comment-input-row input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font-size: 12.5px; outline: none; background: #fff; }
.post-publish {
  margin-top: 14px; background: var(--green); color: #fff; border-radius: 14px;
  padding: 13px; text-align: center; font-size: 14px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 4px 14px rgba(46,125,70,.25);
}

/* ---------- 我的 ---------- */
.me-hero { background: linear-gradient(135deg, #2E7D46, #3F9A5B); border-radius: var(--radius); padding: 22px 18px; text-align: center; color: #fff; }
.me-big-avatar { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 8px; background: rgba(255,255,255,.2); object-fit: cover; }
.me-big-svg { display: flex; align-items: center; justify-content: center; color: #fff; }
.me-hero-name { font-size: 18px; font-weight: 800; }
.me-hero-level { font-size: 12.5px; opacity: .9; margin-top: 2px; }
.me-exp-bar { background: rgba(255,255,255,.22); border-radius: 6px; height: 7px; margin-top: 12px; overflow: hidden; }
.me-exp-fill { background: #FFD98A; height: 100%; border-radius: 6px; }
.me-stats-row { display: flex; background: var(--card); border-radius: var(--radius); margin-top: 12px; padding: 14px 0; box-shadow: var(--shadow); }
.me-stat { flex: 1; text-align: center; }
.me-stat + .me-stat { border-left: 1px solid var(--line); }
.me-stat-num { font-size: 19px; font-weight: 800; color: var(--green); }
.me-stat-label { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.menu-list { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.menu-item {
  display: flex; align-items: center; gap: 11px; background: var(--card);
  border-radius: 14px; padding: 14px; box-shadow: var(--shadow); cursor: pointer; font-size: 14px; font-weight: 600;
}
.menu-item .ic:last-child { margin-left: auto; color: var(--ink-3); }
.menu-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--green-bg); color: var(--green); display: flex; align-items: center; justify-content: center; }
.about-note { font-size: 11.5px; color: var(--ink-3); line-height: 1.7; margin-top: 16px; padding: 0 4px; }

/* ---------- 二级页 ---------- */
.sub-page { animation: fadeIn .25s ease; }
.sub-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; position: sticky; top: -14px; z-index: 20; background: var(--green-bg); padding: 14px 0 8px; margin-top: -14px; }
.sub-title { font-size: 17px; font-weight: 800; }
.sub-head .nav-back { position: static; box-shadow: none; background: var(--green-bg); }

.set-card { background: var(--card); border-radius: var(--radius); padding: 6px 14px; box-shadow: var(--shadow); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-label { font-size: 14px; font-weight: 600; }
.set-desc { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.set-note { font-size: 11.5px; color: var(--ink-3); line-height: 1.7; margin-top: 12px; padding: 0 4px; }

/* Switch */
.switch { position: relative; display: inline-block; width: 46px; height: 27px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: #D5DDD0; border-radius: 20px; cursor: pointer; transition: .2s;
}
.slider::before {
  content: ''; position: absolute; width: 21px; height: 21px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(19px); }

.quiet-time { display: flex; align-items: center; gap: 6px; }
.quiet-time input[type="time"] { border: 1.5px solid var(--line); border-radius: 10px; padding: 7px 8px; font-size: 12.5px; outline: none; background: #FBFCF9; }

/* 反馈 */
.fb-card { background: var(--card); border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); margin-top: 14px; }
.fb-types { display: flex; flex-wrap: wrap; gap: 8px; margin: 9px 0 13px; }
.fb-type {
  background: #FBFCF9; border: 1.5px solid var(--line); border-radius: 16px;
  padding: 6px 14px; font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.fb-type.active { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.fb-area { width: 100%; border: 1.5px solid var(--line); border-radius: 11px; padding: 11px; font-size: 13.5px; outline: none; background: #FBFCF9; font-family: inherit; resize: vertical; margin-bottom: 13px; }
.fb-area:focus { border-color: var(--green); }
.fb-history { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 13px; display: flex; flex-direction: column; gap: 9px; }
.fb-item { background: var(--green-bg); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--ink-2); }
.fb-item-h { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-bottom: 4px; font-weight: 600; }

/* ---------- 弹层 ---------- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(30, 46, 34, .5); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .18s ease;
}
.sheet {
  background: #fff; width: 100%; max-width: 480px; border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(20px + env(safe-area-inset-bottom)); animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-title { font-size: 16px; font-weight: 800; margin-bottom: 13px; }
.sheet textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 11px; padding: 11px; font-size: 13.5px; outline: none; font-family: inherit; resize: vertical; margin: 12px 0; background: #FBFCF9; }

.dialog {
  background: #fff; width: 86%; max-width: 400px; border-radius: 18px;
  padding: 20px 18px; margin: auto; animation: fadeIn .2s ease; position: relative; top: 22%;
}
.dialog-t { font-size: 16px; font-weight: 800; text-align: center; }
.dialog-d { font-size: 13px; color: var(--ink-2); margin-top: 8px; line-height: 1.7; }
.dialog-btns { display: flex; gap: 10px; margin-top: 16px; }
.dialog-btns > * { flex: 1; }

/* 识别动画 */
.scan-anim { margin: auto; text-align: center; color: #fff; }
.scan-anim-ring {
  width: 110px; height: 110px; margin: 0 auto 16px; border-radius: 50%;
  border: 3px dashed rgba(255,255,255,.7); animation: spin 2.2s linear infinite;
  display: flex; align-items: center; justify-content: center;
}
.scan-anim-ic { position: absolute; margin-top: -72px; margin-left: -15px; }
.scan-anim-t { font-size: 14px; font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }

.scan-picks { display: flex; gap: 10px; margin: 14px 0; }
.scan-pick { flex: 1; text-align: center; cursor: pointer; }
.scan-pick img { width: 100%; aspect-ratio: 1; border-radius: 11px; object-fit: cover; border: 2px solid transparent; }
.scan-pick:active img { border-color: var(--green); }
.scan-pick-n { font-size: 12.5px; font-weight: 600; margin-top: 5px; }

.scan-pick-s { font-size: 11px; color: var(--green); margin-top: 3px; font-weight: 600; }
.scan-pick-noimg { width: 100%; aspect-ratio: 1; border-radius: 11px; background: var(--green-bg); display: flex; align-items: center; justify-content: center; color: #7BA88A; border: 2px dashed #CDE3D3; }
.scan-source .btn { margin-bottom: 10px; }
.scan-source .dialog-d { margin-bottom: 12px; }

.ask-desc { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.pest-list { margin: 13px 0; display: flex; flex-direction: column; gap: 9px; max-height: 260px; overflow-y: auto; }
.pest-row { background: var(--green-bg); border-radius: 10px; padding: 9px 11px; }
.pest-name { font-size: 13px; font-weight: 700; color: var(--green); }
.pest-s { font-size: 12px; color: var(--ink-2); margin-top: 2px; line-height: 1.55; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%) translateY(10px);
  background: rgba(34, 48, 31, .92); color: #fff; border-radius: 20px;
  padding: 10px 20px; font-size: 13px; z-index: 200; opacity: 0; pointer-events: none;
  transition: all .25s ease; max-width: 84%; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ok { background: rgba(46, 125, 70, .95); }

/* ---------- 水滴动画 ---------- */
.drop-anim {
  position: fixed; z-index: 300; color: #4A90D9; pointer-events: none;
  animation: dropFall .9s ease-out forwards;
}
@keyframes dropFall {
  0% { opacity: 0; transform: translateY(-20px) scale(.6); }
  25% { opacity: 1; transform: translateY(0) scale(1.1); }
  60% { opacity: 1; transform: translateY(30px) scale(1); }
  100% { opacity: 0; transform: translateY(70px) scale(.8); }
}

/* ---------- 响应式（桌面居中留白） ---------- */
@media (min-width: 520px) {
  body { background: #DFE6DA; }
  #tabbar { border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
