/* 媒体画廊模态框 */
.media-gallery-modal .ant-modal-content {
  background: transparent !important;
  box-shadow: none !important;
}

.media-gallery-modal .ant-modal-body {
  padding: 0 !important;
}

/* 画廊工具栏 */
.gallery-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.toolbar-left,
.toolbar-right {
  flex: 0 0 auto;
}

.toolbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

/* 画廊按钮 */
.gallery-btn {
  color: rgba(255, 255, 255, 0.85) !important;
  border: none !important;
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(4px);
  transition: all 0.3s ease !important;
  height: 36px;
  width: 36px;
  border-radius: 6px !important;
}

.gallery-btn:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.gallery-btn:active {
  transform: translateY(0);
}

.gallery-btn:disabled {
  color: rgba(255, 255, 255, 0.3) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  cursor: not-allowed;
}

.gallery-close-btn {
  background: rgba(255, 77, 79, 0.2) !important;
}

.gallery-close-btn:hover {
  background: rgba(255, 77, 79, 0.4) !important;
}

/* 画廊内容区域 */
.gallery-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 40px;
  overflow: hidden;
}

/* 图片容器 */
.gallery-image-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gallery-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  cursor: grab;
}

.gallery-image:active {
  cursor: grabbing;
}

/* 视频容器 */
.gallery-video-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* 音频容器 */
.gallery-audio-container {
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.gallery-audio-container audio {
  width: 100%;
  filter: invert(1) hue-rotate(180deg);
}

/* 文档容器 */
.gallery-document-container {
  width: 100%;
  max-width: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.document-preview {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.document-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.8;
}

.document-name {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  word-break: break-all;
}

.document-size {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

/* 画廊信息栏 */
.gallery-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  backdrop-filter: blur(4px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .gallery-toolbar {
    height: 50px;
    padding: 0 12px;
  }

  .toolbar-center .ant-space {
    gap: 8px !important;
  }

  .gallery-btn {
    height: 32px;
    width: 32px;
    font-size: 14px;
  }

  .gallery-content {
    padding: 50px 12px 40px;
  }

  .gallery-info {
    height: 36px;
    padding: 0 12px;
  }

  .gallery-info .ant-typography {
    font-size: 12px !important;
  }

  .document-preview {
    padding: 24px;
  }

  .document-icon {
    font-size: 48px;
  }

  .document-name {
    font-size: 14px;
  }

  .document-size {
    font-size: 12px;
  }

  .gallery-audio-container {
    padding: 24px;
  }
}

/* 小屏幕优化 */
@media (max-width: 480px) {
  .toolbar-center {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .toolbar-center::-webkit-scrollbar {
    display: none;
  }

  .gallery-content {
    padding: 45px 8px 36px;
  }

  .gallery-btn {
    height: 28px;
    width: 28px;
    font-size: 12px;
    flex-shrink: 0;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.gallery-content > * {
  animation: fadeIn 0.3s ease-out;
}

/* 全屏模式优化 */
.media-gallery-modal:-webkit-full-screen {
  background: #000;
}

.media-gallery-modal:-moz-full-screen {
  background: #000;
}

.media-gallery-modal:fullscreen {
  background: #000;
}

/* 加载状态 */
.gallery-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 16px;
}

/* 错误状态 */
.gallery-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #ff4d4f;
}

.gallery-error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.gallery-error-text {
  font-size: 16px;
  margin-bottom: 16px;
}

/* 手势支持提示 */
.gesture-hint {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.media-gallery-modal:hover .gesture-hint {
  opacity: 1;
}

@media (min-width: 769px) {
  .gesture-hint::after {
    content: '← → 切换 | ESC 关闭 | F 全屏 | 空格 播放/暂停';
  }
}

@media (max-width: 768px) {
  .gesture-hint::after {
    content: '左右滑动切换';
  }
}