/* ============================================================
   中拓全球能源管理平台 — 科技蓝深空主题
   深空蓝底+星点 / 青色切角面板 / 亮青数据值 / 青色描边地图
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #030B20;
  --map-bg: #050B14;
  --panel-blue: #1E3A8A;
  --cyan: #3FE6FF;
  --cyan-hi: #6FF0FF;      /* 数据数值亮青 */
  --cyan-dim: #9FD9F0;     /* 单位/次要用青 */
  --green: #2CF6A4;        /* 在线语义绿 */
  --orange: #FF9A4D;
  --text: #DCEEFF;
  --gray-300: #B9D0E8;
  --gray-400: #8FB4D8;
  --gray-500: #5E7EA6;
  --gray-600: #3D587C;
  --gray-700: #2A4166;
}

html, body {
  height: 100%;
  overflow: hidden;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 700px at 50% 42%, rgba(30,84,190,.42) 0%, rgba(10,38,100,.20) 38%, rgba(3,11,32,0) 72%),
    radial-gradient(900px 600px at 80% 110%, rgba(16,60,150,.28) 0%, rgba(3,11,32,0) 60%),
    radial-gradient(700px 500px at 12% -10%, rgba(16,60,150,.26) 0%, rgba(3,11,32,0) 60%),
    var(--bg);
}

/* 星空层（两层视差点） */
body::before, body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 22%, rgba(180,225,255,.9) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 78% 12%, rgba(180,225,255,.7) 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 42% 68%, rgba(120,190,255,.85) 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 88% 72%, rgba(180,225,255,.6) 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 24% 88%, rgba(150,205,255,.7) 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 62% 30%, rgba(180,225,255,.55) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 8% 55%, rgba(120,190,255,.6) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 95% 40%, rgba(180,225,255,.7) 50%, transparent 51%);
}
body::after { transform: scale(1.7); opacity: .35; /* 原 starDrift 动画已移除 —— 60s infinite animation 在低端机持续触发 paint */ }
/* @keyframes starDrift { DISABLED
  from { background-position: 0 0; }
  to   { background-position: 200px 140px; }
} */

/* ---------------- 顶部导航 ---------------- */
.app-header {
  position: relative;
  z-index: 2;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  flex-shrink: 0;
}
.app-header::after {
  content: '';
  position: absolute;
  left: 24%;
  right: 24%;
  bottom: 6px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(63,230,255,.7), transparent);
}

.header-left { display: flex; align-items: center; gap: 14px; }

.logo-box {
  width: 42px; height: 42px;
  border-radius: 6px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(63,230,255,.1);
  border: 1px solid rgba(63,230,255,.55);
  flex-shrink: 0;
}
.logo-box img { width: 88%; height: 88%; object-fit: contain; }

.app-header h1 {
  font-size: 26px;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: 4px;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(63,230,255,.55), 0 2px 0 rgba(0,40,90,.9);
  white-space: nowrap;
}

.header-right { display: flex; align-items: center; gap: 20px; }
.header-time-wrap { display: flex; align-items: center; gap: 16px; }
.header-divider { width: 1px; height: 18px; background: rgba(63,230,255,.25); }
#clock {
  font-size: 14px;
  color: var(--gray-300);
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
}

.header-user { display: flex; align-items: center; gap: 8px; cursor: pointer; transition: opacity .2s; }
.header-user:hover { opacity: .8; }
.user-icon { width: 28px; height: 28px; fill: var(--cyan); }
.header-user span { font-size: 14px; color: var(--gray-300); }

/* 顶部总累计电量 */
.header-kpi { display: flex; align-items: baseline; gap: 9px; margin-right: 6px; }
.hk-label { font-size: 14px; color: var(--gray-300); letter-spacing: 2px; white-space: nowrap; }
.hk-num {
  font-size: 28px;
  font-weight: 900;
  color: var(--cyan-hi);
  letter-spacing: 2px;
  font-family: Consolas, "DIN Alternate", monospace;
  text-shadow: 0 0 16px rgba(111,240,255,.45);
}
.hk-unit { font-size: 13px; color: var(--cyan-dim); white-space: nowrap; }

/* ---------------- 三栏布局 ---------------- */
.app-main {
  position: relative;
  z-index: 1;
  display: flex;
  height: calc(100dvh - 72px);
  height: calc(100vh - 72px);
}

.col {
  width: 20.5%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  min-width: 0;
}

.map-wrap {
  position: relative;
  flex: 1;
  height: 100%;
  background: var(--map-bg);
  overflow: hidden;
}

#mapContainer { width: 100%; height: 100%; background: var(--map-bg); }

/* 地图提亮：高德 darkblue 偏黑，加滤镜拉亮。
   只作用于瓦片画布，标注/信息窗/控件均为 DOM 不受影响。
   注：滤镜每帧随地图重绘重新计算，故只保留 brightness+saturate，
   移除开销更大的 hue-rotate 颜色矩阵（4K 大屏上可明显省 GPU）。 */
#mapContainer canvas {
  filter: brightness(1.8) saturate(1.5);
}
/* Leaflet 降级（CARTO 深灰底）染成同系深蓝 */
.leaflet-tile-pane {
  filter: brightness(1.35) sepia(.55) hue-rotate(175deg) saturate(2.4);
}

/* ---------------- 面板通用（科技切角） ---------------- */
.panel {
  position: relative;
  background: linear-gradient(160deg, rgba(24,66,148,.82) 0%, rgba(13,38,96,.78) 100%);
  border: 1px solid rgba(63,230,255,.40);
  padding: 14px;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  animation: panelIn .45s ease both;
}
/* 左上/右下两角青色高光 */
.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  clip-path: inherit;
  background:
    linear-gradient(135deg, rgba(63,230,255,.9), transparent 22px) top left / 44px 44px no-repeat,
    linear-gradient(225deg, rgba(63,230,255,.9), transparent 22px) bottom right / 44px 44px no-repeat;
  opacity: .5;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.panel-head h3 { font-size: 14px; font-weight: 600; color: #fff; }

.detail-link {
  font-size: 10px;
  color: var(--cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: opacity .2s;
}
.detail-link:hover { opacity: .8; }
.ext-icon { width: 8px; height: 8px; }

/* 左下角电站轮播：航班显示屏风格。
   尺寸、位置、行数、行高全部由 JS initStationRoller() 动态设置；
   视口变化 / orientationchange 实时重算。 */
.sc-roller {
  position: fixed;
  bottom: 70px;
  left: 24px;
  background: rgba(6,20,52,.95); /* backdrop-filter 移除：叠在地图画布上会每帧重新采样模糊 */
  border: 1px solid rgba(63,230,255,.45);
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(63,230,255,.2);
  overflow: hidden;
  z-index: 45;
  padding: 0;
  font-size: 10px;
  /* JS 会覆盖 width/height/left/right/top/bottom */
  width: 210px;
  height: 98px;
}
.sc-list {
  display: flex;
  flex-direction: column;
  will-change: transform;
}
.sc-row {
  flex-shrink: 0;
  height: var(--sc-row-h, 19.6px);
  line-height: var(--sc-row-h, 19.6px);
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(63,230,255,.08);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-row .sc-name {
  color: var(--cyan-hi);
  font-weight: 600;
  text-shadow: 0 0 4px rgba(111,240,255,.25);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
}
.sc-row .sc-cap {
  color: var(--gray-400);
  font-weight: 500;
  font-size: 9px;
  flex-shrink: 0;
}
.sc-row.sc-even { background: rgba(63,230,255,.04); }
.sc-row.sc-yellow { background: rgba(255,193,7,.10); }
.sc-row.sc-yellow .sc-name {
  color: #FFC107;
  text-shadow: 0 0 4px rgba(255,193,7,.35);
}
.sc-row.sc-yellow .sc-cap { color: rgba(255,193,7,.7); }

/* 左下角操作区：详情数据 + 视频监控（与右下角语言切换对称） */
.ut-actions {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 50;
  display: flex; align-items: center; gap: 10px;
}
.ut-detail {
  font-size: 14px;
  font-weight: 500;
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: 1px;
  padding: 8px 18px;
  background: rgba(8,28,68,.94);
  border: 1px solid rgba(63,230,255,.55);
  display: flex; align-items: center; gap: 8px;
  min-height: 38px;
  transition: background .2s, box-shadow .2s;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.ut-detail:hover {
  background: rgba(30,84,190,.7);
  box-shadow: 0 0 12px rgba(63,230,255,.35);
}
/* 视频监控入口：与「详情数据」同一视觉语言，尺寸略小 */
.ut-cctv {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: 1px;
  padding: 5px 12px;
  background: rgba(8,28,68,.94);
  border: 1px solid rgba(63,230,255,.55);
  display: flex; align-items: center; gap: 6px;
  min-height: 31px;
  transition: background .2s, box-shadow .2s;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.ut-cctv svg { width: 14px; height: 14px; flex: none; }
.ut-cctv:hover {
  background: rgba(30,84,190,.7);
  box-shadow: 0 0 12px rgba(63,230,255,.35);
}

.panel-sub {
  font-size: 10px;
  font-weight: 400;
  color: var(--gray-400);
  margin-bottom: 8px;
}

/* ---------------- FBox 实时电站卡（总发电量增长曲线） ---------------- */
.station-panel {
  overflow: visible;
  min-height: 0;   /* 允许与左栏对应模块等高压缩，不按内容最小高度撑开 */
}

.sp-head { flex: none; margin-bottom: 6px; position: relative; padding-right: 90px; }
.sp-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sp-name-bar {
  width: 4px; height: 20px; border-radius: 1px; flex: none;
  background: linear-gradient(180deg, #fff 0%, var(--cyan) 100%);
  box-shadow: 0 0 8px rgba(63,230,255,.55);
}
.sp-name {
  font-size: 18px; font-weight: 800; color: #fff; letter-spacing: .8px;
  text-shadow: 0 0 12px rgba(63,230,255,.35);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.sp-badge {
  flex: none;
  padding: 2px 10px; border-radius: 3px;
  font-size: 10px; font-weight: 700; line-height: 1.5;
  color: #06301f; background: var(--green);
  border: 1px solid rgba(44,246,164,.6);
  text-shadow: none;
  box-shadow: 0 0 8px rgba(44,246,164,.35);
}
.sp-badge[data-on="0"] { background: #46566e; color: #d7e2ee; border-color: #5a6d88; box-shadow: none; }

/* 数据健康告警角标：冻结=琥珀色闪烁，通讯中断=红色 */
.sp-health {
  flex: none;
  padding: 2px 10px; border-radius: 3px;
  font-size: 10px; font-weight: 700; line-height: 1.5;
  cursor: help;
}
.sp-health.frozen {
  color: #3a2400; background: #ffb547;
  border: 1px solid rgba(255,181,71,.7);
  box-shadow: 0 0 8px rgba(255,181,71,.4);
  animation: healthBlink 2s ease-in-out infinite;
}
.sp-health.comm-err {
  color: #fff; background: #d33;
  border: 1px solid rgba(255,80,80,.7);
  box-shadow: 0 0 8px rgba(255,60,60,.4);
}
@keyframes healthBlink { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

.sp-sub-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.sp-title-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--cyan); box-shadow: 0 0 7px var(--cyan);
  animation: dotPulse 1.8s ease-in-out infinite;
}
.pv-title-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--cyan); box-shadow: 0 0 7px var(--cyan);
  animation: dotPulse 1.8s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 7px var(--cyan); }
  50%      { opacity: .4; transform: scale(.85); box-shadow: 0 0 2px var(--cyan); }
}
.sp-curve-title { font-size: 13px; font-weight: 700; color: var(--cyan); letter-spacing: 1px; }
.sp-serial { margin-top: 4px; font-size: 10px; color: var(--gray-400); letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sp-enter {
  position: absolute; right: 0; top: 4px;
  font-size: 11px; color: var(--cyan); letter-spacing: .5px;
  padding: 3px 10px; border: 1px solid var(--border); border-radius: 3px;
  background: rgba(63,230,255,.08); transition: all .15s; white-space: nowrap;
}
.sp-enter:hover { background: rgba(63,230,255,.22); color: var(--cyan-hi); }

.sp-kpis { display: flex; gap: 10px; flex: none; margin: 12px 0 10px; }
.sp-kpi {
  flex: 1 1 0; min-width: 0;
  background: rgba(63,230,255,.10);
  border: 1px solid rgba(63,230,255,.30);
  padding: 8px 12px;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
.sp-kpi-label { font-size: 10px; color: var(--gray-400); margin-bottom: 3px; white-space: nowrap; letter-spacing: 1px; }
.sp-kpi-val {
  font-size: 20px; font-weight: 900; color: var(--cyan-hi);
  font-family: Consolas, "DIN Alternate", "SF Mono", "Courier New", monospace;
  line-height: 1.15; white-space: nowrap; overflow: hidden;
  text-shadow: 0 0 12px rgba(111,240,255,.35);
}
.sp-kpi-unit { font-size: 10px; color: var(--cyan-dim); font-weight: 600; margin-left: 3px; text-shadow: none; }

.sp-tabs { display: flex; gap: 8px; flex: none; margin-bottom: 8px; }
.sp-tab {
  padding: 5px 15px;
  background: rgba(63,230,255,.06);
  border: 1px solid rgba(63,230,255,.32);
  cursor: pointer;
  font-size: 11px; letter-spacing: 1px; color: var(--gray-300);
  transition: all .15s;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.sp-tab:hover { color: var(--cyan); border-color: rgba(63,230,255,.7); }
.sp-tab.active {
  color: #031B33; background: linear-gradient(180deg, #7FF1FF, #2BC8E8);
  border-color: var(--cyan);
  font-weight: 800; box-shadow: 0 0 12px rgba(63,230,255,.45);
}

.sp-chart {
  flex: 1 1 auto; min-height: 90px; width: 100%;
  background: rgba(5,17,40,.5);
  border: 1px solid rgba(63,230,255,.14);
}

.sp-statusbar {
  flex: none;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  margin-top: 6px;
  border-top: 1px solid rgba(63,230,255,.15);
  font-size: 10px; color: var(--gray-500);
}
.sp-live { white-space: nowrap; }
.sp-live b { color: var(--green); font-weight: 700; }
.sp-live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); margin-right: 4px; vertical-align: middle;
  box-shadow: 0 0 7px var(--green);
  animation: sp-pulse 1.6s infinite;
}
.sp-live.is-off .sp-live-dot { background: #5d7088; box-shadow: none; animation: none; }
.sp-live.is-off b { color: #93a6bb; }
@keyframes sp-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
.sp-sampling { font-size: 10px; color: var(--gray-500); margin-left: 10px; white-space: nowrap; }
.sp-update { white-space: nowrap; }
.sp-update b { color: var(--gray-300); font-family: Consolas, monospace; font-weight: 600; }

.sp-units-toggle {
  flex: none;
  display: flex; align-items: center; gap: 6px;
  width: 100%;
  margin-top: 5px;
  padding: 5px 2px 1px;
  background: none; border: none; border-top: 1px solid rgba(63,230,255,.12);
  cursor: pointer;
  font-size: 10px; color: var(--gray-400);
  text-align: left;
}
.sp-units-toggle:hover { color: var(--cyan); }
.sp-arrow { font-size: 8px; transition: transform .2s; color: var(--gray-500); }
.sp-units-toggle.open .sp-arrow { transform: rotate(90deg); }

/* 机组明细浮层：在卡片内部展开，不挤压图表 */
.sp-units {
  position: absolute;
  left: 8px; right: 8px; bottom: 26px;
  max-height: 62%;
  overflow-y: auto;
  z-index: 6;
  background: rgba(6,20,52,.97);
  border: 1px solid rgba(63,230,255,.4);
  box-shadow: 0 8px 24px rgba(0,0,0,.55), 0 0 14px rgba(63,230,255,.15);
  padding: 4px 0;
}
.sp-unit {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 4px 10px;
  font-size: 10px;
  border-bottom: 1px solid rgba(63,230,255,.08);
}
.sp-unit:last-child { border-bottom: none; }
.sp-unit-name { color: var(--gray-300); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sp-unit.total .sp-unit-name { color: var(--cyan-hi); font-weight: 800; }
.sp-unit-val { color: var(--text); font-family: Consolas, monospace; font-weight: 600; white-space: nowrap; }
.sp-unit-val .u { font-size: 8px; color: var(--gray-500); margin-left: 2px; }
.sp-unit-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; margin-right: 6px; }
.sp-unit-dot.ok { background: var(--cyan); box-shadow: 0 0 5px rgba(63,230,255,.7); }
.sp-unit-dot.warn { background: #e6a23c; }
.sp-unit-dot.err { background: #ff5c7a; }
.sp-unit-dot.unknown { background: #5d7088; }
.sp-unit-left { display: flex; align-items: center; min-width: 0; }

.sp-waiting {
  position: absolute; inset: 0;
  z-index: 5;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,20,52,.85);
  font-size: 11px; color: var(--gray-400);
  pointer-events: none;
}
.sp-waiting[hidden] { display: none; }
.sp-units[hidden] { display: none; }

/* ---------------- KPI ---------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 10px;
}
.kpi-card {
  background: rgba(63,230,255,.09);
  border: 1px solid rgba(63,230,255,.26);
  padding: 9px 8px;
  text-align: center;
  transition: border-color .3s;
  min-width: 0;
  overflow: hidden;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.kpi-label { font-size: 10px; color: var(--gray-400); margin-bottom: 3px; line-height: 1.3; white-space: nowrap; }
.kpi-value-row { display: flex; align-items: baseline; justify-content: center; gap: 2px; }
.kpi-value {
  font-size: 17px;
  font-weight: 900;
  color: var(--cyan-hi);
  font-variant-numeric: tabular-nums;
  font-family: Consolas, "DIN Alternate", monospace;
  text-shadow: 0 0 10px rgba(111,240,255,.3);
  white-space: nowrap;
}
.kpi-unit { font-size: 9px; color: var(--cyan-dim); font-weight: 600; }

.mini-chart { width: 100%; flex: 1 1 auto; min-height: 0; }
.kpi-chart { height: 96px; flex: 0 0 96px; }

/* ---------------- 右栏：3D 工艺链路动图卡 ---------------- */
.media-panel {
  padding: 14px;
  overflow: hidden;
}
/* 角部高光压在图之上，保持与左侧电站卡一致的面板风格 */
.media-panel::before { z-index: 4; }
.media-panel .sp-head {
  position: relative;
  z-index: 2;
  /* 3D建模按钮只在首行右侧，后续文字用满整行宽度 */
  padding-right: 0;
}
/* 卡片说明：三项建模服务，替代原序列号小字 */
.media-panel .mp-scope {
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: .3px;
  color: var(--gray-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 1250px) {
  .media-panel .mp-scope,
  .sp-serial,
  .pv-serial { font-size: 9px; letter-spacing: 0; }
}
/* 四个 3D 模型动图：田字格排列，按顺序轮流高亮循环播放 */
.mp-grid {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  padding-bottom: 2px;
}
.mp-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(63, 230, 255, .14);
  border-radius: 4px;
  background: rgba(4, 14, 26, .45);
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .45s, box-shadow .45s, background .45s;
}
.mp-cell:hover {
  border-color: rgba(63, 230, 255, .55);
  background: rgba(10, 32, 54, .62);
}
.mp-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: saturate(1.05) contrast(1.04) brightness(1.02);
  transition: filter .45s, transform .45s;
}
.mp-cell.is-active {
  border-color: rgba(63, 230, 255, .72);
  background: rgba(10, 32, 54, .7);
  box-shadow: 0 0 12px rgba(63, 230, 255, .28), inset 0 0 14px rgba(63, 230, 255, .12);
}
.mp-cell.is-active img {
  filter: saturate(1.15) contrast(1.06) brightness(1.1) drop-shadow(0 6px 16px rgba(0,0,0,.45));
  transform: scale(1.02);
}

/* ---------------- 右栏：光伏板块入口（与上方电站卡 1:1 等高，和左侧两栏对齐） ---------------- */
.pv-entry {
  text-decoration: none;
  color: inherit;
  gap: 5px;
  flex: 1 1 0;
  min-height: 0;
  transition: border-color .2s, box-shadow .2s;
}
/* 右下角浮动按钮（3D建模 / 语言切换）占位：用 flex 占位而不是内边距，
   这样与上方电站卡内边距一致，两块卡仍能等高；内部内容整体上移 */
.panel.pv-entry::after {
  content: '';
  flex: 1 1 0;
  /* 至少 36px：保证「查看运行概览」不被右下角浮动按钮压住（按钮占卡底上方约 52px） */
  min-height: 36px;
  pointer-events: none;
}
/* 上留白：与底部占位 1:1 平分，红框内容（图表+说明+入口）在卡内上下居中 */
.pv-gap { flex: 1 1 0; min-height: 0; }
.pv-entry:hover {
  border-color: rgba(111,240,255,.85);
  box-shadow: 0 0 18px rgba(63,230,255,.28);
}
/* 光伏板块标题区：三行堆叠，对齐数字孪生 sp-head 排版（右侧预留 sp-enter 按钮位置） */
.pv-head { flex: none; margin-bottom: 6px; position: relative; padding-right: 90px; }
.pv-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pv-tag-bar {
  width: 4px; height: 20px; border-radius: 1px; flex: none;
  background: linear-gradient(180deg, #fff 0%, var(--cyan) 100%);
  box-shadow: 0 0 8px rgba(63,230,255,.55);
}
.pv-tag { font-size: 18px; font-weight: 800; letter-spacing: .8px; color: #fff; text-shadow: 0 0 12px rgba(63,230,255,.35); white-space: nowrap; }
.pv-sub-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.pv-title-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--cyan); box-shadow: 0 0 7px var(--cyan);
}
.pv-live { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--cyan); letter-spacing: 1px; }
.pv-serial { margin-top: 4px; font-size: 10px; color: var(--gray-400); letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-live i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #3ef0a0; box-shadow: 0 0 6px #3ef0a0;
  animation: pvPulse 2.2s ease-in-out infinite;
}
@keyframes pvPulse { 50% { opacity: .35; } }
.pv-shot {
  position: relative;
  /* 与上下留白 4:1:1 分配剩余空间，曲线区约占一半，整体上下居中 */
  flex: 4 1 0; min-height: 90px; overflow: hidden;
  background: linear-gradient(155deg, #0E2F65 0%, #0A2048 55%, #051126 100%);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
/* 画布上沿下移 8px 留出呼吸空间，底部留出图例高度，避免曲线被图例压住 */
.pv-shot #pvMiniChart {
  position: absolute; left: 0; right: 0; top: 8px; bottom: 17px;
  width: auto; height: auto;
  /* 顶部青色光晕 —— 强化科技感 */
  box-shadow: inset 0 22px 40px -20px rgba(111,240,255,.28),
              inset 0 -18px 36px -24px rgba(3,11,32,.9);
}
/* 迷你图例：固定在画布下方独立一条，不覆盖曲线 */
.pv-curve-legend {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 17px;
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: center;
  gap: 4px 10px;
  font-size: 8px; color: #B9D0E8; line-height: 1;
  padding: 0 6px;
  background: rgba(3,11,32,.72); border-top: 1px solid rgba(63,230,255,.14);
  pointer-events: none;
}
.pv-curve-legend span { display: inline-flex; align-items: center; gap: 3px; }
.pv-curve-legend .dot {
  display: inline-block; width: 7px; height: 2px; border-radius: 1px;
}
.pv-curve-legend .dot.pv   { background: #6FF0FF; }
.pv-curve-legend .dot.load { background: #FFB066; }
.pv-curve-legend .dot.grid { background: #5B9CF0; }
.pv-curve-legend .dot.soc  { background: #4AD2A3; }
/* ---------------- 机组实时数据表（FlexManager 风格） ---------------- */
.unit-table {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(63,230,255,.18);
  margin-top: 6px;
  padding-top: 8px;
}
.ut-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 5px; }
.ut-title {
  font-size: 12px; color: var(--cyan); letter-spacing: 1px; font-weight: 700;
  text-shadow: 0 0 8px rgba(63,230,255,.4);
}
.ut-title::before { content: '▎'; margin-right: 3px; color: var(--cyan); }
.ut-station { font-size: 10px; color: var(--gray-500); }
.ut-rows { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.ut-rows::-webkit-scrollbar { width: 4px; }
.ut-rows::-webkit-scrollbar-thumb { background: rgba(63,230,255,.3); border-radius: 2px; }
.ut-row {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 6px;
  border-bottom: 1px dashed rgba(63,230,255,.13);
  font-size: 11px;
}
.ut-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gray-300); }
.ut-val { flex: none; font-family: Consolas, monospace; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.ut-val .u { color: var(--gray-500); font-size: 9px; margin-left: 2px; }
.ut-row.total {
  background: linear-gradient(90deg, rgba(63,230,255,.16), rgba(63,230,255,.03));
  border: 1px solid rgba(63,230,255,.4);
  margin: 3px 0;
}
.ut-row.total .ut-name, .ut-row.total .ut-val {
  color: var(--cyan-hi); font-weight: 900; text-shadow: 0 0 8px rgba(111,240,255,.35);
}
.ut-empty { font-size: 10px; color: var(--gray-500); text-align: center; padding: 12px 0; }

/* ---------------- 地图控件（深色玻璃切角） ---------------- */
.map-toggle {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 10;
  background: rgba(8,28,68,.94);
  border: 1px solid rgba(63,230,255,.55);
  color: var(--cyan);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background .2s;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.map-toggle:hover { background: rgba(30,84,190,.7); }

.zoom-ctrl {
  position: absolute;
  bottom: 16px; left: 16px;
  z-index: 10;
  display: flex; flex-direction: column; gap: 8px;
}
.zoom-ctrl button {
  width: 38px; height: 38px;
  background: rgba(8,28,68,.94);
  border: 1px solid rgba(63,230,255,.55);
  color: var(--cyan);
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.zoom-ctrl button + button { border-top: none; }
.zoom-ctrl button:hover { background: rgba(30,84,190,.7); }

.scale-badge {
  position: absolute;
  bottom: 16px; right: 16px;
  z-index: 10;
  background: rgba(8,28,68,.9);
  border: 1px solid rgba(63,230,255,.3);
  color: var(--gray-300);
  padding: 4px 12px;
  font-size: 11px;
}

/* 地图底部标语 */
.map-slogan {
  position: absolute;
  left: 50%; bottom: 30px;
  transform: translateX(-50%);
  z-index: 9;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  color: rgba(120,210,255,.85);
  text-shadow: 0 0 22px rgba(63,230,255,.7);
  white-space: nowrap;
  pointer-events: none;
}
/* 中文单独保留宽字距 */
[lang="zh-CN"] .map-slogan { letter-spacing: 8px; }

/* ---------------- 地图标注 ---------------- */
@keyframes pulse-yellow {
  0%, 100% { opacity: 1; box-shadow: 0 0 15px rgba(255,193,7,.8), 0 0 20px rgba(255,193,7,.4); }
  50%      { opacity: .7; box-shadow: 0 0 25px rgba(255,193,7,1), 0 0 35px rgba(255,193,7,.6); }
}
@keyframes pulse-blue {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px rgba(63,230,255,.5); }
  50%      { opacity: .7; box-shadow: 0 0 20px rgba(63,230,255,.85); }
}

/* ================ 新地图标记系统（锚点 + 引导线 + 标签） ================ */

/* 标记容器：零尺寸锚定在经纬度点，children 从这里展开 */
.mk-wrap { position: absolute; width: 0; height: 0; pointer-events: auto; }

/* 真实锚点：8px 圆点 + 外围脉冲环 */
.mk-anchor {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 4px var(--cyan), 0 0 10px rgba(63,230,255,.45);
  pointer-events: auto; cursor: pointer;
  z-index: 5;
}
.mk-anchor::before {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--cyan);
  transform: translate(-50%, -50%);
}
.mk-anchor::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--cyan); opacity: .5;
  transform: translate(-50%, -50%);
  /* 脉冲环仅保留给黄色重点电站 —— 54 个锚点同时脉冲会维持大量合成层 */
}
.mk-anchor.yellow { background: #FFC107; box-shadow: 0 0 4px #FFC107, 0 0 12px rgba(255,193,7,.5); }
.mk-anchor.yellow::before { border-color: #FFC107; }
.mk-anchor.yellow::after  { border-color: #FFC107; animation: mkPulse 2s ease-out infinite; }

/* 引导线：SVG 从锚点到标签，虚线 + 微光流动 */
.mk-leader {
  position: absolute; left: 0; top: 0;
  pointer-events: none; z-index: 2; overflow: visible;
}
.mk-leader path {
  stroke: var(--cyan); stroke-width: 1.2; fill: none;
  stroke-linecap: round; stroke-dasharray: 5 3;
  filter: drop-shadow(0 0 2px rgba(63,230,255,.5));
}
.mk-leader path.flow { animation: mkFlow 3s linear infinite; }
.mk-leader.yellow path { stroke: #FFC107; filter: drop-shadow(0 0 2px rgba(255,193,7,.5)); }

/* 电站标签：圆角矩形，hover 放大 + 微回弹 */
/* 电站标签：缩小字号/内边距，减少占用 */
.mk-label {
  position: absolute;
  background: rgba(6,20,52,.92);
  border: 1px solid var(--cyan);
  border-radius: 2px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
  color: #DCEEFF;
  white-space: nowrap;
  line-height: 1.4;
  letter-spacing: .2px;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  box-shadow: 0 0 5px rgba(63,230,255,.2);
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  z-index: 4;
  transform: translate(calc(var(--mk-dx, 0px) - 50%), calc(var(--mk-dy, -16px) - 50%));
  transition: box-shadow .15s ease-out, z-index .15s ease-out;
  /* 呼吸动画已移除（54 个标签同时动画代价高），保留静态发光 */
}
.mk-label .mk-cap {
  color: var(--gray-400); font-weight: 500;
  margin-left: 4px; font-size: 8px;
}
/* 黄色重点电站：保留动态效果（全场仅 6 个，成本可忽略）
   用 ::after 扩散光环做动效，只改 transform/opacity，不触发重绘 */
.mk-label.yellow {
  border-color: #FFC107; color: #FFC107;
  box-shadow: 0 0 8px rgba(255,193,7,.35);
  animation: mkYellowBreath 2.4s ease-in-out infinite;
}
.mk-label.yellow::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 3px;
  border: 1px solid rgba(255,193,7,.85);
  pointer-events: none;
  animation: mkYellowRing 2.4s ease-out infinite;
}
.mk-label.yellow .mk-cap { color: rgba(255,193,7,.7); }
.mk-label:hover {
  transform: translate(calc(var(--mk-dx, 0px) - 50%), calc(var(--mk-dy, -16px) - 50%)) scale(1.12);
  box-shadow: 0 0 14px rgba(63,230,255,.5);
  z-index: 10;
}
.mk-label.yellow:hover { box-shadow: 0 0 18px rgba(255,193,7,.7); }

/* 旧样式保留（兼容残留引用，不主动用） */
.mk { display: none; }
.mk-yellow { background: rgba(6,20,52,.92); border: 2px solid #FFC107; color: #FFC107; padding: 4px 12px; font-size: 11px; font-weight: 700; white-space: nowrap; text-shadow: 0 1px 3px rgba(0,0,0,.8); box-shadow: 0 0 15px rgba(255,193,7,.8); animation: pulse-yellow 2s ease-in-out infinite; cursor: pointer; user-select: none; }

/* keyframes */
@keyframes mkPulse {
  0%   { transform: translate(-50%,-50%) scale(1);    opacity: .55; }
  70%  { transform: translate(-50%,-50%) scale(2.3);  opacity: 0; }
  100% { transform: translate(-50%,-50%) scale(2.3);  opacity: 0; }
}
@keyframes mkFlow {
  from { stroke-dashoffset: 16; }
  to   { stroke-dashoffset: 0; }
}
/* 黄色重点电站：呼吸 + 向外扩散光环（纯合成层属性） */
@keyframes mkYellowBreath {
  0%, 100% { opacity: 1; }
  50%      { opacity: .78; }
}
@keyframes mkYellowRing {
  0%       { transform: scale(1);    opacity: .85; }
  70%, 100% { transform: scale(1.25); opacity: 0; }
}
.gemp-divicon { background: transparent; border: none; }

/* AMap marker 容器去除默认样式 */
.amap-marker { background: transparent; border: none; }

/* 信息窗(暗色青色卡片) */
.gemp-info {
  background: rgba(6,20,52,.95);
  color: #DCEEFF;
  padding: 8px 12px;
  border: 1px solid var(--cyan);
  box-shadow: 0 4px 12px rgba(63,230,255,.3);
  min-width: 140px;
  max-width: 210px;
}
.gemp-info .gi-title {
  font-size: 12px; font-weight: 700; margin-bottom: 6px; color: var(--cyan);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.gemp-info .gi-row {
  font-size: 10px; line-height: 1.6;
  display: flex; justify-content: space-between; gap: 12px;
}
.gemp-info .gi-k { color: #9DB9D6; }
.gemp-info .gi-v { color: #DCEEFF; font-weight: 600; }
.amap-info-close { color: var(--gray-400) !important; }
.amap-info-content { background: transparent !important; padding: 0 !important; }
.amap-info-sharp { display: none; }

/* Leaflet 弹窗适配(降级方案) */
.leaflet-popup-content-wrapper {
  background: transparent;
  box-shadow: none;
  padding: 0;
}
.leaflet-popup-content { margin: 0; line-height: normal; }
.leaflet-popup-tip { background: rgba(6,20,52,.95); border: 1px solid var(--cyan); box-shadow: 0 4px 12px rgba(63,230,255,.3); }
.leaflet-popup-close-button { color: var(--gray-400) !important; font-size: 16px !important; padding: 4px 6px 0 0 !important; }
.leaflet-div-icon { background: transparent; border: none; }
.leaflet-bar, .leaflet-control-attribution { display: none !important; }
.leaflet-container { background: #050B14; font-family: inherit; }

.gemp-brand {
  position: absolute;
  left: 8px; bottom: 4px;
  z-index: 9;
  display: flex; align-items: center; gap: 5px;
  font-size: 10px;
  color: rgba(220,238,255,.7);
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
  pointer-events: none;
}
.gemp-brand img { height: 14px; }
/* display:flex 会覆盖 hidden 属性，需显式隐藏（否则与高德 logo 重叠成乱码） */
.gemp-brand[hidden] { display: none; }

/* ---------------- 右下角 3D 入口（文字按钮，与语言切换同一排、同一视觉语言） ---------------- */
.gas-entry {
  display: flex; align-items: center;
  padding: 8px 16px;
  min-height: 38px;
  background: rgba(8,28,68,.94);
  border: 1px solid rgba(63,230,255,.55);
  color: var(--cyan);
  font-size: 14px; font-weight: 500;
  letter-spacing: 1px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, box-shadow .2s;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.gas-entry:hover {
  background: rgba(30,84,190,.7);
  box-shadow: 0 0 12px rgba(63,230,255,.35);
}

/* ---------------- 语言切换（切角深色玻璃） ---------------- */
.lang-switch {
  position: fixed; bottom: 24px; right: 24px; z-index: 50;
  display: flex; align-items: center; gap: 10px;
}
.lang-trigger {
  padding: 8px 18px;
  background: rgba(8,28,68,.94);
  border: 1px solid rgba(63,230,255,.55);
  color: var(--cyan);
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500;
  letter-spacing: 1px;
  min-height: 38px;
  cursor: pointer;
  transition: background .2s;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.lang-trigger:hover { background: rgba(30,84,190,.7); }
.lang-caret { width: 16px; height: 16px; transition: transform .2s; }
.lang-switch.open .lang-caret { transform: rotate(180deg); }

.lang-menu {
  list-style: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  min-width: 120px;
  background: rgba(6,20,52,.97);
  border: 1px solid rgba(63,230,255,.45);
  box-shadow: 0 8px 24px rgba(0,0,0,.5), 0 0 14px rgba(63,230,255,.15);
  overflow: hidden;
}
.lang-menu li {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
}
.lang-menu li:hover { background: rgba(30,84,190,.55); }
.lang-menu li.active { color: var(--cyan); }

/* ---------------- 加载 / 警告 ---------------- */
.loader-mask {
  position: fixed; inset: 0;
  z-index: 100;
  background:
    radial-gradient(1000px 600px at 50% 40%, rgba(30,84,190,.35) 0%, rgba(3,11,32,0) 70%),
    var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s ease;
}
.loader-mask.hide { opacity: 0; pointer-events: none; }
.loader-box { text-align: center; }
.loader-ring {
  width: 44px; height: 44px;
  border: 3px solid rgba(63,230,255,.18);
  border-top-color: var(--cyan);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { font-size: 13px; color: var(--gray-400); letter-spacing: 1px; }

.conn-banner {
  position: fixed;
  top: 72px; left: 0; right: 0;
  z-index: 90;
  background: rgba(220,38,38,.92);
  color: #fff;
  text-align: center;
  font-size: 12px;
  padding: 6px 12px;
  animation: blink 1s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .55; } }

/* ---------------- 窄屏适配 ---------------- */
@media (max-width: 1280px) {
  .app-header h1 { font-size: 22px; letter-spacing: 2px; }
  .hk-num { font-size: 23px; }
  .panel-head h3 { font-size: 13px; }
  .map-slogan { font-size: 17px; letter-spacing: 2px; }
  [lang="zh-CN"] .map-slogan { letter-spacing: 6px; }
  [dir="rtl"] .map-slogan { font-size: 17px; letter-spacing: 1px; }
}

/* ---------------- 平板 / 手机端适配 ---------------- */
/* 仅竖屏窄屏降级为纵向堆叠；横屏手机/平板保持三栏桌面布局 */
@media (max-width: 960px) and (orientation: portrait) {
  html, body { height: auto; overflow: auto; }
  .app-header {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 8px;
  }
  [dir="rtl"] .app-header { padding: 10px 14px; }
  .app-header h1 { font-size: 18px; letter-spacing: 1px; white-space: normal; }
  .header-left { gap: 10px; }
  .logo-box { width: 36px; height: 36px; }
  .header-right { gap: 10px; flex-wrap: wrap; }
  .hk-num { font-size: 20px; }
  .header-user span { display: none; }

  .app-main {
    flex-direction: column !important;
    height: auto;
  }
  [dir="rtl"] .app-main { flex-direction: column !important; }
  [dir="rtl"] .app-header,
  [dir="rtl"] .header-left,
  [dir="rtl"] .header-right { flex-direction: row !important; flex-wrap: wrap; }
  .col {
    width: 100%;
    height: auto;
    padding: 8px 10px;
  }
  .map-wrap {
    height: 55vh;
    min-height: 380px;
    flex: none;
  }
  .panel { flex: none; min-height: 0; }
  .sp-kpis { grid-template-columns: 1fr 1fr; }
  .map-slogan { font-size: 15px; letter-spacing: 1px; bottom: 14px; }
  [lang="zh-CN"] .map-slogan { letter-spacing: 4px; }
  [dir="rtl"] .map-slogan { font-size: 15px; letter-spacing: 1px; }

  /* FBox 电站卡 — 手机竖屏 */
  .sp-head { padding-right: 72px; }
  .sp-name { font-size: 16px; letter-spacing: .4px; }
  .sp-serial { font-size: 8px; }
  .sp-kpis { gap: 8px; margin: 10px 0 8px; }
  .sp-kpi { padding: 6px 10px; }
  .sp-kpi-label { font-size: 9px; }
  .sp-tabs { gap: 6px; margin-bottom: 6px; }
  .sp-tab { padding: 4px 10px; font-size: 10px; letter-spacing: .5px; }
  .sp-chart { min-height: 120px; }
  .sp-statusbar { font-size: 11px; gap: 10px; flex-wrap: wrap; }
  .sp-update b { font-size: 11px; }

  /* 数字孪生卡 — 手机竖屏 */
  .media-panel .sp-head { padding-right: 72px; }
  .media-panel .mp-scope { font-size: 8px; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* 手机端卡片高度自适应，格子用固定宽高比撑开 */
  .mp-grid { flex: none; gap: 5px; grid-template-rows: auto auto; }
  .mp-cell { aspect-ratio: 4 / 3; }

  /* 光伏板块 — 手机竖屏 */
  .pv-entry { flex: 1 1 auto; min-height: 220px; gap: 8px; }
  .panel.pv-entry::after { content: none; }
  .pv-head { padding-right: 72px; }
  .pv-name-row { gap: 6px; }
  .pv-tag-bar { height: 18px; }
  .pv-tag { font-size: 16px; letter-spacing: .4px; }
  .pv-sub-row { gap: 5px; margin-top: 5px; }
  .pv-serial { font-size: 8px; letter-spacing: 0; }
  .pv-shot { min-height: 100px; }

  /* 装饰条/圆点 — 手机竖屏略缩小 */
  .sp-name-bar, .pv-tag-bar { width: 3px; height: 18px; }
  .sp-title-dot, .pv-title-dot { width: 7px; height: 7px; }

  /* 底部操作按钮组 */
  .ut-actions { position: static; margin-top: 10px; gap: 10px; }
  .ut-detail, .ut-cctv { padding: 9px 14px; font-size: 13px; }

  /* 语言切换 / 3D 入口 */
  .lang-switch { position: static; margin-top: 10px; padding: 8px; }
}

@media (max-width: 600px) and (orientation: portrait) {
  .app-header h1 { font-size: 15px; letter-spacing: 0.5px; }
  .header-kpi .hk-label { display: none; }
  .hk-num { font-size: 17px; }
  #clock { font-size: 12px; }
  .col { padding: 6px 8px; gap: 8px; }
  .panel { padding: 10px; }
  .sp-kpi-val { font-size: 15px; }
  .map-wrap { height: 50vh; min-height: 320px; }
  .map-slogan { font-size: 13px; letter-spacing: 1px; bottom: 10px; }
  [lang="zh-CN"] .map-slogan { letter-spacing: 3px; }
  [dir="rtl"] .map-slogan { font-size: 13px; letter-spacing: 1px; }

  /* FBox 电站卡 — 小屏更紧凑 */
  .sp-head { padding-right: 60px; }
  .sp-name { font-size: 14px; letter-spacing: .2px; }
  .sp-serial { font-size: 7px; }
  .sp-enter { font-size: 10px; padding: 2px 8px; }
  .sp-kpi { padding: 5px 8px; }
  .sp-kpi-label { font-size: 8px; }
  .sp-chart { min-height: 100px; }
  .sp-statusbar { font-size: 10px; gap: 8px; }
  .sp-update b { font-size: 10px; }

  /* 数字孪生卡 — 小屏 */
  .media-panel .sp-head { padding-right: 60px; }
  .media-panel .mp-scope { font-size: 7px; }
  .mp-cell { aspect-ratio: 1 / 1; }

  /* 光伏板块 — 小屏 */
  .pv-entry { min-height: 180px; gap: 6px; }
  .pv-head { padding-right: 60px; }
  .pv-tag { font-size: 14px; letter-spacing: .2px; }
  .pv-sub-row { margin-top: 3px; }
  .pv-serial { font-size: 7px; }
  .pv-shot { min-height: 72px; }

  /* 装饰条/圆点 — 小屏再缩 */
  .sp-name-bar, .pv-tag-bar { width: 3px; height: 16px; }
  .sp-title-dot, .pv-title-dot { width: 6px; height: 6px; }

  /* 底部按钮组 — 全宽纵向 */
  .ut-actions { flex-direction: column; }
  .ut-detail, .ut-cctv { width: 100%; padding: 10px; justify-content: center; }
}

/* 横屏窄屏（手机横屏）：保持三栏，但压缩尺寸 */
@media (max-width: 960px) and (orientation: landscape) {
  .app-header { height: 56px; padding: 0 16px; }
  .app-header h1 { font-size: 17px; letter-spacing: 1px; }
  .logo-box { width: 34px; height: 34px; }
  .header-right { gap: 12px; }
  .hk-num { font-size: 19px; }
  .header-user span { display: none; }
  .col { padding: 8px; gap: 8px; }
  .panel { padding: 10px; }
  .map-slogan { font-size: 14px; letter-spacing: 1px; bottom: 12px; }
  [lang="zh-CN"] .map-slogan { letter-spacing: 4px; }
  [dir="rtl"] .map-slogan { font-size: 14px; letter-spacing: 1px; }

  /* FBox 电站卡 — 横屏压缩 */
  .sp-name { font-size: 15px; }
  .sp-kpi-val { font-size: 16px; }
  .sp-chart { min-height: 80px; }
  .sp-statusbar { font-size: 10px; gap: 8px; }

  /* 光伏板块 — 横屏保持 flex */
  .pv-entry { flex: 1 1 0; }
  .pv-shot { min-height: 50px; }
}

/* ---------------- 竖屏旋转提示层 ---------------- */
.rotate-hint {
  display: none !important;   /* 已取消自动弹出 */
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(3,11,32,.96);
  color: var(--cyan);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 24px;
}
.rotate-hint .rh-icon {
  width: 84px; height: 84px;
  border: 3px solid var(--cyan);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  animation: rh-rotate 1.8s ease-in-out infinite;
}
.rotate-hint .rh-icon svg { width: 44px; height: 44px; fill: var(--cyan); }
.rotate-hint .rh-title { font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.rotate-hint .rh-sub { font-size: 13px; color: var(--gray-400); max-width: 280px; line-height: 1.6; }
.rotate-hint .rh-btn {
  margin-top: 6px;
  padding: 10px 22px;
  background: linear-gradient(135deg, #1976d2, #0d47a1);
  color: #fff; border: none; border-radius: 6px;
  font-size: 14px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(25,118,210,.5);
}
.rotate-hint .rh-skip {
  font-size: 12px; color: var(--gray-500); text-decoration: underline;
  cursor: pointer; background: none; border: none;
}
@keyframes rh-rotate {
  0%, 20% { transform: rotate(0deg); }
  80%, 100% { transform: rotate(90deg); }
}
/* 触屏设备竖屏时显示提示；可通过 .dismissed 永久隐藏 */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  .rotate-hint { display: flex; }
  .rotate-hint.dismissed { display: none !important; }
}

/* ---------------- 阿语：保持左右模块位置与其他语言一致 ----------------
   文档 dir="rtl" 仅用于阿拉伯文字的正确排版（右对齐/连字），
   但所有横向布局容器强制 flex-direction: row-reverse，
   使视觉上的左右顺序与 LTR 页面完全一致。 */
[dir="rtl"] .app-main,
[dir="rtl"] .app-header,
[dir="rtl"] .header-left,
[dir="rtl"] .header-right,
[dir="rtl"] .header-kpi,
[dir="rtl"] .header-time-wrap,
[dir="rtl"] .header-user,
[dir="rtl"] .sp-name-row,
[dir="rtl"] .sp-sub-row,
[dir="rtl"] .sp-kpis,
[dir="rtl"] .sp-tabs,
[dir="rtl"] .sp-statusbar,
[dir="rtl"] .sp-units-toggle,
[dir="rtl"] .sp-unit,
[dir="rtl"] .sp-unit-left,
[dir="rtl"] .kpi-value-row,
[dir="rtl"] .pv-head,
[dir="rtl"] .ut-head,
[dir="rtl"] .ut-row {
  flex-direction: row-reverse;
}
/* 顶部品牌与顶部信息的物理左右内边距保持对称观感 */
[dir="rtl"] .app-header { padding: 0 26px; }

/* ---------------- 阿语 RTL 镜像 ---------------- */
[dir="rtl"] .map-slogan { letter-spacing: 1px; direction: ltr; }

/* ---------------- 其他语言（英/俄/法/西/葡）标题字距收紧 ----------------
   中文（zh-CN）与阿语（dir=rtl）保持原字距；
   拉丁/西里尔标题原文较长，字距收紧以对齐阿语版的紧凑观感 */
html[lang="en"] .app-header h1,
html[lang="ru"] .app-header h1,
html[lang="fr"] .app-header h1,
html[lang="es"] .app-header h1,
html[lang="pt"] .app-header h1 { letter-spacing: 1px; }

html[lang="en"] .map-slogan,
html[lang="ru"] .map-slogan,
html[lang="fr"] .map-slogan,
html[lang="es"] .map-slogan,
html[lang="pt"] .map-slogan { letter-spacing: 1px; }
