/* 通用轮播图（cms-gallery）
 * 编辑态：gallery.js 未运行时不加 .is-ready，所有图片纵向排布，便于后台直接点选；
 * 运行态：加 .is-ready 后切换为横向轨道，箭头/圆点出现。
 */
.cms-gallery {
  position: relative;
  width: 100%;
}

.cms-gallery .cms-gallery__viewport {
  overflow: hidden;
  width: 100%;
}

.cms-gallery .cms-gallery__track {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cms-gallery.is-ready .cms-gallery__track {
  display: flex;
  transition: transform 0.45s ease;
}

.cms-gallery .cms-gallery__slide {
  flex: 0 0 100%;
  min-width: 0;
}

.cms-gallery .cms-gallery__figure {
  margin: 0;
}

.cms-gallery .cms-gallery__img {
  width: 100%;
  height: auto;
}

.cms-gallery .cms-gallery__link {
  display: block;
  text-decoration: none;
}

.cms-gallery .cms-gallery__caption {
  margin-top: 12px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

/* 图注压在图片底部（对应设计稿中带黑色渐变的检测设备图注） */
.cms-gallery--overlay .cms-gallery__figure {
  position: relative;
  overflow: hidden;
}

.cms-gallery--overlay .cms-gallery__figure::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 106px;
  background: linear-gradient(0deg, #000000 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}

.cms-gallery--overlay .cms-gallery__caption {
  position: absolute;
  right: 0;
  bottom: 39px;
  left: 0;
  z-index: 1;
  margin: 0;
  color: #ffffff;
  font-size: 20px;
  font-weight: 500;
  line-height: 22px;
}

.cms-gallery .cms-gallery__nav,
.cms-gallery .cms-gallery__dots {
  display: none;
}

.cms-gallery.is-ready .cms-gallery__nav {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.45);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.cms-gallery.is-ready .cms-gallery__nav:hover {
  background: rgba(17, 24, 39, 0.7);
}

/* 单张图片时不需要左右切换 */
.cms-gallery.is-ready.is-single .cms-gallery__nav {
  display: none;
}

.cms-gallery.is-ready .cms-gallery__nav::before {
  content: "";
  width: 9px;
  height: 9px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
}

.cms-gallery.is-ready .cms-gallery__nav--prev {
  left: 16px;
}

.cms-gallery.is-ready .cms-gallery__nav--prev::before {
  transform: rotate(-135deg);
}

.cms-gallery.is-ready .cms-gallery__nav--next {
  right: 16px;
}

.cms-gallery.is-ready .cms-gallery__nav--next::before {
  transform: rotate(45deg);
}

.cms-gallery.is-ready .cms-gallery__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.cms-gallery .cms-gallery__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #c6cbd8;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.cms-gallery .cms-gallery__dot.is-active {
  background: #1b4fa0;
}

@media (prefers-reduced-motion: reduce) {
  .cms-gallery.is-ready .cms-gallery__track {
    transition: none;
  }
}

@media (max-width: 768px) {
  .cms-gallery.is-ready .cms-gallery__nav {
    width: 34px;
    height: 34px;
    margin-top: -17px;
  }

  .cms-gallery.is-ready .cms-gallery__nav--prev {
    left: 8px;
  }

  .cms-gallery.is-ready .cms-gallery__nav--next {
    right: 8px;
  }
}
