/* ===== 图片批量排序弹窗样式 ===== */
/* 微信风格：5 张一行、角标删除、长按拖拽 */

.ir-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ir-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.ir-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  background: #fff;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.ir-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line, #e0dcd5);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink, #2c2420);
}

.ir-hint {
  margin-left: auto;
  margin-right: 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted, #8a7d6e);
}

.ir-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--cream, #f0ebe3);
  color: var(--ink, #2c2420);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ir-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ir-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--cream, #f0ebe3);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: grab;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease;
  will-change: transform;
}

.ir-item:active {
  cursor: grabbing;
  transform: scale(0.96);
}

.ir-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ir-item.is-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--olive, #5a6b3c);
  border-radius: 6px;
  pointer-events: none;
}

.ir-cover-tag {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--olive, #5a6b3c);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
}

.ir-item.is-cover .ir-cover-tag {
  opacity: 1;
}

.ir-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--terra, #c84a3e);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
}

.ir-item.ir-placeholder {
  opacity: 0.35;
  transform: scale(0.96);
}

.ir-ghost {
  position: fixed;
  z-index: 300;
  border-radius: 6px;
  overflow: hidden;
  opacity: 0.92;
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.ir-ghost img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ir-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line, #e0dcd5);
  display: flex;
  justify-content: center;
}

.ir-footer .btn {
  min-width: 120px;
}

/* 禁用关键按钮的 active 缩放，避免“只弹动没反应” */
.ir-del:active,
.ir-close:active,
.ir-footer .btn:active {
  transform: none !important;
}

@media (max-width: 400px) {
  .ir-grid {
    gap: 6px;
    padding: 12px;
  }
}
