/* ═══════════════════════════════════════
   Step 4: 打怪升级路线图（游戏地图风）
   ═══════════════════════════════════════ */

#roadmapProgress {
  background: linear-gradient(135deg, #1e293b 0%, #0f766e 100%);
  color: #fff; border-radius: var(--radius);
  padding: 24px; margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.progress-head {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.progress-head h3 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.progress-head p { margin: 0; font-size: 14px; opacity: 0.85; }
.progress-head p strong { color: #fde68a; font-size: 18px; }
.progress-badge {
  padding: 8px 16px; background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px; font-size: 14px; font-weight: 700;
}
.progress-bar-outer {
  height: 10px; background: rgba(255, 255, 255, 0.15);
  border-radius: 999px; overflow: hidden;
}
.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #fde68a, #f59e0b, #fb923c);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

/* ── 地图路径 ── */
.map-path {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  padding: 20px 0;
}

/* 节点卡片：模仿地图上的"营地/关卡" */
.map-node {
  position: relative;
}
.map-node .node-line {
  position: absolute; top: -22px; left: 50%;
  width: 2px; height: 22px;
  background: repeating-linear-gradient(
    to bottom,
    #cbd5e1 0, #cbd5e1 4px,
    transparent 4px, transparent 8px
  );
  transform: translateX(-50%);
}
.map-node .node-line.hidden { display: none; }

.node-inner {
  position: relative;
  background: #fff;
  border: 2.5px solid var(--line);
  border-radius: 16px;
  padding: 20px 18px 18px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s;
  overflow: hidden;
}

.map-node-active .node-inner {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-light), var(--shadow);
  animation: pulseActive 2s infinite;
}
@keyframes pulseActive {
  0%, 100% { box-shadow: 0 0 0 4px var(--brand-light), var(--shadow); }
  50% { box-shadow: 0 0 0 8px rgba(15, 118, 110, 0.1), var(--shadow); }
}

.map-node-done .node-inner {
  border-color: #10b981;
  background: linear-gradient(180deg, #ecfdf5 0%, #fff 60%);
}
.map-node-done .node-inner::before {
  content: "✓";
  position: absolute; top: 10px; right: 12px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: #10b981; color: #fff;
  border-radius: 50%; font-weight: 800;
  font-size: 14px;
}

.map-node-locked .node-inner {
  background: #f8fafc;
  opacity: 0.6;
}

.node-icon {
  font-size: 42px;
  text-align: center;
  margin-bottom: 6px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.node-level {
  text-align: center;
  font-size: 11px; font-weight: 800;
  color: var(--muted); letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.node-name {
  text-align: center;
  font-size: 18px; font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.map-node-done .node-name { color: #047857; }

.node-title {
  text-align: center;
  font-size: 13px; color: var(--muted);
  line-height: 1.4;
  margin-bottom: 10px;
  min-height: 36px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.node-meta {
  display: flex; justify-content: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.node-tool, .node-diff {
  padding: 3px 10px; font-size: 11px; font-weight: 700;
  border-radius: 999px;
  background: #f1f5f9; color: #475569;
}
.node-diff {
  background: #fef3c7; color: #92400e;
}

.node-goal {
  padding: 10px 12px; margin-bottom: 12px;
  background: #fffbeb; border: 1px dashed #fde68a;
  border-radius: 8px;
  font-size: 12px; color: #78350f;
  line-height: 1.5;
}

.node-action {
  width: 100%;
  padding: 10px; border: none; border-radius: 8px;
  background: var(--brand); color: #fff;
  font-size: 14px; font-weight: 700;
  transition: all 0.2s;
}
.node-action:not(:disabled):hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}
.node-action:disabled {
  background: #cbd5e1; cursor: not-allowed;
}
.node-action-done {
  background: #fff; color: var(--muted);
  border: 1.5px solid var(--line);
}
.node-action-done:hover {
  background: #f8fafc; color: var(--ink); border-color: #cbd5e1;
}

/* ── 通关凭证图片 ── */
.node-proof {
  position: relative;
  width: 100%; height: 120px;
  margin-bottom: 10px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}
.node-proof img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.node-proof:hover img { transform: scale(1.05); }
.proof-hover {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.5); color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  opacity: 0; transition: opacity 0.2s;
}
.node-proof:hover .proof-hover { opacity: 1; }

/* ── 解锁弹窗 ── */
.modal-goal {
  padding: 12px 14px;
  background: #fffbeb; border: 1px dashed #fde68a;
  border-radius: 8px; margin: 0 0 18px;
  font-size: 13px; color: #78350f;
}

/* upload-box 用 display:flex 保证子元素居中，避免被 base.css 的 input 全局规则污染 */
.upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 160px;
  padding: 24px 20px;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  box-sizing: border-box;
}
.upload-box:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}
.upload-box input[type=file] {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.upload-box .upload-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 4px;
}
.upload-box .upload-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.upload-box .upload-hint {
  font-size: 12px;
  color: var(--muted);
}

#unlockPreview {
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
}
#unlockPreview:empty { display: none; }
#unlockPreview img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  display: block;
  background: #000;
}

.upload-note {
  display: block;
  margin-top: 14px;
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
  background: #fff;
  color: var(--ink);
}
.upload-note:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

/* ── 查看凭证弹窗 ── */
#proofModal .modal-box { max-width: 700px; }
#proofModal img {
  width: 100%; max-height: 60vh;
  object-fit: contain;
  background: #000;
}
.proof-meta {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.proof-meta strong { color: var(--ink); margin-right: 6px; }

/* ── 通关庆祝特效 ── */
.celebrate-burst {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 80px;
  z-index: 300;
  pointer-events: none;
  animation: burst 1.5s ease-out forwards;
}
@keyframes burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, -120%) scale(1); }
}

.empty-tip {
  padding: 60px 20px; text-align: center;
  color: var(--muted); font-size: 15px;
  background: var(--panel); border-radius: var(--radius);
  border: 2px dashed var(--line);
}

@media (max-width: 600px) {
  .map-path { grid-template-columns: 1fr; gap: 18px; }
}
