/* ============ 局内 HUD(阶段性补充) ============ */
#hud-layer { position: absolute; inset: 0; pointer-events: none; }
#hud-layer > * { pointer-events: auto; }

.hud-scene-tag {
  position: absolute;
  top: 18px;
  left: 22px;
  padding: 5px 16px;
  background: rgba(20, 14, 8, 0.8);
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  color: var(--gold-bright);
  font-size: 15px;
  letter-spacing: 3px;
}

.hud-hint {
  position: absolute;
  bottom: 106px; /* 避让下方居中的快捷栏(其顶边约在 92px) */
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 20px;
  background: rgba(20, 14, 8, 0.85);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  color: var(--paper);
  font-size: 15px;
  letter-spacing: 2px;
}
.hud-hint .key {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  padding: 0 6px;
  margin: 0 4px;
  background: var(--wood);
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  color: var(--gold-bright);
  font-family: sans-serif;
  font-size: 13px;
}

/* ---- 职业与技能状态(§职业):场景标签下方;圆形技能槽 + 文本 ---- */
.hud-job {
  position: absolute;
  top: 64px;
  left: 22px;
  padding: 4px 14px 4px 6px;
  background: rgba(20, 14, 8, 0.75);
  border: 1px solid rgba(150, 120, 60, 0.5);
  border-radius: 3px;
  color: rgba(230, 216, 184, 0.9);
  font-size: 13px;
  letter-spacing: 2px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* R 挖掘技能槽容器(§工兵铲技能冷却UI):屏幕右下独立悬浮,与左下 .hud-bars 同底边对齐;
   不遮挡快捷栏(底部居中)/小地图/nearby-items(右中);槽体不拦截点击(纯展示) */
.hud-dig {
  position: absolute;
  right: 22px;
  bottom: 26px;
  pointer-events: none;
}

/* 圆形技能槽(§技能UI):图标/冷却遮罩/时间分离,未来美术只换 jobs.json active.icon 指向的图片 */
.skill-slot {
  display: flex;
  align-items: center;
  gap: 10px;
}
.skill-icon {
  position: relative;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;            /* 正圆:裁切图标/遮罩/时间 */
  overflow: hidden;
  border: 2px solid rgba(170, 138, 70, 0.85);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 0 8px rgba(0, 0, 0, 0.5);
  /* 程序化 fallback 底色:按 data-job 区分职业,未来图片直接盖在其上 */
  background: radial-gradient(circle at 35% 30%, #6b5327, #241a0c 72%);
}
.skill-icon[data-job="agent"] {
  background: radial-gradient(circle at 35% 30%, #5a2b22, #1c0d0a 72%);
}
/* R 挖掘槽(§工兵铲技能冷却UI):土褐色底,图标就绪后由 assets.sprite 绘制的铲子图覆盖 */
.skill-icon[data-job="dig"] {
  background: radial-gradient(circle at 35% 30%, #4a3d22, #1a140a 72%);
}
/* 键位角标(§工兵铲技能冷却UI):槽位左上角 E/R 标识,在图标与冷却遮罩之上 */
.skill-key {
  position: absolute;
  top: 3px;
  left: 7px;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0;
  color: rgba(230, 216, 184, 0.9);
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
  z-index: 2;
}
.skill-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* 冷却遮罩:半透明灰扇形(conic-gradient 由 JS 按剩余比例写入,逆时针退去),不修改原图 */
.skill-cool {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: none;
  pointer-events: none;
}
/* 冷却剩余时间:图标正中央 */
.skill-cd {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 0;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}
.skill-txt {
  align-self: center;
}

/* ---- 局内状态信息组(§HUD信息组,2026-09-15):倒计时在左 + 撤离目标紧挨其右,顶部中央同一信息组 ---- */
.hud-run-status {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 16px); /* 小屏自动收紧间距,避免覆盖小地图/职业技能 */
}
/* 小屏(§响应式):缩小字体与内边距,保证信息组不覆盖小地图/职业技能,不出现文字溢出 */
@media (max-width: 920px) {
  .hud-run-status { gap: 6px; }
  .hud-timer { font-size: 13px; padding: 4px 10px; letter-spacing: 1px; }
  .hud-escape { font-size: 12px; padding: 4px 12px; letter-spacing: 1px; }
  .hud-escape .label { margin-right: 4px; }
  .hud-escape .v { font-size: 14px; }
}
/* ---- 撤离目标价值(全局 HUD:卡车/归宝斋/遗迹常显;信息组内静态排布,不再单独定位) ---- */
.hud-escape {
  padding: 6px 22px;
  background: rgba(20, 14, 8, 0.85);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  color: var(--paper);
  font-size: 15px;
  letter-spacing: 2px;
  white-space: nowrap;
}
.hud-escape .label { color: rgba(200, 180, 150, 0.7); margin-right: 10px; }
.hud-escape .v { color: var(--gold-bright); font-size: 17px; }
.hud-escape.reached {
  border-color: var(--gold-bright);
  box-shadow: 0 0 10px rgba(201, 162, 39, 0.45);
}

/* ---- 左下状态条 ---- */
.hud-bars {
  position: absolute;
  left: 22px;
  bottom: 26px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 240px;
  pointer-events: none;
}
.hud-bar {
  position: relative;
  height: 20px;
  background: rgba(15, 10, 6, 0.85);
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  overflow: hidden;
}
.hud-bar .fill {
  height: 100%;
  transition: width 0.12s linear;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.15));
}
.hud-bar.hp .fill { background-color: var(--hp); }
.hud-bar.sta .fill { background-color: var(--stamina); }

/* ---- 负重阶段 → 体力条颜色(§负重):变量集中在 base.css,经 data-stage 切换 ---- */
.hud-bar.sta[data-stage="light"] .fill { background-color: var(--weight-light); }
.hud-bar.sta[data-stage="burden"] .fill { background-color: var(--weight-burden); }
.hud-bar.sta[data-stage="overload"] .fill { background-color: var(--weight-overload); }
.hud-bar.sta[data-stage="crushed"] .fill { background-color: var(--weight-crushed); }
/* 状态优先级(§体力条颜色优先级):力竭(.low)规则写在阶段色之后,同优先级下后者生效 → 力竭永远覆盖阶段色 */
.hud-bar.sta.low .fill { background-color: #7a5a2a; }
.hud-bar.wgt .fill { background-color: #6d5a3a; }
.hud-bar.wgt.low .fill { background-color: var(--danger); }
.hud-bar .txt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--paper);
  text-shadow: 0 1px 2px #000;
}

/* ---- 快捷栏(§10/§53) ---- */
.hud-quickbar {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto; /* .hud-bars 为 none,快捷栏需可点击 */
}
.qk-cast {
  width: 220px;
  height: 18px;
  position: relative;
  background: rgba(15, 10, 6, 0.85);
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  overflow: hidden;
}
.qk-cast .fill { height: 100%; background: rgba(143, 179, 160, 0.75); transition: width 0.1s linear; }
.qk-cast .txt {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--paper); text-shadow: 0 1px 2px #000;
}
.qk-slots { display: flex; gap: 8px; }
.qk-slot {
  position: relative;
  width: 128px; height: 84px; /* 2026-09-15 放大(§快捷栏放大):原 116×68;图标成为主要视觉内容 */
  background: rgba(20, 14, 8, 0.85);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  padding: 4px 6px 3px;
  cursor: pointer;
  user-select: none;
}
.qk-slot.active { border-color: var(--gold-bright); box-shadow: 0 0 8px rgba(201, 162, 39, 0.45); }
.qk-slot.using { border-color: #8fb3a0; }
.qk-num {
  position: absolute; top: 1px; left: 4px;
  font-size: 11px; color: rgba(200, 180, 150, 0.55);
  font-family: sans-serif;
  z-index: 1;
}
/* 挥铲冷却遮罩(§工兵铲技能冷却UI):仅工兵铲槽位预置,conic-gradient 由 JS 按剩余比例写入,逆时针退去 */
.qk-cool {
  position: absolute; inset: 0;
  border-radius: 4px;
  display: none;
  pointer-events: none;
  z-index: 2;
}
/* 挥铲冷却剩余时间:槽位正中央(2s 全程 <10s,固定一位小数) */
.qk-cd {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 0;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
  z-index: 3;
}
.qk-icon {
  width: 60px; height: 60px; /* 2026-09-15 放大(§快捷栏放大):原 34×34;object-fit:contain 等比不变形,不遮左上角数字/底部耐久条 */
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}
/* 耐久进度条(§耐久进度条):底部细条,只以长度表达剩余耐久,不显示具体数字;<=30% 红色警示 */
.qk-durbar {
  width: 100%; height: 6px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(120, 100, 60, 0.5);
  border-radius: 3px;
  overflow: hidden;
}
.qk-durbar-fill {
  height: 100%;
  background: linear-gradient(180deg, #b8d8a8, #7aa06a);
  border-radius: 2px;
  transition: width 0.2s linear;
}
.qk-durbar-fill.low { background: linear-gradient(180deg, #e0705a, #b0402e); }
.qk-empty { font-size: 11px; color: rgba(150, 130, 90, 0.4); }
/* 猎枪弹药显示(§猎枪快捷栏UI):耐久条上方一行"弹匣/备弹"(如 2/24),复用槽位状态区,不建独立 HUD 框架 */
.qk-ammo {
  font-size: 12px;
  line-height: 1;
  color: #e8c76a;
  font-family: sans-serif;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.qk-ammo i { font-style: normal; color: rgba(200, 180, 150, 0.55); margin: 0 1px; }

/* ---- 局内倒计时(§倒计时):信息组内静态排布(位于撤离目标左侧,§HUD信息组) ---- */
.hud-timer {
  padding: 5px 18px;
  background: rgba(20, 14, 8, 0.8);
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--paper);
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}
.hud-timer.warn { color: #e04a3a; border-color: rgba(224, 74, 58, 0.6); }
.hud-timer.critical { animation: hud-timer-blink 1s steps(2, start) infinite; }
@keyframes hud-timer-blink { 50% { opacity: 0.45; } }

/* ---- 小地图/大地图(§46/§49)/清雾测试(§48) ---- */
.minimap-wrap {
  position: absolute;
  top: 18px;
  right: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.minimap-wrap.hidden { display: none; }
.minimap-cv {
  background: #000;
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.6);
}
.minimap-clearfog,
.minimap-nav {
  padding: 3px 14px;
  background: rgba(20, 14, 8, 0.85);
  border: 1px solid rgba(150, 120, 60, 0.5);
  border-radius: 3px;
  color: rgba(200, 180, 150, 0.75);
  font-size: 12px;
  letter-spacing: 2px;
  cursor: pointer;
}
.minimap-clearfog:hover,
.minimap-nav:hover { border-color: var(--gold-dim); color: var(--gold-bright); }
/* 导航按钮:开启状态高亮;祭坛等场景下隐藏 */
.minimap-nav.nav-on { border-color: var(--gold-bright); color: var(--gold-bright); }
.minimap-nav.hidden { display: none; }

/* 大地图模式(§49):隐藏其他局内 UI,只保留地图本体 */
body.bigmap-mode .minimap-cv {
  border-width: 2px;
  border-color: var(--gold-bright);
}
body.bigmap-mode .hud-scene-tag,
body.bigmap-mode .hud-hint,
body.bigmap-mode .hud-bars,
body.bigmap-mode .hud-quickbar,
body.bigmap-mode .hud-timer,
body.bigmap-mode .hud-escape {
  display: none;
}

/* ---- 失败结算覆盖层(§4) ---- */
.fail-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(30, 8, 4, 0.82), rgba(0, 0, 0, 0.95));
  animation: fail-in 0.5s ease-out;
}
@keyframes fail-in { from { opacity: 0; } to { opacity: 1; } }
.fail-box {
  text-align: center;
  padding: 46px 72px;
  background: rgba(18, 12, 7, 0.92);
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  box-shadow: 0 0 60px rgba(160, 30, 20, 0.35);
}
.fail-box h2 {
  margin: 0 0 8px;
  font-size: 34px;
  letter-spacing: 10px;
  color: #d8442e;
  text-shadow: 0 2px 10px rgba(200, 40, 30, 0.5);
}
.fail-sub { margin: 0 0 22px; color: rgba(200, 180, 150, 0.7); font-size: 14px; letter-spacing: 3px; }
.fail-stats {
  display: flex;
  gap: 34px;
  justify-content: center;
  margin-bottom: 28px;
}
.fail-stats span { display: block; font-size: 12px; color: rgba(200, 180, 150, 0.6); margin-bottom: 4px; }
.fail-stats b { font-size: 22px; color: var(--gold-bright); }
.fail-btn {
  display: inline-block;
  padding: 10px 44px;
  background: var(--wood);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  color: var(--gold-bright);
  font-size: 16px;
  letter-spacing: 4px;
  cursor: pointer;
}
.fail-btn:hover { background: #4a3820; }

/* ---- 成功结算覆盖层(§56):金色视觉,战利品依次出现 ---- */
.suc-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(38, 28, 8, 0.85), rgba(0, 0, 0, 0.95));
  animation: fail-in 0.5s ease-out;
}
.suc-box {
  text-align: center;
  padding: 40px 64px;
  background: rgba(18, 12, 7, 0.92);
  border: 1px solid var(--gold-bright);
  border-radius: 6px;
  box-shadow: 0 0 60px rgba(201, 162, 39, 0.35);
}
.suc-box h2 {
  margin: 0 0 8px;
  font-size: 34px;
  letter-spacing: 10px;
  color: var(--gold-bright);
  text-shadow: 0 2px 10px rgba(201, 162, 39, 0.5);
}
.suc-sub { margin: 0 0 20px; color: rgba(200, 180, 150, 0.7); font-size: 14px; letter-spacing: 3px; }
.suc-loot {
  min-width: 380px;
  margin-bottom: 18px;
  max-height: 40vh;
  overflow-y: auto;
}
.suc-row {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  padding: 7px 4px;
  border-bottom: 1px dashed rgba(125, 99, 32, 0.35);
  opacity: 0;
  animation: suc-row-in 0.45s ease-out forwards;
}
@keyframes suc-row-in {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}
.suc-name { font-size: 15px; letter-spacing: 1px; }
.suc-val { font-size: 14px; color: var(--gold-bright); }
.suc-w { font-size: 12px; color: rgba(200, 180, 150, 0.6); min-width: 40px; text-align: right; }
.suc-empty {
  padding: 18px 0 14px;
  color: rgba(200, 180, 150, 0.55);
  font-size: 14px;
  letter-spacing: 2px;
  animation: suc-row-in 0.45s ease-out 0.25s forwards;
  opacity: 0;
}
.suc-total {
  display: flex;
  gap: 40px;
  justify-content: center;
  margin-bottom: 24px;
  animation: suc-row-in 0.45s ease-out forwards;
}
.suc-total span { display: block; font-size: 12px; color: rgba(200, 180, 150, 0.6); margin-bottom: 4px; }
.suc-total b { font-size: 22px; color: var(--gold-bright); }
.suc-total.dim b { color: rgba(200, 180, 150, 0.5); }
.suc-btn {
  display: inline-block;
  padding: 10px 44px;
  background: var(--wood);
  border: 1px solid var(--gold-bright);
  border-radius: 4px;
  color: var(--gold-bright);
  font-size: 16px;
  letter-spacing: 4px;
  cursor: pointer;
}
.suc-btn:hover { background: #4a3820; }

/* ---- 撤离动画覆盖层(§撤离):金色视觉,淡入停留淡出 ---- */
.evac-overlay {
  position: absolute;
  inset: 0;
  z-index: 26;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(38, 28, 8, 0.85), rgba(0, 0, 0, 0.96));
  animation: fail-in 0.5s ease-out;
  transition: opacity 0.6s ease;
}
.evac-box {
  text-align: center;
  padding: 44px 70px;
  background: rgba(18, 12, 7, 0.94);
  border: 1px solid var(--gold-bright);
  border-radius: 6px;
  box-shadow: 0 0 60px rgba(201, 162, 39, 0.4);
}
.evac-box h2 {
  margin: 0 0 8px;
  font-size: 34px;
  letter-spacing: 10px;
  color: var(--gold-bright);
  text-shadow: 0 2px 10px rgba(201, 162, 39, 0.5);
}
.evac-sub { margin: 0 0 20px; color: rgba(200, 180, 150, 0.7); font-size: 14px; letter-spacing: 3px; }
.evac-total span { display: block; font-size: 12px; color: rgba(200, 180, 150, 0.6); margin-bottom: 4px; }
.evac-total b { font-size: 22px; color: var(--gold-bright); }

/* ---- 附近可拾取物品列表(§拾取优化):屏幕中右侧,不挡玩家/核心 HUD;分辨率变化按比例定位 ---- */
.hud-nearby {
  position: fixed;
  top: 50%;
  right: 3.5%;
  transform: translateY(-50%);
  min-width: 170px;
  max-width: 230px;
  max-height: 46vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(24, 19, 12, 0.92), rgba(16, 12, 8, 0.92));
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 10px;
  padding: 8px;
  pointer-events: none; /* 纯展示:不拦截鼠标,避免误触世界输入 */
  z-index: 5;
}
.hud-nearby .nb-title {
  font-size: 11px;
  letter-spacing: 4px;
  color: rgba(201, 162, 39, 0.75);
  text-align: center;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.25);
}
.hud-nearby .nb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 7px;
  border: 1px solid rgba(201, 162, 39, 0.14);
  background: rgba(0, 0, 0, 0.25);
  opacity: 0.72;
}
.hud-nearby .nb-item:last-child { margin-bottom: 0; }
/* 选中态:金色描边+提亮(滚轮/默认选中) */
.hud-nearby .nb-item.active {
  opacity: 1;
  border-color: rgba(232, 199, 106, 0.85);
  background: rgba(58, 44, 20, 0.55);
  box-shadow: 0 0 10px rgba(201, 162, 39, 0.35);
}
.hud-nearby .nb-icon { width: 26px; height: 26px; object-fit: contain; flex: 0 0 auto; image-rendering: pixelated; }
.hud-nearby .nb-gem { /* 珍宝无 icon:品质色菱形(与世界渲染菱形同款) */
  width: 14px; height: 14px; flex: 0 0 auto;
  transform: rotate(45deg);
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 8px var(--nb-color, #e8c76a);
}
.hud-nearby .nb-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hud-nearby .nb-name { font-size: 13px; color: rgba(235, 220, 190, 0.95); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-nearby .nb-value { font-size: 11px; color: rgba(200, 180, 150, 0.65); }
.hud-nearby .nb-item.active .nb-value { color: var(--gold-bright); }
