/* ============================================================
   后台管理系统 - 设计系统（shadcn 风格 · 柔和蓝灰 · 低饱和度）
   ============================================================ */
:root {
  --background: 215 28% 97%;
  --foreground: 222 30% 14%;
  --card: 0 0% 100%;
  --card-foreground: 222 30% 14%;
  --primary: 215 32% 48%;
  --primary-foreground: 0 0% 100%;
  --secondary: 214 30% 95%;
  --secondary-foreground: 215 30% 28%;
  --muted: 214 30% 95%;
  --muted-foreground: 215 16% 46%;
  --accent: 215 35% 94%;
  --accent-foreground: 215 35% 26%;
  --destructive: 0 66% 50%;
  --destructive-foreground: 0 0% 100%;
  --border: 214 28% 90%;
  --input: 214 28% 90%;
  --ring: 215 32% 48%;
  --radius: 0.65rem;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--muted-foreground) / 0.4); }

/* ---------- 基础交互反馈 ---------- */
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- 焦点环 ---------- */
.focus-ring:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring) / 0.5);
}

/* ---------- 登录页 ---------- */
.login-bg {
  background:
    radial-gradient(1200px 600px at 15% -10%, hsl(215 40% 92% / 0.8), transparent 60%),
    radial-gradient(1000px 500px at 90% 110%, hsl(210 35% 90% / 0.8), transparent 60%),
    hsl(var(--background));
}

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.55rem;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-green  { background: hsl(150 60% 92%); color: hsl(150 65% 26%); }
.badge-yellow { background: hsl(45 85% 90%);  color: hsl(40 70% 28%); }
.badge-red    { background: hsl(0 70% 93%);    color: hsl(0 65% 38%); }
.badge-blue   { background: hsl(215 60% 92%);  color: hsl(215 65% 32%); }
.badge-gray   { background: hsl(214 30% 94%);  color: hsl(215 16% 42%); }

/* ---------- 状态点（饱和度） ---------- */
.dot { width: 8px; height: 8px; border-radius: 9999px; display: inline-block; }
.dot-green  { background: hsl(150 65% 45%); }
.dot-yellow { background: hsl(45 90% 50%); }
.dot-red    { background: hsl(0 70% 52%); }
.dot-gray   { background: hsl(215 15% 70%); }

/* ---------- 表格 ---------- */
.table-base { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table-base thead th {
  text-align: left;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  font-size: 12.5px;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.5);
  white-space: nowrap;
}
.table-base tbody td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
  vertical-align: middle;
}
.table-base tbody tr:last-child td { border-bottom: none; }
.table-base tbody tr:hover { background: hsl(var(--accent) / 0.5); }

/* ---------- 卡片 ---------- */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 2px hsl(215 30% 50% / 0.04);
}

/* 可点击卡片（仪表盘统计） */
.card-clickable { cursor: pointer; transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease; }
.card-clickable:hover {
  box-shadow: 0 4px 16px hsl(215 30% 50% / 0.12);
  border-color: hsl(var(--ring) / 0.35);
  transform: translateY(-1px);
}

/* ---------- 动画 ---------- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn 0.25s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.toast-item { animation: toastIn 0.25s ease; }

/* ---------- 侧边栏折叠 ---------- */
.sidebar-collapsed .sidebar-link span.menu-label,
.sidebar-collapsed .sidebar-section-title,
.sidebar-collapsed .sidebar-brand-text { display: none; }

/* ---------- 地图总览 ---------- */
.map-point-dot {
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.amap-info-content {
  border-radius: 0.6rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  min-width: 200px;
  font-size: 13px;
}
.sidebar-collapsed .sidebar-link { justify-content: center; padding: 0.55rem 0; }
.sidebar-collapsed .sidebar { width: 64px; }

/* ---------- 简易图表（仪表盘柱状图） ---------- */
.bar { border-radius: 4px 4px 0 0; background: hsl(var(--primary) / 0.75); transition: height 0.4s ease; }

/* ---------- 暗色态微调（保持浅底为主） ---------- */
@media (prefers-color-scheme: dark) {
  :root { color-scheme: light; }
}
