/* ============================================================
   本草植物饮 H5 商城系统 · 公共样式
   移动端优先；管理后台复用（.admin- 前缀）
   ============================================================ */
:root {
  --primary: #2f7d5c;
  --primary-dark: #215943;
  --primary-light: #eaf4ee;
  --gold: #b98a2f;
  --gold-light: #f7efdc;
  --danger: #c0392b;
  --text: #24332b;
  --text-sub: #6b7a72;
  --bg: #f4f7f3;
  --card: #ffffff;
  --border: #e3ebe4;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(33, 89, 67, 0.08);
}

* { 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);
  line-height: 1.6;
}

/* ---------- 移动端容器 ---------- */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 72px;
}

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 16px 18px 14px;
  border-radius: 0 0 22px 22px;
}
.topbar h1 { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.topbar .sub { font-size: 12px; opacity: 0.85; margin-top: 2px; }

/* ---------- 底部导航 ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 9px 0 8px;
  font-size: 11px;
  color: var(--text-sub);
  text-decoration: none;
}
.bottom-nav a .ico { font-size: 20px; display: block; line-height: 1.2; }
.bottom-nav a.active { color: var(--primary); font-weight: 600; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 12px 14px;
}
.card h3 { font-size: 15px; margin-bottom: 10px; }
.card .muted { font-size: 12px; color: var(--text-sub); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn:active { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.gold { background: var(--gold); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 14px; font-size: 13px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--primary); }
.tip { font-size: 12px; color: var(--text-sub); margin-top: 6px; }

/* ---------- 徽标 / 标签 ---------- */
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.tag.green { background: var(--primary-light); color: var(--primary); }
.tag.gold { background: var(--gold-light); color: var(--gold); }
.tag.gray { background: #eef1ee; color: var(--text-sub); }
.tag.red { background: #fdecea; color: var(--danger); }

/* ---------- 金额 ---------- */
.money { color: var(--danger); font-weight: 700; }
.money.big { font-size: 22px; }
.money.plain { color: var(--primary); }

/* ---------- 列表 ---------- */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item .l { font-size: 14px; }
.list-item .r { font-size: 14px; color: var(--text-sub); text-align: right; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--text-sub); padding: 34px 0; font-size: 13px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 32, 25, 0.88);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 999;
  display: none;
  max-width: 80%;
}
#toast.show { display: block; }

/* ---------- 阶梯 / 权益块 ---------- */
.tier-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin: 12px 14px;
  background: #fff;
}
.tier-card.hot { border-color: var(--gold); background: linear-gradient(180deg, #fffdf7, #fff); }
.tier-card .tier-name { font-size: 18px; font-weight: 700; color: var(--primary-dark); }
.tier-card.hot .tier-name { color: var(--gold); }
.tier-card ul { list-style: none; margin: 10px 0; }
.tier-card ul li { font-size: 13px; color: var(--text); padding: 4px 0 4px 20px; position: relative; }
.tier-card ul li::before { content: '✓'; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
.tier-card.hot ul li::before { color: var(--gold); }

/* ---------- 分节 ---------- */
.section-title { font-size: 15px; font-weight: 700; margin: 18px 14px 2px; color: var(--text); }

/* ---------- 管理后台 ---------- */
.admin-shell { display: flex; min-height: 100vh; max-width: 1400px; margin: 0 auto; }
.admin-side {
  width: 220px;
  background: var(--primary-dark);
  color: #fff;
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-side .brand { font-size: 16px; font-weight: 700; padding: 6px 12px 18px; border-bottom: 1px solid rgba(255,255,255,0.15); margin-bottom: 10px; }
.admin-side a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 2px;
}
.admin-side a:hover, .admin-side a.active { background: rgba(255,255,255,0.14); color: #fff; }
.admin-main { flex: 1; padding: 20px 24px; max-width: calc(100% - 220px); }
.admin-main h2 { font-size: 20px; margin-bottom: 16px; }
.admin-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.admin-toolbar input, .admin-toolbar select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.admin-card { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table th { color: var(--text-sub); font-weight: 600; background: #fafcfa; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 16px; }
.stat-card .num { font-size: 26px; font-weight: 700; color: var(--primary-dark); }
.stat-card .label { font-size: 12px; color: var(--text-sub); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

@media (max-width: 820px) {
  .admin-side { width: 62px; padding: 12px 6px; }
  .admin-side .brand { font-size: 12px; padding: 6px 4px 14px; text-align: center; }
  .admin-side a { font-size: 12px; text-align: center; padding: 10px 2px; }
  .admin-main { max-width: none; padding: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- 登录分隔 ---------- */
.divider { text-align: center; color: var(--text-sub); font-size: 13px; margin: 16px 0; position: relative; }
.divider::before, .divider::after { content: ''; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--border); }
.divider::before { left: 0; }
.divider::after { right: 0; }

/* 链接 */
.link { color: var(--primary); text-decoration: none; font-size: 14px; }
.mt10 { margin-top: 10px; }
.mb8 { margin-bottom: 8px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* ---------- 商城（二期）：弹窗 / 分段选择 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 32, 25, 0.45);
  z-index: 80;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-mask.show { display: flex; }
.modal-box {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 20px 18px 26px;
  max-height: 88vh;
  overflow-y: auto;
}
.seg { display: flex; gap: 8px; }
.seg label {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-sub);
}
.seg input { display: none; }
.seg input:checked + span { color: var(--primary); font-weight: 700; }
.seg label.sel { border-color: var(--primary); background: var(--primary-light); }

/* ---------- 三期/四期：进货寄卖（抢单 v2） ---------- */
.rush-hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  border-radius: var(--radius);
  padding: 18px;
  margin: 12px 14px;
  box-shadow: var(--shadow);
}
.rush-hero .rowline { display: flex; justify-content: space-between; align-items: baseline; }
.rush-hero .price { font-size: 30px; font-weight: 800; line-height: 1.2; }
.rush-hero .price small { font-size: 13px; font-weight: 500; opacity: 0.85; }
.rush-hero .tag { background: rgba(255,255,255,0.2); color: #fff; }
.rush-hero .tag.gold { background: rgba(255,255,255,0.18); color: #ffe9b3; }
.rush-hero .muted { color: rgba(255,255,255,0.8); }
.progress-wrap { margin-top: 12px; }
.progress-bar { height: 8px; background: rgba(255,255,255,0.22); border-radius: 999px; overflow: hidden; }
.progress-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #ffe9b3, #ffd76a); border-radius: 999px; transition: width 0.5s; }
.progress-caption { display: flex; justify-content: space-between; font-size: 11px; opacity: 0.9; margin-top: 5px; }
.stat-mini { display: flex; gap: 10px; margin: 12px 14px 2px; }
.stat-mini .cell { flex: 1; background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 12px 10px; text-align: center; }
.stat-mini .num { font-size: 19px; font-weight: 800; color: var(--primary-dark); }
.stat-mini .label { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.list-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.paycode-thumb { margin-top: 8px; }
.paycode-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.paycode-thumb .urltext { font-size: 11px; color: var(--text-sub); word-break: break-all; }
.rush-tip { font-size: 12px; color: var(--text-sub); padding: 4px 2px 0; }
.qty-stepper { display: flex; align-items: center; gap: 10px; }
.qty-stepper button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--primary); background: #fff; color: var(--primary); font-size: 18px; font-weight: 700; cursor: pointer; }
.qty-stepper button:active { background: var(--primary-light); }
.qty-stepper .qty { font-size: 20px; font-weight: 800; width: 40px; text-align: center; }
.assess-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.assess-row:last-child { border-bottom: none; }