/* ============================================================================
 * 复刻「素材四件套」—— 商品 / 人物 / 背景 / 声音
 * 老板 2026-11-02 定：三个复刻页（深度复刻 / 分镜复刻 / 素材替换）都用这一套，
 * 一行四个小图标位，排在「添加参考视频」**上面**（同行就是这个形态）。
 * 🔴 只给 .rk-* 用，别往这里塞别的页面样式。
 * ========================================================================== */

.rk-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 2px 0 4px;
}

.rk-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}

.rk-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px dashed #e8d3bd;
  border-radius: 12px;
  background: #fffdfb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color .16s, background .16s;
}

.rk-cell:hover .rk-box { border-color: #f0a97c; background: #fffaf5; }

.rk-cell.has .rk-box {
  border-style: solid;
  border-color: #f3cbb0;
  background: #fff;
}

.rk-ico { font-size: 26px; line-height: 1; }

/* 右下角那个圆形上传标（同行也是这个位置） */
.rk-up {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #6b6b6b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  font-style: normal;
}

.rk-cell.has .rk-up { display: none; }

/* 多张**并排**显示（老板 2026-11-02：「不要叠加」）——
   1 张铺满 / 2 张各一半 / 3 张三列 / 4 张 2×2 / 5 张以上三列自动换行 */
.rk-imgs {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 2px;
  padding: 2px;
  box-sizing: border-box;
}
.rk-imgs.n1 { grid-template-columns: 1fr; }
.rk-imgs.n2 { grid-template-columns: 1fr 1fr; }
.rk-imgs.n3 { grid-template-columns: 1fr 1fr 1fr; }
.rk-imgs.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.rk-imgs.n9 { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; }
.rk-imgs .c {
  position: relative;
  overflow: hidden;
  border-radius: 7px;
  background: #f6efe7;
  cursor: pointer;
}
.rk-imgs .c img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
/* 格子里的小加号：放在第二行右侧，不遮图 */
.rk-plus {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: rgba(90, 90, 90, .82);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

/* ---------- 图片管理浮层（点缩略图弹出） ---------- */
.rk-pop {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: none;
}
.rk-pop.on { display: block; }
.rk-pop-mask {
  position: absolute;
  inset: 0;
  background: rgba(28, 22, 18, .58);
}
.rk-pop-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(86vw, 360px);
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
  box-sizing: border-box;
}
.rk-pop-x {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(38, 31, 26, .55);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.rk-pop-pic {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #f6efe7;
}
.rk-pop-pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.rk-pop-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.rk-pop-n {
  flex: 1;
  font-size: 12px;
  color: #9b7b5f;
}
.rk-pop-del, .rk-pop-add {
  border: 0;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px;
  cursor: pointer;
}
.rk-pop-del { background: #fdeceb; color: #d8453c; }
.rk-pop-add { background: #fff1e6; color: #d9601a; }

/* 张数角标：这一格放了几张（多角度图都算同一件） */
.rk-n {
  position: absolute;
  left: 3px;
  top: 3px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: rgba(249, 89, 1, .92);
  color: #fff;
  font-size: 9.5px;
  line-height: 15px;
  text-align: center;
  font-style: normal;
}

.rk-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rk-x {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 17px;
  height: 17px;
  border: 0;
  border-radius: 50%;
  background: rgba(38, 31, 26, .62);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.rk-t {
  font-size: 11.5px;
  font-weight: 600;
  color: #6b4a2f;
  line-height: 1.25;
  white-space: nowrap;
}

.rk-s {
  font-size: 9.5px;
  color: #c9a98d;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rk-cell.busy .rk-box { border-color: #f95901; }

/* 声音位：已就绪时显示「✓ 用你的声音」 */
.rk-cell.voice-on .rk-box { border-style: solid; border-color: #f0a85a; background: #fff5ec; }

.rk-vok { font-size: 22px; color: #f0902f; line-height: 1; }

@media (max-width: 340px) {
  .rk-bar { gap: 6px; }
  .rk-t { font-size: 10.5px; }
}
