/* 弹窗样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: linear-gradient(135deg, #0a1628 0%, #1a2a4a 100%);
  border-radius: 16px;
  border: 1px solid rgba(0, 180, 216, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 800px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.detection-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 180, 216, 0.2);
}

.detection-modal .modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-cyan);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 1001;
  position: relative;
}

.modal-close:hover {
  background: rgba(255, 100, 100, 0.5);
  color: #fff;
  transform: scale(1.1);
}

/* 实时监控全屏样式 */
.fullscreen-video-modal {
  max-width: 95vw;
  width: 1400px;
  background: var(--bg-primary);
}

.fullscreen-video-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
}

.fullscreen-video-modal .modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-cyan);
}

.fullscreen-video-area {
  padding: 20px;
}

.fullscreen-video-wrapper {
  width: 100%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-video-wrapper video,
.fullscreen-video-wrapper canvas {
  max-width: 100%;
  max-height: 70vh;
}

.fullscreen-video-wrapper .video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  color: var(--text-secondary);
}

.fullscreen-video-wrapper .video-placeholder svg {
  width: 80px;
  height: 80px;
  opacity: 0.5;
}

.fullscreen-video-wrapper .video-placeholder span {
  font-size: 16px;
}

.modal-body {
  padding: 24px;
  max-height: calc(85vh - 80px);
  overflow-y: auto;
}

.modal-video-area {
  background: #0d1929;
  border-radius: 12px;
  padding: 40px;
  margin-bottom: 20px;
  border: 1px solid rgba(0, 180, 216, 0.15);
  position: relative;
  transition: all 0.3s ease;
}

.modal-video-area.expanded {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  border-radius: 0;
  padding: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 22, 40, 0.98);
  margin: 0;
}

.expand-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(0, 180, 216, 0.2);
  border: 1px solid rgba(0, 180, 216, 0.4);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.expand-btn:hover {
  background: rgba(0, 180, 216, 0.4);
  transform: scale(1.1);
}

.expand-btn svg {
  width: 20px;
  height: 20px;
  fill: var(--accent-cyan);
}

/* 标题内联放大按钮 */
.expand-btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(0, 180, 216, 0.15);
  border: 1px solid rgba(0, 180, 216, 0.3);
  border-radius: 4px;
  cursor: pointer;
  margin-left: 8px;
  vertical-align: middle;
  transition: all 0.2s;
}

.expand-btn-inline:hover {
  background: rgba(0, 180, 216, 0.35);
  transform: scale(1.1);
}

.expand-btn-inline svg {
  fill: var(--accent-cyan);
}

.modal-video-area.expanded .expand-btn {
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
}

.modal-video-area.expanded .expand-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-video-area.expanded .modal-video-placeholder {
  width: 100%;
  max-width: 1200px;
  height: 80vh;
}

.modal-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-muted);
  min-height: 200px;
}

.modal-video-placeholder svg {
  width: 64px;
  height: 64px;
  fill: var(--accent-cyan);
  opacity: 0.5;
}

.modal-video-player {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-video-player video {
  width: 100%;
  max-height: 60vh;
  display: block;
}

.video-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}

.video-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 180, 216, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* 检测弹窗视频加载失败提示 */
.video-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 20px;
  color: var(--text-secondary);
  text-align: center;
}
.video-error svg {
  color: var(--danger);
  opacity: 0.85;
}
.video-error p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

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

.modal-clip-list {
  background: rgba(0, 180, 216, 0.05);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(0, 180, 216, 0.1);
}

.modal-clip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(0, 180, 216, 0.1);
  color: var(--accent-cyan);
  font-weight: 500;
}

.modal-clip-header svg {
  width: 20px;
  height: 20px;
  fill: var(--accent-cyan);
}

.clip-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clip-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0, 180, 216, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.clip-item:hover {
  background: rgba(0, 180, 216, 0.15);
  border-color: rgba(0, 180, 216, 0.3);
}

.clip-item.clip-selected {
  background: rgba(0, 180, 216, 0.25);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 180, 216, 0.3);
}

.clip-item.clip-selected .clip-number {
  background: linear-gradient(135deg, #ff6b35, #ff8c5a);
}

.clip-item.clip-selected .clip-icon {
  background: #ff6b35;
}

.clip-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-cyan);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.clip-number {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #00d4aa, #00a8cc);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.clip-icon svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.clip-info {
  flex: 1;
}

.clip-time {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.clip-duration {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
