/**
 * CityPulse 数据仪表盘页面专属样式
 * - 白色大卡片分组
 * - 蓝色主色（与全站一致）
 * - 分类分布 / 评分分布：纯 CSS 横向条形图（渐变背景 + width 控制）
 */

.dash-body {
  background: #f3f6fb;
  min-height: 100vh;
}
.container {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
}

/* ===== 顶部 ===== */
.dash-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.dash-header__inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  text-decoration: none;
}
.dash-header__logo svg {
  width: 28px;
  height: 28px;
  color: var(--color-primary, #1890ff);
}
.dash-header__nav {
  display: inline-flex;
  gap: 6px;
}
.dash-header__link {
  height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  font-size: 14px;
  color: #374151;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.dash-header__link:hover {
  background: #e6f4ff;
  color: var(--color-primary, #1890ff);
}

/* ===== 主体 ===== */
.dash-main {
  padding: 28px 0 80px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ===== 通用卡片 ===== */
.dash-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.dash-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.dash-card__title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.dash-card__title-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-primary, #1890ff);
  box-shadow: 0 0 0 4px rgba(24,144,255,0.14);
}
.dash-card__tip {
  font-size: 12px;
  color: #9ca3af;
}

/* ===== 统计卡（4 个） ===== */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.dash-stat {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}
.dash-stat::after {
  /* 右下角渐变光斑 */
  content: "";
  position: absolute;
  right: -24px;
  bottom: -24px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(24,144,255,0.14), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.dash-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -18px rgba(24,144,255,0.45);
}
.dash-stat__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex: 0 0 auto;
}
.dash-stat--places .dash-stat__icon { background: #e6f4ff; }
.dash-stat--reviews .dash-stat__icon { background: #dcfce7; }
.dash-stat--rating .dash-stat__icon { background: #fef3c7; }
.dash-stat--cats .dash-stat__icon { background: #f3e8ff; }
.dash-stat__body { flex: 1; min-width: 0; }
.dash-stat__label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
}
.dash-stat__value {
  font-size: 30px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.2px;
  line-height: 1.1;
}

/* ===== 中部双栏：分类 / 评分 ===== */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* ===== 条形图（横向，纯 CSS） ===== */
.dash-bar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dash-bar-list__loading {
  color: #9ca3af;
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
}
.dash-bar {
  display: grid;
  grid-template-columns: 84px 1fr 60px;
  align-items: center;
  gap: 12px;
}
.dash-bar__label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-bar__track {
  height: 14px;
  border-radius: 999px;
  background: #f0f4f8;
  overflow: hidden;
  position: relative;
}
.dash-bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #69b1ff 0%, #1890ff 60%, #096dd9 100%);
  transition: width 0.8s cubic-bezier(.16,.84,.44,1);
  box-shadow: 0 2px 6px -2px rgba(24,144,255,0.35);
}
.dash-bar--rating .dash-bar__fill {
  background: linear-gradient(90deg, #fde68a 0%, #f59e0b 60%, #d97706 100%);
  box-shadow: 0 2px 6px -2px rgba(245,158,11,0.35);
}
.dash-bar__value {
  font-size: 13px;
  color: #4b5563;
  text-align: right;
  font-weight: 600;
}
.dash-bar__value small {
  color: #9ca3af;
  font-weight: 400;
  margin-left: 2px;
}

/* ===== 热门 Top 5 排行榜 ===== */
.dash-top-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: top;
}
.dash-top-item {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fafbfc;
  border: 1px solid #f1f3f5;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  counter-increment: top;
}
.dash-top-item:hover {
  border-color: #91caff;
  background: #f0f8ff;
  transform: translateX(2px);
}
.dash-top-item__rank {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #6b7280;
  background: #f3f4f6;
}
/* Top 3 奖牌色 */
.dash-top-item--1 .dash-top-item__rank { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #fff; }
.dash-top-item--2 .dash-top-item__rank { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #fff; }
.dash-top-item--3 .dash-top-item__rank { background: linear-gradient(135deg, #fed7aa, #ea580c); color: #fff; }
.dash-top-item__name {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-top-item__meta {
  font-size: 12px;
  color: #9ca3af;
}
.dash-top-item__rating {
  font-size: 15px;
  font-weight: 700;
  color: #f59e0b;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* ===== Toast ===== */
.dash-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-140%);
  padding: 10px 20px;
  background: #111827;
  color: #fff;
  font-size: 14px;
  border-radius: 10px;
  box-shadow: 0 10px 24px -8px rgba(0,0,0,0.25);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 200;
  max-width: min(560px, calc(100vw - 48px));
  text-align: center;
}
.dash-toast.is-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.dash-toast.is-error { background: #ff4d4f; }

/* ===== 响应式 ===== */
@media (max-width: 960px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .dash-header__inner { height: 56px; }
  .dash-header__logo { font-size: 15px; }
  .dash-main { padding: 20px 0 60px; gap: 16px; }
  .dash-stats { grid-template-columns: 1fr; gap: 12px; }
  .dash-stat__value { font-size: 26px; }
  .dash-card { padding: 18px 16px; }
  .dash-top-item { grid-template-columns: 32px 1fr auto; row-gap: 6px; }
  .dash-top-item__meta { grid-column: 2 / 4; text-align: right; }
}
