/* NPC 总控台样式 —— 浅红主题 */
/* ───── 浅红整体背景 ───── */
body{background:#fbe3e3;}
.bg-fx::before{background:
  radial-gradient(60% 50% at 20% 10%,rgba(192,57,43,.14),transparent 60%),
  radial-gradient(50% 50% at 85% 80%,rgba(224,165,38,.10),transparent 60%);}
.bg-grid{background-image:linear-gradient(rgba(192,57,43,.10) 1px,transparent 1px),linear-gradient(90deg,rgba(192,57,43,.10) 1px,transparent 1px);}

.npc-layout{display:grid;grid-template-columns:1fr 400px;gap:16px;padding:14px 16px 28px;align-items:start;}
@media(max-width:1180px){.npc-layout{grid-template-columns:1fr;}}

/* 顶栏：品牌红，白字 */
.tac-bar{background:linear-gradient(180deg,#d44a3f,#c0392b);border-bottom:1px solid #a52a20;color:#fff;}
.tac-bar .logo{color:#fff;}
.tac-bar .logo small{color:#ffd9d9;}
.tac-bar .stat{color:#ffe3e3;}
.tac-bar .stat b{color:#fff;}
.tac-bar .tag.red{background:rgba(255,255,255,.22);color:#fff;border:1px solid rgba(255,255,255,.45);}
.resbar .res{background:rgba(255,255,255,.22);padding:5px 11px;border-radius:999px;font-size:13px;color:#fff;}
.resbar .res b{color:#fff;}

.pane-head{display:flex;align-items:center;gap:12px;margin-bottom:10px;flex-wrap:wrap;}
.pane-head h2{font-size:18px;font-weight:900;color:#a52a20;}
.legend{display:flex;gap:12px;flex-wrap:wrap;font-size:12px;color:#8a4a44;}
.legend i.lg{display:inline-block;width:12px;height:12px;border-radius:3px;margin-right:3px;vertical-align:-2px;}
.lg.mtn{background:#1a7a52;}.lg.wat{background:#87ceeb;}.lg.rd{background:#cfcfcf;}.lg.plain{background:#b8e68c;}
.lg.enemy{background:#c0392b;}.lg.town{background:#f0d860;}

.btn.ghost.top-exit{margin-left:4px;white-space:nowrap;color:#fff;border-color:#ffd9d9;}

/* 按钮：NPC 控制台内统一红系 */
.btn.blue{background:linear-gradient(180deg,#d9544a,#c0392b);box-shadow:0 4px 0 #8e2a20, var(--shadow);}
.btn.amber{background:linear-gradient(180deg,#e0736a,#c0392b);color:#fff;box-shadow:0 4px 0 #8e2a20, var(--shadow);}

/* 地形盘：严格参照"地图卡完整版"打印道具 PDF —— 颜色+文字一一对应 */
.npc-board{display:grid;grid-template-columns:28px repeat(13,1fr);gap:1px;background:#333;padding:6px;border-radius:6px;
  box-shadow:inset 0 0 0 2px #222, var(--shadow);max-width:1040px;border:2px solid #c0392b;}
@media(max-width:620px){.npc-board{grid-template-columns:22px repeat(13,1fr);gap:1px;padding:3px;}}

.nc{position:relative;aspect-ratio:1/1;font-size:10px;font-weight:700;line-height:1.15;
  display:flex;align-items:center;justify-content:center;cursor:pointer;transition:.12s;overflow:hidden;
  padding:1px;text-align:center;word-break:break-all;}
.nc:hover{transform:scale(1.2);z-index:6;box-shadow:0 0 0 2px #fff,0 0 8px rgba(0,0,0,.5);}

/* ── 地图卡颜色（严格按PDF）── */
.nc.plain{background:#b8e68c;color:#2a4a1a;}           /* 浅绿 = 平原/平 */
.nc.mtn{background:#1a7a52;color:#d0f0d8;}             /* 深绿 = 山 */
.nc.wat{background:#87ceeb;color:#1a4a6a;}              /* 浅蓝 = 河流 */
.nc.rd{background:#cfcfcf;color:#333;}                   /* 灰 = 公路 */
.nc.enemy{background:#c0392b;color:#fff;}                /* 红 = 敌军（白字）*/
.nc.town{background:#f0d860;color:#5a4a1a;}              /* 黄 = 城镇/设施 */

/* 列头 / 行头 / 角（参照大盘面 PDF） */
.nc.hdr-corner{background:none;border:none;}
.nc.hdr-col{background:#fff;color:#333;font-size:11px;font-weight:900;
  border-radius:2px;display:flex;align-items:center;justify-content:center;border-bottom:2px solid #c0392b;}
.nc.hdr-row{background:#fff;color:#333;font-size:10px;font-weight:900;
  border-radius:2px;display:flex;align-items:center;justify-content:center;border-right:2px solid #c0392b;}

/* 坐标小字：每个格子左上角 */
.nc .coord-mini{position:absolute;top:1px;left:2px;font-size:7px;font-weight:900;line-height:1;z-index:3;
  color:rgba(40,30,20,.7);text-shadow:0 0 2px rgba(255,255,255,.6);pointer-events:none;letter-spacing:.02em;}
.nc.enemy .coord-mini,.nc.mtn .coord-mini{color:rgba(255,255,255,.92);text-shadow:0 0 2px rgba(0,0,0,.5);}

/* 地图卡文字标签（主内容） */
.nc .map-label{font-size:10px;font-weight:700;z-index:2;line-height:1.1;
  display:inline-block;text-align:center;word-break:break-word;}
.nc.enemy .map-label{text-shadow:0 1px 2px rgba(0,0,0,.4);}
.nc.mtn .map-label,.nc.wat .map-label{text-shadow:0 0 2px rgba(255,255,255,.3);}
.nc.town .map-label{font-weight:800;}

.nc.sel{box-shadow:0 0 0 3px #ffd700,0 0 12px rgba(255,215,0,.7);transform:scale(1.2);z-index:7;}
.nc .rv{position:absolute;bottom:0;left:0;right:0;height:3px;background:#ffd700;z-index:4;}

.npc-tools{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap;align-items:center;}
.npc-tools .sel,.npc-tools .inp{background:#fff;border:1px solid #e0a0a0;border-radius:8px;padding:7px 10px;font-family:inherit;font-size:13px;color:#5e1c14;}
.npc-tools .inp{width:90px;}

.npc-side{display:flex;flex-direction:column;gap:14px;}
.card.tac{background:linear-gradient(180deg,#ffffff,#fdeaea);color:#5e1c14;border:1px solid #e7b3b3;box-shadow:0 10px 30px rgba(192,57,43,.12);}
.card.tac .mini-h{font-size:13px;font-weight:900;letter-spacing:.05em;color:#c0392b;margin-bottom:10px;text-transform:uppercase;}
.ctrl-row{margin-bottom:10px;}
/* 重置按钮：与常规按钮区分，提示为危险操作 */
#resetBtn{margin-top:2px;color:#c0392b;border-color:#e7a3a3;font-weight:800;letter-spacing:.06em;transition:background .15s,filter .15s;}
#resetBtn:hover{background:#fbe0e0;filter:brightness(1.02);}
#resetBtn:active{transform:translateY(1px);}
.btn.full{width:100%;justify-content:center;}
.btn.sm{padding:.45em .9em;font-size:13px;border-radius:8px;}
.step-nav{display:flex;align-items:center;gap:10px;margin-top:10px;}
.step-now{flex:1;text-align:center;font-size:13px;line-height:1.5;}
.step-now b{color:#c0392b;font-size:15px;display:block;}
.step-now span{color:#a86a64;font-size:11.5px;}
.progress-label{font-size:12px;color:#a86a64;margin-top:6px;text-align:center;}

.grp-list{display:flex;flex-direction:column;gap:7px;max-height:300px;overflow-y:auto;}
.grp-row{display:flex;align-items:center;gap:9px;background:rgba(192,57,43,.06);border-radius:9px;padding:7px 10px;border-left:4px solid var(--c);}
.grp-row .gn{font-weight:900;font-size:13.5px;width:58px;flex-shrink:0;color:#5e1c14;}
.grp-row .gstat{font-size:11.5px;color:#a86a64;flex:1;line-height:1.5;}
.grp-row .gstat b{color:#5e1c14;}
.grp-row .gon{width:8px;height:8px;border-radius:50%;background:#e0a0a0;flex-shrink:0;}
.grp-row .gon.on{background:var(--green-l);box-shadow:0 0 7px var(--green-l);}
.grp-row.off{opacity:.55;}

.pending{display:flex;flex-direction:column;gap:6px;max-height:200px;overflow-y:auto;}
.pitem{background:rgba(192,57,43,.08);border-left:3px solid #c0392b;border-radius:7px;padding:6px 9px;font-size:12px;color:#7a2a22;}
.pitem b{color:#c0392b;}

.log{display:flex;flex-direction:column;gap:4px;max-height:240px;overflow-y:auto;font-size:12px;}
.log .le{color:#a86a64;line-height:1.5;padding-left:10px;position:relative;}
.log .le::before{content:"";position:absolute;left:0;top:7px;width:4px;height:4px;border-radius:50%;background:#c0392b;}
.log .le b{color:#5e1c14;}

.foot{text-align:center;font-size:12.5px;color:#a86a64;padding:10px;letter-spacing:.05em;}
.sound-toggle{position:fixed;right:16px;bottom:16px;z-index:80;width:46px;height:46px;border-radius:50%;
  background:linear-gradient(180deg,#c0392b,#a52a20);color:#fff;font-size:20px;box-shadow:var(--shadow);border:1px solid #e0a0a0;cursor:pointer;}
.sound-toggle.off{opacity:.6;}

.scanline{position:fixed;left:0;right:0;top:0;height:140px;z-index:-1;pointer-events:none;
  background:linear-gradient(180deg,transparent,rgba(192,57,43,.12),transparent);animation:scanMove 7s linear infinite;}
@keyframes scanMove{0%{transform:translateY(-140px)}100%{transform:translateY(100vh)}}

/* ★ 各组标志叠加（NPC 全图可见位置） */
.grp-marker{position:absolute;top:1px;right:1px;z-index:6;min-width:14px;height:14px;padding:0 3px;
  border-radius:999px;background:var(--c,#c0392b);color:#fff;font-size:9px;font-weight:900;line-height:14px;text-align:center;
  box-shadow:0 0 0 1.5px #fff,0 1px 3px rgba(0,0,0,.45);pointer-events:none;}

/* 收获发放面板 */
.harvest-row{display:flex;gap:7px 12px;margin-bottom:10px;flex-wrap:wrap;align-items:flex-end;}
.harvest-row .hf{display:flex;flex-direction:column;gap:3px;}
.harvest-row .hf-lab{font-size:11px;font-weight:800;color:#a8322a;letter-spacing:.04em;white-space:nowrap;}
.harvest-row .sel,.harvest-row .inp{background:#fff;border:1px solid #e0a0a0;border-radius:8px;padding:6px 8px;font-family:inherit;font-size:13px;color:#5e1c14;}
.harvest-row .sel{min-width:120px;}
.harvest-row .inp.xs{width:64px;}

/* 推进前·各组完成度确认弹窗 */
.step-confirm{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;font-family:inherit;}
.step-confirm .sc-mask{position:absolute;inset:0;background:rgba(60,12,8,.55);backdrop-filter:blur(2px);}
.step-confirm .sc-box{position:relative;width:420px;max-width:92vw;background:linear-gradient(180deg,#fff,#fdeaea);border:1px solid #e7b3b3;border-radius:16px;padding:22px 24px 20px;box-shadow:0 24px 70px rgba(120,30,20,.35);color:#5e1c14;animation:scPop .22s ease both;}
@keyframes scPop{from{opacity:0;transform:translateY(10px) scale(.97)}to{opacity:1;transform:none}}
.step-confirm .sc-title{font-size:18px;font-weight:900;color:#c0392b;letter-spacing:.04em;}
.step-confirm .sc-sub{font-size:12.5px;color:#a86a64;margin-top:3px;}
.step-confirm .sc-stat{font-size:15px;font-weight:800;margin:14px 0 10px;padding:8px 12px;border-radius:9px;background:rgba(192,57,43,.08);border:1px solid rgba(192,57,43,.18);}
.step-confirm .sc-cols{display:flex;gap:12px;}
.step-confirm .sc-col{flex:1;min-width:0;background:#fff;border:1px solid #efd9d9;border-radius:10px;padding:10px 11px;}
.step-confirm .sc-col-h{font-size:12px;font-weight:800;margin-bottom:6px;}
.step-confirm .sc-col-h.done{color:#2e8b57;}
.step-confirm .sc-col-h.pend{color:#c0392b;}
.step-confirm .sc-names{font-size:13px;line-height:1.85;color:#7a3b32;word-break:break-all;}
.step-confirm .sc-names .none{color:#b8a29c;font-style:italic;}
.step-confirm .sc-warn{margin-top:11px;font-size:12.5px;font-weight:700;color:#c0392b;min-height:16px;}
/* ★ 推进前·各小组回执区 */
.step-confirm .sc-ack{margin-top:12px;padding:10px 12px;border:1px dashed #c9b6ad;border-radius:10px;background:#fbf6f3;}
.step-confirm .sc-ack-h{font-size:13px;font-weight:800;color:#7a3b32;margin-bottom:6px;}
.step-confirm .sc-ack-stat{font-size:12px;color:#8a6f67;margin-bottom:7px;}
.step-confirm .sc-ack-list{display:flex;flex-wrap:wrap;gap:6px;}
.step-confirm .sc-ack-item{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:700;padding:3px 9px;border-radius:20px;background:#efe6e1;color:#7a3b32;border:1px solid #e0d2cb;}
.step-confirm .sc-ack-item i{font-style:normal;font-size:11px;padding:1px 7px;border-radius:12px;font-weight:800;}
.step-confirm .sc-ack-item.ok{background:#e6f6ec;border-color:#bfe6cd;color:#1f6f3a;}
.step-confirm .sc-ack-item.ok i{background:#1f6f3a;color:#fff;}
.step-confirm .sc-ack-item.wait{background:#fdecec;border-color:#f3c4c4;color:#c0392b;}
.step-confirm .sc-ack-item.wait i{background:#c0392b;color:#fff;}
.step-confirm .sc-ack-item.na{opacity:.85;}
.step-confirm .sc-ack-item.na i{background:#b8a29c;color:#fff;}
.step-confirm .sc-actions{display:flex;gap:10px;margin-top:16px;}
.step-confirm .sc-actions .btn{flex:1;}

/* ───── 推演日志 · 步骤回放 + 撤回 ───── */
.rl-hint{font-size:11px;font-weight:600;color:#c0392b;background:rgba(192,57,43,.10);padding:2px 8px;border-radius:10px;margin-left:4px;vertical-align:1px;}
.replay-log{max-height:330px;overflow-y:auto;display:flex;flex-direction:column;gap:9px;padding-right:4px;}
.rl-item{border:1px solid #efd9d9;border-radius:11px;background:#fff;padding:9px 11px;position:relative;}
.rl-item.rl-top{border-color:#c0392b;box-shadow:0 0 0 2px rgba(192,57,43,.14);background:linear-gradient(180deg,#fff,#fff6f5);}
.rl-head{display:flex;align-items:center;gap:8px;margin-bottom:4px;}
.rl-round{font-size:12px;font-weight:800;color:#fff;background:#c0392b;padding:2px 9px;border-radius:10px;}
.rl-step{font-size:14px;font-weight:900;color:#a52a20;}
.rl-time{margin-left:auto;font-size:11px;color:#b09a93;font-variant-numeric:tabular-nums;}
.rl-sum{font-size:12.5px;line-height:1.5;color:#7a3b32;word-break:break-all;padding-right:2px;}
.rl-undo{position:absolute;right:10px;bottom:9px;border:1px solid #d9c4bd;background:#fbf2ef;color:#c0392b;font-weight:800;padding:3px 12px;border-radius:9px;cursor:pointer;transition:.15s;}
.rl-undo:hover:not([disabled]){background:#c0392b;color:#fff;border-color:#c0392b;}
.rl-undo[disabled]{opacity:.42;cursor:not-allowed;}
.rl-empty{font-size:12px;color:#b8a29c;font-style:italic;padding:6px 2px;}

/* ★ 敌机巡逻区叠加（NPC 大盘·红色斜纹） */
.nc.patrol{position:relative;z-index:5;box-shadow:inset 0 0 0 2px rgba(220,38,38,.9);
  background-image:repeating-linear-gradient(45deg,rgba(220,38,38,.32) 0,rgba(220,38,38,.32) 5px,transparent 5px,transparent 10px) !important;
  animation:patrolPulseN 1.4s ease-in-out infinite;}
@keyframes patrolPulseN{0%,100%{box-shadow:inset 0 0 0 2px rgba(220,38,38,.7);}50%{box-shadow:inset 0 0 0 3px rgba(220,38,38,1),0 0 10px rgba(220,38,38,.5);}}

/* ★ 本轮敌机巡逻区面板 */
.patrol-zones{margin:6px 0 4px;}
.pz-main{background:rgba(220,38,38,.12);border:1px dashed #e07a7a;color:#7a1f1f;border-radius:8px;padding:8px 10px;font-size:13px;line-height:1.5;}
.pz-main.stopped{background:rgba(30,158,90,.14);border:1px dashed #2e9e5a;color:#0f6b3a;}
.pz-main b{color:#c0392b;font-size:14px;}
.pz-main.stopped b{color:#1e9e5a;}
.patrol-note{font-size:11.5px;color:#8a7a76;line-height:1.45;margin-top:6px;}
