.ch-header-controls { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-left: auto; }
.ch-daterange { display: flex; align-items: center; gap: var(--space-3); }
.ch-header-controls input[type="date"] { width: 131px; }
.ch-header-controls input[type="month"] { width: 128px; }
.ch-sub-row { margin-bottom: var(--space-3); justify-content: flex-end; }
.ch-title-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ch-sub-info { font-size: var(--text-xs); color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; }
.ch-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.ch-label { font-size: var(--text-sm); color: var(--color-text-secondary); font-weight: var(--font-weight-medium); flex-shrink: 0; min-width: 44px; }
.ch-seg { display: inline-flex; border: 1px solid var(--color-border); border-radius: var(--radius-control); overflow: hidden; background: var(--color-bg); }
.ch-seg button { border: none; background: transparent; padding: 0 var(--space-3); min-height: var(--control-h); display: inline-flex; align-items: center; white-space: nowrap; font-size: var(--control-font); cursor: pointer; color: var(--color-text-secondary); font-family: var(--font); transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.ch-seg button + button { border-left: 1px solid var(--color-border); }
.ch-seg button:hover:not(.active):not(:disabled) { background: var(--color-surface-hover); color: var(--color-text-primary); }
.ch-seg button.active { background: var(--color-primary); color: #fff; font-weight: var(--font-weight-medium); }
.ch-seg button:disabled { opacity: 0.4; cursor: default; }
.ch-seg button:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
.ch-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ch-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-pill); background: var(--color-surface); cursor: pointer; font-size: var(--text-sm); color: var(--color-text-secondary); font-family: var(--font); transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); user-select: none; }
.ch-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, #999); flex-shrink: 0; }
.ch-chip:hover { border-color: var(--color-border-hover); color: var(--color-text-primary); }
.ch-chip.active { border-color: var(--color-primary); background: var(--color-primary-light); color: var(--color-primary); font-weight: var(--font-weight-medium); }
.ch-chip:active { transform: scale(0.94); }
.ch-chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-3); }
.ch-cell { background: var(--gray-bg); border-radius: var(--radius-sm); padding: var(--space-2_5); border: 1px solid var(--color-border-light); min-width: 0; display: flex; flex-direction: column; }
.ch-cell-title { font-size: var(--text-base); font-weight: var(--font-weight-semibold); color: var(--color-text-primary); display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1); flex-wrap: wrap; }
.ch-cell-title .ch-sub { font-size: var(--text-xs); font-weight: var(--font-weight-regular); color: var(--color-text-secondary); }
.ch-tall-box { height: 430px; position: relative; background: var(--color-surface); border-radius: var(--radius-sm); border: 1px solid var(--color-border-light); padding: var(--space-1); margin-bottom: var(--space-3); min-width: 0; }
.ch-cell .chart-container { flex: 1; min-height: 250px; margin-bottom: 0; }
.ch-table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-control); max-height: 420px; overflow-y: auto; }
.ch-table-wrap thead th { position: sticky; top: 0; z-index: 2; }
.ch-mom-up { color: var(--color-danger); }
.ch-mom-down { color: var(--color-success); }
@media (max-width: 760px) {
  .ch-cards { grid-template-columns: repeat(2, 1fr); }
  .ch-grid { grid-template-columns: minmax(0, 1fr); }
  .ch-tall-box { height: 320px; }
  .ch-cell .chart-container { min-height: 210px; }
  .ch-header-controls { gap: var(--space-2); margin-left: 0; justify-content: center; }
  .ch-daterange { display: flex; align-items: center; gap: var(--space-2); flex: 1 1 100%; justify-content: center; flex-wrap: wrap; }
  .ch-daterange input[type="date"] { flex: 0 0 auto; width: 131px; }
  .ch-daterange input[type="month"] { flex: 0 0 auto; width: 128px; }
  .ch-sub-row { justify-content: center; }
  .ch-sub-row .ch-label { width: 100%; text-align: center; }
}
.ch-type-chips { margin-bottom: var(--space-2); }
.ch-table-wrap .ch-hourly-table { width: max-content; min-width: 100%; }
.ch-hourly-table th, .ch-hourly-table td { white-space: nowrap; }
.ch-table-wrap .ch-hourly-table .col-date { position: sticky; left: 0; z-index: 1; background: var(--color-surface); color: var(--color-text-primary); font-weight: var(--font-weight-medium); box-shadow: inset -1px 0 0 var(--color-border-light); }
.ch-table-wrap .ch-hourly-table thead .col-date { z-index: 3; }
.ch-table-wrap .ch-hourly-table th:nth-child(2) { color: var(--color-text-primary); }
.ch-table-wrap .ch-hourly-table td:nth-child(2) { background: var(--color-surface-hover); color: var(--color-text-primary); font-weight: var(--font-weight-semibold); }
@media (max-width: 760px) {
  #chChips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  #chChips .ch-chip { width: 100%; justify-content: center; }
  .ch-hourly-wrap { max-height: 380px; }
  .ch-hourly-table { font-size: var(--text-xs); }
  #chHourlyChips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  #chHourlyChips .ch-chip { width: 100%; justify-content: center; }
  #cmpCards .ch-card-value { font-size: clamp(11.5px, 5.67px + 1.82vw, var(--text-lg)); }
  #chProfMonth { width: clamp(105px, 6vw + 78px, 110px) !important; }
}
@media (max-width: 760px) {
  #lhChips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  #lhChips .ch-chip { width: 100%; justify-content: center; white-space: nowrap; font-size: var(--text-tiny); }
}
@media (max-width: 760px) {
  #lhProfMonth { width: clamp(105px, 6vw + 78px, 110px) !important; }
}
.ns-select { min-height: var(--control-h); padding: 0 var(--space-2); font-size: var(--control-font); font-family: var(--font); color: var(--color-text-primary); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-control); cursor: pointer; }
.ns-select:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ns-search { position: relative; }
.ns-search input { width: 190px; min-height: var(--control-h); padding: 0 var(--space-2); font-size: var(--control-font); font-family: var(--font); color: var(--color-text-primary); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-control); }
.ns-search input:focus { outline: none; box-shadow: var(--focus-ring); }
.ns-search input::placeholder { color: var(--color-text-tertiary); }
.ns-search-drop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-control); box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; display: none; }
.ns-search-drop button { display: block; width: 100%; text-align: left; padding: 6px 10px; border: none; background: transparent; font-size: var(--text-sm); color: var(--color-text-primary); font-family: var(--font); cursor: pointer; }
.ns-search-drop button:hover { background: var(--color-surface-hover); }
.ns-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-3); margin-bottom: var(--space-3); }
.ns-side { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.ns-side .ch-cell { flex: 1; min-height: 0; }
.ns-dist-box { height: 300px; position: relative; background: var(--color-surface); border-radius: var(--radius-sm); border: 1px solid var(--color-border-light); padding: var(--space-1); }
.ns-regions { display: flex; flex-direction: column; flex: 1; min-height: 0; justify-content: space-evenly; }
.ns-rrow { display: flex; align-items: center; gap: var(--space-2); padding: 5px 4px; border-radius: var(--radius-sm); cursor: pointer; }
.ns-rrow:hover { background: var(--color-surface-hover); }
.ns-rrow.active { background: var(--color-primary-light); }
.ns-rname { width: 42px; font-size: var(--text-sm); color: var(--color-text-secondary); flex-shrink: 0; }
.ns-rrow.active .ns-rname { color: var(--color-primary); font-weight: var(--font-weight-medium); }
.ns-rtrack { flex: 1; height: 8px; border-radius: var(--radius-pill); background: var(--gray-bg); overflow: hidden; }
.ns-rbar { height: 100%; border-radius: var(--radius-pill); background: var(--color-primary); opacity: .55; }
.ns-rrow.active .ns-rbar { opacity: 1; }
.ns-rval { width: 54px; text-align: right; font-size: var(--text-xs); color: var(--color-text-secondary); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.ns-rrow.active .ns-rval { color: var(--color-text-primary); }
.ns-hourly-box { height: 360px; position: relative; background: var(--color-surface); border-radius: var(--radius-sm); border: 1px solid var(--color-border-light); padding: var(--space-1); margin-bottom: var(--space-2); min-width: 0; }
.ns-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 92vw); background: var(--color-surface); border-left: 1px solid var(--color-border); box-shadow: -12px 0 32px rgba(0,0,0,.14); z-index: 120; transform: translateX(105%); transition: transform var(--dur-base) var(--ease-out); display: flex; flex-direction: column; overflow-y: auto; padding: var(--space-4); }
.ns-drawer.open { transform: translateX(0); }
.ns-drawer-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.28); z-index: 110; opacity: 0; pointer-events: none; transition: opacity var(--dur-base); }
.ns-drawer-mask.show { opacity: 1; pointer-events: auto; }
.ns-drawer-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.ns-drawer-title { flex: 1; min-width: 0; font-size: var(--text-lg); font-weight: var(--font-weight-semibold); color: var(--color-text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-icon-btn { border: 1px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-control); width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--color-text-secondary); font-size: 14px; flex-shrink: 0; }
.ns-icon-btn:hover { background: var(--color-surface-hover); color: var(--color-text-primary); }
.ns-icon-btn.starred { color: #ffb400; border-color: #ffb400; }
.ns-drawer-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin-bottom: var(--space-3); }
.ns-dk { background: var(--gray-bg); border: 1px solid var(--color-border-light); border-radius: var(--radius-sm); padding: var(--space-2); }
.ns-dk-l { font-size: var(--text-xs); color: var(--color-text-tertiary); }
.ns-dk-v { font-size: var(--text-base); font-weight: var(--font-weight-semibold); color: var(--color-text-primary); font-variant-numeric: tabular-nums; margin-top: 1px; }
.ns-dk-v .u { font-size: var(--text-xs); font-weight: var(--font-weight-regular); color: var(--color-text-tertiary); margin-left: 2px; }
.ns-drawer-block { margin-bottom: var(--space-3); }
.ns-d-chart { height: 190px; position: relative; background: var(--color-surface); border: 1px solid var(--color-border-light); border-radius: var(--radius-sm); padding: var(--space-1); }
.ns-drawer-actions { display: flex; gap: var(--space-2); margin-top: var(--space-1); }
.ns-rank-tools { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-2); }
.ns-rank-filter { width: 150px; min-height: var(--control-h); padding: 0 var(--space-2); font-size: var(--control-font); font-family: var(--font); color: var(--color-text-primary); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-control); }
.ns-rank-filter:focus { outline: none; box-shadow: var(--focus-ring); }
.ns-rank-filter::placeholder { color: var(--color-text-tertiary); }
.ns-star-chip { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-sm); color: var(--color-text-secondary); cursor: pointer; white-space: nowrap; user-select: none; }
.ns-star-chip input { accent-color: var(--color-primary); margin: 0; }
.ns-rank-actions { display: flex; gap: var(--space-2); margin-left: auto; }
.ns-cmp-box { margin-bottom: var(--space-2); }
.ns-cmp-chart { height: 300px; position: relative; background: var(--color-surface); border: 1px solid var(--color-border-light); border-radius: var(--radius-sm); padding: var(--space-1); }
.ns-rank-table { max-height: none; overflow: visible; }
.ns-rank-scroll { max-height: 560px; overflow: auto; }
.ns-rank-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ns-rank-table th.num { text-align: right; }
.ns-rank-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.ns-rank-table th.sortable:hover { color: var(--color-primary); }
.ns-rank-table th.active { color: var(--color-primary); background: var(--color-primary-light); font-weight: var(--font-weight-semibold); }
.ns-rank-table td.col-active { background: var(--color-primary-light); font-weight: var(--font-weight-medium); }
/* 两个细则宽表（#rhTableWrap，电厂行 × 月份列）：冻结首列「电厂名称」——移动端横向滑动时
   始终可见当前电厂（用户裁定方案，2026-09-12）；月份列保持正序三端一致。
   超长电厂名：列宽钳制 + 内层省略号（.rh-l-ellipsis）+ title 悬停看全名 */
#rhTableWrap table th:first-child,
#rhTableWrap table td:first-child {
  position: sticky; left: 0; z-index: 1;
  box-shadow: inset -1px 0 0 var(--color-border-light);
  width: 170px; max-width: 170px;
}
#rhTableWrap table th:first-child { background: var(--color-bg-soft, #f1f5f9); z-index: 2; }
#rhTableWrap table td:first-child { background: var(--color-surface); }
.rh-l-ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 138px; }
@media (max-width: 760px) {
  #rhTableWrap table th:first-child,
  #rhTableWrap table td:first-child { width: 130px; max-width: 130px; }
  .rh-l-ellipsis { max-width: 98px; }
}
table thead th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
table thead th.sortable:hover { color: var(--color-primary); }
table thead th.active { color: var(--color-primary); background: var(--color-primary-light); font-weight: var(--font-weight-semibold); }
table tbody td.col-active { background: var(--color-primary-light); font-weight: var(--font-weight-medium); }
.ch-table-wrap .ch-hourly-table td.col-active { background: var(--color-primary-light); font-weight: var(--font-weight-medium); }
.ns-rank-table .col-rk { color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; white-space: nowrap; width: 44px; }
.ns-rank-node { color: var(--color-primary); cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-rank-node:hover { text-decoration: underline; }
.ns-rank-star { border: none; background: transparent; cursor: pointer; color: var(--color-text-tertiary); font-size: 15px; line-height: 1; padding: 0 3px; }
.ns-rank-star.on { color: #ffb400; }
.ns-rank-star:focus-visible { outline: none; text-shadow: var(--focus-ring); }
.ns-rank-pager { display: flex; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-2) 0; font-size: var(--text-sm); color: var(--color-text-secondary); border-top: 1px solid var(--color-border-light); }
@media (max-width: 760px) {
  .ns-grid { grid-template-columns: minmax(0, 1fr); }
  .ns-dist-box { height: 240px; }
  .ns-hourly-box { height: 280px; }
  .ns-rank-tools { justify-content: center; }
  .ns-rank-actions { margin-left: 0; }
  .ns-rank-filter { flex: 1 1 100%; width: 100%; }
  .ns-cmp-chart { height: 240px; }
  .ns-rank-scroll { max-height: 480px; }
  .ns-drawer-kpis { grid-template-columns: repeat(2, 1fr); }
  .ns-search { flex: 1 1 100%; }
  .ns-search input { width: 100%; }
  .ns-search-drop { right: auto; width: 100%; }
}
