/* PickIt · 图片拼接 · 工具专属样式  author: ruan
 * 公共部分见 /shared/base.css */

/* 缩略图列表 */
.thumbs {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  min-height: 24px;
}
.thumbs:empty { display: none; }

.thumb {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  aspect-ratio: 1;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  /* 缩略图网格里拖拽换序是二维手势，和滑动页面冲突；纵向滑动交回浏览器，
     触屏换序改用缩略图上的「前移 / 后移」按钮。鼠标拖拽不受影响。 */
  touch-action: pan-y;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.thumb .idx {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(29, 27, 23, 0.75);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--mono);
}
.thumb .del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(29, 27, 23, 0.75);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.thumb .mv {
  position: absolute;
  bottom: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #1d1b17;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.thumb .mv-prev { left: 4px; }
.thumb .mv-next { right: 4px; }
.thumb:hover .del, .thumb:hover .mv, .thumb:focus-within .del, .thumb:focus-within .mv { opacity: 1; }
.thumb .del:hover { background: var(--danger); }
.thumb .mv:hover { background: #fff; color: #0b5c56; }
.thumb .mv:disabled { opacity: 0 !important; pointer-events: none; }

/* 触屏设备没有 hover，操作按钮常驻显示并放大触控面积 */
@media (hover: none), (pointer: coarse) {
  .thumb .del, .thumb .mv { opacity: 1; width: 36px; height: 36px; font-size: 18px; }
}
body.is-touch .thumb .del, body.is-touch .thumb .mv { opacity: 1; width: 36px; height: 36px; font-size: 18px; }

.thumb.is-dragging { opacity: 0.35; }
.thumb.is-target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); transform: scale(1.03); }

body.is-sorting { cursor: grabbing; }
body.is-sorting * { cursor: grabbing !important; }

.drag-ghost {
  position: fixed;
  z-index: 100;
  width: 88px;
  height: 88px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-3deg);
  border: 2px solid #fff;
}
.drag-ghost img { width: 100%; height: 100%; object-fit: cover; }

#seamlessBtn { margin-top: 16px; }
