/* ==========================================================================
   铁流智脑 · 军车编队样式（convoy.css）
   【11-26】与 convoy.js 配套：车辆图标容器、朝向旋转、光晕、类型标签
   ========================================================================== */

/* Leaflet divIcon 默认有白底和边框，全部清掉 */
.convoy-icon {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* 车辆整体容器：不接收鼠标事件，避免遮挡地图拖拽 */
.convoy-car {
  position: relative;
  width: 72px;
  height: 44px;
  pointer-events: none;
  will-change: transform;
}

/* 地面光晕：让车在深色底图上"浮"起来 */
.convoy-glow {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 62px;
  height: 28px;
  margin: -14px 0 0 -31px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    var(--gc, rgba(140, 220, 255, .5)) 0%,
    rgba(120, 200, 255, .18) 45%,
    rgba(0, 0, 0, 0) 75%);
  filter: blur(1.5px);
  opacity: .85;
  z-index: 0;
}

/* 车身：按路线切线方向旋转（JS 写入 transform: rotate） */
.convoy-body {
  position: relative;
  z-index: 1;
  transform-origin: 50% 50%;
  transition: transform .12s linear;
  /* 【11-26】白色描边 + 落地阴影，深色车标在浅色路网上也能看清 */
  filter:
    drop-shadow(0 0 2px #fff)
    drop-shadow(0 0 3.5px rgba(255, 255, 255, .9))
    drop-shadow(0 1px 3px rgba(0, 0, 0, .85));
  display: block;
}

.convoy-body svg {
  display: block;
  overflow: visible;
  /* 【11-26】放大到 1.8 倍：zoom 9 视野下原尺寸几乎认不出 */
  width: 72px;
  height: 44px;
}

/* 不同类型微调光晕颜色（与车型配色一致） */
.convoy-car[data-type="command"] .convoy-glow { --gc: rgba(143, 224, 174, .55); }
.convoy-car[data-type="truck"]   .convoy-glow { --gc: rgba(183, 217, 139, .50); }
.convoy-car[data-type="apc"]     .convoy-glow { --gc: rgba(168, 189, 133, .50); }
.convoy-car[data-type="medic"]   .convoy-glow { --gc: rgba(255, 130, 130, .60); }

/* 指挥车天线闪烁（唯一保留的动效，提示这是指挥节点） */
@keyframes convoyBlink {
  0%, 100% { opacity: .45; }
  50%      { opacity: 1; }
}
.convoy-car[data-type="command"] .convoy-antenna-led {
  animation: convoyBlink 1.6s ease-in-out infinite;
}

/* 救护车顶灯闪烁 */
@keyframes convoySiren {
  0%, 100% { fill: #ff4d4d; }
  50%      { fill: #ffb3b3; }
}
.convoy-car[data-type="medic"] .convoy-siren-lamp {
  animation: convoySiren 1s ease-in-out infinite;
}

/* 图例里的军车小图标
   【11-26 修】.map-legend 是 grid + max-content 两列布局，
   这一行必须横跨两列，否则只占第一列会被挤成竖排/裁切 */
#lgConvoyRow.lg-convoy-row {
  grid-column: 1 / -1 !important;
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  gap: 1px !important;
  align-items: flex-start !important;
  height: auto !important;
  margin-top: 2px !important;
}
.lg-convoy-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  color: #45586C;
  white-space: nowrap;
}
.lg-convoy-item svg {
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6));
}

/* ==========================================================================
   【11-26 三改】车标可见性强化
   问题：zoom 9 观望时绿车标压在浅灰底图上几乎看不见
   方案：车标放大到 72x44 + 亮黄光晕 + 强白描边 + 文字名称标签
   ========================================================================== */
.convoy-tag {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  margin-top: 4px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(8, 18, 12, .82);
  border: 1px solid rgba(255, 214, 120, .55);
  color: #ffe9a8;
  font-size: 10px;
  line-height: 13px;
  white-space: nowrap;
  font-family: var(--mono, monospace);
  letter-spacing: .3px;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}

/* 光晕加亮加宽，让车从底图上"发亮" */
.convoy-car .convoy-glow {
  background: radial-gradient(ellipse at center,
    rgba(255, 240, 130, .78) 0%,
    rgba(255, 205, 60, .38) 45%,
    rgba(255, 190, 0, 0) 80%) !important;
  filter: blur(2.5px);
  opacity: 1 !important;
}

/* 描边再加粗一档 */
.convoy-body {
  filter:
    drop-shadow(0 0 2.5px #fff)
    drop-shadow(0 0 4px rgba(255, 255, 255, .95))
    drop-shadow(0 2px 4px rgba(0, 0, 0, .9)) !important;
}


/* ==========================================================================
   【11-26 四改】车标可见性终极方案
   1) 车辆图层 z-index 提到图例之上（图例默认折叠，不再挡路）
   2) 车标再放大到 88x54
   3) 图例默认折叠成小按钮，点击展开
   ========================================================================== */

/* 车辆图层压在一切之上（Leaflet markerPane 默认 600，这里提到 700） */
.leaflet-marker-pane { z-index: 700 !important; }

/* 车标尺寸再放大一档 */
.convoy-car { width: 88px !important; height: 54px !important; }
.convoy-body svg { width: 88px !important; height: 54px !important; }
.convoy-glow { width: 76px !important; height: 34px !important; margin: -17px 0 0 -38px !important; }
.convoy-tag { font-size: 11px !important; line-height: 14px !important; padding: 1px 6px !important; }

/* ---------- 图例：折叠式（【11-27】默认收起，点标题栏展开）----------
   注意：style.css 用 !important 定了 .map-legend 的布局，
   这里必须用同样带 !important 且更具体的选择器（#pagePlan 前缀）才盖得住。
   折叠/展开的 max-height 由 style.css 末尾 .lg-collapsed/.lg-open 统一控制，
   这里只管指针事件与层级，不再改高度，避免互相打架 */
#pagePlan .map-legend {
  cursor: pointer !important;
  pointer-events: auto !important;
}
/* 折叠态提示 */
.map-legend::before {
  content: '图例' !important;
  font-size: 9px !important;
  top: -7px !important;
  left: 4px !important;
  padding: 0 3px !important;
}

/* ==========================================================================
   【11-26 五改】登录页（未登录）背景地图 + 军车编队
   目标：不登录也能在登录页背景上看到军车在路线图上跑
   做法：#loginMap 铺满全屏固定在最底层（z-index:0），
         登录框/标语/军旗照旧浮在上面（z-index 更大）
   ========================================================================== */
#loginMap {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;   /* 不抢登录框的点击/拖拽 */
  background: #0A1526 !important;
}

/* 底图柔化 + 压暗，保证登录框文字清晰、军车醒目 */
#loginMap .leaflet-tile-pane {
  filter: none !important;
}
/* 瓦片加载前的兜底底色 */
#loginMap .leaflet-container { background: #0A1526 !important; }

/* 登录页上的军车稍放大一点（背景视觉，不需要那么精确） */
#loginMap .convoy-car { transform-origin: 50% 50%; }

/* 登录页不显示图例/缩放控件等 UI */
#loginMap .leaflet-control-container { display: none !important; }

/* 让登录页内容浮在地图之上
   【11-26 修】只给真正需要提层的元素加 z-index，
   绝不动 #loginHero 的 position/z-index（它原本是 fixed 全屏容器，
   一提层就会盖住顶部标语和登录框） */
/* 【11-26 修2】不要给 #pageLogin 的子元素统一设 position:relative，
   那会破坏 .top-alert-slogan / .login-bg-glow 原本的 absolute 定位，
   导致标语消失。只给登录框单独提层即可。 */
#loginMap { z-index: 0 !important; }
#pageLogin .login-frame { z-index: 2 !important; }
/* 【11-27 修】原来 z-index:3 把版本号压在登录面板下面，导致完全看不见。
   版本号在顶栏右上角独立区域，不遮挡登录框，提到面板之上即可。 */
.top-version { z-index: 70 !important; }

/* 登录页背景图改为半透明，露出下面的活地图（保留原有地图氛围） */
#pageLogin {
  background-color: transparent !important;
  background-image: linear-gradient(rgba(8,18,38,.18), rgba(8,18,38,.28)) !important;
}

/* ==========================================================================
   【11-26 六改】登录页背景的军车缩小（登录页只是氛围背景，不抢视野）
   规划页保持 88x54 不变，只有 #loginMap 里的车缩到 62%
   ========================================================================== */
#loginMap .convoy-car {
  width: 46px !important;
  height: 28px !important;
}
#loginMap .convoy-body svg {
  width: 46px !important;
  height: 28px !important;
}
#loginMap .convoy-glow {
  width: 38px !important;
  height: 18px !important;
  margin: -9px 0 0 -19px !important;
}
#loginMap .convoy-tag {
  font-size: 8px !important;
  line-height: 10px !important;
  padding: 0 3px !important;
  margin-top: 0 !important;
}
/* 登录页车标阴影收一点，避免"贴纸感" */
#loginMap .convoy-body {
  filter:
    drop-shadow(0 0 1.5px rgba(255,255,255,.9))
    drop-shadow(0 1px 2px rgba(0,0,0,.7)) !important;
}
/* 登录页光晕压淡，融合进底图 */
#loginMap .convoy-car .convoy-glow {
  opacity: .55 !important;
  filter: blur(2px) !important;
}
