/* ============================================================
   ChinaVA 航空目视化动态大屏  dashboard.css
   配套资源：Web/js/dashboard.js  Web/images/*
   主题：深空科技蓝 · 三栏大屏
   ============================================================ */

:root {
  --bg: #050e1e;
  --panel: rgba(8, 24, 50, .58);
  --panel-solid: rgba(7, 21, 45, .92);
  --panel-border: rgba(0, 190, 255, .22);
  --accent: #00d4ff;
  --accent-2: #2f7bff;
  --text: #d8ecff;
  --muted: #7fa8d0;
  --amber: #ffb020;
  --green: #2ee6a8;
  --red: #ff5b7a;
  --violet: #8f6bff;
  --header-h: 84px;
  --footer-h: 54px;
  --side-w: 384px;
  --gap: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { width: 100%; height: 100%; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  background: #050e1e;
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 整体画布 ---------- */
.screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: url("../images/bg.png") center / cover no-repeat, var(--bg);
  display: grid;
  grid-template-rows: var(--header-h) 1fr var(--footer-h);
  overflow: hidden;
}

/* 顶部横向扫描光线 */
.screen::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 212, 255, .05), transparent 18%);
  z-index: 0;
}

/* ============================================================
   头部
   ============================================================ */
.header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background: linear-gradient(180deg, rgba(6, 18, 40, .85), rgba(6, 18, 40, .25));
  border-bottom: 1px solid rgba(0, 190, 255, .25);
}
.header::after {
  content: "";
  position: absolute;
  left: 8%; right: 8%; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  filter: drop-shadow(0 0 6px rgba(0, 212, 255, .9));
}

.header-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.header-brand .logo { height: 46px; display: block; filter: drop-shadow(0 0 8px rgba(0, 190, 255, .45)); }
.header-brand .brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.header-brand .brand-cn { font-size: 21px; font-weight: 800; letter-spacing: 3px; color: #eef8ff; }
.header-brand .brand-en { font-size: 11px; letter-spacing: 4px; color: var(--muted); text-transform: uppercase; }

.header-title {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  white-space: nowrap;
}
.header-title .t1 {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 10px;
  background: linear-gradient(180deg, #ffffff 20%, #9fe8ff 60%, #3fa9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(0, 150, 255, .45));
}
.header-title .t2 {
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: 8px;
  color: var(--accent);
  opacity: .9;
}

.header-clock { text-align: right; min-width: 190px; }
.header-clock .time {
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #eaf6ff;
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(0, 190, 255, .6);
  line-height: 1;
}
.header-clock .date { margin-top: 5px; font-size: 13px; color: var(--muted); letter-spacing: 2px; }
.header-clock .date b { color: var(--accent); font-weight: 600; }

/* ============================================================
   主体三栏
   ============================================================ */
.main {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: var(--side-w) 1fr var(--side-w);
  grid-template-rows: minmax(0, 1fr);
  gap: var(--gap);
  padding: var(--gap);
  min-height: 0;
  overflow: hidden;
}
.col { display: flex; flex-direction: column; gap: var(--gap); min-height: 0; overflow: hidden; }
.col-center { min-width: 0; }

/* ---------- 面板通用 ---------- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 14px 16px 16px;
  backdrop-filter: blur(4px);
  box-shadow: inset 0 0 30px rgba(0, 120, 255, .06);
  overflow: hidden;
}
/* 四角括号装饰 */
.panel::before, .panel::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--accent);
  border-style: solid;
  opacity: .9;
}
.panel::before { left: -1px; top: -1px; border-width: 2px 0 0 2px; }
.panel::after { right: -1px; bottom: -1px; border-width: 0 2px 2px 0; }

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #dff2ff;
  position: relative;
}
.panel-title::before {
  content: "";
  width: 5px; height: 16px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(0, 212, 255, .8);
}
.panel-title .sub { font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: 1px; margin-left: auto; }

.panel-body { position: relative; min-height: 0; }

/* 占位/空状态 */
.empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; min-height: 90px;
  color: var(--muted); font-size: 13px; letter-spacing: 1px;
  text-align: center;
}
.empty .dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite; }
@keyframes blink { 0%,100% { opacity: .2; } 50% { opacity: 1; } }

/* ============================================================
   左侧：KPI 指标
   ============================================================ */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi {
  position: relative;
  padding: 14px 14px 12px;
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(0, 190, 255, .10), rgba(8, 26, 55, .35));
  border: 1px solid rgba(0, 190, 255, .16);
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute; right: -18px; bottom: -18px;
  width: 60px; height: 60px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 255, .22), transparent 70%);
}
.kpi .k-label { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.kpi .k-value {
  margin-top: 6px;
  font-size: 30px; font-weight: 800; line-height: 1;
  color: #eaf6ff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(0, 190, 255, .35);
}
.kpi .k-value .unit { font-size: 13px; font-weight: 500; color: var(--accent); margin-left: 4px; }
.kpi .k-foot { margin-top: 6px; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.kpi .k-foot .pill { padding: 1px 7px; border-radius: 9px; font-size: 10px; }
.pill.up { color: var(--green); background: rgba(46, 230, 168, .12); }
.pill.warn { color: var(--amber); background: rgba(255, 176, 32, .12); }
.pill.off { color: var(--red); background: rgba(255, 91, 122, .12); }

/* ============================================================
   环形图（SVG donut）
   ============================================================ */
.donut-wrap { display: flex; align-items: center; gap: 14px; }
.donut-box { position: relative; width: 148px; height: 148px; flex: 0 0 148px; }
.donut-box svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-center .n { font-size: 26px; font-weight: 800; color: #eaf6ff; }
.donut-center .t { font-size: 11px; color: var(--muted); margin-top: 2px; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.donut-legend .lg { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.donut-legend .lg .sw { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.donut-legend .lg .nm { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-legend .lg .vl { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.donut-legend .lg .pc { width: 40px; text-align: right; color: var(--accent); font-variant-numeric: tabular-nums; }

/* ============================================================
   水平条形图
   ============================================================ */
.hbar-list { display: flex; flex-direction: column; gap: 12px; }
.hbar .h-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.hbar .h-name { width: 120px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .h-val { margin-left: auto; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar .h-track { margin-top: 5px; height: 8px; border-radius: 5px; background: rgba(0, 190, 255, .10); overflow: hidden; }
.hbar .h-fill {
  height: 100%; width: 0;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 10px rgba(0, 212, 255, .5);
  transition: width .8s cubic-bezier(.2,.8,.2,1);
}
.hbar .h-fill.warn { background: linear-gradient(90deg, #ff7b3a, var(--amber)); box-shadow: 0 0 10px rgba(255,176,32,.5); }
.hbar .h-fill.green { background: linear-gradient(90deg, #17b890, var(--green)); box-shadow: 0 0 10px rgba(46,230,168,.5); }
.hbar .h-fill.violet { background: linear-gradient(90deg, #6a4bff, var(--violet)); box-shadow: 0 0 10px rgba(143,107,255,.5); }

/* ============================================================
   实时动态日志
   ============================================================ */
.log-list { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.log-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px;
  font-size: 12px;
  border-bottom: 1px dashed rgba(0, 190, 255, .10);
  animation: slideIn .4s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.log-item .t { color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-item .tag { flex: 0 0 auto; padding: 1px 6px; border-radius: 4px; font-size: 10px; }
.log-item .msg { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag.up { color: var(--green); background: rgba(46,230,168,.12); }
.tag.phase { color: var(--accent); background: rgba(0,212,255,.12); }
.tag.down { color: var(--red); background: rgba(255,91,122,.12); }

/* ============================================================
   底部操作按钮（登录 / 注册 / 平台）
   ============================================================ */
.action-bar { display: flex; gap: 10px; flex: 0 0 auto; }
.act-btn {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border-radius: 6px;
  border: 1px solid rgba(0,190,255,.3);
  background: linear-gradient(160deg, rgba(0,190,255,.10), rgba(8,26,55,.4));
  color: #dff2ff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 3px;
  text-decoration: none;
  transition: all .2s ease;
  user-select: none;
}
.act-btn:hover { background: rgba(0,190,255,.22); color: #fff; box-shadow: 0 0 12px rgba(0,212,255,.4); }
.act-btn.primary {
  background: linear-gradient(160deg, var(--accent), #2f9bff);
  color: #051020;
  border-color: transparent;
  box-shadow: 0 0 14px rgba(0,190,255,.35);
}
.act-btn.primary:hover { filter: brightness(1.12); color: #051020; }

/* ============================================================
   中央地图
   ============================================================ */
.map-panel { padding: 14px 14px 12px; display: flex; flex-direction: column; }
.map-panel .panel-body { flex: 1; min-height: 0; position: relative; border-radius: 6px; overflow: hidden; border: 1px solid rgba(0,190,255,.14); }
#map { position: absolute; inset: 0; background: #071733; }

.map-stat {
  position: absolute; left: 12px; top: 12px; z-index: 500;
  display: flex; gap: 10px;
}
.map-stat .chip {
  padding: 5px 10px; border-radius: 6px;
  background: rgba(8,24,50,.78);
  border: 1px solid rgba(0,190,255,.25);
  font-size: 12px; color: var(--text);
  backdrop-filter: blur(3px);
}
.map-stat .chip b { color: var(--accent); }

.map-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 500;
  display: flex; gap: 12px; align-items: center;
  padding: 6px 12px; border-radius: 6px;
  background: rgba(8,24,50,.78);
  border: 1px solid rgba(0,190,255,.25);
  font-size: 11px; color: var(--muted);
}
.map-legend .lg { display: flex; align-items: center; gap: 6px; }
.map-legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.sw.fly { background: var(--accent); }
.sw.dep { background: var(--green); }
.sw.arr { background: var(--amber); }

.map-overlay-msg {
  position: absolute; inset: 0; z-index: 600;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px;
  background: rgba(5,14,30,.72);
  color: var(--muted); font-size: 14px; letter-spacing: 2px;
  text-align: center;
}
.map-overlay-msg .big { font-size: 18px; color: #cfeaff; }
.map-overlay-msg.hidden { display: none; }
.map-overlay-msg .retry { margin-top: 6px; padding: 6px 18px; border: 1px solid rgba(0,190,255,.4); border-radius: 6px; background: rgba(0,190,255,.12); color: var(--accent); cursor: pointer; font-size: 13px; }
.map-overlay-msg .retry:hover { background: rgba(0,190,255,.24); }

/* 顶部提示条（演示模式 / 状态提示） */
.map-toast {
  position: absolute; left: 50%; top: 12px; transform: translate(-50%, -18px);
  z-index: 620;
  padding: 7px 18px; border-radius: 6px;
  background: rgba(7,21,45,.92);
  border: 1px solid rgba(255,176,32,.5);
  color: var(--amber); font-size: 12px; letter-spacing: 1px;
  opacity: 0; pointer-events: none;
  transition: opacity .4s, transform .4s;
  box-shadow: 0 0 18px rgba(255,176,32,.2);
}
.map-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 飞行标记 */
.fly-marker { position: relative; width: 0; height: 0; }
.fly-marker .plane {
  position: absolute; left: -17px; top: -17px;
  width: 34px; height: 34px;
  filter: drop-shadow(0 0 6px rgba(0,212,255,.9));
}
.fly-marker .callsign {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  padding: 1px 7px; border-radius: 4px;
  background: rgba(6,20,42,.85);
  border: 1px solid rgba(0,212,255,.5);
  color: #dff4ff; font-size: 11px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 0 8px rgba(0,212,255,.3);
}
.apt-marker { position: relative; width: 0; height: 0; }
.apt-marker .pin {
  position: absolute; left: -11px; top: -22px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  font-size: 10px; font-weight: 700; color: #051020;
}
.apt-marker .pin span { transform: rotate(45deg); }
.apt-marker .pin.dep { background: var(--green); box-shadow: 0 0 8px rgba(46,230,168,.8); }
.apt-marker .pin.arr { background: var(--amber); box-shadow: 0 0 8px rgba(255,176,32,.8); }
.apt-marker .name {
  position: absolute; left: 50%; top: 2px; transform: translateX(-50%);
  font-size: 10px; color: var(--muted); white-space: nowrap;
  background: rgba(6,20,42,.7); padding: 0 5px; border-radius: 3px;
}

/* Leaflet 暗色控件 */
.leaflet-container { font-family: inherit; background: #071733; }
/* 标准 OSM 瓦片反色为暗色科技风（无需外部暗色 CDN，国内稳定） */
.leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(.72) contrast(.92) saturate(.6);
}
.leaflet-bar { border: 1px solid rgba(0,190,255,.35) !important; box-shadow: none !important; }
.leaflet-bar a {
  background: rgba(8,24,50,.85) !important;
  color: var(--accent) !important;
  border-bottom: 1px solid rgba(0,190,255,.2) !important;
}
.leaflet-bar a:hover { background: rgba(0,190,255,.22) !important; }
.leaflet-control-attribution {
  background: rgba(6,18,40,.6) !important;
  color: var(--muted) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--accent) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: rgba(7,21,45,.95) !important;
  color: var(--text) !important;
  border: 1px solid rgba(0,190,255,.35);
  box-shadow: 0 0 20px rgba(0,190,255,.25) !important;
}
.leaflet-popup-content { margin: 10px 14px !important; }
.fly-popup { font-size: 12px; line-height: 1.8; }
.fly-popup .fp-title { font-size: 14px; font-weight: 700; color: #dff4ff; margin-bottom: 4px; }
.fly-popup .row { display: flex; gap: 6px; }
.fly-popup .row .k { color: var(--muted); white-space: nowrap; }
.fly-popup .row .v { color: var(--text); }
.fly-popup .row .v.cy { color: var(--accent); }

/* ============================================================
   底部跑马灯
   ============================================================ */
.footer {
  position: relative; z-index: 5;
  display: flex; align-items: center;
  background: linear-gradient(0deg, rgba(6,18,40,.85), rgba(6,18,40,.3));
  border-top: 1px solid rgba(0,190,255,.25);
  overflow: hidden;
}
.footer::before {
  content: "";
  position: absolute; left: 8%; right: 8%; top: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  filter: drop-shadow(0 0 6px rgba(0,120,255,.8));
}
.footer .foot-label {
  flex: 0 0 auto;
  padding: 0 18px;
  height: 100%;
  display: flex; align-items: center;
  font-size: 13px; font-weight: 700; letter-spacing: 2px;
  color: #051020;
  background: linear-gradient(90deg, var(--accent), #6fe0ff);
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
}
.ticker-wrap { flex: 1; overflow: hidden; position: relative; height: 100%; }
.ticker-track { display: inline-flex; align-items: center; height: 100%; white-space: nowrap; animation: marquee 38s linear infinite; will-change: transform; }
.ticker-wrap:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 8px; padding: 0 22px; font-size: 13px; }
.ticker-item .cs { color: #eaf6ff; font-weight: 700; }
.ticker-item .meta { color: var(--muted); }
.ticker-item .meta b { color: var(--accent); }
.ticker-item .sep { color: var(--accent); }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ============================================================
   滚动条
   ============================================================ */
.scrollable { overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(0,190,255,.4) transparent; }
.scrollable::-webkit-scrollbar { width: 5px; }
.scrollable::-webkit-scrollbar-thumb { background: rgba(0,190,255,.35); border-radius: 4px; }
.scrollable::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1500px) {
  :root { --side-w: 340px; }
  .header-title .t1 { font-size: 26px; letter-spacing: 7px; }
  .header-clock .time { font-size: 25px; }
}
@media (max-width: 1200px) {
  :root { --side-w: 300px; }
  .header-brand .brand-cn { font-size: 17px; }
  .header-title .t1 { font-size: 22px; letter-spacing: 4px; }
  .header-clock { min-width: 140px; }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 980px) {
  .main { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; overflow-y: auto; }
  .screen { grid-template-rows: var(--header-h) 1fr var(--footer-h); }
  .col { overflow: visible; }
  .header-title { position: static; transform: none; }
  .header { gap: 10px; }
}
