:root {
  color-scheme: dark;
  --bg: #07111c;
  --panel: rgba(14, 31, 48, 0.82);
  --panel-solid: #0d2235;
  --text: #edf7ff;
  --muted: #8aa4b8;
  --line: rgba(137, 183, 214, 0.18);
  --blue: #4fb6ff;
  --cyan: #37e6ff;
  --green: #31d48b;
  --yellow: #ffcc66;
  --red: #ff6b7a;
  --shadow: rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #081a2a 0%, #06101a 56%, #03080f 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  width: min(1360px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 28px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
}

.title-block {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 16px;
  line-height: 1.2;
}

.header-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 25, 40, 0.72);
  color: #d7ecfb;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.nav-link:hover {
  border-color: rgba(79, 182, 255, 0.42);
  color: #ffffff;
}

.nav-link.active {
  border-color: rgba(79, 182, 255, 0.58);
  color: #ffffff;
  background: rgba(16, 78, 135, 0.78);
}

.logout-button {
  cursor: pointer;
}

.logout-button:hover {
  border-color: rgba(255, 107, 122, 0.46);
  color: #ffb7bf;
}


.battery-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 25, 40, 0.72);
  box-shadow: 0 8px 18px var(--shadow);
}

.battery-chip {
  min-width: 86px;
  padding: 8px 11px;
}

.battery-chip strong,
.status-pill strong {
  display: block;
  font-size: 14px;
  line-height: 1;
}

.battery-shell {
  position: relative;
  width: 28px;
  height: 14px;
  border: 1px solid rgba(217, 240, 255, 0.75);
  border-radius: 3px;
  padding: 2px;
}

.battery-shell::after {
  content: "";
  position: absolute;
  top: 4px;
  right: -4px;
  width: 3px;
  height: 6px;
  border-radius: 0 2px 2px 0;
  background: rgba(217, 240, 255, 0.75);
}

#battery-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  transition: width 180ms ease;
}

.status-pill {
  min-width: 94px;
  padding: 9px 13px;
  color: var(--muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(138, 164, 184, 0.12);
}

.status-pill.online {
  color: #caffea;
  border-color: rgba(49, 212, 139, 0.36);
}

.status-pill.online .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(49, 212, 139, 0.14);
}

.status-pill.offline {
  color: #ffd4d9;
  border-color: rgba(255, 107, 122, 0.32);
}

.status-pill.offline .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 107, 122, 0.14);
}

.status-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 18px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 19, 31, 0.66);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.tab-button {
  appearance: none;
  min-width: 0;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #a7bfd1;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.tab-button:hover {
  border-color: rgba(79, 182, 255, 0.35);
  color: var(--text);
}

.tab-button.active {
  color: #ffffff;
  border-color: rgba(88, 209, 255, 0.6);
  background: #145d9f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.robot-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.38fr) minmax(620px, 1.72fr) minmax(200px, 0.42fr);
  gap: 16px;
  align-items: stretch;
}

.metric-panel,
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px var(--shadow);
  contain: paint;
}

.metric-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 640px;
  padding: 20px;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.hero-metric {
  display: block;
  margin-top: 10px;
  font-size: 46px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.metric-panel small {
  display: block;
  min-height: 22px;
  margin-top: 12px;
  color: #afc3d1;
  overflow-wrap: anywhere;
}

.meter-track {
  position: relative;
  height: 8px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(107, 142, 169, 0.2);
}

.meter-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--blue));
  transition: width 180ms ease;
}

.identity-panel {
  gap: 0;
  justify-content: center;
}

.identity-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.55fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(137, 183, 214, 0.14);
}

.identity-row:last-child {
  border-bottom: 0;
}

.identity-row span {
  color: var(--muted);
  font-size: 13px;
}

.identity-row strong {
  display: block;
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-align: right;
}

.robot-stage {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  border: 1px solid rgba(69, 155, 219, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(9, 32, 51, 0.96), rgba(6, 18, 29, 0.96));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
  contain: paint;
}

.stage-grid {
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(105, 177, 230, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 177, 230, 0.09) 1px, transparent 1px);
  background-size: 34px 34px;
}

.signal-rings {
  position: absolute;
  inset: 8% 18% 8%;
  pointer-events: none;
}

.signal-rings span {
  position: absolute;
  inset: calc(var(--i, 0) * 8%);
  border: 1px solid rgba(79, 182, 255, 0.16);
  border-radius: 999px;
}

.signal-rings span:nth-child(1) {
  --i: 0;
}

.signal-rings span:nth-child(2) {
  --i: 1;
}

.signal-rings span:nth-child(3) {
  --i: 2;
}

.robot-figure {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(42%, 360px);
  height: min(94%, 610px);
  object-fit: contain;
  object-position: center bottom;
  transform: translate(-50%, -50%);
  display: block;
  filter:
    drop-shadow(0 18px 24px rgba(0, 0, 0, 0.3))
    drop-shadow(0 0 16px rgba(55, 230, 255, 0.16))
    drop-shadow(0 0 36px rgba(55, 230, 255, 0.1));
  pointer-events: none;
  user-select: none;
}

.callout-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.callout {
  position: absolute;
  display: contents;
}

.callout svg {
  position: absolute;
  overflow: visible;
  pointer-events: none;
}

.callout line {
  stroke: rgba(74, 214, 255, 0.62);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.callout i {
  position: absolute;
  z-index: 2;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(55, 230, 255, 0.13);
  transform: translate(-50%, -50%);
}

.callout div {
  position: absolute;
  z-index: 3;
  display: grid;
  min-width: 74px;
  min-height: 44px;
  padding: 7px 10px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(106, 195, 255, 0.44);
  border-radius: 8px;
  background: rgba(5, 16, 27, 0.78);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
  text-align: center;
}

.callout span {
  min-width: 0;
  color: #9fb6c8;
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.callout strong {
  display: block;
  margin-top: 3px;
  color: #e9fbff;
  font-size: 17px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.callout.warn {
  color: var(--yellow);
}

.callout.warn div {
  border-color: rgba(255, 204, 102, 0.54);
}

.callout.warn line {
  stroke: rgba(255, 204, 102, 0.62);
}

.callout.warn i,
.warn {
  color: var(--yellow);
  background: var(--yellow);
}

.callout.critical {
  color: var(--red);
}

.callout.critical div {
  border-color: rgba(255, 107, 122, 0.62);
}

.callout.critical line {
  stroke: rgba(255, 107, 122, 0.7);
}

.callout.critical i,
.critical {
  color: var(--red);
  background: var(--red);
}

.callout.unknown {
  color: var(--muted);
}

.callout.unknown div {
  border-color: rgba(138, 164, 184, 0.28);
}

.callout.unknown line {
  stroke: rgba(138, 164, 184, 0.35);
}

.callout.unknown i {
  background: #6c8192;
  box-shadow: none;
}

.ok {
  color: var(--green);
}

.stale {
  color: var(--yellow);
}

.not_found,
.unknown {
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.72fr) minmax(300px, 0.78fr);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  padding: 16px;
}

.camera-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.camera-shell {
  width: min(1360px, calc(100vw - 32px));
}

.camera-page-layout,
.photo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.38fr);
  gap: 16px;
  margin-top: 18px;
  align-items: start;
}

.camera-view-panel,
.camera-info-panel,
.photo-view-panel,
.photo-list-panel {
  min-height: 0;
}

.photo-shell {
  width: min(1360px, calc(100vw - 32px));
}

.map-shell {
  width: min(1360px, calc(100vw - 32px));
}

.config-shell {
  width: min(1360px, calc(100vw - 32px));
}

.photo-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
}

.config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
  gap: 16px;
  align-items: start;
  margin-top: 18px;
}

.config-panel,
.config-info-panel {
  min-height: 0;
}

.config-form {
  display: grid;
  gap: 14px;
}

.field-row,
.toggle-row {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(137, 183, 214, 0.13);
}

.field-row {
  grid-template-columns: minmax(110px, 0.35fr) minmax(120px, 1fr) 46px;
}

.toggle-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.field-row span,
.toggle-row span {
  min-width: 0;
  color: #a8bfd1;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.field-row small {
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.field-row input[type="number"] {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(137, 183, 214, 0.22);
  border-radius: 8px;
  outline: none;
  background: rgba(3, 12, 21, 0.72);
  color: var(--text);
  font-weight: 800;
}

.field-row input[type="number"]:focus {
  border-color: rgba(55, 230, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(55, 230, 255, 0.1);
}

.toggle-row input[type="checkbox"] {
  appearance: none;
  position: relative;
  width: 48px;
  height: 28px;
  border: 1px solid rgba(137, 183, 214, 0.28);
  border-radius: 999px;
  background: rgba(3, 12, 21, 0.72);
  cursor: pointer;
}

.toggle-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #8aa4b8;
  transition: transform 160ms ease, background 160ms ease;
}

.toggle-row input[type="checkbox"]:checked {
  border-color: rgba(49, 212, 139, 0.45);
  background: rgba(49, 212, 139, 0.18);
}

.toggle-row input[type="checkbox"]:checked::after {
  transform: translateX(20px);
  background: var(--green);
}

.config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.34fr);
  gap: 16px;
  align-items: start;
  margin-top: 18px;
}

.map-view-panel,
.map-info-panel {
  min-height: 0;
}

.map-frame {
  position: relative;
  width: 100%;
  min-height: 720px;
  overflow: hidden;
  border: 1px solid rgba(137, 183, 214, 0.16);
  border-radius: 8px;
  background: #02070d;
}

.map-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 720px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.map-summary {
  margin-bottom: 14px;
}

.map-point-list {
  display: grid;
  gap: 8px;
  max-height: 64vh;
  overflow: auto;
  padding-right: 4px;
}

.map-point-item {
  appearance: none;
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid rgba(137, 183, 214, 0.14);
  border-radius: 8px;
  background: rgba(6, 17, 28, 0.6);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.map-point-item:hover,
.map-point-item.active {
  border-color: rgba(255, 204, 102, 0.5);
  background: rgba(82, 65, 24, 0.52);
}

.map-point-item strong,
.map-point-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.map-point-item strong {
  font-size: 14px;
}

.map-point-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.photo-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(137, 183, 214, 0.16);
  border-radius: 8px;
  background: #02070d;
}

.photo-frame img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
}

.photo-list {
  display: grid;
  gap: 8px;
  max-height: 74vh;
  overflow: auto;
  padding-right: 4px;
}

.photo-item {
  appearance: none;
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(137, 183, 214, 0.14);
  border-radius: 8px;
  background: rgba(6, 17, 28, 0.6);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.photo-item:hover,
.photo-item.active {
  border-color: rgba(55, 230, 255, 0.42);
  background: rgba(20, 93, 159, 0.34);
}

.photo-item strong,
.photo-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.photo-item strong {
  font-size: 14px;
}

.photo-item span {
  color: var(--muted);
  font-size: 12px;
}

.camera-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid rgba(137, 183, 214, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(6, 19, 31, 0.95), rgba(2, 7, 12, 0.98));
}

.camera-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #02070d;
}

.large-camera-frame {
  min-height: 520px;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
}


/* 画面模式控制条面板容器 - 精美的毛玻璃与浮光微描边效果 */
.camera-mode-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 10px 16px;
  border: 1px solid rgba(137, 183, 214, 0.15);
  border-radius: 8px;
  background: rgba(10, 26, 42, 0.55);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 6px 18px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.camera-mode-control .control-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* 选项卡按钮容器 */
.camera-mode-control .mode-tabs {
  display: flex;
  gap: 6px;
  padding: 3px;
  border: 1px solid rgba(137, 183, 214, 0.1);
  border-radius: 7px;
  background: rgba(6, 17, 28, 0.65);
}

/* 选项卡按钮样式 - 平滑高光悬停 */
.camera-mode-control .mode-tab {
  appearance: none;
  min-height: 30px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #a2b9ca;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.camera-mode-control .mode-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

/* 激活选项卡 - 高端青蓝色发光渐变 */
.camera-mode-control .mode-tab.active {
  color: #ffffff;
  border-color: rgba(55, 230, 255, 0.32);
  background: linear-gradient(135deg, #104e87 0%, #165b99 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 8px rgba(55, 230, 255, 0.22);
}

.camera-toolbar {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.primary-button,
.secondary-button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  color: #ffffff;
  font-weight: 800;
  line-height: 1.2;
}

.primary-button {
  background: #145d9f;
  border-color: rgba(88, 209, 255, 0.5);
}

.secondary-button {
  background: rgba(10, 25, 40, 0.72);
  border-color: var(--line);
  color: #d7ecfb;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.camera-info-panel .data-row {
  grid-template-columns: minmax(68px, 0.42fr) minmax(0, 1fr);
}

.camera-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.camera-meta span,
.camera-meta strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.camera-meta strong {
  color: #c9dcea;
  font-weight: 700;
  text-align: right;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.data-list,
.topic-list {
  display: grid;
  gap: 0;
}

.data-row,
.topic-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 39px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(137, 183, 214, 0.13);
}

.data-row:last-child,
.topic-row:last-child {
  border-bottom: 0;
}

.data-row span,
.topic-row span {
  min-width: 0;
  color: #a8bfd1;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.data-row strong,
.topic-row strong {
  display: block;
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-align: right;
}

.data-row strong.ok,
.topic-row strong.ok {
  color: var(--green);
}

.data-row strong.warn,
.topic-row strong.stale {
  color: var(--yellow);
}

.data-row strong.critical {
  color: var(--red);
}

.error-panel {
  margin-top: 16px;
  border-color: rgba(255, 107, 122, 0.34);
}

pre {
  margin: 0;
  white-space: pre-wrap;
  color: #ffd1d6;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 1080px) {
  .robot-layout,
  .detail-grid,
  .camera-page-layout,
  .map-layout,
  .config-layout {
    grid-template-columns: 1fr;
  }

  .metric-panel {
    min-height: auto;
  }

  .identity-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
  }

  .robot-stage {
    min-height: 620px;
  }

  .map-frame,
  .map-frame canvas {
    min-height: 620px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 20px, 680px);
    padding-top: 16px;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-status {
    width: 100%;
    justify-content: flex-start;
  }

  .status-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .robot-stage {
    min-height: 560px;
  }

  .robot-figure {
    width: min(52%, 330px);
    height: min(91%, 520px);
  }

  .callout {
    min-width: 66px;
    min-height: 42px;
    padding: 7px 8px;
  }

  .callout strong {
    font-size: 15px;
  }

  .identity-panel {
    grid-template-columns: 1fr;
  }

  .hero-metric {
    font-size: 38px;
  }

  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .large-camera-frame {
    min-height: 320px;
  }

  .map-frame,
  .map-frame canvas {
    min-height: 520px;
  }

  .camera-toolbar {
    flex-direction: column;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .field-row small {
    text-align: left;
  }
}

@media (max-width: 460px) {
  .robot-stage {
    min-height: 470px;
  }

  .callout {
    min-width: 58px;
    padding: 6px 7px;
  }

  .callout span {
    font-size: 11px;
  }

  .callout strong {
    font-size: 14px;
  }

  .map-frame,
  .map-frame canvas {
    min-height: 420px;
  }
}

/* ===== 地图页 P1+P2 工具栏 + 徽章 ===== */
.map-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(79, 182, 255, 0.15);
  border-radius: 8px;
}

.map-toolbar label {
  font-size: 13px;
  color: rgba(220, 230, 240, 0.7);
  margin-right: 4px;
}

.map-toolbar select {
  flex: 1 1 200px;
  min-width: 160px;
  padding: 6px 10px;
  background: rgba(2, 7, 13, 0.7);
  color: #eaffff;
  border: 1px solid rgba(79, 182, 255, 0.3);
  border-radius: 6px;
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 999px;
  background: rgba(120, 130, 140, 0.25);
  color: rgba(220, 230, 240, 0.9);
  border: 1px solid rgba(120, 130, 140, 0.4);
}

.badge.active {
  background: rgba(255, 165, 0, 0.18);
  color: #ffcc66;
  border-color: rgba(255, 165, 0, 0.5);
}

#deployed-badge {
  background: rgba(49, 212, 139, 0.18);
  color: #31d48b;
  border-color: rgba(49, 212, 139, 0.5);
}

/* ===== 地图页 P3+P4+P5 操作区 ===== */
.map-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.danger-button {
  background: rgba(255, 70, 90, 0.15);
  color: #ff5a6b;
  border: 1px solid rgba(255, 70, 90, 0.5);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}
.danger-button:hover {
  background: rgba(255, 70, 90, 0.25);
}
.danger-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.danger-text {
  color: #ff8095 !important;
  border-color: rgba(255, 128, 149, 0.4) !important;
}

.point-action-area {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(255, 204, 102, 0.06);
  border: 1px solid rgba(255, 204, 102, 0.2);
  border-radius: 8px;
}
.point-action-area h4 {
  margin: 0 0 8px 0;
  color: #ffcc66;
  font-size: 14px;
}

.patrol-control {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(79, 182, 255, 0.15);
}
.patrol-control h4 {
  margin: 0 0 8px 0;
  color: rgba(220, 230, 240, 0.85);
  font-size: 14px;
}

.input-group label {
  display: block;
  font-size: 13px;
  color: rgba(220, 230, 240, 0.7);
  margin-bottom: 4px;
}
.input-group input[type="text"] {
  width: 100%;
  padding: 6px 10px;
  background: rgba(2, 7, 13, 0.7);
  color: #eaffff;
  border: 1px solid rgba(79, 182, 255, 0.3);
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}
.input-with-btn {
  display: flex;
  gap: 6px;
}
.input-with-btn input {
  flex: 1;
}

.divider {
  height: 1px;
  background: rgba(79, 182, 255, 0.15);
  margin: 10px 0;
}

.panel-desc {
  margin: 8px 0 0 0;
  font-size: 12px;
  color: rgba(220, 230, 240, 0.55);
  line-height: 1.5;
}

/* ===== P7 建图覆盖层 ===== */
.mapping-overlay {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(2, 7, 13, 0.95), rgba(2, 7, 13, 0.75));
  border-top: 2px solid rgba(255, 165, 0, 0.5);
  padding: 12px 24px;
  z-index: 30;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}
.mapping-overlay-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
}
.mapping-overlay-bar strong {
  color: #ffcc66;
  font-size: 16px;
}
.mapping-info {
  font-size: 13px;
  color: rgba(220, 230, 240, 0.7);
}
.mapping-overlay-bar .spacer {
  flex: 1;
}
