/* ==========================================================================
   悠獭连锁 全门店智能中控大屏 CSS (高端深邃石墨黑 · 阶梯灰与克制互补色设计系统)
   ========================================================================== */

:root {
  /* 1. 基础深邃底色层级 (Deep Obsidian & Titanium Slate) */
  --bg: #07090e;              /* 主画布背景：深邃曜石底 */
  --bg-alt: #0a0e17;          /* 辅助背景 */
  --panel: #0d121f;           /* 一级面板：沉稳石墨蓝黑 */
  --panel-alt: #12192b;       /* 二级卡片：磨砂石墨 */
  --panel-raised: #172138;    /* 三级控件/输入框 */
  --panel-hover: #1c2844;     /* 悬浮高亮 */

  /* 2. 极其细腻的半透极简中性边框 (微晶磨砂边界，杜绝粗糙刺眼的蓝框) */
  --border: rgba(148, 163, 184, 0.08);
  --border-light: rgba(148, 163, 184, 0.14);
  --border-focus: rgba(56, 189, 248, 0.35);

  /* 3. 核心单重点主色 (冰晶天青 Ice Cyan - 极度克制，不刺眼) */
  --primary: #38bdf8;
  --primary-hover: #7dd3fc;
  --primary-dark: #0284c7;
  --primary-bg: rgba(56, 189, 248, 0.08);
  --primary-bg-hover: rgba(56, 189, 248, 0.15);

  /* 4. 辅助状态互补色 (低饱和度、柔和通透，仅作精准点缀) */
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, 0.08);
  --amber: #fbbf24;
  --amber-bg: rgba(251, 191, 36, 0.08);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.08);
  --cyan: #38bdf8;
  --cyan-bg: rgba(56, 189, 248, 0.08);

  --status-sage: #34d399;
  --status-amber: #fbbf24;
  --status-coral: #f87171;

  /* 5. 层次分明的文字阶梯 (Slate Text Hierarchy) */
  --text: #f8fafc;            /* 主标题与关键数据：近白 */
  --text-muted: #cbd5e1;      /* 正文文字：纯净浅板岩 */
  --text-dim: #94a3b8;        /* 次级说明：低饱和中灰 */
  --text-faint: #64748b;      /* 标签/暗注：深板岩灰 */

  /* 字体系统 */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Menlo, monospace;

  /* 统一质感圆角与阴影 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-hud: 0 12px 36px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--primary); color: #000; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.3); }

/* SVG 通用样式 */
svg.icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -2px;
}

svg.icon-brand {
  width: 17px;
  height: 17px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
}

svg.icon-alert {
  width: 15px;
  height: 15px;
  stroke: var(--amber);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

/* ============ 顶部导航 ============ */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 20px;
  background: rgba(13, 18, 31, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.header-left { display: flex; align-items: center; gap: 12px; }

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary-bg);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
  line-height: 1.2;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.sub-divider { color: var(--border); }

.code-tag {
  font-family: var(--font-mono);
  color: var(--text-dim);
  background: var(--panel-raised);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.badge-online { color: var(--green); background: var(--green-bg); border: 1px solid rgba(52, 211, 153, 0.2); }
.badge-ai { color: var(--primary); background: var(--primary-bg); border: 1px solid rgba(56, 189, 248, 0.25); }
.badge-mode { color: var(--amber); background: var(--amber-bg); border: 1px solid rgba(251, 191, 36, 0.2); }

/* 四屏切换导航按键 (极简板岩灰胶囊) */
.screen-switcher {
  display: flex;
  gap: 4px;
  background: rgba(7, 9, 14, 0.6);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: var(--radius-sm);
}
.switch-btn {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 3px;
  transition: all 0.12s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.switch-btn:hover { color: #fff; background: var(--panel-raised); }
.switch-btn.active {
  color: #fff;
  background: var(--primary-bg);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* ============ 全局置顶告警条 (柔和琥珀微透) ============ */
.global-alert-bar {
  background: rgba(251, 191, 36, 0.04);
  border-bottom: 1px solid rgba(251, 191, 36, 0.15);
  padding: 6px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 52px;
  z-index: 45;
}

.alert-bar-content {
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.alert-bar-actions { display: flex; gap: 8px; align-items: center; }

/* ============ 按钮系统 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-raised);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--border-light); color: #fff; background: var(--panel-hover); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 4px 9px; font-size: 11px; }

.btn-outline { background: transparent; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #07090e;
  font-weight: 700;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-ai {
  background: var(--primary-bg);
  border-color: rgba(56, 189, 248, 0.25);
  color: var(--primary);
}
.btn-ai:hover { background: var(--primary-bg-hover); color: #fff; border-color: var(--border-focus); }

.btn-success { background: var(--green-bg); border-color: rgba(52, 211, 153, 0.25); color: var(--green); }
.btn-success:hover { background: var(--green); color: #07090e; }

.btn-text-clear {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 11px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-text-clear:hover { color: var(--primary); }

/* ============ 主布局 (minmax 防止中栏撑爆右栏) ============ */
.app-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 330px;
  gap: 12px;
  padding: 12px 18px;
  align-items: start;
  min-height: calc(100vh - 52px);
  width: 100%;
  box-sizing: border-box;
  transition: grid-template-columns 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.app-layout.sidebar-collapsed {
  grid-template-columns: 0px minmax(0, 1fr) 330px;
  gap: 0 12px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.panel-header h2 {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.2px;
}
.panel-header h2 svg { stroke: var(--primary); }

.btn-toggle-sidebar {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 22px;
  height: 22px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-toggle-sidebar:hover {
  background: var(--panel-hover);
  border-color: var(--border-light);
  color: #fff;
}
.btn-toggle-sidebar svg { width: 12px; height: 12px; stroke-width: 2.2; }

/* 悬浮展开侧边栏按钮 */
.btn-expand-sidebar {
  position: fixed;
  top: 64px;
  left: 10px;
  z-index: 40;
  background: var(--panel);
  border: 1px solid var(--border-focus);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}
.btn-expand-sidebar:hover {
  background: var(--primary-bg);
  color: #fff;
  transform: translateX(2px);
}
.btn-expand-sidebar svg { width: 13px; height: 13px; stroke: currentColor; }

.badge-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--primary);
  background: var(--primary-bg);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 3px;
}

/* ============ 左侧侧边栏 (定高自适应滚动) ============ */
.sidebar-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: calc(100vh - 76px);
  max-height: calc(100vh - 76px);
  position: sticky;
  top: 64px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.sidebar-panel.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  opacity: 0;
  pointer-events: none;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  flex-shrink: 0;
}
.search-box svg { stroke: var(--text-dim); margin-right: 5px; }
.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 11.5px;
  width: 100%;
}
.search-box input::placeholder { color: var(--text-faint); }

.tree-container {
  flex: 1;
  overflow-y: auto;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 现代化门店卡片 */
.store-tree-item {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  cursor: pointer;
  transition: all 0.12s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.store-tree-item:hover {
  background: var(--panel-hover);
  border-color: var(--border-light);
  transform: translateX(1px);
}
.store-tree-item.active {
  background: var(--primary-bg);
  border-color: rgba(56, 189, 248, 0.35);
}

.store-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.store-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
}
.score-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 1px 5px;
  border-radius: 3px;
}

.store-item-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.store-serial-tag {
  color: var(--text-dim);
}
.store-status-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
}
.tag-pass { background: var(--green-bg); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.2); }
.tag-warn { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.2); }
.tag-danger { background: var(--red-bg); color: var(--red); border: 1px solid rgba(248, 113, 113, 0.2); }

.device-summary-box {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.summary-title { font-weight: 700; color: var(--primary); font-size: 11.5px; margin-bottom: 2px; }
.summary-row { display: flex; justify-content: space-between; color: var(--text-dim); font-size: 11px; }

/* ============ 中间主监视工作台 ============ */
.main-monitor-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 核心重点关注中枢 */
.priority-focus-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-card);
}

.priority-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.priority-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.priority-badge {
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: var(--amber);
  padding: 1px 6px;
  border-radius: 3px;
}
.priority-name { font-size: 14px; font-weight: 700; color: #fff; }
.priority-time { font-size: 10.5px; color: var(--text-faint); font-family: var(--font-mono); }

.priority-score-box {
  display: flex;
  align-items: center;
  gap: 5px;
}
.score-label { font-size: 10.5px; color: var(--text-dim); }
.score-num { font-size: 18px; font-weight: 800; font-family: var(--font-mono); color: var(--primary); }

.priority-summary-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

.priority-tags-wrap {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.tag-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
}
.tag-warn { background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.2); color: var(--amber); }
.tag-info { background: var(--primary-bg); border: 1px solid var(--border); color: var(--primary); }

.priority-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: 2px;
}
.action-hint { font-size: 11px; color: var(--text-faint); }

/* ============ 下机清扫待办智能巡检中枢 ============ */
.clean-radar-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-card);
}

.clean-radar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.clean-radar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
}

.clean-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: var(--amber);
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
}

.clean-tasks-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.clean-task-item {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 250px;
  flex-shrink: 0;
  transition: all 0.12s;
}

.clean-task-item:hover {
  border-color: rgba(251, 191, 36, 0.3);
  background: var(--panel-hover);
}

.clean-task-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.clean-task-store {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
}

.clean-task-seat {
  font-family: var(--font-mono);
  color: var(--primary);
  font-weight: 700;
}

.clean-task-channel {
  font-size: 10.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.clean-task-btn {
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.12s;
}

.clean-task-btn:hover {
  background: var(--primary);
  color: #07090e;
}

.clean-task-empty {
  font-size: 11.5px;
  color: var(--text-faint);
  padding: 4px 0;
}

/* 视窗工具条 */
.monitor-toolbar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.toolbar-left { display: flex; align-items: center; gap: 8px; }
.channel-indicator { font-size: 12px; color: var(--text-dim); }
.channel-indicator b { color: #fff; }

.select-sm {
  background: var(--panel-raised);
  color: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
}
.select-sm:focus { border-color: var(--border-focus); }
.channel-ip-tag { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); }

.channel-zone-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.zone-single { background: rgba(56, 189, 248, 0.08); color: var(--primary); border: 1px solid rgba(56, 189, 248, 0.2); }
.zone-team { background: rgba(168, 85, 247, 0.08); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.2); }
.zone-hall { background: rgba(52, 211, 153, 0.08); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.2); }
.zone-front { background: rgba(251, 191, 36, 0.08); color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.2); }
.zone-service { background: rgba(244, 114, 182, 0.08); color: #f472b6; border: 1px solid rgba(244, 114, 182, 0.2); }

.toolbar-right { display: flex; gap: 6px; align-items: center; }

/* 4K 大屏视窗 */
.screen-viewport {
  width: 100%;
  height: 520px;
  min-height: 480px;
  background: #03060d;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.live-image { width: 100%; height: 100%; object-fit: cover; }

.viewport-hud-tag {
  position: absolute;
  top: 12px;
  left: 14px;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.hud-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}
.screen-watermark {
  position: absolute;
  top: 12px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 1px;
}

.image-overlay-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(7, 9, 14, 0.9) 100%);
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}
.overlay-actions { display: flex; gap: 8px; }
.overlay-btn {
  color: var(--primary);
  text-decoration: none;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 4K 视窗右上角 HUD 悬浮 AI 智能风控研判面板 */
.viewport-hud-ai-card {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 310px;
  max-width: calc(100% - 28px);
  background: rgba(9, 13, 22, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 6px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 20;
  box-shadow: var(--shadow-hud);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.viewport-hud-ai-card.collapsed {
  width: auto;
  min-width: 130px;
}
.viewport-hud-ai-card.collapsed .hud-ai-body {
  display: none;
}

.hud-ai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 5px;
  gap: 6px;
}

.hud-ai-title {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hud-ai-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 1px 5px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hud-status-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
}

.hud-status-badge.status-pass {
  background: rgba(52, 211, 153, 0.1);
  color: var(--status-sage);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.hud-status-badge.status-warn {
  background: rgba(251, 191, 36, 0.1);
  color: var(--status-amber);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.hud-status-badge.status-danger {
  background: rgba(248, 113, 113, 0.1);
  color: var(--status-coral);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.hud-ai-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hud-mini-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  width: 20px;
  height: 20px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
  padding: 0;
}
.hud-mini-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  border-color: var(--border-focus);
}

.hud-ai-body {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hud-ai-body ul {
  padding-left: 12px;
  margin: 2px 0;
}

.hud-ai-body p {
  margin: 0;
}

.hud-ai-body strong {
  color: #fff;
}

.hud-ai-empty {
  font-size: 10.5px;
  color: var(--text-faint);
  padding: 3px 0;
}

/* ============ 智能 AI 目标视觉定位标注图层 (Bounding Box + Callout Badges) ============ */
.ai-visual-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

.ai-target-box {
  position: absolute;
  border: 1px solid var(--box-color, rgba(248, 113, 113, 0.7));
  background: rgba(248, 113, 113, 0.08);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.25), inset 0 0 6px rgba(248, 113, 113, 0.08);
  border-radius: 4px;
  transition: all 0.2s ease;
  pointer-events: auto;
}

.ai-target-box.type-trash,
.ai-target-box.type-hazard,
.ai-target-box.type-warning {
  --box-color: #f87171;
  border-color: rgba(248, 113, 113, 0.65);
  background: rgba(248, 113, 113, 0.08);
}

.ai-target-box.type-headset,
.ai-target-box.type-chair,
.ai-target-box.type-crowd {
  --box-color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.65);
  background: rgba(251, 191, 36, 0.08);
}

.ai-target-box.type-seat,
.ai-target-box.type-normal {
  --box-color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(56, 189, 248, 0.06);
}

/* 四角微晶科技瞄准标 (Tech corner brackets) */
.ai-box-corner {
  position: absolute;
  width: 5px;
  height: 5px;
  border-color: var(--box-color, #f87171);
  border-style: solid;
}
.ai-corner-tl { top: -1px; left: -1px; border-width: 1.5px 0 0 1.5px; }
.ai-corner-tr { top: -1px; right: -1px; border-width: 1.5px 1.5px 0 0; }
.ai-corner-bl { bottom: -1px; left: -1px; border-width: 0 0 1.5px 1.5px; }
.ai-corner-br { bottom: -1px; right: -1px; border-width: 0 1.5px 1.5px 0; }

/* 紧贴目标旁侧的精细悬浮微胶囊标签 (Callout Badge) */
.ai-callout-tag {
  position: absolute;
  background: rgba(10, 14, 23, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--box-color, rgba(248, 113, 113, 0.6));
  color: #fff;
  font-size: 9.5px;
  font-weight: 500;
  padding: 1.5px 5px;
  border-radius: 2.5px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  z-index: 25;
  pointer-events: none;
  animation: tagPopIn 0.2s ease-out;
}

/* 错位排布防止堆叠遮挡 */
.ai-callout-tag.pos-top-left { bottom: calc(100% + 3px); left: 0; }
.ai-callout-tag.pos-bottom-left { top: calc(100% + 3px); left: 0; }
.ai-callout-tag.pos-top-right { bottom: calc(100% + 3px); right: 0; left: auto; }
.ai-callout-tag.pos-bottom-right { top: calc(100% + 3px); right: 0; left: auto; }
.ai-callout-tag.pos-right-mid { top: 10%; left: calc(100% + 5px); }

.callout-svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--box-color, #38bdf8);
  flex-shrink: 0;
}

@keyframes tagPopIn {
  0% { opacity: 0; transform: translateY(3px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============ 右侧排行榜 ============ */
.wall-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 64px;
}

.wall-stat-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  text-align: center;
}
.stat-item { display: flex; flex-direction: column; gap: 1px; }
.stat-label { font-size: 10px; color: var(--text-faint); font-weight: 600; }
.stat-item b { font-size: 13.5px; font-family: var(--font-mono); color: #fff; }

.wall-desc { font-size: 10.5px; color: var(--text-faint); }

.wall-card,
.store-wall-card {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: all 0.12s;
}
.wall-card:hover,
.store-wall-card:hover {
  border-color: var(--border-light);
  background: var(--panel-hover);
}
.wall-card.active,
.store-wall-card.active {
  border-color: rgba(56, 189, 248, 0.35);
  background: var(--primary-bg);
}

.wall-card-head,
.swc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wall-card-name { font-size: 12.5px; font-weight: 700; color: #fff; }
.swc-score { font-family: var(--font-mono); font-weight: 700; font-size: 11.5px; color: var(--primary); }

.wall-card-body {
  display: flex;
  gap: 8px;
  align-items: center;
}
.wall-card-thumb {
  width: 60px;
  height: 40px;
  background: #03060d;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wall-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wall-card-thumb.empty svg { width: 16px; height: 16px; stroke: var(--text-faint); }

.wall-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
  overflow: hidden;
}
.wall-card-summary,
.swc-summary {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wall-card-meta,
.swc-foot {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}
.view-btn-text { color: var(--primary); font-weight: 600; cursor: pointer; }
.view-btn-text:hover { text-decoration: underline; }

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