/* ═══════════════════════════════════════════════════════════════════════════
   神农云方 · 平台管理后台（web） — Phase 1
   设计语言：深色侧边栏 + 浅色工作区，主色沿用小程序品牌青绿 #00C1B3
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --brand: #00C1B3;
  --brand-dark: #00a899;
  --ink: #1f2937;
  --ink-2: #4b5563;
  --ink-3: #9ca3af;
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: #e5e7eb;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #059669;
  --sidebar: #0e1726;
  --sidebar-2: #16233a;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  font-size: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--brand-dark); text-decoration: none; }

/* ── 登录 ─────────────────────────────────────────────────── */
.login-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #0e1726 0%, #16233a 55%, #0f2e2b 100%); padding: 24px;
}
.login-panel { width: 400px; max-width: 100%; background: var(--card); border-radius: 16px; padding: 36px 32px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.login-logo, .sidebar-logo {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--brand), #0d9488); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600;
}
.login-title { font-size: 17px; font-weight: 600; }
.login-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.login-form .field { display: block; margin-bottom: 16px; }
.login-form .field span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.login-form input {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 12px; font-size: 15px; outline: none; transition: border .15s, box-shadow .15s;
}
.login-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,193,179,.15); }
.login-error { min-height: 18px; font-size: 13px; color: var(--danger); margin: -4px 0 8px; }
.login-tip { font-size: 12px; color: var(--ink-3); margin-top: 16px; line-height: 1.6; }

/* ── 布局 ─────────────────────────────────────────────────── */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 216px; flex: none; background: var(--sidebar); color: #cbd5e1;
  display: flex; flex-direction: column;
}
.sidebar-brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 16px; color: #fff; font-size: 16px; font-weight: 600; }
.sidebar-sub { font-size: 11px; color: #64748b; font-weight: 400; margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 8px 10px; overflow-y: auto; }
.nav-section { font-size: 11px; color: #64748b; padding: 14px 10px 6px; letter-spacing: .05em; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 2px 0;
  border-radius: 8px; color: #cbd5e1; cursor: pointer; font-size: 13.5px; transition: background .12s, color .12s;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--sidebar-2); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(0,193,179,.18), rgba(0,193,179,.05)); color: var(--brand); font-weight: 600; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--danger); color: #fff; border-radius: 99px;
  font-size: 11px; padding: 1px 7px; font-weight: 600;
}
.sidebar-footer { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.user-name { color: #fff; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.user-role { color: #64748b; font-size: 11.5px; margin-bottom: 10px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; flex: none; background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.topbar h1 { font-size: 17px; font-weight: 600; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.page { flex: 1; overflow-y: auto; padding: 22px 24px 40px; }

/* ── 通用元素 ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 13px; cursor: pointer;
  transition: all .12s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-warn { background: #fff7ed; border-color: #fdba74; color: var(--warn); }
.btn-warn:hover { background: #ffedd5; border-color: #fb923c; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.2); color: #cbd5e1; }
.btn-ghost:hover { border-color: rgba(255,255,255,.4); color: #fff; }
.btn-block { width: 100%; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card-title { font-size: 14.5px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.card-title .hint { font-size: 12px; color: var(--ink-3); font-weight: 400; }

.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } }

.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16,24,40,.1); }
.stat-num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

/* ── 表格 ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f8fafc; color: var(--ink-2); font-weight: 600; position: sticky; top: 0; z-index: 1; }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }
td.wrap { white-space: normal; min-width: 160px; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
th.num { text-align: right; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.badge-gray { background: #f1f5f9; color: var(--ink-2); }
.badge-teal { background: #ccfbf1; color: #0f766e; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-green { background: #dcfce7; color: #15803d; }

/* ── 筛选条 / 标签页 ──────────────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.input, .select {
  height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px;
  font-size: 13px; outline: none; background: #fff; color: var(--ink);
}
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,193,179,.12); }
.input { min-width: 220px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 9px 16px; font-size: 13.5px; color: var(--ink-2); cursor: pointer;
  border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }
.tab .count { margin-left: 5px; font-size: 12px; color: var(--ink-3); }

.empty { text-align: center; color: var(--ink-3); padding: 40px 0; font-size: 13px; }
.loading { text-align: center; color: var(--ink-3); padding: 24px 0; font-size: 13px; }

/* ── 提现明细展开区 ───────────────────────────────────────── */
.sources { background: #f8fafc; border: 1px dashed var(--line); border-radius: 8px; padding: 12px 14px; margin-top: 10px; }
.sources-title { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.sources table { font-size: 12.5px; }
.sources th, .sources td { padding: 6px 10px; }

/* ── Toast / Modal ────────────────────────────────────────── */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #111827; color: #fff; border-radius: 8px; padding: 10px 18px; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: toast-in .18s ease-out; max-width: 80vw;
}
.toast.ok { background: #065f46; }
.toast.err { background: #991b1b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade-in .15s;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 14px; width: 460px; max-width: 100%; max-height: 86vh;
  display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(0,0,0,.3);
}
.modal.wide { width: 720px; }
.modal-head { padding: 18px 22px 0; font-size: 15.5px; font-weight: 600; }
.modal-body { padding: 14px 22px; overflow-y: auto; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.modal-body .field { display: block; margin: 12px 0; }
.modal-body .field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; }
.modal-body .field input, .modal-body .field textarea, .modal-body .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; outline: none; font-family: inherit;
}
.modal-body .field textarea { min-height: 72px; resize: vertical; }
.modal-body .field input:focus, .modal-body .field textarea:focus { border-color: var(--brand); }
.modal-body .warn-box { background: #fff7ed; border: 1px solid #fdba74; color: #9a3412; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin: 10px 0; }
.modal-body img.review-img { width: 100%; border-radius: 8px; border: 1px solid var(--line); margin: 6px 0; }
.modal-foot { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 10px; }

/* ── 待办列表 ─────────────────────────────────────────────── */
.todo-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--line);
  cursor: pointer; font-size: 13.5px;
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover .todo-label { color: var(--brand-dark); }
.todo-count { margin-left: auto; background: #fee2e2; color: #b91c1c; border-radius: 99px; font-size: 12px; padding: 2px 10px; font-weight: 600; }
.todo-count.zero { background: #f1f5f9; color: var(--ink-3); }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { color: var(--ink); }

.pager { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 14px 0 0; font-size: 13px; color: var(--ink-3); }
