/* ============================================================
   京东集团智能安防管理系统 - 公共样式
   依据《京东IBMS界面规范》：
   - 整体色系：红、白、灰
   - 页面主底色：#F4F6FA（灰）
   - 顶部一级导航底色：#E1251B（京东红）
   - 左侧二级导航底色：#FFFFFF（白）
   - 左侧三级导航底色：#F9F9F9（灰）
   - 字体：京东朗正（未安装时回退 微软雅黑）
   ============================================================ */

:root {
  --jd-red: #E1251B;
  --jd-red-dark: #C81623;
  --jd-red-light: #FDECEB;
  --jd-bg: #F4F6FA;
  --jd-sidebar: #FFFFFF;
  --jd-sidebar-sub: #F9F9F9;
  --jd-text: #333333;
  --jd-text-sub: #666666;
  --jd-border: #E8EAf0;
}

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

html, body {
  width: 100%;
  height: 100%;
  font-family: "JD LanZheng", "京东朗正", "Microsoft YaHei", "微软雅黑", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--jd-text);
  background: var(--jd-bg);
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #C9CEDB; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #A9B0C2; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 水印（所有系统页面显示当前登录用户名） ---------- */
.jd-watermark-layer {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.jd-watermark-layer span {
  position: absolute;
  transform: rotate(-24deg);
  color: rgba(0, 0, 0, 0.055);
  font-size: 16px;
  font-weight: bold;
  white-space: nowrap;
  user-select: none;
}

/* ---------- 通用工具类 ---------- */
.text-red { color: var(--jd-red); }
.text-sub { color: var(--jd-text-sub); }
.text-center { text-align: center; }

/* 页面通用容器（子页面内） */
.page {
  padding: 16px;
}
.page-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.page-title {
  font-size: 18px;
  font-weight: bold;
  position: relative;
  padding-left: 12px;
}
.page-title::before {
  content: "";
  position: absolute;
  left: 0; top: 3px; bottom: 3px;
  width: 4px;
  border-radius: 2px;
  background: var(--jd-red);
}

/* 卡片 */
.jd-card {
  background: #FFFFFF;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(31, 45, 76, 0.06);
  padding: 16px;
}
.jd-card + .jd-card { margin-top: 16px; }
.jd-card-title {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.jd-card-title::before {
  content: "";
  display: inline-block;
  width: 4px; height: 14px;
  border-radius: 2px;
  background: var(--jd-red);
  margin-right: 8px;
  vertical-align: -2px;
}
.jd-card-title .title-text { flex: 1; }

/* ---------- Element UI 主题定制（京东红） ---------- */
.el-button--primary {
  background-color: var(--jd-red) !important;
  border-color: var(--jd-red) !important;
}
.el-button--primary:hover,
.el-button--primary:focus {
  background-color: var(--jd-red-dark) !important;
  border-color: var(--jd-red-dark) !important;
}
.el-button--text { color: var(--jd-red) !important; }

.el-menu { border-right: none !important; }

.el-pagination.is-background .el-pager li:not(.disabled).active {
  background-color: var(--jd-red) !important;
  color: #fff;
}
.el-pagination.is-background .el-pager li:not(.disabled):hover { color: var(--jd-red); }

.el-table th { background-color: #F9F9F9 !important; color: #555; font-weight: bold; }
.el-table thead { color: #555 !important; }

.el-tabs__item.is-active { color: var(--jd-red) !important; }
.el-tabs__active-bar { background-color: var(--jd-red) !important; }
.el-tabs__item:hover { color: var(--jd-red); }

.el-checkbox__input.is-checked .el-checkbox__inner,
.el-radio__input.is-checked .el-radio__inner {
  background-color: var(--jd-red) !important;
  border-color: var(--jd-red) !important;
}
.el-checkbox__input.is-checked + .el-checkbox__label,
.el-radio__input.is-checked + .el-radio__label { color: var(--jd-red) !important; }
.el-switch.is-checked .el-switch__core { background-color: var(--jd-red) !important; border-color: var(--jd-red) !important; }

.el-tag--danger { background-color: var(--jd-red-light); border-color: #F5B5B1; color: var(--jd-red); }

.el-badge__content.is-fixed { background-color: var(--jd-red); }

.el-input__inner:focus, .el-textarea__inner:focus {
  border-color: var(--jd-red) !important;
}
.el-select .el-input.is-focus .el-input__inner { border-color: var(--jd-red) !important; }
.el-select-dropdown__item.selected { color: var(--jd-red) !important; }

/* ---------- 状态徽标 ---------- */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
}
.status-dot.green { background: #37C273; }
.status-dot.red { background: var(--jd-red); }
.status-dot.orange { background: #F5A623; }
.status-dot.gray { background: #BFC4D1; }

/* ---------- 布局工具 ---------- */
.flex-row { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* 数字统计卡 */
.stat-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(31, 45, 76, 0.06);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-card .stat-label { color: var(--jd-text-sub); font-size: 13px; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: bold; line-height: 1; }
.stat-card .stat-value.unit { font-size: 14px; font-weight: normal; color: var(--jd-text-sub); margin-left: 4px; }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
}
.stat-icon.red { background: linear-gradient(135deg, #F05A50, var(--jd-red)); }
.stat-icon.orange { background: linear-gradient(135deg, #FFB199, #F5A623); }
.stat-icon.blue { background: linear-gradient(135deg, #6FA8FF, #3D7EFF); }
.stat-icon.green { background: linear-gradient(135deg, #6FD9A4, #37C273); }
.stat-icon.purple { background: linear-gradient(135deg, #B58AFF, #8A5CF6); }
.stat-icon.cyan { background: linear-gradient(135deg, #67DBE9, #22B8CF); }

/* 空视频占位（演示用） */
.video-placeholder {
  background: #1B2A4A;
  border-radius: 4px;
  color: #7A8DB0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.video-placeholder .cam-name {
  position: absolute;
  left: 8px; top: 8px;
  color: #C8D3EC;
  font-size: 12px;
  background: rgba(0,0,0,0.35);
  padding: 2px 8px;
  border-radius: 3px;
  z-index: 2;
}
.video-placeholder .cam-time {
  position: absolute;
  right: 8px; top: 8px;
  color: #9FB0D8;
  font-size: 12px;
  background: rgba(0,0,0,0.35);
  padding: 2px 8px;
  border-radius: 3px;
  z-index: 2;
}
.video-placeholder .cam-tag {
  position: absolute;
  left: 8px; bottom: 8px;
  z-index: 2;
}
.video-placeholder .video-icon {
  font-size: 42px;
  color: #3E5580;
}
.video-placeholder .scanline {
  position: absolute;
  left: 0; right: 0;
  height: 90px;
  background: linear-gradient(180deg, rgba(62,85,128,0) 0%, rgba(80,110,170,0.25) 50%, rgba(62,85,128,0) 100%);
  animation: scanmove 6s linear infinite;
  z-index: 1;
}
@keyframes scanmove {
  0% { top: -90px; }
  100% { top: 100%; }
}
