:root {
  --green: #1F6E43;
  --green-dark: #174F31;
  --green-light: #E7F2EA;
  --bg: #F4F7F5;
  --card: #FFFFFF;
  --text: #1F2937;
  --muted: #6B7280;
  --gold: #F59E0B;
  --red: #DC2626;
  --border: #E5E7EB;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; }

#topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--green);
  color: #fff;
  box-shadow: var(--shadow);
}

.topbar-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

#brandTitle { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#todayLabel { font-size: 12px; opacity: .85; flex-shrink: 0; }

#app { max-width: 640px; margin: 0 auto; padding: 14px 14px 100px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 15px; color: var(--green); margin-bottom: 12px; }
.card h3 { font-size: 14px; margin-bottom: 8px; }

.page-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.page-sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }

.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .num { font-size: 21px; font-weight: 700; margin-top: 4px; }
.kpi.accent { background: var(--green); color: #fff; }
.kpi.accent .label { color: rgba(255, 255, 255, .8); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn.secondary { background: #fff; color: var(--green); border: 1px solid var(--green); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn.small { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn.danger { background: var(--red); }
.btn.gold { background: var(--gold); }
.btn-block { width: 100%; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
textarea { resize: vertical; min-height: 60px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid .full { grid-column: 1 / -1; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }

.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row .main { font-size: 14px; font-weight: 600; }
.list-row .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.actions { display: flex; gap: 6px; flex-shrink: 0; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; background: var(--green-light); color: var(--green); font-weight: 600; }
.badge.warn { background: #FEF3C7; color: #92400E; }
.badge.red { background: #FEE2E2; color: var(--red); }
.badge.gray { background: #F3F4F6; color: #6B7280; }
.tag { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 6px; background: #EEF2FF; color: #3730A3; margin-right: 4px; }

.empty { text-align: center; color: var(--muted); padding: 26px 0; font-size: 13px; }
.tip { background: var(--green-light); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--green-dark); margin-bottom: 10px; }
.hint { font-size: 11px; color: var(--muted); margin-top: 5px; }

.progress { height: 8px; background: #E5E7EB; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--green); border-radius: 99px; }
.progress .warn { background: var(--gold); }

#bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
#bottomnav .nav-inner { max-width: 640px; margin: 0 auto; display: flex; }
#bottomnav button {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 0 7px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
#bottomnav button.active { color: var(--green); font-weight: 700; }
#bottomnav .ico { font-size: 20px; line-height: 1; }

.subnav { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.subnav button {
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.subnav button.active { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }

.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-item { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; cursor: pointer; border: none; text-align: left; }
.menu-item .ico { font-size: 22px; }
.menu-item .t { font-weight: 700; font-size: 14px; margin-top: 6px; }
.menu-item .d { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

.toast {
  position: fixed;
  top: calc(66px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 13px;
  z-index: 99;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
  max-width: 80vw;
  text-align: center;
}

/* ---------- 对外展示页 ---------- */
.share-hero { background: linear-gradient(135deg, var(--green) 0%, #2E8B57 100%); color: #fff; text-align: center; padding: 46px 20px 40px; }
.share-hero .logo { width: 64px; height: 64px; margin: 0 auto 14px; }
.share-hero h1 { font-size: 24px; font-weight: 800; letter-spacing: 2px; }
.share-hero .slogan { font-size: 14px; opacity: .9; margin-top: 8px; line-height: 1.6; }
.share-body { max-width: 640px; margin: 0 auto; padding: 18px 14px 60px; }
.share-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.share-card h2 { font-size: 16px; color: var(--green); margin-bottom: 12px; padding-left: 10px; border-left: 4px solid var(--green); }
.share-card p { font-size: 14px; line-height: 1.8; color: var(--text); }
.share-price { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.share-price:last-child { border-bottom: none; }
.share-price .p { color: var(--green); font-weight: 700; white-space: nowrap; padding-left: 10px; }
.share-event { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.share-event:last-child { border-bottom: none; }
.share-event .name { font-weight: 700; font-size: 15px; }
.share-event .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.share-footer { text-align: center; padding: 18px 0 40px; font-size: 12px; color: var(--muted); }
.share-contact { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; }
.share-contact .ico { font-size: 18px; }
.share-btn { display: block; width: 100%; margin-top: 16px; }
