/* ============================================================
 * 寰宇争霸 —— 明亮卡通风格样式
 * ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: #aee3f5;
  user-select: none;
}

button { font-family: inherit; cursor: pointer; }

/* ---------- 通用按钮 ---------- */
.btn {
  border: none; border-radius: 10px;
  background: #fff; color: #333;
  padding: 7px 12px; font-size: 13px; font-weight: bold;
  box-shadow: 0 2px 0 rgba(60, 90, 110, 0.25);
  transition: transform .08s, box-shadow .08s, background .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 0 rgba(60, 90, 110, 0.25); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(60, 90, 110, 0.25); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: #ffb84d; color: #5a3800; }
.btn.primary:hover { background: #ffc46b; }
.btn.danger { background: #ff8a80; color: #5a1000; }
.btn.big { font-size: 16px; padding: 12px 22px; border-radius: 14px; }
.btn.small { padding: 4px 9px; font-size: 12px; }

/* ---------- 顶部指挥栏 ---------- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 58px; z-index: 50;
  background: #fffdf5;
  box-shadow: 0 3px 12px rgba(40, 80, 120, 0.18);
  display: flex; align-items: center; gap: 14px; padding: 0 14px;
}
.brand { font-size: 20px; font-weight: 900; color: #2c6e8f; letter-spacing: 1px; white-space: nowrap; }
.player-chip { display: flex; align-items: center; gap: 6px; background: #eef6fb; padding: 5px 12px; border-radius: 20px; }
.player-chip i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.player-chip span { font-weight: bold; font-size: 14px; }
.res-group { display: flex; gap: 10px; }
.res {
  background: #f4f9f4; border-radius: 12px; padding: 4px 10px;
  display: flex; flex-direction: column; align-items: center; line-height: 1.15; min-width: 86px;
}
.res b { font-size: 14px; color: #234; }
.res small { font-size: 10px; color: #7a9; }
.date { font-size: 13px; font-weight: bold; color: #456; white-space: nowrap; }
.speed-group { display: flex; gap: 5px; }
.speed-group .btn { padding: 6px 10px; }
.speed-group .spd.on { background: #ffb84d; color: #5a3800; }
.speed-group .pause { min-width: 82px; }
.progress {
  font-size: 13px; font-weight: bold; color: #2c6e8f;
  background: #e3f2fa; border-radius: 12px; padding: 6px 12px; white-space: nowrap;
}
.menu-group { display: flex; gap: 6px; margin-left: auto; }
.menu-group .btn { white-space: nowrap; padding: 7px 9px; font-size: 12.5px; }

/* ---------- 地图区 ---------- */
#map-wrap { position: absolute; inset: 58px 0 0 0; }
#map { display: block; width: 100%; height: 100%; cursor: grab; }
#map:active { cursor: grabbing; }

#tip {
  position: fixed; z-index: 60; display: none; pointer-events: none;
  background: rgba(255, 253, 245, 0.97); border-radius: 10px; padding: 5px 11px 6px;
  font-size: 12px; box-shadow: 0 3px 10px rgba(0,0,0,.2);
  display: none; white-space: nowrap;
}
#tip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tip-nation { font-size: 17px; font-weight: 900; letter-spacing: 1px; line-height: 1.25; }
.tip-sub { color: #678; font-size: 11.5px; display: flex; align-items: center; gap: 5px; }

/* ---------- 左侧栏 ---------- */
#side-left {
  position: absolute; left: 12px; top: 12px; bottom: 12px; width: 292px;
  display: flex; flex-direction: column; gap: 10px; z-index: 20; pointer-events: none;
}
.card {
  pointer-events: auto;
  background: rgba(255, 253, 245, 0.96); border-radius: 16px;
  box-shadow: 0 4px 14px rgba(40, 80, 120, 0.2);
  padding: 12px; font-size: 13px; overflow: hidden auto;
}
.card.grow { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.card-title { font-weight: bold; color: #2c6e8f; margin-bottom: 8px; font-size: 14px; }
.empty { color: #8aa; text-align: center; padding: 18px 6px; line-height: 1.7; font-size: 12px; }
.warn { background: #fff3cd; color: #7a5b00; border-radius: 8px; padding: 5px 8px; margin-top: 6px; font-size: 12px; }

.tp-name { font-size: 17px; font-weight: 900; color: #234; }
.tp-owner { display: flex; align-items: center; gap: 6px; margin: 5px 0; font-weight: bold; }
.tp-owner i { width: 13px; height: 13px; border-radius: 4px; }
.tp-stats { display: flex; flex-wrap: wrap; gap: 5px; }
.tp-stats span { background: #eef6fb; border-radius: 8px; padding: 3px 8px; font-size: 11.5px; color: #345; }
.tp-divs { margin-top: 7px; color: #456; font-size: 12px; line-height: 1.6; }

/* 部队行 */
.div-row {
  border: 2px solid #e4ecf0; border-radius: 12px; padding: 8px 9px; margin-bottom: 7px;
  cursor: pointer; transition: border-color .15s, background .15s; background: #fff;
}
.div-row:hover { border-color: #ffb84d; }
.div-row.sel { border-color: #f5a623; background: #fff8ec; }
.div-row.just-in { animation: fadeUp .4s cubic-bezier(.22, 1.35, .36, 1) backwards; }
.dr-top { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.dr-top b { color: #234; }
.tag { background: #e3f2fa; color: #2c6e8f; font-size: 10.5px; border-radius: 6px; padding: 1px 6px; }
.st { margin-left: auto; font-size: 11px; color: #7a9; }
.st.war { color: #d9534f; font-weight: bold; animation: warPulse 1.4s ease-in-out infinite; }
.st.move { color: #3b8fa0; }
.st.ok { color: #58b558; }
@keyframes warPulse { 50% { opacity: .5; } }
.dr-bot { display: flex; gap: 9px; margin-top: 4px; font-size: 11px; color: #567; }
.dr-bar { height: 4px; background: #e8e8e0; border-radius: 3px; margin-top: 5px; overflow: hidden; }
.dr-bar i { display: block; height: 100%; background: #58b558; border-radius: 3px; }

/* ---------- 战报（弹簧滑入） ---------- */
#toast-box {
  position: absolute; right: 12px; top: 12px; width: 330px; z-index: 40;
  display: flex; flex-direction: column; gap: 7px; pointer-events: none;
}
.toast {
  background: rgba(255, 253, 245, 0.97); border-radius: 12px; padding: 9px 13px;
  font-size: 12.5px; font-weight: bold; color: #345;
  box-shadow: 0 4px 12px rgba(0,0,0,.16);
  animation: slidein .45s cubic-bezier(.22, 1.35, .36, 1);
  transition: opacity .5s, transform .5s;
}
.toast.out { opacity: 0; transform: translateX(30px); }
.toast.good { background: #e8f8e0; color: #2c6e2c; }
.toast.bad { background: #ffe3e0; color: #8a2a20; }
.toast.war { background: #fff0d6; color: #8a5a00; }
@keyframes slidein {
  from { transform: translateX(90px) scale(.92); opacity: 0; }
  70% { transform: translateX(-3px) scale(1.01); }
}

/* ---------- 移动横幅 ---------- */
#move-banner {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: rgba(35, 55, 70, 0.92); color: #fff;
  border-radius: 30px; padding: 10px 18px; display: none; align-items: center; gap: 14px;
  font-size: 14px; font-weight: bold; z-index: 45; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
#move-banner .btn { background: #ffb84d; color: #5a3800; }

/* ---------- 弹窗（弹簧进出场，双向过渡） ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(30, 55, 75, 0.45); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s;
}
.modal-back.show { opacity: 1; visibility: visible; }
.modal {
  background: #fffdf5; border-radius: 20px; padding: 18px 20px;
  width: 560px; max-width: 94vw; max-height: 88vh; overflow: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  transform: translateY(26px) scale(.95);
  opacity: 0;
  transition: transform .42s cubic-bezier(.22, 1.35, .36, 1), opacity .28s ease;
}
.modal-back.show .modal { transform: none; opacity: 1; }
.modal.wide { width: 1060px; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; font-size: 17px; color: #234;
}
.head-right { display: flex; align-items: center; gap: 10px; }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

.field-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.field-row.col { flex-direction: column; align-items: stretch; }
.field-row label { font-size: 12.5px; font-weight: bold; color: #567; white-space: nowrap; }
select {
  font-family: inherit; font-size: 12.5px; padding: 6px 8px; border-radius: 9px;
  border: 2px solid #dfe8ec; background: #fff; color: #234; font-weight: bold;
}
select:focus { outline: none; border-color: #ffb84d; }

/* 编组 */
.tpl-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tpl-btn { border: 2px solid #dfe8ec; background: #fff; border-radius: 10px; padding: 6px 11px; font-size: 12.5px; font-weight: bold; color: #345; }
.tpl-btn:hover { border-color: #ffb84d; background: #fff8ec; }
.reg-row {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 2px solid #e4ecf0; border-radius: 12px;
  padding: 6px 9px; margin-bottom: 6px;
}
.reg-row .sel-type { width: 118px; }
.reg-row .sel-equip { flex: 1; min-width: 0; }
.reg-row .sel-equip2 { flex: 1; min-width: 0; }
.reg-men { font-size: 11.5px; color: #567; white-space: nowrap; }
.reg-del { border: none; background: #ffe3e0; color: #a33; border-radius: 8px; padding: 4px 8px; font-weight: bold; }

/* ---------- 编师：滑块式驻扎地 + 点击式团配置 ---------- */
.loc-slider { position: relative; display: flex; gap: 2px; background: #e9eff3; border-radius: 12px; padding: 4px; flex: 1; }
.loc-thumb {
  position: absolute; top: 4px; bottom: 4px; background: #fff; border-radius: 9px;
  box-shadow: 0 2px 7px rgba(40, 80, 120, .22);
  transition: left .3s cubic-bezier(.22, 1.35, .36, 1), width .3s cubic-bezier(.22, 1.35, .36, 1);
}
.loc-opt {
  flex: 1; position: relative; z-index: 1; border: 0; background: transparent; cursor: pointer;
  padding: 4px 6px; font-size: 12.5px; font-weight: bold; color: #789; border-radius: 9px;
  transition: color .2s; white-space: nowrap; overflow: hidden; line-height: 1.35;
}
.loc-opt small { display: block; font-weight: normal; font-size: 10px; color: #9ab; }
.loc-opt.sel { color: #1d5a7a; }
.loc-opt.sel small { color: #4a7a95; }
.loc-opt.full { opacity: .4; }
.loc-opt:not(.full):hover { color: #2c6e8f; }
.reg-row {
  border: 2px solid #e4ecf0; border-radius: 12px; padding: 7px 9px; margin-bottom: 7px;
  display: flex; flex-direction: column; gap: 5px; background: #fff;
}
.reg-line { display: flex; align-items: center; gap: 7px; }
.reg-idx {
  width: 20px; height: 20px; border-radius: 50%; background: #eef3f6; color: #567;
  font-size: 11px; font-weight: bold; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.seg-types { display: flex; gap: 4px; flex: 1; min-width: 0; }
.seg-type {
  flex: 1; border: 2px solid #dfe8ec; background: #fff; border-radius: 9px; padding: 4px 3px;
  font-size: 11.5px; font-weight: bold; color: #567; cursor: pointer;
  transition: border-color .15s, color .15s, transform .12s; white-space: nowrap; overflow: hidden;
}
.seg-type.sel { border-color: transparent; color: #fff; }
.seg-type:not(.sel):not(:disabled):hover { border-color: #ffb84d; }
.seg-type:active { transform: scale(.94); }
.seg-type:disabled { opacity: .4; cursor: not-allowed; }
.seg-equips { display: flex; flex-wrap: wrap; gap: 4px; }
.seg-equip {
  border: 1.5px solid #dfe8ec; background: #fafcfd; border-radius: 9px; padding: 3px 9px;
  font-size: 11px; font-weight: bold; color: #567; cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.seg-equip em { font-style: normal; color: #8a9; font-weight: normal; }
.seg-equip.sel { border-color: #ffb84d; background: #fff8ec; color: #5a3800; }
.seg-equip:not(.sel):not(:disabled):hover { border-color: #ffb84d; }
.seg-equip:active { transform: scale(.94); }
.seg-equip:disabled { opacity: .4; cursor: not-allowed; }
.reg-chip {
  width: 24px; height: 24px; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.reg-name { font-weight: bold; color: #345; font-size: 12.5px; width: 76px; white-space: nowrap; }
.btn.add { align-self: flex-start; background: #e8f4ff; color: #2c6e8f; }
.cost-box {
  background: #fff4dd; border-radius: 12px; padding: 9px 13px;
  font-size: 13px; color: #6a4a00; font-weight: bold; line-height: 1.7;
}

/* 师详情 */
.detail-status { font-size: 13.5px; font-weight: bold; color: #2c6e8f; margin-bottom: 6px; }
.detail-stats {
  background: #eef6fb; border-radius: 12px; padding: 9px 13px;
  font-size: 13.5px; color: #345; margin-bottom: 12px;
}

/* ---------- 城市弹窗 ---------- */
.modal.city-modal { width: 660px; }
.city-info {
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
  background: #eef6fb; border-radius: 12px; padding: 8px 12px;
  font-size: 12.5px; color: #345; margin-bottom: 12px;
}
.city-info .ci-owner { display: flex; align-items: center; gap: 5px; font-weight: bold; }
.city-info i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.city-info .ci-bonus { color: #2c6e2c; font-weight: bold; }
.bld-ing { color: #b3772f; font-weight: bold; }

.city-slots {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 12px;
}
.slot {
  min-height: 118px; border-radius: 14px; padding: 8px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; text-align: center; font-size: 11.5px;
}
/* 空地 = 灰色小房子 + 加号 */
.slot.empty {
  background: #dcdcd4;
  border: 2px dashed #a9a99e;
  cursor: pointer; position: relative;
  transition: border-color .15s, background .15s;
}
.slot.empty:hover, .slot.empty.pick { border-color: #f5a623; background: #e8e6da; }
.slot.empty::before {
  content: '🏠'; font-size: 30px; line-height: 1;
  filter: grayscale(1); opacity: .45; display: block;
}
.slot-add {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: #ffb84d; color: #5a3800; font-size: 20px; font-weight: 900; line-height: 1;
  box-shadow: 0 2px 0 rgba(90, 56, 0, 0.35); margin-top: 2px;
}
.slot-add:hover { transform: scale(1.12); }
.slot.empty.pick .slot-add { background: #f5a623; }
.slot-tip { color: #8a8a80; font-size: 10px; }
.slot.built { background: #eaf7e4; border: 2px solid #9fd49a; }
.slot.blding { background: #fff4dd; border: 2px solid #f0c060; }
.slot-icon { font-size: 26px; line-height: 1.1; }
.slot-name { font-weight: 900; color: #345; }
.slot-eff { color: #678; font-size: 10px; line-height: 1.4; }
.slot-bar { width: 90%; height: 6px; background: #e8ddb8; border-radius: 4px; overflow: hidden; }
.slot-bar i { display: block; height: 100%; background: #e0a23c; }

/* 建造菜单 */
.build-menu {
  background: #f6f9f4; border: 2px solid #e0e8dc; border-radius: 14px;
  padding: 10px 12px; margin-bottom: 12px;
}
.bm-title { font-weight: bold; color: #345; font-size: 13px; margin-bottom: 8px; }
.bm-plans { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.plan-chip {
  border: 2px solid #f0c060; background: #fff8ec; color: #6a4a00;
  border-radius: 18px; padding: 5px 12px; font-size: 12px; font-weight: bold;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.plan-chip:hover { background: #ffefc9; }
.plan-chip.custom { border-color: #9ec9f0; background: #eef6fd; color: #235a80; }
.plan-chip .plan-del {
  font-style: normal; background: #ffd0cc; color: #a33; border-radius: 50%;
  width: 16px; height: 16px; font-size: 10px; line-height: 16px; text-align: center;
}
.plan-chip .plan-del:hover { background: #ffb0aa; }
.bm-list { display: flex; flex-direction: column; gap: 6px; }
.bm-row {
  display: flex; align-items: center; gap: 9px;
  background: #fff; border: 1.5px solid #e4ecf0; border-radius: 10px; padding: 6px 9px;
}
.bm-icon { font-size: 19px; }
.bm-name { font-weight: bold; color: #345; width: 58px; white-space: nowrap; }
.bm-desc { flex: 1; color: #678; font-size: 11.5px; }
.bm-cost { color: #8a5a00; font-size: 11.5px; font-weight: bold; white-space: nowrap; }
.bm-cancel-row { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.bm-cancel-row .hint { font-size: 11px; color: #8a9; }

.city-foot { display: flex; align-items: center; gap: 9px; }
.plan-input {
  flex: 1; border: 2px solid #dfe8ec; border-radius: 10px; padding: 7px 10px;
  font-family: inherit; font-size: 12.5px;
}
.plan-input:focus { outline: none; border-color: #ffb84d; }
.money-tag { font-weight: 900; color: #8a5a00; background: #fff4dd; border-radius: 10px; padding: 6px 11px; white-space: nowrap; }

/* ---------- 军营（城市内按营展示） ---------- */
.city-barracks { margin-bottom: 12px; }
.bb-title { font-weight: bold; color: #2c6e8f; font-size: 13px; margin-bottom: 7px; }
.bb-empty { color: #8aa; font-size: 12px; background: #f2f6f8; border-radius: 10px; padding: 8px 12px; text-align: center; }
.camp-card {
  display: flex; align-items: center; gap: 9px;
  background: #fff; border: 2px solid #e4ecf0; border-radius: 12px;
  padding: 7px 10px; margin-bottom: 6px;
}
.camp-info { flex: 1; min-width: 0; line-height: 1.25; }
.camp-info b { font-size: 12.5px; color: #234; }
.camp-info small { color: #789; font-size: 10.5px; margin-left: 5px; }
.camp-bar { width: 90px; height: 5px; background: #e8e8e0; border-radius: 3px; overflow: hidden; margin-top: 3px; }
.camp-bar i { display: block; height: 100%; background: #58b558; }
.camp-equip { width: 168px; flex-shrink: 0; }
.camp-men { font-size: 11px; color: #567; white-space: nowrap; }

/* ---------- 内政 ---------- */
.modal.dom-modal { width: 560px; }
.dom-sec { background: #f6faf6; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.dom-title { font-weight: 900; color: #345; margin-bottom: 8px; font-size: 14px; }
.dom-tax-row { display: flex; align-items: center; gap: 12px; }
.dom-tax-row input[type="range"] { flex: 1; accent-color: #e0a23c; }
.dom-tax-row b { font-size: 17px; color: #8a5a00; min-width: 46px; text-align: right; }
.dom-preview { font-size: 13px; color: #345; margin: 8px 0 4px; }
.dom-tech { color: #2e8b8b; font-weight: bold; font-size: 11.5px; }
.dim { color: #8a9; font-size: 11.5px; }
.dom-policies { display: flex; gap: 10px; }
.pol-card {
  flex: 1; background: #fff; border: 2px solid #e4ecf0; border-radius: 12px;
  padding: 10px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.pol-card:hover { border-color: #ffb84d; }
.pol-card.on { border-color: #58b558; background: #eaf7e4; }
.pol-icon { font-size: 22px; }
.pol-card b { display: block; color: #234; font-size: 13px; margin: 3px 0; }
.pol-card small { display: block; color: #678; font-size: 10.5px; line-height: 1.5; min-height: 31px; }
.pol-sw { margin-top: 6px; font-size: 11px; font-weight: bold; color: #8a9; }
.pol-card.on .pol-sw { color: #2c6e2c; }
.mig-row { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.mig-row select { flex: 1; }
.mig-arrow { font-weight: 900; color: #8a9; }
#dom-mig-amt { width: 100%; accent-color: #4f8fdd; margin: 4px 0; }
#dom-mig-go { margin-top: 8px; }

/* ---------- 外交 ---------- */
.modal.diplo-modal { width: 780px; }
.diplo-wrap { display: flex; gap: 12px; min-height: 380px; }
.diplo-list { width: 218px; flex-shrink: 0; overflow: auto; max-height: 62vh; }
.dp-row {
  display: flex; align-items: center; gap: 8px;
  border: 2px solid #e4ecf0; background: #fff; border-radius: 11px;
  padding: 7px 10px; margin-bottom: 6px; cursor: pointer; font-size: 12.5px;
}
.dp-row:hover { border-color: #ffb84d; }
.dp-row.sel { border-color: #f5a623; background: #fff8ec; }
.dp-row i { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.dp-row b { flex: 1; }
.dp-rel { font-weight: bold; font-size: 11.5px; }
.dp-rel.good { color: #2c6e2c; }
.dp-rel.bad { color: #a33; }
.dp-pact { font-size: 10px; background: #e8f4ff; color: #2c6e8f; border-radius: 6px; padding: 1px 5px; }
.diplo-detail { flex: 1; overflow: auto; max-height: 66vh; }
.dpd-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #eef6fb; border-radius: 12px; padding: 9px 13px; margin-bottom: 10px; font-size: 13px;
}
.dpd-head i { width: 14px; height: 14px; border-radius: 4px; }
.dpd-head span { color: #567; font-size: 12px; }
.dpd-head .good { color: #2c6e2c; }
.dpd-head .bad { color: #a33; }
.dp-offer {
  background: #fff; border: 2px solid #e4ecf0; border-radius: 12px;
  padding: 9px 12px; margin-bottom: 9px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.dp-offer > b { font-size: 13px; color: #234; }
.dp-offer > small { flex: 1; color: #678; font-size: 11.5px; min-width: 130px; }
.dp-offer select { max-width: 200px; }
.dp-offer .dim { width: 100%; }

/* ---------- 军港 ---------- */
.city-navy { margin-bottom: 12px; }
.navy-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #eaf4fb; border: 2px solid #9cc9e8; border-radius: 12px;
  padding: 8px 12px;
}
.navy-title { font-weight: 900; color: #2c6e8f; font-size: 13px; }
.navy-stat { font-size: 12.5px; color: #345; }
.navy-row .dim { width: 100%; }

/* ---------- 外交峰会（领袖谈判） ---------- */
.diplo-body { min-height: 420px; }
.hall-title { font-weight: 900; color: #2c6e8f; font-size: 16px; text-align: center; margin-bottom: 14px; animation: fadeUp .45s ease backwards; }
.hall-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hall-card {
  width: 158px; border: 2px solid #e4ecf0; background: #fff; border-radius: 14px;
  padding: 12px 10px; text-align: center; cursor: pointer; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  animation: chipIn .45s cubic-bezier(.22, 1.35, .36, 1) backwards;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.hall-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(40,80,120,.18); border-color: #ffb84d; }
.hall-avatar {
  width: 52px; height: 52px; border-radius: 50%; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  background: #eef6fb; border: 3px solid; margin-bottom: 3px; overflow: hidden;
}
.hall-avatar .lp, .leader-card .lp {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
}
.leader-card .lp { width: 64px; height: 64px; box-shadow: 0 3px 10px rgba(30,60,90,.25); }
.hall-card b { font-size: 13px; color: #234; }
.hall-card small { color: #789; font-size: 10.5px; }

/* 谈判桌 */
.summit { min-height: 430px; display: flex; flex-direction: column; }
.summit-leaders { display: flex; align-items: stretch; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.leader-card {
  flex: 1; background: #eef6fb; border-radius: 16px; border: 2px solid #cfe3f2;
  padding: 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 22px;
}
.leader-card b { font-size: 14.5px; color: #234; }
.leader-card small { color: #678; font-size: 11.5px; }
.leader-card.me { border-color: #f5c86a; background: #fffaf0; }
.summit.fresh .leader-card.me { animation: leaderInL .6s cubic-bezier(.22, 1.3, .36, 1) backwards; }
.summit.fresh .leader-card.them { animation: leaderInR .6s cubic-bezier(.22, 1.3, .36, 1) backwards; }
.summit.fresh .summit-vs { animation: titleIn .7s cubic-bezier(.22, 1.35, .36, 1) .15s backwards; }
@keyframes leaderInL { from { transform: translateX(-90px) rotate(-4deg); opacity: 0; } }
@keyframes leaderInR { from { transform: translateX(90px) rotate(4deg); opacity: 0; } }
.summit-vs {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 30px;
}
.summit-vs small { font-size: 11px; color: #8a9; font-weight: bold; }
.nego-status {
  display: flex; gap: 18px; justify-content: center; font-size: 12.5px; color: #567;
  background: #f4f9f4; border-radius: 10px; padding: 6px; margin-bottom: 10px;
}
.nego-status .good { color: #2c6e2c; }
.nego-status .bad { color: #a33; }
.nego-status b { display: inline-block; }
.nego-status b.bump { animation: chipBump .3s cubic-bezier(.22, 1.35, .36, 1); }
.warn-inline { color: #b35a00; font-weight: bold; }

.nego-board { display: flex; gap: 12px; align-items: stretch; }
.nego-side {
  flex: 1; background: #f6faf6; border-radius: 14px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.nego-side > b { font-size: 13px; color: #345; }
.chip-slots { min-height: 92px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.nego-chip {
  background: #fff; border: 2px solid #dfe8ec; border-radius: 18px;
  padding: 4px 10px; font-size: 12px; font-weight: bold; color: #345;
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.nego-chip.just-in { animation: chipIn .35s cubic-bezier(.22, 1.35, .36, 1) backwards; }
.nego-chip.bump { animation: chipBump .3s cubic-bezier(.22, 1.35, .36, 1); }
.nego-chip:active { transform: scale(.94); }
.nego-chip:hover { border-color: #ffb84d; transform: translateY(-1px); }
.nego-chip.none { border-style: dashed; color: #a9b8bd; cursor: default; }
.nego-chip.threat { border: 2px dashed #e05a5a; background: #fff0f0; color: #8a2020; }
.nego-chip.threat:hover { border-color: #b33; background: #ffe0e0; }
.nego-chip.give { border-left: 4px solid #58b558; }
.nego-chip.get { border-left: 4px solid #e0784a; }
.chip-del {
  font-style: normal; background: #ffe3e0; color: #a33; border-radius: 50%;
  width: 15px; height: 15px; font-size: 9px; line-height: 15px; text-align: center;
  transition: transform .15s cubic-bezier(.34, 1.56, .64, 1), background .15s;
}
.chip-del:hover { background: #ffb0aa; transform: scale(1.2); }
.chip-add { display: flex; flex-wrap: wrap; gap: 5px; }
.chip-add-btn {
  border: 1.5px dashed #b8ccc4; background: transparent; border-radius: 14px;
  padding: 3px 9px; font-size: 11px; font-weight: bold; color: #567;
  transition: border-color .15s, color .15s, background .15s, transform .12s;
}
.chip-add-btn:hover { border-color: #58b558; color: #2c6e2c; background: #eef8ea; }
.chip-add-btn:active { transform: scale(.92); }
/* 被删除筹码的残影：原地缩小淡出 */
.chip-ghost {
  background: #fff; border: 2px solid #dfe8ec; border-radius: 18px;
  padding: 4px 10px; font-size: 12px; font-weight: bold; color: #345;
  display: inline-flex; align-items: center; gap: 5px;
  animation: chipOut .35s cubic-bezier(.55, 0, .85, .4) forwards;
}
.chip-ghost.give { border-left: 4px solid #58b558; }
.chip-ghost.get { border-left: 4px solid #e0784a; }
@keyframes chipOut { to { transform: scale(.4) rotate(6deg); opacity: 0; } }
@keyframes chipBump { 35% { transform: scale(1.14); } 70% { transform: scale(.97); } }
.nego-reply {
  width: 240px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.reply-bubble {
  width: 100%; background: #fff; border: 2px solid #dfe8ec; border-radius: 14px;
  padding: 12px 14px; font-size: 13px; color: #345; line-height: 1.7; text-align: center;
  position: relative;
}
.reply-bubble.just-in { animation: bubbleIn .45s cubic-bezier(.22, 1.45, .36, 1); }
.reply-bubble::before {
  content: ''; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  border: 9px solid transparent; border-bottom-color: #dfe8ec; border-top: 0;
}
.reply-bubble.accept { background: #eaf7e4; border-color: #9fd49a; }
.reply-bubble.accept::before { border-bottom-color: #9fd49a; }
.reply-bubble.counter { background: #fff4dd; border-color: #f0c060; }
.reply-bubble.counter::before { border-bottom-color: #f0c060; }
.reply-bubble.reject { background: #ffe9e7; border-color: #f0a9a0; }
.reply-bubble.reject::before { border-bottom-color: #f0a9a0; }
.reply-bubble.hello { background: #eef6fb; border-color: #bfdcf2; }
.reply-bubble.hello::before { border-bottom-color: #bfdcf2; }
@keyframes bubbleIn { from { transform: scale(.6) translateY(14px); opacity: 0; } }
.nego-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }

/* ---------- 上帝视角：世界格局 ---------- */
.world-rel { display: flex; flex-direction: column; gap: 8px; }
.wr-card {
  background: #fff; border: 2px solid #e4ecf0; border-radius: 12px; padding: 9px 12px;
  animation: fadeUp .35s ease backwards;
}
.wr-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.wr-top .lp { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid #dfe8ec; align-self: center; flex-shrink: 0; }
.wr-name { font-size: 19px; font-weight: 900; letter-spacing: 1.5px; }
.wr-leader { color: #456; font-size: 12.5px; font-weight: bold; }
.wr-meta { color: #8a9; font-size: 11.5px; margin-left: auto; }
.wr-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.wr-pact { background: #e8f4fd; color: #2c6e8f; border-radius: 10px; padding: 2px 8px; font-size: 11px; font-weight: bold; }
.wr-grudge { background: #ffe9e7; color: #a33; border-radius: 10px; padding: 2px 8px; font-size: 11px; font-weight: bold; }
.wr-rel { background: #f4f9f4; border-radius: 10px; padding: 2px 8px; font-size: 11px; font-weight: bold; }
.wr-rel.good { color: #2c6e2c; }
.wr-rel.bad { color: #a33; }

/* ---------- 科技树 ---------- */
.autolight-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.autolight-row .hint { font-size: 11.5px; color: #8a9; }
#tech-cols { display: flex; gap: 12px; }
.tech-col {
  flex: 1; background: #f6faf6; border-radius: 14px; padding: 10px 8px;
  border-top: 5px solid var(--bc);
}
.tech-col-name { text-align: center; font-weight: 900; color: #345; margin-bottom: 10px; font-size: 14px; }
.tech-node {
  background: #fff; border: 2px solid #e4ecf0; border-radius: 12px;
  padding: 8px 9px; margin-bottom: 4px; cursor: pointer; transition: transform .1s, border-color .15s;
  position: relative;
}
.tech-node:hover { transform: translateY(-1px); }
.tn-name { font-weight: bold; font-size: 13px; color: #234; }
.tn-desc { font-size: 11px; color: #678; margin: 3px 0; line-height: 1.45; }
.tn-cost { font-size: 11.5px; font-weight: bold; color: #8a9; }
.tech-node.done { background: #e8f8e0; border-color: #9fd49a; cursor: default; }
.tech-node.done .tn-cost { color: #2c6e2c; }
.tech-node.avail { border-color: var(--bc); }
.tech-node.avail.poor { opacity: .75; }
.tech-node.locked { opacity: .5; cursor: not-allowed; background: #f2f2f2; }
.tn-link { text-align: center; color: #b8c4c8; font-size: 12px; line-height: 1; margin: 2px 0; }

/* ---------- 开局（发布会式入场编排） ---------- */
.modal.start { width: 780px; }
.start-head { text-align: center; margin-bottom: 12px; }
.start-title {
  font-size: 42px; font-weight: 900; color: #2c6e8f; letter-spacing: 4px; text-shadow: 0 3px 0 #d8ecf5;
  animation: titleIn .8s cubic-bezier(.22, 1.35, .36, 1) backwards;
}
.start-sub { color: #678; margin-top: 6px; font-size: 14px; animation: fadeUp .6s ease .25s backwards; }
.start-tips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px;
}
.start-tips span {
  background: #eef6fb; border-radius: 16px; padding: 5px 13px; font-size: 12px; color: #345; font-weight: bold;
  animation: fadeUp .5s ease backwards;
}
.start-tips span:nth-child(1) { animation-delay: .35s; }
.start-tips span:nth-child(2) { animation-delay: .43s; }
.start-tips span:nth-child(3) { animation-delay: .51s; }
.start-tips span:nth-child(4) { animation-delay: .59s; }
.start-tips span:nth-child(5) { animation-delay: .67s; }
.pick-label { font-weight: bold; color: #345; margin-bottom: 8px; font-size: 13.5px; animation: fadeUp .5s ease .7s backwards; }
#country-grid { display: flex; flex-wrap: wrap; gap: 8px; max-height: 300px; overflow: auto; padding: 4px; }
@keyframes titleIn { from { transform: scale(1.6); opacity: 0; letter-spacing: 14px; } }
@keyframes fadeUp { from { transform: translateY(10px); opacity: 0; } }
.c-chip {
  display: flex; align-items: center; gap: 7px;
  border: 2px solid #e4ecf0; background: #fff; border-radius: 12px;
  padding: 7px 12px; font-size: 13px; font-weight: bold; color: #345;
  flex-direction: column; align-items: flex-start; gap: 1px; position: relative;
  animation: chipIn .45s cubic-bezier(.22, 1.35, .36, 1) backwards;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.c-chip:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(40,80,120,.15); }
@keyframes chipIn { from { transform: scale(.6); opacity: 0; } }
.c-chip i { position: absolute; right: 8px; top: 8px; width: 12px; height: 12px; border-radius: 50%; }
.c-chip small { font-size: 10px; color: #8a9; font-weight: normal; }
.c-chip:hover { border-color: #ffb84d; }
.c-chip.major { border-color: #f5c86a; background: #fffaf0; }
.c-chip.picked { border-color: #f5a623; background: #fff3d6; box-shadow: 0 0 0 3px #ffe3ad; }
.start-btns { display: flex; justify-content: center; gap: 14px; margin-top: 16px; }

/* ---------- 结算 ---------- */
.end-modal { text-align: center; width: 480px; }
.end-title { font-size: 40px; font-weight: 900; color: #b8860b; margin-bottom: 12px; }
.end-desc { font-size: 15px; color: #456; line-height: 1.9; margin-bottom: 8px; }

/* ---------- 帮助 ---------- */
.help-body { font-size: 13px; color: #345; line-height: 1.9; }
.help-body p { margin-bottom: 9px; }
.help-body b { color: #b3772f; }

/* ---------- 彩带 ---------- */
#confetti { position: fixed; inset: 0; z-index: 200; pointer-events: none; display: none; overflow: hidden; }
#confetti i {
  position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: .6; }
}

/* ---------- 进入战局的入场编排 ---------- */
body.playing #topbar { animation: barIn .55s cubic-bezier(.22, 1.2, .36, 1) backwards; }
body.playing #side-left { animation: sideIn .6s cubic-bezier(.22, 1.25, .36, 1) .08s backwards; }
body.playing #toast-box { animation: sideIn .6s cubic-bezier(.22, 1.25, .36, 1) .16s backwards; }
body.playing #topbar .menu-group .btn { animation: fadeUp .4s ease backwards; }
body.playing #topbar .menu-group .btn:nth-child(1) { animation-delay: .18s; }
body.playing #topbar .menu-group .btn:nth-child(2) { animation-delay: .22s; }
body.playing #topbar .menu-group .btn:nth-child(3) { animation-delay: .26s; }
body.playing #topbar .menu-group .btn:nth-child(4) { animation-delay: .3s; }
body.playing #topbar .menu-group .btn:nth-child(5) { animation-delay: .34s; }
body.playing #topbar .menu-group .btn:nth-child(6) { animation-delay: .38s; }
body.playing #topbar .menu-group .btn:nth-child(7) { animation-delay: .42s; }
@keyframes barIn { from { transform: translateY(-110%); } }
@keyframes sideIn { from { transform: translateX(-120%); opacity: 0; } }

/* ---------- 微交互 ---------- */
.btn:active { transform: translateY(1px) scale(.96); }
.btn.primary { transition: transform .12s, box-shadow .15s, background .15s; }
.btn.primary:hover { box-shadow: 0 4px 12px rgba(255, 170, 40, .45); }
.slot-add { transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), background .15s; }
.camp-card, .dp-row, .tpl-btn, .tech-node, .div-row { transition: transform .15s, border-color .15s, background .15s, box-shadow .15s; }
.camp-card:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(40,80,120,.12); }
.dp-row:hover { transform: translateX(2px); }
.dr-bar, .slot-bar i, .camp-bar i { transition: width .45s ease; }

/* ---------- 减弱动态效果（系统设置） ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- 数据汇演图表面板 ---------- */
#cine-chart {
  position: fixed; left: 50%; bottom: 24px; z-index: 90;
  width: 860px; max-width: 94vw;
  background: rgba(255, 253, 245, 0.97); border-radius: 20px;
  box-shadow: 0 18px 60px rgba(20, 50, 80, 0.35);
  padding: 14px 18px;
  transform: translate(-50%, 130%);
  opacity: 0;
  transition: transform .7s cubic-bezier(.22, 1.2, .36, 1), opacity .5s;
  pointer-events: none;
}
#cine-chart.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.cc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.cc-head > b { font-size: 15px; color: #234; }
.cc-metrics { display: flex; gap: 6px; margin-left: auto; }
.cc-metric {
  border: 2px solid #e4ecf0; background: #fff; border-radius: 16px;
  padding: 4px 11px; font-size: 12px; font-weight: bold; color: #567;
}
.cc-metric.on { border-color: #f5a623; background: #fff3d6; color: #8a5a00; }
.cc-body { display: flex; gap: 16px; }
.cc-left { flex: 1.25; min-width: 0; }
.cc-svg { width: 100%; height: 190px; display: block; }
@keyframes ccLine { to { stroke-dashoffset: 0; } }
.cc-legend { display: flex; gap: 12px; margin-top: 4px; }
.cc-legend span { font-size: 11px; color: #567; font-weight: bold; display: flex; align-items: center; gap: 5px; }
.cc-legend i { width: 10px; height: 10px; border-radius: 3px; }
.cc-right { width: 300px; flex-shrink: 0; }
.cc-bars-title { font-weight: bold; color: #345; font-size: 12.5px; margin-bottom: 7px; }
.cc-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.cc-bar-name { width: 64px; font-size: 11.5px; color: #345; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-bar-track { flex: 1; height: 14px; background: #eef2f0; border-radius: 7px; overflow: hidden; }
.cc-bar-track i {
  display: block; height: 100%; width: 0; border-radius: 7px;
  animation: barGrow .9s cubic-bezier(.22, 1.2, .36, 1) forwards;
}
@keyframes barGrow { to { width: var(--w); } }
.cc-bar-val { width: 40px; text-align: right; font-size: 11.5px; color: #567; }
.cc-empty { color: #8a9; font-size: 12.5px; text-align: center; padding: 60px 0; }
body.cine #side-left, body.cine #toast-box { opacity: .12; pointer-events: none; transition: opacity .5s; }

/* ---------- 窄屏 ---------- */
@media (max-width: 1100px) {
  .res { min-width: 70px; }
  .brand { display: none; }
  #side-left { width: 250px; }
}
