/* ============================================================
   场景图层 / 热点 / NPC站位 / 场景导航 / 背包栏
   ============================================================ */

/* ---------- 场景背景 ---------- */
#scene-layer { position: absolute; inset: 0; overflow: hidden; background: var(--bg-deep); }
#scene-bg, #scene-bg-next {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity .8s ease;
}
#scene-bg-next { opacity: 0; }
.scene-vignette {
  position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 160px 40px rgba(0,0,0,.8);
  z-index: 2;
}
/* 时空异常闪烁遮罩 */
.scene-glitch {
  position: absolute; inset: 0; z-index: 6; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(94,234,212,.14), transparent 70%);
  animation: glitchPulse 2.2s infinite;
}
@keyframes glitchPulse {
  0%, 84%, 100% { opacity: .35; }
  86% { opacity: 1; }
  88% { opacity: .2; }
  90% { opacity: .9; }
  93% { opacity: .4; }
}

/* ---------- 可交互热点 ---------- */
/* 两个全屏容器本身不拦截事件，只由内部按钮响应，避免透明层盖住下方热点 */
#hotspot-layer, #npc-spot-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s;
  pointer-events: auto;
}
.hotspot::before {
  content: '';
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px 2px rgba(212,175,55,.65);
  opacity: .85;
  animation: hotspotPulse 2.4s infinite;
}
.hotspot:hover { transform: translate(-50%, -50%) scale(1.25); }
.hotspot::after {
  content: attr(data-label);
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  white-space: nowrap;
  font-size: var(--fs-xs);
  color: var(--ink);
  background: rgba(13,17,23,.9);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 2px 8px;
  opacity: 0;
  transition: opacity .18s;
  pointer-events: none;
}
.hotspot:hover::after, .hotspot:focus-visible::after { opacity: 1; }
.hotspot.hotspot-anomalous::before {
  background: var(--accent);
  box-shadow: 0 0 14px 3px rgba(94,234,212,.6);
}
.hotspot.done { opacity: .45; }
/* 智能提示：3分钟停留后微光放大 */
.hotspot.glow-hint::before { animation-duration: .9s; transform: scale(1.5); }
@keyframes hotspotPulse {
  0%, 100% { transform: scale(1); opacity: .85; }
  50% { transform: scale(1.35); opacity: .45; }
}

/* ---------- 场景内 NPC 站位 ---------- */
.npc-spot {
  position: absolute;
  transform: translate(-50%, -100%);
  border: none; background: transparent;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  z-index: 5;
  transition: transform .18s;
  pointer-events: auto;
}
.npc-spot:hover { transform: translate(-50%, -100%) scale(1.08); }
.npc-spot .npc-mini {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title);
  font-size: 22px;
  color: var(--ink);
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}
.npc-spot .npc-mini img { width: 100%; height: 100%; object-fit: cover; }
.npc-spot .npc-spot-name {
  font-size: var(--fs-xs);
  background: rgba(13,17,23,.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 10px;
  color: var(--ink-dim);
}
.npc-spot:hover .npc-spot-name { color: var(--ink); border-color: var(--accent); }

/* ---------- 场景导航 ---------- */
#place-nav {
  position: absolute; bottom: 74px; left: 50%; transform: translateX(-50%);
  display: flex; gap: var(--sp-2);
  z-index: 25;
  padding: var(--sp-1);
}
.place-btn {
  padding: 6px 16px;
  background: rgba(13,17,23,.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-dim);
  font-size: var(--fs-sm);
  letter-spacing: .08em;
  transition: color .18s, border-color .18s;
}
.place-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--accent); }
.place-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.place-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- 背包栏 ---------- */
#inventory-bar {
  position: absolute; bottom: var(--sp-3); left: 50%; transform: translateX(-50%);
  display: flex; gap: var(--sp-2);
  padding: var(--sp-2);
  background: rgba(13,17,23,.85);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  z-index: 25;
}
.inv-slot {
  width: 48px; height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  position: relative;
}
.inv-slot.filled { border-color: rgba(212,175,55,.5); cursor: pointer; }
.inv-slot.filled:hover { border-color: var(--gold); box-shadow: 0 0 10px rgba(212,175,55,.3); }
.inv-slot .inv-tip {
  position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%);
  background: rgba(13,17,23,.95); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 4px 10px;
  font-size: var(--fs-xs); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.inv-slot:hover .inv-tip { opacity: 1; }
.inv-slot.inv-new { animation: invPop .5s ease both; }
@keyframes invPop {
  0% { transform: scale(.3); } 60% { transform: scale(1.2); } 100% { transform: scale(1); }
}

/* ---------- 立绘层 ---------- */
#portrait-layer {
  position: absolute; inset: 0; z-index: 8; pointer-events: none;
}
.portrait-slot {
  position: absolute; bottom: 150px;
  width: min(300px, 30vw); height: min(460px, 52vh);
  transition: transform .4s ease, opacity .4s ease, filter .3s;
  opacity: 0;
}
.portrait-slot img {
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,.6));
}
#portrait-left { left: 4vw; transform: translateY(20px); }
#portrait-right { right: 4vw; transform: translateY(20px); }
.portrait-slot.show { opacity: 1; transform: translateY(0); }
.portrait-slot.dim { filter: brightness(.55); }
/* 无立绘 NPC 的代用名牌头像 */
.portrait-fallback {
  width: 180px; height: 180px;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-size: 64px;
  box-shadow: var(--shadow-panel);
}
