/* 左栏用电模块：横排摘要 + 最近七天柱状图 */

.elec-module {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  overflow: hidden;
}

.elec-module-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.elec-module-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 2px;
}

/* 昨日 / 本月：横排两列 */
.elec-metrics-row {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}

.elec-metric {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.elec-metric-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.elec-metric-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
}

.elec-metric-value strong {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.elec-unit {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}

.elec-metric-compare {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.elec-compare-ref {
  font-size: 0.88rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.elec-compare-ref span {
  font-variant-numeric: tabular-nums;
}

.elec-delta {
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.elec-delta--down {
  color: #52c41a;
}

.elec-delta--up {
  color: #ff6b6b;
}

.elec-delta--flat {
  color: var(--text-muted);
}

/* 最近七天：车机级纤细渐变柱图 */
.elec-recent {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.elec-recent-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 2px;
}

.elec-week-chart {
  position: relative;
  padding: 16px 10px 26px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: visible;
}

.elec-week-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  min-height: 92px;
  padding-top: 22px;
}

.elec-week-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  position: relative;
  padding-top: 20px;
}

/* 顶部 kWh：普通日半透，昨日（最新）纯白 */
.elec-week-kwh {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}

.elec-week-kwh--empty {
  color: rgba(255, 255, 255, 0.22);
}

.elec-week-col--yesterday .elec-week-kwh {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.72rem;
}

.elec-week-col--syncing .elec-week-kwh {
  color: rgba(255, 204, 0, 0.72);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  word-break: keep-all;
}

.elec-week-col--syncing .elec-week-track {
  visibility: hidden;
  height: 0;
  margin: 0;
  padding: 0;
}

.elec-week-col--syncing .elec-week-label {
  color: rgba(255, 204, 0, 0.48);
}

/* 轨道：极细引导线，不抢视觉 */
.elec-week-track {
  position: relative;
  width: 10px;
  max-width: 10px;
  height: 52px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent;
  padding: 0;
  box-sizing: border-box;
}

.elec-week-track::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 1px;
  height: 100%;
  border-radius: 1px;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.01)
  );
  pointer-events: none;
}

/* 柱体：上下渐变 + 圆顶 */
.elec-week-fill {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 0;
  border-radius: 20px 20px 4px 4px;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.2)
  );
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.04);
  transition: height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 昨日 / 最新一天：青蓝高亮渐变 */
.elec-week-col--yesterday .elec-week-fill {
  background: linear-gradient(
    to top,
    rgba(0, 229, 255, 0.1),
    rgba(0, 229, 255, 0.6)
  );
  box-shadow:
    0 0 14px rgba(0, 229, 255, 0.18),
    0 0 4px rgba(0, 229, 255, 0.12);
}

/* 底部日期 */
.elec-week-label {
  margin-top: 7px;
  font-size: 0.64rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.06em;
  white-space: nowrap;
  line-height: 1.2;
}

.elec-week-col--yesterday .elec-week-label {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
}

.elec-week-empty {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 1px;
  padding: 18px 0;
  text-align: center;
}

/* 数据来源：右下角低调脚注 */
.elec-source-note {
  position: absolute;
  right: 10px;
  bottom: 7px;
  left: auto;
  margin: 0;
  max-width: 55%;
  font-size: 0.58rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.22);
  letter-spacing: 0.4px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.elec-source-note:empty {
  display: none;
}

.elec-updated {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.5px;
}
