* {
  box-sizing: border-box;
}

:root {
  --line: rgba(74, 174, 255, 0.5);
  --line-strong: rgba(100, 220, 255, 0.9);
  --text: #e0f2ff;
  --accent: #3de7ff;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 10%, #1a164d 0%, #060a2b 40%, #000412 100%);
  color: var(--text);
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

button,
a {
  font-family: inherit;
}

#app {
  width: 100%;
  height: 100%;
}

.proto-screen {
  width: 100%;
  height: 100%;
  padding: 8px 16px 12px;
  position: relative;
  background:
    radial-gradient(circle at 10% 20%, rgba(120, 28, 64, 0.1), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(32, 74, 168, 0.1), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(16, 42, 102, 0.06), transparent 60%);
}

.proto-screen::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0px;
  height: 120px;
  pointer-events: none;
  background:
    linear-gradient(0deg, rgba(8, 22, 60, 0.5), rgba(8, 22, 60, 0)),
    linear-gradient(90deg, rgba(20, 78, 180, 0.15) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(rgba(20, 78, 180, 0.12) 1px, transparent 1px) 0 0 / 40px 40px;
  transform: perspective(400px) rotateX(60deg);
  transform-origin: bottom center;
}

.overview-screen::before,
.station-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.overview-screen::before {
  background:
    linear-gradient(180deg, rgba(7, 11, 40, 0.24), rgba(6, 10, 38, 0.16)),
    radial-gradient(circle at 30% 40%, rgba(55, 12, 62, 0.1), transparent 55%);
}

.station-screen::before {
  background:
    linear-gradient(180deg, rgba(4, 10, 36, 0.3), rgba(4, 10, 34, 0.2)),
    radial-gradient(circle at 45% 45%, rgba(66, 18, 70, 0.11), transparent 62%);
}

.template-screen::before {
  background:
    linear-gradient(180deg, rgba(3, 8, 32, 0.38), rgba(3, 8, 30, 0.28)),
    radial-gradient(circle at 44% 46%, rgba(49, 11, 63, 0.14), transparent 65%);
}

.proto-top {
  height: 76px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-bottom: 16px;
}

.proto-top::before {
  content: '';
  position: absolute;
  top: 34px;
  left: 0;
  right: 0;
  height: 2px;
  background:
    linear-gradient(90deg,
      transparent 0%,
      rgba(45, 122, 222, 0.75) 20%,
      rgba(45, 122, 222, 0.75) 35%,
      transparent 40%,
      transparent 60%,
      rgba(45, 122, 222, 0.75) 65%,
      rgba(45, 122, 222, 0.75) 80%,
      transparent 100%);
  z-index: 1;
}

.proto-top::after {
  content: '';
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  height: 2px;
  background:
    linear-gradient(90deg,
      transparent 0%,
      rgba(15, 60, 130, 0.55) 15%,
      rgba(15, 60, 130, 0.55) 38%,
      transparent 42%,
      transparent 58%,
      rgba(15, 60, 130, 0.55) 62%,
      rgba(15, 60, 130, 0.55) 85%,
      transparent 100%);
  z-index: 0;
}

.head-line {
  position: absolute;
  top: 34px;
  width: 140px;
  height: 2px;
  background: linear-gradient(90deg, rgba(144, 230, 255, 0.9), transparent);
  box-shadow: 0 0 8px rgba(101, 217, 255, 0.7);
  z-index: 2;
}

.head-line.left {
  left: calc(50% - 480px);
}

.head-line.right {
  right: calc(50% - 480px);
  transform: scaleX(-1);
}

.head-spark {
  position: absolute;
  left: 50%;
  top: -8px;
  width: 280px;
  height: 84px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(160, 220, 255, 0.55) 0%, rgba(90, 180, 255, 0.18) 30%, transparent 70%);
  pointer-events: none;
  z-index: 3;
}

.title-shell {
  position: relative;
  width: 680px;
  height: 64px;
  background:
    linear-gradient(180deg, rgba(8, 25, 75, 0.88), rgba(12, 35, 95, 0.7)),
    linear-gradient(90deg, rgba(20, 70, 160, 0.14) 1px, transparent 1px) 0 0 / 16px 100%;
  clip-path: polygon(0 0,
      100% 0,
      95% 65%,
      65% 65%,
      60% 100%,
      40% 100%,
      35% 65%,
      5% 65%);
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 10px;
}

.title-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(110, 200, 255, 0.1) 0%, transparent 40%);
  pointer-events: none;
}

.proto-title {
  margin: 0;
  font-size: 32px;
  font-weight: bold;
  letter-spacing: 3px;
  color: #e5f5ff;
  text-shadow:
    0 0 8px rgba(120, 200, 255, 0.7),
    0 0 20px rgba(120, 200, 255, 0.35),
    0 2px 2px rgba(0, 0, 0, 0.7);
}

.top-tabs {
  position: absolute;
  top: 15px;
  display: flex;
  gap: 16px;
  z-index: 4;
}

.top-tabs.left {
  right: calc(50% + 360px);
}

.top-tabs.right {
  left: calc(50% + 360px);
}

.top-tab {
  min-width: 110px;
  height: 38px;
  border: 1px solid rgba(80, 180, 255, 0.5);
  background:
    linear-gradient(to right, rgba(50, 150, 255, 0.2), rgba(20, 60, 140, 0.5)),
    rgba(8, 20, 60, 0.8);
  color: #e0f5ff;
  font-size: 15px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  padding: 0 18px;
  box-shadow:
    inset 0 0 10px rgba(50, 150, 255, 0.2),
    0 0 5px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.top-tab:hover,
.top-tab.active {
  border-color: rgba(120, 220, 255, 0.9);
  background:
    linear-gradient(to right, rgba(80, 180, 255, 0.4), rgba(30, 90, 200, 0.7)),
    rgba(15, 30, 90, 0.9);
  box-shadow:
    inset 0 0 15px rgba(100, 200, 255, 0.4),
    0 0 10px rgba(60, 160, 255, 0.6);
  color: #ffffff;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

.proto-top.plain-head .top-tabs {
  display: none;
}

.panel {
  border: 1px solid rgba(100, 200, 255, 0.35);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(20, 60, 160, 0.1) 0%, rgba(5, 20, 60, 0.6) 100%),
    rgba(8, 20, 60, 0.65);
  box-shadow:
    inset 0 0 22px rgba(50, 150, 255, 0.1),
    0 5px 14px rgba(0, 0, 0, 0.4);
  position: relative;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border-top: 2px solid rgba(120, 220, 255, 0.75);
  border-left: 2px solid rgba(120, 220, 255, 0.75);
  pointer-events: none;
}

.panel::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  border-bottom: 2px solid rgba(120, 220, 255, 0.75);
  border-right: 2px solid rgba(120, 220, 255, 0.75);
  pointer-events: none;
}

.overview-main {
  margin-top: 9px;
  display: grid;
  grid-template-columns: minmax(0, 1.23fr) minmax(0, 0.87fr) minmax(0, 0.8fr);
  gap: 10px;
  height: calc(100% - 120px);
}

.map-panel {
  display: grid;
  grid-template-rows: 1fr 120px;
  gap: 8px;
  padding: 8px;
  min-height: 0;
}

.map-surface {
  position: relative;
  border: 1px solid rgba(80, 180, 255, 0.3);
  border-radius: 4px;
  overflow: hidden;
  background: transparent;
}

.map-surface::before {
  content: '';
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 30px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(40, 160, 255, 0.6) 0, rgba(20, 80, 200, 0.2) 50%, transparent 70%);
  box-shadow: 0 0 40px rgba(40, 160, 255, 0.4);
  z-index: 1;
}

.map-surface::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 25px;
  height: 90px;
  border: 2px solid rgba(100, 200, 255, 0.3);
  border-radius: 50%;
  background: transparent;
  pointer-events: none;
  z-index: 1;
}

.map-core {
  position: absolute;
  inset: 0;
  transform: scale(0.85);
  transform-origin: center 40%;
}

.map-union-shadow,
.map-union-high {
  position: absolute;
  pointer-events: none;
  clip-path: polygon(14% 24%, 19% 13%, 33% 6%, 46% 7%, 57% 2%, 71% 6%, 82% 12%, 92% 21%, 96% 35%, 90% 44%, 95% 57%, 90% 66%, 92% 78%, 84% 90%, 70% 95%, 58% 98%, 44% 97%, 31% 93%, 18% 88%, 9% 76%, 7% 61%, 3% 50%, 5% 37%);
}

.map-union-shadow {
  left: 36px;
  top: 76px;
  width: 494px;
  height: 480px;
  background: rgba(10, 30, 80, 0.9);
  filter: drop-shadow(0 20px 10px rgba(0, 0, 0, 0.6));
}

.map-union-high {
  left: 36px;
  top: 54px;
  width: 494px;
  height: 466px;
  border: 2px solid rgba(120, 220, 255, 0.8);
  background:
    linear-gradient(135deg, rgba(60, 160, 255, 0.6), rgba(20, 80, 180, 0.8) 50%, rgba(10, 40, 120, 0.9));
  box-shadow: inset 0 0 30px rgba(100, 200, 255, 0.4);
  opacity: 1;
}

/* Legacy map-dot and region styles have been replaced by ECharts */

.legend-box {
  position: absolute;
  right: 20px;
  bottom: 24px;
  width: 210px;
  background: rgba(4, 26, 87, 0.7);
  border: 1px solid rgba(84, 174, 242, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
}

.legend-box h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: #9fe9ff;
}

.legend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 12px;
  color: #9ecfff;
}

.legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.legend-item .c1 {
  background: #ff5f8b;
  box-shadow: 0 0 8px #ff5f8b;
}

.legend-item .c2 {
  background: #7cf1c3;
  box-shadow: 0 0 8px #7cf1c3;
}

.legend-item .c3 {
  background: #7a8fff;
  box-shadow: 0 0 8px #7a8fff;
}

.legend-item .c4 {
  background: #ffb84f;
  box-shadow: 0 0 8px #ffb84f;
}

.legend-item .c5 {
  background: #4ec3ff;
  box-shadow: 0 0 8px #4ec3ff;
}

.summary-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.strip-card {
  border: 1px solid rgba(84, 174, 242, 0.28);
  border-radius: 10px;
  padding: 8px;
  background: rgba(4, 24, 82, 0.58);
}

.strip-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #95e9ff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  white-space: nowrap;
}

.strip-card h3::before {
  display: none;
}

.strip-card h3::after {
  display: none;
}

.strip-card h3 span::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -2px;
  background: linear-gradient(180deg, #38eeff, #2f7dff);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.strip-card h3 button {
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(34, 122, 210, 0.8), rgba(9, 35, 98, 0.9));
  color: #d8f5ff;
  border-radius: 8px;
  padding: 2px 10px;
  cursor: pointer;
  font-size: 13px;
}

.strip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.strip-grid>div {
  border-left: 1px solid rgba(102, 186, 249, 0.35);
  padding-left: 8px;
}

.strip-grid b {
  display: block;
  color: #30eeff;
  font-size: 28px;
  line-height: 1;
}

.strip-grid small {
  font-size: 13px;
}

.strip-grid span {
  font-size: 13px;
  color: #d7ecff;
}

.energy-center,
.right-monitor {
  display: grid;
  gap: 10px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.energy-center {
  grid-template-rows: auto 1.4fr 1fr;
}

.right-monitor {
  grid-template-rows: 1fr 1fr 1fr;
}

.energy-total,
.day-panel,
.realtime-panel,
.right-monitor>.panel {
  padding: 8px 9px 9px;
}

.panel h3 {
  margin: 0 0 7px;
  color: #98f0ff;
  font-size: 16px;
  line-height: 1;
  position: relative;
  padding-right: 38px;
}

.panel h3::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  margin-right: 5px;
  vertical-align: -1px;
  background: linear-gradient(180deg, #35e8ff, #2c75f8);
}

.panel h3::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 95px;
  height: 4px;
  background:
    linear-gradient(90deg, rgba(80, 214, 255, 0.75), rgba(80, 214, 255, 0.02)),
    linear-gradient(90deg, rgba(80, 214, 255, 0.35) 40%, transparent 0) 0 0 / 10px 100%;
}

.big-number {
  width: 100%;
  border: 1px solid rgba(80, 200, 255, 0.5);
  background:
    linear-gradient(90deg, rgba(10, 40, 120, 0.6), rgba(30, 100, 200, 0.3) 50%, rgba(10, 40, 120, 0.6));
  border-radius: 4px;
  padding: 10px 15px;
  text-align: center;
  cursor: pointer;
  color: #4df8ff;
  font-size: 46px;
  font-weight: bold;
  letter-spacing: 4px;
  text-shadow:
    0 0 10px rgba(70, 240, 255, 0.8),
    0 0 20px rgba(70, 240, 255, 0.4);
  box-shadow:
    inset 0 0 15px rgba(50, 150, 255, 0.2),
    0 5px 15px rgba(0, 0, 0, 0.3);
}

.big-number span {
  font-size: 20px;
  margin-left: 10px;
  color: #a0d0ff;
  text-shadow: none;
  font-weight: normal;
}

.day-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.day-row button {
  border: 1px solid rgba(84, 174, 242, 0.5);
  background: rgba(12, 45, 120, 0.72);
  color: #d8ecff;
  border-radius: 8px;
  padding: 5px 8px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}

.day-row b {
  color: #44f0ff;
}

.ring-row {
  margin: 9px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ring-card {
  border: 0;
  background: transparent;
  color: #d8ecff;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.ring {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: conic-gradient(#4df8ff calc(var(--p) * 1%), rgba(20, 60, 160, 0.4) 0);
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #d5f7ff;
  position: relative;
  box-shadow: 0 0 15px rgba(50, 200, 255, 0.2);
}

.ring em {
  position: relative;
  z-index: 2;
  font-style: normal;
  font-weight: 500;
}

.ring::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: rgba(10, 25, 75, 0.95);
  box-shadow:
    inset 0 0 10px rgba(50, 150, 255, 0.2),
    0 0 10px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.ring-card small {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.1;
}

.chart-btn,
.pie-wrap,
.template-tip,
.note-line {
  width: 100%;
  border: 1px solid rgba(84, 174, 242, 0.28);
  border-radius: 8px;
  background: rgba(5, 24, 80, 0.45);
  padding: 0;
  cursor: pointer;
}

.chart-btn svg {
  width: 100%;
  height: 100%;
  display: block;
}

.realtime-panel .chart-btn {
  height: 100%;
}

.right-monitor .panel:first-child .chart-btn {
  height: calc(100% - 42px);
}

.right-monitor .panel:last-child .chart-btn {
  height: calc(100% - 42px);
}

.monitor-chart {
  height: 170px;
}

.pie-wrap {
  height: 170px;
  display: grid;
  place-items: center;
}

.pie-ring {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(#694df9 0 30%,
      #3269ff 30% 80%,
      #34c1ff 80% 100%);
  position: relative;
  box-shadow: 0 0 20px rgba(50, 150, 255, 0.2);
}

.pie-ring::after {
  content: '';
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: #0d1e57;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.pie-subtitle {
  text-align: center;
  width: 100%;
  color: #b0d0ff;
  font-size: 14px;
  margin-top: -10px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.pie-wrap {
  position: relative;
}

.pie-label {
  position: absolute;
  color: #c8e8ff;
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
}

.pie-label-1 {
  left: 8%;
  top: 22%;
}

.pie-label-2 {
  right: 6%;
  top: 18%;
}

.pie-label-3 {
  right: 10%;
  bottom: 22%;
}

.chart-legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-bottom: 4px;
  font-size: 12px;
}

.legend-dot {
  width: 18px;
  height: 3px;
  border-radius: 2px;
}

.legend-dot.water {
  background: #2ef4ff;
}

.legend-dot.power {
  background: #ffc04f;
}

.legend-line {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  position: relative;
}

.legend-line::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: rgba(8, 32, 94, 0.95);
}

.legend-line.supply {
  background: #2ef4ff;
  color: #2ef4ff;
}

.legend-line.elec {
  background: #ffc152;
  color: #ffc152;
}

.legend-label {
  color: #b8d8f0;
}

.monitor-legend {
  justify-content: flex-end;
  padding-right: 8px;
}

.time-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.time-tab {
  border: 1px solid rgba(89, 188, 255, 0.8);
  background: rgba(11, 47, 126, 0.7);
  color: #c8e0f5;
  border-radius: 6px;
  font-size: 12px;
  padding: 3px 9px;
  cursor: pointer;
}

.time-tab.active,
.time-tab:hover {
  background: linear-gradient(180deg, rgba(62, 184, 255, 0.6), rgba(19, 62, 154, 0.75));
  border-color: rgba(89, 188, 255, 0.9);
}

/* --- Station Page Refinements --- */
.station-screen {
  position: relative;
  background: radial-gradient(circle at 50% 10%, #0f172a 0%, #020617 100%);
  overflow: hidden;
}

.station-screen::before {
  content: '';
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  transform: perspective(1000px) rotateX(60deg) translateY(-100px) translateZ(-200px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.station-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 20%, #020617 80%);
  pointer-events: none;
  z-index: 0;
}

.station-screen .proto-top {
  height: 66px;
  margin-bottom: 8px;
}

.station-main {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 24px;
  height: calc(100vh - 100px);
  padding: 0 32px 24px;
}

.station-side {
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  position: relative;
  overflow: visible;
}

.station-side.left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(6, 17, 37, 0.9);
  backdrop-filter: blur(8px);
  clip-path: polygon(0 0, 85% 0, 100% 15%, 100% 85%, 85% 100%, 0 100%);
  z-index: 0;
}

.station-side.left::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: rgba(6, 182, 212, 0.4);
  /* cyan-500/40 */
  clip-path: polygon(0 0, 85% 0, 100% 15%, 100% 85%, 85% 100%, 0 100%);
  z-index: -1;
}

.station-side.right::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(6, 17, 37, 0.9);
  backdrop-filter: blur(8px);
  clip-path: polygon(15% 0, 100% 0, 100% 100%, 15% 100%, 0 85%, 0 15%);
  z-index: 0;
}

.station-side.right::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: rgba(6, 182, 212, 0.4);
  clip-path: polygon(15% 0, 100% 0, 100% 100%, 15% 100%, 0 85%, 0 15%);
  z-index: -1;
}

/* Glowing Edges */
.station-side-glow {
  position: absolute;
  top: 15%;
  bottom: 15%;
  width: 2px;
  background: #22d3ee;
  box-shadow: 0 0 15px 2px #22d3ee;
  z-index: 1;
}

.station-side.left .station-side-glow {
  right: 2px;
}

.station-side.right .station-side-glow {
  left: 2px;
}

.station-btn {
  background: transparent;
  border: 0;
  color: #eff6ff;
  cursor: pointer;
  min-height: 48px;
  font-size: 14px;
  position: relative;
  z-index: 1;
  padding: 0 10px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  outline: none;
  font-weight: bold;
  letter-spacing: 0.05em;
  transition: transform 0.3s;
}

.station-side.left .station-btn {
  clip-path: polygon(8% 0, 100% 0, 100% 100%, 0 100%);
}

.station-side.right .station-btn {
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);
}

.station-btn-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0284c7, #0369a1, #0f172a);
  z-index: -2;
  transition: background 0.3s;
}

/* glossy overlay */
.station-btn-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent);
}

.station-btn-bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.7), transparent);
}

/* Side Bright Edge */
.station-btn-edge {
  position: absolute;
  top: 0;
  width: 4px;
  height: 100%;
  background: #cffafe;
  z-index: -1;
}

.station-side.left .station-btn-edge {
  left: 0;
}

.station-side.right .station-btn-edge {
  right: 0;
}

.station-btn.active,
.station-btn:hover {
  transform: scale(1.05);
  color: white;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.station-btn.active .station-btn-bg,
.station-btn:hover .station-btn-bg {
  background: linear-gradient(180deg, #38bdf8, #0284c7, #0369a1);
}

/* Glow underlayer for active */
.station-btn-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #22d3ee, #0284c7);
  filter: blur(6px);
  z-index: -3;
  opacity: 0;
  transition: opacity 0.3s;
}

.station-btn.active .station-btn-glow,
.station-btn:hover .station-btn-glow {
  opacity: 1;
}

.station-btn span {
  position: relative;
  z-index: 1;
}

.station-center {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 5px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.metric-card {
  position: relative;
  background: linear-gradient(180deg, rgba(10, 25, 49, 0.8), rgba(2, 9, 25, 0.8));
  border: 1px solid rgba(30, 58, 138, 0.5);
  /* blue-800/50 */
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  min-height: 80px;
  transition: all 0.3s;
}

.metric-card:hover {
  border-color: rgba(34, 211, 238, 0.5);
  /* cyan-500/50 */
}

/* top sliding glow */
.metric-card-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 2px;
  background: #22d3ee;
  box-shadow: 0 0 10px #22d3ee;
  transition: width 0.5s;
}

.metric-card:hover .metric-card-glow {
  width: 75%;
}

/* 4 corners */
.metric-card::before,
.metric-card::after,
.metric-card-corner::before,
.metric-card-corner::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: #06b6d4;
  /* cyan-500 */
}

.metric-card::before {
  top: 0;
  left: 0;
  border-top: 2px solid;
  border-left: 2px solid;
}

.metric-card::after {
  top: 0;
  right: 0;
  border-top: 2px solid;
  border-right: 2px solid;
}

.metric-card-corner::before {
  bottom: 0;
  left: 0;
  border-bottom: 2px solid;
  border-left: 2px solid;
}

.metric-card-corner::after {
  bottom: 0;
  right: 0;
  border-bottom: 2px solid;
  border-right: 2px solid;
}

/* icon wrap */
.metric-icon-wrap {
  padding: 8px;
  background: rgba(30, 58, 138, 0.3);
  border-radius: 4px;
  transition: background 0.3s;
}

.metric-card:hover .metric-icon-wrap {
  background: rgba(22, 78, 99, 0.3);
}

.metric-icon {
  width: 24px;
  height: 24px;
  position: relative;
  border-radius: 50%;
  border: 2px solid #22d3ee;
  box-shadow: 0 0 6px rgba(34, 211, 238, 0.25);
  display: grid;
  place-items: center;
}

.metric-icon::before {
  content: '';
  width: 10px;
  height: 10px;
  background: #22d3ee;
  border-radius: 50%;
}

.metric-text {
  display: flex;
  flex-direction: column;
}

.metric-card span {
  font-size: 12px;
  color: #93c5fd;
  /* blue-300 */
  margin-bottom: 4px;
}

.metric-card b {
  font-size: 24px;
  font-weight: bold;
  color: #67e8f9;
  /* cyan-300 */
  font-family: monospace;
  letter-spacing: 0.05em;
  text-shadow: none;
}

.metric-icon::before,
.metric-icon::after {
  content: '';
  position: absolute;
}

.metric-icon.i1 {
  border-color: rgba(80, 220, 120, 0.7);
  box-shadow: 0 0 5px rgba(80, 220, 120, 0.22);
}

.metric-icon.i1::before {
  left: 3px;
  top: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(80, 220, 120, 0.8);
}

.metric-icon.i2 {
  border-color: rgba(73, 180, 255, 0.7);
  box-shadow: 0 0 5px rgba(73, 180, 255, 0.22);
}

.metric-icon.i2::before {
  left: 2px;
  top: 2px;
  width: 9px;
  height: 9px;
  border: 2px solid rgba(73, 180, 255, 0.8);
  border-top-color: transparent;
  border-radius: 50%;
}

.metric-icon.i3 {
  border-color: rgba(255, 200, 60, 0.7);
  box-shadow: 0 0 5px rgba(255, 200, 60, 0.22);
}

.metric-icon.i3::before {
  inset: 3px;
  border: 2px solid rgba(255, 200, 60, 0.8);
  border-radius: 2px;
}

.metric-icon.i4 {
  border-color: rgba(255, 100, 120, 0.7);
  box-shadow: 0 0 5px rgba(255, 100, 120, 0.22);
}

.metric-icon.i4::before {
  left: 2px;
  top: 2px;
  width: 9px;
  height: 9px;
  border-radius: 6px 6px 6px 1px;
  border: 2px solid rgba(255, 100, 120, 0.8);
}

.station-grid {
  min-height: 0;
  display: grid;
  gap: 5px;
}

.station-grid.live {
  grid-template-columns: 1fr 1fr;
}

.station-grid.template {
  grid-template-columns: 0.56fr 1fr;
}

.left-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.block-a,
.block-b,
.block-c {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.block-d,
.template-area {
  padding: 16px;
}

.block-d {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 6px 7px;
}

.section-title {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 8px;
  position: relative;
  border-bottom: 1px solid rgba(30, 58, 138, 0.5);
  /* blue-800/50 */
}

.st-line {
  width: 6px;
  height: 12px;
  background: #22d3ee;
  box-shadow: 0 0 5px #22d3ee;
  margin-right: 8px;
}

.section-title h3 {
  margin: 0;
  color: #ffffff;
  font-weight: 500;
  letter-spacing: 0.025em;
  font-size: 14px;
}

.st-arrow {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-left: 6px solid #22d3ee;
  border-bottom: 4px solid transparent;
  margin-left: auto;
}

.st-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 33%;
  height: 1px;
  background: #22d3ee;
  box-shadow: 0 0 5px #22d3ee;
}

.template-screen .section-title h3 {
  font-size: 12px;
}

.station-screen .panel h3::after {
  display: none;
  /* remove old style */
}

.table-grid {
  display: grid;
  gap: 4px;
}

.table-line {
  border: 0;
  border-bottom: 1px solid rgba(30, 58, 138, 0.5);
  /* blue-800/50 from reference */
  background: transparent;
  color: #c8e0ff;
  display: grid;
  padding: 12px 16px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.table-line:hover {
  background: rgba(8, 51, 68, 0.3);
  /* cyan-950/30 */
  border-bottom-color: rgba(6, 182, 212, 0.5);
  /* cyan-500/50 */
}

.table-line.pair {
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.table-cell {
  min-width: 0;
  display: grid;
  grid-template-columns: 15px 1fr auto;
  gap: 8px;
  align-items: center;
}

.table-cell em {
  font-style: normal;
  color: #90b8e8;
  font-size: 11px;
}

.table-cell strong {
  font-weight: 500;
  color: #80b0e8;
  font-size: 14px;
}

.table-cell b {
  font-size: 16px;
  color: #60c8f5;
  font-weight: 600;
}

.table-cell.empty {
  opacity: 0;
  pointer-events: none;
}

.table-line.ghost {
  height: 32px;
  cursor: default;
  border-bottom-color: rgba(112, 189, 245, 0.22);
}

.block-d .chart-btn {
  height: 240px;
  flex-shrink: 0;
}

.plant-canvas {
  margin-top: 10px;
  flex: 1;
  min-height: 220px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(59, 130, 246, 0.3);
  /* blue-500/30 */
  border-radius: 8px;
  background: rgba(10, 25, 49, 0.4);
  /* #0a1931/40 */
  box-shadow: inset 0 0 30px rgba(34, 211, 238, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.plant-bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, transparent, rgba(2, 9, 25, 0.8));
  z-index: 0;
}

.plant-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  mix-blend-mode: luminosity;
  transition: opacity 0.7s;
}

.plant-canvas:hover .plant-bg-image {
  opacity: 0.8;
}

.corner-glow {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: #22d3ee;
  z-index: 10;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.plant-canvas:hover .corner-glow {
  opacity: 1;
}

.corner-glow.top-left {
  top: 0;
  left: 0;
  border-top: 2px solid;
  border-left: 2px solid;
}

.corner-glow.top-right {
  top: 0;
  right: 0;
  border-top: 2px solid;
  border-right: 2px solid;
}

.corner-glow.bottom-left {
  bottom: 0;
  left: 0;
  border-bottom: 2px solid;
  border-left: 2px solid;
}

.corner-glow.bottom-right {
  bottom: 0;
  right: 0;
  border-bottom: 2px solid;
  border-right: 2px solid;
}

.sensor-label {
  position: absolute;
  z-index: 20;
  display: flex;
  align-items: center;
}

.sensor-label.right {
  flex-direction: row-reverse;
}

.sensor-btn {
  background: rgba(10, 25, 49, 0.9);
  border: 1px solid rgba(6, 182, 212, 0.5);
  /* cyan-500/50 */
  color: #67e8f9;
  /* cyan-300 */
  font-size: 10px;
  padding: 6px 12px;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.2);
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  transition: all 0.3s;
}

.sensor-label:hover .sensor-btn {
  background: rgba(22, 78, 99, 0.8);
  /* cyan-900/80 */
  border-color: #22d3ee;
  /* cyan-400 */
  color: #ffffff;
}

.sensor-line {
  width: 32px;
  height: 1px;
  background: rgba(6, 182, 212, 0.5);
  transition: background 0.3s;
}

.sensor-label:hover .sensor-line {
  background: #22d3ee;
}

.sensor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 5px #22d3ee;
  transition: transform 0.3s;
}

.sensor-label:hover .sensor-dot {
  transform: scale(1.5);
}

.plant-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.plant-hit {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 1;
}

.equip-node,
.camera-node {
  position: absolute;
  border: 1px solid rgba(95, 198, 255, 0.7);
  background: rgba(12, 62, 141, 0.82);
  color: #c8e0f5;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 11px;
  cursor: pointer;
  z-index: 3;
}

.equip-a {
  left: 16%;
  bottom: 10px;
}

.equip-b {
  left: 38%;
  bottom: 10px;
}

.equip-c {
  left: 60%;
  bottom: 10px;
}

.camera-node {
  right: 6%;
  bottom: 10px;
  border-color: rgba(255, 158, 195, 0.65);
  color: #f0c8d5;
}

.template-area {
  position: relative;
}

.template-area::before {
  content: '';
  position: absolute;
  inset: 3%;
  border-radius: 12px;
  background: radial-gradient(circle at 45% 45%, rgba(70, 143, 250, 0.25), rgba(13, 41, 112, 0.05) 70%);
}

.template-tip,
.note-line {
  border: 1px solid rgba(95, 188, 255, 0.3);
  background: rgba(6, 29, 88, 0.68);
  color: #d0e5f8;
  border-radius: 6px;
  padding: 8px;
  font-size: 12px;
  text-align: center;
  line-height: 1.35;
}

.template-tip {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  font-size: 0;
  z-index: 1;
}

.note-line {
  font-size: 18px;
  color: rgba(225, 240, 255, 0.88);
  text-shadow: 0 0 5px rgba(82, 195, 255, 0.22);
  border: 0;
  background: transparent;
  padding: 3px 10px 0;
}

.station-hint {
  position: absolute;
  left: 60px;
  right: 60px;
  bottom: 24px;
  border: 0;
  background: transparent;
  color: rgba(255, 205, 95, 0.85);
  text-shadow: 0 0 5px rgba(255, 195, 75, 0.25);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
}

.quick-nav {
  position: absolute;
  right: 14px;
  bottom: 2px;
  display: flex;
  gap: 6px;
  z-index: 10;
  transform: scale(0.74);
  transform-origin: bottom right;
  opacity: 0;
}

.quick-btn {
  border: 1px solid rgba(95, 198, 255, 0.85);
  background: linear-gradient(180deg, rgba(38, 131, 217, 0.8), rgba(9, 40, 109, 0.88));
  color: #d0e8ff;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.quick-btn:hover {
  box-shadow: 0 0 10px rgba(71, 213, 255, 0.5);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  border: 1px solid rgba(111, 212, 255, 0.88);
  background: rgba(6, 39, 104, 0.88);
  color: #c5f0ff;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 18px;
  z-index: 12;
}

.function-page-root {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 16px;
  background: radial-gradient(circle at 50% 12%, #153889 0%, #07144d 30%, #020a2e 74%, #010419 100%);
}

.function-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.function-head h1 {
  margin: 0;
  font-size: 44px;
  color: #a1f3ff;
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.module-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
}

.module-card {
  padding: 12px;
}

.module-card h3 {
  margin: 0 0 10px;
  color: #8deeff;
  font-size: 28px;
}

.module-grid {
  display: grid;
  gap: 8px;
}

.module-link {
  border: 1px solid rgba(95, 198, 255, 0.8);
  background: linear-gradient(180deg, rgba(33, 122, 210, 0.75), rgba(8, 35, 100, 0.9));
  color: #d8f5ff;
  border-radius: 8px;
  padding: 8px;
  font-size: 20px;
  text-align: left;
  cursor: pointer;
}

.feature-panel {
  padding: 12px;
}

.feature-desc {
  margin: 0 0 10px;
  color: #a8d8f6;
  font-size: 20px;
}

.query-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.query-grid label {
  display: grid;
  gap: 6px;
}

.query-grid span {
  color: #9dd3f8;
  font-size: 18px;
}

.query-grid input,
.query-grid select {
  border: 1px solid rgba(92, 194, 255, 0.5);
  background: rgba(13, 45, 122, 0.9);
  color: #d8f5ff;
  border-radius: 8px;
  padding: 8px;
  font-size: 18px;
}

.query-actions {
  margin: 12px 0;
  display: flex;
  gap: 10px;
}

.record-table {
  width: 100%;
  border-collapse: collapse;
}

.record-table th,
.record-table td {
  border-bottom: 1px solid rgba(98, 175, 236, 0.3);
  padding: 9px;
  font-size: 18px;
}

.status {
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 14px;
}

.status.ok {
  color: #5af4c8;
  border-color: rgba(90, 244, 200, 0.5);
}

.status.warn {
  color: #ffd183;
  border-color: rgba(255, 209, 131, 0.5);
}

.status.err {
  color: #ff91b0;
  border-color: rgba(255, 145, 176, 0.5);
}

@media (max-width: 1400px) {
  .overview-main {
    grid-template-columns: 1fr;
    overflow: auto;
    height: calc(100% - 176px);
  }

  .station-main {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .station-side {
    flex-direction: row;
    flex-wrap: wrap;
    border-radius: 14px;
  }

  .station-grid {
    grid-template-columns: 1fr;
  }

  .query-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .query-grid {
    grid-template-columns: 1fr;
  }

  .function-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
