/* H5 样式库 — 按《设计规范》实现：深绿 #1F4A33 + 米白 #F5F4EF + 点缀金 #C9A05C */
:root {
  --primary: #1F4A33;
  --primary-dark: #153524;
  --primary-light: #2E6B4A;
  --secondary: #3E8E63;
  --accent: #C9A05C;
  --bg: #F5F4EF;
  --card: #FFFFFF;
  --tip-bg: #FBF6E9;
  --text: #1F2924;
  --text-sub: #6B7A72;
  --text-disabled: #A8B3AC;
  --line: #E8EAE5;
  --warning: #D48806; --warning-bg: #FFF7E6;
  --success: #2E7D4F; --success-bg: #E8F5EC;
  --danger: #C4453C; --danger-bg: #FDECEA;
  --info: #3572B0; --info-bg: #E8F1FA;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 22px;
  max-width: 480px; margin: 0 auto; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }

/* ---- 顶部栏 ---- */
.topbar {
  height: 44px; display: flex; align-items: center; justify-content: center;
  background: var(--card); position: sticky; top: 0; z-index: 20;
  font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--line);
}
.topbar .back { position: absolute; left: 12px; font-size: 20px; color: var(--text); padding: 4px 8px; }
.topbar .rules-entry { position: absolute; right: 12px; font-size: 13px; font-weight: 400; color: var(--secondary); padding: 4px 8px; }
.topbar.green { background: var(--primary); color: #fff; border-bottom: none; }
.topbar.green .back { color: #fff; }

/* ---- 底部导航 ---- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; z-index: 30;
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #8A948E; font-size: 10px; }
.tabbar a.active { color: var(--primary); font-weight: 600; }
.tabbar .ticon { font-size: 21px; line-height: 1; }
.page { padding: 16px 16px calc(76px + env(safe-area-inset-bottom)); }
.page.no-tab { padding-bottom: 24px; }

/* ---- 卡片 ---- */
.card { background: var(--card); border-radius: 12px; padding: 16px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(31,74,51,.06); }
.card-dark {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff; border-radius: 12px; padding: 20px 16px; margin-bottom: 12px;
}
.card-dark .label { font-size: 12px; opacity: .8; }
.card-dark .big-num { font-size: 32px; line-height: 40px; font-weight: 700; }
.card-dark .big-num small { font-size: 14px; font-weight: 400; }
.card-tip { background: var(--tip-bg); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; font-size: 12px; color: var(--text-sub); }
.card-tip .tip-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }

/* 三联统计 */
.stat-row { display: flex; text-align: center; margin-top: 14px; }
.stat-row .item { flex: 1; border-right: 1px solid rgba(255,255,255,.2); }
.stat-row .item:last-child { border-right: none; }
.stat-row .v { font-size: 20px; font-weight: 700; }
.stat-row .k { font-size: 12px; opacity: .75; margin-top: 2px; }
.stat-row.light .item { border-color: var(--line); }
.stat-row.light .v { color: var(--text); }
.stat-row.light .k { color: var(--text-sub); opacity: 1; }

/* 首页头部 */
.home-head { background: var(--primary); color: #fff; padding: 12px 16px 20px; }
.home-head .brand { display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 600; }
.home-head .welcome { font-size: 12px; opacity: .85; margin-top: 6px; }
.home-head .badge-user { background: var(--accent); color: #fff; font-size: 10px; border-radius: 3px; padding: 1px 6px; margin-right: 6px; }
.home-stats { display: flex; gap: 10px; margin-top: 14px; }
.home-stats .hs { flex: 1; background: rgba(255,255,255,.12); border-radius: 10px; padding: 10px 8px; text-align: center; }
.home-stats .hs .k { font-size: 12px; opacity: .8; }
.home-stats .hs .v { font-size: 20px; font-weight: 700; margin-top: 2px; }

/* 常用操作宫格 */
.grid-ops { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grid-ops a { background: var(--card); border-radius: 12px; padding: 14px 4px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; box-shadow: 0 2px 8px rgba(31,74,51,.06); }
.grid-ops .op-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--success-bg); display: flex; align-items: center; justify-content: center; font-size: 20px; }

/* Banner */
.banner-wrap { position: relative; border-radius: 12px; overflow: hidden; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(31,74,51,.06); }
.banner-track { display: flex; transition: transform .4s; }
.banner-track .slide { min-width: 100%; position: relative; }
.banner-track img { width: 100%; aspect-ratio: 2.35/1; object-fit: cover; display: block; }
.banner-track .slide-title { position: absolute; left: 12px; bottom: 10px; color: #fff; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.banner-dots { position: absolute; bottom: 8px; right: 12px; display: flex; gap: 5px; }
.banner-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.4); }
.banner-dots i.on { background: #fff; }

/* 区块标题 */
.sec-title { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 600; margin: 16px 0 10px; }
.sec-title .more { font-size: 12px; color: var(--text-sub); font-weight: 400; }

/* 资讯 */
.news-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: none; }
.news-item img { width: 96px; height: 64px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--line); }
.news-item .nt { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-item .nd { font-size: 12px; color: var(--text-sub); margin-top: 4px; }

/* 入口卡 */
.entry-card { display: flex; align-items: center; gap: 12px; }
.entry-card .e-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--success-bg); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.entry-card .e-main { flex: 1; }
.entry-card .e-title { font-weight: 600; }
.entry-card .e-sub { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

/* ---- 按钮 ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; padding: 0 16px; height: 40px; font-family: inherit; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-danger-outline { background: #fff; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { display: flex; width: 100%; height: 44px; font-size: 15px; font-weight: 600; }
.btn-sm { height: 30px; font-size: 12px; padding: 0 12px; border-radius: 6px; }
.btn:disabled { opacity: .4; }

/* ---- 表单 ---- */
.form-item { margin-bottom: 16px; }
.form-item label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.form-item label .req { color: var(--danger); }
.form-item input, .form-item textarea, .form-item select {
  width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 12px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
.form-item textarea { height: 80px; padding: 10px 12px; resize: none; }
.form-item input:focus, .form-item textarea:focus, .form-item select:focus { outline: none; border-color: var(--primary); }
.form-item input::placeholder, .form-item textarea::placeholder { color: var(--text-disabled); }
.form-err { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ---- 标签 ---- */
.tag { display: inline-block; font-size: 12px; border-radius: 999px; padding: 2px 10px; }
.tag-pending { color: var(--warning); background: var(--warning-bg); }
.tag-approved { color: var(--success); background: var(--success-bg); }
.tag-rejected { color: var(--danger); background: var(--danger-bg); }
.tag-info { color: var(--info); background: var(--info-bg); }
.tag-gold { color: #fff; background: var(--accent); border-radius: 4px; }

/* 基地 Tab */
.base-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.base-tabs::-webkit-scrollbar { display: none; }
.base-tabs .bt { flex-shrink: 0; padding: 6px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px; color: var(--text-sub); }
.base-tabs .bt.on { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }

/* 树龄档位网格 */
.tier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tier-card { background: #fff; border: 2px solid transparent; border-radius: 12px; padding: 12px; box-shadow: 0 2px 8px rgba(31,74,51,.06); cursor: pointer; position: relative; }
.tier-card.on { border-color: var(--primary); }
.tier-card.disabled { opacity: .45; pointer-events: none; }
.tier-card .ta { font-size: 16px; font-weight: 700; }
.tier-card .ts { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.tier-card .tp { font-size: 12px; color: var(--accent); margin-top: 2px; }
.tier-card .tk { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.tier-card .check { position: absolute; top: 10px; right: 10px; color: var(--secondary); font-size: 15px; }

/* 费用提示条 */
.cost-bar { background: var(--success-bg); border-radius: 8px; padding: 10px 12px; font-size: 12px; color: var(--text-sub); margin-bottom: 14px; }
.cost-bar b { color: var(--text); }

/* 记录卡片 */
.record-card .rc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.record-card .rc-no { font-weight: 600; font-size: 13px; word-break: break-all; }
.rc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.rc-fields .f { font-size: 13px; }
.rc-fields .f.full { grid-column: 1 / -1; }
.rc-fields .fk { color: var(--text-sub); font-size: 12px; }
.rc-fields .fv { margin-top: 1px; word-break: break-all; }
.rc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-sub); }
.cert-box { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.cert-box .cert-thumb { height: 96px; border-radius: 8px; display: block; border: 1px solid var(--line); }
.cert-empty { font-size: 12px; color: var(--text-disabled); background: var(--bg); border-radius: 8px; padding: 12px; text-align: center; }
.reject-reason { margin-top: 8px; font-size: 12px; color: var(--danger); background: var(--danger-bg); border-radius: 6px; padding: 8px 10px; }

/* 商城 */
.mall-head { background: var(--primary); color: #fff; padding: 14px 16px 16px; }
.mall-head h2 { font-size: 17px; }
.mall-head p { font-size: 12px; opacity: .85; margin-top: 4px; }
.search-row { display: flex; gap: 8px; margin: 12px 0; }
.search-row input { flex: 1; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; font-size: 13px; }
.search-row .btn { height: 38px; }
.cat-row { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; }
.cat-row a { flex-shrink: 0; padding: 4px 14px; border-radius: 999px; background: #fff; font-size: 12px; color: var(--text-sub); border: 1px solid var(--line); }
.cat-row a.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.prod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prod-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(31,74,51,.06); }
.prod-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: var(--line); }
.prod-card .pn { font-size: 13px; padding: 8px 10px 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.prod-card .pp { color: var(--accent); font-weight: 700; padding: 0 10px 10px; }

/* 我的 */
.me-head { background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; padding: 20px 16px; display: flex; align-items: center; gap: 12px; }
.me-head .avatar { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.me-menu .mi { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.me-menu .mi:last-child { border-bottom: none; }
.me-menu .mi .l { display: flex; align-items: center; gap: 10px; }
.me-menu .arrow { color: var(--text-disabled); }

/* 转让记录 */
.log-item { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.log-item:last-child { border-bottom: none; }
.log-item .amt-in { color: var(--success); font-weight: 700; }
.log-item .amt-out { color: var(--danger); font-weight: 700; }
.log-item .lm { color: var(--text-sub); font-size: 12px; margin-top: 2px; word-break: break-all; }

/* 空状态 */
.empty { text-align: center; padding: 40px 16px; color: var(--text-disabled); }
.empty .e-ic { font-size: 40px; margin-bottom: 10px; }
.empty .e-main { font-size: 14px; color: var(--text-sub); }
.empty .e-sub { font-size: 12px; margin-top: 4px; }
.empty .btn { margin-top: 14px; }

/* 登录页 */
.auth-hero { background: var(--primary); color: #fff; padding: 48px 24px 60px; text-align: center; }
.auth-hero .logo { font-size: 40px; }
.auth-hero h1 { font-size: 20px; margin-top: 10px; }
.auth-hero p { font-size: 12px; opacity: .8; margin-top: 6px; }
.auth-card { background: #fff; border-radius: 16px; margin: -32px 16px 24px; padding: 20px 16px; box-shadow: 0 4px 16px rgba(31,74,51,.1); }
.auth-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.auth-tabs .at { flex: 1; text-align: center; padding: 10px 0; font-size: 15px; color: var(--text-sub); cursor: pointer; }
.auth-tabs .at.on { color: var(--primary); font-weight: 600; border-bottom: 2px solid var(--primary); }

/* ---- Toast / Modal / 图片查看 ---- */
.toast { position: fixed; top: 20%; left: 50%; transform: translate(-50%, -10px); background: rgba(31,41,36,.9); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; z-index: 999; opacity: 0; transition: all .3s; max-width: 80%; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-success { background: rgba(46,125,79,.95); }
.toast-error { background: rgba(196,69,60,.95); }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 32px; }
.modal-box { background: #fff; border-radius: 12px; padding: 20px; width: 100%; max-width: 320px; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-text { font-size: 13px; color: var(--text-sub); margin: 10px 0 18px; line-height: 20px; word-break: break-all; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }
.img-viewer { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 950; display: flex; align-items: center; justify-content: center; }
.img-viewer img { max-width: 96%; max-height: 90%; }

.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.sub { color: var(--text-sub); font-size: 12px; }
.copyable { color: var(--secondary); cursor: pointer; }
