:root {
  --bg: #f2f4f7;
  --card: #ffffff;
  --ink: #1f2329;
  --sub: #8a9099;
  --line: #eef0f3;
  --brand: #2e7d32;
  --brand-soft: #e8f5e9;
  --accent: #1565c0;
  --gold: #b8860b;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 24px rgba(0,0,0,0.04);
}

/* 顶栏 */
.topbar {
  position: relative;
  background: linear-gradient(135deg, var(--brand), #388e3c);
  color: #fff;
  padding: 18px 18px 30px;
}
.topbar .park { font-size: 17px; font-weight: 700; letter-spacing: 0.5px; }
/* “数据更新于…” 定位在色块右下角 */
.topbar .sub {
  position: absolute;
  right: 18px;
  bottom: 12px;
  text-align: right;
  font-size: 12px;
  opacity: 0.85;
  margin-top: 0;
}

/* 内容区 */
.content { flex: 1; overflow-y: auto; padding: 14px 14px 90px; }
.page { display: none; }
.page.active { display: block; }

/* 卡片通用 */
.card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-title { font-size: 13px; color: var(--sub); margin-bottom: 10px; }

/* 今日指标网格 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric { background: #fafbfc; border-radius: 10px; padding: 12px; }
.metric .k { font-size: 12px; color: var(--sub); }
.metric .v { font-size: 19px; font-weight: 700; margin-top: 4px; }

/* 物业应得 大绿卡 */
.hero {
  background: linear-gradient(135deg, var(--brand), #43a047);
  color: #fff;
  border-radius: 16px;
  padding: 18px 18px 16px;
  margin-bottom: 12px;
  box-shadow: 0 6px 18px rgba(46,125,50,0.25);
}
.hero .label { font-size: 13px; opacity: 0.9; }
.hero .amount { font-size: 34px; font-weight: 800; margin: 6px 0 2px; letter-spacing: 0.5px; }
.hero .note { font-size: 12px; opacity: 0.9; }
.hero .row { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12px; opacity: 0.95; }

/* 近7日柱状图 */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding-top: 6px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar { width: 70%; background: linear-gradient(180deg, #66bb6a, #43a047); border-radius: 5px 5px 0 0; min-height: 4px; transition: height 0.4s ease; }
.bar.today { background: linear-gradient(180deg, #ffb300, #f9a825); }
.bar-label { font-size: 10px; color: var(--sub); margin-top: 6px; }

/* 统计页 日期选择 */
.date-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; }
.date-chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 13px;
  color: var(--sub);
}
.date-chip.sel { background: var(--brand); color: #fff; border-color: var(--brand); }

/* 我的页 */
.info-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--sub); }
.info-row .v { font-weight: 600; }
.notice { font-size: 12px; color: var(--sub); line-height: 1.7; margin-top: 6px; }

/* 底部 tab */
.tabbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--sub);
  padding: 4px 0;
}
.tab .ic { font-size: 20px; display: block; margin-bottom: 2px; }
.tab.active { color: var(--brand); font-weight: 600; }

.loading { text-align: center; color: var(--sub); padding: 40px 0; font-size: 14px; }
