/* VchatMediaViewer · IM 群富媒体应用内查看器（对标 Telegram，绝不新开页面） */
.vmv-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 88px;
}
.vmv-overlay[hidden] {
  display: none;
}
.vmv-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 26px;
  line-height: 38px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
}
.vmv-scan {
  position: absolute;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 3;
  min-width: min(280px, calc(100vw - 48px));
  border: none;
  border-radius: 24px;
  padding: 14px 22px;
  background: rgba(47, 158, 110, 0.96);
  color: #fff;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.2;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: vmv-scan-in 0.28s ease-out;
}
@keyframes vmv-scan-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
.vmv-scan:disabled {
  opacity: 0.55;
  cursor: wait;
}
.vmv-scan:active {
  filter: brightness(1.08);
}
.vmv-overlay--video .vmv-scan {
  display: none !important;
}
.vmv-close:active {
  background: rgba(255, 255, 255, 0.28);
}
.vmv-download {
  position: absolute;
  top: 14px;
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 22px;
  line-height: 38px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
}
.vmv-download:active {
  background: rgba(255, 255, 255, 0.28);
}
.vmv-stage {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vmv-img,
.vmv-video {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  border-radius: 6px;
  object-fit: contain;
}
.vmv-img {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  cursor: zoom-in;
  will-change: transform;
}
.vmv-img--zoomed {
  cursor: grab;
}
.vmv-img--zoomed:active {
  cursor: grabbing;
}
html.vmv-lock,
html.vmv-lock body {
  overflow: hidden;
}
.vmv-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.vmv-nav:disabled {
  opacity: 0.25;
  cursor: default;
}
.vmv-nav--prev {
  left: 12px;
}
.vmv-nav--next {
  right: 12px;
}
.vmv-counter {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 13px;
}

.vmv-overlay--video {
  padding: 0;
  background: #000;
}
.vmv-overlay--video .vmv-stage {
  width: 100%;
  height: 100%;
}
.vmv-overlay--video .vmv-close {
  top: calc(10px + env(safe-area-inset-top, 0));
  right: calc(10px + env(safe-area-inset-right, 0));
  width: 44px;
  height: 44px;
  line-height: 42px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.vmv-overlay--portrait .vmv-video--portrait {
  width: auto;
  height: 100%;
  max-height: 100dvh;
  max-width: 100vw;
  border-radius: 0;
  object-fit: contain;
  background: #000;
}
.vmv-overlay--video:not(.vmv-overlay--portrait) .vmv-video {
  width: 100%;
  max-width: 100vw;
  max-height: 100dvh;
  border-radius: 0;
}
html.vmv-lock-video,
html.vmv-lock-video body {
  overflow: hidden;
  background: #000;
}
