/* ============================================================
   VulpeCat 灵猫司海 —— 控制台
   三栏：船队 / 海图 / 状态   +  底部工具栏
   ============================================================ */

.console-body {
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

/* 控制台背景压暗、停止位移，省 GPU 给地图和姿态球 */
.console-body .bg {
  animation: none;
  transform: none;
  filter: brightness(.55) saturate(.9);
}
.console-body .scrim {
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(8, 9, 14, .55), transparent 60%),
    linear-gradient(180deg, rgba(8, 9, 14, .78), rgba(8, 9, 14, .88));
}

/* ---------- 网格 ---------- */

.app {
  position: relative;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr) 340px;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "fleet map panel"
    "fleet toolbar panel";
  gap: 12px;
  height: 100vh;
  height: 100svh;
  padding: 12px;
  z-index: 1;
}

.app > .card {
  margin: 0;
  width: auto;
  contain: paint;
}

/* ---------- 船队 ---------- */

.fleetcard {
  grid-area: fleet;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 12px 10px;
  gap: 10px;
}

.fleet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}
.fleet-head b { font-size: 13px; letter-spacing: .08em; font-weight: 600; }
.fleet-head .count {
  margin-left: 2px;
  font-size: 11px;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.fleet-head .iconbtn { margin-left: auto; width: 30px; height: 30px; border-radius: 9px; }
.fleet-head .iconbtn svg { width: 15px; height: 15px; }

.brandmark { color: var(--sun); display: grid; place-items: center; }
.brandmark svg { width: 20px; height: 20px; }
.brandmark .usv-logo { width: 21px; height: 21px; }

.fleet-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
  min-height: 0;
  padding: 2px;
  scrollbar-width: thin;
}
.fleet-list::-webkit-scrollbar { width: 4px; }
.fleet-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 2px; }

.ship {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  grid-template-areas:
    "dot name batt"
    "dot meta meta";
  gap: 3px 8px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 13px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .04);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: all .16s var(--ease);
  position: relative;
}
.ship:hover { background: rgba(255, 255, 255, .085); }
.ship.on {
  border-color: color-mix(in srgb, var(--sun) 46%, transparent);
  background: color-mix(in srgb, var(--sun) 11%, rgba(255, 255, 255, .04));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sun) 22%, transparent),
              0 12px 28px -18px var(--glow);
}
.ship.on::before {
  content: "";
  position: absolute;
  left: 0; top: 14%; bottom: 14%;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--sun), var(--coral));
}

.ship .dot {
  grid-area: dot;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(245, 240, 236, .28);
  align-self: start;
  margin-top: 5px;
}
.ship .dot.on { background: var(--ok); box-shadow: 0 0 8px color-mix(in srgb, var(--ok) 70%, transparent); }
.ship .dot.lag { background: var(--warn); }
.ship .dot.off { background: rgba(255, 155, 155, .7); }
/* 样例船：空心点 = 没有真船连着 */
.ship .dot.sample { background: transparent; box-shadow: inset 0 0 0 1px rgba(245, 240, 236, .45); }
.ship.sample .spd { color: var(--ink-mute); letter-spacing: .02em; }

.ship .nm {
  grid-area: name;
  font-size: 13px;
  font-weight: 570;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ship .nm em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--ink-mute);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 1px 4px;
  margin-left: 5px;
  vertical-align: 1px;
}
.ship .nm em.sample { color: var(--sun); border-color: color-mix(in srgb, var(--sun) 34%, transparent); }

.ship .batt {
  grid-area: batt;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.ship .batt i {
  display: block;
  width: 26px; height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .12);
  position: relative;
  overflow: hidden;
}
.ship .batt i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--v, 0%);
  background: linear-gradient(90deg, var(--sun), var(--coral));
  border-radius: 2px;
}
.ship .batt.low i::after { background: linear-gradient(90deg, #ff9b9b, #e05a5a); }

.ship .meta {
  grid-area: meta;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  color: var(--ink-mute);
  white-space: nowrap;
  overflow: hidden;
}
.ship .meta .sig { display: inline-flex; gap: 1.5px; align-items: flex-end; height: 9px; }
.ship .meta .sig i {
  width: 2.5px;
  border-radius: 1px;
  background: rgba(255, 255, 255, .16);
}
.ship .meta .sig i.on { background: var(--sun); }
.ship .meta .sig i:nth-child(1) { height: 3px; }
.ship .meta .sig i:nth-child(2) { height: 5px; }
.ship .meta .sig i:nth-child(3) { height: 7px; }
.ship .meta .sig i:nth-child(4) { height: 9px; }

.ship .hdg {
  width: 12px; height: 12px;
  transform: rotate(var(--h, 0deg));
  transition: transform .4s linear;
  color: var(--sun);
  opacity: .85;
}
.ship .hdg svg { width: 100%; height: 100%; display: block; }

.fleet-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 6px 2px;
  border-top: 1px solid var(--line-soft);
  font-size: 10.5px;
  color: var(--ink-mute);
}
.fleet-foot .conn {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--warn);
}
.fleet-foot .conn.on { background: var(--ok); }
.fleet-foot .conn.off { background: var(--bad); }
.fleet-foot a {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--sun);
  font: inherit;
  font-size: 10.5px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  text-decoration: none;
}
.fleet-foot a:hover { background: rgba(255, 255, 255, .08); }

/* ---------- 海图 ---------- */

.mapcard {
  grid-area: map;
  position: relative;
  padding: 0;
  overflow: hidden;
  min-height: 0;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0a1219;
}

.leaflet-container {
  background: #0a1219;
  font-family: inherit;
  outline: none;
}
.leaflet-control-attribution {
  background: rgba(10, 14, 20, .62) !important;
  color: rgba(245, 240, 236, .5) !important;
  font-size: 9.5px !important;
  padding: 1px 6px !important;
  border-radius: 6px 0 0 0;
  backdrop-filter: blur(6px);
}
.leaflet-control-attribution a { color: rgba(245, 240, 236, .62) !important; }
.leaflet-bar a {
  background: rgba(18, 19, 26, .86) !important;
  color: var(--ink-dim) !important;
  border-color: var(--line-soft) !important;
}
.leaflet-bar a:hover { background: rgba(40, 42, 54, .95) !important; }

/* 卫星图偏亮，压一档让它和深色界面融在一起。
   用 opacity 让容器底色透上来，别用 filter —— 软件渲染下 filter 可能整片发黑 */
.leaflet-tile { opacity: .88 !important; }

/* 缩放控件让开左上角的底图角标 */
.leaflet-top.leaflet-left { top: 36px; }

.map-badge,
.map-hint {
  position: absolute;
  z-index: 500;
  font-size: 10.5px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(12, 14, 20, .7);
  border: 1px solid var(--line-soft);
  color: var(--ink-mute);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.map-badge { left: 10px; top: 10px; }
.map-hint { right: 10px; bottom: 22px; transition: opacity .3s; }
.map-hint.hide { opacity: 0; }

.map-legend {
  position: absolute;
  z-index: 500;
  left: 10px;
  bottom: 22px;
  display: flex;
  gap: 10px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(12, 14, 20, .7);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
  font-size: 10px;
  color: var(--ink-mute);
}
.map-legend span { display: inline-flex; align-items: center; gap: 4px; }
.map-legend i { width: 6px; height: 6px; border-radius: 50%; }

/* 船标 */

.shipmark {
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  transform: rotate(var(--h, 0deg)) scale(var(--s, 1));
  transform-origin: 50% 50%;
  transition: transform .45s linear, opacity .25s;
  opacity: .62;
  color: var(--sun);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .7));
}
.shipmark svg { width: 26px; height: 26px; display: block; }
.shipmark.sel {
  opacity: 1;
  --s: 1.12;
  color: var(--sun);
  filter: drop-shadow(0 0 9px var(--glow));
}
.shipmark.sel::after {
  content: "";
  position: absolute;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--sun) 45%, transparent);
  animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping {
  0%   { transform: scale(.62); opacity: .9; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}

.shipmark-wrap { background: none; border: 0; }

/* 目标点 / 航点 */

.wp {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #24101a;
  background: linear-gradient(155deg, var(--sun), var(--coral));
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .8);
  cursor: grab;
}
.wp.mid {
  width: 12px; height: 12px;
  font-size: 0;
  opacity: .55;
  background: rgba(255, 255, 255, .5);
  cursor: copy;
}
.wp.home {
  width: 18px; height: 18px;
  color: var(--sun);
  background: rgba(12, 14, 20, .82);
  border: 1px solid color-mix(in srgb, var(--sun) 55%, transparent);
  opacity: .8;
}
.wp.home svg { width: 11px; height: 11px; }
.wp.target {
  color: #24101a;
  animation: tgt 1.6s var(--ease) infinite;
}
.wp.target svg { width: 13px; height: 13px; }
@keyframes tgt {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sun) 55%, transparent); }
  50%      { box-shadow: 0 0 0 9px transparent; }
}

/* ---------- 状态面板 ---------- */

.panelcard {
  grid-area: panel;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 14px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.panelcard::-webkit-scrollbar { width: 4px; }
.panelcard::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 2px; }

.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.panel-head .ph-left { min-width: 0; flex: 1; }
.panel-head b {
  display: block;
  font-size: 15px;
  font-weight: 620;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-head span {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--ink-mute);
}

.badge {
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid var(--line-soft);
  color: var(--ink-mute);
  background: rgba(255, 255, 255, .04);
}
.badge.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.badge.lag { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.badge.off { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 34%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }

/* 姿态球 */

.ballbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px 0 0;
  position: relative;
}
#ball {
  width: 228px;
  height: 228px;
  display: block;
  flex: 0 0 auto;
}

.ball-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font-size: 9.5px;
  color: var(--ink-mute);
  margin-top: 2px;
}
.ball-legend span { display: inline-flex; align-items: center; gap: 4px; }
.ball-legend i { width: 7px; height: 3px; border-radius: 2px; }

/* 状态格 */

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.stat {
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .04);
  min-width: 0;
}
.stat .k {
  display: block;
  font-size: 9.5px;
  letter-spacing: .08em;
  color: rgba(245, 240, 236, .45);
  text-transform: uppercase;
}
.stat .v {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat .v small { font-family: inherit; font-size: 9.5px; color: var(--ink-mute); font-weight: 400; }
.stat.wide { grid-column: span 2; }
.stat.wide .v { font-size: 12.5px; }
.stat .v.bad { color: var(--bad); }
.stat .v.warn { color: var(--warn); }
.stat .v.ok { color: var(--ok); }
.stat .v .copy { cursor: pointer; }
.stat .sig { display: inline-flex; gap: 1.5px; align-items: flex-end; height: 11px; margin-right: 4px; }
.stat .sig i { width: 3px; border-radius: 1px; background: rgba(255, 255, 255, .16); }
.stat .sig i.on { background: var(--sun); }
.stat .sig i:nth-child(1) { height: 4px; }
.stat .sig i:nth-child(2) { height: 6px; }
.stat .sig i:nth-child(3) { height: 8px; }
.stat .sig i:nth-child(4) { height: 10px; }
.stat .sig i:nth-child(5) { height: 12px; }

/* 图传 */

.video {
  position: relative;
  margin-top: auto;
  border-radius: 13px;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, .32);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  flex: 0 0 auto;
}
.vstage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.vstage video,
.vstage img { width: 100%; height: 100%; object-fit: cover; display: block; }

.vempty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--ink-mute);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .016) 0 8px, transparent 8px 16px);
}
.vempty svg { width: 22px; height: 22px; opacity: .55; }
.vempty b { font-size: 12px; font-weight: 550; color: var(--ink-dim); }
.vempty span { font-size: 9.5px; letter-spacing: .02em; }

.vbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  font-size: 9.5px;
  color: var(--ink-mute);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .62));
  font-variant-numeric: tabular-nums;
}
.vbar .vdot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .3);
}
.video[data-state="live"] .vbar .vdot { background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.video[data-state="error"] .vbar .vdot { background: var(--bad); }
.vbar .spacer { flex: 1; }

/* ---------- 工具栏 ---------- */

.toolbar {
  grid-area: toolbar;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  min-height: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.toolbar::-webkit-scrollbar { display: none; }

.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .045);
  color: var(--ink-dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s var(--ease);
  white-space: nowrap;
}
.tool svg { width: 15px; height: 15px; }
.tool:hover:not(:disabled) { background: rgba(255, 255, 255, .1); color: var(--ink); }
.tool[aria-pressed="true"] {
  color: #24101a;
  background: linear-gradient(155deg, var(--sun), var(--coral));
  border-color: transparent;
  box-shadow: 0 8px 20px -12px var(--glow);
}
.tool:disabled { opacity: .38; cursor: not-allowed; }
.tool.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.tool.danger[aria-pressed="true"] { color: #fff; background: linear-gradient(155deg, #ff8080, #d94a4a); }

.tool-sep { width: 1px; height: 20px; background: var(--line-soft); flex: 0 0 auto; margin: 0 2px; }

.tool-status {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--ink-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 10px;
  flex: 1 1 auto;
  text-align: right;
}
.tool-status.ok { color: var(--ok); }
.tool-status.warn { color: var(--warn); }
.tool-status.bad { color: var(--bad); }

.route-actions {
  display: none;
  gap: 5px;
  flex: 0 0 auto;
}
.route-actions.on { display: flex; }
/* 航线编辑时按钮已经很多，状态文案让位，别把工具栏挤爆 */
.route-actions.on ~ .tool-status { display: none; }
.route-actions button {
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .06);
  color: var(--ink-dim);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.route-actions button:hover { background: rgba(255, 255, 255, .12); }
.route-actions button.go {
  color: #24101a;
  background: linear-gradient(155deg, var(--sun), var(--coral));
  border-color: transparent;
}

/* 急停长按进度 */

.tool.estop { position: relative; overflow: hidden; }
.tool.estop .hold {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: rgba(255, 107, 107, .35);
  transition: width .08s linear;
}

/* ---------- 加载层 ---------- */

#boot {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: #0b0d13;
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
#boot::before {
  content: "";
  position: absolute;
  inset: -20px;
  background-image: var(--bg-d);
  background-size: cover;
  background-position: 58% center;
  filter: blur(30px) brightness(.34) saturate(.9);
  opacity: .9;
}
#boot.done { opacity: 0; transform: scale(1.02); pointer-events: none; }

.boot-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(360px, calc(100vw - 56px));
}

.boot-ring {
  width: 104px;
  height: 104px;
  position: relative;
  margin-bottom: 10px;
  color: var(--sun);
}
.boot-ring svg { width: 100%; height: 100%; display: block; }
.boot-ring .usv-logo {
  position: absolute;
  left: 50%; top: 50%;
  width: 46px; height: 46px;
  transform: translate(-50%, -50%);
}
.boot-ring .spin { animation: spin 2.6s linear infinite; transform-origin: 50% 50%; }
.boot-ring .spin2 { animation: spin 1.7s linear infinite reverse; transform-origin: 50% 50%; }
@keyframes spin { to { transform: rotate(360deg); } }

.boot-title {
  font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  font-size: 20px;
  letter-spacing: .14em;
  font-weight: 600;
}
.boot-sub { font-size: 10.5px; letter-spacing: .22em; color: var(--ink-mute); text-transform: uppercase; }

.boot-steps {
  list-style: none;
  margin: 22px auto 0;
  padding: 0;
  width: 268px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.boot-steps li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: rgba(245, 240, 236, .34);
  transition: color .3s var(--ease);
}
.boot-steps li .tick {
  width: 14px; height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .2);
  display: grid;
  place-items: center;
  transition: all .3s var(--ease);
}
.boot-steps li .tick svg { width: 8px; height: 8px; opacity: 0; transition: opacity .2s; }
.boot-steps li.act { color: var(--ink); }
.boot-steps li.act .tick {
  border-color: color-mix(in srgb, var(--sun) 65%, transparent);
  animation: tickPulse 1.1s ease-in-out infinite;
}
.boot-steps li.done { color: var(--ink-dim); }
.boot-steps li.done .tick {
  background: linear-gradient(155deg, var(--sun), var(--coral));
  border-color: transparent;
}
.boot-steps li.done .tick svg { opacity: 1; color: #24101a; }
.boot-steps li.warn { color: var(--warn); }
.boot-steps li.warn .tick { border-color: color-mix(in srgb, var(--warn) 70%, transparent); }
.boot-steps li .note { margin-left: auto; font-size: 10.5px; color: var(--ink-mute); }
@keyframes tickPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sun) 45%, transparent); }
  50%      { box-shadow: 0 0 0 4px transparent; }
}

.boot-bar {
  margin: 18px auto 0;
  width: 268px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.boot-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--sun), var(--coral));
  transition: width .4s var(--ease);
}

.boot-tip {
  margin-top: 10px;
  font-size: 10px;
  color: rgba(245, 240, 236, .3);
  letter-spacing: .06em;
}

/* ---------- 离线横幅 ---------- */

.offline-bar {
  position: fixed;
  z-index: 50;
  left: 50%;
  top: 14px;
  transform: translate(-50%, -140%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent);
  background: rgba(30, 12, 14, .92);
  color: #ffd9d9;
  font-size: 11.5px;
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .9);
  transition: transform .34s var(--ease);
}
.offline-bar.on { transform: translate(-50%, 0); }
.offline-bar button {
  border: 1px solid rgba(255, 255, 255, .22);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 7px;
  cursor: pointer;
}

/* ---------- 手机抽屉 ---------- */

.sheet-handle { display: none; }

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1280px) {
  .app { grid-template-columns: 236px minmax(0, 1fr) 306px; }
  #ball { width: 200px; height: 200px; }
}

@media (max-width: 1080px) {
  .app { grid-template-columns: 210px minmax(0, 1fr) 280px; gap: 9px; padding: 9px; }
  .stats { grid-template-columns: 1fr; }
  .stat.wide { grid-column: span 1; }
  .video { aspect-ratio: 4 / 3; }
  .tool span.lbl { display: none; }
  .tool { padding: 0 10px; }
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 64px minmax(0, 1fr) 236px;
    gap: 8px;
  }
  .fleet-head b, .fleet-head .count { display: none; }
  .fleet-head { justify-content: center; }
  .ship {
    grid-template-columns: auto;
    grid-template-areas: "name" "batt";
    justify-items: center;
    padding: 8px 4px;
  }
  .ship .dot { display: none; }
  .ship .nm { font-size: 11px; text-align: center; }
  .ship .nm em, .ship .meta { display: none; }
  .ship .batt { justify-content: center; }
  .fleet-foot { justify-content: center; }
  .fleet-foot span { display: none; }
  .stats { grid-template-columns: 1fr; }
  #ball { width: 176px; height: 176px; }
}

@media (max-width: 760px) {
  .console-body { overflow: hidden; }

  .app {
    display: block;
    padding: 0;
    height: 100svh;
  }

  .mapcard {
    position: fixed;
    inset: 0;
    border-radius: 0;
    border: 0;
  }

  /* 船队 → 顶部胶囊条 */
  .fleetcard {
    position: fixed;
    z-index: 30;
    top: calc(8px + env(safe-area-inset-top));
    left: 8px;
    right: 8px;
    height: auto;
    padding: 7px;
    border-radius: 15px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    background: rgba(14, 16, 22, .76);
  }
  .fleet-foot { display: none; }
  /* 返回键留在胶囊条最左边，其余头部元素藏掉 —— 不然手机上就没路回去了 */
  .fleet-head {
    display: flex;
    flex: 0 0 auto;
    padding: 0;
    gap: 0;
  }
  .fleet-head .brandmark,
  .fleet-head b,
  .fleet-head .count { display: none; }
  .fleet-head .iconbtn {
    margin-left: 0;
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }
  .fleet-list {
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding: 0;
    scrollbar-width: none;
  }
  .fleet-list::-webkit-scrollbar { display: none; }
  .ship {
    grid-template-columns: 8px auto;
    grid-template-areas: "dot name";
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 10px;
  }
  .ship .dot { display: block; margin-top: 0; align-self: center; }
  .ship .batt, .ship .meta { display: none; }
  .ship .nm { font-size: 11.5px; }
  .ship.on::before { display: none; }

  /* 工具栏 → 抽屉上方横条 */
  .toolbar {
    position: fixed;
    z-index: 26;
    left: 8px;
    right: 8px;
    bottom: calc(64px + env(safe-area-inset-bottom));
    border-radius: 14px;
    padding: 7px 8px;
    background: rgba(14, 16, 22, .82);
    transition: transform .3s var(--ease), opacity .3s var(--ease);
  }
  body.sheet-up .toolbar { opacity: 0; pointer-events: none; transform: translateY(10px); }
  .tool-status { display: none; }

  /* 状态面板 → 底部抽屉 */
  .panelcard {
    position: fixed;
    z-index: 28;
    left: 0; right: 0; bottom: 0;
    height: 62svh;
    border-radius: 20px 20px 0 0;
    padding: 0 14px calc(14px + env(safe-area-inset-bottom));
    transform: translateY(calc(100% - 60px));
    transition: transform .32s var(--ease);
    background: rgba(16, 17, 24, .94);
    border-bottom: 0;
  }
  .panelcard.up { transform: none; }

  .sheet-handle {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 60px;
    position: sticky;
    top: 0;
    margin: 0 -14px 8px;
    padding: 0 16px;
    background: rgba(16, 17, 24, .96);
    border-bottom: 1px solid var(--line-soft);
    border-radius: 20px 20px 0 0;
    cursor: pointer;
    z-index: 2;
  }
  .sheet-handle .grip {
    position: absolute;
    top: 7px; left: 50%;
    transform: translateX(-50%);
    width: 34px; height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .2);
  }
  .sheet-handle b { font-size: 13.5px; font-weight: 600; }
  .sheet-handle .meta { font-size: 10.5px; color: var(--ink-mute); }
  .sheet-handle svg { margin-left: auto; width: 16px; height: 16px; color: var(--ink-mute); transition: transform .3s var(--ease); }
  .panelcard.up .sheet-handle svg { transform: rotate(180deg); }

  .panel-head { display: none; }
  #ball { width: 190px; height: 190px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat.wide { grid-column: span 2; }
  .video { aspect-ratio: 16 / 9; }

  .map-badge { top: auto; bottom: calc(128px + env(safe-area-inset-bottom)); left: 8px; }
  .map-hint, .map-legend { display: none; }
  .leaflet-control-zoom { display: none; }   /* 手机上双指缩放就够 */
}

@media (max-width: 760px) and (max-height: 560px) {
  .panelcard { height: 82svh; }
}
