/* 新闻正文内图片：文末集中展示；文中原位置为「图片 N」链接；灯箱放大 */

.news-article-images-appendix {
  box-sizing: border-box;
  margin: 28px 0 0;
  padding: 16px 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
}

.news-article-images-stack {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 16px 18px;
  align-items: start;
  justify-items: center;
}

#news-article-body .news-inline-img-ref,
.news-gallery-body .news-inline-img-ref {
  display: inline;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: #0b57d0;
  white-space: nowrap;
}

#news-article-body .news-inline-img-ref:hover,
.news-gallery-body .news-inline-img-ref:hover {
  color: #0945a8;
}

.news-article-images-preface-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  color: #222;
}

.news-article-images-preface-hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #666;
  font-weight: normal;
}

.news-article-images-preface-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.news-article-images-preface-list li {
  margin: 0;
}

.news-article-images-preface-list a {
  display: inline-block;
  padding: 4px 10px;
  font-size: 14px;
  line-height: 1.35;
  color: #0b57d0;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid rgba(11, 87, 208, 0.35);
  background: rgba(255, 255, 255, 0.7);
}

.news-article-images-preface-list a:hover {
  background: rgba(11, 87, 208, 0.08);
  text-decoration: none;
}

#news-article-body figure.news-article-thumb-figure,
.news-gallery-body figure.news-article-thumb-figure {
  margin: 0;
  max-width: 100%;
  width: 100%;
  padding: 0;
  text-align: center;
  scroll-margin-top: 12px;
}

/* 文末图集：仅占栅格单元宽度，多图横向排列、排满换行 */
.news-article-images-stack figure.news-article-thumb-figure {
  margin: 0;
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
}

#news-article-body figure.news-article-thumb-figure .news-article-thumb-caption,
.news-gallery-body figure.news-article-thumb-figure .news-article-thumb-caption {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #555;
}

html[data-theme="dark"] .news-article-images-appendix {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .news-article-images-stack {
  border-top-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] #news-article-body .news-inline-img-ref,
html[data-theme="dark"] .news-gallery-body .news-inline-img-ref {
  color: #7eb8ff;
}

html[data-theme="dark"] #news-article-body .news-inline-img-ref:hover,
html[data-theme="dark"] .news-gallery-body .news-inline-img-ref:hover {
  color: #a8d0ff;
}

html[data-theme="dark"] .news-article-images-preface-title {
  color: #e8e8e8;
}

html[data-theme="dark"] .news-article-images-preface-hint {
  color: #9a9a9a;
}

html[data-theme="dark"] .news-article-images-preface-list a {
  color: #7eb8ff;
  border-color: rgba(126, 184, 255, 0.45);
  background: rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .news-article-images-preface-list a:hover {
  background: rgba(126, 184, 255, 0.12);
}

html[data-theme="dark"] #news-article-body figure.news-article-thumb-figure .news-article-thumb-caption,
html[data-theme="dark"] .news-gallery-body figure.news-article-thumb-figure .news-article-thumb-caption {
  color: #aaa;
}

#news-article-body img.news-article-thumb,
.news-gallery-body img.news-article-thumb {
  box-sizing: border-box;
  max-width: min(100%, 420px);
  max-height: 280px;
  width: auto !important;
  height: auto !important;
  cursor: zoom-in;
  display: block;
  margin: 0 auto;
  padding: 4px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  vertical-align: middle;
}

/* 文末图集内：限制为单元格宽度，便于多列并排 */
#news-article-body .news-article-images-stack img.news-article-thumb,
.news-gallery-body .news-article-images-stack img.news-article-thumb {
  max-width: 100%;
  max-height: 220px;
}

#news-article-body img.news-article-thumb:hover,
.news-gallery-body img.news-article-thumb:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
  transform: translateY(-1px);
}

html[data-theme="dark"] #news-article-body img.news-article-thumb,
html[data-theme="dark"] .news-gallery-body img.news-article-thumb {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] #news-article-body img.news-article-thumb:hover,
html[data-theme="dark"] .news-gallery-body img.news-article-thumb:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

/* 灯箱 */
#news-img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#news-img-lightbox.news-lightbox-open {
  display: flex;
}

#news-img-lightbox .news-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: zoom-out;
}

#news-img-lightbox .news-lightbox-stage-wrap {
  position: relative;
  z-index: 1;
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#news-img-lightbox .news-lightbox-stage-wrap img {
  pointer-events: auto;
  max-width: 96vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  cursor: default;
  display: block;
}

#news-img-lightbox .news-lightbox-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22%;
  z-index: 2;
  cursor: pointer;
  border: none;
  background: transparent;
  color: transparent;
  -webkit-tap-highlight-color: transparent;
}

#news-img-lightbox .news-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.06);
}

#news-img-lightbox .news-lightbox-nav-prev {
  left: 0;
}

#news-img-lightbox .news-lightbox-nav-next {
  right: 0;
}

#news-img-lightbox .news-lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  line-height: 46px;
  text-align: center;
  font-size: 36px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

#news-img-lightbox .news-lightbox-nav-prev .news-lightbox-arrow {
  left: 8px;
}

#news-img-lightbox .news-lightbox-nav-next .news-lightbox-arrow {
  right: 8px;
}

#news-img-lightbox .news-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#news-img-lightbox .news-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

#news-img-lightbox .news-lightbox-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  letter-spacing: 0.02em;
}

#news-img-lightbox.news-lightbox-single .news-lightbox-nav,
#news-img-lightbox.news-lightbox-single .news-lightbox-counter {
  display: none;
}

body.news-lightbox-active {
  overflow: hidden;
}

@media (max-width: 600px) {
  .news-article-images-stack {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 12px 10px;
  }

  #news-article-body img.news-article-thumb,
  .news-gallery-body img.news-article-thumb {
    max-width: 100%;
    max-height: 220px;
  }

  #news-article-body .news-article-images-stack img.news-article-thumb,
  .news-gallery-body .news-article-images-stack img.news-article-thumb {
    max-height: 180px;
  }

  #news-img-lightbox .news-lightbox-nav {
    width: 28%;
  }
}
