/* ============================================================
   七百弄鸡 · 现代农事（家禽）综合服务中心
   主题：绿色农业风（对应设计稿），移动端优先
   ============================================================ */
:root {
  --g-900: #0b6b33;
  --g-800: #0f7d3d;
  --g-700: #0f9d58;
  --g-600: #16a95c;
  --g-100: #e3f4e9;
  --g-050: #f0faf4;
  --ink: #1c231f;
  --ink-2: #5b6660;
  --ink-3: #97a29c;
  --bg: #f4f6f5;
  --card: #ffffff;
  --line: #edf0ee;
  --red: #e64545;
  --orange: #f08c1e;
  --blue: #3d7ef2;
  --purple: #7a5af0;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(20, 60, 35, .06);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; box-shadow: 0 0 24px rgba(0,0,0,.05); }
.hidden { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 顶部 ---------- */
.page-header { padding: 0; }
.header-green {
  background: linear-gradient(150deg, #12a556 0%, #0c8a45 55%, #0a6e38 100%);
  color: #fff; padding: 18px 18px 22px;
  border-radius: 0 0 22px 22px;
}
.header-plain { background: var(--card); padding: 14px 18px; border-bottom: 1px solid var(--line); }
.h-row { display: flex; align-items: center; justify-content: space-between; }
.h-title { font-size: 20px; font-weight: 700; }
.h-sub { font-size: 12.5px; opacity: .88; margin-top: 5px; }
.h-back { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.18); cursor: pointer; }
.header-plain .h-back { background: var(--g-050); color: var(--g-800); }
.h-back svg { width: 17px; height: 17px; }
.pill-btn {
  font-size: 12.5px; padding: 6px 13px; border-radius: 20px; cursor: pointer;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.45); color: #fff;
}
.badge { font-size: 10.5px; padding: 2px 7px; border-radius: 8px; font-weight: 600; }
.badge-green { background: var(--g-100); color: var(--g-800); }
.badge-orange { background: #fdf0df; color: #d9740c; }
.badge-gray { background: #eef1ef; color: var(--ink-2); }
.badge-red { background: #fdeaea; color: var(--red); }
.badge-blue { background: #e8f0fe; color: var(--blue); }

/* ---------- 主体 ---------- */
.page-main { padding: 14px 14px 86px; }
.page-main.no-top { padding-top: 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px; margin-bottom: 13px; }
.sec-title { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 2px 11px; }
.sec-title h3 { font-size: 16.5px; font-weight: 700; }
.sec-title .more { font-size: 12.5px; color: var(--ink-3); cursor: pointer; }
.sec-title .more.on-green { color: rgba(255,255,255,.85); }

/* 统计格 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stat-cell { text-align: center; }
.stat-cell b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.stat-cell span { font-size: 11.5px; color: var(--ink-2); }
.stat-cell b em { font-style: normal; font-size: 11px; font-weight: 600; margin-left: 1px; }

/* 农事时间线 */
.task-item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.task-item:last-child { border-bottom: none; }
.task-time { font-size: 13px; color: var(--ink-2); width: 46px; flex-shrink: 0; font-weight: 600; }
.task-name { flex: 1; font-size: 14px; line-height: 1.45; }
.task-name small { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.task-state { flex-shrink: 0; }

/* 快捷服务九宫格 */
.svc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 6px; }
.svc-item { display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; }
.svc-ico { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; }
.svc-ico svg { width: 21px; height: 21px; }
.svc-item span { font-size: 11.5px; color: var(--ink-2); }
.bg-green { background: var(--g-100); color: var(--g-700); }
.bg-orange { background: #fdf0df; color: #e58312; }
.bg-blue { background: #e8f0fe; color: var(--blue); }
.bg-purple { background: #efeafe; color: var(--purple); }
.bg-red { background: #fdeaea; color: var(--red); }
.bg-cyan { background: #e2f5f4; color: #149a90; }
.bg-yellow { background: #fdf6dc; color: #c9a10e; }
.bg-gray { background: #eef1ef; color: var(--ink-2); }

/* 行情卡 */
.market-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.mk-cell { background: var(--g-050); border-radius: 12px; padding: 11px 8px; text-align: center; }
.mk-cell .mk-name { font-size: 11.5px; color: var(--ink-2); }
.mk-cell .mk-price { font-size: 18px; font-weight: 800; margin: 3px 0 2px; }
.mk-cell .mk-chg { font-size: 11px; font-weight: 700; }
.up { color: var(--red); } .down { color: #12a35a; }

/* 进度条 */
.bar { height: 6px; background: #e6efe9; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #16a95c, #0f9d58); border-radius: 4px; }

/* 列表条目 */
.row-item { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row-item:last-child { border-bottom: none; }
.row-ico { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.row-ico svg { width: 19px; height: 19px; }
.row-main { flex: 1; min-width: 0; }
.row-main b { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.row-main small { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.row-side { text-align: right; flex-shrink: 0; }
.row-side b { font-size: 14px; }
.row-side small { display: block; color: var(--ink-3); font-size: 11px; margin-top: 2px; }
.arrow { color: #c3cbc6; font-size: 16px; }

/* 分布色块 */
.dist-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dist-cell { border-radius: 11px; padding: 10px 6px; text-align: center; cursor: pointer; }
.dist-cell b { display: block; font-size: 17px; font-weight: 800; }
.dist-cell span { font-size: 10.5px; }
.d-hot { background: #fde8e2; color: #d84b2a; }
.d-warm { background: #fdf0df; color: #d9740c; }
.d-mid { background: #e4f3e6; color: #2e9455; }
.d-cool { background: #eef4ee; color: #6f8f79; }
.legend { display: flex; gap: 14px; justify-content: flex-end; font-size: 11px; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }

/* 商城 */
.search-box { background: #f0f2f1; border-radius: 20px; padding: 9px 14px; font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.cat-row { display: flex; gap: 8px; overflow-x: auto; padding: 13px 0 4px; }
.cat-row::-webkit-scrollbar { display: none; }
.cat-chip { flex-shrink: 0; font-size: 13px; padding: 6px 15px; border-radius: 17px; background: #fff; color: var(--ink-2); border: 1px solid var(--line); cursor: pointer; }
.cat-chip.active { background: var(--g-700); color: #fff; border-color: var(--g-700); font-weight: 600; }
.filter-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin: 10px 2px; }
.filter-row .fl { display: flex; gap: 14px; }
.filter-row .fl span.on { color: var(--g-700); font-weight: 700; }
.goods-card { display: flex; gap: 12px; }
.goods-img { width: 86px; height: 86px; border-radius: 12px; background: linear-gradient(135deg, #fdf3d8, #f7e3ae); display: flex; align-items: center; justify-content: center; font-size: 34px; flex-shrink: 0; }
.goods-main { flex: 1; min-width: 0; }
.goods-main b { font-size: 14.5px; font-weight: 700; display: block; }
.goods-sup { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ink-2); margin-top: 4px; }
.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.tag { font-size: 10px; padding: 2px 7px; border-radius: 6px; background: var(--g-100); color: var(--g-800); }
.tag.blue { background: #e8f0fe; color: var(--blue); }
.tag.orange { background: #fdf0df; color: #d9740c; }
.goods-bottom { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; }
.goods-price { color: var(--red); font-weight: 800; font-size: 17px; }
.goods-price em { font-style: normal; font-size: 11px; font-weight: 500; color: var(--ink-3); }
.goods-sales { font-size: 11px; color: var(--ink-3); }

/* 养殖分布顶部数字 */
.big-stats { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.big-stats b { font-size: 21px; font-weight: 800; display: block; }
.big-stats span { font-size: 11px; opacity: .85; }

/* 角色卡 */
.role-item { display: flex; align-items: center; gap: 13px; padding: 15px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; margin-bottom: 11px; cursor: pointer; }
.role-item.active { border-color: var(--g-700); background: var(--g-050); }
.role-ico { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.role-ico svg { width: 20px; height: 20px; }
.role-main { flex: 1; }
.role-main b { font-size: 15px; }
.role-main small { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 3px; }
.role-now { font-size: 11px; color: var(--g-700); font-weight: 700; }

/* 我的页 */
.profile-card { border-radius: 18px; padding: 18px 16px; color: #fff; background: linear-gradient(140deg, #14a557, #0b7a3d); margin-bottom: 13px; }
.profile-top { display: flex; align-items: center; gap: 13px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; flex-shrink: 0; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-top: 16px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.22); }

/* 表单/详情 */
.detail-line { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.detail-line:last-child { border-bottom: none; }
.detail-line span { color: var(--ink-2); }
.detail-line b { font-weight: 600; }

/* 资金流向链 */
.flow-chain { position: relative; padding-left: 22px; }
.flow-chain::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--g-100); }
.flow-node { position: relative; padding: 0 0 16px; }
.flow-node::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--g-700); border: 2px solid #d9efe1; }
.flow-node b { font-size: 13.5px; display: block; }
.flow-node small { color: var(--ink-3); font-size: 11.5px; display: block; margin-top: 2px; }
.flow-amt { font-weight: 800; color: var(--g-800); }

/* ---------- 底部导航 ---------- */
.tab-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: #fff; z-index: 50;
  display: flex; padding: 7px 0 10px; border-top: 1px solid var(--line);
}
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--ink-3); font-size: 10.5px; cursor: pointer; }
.tab-item .tab-ico { width: 23px; height: 23px; }
.tab-item.active { color: var(--g-700); font-weight: 700; }

/* ---------- 弹层 / Toast ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(10, 30, 18, .45); z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.modal-sheet { background: #fff; width: 100%; max-width: 480px; border-radius: 20px 20px 0 0; padding: 18px 18px 28px; max-height: 78vh; overflow-y: auto; }
.toast {
  position: fixed; left: 50%; top: 46%; transform: translate(-50%,-50%); z-index: 99;
  background: rgba(20,40,28,.88); color: #fff; font-size: 13.5px; padding: 11px 20px; border-radius: 10px;
}
.btn {
  display: block; width: 100%; border: none; border-radius: 12px; padding: 13px;
  background: var(--g-700); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 16px;
}
.btn.ghost { background: var(--g-050); color: var(--g-800); }
.btn.sm { width: auto; display: inline-block; padding: 7px 16px; font-size: 12.5px; margin-top: 0; border-radius: 9px; }
.inp {
  width: 100%; border: 1.5px solid var(--line); border-radius: 11px; padding: 11px 12px;
  font-size: 14px; background: #fafbfa; color: var(--ink); outline: none; appearance: auto;
}
.inp:focus { border-color: var(--g-600); background: #fff; }
