/* 页面级组件样式 */

/* ---------- 数字孪生主界面 ---------- */
.site-wrap { position: relative; }
.site-tools {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.site-tools .legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-soft); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.site-card { padding: 14px; }
.bld { transition: opacity .25s var(--ease-out), filter .25s var(--ease-out); }
.bld .bld-body { transition: fill-opacity .2s; }
.bld:hover { filter: drop-shadow(0 4px 10px rgba(11,43,69,0.45)); }
.bld.sel { filter: drop-shadow(0 0 12px rgba(0,194,209,0.8)); }
.bld.sel .bld-body { stroke: #0B2B45; stroke-width: 3; }
.bld.zone-off { opacity: 0.18; }
.station { transition: opacity .25s var(--ease-out); }
.station:hover { filter: drop-shadow(0 0 10px rgba(0,194,209,0.7)); }
.station.zone-sel rect:first-of-type { stroke-width: 4; }
.pipe-line { animation: pipeflow 1.6s linear infinite; }
@keyframes pipeflow { to { stroke-dashoffset: -15; } }
#site-svg { border-radius: 12px; }

/* 楼栋信息 */
.bld-panel .bp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.bp-num {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  background: linear-gradient(135deg, var(--ink), var(--energy-deep));
  color: #fff; font-family: var(--font-mono); font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}
.floor-grid { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; max-height: 400px; overflow: auto; padding-right: 4px; }
.floor-row { display: flex; align-items: center; gap: 8px; }
.floor-label {
  width: 42px; flex: none; text-align: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink-soft);
  background: #F2FAFB; border-radius: 8px; padding: 6px 0;
}
.floor-units { display: flex; gap: 6px; flex-wrap: wrap; }
.unit-btn {
  width: 40px; height: 34px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--bg-pure); color: var(--ink-soft); font-family: var(--font-mono);
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all 0.25s var(--ease-out);
}
.unit-btn:hover { border-color: var(--energy); color: var(--energy-deep); background: var(--energy-glow); transform: translateY(-2px); }

/* 能源站列表（平面总览右侧） */
.station-mini {
  display: flex; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  cursor: pointer; background: #FAFDFE; transition: all .25s var(--ease-out);
}
.station-mini:hover {
  border-color: rgba(0,194,209,.55); background: var(--bg-pure);
  box-shadow: 0 4px 14px rgba(11,43,69,.08); transform: translateY(-1px);
}
.station-mini.sel { border-color: var(--energy); box-shadow: 0 0 0 2px rgba(0,194,209,.18); }
.station-mini .sm-badge {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: var(--grad-dark); color: #fff; font-family: var(--font-mono);
  font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.station-mini .sm-main { flex: 1; min-width: 0; }
.station-mini .sm-name { font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-mini .sm-sub { font-size: 11.5px; color: var(--ink-faint); margin-top: 1px; }
.station-mini .sm-cap { text-align: right; flex: none; }
.station-mini .sm-cap .v { font-family: var(--font-mono); font-weight: 800; color: var(--energy-deep); font-size: 13.5px; }
.station-mini .sm-cap .n { font-size: 10.5px; color: var(--ink-faint); margin-top: 1px; }

/* 模拟时钟控制条 */
.sim-bar {
  position: sticky; bottom: 14px; z-index: 60;
  background: rgba(255,255,255,0.88); backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lift); padding: 14px 18px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.sim-clock { display: flex; align-items: baseline; gap: 10px; }
.sim-clock .date { font-family: var(--font-mono); font-size: 18px; font-weight: 800; color: var(--ink); }
.sim-clock .time { font-family: var(--font-mono); font-size: 13px; color: var(--energy-deep); }
.sim-clock .day { font-size: 11.5px; color: var(--ink-faint); font-family: var(--font-mono); }
.sim-live { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.live-chip {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft);
  background: #F2FAFB; border-radius: 999px; padding: 6px 12px;
}
.live-chip b { color: var(--ink); }
.live-chip .u { color: var(--energy-deep); font-size: 10px; }

/* 户级模态 */
.hh-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(11,43,69,0.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(4px);
}
.hh-modal {
  background: var(--bg); border-radius: 20px; width: min(1080px, 96vw);
  max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lift);
  border: 1px solid var(--line-strong);
}
.hh-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 26px; border-bottom: 1px solid var(--line);
  background: var(--bg-pure); border-radius: 20px 20px 0 0;
}
.hh-title { font-size: 20px; font-weight: 800; color: var(--ink); }
.hh-sub { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }
.hh-close {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--bg-pure); font-size: 20px; color: var(--ink-soft); cursor: pointer;
  transition: all 0.25s;
}
.hh-close:hover { color: var(--danger); border-color: var(--danger); transform: rotate(90deg); }
.hh-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 20px; padding: 22px 26px; }
.hh-plan { background: var(--bg-pure); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 16px; }
.plan-img { position: relative; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: #fff; }
.plan-img img { display: block; width: 100%; height: auto; }
.plan-img-tag {
  position: absolute; left: 0; top: 0; background: rgba(11,43,69,0.82); color: #7fe9f2;
  font-size: 12.5px; font-weight: 700; padding: 6px 14px; border-radius: 0 0 12px 0;
  letter-spacing: 0.5px;
}
.plan-rooms {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 12px;
}
.plan-rooms-t {
  grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--ink-soft);
  margin-bottom: 2px;
}
.p-room {
  display: flex; align-items: center; gap: 6px; border: 1px solid rgba(11,43,69,0.16);
  border-radius: 8px; padding: 7px 9px; background: #FDFEFE; font-size: 12px;
}
.p-room-ic { font-size: 15px; }
.p-room-nm { flex: 1; font-weight: 600; color: var(--ink); }
.p-room-ar { color: var(--ink-faint); font-family: var(--font-mono); font-size: 11px; }
.p-room-tp { font-family: var(--font-mono); font-weight: 800; color: var(--energy-deep); }
.p-room-ht { color: var(--cost); font-size: 11px; animation: breathe 2.2s infinite; }
.unit-plan { display: grid; gap: 8px; }
.room {
  border: 1.5px solid rgba(11,43,69,0.20); border-radius: 10px;
  padding: 10px 8px; text-align: center; position: relative; background: #FDFEFE;
  min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.room-icon { font-size: 22px; }
.room-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.room-area { font-size: 11px; color: var(--ink-faint); font-family: var(--font-mono); }
.room-temp { font-size: 15px; font-weight: 800; font-family: var(--font-mono); color: var(--energy-deep); }
.room-heat {
  position: absolute; right: 6px; bottom: 4px; font-size: 11px; color: var(--cost);
  animation: breathe 2.2s infinite;
}
.hh-info { display: flex; flex-direction: column; gap: 14px; }
.hh-ctl {
  background: var(--bg-pure); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 14px;
}
.hh-ctl-lbl { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; color: var(--ink-soft); margin-bottom: 8px; }
.hh-ctl-lbl b { font-family: var(--font-mono); font-size: 20px; color: var(--energy-deep); }
.hh-ctl input[type=range] {
  width: 100%; -webkit-appearance: none; height: 5px; border-radius: 4px;
  background: linear-gradient(90deg, var(--energy) 40%, rgba(11,43,69,0.12) 40%); outline: none;
}
.hh-ctl input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 4px solid var(--energy); box-shadow: 0 0 0 5px var(--energy-glow);
}
.hh-ctl-note { font-size: 11.5px; color: var(--ink-faint); margin-top: 8px; }
.hh-meter { display: flex; flex-direction: column; gap: 8px; }
.hh-meter-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--ink-soft); padding: 9px 14px;
  background: var(--bg-pure); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.hh-meter-row b { font-family: var(--font-mono); color: var(--ink); }
.hh-meter-row b.save { color: var(--save-deep); }

/* ---------- 户级 3D 户型 ---------- */
.hh-modal-3d { width: min(1320px, 97vw); }
.hh-stage { min-width: 0; }
.hh-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.hh-tab {
  border: 1px solid var(--line-strong); background: var(--bg-pure); color: var(--ink-soft);
  border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.2s;
}
.hh-tab.active { background: var(--energy); border-color: var(--energy); color: #fff; }
.hh-tab:hover:not(.active) { border-color: var(--energy); color: var(--energy-deep); }
.hh-3d { position: relative; height: 640px; background: #eef3f6; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
#hh-canvas { position: absolute; inset: 0; }
.hh-3d-tools { position: absolute; top: 12px; left: 12px; z-index: 5; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hh-floor {
  display: flex; align-items: center; gap: 2px; background: rgba(255,255,255,0.94);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 4px;
  box-shadow: 0 4px 14px rgba(11,43,69,.10);
}
.hh-floor button {
  width: 28px; height: 28px; border: 0; background: transparent; border-radius: 50%;
  font-size: 13px; color: var(--ink-soft); cursor: pointer; transition: all 0.2s;
}
.hh-floor button:hover { background: #eaf4f6; color: var(--energy-deep); }
.hh-floor b { font-family: var(--font-mono); font-size: 13px; color: var(--ink); min-width: 38px; text-align: center; }
.hh-3d-btn {
  border: 1px solid var(--line-strong); background: rgba(255,255,255,0.94); color: var(--ink-soft);
  border-radius: 999px; padding: 6px 13px; font-size: 12px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 14px rgba(11,43,69,.10); transition: all 0.2s;
}
.hh-3d-btn:hover { border-color: var(--energy); color: var(--energy-deep); }
.hh-3d-btn.on { background: var(--ink); color: #7fe9f2; border-color: var(--ink); }
.hh-3d-legend {
  position: absolute; bottom: 12px; left: 12px; z-index: 5; display: flex; gap: 14px;
  background: rgba(255,255,255,0.94); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 7px 14px; font-size: 12px; color: var(--ink-soft); box-shadow: 0 4px 14px rgba(11,43,69,.10);
}
.hh-3d-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hh-3d-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.hh-3d-legend em { font-style: normal; font-family: var(--font-mono); font-weight: 800; color: var(--energy-deep); }
.hh-3d-legend .flow-ic { width: 18px; height: 8px; border-radius: 2px; background: linear-gradient(90deg, #ff5f3a, #ffb46b, #2f7cf6); position: relative; overflow: hidden; }
.hh-3d-legend .flow-ic::after {
  content: ""; position: absolute; left: -8px; top: 0; bottom: 0; width: 8px;
  background: rgba(255,255,255,0.85); animation: flowrun 1.1s linear infinite;
}
@keyframes flowrun { to { left: 100%; } }
.hh-3d-copy { position: absolute; right: 12px; bottom: 12px; z-index: 5; font-size: 11px; color: var(--ink-faint); background: rgba(255,255,255,0.85); border-radius: 8px; padding: 5px 10px; }
.h3-room-lbl {
  display: flex; flex-direction: column; align-items: center; gap: 1px; white-space: nowrap;
  background: rgba(255,255,255,0.96); border: 1px solid rgba(11,43,69,0.22); border-radius: 9px;
  padding: 4px 9px; box-shadow: 0 3px 10px rgba(11,43,69,.14); pointer-events: none;
}
.h3-room-lbl b { font-size: 11px; color: var(--ink-soft); font-weight: 700; }
.h3-room-lbl span { font-family: var(--font-mono); font-size: 13.5px; font-weight: 800; color: var(--energy-deep); }
.h3-man-lbl {
  display: flex; flex-direction: column; gap: 1px; white-space: nowrap; text-align: left;
  background: rgba(11,43,69,0.92); border: 1px solid rgba(11,43,69,0.6); border-radius: 10px;
  padding: 6px 11px; box-shadow: 0 4px 14px rgba(11,43,69,.3); pointer-events: none;
}
.h3-man-lbl b { font-size: 11.5px; color: #7fe9f2; font-weight: 800; letter-spacing: 0.5px; }
.h3-man-lbl span { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; }
.h3-man-lbl .hot { color: #ff9a72; }
.h3-man-lbl .cool { color: #8ab8ff; }
.hh-water { background: var(--bg-pure); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 13px 14px; }
.hh-sec-t { font-size: 12.5px; font-weight: 800; color: var(--ink); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.hh-sec-t::before { content: ""; width: 4px; height: 13px; border-radius: 2px; background: var(--energy); }
.hh-water-row {
  display: flex; justify-content: space-between; align-items: center; font-size: 12.5px;
  color: var(--ink-soft); padding: 7px 0; border-bottom: 1px dashed var(--line);
}
.hh-water-row:last-of-type { border-bottom: 0; }
.hh-water-row b { font-family: var(--font-mono); font-size: 14px; color: var(--ink); }
.hh-water-row b .u { font-size: 10px; color: var(--ink-faint); font-family: var(--font-sans); margin-left: 2px; }
.hh-water-row b.hot { color: #e2552e; }
.hh-water-row b.cool { color: #2f6fc9; }
.hh-water-note { font-size: 11px; color: var(--ink-faint); margin-top: 8px; line-height: 1.6; }
.hh-rooms { background: var(--bg-pure); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 13px 14px; }
.h3-room-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.h3-room {
  display: flex; justify-content: space-between; align-items: center; font-size: 12px;
  border: 1px solid rgba(11,43,69,0.14); border-radius: 8px; padding: 6px 9px; background: #FDFEFE;
}
.h3-room span { color: var(--ink-soft); }
.h3-room b { font-family: var(--font-mono); font-weight: 800; color: var(--energy-deep); }
.hh-modal-3d .hh-body { grid-template-columns: minmax(0, 1.55fr) minmax(330px, 1fr); }
.hh-modal-3d .hh-info { max-height: 640px; overflow: auto; padding-right: 2px; }

/* ---------- 能源站 ---------- */
.station-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.station-card { position: relative; overflow: hidden; }
.station-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--energy-deep), var(--energy), #39E6F5);
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease-out);
}
.station-card:hover::before { transform: scaleX(1); }
.station-card .st-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.st-badge {
  width: 52px; height: 52px; border-radius: 16px; flex: none;
  background: var(--grad-dark); color: #fff; font-family: var(--font-mono);
  font-weight: 800; font-size: 19px; display: flex; align-items: center; justify-content: center;
}
.st-badge small { font-size: 10px; opacity: 0.75; display: block; text-align: center; }
.st-name { font-size: 17px; font-weight: 800; color: var(--ink); }
.st-sub { font-size: 12.5px; color: var(--ink-faint); }
.st-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 4px 0 12px; }
.st-kpi { background: #F2FAFB; border-radius: var(--radius-sm); padding: 10px 12px; }
.st-kpi .k { font-size: 11px; color: var(--ink-faint); font-family: var(--font-mono); }
.st-kpi .v { font-family: var(--font-mono); font-size: 19px; font-weight: 800; color: var(--ink); }
.st-kpi .v .u { font-size: 11px; color: var(--energy-deep); }
.st-buildings { display: flex; flex-wrap: wrap; gap: 5px; }
.st-buildings span {
  font-family: var(--font-mono); font-size: 11px; padding: 3px 8px;
  background: var(--bg-pure); border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink-soft);
}
.st-3d {
  display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 700;
  color: var(--energy-deep); background: #eefbfc; border: 1px solid rgba(0,194,209,.35);
  border-radius: 8px; padding: 6px 12px; text-decoration: none;
}
.st-3d:hover { background: var(--energy); color: #fff; }

/* P&ID 示意 */
.pid { width: 100%; background: var(--bg-pure); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 10px; }
.pid svg text { font-family: var(--font-mono); }

/* ---------- 投资测算 ---------- */
.invest-kpis { display: grid; grid-template-columns: 1.35fr 1.35fr 1fr 1fr 1fr; gap: 14px; margin: 6px 0 18px; }
.invest-kpis .card { padding: 16px 18px; }
.ik-label { font-size: 12px; color: var(--ink-faint); font-family: var(--font-mono); letter-spacing: 0.08em; }
.ik-value { font-family: var(--font-mono); font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; color: var(--ink); margin: 2px 0; }
.ik-value .u { font-size: 12px; color: var(--energy-deep); }
.ik-value.save { color: var(--save-deep); }
.ik-value.save .u { color: var(--save); }
.ik-value.cost { color: var(--cost-deep); }
.ik-value.cost .u { color: var(--cost); }
.ik-note { font-size: 11.5px; color: var(--ink-faint); }
.ik-big { grid-row: span 2; background: var(--grad-dark) !important; border: none !important; }
.ik-big .ik-label { color: #7FE9F2; }
.ik-big .ik-value { color: #fff; font-size: clamp(30px, 3.4vw, 44px); }
.ik-big .ik-value .u { color: #39E6F5; }
.ik-big .ik-note { color: rgba(255,255,255,0.62); }

.btn-cy:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 欧适能知识库依据 ---------- */
.kb-loading { font-size: 12.5px; color: var(--ink-faint); padding: 10px 0; }
.kb-item { border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: var(--bg-pure); }
.kb-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.kb-name { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.kb-q { font-size: 11.5px; color: var(--energy-deep); font-family: var(--font-mono); }
.kb-rec { border-left: 3px solid var(--energy); background: #f2fbfc; border-radius: 0 8px 8px 0; padding: 8px 12px; margin-bottom: 8px; }
.kb-txt { font-size: 12.5px; line-height: 1.65; color: var(--ink-soft); }
.kb-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 11px; color: var(--ink-faint); font-family: var(--font-mono); }
.kb-err { font-size: 12.5px; color: #c2410c; }
.kb-none { font-size: 12.5px; color: var(--ink-faint); }

@media (max-width: 1080px) {
  .invest-kpis { grid-template-columns: repeat(2, 1fr); }
  .hh-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .invest-kpis { grid-template-columns: 1fr; }
  .sim-bar { gap: 10px; }
  .hh-overlay { padding: 10px; align-items: flex-end; }
  .hh-modal { width: 100vw; max-height: 94vh; border-radius: 16px 16px 0 0; }
  .hh-head { padding: 16px 18px; }
}
