/**
 * 工具详情截图轮播（独立于 Vite 构建，服务器无 npm 时也能即时生效）
 * 列表态：固定视口（限高 + 宽度不越过左右箭头），图 object-contain 居中
 */

.mytb-screenshots {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.mytb-screenshots-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  align-items: stretch;
  width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.mytb-screenshots-track::-webkit-scrollbar {
  display: none;
}

.mytb-screenshot-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-width: 0;
}

/* 固定显示区：高度封顶，左右留出箭头空间；框本身不可见，圆角打在图片上 */
.mytb-screenshot-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: calc(100% - 64px);
  max-width: 100%;
  height: 240px;
  margin: 0 auto;
  position: relative;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: zoom-in;
  padding: 0;
  text-decoration: none;
}

@media (min-width: 640px) {
  .mytb-screenshot-frame {
    width: calc(100% - 80px);
    height: 280px;
  }
}

.mytb-screenshot-frame:hover {
  box-shadow: none;
}

.mytb-screenshot-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 12px;
}

.mytb-screenshots-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ededed;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #222;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mytb-screenshots-nav[hidden] {
  display: none;
}

.mytb-screenshots-nav:hover {
  background: #fff;
}

.mytb-screenshots-nav--prev {
  left: 8px;
}

.mytb-screenshots-nav--next {
  right: 8px;
}

@media (min-width: 640px) {
  .mytb-screenshots-nav {
    width: 40px;
    height: 40px;
  }

  .mytb-screenshots-nav--prev {
    left: 12px;
  }

  .mytb-screenshots-nav--next {
    right: 12px;
  }
}

.mytb-screenshot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 16px;
}

@media (min-width: 640px) {
  .mytb-screenshot-lightbox {
    padding: 32px;
  }
}

.mytb-screenshot-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.mytb-screenshot-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9999px;
  background: #fff;
  color: #71717a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mytb-screenshot-lightbox-close:hover {
  background: #f9fafb;
}

.mytb-screenshot-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.9);
  color: #222;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mytb-screenshot-lightbox-nav:hover {
  background: #fff;
}

.mytb-screenshot-lightbox-nav--prev {
  left: 12px;
}

.mytb-screenshot-lightbox-nav--next {
  right: 12px;
}

@media (min-width: 640px) {
  .mytb-screenshot-lightbox-nav--prev {
    left: 24px;
  }

  .mytb-screenshot-lightbox-nav--next {
    right: 24px;
  }
}
