/**
 * ImageViewer.css  v1.8
 * 轻量级图片查看器样式
 */

/* ── 背景遮罩 ── */
.iv-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.iv-backdrop.iv-visible {
  opacity: 1;
  pointer-events: auto;
}
.iv-backdrop-bg {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
}

/* ── 主容器 ── */
.iv-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10001;
  display: none;
  flex-direction: column;
  background: #000;
  color: #fff;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  user-select: none;
}
.iv-container.iv-visible {
  display: flex;
}

/* 隐藏UI */
.iv-container.iv-ui-hidden .iv-hint {
  opacity: 0;
  pointer-events: none;
}
/* header保持可交互，悬停时显示 */
.iv-container.iv-ui-hidden .iv-header {
  opacity: 0;
  pointer-events: auto;
  cursor: default;
}
.iv-container.iv-ui-hidden .iv-header:hover {
  opacity: 1;
}

/* ── 顶部栏 ── */
.iv-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.8) 0%,
    transparent 100%
  );
  cursor: default;
}
.iv-title {
  font-size: 14px;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.iv-controls {
  display: flex;
  gap: 10px;
}
.iv-btn {
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
}
.iv-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
.iv-btn:active {
  transform: scale(0.95);
}
.iv-btn-close {
  padding: 7px 14px;
  font-size: 20px;
  line-height: 1;
}
.iv-btn-fullscreen {
  background: rgba(25, 118, 210, 0.75);
  border-color: rgba(25, 118, 210, 0.75);
}
.iv-btn-fullscreen:hover {
  background: rgba(25, 118, 210, 0.95);
}
.iv-btn-reset {
  background: rgba(76, 175, 80, 0.75);
  border-color: rgba(76, 175, 80, 0.75);
}
.iv-btn-reset:hover {
  background: rgba(76, 175, 80, 0.95);
}
.iv-btn-opentab {
  background: rgba(156, 39, 176, 0.75);
  border-color: rgba(156, 39, 176, 0.75);
}
.iv-btn-opentab:hover {
  background: rgba(156, 39, 176, 0.95);
}
.iv-btn-path {
  background: rgba(233, 30, 99, 0.75);
  border-color: rgba(233, 30, 99, 0.75);
}
.iv-btn-path:hover {
  background: rgba(233, 30, 99, 0.95);
}

/* ── Toast提示 ── */
.iv-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 10002;
  pointer-events: none;
  max-width: 90vw;
  word-break: break-all;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.iv-toast::before {
  content: "📋 ";
  opacity: 0.8;
}

/* ── 视口区域 ── */
.iv-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
}
.iv-viewport:active {
  cursor: grabbing;
}

/* ── 图片 ── */
.iv-transform {
  transform-origin: center center;
  will-change: transform;
}
.iv-image {
  display: block;
  max-width: none;
  max-height: none;
  pointer-events: none;
  transition: opacity 0.15s;
}

/* ── 底部提示 ── */
.iv-hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 10px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  transition: opacity 0.2s;
}

/* ── 全景按钮 ── */
.iv-btn-pano {
  background: rgba(230, 81, 0, 0.75);
  border-color: rgba(230, 81, 0, 0.75);
}
.iv-btn-pano:hover:not(:disabled) {
  background: rgba(230, 81, 0, 0.95);
}
.iv-btn-pano:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── 退出全景按钮 ── */
.iv-btn-exit-pano {
  background: rgba(230, 81, 0, 0.9);
  border-color: rgba(230, 81, 0, 0.9);
}
.iv-btn-exit-pano:hover {
  background: rgba(230, 81, 0, 1);
}

/* ── PSV 容器 ── */
.iv-psv-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 5;
}
