/* PTG Slider minimal styles */
.ptg-slider {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
  /* 默认16:9比例，优先保障横屏展示 */
  aspect-ratio: 16 / 9;
  /* 兼容性回退：如果不支持aspect-ratio，设置一个默认高度 */
  min-height: 300px;
}

.ptg-slider-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.4s ease;
}

.ptg-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ptg-slide img {
  display: block;
  width: 100%;
  height: 100%;
  /* 核心：保持比例适应容器，不裁剪，竖屏图片会自动缩放以适应高度 */
  object-fit: contain;
  cursor: pointer;
}

.ptg-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.75);
  border: none;
  color: #333;
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.2s;
}
.ptg-nav:hover {
  background: rgba(255,255,255,1);
}
.ptg-prev { left: 10px; }
.ptg-next { right: 10px; }

.ptg-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.ptg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background 0.2s;
}

.ptg-dot.active {
  background: #fff;
}

/* Lightbox Styles */
.ptg-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.ptg-lightbox.active {
  opacity: 1;
  visibility: visible;
}
.ptg-lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  cursor: zoom-out;
}
.ptg-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  z-index: 10000;
  line-height: 1;
}

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

.ptg-lightbox-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 0; /* flex layout trick */
  position: relative;
}

.ptg-lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  cursor: grab;
  transition: transform 0.1s ease-out;
}

.ptg-lightbox img:active {
  cursor: grabbing;
}

.ptg-lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: none;
  font-size: 40px;
  padding: 20px;
  cursor: pointer;
  z-index: 10001;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.ptg-lightbox-btn:hover {
  background: rgba(255,255,255,0.3);
}
.ptg-lightbox-prev { left: 20px; }
.ptg-lightbox-next { right: 20px; }

.ptg-lightbox-thumbs {
  height: 80px;
  width: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  overflow-x: auto;
  z-index: 10002;
}

.ptg-lightbox-thumb {
  height: 60px;
  width: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s;
}
.ptg-lightbox-thumb:hover {
  opacity: 1;
}
.ptg-lightbox-thumb.active {
  border-color: #fff;
  opacity: 1;
  transform: scale(1.1);
}
