:root {
  --bg: #eef2f0;
  --side: #14301f;
  --side2: #1a3d28;
  --brand: #1f7a4c;
  --ink: #14231a;
  --muted: #607266;
  --line: #d7e1da;
  --card: #fff;
  --danger: #c0392b;
  --warn: #c47a12;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "PingFang SC","Noto Sans SC","Microsoft YaHei",sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
.admin-body { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-side {
  background: linear-gradient(180deg, var(--side), var(--side2));
  color: #e8f5ee; padding: 18px 12px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 6px 8px 18px; }
.brand .mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg,#2f9b61,#176844); font-weight: 800;
}
.brand strong { display: block; }
.brand small { opacity: .7; font-size: 12px; }
.admin-side nav { display: grid; gap: 4px; }
.admin-side a {
  color: rgba(255,255,255,.82); padding: 10px 12px; border-radius: 10px; font-weight: 600;
}
.admin-side a:hover { background: rgba(255,255,255,.08); }
.admin-side a.active { background: rgba(47,155,97,.35); color: #fff; }
.admin-main { min-width: 0; }
.admin-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px; background: rgba(238,242,240,.9); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; backdrop-filter: blur(8px); z-index: 5;
}
.admin-top h1 { margin: 0; font-size: 20px; }
.admin-user { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.admin-user-avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line); background: #eaf5ef;
}
.user-avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  display: inline-grid; place-items: center;
  background: #eaf5ef; color: #176844; font-weight: 800; border: 1px solid #cfe5d8;
}
.user-avatar.fallback { font-size: 15px; }
.user-edit-head {
  display: flex; gap: 16px; align-items: center; margin-bottom: 16px;
  padding: 12px; border-radius: 12px; background: #f5faf7; border: 1px solid var(--line);
}
.avatar-picker { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 110px; }
.avatar-preview {
  width: 84px; height: 84px; border-radius: 50%; overflow: hidden;
  border: 2px dashed #b7d4c3; background: #fff;
  display: grid; place-items: center; color: var(--muted); font-size: 13px; font-weight: 700;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-upload-btn { cursor: pointer; }
.danger-text { color: var(--danger) !important; border-color: #f0b4ad !important; }
.admin-content { padding: 18px 22px 40px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(160px,1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  box-shadow: 0 8px 24px rgba(20,45,30,.05);
}
.stat em { display: block; font-style: normal; color: var(--muted); font-size: 13px; }
.stat strong { font-size: 28px; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 8px 24px rgba(20,45,30,.05); padding: 16px; margin-bottom: 16px;
}
.panel h2 { margin: 0 0 12px; font-size: 16px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select, .field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font: inherit; background: #fff;
}
.toolbar input[type=search] { min-width: 240px; }
.btn {
  appearance: none; border: 0; cursor: pointer; border-radius: 10px;
  padding: 9px 14px; font-weight: 700; background: var(--brand); color: #fff;
}
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid #b7d4c3; }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.badge { display: inline-flex; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; background: #eef2f0; }
.badge.ok { background: #e5f6ec; color: #176844; }
.badge.fail { background: #fdecea; color: #a83228; }
.badge.warn { background: #fff4e5; color: #9a5b08; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; color: #fff; margin: 0 4px 4px 0;
  background: #1f7a4c;
}
.chip.chip-icon {
  background: #eaf5ef;
  color: #176844;
  border: 1px solid #cfe5d8;
  gap: 6px;
  padding: 3px 10px 3px 6px;
}
.chip.chip-icon i { font-style: normal; font-size: 14px; }
.type-ico-cell { font-size: 22px; line-height: 1; }
.icon-picked {
  width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 26px; background: #f5faf7; margin-bottom: 8px;
}
.icon-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; max-width: 420px;
}
.icon-opt {
  appearance: none; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; height: 40px; font-size: 20px; cursor: pointer;
}
.icon-opt.active { border-color: var(--brand); background: #eaf5ef; box-shadow: 0 0 0 2px rgba(31,122,76,.15); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field span { font-size: 13px; color: var(--muted); }
.check-list { display: flex; flex-wrap: wrap; gap: 10px; }
.check-list label { display: flex; gap: 6px; align-items: center; background: #f5faf7; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.type-pick-ico { font-size: 16px; }
.muted { color: var(--muted); }
.toast {
  position: fixed; right: 20px; bottom: 20px; background: rgba(20,35,26,.92); color: #fff;
  padding: 10px 14px; border-radius: 999px; z-index: 50; display: none;
}
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(180deg,#f4faf6,#e7efe9); }
.auth-card { width: min(420px,92vw); background: #fff; border-radius: 16px; padding: 22px; border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(20,45,30,.08); }
.auth-card h1 { margin: 0 0 8px; }
.form-layout { display: grid; grid-template-columns: 240px 1fr; gap: 14px; }
.cat-list { display: grid; gap: 6px; }
.cat-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; background: #fff; text-align: left;
}
.cat-item.active { border-color: var(--brand); background: #eaf5ef; }
.field-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #fafcfb;
}
.field-card .row { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.map-hint {
  background: #f5faf7; border: 1px dashed #b7d4c3; border-radius: 12px; padding: 12px; font-size: 13px; color: var(--muted);
}
@media (max-width: 900px) {
  .admin-body { grid-template-columns: 1fr; }
  .admin-side { position: relative; height: auto; }
  .grid-2, .grid-3, .form-layout { grid-template-columns: 1fr; }
}

/* —— 数据大屏 —— */
.dash-screen { display: grid; gap: 16px; }
.dash-hero {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-end;
  padding: 22px 24px;
  border-radius: 18px;
  color: #eaf7f0;
  background:
    radial-gradient(600px 220px at 10% 0%, rgba(80,200,140,.35), transparent 60%),
    radial-gradient(500px 200px at 90% 20%, rgba(196,122,18,.22), transparent 55%),
    linear-gradient(135deg, #0f2f1d 0%, #145233 45%, #1b6b42 100%);
  box-shadow: 0 16px 40px rgba(15, 47, 29, .25);
  position: relative; overflow: hidden;
}
.dash-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent);
  pointer-events: none;
}
.dash-kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; opacity: .75; margin-bottom: 6px;
}
.dash-title { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: .02em; }
.dash-sub { margin: 0; opacity: .78; font-size: 13px; }
.dash-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.btn.ghost.light {
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.28);
}
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.dash-kpi {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 14px 12px; box-shadow: 0 10px 28px rgba(20,45,30,.06);
  position: relative; overflow: hidden;
}
.dash-kpi::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--brand);
}
.dash-kpi em { display: block; font-style: normal; color: var(--muted); font-size: 12px; font-weight: 700; }
.dash-kpi strong { display: block; font-size: 28px; margin: 6px 0 2px; letter-spacing: -.02em; }
.dash-kpi span { font-size: 12px; color: var(--muted); }
.dash-kpi.tone-green::before { background: #1f7a4c; }
.dash-kpi.tone-teal::before { background: #0d9488; }
.dash-kpi.tone-ok::before { background: #22a06b; }
.dash-kpi.tone-bad::before { background: #e2554a; }
.dash-kpi.tone-warn::before { background: #d4920a; }
.dash-kpi.tone-blue::before { background: #3b82f6; }
.dash-kpi.tone-ok strong { color: #176844; }
.dash-kpi.tone-bad strong { color: #a83228; }
.dash-kpi.tone-warn strong { color: #9a5b08; }

.dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 14px;
}
.dash-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px 16px; box-shadow: 0 10px 28px rgba(20,45,30,.05);
  min-width: 0;
}
.dash-card-wide { grid-column: 1 / -1; }
.dash-card-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 10px;
}
.dash-card-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.dash-chart-box { position: relative; height: 260px; }
.dash-chart-box.tall { height: 280px; }
.dash-rank { display: grid; gap: 10px; padding: 4px 0 2px; min-height: 280px; }
.rank-row {
  display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center;
}
.rank-no {
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; background: #eaf5ef; color: #176844;
}
.rank-row:nth-child(1) .rank-no { background: #fdecea; color: #a83228; }
.rank-row:nth-child(2) .rank-no { background: #fff4e5; color: #9a5b08; }
.rank-row:nth-child(3) .rank-no { background: #e8f1ff; color: #1d4ed8; }
.rank-name { font-size: 13px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { height: 7px; border-radius: 999px; background: #eef2f0; overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f9b61, #1f7a4c); }
.dash-table-wrap { overflow: auto; }
.dash-table { font-size: 13px; }
.dash-table th { white-space: nowrap; }

@media (max-width: 1200px) {
  .dash-kpis { grid-template-columns: repeat(3, 1fr); }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-card-wide { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .dash-hero { flex-direction: column; align-items: flex-start; }
  .dash-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-title { font-size: 22px; }
}
