* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
  color: #e7f3ff;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.num { font-family: Bahnschrift, "DIN Alternate", "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; }

#screen {
  position: relative;
  width: 1920px;
  height: 1080px;
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transform-origin: center center;
  background-color: #03102a;
  background-image:
    linear-gradient(#3ec8ff, #3ec8ff) left 8px top 8px / 26px 2px no-repeat,
    linear-gradient(#3ec8ff, #3ec8ff) left 8px top 8px / 2px 26px no-repeat,
    linear-gradient(#3ec8ff, #3ec8ff) right 8px top 8px / 26px 2px no-repeat,
    linear-gradient(#3ec8ff, #3ec8ff) right 8px top 8px / 2px 26px no-repeat,
    linear-gradient(#3ec8ff, #3ec8ff) left 8px bottom 8px / 26px 2px no-repeat,
    linear-gradient(#3ec8ff, #3ec8ff) left 8px bottom 8px / 2px 26px no-repeat,
    linear-gradient(#3ec8ff, #3ec8ff) right 8px bottom 8px / 26px 2px no-repeat,
    linear-gradient(#3ec8ff, #3ec8ff) right 8px bottom 8px / 2px 26px no-repeat,
    radial-gradient(ellipse 70% 42% at 50% 0%, rgba(24, 96, 190, 0.38), transparent 62%),
    linear-gradient(180deg, #06183a 0%, #020c1e 100%);
  box-shadow: 0 0 0 1px rgba(62, 160, 230, 0.28);
}
#screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(70, 140, 210, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70, 140, 210, 0.09) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at 50% 38%, #000 28%, transparent 78%);
}
#screen > * { position: relative; z-index: 1; }
#screen > .modal-mask { z-index: 30; }
#screen > .toast { z-index: 40; }

.header {
  height: 100px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 300px 1fr 320px;
  grid-template-rows: 58px 42px;
  align-items: center;
}
.brand {
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
}
.logo { width: 36px; height: 36px; filter: drop-shadow(0 0 6px rgba(70, 190, 255, 0.65)); }
.title-banner {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  height: 54px;
  display: grid;
  place-items: center;
}
.title-frame { position: absolute; inset: 0 20px; width: calc(100% - 40px); height: 100%; }
.title-banner h1 {
  position: relative;
  margin: 0;
  font-size: 32px;
  letter-spacing: 8px;
  font-weight: 700;
  color: #f5fbff;
  text-shadow: 0 0 18px rgba(90, 190, 255, 0.55);
}
.meta {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #d7ecff;
  font-size: 16px;
}
.weather { display: inline-flex; align-items: center; gap: 6px; }
.weather svg { width: 22px; height: 22px; fill: #d5eeff; }
.nav {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.nav button {
  border: 0;
  color: #d3ebff;
  background: linear-gradient(180deg, rgba(18, 86, 168, 0.95), rgba(8, 42, 102, 0.95));
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 100%, 0 100%);
  padding: 6px 22px;
  font-size: 14px;
  letter-spacing: 1px;
}
.nav button.active {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(180deg, #3ec0ff, #0c74dc);
  box-shadow: 0 0 12px rgba(50, 180, 255, 0.45);
}

.kpis {
  height: 84px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}
.kpi {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background:
    linear-gradient(#49c8ff, #49c8ff) left top / 10px 2px no-repeat,
    linear-gradient(#49c8ff, #49c8ff) left top / 2px 10px no-repeat,
    linear-gradient(#49c8ff, #49c8ff) right top / 10px 2px no-repeat,
    linear-gradient(#49c8ff, #49c8ff) right top / 2px 10px no-repeat,
    linear-gradient(180deg, rgba(14, 58, 120, 0.72), rgba(5, 22, 52, 0.88));
  border: 1px solid rgba(70, 150, 220, 0.38);
  box-shadow: inset 0 0 18px rgba(20, 100, 200, 0.16);
}
.kpi-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(110, 200, 255, 0.75);
  background: radial-gradient(circle at 40% 35%, rgba(90, 200, 255, 0.35), rgba(8, 36, 84, 0.2) 70%);
  box-shadow: 0 0 12px rgba(40, 160, 255, 0.35), inset 0 0 8px rgba(80, 180, 255, 0.25);
}
.kpi-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #8ad8ff;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.kpi-label { color: #8eb6dc; font-size: 13px; }
.kpi-value { margin-top: 2px; color: #fff; font-size: 24px; font-weight: 700; line-height: 1; white-space: nowrap; }
.kpi-value small { margin-left: 3px; font-size: 13px; font-weight: 500; color: #9cc8ee; }
.kpi-value small:first-child { margin: 0 2px 0 0; }

.main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 468px minmax(0, 1fr) 468px;
  gap: 12px;
}
.col { display: grid; gap: 12px; min-height: 0; }
.col-left { grid-template-rows: 248px 228px minmax(0, 1fr); }
.col-center { grid-template-rows: minmax(0, 1fr) 232px; }
.col-right { grid-template-rows: 300px 228px minmax(0, 1fr); }
.center-bottom {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(#46c8ff, #46c8ff) left top / 12px 2px no-repeat,
    linear-gradient(#46c8ff, #46c8ff) left top / 2px 12px no-repeat,
    linear-gradient(#46c8ff, #46c8ff) right top / 12px 2px no-repeat,
    linear-gradient(#46c8ff, #46c8ff) right top / 2px 12px no-repeat,
    linear-gradient(#46c8ff, #46c8ff) left bottom / 12px 2px no-repeat,
    linear-gradient(#46c8ff, #46c8ff) left bottom / 2px 12px no-repeat,
    linear-gradient(#46c8ff, #46c8ff) right bottom / 12px 2px no-repeat,
    linear-gradient(#46c8ff, #46c8ff) right bottom / 2px 12px no-repeat,
    linear-gradient(180deg, rgba(10, 42, 96, 0.72), rgba(4, 16, 42, 0.9));
  border: 1px solid rgba(64, 146, 220, 0.4);
  box-shadow: inset 0 0 24px rgba(16, 80, 170, 0.16);
}
.panel-hd {
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 12px;
  background: linear-gradient(90deg, rgba(28, 114, 206, 0.32), transparent 72%);
  border-bottom: 1px solid rgba(80, 160, 230, 0.22);
}
.panel-hd h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #e9f6ff;
}
.mark {
  width: 0;
  height: 0;
  border-left: 8px solid #2ec7ff;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  filter: drop-shadow(0 0 4px #2ec7ff);
}
.panel-bd { flex: 1; min-height: 0; padding: 8px 12px 10px; }
.chart-host { position: relative; }
.chart-host .chart { position: absolute; inset: 4px 2px 2px; }
.chart-box { position: relative; min-height: 0; }
.chart-box .chart { position: absolute; inset: 0; }
.chart-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}
.chart-center span { color: #9ec4e4; font-size: 12px; }
.chart-center strong { color: #fff; font-size: 22px; line-height: 1.15; font-weight: 700; }
.chart-center em { color: #8eb6d8; font-style: normal; font-size: 12px; }

.overview-layout, .task-layout {
  height: 100%;
  display: grid;
  align-items: center;
}
.overview-layout { grid-template-columns: 188px 1fr; gap: 4px; }
.task-layout { grid-template-columns: 118px 1fr; }
.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}
.legend li {
  display: grid;
  grid-template-columns: 8px 56px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: #e4f2ff;
}
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend .pct { color: #8eb6d8; }
.task-legend li { grid-template-columns: 8px 48px 28px 46px; gap: 6px; }
.task-center strong { font-size: 26px; }

.util-layout { height: 100%; display: flex; flex-direction: column; }
.util-chart-wrap { height: 156px; flex-shrink: 0; }
.util-center strong { font-size: 28px; color: #f4fbff; text-shadow: 0 0 12px rgba(80, 190, 255, 0.45); }
.util-center em { display: block; margin-top: 2px; font-size: 11px; color: #9ec4e4; }
.util-list {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  align-content: center;
}
.util-item {
  display: grid;
  grid-template-columns: 36px 1fr 48px;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}
.util-track { height: 6px; border-radius: 4px; background: rgba(40, 90, 150, 0.4); overflow: hidden; }
.util-track span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #1a6dff, #3ecbff);
}

.table-bd { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.data-table th {
  color: #7eafd6;
  font-weight: 500;
  font-size: 12px;
  text-align: left;
  padding: 3px 4px 5px;
}
.data-table td {
  color: #e7f3ff;
  font-size: 12px;
  padding: 3px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table tbody tr:nth-child(odd) { background: rgba(22, 78, 150, 0.2); }
.data-table tbody tr:hover { background: rgba(40, 120, 210, 0.28); }
.top-table th:nth-child(1), .top-table td:nth-child(1) { width: 72px; }
.top-table th:nth-child(2), .top-table td:nth-child(2) { width: 68px; }
.top-table th:nth-child(4), .top-table td:nth-child(4) { width: 68px; text-align: right; }
.top-table th:nth-child(5), .top-table td:nth-child(5) { width: 78px; text-align: right; }
.task-table tbody tr { cursor: pointer; }
.task-table th:nth-child(1) { width: 16%; }
.task-table th:nth-child(3) { width: 14%; }
.task-table th:nth-child(4) { width: 18%; }
.task-table th:nth-child(5) { width: 24%; }
.bar { height: 7px; border-radius: 4px; background: rgba(36, 86, 146, 0.45); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #1a6dff, #49d2ff); }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 12px;
}
.st-run { color: #49d2ff; background: rgba(40, 160, 255, 0.16); }
.st-wait { color: #f5b942; background: rgba(245, 185, 66, 0.14); }
.st-done { color: #3dde9b; background: rgba(46, 220, 150, 0.14); }
.st-cancel { color: #9aabbd; background: rgba(140, 160, 180, 0.14); }
.live-dot {
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-radius: 50%;
  background: #2ee6a6;
  box-shadow: 0 0 8px #2ee6a6;
  animation: blink 1.4s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.view-switch { display: flex; gap: 4px; }
.view-switch button {
  border: 1px solid rgba(80, 170, 240, 0.4);
  background: rgba(8, 36, 80, 0.55);
  color: #b7d7f2;
  padding: 2px 10px;
  font-size: 12px;
}
.view-switch button.active {
  color: #fff;
  border-color: #49c8ff;
  background: linear-gradient(180deg, #1a94ff, #0b62c8);
}
.warehouse-view {
  position: relative;
  flex: 1;
  min-height: 0;
  background: radial-gradient(ellipse at 50% 58%, rgba(18, 78, 150, 0.45), rgba(4, 16, 40, 0.15) 72%);
}
.warehouse-view canvas { width: 100%; height: 100%; display: block; }
.wh-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.zone-tag, .gate-tag {
  padding: 1px 8px;
  color: #eef8ff;
  font-size: 13px;
  letter-spacing: 1px;
  background: rgba(6, 28, 64, 0.55);
  border: 1px solid rgba(130, 210, 255, 0.65);
  text-shadow: 0 0 8px rgba(80, 190, 255, 0.8);
  white-space: nowrap;
}
.gate-tag.out { color: #ffe0b5; border-color: rgba(245, 176, 70, 0.8); }
.gate-tag.in { color: #d9f6ff; border-color: rgba(70, 210, 255, 0.85); }
.zone-chip, .wh-legend, .wh-tip, .wh-fallback { position: absolute; z-index: 4; }
.zone-chip {
  top: 10px;
  left: 12px;
  padding: 4px 10px;
  font-size: 12px;
  color: #d7ecff;
  background: rgba(6, 24, 56, 0.72);
  border: 1px solid rgba(90, 180, 255, 0.4);
}
.wh-legend {
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  padding: 4px 12px;
  font-size: 12px;
  color: #d5e8f8;
  background: rgba(4, 18, 42, 0.45);
}
.wh-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; display: inline-block; }
.swatch.normal { background: #2b8cff; }
.swatch.busy { background: #f0a20a; }
.swatch.full { background: #ff4b45; }
.swatch.empty { background: rgba(190, 210, 230, 0.15); border: 1px solid rgba(210, 226, 240, 0.85); }
.wh-tip {
  min-width: 148px;
  padding: 8px 10px;
  background: rgba(4, 18, 40, 0.94);
  border: 1px solid rgba(80, 190, 255, 0.65);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color: #d7ecff;
  font-size: 12px;
  line-height: 1.6;
  pointer-events: none;
}
.wh-tip strong { display: block; color: #fff; font-size: 13px; }
.wh-fallback {
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffb4b4;
  background: rgba(4, 12, 28, 0.72);
}

.alert-head, .alert-row {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 0.95fr 40px;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}
.alert-head { color: #7eafd6; padding: 2px 4px 6px; }
.alert-row { padding: 7px 4px; border-top: 1px solid rgba(80, 140, 200, 0.16); }
.alert-name { display: inline-flex; align-items: center; gap: 6px; }
.warn-low, .warn-high {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid #ff5d5d;
}
.warn-high { border-bottom-color: #f5b942; }
.type-low { color: #ff6b6b; }
.type-high { color: #f5b942; }
.link-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: #49c8ff;
  font-size: 12px;
}
.link-btn:hover { color: #9ae4ff; }
.modal-alerts .alert-row { grid-template-columns: 1.2fr 1fr 1fr; }

.toast {
  position: absolute;
  top: 112px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  color: #e9f6ff;
  background: rgba(8, 36, 78, 0.94);
  border: 1px solid rgba(80, 190, 255, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  font-size: 13px;
}
.modal-mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(1, 8, 20, 0.55);
}
.modal {
  width: 440px;
  padding: 14px 16px 16px;
  background: linear-gradient(180deg, rgba(14, 52, 108, 0.96), rgba(6, 20, 48, 0.98));
  border: 1px solid rgba(80, 186, 255, 0.55);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
}
.modal-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-hd strong { font-size: 16px; letter-spacing: 1px; }
#modal-close {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(120, 190, 240, 0.4);
  background: transparent;
  color: #d7ecff;
  font-size: 18px;
  line-height: 1;
}
.info-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid rgba(90, 150, 210, 0.18);
  font-size: 13px;
}
.info-line span { color: #8eb6d8; }
.info-line strong { color: #f2f8ff; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}
