/* ============================================================
   贵州村水 · 三端共用设计系统
   手机优先 + PC 自适应，无外网依赖
   ============================================================ */

:root {
  --brand-1: #0F766E;
  --brand-2: #0EA5E9;
  --brand-grad: linear-gradient(135deg, #0F766E 0%, #0EA5E9 100%);
  --brand-soft: #E6F7F5;
  --amber-1: #F59E0B;
  --amber-soft: #FEF3C7;
  --danger: #E11D48;
  --danger-soft: #FFE4E6;
  --ok: #059669;
  --ok-soft: #D1FAE5;
  --ink: #0F172A;
  --ink-2: #475569;
  --ink-3: #94A3B8;
  --line: #E8EDF2;
  --bg: #F7F9FB;
  --card: #FFFFFF;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 26px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .04);
  --sh-2: 0 4px 12px rgba(15, 23, 42, .07), 0 12px 28px rgba(15, 23, 42, .06);
  --sh-3: 0 8px 24px rgba(15, 118, 110, .22);
  --t: .22s cubic-bezier(.4, 0, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* 兼容别名：早期页面用了 --c-* 命名，统一映射到上面这套，避免文字塌成默认黑 */
  --c-primary: var(--brand-1);
  --c-primary-2: var(--brand-2);
  --c-text-1: var(--ink);
  --c-text-2: var(--ink-2);
  --c-text-3: var(--ink-3);
  --c-line: var(--line);
  --c-bg: var(--bg);
  --c-card: var(--card);
  --c-danger: var(--danger);
  --c-success: var(--ok);
  --c-warning: var(--amber-1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ---------- 图标 ---------- */
.ico {
  width: 22px; height: 22px; flex: none;
  stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
  fill: none;
}
.ico-sm { width: 16px; height: 16px; stroke-width: 2; }
.ico-lg { width: 28px; height: 28px; stroke-width: 1.6; }
.ico-xl { width: 40px; height: 40px; stroke-width: 1.4; }

/* ---------- 页面容器 ---------- */
.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(84px + var(--safe-b));
  background: var(--bg);
  position: relative;
}
.page-wide { max-width: 100%; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 16px;
  background: rgba(247, 249, 251, .82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t);
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-title { font-size: 17px; font-weight: 650; letter-spacing: -.2px; flex: 1; }
.nav-back, .nav-right a {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: background var(--t), color var(--t);
}
.nav-back:active, .nav-right a:active { background: #EDF2F6; color: var(--ink); }
.nav-right { display: flex; gap: 4px; margin-left: auto; }

/* ---------- 主视觉 ---------- */
.hero {
  margin: 8px 16px 0;
  padding: 26px 22px 22px;
  border-radius: var(--r-xl);
  background: var(--brand-grad);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--sh-3);
}
.hero::after {
  content: ''; position: absolute;
  right: -56px; top: -56px; width: 190px; height: 190px;
  border-radius: 50%; background: rgba(255, 255, 255, .13);
}
.hero::before {
  content: ''; position: absolute;
  right: 34px; bottom: -70px; width: 130px; height: 130px;
  border-radius: 50%; background: rgba(255, 255, 255, .08);
}
.hero-label { font-size: 13.5px; opacity: .9; position: relative; z-index: 1; }
.hero-num {
  display: flex; align-items: baseline; gap: 8px;
  margin: 10px 0 18px; position: relative; z-index: 1;
}
.hero-num b {
  font-size: 52px; font-weight: 750; line-height: 1;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}
.hero-num span { font-size: 14px; opacity: .88; font-weight: 500; }
.hero-sub {
  display: flex; gap: 0;
  border-top: 1px solid rgba(255, 255, 255, .2);
  padding-top: 14px; position: relative; z-index: 1;
}
.hero-sub > div { flex: 1; text-align: center; }
.hero-sub > div + div { border-left: 1px solid rgba(255, 255, 255, .16); }
.hero-sub em { display: block; font-style: normal; font-size: 11.5px; opacity: .8; margin-bottom: 3px; }
.hero-sub b { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- 区块 ---------- */
.sec { padding: 20px 16px 0; }
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; padding: 0 2px;
}
.sec-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 15px; font-weight: 650; color: var(--ink);
}
.sec-title .ico { width: 18px; height: 18px; color: var(--brand-1); }
.sec-more {
  display: flex; align-items: center; gap: 1px;
  font-size: 13px; color: var(--ink-3);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.card-pad { padding: 18px; }

/* ---------- 列表行 ---------- */
.row {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 16px;
  position: relative;
  transition: background var(--t);
}
.row + .row::before {
  content: ''; position: absolute; left: 61px; right: 0; top: 0;
  height: 1px; background: var(--line);
}
a.row:active { background: #F8FAFC; }
.row-ico {
  width: 40px; height: 40px; flex: none;
  border-radius: 13px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-1);
}
.row-ico.amber { background: var(--amber-soft); color: #B45309; }
.row-ico.blue  { background: #E0F2FE; color: #0369A1; }
.row-ico.rose  { background: var(--danger-soft); color: var(--danger); }
.row-ico.green { background: var(--ok-soft); color: var(--ok); }
.row-ico .ico { width: 20px; height: 20px; }
.row-main { flex: 1; min-width: 0; }
.row-t {
  font-size: 15px; font-weight: 550; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-d {
  font-size: 12.5px; color: var(--ink-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-r { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--ink-3); }
.row-v { font-size: 14.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.row-v.minus { color: var(--danger); }
.row-v.plus { color: var(--ok); }
.row-tm { font-size: 11.5px; color: var(--ink-3); }

/* ---------- 提示条 ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 15px; border-radius: var(--r-md);
  font-size: 13.5px; line-height: 1.5;
}
.alert .ico { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-warn { background: var(--amber-soft); color: #92400E; }
.alert-danger { background: var(--danger-soft); color: #9F1239; }
.alert-ok { background: var(--ok-soft); color: #065F46; }
.alert-info { background: #E0F2FE; color: #075985; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; height: 46px; padding: 0 22px;
  border-radius: 14px; font-size: 15px; font-weight: 600;
  background: var(--brand-grad); color: #fff;
  box-shadow: 0 4px 14px rgba(15, 118, 110, .28);
  transition: transform var(--t), box-shadow var(--t), opacity var(--t);
}
.btn:active { transform: scale(.975); box-shadow: 0 2px 8px rgba(15, 118, 110, .22); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-block { display: flex; width: 100%; }
.btn-ghost {
  background: #F1F5F9; color: var(--ink-2);
  box-shadow: none;
}
.btn-outline {
  background: transparent; color: var(--brand-1);
  border: 1.5px solid var(--brand-1); box-shadow: none;
}
.btn-danger { background: linear-gradient(135deg, #E11D48, #F43F5E); box-shadow: 0 4px 14px rgba(225, 29, 72, .25); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 11px; }
.btn-lg { height: 52px; font-size: 16px; border-radius: 16px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 7px;
}
.input, .select, .textarea {
  width: 100%; height: 50px; padding: 0 15px;
  background: #F8FAFC; border: 1.5px solid transparent;
  border-radius: 14px; font-size: 15px;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
  outline: none;
}
.textarea { height: auto; padding: 13px 15px; resize: vertical; min-height: 88px; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus {
  background: #fff; border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, .1);
}
.input::placeholder { color: var(--ink-3); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 42px;
}
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; min-width: 0; }

/* ---------- 登录页 ---------- */
.login-wrap {
  max-width: 440px; margin: 0 auto;
  min-height: 100vh;
  padding: 8vh 24px 40px;
  display: flex; flex-direction: column;
}
.login-logo { text-align: center; margin-bottom: 36px; }
.login-mark {
  width: 72px; height: 72px; margin: 0 auto 18px;
  border-radius: 24px; background: var(--brand-grad);
  display: grid; place-items: center;
  box-shadow: var(--sh-3);
  color: #fff;
}
.login-mark .ico { width: 38px; height: 38px; stroke-width: 1.6; }
.login-title { font-size: 25px; font-weight: 750; letter-spacing: -.5px; }
.login-sub { font-size: 13.5px; color: var(--ink-3); margin-top: 7px; }
.login-form { margin-top: 4px; }
.login-foot { margin-top: auto; padding-top: 30px; text-align: center; }

/* ---------- 底部标签栏 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-width: 480px; margin: 0 auto;
  display: flex;
  padding: 6px 6px calc(6px + var(--safe-b));
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  padding: 6px 0 4px; border-radius: 12px;
  color: var(--ink-3); font-size: 10.5px; font-weight: 550;
  transition: color var(--t);
}
.tabbar a .ico { width: 23px; height: 23px; }
.tabbar a.on { color: var(--brand-1); }
.tabbar a.on .ico { stroke-width: 2; }

/* ---------- 空状态 ---------- */
.empty {
  padding: 44px 20px; text-align: center; color: var(--ink-3);
}
.empty .ico { width: 46px; height: 46px; margin: 0 auto 12px; opacity: .5; stroke-width: 1.3; }
.empty p { font-size: 13.5px; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 9px; border-radius: 8px;
  font-size: 11.5px; font-weight: 600;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--amber-soft); color: #B45309; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: #E0F2FE; color: #0369A1; }
.badge-grey { background: #F1F5F9; color: var(--ink-3); }

/* ---------- 进度条 ---------- */
.bar { height: 6px; border-radius: 99px; background: #EEF2F6; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--brand-grad); }

/* ---------- 统计小卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-grid.g3 { grid-template-columns: repeat(3, 1fr); }
.stat {
  background: var(--card); border-radius: var(--r-md);
  padding: 15px 14px; box-shadow: var(--sh-1);
}
.stat em { display: block; font-style: normal; font-size: 12px; color: var(--ink-3); margin-bottom: 5px; }
.stat b { font-size: 21px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat b small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }

/* ---------- 动效 ---------- */
.fade-up { animation: fadeUp .42s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.stagger > * { animation: fadeUp .42s cubic-bezier(.22, 1, .36, 1) both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .05s; }
.stagger > *:nth-child(3) { animation-delay: .08s; }
.stagger > *:nth-child(4) { animation-delay: .11s; }
.stagger > *:nth-child(5) { animation-delay: .14s; }
.stagger > *:nth-child(6) { animation-delay: .17s; }
.stagger > *:nth-child(7) { animation-delay: .20s; }
.stagger > *:nth-child(8) { animation-delay: .23s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 110px; z-index: 999;
  transform: translate(-50%, 14px);
  max-width: 84vw; padding: 12px 20px;
  background: rgba(15, 23, 42, .92); color: #fff;
  border-radius: 14px; font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: rgba(5, 150, 105, .95); }
.toast.err { background: rgba(225, 29, 72, .95); }

/* ---------- 弹层 ---------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 201;
  max-width: 480px; margin: 0 auto;
  background: #fff; border-radius: 24px 24px 0 0;
  padding: 8px 20px calc(22px + var(--safe-b));
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1);
  max-height: 86vh; overflow-y: auto;
}
.sheet.show { transform: none; }
.sheet-bar {
  width: 38px; height: 4px; border-radius: 99px;
  background: #E2E8F0; margin: 6px auto 16px;
}
.sheet-title { font-size: 17px; font-weight: 650; margin-bottom: 4px; }
.sheet-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; }

@media (min-width: 520px) {
  .sheet { border-radius: 24px; bottom: 50%; transform: translateY(50%) scale(.96); opacity: 0; }
  .sheet.show { transform: translateY(50%) scale(1); opacity: 1; }
  .sheet-bar { display: none; }
}
