/* 骨架线渲染样式（Canvas 容器 + 叠加层） */

.camera-container {
  position: relative;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

/* video 负责显示画面，镜像由 JS 动态控制（.mirrored 类） */
.camera-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* canvas 透明叠加在 video 上方，镜像与 video 同步 */
.camera-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  background: transparent;
  pointer-events: none;
}

/* 镜像模式：video 和 canvas 同时翻转 */
.camera-container.mirrored video,
.camera-container.mirrored canvas {
  transform: scaleX(-1);
}

/* 风险等级标识 */
#risk-indicator {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-xl);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s, background 0.3s;
  pointer-events: none;
  z-index: 5;
}

#risk-indicator.show { opacity: 1; }
#risk-indicator.safe { background: var(--risk-safe); }
#risk-indicator.warning { background: var(--risk-warning); }
#risk-indicator.danger {
  background: var(--risk-danger);
  animation: risk-pulse 1s ease-in-out infinite;
}

@keyframes risk-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 69, 58, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(255, 69, 58, 0); }
}

/* FPS 显示 */
#fps-display {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  z-index: 5;
}

/* 模型加载提示遮罩 */
.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  z-index: 10;
}

.loading-overlay .spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
