/* ===== 三国·烽烟 界面样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #0b0d12;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #e8e0d0;
  user-select: none;
}

#game-container { position: fixed; inset: 0; z-index: 0; }
#game-container canvas { display: block; }

.hidden { display: none !important; }

.screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 20%, rgba(40,34,24,.55), rgba(8,8,12,.92));
  backdrop-filter: blur(2px);
}

/* 剧本下拉选择：主菜单右上角 */
.juben-drop { position: absolute; top: 18px; right: 18px; z-index: 15; font-size: 13px; }
/* 地图设计下拉：剧本下拉左侧（右上角） */
.design-drop { right: 168px; }
.juben-drop-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(24,20,14,.72); border: 1px solid rgba(212,175,90,.4);
  color: #f3e6c8; border-radius: 8px; padding: 7px 12px; cursor: pointer;
  font-size: 13px; transition: all .18s;
}
.juben-drop-btn:hover { border-color: #d4af5a; box-shadow: 0 0 10px rgba(212,175,90,.2); }
.juben-drop-caret { color: #d4af5a; font-size: 10px; transition: transform .18s; }
.juben-drop.open .juben-drop-caret { transform: rotate(180deg); }
.juben-drop-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 178px;
  background: rgba(24,20,14,.96); border: 1px solid rgba(212,175,90,.35);
  border-radius: 10px; overflow: hidden; box-shadow: 0 6px 22px rgba(0,0,0,.5);
}
.juben-drop-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer;
  color: #e8dcc0; transition: background .15s;
}
.juben-drop-item:hover { background: rgba(212,175,90,.16); }
.juben-drop-item.active { color: #d4af5a; }
.juben-drop-item .ji { width: 18px; text-align: center; }
.juben-drop-item .jc { margin-left: auto; color: #d4af5a; }

/* ===== 玻璃拟态通用 ===== */
.glass {
  background: rgba(24, 20, 14, .62);
  border: 1px solid rgba(212, 175, 90, .35);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
}

/* ===== 主菜单 ===== */
.start-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(8,8,12,.9)),
    repeating-linear-gradient(45deg, rgba(212,175,90,.03) 0 2px, transparent 2px 26px);
}
.start-title { text-align: center; margin-bottom: 26px; }
.start-title h1 {
  font-size: 64px; letter-spacing: 14px; font-weight: 900;
  color: #f3e6c8;
  text-shadow: 0 0 18px rgba(212,175,90,.55), 0 4px 12px rgba(0,0,0,.8);
}
.start-title .gold { color: #d4af5a; }
.start-title .sub { margin-top: 10px; color: #a99a7e; letter-spacing: 4px; font-size: 14px; }

.char-select { text-align: center; }
.char-select h2 { color: #d4af5a; font-size: 18px; letter-spacing: 6px; margin-bottom: 14px; }

.char-cards { display: flex; gap: 16px; }
.char-card {
  width: 190px; padding: 16px 14px; cursor: pointer;
  border-radius: 18px; transition: transform .18s, border-color .18s, box-shadow .18s;
  border: 1px solid rgba(212,175,90,.25);
  background: rgba(24,20,14,.66);
}
.char-card:hover { transform: translateY(-4px); }
.char-card.selected {
  border-color: #d4af5a;
  box-shadow: 0 0 0 2px rgba(212,175,90,.35), 0 10px 26px rgba(0,0,0,.5);
}
.char-card h3 { color: #f3e6c8; font-size: 17px; margin-bottom: 4px; }
.char-card .pos { color: #a99a7e; font-size: 12px; margin-bottom: 10px; }
.attr-row { display: flex; align-items: center; gap: 6px; margin: 5px 0; }
.attr-row .at { width: 26px; font-size: 12px; color: #d4af5a; }
.attr-row .track { flex: 1; height: 7px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.attr-row .fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #8a6b2f, #d4af5a); }

.start-actions { margin-top: 26px; display: flex; gap: 14px; }
.btn {
  padding: 12px 30px; font-size: 16px; letter-spacing: 4px; cursor: pointer;
  border-radius: 14px; color: #f3e6c8;
  background: rgba(38, 32, 22, .8);
  border: 1px solid rgba(212,175,90,.45);
  transition: all .18s;
}
.btn:hover { background: rgba(212,175,90,.18); box-shadow: 0 0 18px rgba(212,175,90,.25); }
.btn.primary { background: linear-gradient(135deg, #8a6b2f, #d4af5a); color: #241a08; border: none; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.12); }

.hint { margin-top: 18px; color: #7c715c; font-size: 12px; letter-spacing: 2px; }

/* ===== 关卡选择 ===== */
.screen-title { color: #d4af5a; letter-spacing: 8px; margin-bottom: 22px; font-size: 22px; }
.level-grid {
  display: grid; grid-template-columns: repeat(3, 200px); gap: 14px; margin-bottom: 22px;
}
.level-card {
  padding: 16px; border-radius: 16px; text-align: center; cursor: pointer;
  background: rgba(24,20,14,.66);
  border: 1px solid rgba(212,175,90,.25);
  transition: all .18s;
}
.level-card:hover { transform: translateY(-3px); border-color: #d4af5a; }
.level-card.locked { opacity: .45; cursor: not-allowed; }
.level-card.locked:hover { transform: none; }
.level-card .lv { color: #d4af5a; font-size: 13px; }
.level-card h3 { margin: 6px 0; color: #f3e6c8; font-size: 16px; }
.level-card .obj { color: #a99a7e; font-size: 12px; }
.level-card.custom-map { border-color: rgba(126, 203, 255, .4); }
.level-card.custom-map .lv { color: #7ecbff; }
.level-card.custom-map:hover { border-color: #7ecbff; box-shadow: 0 0 12px rgba(126, 203, 255, .3); }
.level-actions { display: flex; gap: 14px; justify-content: center; }

/* ===== 剧本选择 ===== */
.juben-grid { display: grid; grid-template-columns: repeat(2, 260px); gap: 16px; margin-bottom: 22px; }
.juben-card {
  padding: 22px 18px; border-radius: 18px; text-align: center; cursor: pointer;
  background: rgba(24,20,14,.66);
  border: 1px solid rgba(212,175,90,.28);
  transition: all .18s;
}
.juben-card:hover { transform: translateY(-3px); border-color: #d4af5a; box-shadow: 0 0 14px rgba(212,175,90,.25); }
.juben-card.active { border-color: #d4af5a; background: rgba(60,48,28,.72); box-shadow: 0 0 16px rgba(212,175,90,.35); }
.juben-card .jicon { font-size: 34px; display: block; margin-bottom: 8px; }
.juben-card h3 { margin: 4px 0; color: #f3e6c8; font-size: 17px; }
.juben-card .jdesc { color: #a99a7e; font-size: 12px; line-height: 1.6; }
.juben-card .jlv { color: #d4af5a; font-size: 12px; margin-top: 8px; }

/* ===== 金币显示 ===== */
.gold-info { color: #f3d97a; font-size: 14px; font-weight: 700; letter-spacing: 1px; }

/* ===== 物品商城 ===== */
#shop-screen { display: flex; flex-direction: column; align-items: center; }
.shop-gold {
  padding: 12px 28px; border-radius: 14px; margin-bottom: 20px;
  color: #f3e6c8; font-size: 17px; letter-spacing: 2px;
}
.shop-gold b { color: #f3d97a; font-size: 22px; margin-left: 6px; }
.shop-grid {
  display: grid; grid-template-columns: repeat(3, 230px); gap: 16px; margin-bottom: 16px;
}
.shop-card {
  padding: 18px 16px; border-radius: 16px; text-align: center;
  background: rgba(24,20,14,.66);
  border: 1px solid rgba(212,175,90,.25);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.shop-card .sc-icon { font-size: 34px; }
.shop-card .sc-name { color: #f3e6c8; font-size: 16px; font-weight: 700; }
.shop-card .sc-desc { color: #a99a7e; font-size: 12px; min-height: 30px; }
.shop-card .sc-price { color: #f3d97a; font-size: 15px; }
.shop-card .sc-stock { color: #7c715c; font-size: 12px; }
.shop-card .sc-buy {
  margin-top: 4px; padding: 8px 22px; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, #8a6b2f, #d4af5a); color: #241a08;
  border: none; font-weight: 700; font-size: 14px; transition: all .18s;
}
.shop-card .sc-buy:hover { filter: brightness(1.12); }
.shop-card .sc-buy.disabled {
  background: rgba(60,52,38,.7); color: #6b6151; cursor: not-allowed;
}
.shop-tip { color: #d4af5a; font-size: 13px; min-height: 18px; margin-bottom: 14px; letter-spacing: 1px; }

/* ===== 军营内政 ===== */
#camp-screen { display: flex; flex-direction: column; align-items: center; overflow-y: auto; padding: 30px 0; }
.camp-res {
  display: flex; gap: 28px; padding: 12px 28px; border-radius: 14px; margin-bottom: 18px;
  color: #f3e6c8; font-size: 15px; letter-spacing: 1px;
}
.camp-res b { color: #f3d97a; font-size: 18px; margin: 0 4px; }
.camp-grid {
  display: grid; grid-template-columns: repeat(5, 180px); gap: 14px; margin-bottom: 18px;
}
.camp-card {
  padding: 16px 12px; border-radius: 16px; text-align: center;
  background: rgba(24,20,14,.66);
  border: 1px solid rgba(212,175,90,.25);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.camp-card .cc-icon { font-size: 30px; }
.camp-card .cc-name { color: #f3e6c8; font-size: 15px; font-weight: 700; }
.camp-card .cc-lv { color: #d4af5a; font-size: 13px; }
.camp-card .cc-desc { color: #a99a7e; font-size: 11px; min-height: 28px; }
.camp-card .cc-cost { color: #f3d97a; font-size: 12px; }
.camp-card .cc-upgrade {
  margin-top: 4px; padding: 7px 18px; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, #8a6b2f, #d4af5a); color: #241a08;
  border: none; font-weight: 700; font-size: 13px; transition: all .18s;
}
.camp-card .cc-upgrade:hover { filter: brightness(1.12); }
.camp-card .cc-upgrade.disabled {
  background: rgba(60,52,38,.7); color: #6b6151; cursor: not-allowed;
}
.camp-card .cc-upgrade.maxed {
  background: rgba(60,52,38,.7); color: #d4af5a; cursor: default;
}
.camp-actions { display: flex; gap: 14px; margin-bottom: 10px; }
.camp-tip { color: #d4af5a; font-size: 13px; min-height: 18px; letter-spacing: 1px; }

/* ===== 基地 3D HUD 覆盖层 ===== */
#base-hud { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#base-hud.hidden { display: none; }
/* 左键拖拽框选矩形（JS 动态创建，置于 HUD 之上，不拦截事件） */
#box-select {
  position: fixed; z-index: 60; display: none;
  border: 1px solid rgba(126, 203, 255, 0.9);
  background: rgba(126, 203, 255, 0.15);
  pointer-events: none;
  box-shadow: 0 0 6px rgba(126, 203, 255, 0.4);
}
.bh-topbar {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 4px; padding: 6px 14px; border-radius: 12px;
  color: #f3e6c8; font-size: 12px; letter-spacing: .5px; align-items: center;
  pointer-events: auto;
  background: rgba(24,20,14,.82); border: 1px solid rgba(212,175,90,.35);
  box-shadow: 0 4px 18px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,220,150,.12);
}
.bh-tb-row { display: flex; gap: 10px; align-items: center; }
.bh-tb-group { display: flex; gap: 8px; align-items: center; }
.bh-tb-item { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.bh-tb-label { color: #c9a96a; font-size: 12px; font-weight: 600; opacity: .85; }
.bh-tb-sep { width: 1px; height: 20px; background: rgba(212,175,90,.28); flex-shrink: 0; }
.bh-topbar b { color: #f3d97a; font-size: 15px; margin: 0 1px; font-weight: 700; }
.btn-sm {
  padding: 5px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600;
  border: none; background: linear-gradient(135deg, #8a6b2f, #d4af5a); color: #241a08;
  pointer-events: auto; transition: filter .18s;
}
.btn-sm:hover { filter: brightness(1.12); }
.bh-hint {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  color: #a99a7e; font-size: 12px; letter-spacing: 1px; pointer-events: none;
  max-width: 90%; text-align: center;
}
/* 小地图（左下角，可点击导航） */
.bh-minimap {
  position: absolute; bottom: 16px; left: 16px;
  width: 180px; height: 180px; border-radius: 10px;
  background: rgba(20,28,18,.85); border: 2px solid rgba(180,150,80,.5);
  box-shadow: 0 4px 16px rgba(0,0,0,.5); cursor: pointer; z-index: 50;
}
.bh-sel {
  position: absolute; top: 64px; left: 16px;
  padding: 8px 14px; border-radius: 12px; pointer-events: none;
  background: rgba(24,20,14,.72); border: 1px solid rgba(79,255,90,.35);
  display: flex; flex-direction: column; gap: 2px;
}
.bh-sel.hidden { display: none; }
.bh-sel-title { color: #4fff5a; font-size: 14px; font-weight: 700; }
.bh-sel-title b { color: #f3d97a; }
.bh-sel-hint { color: #a99a7e; font-size: 11px; }
.bh-sel-header { display: flex; align-items: center; gap: 8px; }
.bh-build-cat { color: #c9a96a; font-size: 11px; font-weight: 600; margin: 6px 0 3px; letter-spacing: 1px; }
.bh-build-grid { display: flex; flex-wrap: wrap; gap: 5px; pointer-events: auto; }
.bh-build-btn {
  padding: 5px 8px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 600;
  border: 1px solid rgba(212,175,90,.4); background: rgba(38,32,22,.8); color: #f3e6c8;
  transition: all .15s;
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 60px;
  position: relative;
}
.bh-build-btn:hover { background: rgba(212,175,90,.25); box-shadow: 0 0 8px rgba(212,175,90,.3); transform: translateY(-1px); }
.bh-build-btn.disabled { opacity: .4; cursor: not-allowed; }
.bh-build-btn.disabled:hover { background: rgba(38,32,22,.8); box-shadow: none; transform: none; }
.bh-build-icon { font-size: 18px; line-height: 1; }
.bh-build-name { font-size: 11px; }
.bh-build-cost { font-size: 10px; font-weight: 400; color: #f3d97a; letter-spacing: 0; }
.bh-build-btn.disabled .bh-build-cost { color: #7c715c; }
.bh-build-maxed { font-size: 9px; color: #f56a4a; font-weight: 700; }
.bh-build-empty { color: #7c715c; font-size: 11px; padding: 4px; }
.bh-flash {
  position: absolute; top: 110px; left: 50%; transform: translateX(-50%);
  padding: 8px 18px; border-radius: 10px; pointer-events: none;
  background: rgba(24,20,14,.88); border: 1px solid rgba(212,175,90,.5);
  color: #f3d97a; font-size: 14px; font-weight: 600; letter-spacing: 1px;
  transition: opacity .2s;
}
.bh-flash.hidden { display: none; }
/* 关卡基地：主城血量条 */
.bh-th {
  position: absolute; top: 64px; right: 16px; width: 200px;
  padding: 8px 14px; border-radius: 12px; pointer-events: none;
  display: flex; align-items: center; gap: 8px;
}
.bh-th.hidden { display: none; }
.bh-th-title { color: #f3e6c8; font-size: 14px; white-space: nowrap; }
.bh-th-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(60,52,38,.7); overflow: hidden; }
.bh-th-fill { height: 100%; background: linear-gradient(90deg, #4faa6a, #6ef0a0); transition: width .3s; }
.bh-th-num { color: #f3d97a; font-size: 14px; min-width: 40px; text-align: right; }
.bh-th.low .bh-th-fill { background: linear-gradient(90deg, #d43d3d, #ff7a7a); }
.bh-th.low .bh-th-num { color: #ff7a7a; }
/* 关卡基地：波次预警（塔防模式：出兵波次 + 倒计时） */
.bh-wave {
  position: absolute; top: 104px; right: 16px;
  padding: 6px 12px; border-radius: 8px;
  background: rgba(24,20,14,.72); border: 1px solid rgba(212,175,90,.25);
  color: #f3e6c8; font-size: 12px;
  min-width: 170px;
}
.bh-wave.hidden { display: none; }

/* 生存模式：顶部中央大号实时倒计时 */
.bh-countdown {
  position: absolute; top: 74px; left: 50%; transform: translateX(-50%);
  padding: 8px 26px; border-radius: 14px; pointer-events: none;
  background: rgba(24,20,14,.82); border: 1px solid rgba(212,175,90,.4);
  color: #f3d97a; font-size: 26px; font-weight: 800; letter-spacing: 3px;
  text-shadow: 0 0 14px rgba(212,175,90,.4);
  display: flex; align-items: center; gap: 8px;
}
.bh-countdown.hidden { display: none; }
.bh-countdown .bc-tag { font-size: 13px; font-weight: 600; color: #c9a96a; letter-spacing: 1px; }
.bh-countdown.low { border-color: rgba(255,90,90,.6); color: #ff6a5a; text-shadow: 0 0 16px rgba(255,60,50,.5); }
.bh-countdown.low .bc-tag { color: #ff9a8a; }

/* 回合制指示器 */
.bh-turn {
  position: absolute; top: 74px; left: 50%; transform: translateX(-50%);
  padding: 6px 18px; border-radius: 12px; pointer-events: auto;
  background: rgba(24,20,14,.82); border: 1px solid rgba(100,200,255,.45);
  color: #8fc; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.bh-turn.hidden { display: none; }
.bh-turn.enemy { border-color: rgba(255,90,90,.5); color: #ff8a7a; }
.bh-turn #bh-turn-end { padding: 2px 12px; font-size: 13px; }

/* 回合制攻击按钮 */
.bh-turn-attack {
  position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%);
  padding: 10px 36px; border-radius: 14px; pointer-events: auto; cursor: pointer;
  background: linear-gradient(135deg, rgba(180,40,30,.85), rgba(120,20,15,.85));
  border: 2px solid rgba(255,160,80,.6); color: #ffeedd; font-size: 18px; font-weight: 800;
  text-shadow: 0 1px 3px rgba(0,0,0,.5); box-shadow: 0 4px 16px rgba(180,40,30,.4);
  transition: transform .15s, box-shadow .15s; z-index: 10;
}
.bh-turn-attack.hidden { display: none; }
.bh-turn-attack:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 6px 22px rgba(255,80,30,.55); }
.bh-turn-attack:active { transform: translateX(-50%) translateY(1px); }
.bh-wave div { line-height: 1.8; white-space: nowrap; }
.bh-wave b { color: #f3d97a; }

/* 主将技能框（选中主将时显示，右下） */
#bh-hero {
  position: absolute; right: 16px; bottom: 74px;
  display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; padding: 10px 14px;
  max-width: 520px;
  pointer-events: auto;
}
#bh-hero.hidden { display: none; }
.bh-hero-title {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  color: #d4af5a; font-size: 12px; margin-right: 2px;
}
.bh-hero-title b { color: #f3d97a; font-size: 14px; }
.bh-skill {
  position: relative; width: 54px; height: 54px; border-radius: 12px;
  border: 1px solid rgba(212,175,90,.35); background: rgba(38,32,22,.9);
  color: #f3e6c8; cursor: pointer; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s; overflow: hidden; user-select: none;
}
.bh-skill:hover { border-color: #d4af5a; transform: translateY(-2px); }
.bh-skill.ready {
  background: linear-gradient(135deg, #3a2f18, #6b5428);
  border-color: #d4af5a; box-shadow: 0 0 10px rgba(212,175,90,.3);
}
.bh-skill.turn-selected {
  background: linear-gradient(135deg, #2a3a1f, #4a6b28) !important;
  border-color: #6fff6f !important; box-shadow: 0 0 14px rgba(111,255,111,.5) !important;
}
.bh-skill .bs-name {
  position: absolute; bottom: 2px; width: 100%; text-align: center;
  font-size: 10px; color: #d4af5a; letter-spacing: 1px; text-shadow: 0 1px 2px rgba(0,0,0,.8);
}
.bh-skill .bs-cd {
  position: absolute; inset: 0; background: rgba(0,0,0,.68);
  display: flex; align-items: center; justify-content: center;
  color: #ffd97a; font-size: 15px; font-weight: 700;
}
/* 可用物品栏（右下） */
#bh-items {
  position: absolute; right: 16px; bottom: 16px;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  pointer-events: auto;
}
.bh-items-title {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  color: #a99a7e; font-size: 12px; margin-right: 2px;
}
.bh-items-title b { color: #6ef0a0; font-size: 14px; }
.bh-item {
  position: relative; width: 50px; height: 50px; border-radius: 12px;
  border: 1px solid rgba(79,255,90,.3); background: rgba(24,20,14,.88);
  color: #f3e6c8; cursor: pointer; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s; user-select: none;
}
.bh-item:hover { border-color: #6ef0a0; transform: translateY(-2px); }
.bh-item.zero { opacity: .35; cursor: not-allowed; }
.bh-item .bi-name {
  position: absolute; bottom: 1px; width: 100%; text-align: center;
  font-size: 9px; color: #6ef0a0; text-shadow: 0 1px 2px rgba(0,0,0,.8);
}
.bh-item .bi-cnt {
  position: absolute; top: 1px; right: 3px; font-size: 11px; color: #6ef0a0; font-weight: 700;
}

/* 出征按钮 */
#btn-march {
  margin-left: 12px;
  background: linear-gradient(135deg, #9e2b25, #d45a5a);
  color: #fff;
}
#btn-march:hover { filter: brightness(1.12); }
#btn-march.disabled {
  background: rgba(60,52,38,.7);
  color: #6b6151;
  cursor: not-allowed;
}
#btn-march.hidden { display: none; }
.base-popup {
  position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%);
  width: 320px; padding: 16px 18px; border-radius: 16px; pointer-events: auto;
  background: rgba(24,20,14,.88); border: 1px solid rgba(212,175,90,.35);
  display: flex; flex-direction: column; gap: 8px;
}
.base-popup.wide { width: 460px; }
.base-popup.hidden { display: none; }
.bp-head { display: flex; align-items: center; gap: 8px; }
.bp-icon { font-size: 24px; }
.bp-name { color: #f3e6c8; font-size: 16px; font-weight: 700; }
.bp-desc { color: #a99a7e; font-size: 12px; margin-bottom: 4px; }
.bp-btn {
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600;
  border: none; transition: all .18s; text-align: center;
}
.bp-btn.up { background: linear-gradient(135deg, #8a6b2f, #d4af5a); color: #241a08; }
.bp-btn.up:hover { filter: brightness(1.12); }
.bp-btn.up.disabled { background: rgba(60,52,38,.7); color: #6b6151; cursor: not-allowed; }
.bp-btn.train { background: linear-gradient(135deg, #2a5a3a, #4faa6a); color: #e8f5e8; }
.bp-btn.train:hover { filter: brightness(1.12); }
.bp-btn.train.disabled { background: rgba(60,52,38,.7); color: #6b6151; cursor: not-allowed; }
.bp-btn.demolish { background: linear-gradient(135deg, #6a2a2a, #c54a4a); color: #ffe8e8; }
.bp-btn.demolish:hover { filter: brightness(1.12); }
.bp-maxed { color: #d4af5a; font-size: 13px; text-align: center; padding: 6px; }
.bp-hint { color: #6b6151; font-size: 12px; text-align: center; }
.bp-hint.no { color: #d45a5a; }

/* ===== 通用弹窗 ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  width: 560px; max-height: 80vh; padding: 20px 24px;
  display: flex; flex-direction: column; gap: 12px;
  border-radius: 18px;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-header h2 { color: #f3e6c8; font-size: 20px; letter-spacing: 3px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(212,175,90,.4); background: rgba(38,32,22,.8);
  color: #f3e6c8; font-size: 16px; transition: all .15s;
}
.modal-close:hover { background: rgba(212,175,90,.25); }

/* ===== 素材设计（地形素材元素库 · 3D 实时渲染） ===== */
.scenario-box { width: 920px; max-width: 96vw; }
.scenario-tip { color: #a99a7e; font-size: 13px; text-align: center; margin: 0; }
.scenario-layout { display: flex; gap: 12px; height: 62vh; }
.scenario-sidebar {
  width: 240px; flex-shrink: 0; overflow-y: auto; padding: 4px;
  border-right: 1px solid rgba(212,175,90,.2);
}
.scenario-cat {
  font-size: 13px; font-weight: 700; color: #d4af5a; letter-spacing: 1px;
  padding: 8px 4px 4px; border-bottom: 1px solid rgba(212,175,90,.2); margin-top: 6px;
}
.scenario-cat:first-child { margin-top: 0; }
.scenario-item {
  padding: 6px 10px; font-size: 13px; color: #c8bfae; cursor: pointer;
  border-radius: 8px; transition: all .15s; margin: 2px 0;
}
.scenario-item:hover { background: rgba(212,175,90,.12); color: #f3e6c8; }
.scenario-item.active { background: rgba(212,175,90,.2); color: #f3e6c8; font-weight: 700; }
/* 素材二级子项（英雄具体素材） */
.scenario-item.scenario-sub {
  margin-left: 16px; padding: 5px 8px; font-size: 12px;
  background: rgba(126,203,255,.07);
  border: 1px solid rgba(126,203,255,.18);
  border-radius: 6px; color: #a8cce8;
}
.scenario-item.scenario-sub:hover { background: rgba(126,203,255,.16); color: #eaf6ff; }
.scenario-preview {
  flex: 1; display: flex; flex-direction: column; gap: 10px; align-items: center;
}
#scenario-canvas {
  width: 400px; height: 300px; max-width: 100%; border-radius: 10px;
  background: #1a1a24; border: 1px solid rgba(212,175,90,.2);
}
.scenario-detail { width: 100%; max-width: 400px; }
.sd-name { font-size: 16px; font-weight: 700; color: #f3e6c8; margin-bottom: 4px; }
.sd-fn {
  font-size: 11px; color: #8fd0a0; font-family: Consolas, 'Courier New', monospace;
  background: rgba(80,160,110,.1); border: 1px solid rgba(80,160,110,.25);
  border-radius: 6px; padding: 2px 7px; display: inline-block; margin-bottom: 6px;
}
.sd-use { font-size: 12px; color: #a99a7e; line-height: 1.4; margin-bottom: 4px; }
.sd-desc { font-size: 12px; color: #c8bfae; line-height: 1.5; margin: 0; }
.sd-opt-btn { margin-top: 10px; }
@media (max-width: 860px) {
  .scenario-layout { flex-direction: column; height: auto; }
  .scenario-sidebar { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid rgba(212,175,90,.2); }
  #scenario-canvas { width: 100%; height: 240px; }
}

/* ===== 英雄技能设计 ===== */
.heroskill-box { width: 1080px; max-width: 96vw; }
.heroskill-layout { height: 70vh; }
.heroskill-main {
  flex: 1; display: flex; flex-direction: column; gap: 12px; align-items: center; overflow-y: auto;
}
#heroskill-canvas {
  width: 480px; height: 360px; max-width: 100%; border-radius: 10px;
  background: #1a1a24; border: 1px solid rgba(212,175,90,.2);
}
.heroskill-detail {
  width: 100%; max-width: 560px; color: #c0b090; font-size: 13px; line-height: 1.7;
}
.heroskill-detail .hs-name { font-size: 20px; font-weight: 700; color: #f0d090; margin-bottom: 4px; }
.heroskill-detail .hs-intro { color: #a09080; font-style: italic; margin: 4px 0 10px; }
.heroskill-detail .hs-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.heroskill-detail .hs-tag {
  padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600;
  background: rgba(212,175,90,.15); color: #d4af5a; border: 1px solid rgba(212,175,90,.3);
}
.heroskill-detail .hs-meta { color: #8a7a5a; font-size: 12px; margin-bottom: 10px; }
.heroskill-detail .hs-lv-table {
  width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px;
}
.heroskill-detail .hs-lv-table th {
  color: #d4af5a; font-weight: 600; padding: 4px 8px; text-align: center;
  border-bottom: 1px solid rgba(212,175,90,.25);
}
.heroskill-detail .hs-lv-table td {
  padding: 4px 8px; text-align: center; color: #c0b090;
  border-bottom: 1px solid rgba(212,175,90,.1);
}
.heroskill-detail .hs-lv-table tr:hover td { background: rgba(212,175,90,.08); }
.heroskill-detail .hs-effect {
  margin: 6px 0 12px; padding: 10px 12px; border-radius: 8px; line-height: 1.9;
  background: rgba(126,203,255,.08); border: 1px solid rgba(126,203,255,.2);
}
.heroskill-detail .hs-effect-title {
  font-size: 12px; font-weight: 700; color: #7ecbff; margin-bottom: 4px; letter-spacing: 1px;
}

/* ===== 新建素材按钮 + AI 生成对话框 ===== */
.modal-header-actions { display: flex; align-items: center; gap: 8px; }
.btn-new-material {
  padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  border-radius: 8px; border: 1px solid rgba(126,203,255,.4);
  background: rgba(30,60,100,.7); color: #a8cce8;
  transition: all .15s; white-space: nowrap;
}
.btn-new-material:hover {
  background: rgba(50,100,160,.8); color: #eaf6ff;
  box-shadow: 0 0 12px rgba(126,203,255,.3);
}
.ai-mat-dialog { width: 560px; max-width: 94vw; max-height: 90vh; }
.ai-mat-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; flex: 1; min-height: 0; }
.ai-mat-label { font-size: 13px; color: #c8bfae; }
.ai-mat-prompt {
  width: 100%; resize: vertical; min-height: 80px;
  background: rgba(20,18,14,.8); color: #f3e6c8;
  border: 1px solid rgba(212,175,90,.3); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; line-height: 1.5;
  font-family: inherit; outline: none; transition: border-color .15s;
}
.ai-mat-prompt:focus { border-color: rgba(126,203,255,.5); }
.ai-mat-status {
  font-size: 13px; min-height: 20px; text-align: center;
  color: #a99a7e; transition: all .2s;
}
.ai-mat-status.loading { color: #8fd0a0; }
.ai-mat-status.error { color: #ff6b6b; }
.ai-mat-status.success { color: #8fd0a0; }
.ai-mat-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0;
  background: rgba(20,18,14,.92); padding: 8px 0 4px;
  margin-top: 4px;
  backdrop-filter: blur(4px);
}
.ai-mat-preview-wrap {
  display: flex; justify-content: center; align-items: center;
  background: rgba(10,8,6,.6); border-radius: 10px; padding: 8px;
  border: 1px solid rgba(212,175,90,.15);
}
.ai-mat-preview-wrap canvas { border-radius: 8px; max-width: 100%; }

/* AI 素材多轮对话历史 */
.ai-mat-history {
  max-height: 180px; overflow-y: auto; padding: 8px 10px;
  background: rgba(10,8,6,.5); border-radius: 8px;
  border: 1px solid rgba(212,175,90,.15);
  display: flex; flex-direction: column; gap: 6px;
}
.ai-mat-history-item {
  font-size: 12px; line-height: 1.5; padding: 6px 9px; border-radius: 6px;
  word-break: break-all;
}
.ai-mat-history-item.user {
  background: rgba(126,203,255,.1); color: #c8e0ff;
  border-left: 2px solid rgba(126,203,255,.5);
}
.ai-mat-history-item.assistant {
  background: rgba(143,208,160,.08); color: #b8e0c0;
  border-left: 2px solid rgba(143,208,160,.5);
}
.ai-mat-history-item .role-tag {
  display: inline-block; font-weight: bold; margin-right: 6px; opacity: .8;
}
.ai-mat-history-item.user .role-tag::before { content: "🎯 优化: "; }
.ai-mat-history-item.assistant .role-tag::before { content: "✨ AI: "; }

/* ===== 地图设计（拖拽素材设计地图） ===== */
.mapdesign-box { width: 980px; max-width: 96vw; }
.mapdesign-main { flex: 1; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.md-canvas-wrap { position: relative; width: 600px; max-width: 100%; }
#mapdesign-canvas {
  width: 600px; height: 420px; max-width: 100%; border-radius: 10px;
  background: #1a1a24; border: 1px solid rgba(212,175,90,.2); cursor: default;
}
/* ===== 地图设计全屏模式（占满整个视口，便于设计大图） ===== */
#mapdesign-modal {
  padding: 0;
  align-items: stretch; justify-content: stretch;
  background: rgba(6, 8, 14, .94);
}
#mapdesign-modal .mapdesign-box {
  width: 100%; max-width: none; height: 100vh; max-height: none;
  border-radius: 0; border: none; padding: 12px 16px;
  background: rgba(10, 13, 20, .86);
  box-shadow: none;
}
#mapdesign-modal .scenario-layout {
  flex: 1; height: auto; min-height: 0; flex-direction: row;
}
#mapdesign-modal .scenario-sidebar { width: 220px; }
#mapdesign-modal .mapdesign-main { height: 100%; min-height: 0; }
#mapdesign-modal .md-canvas-wrap { flex: 1; width: 100%; height: 100%; min-height: 0; }
#mapdesign-modal #mapdesign-canvas { width: 100%; height: 100%; max-width: none; display: block; border-radius: 8px; }
/* 地图编辑器小地图（左下角悬浮） */
.md-minimap {
  position: absolute; left: 10px; bottom: 10px; z-index: 5;
  width: 170px; padding: 5px; border-radius: 10px;
  background: rgba(18,22,32,.78); border: 1px solid rgba(212,175,90,.35);
  box-shadow: 0 4px 14px rgba(0,0,0,.35); backdrop-filter: blur(4px);
  pointer-events: auto;
}
.md-minimap-title { font-size: 11px; color: #d4af5a; text-align: center; margin-bottom: 4px; user-select: none; }
.md-minimap-wrap { position: relative; width: 158px; height: 158px; margin: 0 auto; }
#md-minimap-canvas { display: block; width: 158px; height: 158px; border-radius: 5px; background: #1a2a1a; }
/* 小地图 2D 覆盖层：绘制物体点与当前视角范围框（叠在 WebGL 场景上方，接收点击） */
#md-minimap-overlay {
  position: absolute; inset: 0; width: 158px; height: 158px;
  border-radius: 5px; cursor: pointer;
  pointer-events: auto; z-index: 2;
}
#mapdesign-canvas.drag-over { border-color: #d4af5a; box-shadow: 0 0 12px rgba(212,175,90,.3); }
.mapdesign-toolbar {
  display: flex; align-items: center; gap: 6px; width: 100%; max-width: 600px;
  flex-wrap: wrap;
}
.btn.small { padding: 4px 12px; font-size: 13px; }
.btn.small.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.faction-player { border-color: rgba(255,221,68,.5); }
.faction-enemy { border-color: rgba(255,68,68,.5); }
.faction-neutral { border-color: rgba(68,255,68,.5); }
.md-toolbar-sep { width: 1px; height: 22px; background: rgba(212,175,90,.3); margin: 0 4px; }
.md-info { font-size: 13px; color: #a99a7e; margin-left: auto; }
.md-size-label { font-size: 13px; color: #a99a7e; white-space: nowrap; }
.md-select {
  padding: 2px 8px; font-size: 13px; border-radius: 6px;
  background: rgba(38,32,22,.8); color: #d4af5a; border: 1px solid rgba(212,175,90,.3);
  cursor: pointer; outline: none;
}
.md-select:hover { border-color: rgba(212,175,90,.6); }

/* ===== 英雄选择弹框 ===== */
.hero-select-box { width: 480px; max-width: 92vw; max-height: 80vh; overflow-y: auto; }
.hero-select-list { display: flex; flex-direction: column; gap: 8px; padding: 8px 4px; }
.hero-select-item {
  padding: 12px 16px; border-radius: 10px; cursor: pointer;
  background: rgba(38,32,22,.7); border: 1px solid rgba(212,175,90,.2);
  transition: all .15s;
}
.hero-select-item:hover { background: rgba(58,48,32,.9); border-color: rgba(212,175,90,.6); transform: translateY(-1px); }
.hero-select-item .hsi-name { font-size: 16px; font-weight: bold; color: #d4af5a; margin-bottom: 4px; }
.hero-select-item .hsi-desc { font-size: 12px; color: #a99a7e; }

/* ===== 敌方实力设置弹框 ===== */
.enemy-stats-box { width: 520px; max-width: 92vw; max-height: 85vh; overflow-y: auto; }
.enemy-stats-body { padding: 8px 16px; }
.es-section { font-size: 14px; font-weight: bold; color: #d4af5a; margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid rgba(212,175,90,.2); }
.es-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.es-row label { width: 80px; font-size: 13px; color: #a99a7e; flex-shrink: 0; }
.es-row input { width: 80px; padding: 3px 8px; font-size: 13px; border-radius: 5px; background: rgba(38,32,22,.8); color: #d4af5a; border: 1px solid rgba(212,175,90,.3); outline: none; }
.es-row span { font-size: 12px; color: #887a5e; }
.es-soldier-group { padding: 8px 10px; margin: 6px 0; border-radius: 8px; background: rgba(28,22,16,.5); border: 1px solid rgba(212,175,90,.1); }
.es-soldier-name { font-size: 14px; font-weight: bold; color: #c9a227; display: block; margin-bottom: 4px; }
.es-actions { display: flex; gap: 10px; justify-content: center; padding: 12px 0 8px; }
.md-item { cursor: grab; }
.md-item:active { cursor: grabbing; }
@media (max-width: 860px) {
  #mapdesign-canvas { width: 100%; height: 300px; }
}

/* ===== 历史消息 ===== */
.msg-filter-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.msg-filter-btn {
  padding: 4px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
  border: 1px solid rgba(212,175,90,.3); background: rgba(38,32,22,.7); color: #a99a7e;
  transition: all .15s;
}
.msg-filter-btn:hover { border-color: #d4af5a; color: #f3e6c8; }
.msg-filter-btn.active { background: linear-gradient(135deg, #8a6b2f, #d4af5a); color: #241a08; border: none; font-weight: 700; }
.msg-list {
  flex: 1; overflow-y: auto; max-height: 50vh; padding: 4px;
  display: flex; flex-direction: column; gap: 4px;
}
.msg-list:empty::before { content: '暂无消息记录'; color: #6b6151; font-size: 14px; text-align: center; padding: 20px; }
.msg-item {
  padding: 8px 12px; border-radius: 8px; font-size: 13px; color: #e8e0d0;
  background: rgba(38,32,22,.5); border-left: 3px solid #6b6151;
  display: flex; flex-direction: column; gap: 2px;
}
.msg-item.envoy { border-left-color: #d4af5a; }
.msg-item.enemy { border-left-color: #d45a5a; }
.msg-item.neutral { border-left-color: #6aaa6a; }
.msg-item.ally { border-left-color: #4fc3ff; }
.msg-item.system { border-left-color: #9a9a9a; }
.msg-item .msg-time { color: #6b6151; font-size: 11px; }
.msg-item .msg-text { line-height: 1.4; }
.msg-help-actions { display: flex; gap: 8px; margin-top: 6px; }
.msg-help-btn {
  padding: 5px 16px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: filter .18s;
}
.msg-help-btn.accept { background: linear-gradient(135deg, #2a5a3a, #4faa6a); color: #e8f5e8; }
.msg-help-btn.reject { background: rgba(60,52,38,.7); color: #c9a96a; }
.msg-help-btn:hover { filter: brightness(1.15); }
.msg-help-resolved { color: #6b6151; font-size: 12px; margin-top: 4px; }

/* ===== 求援弹框 ===== */
.help-body { color: #e8e0d0; font-size: 15px; line-height: 1.6; padding: 8px 4px; }
.help-body .help-detail { color: #a99a7e; font-size: 13px; margin-top: 6px; }
.help-body .help-cost { color: #f3d97a; font-size: 14px; margin-top: 8px; font-weight: 700; }
.help-actions { display: flex; gap: 12px; justify-content: flex-end; }
.help-btn {
  padding: 8px 24px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 700;
  border: none; transition: filter .15s;
}
.help-btn.accept { background: linear-gradient(135deg, #2a5a3a, #4faa6a); color: #e8f5e8; }
.help-btn.reject { background: linear-gradient(135deg, #6a2a2a, #c54a4a); color: #ffe8e8; }
.help-btn:hover { filter: brightness(1.12); }
.help-btn.disabled { opacity: .4; cursor: not-allowed; }

/* ===== 盟军面板 ===== */
.allies-list { flex: 1; overflow-y: auto; max-height: 60vh; display: flex; flex-direction: column; gap: 10px; }
.allies-list:empty::before { content: '暂无盟军基地'; color: #6b6151; font-size: 14px; text-align: center; padding: 20px; }
.ally-card {
  padding: 14px; border-radius: 12px;
  background: rgba(38,32,22,.6); border: 1px solid rgba(79,195,255,.3);
  display: flex; flex-direction: column; gap: 8px;
}
.ally-card-header { display: flex; align-items: center; justify-content: space-between; }
.ally-card-name { color: #4fc3ff; font-size: 16px; font-weight: 700; }
.ally-card-hp { color: #f3d97a; font-size: 13px; }
.ally-card-info { display: flex; gap: 16px; color: #a99a7e; font-size: 13px; }
.ally-card-info b { color: #f3e6c8; }
.ally-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ally-action-btn {
  padding: 5px 14px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 600;
  border: 1px solid rgba(212,175,90,.4); background: rgba(38,32,22,.8); color: #f3e6c8;
  transition: all .15s;
}
.ally-action-btn:hover { background: rgba(212,175,90,.25); }
.ally-action-btn.disabled { opacity: .4; cursor: not-allowed; }
.bp-cost { color: #f3e6c8; font-size: 12px; text-align: center; padding: 4px; background: rgba(60,52,38,.5); border-radius: 6px; }
.bp-cond { display: flex; align-items: center; gap: 6px; color: #f3e6c8; font-size: 12px; }

/* ===== 技能升级面板 ===== */
.skill-upgrade-body { max-width: 460px; max-height: 60vh; overflow-y: auto; }
.skill-upgrade-points { text-align: center; font-size: 16px; color: #f3d97a; margin-bottom: 12px; }
.skill-upgrade-points b { font-size: 20px; color: #fff; }
.skill-upgrade-list { display: flex; flex-direction: column; gap: 10px; }
.skill-upgrade-item {
  padding: 12px; border-radius: 12px; background: rgba(38,32,22,.6);
  border: 1px solid rgba(212,175,90,.2); transition: all .15s;
}
.skill-upgrade-item:hover { border-color: rgba(212,175,90,.5); }
.skill-upgrade-item.skill-recall { opacity: .7; border-color: rgba(100,200,100,.3); }
.skill-upgrade-info { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.skill-icon { font-size: 20px; }
.skill-name { font-size: 15px; font-weight: 700; color: #f3e6c8; flex: 1; }
.skill-lv { font-size: 13px; color: #f3d97a; font-weight: 600; }
.skill-desc { font-size: 12px; color: #a99a7e; margin-bottom: 8px; }
.skill-upgrade-action { text-align: right; }
.skill-no-upgrade, .skill-maxed, .skill-no-points { font-size: 12px; color: #6b6151; }
.skill-maxed { color: #4fc3ff; }
.skill-up-btn { padding: 4px 16px !important; font-size: 12px !important; }
.skill-upgrade-tip { text-align: center; font-size: 12px; color: #6b6151; margin-top: 12px; }

/* ===== AI 地图生成对话框 ===== */
.ai-mapgen-dialog { max-width: 520px; }
#ai-mapgen-dialog { z-index: 300; }
.ai-mapgen-body { display: flex; flex-direction: column; gap: 12px; }
.ai-mapgen-row { display: flex; align-items: center; gap: 10px; }
.ai-mapgen-label { font-size: 14px; color: #f3e6c8; flex-shrink: 0; }
.ai-mapgen-select { background: rgba(38,32,22,.8); color: #f3e6c8; border: 1px solid rgba(212,175,90,.3); border-radius: 8px; padding: 6px 12px; font-size: 13px; }
.ai-mapgen-prompt { width: 100%; background: rgba(38,32,22,.8); color: #f3e6c8; border: 1px solid rgba(212,175,90,.3); border-radius: 8px; padding: 10px; font-size: 13px; resize: vertical; box-sizing: border-box; }
.ai-mapgen-prompt:focus { outline: none; border-color: rgba(212,175,90,.6); }
.ai-mapgen-actions { display: flex; gap: 10px; justify-content: flex-end; }
.ai-mapgen-result { background: rgba(38,32,22,.6); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ai-mapgen-result-info { font-size: 13px; color: #a99a7e; max-height: 200px; overflow-y: auto; white-space: pre-wrap; }
.bp-cond b { color: #f3d97a; min-width: 26px; text-align: right; }
.bp-cond-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(60,52,38,.7); overflow: hidden; }
.bp-cond-fill { height: 100%; background: linear-gradient(90deg, #4faa6a, #6ef0a0); transition: width .3s; }
.bp-cond.low .bp-cond-fill { background: linear-gradient(90deg, #c95a2a, #f08a4a); }
.bp-cond.low b { color: #f08a4a; }
.bp-alloc { display: flex; align-items: center; gap: 8px; color: #f3e6c8; font-size: 13px; }
.bp-alloc b { color: #f3d97a; }
.bp-alloc-btn {
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 16px; font-weight: 700;
  border: 1px solid rgba(212,175,90,.4); background: rgba(38,32,22,.85); color: #f3e6c8;
}
.bp-alloc-btn:hover { border-color: #d4af5a; }
.bp-close {
  padding: 6px; border-radius: 8px; cursor: pointer; font-size: 12px;
  border: 1px solid rgba(212,175,90,.2); background: transparent; color: #a99a7e;
}
.bp-close:hover { color: #f3e6c8; }

/* ===== 武器库弹窗 UI ===== */
.ar-summary {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.ar-summary-item {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(212,175,90,.15);
}
.ar-summary-item.atk { border-color: rgba(220,80,60,.3); }
.ar-summary-item.def { border-color: rgba(80,140,220,.3); }
.ar-summary-item.lv { border-color: rgba(212,175,90,.4); }
.ar-si-icon { font-size: 22px; flex-shrink: 0; }
.ar-si-val { font-size: 24px; font-weight: 800; color: #f3d97a; line-height: 1; }
.ar-summary-item.atk .ar-si-val { color: #f56a4a; }
.ar-summary-item.def .ar-si-val { color: #5a9af5; }
.ar-si-label { font-size: 10px; color: #a99a7e; line-height: 1.2; }

.ar-section-title {
  font-size: 14px; font-weight: 700; color: #d4af5a;
  margin: 12px 0 8px; padding-bottom: 6px;
  border-bottom: 1px solid rgba(212,175,90,.2);
}
.ar-section-title .ar-sub { font-size: 11px; color: #8a7e62; font-weight: 400; margin-left: 6px; }

.ar-weapon-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
/* 按 tier 分组布局 */
.ar-tier {
  display: flex; align-items: stretch; gap: 8px; margin-bottom: 6px;
  padding: 6px 8px; border-radius: 10px;
  background: rgba(255,255,255,.02); border: 1px solid rgba(212,175,90,.1);
}
.ar-tier.locked { opacity: .55; }
.ar-tier-label {
  flex-shrink: 0; width: 36px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #d4af5a; letter-spacing: 1px;
  border-right: 1px solid rgba(212,175,90,.15); padding-right: 8px;
}
.ar-tier-weapons { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ar-weapon-card {
  padding: 7px 9px; border-radius: 9px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(212,175,90,.15);
  display: flex; align-items: center; gap: 8px;
  transition: all .2s;
}
.ar-weapon-card.available { border-color: rgba(79,170,106,.4); background: rgba(79,170,106,.08); }
.ar-weapon-card.owned { border-color: rgba(212,175,90,.3); background: rgba(212,175,90,.06); }
.ar-weapon-card.locked { opacity: .5; }
.ar-weapon-card.poor { border-color: rgba(180,60,60,.3); }
.ar-wc-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ar-wc-header { display: flex; align-items: center; gap: 5px; }
.ar-wc-icon { font-size: 16px; }
.ar-wc-name { font-size: 13px; font-weight: 700; color: #f3e6c8; }
.ar-wc-stats { display: flex; gap: 5px; }
.ar-stat { font-size: 11px; padding: 1px 7px; border-radius: 5px; font-weight: 600; }
.ar-stat.atk { color: #f56a4a; background: rgba(220,80,60,.15); }
.ar-stat.def { color: #5a9af5; background: rgba(80,140,220,.15); }
.ar-wc-right { margin-left: auto; flex-shrink: 0; }
.ar-wc-status { font-size: 11px; text-align: center; padding: 3px 6px; white-space: nowrap; }
.ar-wc-status.owned { color: #6ef0a0; }
.ar-wc-status.locked { color: #8a7e62; }
.ar-wc-btn {
  padding: 5px 9px; border-radius: 7px; border: none; cursor: pointer;
  font-size: 12px; text-align: center; white-space: nowrap;
  background: linear-gradient(135deg, #2a5a3a, #4faa6a); color: #e8f5e8;
  transition: all .2s;
}
.ar-wc-btn:hover { filter: brightness(1.15); }
.ar-wc-btn.disabled { background: rgba(60,52,38,.7); color: #6b6151; cursor: not-allowed; }

.ar-skill-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.ar-skill-card {
  padding: 10px 12px; border-radius: 10px; margin-bottom: 0;
  background: rgba(255,255,255,.04); border: 1px solid rgba(212,175,90,.15);
  display: flex; flex-direction: column; gap: 5px;
}
.ar-sk-info { display: flex; align-items: center; gap: 6px; }
.ar-sk-icon { font-size: 18px; }
.ar-sk-name { font-size: 14px; font-weight: 700; color: #f3e6c8; }
.ar-sk-desc { font-size: 11px; color: #a99a7e; }
.ar-sk-bar { display: flex; align-items: center; gap: 4px; }
.ar-sk-dot {
  width: 18px; height: 8px; border-radius: 3px;
  background: rgba(60,52,38,.6); border: 1px solid rgba(212,175,90,.2);
}
.ar-sk-dot.filled { background: linear-gradient(90deg, #d4af5a, #f3d97a); border-color: #d4af5a; }
.ar-sk-lv { font-size: 12px; color: #f3d97a; margin-left: 6px; font-weight: 600; }
.ar-sk-btn {
  padding: 6px 12px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 12px; text-align: center;
  background: linear-gradient(135deg, #8a6b2f, #d4af5a); color: #241a08;
  transition: all .2s;
}
.ar-sk-btn:hover { filter: brightness(1.15); }
.ar-sk-btn.disabled { background: rgba(60,52,38,.7); color: #6b6151; cursor: not-allowed; }
.ar-sk-maxed { font-size: 12px; text-align: center; color: #6ef0a0; padding: 4px; }

/* 部署面板兵种数量徽章 */
.dp-cnt {
  font-style: normal; font-size: 11px; color: #f3d97a;
  background: rgba(0,0,0,.3); padding: 1px 6px; border-radius: 8px; margin-left: 2px;
}
.dp-c.zero { opacity: .4; }

/* ===== 战前部署（透明遮罩，底部悬浮面板） ===== */
#deploy-screen { background: transparent; pointer-events: none; justify-content: space-between; padding: 20px 0 16px; }
#deploy-screen > * { pointer-events: auto; }
.deploy-top { text-align: center; }
.deploy-top h2 { color: #d4af5a; letter-spacing: 8px; margin-bottom: 6px; font-size: 22px; text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.dp-hint { color: #e8ddc0; font-size: 12px; letter-spacing: 2px; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.deploy-panel {
  width: 640px; margin: 0 auto; padding: 16px 22px; border-radius: 18px;
  display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.dp-res { display: flex; gap: 24px; color: #f3e6c8; font-size: 14px; letter-spacing: 1px; }
.dp-res b { color: #f3d97a; font-size: 17px; margin: 0 3px; }
.dp-ops { display: flex; gap: 12px; }
.dp-op {
  padding: 10px 16px; border-radius: 12px; cursor: pointer;
  background: rgba(38,32,22,.85); border: 1px solid rgba(212,175,90,.4);
  color: #f3e6c8; font-size: 14px; font-weight: 600; transition: all .18s;
}
.dp-op em { display: block; color: #d4af5a; font-size: 11px; font-style: normal; margin-top: 3px; }
.dp-op:hover:not(.disabled) { border-color: #d4af5a; transform: translateY(-2px); }
.dp-op.disabled { opacity: .4; cursor: not-allowed; }
.dp-form { display: flex; gap: 10px; }
.dp-f {
  padding: 8px 16px; border-radius: 10px; cursor: pointer;
  background: rgba(38,32,22,.85); border: 1px solid rgba(212,175,90,.35);
  color: #c8bda2; font-size: 13px; transition: all .18s;
}
.dp-f:hover { border-color: #d4af5a; }
.dp-f.active { background: linear-gradient(135deg, #8a6b2f, #d4af5a); color: #241a08; font-weight: 700; border: none; }
.dp-class { display: flex; gap: 10px; }
.dp-c {
  padding: 8px 14px; border-radius: 10px; cursor: pointer;
  background: rgba(38,32,22,.85); border: 1px solid rgba(212,175,90,.35);
  color: #c8bda2; font-size: 13px; transition: all .18s;
}
.dp-c:hover { border-color: #d4af5a; }
.dp-c.active { background: linear-gradient(135deg, #8a6b2f, #d4af5a); color: #241a08; font-weight: 700; border: none; }
.dp-status { color: #d4af5a; font-size: 13px; min-height: 18px; letter-spacing: 1px; text-align: center; }
.dp-go { width: 200px; font-size: 16px; letter-spacing: 6px; }

/* ===== 斥候情报弹窗 ===== */
.intel-box { width: 380px; padding: 26px 30px; text-align: center; position: relative; }
.intel-box h3 { color: #d4af5a; letter-spacing: 4px; margin-bottom: 16px; }
.intel-close { position: absolute; top: 12px; right: 16px; cursor: pointer; color: #a99a7e; font-size: 18px; }
.intel-close:hover { color: #f3e6c8; }
.intel-body { color: #f3e6c8; font-size: 14px; line-height: 1.9; text-align: left; }
.intel-body .intel-row { display: flex; justify-content: space-between; border-bottom: 1px dashed rgba(212,175,90,.25); padding: 5px 0; }
.intel-body .intel-k { color: #c8bda2; }
.intel-body .intel-v { color: #f3d97a; font-weight: 700; }
.intel-body .intel-bonus { color: #6ef0a0; margin-top: 10px; }

/* ===== 存档/读档弹窗 ===== */
.save-box { width: 460px; max-width: 92vw; padding: 26px 30px; position: relative; }
.save-box h3 { color: #d4af5a; letter-spacing: 4px; margin-bottom: 18px; text-align: center; }
.save-close { position: absolute; top: 12px; right: 16px; cursor: pointer; color: #a99a7e; font-size: 18px; }
.save-close:hover { color: #f3e6c8; }
.save-slots { display: flex; flex-direction: column; gap: 12px; }
.save-slot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-radius: 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(212,175,90,.2);
  cursor: pointer; transition: all .2s;
}
.save-slot:hover { background: rgba(212,175,90,.12); border-color: rgba(212,175,90,.5); transform: translateY(-1px); }
.save-slot.empty { opacity: .7; }
.save-slot-info { display: flex; flex-direction: column; gap: 4px; }
.save-slot-name { color: #f3e6c8; font-size: 15px; font-weight: 700; }
.save-slot-meta { color: #a99a7e; font-size: 12px; }
.save-slot-actions { display: flex; gap: 8px; }
.save-slot-btn {
  padding: 6px 14px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 13px; background: rgba(212,175,90,.25); color: #f3e6c8;
}
.save-slot-btn:hover { background: rgba(212,175,90,.5); }
.save-slot-btn.danger { background: rgba(180,60,60,.3); color: #ffb0b0; }
.save-slot-btn.danger:hover { background: rgba(180,60,60,.6); }
.save-slot-empty-label { color: #8a7e62; font-size: 14px; font-style: italic; }

/* ===== HUD ===== */
#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#hud button { pointer-events: auto; }

.top-bar {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 22px; padding: 10px 20px; min-width: 420px;
}
.top-left { display: flex; flex-direction: column; }
.level-name { color: #d4af5a; font-weight: 700; letter-spacing: 3px; }
.objective { color: #c8bda2; font-size: 12px; margin-top: 2px; }
.top-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.wave-info { color: #a99a7e; font-size: 13px; }
.weather-chip {
  color: #ffe9b0; font-size: 12px; padding: 2px 10px; border-radius: 20px;
  background: rgba(38,32,22,.6); border: 1px solid rgba(212,175,90,.3); margin-left: 8px;
}
.obj-chip {
  color: #9fd8ff; font-size: 12px; padding: 2px 10px; border-radius: 20px;
  background: rgba(38,32,22,.6); border: 1px solid rgba(79,195,255,.3); margin-left: 8px;
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  background: rgba(38,32,22,.8); border: 1px solid rgba(212,175,90,.4); color: #f3e6c8; font-size: 15px;
}

/* ===== 行军阶段 ===== */
#march-hud {
  position: absolute; top: 86px; left: 50%; transform: translateX(-50%);
  width: 440px; text-align: center; pointer-events: none; z-index: 20;
}
.march-title { font-size: 22px; letter-spacing: 8px; color: #f3e6c8; text-shadow: 0 2px 8px rgba(0,0,0,.6); margin-bottom: 8px; }
.march-track { height: 8px; border-radius: 6px; background: rgba(0,0,0,.4); border: 1px solid rgba(212,175,90,.4); overflow: hidden; }
.march-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #8a6b2f, #d4af5a); transition: width .2s; }
.march-msg { margin-top: 8px; font-size: 13px; color: #e8d9b6; text-shadow: 0 1px 4px rgba(0,0,0,.6); }

/* ===== 属性按钮 + 弹框 ===== */
.stats-hero-btn {
  position: absolute; left: 16px; bottom: 16px;
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900; color: #241a08; font-family: inherit;
  background: radial-gradient(circle at 35% 30%, #f0d9a0, #d4af5a 70%);
  border: 2px solid #f3e6c8;
  cursor: pointer; pointer-events: auto; padding: 0;
  transition: transform .15s, box-shadow .15s;
}
.stats-hero-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(212,175,90,.5); }
.hero-head {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900; color: #241a08;
  background: radial-gradient(circle at 35% 30%, #f0d9a0, #d4af5a 70%);
  border: 2px solid #f3e6c8;
}
.hero-info { min-width: 170px; }
.hero-name { font-size: 15px; font-weight: 700; color: #f3e6c8; margin-bottom: 6px; }
.bar { height: 10px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; margin: 4px 0; position: relative; }
.bar-fill { display: block; height: 100%; border-radius: 6px; transition: width .15s; }
.bar.hp .bar-fill { background: linear-gradient(90deg, #a3262a, #e0484f); }
.bar.sp .bar-fill { background: linear-gradient(90deg, #1f5c8a, #3fa0d8); }
.bar.army-bar .bar-fill { background: linear-gradient(90deg, #8a6b2f, #d4af5a); }
.bar em { position: absolute; right: 6px; top: -1px; font-style: normal; font-size: 9px; color: #fff; text-shadow: 0 1px 2px #000; }
.attrs { display: flex; gap: 8px; flex-wrap: wrap; }
.attrs .at {
  font-size: 11px; padding: 2px 7px; border-radius: 8px;
  background: rgba(0,0,0,.35); color: #c8bda2; border: 1px solid rgba(212,175,90,.2);
}
.attrs .at b { color: #d4af5a; }
.army-count { font-size: 12px; color: #c8bda2; margin-top: 6px; }

.stats-box {
  position: relative; padding: 30px 34px 24px; width: 340px;
  display: flex; flex-direction: column; gap: 16px;
}
.stats-close {
  position: absolute; top: 12px; right: 14px; cursor: pointer;
  width: 28px; height: 28px; line-height: 28px; text-align: center;
  border-radius: 50%; color: #a99a7e; font-size: 16px;
}
.stats-close:hover { background: rgba(212,175,90,.18); color: #f3e6c8; }
.stats-sec-title { font-size: 14px; color: #d4af5a; margin-bottom: 10px; letter-spacing: 2px; }
.stats-hero-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.stats-section .bar { height: 8px; margin: 6px 0; }
.stats-section .attrs { margin-top: 8px; }

.skill-bar {
  position: absolute; right: 16px; bottom: 16px;
  display: flex; gap: 10px; padding: 12px;
}
.skill {
  width: 58px; height: 58px; border-radius: 14px; position: relative; cursor: pointer;
  pointer-events: auto;
  background: radial-gradient(circle at 30% 25%, rgba(60,50,32,.9), rgba(24,20,14,.9));
  border: 1px solid rgba(212,175,90,.45);
  transition: all .12s;
}
.skill:hover { border-color: #f3e6c8; }
.skill .key {
  position: absolute; top: 3px; right: 5px; font-size: 10px; color: #a99a7e;
}
.skill .sname {
  position: absolute; bottom: 4px; left: 0; right: 0; text-align: center;
  font-size: 11px; color: #f3e6c8;
}
.skill .icon { font-size: 22px; position: absolute; top: 10px; left: 0; right: 0; text-align: center; }
.skill .cd-mask {
  position: absolute; inset: 0; border-radius: 14px; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.78) var(--cd, 0%), rgba(0,0,0,.1) var(--cd, 0%), transparent 100%);
}
.skill .cd-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 18px; font-weight: 700; color: #f3e6c8;
  text-shadow: 0 1px 3px #000; opacity: 0;
}
.skill.cooling { filter: saturate(.55); }
.skill .cd-tip { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9px; color: #a99a7e; }

.control-hint {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: rgba(232,224,208,.4); letter-spacing: 1px;
}

/* ===== 开场镜头标题 ===== */
#cinematic-title {
  position: fixed; top: 30%; left: 0; right: 0;
  text-align: center; z-index: 50;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.ct-name {
  font-size: 44px; color: #f0e6cf;
  letter-spacing: 10px; font-weight: bold;
  text-shadow: 0 2px 30px rgba(0,0,0,.8), 0 0 60px rgba(212,175,90,.3);
}
.ct-sub {
  font-size: 17px; color: #d4af5a;
  margin-top: 10px; letter-spacing: 5px;
  text-shadow: 0 1px 12px rgba(0,0,0,.6);
}

/* ===== 剧情对话框 ===== */
.dialog-box {
  width: min(640px, 88vw);
  padding: 28px 34px 22px;
  text-align: left;
  cursor: pointer;
}
.dialog-name {
  color: #d4af5a;
  font-size: 15px;
  letter-spacing: 3px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212,175,90,.25);
}
.dialog-text {
  color: #f0e6cf;
  font-size: 16px;
  line-height: 1.9;
  min-height: 96px;
}
.dialog-hint {
  margin-top: 14px;
  text-align: right;
  color: rgba(240,230,207,.45);
  font-size: 13px;
  animation: hintPulse 1.6s ease-in-out infinite;
}
@keyframes hintPulse { 0%, 100% { opacity: .35; } 50% { opacity: .9; } }

/* ===== 剧情 Toast 对白（自动关闭 · 小弹框） ===== */
#dialog-toast {
  position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%) translateY(20px);
  z-index: 9998; max-width: min(420px, 86vw); padding: 13px 20px 15px;
  background: rgba(24,30,44,.92); border: 1px solid rgba(212,175,90,.35);
  border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .3s ease;
  text-align: left;
}
#dialog-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#dialog-toast .toast-who {
  color: #d4af5a; font-size: 13px; letter-spacing: 2px; margin-bottom: 6px;
}
#dialog-toast .toast-text { color: #f0e6cf; font-size: 14px; line-height: 1.6; }

/* ===== 结算 ===== */
.result-box { text-align: center; padding: 36px 52px; max-width: 480px; }
.result-box h2 { font-size: 34px; letter-spacing: 8px; margin-bottom: 10px; color: #f3e6c8; }
.result-box #result-title.win { color: #d4af5a; text-shadow: 0 0 20px rgba(212,175,90,.5); }
.result-box #result-title.lose { color: #e0484f; text-shadow: 0 0 20px rgba(224,72,79,.4); }
#result-desc { color: #a99a7e; margin-bottom: 16px; line-height: 1.7; }
.reward-box { margin: 14px auto 6px; padding: 12px; border-radius: 14px; background: rgba(0,0,0,.3); }
.reward-box h3 { color: #d4af5a; font-size: 14px; margin-bottom: 8px; }
.reward-box .attrs { justify-content: center; flex-wrap: wrap; }
.result-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }

/* ===== 关卡载入进度遮罩 ===== */
#loading-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,8,4,.78);
}
#loading-overlay.hidden { display: none; }
.loading-box {
  width: 340px; max-width: 84vw;
  padding: 24px 28px; border-radius: 16px;
  text-align: center; color: #f3e6c8;
  background: rgba(24,20,14,.92); border: 1px solid rgba(212,175,90,.35);
  box-shadow: 0 10px 34px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,220,150,.12);
}
.loading-title { font-size: 16px; letter-spacing: 3px; color: #ffd97a; margin-bottom: 14px; }
.loading-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.loading-bar-fill { height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg,#d4af5a,#ffd97a); transition: width .25s ease; }
.loading-msg { margin-top: 12px; font-size: 13px; color: #d9c9a8; min-height: 18px; }
.loading-pct { margin-top: 4px; font-size: 12px; color: #a9987a; }

/* ===== 暂停 ===== */
.mask {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(8,8,12,.7); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
.pause-box { text-align: center; padding: 34px 48px; display: flex; flex-direction: column; gap: 14px; }
.pause-box h2 { color: #d4af5a; letter-spacing: 8px; margin-bottom: 6px; }

/* ===== 回合制：敌军面板 ===== */
.enemy-panel {
  position: absolute; top: 76px; right: 16px;
  width: 210px; padding: 12px 14px;
}

/* ===== 我军状态面板（左上方） ===== */
.player-panel {
  position: absolute; top: 76px; left: 16px;
  width: 230px; padding: 12px 14px;
}
.pp-title { font-size: 13px; color: #d4af5a; margin-bottom: 8px; letter-spacing: 1px; }
.pp-hero-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(212,175,90,.15); }
.pp-hero-icon {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; color: #241a08;
  background: radial-gradient(circle at 35% 30%, #f0d9a0, #d4af5a 70%);
  border: 1.5px solid #f3e6c8;
}
.pp-hero-bars { flex: 1; min-width: 0; }
.pp-hero-name { font-size: 12px; color: #f3e6c8; font-weight: 700; margin-bottom: 3px; }
.player-panel .bar { height: 7px; margin: 3px 0; }
.player-panel .bar em { font-size: 8px; top: -2px; }
.pp-army-row { display: flex; align-items: center; gap: 8px; }
.pp-army-label { font-size: 11px; color: #a99a7e; min-width: 16px; }
.pp-army-row .bar { flex: 1; height: 8px; margin: 0; }
.pp-army-row .bar-fill { background: linear-gradient(90deg, #2a7a3a, #5ec06a); }
.pp-army-row em { font-size: 9px; top: -2px; }
.pp-morale-row, .pp-rage-row { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.pp-morale-label, .pp-rage-label { font-size: 11px; color: #a99a7e; min-width: 16px; }
.pp-morale-row .bar, .pp-rage-row .bar { flex: 1; height: 7px; margin: 0; }
.pp-morale-row .bar-fill { background: linear-gradient(90deg, #7a5a1f, #e0b34f); }
.pp-rage-row .bar-fill { background: linear-gradient(90deg, #7a1f3a, #e0486a); }
.pp-morale-row em, .pp-rage-row em { font-size: 9px; top: -2px; }
.enemy-title { font-size: 13px; color: #e0484f; margin-bottom: 8px; letter-spacing: 1px; }
.enemy-boss-name { font-size: 12px; color: #f3e6c8; margin-bottom: 4px; }
.enemy-panel .bar { height: 8px; }
.enemy-panel .bar-fill { background: linear-gradient(90deg, #7a1f2a, #e0484f); }
.enemy-morale-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.enemy-morale-label { font-size: 11px; color: #a99a7e; min-width: 16px; }
.enemy-morale-row .bar { flex: 1; height: 7px; margin: 0; }
.enemy-morale-row .bar-fill { background: linear-gradient(90deg, #7a3a1f, #e0804f); }
.enemy-morale-row em { font-size: 9px; top: -2px; }
.enemy-count { font-size: 12px; color: #c8bda2; margin-top: 6px; }

/* ===== 回合制：指令面板 ===== */
.cmd-panel {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  padding: 10px 18px 8px; min-width: 640px; max-width: 94vw;
}
.turn-info {
  display: flex; justify-content: center; align-items: center; gap: 14px;
  font-size: 13px; color: #d4af5a; letter-spacing: 2px;
}
.turn-msg {
  color: #f3e6c8; font-size: 12px;
  transition: opacity .3s;
}
.cmd-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cmd {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; width: 84px; height: 64px; cursor: pointer;
  border-radius: 14px; pointer-events: auto;
  background: radial-gradient(circle at 30% 25%, rgba(60,50,32,.9), rgba(24,20,14,.9));
  border: 1px solid rgba(212,175,90,.45);
  color: #f3e6c8; font-family: inherit;
  transition: all .12s;
}
.cmd:hover:not(.disabled) { border-color: #f3e6c8; transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.cmd .ic { font-size: 20px; line-height: 1; }
.cmd .lb { font-size: 12px; }
.cmd .cs { font-size: 9px; color: #a99a7e; }
.cmd.disabled { opacity: .35; cursor: not-allowed; filter: grayscale(.7); }
.cmd.ult {
  background: radial-gradient(circle at 30% 25%, rgba(90,30,60,.95), rgba(40,12,28,.95));
  border-color: rgba(224,72,106,.7);
}
.cmd.ult.ready {
  border-color: #ffd76a; color: #ffe9b0;
  box-shadow: 0 0 16px rgba(255,190,60,.55), inset 0 0 10px rgba(255,170,40,.25);
  animation: ultPulse 1s ease-in-out infinite;
}
@keyframes ultPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.cmd-hint { font-size: 10px; color: rgba(232,224,208,.4); letter-spacing: 1px; }

/* ===== 回合制：补给物品 ===== */
.item-panel {
  display: flex; gap: 10px; padding: 10px 12px;
  position: absolute; bottom: calc(100% + 10px); left: 0; right: 0;
  border-radius: 16px;
}
.item-btn {
  flex: 1; display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(38,32,22,.85);
  border: 1px solid rgba(212,175,90,.4);
  color: #f3e6c8; font-family: inherit; text-align: left;
  transition: all .12s;
}
.item-btn:hover:not(.disabled) { border-color: #f3e6c8; transform: translateY(-2px); }
.item-btn .ic { font-size: 22px; }
.item-btn .ib { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.item-btn .ib b { font-size: 13px; }
.item-btn .ib em { font-style: normal; font-size: 10px; color: #a99a7e; }
.item-btn .cnt { font-size: 13px; color: #d4af5a; }
.item-btn .cnt b { font-size: 16px; }
.item-btn.disabled { opacity: .4; cursor: not-allowed; filter: grayscale(.7); }
