/* ============================================================================
   数据看板
   图表用纯 CSS 画（没有构建步骤，不引图表库）
   ============================================================================ */
.db-range {
  padding: 9px 12px; border: 1px solid var(--line, #dfe7e5); border-radius: 10px;
  font: inherit; font-size: 12.5px; color: var(--ink, #123343); background: #fff; cursor: pointer;
}

/* ---- KPI 卡 ---- */
.db-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-bottom: 20px; }
.db-kpi {
  background: #fff; border: 1px solid var(--line, #dfe7e5); border-radius: 14px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 3px;
}
.db-kpi small { font-size: 11.5px; color: var(--soft, #70848a); }
.db-kpi b { font-size: 27px; line-height: 1.15; color: var(--ink, #123343); font-variant-numeric: tabular-nums; }
.db-kpi span { font-size: 11.5px; color: var(--soft, #70848a); }
.db-kpi span b { font-size: 11.5px; color: var(--ink, #123343); }

.db-up { color: #2f7d5c; font-weight: 700; }
.db-down { color: #c0503a; font-weight: 700; }
.db-flat { color: #a8b4b8; }

/* ---- 切换 ---- */
.db-tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line, #dfe7e5); flex-wrap: wrap; }
.db-tabs button {
  border: none; background: none; padding: 9px 15px; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--soft, #70848a);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.db-tabs button.on { color: var(--orange, #df7040); border-bottom-color: var(--orange, #df7040); font-weight: 700; }

/* ---- 面板 ---- */
.db-panel {
  background: #fff; border: 1px solid var(--line, #dfe7e5); border-radius: 14px;
  padding: 18px 20px; margin-bottom: 16px;
}
.db-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.db-panel-head b { font-size: 13.5px; color: var(--ink, #123343); }
.db-panel-head span { font-size: 11.5px; color: var(--soft, #70848a); }
.db-note { font-size: 11.5px; color: var(--soft, #70848a); margin-top: 12px; }
.db-note b { color: var(--ink, #123343); }
.db-empty { padding: 30px; text-align: center; color: #a8b4b8; font-size: 12.5px; }

.db-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

/* ---- 竖柱图 ---- */
.db-bars { display: flex; align-items: flex-end; gap: 5px; height: 190px; padding-top: 18px; }
.db-bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.db-bar-v { font-size: 10.5px; color: var(--soft, #70848a); font-variant-numeric: tabular-nums; margin-bottom: 3px; }
.db-bar-col {
  width: 100%; max-width: 46px; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #f0a07a, #df7040);
  transition: height .3s ease;
}
.db-bar-col.zero { background: #eef2f1; height: 2px !important; }
.db-bar:hover .db-bar-col { filter: brightness(1.08); }
.db-bar-x { font-size: 10px; color: #a8b4b8; margin-top: 6px; white-space: nowrap; }

/* ---- 24 小时 ---- */
.db-hours { display: flex; align-items: flex-end; gap: 3px; height: 170px; padding-top: 14px; }
.db-hour { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; }
.db-hour-col { width: 100%; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #9fc4b6, #4f8f76); transition: height .3s ease; }
.db-hour.zero .db-hour-col { background: #eef2f1; height: 2px !important; }
.db-hour.peak .db-hour-col { background: linear-gradient(180deg, #f0a07a, #df7040); }
.db-hour span { font-size: 9.5px; color: #a8b4b8; height: 12px; }

/* ---- 横条排行 ---- */
.db-rank { display: flex; flex-direction: column; gap: 9px; }
.db-rank-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.db-rank-i { width: 18px; flex: 0 0 18px; text-align: center; color: #a8b4b8; font-size: 11px; font-variant-numeric: tabular-nums; }
.db-rank-name { flex: 0 0 40%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink, #123343); }
.db-rank-bar { flex: 1; height: 8px; background: #f2f5f4; border-radius: 999px; overflow: hidden; }
.db-rank-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #f0a07a, #df7040); }
.db-rank-n { flex: 0 0 52px; text-align: right; color: var(--soft, #70848a); font-variant-numeric: tabular-nums; }

.db-foot { font-size: 11.5px; color: #a8b4b8; margin-top: 4px; }

@media (max-width: 720px) {
  .db-bars { height: 150px; }
  .db-rank-name { flex-basis: 34%; }
  .db-bar-x { font-size: 9px; }
}
