/* ============================================================
 * 曲线时间维度：典型日 / 全年（12 月 × 24 小时）
 * 配套 curve-view.js   2026-10-28
 *
 * 只挂在「日综合 功率曲线分析」这个面板上，不侵入内核。
 * 面板是白底，所有规则都限定在 .cv-* 命名空间内。
 * ============================================================ */

/* ---- 右上角控件 ---- */
.cv-ctrl {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: auto; margin-right: 10px;
  font-size: 12px; vertical-align: middle;
}
.cv-seg {
  display: inline-flex; border: 1px solid #cbd9e8; border-radius: 8px;
  overflow: hidden; background: #f4f8fc;
}
.cv-seg button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 4px 11px; font: inherit; font-size: 12px; font-weight: 600;
  color: #5b7290; line-height: 1.6;
}
.cv-seg button + button { border-left: 1px solid #dbe6f2; }
.cv-seg button.on {
  background: linear-gradient(135deg, #1b6fe0, #3b8ff0); color: #fff;
  box-shadow: 0 2px 8px -3px rgba(27, 111, 224, .8);
}
.cv-month { display: inline-flex; align-items: center; gap: 3px; }
.cv-month button {
  appearance: none; border: 1px solid #cbd9e8; background: #fff; cursor: pointer;
  width: 22px; height: 24px; border-radius: 6px; padding: 0;
  font-size: 11px; color: #3f5a76; line-height: 1;
}
.cv-month button:hover { background: #eef5fd; border-color: #9cc2f5; }
.cv-month select {
  font: inherit; font-size: 12px; padding: 3px 6px; border-radius: 6px;
  border: 1px solid #cbd9e8; background: #fff; color: #12314d; font-weight: 600;
}
/* ---- 日期选择 ---- */
.cv-date { display: inline-flex; align-items: center; }
.cv-date input[type="date"] {
  font: inherit; font-size: 11.5px; padding: 2px 4px; border-radius: 6px;
  border: 1px solid #cbd9e8; background: #fff; color: #12314d; font-weight: 600;
  width: 128px; height: 24px;
}
.cv-date input[type="date"]:hover { border-color: #9cc2f5; background: #f7fbff; }
.cv-date input[type="date"]:focus { outline: 2px solid #bcd8fb; outline-offset: 0; }

/* ---- 全年视图 ---- */
#cvYearWrap { margin-top: 4px; }
.cv-yhead {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.cv-yhead .cv-h { font-size: 13px; font-weight: 700; color: #0b2540; }
.cv-yhead .cv-sub { font-size: 11.5px; color: #7b8ea3; }
.cv-dim {
  display: inline-flex; border: 1px solid #cbd9e8; border-radius: 8px; overflow: hidden;
  margin-left: auto; background: #f4f8fc;
}
.cv-dim button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 4px 12px; font: inherit; font-size: 12px; font-weight: 600; color: #5b7290;
}
.cv-dim button + button { border-left: 1px solid #dbe6f2; }
.cv-dim button.on { background: #fff; color: #0b2540; box-shadow: inset 0 -2px 0 #1b6fe0; }

.cv-heat-scroll { overflow-x: auto; padding-bottom: 4px; }
.cv-heat {
  display: grid;
  grid-template-columns: 54px repeat(24, minmax(24px, 1fr)) 60px;
  gap: 2px; min-width: 800px; font-variant-numeric: tabular-nums;
}
.cv-heat .cv-hc, .cv-heat .cv-hr {
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; color: #7b8ea3; height: 20px;
}
/* 表头底纹＝分时时段（尖/峰/平/谷/深），只做细下划线，避免和热力格抢视觉 */
.cv-heat .cv-hc.s-sharp { box-shadow: inset 0 -3px 0 #ef4444; color: #991b1b; font-weight: 700; }
.cv-heat .cv-hc.s-peak { box-shadow: inset 0 -3px 0 #f97316; color: #9a3412; font-weight: 700; }
.cv-heat .cv-hc.s-flat { box-shadow: inset 0 -3px 0 #2563eb; color: #1e40af; font-weight: 700; }
.cv-heat .cv-hc.s-valley { box-shadow: inset 0 -3px 0 #10b981; color: #047857; font-weight: 700; }
.cv-heat .cv-hc.s-deep { box-shadow: inset 0 -3px 0 #7c3aed; color: #5b21b6; font-weight: 700; }
.cv-heat .cv-hc-sum { font-size: 10px; color: #8fa2b6; }
.cv-heat .cv-daycell {
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 4px; height: 26px; font-size: 9.5px; color: #5b7290;
  font-variant-numeric: tabular-nums;
}
.cv-heat .cv-hr {
  justify-content: flex-end; padding-right: 6px; cursor: pointer;
  font-weight: 700; color: #33506d; border-radius: 5px;
}
.cv-heat .cv-hr:hover { background: #eef5fd; color: #1b6fe0; }
.cv-heat .cv-hr.on { background: #1b6fe0; color: #fff; }
.cv-heat .cv-c {
  height: 26px; border-radius: 4px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 9.5px; color: #12314d; transition: transform .1s;
  border: 1px solid rgba(11, 37, 64, .05);
}
.cv-heat .cv-c:hover { transform: scale(1.12); outline: 1.5px solid #1b6fe0; z-index: 2; }

.cv-legend {
  display: flex; align-items: center; gap: 8px; margin: 9px 0 2px;
  font-size: 11.5px; color: #7b8ea3;
}
.cv-legend .cv-scale {
  width: 120px; height: 9px; border-radius: 5px;
  background: linear-gradient(90deg, #eaf3fd, #9cc8f7, #3b8ff0, #0b4f9e);
}
.cv-legend .cv-scale.warm { background: linear-gradient(90deg, #fff7e6, #ffd08a, #f59e0b, #a1520a); }
.cv-legend .cv-scale.cyan { background: linear-gradient(90deg, #e8fbff, #9fe9f7, #06b6d4, #0a6f84); }
.cv-legend-slot { margin-top: 2px; gap: 10px; }
.cv-legend-slot .cv-sl { display: inline-flex; align-items: center; gap: 4px; color: #47617c; }
.cv-legend-slot .cv-sl i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.cv-legend-slot .cv-sl i.s-sharp { background: #ef4444; }
.cv-legend-slot .cv-sl i.s-peak { background: #f97316; }
.cv-legend-slot .cv-sl i.s-flat { background: #2563eb; }
.cv-legend-slot .cv-sl i.s-valley { background: #10b981; }
.cv-legend-slot .cv-sl i.s-deep { background: #7c3aed; }
.cv-legend .cv-sum { margin-left: auto; color: #47617c; }
.cv-legend .cv-sum b { color: #0b2540; }

/* 月度柱状 */
.cv-bars {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px;
  margin-top: 14px; align-items: end; min-width: 720px;
}
.cv-bars .cv-bcol { text-align: center; border-radius: 6px; padding: 2px 0; }
.cv-bars .cv-bcol.on { background: #f2f8ff; box-shadow: inset 0 0 0 1px #d6e8fc; }
.cv-bars .cv-bpair {
  height: 92px; display: flex; align-items: flex-end; justify-content: center; gap: 3px;
}
.cv-bars .cv-bar { width: 45%; border-radius: 3px 3px 0 0; min-height: 2px; }
.cv-bars .cv-bar.use { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.cv-bars .cv-bar.gen { background: linear-gradient(180deg, #fbbf24, #d97706); }
.cv-bars .cv-bm { font-size: 10.5px; color: #5b7290; margin-top: 3px; font-weight: 600; }
.cv-bars .cv-bv { font-size: 9.5px; color: #8fa2b6; line-height: 1.35; }

.cv-note {
  margin-top: 12px; padding: 9px 12px; border-radius: 9px;
  background: #f6f9fd; border: 1px solid #e3ecf6; border-left: 3px solid #1b6fe0;
  font-size: 11.5px; line-height: 1.8; color: #47617c;
}
.cv-note b { color: #12314d; }
.cv-loading { padding: 26px 0; text-align: center; color: #7b8ea3; font-size: 13px; }

@media (max-width: 768px) {
  .cv-ctrl {
    margin-left: 0; margin-right: 0; width: 100%; justify-content: flex-start;
    margin-top: 8px; flex-wrap: wrap; gap: 6px;
  }
  .cv-date input[type="date"] { width: 118px; }
  .cv-bars { min-width: 640px; }
  .cv-bars .cv-bpair { height: 70px; }
  .cv-legend .cv-sum { margin-left: 0; width: 100%; }
}
