/* 许峰声呐AI工作室 · 精密仪器与极简建筑美学（去霓虹、去渐变、零AI廉价感） */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-subtle: #f1f3f6;
  --surface-hover: #eaedf2;
  --border: #e2e6ec;
  --border-strong: #cfd6e0;
  --ink: #111827;
  --ink-secondary: #4b5563;
  --ink-muted: #6b7280;
  --primary: #111827;
  --primary-hover: #1f2937;
  --primary-fg: #ffffff;
  --brand-accent: #1d4ed8;
  --alert: #c8322b;
  --confirm: #15803d;
  --stage-bg: #0c0e12;
  --stage-bar: #14171d;
  --stage-border: rgba(255, 255, 255, 0.08);
  --stage-ink: #e5e7eb;
  --stage-muted: #9ca3af;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] {
  --bg: #111317;
  --surface: #181b20;
  --surface-subtle: #20242b;
  --surface-hover: #282d36;
  --border: #2a2f38;
  --border-strong: #39404d;
  --ink: #f1f3f5;
  --ink-secondary: #adb5bd;
  --ink-muted: #868e96;
  --primary: #f1f3f5;
  --primary-hover: #ffffff;
  --primary-fg: #111317;
  --brand-accent: #60a5fa;
  --alert: #e0524c;
  --confirm: #4ade80;
  --stage-bg: #090b0e;
  --stage-bar: #12151a;
  --stage-border: rgba(255, 255, 255, 0.07);
  --stage-ink: #e5e7eb;
  --stage-muted: #9ca3af;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 13px; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }
.ic { width: 14px; height: 14px; flex-shrink: 0; }
.ic-xs { width: 11px; height: 11px; flex-shrink: 0; }

/* 顶栏：干净利落的瑞士网格比例 */
.topbar {
  height: 60px; padding: 0 18px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: relative; z-index: 30;
}
.topbar-left, .topbar-center, .topbar-right {
  display: flex; align-items: center; gap: 10px;
}
.topbar-left { min-width: 0; }
.brand-logo {
  height: 30px; width: auto; display: block; object-fit: contain; flex-shrink: 0;
}
.v-divider { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.file-status {
  font-size: 12px; color: var(--ink-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px;
  font-variant-numeric: tabular-nums;
}

/* 按钮体系：克制、沉稳、无渐变无发光 */
.btn {
  border: 1px solid transparent; border-radius: 6px; padding: 7px 14px;
  font-size: 12.5px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.38; cursor: not-allowed; }
.btn-primary {
  background: var(--primary); color: var(--primary-fg); font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary {
  background: var(--surface); color: var(--ink);
  border-color: var(--border-strong); box-shadow: var(--shadow-sm);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-subtle); }
.btn-ghost {
  background: transparent; color: var(--ink-secondary); border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-subtle); color: var(--ink); }
.btn-stop {
  background: var(--alert); color: #ffffff; font-weight: 600;
}
.btn-icon {
  width: 32px; height: 32px; padding: 0;
  background: var(--surface); color: var(--ink-secondary); border-color: var(--border);
}
.btn-icon:hover { background: var(--surface-subtle); color: var(--ink); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }
.btn-lg { padding: 10px 18px; font-size: 13px; border-radius: 7px; }
.btn-row { display: flex; gap: 6px; }

/* 目标快选胶囊组：嵌入式仪器槽 + 高对比实心选中态（一眼辨识已选目标） */
.chip-group {
  display: flex; align-items: center; gap: 3px;
  background: var(--surface-subtle); padding: 3px;
  border: 1px solid var(--border-strong); border-radius: 8px;
}
.chip {
  background: transparent; color: var(--ink-secondary);
  border: 1px solid transparent; border-radius: 5px;
  padding: 5px 11px; font-size: 12px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  transition: background 0.12s, color 0.12s; white-space: nowrap;
}
.chip:hover:not(.active) { background: var(--surface-hover); color: var(--ink); }
.chip.active {
  background: var(--ink); color: var(--surface);
  font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
}
.chip.active::before {
  content: "✓"; font-size: 11px; font-weight: 700; line-height: 1;
}

.engine-badge {
  font-size: 11.5px; color: var(--ink-secondary);
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-subtle); border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.engine-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-muted);
}
.engine-badge.ready::before { background: var(--confirm); }
.engine-badge.warn::before { background: var(--alert); }

/* 弹出菜单 */
.dropdown-wrap { position: relative; }
.popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  min-width: 248px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 5px; box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 2px;
}
.popover-right { left: auto; right: 0; }
.popover-item {
  width: 100%; text-align: left; background: transparent; border: none;
  border-radius: 6px; padding: 8px 10px; cursor: pointer; color: var(--ink);
  display: flex; flex-direction: column; gap: 2px;
}
.popover-item:hover { background: var(--surface-subtle); }
.popover-item strong { font-size: 12.5px; font-weight: 600; }
.popover-item span { font-size: 11px; color: var(--ink-muted); }
.display-popover { padding: 12px; gap: 10px; min-width: 230px; color: var(--ink); }

/* 细扫描进度条 */
.progress-strip {
  height: 28px; background: var(--surface-subtle); border-bottom: 1px solid var(--border);
  position: relative; display: flex; align-items: center; padding: 0 18px;
}
.progress-strip-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: rgba(29, 78, 216, 0.12); transition: width 0.2s;
}
.progress-strip-text {
  position: relative; z-index: 2; font-size: 11.5px; font-weight: 500;
  color: var(--ink); font-variant-numeric: tabular-nums;
}

/* 主双栏布局 */
.studio-grid {
  height: calc(100vh - 60px);
  display: grid; grid-template-columns: 1fr 352px;
}
body.has-progress .studio-grid { height: calc(100vh - 88px); }

/* 声呐主画布：暗室取景器 */
.stage {
  display: flex; flex-direction: column; background: var(--stage-bg);
  overflow: hidden; position: relative;
}
.stage-bar {
  height: 40px; padding: 0 14px; background: var(--stage-bar);
  border-bottom: 1px solid var(--stage-border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: relative; z-index: 12;
}
.readout-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; color: var(--stage-muted); font-variant-numeric: tabular-nums;
}
.stage-actions { display: flex; align-items: center; gap: 8px; }
.tool-btn {
  background: rgba(255, 255, 255, 0.06); color: var(--stage-ink);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 5px;
  padding: 4px 10px; font-size: 11.5px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.tool-btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn-measure-active {
  background: #ffffff !important; color: #111827 !important; border-color: #ffffff !important; font-weight: 600;
}
.tool-btn-muted { color: #fca5a5; border-color: rgba(252, 165, 165, 0.35); }
.stage-legend {
  font-size: 11px; color: var(--stage-muted);
  padding-left: 8px; border-left: 1px solid var(--stage-border);
}

.canvas-container {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
#waterfallCanvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
#overlayCanvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.measure-labels-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.measure-badge {
  position: absolute; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(17, 24, 39, 0.94); color: #f9fafb;
  border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 5px;
  padding: 3px 6px 3px 8px; font-size: 11.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45); pointer-events: none;
}
.measure-badge.draft { border-style: dashed; }
.measure-badge .m-sub { font-weight: 400; font-size: 11px; color: #9ca3af; }
.measure-badge .m-del {
  pointer-events: auto; border: none; background: rgba(255, 255, 255, 0.12);
  color: #e5e7eb; border-radius: 3px; width: 17px; height: 17px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1; cursor: pointer; padding: 0;
}
.measure-badge .m-del:hover { background: var(--alert); color: #fff; }

/* 空状态：极简建筑留白（与白底/暗色 Logo 无缝融合，绝无白贴纸） */
.empty-state {
  position: absolute; inset: 0; z-index: 5;
  background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 36px;
}
.empty-logo { height: 48px; width: auto; display: block; margin-bottom: 20px; object-fit: contain; }
.empty-sub {
  margin: 0 0 26px; max-width: 460px; font-size: 13px; line-height: 1.7; color: var(--ink-secondary);
}
.empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* 底部时间轴 */
.timeline {
  height: 42px; padding: 0 14px; background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.timeline .readout-mono { color: var(--ink-muted); }
.scrubber-wrap { flex: 1; position: relative; height: 24px; display: flex; align-items: center; }
.scrubber-wrap input[type="range"] { width: 100%; position: relative; z-index: 2; accent-color: var(--ink); cursor: pointer; }
.timeline-health {
  position: absolute; left: 6px; right: 6px; bottom: 1px; height: 4px;
  border-radius: 2px; overflow: hidden; pointer-events: none; z-index: 1;
  background: rgba(148, 163, 184, 0.18);
}
.th-seg { position: absolute; top: 0; bottom: 0; }
.th-seg.overspeed { background: rgba(245, 158, 11, 0.85); }
.th-seg.sharpturn { background: rgba(239, 68, 68, 0.88); }
.timeline-markers { position: absolute; left: 6px; right: 6px; top: 0; bottom: 0; pointer-events: none; z-index: 3; }

/* 俯视 GPS 扫幅覆盖 + 沿航迹水深剖面停靠面板 */
.telemetry-dock {
  height: 228px; flex-shrink: 0;
  background: #0d1118; border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex; flex-direction: column;
}
.telemetry-dock-head {
  height: 32px; padding: 0 12px; background: #131822;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.telemetry-legend {
  display: flex; align-items: center; gap: 12px; font-size: 11px; color: #9ca3af;
}
.telemetry-legend span { display: inline-flex; align-items: center; gap: 5px; }
.leg-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.leg-swath { background: rgba(56, 189, 248, 0.65); }
.leg-speed { background: #f59e0b; }
.leg-turn { background: #ef4444; }
.telemetry-dock-body {
  flex: 1; min-height: 0; display: grid; grid-template-columns: 52% 48%;
}
.telemetry-pane {
  position: relative; min-height: 0; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.telemetry-pane:last-child { border-right: none; }
.telemetry-pane-title {
  position: absolute; top: 6px; left: 10px; z-index: 2; pointer-events: none;
  font-size: 10.5px; color: rgba(226, 232, 240, 0.72);
  background: rgba(13, 17, 24, 0.72); padding: 2px 6px; border-radius: 4px;
}
.telemetry-pane canvas { width: 100%; height: 100%; display: block; cursor: pointer; }
.tl-dot {
  position: absolute; top: 2px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--alert); border: 1.5px solid var(--surface);
  transform: translateX(-50%); pointer-events: auto; cursor: pointer;
}
.tl-dot.confirmed { background: var(--confirm); }
.tl-dot:hover { transform: translateX(-50%) scale(1.45); }

/* 右侧判图结果栏 */
.inspector {
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
}
.inspector-head {
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.inspector-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.inspector-meta { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }
.export-group { display: flex; gap: 4px; }

.tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border); padding: 0 12px; gap: 8px;
}
.tab-item {
  border: none; background: transparent; color: var(--ink-muted);
  padding: 10px 4px; font-size: 12.5px; font-weight: 500; cursor: pointer;
  border-bottom: 2px solid transparent; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tab-item.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.tab-num {
  font-size: 11px; padding: 1px 6px; border-radius: 999px;
  background: var(--surface-subtle); color: var(--ink-secondary);
}

.error-banner {
  margin: 10px 12px 0; padding: 8px 10px; border-radius: 6px; font-size: 11.5px; line-height: 1.45;
  background: rgba(200, 50, 43, 0.08); color: var(--alert); border: 1px solid rgba(200, 50, 43, 0.25);
  word-break: break-all; display: flex; flex-direction: column; gap: 7px;
}
.error-banner-actions { display: flex; align-items: center; gap: 6px; }
.btn-retry-failed {
  border: 1px solid rgba(200, 50, 43, 0.45); background: var(--surface); color: var(--alert);
  border-radius: 5px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.btn-retry-failed:hover:not(:disabled) { background: var(--alert); color: #fff; }
.btn-retry-failed:disabled { opacity: 0.45; cursor: not-allowed; }

.result-list {
  flex: 1; overflow-y: auto; padding: 10px 12px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.empty-note {
  color: var(--ink-muted); font-size: 12.5px; line-height: 1.7;
  padding: 36px 16px; text-align: center;
}

/* 精炼结果卡片 */
.intel-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px; cursor: pointer;
  display: grid; grid-template-columns: 64px 1fr; gap: 11px;
  transition: border-color 0.14s, background 0.14s;
}
.intel-card:hover { border-color: var(--border-strong); background: var(--surface-subtle); }
.intel-card.confirmed { border-left: 3px solid var(--confirm); }
.intel-card.rejected { opacity: 0.48; }
.intel-thumb {
  width: 64px; height: 64px; border-radius: 5px; object-fit: cover;
  background: #0c0e12; border: 1px solid var(--border);
}
.intel-card-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.intel-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.intel-label { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.risk-pill {
  font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 4px;
  background: var(--surface-subtle); color: var(--ink-secondary); border: 1px solid var(--border);
  flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.risk-high { color: var(--alert); border-color: rgba(200, 50, 43, 0.3); background: rgba(200, 50, 43, 0.06); }

.intel-gps-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--ink-secondary);
}
.btn-copy-gps {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-secondary);
  border-radius: 4px; padding: 2px 7px; font-size: 10.5px; font-weight: 500; cursor: pointer; flex-shrink: 0;
}
.btn-copy-gps:hover { color: var(--ink); border-color: var(--ink); }
.intel-summary {
  font-size: 11.5px; color: var(--ink-muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.intel-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10.5px; color: var(--ink-muted); font-variant-numeric: tabular-nums;
}

/* 设置抽屉 */
.drawer { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.35); }
.drawer-panel {
  position: relative; z-index: 2; width: min(380px, 92vw); height: 100%;
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; box-shadow: var(--shadow-md);
}
.drawer-head {
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 18px; }
.drawer-block { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.drawer-block:last-child { border-bottom: none; }
.block-title { font-size: 11.5px; font-weight: 600; color: var(--ink-muted); letter-spacing: 0.3px; }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--ink-secondary); }
.field-row { display: grid; grid-template-columns: 1fr 90px; gap: 8px; }
.field-row.single-col { grid-template-columns: 1fr; }
.field select, .field input[type="text"] {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 6px; padding: 7px 9px; font-size: 12.5px;
}
.field input[type="range"] { width: 100%; accent-color: var(--ink); }
.checkbox-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--ink); cursor: pointer; line-height: 1.45; }
.hint-text { font-size: 11.5px; color: var(--ink-muted); line-height: 1.5; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.meta-grid .lbl { display: block; font-size: 11px; color: var(--ink-muted); }
.meta-grid strong { font-size: 12px; color: var(--ink); word-break: break-all; }

/* 切片复核弹窗 */
.modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(3px); }
.modal-dialog {
  position: relative; z-index: 2; width: min(1060px, 94vw); max-height: 92vh;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-md);
}
.modal-head {
  padding: 13px 18px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.modal-body {
  padding: 16px; display: grid; grid-template-columns: 1fr 280px; gap: 16px; overflow-y: auto;
}
.modal-canvas-wrap {
  position: relative; background: #090b0e; border: 1px solid var(--border);
  border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: visible;
}
#modalCanvas { width: 100%; max-width: 680px; height: auto; display: block; border-radius: 5px; }
.modal-hover-tooltip {
  position: absolute; z-index: 20; width: 292px; pointer-events: none;
  background: rgba(17, 24, 39, 0.96); color: #f9fafb;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 8px; padding: 11px 13px;
  font-size: 12px; line-height: 1.55; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
.modal-hover-tooltip .tt-title { font-weight: 600; color: #ffffff; margin-bottom: 5px; font-size: 13px; }
.modal-hover-tooltip .tt-phys {
  margin: 7px 0; padding: 7px 9px; background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 5px; font-size: 11.5px;
}
.modal-hover-tooltip .tt-reason { font-size: 11.5px; color: #d1d5db; margin-top: 5px; }

.modal-side { display: flex; flex-direction: column; gap: 12px; }
.modal-details {
  background: var(--surface-subtle); border: 1px solid var(--border);
  border-radius: 7px; padding: 12px; font-size: 12px; line-height: 1.65; color: var(--ink);
}
.modal-actions { display: flex; flex-direction: column; gap: 7px; }
.modal-ab-box { padding-top: 10px; border-top: 1px solid var(--border); }

.toast {
  position: fixed; bottom: 54px; left: 50%; transform: translateX(-50%); z-index: 90;
  background: var(--ink); color: var(--surface);
  padding: 8px 16px; border-radius: 6px; font-size: 12px; font-weight: 500;
  box-shadow: var(--shadow-md);
}

/* 顶栏用户菜单与修改密码弹窗 */
.user-menu-btn { max-width: 148px; }
.user-menu-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popover-head {
  padding: 8px 10px 9px; border-bottom: 1px solid var(--border); margin-bottom: 3px;
  display: flex; flex-direction: column; gap: 2px;
}
.popover-head strong { font-size: 12.5px; color: var(--ink); }
.popover-head span { font-size: 11px; color: var(--ink-muted); }
.popover-danger strong { color: var(--alert); }

.pwd-modal-dialog { width: min(400px, 92vw); }
.pwd-form { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.pwd-form input[type="password"] {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 6px; padding: 8px 10px; font-size: 13px;
}
.pwd-alert {
  padding: 8px 10px; border-radius: 6px; font-size: 12px;
  background: rgba(200, 50, 43, 0.08); color: var(--alert); border: 1px solid rgba(200, 50, 43, 0.25);
}
.pwd-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* 多 XTF 文件联合航迹覆盖与盲区排查室 */
.mission-modal-dialog {
  width: min(1240px, 95vw);
  height: min(86vh, 840px);
  max-height: 92vh;
}
.mission-sub-note {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}
.mission-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 312px 1fr;
}
.mission-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.mission-kpi-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}
.mission-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mission-kpi-wide { grid-column: 1 / -1; }
.mission-kpi span { font-size: 11px; color: var(--ink-muted); }
.mission-kpi strong { font-size: 14px; font-weight: 600; color: var(--ink); }
.mission-side-bar {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}
.mission-track-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mission-track-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 9px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mission-track-item.muted { opacity: 0.48; }
.mt-head {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  min-width: 0;
}
.mt-head strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mt-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.mt-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.mt-del {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-muted);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10.5px;
  cursor: pointer;
}
.mt-del:hover { color: var(--alert); border-color: rgba(200, 50, 43, 0.45); }

.mission-canvas-wrap {
  position: relative;
  min-height: 0;
  background: #080c12;
  overflow: hidden;
}
#missionCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
#missionCanvas:active { cursor: grabbing; }
.mission-canvas-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mission-mode-group {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 2px;
}
.mission-mode-btn {
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.mission-mode-btn.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
}
.mission-canvas-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(8, 12, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  color: #cbd5e1;
  pointer-events: none;
}
.mission-canvas-legend span { display: inline-flex; align-items: center; gap: 5px; }

/* 多航次拼图大红点悬停情报浮窗 */
.mission-target-tooltip {
  position: absolute;
  z-index: 18;
  width: 320px;
  pointer-events: none;
  background: rgba(12, 16, 24, 0.96);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  align-items: start;
}
.mission-target-tooltip.no-thumb {
  grid-template-columns: 1fr;
}
.mtt-thumb {
  width: 74px;
  height: 74px;
  border-radius: 5px;
  object-fit: cover;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.mtt-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  line-height: 1.45;
}
.mtt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.mtt-head strong {
  font-size: 12.5px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mtt-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}
.mtt-badge.confirmed {
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.45);
}
.mtt-badge.corrob {
  background: rgba(250, 204, 21, 0.2);
  color: #fde047;
  border-color: rgba(250, 204, 21, 0.5);
}
.mtt-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}
.mtt-reason {
  font-size: 11px;
  color: #94a3b8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mtt-foot {
  font-size: 10.5px;
  color: #38bdf8;
  margin-top: 2px;
}

/* 3D 水下场景复盘弹窗 */
.scene3d-modal-dialog {
  width: min(1240px, 95vw);
  height: min(88vh, 860px);
  max-height: 92vh;
}
.s3d-mode-btn {
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.s3d-mode-btn.active {
  background: var(--ink);
  color: var(--surface);
  font-weight: 600;
}
.s3d-select {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}
.scene3d-controls {
  padding: 8px 16px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-secondary);
}
.s3d-ctrl-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.s3d-ctrl-item input[type="range"] { width: 96px; accent-color: var(--ink); }
.s3d-ctrl-item strong { color: var(--ink); min-width: 34px; }
.s3d-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--ink);
}
.s3d-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-muted);
}
.scene3d-canvas-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #090e16;
  overflow: hidden;
}
#scene3dCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
#scene3dCanvas:active { cursor: grabbing; }
.scene3d-hud-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.s3d-hud-tag {
  position: absolute;
  transform: translate(-50%, -100%);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  border: 1px solid rgba(255, 59, 48, 0.78);
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.s3d-hud-tag:hover,
.s3d-hud-tag.active {
  background: rgba(15, 23, 42, 0.98);
  border-color: #ffffff;
  transform: translate(-50%, -100%) scale(1.05);
  z-index: 6;
}
.s3d-hud-tag.confirmed { border-color: rgba(34, 197, 94, 0.85); }
.s3d-hud-tag span { font-size: 10px; color: #cbd5e1; font-variant-numeric: tabular-nums; }

.s3d-detail-card {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 15;
  width: 332px;
  background: rgba(11, 15, 23, 0.96);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  padding: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.s3d-dc-top {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  align-items: start;
}
.s3d-dc-top.no-thumb { grid-template-columns: 1fr; }
.s3d-dc-thumb {
  width: 82px;
  height: 82px;
  border-radius: 6px;
  object-fit: cover;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.s3d-dc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.s3d-dc-head strong { font-size: 13px; color: #ffffff; }
.s3d-dc-close {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.s3d-dc-close:hover { background: rgba(239, 68, 68, 0.75); color: #fff; }
.s3d-dc-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.45;
}
.s3d-dc-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}
.s3d-dc-reason {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.5;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.s3d-dc-actions {
  display: flex;
  gap: 8px;
}
.s3d-dc-actions button { flex: 1; }
.scene3d-target-bar {
  padding: 8px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  min-height: 40px;
}
.s3d-tip { font-size: 11.5px; color: var(--ink-muted); white-space: nowrap; }
.s3d-target-chip {
  border: 1px solid rgba(200, 50, 43, 0.35);
  background: rgba(200, 50, 43, 0.08);
  color: var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.s3d-target-chip.confirmed {
  border-color: rgba(21, 128, 61, 0.45);
  background: rgba(21, 128, 61, 0.1);
}
.s3d-target-chip.remote {
  opacity: 0.72;
  border-style: dashed;
}
.s3d-target-chip:hover { filter: brightness(0.92); opacity: 1; }

/* 正式搜救结案报告配置弹窗 */
.report-modal-dialog { width: min(700px, 94vw); }
.report-form {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}
.report-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.report-grid-3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; }
@media (max-width: 640px) {
  .report-grid-2, .report-grid-3 { grid-template-columns: 1fr; }
}
.report-form textarea {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 8px 10px; font-size: 12.5px; font-family: inherit; line-height: 1.55; resize: vertical;
}
.report-checks {
  display: flex; flex-direction: column; gap: 7px;
  padding: 10px 12px; border-radius: 7px;
  background: var(--surface-subtle); border: 1px solid var(--border);
}
.rep-tpl-row { display: flex; gap: 5px; flex-wrap: wrap; }

/* 工作台高亮清空按钮（警示红实心，高辨识度且不花哨） */
.btn-clear-alert {
  background: var(--alert);
  color: #ffffff;
  border-color: var(--alert);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(200, 50, 43, 0.28);
}
.btn-clear-alert:hover:not(:disabled) {
  background: #a8241e;
  border-color: #a8241e;
  color: #ffffff;
}

/* 设置抽屉：云端历史项目存档列表 */
.cloud-proj-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 240px;
  overflow-y: auto;
}
.cloud-proj-item {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--surface-subtle);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cloud-proj-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.cloud-proj-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cloud-proj-meta {
  font-size: 11px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.cloud-proj-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

/* 声呐视口暗室全屏模式：隐藏顶栏与右侧结果栏，保留工具栏/时间轴与弹窗层级 */
body.stage-fullscreen .topbar { display: none; }
body.stage-fullscreen .inspector { display: none; }
body.stage-fullscreen .studio-grid {
  height: 100vh;
  grid-template-columns: 1fr;
}
body.stage-fullscreen.has-progress .studio-grid {
  height: calc(100vh - 28px);
}
body.stage-fullscreen .timeline {
  background: var(--stage-bar);
  border-top-color: var(--stage-border);
}
body.stage-fullscreen .timeline .readout-mono {
  color: var(--stage-muted);
}
body.stage-fullscreen .scrubber-wrap input[type="range"] {
  accent-color: #e5e7eb;
}

/* 声呐视口地图与航迹缩略画中画浮窗（精密仪表风格，支持拖拽） */
.track-pip-float {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 15;
  width: 268px;
  background: rgba(11, 15, 23, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.52);
  overflow: hidden;
  backdrop-filter: blur(6px);
  user-select: none;
}
.track-pip-head {
  height: 28px;
  padding: 0 8px;
  background: rgba(20, 25, 36, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: move;
}
.track-pip-status {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.track-pip-status.warn-turn { color: #fca5a5; font-weight: 600; }
.track-pip-status.warn-speed { color: #fcd34d; font-weight: 600; }
.track-pip-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.track-pip-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10.5px;
  line-height: 1.4;
  cursor: pointer;
}
.track-pip-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}
.track-pip-body {
  position: relative;
  height: 174px;
  background: #090d14;
}
#trackPipCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}
.track-pip-hint {
  position: absolute;
  left: 7px;
  bottom: 6px;
  font-size: 10px;
  color: rgba(226, 232, 240, 0.72);
  background: rgba(9, 13, 20, 0.72);
  padding: 1px 5px;
  border-radius: 3px;
  pointer-events: none;
}
