/* Gallery Plugin Frontend Styles - v2.9.11 (Optimized Scrolling) */
@import url("https://fonts.loli.net/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap");

:root {
  --transition-speed: 0.3s;
  --smooth-transition: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --vh: 1vh; /* 全局定义，由JS动态设置 */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  overflow: hidden;
  background-color: #111;
  color: #fff;
  min-height: 100vh; /* 确保body高度至少为100vh */
}

#gallery-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh; /* 确保在非移动端使用100vh */
}

/* Background Image Containers */
.bg-image-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: blur(20px) brightness(0.6); /* 模糊和变暗效果 */
  z-index: 0; /* 默认层级，在活动背景之下 */
  transition: opacity 0.8s ease-in-out; /* 增加过渡时间 */
  opacity: 0;
}
.bg-image-container.active {
  opacity: 1;
}

/* Particle Effect */
#particle-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh; /* 确保粒子效果在非移动端也覆盖全屏 */
  pointer-events: none;
  z-index: 0; /* 默认层级，在活动背景之下 */
}
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  animation: float linear infinite;
}
@keyframes float {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  25% {
    opacity: 0.7;
  }
  50% {
    transform: translateY(-15vh) translateX(5vw);
  }
  75% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(-30vh) translateX(-5vw);
    opacity: 0;
  }
}

/* Main Image Display */
.main-view {
  position: absolute;
  top: 5%;
  left: 300px;
  right: 5%;
  bottom: 15%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}
#main-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: scale(0.95);
  transition: all var(--transition-speed) var(--smooth-transition);
  transition-delay: 0.1s;
}
#main-image.visible {
  opacity: 1;
  transform: scale(1);
}

/* 融入式加载指示器 */
.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--smooth-transition);
  z-index: 15;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  padding: 25px 35px;
}
.loading-indicator.show {
  opacity: 1;
  visibility: visible;
}
.loading-spinner {
  width: 45px;
  height: 45px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.loading-text {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Glassmorphism Effect */
.glass-effect {
  background: rgba(20, 20, 30, 0.5);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  border-radius: 12px;
}

/* Sidebar Layout */
.sidebar {
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  padding: 25px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sidebar-title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Featured Collection - 优化滚动性能 */
.featured-collection {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
}
.thumbnail-list-wrapper {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* 优化滚动性能 */
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
}
.thumbnail-list-wrapper::-webkit-scrollbar {
  display: none;
}
.thumbnail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 10px;
  /* 优化渲染性能 */
  contain: layout style paint;
}
.thumbnail-item {
  position: relative;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.2s var(--smooth-transition);
  transform: translateX(0);
  /* 优化动画性能 */
  will-change: transform, border-color;
}
.thumbnail-item:hover {
  transform: translateX(5px);
  border-color: rgba(255, 255, 255, 0.2);
}
.thumbnail-item.active {
  border-color: rgba(90, 103, 216, 0.8);
  transform: translateX(8px);
  box-shadow: 0 4px 12px rgba(90, 103, 216, 0.3);
}
.thumbnail-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s var(--smooth-transition);
  /* 优化图片渲染 */
  will-change: transform;
}
.thumbnail-item:hover img {
  transform: scale(1.05);
}
.thumbnail-item .title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  font-size: 13px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Category Filters - 优化滚动性能 */
.category-filters-wrapper {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.category-filters-scroll {
  max-height: 200px;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* 优化滚动性能 */
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
}
.category-filters-scroll::-webkit-scrollbar {
  display: none;
}
.category-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 10px;
  /* 优化渲染性能 */
  contain: layout style paint;
}
.glass-button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e0e0e0;
  padding: 12px 15px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  transition: all 0.2s var(--smooth-transition);
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  transform: translateX(0);
  position: relative;
  user-select: none;
  /* 优化动画性能 */
  will-change: transform, background-color, border-color;
}
.glass-button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: translateX(3px);
}
.glass-button.active {
  background: rgba(90, 103, 216, 0.7);
  border-color: rgba(129, 140, 248, 0.5);
  color: #fff;
  font-weight: 500;
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(90, 103, 216, 0.3);
}
.glass-button i {
  width: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
  transition: color 0.2s var(--smooth-transition);
}
.glass-button.active i,
.glass-button:hover i {
  color: #fff;
}
.glass-button span:first-of-type {
  flex: 1;
}
.category-count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  min-width: 20px;
  text-align: center;
  transition: all 0.2s var(--smooth-transition);
  will-change: transform, background-color;
}
.glass-button.active .category-count {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Particle Toggle Wrapper */
.particle-toggle-wrapper {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 15px;
}
.particle-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s var(--smooth-transition);
}
.particle-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}
.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}
.switch input {
  display: none;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: all 0.3s var(--smooth-transition);
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: all 0.3s var(--smooth-transition);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
input:checked + .slider {
  background-color: #4f46e5;
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.3);
}
input:checked + .slider:before {
  transform: translateX(14px);
}

/* Info Tip */
.info-tip {
  position: absolute;
  top: 25px;
  right: 25px;
  z-index: 30;
  cursor: pointer;
}
.info-tip i {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.2s var(--smooth-transition);
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 50%;
  backdrop-filter: blur(10px);
}
.info-tip:hover i {
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.5);
}
.info-tooltip {
  position: absolute;
  top: 50px;
  right: 0;
  min-width: 300px;
  padding: 15px 20px;
  background: rgba(20, 20, 30, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.2s var(--smooth-transition);
  pointer-events: none;
}
.info-tip:hover .info-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.info-tooltip h4 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 8px 0;
  color: #fff;
}
.info-tooltip p {
  font-size: 14px;
  color: #ccc;
  margin: 0;
  line-height: 1.4;
}

/* Info Panel */
.info-panel {
  position: absolute;
  bottom: 20px;
  left: 280px;
  right: 20px;
  padding: 20px;
  border-radius: 12px;
  z-index: 20;
  transition: all 0.2s var(--smooth-transition);
}
.info-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.info-panel h3 {
  font-weight: 500;
  margin-bottom: 8px;
  color: #fff;
}
.info-panel p {
  font-size: 14px;
  color: #ccc;
  margin-bottom: 15px;
  line-height: 1.5;
}
.image-meta {
  display: flex;
  gap: 15px;
  font-size: 12px;
  color: #aaa;
}

/* Empty Gallery Notice */
.empty-gallery-notice {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 40px;
  z-index: 25;
}
.empty-gallery-notice h3 {
  font-size: 20px;
  margin-bottom: 10px;
}
.empty-gallery-notice p {
  margin-bottom: 20px;
}

/* 响应式设计 */

/* 1024px - 小屏幕桌面和大型平板 */
@media (max-width: 1024px) {
  .sidebar {
    width: 260px;
    padding: 20px;
  }
  .main-view {
    left: 280px;
  }
  .info-panel {
    left: 280px;
  }
}

/* 768px - Tablet Portrait */
@media (max-width: 768px) {
  .sidebar {
    width: 200px; /* 略微增加宽度 */
    padding: 20px;
  }
  .main-view {
    left: 270px; /* 配合侧边栏宽度调整 */
  }
  .info-panel {
    left: 270px; /* 配合侧边栏宽度调整 */
    bottom: 15px;
    right: 15px;
    padding: 15px;
  }
  .info-tip {
    top: 15px;
    right: 15px;
  }
  .info-tooltip {
    min-width: 200px;
  }
  .featured-collection {
    padding: 15px;
  }
  .category-filters-wrapper {
    padding: 15px;
  }
  .thumbnail-item img {
    height: 100px;
  }
  .glass-button {
    padding: 10px 12px;
  }
}

/* 480px - Mobile Landscape & Large Phones */
@media (max-width: 480px) {
  body {
    overflow: auto; /* 允许在移动设备上滚动 */
  }
  #gallery-container {
    position: relative;
    height: auto;
  }
  .bg-image-container {
    position: fixed; /* 背景保持固定 */
    height: 100vh;
  }
  #particle-container {
    position: fixed; /* 粒子效果保持固定 */
    height: 100vh;
  }
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 15px;
    border-radius: 0;
    box-shadow: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    /* 确保在移动端侧边栏内容可以滚动 */
    overflow-y: auto;
    max-height: calc(var(--vh, 1vh) * 40); /* 限制侧边栏在移动设备上的最大高度 */
  }
  .featured-collection {
    max-height: none; /* 允许在移动端根据内容自适应高度 */
  }
  .main-view {
    position: relative;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    height: calc(var(--vh, 1vh) * 60); /* 使用动态vh变量 */
    padding: 15px;
    display: block; /* 允许内部元素垂直堆叠 */
  }
  .info-panel {
    position: relative;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px; /* 调整移动端内边距 */
  }
  .info-tip {
    top: 10px;
    right: 10px;
    position: relative; /* 确保在移动端布局流中 */
    width: fit-content; /* 适应内容宽度 */
    margin-left: auto; /* 右对齐 */
    margin-right: 15px; /* 距离右侧边缘 */
  }
  .info-tooltip {
    position: absolute;
    top: 40px; /* 调整位置 */
    right: 0;
    left: auto; /* 确保在右侧 */
    min-width: 250px;
    max-width: calc(100vw - 30px); /* 限制最大宽度 */
  }
}

/* Swiper Base Styles */
.swiper-container {
    width: 100%; /* 占据main-content的全部宽度 */
    height: calc(100vh - 120px); /* 适应红框高度 */
    max-width: 1400px; /* 限制最大宽度 */
    max-height: 800px; /* 限制最大高度 */
    margin: auto; /* 居中 */
    position: relative; /* 确保子元素定位正确 */
    display: flex;
    align-items: center;
    justify-content: center;
    left: 0; /* 移除左侧偏移，让其在main-content中居中 */
    transform: translateX(0); /* 移除transform，让margin auto生效 */
  }
  @media (max-width: 480px) {
    .swiper-container {
      height: calc(var(--vh, 1vh) * 50); /* 调整移动端高度 */
      padding: 0 10px; /* 增加左右内边距 */
    }
  }

.swiper-slide {
    background-position: center;
    background-size: cover;
    width: 800px; /* 调整宽度 */
    height: 600px; /* 调整高度 */
    max-width: 90%; /* 限制最大宽度 */
    max-height: 90%; /* 限制最大高度 */
    border-radius: 12px;
  }
  @media (max-width: 480px) {
    .swiper-slide {
      width: 95%; /* 移动端宽度 */
      height: auto; /* 高度自适应 */
      max-height: 100%; /* 确保高度不超过容器 */
    }
  }

.swiper-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Custom Navigation Arrows */
.swiper-button-next, .swiper-button-prev {
  color: #fff;
  background-color: rgba(0, 0, 0, 0.5); /* 调整背景透明度 */
  border-radius: 50%;
  width: 50px; /* 按钮尺寸 */
  height: 50px; /* 按钮尺寸 */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease; /* 添加transform过渡 */
  z-index: 100; /* 提高z-index确保可见性 */
  top: 50%;
  transform: translateY(-50%);
  margin: 0 20px; /* 调整左右外边距，使其更靠近Cover Flow */
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* 阴影 */
  pointer-events: auto; /* 确保按钮可点击 */
}

.swiper-button-next:hover, .swiper-button-prev:hover {
  background-color: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.1); /* 悬停放大效果 */
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); /* 悬停时阴影更明显 */
}

.swiper-button-next::after, .swiper-button-prev::after {
  font-size: 28px; /* 增加箭头图标大小 */
  font-weight: bold;
}

.swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.5);
  opacity: 0.8;
}

.swiper-pagination-bullet-active {
  background: #fff;
  opacity: 1;
}

/* Coverflow Effect Specifics */
.swiper-container-coverflow .swiper-slide-shadow-left,
.swiper-container-coverflow .swiper-slide-shadow-right {
  background-image: linear-gradient(to right, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
}

.main-content {
    position: absolute;
    top: 0;
    left: 280px; /* 保持侧边栏的宽度 */
    width: calc(100% - 280px); /* 减去侧边栏宽度 */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-sizing: border-box;
    padding: 20px;
    /* 确保main-content在侧边栏右侧，并占据剩余宽度 */
    transform: translateX(0); /* 移除可能存在的transform影响 */
    transition: all var(--transition-speed) var(--smooth-transition);
  }
  @media (max-width: 480px) {
    .main-content {
      position: relative;
      left: 0;
      width: 100%;
      height: auto;
      padding: 0;
      flex-direction: column; /* 堆叠内容 */
    }
  }

/* Swiper Coverflow Specific Styles */
.swiper-3d .swiper-slide-shadow-left,
.swiper-3d .swiper-slide-shadow-right {
  background-image: linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
}

/* Custom Navigation Styles */
:root {
  --swiper-navigation-color: #fff;
  --swiper-navigation-size: 30px;
}

/* Image Frame and Shadow */
.swiper-slide-active {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}



/* Swiper Navigation Buttons Custom Styles */
.swiper-button-next, .swiper-button-prev {
    color: #fff !important; /* Ensure visibility */
    background-color: rgba(0, 0, 0, 0.4); /* Semi-transparent background */
    border-radius: 50%; /* Make them round */
    width: 50px; /* Adjust size */
    height: 50px; /* Adjust size */
    margin-top: -25px; /* Center vertically */
    transition: background-color 0.3s ease; /* Smooth transition on hover */
    z-index: 100; /* 提高z-index确保可见性 */
  }
  @media (max-width: 480px) {
    .swiper-button-next, .swiper-button-prev {
      width: 40px; /* 移动端按钮尺寸 */
      height: 40px; /* 移动端按钮尺寸 */
      margin-top: -20px; /* 垂直居中 */
    }
  }{
  background-color: rgba(0, 0, 0, 0.6); /* Darker on hover */
}

.swiper-button-prev {
    left: 300px; /* Position to the right of the sidebar */
  }
  @media (max-width: 480px) {
    .swiper-button-prev {
      left: 10px; /* 移动端靠左 */
    }
  }

.swiper-button-next {
    right: 20px; /* Position from the right edge */
  }
  @media (max-width: 480px) {
    .swiper-button-next {
      right: 10px; /* 移动端靠右 */
    }
  }

.swiper-button-next::after, .swiper-button-prev::after {
    font-size: 20px !important; /* Adjust icon size */
  }
  @media (max-width: 480px) {
    .swiper-button-next::after, .swiper-button-prev::after {
      font-size: 18px !important; /* 移动端图标尺寸 */
    }
  }

