:root {
  --bg: #060a14;
  --bg2: #0a1124;
  --panel: rgba(16, 26, 50, 0.62);
  --panel-brd: rgba(0, 229, 255, 0.22);
  --cyan: #00e5ff;
  --blue: #2b6cff;
  --green: #00ffa3;
  --red: #ff4d6d;
  --amber: #ffb020;
  --purple: #7c4dff;
  --text: #d6e6ff;
  --muted: #7e93b8;
  --glow: 0 0 18px rgba(0, 229, 255, 0.25);
  --font-cn: 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  --topbar-h: 76px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Rajdhani', 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  background: radial-gradient(1200px 700px at 80% -10%, rgba(43, 108, 255, 0.18), transparent 60%),
              radial-gradient(900px 600px at 0% 110%, rgba(0, 229, 255, 0.14), transparent 55%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-screen {
  position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.login-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(0, 229, 255, 0.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0, 229, 255, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 75%);
}
.login-card {
  position: relative; z-index: 2; width: 460px; max-width: 92vw;
  background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 18px;
  padding: 38px 34px; backdrop-filter: blur(14px); box-shadow: var(--glow), 0 20px 60px rgba(0,0,0,.5);
}
.login-logo { display: flex; align-items: center; gap: 14px; }
.logo-mark {
  width: 54px; height: 54px; display: grid; place-items: center;
  font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 28px; color: #04121f;
  background: linear-gradient(135deg, var(--cyan), var(--blue)); border-radius: 14px;
  box-shadow: 0 0 22px rgba(0,229,255,.55);
}
.logo-mark.sm { width: 34px; height: 34px; font-size: 18px; border-radius: 9px; }
.sys-title { font-family: var(--font-cn); font-weight: 900; letter-spacing: 2px; font-size: 24px; }
.sys-title.sm { font-size: 17px; letter-spacing: 1px; }
.sys-sub { color: var(--muted); font-size: 12px; letter-spacing: 3px; }
.login-tip { color: var(--muted); font-size: 14px; margin: 22px 0 12px; }
.login-foot { color: var(--muted); font-size: 12px; margin-top: 22px; text-align: center; letter-spacing: 1px; }

.account-list { display: flex; flex-direction: column; gap: 10px; }
.account-btn {
  text-align: left; padding: 13px 16px; border-radius: 11px; cursor: pointer;
  background: rgba(0, 229, 255, 0.06); border: 1px solid rgba(0, 229, 255, 0.2);
  color: var(--text); transition: .18s; font-family: inherit; font-size: 15px;
}
.account-btn:hover { background: rgba(0, 229, 255, 0.16); border-color: var(--cyan); box-shadow: var(--glow); transform: translateY(-1px); }
.account-btn b { color: var(--cyan); }
.account-btn .role { float: right; color: var(--muted); font-size: 13px; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 10; overflow: hidden;
  background:
    repeating-linear-gradient(115deg, rgba(60,140,220,.045) 0 2px, rgba(0,0,0,0) 2px 27px),
    radial-gradient(60% 120% at 50% 120%, rgba(0,229,255,.12), transparent 70%),
    linear-gradient(180deg, #08152c, #05101f);
  box-shadow: 0 8px 26px rgba(0,0,0,.6);
}
/* 顶/底发光细线 */
.tb-edge { position: absolute; left: 0; right: 0; height: 1px; pointer-events: none; z-index: 3; }
.tb-edge.top {
  top: 0;
  background: linear-gradient(90deg, rgba(180,230,255,.08), rgba(224,246,255,.95) 50%, rgba(180,230,255,.08));
  box-shadow: 0 0 8px rgba(180,230,255,.55);
}
.tb-edge.bot {
  bottom: 0;
  background: linear-gradient(90deg, rgba(0,200,255,.06), rgba(96,228,255,.92) 50%, rgba(0,200,255,.06));
  box-shadow: 0 0 9px rgba(0,229,255,.6);
}
.topbar-left { position: relative; z-index: 3; display: flex; align-items: center; gap: 8px; }
.topbar-right { position: relative; z-index: 3; display: flex; align-items: center; gap: 12px; }

/* 走线装饰（节点 + 斜引线） */
.tb-trace { width: 58px; height: 40px; opacity: .8; }
.tb-trace.flip { transform: scaleX(-1); }
.tb-trace .trace-line { stroke: rgba(120,200,255,.55); stroke-width: 1; }
.tb-trace .trace-line.diag { stroke: rgba(120,200,255,.35); }
.tb-trace .trace-node { fill: #cfeeff; filter: drop-shadow(0 0 4px rgba(120,210,255,.9)); }

/* 顶栏左侧：北京时间（单行，参考数据大屏） */
.bj-time {
  display: flex; align-items: baseline; gap: 9px;
  font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif; font-size: 15px; letter-spacing: 1px;
  color: #dcefff; white-space: nowrap; text-shadow: 0 0 10px rgba(120,200,255,.45);
}
.bj-time .bj-date { color: #7ff0ff; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(0,229,255,.75), 0 0 4px rgba(0,229,255,.5); }
.bj-time .bj-week { color: #9fc4e8; font-size: 14px; }
.bj-time .bj-clock {
  font-family: Arial, 'Microsoft YaHei', 'SimHei', sans-serif; font-weight: 700; font-size: 17px;
  color: #eaf7ff; letter-spacing: 1.5px; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(0,229,255,.6);
}

/* 顶栏右侧：圆形图标按钮（同心圆发光） */
.round-btn {
  width: 38px; height: 38px; flex: none; padding: 0; border: none; background: transparent;
  cursor: pointer; border-radius: 50%; pointer-events: auto;
  filter: drop-shadow(0 0 8px rgba(0,229,255,.45)); transition: filter .2s, transform .2s;
}
.round-btn svg { display: block; width: 100%; height: 100%; }
.round-btn:hover { filter: drop-shadow(0 0 15px rgba(0,229,255,.95)); transform: scale(1.07); }
.round-btn:active { transform: scale(.96); }
.org-badge {
  font-family: 'Orbitron', sans-serif; padding: 5px 12px; border-radius: 8px; font-size: 13px;
  background: linear-gradient(135deg, rgba(0,229,255,.18), rgba(43,108,255,.18));
  border: 1px solid var(--panel-brd); color: var(--cyan);
}
.org-tags { display: flex; gap: 6px; }
.tag {
  font-size: 12px; padding: 3px 9px; border-radius: 20px; color: var(--amber);
  border: 1px solid rgba(255,176,32,.4); background: rgba(255,176,32,.08);
}
.btn-ghost {
  padding: 6px 14px; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 14px;
  background: transparent; border: 1px solid rgba(126,147,184,.35); color: var(--muted); transition: .15s;
}
.btn-ghost:hover { color: var(--red); border-color: var(--red); }

/* ---------- 顶部标题（倒梯形科技背景，居中；收敛动态，让出两侧不挡时间） ---------- */
.app-title {
  position: absolute; left: 0; top: 0; width: 100%; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: center; z-index: 2; pointer-events: none;
}
.title-frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 1; }
.tf-body { } /* 填充由内联 url(#tfFill)/#tfGrid/#tfCore 决定 */
.tf-stroke { fill: none; }
.tf-stroke-outer {
  stroke: url(#tfEdge); stroke-width: 2.2; vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 6px rgba(0,229,255,.6));
  stroke-dasharray: 30 18; animation: tfFlow 6s linear infinite;
}
.tf-stroke-inner { stroke: #36e6ff; stroke-opacity: .45; stroke-width: 1; vector-effect: non-scaling-stroke; }
.tf-topline { stroke: #dff6ff; stroke-width: 1.5; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px rgba(180,240,255,.85)); }
.tf-ticks line { stroke: #5fd8ff; stroke-opacity: .45; stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.tf-arrow { fill: #8ff2ff; fill-opacity: .75; filter: drop-shadow(0 0 4px rgba(0,229,255,.7)); }
.tf-core { stroke: #8ff2ff; stroke-width: 2.2; vector-effect: non-scaling-stroke; opacity: .7; filter: drop-shadow(0 0 6px rgba(0,229,255,.8)); }
.tf-nodes circle { fill: #c7f6ff; filter: drop-shadow(0 0 5px rgba(0,229,255,.9)); transform-box: fill-box; transform-origin: center; animation: tfPulse 3.6s ease-in-out infinite; }
.tf-nodes circle:nth-child(2){animation-delay:.5s} .tf-nodes circle:nth-child(3){animation-delay:1s}
.tf-nodes circle:nth-child(4){animation-delay:1.5s} .tf-nodes circle:nth-child(5){animation-delay:2s}
.tf-nodes circle:nth-child(6){animation-delay:2.5s}
@keyframes tfPulse { 0%,100%{opacity:.55; transform:scale(.85)} 50%{opacity:1; transform:scale(1.12)} }
@keyframes tfFlow { to { stroke-dashoffset: -48; } }

/* 标题聚光晕（静态柔光，聚焦视线） */
.title-spot {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 380px; height: 100px; border-radius: 50%; z-index: 1; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(0,229,255,.2), rgba(0,229,255,.07) 46%, transparent 72%);
  filter: blur(2px);
}
/* 标题文字牌：玻璃底板 + 居中，静态发光 */
.title-inner {
  position: relative; z-index: 3; font-family: var(--font-cn); font-weight: 900;
  letter-spacing: 5px; font-size: 28px; line-height: 1; white-space: nowrap; color: #ffffff;
  padding: 10px 40px 12px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(11,36,72,.72), rgba(6,18,40,.82));
  border: 1px solid rgba(135,232,255,.6);
  box-shadow: 0 0 22px rgba(0,229,255,.45), inset 0 0 26px rgba(0,229,255,.16), 0 0 0 4px rgba(0,42,72,.3);
  text-shadow: 0 0 10px rgba(0,229,255,.9), 0 0 22px rgba(0,229,255,.5), 0 1px 2px rgba(0,12,30,.9);
}
.title-inner .region-part { color: #b6f2ff; text-shadow: 0 0 12px rgba(0,229,255,.95), 0 1px 2px rgba(0,12,30,.7); }
.title-inner .title-sep { color: #d6ecff; margin: 0 5px; }
.title-inner .title-part { color: #ffffff; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.sidebar {
  width: 200px; padding: 18px 12px; border-right: 1px solid var(--panel-brd);
  background: rgba(8, 14, 30, 0.5); display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.nav-item {
  padding: 12px 14px; border-radius: 10px; cursor: pointer; color: var(--muted); font-size: 15px;
  border: 1px solid transparent; transition: .15s; display: flex; align-items: center; justify-content: flex-start; gap: 11px;
}
.nav-ico { width: 19px; height: 19px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: inherit; }
.nav-ico svg { width: 100%; height: 100%; display: block; }
.nav-label { line-height: 1; }
.nav-item:hover { color: var(--text); background: rgba(0,229,255,.06); }
.nav-item.active { color: var(--cyan); background: rgba(0,229,255,.12); border-color: var(--panel-brd); }
/* 侧栏操作按钮与导航项（系统设置）风格一致 */
.nav-btn { width: 100%; text-align: left; font-family: inherit; font-size: 15px; font-weight: 400; background: transparent; border: 1px solid transparent; }
.nav-btn:hover { color: var(--text); background: rgba(0,229,255,.06); }
.nav-item.danger:hover { color: var(--red); background: rgba(255,77,109,.08); border-color: rgba(255,77,109,.4); }
.tag-soon { font-size: 11px; color: var(--purple); border: 1px solid rgba(124,77,255,.4); border-radius: 10px; padding: 1px 6px; }
.sidebar-foot { margin-top: auto; color: var(--muted); font-size: 12px; padding: 10px 14px; }
.sidebar-spacer { height: 14px; margin-top: auto; }
.user-card {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: rgba(0,229,255,.06); border: 1px solid rgba(0,229,255,.22);
}
.user-name { font-family: 'Orbitron', sans-serif; font-size: 15px; color: var(--cyan); font-weight: 700; }
.user-org { font-size: 12px; color: var(--muted); margin-top: 3px; }
.user-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.side-btn {
  margin-top: 8px; padding: 9px 14px; border-radius: 9px; cursor: pointer; font-family: inherit; font-size: 14px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(126,147,184,.3); color: var(--text); transition: .15s; text-align: left;
}
.side-btn:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(0,229,255,.08); box-shadow: var(--glow); }
.side-btn.danger:hover { border-color: var(--red); color: var(--red); background: rgba(255,77,109,.08); box-shadow: none; }
.region-tip { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 0; }

.content { flex: 1; overflow: hidden; }

/* ===== 数据看板：整屏自适应，无需滚动 ===== */
#view-dashboard {
  height: calc(100vh - var(--topbar-h));
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px 20px; overflow: hidden;
}
#view-devices, #view-alerts {
  height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 22px 26px;
}

/* ---------- KPI ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin-bottom: 0; }
.kpi-card {
  position: relative; padding: 10px 12px; border-radius: 12px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--panel-brd); backdrop-filter: blur(8px);
}
.kpi-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan);
}
.kpi-card.warn::before { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.kpi-card.danger::before { background: var(--red); box-shadow: 0 0 12px var(--red); }
.kpi-card.good::before { background: var(--green); box-shadow: 0 0 12px var(--green); }
.kpi-label { color: var(--muted); font-size: 13px; letter-spacing: 1px; }
.kpi-value { font-family: Arial, 'Helvetica Neue', 'Microsoft YaHei', 'SimHei', sans-serif; font-size: 34px; font-weight: 700; margin-top: 4px; color: #fff; text-shadow: 0 0 16px rgba(0, 229, 255, 0.4); font-variant-numeric: tabular-nums; }

/* 地图面板 */
#view-dashboard .map-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-top: 0; }
.map-panel .panel-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.device-map {
  flex: 1 1 auto; min-height: 160px; position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--panel-brd);
  background-color: #04101e;
  /* 底图未加载时也有"地图感"的网格底纹 */
  background-image: linear-gradient(rgba(0, 229, 255, .07) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0, 229, 255, .07) 1px, transparent 1px);
  background-size: 40px 40px;
}
/* 写实地图：保留高德瓦片真实配色（绿底蓝水），仅轻微增强对比 */
.device-map .maplibregl-canvas { filter: saturate(1.08) contrast(1.02); }
.device-map .maplibregl-ctrl-bottom-right { z-index: 5; }
.device-map .maplibregl-ctrl-attrib { background: rgba(4, 16, 30, .7); color: #7e93b8; }
.device-map .maplibregl-ctrl-attrib a { color: #9fb3d6; }
.device-map .maplibregl-ctrl-group { background: rgba(10, 17, 36, .9); border: 1px solid var(--panel-brd); }
.device-map .maplibregl-ctrl-group button { background: rgba(10, 17, 36, .9); color: var(--cyan); }
.device-map .maplibregl-ctrl-group button + button { border-top: 1px solid var(--panel-brd); }
.device-map .maplibregl-ctrl button:hover { background: rgba(0, 229, 255, .18); }
/* 写实地图叠加层：仅底部微弱压暗增强纵深感，不再覆盖青色网格 */
.map-fx {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(130% 90% at 50% 120%, rgba(0,0,0,.18), transparent 60%);
}
.map-compass {
  position: absolute; top: 10px; left: 12px; z-index: 3; pointer-events: none;
  font-family: 'Rajdhani', sans-serif; font-size: 12px; letter-spacing: 2px; color: var(--cyan);
  padding: 4px 10px; border: 1px solid var(--panel-brd); border-radius: 20px;
  background: rgba(4, 16, 30, .55); text-shadow: 0 0 8px rgba(0, 229, 255, .6);
}
.map-fallback { margin-top: 8px; font-size: 12px; color: var(--amber); letter-spacing: .5px; }
.map-legend { font-size: 12px; color: var(--muted); display: flex; gap: 14px; align-items: center; }
.map-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.map-legend .dot.online { background: #00ffa3; }
.map-legend .dot.lowBattery { background: #ffb020; }
.map-legend .dot.offline { background: #7e93b8; }
.map-legend .dot.alert { background: #ff4d6d; box-shadow: 0 0 8px #ff4d6d; }
/* MapLibre 弹窗暗色适配 + 结构化设备卡片 */
.maplibregl-popup-content { background: rgba(10,17,36,.96); color: #d6e6ff; border: 1px solid var(--panel-brd); box-shadow: 0 0 22px rgba(0,229,255,.3); border-radius: 12px; font-family: var(--font-cn); font-size: 13px; line-height: 1.6; }
.dev-popup .maplibregl-popup-content { background: rgba(10,17,36,.97); color: #d6e6ff; border: 1px solid var(--panel-brd); box-shadow: 0 0 24px rgba(0,229,255,.35); border-radius: 12px; padding: 12px 14px; }
.dev-pop { min-width: 206px; }
.dev-pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; padding-bottom: 8px; border-bottom: 1px solid rgba(126,147,184,.22); }
.dev-pop-id { font-family: 'Orbitron', sans-serif; font-weight: 700; color: var(--cyan); font-size: 14px; letter-spacing: .5px; }
.dev-pop-status { font-size: 12px; padding: 2px 10px; border-radius: 12px; border: 1px solid; font-weight: 600; }
.dev-pop-row { display: flex; justify-content: space-between; gap: 18px; font-size: 13px; padding: 3px 0; }
.dev-pop-row .k { color: var(--muted); }
.dev-pop-row .v { color: #eaf2ff; font-weight: 500; }
.dev-popup .maplibregl-popup-close-button { color: #9fb3d6; font-size: 18px; padding: 3px 7px; }
.dev-popup .maplibregl-popup-close-button:hover { color: var(--cyan); background: transparent; }
.dev-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-top-color: rgba(10,17,36,.97); }
.dev-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-bottom-color: rgba(10,17,36,.97); }
.dev-popup.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-left-color: rgba(10,17,36,.97); }
.dev-popup.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-right-color: rgba(10,17,36,.97); }
.maplibregl-popup-tip { border-top-color: #0a1124; border-bottom-color: #0a1124; }
.maplibregl-popup-close-button { color: #9fb3d6; font-size: 16px; padding: 2px 6px; }
/* 设备标记（悬浮于倾斜地图之上，呈现 3D 浮点效果） */
.map-marker { width: 14px; height: 14px; position: relative; }
.map-marker .core { position: absolute; inset: 0; border-radius: 50%; background: var(--c); border: 2px solid rgba(4,16,30,.85); box-shadow: 0 0 10px var(--c), 0 0 22px var(--c); }
.map-marker .ring { position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--c); opacity: .5; }
.map-marker.alert .core { animation: markerPulse 1.4s infinite; }
.map-marker.alert .ring { animation: markerRing 1.6s infinite; }
@keyframes markerPulse { 0% { transform: scale(1); opacity: 1; } 70% { transform: scale(2.2); opacity: 0; } 100% { opacity: 0; } }
@keyframes markerRing { 0% { transform: scale(.6); opacity: .6; } 100% { transform: scale(2.4); opacity: 0; } }
.kpi-unit { font-size: 14px; color: var(--muted); margin-left: 4px; font-family: Arial, 'Microsoft YaHei', 'SimHei', sans-serif; }
.kpi-sub { font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 数据看板三栏布局：地图居中，两侧实时区 ===== */
.dash-cols { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 320px 1fr 350px; gap: 12px; }
.dash-col { min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.dash-left { overflow-y: auto; padding-right: 4px; }
.dash-center { min-width: 0; }
.dash-panel { display: flex; flex-direction: column; min-height: 0; }
.dash-panel.grow { flex: 1 1 auto; min-height: 0; }
.dash-center .map-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

/* 用户信息 */
.user-info { display: flex; flex-direction: column; gap: 2px; }
.ui-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 4px; border-bottom: 1px solid rgba(126,147,184,.12); font-size: 13px; }
.ui-row:last-child { border-bottom: none; }
.ui-k { color: var(--muted); }
.ui-v { color: #eaf2ff; font-family: 'Rajdhani','Orbitron',sans-serif; font-weight: 700; font-size: 15px; }

/* 处理进度 */
.progress-list { display: flex; flex-direction: column; gap: 11px; }
.prog-item { font-size: 12px; }
.prog-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; color: var(--text); }
.prog-name { font-weight: 500; }
.prog-pct { font-family: 'Rajdhani',sans-serif; font-weight: 700; color: var(--cyan); }
.prog-bar { height: 7px; border-radius: 6px; background: rgba(126,147,184,.18); overflow: hidden; }
.prog-fill { height: 100%; border-radius: 6px; transition: width .6s ease; }

/* 数据分析（迷你图表，位于左栏「处理进度」下方，竖直堆叠撑满左栏高度） */
.data-stats { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.mini-charts { display: grid; grid-template-columns: 1fr; grid-template-rows: repeat(2, minmax(132px, 1fr)); gap: 10px; flex: 1 1 auto; min-height: 0; }
.mini-chart { min-height: 132px; display: flex; flex-direction: column; }

/* 地图下方两面板：近 7 日告警趋势 + 近 30 日告警趋势 */
.center-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 0 0 auto; height: 208px; }
.center-panels .panel { display: flex; flex-direction: column; min-height: 0; }
.chart-body { flex: 1 1 auto; min-height: 0; width: 100%; }
.mc-title {
  flex: 0 0 auto; font-size: 12.5px; color: #cdddf6; letter-spacing: .5px; line-height: 1.2;
  margin-bottom: 2px; padding-left: 7px; border-left: 3px solid var(--cyan); box-shadow: -1px 0 8px rgba(0, 229, 255, .25);
}
.mc-body { flex: 1 1 auto; min-height: 96px; width: 100%; }

/* 当前告警（原实时告警日志） */
.alert-feed { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.alert-empty { margin: auto; color: var(--muted); font-size: 13px; text-align: center; padding: 18px 0; }
.alert-item { border: 1px solid var(--panel-brd); border-radius: 10px; padding: 9px 11px; background: rgba(0,229,255,.04); animation: feedIn .4s ease; }
@keyframes feedIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.ai-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.ai-type { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.ai-time { margin-left: auto; color: var(--muted); font-size: 11px; font-family: 'Rajdhani',sans-serif; }
.ai-mid { font-size: 12px; color: #cdddf6; margin-bottom: 6px; }
.ai-comm { color: var(--cyan); }
.ai-user { color: #eaf2ff; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-left: 8px; box-shadow: 0 0 8px var(--red); animation: blink 1.2s infinite; vertical-align: middle; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
/* 告警日志标题右侧：当前告警总条数 */
.panel-title.alert-title { display: flex; align-items: center; }
.alert-count {
  margin-left: auto; font-family: Arial, 'Microsoft YaHei', 'SimHei', sans-serif; font-weight: 700;
  font-size: 13px; color: var(--cyan); letter-spacing: .5px; white-space: nowrap;
  padding: 2px 10px; border-radius: 12px; border: 1px solid var(--panel-brd);
  background: rgba(0,229,255,.08); box-shadow: 0 0 10px rgba(0,229,255,.15);
}

/* ===== 系统设置视图 ===== */
#view-settings { height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 22px 26px; }
.settings-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 700px; margin-top: 4px; }
.set-card { display: flex; align-items: center; gap: 16px; }
.set-ico { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; font-size: 22px; border-radius: 12px; background: rgba(0,229,255,.08); border: 1px solid var(--panel-brd); }
.set-body { flex: 1; }
.set-t { font-size: 16px; font-weight: 700; color: var(--text); }
.set-d { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.set-d b { color: var(--cyan); }
.btn-primary.sm { height: 38px; padding: 0 18px; letter-spacing: 2px; font-size: 14px; }

/* 汇总行（设备/告警列表顶部） */
.sum-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.dev-panel { margin-top: 0; }
.filter-bar { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; margin-left: auto; }
.dev-select {
  height: 30px; border-radius: 8px; padding: 0 8px; font-size: 12px; font-family: inherit;
  color: var(--text); background: rgba(6, 12, 26, 0.7); border: 1px solid rgba(126, 147, 184, .3); outline: none;
}
.dev-select:focus { border-color: var(--cyan); }
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--panel-brd); margin-top: 6px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.data-table th { text-align: left; padding: 10px 12px; color: var(--muted); font-weight: 600; background: rgba(0, 229, 255, .05); border-bottom: 1px solid var(--panel-brd); white-space: nowrap; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid rgba(126, 147, 184, .12); color: var(--text); white-space: nowrap; }
.data-table tbody tr:hover { background: rgba(0, 229, 255, .05); }
.data-table .empty { text-align: center; color: var(--muted); padding: 24px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px; border: 1px solid; }
.pill.on { color: var(--green); border-color: rgba(0, 255, 163, .4); background: rgba(0, 255, 163, .08); }
.pill.low { color: var(--amber); border-color: rgba(255, 176, 32, .4); background: rgba(255, 176, 32, .08); }
.pill.off { color: var(--muted); border-color: rgba(126, 147, 184, .4); background: rgba(126, 147, 184, .08); }
.pill.alt { color: var(--red); border-color: rgba(255, 77, 109, .45); background: rgba(255, 77, 109, .1); }
.pill.tip { color: #c9b6ff; border-color: rgba(124, 77, 255, .45); background: rgba(124, 77, 255, .1); }
.btn-mini {
  padding: 4px 10px; border-radius: 7px; cursor: pointer; font-family: inherit; font-size: 12px; color: #04121f;
  background: linear-gradient(135deg, var(--cyan), var(--blue)); border: none; box-shadow: 0 0 10px rgba(0, 229, 255, .35);
}
.btn-mini:hover { box-shadow: 0 0 16px rgba(0, 229, 255, .6); }
.btn-mini:disabled { filter: grayscale(.7); cursor: default; box-shadow: none; opacity: .65; }
.btn-mini.ghost { background: rgba(126,147,184,.16); color: var(--text); box-shadow: none; border: 1px solid var(--panel-brd); }
.btn-mini.ghost:hover { box-shadow: 0 0 12px rgba(126,147,184,.4); }
.muted { color: var(--muted); }

/* 告警条目：底部状态 + 操作按钮 */
.ai-bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-actions { display: inline-flex; gap: 7px; flex: none; }
.ai-actions .btn-mini { padding: 3px 11px; font-size: 11.5px; letter-spacing: 1px; }

/* 告警详情弹窗 */
.adm-card { max-width: 560px; width: calc(100% - 32px); }
.adm-body { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 2px; }
.ad-head { display: flex; align-items: center; gap: 10px; }
.ad-type { font-size: 17px; font-weight: 700; color: var(--text); }
.ad-status { margin-left: auto; }
.ad-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; color: #cdddf6; padding: 8px 12px; border-radius: 10px; background: rgba(0,229,255,.05); border: 1px solid var(--panel-brd); }
.ad-meta i { color: var(--muted); font-style: normal; margin-right: 6px; font-size: 12px; }
.ad-sec-t { font-size: 13px; color: var(--cyan); margin-bottom: 7px; letter-spacing: .5px; padding-left: 9px; border-left: 3px solid var(--cyan); }
.ad-ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.ad-ul li { font-size: 13px; color: #d6e6ff; line-height: 1.6; }
.ad-trigger { font-size: 13px; color: #e6f1ff; line-height: 1.7; padding: 9px 12px; border-radius: 10px; background: rgba(0,229,255,.06); border: 1px solid rgba(0,229,255,.18); }
.ad-auto { display: flex; flex-direction: column; gap: 7px; padding: 10px 12px; border-radius: 10px; background: rgba(0,255,163,.05); border: 1px solid rgba(0,255,163,.2); }
.ad-auto-row { display: flex; gap: 10px; font-size: 13px; }
.ad-k { color: var(--muted); flex: 0 0 64px; }
.ad-v { color: #eaf6ff; font-weight: 500; }
.ad-v.ad-ok { color: var(--green); }
.ad-v.ad-wait { color: var(--amber); }
.ad-manual { display: flex; align-items: center; gap: 10px; }
.ad-note { font-size: 12.5px; color: #cdddf6; }
.ad-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 2px; }

/* ---------- 图表 ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; flex: 0 0 auto; }
.panel {
  background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 14px; padding: 14px 16px;
  backdrop-filter: blur(8px);
}
.panel-title { font-size: 15px; color: var(--text); margin-bottom: 8px; letter-spacing: 1px; position: relative; padding-left: 12px; }
.panel-title::before { content: ''; position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.chart { width: 100%; height: 150px; }

/* ---------- 占位 ---------- */
.placeholder { display: grid; place-items: center; height: 60vh; text-align: center; color: var(--muted); }
.ph-icon { font-size: 56px; margin-bottom: 12px; opacity: .5; }
.placeholder h2 { color: var(--text); margin-bottom: 8px; }

@media (max-width: 1280px) {
  .kpi-row { grid-template-columns: repeat(4, 1fr); }
  .dash-cols { grid-template-columns: 280px 1fr 300px; }
}
@media (max-width: 1100px) {
  /* 窄屏放宽为可滚动，避免信息被压缩看不清 */
  #view-dashboard { height: auto; min-height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-cols { grid-template-columns: 1fr; }
  .dash-col { overflow: visible; }
  .dash-center .map-panel { min-height: 360px; }
  .device-map { min-height: 360px; }
}
@media (max-width: 720px) {
  .dash-cols { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* ---------- 登录表单 ---------- */
.login-form { margin-top: 26px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--muted); letter-spacing: 1px; }
.field-input {
  height: 44px; border-radius: 10px; padding: 0 14px; font-size: 15px; font-weight: 500;
  font-family: var(--font-cn); letter-spacing: .5px;
  color: var(--text); background: rgba(6, 12, 26, 0.7); border: 1px solid rgba(126,147,184,.3);
  transition: .15s; outline: none;
}
.field-input::placeholder { color: #5d739a; font-weight: 400; }
.field-input:focus { border-color: var(--cyan); box-shadow: var(--glow); }
.login-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.remember { color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.remember input { accent-color: var(--cyan); }
.link { color: var(--cyan); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }
.btn-primary {
  height: 46px; border: none; border-radius: 10px; cursor: pointer; font-family: inherit; font-size: 16px; font-weight: 700;
  letter-spacing: 4px; color: #04121f; background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 0 18px rgba(0,229,255,.4); transition: .15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 26px rgba(0,229,255,.6); }
.login-err { color: var(--red); font-size: 13px; min-height: 16px; margin: 0; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 16, 0.66); backdrop-filter: blur(4px); }
.modal-card { width: 380px; max-width: 92vw; background: var(--bg2); border: 1px solid var(--panel-brd);
  border-radius: 16px; padding: 22px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.6); display: flex; flex-direction: column; gap: 14px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; font-size: 17px; font-weight: 700; color: var(--text); }
.modal-x { background: none; border: none; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; }
.modal-x:hover { color: var(--red); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.modal-foot .btn-primary { letter-spacing: 2px; height: 40px; padding: 0 22px; font-size: 14px; }

/* ---------- 全屏模式（仅标题 + 数据面板，隐藏侧栏） ---------- */
.fs-exit {
  display: none; position: fixed; top: 12px; right: 16px; z-index: 40;
  padding: 8px 16px; border-radius: 9px; cursor: pointer; font-family: inherit; font-size: 13px;
  background: rgba(8, 14, 30, .85); border: 1px solid var(--panel-brd); color: var(--cyan);
  backdrop-filter: blur(6px); box-shadow: var(--glow);
}
.fs-exit:hover { background: rgba(0, 229, 255, .16); }
.fs-mode .sidebar { display: none; }
.fs-mode .fs-exit { display: block; }
