/* 后台首页：KPI + 趋势 + 排行 + 实时动态 */
.dash-page {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-bottom: 24px;
}

#dashPageContent {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.dash-head-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1f2430;
}

.dash-head-meta {
  font-size: 12px;
  color: #8a9099;
}

.dash-head-refresh {
  border: 1px solid #d2d7e3;
  background: #fff;
  color: #364054;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.dash-head-refresh:hover {
  border-color: #2e73ff;
  color: #2e73ff;
}

/* —— 顶层 KPI —— */
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1200px) {
  .dash-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dash-kpi {
  background: #fff;
  border-radius: 12px;
  padding: 18px 18px 16px;
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.06);
  border: 1px solid #e8ebf2;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  min-width: 0;
}

.dash-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.1);
}

.dash-kpi-label {
  font-size: 13px;
  color: #8a9099;
  margin-top: 0;
}

.dash-kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: #1f2430;
  line-height: 1.2;
  margin-top: 6px;
}

.dash-kpi-value--money {
  color: #d92d2d;
}

.dash-kpi-change {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
}

.dash-kpi-change--up {
  color: #17b26a;
}
.dash-kpi-change--down {
  color: #f04438;
}
.dash-kpi-change--flat {
  color: #8a9099;
}

.dash-kpi-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7489;
}

/* —— 中层图表 —— */
.dash-mid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  min-width: 0;
}

@media (max-width: 1000px) {
  .dash-mid {
    grid-template-columns: 1fr;
  }
}

.dash-card {
  background: #fff;
  border: 1px solid #e8ebf2;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.05);
  min-width: 0;
}

.dash-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #1f2430;
  margin-bottom: 4px;
}

.dash-card-desc {
  font-size: 12px;
  color: #8a9099;
  margin-bottom: 16px;
}

.dash-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #5c6578;
}

.dash-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.dash-legend-swatch--sales {
  background: linear-gradient(180deg, #2e73ff, #6ba3ff);
}
.dash-legend-swatch--borrow {
  background: #17b26a;
  border-radius: 50%;
  width: 10px;
  height: 10px;
}

/* 双轴趋势图 */
.dash-combo {
  display: flex;
  gap: 8px;
  height: 200px;
  min-width: 0;
}

.dash-combo-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 10px;
  color: #8a9099;
  width: 36px;
  flex-shrink: 0;
  text-align: right;
}

.dash-combo-main {
  flex: 1;
  min-width: 0;
  position: relative;
  border-left: 1px solid #edf0f6;
  border-bottom: 1px solid #edf0f6;
}

.dash-combo-bars {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 12px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 0 4px;
}

.dash-combo-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.dash-combo-bar {
  width: 100%;
  max-width: 32px;
  background: linear-gradient(180deg, #2e73ff 0%, #6ba3ff 100%);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}

.dash-combo-line-layer {
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  bottom: 24px;
  pointer-events: none;
}

.dash-combo-line-svg {
  width: 100%;
  height: 100%;
}

.dash-combo-labels {
  display: flex;
  gap: 6px;
  padding: 8px 4px 0 44px;
}

.dash-combo-lbl {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: #8a9099;
  min-width: 0;
}

/* 环形图 */
.dash-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.dash-donut {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.dash-donut-hole {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px #f0f2f7;
}

.dash-donut-total {
  font-size: 11px;
  color: #8a9099;
}

.dash-donut-amt {
  font-size: 16px;
  font-weight: 700;
  color: #d92d2d;
  margin-top: 2px;
}

.dash-donut-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-donut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #5c6578;
}

.dash-donut-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}

.dash-donut-row-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

/* —— 底层列表 —— */
.dash-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .dash-bottom {
    grid-template-columns: 1fr;
  }
}

.dash-rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-rank-idx {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f0f2f7;
  color: #5c6578;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-rank-idx--top {
  background: #fdeeee;
  color: #d92d2d;
}

.dash-rank-body {
  flex: 1;
  min-width: 0;
}

.dash-rank-name {
  font-size: 13px;
  color: #1f2430;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-rank-bar-track {
  height: 6px;
  background: #f0f2f7;
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.dash-rank-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #2e73ff, #6ba3ff);
}

.dash-rank-count {
  font-size: 13px;
  font-weight: 600;
  color: #2e73ff;
  flex-shrink: 0;
}

.dash-feed {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dash-feed-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f2f7;
  cursor: pointer;
  transition: background 0.12s;
}

.dash-feed-item:hover {
  background: #fafbfc;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 6px;
}

.dash-feed-item:last-child {
  border-bottom: none;
}

.dash-feed-time {
  font-size: 12px;
  color: #8a9099;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  width: 40px;
}

.dash-feed-text {
  flex: 1;
  font-size: 13px;
  color: #364054;
  line-height: 1.45;
  min-width: 0;
}

.dash-feed-item--warn .dash-feed-text {
  color: #b42318;
}

.dash-empty {
  text-align: center;
  color: #8a9099;
  font-size: 13px;
  padding: 24px 8px;
}

.dash-loading-mask {
  text-align: center;
  padding: 80px 16px;
  color: #8a9099;
  font-size: 14px;
}

.dash-error-mask {
  text-align: center;
  padding: 80px 16px;
  color: #f04438;
  font-size: 14px;
}
