/* 全局样式 */
body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  margin: 0;
  padding: 0;
  text-align: center;
}

/* 媒体容器和图片容器共用样式 */
#mediaContainer,
#imageContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 20px;
  justify-content: center;
}

/* 媒体项和图片项共用样式 */
.media-item,
.image-item {
  width: 200px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s;
}

.media-item:hover,
.image-item img:hover {
  transform: scale(1.05);
}

/* 媒体项和图片项内的媒体元素样式 */
.media-item img,
.media-item video,
.image-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.media-item video {
  background-color: #000;
}

/* 媒体名称和图片名称共用样式 */
.media-name,
.image-name {
  margin-top: 8px;
  font-size: 14px;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 文件夹标签样式 */
.folder-tabs {
  margin-bottom: 20px;
  /*display: flex;*/ /* 取消 flex 布局，以便在小屏幕上显示为一行 */
  flex-wrap: wrap;
  gap: 5px;
}

.folder-tab {
  padding: 10px 15px;
  margin: 3px;
  background: #eee;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s;
}

.folder-tab:hover {
  background: #ddd;
}

.folder-tab.active {
  background: #007bff;
  color: white;
}

/* 加载中提示样式 */
.loading {
  padding: 20px;
  text-align: center;
  color: #666;
}

/* 错误信息提示样式 */
.error-message {
  padding: 20px;
  color: #dc3545;
  text-align: center;
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  gap: 5px;
  flex-wrap: wrap;
}

.page-btn {
  padding: 8px 12px;
  background: #eee;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 40px;
  text-align: center;
}

.page-btn:hover {
  background: #ddd;
}

.page-btn.active {
  background: #007bff;
  color: white;
}


.page-btn:disabled {
  background: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

/* 省略号样式 */
.page-ellipsis {
  padding: 8px 6px;
  color: #6c757d;
  font-weight: bold;
  user-select: none;
}

/* 快速跳转输入框样式 */
.page-jump {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 15px;
}

.page-jump input {
  width: 60px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-align: center;
}

.page-jump button {
  padding: 8px 12px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.page-jump button:hover {
  background: #0056b3;
}
/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content img,
.modal-content video {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.modal-content video {
  background-color: #000;
}

/* 关闭按钮样式 */
.close-btn {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 80px;
  font-weight: bold;
  cursor: pointer;
}

/* 媒体信息和图片信息共用样式 */
.media-info,
.image-info {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  text-align: center;
  color: white;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 10px;
}
/* 添加触摸滑动提示 */
.swipe-hint {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  animation: fadeInOut 3s ease-in-out;
  z-index: 1001;
  white-space: nowrap;
}

@keyframes fadeInOut {
  0%,
  100% {
    opacity: 0;
  }
  25%,
  75% {
    opacity: 1;
  }
}

/* 导航箭头 */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 40px;
  cursor: pointer;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.5);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
  user-select: none;
}

.nav-arrow:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.nav-arrow.left {
  left: 20px;
}

.nav-arrow.right {
  right: 20px;
}

.nav-arrow.hidden {
  display: none;
}

/* 当前媒体计数 */
.media-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background: rgba(0, 0, 0, 0.7);
  padding: 5px 15px;
  border-radius: 15px;
  font-size: 14px;
  z-index: 1001;
}
/* 视频播放图标样式 */
.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 40px;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  opacity: 0.8;
  transition: opacity 0.3s;
}

.video-thumbnail:hover .video-play-icon {
  opacity: 1;
}

.video-thumbnail {
  position: relative;
}

/* 响应式设计 */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }
  #mediaContainer,
  #imageContainer {
    gap: 10px;
    padding: 10px;
  }
  .media-item,
  .image-item {
    width: 180px;
  }
  .media-item img,
  .media-item video,
  .image-item img {
    height: 180px;
  }
  .folder-tabs {
    margin-bottom: 15px;
  }
  .folder-tab {
    padding: 8px 12px;
  }
  .pagination {
    margin: 15px 0;
    gap: 4px;
  }
  .page-btn {
    padding: 6px 10px;
  }
  .modal-content img,
  .modal-content video {
    max-height: 80vh;
  }
  .media-info,
  .image-info {
    padding: 8px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 12px;
  }
  #mediaContainer,
  #imageContainer {
    gap: 5px;
    padding: 5px;
  }
  .media-item,
  .image-item {
    width: 150px;
  }
  .media-item img,
  .media-item video,
  .image-item img {
    height: 150px;
  }
  .folder-tabs {
    margin-bottom: 10px;
  }
  .folder-tab {
    padding: 6px 10px;
  }
  .pagination {
    gap: 2px;
  }
  
  .page-btn {
    padding: 5px 6px;
    min-width: 30px;
    font-size: 12px;
  }
    .page-jump {
    margin-left: 5px;
    font-size: 12px;
  }
  
  .page-jump input {
    width: 40px;
    padding: 4px;
  }
  
  .page-jump button {
    padding: 4px 8px;
  }
  .modal-content img,
  .modal-content video {
    max-height: 70vh;
  }
  .media-info,
  .image-info {
    padding: 6px;
  }
}
