:root {
  --bg-0: #07110f;
  --bg-1: #0b1a16;
  --panel-bg: rgba(12, 32, 27, 0.78);
  --panel-border: rgba(66, 243, 181, 0.32);
  --text-main: #e0f3ea;
  --text-dim: #94b9a7;
  --accent-cyan: #69f0ae;
  --accent-green: #42f3b5;
  --accent-amber: #ffb547;
  --danger: #ff5f6d;
  --ok: #63ffad;
  --warn: #ffd966;
  --mono: "Consolas", "Cascadia Code", "JetBrains Mono", monospace;
  --ui: "Bahnschrift", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --unified-lower-panel-height: 430px;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 20% 10%, #0f2e1c 0%, #06150d 40%, #020a06 100%);
  color: var(--text-main);
  font-family: var(--ui);
  zoom: 1.15;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(32, 148, 80, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 148, 80, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: -1;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(60, 170, 110, 0.35);
  background: linear-gradient(90deg, rgba(5, 18, 10, 0.95), rgba(6, 22, 14, 0.9));
  backdrop-filter: blur(8px);
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 280px;
}
.brand-logos {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand-logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
}
.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-main {
  color: #edf8ff;
  font-size: 26px;
  letter-spacing: 1.2px;
  font-weight: 700;
  line-height: 1.2;
}
.brand-main .brand-en {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.6px;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #b7e4c8;
  border: 1px solid rgba(70, 136, 196, 0.35);
  background: rgba(6, 26, 14, 0.62);
  border-radius: 20px;
  padding: 6px 10px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot.ok {
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}

.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 8px var(--warn);
}

.system-state-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-left: 8px;
  font-size: 11px;
}

.state-item {
  color: #8ec4a8;
  opacity: 0.85;
  white-space: nowrap;
}

.state-value.status-ok { color: var(--ok); }
.state-value.status-warn { color: var(--warn); }
.state-value.status-bad { color: #ff5f6d; }

.dot-sep {
  color: rgba(70, 136, 196, 0.35);
  margin: 0 2px;
}

.segmented {
  display: inline-flex;
  border-radius: 8px;
  padding: 3px;
  border: 1px solid rgba(55, 170, 110, 0.35);
  background: rgba(5, 18, 10, 0.9);
}

.segmented button {
  border: none;
  color: #8ec4a8;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  white-space: nowrap;
}

.segmented button.active {
  color: #e8f8ff;
  background: linear-gradient(135deg, rgba(27, 143, 85, 0.85), rgba(18, 120, 75, 0.85));
  box-shadow: 0 0 12px rgba(50, 180, 110, 0.4);
}

.segmented.small button {
  padding: 5px 8px;
  font-size: 11px;
}

.page {
  display: none;
  height: calc(100% - 74px);
  padding: 12px;
  gap: 12px;
}

.page.active {
  display: grid;
}

#overview-page {
  grid-template-columns: minmax(260px, 300px) minmax(680px, 1fr) minmax(270px, 320px);
  min-height: 0;
}

#center-column {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
}

.stack-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#left-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

#left-column > .panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.panel {
  min-height: 0;
  min-width: 0;
  background: linear-gradient(160deg, rgba(8, 24, 16, 0.88), rgba(6, 18, 12, 0.82));
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: inset 0 0 30px rgba(40, 90, 150, 0.18);
  padding: 12px;
}

.panel-title {
  color: #d8edff;
  font-size: 14px;
  letter-spacing: 1px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(70, 140, 199, 0.25);
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#metrics-panel {
  overflow: hidden;
}

#metrics-panel .metric-grid {
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  grid-auto-rows: minmax(0, 1fr);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 3px;
}

.metric-card {
  border: 1px solid rgba(60, 165, 110, 0.28);
  background: linear-gradient(160deg, rgba(8, 34, 59, 0.6), rgba(8, 18, 34, 0.9));
  border-radius: 10px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 6px;
  align-items: end;
}

.metric-label {
  grid-column: 1;
  grid-row: 1;
  font-size: 11px;
  color: #9eb9d2;
}

.metric-value {
  grid-column: 1 / span 2;
  grid-row: 2;
  margin-top: 0;
  font-size: 24px;
  color: #63e4ff;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.6px;
  line-height: 1.08;
}

.metric-unit {
  grid-column: 2;
  grid-row: 1;
  margin-top: 0;
  font-size: 11px;
  color: #6f90ac;
  text-align: right;
  white-space: nowrap;
}

.protocol-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 250px;
  overflow: auto;
  padding-right: 4px;
}

#protocol-panel .protocol-list {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
}

.protocol-row {
  display: grid;
  grid-template-columns: 76px 1fr 48px;
  align-items: center;
  gap: 8px;
}

.protocol-name {
  color: #afdec6;
  font-size: 12px;
}

.protocol-bar {
  height: 8px;
  border-radius: 6px;
  background: rgba(40, 130, 85, 0.35);
  overflow: hidden;
}

.protocol-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}

.protocol-pct {
  text-align: right;
  color: #83f2c9;
  font-family: var(--mono);
  font-size: 11px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(71, 132, 189, 0.25);
  border-radius: 10px;
  max-height: 100%;
}

.table-wrap.compact {
  max-height: 210px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 7px 8px;
  white-space: nowrap;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(9, 29, 50, 0.95);
  color: #c7d9eb;
  border-bottom: 1px solid rgba(75, 144, 198, 0.35);
  text-align: left;
}

tbody tr {
  border-bottom: 1px solid rgba(64, 112, 160, 0.22);
  cursor: pointer;
}

tbody tr:hover {
  background: rgba(34, 76, 118, 0.25);
}

tbody tr.active {
  background: rgba(50, 120, 178, 0.28);
}

#scene-panel {
  min-height: 0;
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(92, 200, 255, 0.42);
  box-shadow: inset 0 0 40px rgba(45, 110, 180, 0.18), 0 0 18px rgba(16, 50, 90, 0.28);
}

.scene-feature-row {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.feature-nav-btn {
  --feature-accent: #69f0ae;
  min-width: 0;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--feature-accent) 58%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--feature-accent) 13%, transparent), transparent 58%),
    linear-gradient(160deg, rgba(11, 35, 60, 0.88), rgba(7, 20, 37, 0.94));
  color: #e3f3ff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.22;
  padding: 10px 14px;
  cursor: pointer;
  letter-spacing: 0;
  text-align: center;
  box-shadow:
    0 6px 18px rgba(3, 12, 24, 0.22),
    inset 0 0 18px color-mix(in srgb, var(--feature-accent) 18%, transparent);
}

.feature-nav-btn:hover {
  border-color: color-mix(in srgb, var(--feature-accent) 78%, white 6%);
  filter: brightness(1.08);
}

.scene-feature-row-top .feature-nav-btn:nth-child(1) {
  --feature-accent: #65cfff;
}

.scene-feature-row-top .feature-nav-btn:nth-child(2) {
  --feature-accent: #69d4bb;
}

.scene-feature-row-top .feature-nav-btn:nth-child(3) {
  --feature-accent: #88c9ee;
}

.scene-feature-row-top .feature-nav-btn:nth-child(4) {
  --feature-accent: #8edbaf;
}

.scene-feature-row-top .feature-nav-btn:nth-child(5) {
  --feature-accent: #a9caff;
}

.scene-feature-row-bottom .feature-nav-btn:nth-child(1) {
  --feature-accent: #77d9c5;
}

.scene-feature-row-bottom .feature-nav-btn:nth-child(2) {
  --feature-accent: #86cbff;
}

.scene-feature-row-bottom .feature-nav-btn:nth-child(4) {
  --feature-accent: #7ed7a3;
}

.scene-feature-row-bottom .feature-nav-btn:nth-child(5) {
  --feature-accent: #b2c9f0;
}

.feature-nav-btn.heatmap-toggle {
  --feature-accent: #e6b96f;
  border-color: color-mix(in srgb, var(--feature-accent) 58%, transparent);
  color: #ffe2b3;
}

.feature-nav-btn.heatmap-toggle.active,
.feature-nav-btn.heatmap-toggle[aria-pressed="true"] {
  color: #fff7ea;
  border-color: rgba(255, 133, 93, 0.9);
  background: linear-gradient(160deg, rgba(142, 50, 38, 0.92), rgba(96, 45, 28, 0.92));
  box-shadow:
    0 0 16px rgba(255, 119, 89, 0.32),
    inset 0 0 16px rgba(255, 187, 109, 0.16);
}

.scene-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 9;
  display: inline-flex;
  gap: 8px;
}

#scene-panel:fullscreen {
  background: #040913;
}

#scene-panel:fullscreen .scene-actions {
  top: 14px;
  right: 14px;
}

#three-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#zone-label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.zone-label {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 88px;
  text-align: center;
  font-size: 11px;
  color: #e8f6ff;
  border: 1px solid rgba(81, 159, 215, 0.55);
  background: rgba(7, 18, 34, 0.82);
  border-radius: 4px;
  padding: 3px 6px;
}

.zone-label strong {
  font-family: var(--mono);
  color: var(--accent-green);
}

.building-label {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 92px;
  max-width: 220px;
  text-align: center;
  color: #f3fbff;
  border: 1px solid rgba(145, 216, 255, 0.76);
  background: linear-gradient(180deg, rgba(11, 36, 58, 0.9), rgba(7, 20, 36, 0.9));
  border-radius: 12px;
  padding: 6px 12px 7px;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(92, 201, 255, 0.35);
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.building-label:hover {
  transform: translate(-50%, -50%) translateY(-2px);
  border-color: rgba(127, 255, 199, 0.95);
  box-shadow:
    0 0 18px rgba(100, 238, 191, 0.48),
    inset 0 0 12px rgba(49, 153, 119, 0.22);
}

.building-label-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
}

.building-label-name::after {
  content: " \2192";
  color: #83f2c9;
  font-weight: 700;
}

.building-label-traffic {
  display: none;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.12;
  font-family: var(--mono);
  letter-spacing: 0;
  color: #95e7ff;
  text-shadow: 0 0 6px rgba(71, 194, 252, 0.45);
}

.building-label.has-traffic {
  border-color: rgba(117, 221, 255, 0.9);
  box-shadow:
    0 0 14px rgba(92, 201, 255, 0.42),
    inset 0 0 10px rgba(44, 118, 168, 0.22);
}

.building-label.trend-up .building-label-traffic {
  color: #7af0bb;
  text-shadow: 0 0 8px rgba(80, 244, 176, 0.44);
}

.building-label.trend-down .building-label-traffic {
  color: #ffc2b2;
  text-shadow: 0 0 8px rgba(255, 147, 124, 0.44);
}

.building-label.trend-flat .building-label-traffic {
  color: #9ed8ff;
  text-shadow: 0 0 7px rgba(88, 186, 255, 0.4);
}

.road-debug-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 10px;
  line-height: 1;
  color: #dff7ff;
  border: 1px solid rgba(125, 218, 255, 0.9);
  background: rgba(7, 25, 44, 0.88);
  border-radius: 4px;
  padding: 2px 4px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 0 10px rgba(86, 200, 255, 0.28);
}

.road-debug-label.is-suspicious {
  color: #ffe7ea;
  border-color: rgba(255, 108, 128, 0.95);
  background: rgba(70, 13, 20, 0.9);
  box-shadow: 0 0 10px rgba(255, 92, 117, 0.4);
}

.scene-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 11px;
  color: #8bb2d4;
  background: rgba(6, 14, 26, 0.7);
  border: 1px solid rgba(69, 138, 193, 0.35);
  padding: 5px 8px;
  border-radius: 6px;
}

#lower-grid {
  display: none;
  grid-template-columns: minmax(280px, 1.15fr) minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 12px;
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

#lower-grid > .panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#lower-grid .list-block {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
}

#lower-grid .geo-list {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
}

#right-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

#right-column > .panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#hot-building-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#forensics-snapshot-panel {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#threat-share-main-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#threat-share-main-panel .alert-feed {
  flex: 1 1 auto;
  max-height: none;
  min-height: 120px;
}

#geo-domestic-side-panel {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.forensics-list {
  margin-top: 4px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 4px;
}

.building-detail-page {
  overflow: hidden;
}

#building-detail-app {
  height: 100%;
}

.detail-back-link {
  text-decoration: none;
}

.building-detail-layout {
  height: calc(100% - 74px);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(280px, 0.88fr) minmax(430px, 1.3fr) minmax(310px, 0.95fr);
  grid-template-rows: minmax(188px, 0.48fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.detail-profile-panel {
  grid-column: 1 / 5;
  min-height: 0;
  overflow: hidden;
}

.detail-profile-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.detail-meta {
  color: #8ec4b0;
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.detail-category-panel,
.detail-device-panel,
.detail-record-panel,
.detail-snapshot-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-bar-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.detail-bar-row {
  border: 1px solid rgba(77, 145, 203, 0.22);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(8, 34, 59, 0.48), rgba(8, 18, 34, 0.76));
  padding: 9px;
}

.detail-bar-head,
.detail-bar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-bar-head span {
  color: #d7ecff;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-bar-head strong {
  color: #83f2c9;
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.detail-bar-track {
  height: 9px;
  border-radius: 999px;
  margin: 8px 0 6px;
  background: rgba(40, 130, 85, 0.35);
  overflow: hidden;
}

.detail-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #40e3a4, #69f0ae);
  box-shadow: 0 0 10px rgba(75, 230, 182, 0.34);
}

.detail-bar-foot {
  color: #86c4a0;
  font-size: 11px;
  line-height: 1.45;
}

.detail-record-table {
  flex: 1 1 auto;
  min-height: 0;
}

.detail-record-table table {
  min-width: 780px;
}

.detail-snapshot-empty {
  color: #86c4a0;
  border: 1px dashed rgba(78, 175, 125, 0.35);
  border-radius: 8px;
  padding: 14px;
}

.detail-snapshot {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.snapshot-photo {
  position: relative;
  min-height: 190px;
  border: 1px solid color-mix(in srgb, var(--snapshot-tone) 68%, white 0%);
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 30%, color-mix(in srgb, var(--snapshot-tone) 60%, transparent), transparent 26%),
    radial-gradient(circle at 70% 65%, rgba(255, 255, 255, 0.14), transparent 20%),
    linear-gradient(145deg, rgba(9, 23, 38, 0.94), rgba(6, 14, 26, 0.96));
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.24);
}

.snapshot-photo-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(150, 230, 190, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 230, 190, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.8;
}

.snapshot-photo-mark {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 1;
  color: #f0fff9;
  font-size: 24px;
  font-weight: 700;
  text-shadow: 0 0 14px color-mix(in srgb, var(--snapshot-tone) 70%, transparent);
}

.snapshot-title {
  color: #e6f5ff;
  font-size: 15px;
  font-weight: 700;
}

.snapshot-sub,
.snapshot-note {
  color: #8ec4b0;
  font-size: 12px;
  line-height: 1.55;
}

.snapshot-kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(70, 140, 199, 0.22);
}

.snapshot-kv span {
  color: #8ec4b0;
}

.snapshot-kv strong {
  color: #d9fff1;
  font-family: var(--mono);
  text-align: right;
}

.forensics-item {
  border: 1px solid rgba(77, 141, 195, 0.32);
  border-radius: 8px;
  padding: 7px 8px;
  background: rgba(10, 28, 47, 0.66);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.forensics-main {
  font-size: 11px;
  color: #d9ecff;
}

.forensics-sub {
  font-size: 11px;
  color: #9ddec0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.forensics-sub .mono {
  color: #86d9ff;
}

#geo-domestic-side-panel .geo-map-wrap {
  height: 220px;
}

#geo-domestic-side-panel .geo-list {
  flex: 1 1 auto;
  max-height: none;
  min-height: 96px;
}

.list-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding-right: 4px;
}

.list-block.compact-height {
  max-height: 126px;
}

.list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(65, 130, 183, 0.26);
  border-radius: 8px;
  background: rgba(10, 28, 47, 0.68);
  padding: 8px;
  cursor: pointer;
}

.list-item:hover {
  border-color: rgba(88, 171, 230, 0.66);
}

.list-item.active {
  border-color: rgba(64, 205, 255, 0.88);
  box-shadow: 0 0 14px rgba(43, 182, 255, 0.2);
}

.item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-title {
  font-size: 12px;
  color: #d3e7f9;
}

.item-sub {
  font-size: 11px;
  color: #8fb2cf;
}

.item-value {
  font-size: 16px;
  font-family: var(--mono);
  font-weight: 700;
  color: #79e6ff;
}

.threat-share {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
}

.donut-block {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 8px;
  row-gap: 5px;
  align-items: center;
}

.donut-title {
  grid-column: 1 / -1;
  color: #a9dec5;
  font-size: 11px;
}

.status-donut {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: conic-gradient(#1a9e5e 0deg, #1a9e5e 360deg);
  position: relative;
}

.status-donut::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(6, 12, 23, 0.95);
  border: 1px solid rgba(68, 130, 178, 0.4);
}

#threat-total,
#device-health-total {
  position: relative;
  z-index: 1;
  font-size: 15px;
  font-family: var(--mono);
  color: #eefff4;
}

.legend-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-list.compact {
  gap: 3px;
}

.legend-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 7px;
  align-items: center;
  font-size: 11px;
}

.legend-list.compact .legend-item {
  font-size: 10px;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 5px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.alert-feed {
  margin-top: 8px;
  max-height: 200px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alert-item {
  border: 1px solid rgba(196, 71, 88, 0.44);
  background: rgba(70, 15, 25, 0.42);
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 14px;
  color: #ffc2c8;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 7px;
  align-items: center;
}

.alert-item .severity {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.alert-item.is-empty {
  border-color: rgba(80, 150, 197, 0.28);
  background: rgba(10, 28, 47, 0.48);
  color: #9fdec0;
}

#threat-map-canvas {
  width: 100%;
  height: 220px;
  border-radius: 10px;
  border: 1px solid rgba(55, 150, 100, 0.28);
  background: linear-gradient(160deg, rgba(5, 18, 10, 0.95), rgba(3, 10, 6, 0.95));
}

#threat-map-canvas-domestic {
  width: 100%;
  height: 220px;
  border-radius: 10px;
  border: 1px solid rgba(55, 150, 100, 0.28);
  background: linear-gradient(160deg, rgba(5, 18, 10, 0.95), rgba(3, 10, 6, 0.95));
}

.geo-map-wrap {
  position: relative;
  width: 100%;
  height: 220px;
}

.geo-map-wrap.full {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.geo-map-chart {
  display: block;
  width: 100%;
  height: 220px;
}

.geo-list {
  margin-top: 8px;
  max-height: 84px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

.geo-item {
  font-size: 11px;
  color: #a8dec4;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
}

.geo-item button {
  padding: 4px 7px;
  font-size: 11px;
}

.geo-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.geo-modal-head .geo-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.geo-actions .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.geo-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(2, 7, 15, 0.92);
  backdrop-filter: blur(4px);
  display: none;
  flex-direction: column;
  padding: 12px;
}

.geo-modal.open {
  display: flex;
}

.geo-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(77, 145, 203, 0.3);
  border-radius: 10px;
  background: rgba(9, 22, 38, 0.86);
}

.geo-modal-title {
  font-size: 16px;
  color: #dff2ff;
  letter-spacing: 1px;
}

.geo-modal-body {
  margin-top: 12px;
  min-height: 0;
  flex: 1;
  display: block;
}

.geo-map-chart-full {
  display: block;
  width: 100%;
  min-height: 0;
  height: 100%;
  border-radius: 12px;
  border: 1px solid rgba(82, 152, 206, 0.35);
  background: linear-gradient(160deg, rgba(5, 18, 10, 0.95), rgba(3, 10, 6, 0.95));
}

.geo-hover-card {
  position: absolute;
  min-width: 230px;
  max-width: 310px;
  z-index: 6;
  border: 1px solid rgba(133, 196, 238, 0.48);
  border-radius: 10px;
  background: rgba(5, 16, 31, 0.95);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
  padding: 9px;
  color: #d8fee8;
  font-size: 12px;
  display: none;
  pointer-events: none;
}

.geo-hover-card.open {
  display: block;
}

.geo-hover-card.full {
  min-width: 270px;
  max-width: 360px;
}

.geo-hover-card.full .geo-hover-amap,
.geo-hover-card.full .geo-hover-map-fallback {
  height: 160px;
}

.geo-hover-title {
  font-size: 13px;
  font-weight: 700;
  color: #eef8ff;
}

.geo-hover-sub {
  margin-top: 3px;
  color: #98bfdc;
  font-size: 11px;
}

.geo-hover-map {
  margin-top: 8px;
}

.geo-hover-amap {
  width: 100%;
  height: 130px;
  border-radius: 8px;
  border: 1px solid rgba(90, 195, 140, 0.35);
  overflow: hidden;
  background: rgba(8, 22, 14, 0.85);
}

.geo-hover-map-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 130px;
  border-radius: 8px;
  border: 1px solid rgba(90, 195, 140, 0.35);
  background: rgba(8, 22, 14, 0.85);
  color: #95d8bb;
  font-size: 11px;
}

.geo-hover-addr {
  margin-top: 6px;
  color: #bbe2fb;
  line-height: 1.4;
}

.geo-hover-ip {
  margin-top: 4px;
  color: #8ec7ff;
  font-family: var(--mono);
}

.geo-point-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(2, 8, 18, 0.88);
  backdrop-filter: blur(6px);
  display: none;
  padding: 20px;
}

.geo-point-modal.open {
  display: block;
}

.geo-point-shell {
  width: min(1320px, 96vw);
  height: min(860px, 95vh);
  margin: 0 auto;
  border: 1px solid rgba(80, 185, 135, 0.36);
  border-radius: 12px;
  background: linear-gradient(170deg, rgba(8, 22, 38, 0.95), rgba(5, 16, 10, 0.95));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.geo-point-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(80, 148, 204, 0.35);
}

.geo-point-title {
  font-size: 18px;
  color: #e3f4ff;
  letter-spacing: 0.8px;
}

.geo-point-index {
  min-width: 74px;
  text-align: center;
  font-size: 12px;
  color: #9fcaea;
  border: 1px solid rgba(91, 156, 210, 0.34);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(9, 27, 45, 0.72);
}

.geo-point-body {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(380px, 460px);
  gap: 14px;
  padding: 14px;
}

.geo-point-map-panel {
  border: 1px solid rgba(83, 150, 204, 0.35);
  border-radius: 10px;
  background: rgba(7, 16, 30, 0.88);
  padding: 8px;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.geo-point-amap {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.geo-point-amap-status {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  max-width: calc(100% - 28px);
  border: 1px solid rgba(112, 182, 231, 0.58);
  border-radius: 999px;
  background: rgba(7, 23, 41, 0.86);
  color: #d6ffef;
  font-size: 11px;
  line-height: 1.3;
  padding: 5px 10px;
  display: none;
}

.geo-point-amap-status.error {
  border-color: rgba(255, 144, 150, 0.76);
  color: #ffd4d7;
}

.geo-point-rich-detail {
  border: 1px solid rgba(83, 149, 204, 0.36);
  border-radius: 10px;
  background: rgba(7, 18, 32, 0.9);
  padding: 12px;
  overflow: auto;
  font-size: 12px;
  color: #c8e3f9;
  line-height: 1.55;
}

.geo-rich-title {
  font-size: 14px;
  color: #e6f4ff;
  margin-bottom: 8px;
  font-weight: 700;
}

.geo-rich-line {
  margin-top: 4px;
}

.geo-rich-tag {
  display: inline-block;
  margin-right: 6px;
  margin-bottom: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(118, 187, 232, 0.36);
  background: rgba(21, 56, 89, 0.45);
  color: #d8ffee;
  font-size: 11px;
}

.geo-rich-table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 11px;
}

.geo-rich-table th,
.geo-rich-table td {
  border-bottom: 1px solid rgba(72, 129, 178, 0.34);
  padding: 5px 4px;
  text-align: left;
}

.geo-rich-table th {
  color: #93bfdf;
  font-weight: 600;
}

.geo-rich-table td {
  color: #d8ebfb;
}

.state-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.state-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #abc4dd;
  border-bottom: 1px solid rgba(70, 130, 180, 0.16);
  padding-bottom: 6px;
}

.state-item strong {
  color: #e9f6ff;
  font-family: var(--mono);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.state-item strong::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(145, 226, 180, 0.65);
  box-shadow: 0 0 8px rgba(145, 226, 180, 0.42);
}

.state-item strong.status-ok {
  color: #74ffbd;
}

.state-item strong.status-ok::before {
  background: #74ffbd;
  box-shadow: 0 0 10px rgba(116, 255, 189, 0.88);
}

.state-item strong.status-warn {
  color: #ffd687;
}

.state-item strong.status-warn::before {
  background: #ffd687;
  box-shadow: 0 0 10px rgba(255, 214, 135, 0.85);
}

.state-item strong.status-bad {
  color: #ff8d96;
}

.state-item strong.status-bad::before {
  background: #ff8d96;
  box-shadow: 0 0 10px rgba(255, 141, 150, 0.85);
}

.state-item strong.status-neutral::before {
  background: rgba(145, 226, 180, 0.65);
  box-shadow: 0 0 8px rgba(145, 226, 180, 0.42);
}

.note-list {
  font-size: 12px;
  color: #9eb7d1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.45;
}

#search-page {
  grid-template-columns: 1fr;
}

#operations-page {
  grid-template-columns: 1fr;
}

#feature-page {
  grid-template-columns: 1fr;
}

.feature-layout {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.feature-hero-panel {
  overflow: hidden;
}

.feature-hero-panel .panel-title {
  margin-bottom: 4px;
  padding-bottom: 0;
  border-bottom: none;
}

.feature-subtitle {
  color: #91b6d4;
  font-size: 12px;
  line-height: 1.45;
}

.feature-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.feature-summary-card {
  border: 1px solid rgba(60, 165, 110, 0.28);
  background: rgba(10, 29, 49, 0.68);
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
}

.feature-summary-label {
  color: #9fd7bd;
  font-size: 12px;
}

.feature-summary-value {
  margin-top: 5px;
  color: #78e7ff;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.feature-main-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.feature-view {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.feature-table {
  min-width: 860px;
}

.feature-report {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1fr);
  gap: 12px;
}

.feature-report-card {
  border: 1px solid rgba(60, 165, 110, 0.28);
  border-radius: 8px;
  padding: 12px;
  background: rgba(8, 21, 38, 0.72);
}

.feature-report-title {
  color: #dff1ff;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-report-text {
  color: #a9c7e1;
  font-size: 12px;
  line-height: 1.65;
}

.device-action-btn {
  padding: 5px 8px;
  font-size: 11px;
}

.power-curve {
  display: block;
  width: 150px;
  height: 42px;
}

.power-curve text {
  fill: #8ec4b0;
  font-size: 8px;
  font-family: var(--mono);
}

.search-layout {
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(560px, 1fr) minmax(280px, 330px);
  gap: 12px;
  min-height: 0;
}

.ops-layout {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(520px, 1fr) minmax(300px, 360px);
  gap: 12px;
  min-height: 0;
}

.compact-row {
  margin-top: 0;
  align-items: center;
}

.ops-device-table {
  margin-top: 12px;
  max-height: 460px;
  overflow: auto;
}

.ops-message-list {
  min-height: 520px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ops-message-item {
  border: 1px solid rgba(72, 132, 181, 0.28);
  border-radius: 8px;
  padding: 9px;
  background: rgba(8, 21, 38, 0.74);
  font-size: 12px;
  color: #c3f5d5;
}

.ops-message-meta {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  color: #8fb3d2;
  margin-bottom: 6px;
  font-size: 15px;
}

.ops-message-payload {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "SFMono-Regular", monospace;
  color: #d9f0ff;
}

.ops-command-textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  background: rgba(5, 16, 10, 0.9);
  border: 1px solid rgba(55, 155, 100, 0.35);
  border-radius: 8px;
  padding: 10px;
  color: #d7fae8;
  font-size: 12px;
  line-height: 1.45;
}

.ops-result-box {
  min-height: 180px;
  margin-top: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: #acc8e1;
}

.form-grid label.full {
  grid-column: 1 / -1;
}

input,
select {
  width: 100%;
  background: rgba(5, 16, 10, 0.9);
  border: 1px solid rgba(55, 155, 100, 0.35);
  border-radius: 7px;
  padding: 8px;
  color: #d7fae8;
  font-size: 12px;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(67, 197, 249, 0.85);
  box-shadow: 0 0 0 2px rgba(67, 197, 249, 0.2);
}

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid rgba(65, 170, 115, 0.45);
  background: rgba(10, 35, 22, 0.82);
  color: #d0e7fc;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 12px;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(145deg, rgba(16, 120, 72, 0.9), rgba(20, 135, 85, 0.9));
  border-color: rgba(75, 255, 160, 0.7);
}

.btn.ghost {
  border-color: rgba(111, 172, 220, 0.2);
  color: #8bcba8;
}

.btn:hover {
  filter: brightness(1.1);
}

.result-meta {
  font-size: 12px;
  color: #9fdec0;
}

.pagination {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.detail-box {
  min-height: 250px;
  max-height: 360px;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid rgba(55, 155, 100, 0.3);
  padding: 10px;
  background: rgba(8, 21, 38, 0.82);
  color: #c3f5d5;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.flow-snapshot-box {
  white-space: normal;
  max-height: none;
}

.flow-snapshot-box .snapshot-photo.compact {
  min-height: 150px;
}

.mono {
  font-family: var(--mono);
}

.tag-danger {
  color: #ff7f8b;
}

.tag-safe {
  color: #6cefb8;
}

@media (max-width: 1650px) {
  #overview-page {
    grid-template-columns: minmax(250px, 285px) minmax(620px, 1fr) minmax(250px, 295px);
  }
}

@media (max-width: 1360px) {
  .brand-main {
    font-size: 20px;
  }

  #center-column {
    display: grid;
    grid-template-rows: auto minmax(450px, 58vh) auto;
  }

  #left-column {
    display: flex;
    flex-direction: column;
    min-height: auto;
  }

  #right-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  #lower-grid {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  #overview-page {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  #geo-domestic-side-panel {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  #scene-panel {
    min-height: 450px;
  }

  .feature-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-report {
    grid-template-columns: 1fr;
  }

  .building-detail-page {
    overflow: auto;
  }

  .building-detail-layout {
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    overflow: visible;
  }

  .detail-profile-panel {
    grid-column: auto;
  }

  .detail-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-category-panel,
  .detail-device-panel,
  .detail-record-panel,
  .detail-snapshot-panel {
    min-height: 260px;
  }

  .search-layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }
}

@media (max-width: 860px) {
  html,
  body {
    overflow: auto;
  }

  .topbar {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
  }

  .top-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .page {
    height: auto;
    min-height: calc(100% - 74px);
    padding: 8px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .scene-feature-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-summary-grid {
    grid-template-columns: 1fr;
  }

  .detail-profile-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .geo-map-wrap.full {
    min-height: 360px;
  }

  .geo-point-modal {
    padding: 10px;
  }

  .geo-point-shell {
    width: 100%;
    height: 95vh;
  }

  .geo-point-body {
    grid-template-columns: 1fr;
  }

  .geo-point-map-panel {
    min-height: 260px;
  }
}

body.day-mode {
  background: radial-gradient(circle at 20% 8%, #f2f8ff 0%, #dbeafb 42%, #c3d8ef 100%);
  color: #19324e;
}

body.day-mode::before {
  background-image:
    linear-gradient(rgba(90, 160, 120, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 160, 120, 0.14) 1px, transparent 1px);
}

body.day-mode .topbar {
  border-bottom: 1px solid rgba(80, 160, 115, 0.4);
  background: linear-gradient(90deg, rgba(239, 246, 255, 0.96), rgba(223, 237, 251, 0.94));
}

body.day-mode .brand-main {
  color: #16395e;
}

body.day-mode .brand-sub {
  color: #4d6f92;
}

body.day-mode .status-chip {
  color: #325679;
  border: 1px solid rgba(111, 149, 190, 0.42);
  background: rgba(237, 246, 255, 0.84);
}

body.day-mode .segmented {
  border: 1px solid rgba(115, 156, 199, 0.48);
  background: rgba(236, 245, 254, 0.94);
}

body.day-mode .segmented button {
  color: #436388;
}

body.day-mode .segmented button.active {
  color: #f5fbff;
  background: linear-gradient(135deg, rgba(54, 124, 196, 0.9), rgba(34, 151, 201, 0.86));
  box-shadow: 0 0 10px rgba(58, 139, 208, 0.36);
}

body.day-mode .panel {
  background: linear-gradient(160deg, rgba(242, 248, 255, 0.9), rgba(225, 237, 250, 0.88));
  border: 1px solid rgba(108, 150, 193, 0.45);
  box-shadow: inset 0 0 24px rgba(120, 161, 198, 0.1);
}

body.day-mode .panel-title {
  color: #1a3b60;
  border-bottom: 1px solid rgba(114, 154, 195, 0.38);
}

body.day-mode .metric-card {
  border: 1px solid rgba(117, 158, 198, 0.34);
  background: linear-gradient(160deg, rgba(235, 245, 254, 0.88), rgba(224, 237, 249, 0.94));
}

body.day-mode .metric-label {
  color: #4a6e92;
}

body.day-mode .metric-value {
  color: #0d7ac0;
}

body.day-mode .metric-unit {
  color: #5a7e9f;
}

body.day-mode .protocol-name,
body.day-mode .protocol-pct,
body.day-mode .list-item,
body.day-mode .forensics-main,
body.day-mode .forensics-sub,
body.day-mode .legend-item,
body.day-mode .alert-item,
body.day-mode .state-item,
body.day-mode .result-meta,
body.day-mode .detail-box,
body.day-mode .geo-item,
body.day-mode .geo-point-index {
  color: #36587b;
}

body.day-mode .state-item strong {
  color: #1b476f;
}

body.day-mode thead th {
  background: rgba(220, 234, 248, 0.96);
  color: #2d5177;
  border-bottom: 1px solid rgba(112, 153, 195, 0.42);
}

body.day-mode tbody tr {
  border-bottom: 1px solid rgba(121, 159, 196, 0.3);
}

body.day-mode tbody tr:hover {
  background: rgba(160, 194, 226, 0.28);
}

body.day-mode .btn {
  border: 1px solid rgba(113, 155, 197, 0.42);
  background: linear-gradient(160deg, rgba(240, 248, 255, 0.92), rgba(228, 240, 252, 0.92));
  color: #2a4e74;
}

body.day-mode .btn.ghost {
  background: rgba(230, 242, 253, 0.82);
}

body.day-mode .feature-nav-btn {
  border-color: color-mix(in srgb, var(--feature-accent) 48%, rgba(108, 151, 194, 0.5));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--feature-accent) 14%, transparent), transparent 62%),
    linear-gradient(160deg, rgba(238, 247, 255, 0.92), rgba(224, 238, 251, 0.94));
  color: #244a70;
  box-shadow:
    0 6px 18px rgba(73, 105, 132, 0.14),
    inset 0 0 14px color-mix(in srgb, var(--feature-accent) 13%, transparent);
}

body.day-mode .feature-nav-btn.heatmap-toggle {
  border-color: color-mix(in srgb, var(--feature-accent) 52%, rgba(211, 139, 57, 0.45));
  color: #7d4c17;
}

body.day-mode .feature-nav-btn.heatmap-toggle.active,
body.day-mode .feature-nav-btn.heatmap-toggle[aria-pressed="true"] {
  color: #fff7ed;
  border-color: rgba(219, 104, 63, 0.86);
  background: linear-gradient(160deg, rgba(189, 76, 50, 0.9), rgba(142, 68, 35, 0.88));
}

body.day-mode .feature-summary-card,
body.day-mode .feature-report-card {
  border-color: rgba(115, 156, 199, 0.38);
  background: rgba(232, 243, 254, 0.82);
}

body.day-mode .feature-subtitle,
body.day-mode .feature-summary-label,
body.day-mode .feature-report-text {
  color: #4c6f91;
}

body.day-mode .feature-summary-value,
body.day-mode .feature-report-title {
  color: #146fa8;
}

body.day-mode .scene-hint {
  color: #305577;
  border: 1px solid rgba(115, 155, 195, 0.36);
  background: rgba(232, 244, 255, 0.82);
}

body.day-mode .building-label {
  color: #f8fcff;
  border-color: rgba(111, 170, 214, 0.72);
  background: linear-gradient(180deg, rgba(61, 116, 166, 0.9), rgba(43, 89, 134, 0.88));
  box-shadow: 0 0 10px rgba(78, 178, 130, 0.34);
}

body.day-mode .building-label.has-traffic {
  border-color: rgba(128, 196, 244, 0.86);
  box-shadow:
    0 0 12px rgba(105, 180, 235, 0.36),
    inset 0 0 9px rgba(157, 208, 247, 0.2);
}

body.day-mode .building-label-traffic {
  color: #dbf2ff;
  text-shadow: 0 0 4px rgba(219, 242, 255, 0.3);
}


/* 时间显示统一放大 */
#clock {
  font-size: 16px;
  font-weight: 600;
  font-family: var(--mono);
}

/* ===== 月度低碳报告 UI ===== */
.monthly-report-ui {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.report-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.report-control-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.report-control-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
}
.report-control-group input,
.report-control-group select {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  color: var(--text-main);
  padding: 4px 8px;
  font-size: 13px;
  height: 32px;
}
.report-history-panel {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel-bg);
  padding: 12px 14px;
  max-height: 280px;
  overflow: auto;
}
.report-history-panel h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--accent-cyan);
}
.report-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.report-list-item {
  padding: 10px 12px;
  border: 1px solid rgba(66,243,181,0.12);
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background 0.15s;
}
.report-list-item:hover,
.report-list-item.active {
  background: rgba(56,217,150,0.08);
  border-color: rgba(56,217,150,0.35);
}
.report-list-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}
.report-list-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
}
.report-viewer {
  min-height: 320px;
}
.report-viewer iframe {
  display: block;
}
body.day-mode .report-history-panel {
  background: rgba(232,243,254,0.82);
  border-color: rgba(115,156,199,0.38);
}
body.day-mode .report-list-item {
  background: rgba(255,255,255,0.5);
  border-color: rgba(115,156,199,0.25);
}
body.day-mode .report-list-item:hover,
body.day-mode .report-list-item.active {
  background: rgba(56,217,150,0.12);
  border-color: rgba(56,217,150,0.4);
}

/* === RAG 智能助手 === */
@keyframes rag-wiggle {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(-3deg); }
  30% { transform: rotate(3deg); }
  45% { transform: rotate(-2deg); }
  60% { transform: rotate(2deg); }
}
@keyframes rag-pulse {
  0% { transform: scale(0.95); opacity: 0.9; }
  70% { transform: scale(1.12); opacity: 0; }
  100% { transform: scale(1.15); opacity: 0; }
}
.rag-btn {
  position: relative;
  color: #ffffff;
  background: linear-gradient(135deg, #2d6a4f 0%, #3aa374 45%, #2d6a4f 100%);
  border: none;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 22px rgba(35, 140, 80, 0.32);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.rag-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 28px rgba(35, 140, 80, 0.38);
}
.rag-btn::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 2px solid rgba(58, 163, 116, 0.35);
  opacity: 0;
}
.rag-btn.attn::before {
  animation: rag-pulse 1.8s ease-out 2;
  opacity: 1;
}
.rag-btn.attn {
  animation: rag-wiggle 0.9s ease both;
}
.rag-btn::after {
  content: "✨";
  position: absolute;
  top: -8px;
  right: -10px;
  font-size: 14px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
  animation: rag-orbit 3.8s ease-in-out infinite;
  opacity: 0.9;
}
@keyframes rag-orbit {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(2px, -2px); }
  50% { transform: translate(0, -3px); }
  75% { transform: translate(-2px, -2px); }
}

/* RAG 对话面板 */
.rag-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.rag-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.rag-chat-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 720px;
  height: 82vh;
  max-height: 720px;
  background: linear-gradient(160deg, rgba(11, 22, 38, 0.98), rgba(8, 18, 32, 0.97));
  border: 1px solid rgba(66, 243, 181, 0.28);
  border-radius: 14px;
  backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55);
}
.rag-chat-panel.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.rag-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(80, 148, 210, 0.25);
  background: linear-gradient(90deg, rgba(6, 26, 16, 0.9), rgba(8, 36, 20, 0.85));
}
.rag-chat-header h3 {
  margin: 0;
  font-size: 15px;
  color: #e8f8ff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rag-chat-header .rag-status {
  font-size: 11px;
  color: #94b9a7;
  margin-top: 2px;
}
.rag-chat-close {
  background: transparent;
  border: none;
  color: #8bcba8;
  font-size: 20px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rag-chat-close:hover {
  background: rgba(255,255,255,0.08);
  color: #e0f3ea;
}
.rag-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rag-chat-msg {
  max-width: 92%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.75;
  word-break: break-word;
}
.rag-chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(35,104,175,0.85), rgba(21,142,193,0.85));
  color: #e8f8ff;
  border-bottom-right-radius: 2px;
}
.rag-chat-msg.assistant {
  align-self: flex-start;
  background: rgba(10, 35, 22, 0.82);
  border: 1px solid rgba(83, 150, 205, 0.3);
  color: #e0f3ea;
  border-bottom-left-radius: 2px;
}
.rag-chat-msg.assistant h4 {
  margin: 8px 0 4px;
  font-size: 13px;
  color: #ffb547;
}
.rag-chat-msg.assistant ul {
  margin: 4px 0;
  padding-left: 16px;
}
.rag-chat-msg.assistant li {
  margin: 2px 0;
}
.rag-chat-msg.assistant strong {
  color: #42f3b5;
}
.rag-chat-msg.assistant code {
  background: rgba(0,0,0,0.25);
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 12px;
}
.rag-chat-msg.system {
  align-self: center;
  font-size: 11px;
  color: #94b9a7;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(148,185,167,0.1);
  padding: 6px 10px;
}
.rag-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(80, 148, 210, 0.2);
  background: rgba(9, 20, 36, 0.7);
}
.rag-chat-input {
  flex: 1;
  background: rgba(10, 35, 22, 0.72);
  border: 1px solid rgba(65, 170, 115, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  color: #e0f3ea;
  font-size: 15px;
  resize: none;
  outline: none;
  font-family: var(--ui);
}
.rag-chat-input::placeholder {
  color: #5a7a8a;
}
.rag-chat-input:focus {
  border-color: rgba(66, 243, 181, 0.5);
}
.rag-chat-send {
  background: linear-gradient(135deg, #2d6a4f, #3aa374);
  border: none;
  border-radius: 8px;
  color: #fff;
  padding: 0 14px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}
.rag-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.rag-typing {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
}
.rag-typing span {
  width: 6px;
  height: 6px;
  background: #42f3b5;
  border-radius: 50%;
  animation: rag-typing-bounce 1.2s infinite ease-in-out;
}
.rag-typing span:nth-child(2) { animation-delay: 0.15s; }
.rag-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes rag-typing-bounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

@media (max-width: 780px) {
  .rag-chat-panel { width: 92vw; height: 86vh; }
}
@media (max-width: 520px) {
  .rag-chat-panel { width: 96vw; height: 90vh; border-radius: 10px; }
  .brand-logo-img { height: 32px; }
}
