/* M17：大图查看器新增的「缩放 / 平移 / 切图」样式。
   老的那几组（.image-viewer / .iv-image / .iv-toolbar / .iv-download …）还在 style.css 里没动，
   这里只补新件 —— 这样两份文件互不干扰，样式也不用从 style.css 里抠出来。
   ⚠️ 由 templates/_sidebar.html 引入（全站唯一入口）。 */

/* 舞台：把 <img> 和切图网格包在一起，缩放/平移作用在舞台上 → 网格永远跟着图跑 */
.iv-stage {
  position: relative;
  display: inline-flex;
  transform-origin: 0 0;   /* 与画布一致：缩放锚点用 0 0，配 zoomAt 的数学 */
  will-change: transform;
}

.iv-stage.is-dragging {
  cursor: grabbing;
}

.iv-stage {
  cursor: grab;
}

/* 工具栏里的缩放件 */
.iv-zoom {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.iv-zoom:hover {
  background: rgba(0, 0, 0, 0.8);
}

.iv-zoompct {
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 10px;
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 46px;
  text-align: center;
}

.iv-splitbtn,
.iv-cropbtn {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

.iv-splitbtn:hover,
.iv-cropbtn:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* C67：切图网格 / 底部切图条（.iv-grid / .iv-cell / .iv-splitbar / .iv-split-*）已退役 ——
   点「✂️ 切割」直接开 window.SplitPanel（split_panel.css 自带样式），这里只留结果提示。 */

.iv-split-msg {
  color: #fca5a5;
}

.iv-split-msg.is-ok {
  color: #86efac;
}

/* ==========================================================================
   C54：右侧信息栏（只有 open(urls, idx, {meta, actions}) 传了 opts 才显示）
   - 默认 broad：信息栏 280px，大图区域自动让位
   - .iv-narrow：信息栏收起，回到改造前的纯大图布局
   - 小屏（<900px）：默认收起（避免把大图挤没）
   ========================================================================== */
.iv-info {
  position: absolute;
  top: 56px;
  right: 12px;
  bottom: 72px;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(16, 16, 24, 0.94);
  color: #e8e8ea;
  font-size: 13px;
  overflow: auto;
  z-index: 2;
}

.iv-info[hidden] {
  display: none !important;
}

.iv-narrow .iv-info {
  display: none !important;
}

.iv-info-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.iv-info-title {
  flex: 1 1 auto;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iv-info-toggle {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: transparent;
  color: #e8e8ea;
  cursor: pointer;
  line-height: 1;
}

.iv-info-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

.iv-info-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.iv-info-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.5;
}

.iv-info-label {
  flex: 0 0 62px;
  color: rgba(232, 232, 234, 0.55);
}

.iv-info-value {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

.iv-info-value.is-copy {
  cursor: pointer;
  text-decoration: underline dotted rgba(232, 232, 234, 0.4);
}

.iv-info-value.is-multiline {
  white-space: pre-wrap;
  max-height: 120px;
  overflow: auto;
}

.iv-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.iv-info-btn {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #e8e8ea;
  font-size: 12px;
  cursor: pointer;
}

.iv-info-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.iv-info-btn.is-danger {
  border-color: rgba(240, 80, 80, 0.6);
  color: #ff9b9b;
}

@media (max-width: 900px) {
  .iv-info {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: 45vh;
  }
}
