/* ============================================================
   淮海战役 1948 · 战役沙盘
   写实军事指挥终端风格
   ============================================================ */
:root {
  --bg: #0a0c0a;
  --bg-2: #0e110d;
  --panel: #121510;
  --panel-2: #171b14;
  --panel-3: #1d2119;
  --line: #34382c;
  --line-soft: #262a20;
  --line-bright: #575a41;
  --ink: #d9d2bd;
  --ink-2: #b3ab92;
  --ink-dim: #8b8570;
  --ink-faint: #625e4e;
  --brass: #c0a26a;
  --brass-dim: #8a7346;
  --pla: #b8392e;
  --pla-2: #e0574a;
  --pla-dark: #5f1c16;
  --kmt: #477ba8;
  --kmt-2: #7dabcf;
  --kmt-dark: #1c3852;
  --ok: #7fa06a;
  --warn: #c9a04c;
  --danger: #c4553f;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 胶片颗粒 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

::selection { background: rgba(184, 57, 46, .45); color: #fff; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, .25); }
::-webkit-scrollbar-thumb { background: #3a3d30; border: 2px solid transparent; background-clip: padding-box; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #55573f; background-clip: padding-box; }

button { font-family: inherit; }

/* ============================================================
   总体网格
   ============================================================ */
#app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr) 348px;
  grid-template-rows: 70px minmax(0, 1fr) 142px;
  grid-template-areas:
    "top top top"
    "left stage right"
    "log log log";
  gap: 1px;
  background: #050705;
}

/* ============================================================
   顶栏
   ============================================================ */
#topbar {
  grid-area: top;
  display: flex;
  align-items: stretch;
  gap: 0;
  background:
    linear-gradient(180deg, #1a1e16 0%, #121510 55%, #0e110d 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(210, 190, 140, .06) inset, 0 10px 30px rgba(0, 0, 0, .4);
  position: relative;
  z-index: 20;
}
#topbar::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(192, 162, 106, .55) 20%, rgba(192, 162, 106, .18) 60%, transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 0 22px;
  border-right: 1px solid var(--line-soft);
  min-width: 268px;
}
.emblem {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid rgba(192, 162, 106, .45);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(184, 57, 46, .35), rgba(20, 22, 16, .6) 70%);
  box-shadow: 0 0 14px rgba(184, 57, 46, .22), inset 0 0 8px rgba(0, 0, 0, .6);
}
.emblem svg { width: 22px; height: 22px; fill: #d8b978; filter: drop-shadow(0 0 3px rgba(216, 185, 120, .45)); }
.brand h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: .16em;
  color: #e6dcc0;
  text-shadow: 0 1px 0 #000, 0 0 18px rgba(192, 162, 106, .18);
  line-height: 1.1;
}
.brand p {
  margin: 2px 0 0;
  font-size: 10px;
  letter-spacing: .24em;
  color: var(--ink-dim);
  font-family: var(--mono);
}

.clock-block {
  padding: 12px 20px;
  border-right: 1px solid var(--line-soft);
  min-width: 196px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.clock-block .date {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: .06em;
  color: #ded4b8;
  white-space: nowrap;
}
.clock-block .sub {
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: .08em;
  white-space: nowrap;
}
.clock-block .sub .dot { margin: 0 6px; color: var(--ink-faint); }

.phase-block {
  flex: 1;
  min-width: 260px;
  padding: 11px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}
.phase-top { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.phase-tag {
  font-family: var(--serif);
  font-size: 12px;
  color: #d9c08a;
  border: 1px solid rgba(192, 162, 106, .4);
  padding: 1px 7px;
  letter-spacing: .12em;
  white-space: nowrap;
  background: rgba(192, 162, 106, .06);
}
.phase-name {
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: .05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phase-track {
  position: relative;
  height: 4px;
  background: #24271f;
  border: 1px solid #2f3328;
  border-radius: 1px;
}
.phase-track i {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2%;
  background: linear-gradient(90deg, var(--pla-dark), var(--pla));
  box-shadow: 0 0 8px rgba(184, 57, 46, .5);
  transition: width .4s ease;
}
.phase-day {
  position: absolute;
  right: 0;
  top: 7px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: .06em;
  white-space: nowrap;
}

.odds-block {
  width: 236px;
  padding: 11px 18px;
  border-left: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.odds-head { display: flex; align-items: baseline; justify-content: space-between; }
.odds-head .label { font-size: 10px; letter-spacing: .18em; color: var(--ink-faint); }
.odds-text { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
.odds-text b { font-weight: 500; }
.odds-text b.pla { color: var(--pla-2); }
.odds-text b.kmt { color: var(--kmt-2); }
.odds-text em { font-style: normal; color: var(--ink-faint); margin: 0 5px; }
.odds-bar { display: flex; height: 5px; gap: 2px; background: #23261e; border: 1px solid #2f3328; }
.odds-bar i { display: block; height: 100%; transition: width .5s ease; }
.odds-bar i.pla { background: linear-gradient(180deg, #d0564a, #8d2a21); }
.odds-bar i.kmt { background: linear-gradient(180deg, #6d9cc4, #2c5477); }
.cp-line { display: flex; align-items: center; justify-content: space-between; }
.cp-line .label { font-size: 10px; letter-spacing: .18em; color: var(--ink-faint); }
.cp-pips { display: flex; gap: 4px; }
.cp-pips i {
  width: 13px; height: 5px;
  background: #2b2e24;
  border: 1px solid #3b3e30;
  transform: skewX(-24deg);
}
.cp-pips i.on { background: linear-gradient(180deg, #e2c07c, #a98546); border-color: #c0a26a; box-shadow: 0 0 6px rgba(192, 162, 106, .5); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  margin-left: auto;
}

/* ============================================================
   按钮
   ============================================================ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid #41442f;
  background: linear-gradient(180deg, #24281f, #171a14);
  color: var(--ink-2);
  font-size: 12px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: border-color .15s, color .15s, box-shadow .15s, transform .05s;
  user-select: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brass-dim); color: #efe5c8; box-shadow: 0 0 0 1px rgba(192, 162, 106, .12), 0 0 16px rgba(192, 162, 106, .1) inset; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary {
  border-color: #7c3a30;
  background: linear-gradient(180deg, #8f2f26, #5d1d17);
  color: #f4e3c2;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .4) inset, 0 0 18px rgba(184, 57, 46, .25);
  font-weight: 600;
}
.btn.primary:hover { border-color: #c4574a; background: linear-gradient(180deg, #a63a2f, #6b2119); }
.btn.primary kbd {
  font-family: var(--mono);
  font-size: 9px;
  padding: 1px 4px;
  border: 1px solid rgba(244, 227, 194, .3);
  color: rgba(244, 227, 194, .7);
  background: rgba(0, 0, 0, .2);
}
.btn.ghost { background: transparent; border-color: #33362a; }
.btn.ghost:hover { background: rgba(192, 162, 106, .06); }
.btn.icon { width: 32px; padding: 0; font-family: var(--serif); font-size: 15px; }
.btn.big { height: 44px; padding: 0 26px; font-size: 14px; letter-spacing: .14em; }
.btn.wide { width: 100%; }
.btn.small { height: 26px; padding: 0 9px; font-size: 11px; }

.mini {
  height: 22px;
  min-width: 22px;
  padding: 0 6px;
  border: 1px solid #3a3d2f;
  background: rgba(18, 21, 16, .85);
  color: var(--ink-dim);
  font-size: 10px;
  cursor: pointer;
  letter-spacing: .06em;
}
.mini:hover { color: #e8dcbd; border-color: var(--brass-dim); }
.mini.active { color: #f0e2c0; border-color: var(--brass); background: rgba(192, 162, 106, .12); }

/* ============================================================
   面板
   ============================================================ */
.panel {
  background:
    linear-gradient(180deg, rgba(30, 34, 25, .55), rgba(13, 16, 12, .85) 55%),
    var(--panel);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line-soft);
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(220, 205, 160, .05), inset 0 0 60px rgba(0, 0, 0, .45);
}
#left { grid-area: left; border-left: none; border-top: none; border-bottom: none; }
#right { grid-area: right; border-right: none; border-top: none; border-bottom: none; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(38, 42, 31, .5), transparent);
}
.panel-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .24em;
  color: #d6c59c;
}
.tabs { display: flex; gap: 2px; }
.tabs button {
  height: 24px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: .1em;
  cursor: pointer;
}
.tabs button.active { color: #efdfb8; border-color: #4a4c37; background: rgba(192, 162, 106, .07); }
.tabs button:hover { color: var(--ink); }

.panel-body { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; padding: 6px 0 10px; }
.panel-foot {
  padding: 9px 14px 11px;
  border-top: 1px solid var(--line-soft);
  font-size: 10px;
  color: var(--ink-faint);
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(0, 0, 0, .18);
}
.legend-row { display: flex; align-items: center; gap: 6px; }
.legend-row .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-left: 4px; }
.legend-row .dot.warn { background: var(--danger); }
.legend-row .bar { width: 12px; height: 4px; margin-left: 4px; }
.legend-row .bar.pla { background: var(--pla); }
.legend-row .bar.kmt { background: var(--kmt); }

.oob-summary {
  padding: 9px 16px 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .05em;
  color: var(--ink-dim);
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* 作战序列 */
.oob-group { margin-bottom: 2px; }
.oob-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 5px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--ink-dim);
}
.oob-group-head .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.oob-group-head .cnt { font-family: var(--mono); font-size: 9px; letter-spacing: 0; color: var(--ink-faint); }

.oob-row {
  display: grid;
  grid-template-columns: 3px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 6px 14px 6px 12px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background .12s;
}
.oob-row:hover { background: rgba(192, 162, 106, .05); }
.oob-row.selected { background: rgba(184, 57, 46, .1); border-left-color: var(--pla-2); }
.oob-row.dead { opacity: .32; filter: grayscale(1); cursor: default; }
.oob-row .stripe { width: 3px; height: 26px; background: var(--pla); }
.oob-row.kmt .stripe { background: var(--kmt); }
.oob-row .info { min-width: 0; }
.oob-row .nm {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.oob-row .nm b { font-weight: 600; letter-spacing: .03em; }
.oob-row .nm span { font-family: var(--mono); font-size: 9px; color: var(--ink-faint); }
.oob-row .meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-faint);
}
.oob-row .meta .troops { color: var(--ink-dim); }
.oob-row .bar { width: 62px; height: 3px; background: #262a21; position: relative; overflow: hidden; }
.oob-row .bar i { position: absolute; inset: 0 auto 0 0; background: var(--ok); transition: width .3s; }
.oob-row .bar i.low { background: var(--danger); }
.oob-row .bar i.mid { background: var(--warn); }
.oob-row .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 5px rgba(127, 160, 106, .6);
  flex: none;
}
.oob-row .dot.warn { background: var(--danger); box-shadow: 0 0 6px rgba(196, 85, 63, .7); }
.oob-row .dot.idle { background: #5a5c4a; box-shadow: none; }
.oob-row .badge {
  font-family: var(--sans);
  font-size: 9px;
  padding: 0 4px;
  border: 1px solid rgba(196, 85, 63, .5);
  color: #e6937f;
  letter-spacing: .08em;
  line-height: 14px;
}

/* ============================================================
   地图舞台
   ============================================================ */
#stage {
  grid-area: stage;
  position: relative;
  overflow: hidden;
  background: #0a0c09;
  min-width: 0;
  min-height: 0;
}
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
#map.dragging { cursor: grabbing; }
#map.targeting { cursor: crosshair; }

#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 242, 205, .05), transparent 38%),
    radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(5, 7, 4, .3) 78%, rgba(4, 6, 3, .62) 100%);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, .55);
  z-index: 3;
}
#weather-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  transition: background 1.5s;
}
#weather-layer.rain { background: linear-gradient(180deg, rgba(35, 50, 54, .18), rgba(15, 22, 22, .1)); }
#weather-layer.snow { background: linear-gradient(180deg, rgba(190, 200, 205, .1), rgba(80, 95, 105, .08)); }
#weather-layer.clear { background: radial-gradient(ellipse at 70% 15%, rgba(255, 240, 200, .06), transparent 60%); }
#weather-layer.cloudy { background: rgba(20, 26, 22, .1); }

#map-hud { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
#compass {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 74px;
  height: 74px;
  opacity: .8;
}
.compass-n { font-family: var(--serif); font-size: 9px; fill: rgba(216, 199, 158, .8); letter-spacing: .1em; }
#scalebar {
  position: absolute;
  left: 20px;
  bottom: 18px;
  display: flex;
  align-items: flex-end;
  gap: 0;
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(220, 208, 175, .75);
  letter-spacing: .04em;
  text-shadow: 0 1px 3px #000;
}
#scalebar i {
  display: block;
  width: 110px;
  height: 5px;
  border: 1px solid rgba(220, 208, 175, .6);
  border-top: none;
  margin-right: 8px;
}
#scalebar span { margin-right: 10px; }
#coord-readout {
  position: absolute;
  left: 20px;
  top: 18px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: rgba(214, 201, 166, .55);
  text-shadow: 0 1px 3px #000;
}
#map-legend {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 6px;
  z-index: 5;
}
#map-legend .mini { width: 28px; height: 26px; font-family: var(--serif); font-size: 12px; background: rgba(12, 15, 11, .8); }

#hint-banner {
  position: absolute;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  z-index: 6;
  padding: 6px 16px;
  background: rgba(12, 15, 11, .78);
  border: 1px solid rgba(192, 162, 106, .28);
  color: #d9c89f;
  font-size: 11px;
  letter-spacing: .08em;
  box-shadow: var(--shadow);
  white-space: nowrap;
  pointer-events: none;
}
#target-banner {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 6;
  padding: 6px 16px;
  background: rgba(70, 22, 16, .88);
  border: 1px solid rgba(228, 110, 88, .55);
  color: #f3cdbb;
  font-size: 12px;
  letter-spacing: .06em;
  pointer-events: none;
}

#combat-ticker {
  position: absolute;
  left: 50%;
  top: 92px;
  transform: translateX(-50%);
  z-index: 7;
  max-width: 72%;
  padding: 7px 18px;
  background: rgba(36, 14, 10, .9);
  border: 1px solid rgba(224, 101, 77, .55);
  color: #f2cdb8;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow);
  pointer-events: none;
}

#busy-indicator {
  position: absolute;
  left: 50%;
  top: 56px;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 18px;
  background: rgba(12, 15, 10, .9);
  border: 1px solid rgba(192, 162, 106, .45);
  color: #e6d3a8;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .18em;
  box-shadow: var(--shadow);
}
#busy-indicator span {
  width: 10px; height: 10px;
  border: 1px solid rgba(192, 162, 106, .3);
  border-top-color: var(--brass);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

#map-tooltip {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  min-width: 150px;
  background: rgba(10, 13, 9, .94);
  border: 1px solid #4a4c37;
  padding: 8px 10px;
  box-shadow: var(--shadow);
  font-size: 11px;
  color: var(--ink-2);
}
#map-tooltip .tt-title { font-family: var(--serif); font-size: 13px; color: #e8dcbc; letter-spacing: .05em; margin-bottom: 3px; }
#map-tooltip .tt-sub { font-family: var(--mono); font-size: 9px; color: var(--ink-faint); margin-bottom: 5px; }
#map-tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; font-family: var(--mono); font-size: 10px; }
#map-tooltip .tt-row span:last-child { color: #d8cba7; }

/* ============================================================
   右栏
   ============================================================ */
#right-content { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; }

.rc-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(40, 43, 31, .45), transparent);
}
.rc-head .kicker {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .22em;
  color: var(--ink-faint);
  margin-bottom: 5px;
}
.rc-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .06em;
  color: #e9ddbd;
}
.rc-head .sub { margin-top: 3px; font-size: 11px; color: var(--ink-dim); }
.rc-head .faction-stripe { height: 2px; margin-top: 10px; background: var(--pla); box-shadow: 0 0 8px rgba(184, 57, 46, .5); }
.rc-head.kmt .faction-stripe { background: var(--kmt); box-shadow: 0 0 8px rgba(71, 123, 168, .5); }

.rc-section { padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.rc-section h4 {
  margin: 0 0 9px;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--brass-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}
.rc-section h4::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(192, 162, 106, .25), transparent); }

.stat-grid { display: grid; grid-template-columns: 1fr; gap: 7px; }
.stat { display: grid; grid-template-columns: 44px 1fr 46px; align-items: center; gap: 8px; font-size: 10px; color: var(--ink-faint); }
.stat .lbl { letter-spacing: .1em; }
.stat .track { height: 4px; background: #262a21; position: relative; overflow: hidden; }
.stat .track i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #6f8459, #9db47f); transition: width .35s; }
.stat .track i.mid { background: linear-gradient(90deg, #8d7434, #c9a04c); }
.stat .track i.low { background: linear-gradient(90deg, #7d2e22, #c4553f); }
.stat .track i.blue { background: linear-gradient(90deg, #2c5477, #6d9cc4); }
.stat .val { font-family: var(--mono); font-size: 10px; color: var(--ink-2); text-align: right; }

.unit-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 10px; }
.unit-facts div { font-size: 10px; color: var(--ink-faint); display: flex; justify-content: space-between; gap: 6px; border-bottom: 1px dashed rgba(255, 255, 255, .05); padding-bottom: 3px; }
.unit-facts b { font-weight: 500; color: var(--ink-2); font-family: var(--mono); font-size: 10px; }

.order-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.order-btn {
  height: 36px;
  border: 1px solid #3b3e2f;
  background: linear-gradient(180deg, #21251c, #14170f);
  color: var(--ink-2);
  font-size: 11px;
  letter-spacing: .08em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .12s;
}
.order-btn:hover { border-color: var(--brass-dim); color: #f0e3c2; background: linear-gradient(180deg, #2a2f23, #191d13); }
.order-btn.active { border-color: var(--pla); color: #f2cdc0; background: rgba(184, 57, 46, .15); }
.order-btn.attack { border-color: #633a30; }
.order-btn.attack:hover { border-color: var(--danger); color: #f5cabb; }
.order-btn .ico { font-size: 13px; opacity: .8; }

.ability-list { display: flex; flex-direction: column; gap: 6px; }
.ability {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 8px 10px;
  border: 1px solid #34372a;
  background: rgba(20, 23, 17, .6);
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.ability:hover { border-color: var(--brass-dim); background: rgba(192, 162, 106, .05); }
.ability.disabled { opacity: .42; cursor: not-allowed; }
.ability .an { font-size: 11px; color: var(--ink); letter-spacing: .06em; }
.ability .ac { font-family: var(--mono); font-size: 10px; color: var(--brass); }
.ability .ad { grid-column: 1 / -1; font-size: 10px; color: var(--ink-faint); line-height: 1.45; }

.objective { display: flex; gap: 8px; padding: 5px 0; font-size: 11px; color: var(--ink-dim); border-bottom: 1px dashed rgba(255, 255, 255, .04); }
.objective .mk { width: 13px; height: 13px; border: 1px solid #4a4c37; flex: none; margin-top: 1px; display: grid; place-items: center; font-size: 9px; color: #9fba82; }
.objective.done { color: var(--ink-faint); }
.objective.done .mk { border-color: #567042; background: rgba(127, 160, 106, .15); }
.objective.done .txt { text-decoration: line-through; text-decoration-color: rgba(127, 160, 106, .5); }

.phase-card {
  padding: 12px 14px;
  border: 1px solid #3b3d2d;
  background: linear-gradient(135deg, rgba(192, 162, 106, .06), transparent 60%), rgba(15, 18, 13, .6);
  margin: 12px 16px;
}
.phase-card .pc-tag { font-family: var(--mono); font-size: 9px; letter-spacing: .18em; color: var(--brass); }
.phase-card .pc-name { font-family: var(--serif); font-size: 15px; color: #e6d9b8; margin: 3px 0 6px; letter-spacing: .06em; }
.phase-card .pc-brief { font-size: 11px; color: var(--ink-dim); line-height: 1.6; }

.empty-state { padding: 30px 22px; text-align: center; color: var(--ink-faint); font-size: 12px; line-height: 1.8; }
.empty-state .big { font-family: var(--serif); font-size: 34px; color: #33372a; display: block; margin-bottom: 8px; }

.tip {
  margin: 12px 16px;
  padding: 10px 12px;
  border-left: 2px solid var(--brass-dim);
  background: rgba(192, 162, 106, .04);
  font-size: 11px;
  color: var(--ink-dim);
  line-height: 1.65;
}
.tip b { color: var(--brass); font-weight: 500; }

/* ============================================================
   底栏战报
   ============================================================ */
#logbar {
  grid-area: log;
  background: linear-gradient(180deg, #10130e, #0b0e0a);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}
#logbar::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(192, 162, 106, .25), transparent);
}
.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px 5px;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: .24em;
  color: var(--ink-faint);
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}
#log-feed {
  flex: 1;
  overflow-y: auto;
  padding: 6px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  min-height: 0;
}
.log-line {
  display: grid;
  grid-template-columns: 76px 10px 1fr;
  gap: 8px;
  align-items: baseline;
  color: var(--ink-2);
  padding: 1px 0;
  animation: logIn .3s ease;
}
@keyframes logIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.log-line .ld { font-family: var(--mono); font-size: 9px; color: var(--ink-faint); letter-spacing: 0; }
.log-line .lm { width: 6px; height: 6px; border-radius: 50%; background: #5a5c4a; align-self: center; }
.log-line.combat .lm { background: #c4553f; }
.log-line.victory .lm { background: #c8a45e; box-shadow: 0 0 6px rgba(200, 164, 94, .6); }
.log-line.history .lm { background: #8ba3c0; }
.log-line.enemy .lm { background: #4a7ba8; }
.log-line.loss .lm { background: #8a4b3f; }
.log-line.order .lm { background: #9db47f; }
.log-line .lt { color: var(--ink-2); }
.log-line.victory .lt { color: #e2c78e; }
.log-line.history .lt { color: #c2d2e4; }
.log-line.loss .lt { color: #d99a86; }
.log-line.enemy .lt { color: #9fc0dc; }
.log-line.combat .lt { color: #cfc6ac; }

/* ============================================================
   提示 / 弹窗
   ============================================================ */
#toast {
  position: fixed;
  left: 50%;
  bottom: 168px;
  transform: translateX(-50%);
  z-index: 500;
  padding: 9px 20px;
  background: rgba(12, 15, 10, .95);
  border: 1px solid rgba(192, 162, 106, .45);
  color: #e9dbb8;
  font-size: 12px;
  letter-spacing: .06em;
  box-shadow: var(--shadow);
  pointer-events: none;
}
#toast.warn { border-color: rgba(196, 85, 63, .6); color: #f0b9a7; }
#toast.hidden { display: none; }

#modal-root { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
#modal-root.active { pointer-events: auto; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 3, .78);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative;
  width: min(960px, 100%);
  max-height: 88vh;
  background:
    linear-gradient(180deg, rgba(36, 40, 30, .35), transparent 18%),
    #10130e;
  border: 1px solid #4b4c38;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .7), inset 0 0 80px rgba(0, 0, 0, .4);
  display: flex;
  flex-direction: column;
  animation: modalIn .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.modal::before, .modal::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid var(--brass-dim);
  pointer-events: none;
}
.modal::before { left: 6px; top: 6px; border-right: none; border-bottom: none; }
.modal::after { right: 6px; bottom: 6px; border-left: none; border-top: none; }
.modal.narrow { width: min(560px, 100%); }
.modal.wide { width: min(1180px, 100%); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 26px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head .kicker { font-family: var(--mono); font-size: 9px; letter-spacing: .24em; color: var(--ink-faint); }
.modal-head h2 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .08em;
  color: #eee0bd;
}
.modal-head .sub { margin-top: 4px; font-size: 11px; color: var(--ink-dim); }
.modal-close {
  width: 30px; height: 30px;
  border: 1px solid #464835;
  background: transparent;
  color: var(--ink-dim);
  font-size: 17px;
  cursor: pointer;
  flex: none;
  line-height: 1;
}
.modal-close:hover { color: #f0e0bc; border-color: var(--brass); }
.modal-body { padding: 20px 26px 26px; overflow-y: auto; min-height: 0; }
.modal-body h3 {
  font-family: var(--serif);
  font-size: 14px;
  color: #d9c79c;
  letter-spacing: .12em;
  margin: 18px 0 8px;
  font-weight: 500;
}
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { margin: 0 0 10px; color: var(--ink-2); line-height: 1.85; font-size: 12.5px; }
.modal-body p.lead { font-size: 13.5px; color: var(--ink); }
.modal-body .muted { color: var(--ink-faint); font-size: 11px; }
.modal-body ul { margin: 0 0 12px; padding-left: 18px; color: var(--ink-2); font-size: 12px; line-height: 1.8; }
.modal-body li::marker { color: var(--brass-dim); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 26px 20px; border-top: 1px solid var(--line-soft); }
.modal-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 800px) { .modal-cols { grid-template-columns: 1fr; } }

/* 命令原文 */
.doc-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 900px) { .doc-grid { grid-template-columns: 1fr; } }
.doc-scan {
  border: 1px solid #4a4a38;
  background: #0a0b08;
  padding: 8px;
  position: sticky;
  top: 0;
  max-height: 72vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.doc-scan img { display: block; width: 100%; height: auto; filter: sepia(.12) contrast(1.02); }
.doc-scan .cap {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 7px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-faint);
  letter-spacing: .06em;
}
.doc-text { font-family: var(--serif); }
.doc-text .doc-h { text-align: center; font-size: 18px; letter-spacing: .12em; color: #e5d7b4; margin-bottom: 2px; }
.doc-text .doc-d { text-align: center; font-family: var(--mono); font-size: 10px; color: var(--ink-faint); letter-spacing: .12em; margin-bottom: 18px; }
.doc-text p { font-size: 12.5px; line-height: 2; color: #c8c0a8; text-indent: 2em; margin-bottom: 8px; }
.doc-text p .key { color: var(--brass); font-weight: 600; font-style: normal; }
.doc-text .sig { margin-top: 20px; text-align: right; font-family: var(--serif); color: #cbbc98; line-height: 1.9; font-size: 12.5px; }
.doc-text .note { margin-top: 16px; padding-top: 10px; border-top: 1px dashed #3a3c2c; font-size: 10.5px; color: var(--ink-faint); text-indent: 0; }

/* 战报 */
.battlelog { display: flex; flex-direction: column; gap: 3px; }
.battlelog .day-sep {
  position: sticky;
  top: 0;
  background: #10130e;
  padding: 6px 0 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .18em;
  color: var(--brass-dim);
  border-bottom: 1px solid rgba(192, 162, 106, .15);
  margin-top: 8px;
  z-index: 2;
}
.battlelog .bl {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  font-size: 12px;
  padding: 3px 0;
  color: var(--ink-2);
  line-height: 1.65;
}
.battlelog .bl .ic { color: var(--ink-faint); text-align: center; }
.battlelog .bl.victory .ic { color: #d9b877; }
.battlelog .bl.loss .ic { color: #cf7e68; }
.battlelog .bl.history .ic { color: #8ba3c0; }
.battlelog .bl.combat .ic { color: #c4553f; }
.battlelog .bl.enemy .ic { color: #4a7ba8; }
.battlelog .bl.objective .ic { color: #9db47f; }

/* 抉择 */
.choice-text { font-size: 13px; line-height: 1.9; color: #d5cbb2; margin-bottom: 18px; }
.choice-opts { display: flex; flex-direction: column; gap: 10px; }
.choice-opt {
  text-align: left;
  padding: 14px 16px;
  border: 1px solid #454733;
  background: rgba(22, 26, 18, .7);
  cursor: pointer;
  transition: all .15s;
}
.choice-opt:hover { border-color: var(--brass); background: rgba(192, 162, 106, .06); }
.choice-opt .co-t { font-family: var(--serif); font-size: 14px; color: #ebe0c3; letter-spacing: .05em; }
.choice-opt .co-d { font-size: 11px; color: var(--ink-dim); margin-top: 4px; line-height: 1.6; }

/* 战果 */
.result-grade {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 6px 0 20px;
}
.result-grade .grade {
  font-family: var(--serif);
  font-size: 68px;
  line-height: 1;
  color: #d9b877;
  text-shadow: 0 0 30px rgba(217, 184, 119, .25);
}
.result-grade .rt { font-family: var(--serif); font-size: 22px; color: #e9dcc0; letter-spacing: .1em; }
.result-grade .rs { font-size: 11px; color: var(--ink-dim); margin-top: 4px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); margin-bottom: 18px; }
.result-grid div { background: #121510; padding: 12px 14px; }
.result-grid .k { font-size: 10px; letter-spacing: .14em; color: var(--ink-faint); }
.result-grid .v { font-family: var(--mono); font-size: 19px; color: #ded0ab; margin-top: 3px; }
.result-grid .v small { font-size: 10px; color: var(--ink-faint); }
.hist-compare { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.hc-row { display: grid; grid-template-columns: 70px 1fr 90px; gap: 10px; align-items: center; font-size: 11px; color: var(--ink-dim); }
.hc-row .bar { height: 8px; background: #23261e; position: relative; }
.hc-row .bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #7d2e22, #c4553f); }
.hc-row .bar i.brass { background: linear-gradient(90deg, #6b5a33, #c0a26a); }
.hc-row .num { font-family: var(--mono); text-align: right; color: var(--ink-2); }

/* ============================================================
   开场
   ============================================================ */
#boot {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 45%, rgba(8, 10, 7, .55), rgba(4, 6, 4, .92) 80%);
  overflow: hidden;
  transition: opacity .55s ease, visibility .55s;
}
#boot.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-bg {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(120, 92, 48, .18), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(90, 28, 22, .25), transparent 60%),
    repeating-radial-gradient(circle at 46% 40%, transparent 0 46px, rgba(160, 140, 95, .045) 47px 48px),
    repeating-radial-gradient(circle at 70% 65%, transparent 0 72px, rgba(160, 140, 95, .03) 73px 74px),
    rgba(10, 12, 9, .88);
  transform: scale(1.02);
}
.boot-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 25%, rgba(3, 5, 3, .8) 78%);
}
.boot-inner { position: relative; text-align: center; padding: 30px; max-width: 760px; }
.boot-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .38em;
  color: var(--brass-dim);
  text-transform: uppercase;
  margin-bottom: 22px;
}
.boot-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 700;
  letter-spacing: .18em;
  color: #ecdfbc;
  text-shadow: 0 2px 0 #000, 0 0 60px rgba(192, 162, 106, .22), 0 0 140px rgba(184, 57, 46, .16);
  line-height: 1.05;
  padding-left: .18em;
}
.boot-sub {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--ink-dim);
}
.boot-sub span { color: var(--brass-dim); margin: 0 8px; }
.boot-quote {
  margin: 30px auto 0;
  max-width: 560px;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-dim);
  border-top: 1px solid rgba(192, 162, 106, .18);
  border-bottom: 1px solid rgba(192, 162, 106, .18);
  padding: 16px 0;
  min-height: 66px;
}
.boot-quote em { display: block; margin-top: 6px; font-style: normal; color: var(--brass-dim); font-size: 11px; letter-spacing: .16em; }
.boot-actions { display: flex; gap: 12px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.boot-foot {
  margin-top: 44px;
  display: flex;
  justify-content: center;
  gap: 18px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--ink-faint);
}
.boot-foot span:nth-child(2) { color: var(--brass-dim); }

/* 载入 */
#loading {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(6, 8, 5, .94);
  display: grid;
  place-items: center;
  gap: 16px;
  color: var(--ink-dim);
  font-family: var(--serif);
  letter-spacing: .2em;
  font-size: 13px;
}
#loading.hidden { display: none; }
.spinner {
  width: 34px; height: 34px;
  border: 1px solid rgba(192, 162, 106, .2);
  border-top-color: var(--brass);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

#app.map-full { grid-template-columns: 0 minmax(0, 1fr) 0; }
#app.map-full #left, #app.map-full #right { display: none; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1500px) {
  #app { grid-template-columns: 246px minmax(0, 1fr) 320px; }
  .odds-block { width: 210px; }
  .brand { min-width: 236px; padding-left: 16px; }
  .brand h1 { font-size: 20px; }
}
@media (max-width: 1250px) {
  #app { grid-template-columns: 220px minmax(0, 1fr) 292px; grid-template-rows: 70px minmax(0, 1fr) 120px; }
  .top-actions .btn.ghost { display: none; }
  .odds-block { display: none; }
  .phase-block { min-width: 180px; }
  .brand p { display: none; }
}
@media (max-width: 980px) {
  #app { grid-template-columns: 0 minmax(0, 1fr) 0; }
  #left, #right { display: none; }
  .clock-block { min-width: 0; padding: 8px 12px; }
  .clock-block .date { font-size: 14px; }
  .top-actions { padding: 0 10px; gap: 5px; }
  .top-actions .btn { padding: 0 9px; font-size: 11px; }
}

/* ============================================================
   存档 / 菜单 / 继续战役
   ============================================================ */
.boot-save {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 620px;
  margin: 22px auto 0;
  padding: 10px;
  border: 1px solid rgba(192, 162, 106, .32);
  background: rgba(12, 15, 10, .72);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.boot-save:hover { border-color: rgba(214, 188, 130, .65); background: rgba(24, 28, 19, .8); }
.boot-save img {
  width: 168px;
  height: 94px;
  object-fit: cover;
  flex: none;
  border: 1px solid #3d3f2e;
  background: #0a0c09;
}
.boot-save-text { min-width: 0; }
.boot-save .bs-kicker {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .2em;
  color: var(--brass-dim);
  margin-bottom: 4px;
}
.boot-save .bs-title {
  font-family: var(--serif);
  font-size: 16px;
  color: #ecdfbd;
  letter-spacing: .05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.boot-save .bs-meta {
  margin-top: 5px;
  font-size: 10px;
  color: var(--ink-faint);
  line-height: 1.6;
}

.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.menu-btn {
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid #3d4030;
  background: linear-gradient(180deg, #20241b, #14170f);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  letter-spacing: .06em;
  font-size: 12px;
  transition: border-color .12s, background .12s;
}
.menu-btn:hover { border-color: var(--brass-dim); background: linear-gradient(180deg, #2a2f23, #191d13); }
.menu-btn .k { font-family: var(--mono); font-size: 9px; color: var(--ink-faint); letter-spacing: 0; }
.menu-btn.primary { border-color: #7c3a30; background: linear-gradient(180deg, #8f2f26, #5d1d17); color: #f4e3c2; }
.menu-btn.danger { border-color: #5a2c24; color: #d99583; }
.menu-btn.wide { grid-column: 1 / -1; }
.pause-meta {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .05);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-faint);
  line-height: 1.8;
  letter-spacing: .04em;
}

.save-note {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-left: 2px solid var(--brass-dim);
  background: rgba(192, 162, 106, .05);
  color: var(--ink-dim);
  font-size: 11px;
  line-height: 1.65;
}

.slot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.slot-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #3a3d2d;
  background: #121510;
  min-width: 0;
}
.slot-card.auto { border-color: rgba(192, 162, 106, .5); }
.slot-card.empty { border-style: dashed; opacity: .82; }
.slot-thumb {
  display: block;
  width: 100%;
  height: 126px;
  object-fit: cover;
  background: #0a0c09;
  border-bottom: 1px solid #2b2e22;
}
.slot-thumb.empty {
  display: grid;
  place-items: center;
  color: #565845;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
}
.slot-body { padding: 10px 12px 5px; flex: 1; min-width: 0; }
.slot-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--serif);
  font-size: 14px;
  color: #e7dab9;
  letter-spacing: .05em;
}
.slot-title .tag {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--brass);
  border: 1px solid rgba(192, 162, 106, .35);
  padding: 0 4px;
  line-height: 15px;
  white-space: nowrap;
}
.slot-meta {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.65;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot-meta b { color: var(--ink-2); font-weight: 500; }
.slot-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 9px 12px 12px;
}
.slot-actions .btn {
  height: 27px;
  padding: 0 9px;
  font-size: 10.5px;
  letter-spacing: .05em;
}
.slot-actions .btn.danger { color: #d99583; border-color: #5a2c24; }
.slot-actions .btn.danger:hover { color: #f3c1b1; border-color: #a55243; }
.slot-actions .btn:disabled { opacity: .35; cursor: not-allowed; }

@media (max-width: 760px) {
  .slot-grid { grid-template-columns: 1fr; }
  .boot-save { flex-direction: column; align-items: stretch; }
  .boot-save img { width: 100%; height: 140px; }
  .menu-grid { grid-template-columns: 1fr; }
}

/* 开场：主操作 / 资料操作 分两行 */
.boot-actions.secondary { margin-top: 10px; }
.boot-actions.secondary .btn {
  height: 38px;
  padding: 0 18px;
  font-size: 12px;
  letter-spacing: .08em;
}
#toast { z-index: 1100; }

/* 存档命名 */
.slot-title { min-width: 0; }
.slot-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.boot-save .bs-kicker {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.name-form { display: flex; flex-direction: column; gap: 8px; }
.name-form label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .16em;
  color: var(--brass-dim);
}
.name-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #4a4d38;
  background: #090b07;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: .04em;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.name-input:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 2px rgba(192, 162, 106, .12);
}
.name-hint { font-size: 9.5px; color: var(--ink-faint); line-height: 1.6; }

/* ============================================================
   攻击预估
   ============================================================ */
.ap-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #3b3e2e;
  background: #0f120c;
}
.ap-army { flex: 1; min-width: 0; }
.ap-side {
  display: inline-block;
  margin-right: 7px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .16em;
  padding: 1px 5px;
  border: 1px solid currentColor;
}
.ap-side.pla { color: var(--pla); }
.ap-side.kmt { color: var(--kmt); }
.ap-army b {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  letter-spacing: .04em;
}
.ap-vs {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .2em;
}
.ap-verdict {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 12px 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-family: var(--serif);
  font-size: 18px;
  color: #e4d6b4;
  letter-spacing: .08em;
}
.ap-verdict span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: .04em;
}
.ap-verdict.good { color: #d7c08a; }
.ap-verdict.bad { color: #df9b87; }
.ap-power { margin: 8px 0 12px; }
.ap-bar {
  display: flex;
  height: 8px;
  background: #191c13;
  border: 1px solid #35382a;
  overflow: hidden;
}
.ap-bar i { display: block; height: 100%; }
.ap-bar i.pla { background: linear-gradient(90deg, #8e2b24, #c44935); }
.ap-bar i.kmt { background: linear-gradient(90deg, #2f4d78, #5c86b9); }
.ap-power-num {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-faint);
}
.ap-loss {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.ap-loss > div {
  padding: 9px 11px;
  border: 1px solid #34372a;
  background: #12150f;
}
.ap-loss span {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-faint);
  letter-spacing: .08em;
}
.ap-loss b {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: #e7d9b7;
}
.ap-stats {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 0;
  border-top: 1px solid rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-faint);
}
.ap-factors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.ap-chip {
  padding: 3px 7px;
  border: 1px solid #3b3e2e;
  background: #14170f;
  color: var(--ink-dim);
  font-size: 10px;
  line-height: 1.5;
}
.ap-chip b { font-weight: 500; color: var(--ink); }
.ap-chip.good { border-color: rgba(139,154,97,.55); color: #c8d3a2; }
.ap-chip.bad { border-color: rgba(173,83,66,.55); color: #e0a08d; }
.ap-warn {
  margin: 10px 0;
  padding: 8px 11px;
  border-left: 2px solid #b5624f;
  background: rgba(181,98,79,.06);
  color: #d9a08f;
  font-size: 10.5px;
  line-height: 1.75;
}
.ap-note {
  margin-top: 10px;
  font-size: 9.5px;
  line-height: 1.65;
  color: var(--ink-faint);
}
@media (max-width: 760px) {
  .ap-loss { grid-template-columns: 1fr; }
}

/* ============================================================
   新手引导
   ============================================================ */
#tutorial {
  position: fixed;
  left: 288px;
  bottom: 150px;
  z-index: 420;
  width: 360px;
  max-width: calc(100vw - 28px);
  padding: 14px 16px 12px;
  border: 1px solid rgba(192, 162, 106, .55);
  background: linear-gradient(180deg, rgba(20, 24, 16, .97), rgba(10, 13, 8, .98));
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255,255,255,.025);
  pointer-events: auto;
}
#tutorial::before {
  content: '';
  position: absolute;
  left: -1px; top: -1px;
  width: 38px; height: 2px;
  background: var(--brass);
}
.tut-kicker {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .18em;
  color: var(--brass-dim);
}
.tut-title {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 17px;
  color: #ecdfbd;
  letter-spacing: .05em;
}
.tut-text {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ink-dim);
}
.tut-hint {
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--ink-faint);
}
.tut-dots { display: flex; gap: 5px; margin-top: 10px; }
.tut-dots i {
  display: block;
  width: 16px;
  height: 2px;
  background: #35382a;
}
.tut-dots i.on { background: var(--brass); }
.tut-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}
#btn-exec.tut-pulse {
  animation: tutPulse 1.4s ease-in-out infinite;
}
@keyframes tutPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(198, 74, 53, .0); }
  45% { box-shadow: 0 0 0 5px rgba(198, 74, 53, .22); }
}
.btn.icon.muted { opacity: .35; }

@media (max-width: 980px) {
  #tutorial { left: 16px; width: 340px; }
}
@media (max-width: 900px) {
  #tutorial { display: none !important; }
}
