/*
 * koi-gallery.css — 作品详情页(style-4)原生多图封面轮播样式。
 * 轮播容器 + 左右钮 + 页码(n/N),含 html.koi-dark 暗色(★手动开关驱动,禁 @media prefers-color-scheme)。
 * 仅作用于 #pic-box[data-koi-gallery](原生多图作品);老作品/单图不加此类,零影响。
 */

#pic-box[data-koi-gallery] { position: relative; }

.koi-gallery {
  position: relative;
  width: 100%;
  line-height: 0;
}

.koi-gallery-link {
  display: block;
  width: 100%;
}

.koi-gallery-img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
}

/* 切帧淡入 */
.koi-gallery-fade { animation: koiGalleryFade .28s ease; }
@keyframes koiGalleryFade { from { opacity: .35; } to { opacity: 1; } }

/* 左右按钮(叠加在图上,自身点击不触发灯箱) */
.koi-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .38);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: .85;
  transition: opacity .2s ease, background .2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.koi-gallery-nav:hover { opacity: 1; background: rgba(0, 0, 0, .55); }
.koi-gallery-nav:focus { outline: none; }
.koi-gallery-prev { left: 10px; }
.koi-gallery-next { right: 10px; }

/* 页码 n/N */
.koi-gallery-counter {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 5;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  letter-spacing: .5px;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}
.koi-gallery-sep { margin: 0 1px; opacity: .85; }

/* 小屏 */
@media (max-width: 768px) {
  .koi-gallery-nav { width: 34px; height: 34px; font-size: 15px; }
  .koi-gallery-prev { left: 6px; }
  .koi-gallery-next { right: 6px; }
}

/* 深色模式(html.koi-dark) */
html.koi-dark .koi-gallery-nav { background: rgba(255, 255, 255, .14); color: #eaeaea; }
html.koi-dark .koi-gallery-nav:hover { background: rgba(255, 255, 255, .24); }
html.koi-dark .koi-gallery-counter { background: rgba(255, 255, 255, .16); color: #eaeaea; }
