.nr-img-preview {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  font: inherit;
  text-align: inherit;
  line-height: 0;
}

.nr-img-preview:focus {
  outline: none;
}

.nr-img-preview img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

figure.g-item > .nr-img-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

figure.g-item > .nr-img-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* 绝对定位子元素时，保证 figure 仍按比例占位 */
figure.g-item {
  isolation: isolate;
}

.nr-img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.32rem;
  box-sizing: border-box;
}

.nr-img-lightbox[hidden] {
  display: none !important;
}

.nr-img-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.84);
  cursor: zoom-out;
}

.nr-img-lightbox__panel {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 14rem);
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nr-img-lightbox__panel img {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 0.08rem;
  box-shadow: 0 0.24rem 0.72rem rgba(0, 0, 0, 0.45);
}

.nr-img-lightbox__close {
  position: absolute;
  top: -0.44rem;
  right: 0;
  width: 0.36rem;
  height: 0.36rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.24rem;
  line-height: 0.36rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.nr-img-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.nr-img-lightbox__close:focus {
  outline: none;
}

.nr-img-lightbox__close:focus-visible {
  box-shadow: 0 0 0 2px rgba(27, 227, 229, 0.85);
}

body.nr-img-lightbox-open {
  overflow: hidden;
}
