/* 农收通管理后台样式（自包含，不依赖 CDN） */
:root {
  --green-900: #14432e;
  --green-700: #1f6a47;
  --green-600: #268056;
  --green-100: #e8f3ec;
  --amber-600: #b7791f;
  --amber-50: #fdf6e7;
  --red-600: #b23b3b;
  --red-50: #fdeeee;
  --text-900: #1d2422;
  --text-700: #3f4a46;
  --text-500: #6b7772;
  --line: #e2e8e4;
  --bg: #f5f7f5;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 67, 46, .06), 0 8px 24px rgba(20, 67, 46, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-900);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #eef2ef;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12.5px;
}

/* ---------- 布局 ---------- */
.app-body { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: linear-gradient(180deg, var(--green-900), #0f3323);
  color: #dbe7df;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: #2f9e6b;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 17px;
  flex: 0 0 34px;
}
.brand-name { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: .5px; }
.brand-sub { font-size: 11.5px; color: #9db8a9; }

.nav { padding: 10px 10px 20px; flex: 1; }
.nav-item {
  display: block;
  padding: 9px 12px;
  color: #cfded5;
  border-radius: 8px;
  font-size: 13.5px;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); text-decoration: none; color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }
.nav-group { margin-top: 2px; }
.nav-sub { padding: 2px 0 6px 14px; }
.nav-sub-item {
  display: block;
  padding: 6px 10px;
  color: #a9c1b2;
  font-size: 12.5px;
  border-radius: 6px;
}
.nav-sub-item:hover { color: #fff; background: rgba(255, 255, 255, .05); text-decoration: none; }

.sidebar-foot {
  padding: 12px 16px;
  font-size: 11.5px;
  color: #7f9c8a;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 58px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { font-size: 15px; font-weight: 600; color: var(--text-900); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip {
  font-size: 13px;
  color: var(--text-700);
  background: var(--green-100);
  padding: 5px 10px;
  border-radius: 999px;
}
.inline-form { display: inline; }

.content { padding: 22px; max-width: 1180px; width: 100%; }

/* ---------- 通用组件 ---------- */
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 20px; margin: 0 0 4px; }
.page-desc { margin: 0; color: var(--text-500); font-size: 13px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--green-600); color: #fff; }
.btn-primary:hover { background: var(--green-700); text-decoration: none; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text-700); }
.btn-ghost:hover { border-color: #c6d3cc; text-decoration: none; }
.btn-block { width: 100%; height: 40px; font-size: 14.5px; }

.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 12.5px; color: var(--text-700); margin-bottom: 6px; }
.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  outline: none;
}
.input:focus { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(38, 128, 86, .12); }

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-danger { background: var(--red-50); border-color: #f3d2d2; color: #8c2f2f; }
.alert-warn { background: var(--amber-50); border-color: #f0e0bd; color: #7d5413; }
.alert-code { margin-top: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}
.panel-head h2 { margin: 0; font-size: 14.5px; font-weight: 600; }
.panel-body { padding: 16px 18px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 12.5px; color: var(--text-500); }
.stat-value { font-size: 26px; font-weight: 700; color: var(--green-900); line-height: 1.3; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 11.5px; color: var(--text-500); }

.checklist { margin: 0; padding-left: 18px; }
.checklist li { margin: 6px 0; font-size: 13.5px; }
.checklist .done { color: var(--green-700); }
.checklist .todo { color: var(--text-500); }

.muted { color: var(--text-500); font-size: 12.5px; }

/* ---------- 登录 ---------- */
.plain-body {
  background: radial-gradient(1200px 600px at 20% 0%, #eaf3ee, #f5f7f5 60%);
  min-height: 100vh;
}
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 24px 20px;
  box-shadow: 0 12px 40px rgba(20, 67, 46, .1);
}
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.login-title { font-size: 17px; font-weight: 700; }
.login-sub { font-size: 12px; color: var(--text-500); }
.login-tip { margin: 14px 0 0; font-size: 12px; color: var(--text-500); }
.login-foot { margin: 6px 0 0; font-size: 11.5px; color: #9aa6a1; word-break: break-all; }

/* ---------- 错误页 ---------- */
.error-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.error-code { font-size: 64px; font-weight: 800; color: var(--green-700); line-height: 1; }
.error-title { font-size: 20px; margin: 10px 0 6px; }
.error-msg { color: var(--text-700); margin: 0 0 6px; max-width: 560px; word-break: break-word; }
.error-trace { color: var(--text-500); font-size: 12px; margin: 0 0 18px; }
.error-actions { display: flex; gap: 10px; }
.error-hint { margin-top: 18px; font-size: 12px; color: var(--text-500); }

@media (max-width: 860px) {
  .app-body { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-sub { display: none; }
  .content { padding: 16px; }
}

/* ---------- 批次6：表格 / 筛选 / 分页 / 详情 ---------- */
.alert-ok { background: #e8f3ec; border-color: #cbe4d6; color: #1f6a47; }
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  padding: 12px 16px; background: #fbfcfb; border-bottom: 1px solid var(--line);
}
.filter-bar .field { margin: 0; min-width: 130px; }
.filter-bar .field-label { margin-bottom: 3px; }
.filter-bar .input, .filter-bar select.input { height: 34px; font-size: 13px; padding: 0 9px; }
.filter-bar .btn { height: 34px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table th { background: #f6f8f7; color: var(--text-700); font-weight: 600; font-size: 12.5px; position: sticky; top: 0; }
.table tbody tr:hover { background: #fafcfb; }
.table td.wrap { white-space: normal; min-width: 180px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-empty { padding: 28px; text-align: center; color: var(--text-500); }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 10px 16px; color: var(--text-500); font-size: 12.5px; }
.pager a { padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.pager a.disabled { color: #b9c3be; pointer-events: none; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; background: var(--green-100); color: var(--green-700); }
.badge-warn { background: var(--amber-50); color: var(--amber-600); }
.badge-danger { background: var(--red-50); color: var(--red-600); }
.badge-muted { background: #eef1ef; color: var(--text-500); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-danger { background: var(--red-600); color: #fff; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 9px 18px; }
.detail-item { border-bottom: 1px dashed var(--line); padding: 7px 0; }
.detail-label { color: var(--text-500); font-size: 12px; }
.detail-value { font-size: 13.5px; word-break: break-all; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.section-title { font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
.role-tag { display: inline-block; margin-right: 6px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; color: var(--text-700); }
.pager form { display: inline-flex; gap: 6px; align-items: center; }
.pager .input { width: 64px; height: 28px; font-size: 12px; }
