/* 雪芽 · 山西电力现货市场运行数据
   视觉基调：冷调纸白 + 松针绿 + 两种数据色（日前 petrol / 实时 ochre）
   结构：细线分节、无卡片阴影、信息以字重与留白分级 */

:root {
  --paper: #F0F2ED;
  --surface: #FFFFFF;
  --surface-2: #F7F8F5;
  --ink: #17211C;
  --ink-2: #4C5A53;
  --ink-3: #7E8C85;
  --rule: #D8DDD6;
  --rule-2: #E9EDE6;
  --sprout: #3F6B4E;
  --sprout-2: #E8EFE7;
  --out: #3F6B4E;
  --tie: #A8721F;
  --da: #2E5F73;
  --da-2: #D9E4E8;
  --rt: #A8721F;
  --rt-2: #F0E4CE;
  --alert: #A33B2B;
  --alert-2: #F2E2DE;
  --r: 3px;
  --rail-w: 168px;
  --rail-gap: 30px;
  --num: "SF Mono", "Cascadia Mono", ui-monospace, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 13px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------------------------------------------------------------- 板块列 */
.workspace {
  position: relative;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  column-gap: var(--rail-gap);
}

/* 分栏线贯穿内容区，与各分节的横线相交，形成报表网格 */
.workspace::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--rail-w) + var(--rail-gap) / 2);
  width: 1px;
  background: var(--rule-2);
  pointer-events: none;
}

.rail {
  position: sticky;
  top: var(--rail-top, 108px);
  align-self: start;
  min-width: 0;
  padding: 30px 0 40px;
}

/* 后续新增板块沿用 .rail-sec，组间以细线分隔 */
.rail-sec + .rail-sec {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--rule-2);
}

.rail-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 9px;
  padding-left: 12px;
  border-left: 2px solid transparent;
  text-decoration: none;
  color: var(--ink-2);
  transition: color 150ms ease, border-color 150ms ease;
}
.rail-item.is-on { border-left-color: var(--sprout); }

/* 板块内的视图目录：与标题同一左缘，用同一条刻度线延续下去 */
.rail-list {
  display: flex;
  flex-direction: column;
  margin: 14px 0 0;
}

.rail-link {
  display: block;
  padding: 4.5px 0 4.5px 12px;
  border-left: 2px solid transparent;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 150ms ease, border-color 150ms ease;
}
.rail-link:hover { color: var(--ink); }
.rail-link.is-on { color: var(--ink); border-left-color: var(--ink-3); }

main .block { scroll-margin-top: calc(var(--rail-top, 108px) + 16px); }

.rail-num {
  font-family: var(--num);
  font-size: 9.5px;
  letter-spacing: .06em;
  color: var(--ink-3);
}

.rail-name {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: .10em;
  color: var(--ink);
  transition: color 150ms ease;
}
.rail-item:hover .rail-name { color: var(--sprout); }

.rail-desc {
  grid-column: 2;
  margin-top: 4px;
  font-size: 10.5px;
  line-height: 1.65;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.brand { display: flex; align-items: center; gap: 10px; }

.logo { width: 20px; height: 20px; flex: 0 0 auto; }

.mark {
  font-family: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei Light",
               "Source Han Sans SC Light", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: .24em;
  text-indent: .24em;
  line-height: 1;
}

.rule-v { width: 1px; height: 15px; background: var(--rule); }

.sub { font-size: 11.5px; color: var(--ink-3); letter-spacing: .02em; }

.top-right { display: flex; align-items: center; gap: 14px; }

.sync {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--ink-3);
  min-width: 0;
}
#syncText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--sprout);
  box-shadow: 0 0 0 3px rgba(63, 107, 78, .12);
}
.sync .dot.is-warn { background: var(--rt); box-shadow: 0 0 0 3px rgba(168, 114, 31, .14); }
.sync .dot.is-err { background: var(--alert); box-shadow: 0 0 0 3px rgba(163, 59, 43, .14); }
.sync .dot.is-busy { animation: breathe 1.6s ease-in-out infinite; }

@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px;
  font: inherit; font-size: 11.5px; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.btn:hover { background: #FCFCFA; border-color: #C6CEC5; }
.btn:active { transform: translateY(.5px); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn svg { color: var(--ink-3); }
/* 卡片标题行里的小号按钮：与 badge 同一高度带，不撑高标题 */
.btn-xs { height: 24px; padding: 0 9px; gap: 5px; font-size: 11px; }
.btn-xs svg { width: 12px; height: 12px; }
.btn-xs span { white-space: nowrap; }
/* 窄屏标题行改为占满宽度时，操作按钮贴右，徽标留在左侧 */
.hd-ctl > .btn-xs { margin-left: auto; }
.btn-xs.is-done { color: var(--sprout); border-color: rgba(63, 107, 78, .45); background: var(--sprout-2); }
.btn-xs.is-done svg { color: var(--sprout); }

/* ---------------------------------------------------------------- 运行日 */
.daybar {
  position: sticky;
  top: 54px;
  z-index: 19;
  display: flex;
  gap: 4px;
  padding: 9px 0;
  overflow-x: auto;
  background: var(--paper);
  border-bottom: 1px solid var(--rule-2);
  scrollbar-width: none;
}
.daybar::-webkit-scrollbar { display: none; }

.day {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 58px; padding: 5px 8px 4px;
  font: inherit; text-align: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.day:hover { background: #E6EAE3; }
.day .dw { font-size: 9.5px; color: var(--ink-3); letter-spacing: .02em; }
.day .dd { font-size: 12px; font-weight: 500; }
.day .st {
  width: 4px; height: 4px; margin-top: 2px; border-radius: 50%;
  background: transparent;
}
.day .st.ok { background: var(--sprout); }
.day .st.partial { background: var(--rt); }
.day .st.empty, .day .st.none { background: #C9D1C8; }
.day.is-on { background: var(--ink); color: #F4F6F2; }
.day.is-on .dw { color: #A9B8AC; }
.day.is-on .st.ok { background: #8FBF9D; }
.day.is-on .st.partial { background: #D9AE6A; }
.day.is-on .st.empty, .day.is-on .st.none { background: #5E6B62; }
.day.is-today .dd::after { content: "今"; font-size: 8px; margin-left: 2px; vertical-align: super; color: var(--sprout); }
.day.is-on.is-today .dd::after { color: #9CC9A9; }

/* ---------------------------------------------------------------- 分节 */
.block { padding-top: 30px; }
.block + .block {
  margin-top: 26px;
  border-top: 1px solid var(--rule);
}

.block-hd {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
}
.hd-title h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
}
.hint {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--ink-3);
}
.hd-ctl { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 12px 14px 10px;
}
.panel-tight { padding: 0; overflow: hidden; }
.cell { display: flex; flex-direction: column; }
.cell > .panel { flex: 1 1 auto; }

.grid { display: grid; gap: 26px; }
.g-7-5 { grid-template-columns: 7fr 5fr; }
.g-6-6 { grid-template-columns: 1fr 1fr; }
/* 通道容量为主图，占宽更大；右侧限额为两列窄列表，宽屏每列约 250px，可容纳最长 9 字断面名 */
.g-cap { grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr); }
.cell { min-width: 0; }

/* ---------------------------------------------------------------- 概况 */
.block-hero {
  margin-top: 18px;
  padding: 22px 24px 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
}

.hero-grid {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr) 268px;
  gap: 30px;
  align-items: start;
  padding-bottom: 16px;
}

.hero-date {
  font-size: 46px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.hero-day { margin-top: 9px; font-size: 11.5px; color: var(--ink-3); }
.hero-note {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.7;
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 22px;
}
.kpi { padding: 2px 0 0; }
.kpi + .kpi { border-left: 1px solid var(--rule-2); padding-left: 22px; }
.kpi .k-label { font-size: 11px; color: var(--ink-3); }
.kpi .k-main {
  margin-top: 3px;
  font-size: 27px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.kpi .k-main .u { font-size: 11px; font-weight: 500; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.kpi .k-main .k-none {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0;
}
.kpi .k-sub { margin-top: 5px; font-size: 11.5px; color: var(--ink-2); }
.kpi .k-sub em { font-style: normal; color: var(--ink-3); }
.kpi .k-sub b { font-weight: 600; }

.hero-spark { padding-top: 2px; position: relative; }
.spark-head {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 11px; color: var(--ink-3);
  padding-bottom: 2px;
}
.spark-range { font-size: 10.5px; }
.spark { height: 58px; }
.spark.is-empty { height: 0; }
.spark-legend {
  display: flex; align-items: center; gap: 14px;
  padding-top: 5px; font-size: 10.5px; color: var(--ink-3);
}
.spark-legend span { display: inline-flex; align-items: center; gap: 5px; }
.spark-legend i { width: 13px; height: 2px; background: var(--da); border-radius: 1px; }
.spark-legend i.dash {
  background: none;
  background-image: repeating-linear-gradient(90deg, var(--da) 0 4px, transparent 4px 7px);
}
.spark-legend b {
  font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums;
}
.spark-empty { color: var(--ink-3); }

.hero-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0 2px;
  border-top: 1px solid var(--rule-2);
}
.foot-figs { display: flex; flex-wrap: wrap; gap: 8px 34px; }
.fig { display: flex; align-items: baseline; gap: 8px; }
.fig .f-label { font-size: 11px; color: var(--ink-3); }
.fig .f-val { font-size: 13.5px; font-weight: 600; }
.fig .f-val .u { font-size: 10.5px; font-weight: 400; color: var(--ink-3); margin-left: 2px; }

.link-toggle {
  flex: 0 0 auto;
  font: inherit; font-size: 11.5px; color: var(--ink-2);
  background: none; border: 0; border-bottom: 1px solid var(--rule);
  padding: 1px 0; cursor: pointer;
}
.link-toggle:hover { color: var(--sprout); border-color: var(--sprout); }

.raw-text {
  margin: 4px 0 6px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-left: 2px solid var(--sprout);
  font-size: 12px;
  line-height: 1.9;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- 图例与控件 */
.legend { display: flex; flex-wrap: wrap; gap: 3px 20px; margin-bottom: 8px; }

.lg-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 2px 0; border: 0; background: none;
  font: inherit; font-size: 11.5px; color: var(--ink-2);
  cursor: pointer;
  transition: opacity 150ms ease;
}
.lg-item .sw { width: 16px; height: 2px; border-radius: 1px; }
.lg-item .sw.dash {
  background: none !important;
  background-image: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px) !important;
}
.lg-item .v { font-size: 11px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.lg-item.is-off { opacity: .32; }

.lg-item .sw.sq { width: 8px; height: 8px; border-radius: 1px; }
.lg-item.is-static { cursor: default; }
.lg-item.is-static:hover { color: var(--ink-2); }
.lg-item.is-on { color: var(--ink); font-weight: 500; }

.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  overflow: hidden;
}
.seg button {
  font: inherit; font-size: 11px;
  padding: 5px 9px;
  color: var(--ink-2);
  background: none; border: 0;
  border-right: 1px solid var(--rule-2);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: #EFF2EC; }
.seg button.is-on {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--sprout);
}

select {
  appearance: none;
  font: inherit; font-size: 11.5px; color: var(--ink);
  height: 27px;
  max-width: 220px;
  padding: 0 26px 0 9px;
  background: var(--surface)
    url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237E8C85' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 9px center;
  background-size: 9px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  cursor: pointer;
  text-overflow: ellipsis;
}
select:hover { border-color: #C6CEC5; }

.badge {
  font-size: 10.5px; color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--rule-2);
  border-radius: 2px;
  padding: 2px 7px;
  white-space: nowrap;
}
.badge:empty { display: none; }

:focus-visible {
  outline: 2px solid var(--sprout);
  outline-offset: 1px;
  border-radius: 2px;
}

/* ---------------------------------------------------------------- 图表 */
.chart { width: 100%; }
.chart-lg { height: 336px; }
.chart.is-empty { height: 186px; }
.chart-lg.is-empty { height: 216px; }
.chart-md { height: 244px; }
.chart-maint { height: 214px; }

/* 通道图例：名称较长（如「8回500KV线路」），排到图外，避免与相邻项挤压 */
.ch-legend { margin-bottom: 6px; gap: 3px 22px; }
.ch-legend .lg-item { font-size: 11px; }
.chart.chart-ch { height: 216px; }
/* 空态没有图例，补回图例占位，保证与右栏等齐 */
.chart.chart-ch.is-empty { height: 244px; }

.chart-note {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--rule-2);
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.7;
}

.tie-note {
  margin: 4px 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule-2);
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.6;
}
.mini-stats { display: flex; flex-wrap: wrap; gap: 6px 26px; margin-bottom: 4px; }
.ms { display: flex; align-items: baseline; gap: 6px; }
.ms .ms-l { font-size: 10.5px; color: var(--ink-3); }
.ms .ms-v { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

.afc-delta {
  display: flex;
  align-items: center;
  margin-top: 6px;
  padding: 7px 0 2px;
  border-top: 1px solid var(--rule-2);
}
.afc-delta .ad-l { flex: 0 0 52px; font-size: 10px; color: var(--ink-3); }
.afc-delta .ad-v {
  flex: 1; text-align: center; font-size: 11px;
  font-variant-numeric: tabular-nums; color: var(--ink-3);
}
.afc-delta .ad-v.up { color: #8A5D18; font-weight: 600; }
.afc-delta .ad-v.down { color: #2E5F73; font-weight: 600; }

/* ---------------------------------------------------------------- 必开必停 */
.unit-duo { display: grid; grid-template-columns: 1fr 1fr; }
.ud { padding: 16px 16px 10px; }
.ud + .ud { border-left: 1px solid var(--rule-2); }
.ud .n { font-size: 34px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.ud .n .u { font-size: 11px; font-weight: 500; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.ud .t { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11.5px; color: var(--ink-2); }
.ud .t i { width: 6px; height: 6px; border-radius: 1px; display: inline-block; }

.day-bars {
  display: flex;
  gap: 4px;
  height: 66px;
  padding: 0 0 0 54px;
  margin: 2px 0 4px;
  border-bottom: 1px solid var(--rule-2);
}
.db {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 3px;
  padding-bottom: 2px;
}
.db i {
  display: block;
  width: 100%;
  max-width: 20px;
  background: var(--out);
  opacity: .22;
  border-radius: 1px 1px 0 0;
  min-height: 2px;
}
.db.on i { opacity: .85; }
.db span { font-size: 8.5px; line-height: 1; color: var(--ink-3); }
.db.on span { color: var(--ink); font-weight: 600; }

.unit-strip {
  flex: 1 1 auto;
  display: flex; align-items: stretch; gap: 3px;
  min-height: 104px;
  padding: 14px 16px 0;
  border-top: 1px solid var(--rule-2);
  border-bottom: 1px solid var(--rule-2);
}
.us-col { flex: 1; display: flex; align-items: flex-end; justify-content: center; height: auto; min-height: 0; }
.us-pair { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.us-pair span { width: 7px; border-radius: 1px 1px 0 0; min-height: 2px; }
.us-pair .r { background: var(--sprout); }
.us-pair .s { background: var(--rt); }
.us-col.is-on .r { filter: saturate(1.1); }
.us-axis {
  display: flex; gap: 3px; padding: 5px 16px 12px;
  font-size: 9.5px; color: var(--ink-3);
}
.us-axis span { flex: 1; text-align: center; display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.us-axis i { font-style: normal; font-size: 9px; color: var(--ink-3); opacity: .85; }
.us-axis span.is-on b { color: var(--ink); font-weight: 600; }
.us-axis span.is-on i { color: var(--sprout); opacity: 1; font-weight: 600; }
.unit-cap { padding: 0 16px 14px; font-size: 10.5px; color: var(--ink-3); line-height: 1.7; }

/* ---------------------------------------------------------------- 越限 */
.con-head {
  display: grid; grid-template-columns: minmax(88px, 1fr) 74px minmax(0, 1.7fr);
  gap: 10px;
  padding: 9px 14px;
  font-size: 10.5px;
  color: var(--ink-3);
  border-bottom: 1px solid var(--rule-2);
  background: var(--surface-2);
}
.con-group { padding: 2px 0 4px; }
.con-label {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px 5px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
  color: var(--ink-2);
}
.con-label i { width: 5px; height: 5px; border-radius: 50%; }
.con-row {
  display: grid; grid-template-columns: minmax(88px, 1fr) 74px minmax(0, 1.7fr);
  gap: 10px;
  align-items: center;
  padding: 6px 14px;
  border-bottom: 1px solid var(--rule-2);
  font-size: 12px;
}
.con-row:last-child { border-bottom: 0; }
.con-name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.con-cnt { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.con-cnt b { font-weight: 600; color: var(--alert); }
.strip { display: flex; gap: 1px; height: 15px; align-items: stretch; }
.strip i { flex: 1; background: #EDF0EA; border-radius: .5px; }
.strip i.on { background: var(--alert); }
.strip.rt i.on { background: var(--rt); }
.con-range { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.con-col { min-width: 0; }

/* ---------------------------------------------------------------- 阻塞 */
.shadow-list { flex: 1 1 auto; min-height: 0; max-height: 330px; overflow-y: auto; }
.shadow-foot {
  margin-top: auto;
  padding: 9px 14px;
  border-top: 1px solid var(--rule-2);
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.6;
}
.sh-row { padding: 9px 14px; border-bottom: 1px solid var(--rule-2); }
.sh-row:last-child { border-bottom: 0; }
.sh-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sh-name { font-size: 12.5px; }
.sh-val { font-size: 13px; font-weight: 600; color: var(--alert); font-variant-numeric: tabular-nums; }
.sh-val .u { font-size: 10px; font-weight: 400; color: var(--ink-3); margin-left: 2px; }
.sh-meta { margin-top: 3px; font-size: 10.5px; color: var(--ink-3); display: flex; gap: 12px; flex-wrap: wrap; }
.sh-bar { height: 2px; margin-top: 6px; background: var(--rule-2); border-radius: 1px; overflow: hidden; }
.sh-bar i { display: block; height: 100%; background: var(--alert); opacity: .38; }

/* ---------------------------------------------------------------- 限额 */
.limit-wrap { display: flex; flex-direction: column; min-height: 0; }
.limit-grid {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 216px;
  overflow-y: auto;
  scrollbar-width: thin;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  align-items: start;
}
.limit-grid.is-more {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent 100%);
}
.limit-col { min-width: 0; }
.limit-col + .limit-col { border-left: 1px solid var(--rule); }
.limit-grid > .state { grid-column: 1 / -1; }
.limit-foot {
  margin-top: auto;
  padding: 7px 14px 8px;
  border-top: 1px solid var(--rule-2);
  font-size: 10.5px;
  color: var(--ink-3);
  background: var(--surface);
}
.lim {
  display: flex; align-items: center; gap: 9px;
  padding: 0 12px;
  height: 27px;
  border-bottom: 1px solid var(--rule-2);
  font-size: 11px;
  min-width: 0;
}
.lim:last-child { border-bottom: 0; }
.lim-bar {
  flex: 0 0 40px;
  height: 3px;
  background: #E4E9E2;
  border-radius: 2px;
  overflow: hidden;
}
.lim-bar i { display: block; height: 100%; background: var(--da); opacity: .55; border-radius: 2px; }

.lim-n { flex: 1 1 auto; min-width: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lim-v { flex: 0 0 54px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; font-size: 10.5px; }
.lim-v em { font-style: normal; color: var(--ink-3); }

/* ---------------------------------------------------------------- 状态 */
.state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  min-height: 128px;
  height: 100%;
  padding: 18px 14px;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.7;
}
.state.is-boxed {
  align-self: center;
  max-width: 330px;
  margin: auto;
  padding: 16px 22px;
  border: 1px dashed var(--rule);
  border-radius: var(--r);
  background: var(--surface);
}
.state b { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.state .act {
  margin-top: 4px;
  font: inherit; font-size: 11.5px;
  color: var(--sprout);
  background: none; border: 0; border-bottom: 1px solid var(--sprout-2);
  padding: 0 0 1px; cursor: pointer;
}
.state.is-err b { color: var(--alert); }

.overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: var(--r);
  padding: 10px;
}
.overlay .state { min-height: 0; height: auto; }

.skeleton {
  background: linear-gradient(100deg, #EDF0EA 24%, #F6F8F3 38%, #EDF0EA 52%);
  background-size: 300% 100%;
  animation: sk 1.3s ease-in-out infinite;
  border-radius: 2px;
}
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 10px 0 0;
  padding: 9px 14px;
  background: var(--alert-2);
  border-left: 2px solid var(--alert);
  font-size: 12px;
  color: #7C2A1E;
}
.banner button {
  font: inherit; font-size: 11.5px; color: #7C2A1E;
  background: none; border: 0; border-bottom: 1px solid currentColor;
  padding: 0; cursor: pointer;
}

/* ---------------------------------------------------------------- 页脚 */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px;
  margin-top: 40px;
  padding: 16px 0 30px;
  border-top: 1px solid var(--rule);
  font-size: 10.5px;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1240px) {
  .hero-grid { grid-template-columns: 150px minmax(0, 1fr) 220px; gap: 24px; }
  .hero-date { font-size: 40px; }
  .kpi .k-main { font-size: 24px; }
  /* 窄一档时两栏平分，并收紧限额行的固定占宽，保证 9 字断面名不被挤掉 */
  .g-cap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lim { padding: 0 10px; gap: 8px; }
  .lim-bar { flex-basis: 30px; }
}

@media (max-width: 1024px) {
  .shell { padding: 0 22px; }
  .workspace { grid-template-columns: 1fr; }
  .workspace::before { display: none; }
  .rail {
    position: static;
    padding: 10px 0 0;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--rule-2);
  }
  .rail-list { display: none; }
  .rail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .rail-sec { display: flex; align-items: center; gap: 6px; }
  .rail-sec + .rail-sec { margin: 0; padding: 0; border: 0; }
  .rail-item {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 12px 8px;
    border-left: 0;
    border-radius: var(--r);
    cursor: pointer;
  }
  .rail-item:hover { background: var(--surface-2); }
  .rail-item.is-on { background: var(--sprout-2); }
  .rail-desc { display: none; }
  .g-7-5, .g-6-6, .g-cap { grid-template-columns: 1fr; }
  .grid { gap: 22px; }
  .hero-grid { grid-template-columns: 1fr 1fr; }
  .hero-lead { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
  .hero-note { border-top: 0; margin: 0; padding: 0; }
  .hero-kpis { grid-column: 1 / -1; }
  .hero-spark { grid-column: 1 / -1; }
  .spark { height: 72px; }
}

@media (max-width: 760px) {
  body { font-size: 12.5px; }
  .shell { padding: 0 14px; }
  .topbar { height: 50px; }
  .daybar { top: 50px; }
  .brand { gap: 10px; }
  .mark { font-size: 16px; letter-spacing: .22em; text-indent: .22em; }
  .sub { display: none; }
  .rule-v { display: none; }
  .sync #syncText { max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sync-next { display: none; }

  .rail { padding-top: 8px; }
  .rail-item { padding: 6px 10px 7px; }
  .rail-name { font-size: 13.5px; letter-spacing: .08em; }

  .block { padding-top: 24px; }
  .block + .block { margin-top: 20px; }
  .block-hd { flex-direction: column; align-items: flex-start; gap: 8px; }
  .hd-ctl { width: 100%; }
  select { max-width: 100%; flex: 1; }

  .block-hero { padding: 16px 14px 10px; margin-top: 14px; }
  .hero-grid { grid-template-columns: 1fr; gap: 16px; padding-bottom: 12px; }
  .hero-date { font-size: 38px; }
  .hero-kpis { grid-template-columns: 1fr; gap: 14px 0; }
  .kpi + .kpi { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule-2); padding-top: 12px; }
  .kpi .k-main { font-size: 24px; }
  .hero-foot { flex-direction: column; align-items: flex-start; gap: 10px; }
  .foot-figs { gap: 8px 22px; }

  .chart-lg { height: 268px; }
  .chart-md { height: 216px; }
  .chart.chart-ch { height: 188px; }
  .chart.chart-ch.is-empty { height: 216px; }
  .chart-maint { height: 196px; }
  .panel { padding: 10px 10px 8px; }
  .panel-tight { padding: 0; }

  .legend { gap: 2px 12px; }
  .lg-item { font-size: 11px; }

  .con-head { grid-template-columns: minmax(70px, 1fr) 54px minmax(0, 1.4fr); padding: 8px 10px; }
  .con-row { grid-template-columns: minmax(70px, 1fr) 54px minmax(0, 1.4fr); padding: 6px 10px; gap: 8px; }
  .con-label { padding: 8px 10px 4px; }
  .limit-grid { max-height: 243px; grid-template-columns: 1fr; }
  .limit-col + .limit-col { border-left: 0; }
  .lim-n { flex-basis: auto; }
  
  .day-bars {
  display: flex;
  gap: 4px;
  height: 66px;
  padding: 0 0 0 54px;
  margin: 2px 0 4px;
  border-bottom: 1px solid var(--rule-2);
}
.db {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 3px;
  padding-bottom: 2px;
}
.db i {
  display: block;
  width: 100%;
  max-width: 20px;
  background: var(--out);
  opacity: .22;
  border-radius: 1px 1px 0 0;
  min-height: 2px;
}
.db.on i { opacity: .85; }
.db span { font-size: 8.5px; line-height: 1; color: var(--ink-3); }
.db.on span { color: var(--ink); font-weight: 600; }

.unit-strip { min-height: 78px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
