/* ===== VR全景页面样式 ===== */

/* VR页面主容器 */
.vr-page {
  display: flex;
  min-height: calc(100vh - 80px);
  padding-top: 80px;
  background: #f5f7f5;
}

/* 左侧边栏 */
.vr-sidebar {
  width: 320px;
  background: linear-gradient(180deg, #1a3d1a 0%, #0d2a0d 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: relative;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.sidebar-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.sidebar-header p {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* 线路列表 */
.route-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.route-list::-webkit-scrollbar {
  width: 6px;
}

.route-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.route-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.route-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.3s ease;
}

.route-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.route-item.active {
  background: rgba(255, 255, 255, 0.1);
}

.route-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
}

.route-tag {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  background: var(--tag-color, #27ae60);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.route-item-info {
  flex: 1;
}

.route-item-info h3 {
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 2px 0;
}

.route-item-info .scene-count {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

/* 场景标签 */
.route-item-scenes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 16px 68px;
}

.scene-chip {
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.scene-chip:hover {
  background: rgba(255, 255, 255, 0.2);
}

.scene-chip.active {
  background: var(--primary, #2d8f2d);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* 侧边栏底部 */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.sidebar-link {
  display: block;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* 主内容区 */
.vr-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* 位置信息栏 */
.vr-location-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.location-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
}

.location-icon {
  font-size: 1rem;
}

.location-route {
  color: var(--primary, #2d8f2d);
  font-weight: 500;
}

.location-divider {
  color: #ccc;
}

.location-scene {
  color: #333;
  font-weight: 500;
}

.vr-actions {
  display: flex;
  gap: 12px;
}

.vr-actions .btn {
  font-size: 0.875rem;
  padding: 6px 16px;
}

/* 模式切换栏 */
.vr-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: linear-gradient(90deg, #1a3d1a 0%, #2d5a2d 100%);
  flex-shrink: 0;
}

.mode-switcher {
  display: flex;
  gap: 8px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.mode-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mode-btn.active {
  background: #fff;
  color: #1a3d1a;
  border-color: #fff;
  font-weight: 500;
}

.mode-icon {
  font-size: 1rem;
}

.mode-label {
  white-space: nowrap;
}

.mode-hint {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
}

/* 全景查看器容器 */
.vr-viewer-container {
  flex: 1;
  position: relative;
  background: #000;
  min-height: 400px;
}

.vr-viewer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.vr-viewer.active {
  opacity: 1;
  pointer-events: auto;
}

#vr-viewer-image {
  z-index: 1;
}

#vr-viewer-video {
  z-index: 2;
}

#vr-viewer-image .pnlm-container {
  width: 100%;
  height: 100%;
}

/* 视频全景容器 */
.video-panorama-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.vr-video {
  display: none;
}

#vrVideoCanvas {
  width: 100%;
  height: 100%;
  cursor: grab;
}

#vrVideoCanvas:active {
  cursor: grabbing;
}

/* 视频控制覆盖层 */
.video-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.vr-viewer:hover .video-overlay {
  opacity: 1;
}

.video-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.video-ctrl-btn {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.video-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.video-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.progress-filled {
  height: 100%;
  background: #2d8f2d;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s ease;
}

.progress-time {
  font-size: 0.75rem;
  color: #fff;
  white-space: nowrap;
}

/* VR控制按钮 */
.vr-controls {
  position: absolute;
  bottom: 80px;
  right: 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vr-ctrl-btn {
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.vr-ctrl-btn:hover {
  background: var(--primary, #2d8f2d);
  transform: scale(1.1);
}

.vr-ctrl-btn.active {
  background: var(--primary, #2d8f2d);
}

/* VR提示 */
.vr-tips {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.875rem;
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

.vr-tips p {
  margin: 0;
}

/* 加载指示器 */
.vr-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  text-align: center;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.vr-loader.visible {
  opacity: 1;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #2d8f2d;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px;
}

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

/* 场景预览条 */
.scene-preview-bar {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  background: #fff;
  overflow-x: auto;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.scene-preview-bar::-webkit-scrollbar {
  height: 4px;
}

.scene-preview-bar::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.scene-preview-bar::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.preview-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preview-item:hover {
  transform: translateY(-2px);
}

.preview-item.active .preview-thumb {
  border-color: var(--primary, #2d8f2d);
  box-shadow: 0 4px 12px rgba(45, 143, 45, 0.3);
}

.preview-thumb {
  width: 80px;
  height: 60px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.preview-label {
  font-size: 0.75rem;
  color: #666;
  white-space: nowrap;
}

.preview-item.active .preview-label {
  color: var(--primary, #2d8f2d);
  font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .vr-page {
    flex-direction: column;
  }

  .vr-sidebar {
    width: 100%;
    max-height: 300px;
  }

  .route-list {
    display: flex;
    overflow-x: auto;
    padding: 12px 20px;
    gap: 12px;
  }

  .route-item {
    flex-shrink: 0;
    width: 280px;
    border-bottom: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
  }

  .route-item-scenes {
    padding: 0 16px 12px 16px;
  }

  .vr-viewer-container {
    min-height: 350px;
  }
}

@media (max-width: 768px) {
  .vr-location-bar {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .vr-actions {
    width: 100%;
  }

  .vr-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .vr-mode-bar {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .mode-switcher {
    width: 100%;
  }

  .mode-btn {
    flex: 1;
    justify-content: center;
  }

  .mode-hint {
    text-align: center;
  }

  .vr-controls {
    bottom: 70px;
    right: 12px;
  }

  .vr-ctrl-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .vr-tips {
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  .scene-preview-bar {
    padding: 12px 16px;
  }

  .preview-thumb {
    width: 70px;
    height: 50px;
  }

  .preview-label {
    font-size: 0.7rem;
  }

  .route-item-header {
    padding: 12px 16px;
  }

  .route-item-scenes {
    padding-left: 16px;
    gap: 6px;
  }

  .scene-chip {
    padding: 3px 10px;
    font-size: 0.7rem;
  }

  .video-controls {
    gap: 8px;
  }

  .video-ctrl-btn {
    width: 36px;
    height: 36px;
  }
}

/* Pannellum 覆盖样式 */
.pnlm-container {
  font-family: 'Noto Sans SC', sans-serif;
}

.pnlm-hotspot-base {
  cursor: pointer;
}

.pnlm-hotspot-tooltip {
  font-family: 'Noto Sans SC', sans-serif;
}

/* 视频模式提示 */
.video-mode-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(10px);
  z-index: 5;
}

.video-mode-badge::before {
  content: '🎬';
}
