@charset 'utf-8';
/* ============================================================
   一级页面/css/gallery.css —— 高清图库 页面样式（新闻中心-高清圖庫）
   说明：
   1. 1rem = 100px（与 common.css 自适应换算一致）
   2. 兼容 IE11：Flexbox 均书写 -ms- 前缀；栅格使用 float + 百分比宽度
   3. 禁止 CSS Grid；头尾/面包屑/分页复用 common/topbottom-hh.css
   ============================================================ */

/* ---------- 内容区（紫色渐变背景） ---------- */
.gallery-main {
  background: linear-gradient(180deg, #2a0f74 0%, #9780d3 100%);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF2A0F74', endColorstr='#FF9780D3', GradientType=0);
  padding-bottom: 10px;
  padding-bottom: 0.1rem;
  background-color: #2a0f74;
}
.gallery-inner {
  width: 1540px;
  width: 15.4rem;
  margin: 0 auto;
  padding-bottom: 30px;
  padding-bottom: 0.3rem;
}
/* 面包屑（紫色背景上为白色文字） */
.gallery-inner .hh-crumb {
  color: #ffffff;
}
.gallery-inner .hh-crumb a {
  color: #ffffff;
}
.gallery-inner .hh-crumb a:hover {
  color: #e8e0f7;
}

/* ---------- 图片网格（gallery-item 平铺，:nth-child 分行） ---------- */
.gallery-grid {
  width: 100%;
  overflow: hidden;
}
.gallery-item {
  position: relative;
  float: left;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
  cursor: pointer;
}
/* 3 列行（第 1-3、8-10 项）：宽 33.3333%、高 270px */
.gallery-item:nth-child(1),
.gallery-item:nth-child(2),
.gallery-item:nth-child(3),
.gallery-item:nth-child(8),
.gallery-item:nth-child(9),
.gallery-item:nth-child(10) {
  width: 33.3333%;
  height: 270px;
  height: 2.7rem;
}
/* 4 列行（第 4-7、11-14 项）：宽 25%、高 203px */
.gallery-item:nth-child(4),
.gallery-item:nth-child(5),
.gallery-item:nth-child(6),
.gallery-item:nth-child(7),
.gallery-item:nth-child(11),
.gallery-item:nth-child(12),
.gallery-item:nth-child(13),
.gallery-item:nth-child(14) {
  width: 25%;
  height: 203px;
  height: 2.03rem;
}
/* 行首清除浮动（第 1、4、8、11 项） */
.gallery-item:nth-child(1),
.gallery-item:nth-child(4),
.gallery-item:nth-child(8),
.gallery-item:nth-child(11) {
  clear: both;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.5s ease;
  -webkit-transition: -webkit-transform 0.5s ease;
  -ms-transition: -ms-transform 0.5s ease;
}
.gallery-item:hover img {
  transform: scale3d(1.05, 1.05, 1.05);
  -webkit-transform: scale3d(1.05, 1.05, 1.05);
  -ms-transform: scale3d(1.05, 1.05, 1.05);
}
/* 鼠标悬停：紫色外发光 */
.gallery-item:hover {
  box-shadow: 0 0 8px 0 #6440c3;
  z-index: 1;
}
/* 黑色遮罩（伪元素）：默认隐藏，hover 显示 */
.gallery-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  /* IE11 兜底 */
  background: #40000000;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
  -webkit-transition: opacity 0.3s ease;
}
.gallery-item:hover::before {
  opacity: 1;
}
/* 放大镜（伪元素）：默认隐藏，hover 显示 */
.gallery-item::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 21px;
  width: 0.21rem;
  height: 21px;
  height: 0.21rem;
  margin-left: -10px;
  margin-left: -0.1rem;
  margin-top: -10px;
  margin-top: -0.1rem;
  background: url(../common/gallery/zoom.svg) no-repeat center;
  background-size: 100% 100%;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  -webkit-transition: opacity 0.3s ease, -webkit-transform 0.3s ease;
}
.gallery-item:hover::after {
  opacity: 1;
  -ms-transform: scale(1.1);
  transform: scale(1.1);
}

/* ---------- 分页器（紫色背景上） ---------- */
.gallery-inner .hh-pagination {
  margin-bottom: 0;
}
/* ================= 大图弹窗（Swiper 轮播） ================= */
.gallery-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
}
.gallery-lightbox.open {
  display: block;
}
/* 弹窗打开时锁定背景滚动（移动端） */
body.lb-open {
  overflow: hidden;
}
.gallery-lightbox .lb-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}
/* 关闭按钮 */
.gallery-lightbox .lb-close {
  position: absolute;
  top: 20px;
  top: 0.2rem;
  right: 30px;
  right: 0.3rem;
  width: 44px;
  width: 0.44rem;
  height: 44px;
  height: 0.44rem;
  border: none;
  background: none;
  color: #ffffff;
  font-size: 44px;
  font-size: 0.44rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.gallery-lightbox .lb-close:hover {
  color: #9780d3;
}
/* 轮播容器 */
.gallery-lightbox .lb-swiper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80%;
  max-width: 1200px;
  max-width: 12rem;
  height: 7.8rem;
  height: 78vh;
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  z-index: 1;
}
.gallery-lightbox .lb-swiper .swiper-slide {
  text-align: center;
}
/* 大图：绝对定位于弹窗中央（不受 Swiper 高度链影响，任何尺寸均精确居中），等比缩放不超出视口，滚轮可缩放 */
.gallery-lightbox .lb-swiper .swiper-slide img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 7.8rem;
  max-height: 78vh;
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  display: block;
  cursor: zoom-in;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
/* 放大后按住可拖动查看 */
.gallery-lightbox .lb-swiper .swiper-slide img.lb-zoomed {
  cursor: grab;
}
.gallery-lightbox .lb-swiper .swiper-slide img.lb-zoomed.lb-dragging {
  cursor: grabbing;
}
/* 左右切换按钮 */
.gallery-lightbox .lb-prev,
.gallery-lightbox .lb-next {
  position: absolute;
  top: 50%;
  width: 56px;
  width: 0.56rem;
  height: 56px;
  height: 0.56rem;
  margin-top: -28px;
  margin-top: -0.28rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
}
.gallery-lightbox .lb-prev {
  left: 30px;
  left: 0.3rem;
}
.gallery-lightbox .lb-next {
  right: 30px;
  right: 0.3rem;
}
.gallery-lightbox .lb-prev::before,
.gallery-lightbox .lb-next::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  width: 0.14rem;
  height: 14px;
  height: 0.14rem;
  border-left: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
}
.gallery-lightbox .lb-prev::before {
  -ms-transform: translate(-30%, -50%) rotate(45deg);
  transform: translate(-30%, -50%) rotate(45deg);
}
.gallery-lightbox .lb-next::before {
  -ms-transform: translate(-70%, -50%) rotate(-135deg);
  transform: translate(-70%, -50%) rotate(-135deg);
}
.gallery-lightbox .lb-prev:hover,
.gallery-lightbox .lb-next:hover {
  background: rgba(151, 128, 211, 0.5);
}

/* ---------- 响应式（平板/移动端 ≤768px） ---------- */
@media screen and (max-width: 768px) {
  .gallery-main {
    padding: 0 0.2rem 0.1rem;
  }
  .gallery-inner {
    width: 100%;
    padding-bottom: 0.2rem;
    box-sizing: border-box;
  }
  /* 移动端：gallery-grid 一行两个展示（flex 自动换行） */
  .gallery-grid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
  }
  .gallery-item:nth-child(n) {
    float: none;
    width: 50%;
    height: 1.8rem;
  }
  .gallery-inner .hh-crumb,
  .gallery-inner .hh-crumb a {
    font-size: 0.26rem;
  }
  .gallery-lightbox .lb-swiper {
    width: 92%;
    height: 7.2rem;
    height: 72vh;
  }
  /* 大图：绝对居中 + 不超出视口高度（竖屏长图安全） */
  .gallery-lightbox .lb-swiper .swiper-slide img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 7.2rem;
    max-height: 72vh;
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
  }
  .gallery-lightbox .lb-prev {
    left: 0.1rem;
  }
  .gallery-lightbox .lb-next {
    right: 0.1rem;
  }
  /* 触控目标增大（固定 px，不受 rem 缩放影响，至少 44px） */
  .gallery-lightbox .lb-prev,
  .gallery-lightbox .lb-next {
    width: 44px;
    height: 44px;
    margin-top: -22px;
  }
  .gallery-lightbox .lb-prev::before,
  .gallery-lightbox .lb-next::before {
    width: 12px;
    height: 12px;
    border-left-width: 2px;
    border-bottom-width: 2px;
  }
  .gallery-lightbox .lb-close {
    top: 0.1rem;
    right: 0.15rem;
    width: 44px;
    height: 44px;
    font-size: 40px;
  }
}
