/* ============================================================
 * upload.css —— 上传界面（多组图片 + 音效）
 * 注意：全项目不使用毛玻璃（backdrop-filter），一律用不透明或半透明纯色背景。
 * ============================================================ */

#screen-upload {
  overflow: auto;
  align-items: center;
  gap: 12px;
  padding: 4px 0 6px;
}

.upload-hint {
  max-width: 900px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--dim);
  text-align: center;
}

.upload-hint b { color: var(--txt); font-weight: 600; }

/* ---------------- 关卡导航与关卡条 ---------------- */

.level-nav {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.level-nav .btn { flex: 0 0 auto; }

.level-title-wrap { flex: 1 1 auto; text-align: center; min-width: 0; }

.level-title { font-size: 15px; font-weight: 700; }

.level-sub { font-size: 11.5px; color: var(--dim); margin-top: 3px; }

/* 关卡条：一眼看清有哪些关、哪一关已经配好图，点一下直接跳过去。
   无限关卡下这是唯一能"跳着走"的入口，所以必须常驻而不是折叠起来。 */
.level-strip {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.level-chip {
  min-width: 34px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.level-chip:hover { border-color: rgba(255, 107, 139, 0.55); color: var(--txt); }

/* 已配好图的关卡给绿色，没配图的保持灰：扫一眼就知道哪几关能直接玩 */
.level-chip.is-ready { color: #7bf1a8; border-color: rgba(123, 241, 168, 0.32); }

.level-chip.is-current {
  color: var(--txt);
  border-color: var(--accent);
  background: rgba(255, 107, 139, 0.14);
}

/* ---------------- 关卡列表 ---------------- */

.pair-list {
  width: 100%;
  max-width: 900px;
  display: grid;
  gap: 10px;
}

.pair {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 10px 12px 12px;
}

.pair.is-complete { border-color: rgba(123, 241, 168, 0.32); }

.pair-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.pair-no { font-size: 12.5px; font-weight: 700; }

.pair-state { font-size: 11.5px; color: var(--dim); }

.pair-state.ok { color: #7bf1a8; }

.pair-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ---------------- 单个槽位 ---------------- */

.slot {
  position: relative;
  height: 140px;
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.slot:hover { border-color: rgba(255, 107, 139, 0.55); background: rgba(255, 107, 139, 0.06); }

/* 拖拽悬停：由 upload.js 加类名，而不是每帧改 style */
.slot.is-over {
  border-color: var(--accent);
  background: rgba(255, 107, 139, 0.14);
}

.slot.has-image { border-style: solid; border-color: var(--line); cursor: default; }

.slot-empty { text-align: center; pointer-events: none; }

.slot-icon { font-size: 22px; line-height: 1; margin-bottom: 6px; }

.slot-title { font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }

.slot-desc { font-size: 11px; color: var(--dim); }

.slot img {
  width: 100%;
  height: 100%;
  /* contain：缩略图要能看清整张图，不能裁掉内容（选错上下图是要自己吃亏的）。
     不给它加背景色 —— 加纯黑会在大图两侧留出两条很突兀的黑边，
     让它直接坐在卡片背景上，留白就自然了。 */
  object-fit: contain;
  display: block;
}

.slot-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 9px;
  font-size: 11px;
  border-radius: 999px;
  background: rgba(8, 9, 13, 0.82);
  border: 1px solid var(--line);
}

.slot-clear {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(8, 9, 13, 0.82);
  color: var(--txt);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.12s ease;
}

.slot-clear:hover { background: var(--accent); color: #1a0d12; transform: scale(1.06); }

/* ---------------- 操作区 / 音效行 ---------------- */

.upload-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.audio-row {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.audio-label { font-size: 12.5px; font-weight: 600; }

/* 文件名可能很长，省略号收住，不要把这一行撑破 */
.audio-name {
  font-size: 12px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 160px;
  min-width: 0;
}

/* 「清空全部关卡」的二次确认态：按钮自己变成警示样式，让第二次点击有明确含义 */
.btn.is-danger {
  border-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.16);
  color: #ffb3b3;
}

.btn.is-danger:hover:not(:disabled) {
  background: rgba(255, 107, 107, 0.28);
  border-color: #ff8b8b;
}

.save-row {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.save-label { font-size: 12.5px; font-weight: 600; }

.save-state {
  font-size: 12px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 200px;
  min-width: 0;
}

.upload-note {
  font-size: 11.5px;
  color: rgba(152, 160, 180, 0.75);
  text-align: center;
}

/* 窄屏：上下槽位改为竖排 */
@media (max-width: 720px) {
  .pair-slots { grid-template-columns: 1fr; }
  .slot { height: 118px; }
  .audio-name { flex-basis: 100%; white-space: normal; }
}
