/* 值班总览 · 智慧社区大屏 HUD */

/* 页面级禁止横向滚动；纵向交给内部面板 */
html:has(.app-shell.cockpit-mode),
body:has(.app-shell.cockpit-mode) {
  overflow: hidden;
  height: 100%;
  max-width: 100vw;
}

/* ---- 驾驶舱外壳：与 3D 同色系，去掉浅色顶栏割裂感 ---- */
.app-shell.cockpit-mode {
  background: #020814;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
}
.app-shell.cockpit-mode .main {
  background: #020814;
  height: 100%;
  min-height: 0;
  max-height: 100vh;
  overflow: hidden;
  min-width: 0;
}
.app-shell.cockpit-mode .sidebar {
  max-height: 100vh;
  overflow-x: hidden;
}
.app-shell.cockpit-mode .topbar {
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(8, 28, 48, 0.96), rgba(4, 14, 28, 0.92));
  border-bottom: 1px solid rgba(34, 211, 238, 0.28);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.app-shell.cockpit-mode .topbar h2 {
  color: #e8f6ff;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}
.app-shell.cockpit-mode .topbar .meta {
  color: rgba(186, 220, 240, 0.72);
}
.app-shell.cockpit-mode .nav-toggle,
.app-shell.cockpit-mode .cockpit-btn {
  border: 1px solid rgba(34, 211, 238, 0.45);
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.4), rgba(8, 30, 55, 0.75));
  color: #e8f6ff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.app-shell.cockpit-mode .nav-toggle:hover,
.app-shell.cockpit-mode .cockpit-btn:hover {
  border-color: #22d3ee;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.35);
  transform: translateY(-1px);
}
.app-shell.cockpit-mode .cockpit-btn.active {
  border-color: #22d3ee;
  background: rgba(34, 211, 238, 0.18);
  color: #67e8f9;
}
.app-shell.cockpit-mode .status-strip {
  margin: 0;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(34, 211, 238, 0.18);
  background: rgba(4, 16, 32, 0.92);
  box-shadow: none;
  color: rgba(186, 220, 240, 0.8);
}
.app-shell.cockpit-mode .status-strip .strip-item strong,
.app-shell.cockpit-mode .status-strip .strip-clock {
  color: #e8f6ff;
}
.app-shell.cockpit-mode .content.overview-bleed {
  padding: 0;
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #020814;
  overflow: hidden;
}
.app-shell.cockpit-mode .topbar {
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden;
}
.app-shell.cockpit-mode .status-strip {
  flex-shrink: 0;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

/* 隐藏顶栏 / 状态条 */
.app-shell.chrome-hidden .topbar,
.app-shell.chrome-hidden .status-strip {
  display: none !important;
}
.app-shell.cockpit-mode.chrome-hidden .content.overview-bleed,
.app-shell.cockpit-mode.nav-collapsed.chrome-hidden .content.overview-bleed {
  min-height: 0;
  flex: 1;
}
.app-shell.cockpit-mode.nav-collapsed.chrome-hidden .main {
  min-height: 0;
  height: 100%;
}

/* 纵向滚动条美化（驾驶舱面板 / 侧栏） */
.app-shell.cockpit-mode,
.app-shell.cockpit-mode * {
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 211, 238, 0.55) rgba(8, 28, 48, 0.55);
}
.app-shell.cockpit-mode ::-webkit-scrollbar {
  width: 8px;
  height: 0; /* 禁止横向滚动条外观 */
}
.app-shell.cockpit-mode ::-webkit-scrollbar:horizontal {
  height: 0;
  display: none;
}
.app-shell.cockpit-mode ::-webkit-scrollbar-track {
  background: linear-gradient(180deg, rgba(4, 16, 32, 0.2), rgba(8, 28, 48, 0.65));
  border-radius: 999px;
  margin: 6px 0;
  border: 1px solid rgba(34, 211, 238, 0.08);
}
.app-shell.cockpit-mode ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(103, 232, 249, 0.85), rgba(14, 116, 144, 0.9));
  border-radius: 999px;
  border: 2px solid rgba(2, 8, 20, 0.45);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.35);
}
.app-shell.cockpit-mode ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #a5f3fc, #22d3ee);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.55);
}
.app-shell.cockpit-mode ::-webkit-scrollbar-corner {
  background: transparent;
}

/* 悬浮恢复条（顶栏隐藏后仍可操作） */
.ov3-fab {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 40;
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px;
  background: rgba(6, 18, 36, 0.82);
  border: 1px solid rgba(34, 211, 238, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.app-shell.cockpit-mode.chrome-hidden .ov3-fab {
  display: flex;
}
.ov3-fab .cockpit-btn {
  border: 1px solid rgba(34, 211, 238, 0.45);
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.4), rgba(8, 30, 55, 0.75));
  color: #e8f6ff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}

.cockpit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.content.overview-bleed {
  padding: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ov3-root {
  --ov-cyan: #22d3ee;
  --ov-teal: #14b8a6;
  --ov-amber: #f59e0b;
  --ov-magenta: #e879f9;
  --ov-panel: rgba(6, 18, 36, 0.72);
  --ov-line: rgba(34, 211, 238, 0.45);
  --ov-ink: #e8f6ff;
  --ov-muted: rgba(186, 220, 240, 0.72);
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 0;
  color: var(--ov-ink);
  background:
    radial-gradient(ellipse 80% 55% at 50% 70%, rgba(20, 80, 120, 0.35), transparent 70%),
    linear-gradient(180deg, #020814 0%, #061426 45%, #030a14 100%);
  font-family: "Sora", "Noto Sans SC", sans-serif;
}

.ov3-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.ov3-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.ov3-vignette {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(2, 8, 20, 0.88) 0%, transparent 22%, transparent 78%, rgba(2, 8, 20, 0.88) 100%),
    linear-gradient(180deg, rgba(2, 8, 20, 0.75) 0%, transparent 18%, transparent 78%, rgba(2, 8, 20, 0.85) 100%);
}

.ov3-scan {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.08;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(34, 211, 238, 0.35) 3px
  );
  animation: ov3-scan 8s linear infinite;
}

@keyframes ov3-scan {
  from { transform: translateY(0); }
  to { transform: translateY(12px); }
}

.ov3-header {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  text-align: center;
  pointer-events: none;
  width: min(720px, 86%);
}

.ov3-title-frame {
  position: relative;
  padding: 10px 36px 12px;
  clip-path: polygon(4% 0, 96% 0, 100% 50%, 96% 100%, 4% 100%, 0 50%);
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.55), rgba(8, 30, 55, 0.75));
  border: 1px solid var(--ov-line);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.25);
}

.ov3-title-frame h1 {
  margin: 0;
  font-size: clamp(1.05rem, 1.8vw, 1.55rem);
  letter-spacing: 0.18em;
  font-weight: 700;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.55);
}

.ov3-title-frame .sub {
  margin-top: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--ov-muted);
  text-transform: uppercase;
}

.ov3-clock {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 4;
  text-align: right;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.ov3-clock .time {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ov-cyan);
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.45);
}

.ov3-clock .date {
  font-size: 0.78rem;
  color: var(--ov-muted);
  margin-top: 2px;
}

.ov3-panel {
  position: absolute;
  z-index: 3;
  width: min(300px, 28vw);
  max-width: calc(100% - 32px);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  background: var(--ov-panel);
  border: 1px solid var(--ov-line);
  box-shadow: 0 0 24px rgba(8, 145, 178, 0.18), inset 0 0 40px rgba(34, 211, 238, 0.04);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  overflow: hidden;
}

.ov3-panel.left { left: 16px; top: 86px; bottom: 78px; }
.ov3-panel.right { right: 16px; top: 86px; bottom: 78px; }

.ov3-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(34, 211, 238, 0.22);
  flex-shrink: 0;
}

.ov3-panel-head h3 {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  color: var(--ov-cyan);
  font-weight: 700;
}

.ov3-panel-body {
  padding: 12px 10px 16px 14px;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ov3-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ov3-kpi {
  position: relative;
  padding: 10px 10px 12px;
  background: linear-gradient(160deg, rgba(34, 211, 238, 0.12), rgba(8, 30, 55, 0.55));
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 4px;
  overflow: hidden;
}

.ov3-kpi::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ov-cyan), transparent);
  animation: ov3-pulse 2.4s ease-in-out infinite;
}

@keyframes ov3-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.ov3-kpi .label {
  font-size: 0.72rem;
  color: var(--ov-muted);
  letter-spacing: 0.06em;
}

.ov3-kpi .value {
  margin-top: 4px;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 0 14px rgba(34, 211, 238, 0.45);
}

.ov3-kpi.warn .value { color: #fbbf24; text-shadow: 0 0 14px rgba(245, 158, 11, 0.45); }
.ov3-kpi.danger .value { color: #fb7185; text-shadow: 0 0 14px rgba(244, 63, 94, 0.45); }
.ov3-kpi .hint { margin-top: 4px; font-size: 0.7rem; color: var(--ov-muted); }

.ov3-section-title {
  margin: 16px 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--ov-teal);
  font-weight: 700;
}

.ov3-bars { display: flex; flex-direction: column; gap: 8px; }

.ov3-bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 36px;
  gap: 8px;
  align-items: center;
  font-size: 0.76rem;
}

.ov3-bar-row .name { color: var(--ov-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov3-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.ov3-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0891b2, var(--ov-cyan));
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.55);
  transition: width 0.6s ease;
}
.ov3-bar-row:nth-child(2n) .ov3-bar-fill {
  background: linear-gradient(90deg, #7c3aed, var(--ov-magenta));
  box-shadow: 0 0 10px rgba(232, 121, 249, 0.45);
}
.ov3-bar-row:nth-child(3n) .ov3-bar-fill {
  background: linear-gradient(90deg, #b45309, var(--ov-amber));
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}
.ov3-bar-row .num { text-align: right; color: #fff; font-weight: 650; }

.ov3-alarm-list { display: flex; flex-direction: column; gap: 8px; max-height: 100%; }

.ov3-alarm {
  padding: 8px 10px;
  border-radius: 4px;
  background: rgba(8, 25, 48, 0.7);
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-left: 3px solid var(--ov-cyan);
  animation: ov3-fade-in 0.45s ease both;
}

.ov3-alarm.level-critical,
.ov3-alarm.level-high { border-left-color: #fb7185; }
.ov3-alarm.level-medium { border-left-color: var(--ov-amber); }

@keyframes ov3-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.ov3-alarm .top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 0.82rem;
  font-weight: 650;
}

.ov3-alarm .meta {
  font-size: 0.7rem;
  color: var(--ov-muted);
}

.ov3-alarm .msg {
  margin-top: 4px;
  font-size: 0.76rem;
  color: rgba(230, 244, 255, 0.9);
  line-height: 1.35;
}

.ov3-tag {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid currentColor;
  opacity: 0.9;
}

.ov3-center-stats {
  position: absolute;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 18px;
  pointer-events: none;
}

.ov3-ring-stat {
  min-width: 108px;
  text-align: center;
  padding: 8px 12px;
  background: rgba(6, 18, 36, 0.55);
  border: 1px solid rgba(34, 211, 238, 0.3);
  clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%);
}

.ov3-ring-stat .v {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ov-cyan);
}
.ov3-ring-stat .l {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--ov-muted);
}

.ov3-footer {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: min(72%, calc(100% - 40px));
  box-sizing: border-box;
  overflow: hidden;
}

.ov3-chip {
  border: 1px solid rgba(34, 211, 238, 0.55);
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.45), rgba(8, 30, 55, 0.75));
  color: var(--ov-ink);
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  cursor: pointer;
  clip-path: polygon(8% 0, 92% 0, 100% 50%, 92% 100%, 8% 100%, 0 50%);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.ov3-chip:hover {
  transform: translateY(-2px);
  border-color: var(--ov-cyan);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}

.ov3-labels {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  max-width: 100%;
}

.ov3-label {
  position: absolute;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 650;
  color: #ecfeff;
  background: rgba(6, 40, 55, 0.78);
  border: 1px solid rgba(52, 211, 153, 0.65);
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.35);
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.ov3-label .sub {
  display: block;
  margin-top: 2px;
  font-size: 0.64rem;
  font-weight: 500;
  color: rgba(186, 220, 240, 0.85);
  letter-spacing: 0.02em;
}
.ov3-label.warn {
  border-color: rgba(251, 191, 36, 0.85);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
}
.ov3-label.alarm {
  border-color: rgba(251, 113, 133, 0.95);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.55);
  animation: ov3-label-blink 1.2s ease-in-out infinite;
}
.ov3-label.selected {
  transform: translate(-50%, calc(-100% - 4px)) scale(1.06);
  border-color: #67e8f9;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.65);
}
@keyframes ov3-label-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.ov3-label::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 18px;
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.9), transparent);
}

.ov3-site-card {
  position: absolute;
  left: 50%;
  top: 86px;
  transform: translateX(-50%);
  z-index: 5;
  width: min(420px, calc(100% - 340px));
  max-width: 460px;
  padding: 12px 14px;
  background: rgba(6, 18, 36, 0.88);
  border: 1px solid rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 28px rgba(8, 145, 178, 0.25);
  backdrop-filter: blur(12px);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  display: none;
}
.ov3-site-card.show { display: block; animation: ov3-fade-in 0.25s ease; }
.ov3-site-card .hd {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.ov3-site-card .hd strong {
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: #67e8f9;
}
.ov3-site-card .hd .st {
  font-size: 0.72rem;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 3px;
}
.ov3-site-card .st.ok { color: #34d399; }
.ov3-site-card .st.warn { color: #fbbf24; }
.ov3-site-card .st.alarm { color: #fb7185; }
.ov3-site-card .st.idle { color: #94a3b8; }
.ov3-site-card .metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.ov3-site-card .metrics div {
  text-align: center;
  padding: 6px 4px;
  background: rgba(8, 30, 55, 0.65);
  border: 1px solid rgba(34, 211, 238, 0.18);
}
.ov3-site-card .metrics b {
  display: block;
  font-size: 1.05rem;
  color: #fff;
}
.ov3-site-card .metrics span {
  font-size: 0.65rem;
  color: var(--ov-muted, rgba(186, 220, 240, 0.72));
}
.ov3-site-card .hint {
  font-size: 0.74rem;
  color: rgba(186, 220, 240, 0.78);
  line-height: 1.4;
}
.ov3-site-card .acts {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ov3-alarm.dim { opacity: 0.28; filter: grayscale(0.4); }
.ov3-alarm.focus {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.25);
}
.ov3-canvas { cursor: grab; }
.ov3-canvas.is-picking { cursor: pointer; }
.ov3-canvas.is-dragging { cursor: grabbing; }

.ov3-empty {
  padding: 18px 8px;
  text-align: center;
  color: var(--ov-muted);
  font-size: 0.82rem;
}

.ov3-ha {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 4;
  font-size: 0.75rem;
  color: var(--ov-muted);
  pointer-events: none;
}

.ov3-ha strong { color: var(--ov-cyan); }

@media (max-width: 1100px) {
  .ov3-panel { width: min(240px, 34vw); }
  .ov3-center-stats { display: none; }
}

@media (max-width: 820px) {
  .app-shell.cockpit-mode {
    height: auto;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .ov3-panel.left,
  .ov3-panel.right {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: auto;
    margin: 8px;
    max-height: 320px;
  }
  .ov3-root {
    display: flex;
    flex-direction: column;
    min-height: auto;
    overflow-x: hidden;
  }
  .ov3-canvas {
    position: relative;
    height: 360px;
    flex-shrink: 0;
  }
  .ov3-header { position: relative; transform: none; left: auto; width: auto; margin: 10px; }
  .ov3-clock, .ov3-ha, .ov3-footer, .ov3-vignette, .ov3-scan, .ov3-labels { display: none; }
}
