:root {
  --green: #4caf50;
  --green-dark: #2e7d32;
  --orange: #f57c00;
  --bg: #e8f5e9;
  --card: #ffffff;
  --text: #1c1b19;
  --muted: #7a7873;
  --line: #eceae6;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #9fd3e8 0%, #bfe3c4 30%, #8bc98f 100%);
  color: var(--text);
  max-width: 480px;
  margin: 0 auto;
}
#app { min-height: 100%; display: flex; flex-direction: column; }

/* 顶部栏 */
.topbar {
  height: 52px; background: var(--green-dark); color: #fff;
  display: flex; align-items: center; justify-content: center;
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 18px; font-weight: 600; }

/* 主区 */
.main { flex: 1; padding: 14px 14px 90px; }
.page-title { font-size: 17px; font-weight: 600; margin: 6px 2px 14px; color: var(--green-dark); }

/* 卡片 */
.card {
  background: var(--card); border-radius: 16px; padding: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.08); margin-bottom: 14px;
}
.hero { text-align: center; padding: 26px 16px; }
.hero .emoji { font-size: 56px; }
.hero h1 { font-size: 26px; color: var(--green-dark); margin: 10px 0 6px; }
.hero p { color: var(--muted); font-size: 14px; }

/* 周期条 */
.flow { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 16px; }
.flow .step { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.flow .step .ico { font-size: 22px; }
.flow .arrow { color: var(--muted); }

/* 统计网格 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-grid .stat { text-align: center; }
.stat-grid .stat .num { font-size: 22px; font-weight: 700; color: var(--green-dark); }
.stat-grid .stat .label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 入口按钮 */
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.entry {
  border-radius: 16px; padding: 22px 12px; text-align: center; color: #fff;
  font-size: 17px; font-weight: 600; border: none; cursor: pointer;
}
.entry.green { background: var(--green); }
.entry.orange { background: var(--orange); }
.entry.brown { background: #6d4c41; }
.entry .ico { font-size: 26px; display: block; margin-bottom: 8px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 12px; padding: 12px 18px; font-size: 15px; cursor: pointer;
}
.btn-green { background: var(--green); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-ghost { background: #fff; color: var(--orange); border: 1px solid var(--orange); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; }

/* 商品网格 */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.product-img { height: 96px; background: #f1f3f0; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.product-body { padding: 12px; }
.product-name { font-size: 15px; font-weight: 600; }
.product-desc { font-size: 12px; color: var(--muted); margin: 6px 0; min-height: 32px; }
.product-price { color: #e53935; font-weight: 700; }
.product-stock { font-size: 12px; color: var(--muted); }
.product-actions { display: flex; gap: 8px; margin-top: 10px; }
.product-actions .btn { flex: 1; padding: 9px 6px; font-size: 13px; }

/* 分类标签 */
.chips { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 20px;
  padding: 7px 14px; font-size: 13px; white-space: nowrap; cursor: pointer;
}
.chip.active { background: var(--green); color: #fff; border-color: var(--green); }

/* 表单 */
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 14px; margin-bottom: 6px; }
.form-item input, .form-item select, .form-item textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-size: 15px; background: #fafaf8;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 列表 */
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: none; }
.list-item .ico { font-size: 26px; }
.list-item .info { flex: 1; }
.list-item .title { font-size: 15px; font-weight: 600; }
.list-item .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.empty { text-align: center; color: var(--muted); padding: 50px 0; }
.empty .ico { font-size: 44px; display: block; margin-bottom: 10px; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: #fff; display: flex;
  border-top: 1px solid var(--line); z-index: 20;
}
.tab-item {
  flex: 1; border: none; background: none; padding: 8px 0; font-size: 12px; color: var(--muted); cursor: pointer;
}
.tab-item .tab-icon { display: block; font-size: 20px; margin-bottom: 2px; }
.tab-item.active { color: var(--green); font-weight: 600; }

/* 弹窗 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-content {
  background: #fff; width: 100%; max-width: 480px; border-radius: 20px 20px 0 0;
  padding: 20px 18px 26px; max-height: 82vh; overflow-y: auto;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { font-size: 17px; }
.modal-close { border: none; background: #f1f3f0; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; }

/* toast */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50;
}
.toast.show { opacity: 1; }

.badge {
  display: inline-block; background: #e53935; color: #fff; border-radius: 10px;
  font-size: 11px; padding: 0 6px; margin-left: 2px;
}

/* 行内操作按钮组 / 购物车数量 */
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cart-qty { display: flex; align-items: center; gap: 8px; }
.cart-qty button { min-width: 28px; }
