/* ===== 潮生阁 · 古代战争 ===== */
.war-page {
  position: fixed; inset: 0; z-index: 120;
  display: flex; flex-direction: column;
  background: radial-gradient(120% 60% at 50% 0%, #17384b 0%, #0c1c28 55%, #08131b 100%);
  color: #eaf2f8;
  overflow: hidden;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.war-page.hidden { display: none; }

/* 顶栏 */
.war-top {
  position: relative; z-index: 3; flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
  background: linear-gradient(180deg, rgba(5,14,21,.86), rgba(5,14,21,0));
}
.war-back {
  width: 34px; height: 34px; flex: none; border-radius: 11px; border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08); color: #e6eff6; font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.war-back:active { transform: scale(.94); }
.war-title { flex: 1; min-width: 0; }
.war-title b { display: block; font-size: 17px; letter-spacing: .5px; color: #f4e2b0; }
.war-title span { display: block; font-size: 11px; color: #9db4c5; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.war-money {
  flex: none; padding: 6px 12px; border-radius: 999px;
  background: rgba(232,196,106,.14); border: 1px solid rgba(232,196,106,.35);
  color: #f4d98d; font-size: 12px; font-variant-numeric: tabular-nums;
}
.war-money b { font-size: 14px; }

/* 城池场景 */
.war-scene { position: relative; flex: none; height: 33vh; min-height: 190px; max-height: 300px; overflow: hidden; }
.war-scene canvas { width: 100%; height: 100%; display: block; }
.war-scene::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 46px;
  background: linear-gradient(180deg, rgba(8,19,27,0), rgba(8,19,27,.92));
  pointer-events: none;
}
.war-weather-tag {
  position: absolute; left: 14px; top: 10px; z-index: 2;
  font-size: 11px; color: #cfe3ef; background: rgba(5,16,24,.5);
  border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 3px 9px;
}

/* 资源条 */
.war-res { display: flex; gap: 8px; padding: 0 12px; margin-top: -16px; position: relative; z-index: 2; }
.war-res .res {
  flex: 1; min-width: 0; text-align: center; padding: 8px 4px 7px;
  background: rgba(10,26,37,.78); border: 1px solid rgba(232,196,106,.22); border-radius: 14px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 10px 22px -16px rgba(0,0,0,.8);
}
.war-res .res i { font-style: normal; font-size: 13px; opacity: .9; }
.war-res .res b { display: block; font-size: 14px; color: #f3d98e; font-variant-numeric: tabular-nums; line-height: 1.2; }
.war-res .res span { display: block; font-size: 10px; color: #9db4c5; margin-top: 1px; }
.war-res .res.bump b { animation: warBump .45s ease; }
@keyframes warBump { 0% { transform: scale(1); } 40% { transform: scale(1.18); color: #fff3c8; } 100% { transform: scale(1); } }

/* 页签 */
.war-tabs { flex: none; display: flex; gap: 6px; padding: 10px 12px 8px; overflow-x: auto; }
.war-tabs::-webkit-scrollbar { display: none; }
.war-tabs button {
  flex: none; padding: 7px 15px; border-radius: 999px; font-size: 13px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.055); color: #cfe0ec;
  transition: background .15s, color .15s, transform .12s;
}
.war-tabs button:active { transform: scale(.96); }
.war-tabs button.on {
  background: linear-gradient(160deg, #efd28a, #d2a33c); color: #2b1d07; font-weight: 800;
  border-color: transparent; box-shadow: 0 8px 20px -12px rgba(232,196,106,.9);
}

/* 内容区 */
.war-body { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 12px calc(24px + env(safe-area-inset-bottom, 0px)); }
.war-body::-webkit-scrollbar { width: 0; }
.war-card {
  border-radius: 16px; padding: 12px; margin-bottom: 10px;
  background: linear-gradient(180deg, rgba(255,252,246,.98), rgba(244,238,226,.98));
  color: #2c3a43; box-shadow: 0 14px 30px -22px rgba(0,0,0,.85);
}
.war-card h3 { margin: 0 0 8px; font-size: 14px; color: #33434d; display: flex; align-items: center; gap: 6px; }
.war-card h3 em { font-style: normal; font-size: 11px; color: #8a9aa6; font-weight: 400; margin-left: auto; }
.war-note { font-size: 11.5px; color: #7d8d99; line-height: 1.55; }
.war-gold { color: #b8842a; font-weight: 700; }

/* 建设 */
.war-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.war-b {
  border-radius: 15px; padding: 11px; background: #fffdf8;
  border: 1px solid rgba(60,80,95,.1); box-shadow: 0 8px 18px -14px rgba(40,60,75,.6);
  display: flex; flex-direction: column; gap: 6px;
}
.war-b-top { display: flex; align-items: center; gap: 8px; }
.war-b-ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: rgba(232,196,106,.18); }
.war-b-name { font-size: 13.5px; font-weight: 800; }
.war-b-lv { font-size: 11px; color: #8a9aa6; }
.war-b-desc { font-size: 11px; color: #7d8d99; line-height: 1.45; min-height: 30px; }
.war-b-foot { display: flex; align-items: center; gap: 6px; }
.war-b-cost { font-size: 11.5px; color: #b8842a; font-weight: 700; margin-right: auto; }

/* 按钮 */
.war-btn {
  border: 0; border-radius: 11px; padding: 8px 13px; font-size: 12.5px; font-weight: 800;
  background: linear-gradient(160deg, #efd28a, #cf9f39); color: #2b1e08;
  transition: transform .12s, filter .15s;
}
.war-btn:active { transform: scale(.95); }
.war-btn:disabled { opacity: .45; filter: grayscale(.4); }
.war-btn.ghost { background: rgba(255,255,255,.1); color: #e3edf4; border: 1px solid rgba(255,255,255,.18); }
.war-btn.red { background: linear-gradient(160deg, #e46a52, #c23a26); color: #fff; }
.war-btn.green { background: linear-gradient(160deg, #5fc394, #2f8f68); color: #fff; }
.war-btn.wide { width: 100%; padding: 12px; font-size: 14px; }
.war-btn.big { padding: 11px 18px; font-size: 13.5px; }

/* 招兵 */
.war-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.war-row label { font-size: 12.5px; color: #5d6d78; flex: none; width: 44px; }
.war-num {
  flex: 1; min-width: 0; height: 40px; border-radius: 11px; border: 1px solid rgba(60,80,95,.16);
  background: #fff; color: #2c3a43; font-size: 16px; font-weight: 700; text-align: center;
  font-variant-numeric: tabular-nums;
}
.war-quick { display: flex; gap: 6px; }
.war-quick button {
  flex: 1; border-radius: 9px; border: 1px solid rgba(60,80,95,.16); background: #fff;
  color: #4a5c68; font-size: 12px; padding: 7px 0;
}
.war-slider { width: 100%; margin: 6px 0 2px; accent-color: #cf9f39; }
.war-cost-line { display: flex; justify-content: space-between; font-size: 12px; color: #5d6d78; margin-top: 6px; }
.war-cost-line b { color: #b8842a; }

/* 将领 */
.war-gen { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed rgba(60,80,95,.16); }
.war-gen:last-child { border-bottom: 0; }
.war-gen-av {
  width: 40px; height: 40px; flex: none; border-radius: 12px; font-size: 15px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; color: #6b4a12;
  background: linear-gradient(160deg, #f6e3b4, #e2bd6d);
}
.war-gen-info { flex: 1; min-width: 0; }
.war-gen-info b { font-size: 13.5px; }
.war-gen-info span { display: block; font-size: 11px; color: #7d8d99; margin-top: 2px; }
.war-gen .war-btn { padding: 7px 10px; font-size: 11.5px; }

/* 出征 */
.war-target { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed rgba(60,80,95,.16); }
.war-target:last-child { border-bottom: 0; }
.war-target-flag {
  width: 38px; height: 38px; flex: none; border-radius: 11px; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #dfeaf2, #c3d6e3); color: #31536b;
}
.war-target.npc .war-target-flag { background: linear-gradient(160deg, #efd9d1, #d8b6a8); color: #7a3a2a; }
.war-target-info { flex: 1; min-width: 0; }
.war-target-info b { font-size: 13.5px; }
.war-target-info b i { font-style: normal; font-size: 10px; color: #fff; background: #c98a3a; border-radius: 5px; padding: 1px 5px; margin-left: 5px; vertical-align: 2px; }
.war-target-info span { display: block; font-size: 11px; color: #7d8d99; margin-top: 2px; }
.war-target .war-btn { flex: none; padding: 8px 12px; font-size: 12px; }
.war-shield { font-size: 11px; color: #b06a2a; }

/* 战报 */
.war-log-item { padding: 8px 0; border-bottom: 1px dashed rgba(60,80,95,.16); font-size: 12px; color: #4a5c68; }
.war-log-item:last-child { border-bottom: 0; }
.war-log-item b.win { color: #2f8f68; }
.war-log-item b.lose { color: #c23a26; }
.war-log-item span { display: block; color: #8a9aa6; font-size: 11px; margin-top: 3px; }

/* 钱庄 */
.war-money-box { display: flex; gap: 8px; align-items: center; }
.war-input {
  flex: 1; min-width: 0; height: 42px; border-radius: 11px; border: 1px solid rgba(60,80,95,.16);
  background: #fff; padding: 0 12px; font-size: 15px; color: #2c3a43;
}
.war-pwd { width: 100%; height: 42px; border-radius: 11px; border: 1px solid rgba(60,80,95,.16); background: #fff; padding: 0 12px; font-size: 15px; color: #2c3a43; letter-spacing: 3px; }
.war-split { height: 1px; background: rgba(60,80,95,.12); margin: 12px 0; }
.war-rate { display: flex; justify-content: space-between; font-size: 12px; color: #5d6d78; margin: 6px 0; }
.war-rate b { color: #b8842a; }

/* 事件弹窗 */
.war-modal {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(3,10,16,.62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  padding: 24px;
}
.war-modal.hidden { display: none; }
.war-modal-card {
  width: 100%; max-width: 320px; border-radius: 22px; padding: 22px 18px 16px; text-align: center;
  background: linear-gradient(180deg, #fffdf7, #f2e9d8); color: #2c3a43;
  box-shadow: 0 30px 60px -24px rgba(0,0,0,.8);
  animation: warPop .26s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes warPop { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }
.war-modal-ico { font-size: 46px; line-height: 1; }
.war-modal-card h2 { margin: 10px 0 6px; font-size: 19px; letter-spacing: 1px; }
.war-modal-card p { margin: 0 0 4px; font-size: 13px; color: #5d6d78; line-height: 1.6; }
.war-modal-delta { font-size: 14px; font-weight: 800; margin: 8px 0 14px; color: #b8842a; }
.war-modal-delta.bad { color: #c23a26; }
.war-modal-card .war-btn { width: 100%; padding: 11px; font-size: 14px; }

/* 提示 */
.war-toast {
  position: absolute; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: rgba(8,20,29,.92); color: #eaf2f8; font-size: 13px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16); transition: opacity .2s, transform .2s; max-width: 82vw; text-align: center;
}
.war-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 出征动画 */
.war-battle { position: absolute; inset: 0; z-index: 25; display: none; background: rgba(3,10,16,.28); }
.war-battle.on { display: block; }
.war-battle canvas { width: 100%; height: 100%; display: block; }
.war-battle-banner {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.8);
  font-size: 34px; font-weight: 900; letter-spacing: 8px; color: #f6e3a8;
  text-shadow: 0 6px 26px rgba(0,0,0,.9), 0 0 18px rgba(240,200,110,.5);
  opacity: 0; transition: opacity .3s, transform .3s; white-space: nowrap;
}
.war-battle-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.war-battle-banner.lose { color: #f0a08e; letter-spacing: 4px; font-size: 30px; }

/* 搜索入口卡片（跟炸金花同款） */
.war-hit-art {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: 46px; height: 46px; border-radius: 14px; flex: none; font-size: 22px;
  background: linear-gradient(160deg, #e9d3a1, #cba55e);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.08);
}

/* ===== 天下大地图 ===== */
.war-map-wrap {
  position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 10px;
  box-shadow: 0 18px 40px -26px rgba(0,0,0,.9);
  border: 1px solid rgba(232,196,106,.22);
}
#warMapCanvas { display: block; width: 100%; height: auto; aspect-ratio: 10 / 7; min-height: 240px; max-height: 380px; touch-action: none; }
.war-map-hint {
  position: absolute; left: 10px; top: 8px; font-size: 10.5px; color: rgba(255,255,255,.82);
  background: rgba(8,20,28,.55); padding: 3px 9px; border-radius: 999px; pointer-events: none;
}
.war-map-card {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 3;
  border-radius: 14px; padding: 10px 12px; color: #2c3a43;
  background: rgba(255,252,246,.97); box-shadow: 0 16px 34px -20px rgba(0,0,0,.75);
  animation: warPop .2s cubic-bezier(.2,.9,.3,1.2) both;
}
.war-map-card.hidden { display: none; }
.wm-top { display: flex; align-items: baseline; gap: 8px; }
.wm-top b { font-size: 15px; }
.wm-top b i {
  font-style: normal; font-size: 10px; color: #fff; background: #c8862f;
  border-radius: 5px; padding: 1px 5px; margin-left: 5px; vertical-align: 2px;
}
.wm-top span { font-size: 11px; color: #7d8d99; margin-left: auto; }
.wm-stats { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: #5d6d78; margin: 7px 0; }
.wm-stats b { color: #b8842a; font-variant-numeric: tabular-nums; }
.wm-shield { font-size: 11px; color: #b06a2a; margin-bottom: 7px; }
.wm-acts { display: flex; gap: 8px; }
.wm-acts .war-btn { flex: 1; padding: 9px; font-size: 12.5px; }
.war-rank-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px dashed rgba(60,80,95,.16); font-size: 12.5px; }
.war-rank-row:last-child { border-bottom: 0; }
.war-rank-row > b { width: 20px; text-align: center; color: #8a9aa6; font-size: 12px; }
.war-rank-row > b.rk0 { color: #d4a017; }
.war-rank-row > b.rk1 { color: #9aa6b2; }
.war-rank-row > b.rk2 { color: #b07a4a; }
.war-rank-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.war-rank-row .nm i { font-style: normal; font-size: 9.5px; color: #fff; background: #a4553f; border-radius: 4px; padding: 1px 4px; margin-left: 4px; }
.war-rank-row .rg { font-size: 11px; color: #8a9aa6; }
.war-rank-row .pw { font-weight: 800; color: #b8842a; font-variant-numeric: tabular-nums; }
.war-two { display: flex; gap: 8px; margin-top: 10px; }
.war-two .war-btn { flex: 1; }

/* ===== 美术升级 v2：金墨质感 ===== */

/* —— 顶栏：渐变压边 + 金色细线 —— */
.war-top {
  background: linear-gradient(180deg, rgba(4,12,18,.94) 0%, rgba(4,12,18,.5) 62%, rgba(4,12,18,0) 100%);
  padding-bottom: 16px;
}
.war-top::after {
  content: ''; position: absolute; left: 16px; right: 16px; bottom: 5px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,196,106,.45), transparent);
}
.war-back {
  background: linear-gradient(160deg, rgba(255,255,255,.16), rgba(255,255,255,.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 8px 18px -12px rgba(0,0,0,.9);
}
.war-title b {
  text-shadow: 0 2px 14px rgba(0,0,0,.65);
  letter-spacing: 1px;
}
.war-lv {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 32% 26%, #f7e2a8, #c9983a 70%, #9c7222);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 6px 16px -8px rgba(200,150,50,.8);
  color: #3a2708; line-height: 1;
}
.war-lv b { font-size: 15px; font-weight: 900; }
.war-lv i { font-style: normal; font-size: 8px; opacity: .75; margin-top: 1px; }
.war-money {
  background: linear-gradient(160deg, rgba(232,196,106,.24), rgba(232,196,106,.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 10px 20px -14px rgba(232,196,106,.55);
}

/* —— 资源卡：玻璃 + 顶部高光 + 进度条 —— */
.war-res .res {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(17,42,57,.92), rgba(8,22,32,.94));
  border: 1px solid rgba(232,196,106,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 14px 28px -20px rgba(0,0,0,.95);
}
.war-res .res::after {
  content: ''; position: absolute; left: 8px; right: 8px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,232,176,.6), transparent);
}
.war-res .res i { display: block; font-size: 15px; margin-bottom: 1px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.55)); }
.war-res .res .bar {
  display: block; height: 3px; border-radius: 2px; margin: 5px 6px 0;
  background: rgba(255,255,255,.15); overflow: hidden;
}
.war-res .res .bar i {
  display: block; height: 100%; width: 0; border-radius: 2px; margin: 0;
  background: linear-gradient(90deg, #e0b25a, #f7e0a4); transition: width .4s ease;
}

/* —— 页签：选中态更像一枚金印 —— */
.war-tabs button {
  transition: transform .14s, background .18s, box-shadow .18s, color .18s;
}
.war-tabs button.on {
  background: linear-gradient(180deg, #f7e0a6, #d3a441);
  box-shadow: 0 10px 22px -12px rgba(232,196,106,.95), inset 0 1px 0 rgba(255,255,255,.6);
}
.war-tabs button:active { transform: scale(.95); }

/* —— 卡片：纸纹 + 内描边 —— */
.war-card {
  position: relative;
  background-image:
    repeating-linear-gradient(0deg, rgba(150,120,80,.035) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #fffdf8 0%, #f6efe2 100%);
  border: 1px solid rgba(160,130,80,.18);
  box-shadow: 0 16px 34px -24px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.75);
}
.war-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}
.war-card h3 {
  padding-bottom: 8px; margin-bottom: 10px;
  border-bottom: 1px dashed rgba(120,95,55,.24);
}
.war-card h3::before {
  content: ''; width: 4px; height: 14px; border-radius: 2px; flex: none;
  background: linear-gradient(180deg, #e8c46a, #b9872f);
  box-shadow: 0 2px 6px -2px rgba(180,130,40,.7);
}

/* —— 建筑卡：等级进度点 —— */
.war-b {
  position: relative;
  background: linear-gradient(180deg, #fffefb, #f8f2e7);
  border: 1px solid rgba(160,130,80,.16);
  box-shadow: 0 10px 22px -16px rgba(40,60,75,.7), inset 0 1px 0 rgba(255,255,255,.8);
  overflow: hidden;
}
.war-b::after {
  content: ''; position: absolute; right: -18px; top: -18px; width: 46px; height: 46px;
  border-radius: 50%; background: radial-gradient(circle, rgba(232,196,106,.16), transparent 70%);
  pointer-events: none;
}
.war-b-lvbar { display: flex; gap: 2px; margin-top: 4px; padding: 2px; border-radius: 4px; background: rgba(120,95,55,.09); }
.war-b-lvbar i {
  flex: 1; height: 4px; border-radius: 2px; background: rgba(120,95,55,.18);
}
.war-b-lvbar i.on { background: linear-gradient(90deg, #f0cb7c, #c9973a); box-shadow: 0 0 5px rgba(220,170,70,.65); }

/* —— 按钮：金属高光 —— */
.war-btn {
  background: linear-gradient(180deg, #f8e2ac 0%, #e2b65e 55%, #c9983a 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 10px 20px -12px rgba(150,100,20,.65);
}
.war-btn.ghost {
  background: linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,.05));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 8px 18px -14px rgba(0,0,0,.8);
}
.war-btn.red { background: linear-gradient(180deg, #ef8170, #c9412c); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 22px -12px rgba(190,60,40,.7); }
.war-btn.green { background: linear-gradient(180deg, #7ad6a8, #2f9169); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 22px -12px rgba(40,140,100,.7); }

/* —— 将领/目标行：细线分隔 + 悬停感 —— */
.war-gen, .war-target { transition: background .15s; }
.war-gen:active, .war-target:active { background: rgba(200,170,110,.08); }
.war-gen-av {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 6px 14px -8px rgba(150,110,40,.7);
  border: 1px solid rgba(150,110,40,.35);
}
.war-target-flag { box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 6px 14px -10px rgba(40,70,95,.6); }

/* —— 地图外框：四角金饰 —— */
.war-map-wrap::before,
.war-map-wrap::after {
  content: ''; position: absolute; width: 20px; height: 20px; z-index: 2; pointer-events: none;
  border: 2px solid rgba(232,196,106,.65);
}
.war-map-wrap::before { left: 6px; top: 6px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.war-map-wrap::after { right: 6px; bottom: 6px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.war-map-card {
  border: 1px solid rgba(200,160,90,.35);
  background-image: repeating-linear-gradient(0deg, rgba(150,120,80,.03) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(255,253,247,.98), rgba(244,236,221,.98));
  box-shadow: 0 24px 50px -26px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.8);
}

/* —— 势力榜：名次像印章 —— */
.war-rank-row { border-radius: 9px; padding: 7px 6px; }
.war-rank-row > b {
  width: 22px; height: 22px; border-radius: 7px; line-height: 22px; flex: none;
  background: rgba(120,95,55,.1); color: #7d6a4a; font-size: 11px;
}
.war-rank-row > b.rk0 { background: linear-gradient(160deg, #f6dd9e, #d3a441); color: #3a2708; }
.war-rank-row > b.rk1 { background: linear-gradient(160deg, #e6ecf1, #b9c6cf); color: #3b4a55; }
.war-rank-row > b.rk2 { background: linear-gradient(160deg, #e8c1a0, #b98a5f); color: #4a2c12; }

/* —— 弹窗 / Toast —— */
.war-modal-card {
  border: 1px solid rgba(200,160,90,.32);
  background-image: repeating-linear-gradient(0deg, rgba(150,120,80,.03) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #fffdf7, #f2e9d8);
  box-shadow: 0 34px 70px -30px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.8);
}
.war-modal-delta {
  display: inline-block; padding: 4px 14px; border-radius: 999px;
  background: rgba(232,196,106,.16); border: 1px solid rgba(200,160,90,.3);
}
.war-modal-delta.bad { background: rgba(220,90,70,.12); border-color: rgba(210,90,70,.28); }
.war-toast {
  border-color: rgba(232,196,106,.4);
  background: linear-gradient(180deg, rgba(14,30,42,.95), rgba(6,18,26,.95));
  box-shadow: 0 16px 30px -18px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.12);
}

/* —— 页签内容淡入 —— */
@keyframes warBodyIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.war-body.fade > * { animation: warBodyIn .26s cubic-bezier(.2,.8,.3,1) both; }
.war-body.fade > *:nth-child(2) { animation-delay: .04s; }
.war-body.fade > *:nth-child(3) { animation-delay: .08s; }
.war-body.fade > *:nth-child(4) { animation-delay: .12s; }

/* —— 页面进场 —— */
@keyframes warPageIn { from { opacity: 0; transform: scale(1.01); } to { opacity: 1; transform: none; } }
.war-page:not(.hidden) { animation: warPageIn .24s ease both; }


@media (max-width: 360px) {
  .war-grid { grid-template-columns: 1fr; }
  .war-res .res b { font-size: 13px; }
}

/* ===== 行军条 / 音效 / 兵种 ===== */
.war-sound {
  flex: none; width: 34px; height: 34px; border-radius: 11px;
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,.04));
  color: #e6eff6; font-size: 15px; display: flex; align-items: center; justify-content: center;
}
.war-sound.off { opacity: .5; }
.war-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; }
.war-modal-card .war-btn.ghost {
  background: rgba(120,95,55,.1);
  color: #58616a;
  border: 1px solid rgba(120,95,55,.22);
  box-shadow: none;
}
.war-march {
  display: flex; align-items: center; gap: 8px; margin: 8px 12px 0; padding: 8px 12px;
  border-radius: 12px; border: 1px solid rgba(232,196,106,.35);
  background: linear-gradient(90deg, rgba(200,150,60,.22), rgba(200,150,60,.05));
  color: #f4d98d; font-size: 12px;
}
.war-march.hidden { display: none; }
.war-march .wm-ico { font-size: 14px; }
.war-march b { margin-left: auto; font-variant-numeric: tabular-nums; }

.war-troop-pick { display: flex; gap: 8px; margin: 10px 0 12px; }
.war-troop {
  flex: 1; min-width: 0; border-radius: 13px; border: 1px solid rgba(160,130,80,.2);
  background: #fffdf8; padding: 8px 6px; text-align: center;
  display: flex; flex-direction: column; gap: 2px; align-items: center;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .12s;
}
.war-troop:active { transform: scale(.97); }
.war-troop i { font-style: normal; font-size: 18px; }
.war-troop b { font-size: 12.5px; }
.war-troop em { font-style: normal; font-size: 10px; color: #a07a3a; }
.war-troop span { font-size: 9.5px; color: #8a9aa6; line-height: 1.25; }
.war-troop.on {
  background: linear-gradient(180deg, #fff6dd, #f3e2b8);
  border-color: rgba(200,150,60,.6);
  box-shadow: 0 8px 18px -12px rgba(180,130,40,.8), inset 0 1px 0 #fff;
}
.war-troop.on b { color: #8a5a12; }

/* ===== 布局 v2：顶部 HUD + 底部六宫格 + 中间大操作区 ===== */
.war-page { display: flex; flex-direction: column; height: 100%; }
.war-top { flex: none; }
.war-scene {
  flex: none; height: 22vh; min-height: 140px; max-height: 210px;
  transition: height .25s ease, opacity .2s ease, min-height .25s ease;
  cursor: pointer;
}
.war-scene-dim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(6,16,24,.10), rgba(6,16,24,.42));
}
.war-page.scene-fold .war-scene {
  height: 0 !important; min-height: 0 !important; max-height: 0 !important;
  opacity: 0; pointer-events: none;
}
.war-unfold {
  flex: none; margin: 6px 12px 0; padding: 6px 10px; border-radius: 10px;
  border: 1px dashed rgba(232,196,106,.35); background: rgba(232,196,106,.08);
  color: #f0d79b; font-size: 11px; text-align: center;
}
.war-unfold.hidden { display: none; }

.war-res { flex: none; margin-top: -14px; padding: 0 10px; gap: 6px; }
.war-page.scene-fold .war-res { margin-top: 8px; }
.war-res .res { padding: 6px 4px 5px; border-radius: 12px; }
.war-res .res b { font-size: 13.5px; }
.war-res .res span { font-size: 9.5px; }
.war-res .res .bar { margin: 4px 6px 0; }

.war-march { flex: none; }
.war-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 8px 12px 10px;
  -webkit-overflow-scrolling: touch;
}

/* 底部六宫格导航 */
.war-tabs {
  flex: none; display: flex; gap: 4px; overflow: visible;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(8,20,28,.35), rgba(5,14,21,.97));
  border-top: 1px solid rgba(232,196,106,.16);
  box-shadow: 0 -10px 24px -18px rgba(0,0,0,.9);
}
.war-tabs button {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; border: 0; border-radius: 12px; background: none;
  color: #9db4c5; font-size: 10.5px; line-height: 1.1;
  transition: background .16s, color .16s, transform .12s;
}
.war-tabs button .tb-ico { font-size: 15px; line-height: 1; font-style: normal; opacity: .9; }
.war-tabs button.on {
  background: linear-gradient(180deg, #f7e0a6, #d3a441);
  color: #2b1d08; font-weight: 800;
  box-shadow: 0 8px 18px -10px rgba(232,196,106,.95), inset 0 1px 0 rgba(255,255,255,.55);
}
.war-tabs button:active { transform: scale(.94); }

/* 地图页：画布吃满剩余高度 */
#warMapCanvas {
  aspect-ratio: auto !important;
  height: 46vh; min-height: 220px; max-height: 420px;
}

@media (max-height: 700px) {
  .war-scene { height: 18vh; min-height: 118px; }
  .war-res .res { padding: 5px 3px 4px; }
  .war-res .res b { font-size: 12.5px; }
  #warMapCanvas { height: 42vh; }
}
.war-foldbtn {
  flex: none; width: 34px; height: 34px; border-radius: 11px;
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,.04));
  color: #e6eff6; font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.war-foldbtn:active { transform: scale(.94); }

/* 浅色卡片/弹窗里的 ghost 按钮要深色字，否则看不清 */
.war-card .war-btn.ghost,
.war-map-card .war-btn.ghost {
  background: rgba(120,95,55,.1);
  color: #58616a;
  border: 1px solid rgba(120,95,55,.22);
  box-shadow: none;
}

/* ===== 地图外框：留出四边呼吸位，四个角不再贴着画布 ===== */
.war-map-wrap {
  padding: 8px;
  background: linear-gradient(180deg, rgba(8,20,28,.72), rgba(5,14,21,.86));
  border-radius: 18px;
  border: 1px solid rgba(232,196,106,.28);
  box-shadow: 0 18px 40px -26px rgba(0,0,0,.9), inset 0 0 0 1px rgba(255,255,255,.03);
}
.war-map-wrap::before, .war-map-wrap::after { display: none; }
#warMapCanvas { border-radius: 11px; }
.war-map-hint { left: 14px; top: 13px; }
.war-map-card { left: 14px; right: 14px; bottom: 14px; }

/* 领地列表 */
.war-claim-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px dashed rgba(140,110,70,.18);
}
.war-claim-row:last-child { border-bottom: 0; }
.wc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wc-info b { font-size: 13px; color: #3b2f1e; }
.wc-info span { font-size: 11px; color: #8a7a62; }
.war-claim-row .war-btn { padding: 5px 12px; font-size: 12px; }

/* ===== 地图放大：画布直接铺满卡片内侧，四边贴合 ===== */
.war-map-wrap {
  padding: 0;
  background: #0a1720;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(232,196,106,.3);
  box-shadow: 0 20px 44px -26px rgba(0,0,0,.95), inset 0 0 0 1px rgba(255,255,255,.03);
}
#warMapCanvas {
  width: 100%;
  height: calc(100dvh - 300px);
  min-height: 340px;
  max-height: 620px;
  border-radius: 0;
  display: block;
}
.war-map-hint { left: 12px; top: 12px; }
.war-map-card { left: 12px; right: 12px; bottom: 12px; }
@media (max-height: 700px) {
  #warMapCanvas { height: calc(100dvh - 262px); min-height: 300px; }
}
.war-map-home {
  position: absolute; right: 12px; top: 12px; z-index: 3;
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: rgba(8,20,28,.62); color: #f0d79b;
  border: 1px solid rgba(232,196,106,.35);
  backdrop-filter: blur(4px);
}
.war-map-home:active { transform: scale(.94); }

/* 小屏适配：兵种卡别挤成两行 */
@media (max-width: 380px) {
  .war-troop { padding: 7px 4px; }
  .war-troop b { font-size: 11.5px; }
  .war-troop em { font-size: 9px; }
  .war-troop span { display: none; }
  .war-top { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .war-title b { font-size: 14.5px; }
  .war-money { padding: 5px 9px; font-size: 11px; }
  .war-res { gap: 6px; padding: 0 8px; }
  .war-march { margin-left: 8px; margin-right: 8px; padding: 7px 10px; font-size: 11px; }
}
.war-march { cursor: pointer; }
