.image-lightbox {
  width: min(96vw, 1840px);
  height: min(94svh, 1180px);
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(218, 205, 255, 0.28);
  border-radius: 24px;
  background:
    radial-gradient(circle at 82% 8%, rgba(150, 107, 242, 0.18), transparent 28%),
    #08070f;
  color: #f7f4ff;
  box-shadow:
    0 50px 160px rgba(0, 0, 0, 0.72),
    0 0 90px rgba(125, 85, 220, 0.18);
}

.image-lightbox::backdrop {
  background: rgba(3, 3, 8, 0.88);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
}

.lightbox-shell {
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.lightbox-header,
.lightbox-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  background: rgba(8, 7, 15, 0.86);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.lightbox-header {
  justify-content: space-between;
  border-bottom: 1px solid rgba(218, 205, 255, 0.14);
}

.lightbox-heading {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lightbox-heading span {
  color: #b99bff;
  font-family: "Gaoel", "FZHei-B01S", "Microsoft YaHei", sans-serif;
  font-size: 8px;
  letter-spacing: 0.09em;
}

.lightbox-heading strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lightbox-control {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(218, 205, 255, 0.2);
  border-radius: 50%;
  background: rgba(185, 155, 255, 0.06);
  color: #f7f4ff;
  cursor: pointer;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.lightbox-control:hover {
  border-color: #b99bff;
  background: #f7f4ff;
  color: #05050a;
}

.lightbox-control svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.lightbox-stage {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: auto;
  padding: 18px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.018) 25%, transparent 25%) 0 0 / 20px 20px,
    linear-gradient(-45deg, rgba(255, 255, 255, 0.018) 25%, transparent 25%) 0 10px / 20px 20px,
    #05050a;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-out;
}

.lightbox-footer {
  justify-content: space-between;
  border-top: 1px solid rgba(218, 205, 255, 0.14);
  color: #b8b1c5;
  font-family: "Gaoel", "FZHei-B01S", "Microsoft YaHei", sans-serif;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.lightbox-footer b {
  color: #d3c2ff;
  font-weight: 500;
}

.lightbox-original {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 12px;
  padding: 0 15px;
  border: 1px solid rgba(218, 205, 255, 0.22);
  border-radius: 999px;
  color: #f7f4ff;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.lightbox-original:hover {
  border-color: #b99bff;
  background: #f7f4ff;
  color: #05050a;
}

.lightbox-error {
  max-width: 420px;
  color: #b8b1c5;
  text-align: center;
}

body.lightbox-open {
  overflow: hidden;
}

main img.is-lightbox-trigger {
  cursor: zoom-in;
}

main img.is-lightbox-trigger:focus-visible {
  outline: 2px solid #d3c2ff;
  outline-offset: 4px;
}

@media (max-width: 640px) {
  .image-lightbox {
    width: 100vw;
    height: 100svh;
    border: 0;
    border-radius: 0;
  }

  .lightbox-header,
  .lightbox-footer {
    padding: 10px 12px;
  }

  .lightbox-stage {
    padding: 8px;
  }

  .lightbox-heading strong {
    max-width: 46vw;
    font-size: 12px;
  }

  .lightbox-actions {
    gap: 6px;
  }

  .lightbox-footer > span {
    max-width: 48vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-lightbox *,
  .image-lightbox *::before,
  .image-lightbox *::after {
    transition-duration: 0.01ms !important;
  }
}
