:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #1f2733;
  --muted: #7a8699;
  --line: #e6eaf0;
  --brand: #1a9c53;
  --brand-2: #2f6bff;
  --danger: #e25b4b;
  --warn: #e89b1a;
  --up: #e25b4b;
  --down: #1a9c53;
  --shadow: 0 2px 10px rgba(31, 39, 51, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}
#app { min-height: 100vh; }

/* ——— 登录 ——— */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f6ee 0%, #eaf1ff 100%);
}
.login-card {
  width: 360px;
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 36px 32px;
}
.login-card h1 { font-size: 22px; margin: 0 0 4px; }
.login-card .sub { color: var(--muted); margin: 0 0 24px; font-size: 13px; }
.login-logo {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--brand); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  margin-bottom: 16px;
}

/* ——— 布局 ——— */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: #0f1b2d;
  color: #cdd6e4;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}
.sidebar .brand {
  padding: 0 22px 18px;
  font-size: 18px; font-weight: 800; color: #fff;
  display: flex; align-items: center; gap: 10px;
}
.sidebar .brand .dot { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.nav-item {
  padding: 12px 22px; cursor: pointer; color: #cdd6e4;
  border-left: 3px solid transparent; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
}
.nav-item:hover { background: rgba(255,255,255,0.06); }
.nav-item.active { background: rgba(26,156,83,0.18); border-left-color: var(--brand); color: #fff; }
.sidebar .spacer { flex: 1; }
.sidebar .user {
  padding: 14px 22px; border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 13px; color: #9fb0c8;
}
.sidebar .user b { color: #fff; display: block; font-size: 14px; }
.sidebar .logout { color: var(--danger); cursor: pointer; }

.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 24px; font-weight: 600; font-size: 16px;
}
.view { padding: 24px; }

/* ——— 卡片/统计 ——— */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.card {
  background: var(--panel); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow);
}
.card .k { color: var(--muted); font-size: 13px; }
.card .v { font-size: 26px; font-weight: 800; margin-top: 6px; }
.card .v.sm { font-size: 18px; }
.card .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.section { background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.section h3 { margin: 0 0 14px; font-size: 15px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* ——— 表格 ——— */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; background: #fafbfc; }
tbody tr:hover { background: #f7f9fc; }
.empty { color: var(--muted); padding: 24px; text-align: center; }

/* ——— 按钮 ——— */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.btn:hover { border-color: #cfd6e0; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.brand2 { background: var(--brand-2); color: #fff; border-color: var(--brand-2); }
.btn.danger { color: var(--danger); border-color: #f3c4bd; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn-link { background: none; border: none; color: var(--brand-2); cursor: pointer; padding: 2px 6px; font-size: 13px; }
.btn-link.danger { color: var(--danger); }

/* ——— 徽标/标签 ——— */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.badge.green { background: #e6f4ea; color: #1a9c53; }
.badge.red { background: #fbe6e3; color: #e25b4b; }
.badge.gray { background: #eef1f5; color: #7a8699; }
.badge.blue { background: #eaf1ff; color: #2f6bff; }

/* ——— 表单/弹窗 ——— */
.modal-mask { position: fixed; inset: 0; background: rgba(15,27,45,0.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { width: 520px; max-width: 92vw; max-height: 88vh; overflow: auto; background: #fff; border-radius: 14px; padding: 22px 24px; }
.modal h3 { margin: 0 0 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
  font-family: inherit;
}
.field textarea { min-height: 90px; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
select { background: #fff; }

/* ——— 条形/占比 ——— */
.bar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.bar-row .name { width: 64px; color: var(--muted); flex-shrink: 0; }
.bar-track { flex: 1; background: #eef1f5; border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #1a9c53, #2f6bff); border-radius: 6px; }
.bar-row .val { width: 88px; text-align: right; flex-shrink: 0; }

/* ——— 杂项 ——— */
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); }
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: #0f1b2d; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 99; font-size: 13px;
  box-shadow: var(--shadow);
}
.report-box { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 16px; font-size: 13px; }
.report-box p { margin: 6px 0; }
.switch { display: inline-flex; align-items: center; gap: 8px; }
.switch input { width: 16px; height: 16px; }
