/* ==========================================================================
   若依（RuoYi-Pro）风格后台主题
   主色 #409EFF | 侧边栏 #304156 | 页面底色 #f0f2f5
   ========================================================================== */

:root {
  --ry-primary: #409eff;
  --ry-primary-dark: #337ecc;
  --ry-bg: #f0f2f5;
  --ry-side-bg: #304156;
  --ry-side-hover: #263445;
  --ry-side-sub-bg: #1f2d3d;
  --ry-side-text: #bfcbd9;
  --ry-head-h: 50px;
  --ry-side-w: 210px;
  --ry-side-w-collapsed: 54px;
  --ry-tag-h: 38px;
  --ry-success: #67c23a;
  --ry-warning: #e6a23c;
  --ry-danger: #f56c6c;
  --ry-info: #909399;
}

* { box-sizing: border-box; }

html, body, #app { height: 100%; margin: 0; padding: 0; }
/* Vue 根组件包裹层：撑满高度，保证登录页垂直居中、侧边栏满高 */
#app > div { height: 100%; }

body {
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  color: #303133;
  background: var(--ry-bg);
  -webkit-font-smoothing: antialiased;
}

body.is-fullscreen { overflow: hidden; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c0c4cc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #909399; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ 登录页 ============================ */
.login-wrap {
  position: relative;
  height: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #1b2a41 0%, #22364f 45%, #2c4a6b 100%);
}
.login-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(64, 158, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 158, 255, .07) 1px, transparent 1px);
  background-size: 46px 46px;
}
.login-deco {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .5;
}
.login-deco.d1 { width: 380px; height: 380px; background: #2f7fd1; top: -90px; left: -70px; }
.login-deco.d2 { width: 300px; height: 300px; background: #1f9c6d; bottom: -80px; right: -50px; }

.login-card {
  position: relative;
  z-index: 2;
  width: 420px;
  padding: 38px 40px 30px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand .mark {
  width: 46px; height: 46px; margin: 0 auto 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, #409eff, #2b6cb0);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px;
}
.login-brand h1 { margin: 0; font-size: 20px; color: #1f2d3d; letter-spacing: 1px; }
.login-brand p { margin: 6px 0 0; font-size: 12px; color: #909399; }
.login-card .el-input__wrapper { height: 42px; border-radius: 4px; }
.login-card .el-form-item { margin-bottom: 20px; }
.login-card .el-button--primary { height: 42px; font-size: 15px; letter-spacing: 2px; }
.login-tip { margin-top: 16px; text-align: center; font-size: 12px; color: #909399; }

/* ============================ 主体框架 ============================ */
.app-wrapper { display: flex; height: 100%; overflow: hidden; }

/* ---- 侧边栏 ---- */
.sidebar {
  width: var(--ry-side-w);
  flex-shrink: 0;
  background: var(--ry-side-bg);
  display: flex;
  flex-direction: column;
  transition: width .26s ease;
  box-shadow: 2px 0 6px rgba(0, 0, 0, .08);
  z-index: 10;
}
.sidebar.is-collapsed { width: var(--ry-side-w-collapsed); }

.sidebar-logo {
  height: var(--ry-head-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  background: #2b3a4d;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  overflow: hidden;
}
.logo-mark {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, #409eff, #2f7fd1);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px;
}
.logo-text { color: #fff; font-size: 15px; font-weight: 600; white-space: nowrap; letter-spacing: .5px; }
.sidebar.is-collapsed .logo-text { display: none; }

.side-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
.side-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); }

.el-menu { border-right: none !important; }
.el-menu--collapse { width: 100% !important; }
.el-menu--inline { background-color: var(--ry-side-sub-bg) !important; }

.sidebar .el-menu-item,
.sidebar .el-sub-menu__title {
  height: 46px;
  line-height: 46px;
  background-color: transparent !important;
  color: var(--ry-side-text) !important;
  font-size: 14px;
}
.sidebar .el-menu-item:hover,
.sidebar .el-sub-menu__title:hover {
  background-color: var(--ry-side-hover) !important;
  color: #fff !important;
}
.sidebar .el-sub-menu .el-menu-item {
  background-color: var(--ry-side-sub-bg) !important;
  font-size: 13px;
}
.sidebar .el-sub-menu .el-menu-item:hover {
  background-color: #263445 !important;
  color: #fff !important;
}
.sidebar .el-menu-item.is-active {
  background-color: #1a2b3d !important;
  color: #fff !important;
  font-weight: 600;
}
.sidebar .el-menu-item.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ry-primary);
}
.sidebar .el-sub-menu.is-active > .el-sub-menu__title { color: #fff !important; }
.sidebar .el-menu-item .el-icon,
.sidebar .el-sub-menu__title .el-icon { font-size: 16px; margin-right: 8px; vertical-align: middle; }
.sidebar .el-menu--inline .el-icon { margin-right: 8px; }

/* ---- 右侧主体 ---- */
.main-container { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }

.navbar {
  height: var(--ry-head-h);
  flex-shrink: 0;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
  z-index: 9;
}
.hamburger {
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; cursor: pointer;
  color: #5a5e66; font-size: 19px;
  transition: background .2s;
}
.hamburger:hover { background: #f5f7fa; color: var(--ry-primary); }
.navbar .el-breadcrumb { font-size: 13px; font-weight: 400; }
.navbar .el-breadcrumb__inner { color: #97a8be; font-weight: 400 !important; }
.navbar .el-breadcrumb__item:last-child .el-breadcrumb__inner { color: #303133; }

.navbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; cursor: pointer;
  color: #5a5e66; font-size: 17px;
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: #f5f7fa; color: var(--ry-primary); }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px; border-radius: 20px; cursor: pointer;
  transition: background .2s;
}
.user-chip:hover { background: #f5f7fa; }
.user-chip .name { font-size: 13px; color: #303133; }
.user-chip .caret { font-size: 12px; color: #c0c4cc; }

/* ---- 标签页导航 ---- */
.tags-view {
  height: var(--ry-tag-h);
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid #e4e7ed;
  display: flex; align-items: center;
  padding: 0 10px; gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
  overflow-x: auto;
}
.tags-view::-webkit-scrollbar { height: 0; }
.tag-item {
  height: 26px; line-height: 24px;
  border: 1px solid #d8dce5; border-radius: 3px;
  background: #fff; color: #606266;
  font-size: 12px; padding: 0 8px;
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.tag-item:hover { color: var(--ry-primary); border-color: #c6e2ff; }
.tag-item.active { background: var(--ry-primary); border-color: var(--ry-primary); color: #fff; }
.tag-item .el-icon { font-size: 12px; border-radius: 50%; }
.tag-item .el-icon:hover { background: rgba(0, 0, 0, .18); color: #fff; }

/* ---- 内容区 ---- */
.app-main {
  flex: 1;
  background: var(--ry-bg);
  padding: 12px;
  overflow-y: auto;
  min-height: 0;
}

/* ============================ 通用组件 ============================ */
.ry-card {
  background: #fff;
  border-radius: 4px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, .06);
}
.ry-card + .ry-card { margin-top: 12px; }
.card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: #1f2d3d;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid #ebeef5;
}
.card-title::before {
  content: ""; width: 3px; height: 14px;
  background: var(--ry-primary); border-radius: 2px;
}
.card-title .extra { margin-left: auto; font-weight: 400; font-size: 13px; }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.page-head .t { font-size: 17px; font-weight: 600; color: #1f2d3d; margin: 0 0 5px; }
.page-head .d { font-size: 13px; color: #909399; margin: 0; }

.ry-toolbar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.ry-toolbar .spacer { margin-left: auto; }

.ry-search { margin-bottom: 4px; }
.ry-search .el-form-item { margin-bottom: 12px; }
.ry-search .el-form-item__label { color: #606266; font-size: 13px; }

.ry-table .el-table th.el-table__cell {
  background: #f5f7fa; color: #606266; font-weight: 600; font-size: 13px;
}
.ry-table .el-table td.el-table__cell { font-size: 13px; }
.ry-table .el-table .cell { line-height: 22px; }
.ry-table .el-button--small { padding: 5px 8px; }
/* 单元格内的操作链接按钮不换行 */
.ry-table .el-table__cell .cell > a.el-button { white-space: nowrap; }

.pager {
  display: flex; justify-content: flex-end;
  margin-top: 14px; padding: 0 2px;
}
.pager .el-pagination { font-size: 13px; }

.el-link.el-link--primary { font-size: 13px; }
.muted { color: #909399; }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }

/* 统计卡片 */
.stat-card {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid #eef0f3; border-radius: 8px; padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 21, 41, .04);
  transition: box-shadow .2s ease, transform .2s ease;
}
.stat-card:hover { box-shadow: 0 6px 18px rgba(0, 21, 41, .08); transform: translateY(-1px); }
.stat-ico {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 23px;
}
.stat-meta { min-width: 0; flex: 1; }
.stat-meta .label { font-size: 13px; color: #8c8c8c; margin-bottom: 6px; letter-spacing: .3px; }
.stat-meta .value { font-size: 26px; font-weight: 700; color: #1f2d3d; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-meta .value small { font-size: 13px; font-weight: 500; color: #bfbfbf; margin-left: 4px; }
.trend-chip {
  display: inline-flex; align-items: center; margin-top: 10px;
  font-size: 12px; line-height: 1; padding: 4px 8px; border-radius: 10px; font-variant-numeric: tabular-nums;
}
.tone-good { color: #389e0d; background: #f6ffed; }
.tone-warn { color: #d46b08; background: #fff7e6; }
.tone-bad  { color: #cf1322; background: #fff1f0; }

/* 图表容器 */
.chart-box { width: 100%; height: 300px; }
.chart-box.h-sm { height: 240px; }

/* 视频墙 */
.video-wall { display: grid; gap: 10px; grid-template-columns: repeat(4, 1fr); }
.video-wall.g3 { grid-template-columns: repeat(3, 1fr); }
.video-wall.g2 { grid-template-columns: repeat(2, 1fr); }
.video-cell {
  position: relative; aspect-ratio: 16 / 9;
  background: linear-gradient(160deg, #1d2733, #10161e);
  border-radius: 4px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #5d6b7d; font-size: 13px; cursor: pointer;
  border: 1px solid #26313d; transition: border-color .2s, transform .15s;
}
.video-cell:hover { border-color: var(--ry-primary); }
.video-cell.sel { border-color: var(--ry-primary); box-shadow: 0 0 0 2px rgba(64, 158, 255, .25); }
.video-cell .scene {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 80%, rgba(64, 158, 255, .16), transparent 55%),
    linear-gradient(180deg, #232f3d 0%, #16202b 100%);
}
/* 真实监控画面 */
.video-cell .cam-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.03) brightness(0.97);
}
/* 镜头暗角 + 轻微扫描线，模拟监控 OSD 质感 */
.video-cell .vig {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, .38) 100%);
}
.video-cell .scan {
  position: absolute; left: 0; right: 0; height: 40%;
  background: linear-gradient(180deg, transparent, rgba(140, 200, 255, .07), transparent);
  animation: scan 4.2s linear infinite;
}
@keyframes scan { 0% { top: -40%; } 100% { top: 110%; } }
.video-cell .ch {
  position: absolute; left: 8px; top: 6px;
  font-size: 12px; color: #eaf2fb;
  background: rgba(0, 0, 0, .52);
  padding: 1px 6px; border-radius: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .85);
  max-width: calc(100% - 16px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.video-cell .ts {
  position: absolute; right: 8px; bottom: 6px;
  font-size: 11px; color: #dceaf8;
  background: rgba(0, 0, 0, .48);
  padding: 0 5px; border-radius: 2px;
  font-family: Menlo, monospace;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}
.video-cell .live {
  position: absolute; left: 8px; bottom: 6px;
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: #8bf0b4;
  background: rgba(0, 0, 0, .48);
  padding: 0 5px; border-radius: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}
.video-cell .live i {
  width: 6px; height: 6px; border-radius: 50%; background: #34d17a;
  display: block; animation: blink 1.4s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.video-cell .off { position: absolute; inset: 0; background: rgba(8, 12, 17, .88); color: #7d8a99; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; }

.pty-panel { display: grid; grid-template-columns: repeat(3, 46px); gap: 6px; justify-content: center; }
.pty-btn {
  width: 46px; height: 34px; border-radius: 3px;
  border: 1px solid #dcdfe6; background: #fff; color: #606266;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; cursor: pointer; transition: all .15s;
}
.pty-btn:hover { color: var(--ry-primary); border-color: var(--ry-primary); }
.pty-btn:active { background: var(--ry-primary); color: #fff; }

/* 电子地图 */
.map-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #e9eef3; border-radius: 4px; overflow: hidden; border: 1px solid #dde3ea; user-select: none; cursor: grab; }
.map-box.dragging { cursor: grabbing; }
.map-box svg { display: block; width: 100%; height: 100%; }
/* SVG 内文本需显式指定中文字体，否则会出现缺字方框 */
.map-box text { font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif; }

/* 地图工具条 */
.map-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 10px; padding: 8px 12px;
  background: #fff; border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, .06);
}
.map-toolbar .grp { display: flex; align-items: center; gap: 8px; }
.map-toolbar .lbl { font-size: 12px; color: #909399; white-space: nowrap; }
.map-toolbar .spacer { margin-left: auto; }

/* 缩放按钮 */
.map-zoom { position: absolute; right: 12px; top: 12px; z-index: 4; display: flex; flex-direction: column; gap: 4px; }
.map-zoom button {
  width: 28px; height: 28px; border-radius: 3px; cursor: pointer;
  border: 1px solid #dcdfe6; background: rgba(255, 255, 255, .95);
  color: #606266; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12); transition: all .15s;
}
.map-zoom button:hover { color: var(--ry-primary); border-color: var(--ry-primary); }

/* 悬停提示 */
.map-tip {
  position: absolute; z-index: 6; pointer-events: none;
  background: rgba(31, 45, 61, .93); color: #fff;
  font-size: 12px; line-height: 1.6; padding: 6px 10px;
  border-radius: 3px; white-space: nowrap;
  transform: translate(12px, -50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.map-tip b { font-weight: 600; }
.map-tip .s { color: #7ee2a8; }
.map-tip .s.bad { color: #ffb3b3; }

/* 指北针 */
.map-compass {
  position: absolute; right: 14px; bottom: 14px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  border: 1px solid #dcdfe6;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}
.map-compass svg { width: 22px; height: 22px; }

/* 比例尺 */
.map-scale { position: absolute; left: 12px; bottom: 44px; z-index: 3; font-size: 10px; color: #606266; }
.map-scale .bar { height: 5px; border: 1px solid #606266; border-top: none; width: 56px; display: flex; }
.map-scale .bar i { flex: 1; }
.map-scale .bar i:nth-child(odd) { background: #606266; }

/* 图例 */
.map-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 3;
  background: rgba(255, 255, 255, .94); border-radius: 4px;
  padding: 8px 12px; font-size: 12px; color: #606266;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  line-height: 1.9;
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; }
.map-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.map-legend .sq { border-radius: 2px; }

/* 图例（画布外横条） */
.map-legend-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 10px; padding: 8px 14px;
  background: #fff; border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, .06);
  font-size: 12px; color: #606266;
}
.map-legend-bar span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend-bar .lbl { color: #909399; }
.map-legend-bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.map-legend-bar i.sq { border-radius: 2px; }

/* 设备标记 */
.mk { cursor: pointer; }
.mk .mk-bg { stroke: #fff; stroke-width: 0.4; transition: stroke-width .15s; }
.mk:hover .mk-bg { stroke-width: 0.7; }
.mk .mk-ring { fill: none; stroke-width: 0.4; stroke-dasharray: 1.1 0.9; }
.mk .mk-pulse { animation: mkPulse 2.4s ease-out infinite; }
@keyframes mkPulse { 0% { r: 2.6; opacity: .55; } 70% { r: 5.6; opacity: 0; } 100% { r: 5.6; opacity: 0; } }
.mk.sel .mk-bg { stroke: #f56c6c; stroke-width: 0.8; }
.mk .mk-lbl { font-size: 2.6px; fill: #5a6b7d; paint-order: stroke; stroke: rgba(255,255,255,.9); stroke-width: .6; stroke-linejoin: round; }
.mk.on .mk-lbl { opacity: 1; }
.mk.off .mk-lbl { opacity: .45; }

/* 地图右侧详情卡 */
.mk-card { border: 1px solid #e4e7ed; border-radius: 4px; padding: 12px; background: #fafbfc; }
.mk-card .t { font-size: 14px; font-weight: 600; color: #1f2d3d; margin-bottom: 8px; }
.mk-card .kv { display: flex; font-size: 12px; padding: 4px 0; }
.mk-card .kv .k { width: 66px; color: #909399; flex-shrink: 0; }
.mk-card .kv .v { color: #303133; }

/* 地图右侧树状点位列表 */
.mk-tree {
  font-size: 13px; color: #303133;
  --el-tree-node-hover-bg-color: #f5f7fa;
  max-height: 460px; overflow: auto; padding-right: 2px;
}
.mk-tree .el-tree-node__content { height: 32px; border-radius: 3px; }
.mk-tree .el-tree-node.is-current > .el-tree-node__content { background: #ecf5ff; }
.mk-tree .tn { display: flex; align-items: center; gap: 8px; width: 100%; overflow: hidden; }
.mk-tree .tn.zone .tn-label { font-weight: 600; color: #1f2d3d; }
.mk-tree .tn .tn-ico { font-style: normal; color: var(--ry-primary); font-size: 12px; flex-shrink: 0; }
.mk-tree .tn .tn-label {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mk-tree .tn .tn-count {
  margin-left: auto; background: #f0f2f5; color: #909399;
  border-radius: 10px; padding: 0 8px; font-size: 12px; flex-shrink: 0;
}
.mk-tree .tn .tn-type { font-size: 12px; color: #909399; flex-shrink: 0; }
.mk-tree .tn .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mk-tree .tn .dot.on { background: #67c23a; }
.mk-tree .tn .dot.alarm { background: #e6a23c; }
.mk-tree .tn .dot.off { background: #909399; }
.mk-tree .tn .tn-status { font-size: 12px; width: 36px; text-align: right; flex-shrink: 0; }
.mk-tree .tn .tn-status.ok { color: #67c23a; }
.mk-tree .tn .tn-status.bad { color: #f56c6c; }


/* 事件 / 工单流转 */
.flow-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.flow-col { background: #f5f7fa; border-radius: 4px; padding: 10px; min-height: 320px; }
.flow-col h4 { margin: 0 0 10px; font-size: 13px; color: #606266; display: flex; align-items: center; gap: 6px; }
.flow-col h4 .n {
  background: #fff; border-radius: 10px; padding: 0 7px;
  font-size: 11px; color: #909399; font-weight: 400;
}
.flow-card {
  background: #fff; border-radius: 4px; padding: 10px 12px;
  margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0, 21, 41, .08);
  cursor: pointer; border-left: 3px solid #dcdfe6; transition: box-shadow .15s;
}
.flow-card:hover { box-shadow: 0 3px 10px rgba(0, 21, 41, .13); }
.flow-card .h { font-size: 13px; color: #303133; font-weight: 500; margin-bottom: 6px; line-height: 1.5; }
.flow-card .m { font-size: 12px; color: #909399; display: flex; justify-content: space-between; align-items: center; }

/* 时间轴 */
.tl-row { display: flex; gap: 12px; }
.tl-time { width: 96px; flex-shrink: 0; text-align: right; color: #909399; font-size: 12px; padding-top: 2px; }
.tl-body { flex: 1; border-left: 2px solid #ebeef5; padding: 0 0 16px 16px; position: relative; }
.tl-body::before {
  content: ""; position: absolute; left: -6px; top: 3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid var(--ry-primary);
}
.tl-body.c1::before { border-color: #f56c6c; }
.tl-body.c2::before { border-color: #e6a23c; }
.tl-body.c3::before { border-color: #67c23a; }

/* 回放时间轴条 */
.timeline-bar {
  position: relative; height: 46px; border-radius: 4px;
  background: #f5f7fa; border: 1px solid #ebeef5; margin-top: 10px;
  overflow: hidden;
}
.timeline-bar .seg { position: absolute; top: 0; bottom: 0; background: rgba(64, 158, 255, .22); border-right: 1px solid rgba(64, 158, 255, .4); }
.timeline-bar .ev {
  position: absolute; top: 6px; height: 14px; border-radius: 7px;
  background: #f56c6c; opacity: .85;
}
.timeline-bar .cur { position: absolute; top: 0; bottom: 0; width: 2px; background: #f56c6c; }

/* 详情描述 */
.el-descriptions__label { color: #606266 !important; }

/* 大屏 */
.screen-root { background: #06121f; min-height: calc(100vh - 24px); border-radius: 4px; padding: 16px; color: #cfe6ff; }
.screen-head { display: flex; align-items: center; justify-content: center; position: relative; padding-bottom: 12px; border-bottom: 1px solid rgba(64, 158, 255, .2); margin-bottom: 14px; }
.screen-head h2 { margin: 0; font-size: 20px; letter-spacing: 3px; color: #e8f4ff; text-shadow: 0 0 14px rgba(64, 158, 255, .7); }
.screen-head .rt { position: absolute; right: 0; top: 0; font-size: 13px; color: #7ea8d4; }
.screen-grid { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 12px; }
.screen-panel { background: rgba(10, 32, 56, .55); border: 1px solid rgba(64, 158, 255, .28); border-radius: 3px; padding: 10px 12px; }
.screen-panel h3 { margin: 0 0 10px; font-size: 14px; color: #8fd0ff; font-weight: 500; letter-spacing: 1px; }
.screen-panel .video-wall { grid-template-columns: repeat(2, 1fr) !important; }
.screen-kpi { display: flex; justify-content: space-around; text-align: center; padding: 8px 0; }
.screen-kpi .v { font-size: 26px; font-weight: 600; color: #59d0ff; text-shadow: 0 0 12px rgba(64, 158, 255, .8); }
.screen-kpi .l { font-size: 12px; color: #7ea8d4; margin-top: 4px; }
.screen-list { font-size: 12px; }
.screen-list .it { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px dashed rgba(64, 158, 255, .18); color: #b6d4ee; }
.screen-list .it .tm { color: #6f9ac7; flex-shrink: 0; }

/* 大屏预览容器 */
.pv-wrap {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  overflow: hidden; background: #04101c;
  border-radius: 4px; border: 1px solid #1f3a52;
}
.pv-inner {
  width: 1920px; height: 1080px; position: absolute; top: 0; left: 0;
  transform-origin: top left;
}
.pv-inner iframe { width: 1920px; height: 1080px; border: 0; display: block; }

/* 抓拍图占位 */
.snap {
  width: 100%; aspect-ratio: 16 / 9; border-radius: 3px;
  background: linear-gradient(150deg, #34495e, #1c2733);
  display: flex; align-items: center; justify-content: center;
  color: #9fb2c7; font-size: 12px; position: relative; overflow: hidden;
}
.snap img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: saturate(0.9) brightness(0.96);
}
.snap::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 3px); pointer-events: none; }
.snap .box {
  position: absolute; border: 2px solid #f56c6c;
  width: 34%; height: 40%; left: 33%; top: 30%; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(245, 108, 108, .3), 0 0 8px rgba(245, 108, 108, .22);
}
.snap .box span {
  position: absolute; top: -1px; left: -2px;
  font-size: 9px; line-height: 1.5; color: #fff; background: #f56c6c;
  padding: 0 4px; border-radius: 2px; white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
}

/* 详情抽屉 */
.el-drawer__header { margin-bottom: 12px; padding: 0; font-size: 16px; font-weight: 600; color: #1f2d3d; }
.kv-row { display: flex; padding: 9px 0; border-bottom: 1px dashed #ebeef5; font-size: 13px; }
.kv-row .k { width: 110px; color: #909399; flex-shrink: 0; }
.kv-row .v { color: #303133; flex: 1; }

/* 权限标签 */
.perm-tag {
  display: inline-block; padding: 1px 7px; margin: 2px 4px 2px 0;
  background: #f0f2f5; border: 1px solid #e4e7ed; border-radius: 3px;
  font-size: 12px; color: #606266;
}

/* 空状态 */
.empty-box { padding: 30px 0; }

/* 响应式 */
@media (max-width: 1200px) {
  .video-wall { grid-template-columns: repeat(2, 1fr); }
  .flow-cols { grid-template-columns: repeat(2, 1fr); }
  .screen-grid { grid-template-columns: 1fr; }
}
