/* 主要内容区域 */
.main-content {
  margin-top: 80px;
  min-height: calc(100vh - 80px);
  display: flex;
  background-color: #f9fafb;
}

/* 摄像头列表侧栏 */
.camera-sidebar {
  width: 280px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 80px);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.sidebar-title {
  color: #111827;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.sidebar-subtitle {
  color: #6b7280;
  font-size: 14px;
}

.camera-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.camera-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: #f9fafb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.camera-item:hover {
  background: rgba(86, 123, 92, 0.1);
  border-color: rgba(86, 123, 92, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.camera-item.active {
  background: rgba(86, 123, 92, 0.15);
  border-color: #567b5c;
  box-shadow: 0 4px 12px rgba(86, 123, 92, 0.2);
}

.camera-icon {
  width: 32px;
  height: 32px;
  background: #567b5c;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 16px;
}

.camera-info {
  flex: 1;
}

.camera-name {
  color: #111827;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.camera-status {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.camera-status.online {
  color: #10b981;
}

.camera-status.offline {
  color: #ef4444;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* 视频播放区域 */
.video-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.video-header {
  background: #ffffff;
  padding: 20px 30px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.video-title {
  color: #111827;
  font-size: 20px;
  font-weight: 600;
}

.view-mode-toggle {
  display: flex;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.mode-btn {
  padding: 8px 16px;
  background: transparent;
  color: #6b7280;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.mode-btn.active {
  background: #567b5c;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(86, 123, 92, 0.3);
}

.video-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  position: relative;
  background: #f9fafb;
}

.video-player {
  width: 100%;
  max-width: 1200px;
  background: #000000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  position: relative;
  aspect-ratio: 16/9; /* 确保容器有固定的宽高比 */
}

/* Video.js 样式自定义 */
.video-js {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
}

.video-js .vjs-big-play-button {
  background-color: rgba(86, 123, 92, 0.9);
  border: 2px solid #567b5c;
  border-radius: 50%;
  color: #ffffff;
  font-size: 2.5em;
  width: 80px;
  height: 80px;
  line-height: 80px;
  margin-top: -40px;
  margin-left: -40px;
  transition: all 0.3s ease;
}

.video-js .vjs-big-play-button:hover {
  background-color: rgba(86, 123, 92, 1);
  transform: scale(1.1);
}

.video-js .vjs-control-bar {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  backdrop-filter: blur(10px);
}

.video-js .vjs-play-control .vjs-icon-placeholder:before,
.video-js .vjs-progress-control .vjs-play-progress {
  color: #567b5c;
}

.video-js .vjs-volume-level:before {
  background-color: #567b5c;
}

.video-placeholder {
  text-align: center;
  color: #6b7280;
  padding: 60px 20px;
  background: linear-gradient(45deg, #f3f4f6 0%, #e5e7eb 100%);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16/9;
  width: 100%;
}

.video-placeholder-icon {
  font-size: 64px;
  margin-bottom: 16px;
  color: #9ca3af;
}

.video-placeholder-text {
  font-size: 18px;
  margin-bottom: 8px;
}

.video-placeholder-subtitle {
  font-size: 14px;
  color: #6b7280;
}

/* 历史回放控制 */
.time-controls {
  display: none;
  background: #ffffff;
  padding: 20px 30px;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.time-controls.active {
  display: block;
}

.time-control-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 15px;
}

.time-control-row:last-child {
  margin-bottom: 0;
}

.time-control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-control-label {
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  min-width: 60px;
}

.time-input {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  color: #374151;
}

.load-history-btn {
  background: #567b5c;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.load-history-btn:hover {
  background: #4a6b50;
  box-shadow: 0 2px 8px rgba(86, 123, 92, 0.3);
}

.quick-time-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-time-btn {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.quick-time-btn:hover {
  background: rgba(86, 123, 92, 0.1);
  border-color: #567b5c;
  color: #567b5c;
}

/* 全屏样式 */
.fullscreen-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.fullscreen-overlay.active {
  display: flex;
}

.fullscreen-video-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* 全屏视频播放器样式 */
.fullscreen-video-container .video-js {
  width: 100% !important;
  height: 100% !important;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}

/* 手机端全屏视频样式 */
@media (max-width: 768px) {
  .fullscreen-video-container {
    padding: 0;
    margin: 0;
  }
  
  .fullscreen-video-container .video-js {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw;
    max-height: 100vh;
  }
}

.fullscreen-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  border: none;
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  z-index: 10001;
  transition: all 0.3s;
}

.fullscreen-close-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* 加载状态 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #6b7280;
  font-size: 14px;
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #567b5c;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 错误状态 */
.error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 15px;
  border-radius: 8px;
  margin: 20px;
  text-align: center;
}

.error-message .error-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

/* 连接状态指示器 */
.connection-status {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 10;
}

.connection-status.connected {
  background: rgba(16, 185, 129, 0.9);
}

.connection-status.disconnected {
  background: rgba(239, 68, 68, 0.9);
}

.connection-status.connecting {
  background: rgba(245, 158, 11, 0.9);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-menu {
    top: 80px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  }
  
  .main-content {
    flex-direction: column;
  }
  
  .camera-sidebar {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }
  
  .camera-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 10px;
  }
  
  .camera-item {
    min-width: 120px;
    flex-shrink: 0;
  }
  
  .video-container {
    padding: 15px;
  }
  
  .video-header {
    padding: 15px 20px;
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
  
  .time-controls {
    padding: 15px 20px;
  }
  
  .time-control-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .quick-time-buttons {
    width: 100%;
  }
  
  .quick-time-btn {
    flex: 1;
    text-align: center;
  }
}

/* 自定义全屏按钮样式 */
.vjs-custom-fullscreen-button {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3em;
  height: 3em;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2em;
  order: 10;
}

.vjs-custom-fullscreen-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.vjs-custom-fullscreen-button .vjs-icon-placeholder:before {
  content: "⛶";
  font-size: 1.5em;
}

.vjs-custom-fullscreen-button .vjs-control-text {
  font-size: 0.8em;
  margin-left: 5px;
}

/* 独立自定义全屏按钮样式 */
.custom-fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 6px;
  color: white;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.custom-fullscreen-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.05);
}

.custom-fullscreen-btn .fullscreen-icon {
  font-size: 16px;
}

.custom-fullscreen-btn .fullscreen-text {
  font-size: 12px;
  font-weight: 500;
}


/* 缺失分段提示样式 */
.missing-segment-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 20px 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999; /* 降低层级，不遮挡进度条 */
  pointer-events: none; /* 不阻止点击事件 */
}

.missing-segment-content {
  text-align: center;
}

.missing-segment-title {
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  margin: 0;
  white-space: nowrap;
}

/* 隐藏Video.js默认错误提示 */
.video-js .vjs-error-display {
  display: none !important;
}

.video-js .vjs-modal-dialog {
  display: none !important;
}

.video-js .vjs-error-overlay {
  display: none !important;
}

/* 全屏模式缺失分段提示样式 */
.fullscreen-missing-segment-prompt {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 20px 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000; /* 降低层级，不遮挡全屏进度条 */
  pointer-events: none; /* 不阻止点击事件 */
}

.fullscreen-missing-content {
  text-align: center;
}

.fullscreen-missing-title {
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  margin: 0;
  white-space: nowrap;
}

/* 全屏进度条样式 */
.fullscreen-progress-container {
  position: absolute;
  bottom: 20px; /* 调整位置，让进度条贴近视频底部 */
  left: 20px;
  right: 20px;
  z-index: 1001; /* 高于缺失分段提示 */
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  padding: 15px 20px;
  backdrop-filter: blur(10px);
}

.fullscreen-progress-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fullscreen-progress-track {
  position: relative;
  height: 8px; /* 增加轨道高度 */
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fullscreen-progress-track:hover {
  height: 10px; /* 悬停时进一步增加高度 */
  background: rgba(255, 255, 255, 0.4);
}

.fullscreen-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #567b5c;
  border-radius: 4px;
  transition: width 0.1s ease;
}

.fullscreen-progress-handle {
  position: absolute;
  top: 50%;
  width: 20px; /* 增加拖动条宽度 */
  height: 20px; /* 增加拖动条高度 */
  background: #567b5c;
  border: 3px solid #ffffff; /* 增加边框宽度 */
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  transition: all 0.2s ease;
  opacity: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); /* 添加阴影效果 */
}

.fullscreen-progress-track:hover .fullscreen-progress-handle {
  opacity: 1;
}

.fullscreen-progress-handle:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.3); /* 增加缩放效果 */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.fullscreen-progress-time {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
}

.fullscreen-current-time {
  color: #567b5c;
  font-weight: 600;
}

.fullscreen-total-time {
  color: rgba(255, 255, 255, 0.8);
}

/* 全屏进度条响应式设计 */
@media (max-width: 768px) {
  .fullscreen-progress-container {
    bottom: 10px; /* 移动设备上更贴近底部 */
    left: 10px;
    right: 10px;
    padding: 12px 15px;
  }
  
  .fullscreen-progress-time {
    font-size: 12px;
  }
  
  .fullscreen-progress-handle {
    width: 18px; /* 移动设备上保持较大的拖动条 */
    height: 18px;
  }
  
  .fullscreen-progress-track {
    height: 10px; /* 移动设备上增加轨道高度 */
  }
  
  .fullscreen-progress-track:hover {
    height: 12px;
  }
} 