:root {
  --brand: #16794f;
  --brand-600: #116640;
  --brand-700: #0b4a30;
  --brand-soft: #e8f3ee;
  --brand-line: #c9e4d6;
  --ink: #14241d;
  --ink-2: #38493f;
  --muted: #6a7b72;
  --line: #e2e8e3;
  --line-strong: #d2dbd4;
  --bg: #f4f7f4;
  --surface: #ffffff;
  --surface-2: #f9fbf8;
  --danger: #b23a2c;
  --danger-soft: #fdeeeb;
  --danger-line: #efcdc6;
  --warn: #a96a15;
  --warn-soft: #fdf3e2;
  --warn-line: #f0dbb6;
  --info: #2a6a9a;
  --info-soft: #eaf2f8;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 36, 29, 0.05), 0 8px 24px rgba(20, 36, 29, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }

/* ---------- 基础控件 ---------- */
.btn {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: .48; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-600); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand-line); color: var(--brand-600); }
.btn-soft { background: var(--brand-soft); color: var(--brand-700); }
.btn-soft:hover:not(:disabled) { background: var(--brand-line); }
.btn-danger { background: var(--surface); border-color: var(--danger-line); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover:not(:disabled) { background: #992f23; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; }

.input, .select, textarea.input {
  height: 38px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.input { height: auto; padding: 9px 12px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22, 121, 79, .12); }
.input::placeholder { color: #9aa8a0; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%236a7b72' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .req { color: var(--danger); margin-left: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }

.checkbox { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--brand); cursor: pointer; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge-green { background: var(--brand-soft); color: var(--brand-700); border-color: var(--brand-line); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: #cfe2ef; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 15px; }
.card-body { padding: 18px 20px; }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  background: var(--bg);
}
.login-brand {
  background: var(--brand-700);
  color: #fff;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-brand::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -160px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
}
.login-brand::before {
  content: "";
  position: absolute;
  left: -80px;
  top: -120px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .04);
}
.login-logo { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}
.login-logo .name { font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.login-logo .sub { font-size: 12px; opacity: .72; letter-spacing: .4px; }
.login-hero { position: relative; z-index: 1; margin-top: 48px; }
.login-hero h1 { font-size: 34px; line-height: 1.3; letter-spacing: 1px; }
.login-hero p { margin-top: 14px; font-size: 14px; line-height: 1.9; color: rgba(255, 255, 255, .74); max-width: 420px; }
.login-points { position: relative; z-index: 1; display: grid; gap: 14px; margin-top: 36px; }
.login-point { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: rgba(255, 255, 255, .82); }
.login-point .dot { width: 8px; height: 8px; border-radius: 50%; background: #8fd7b3; margin-top: 7px; flex: none; }
.login-foot { position: relative; z-index: 1; font-size: 12px; color: rgba(255, 255, 255, .5); margin-top: 40px; }
.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-size: 22px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.login-form { display: grid; gap: 16px; }
.login-error {
  display: none;
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  color: var(--danger);
  font-size: 13px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
}
.login-error.show { display: block; }

/* ---------- 管理端布局 ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px;
  flex: none;
  background: var(--brand-700);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.sidebar-brand .logo-mark { width: 36px; height: 36px; font-size: 16px; }
.sidebar-brand .name { font-size: 15px; font-weight: 600; }
.sidebar-brand .sub { font-size: 11px; color: rgba(255, 255, 255, .55); }
.side-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: rgba(255, 255, 255, .74);
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.side-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-nav a.active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.side-nav .ico { width: 18px; text-align: center; font-size: 14px; opacity: .9; }
.sidebar-foot {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 11.5px;
  color: rgba(255, 255, 255, .45);
  line-height: 1.8;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 18px; letter-spacing: .5px; }
.topbar .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); }
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-700);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
}
.menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 17px;
  cursor: pointer;
}
.view { padding: 22px 26px 48px; display: flex; flex-direction: column; gap: 16px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view-head .title { font-size: 17px; font-weight: 600; }
.view-head .desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; max-width: 640px; }

/* ---------- 看板 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 14px; }
.stat-card {
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.stat-card .label { font-size: 12.5px; color: var(--muted); }
.stat-card .value { font-size: 27px; font-weight: 650; letter-spacing: .5px; margin-top: 6px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-card .value small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.stat-card.accent { background: var(--brand-700); border-color: var(--brand-700); }
.stat-card.accent .label { color: rgba(255, 255, 255, .72); }
.stat-card.accent .value { color: #fff; }
.stat-card.accent .value small { color: rgba(255, 255, 255, .6); }
.rank-list { display: flex; flex-direction: column; }
.rank-row { display: grid; grid-template-columns: 28px 1fr 90px 110px; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.rank-row:last-child { border-bottom: none; }
.rank-no {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.rank-row:nth-child(1) .rank-no { background: var(--brand); color: #fff; border-color: var(--brand); }
.rank-row:nth-child(2) .rank-no { background: var(--brand-soft); color: var(--brand-700); border-color: var(--brand-line); }
.rank-name { min-width: 0; }
.rank-name .n { font-size: 13.5px; font-weight: 500; }
.rank-bar { margin-top: 5px; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.rank-count { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.rank-amount { text-align: right; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty-state { padding: 42px 16px; text-align: center; color: var(--muted); font-size: 13px; background: var(--surface-2); border-radius: 10px; }

/* ---------- 工具条 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.toolbar .search-box { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
.toolbar .search-box .input { padding-left: 32px; }
.toolbar .search-box::before {
  content: "⌕"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  font-size: 16px; color: var(--muted); pointer-events: none;
}
.toolbar .spacer { flex: 1; }
.toolbar-note { font-size: 12.5px; color: var(--muted); padding: 0 20px 12px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; max-height: calc(100vh - 320px); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.data-table { border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.data-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: #f6faf6;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12.5px;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  user-select: none;
  position: relative;
}
.data-table thead th.align-right { text-align: right; }
.data-table thead th.align-center { text-align: center; }
.data-table thead th.sortable { cursor: pointer; }
.data-table thead th.sortable:hover { color: var(--brand); }
.sort-mark { display: inline-block; width: 12px; margin-left: 4px; color: #b7c3bb; font-size: 11px; }
.sort-mark::after { content: "▼"; font-size: 9px; opacity: .35; }
.sort-mark.is-asc::after { content: "▲"; opacity: 1; color: var(--brand); }
.sort-mark.is-desc::after { content: "▼"; opacity: 1; color: var(--brand); }
.col-resize { position: absolute; right: -3px; top: 0; width: 7px; height: 100%; cursor: col-resize; z-index: 3; }
.col-resize:hover { background: rgba(22, 121, 79, .12); }
.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2ee;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table tbody tr:hover td { background: #f8fbf8; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .align-right { text-align: right; }
.data-table .align-center { text-align: center; }
.cell-actions { display: inline-flex; gap: 6px; }
.link-btn { background: none; border: none; padding: 0; color: var(--brand); font-size: 13px; cursor: pointer; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }
.link-btn:disabled { color: #b8c3bc; cursor: not-allowed; text-decoration: none; }
.cell-thumb { width: 34px; height: 26px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); display: inline-block; margin-right: 5px; vertical-align: middle; }
.thumb-links { display: inline-flex; gap: 8px; align-items: center; }

/* ---------- 分页器 ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
}
.pager-sum { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pager-sum b { color: var(--ink); font-weight: 600; }
.pager-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pager-size { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.pager-size .select { height: 32px; width: 74px; font-size: 13px; padding: 0 24px 0 9px; }
.pager-pages { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pg-btn, .pg-num {
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .12s ease;
}
.pg-btn:hover:not(:disabled), .pg-num:hover { border-color: var(--brand); color: var(--brand); }
.pg-num.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pg-btn:disabled { opacity: .45; cursor: not-allowed; }
.pg-dots { color: var(--muted); padding: 0 2px; font-size: 12px; }
.pager-jump { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.pager-jump .input { height: 32px; width: 62px; padding: 0 8px; text-align: center; font-size: 13px; }
.pager-jump .btn { height: 32px; padding: 0 10px; font-size: 12.5px; }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(12, 26, 20, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .16s ease;
}
.modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 64px);
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(10, 24, 18, .28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: rise .18s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { transform: translateY(8px); opacity: .6 } to { transform: none; opacity: 1 } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-x { border: none; background: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.modal-x:hover { color: var(--ink); }
.modal-body { padding: 18px 22px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.modal-body .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- 提示 ---------- */
.toast-box { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 10px 18px;
  border-radius: 10px;
  background: #17352a;
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 12px 32px rgba(10, 24, 18, .25);
  animation: toastIn .2s ease;
  max-width: 80vw;
}
.toast-success { background: #12603f; }
.toast-error { background: #8f2d22; }
.toast-out { opacity: 0; transform: translateY(-6px); transition: all .22s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) } to { opacity: 1; transform: none } }

/* ---------- 列设置弹层 ---------- */
.popover {
  position: absolute;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(12, 26, 20, .16);
  padding: 8px;
  min-width: 190px;
  animation: rise .14s ease;
}
.popover-title { font-size: 12px; color: var(--muted); padding: 6px 8px 8px; }
.popover-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.popover-item:hover { background: var(--surface-2); }
.popover-foot { border-top: 1px solid var(--line); margin-top: 6px; padding: 8px 8px 2px; display: flex; justify-content: space-between; gap: 8px; }

/* ---------- 数据库重置 ---------- */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--warn-line);
  background: var(--warn-soft);
  font-size: 13px;
  color: #6d4a13;
}
.alert .alert-ico { font-size: 16px; line-height: 1.3; }
.alert b { color: #53380c; }
.alert.info { background: var(--info-soft); border-color: #cfe2ef; color: #23567d; }
.alert.info b { color: #1a4463; }

.reset-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.reset-table thead th { text-align: left; font-size: 12.5px; color: var(--ink-2); background: #f6faf6; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.reset-table tbody td { padding: 12px 14px; border-bottom: 1px solid #eef2ee; vertical-align: top; }
.reset-table tbody tr:last-child td { border-bottom: none; }
.reset-table tr.disabled td { background: #fbfbfa; color: #96a39b; }
.reset-table .t-name { font-weight: 600; font-size: 13.5px; }
.reset-table .t-code { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; margin-top: 2px; }
.reset-table .t-purpose { color: var(--ink-2); }
.reset-table .t-impact { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.reset-table .t-rows { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.reset-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; flex-wrap: wrap; }
.reset-summary .picked { color: var(--ink-2); }
.reset-summary .picked b { color: var(--danger); }
.reset-progress { display: flex; flex-direction: column; gap: 10px; }
.progress-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.progress-track { height: 8px; background: #eef2ee; border-radius: 5px; overflow: hidden; }
.progress-track i { display: block; height: 100%; background: var(--brand); border-radius: 5px; transition: width .25s ease; }
.progress-track.failed i { background: var(--danger); }
.progress-step { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.progress-step .st { display: inline-flex; align-items: center; gap: 8px; }
.progress-step .st-dot { width: 8px; height: 8px; border-radius: 50%; background: #c3ccc6; }
.progress-step.running .st-dot { background: var(--warn); animation: pulse 1s infinite; }
.progress-step.success .st-dot { background: var(--brand); }
.progress-step.failed .st-dot { background: var(--danger); }
.progress-step.skipped .st-dot { background: #b0b9b3; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .4 } }
.progress-step .msg { color: var(--muted); font-size: 12.5px; text-align: right; }

/* ---------- 移动端 ---------- */
.mobile-body { background: #eef2ee; }
.mobile-app { max-width: 620px; margin: 0 auto; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.m-header {
  background: var(--brand-700);
  color: #fff;
  padding: 14px 16px 16px;
  padding-top: calc(14px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 12px;
}
.m-header .logo-mark { width: 34px; height: 34px; font-size: 15px; flex: none; }
.m-header .title { font-size: 15.5px; font-weight: 600; }
.m-header .sub { font-size: 11.5px; color: rgba(255, 255, 255, .62); margin-top: 1px; }
.m-header .m-user { margin-left: auto; text-align: right; font-size: 11.5px; color: rgba(255, 255, 255, .7); }
.m-header .m-user .n { font-size: 13px; color: #fff; font-weight: 500; }
.m-logout { margin-left: 10px; border: 1px solid rgba(255, 255, 255, .28); background: transparent; color: #fff; height: 28px; padding: 0 9px; border-radius: 7px; font-size: 12px; font-family: inherit; cursor: pointer; }
.m-tabs { display: flex; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.m-tabs button {
  flex: 1; height: 46px; border: none; background: none; font-family: inherit; font-size: 14px; color: var(--muted);
  cursor: pointer; position: relative; font-weight: 500;
}
.m-tabs button.active { color: var(--brand-700); font-weight: 600; }
.m-tabs button.active::after { content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 46px; height: 3px; border-radius: 2px 2px 0 0; background: var(--brand); }
.m-content { padding: 14px 14px 28px; flex: 1; }
.m-card-form { background: var(--surface); border-radius: 14px; border: 1px solid var(--line); padding: 16px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.m-card-form .section-title { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.m-card-form .section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.m-field label { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; display: block; font-weight: 500; }
.m-field .input, .m-field .select { height: 46px; border-radius: 10px; font-size: 15px; }
.m-field .input::placeholder { font-size: 14px; }
.m-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-amount-box {
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  padding: 12px 14px;
}
.m-amount-box .label { font-size: 12px; color: var(--brand-700); }
.m-amount-box .value { font-size: 26px; font-weight: 650; color: var(--brand-700); font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.m-amount-box .value small { font-size: 13px; font-weight: 400; margin-right: 2px; }
.m-amount-box .tip { font-size: 11.5px; color: #4d7a64; margin-top: 2px; }
.product-row { display: flex; gap: 8px; }
.product-row .select { flex: 1; }
.product-row .btn { flex: none; height: 46px; border-radius: 10px; }

.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.upload-tile {
  position: relative;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  min-height: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  padding: 10px;
  transition: border-color .15s ease;
}
.upload-tile.has-image { border-style: solid; border-color: var(--brand-line); background: #eef7f2; }
.upload-tile .tile-name { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.upload-tile .tile-preview { position: absolute; inset: 0; display: none; }
.upload-tile.has-image .tile-preview { display: block; }
.upload-tile .tile-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-tile .tile-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; gap: 6px; padding: 6px;
  background: linear-gradient(to top, rgba(10, 24, 18, .72), rgba(10, 24, 18, 0));
  justify-content: flex-end;
}
.upload-tile.has-image .tile-actions { display: none; }
.upload-tile .tile-overlay button {
  border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .16); color: #fff;
  height: 26px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-family: inherit; cursor: pointer;
}
.upload-tile .tile-actions { display: flex; gap: 6px; }
.tile-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 10px; border-radius: 7px; font-size: 12.5px; cursor: pointer;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
}
.tile-btn.ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); }
.tile-btn input { display: none; }
.tile-badge {
  position: absolute; top: 6px; left: 6px; z-index: 4;
  font-size: 11px; background: rgba(10, 24, 18, .68); color: #fff;
  padding: 2px 7px; border-radius: 999px;
}
.tile-uploading {
  position: absolute; inset: 0; z-index: 5; display: none;
  background: rgba(255, 255, 255, .82); align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--brand-700); flex-direction: column; gap: 8px;
}
.upload-tile.uploading .tile-uploading { display: flex; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--brand-line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

.m-submit { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, rgba(244, 247, 244, 0)); }
.m-submit .btn { width: 100%; height: 50px; font-size: 16px; border-radius: 12px; box-shadow: 0 8px 20px rgba(22, 121, 79, .24); }

/* 移动端列表 */
.m-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.m-toolbar .input { flex: 1; height: 42px; border-radius: 10px; }
.m-toolbar .btn { height: 42px; flex: none; }
.m-filter-row { display: flex; gap: 8px; margin-bottom: 12px; }
.m-filter-row .select { flex: 1; height: 36px; font-size: 13px; border-radius: 9px; }
.m-filter-row .btn { height: 36px; }
.m-list { display: flex; flex-direction: column; gap: 10px; }
.m-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; box-shadow: 0 1px 2px rgba(20, 36, 29, .04); }
.m-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.m-item-top .n { font-size: 15px; font-weight: 600; }
.m-item-top .a { font-size: 17px; font-weight: 650; color: var(--brand-700); font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-item-line { font-size: 13px; color: var(--ink-2); margin-top: 4px; display: flex; justify-content: space-between; gap: 10px; }
.m-item-line .k { color: var(--muted); }
.m-item-line .v { text-align: right; word-break: break-all; }
.m-item-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.m-thumbs { display: flex; gap: 6px; }
.m-thumbs img { width: 42px; height: 32px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); }
.m-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 48px 12px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 12px; }

/* 移动端分页器 */
.pager.is-compact { padding: 12px 2px 0; border-top: none; background: transparent; }
.pager.is-compact .pager-sum { font-size: 12px; }
.pager.is-compact .pager-main { gap: 6px; }
.pager.is-compact .pg-btn, .pager.is-compact .pg-num { min-width: 30px; height: 30px; font-size: 12.5px; }
.pager.is-compact .pager-size .select { height: 30px; }
.pager.is-compact .pager-jump { font-size: 12px; }
.pager.is-compact .pager-jump .input { height: 30px; width: 52px; }
.pager.is-compact .pager-jump .btn { height: 30px; padding: 0 8px; }

@media (max-width: 960px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { padding: 32px 26px; }
  .login-hero { margin-top: 26px; }
  .login-hero h1 { font-size: 25px; }
  .login-points { display: none; }
  .login-foot { display: none; }
  .login-form-wrap { padding: 26px 18px 48px; align-items: flex-start; }
  .login-card { max-width: 520px; }
}

@media (max-width: 860px) {
  .admin-shell { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(10, 24, 18, .28);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .topbar { padding: 12px 14px; }
  .topbar h1 { font-size: 16px; }
  .view { padding: 16px 14px 40px; }
  .toolbar { padding: 12px 14px; }
  .toolbar .search-box { max-width: none; }
  .pager { padding: 12px 14px; }
  .table-wrap { max-height: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal { max-height: calc(100vh - 32px); border-radius: 16px; }
  .rank-row { grid-template-columns: 26px 1fr 74px; }
  .rank-amount { display: none; }
}

/* 移动端金额输入 */
.amount-row { display: flex; align-items: center; }
.amount-input {
  flex: 1; width: 100%; padding: 0; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 28px; font-weight: 650; letter-spacing: .5px;
  color: var(--brand-700); font-variant-numeric: tabular-nums;
}
.amount-input::placeholder { color: #9ab7a8; font-weight: 500; }

/* 管理端细节补充 */
.id-preview { width: 96px; height: 66px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); display: block; }
.id-preview-box { display: flex; gap: 12px; flex-wrap: wrap; }
.id-preview-empty {
  width: 96px; height: 66px; border-radius: 7px; border: 1px dashed var(--line-strong);
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); background: var(--surface-2);
}
.log-detail-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.log-detail-row:last-child { border-bottom: none; }
.log-detail-row .k { color: var(--muted); }
.log-detail-row .v { color: var(--ink-2); word-break: break-all; white-space: pre-wrap; }
.backup-name { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.confirm-msg { font-size: 13.5px; line-height: 1.8; color: var(--ink-2); }
.progress-step.rolledback .st-dot { background: #b0b9b3; }

/* ---------- 农户选择器 ---------- */
.farmer-picker { position: relative; }
.farmer-picker .fp-search { display: flex; gap: 8px; }
.farmer-picker .fp-input { flex: 1; }
.farmer-picker .fp-add { white-space: nowrap; }
.farmer-picker.has-selected .fp-search,
.farmer-picker.has-selected .fp-dropdown { display: none; }

.fp-card {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--brand-line); background: var(--brand-soft);
  border-radius: 10px; padding: 10px 12px;
}
.fp-card .fp-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fp-card .fp-main .n { font-size: 14.5px; font-weight: 600; color: var(--brand-700); }
.fp-card .fp-main .p { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fp-card .fp-addr { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fp-card .fp-change { margin-left: auto; white-space: nowrap; }

.fp-dropdown {
  position: absolute; z-index: 80; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); max-height: 238px; overflow: auto; padding: 4px;
}
.fp-item {
  display: block; width: 100%; text-align: left; border: none; background: none;
  font-family: inherit; padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.fp-item:hover { background: var(--brand-soft); }
.fp-item .fp-item-main { display: flex; align-items: baseline; gap: 10px; }
.fp-item .fp-item-main b { font-size: 14px; color: var(--ink); }
.fp-item .fp-item-main i { font-style: normal; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fp-item .fp-item-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-none { padding: 14px 10px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- 产品搜索选择器 ---------- */
.product-picker { position: relative; }
.pp-box {
  display: flex; align-items: center; gap: 8px; min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); cursor: pointer;
}
.pp-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22, 121, 79, .12); }
.pp-selected { font-size: 14px; font-weight: 600; color: var(--brand-700); }
.pp-selected.placeholder { font-weight: 400; color: #9aa8a0; }
.pp-caret { margin-left: auto; font-size: 12px; color: var(--muted); }
.product-picker .pp-dropdown { padding: 0; overflow: hidden; max-height: 320px; }
.product-picker .fp-search { display: flex; padding: 8px; border-bottom: 1px solid var(--line); }
.product-picker .fp-input { flex: 1; height: 34px; }
.pp-list { max-height: 252px; overflow-y: auto; }
.pp-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; border: none; background: none;
  font-family: inherit; padding: 9px 12px; cursor: pointer; font-size: 13.5px; color: var(--ink);
}
.pp-item:hover { background: var(--brand-soft); }
.pp-item.active { background: var(--brand-soft); color: var(--brand-700); font-weight: 600; }
.pp-item .c { font-size: 11.5px; color: var(--muted); flex: none; }

/* ---------- 基础资料子页签 ---------- */
.m-subtabs { display: flex; gap: 8px; margin-bottom: 12px; }
.m-subtabs button {
  flex: 1; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); font-family: inherit; font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.m-subtabs button.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.m-item .m-item-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* ---------- 其它费用与总金额 ---------- */
.m-total-box {
  border: 1px solid var(--brand-line); background: linear-gradient(180deg, #f2faf5, #eaf5ee);
  border-radius: 12px; padding: 10px 14px; display: grid; gap: 4px;
}
.m-total-box .t-line {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.m-total-box .t-line.total {
  border-top: 1px dashed var(--brand-line); margin-top: 4px; padding-top: 8px;
  font-size: 15px; font-weight: 650; color: var(--brand-700);
}
.m-total-box .t-line.total span:last-child { font-size: 20px; letter-spacing: .3px; }

.total-display {
  height: 38px; display: flex; align-items: center; padding: 0 12px;
  border: 1px dashed var(--brand-line); border-radius: var(--radius-sm);
  background: var(--brand-soft); color: var(--brand-700);
  font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums;
}

.fd-phone-hint { color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 8px; padding: 6px 10px; margin-top: 6px; font-size: 12px; }
