/* ============================================================
   应急指挥平台 本地主题（依据 应急指挥平台-工作台.html）
   jQuery + element-ui 主题皮肤，无 Vue 运行时
   ============================================================ */
:root {
  --em-primary: #409EFF;
  --em-success: #67c23a;
  --em-warning: #e6a23c;
  --em-danger: #f56c6c;
  --em-info: #909399;
  --em-bg: #f0f2f5;
  --em-border: #ebeef5;
  --em-text: #303133;
  --em-text-sub: #606266;
  --em-text-mute: #909399;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px; color: var(--em-text); background: var(--em-bg);
}
a { text-decoration: none; color: inherit; }
ul, li { list-style: none; }

.app-wrapper { height: 100vh; display: flex; flex-direction: column; }

/* ===== 顶部栏（深蓝渐变 60px） ===== */
.topbar {
  height: 60px;
  background: linear-gradient(90deg, #1a3d72 0%, #1f4d8f 50%, #24569e 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
  display: flex; align-items: stretch; flex-shrink: 0; z-index: 20;
}
.logo {
  width: 230px; display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0; border-right: 1px solid rgba(255, 255, 255, .12);
}
.logo .logo-icon {
  width: 30px; height: 30px; background: rgba(255, 255, 255, .18); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; margin-right: 10px; font-size: 17px;
}
.logo span { font-size: 16px; font-weight: 600; letter-spacing: 1px; }

/* 侧栏收缩开关（顶栏 logo 右侧） */
.topbar-toggle {
  width: 44px; border: 0; background: transparent; color: #c6d2e3;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; flex-shrink: 0; transition: all .2s;
}
.topbar-toggle:hover { color: #fff; background: rgba(255, 255, 255, .1); }

.top-menu { flex: 1; display: flex; align-items: stretch; overflow-x: auto; }
.top-menu::-webkit-scrollbar { display: none; }
.top-menu-item {
  padding: 0 18px; display: flex; align-items: center; gap: 6px;
  font-size: 14px; color: #c6d2e3; cursor: pointer; position: relative;
  white-space: nowrap; transition: all .2s; user-select: none;
  text-decoration: none; box-sizing: border-box;
}
.top-menu-item:visited { color: #c6d2e3; }
.top-menu-item i { font-size: 16px; }
.top-menu-item:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.top-menu-item.active { color: #fff; font-weight: 600; background: rgba(64, 158, 255, .25); }
.top-menu-item.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--em-primary);
}

.top-right {
  display: flex; align-items: center; gap: 18px; padding: 0 20px; flex-shrink: 0;
  border-left: 1px solid rgba(255, 255, 255, .12);
}
.nav-icon { font-size: 18px; color: #c6d2e3; cursor: pointer; position: relative; line-height: 1; }
.nav-icon:hover { color: #fff; }
.badge-dot {
  position: absolute; top: -4px; right: -6px; background: var(--em-danger); color: #fff;
  font-size: 10px; line-height: 1; padding: 2px 4px; border-radius: 8px; font-family: Arial;
}
.avatar {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 8px; border-radius: 4px; color: #fff;
}
.avatar:hover { background: rgba(255, 255, 255, .12); }
.avatar .avatar-default {
  width: 30px; height: 30px; border-radius: 50%; background: var(--em-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.avatar .el-icon-arrow-down { color: #c6d2e3 !important; }

/* ===== 主体 / 侧栏 ===== */
.body-wrapper { flex: 1; display: flex; overflow: hidden; }
.sidebar {
  width: 210px; background: #fff; border-right: 1px solid #e4e7ed;
  flex-shrink: 0; display: flex; flex-direction: column; overflow-y: auto;
}
.side-title { padding: 16px 20px 10px; font-size: 12px; color: var(--em-info); letter-spacing: 1px; }
.side-menu-item {
  display: flex; align-items: center;
  height: 44px; padding: 0 20px 0 32px;
  color: #5a5e66; cursor: pointer; font-size: 13.5px;
  border-left: 3px solid transparent; transition: all .2s; user-select: none;
  text-decoration: none; white-space: nowrap; width: 100%; box-sizing: border-box;
}
.side-menu-item:hover { background: #f5f7fa; color: var(--em-primary); }
.side-menu-item.active,
.side-menu-item.active:visited {
  color: var(--em-primary); background: #ecf5ff; border-left-color: var(--em-primary); font-weight: 600;
}
.side-menu-item:visited { color: #5a5e66; }
/* 侧栏菜单项内任意 el-icon 图标：固定宽度 + 右间距，行高 1 保证与文字垂直居中 */
.side-menu-item > i {
  width: 18px; margin-right: 8px; text-align: center; flex-shrink: 0;
  line-height: 1; font-size: 15px;
}
/* ===== 多级菜单（父级可展开 + 子级缩进） ===== */
.side-menu-item { position: relative; }
.side-menu-parent { padding-right: 34px; cursor: pointer; }
.side-menu-parent .side-arrow {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  font-size: 12px; color: #c0c4cc; transition: transform .2s;
}
.side-menu-parent.open .side-arrow { transform: translateY(-50%) rotate(0deg); }
.side-menu-parent.has-active { color: var(--em-primary); }
.side-menu-parent.has-active .side-arrow { color: var(--em-primary); }
.side-submenu { display: none; }
.side-submenu.open { display: block; }
/* 层级缩进：深度 1~4 级（更深的沿用第 4 级） */
.side-menu-item.lv1 { padding-left: 32px; }
.side-menu-item.lv2 { padding-left: 48px; }
.side-menu-item.lv3 { padding-left: 64px; }
.side-menu-item.lv4 { padding-left: 80px; }
/* 三级及以下字号略收，层级更清楚 */
.side-menu-item.lv3, .side-menu-item.lv4 { font-size: 13px; }
/* 子级容器内不加额外左边框，靠缩进区分 */
.side-submenu .side-menu-item { border-left-color: transparent; }
.side-submenu .side-menu-item.active { border-left-color: var(--em-primary); }

/* ===== 侧栏收缩态（html.side-collapsed，状态由 layout.js 维护） ===== */
.sidebar { transition: width .2s ease; }
html.side-collapsed .sidebar { width: 64px; overflow-x: hidden; }
html.side-collapsed .side-group-title { display: none; }
html.side-collapsed .side-menu-item {
  padding: 0; justify-content: center; border-left-width: 3px;
}
html.side-collapsed .side-menu-item > i { margin-right: 0; font-size: 17px; }
html.side-collapsed .side-menu-item > .menu-text { display: none; }
/* 收起后不展示子级（点父级会自动展开侧栏），箭头也隐藏 */
html.side-collapsed .side-submenu { display: none !important; }
html.side-collapsed .side-arrow { display: none; }
/* 收起后子菜单切换不再有分组标题，用一条分隔线替代 */
html.side-collapsed #sideMenu { padding-top: 4px; }
.side-group-title {
  padding: 14px; font-size: 14px; color: var(--em-info);
  letter-spacing: 1px; 
}
.logout-link {
  color: #c6d2e3; font-size: 18px; margin-left: 6px; padding: 6px;
  border-radius: 4px; text-decoration: none;
}
.logout-link:hover { background: rgba(255,255,255,.12); color: #fff; }

.main-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.app-main { flex: 1; overflow-y: auto; padding: 5px; }

/* ===== 通用 panel ===== */
.panel {
  background: #fff; border-radius: 6px; box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
  overflow: hidden; margin-bottom: 16px;
}
.panel-header {
  padding: 14px 20px; border-bottom: 1px solid var(--em-border);
  display: flex; align-items: center; justify-content: space-between;
}
.panel-header h3 { font-size: 15px; font-weight: 600;margin:0; }

/* ===== 搜索栏 ===== */
.search-bar {
  padding: 16px 20px; background: #fff; border-bottom: 1px solid var(--em-border);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.search-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--em-text-sub); }
/* 去掉 Element 相邻按钮自带左间距，统一由 flex gap 控制，避免换行时按钮被顶偏 */
.search-bar .el-button,
.search-bar .el-button + .el-button { margin-left: 10px; }


/* ===== 工具栏 ===== */
.toolbar { padding: 12px 20px; display: flex; gap: 10px; align-items: center; }

/* ===== 表格（element 风格）===== */
.table-wrap { overflow-x: auto; }
table.my-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.my-table th {
  background: #f5f7fa; color: var(--em-info); font-weight: 500; text-align: left;
  padding: 11px 12px; border-bottom: 1px solid var(--em-border); font-size: 13px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.my-table td {
  padding: 11px 12px; border-bottom: 1px solid var(--em-border); font-size: 13px;
  color: var(--em-text-sub); vertical-align: middle;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.my-table th.col-actions,
.my-table td.col-actions { white-space: nowrap; text-align: center; }
.my-table td.col-actions .link { margin-right: 8px; }
.my-table tr:hover td { background: #f5f7fa; }
.my-table .link { color: var(--em-primary); cursor: pointer; margin-right: 10px; background: none; border: none; font-size: 13px; }
.my-table .link:hover { text-decoration: underline; }
.my-table .link.danger { color: var(--em-danger); }

/* ===== 分页 ===== */
.pagination { padding: 16px 20px; display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: 13px; color: var(--em-text-sub); }
.pagination .total { margin-right: 12px; }
.pager {
  min-width: 28px; height: 28px; padding: 0 8px; border: 1px solid #dcdfe6;
  border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  background: #fff; color: var(--em-text-sub);
}
.pager:hover:not(.active) { color: var(--em-primary); border-color: var(--em-primary); }
.pager.active { background: var(--em-primary); color: #fff; border-color: var(--em-primary); }
.pager.disabled { color: #c0c4cc; cursor: not-allowed; }

/* ===== 弹窗 ===== */
.dialog-mask {
  display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 100;
  align-items: center; justify-content: center; padding: 20px;
}
.dialog-mask.show { display: flex; }
.dialog {
  background: #fff; border-radius: 6px; width: 780px; max-width: 94vw;
  max-height: 86vh; display: flex; flex-direction: column;
}
.dialog-header {
  padding: 16px 24px; border-bottom: 1px solid var(--em-border); font-size: 16px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}
.dialog-header .close { cursor: pointer; color: var(--em-info); font-size: 18px; }
.dialog-body { padding: 24px; overflow-y: auto; text-align: center; }
.dialog-body .form-grid { gap: 20px 28px; max-width: 660px; margin: 0 auto; text-align: left; }
.dialog-body.frame-body { padding: 0; text-align: left; }
.edit-frame { width: 100%; border: none; display: block; background: #fff; }
.dialog-footer { padding: 14px 20px; border-top: 1px solid var(--em-border); text-align: center; }
.dialog-footer .el-button { margin: 0 5px; }

/* ===== 表单 ===== */
.panel-body { padding: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.form-item { display: flex; align-items: center; }
.form-item.top { align-items: flex-start; }
.form-item label { width: 100px; font-size: 13px; color: var(--em-text-sub); text-align: right; margin-right: 12px; line-height: 32px; flex-shrink: 0; }
.form-item label .req { color: var(--em-danger); margin-right: 4px; }
.form-item .el-input__inner { flex: 1; width: auto; min-width: 0; }
.form-item select.el-select { flex: 1; width: auto; min-width: 0; }
.form-item.full { grid-column: 1 / -1; }
textarea.el-input__inner { height: 80px; padding: 6px 10px; resize: vertical; line-height: 1.5; }

.form-footer { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--em-border); text-align: center; }
.form-footer .el-button { min-width: 88px; }
.form-footer .el-button + .el-button { margin-left: 12px; }

.embed-footer { margin-top: 24px; padding-top: 18px; border-top: 1px solid #ebeef5; text-align: right; }
.embed-footer .el-button + .el-button { margin-left: 12px !important; }

/* ===== 消息提示（模拟 element $message） ===== */
.em-message {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 4px; font-size: 13px; z-index: 999;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12); display: flex; align-items: center; gap: 8px;
}
.em-message.success { background: #f0f9eb; color: #67c23a; border: 1px solid #e1f3d8; }
.em-message.error { background: #fef0f0; color: #f56c6c; border: 1px solid #fde2e2; }
.em-message.info { background: #edf2fc; color: #909399; border: 1px solid #e9ebf0; }

/* ===== 工作台欢迎条 / 统计卡 ===== */
.welcome-bar {
  background: linear-gradient(135deg, #1f4d8f 0%, #2f6fbe 60%, #409EFF 100%);
  border-radius: 6px; color: #fff; padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.welcome-bar h2 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.welcome-bar p { font-size: 13px; opacity: .9; }
.welcome-meta { text-align: right; font-size: 13px; line-height: 1.8; opacity: .95; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-card {
  background: #fff; border-radius: 6px; box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
  padding: 18px 20px; display: flex; align-items: center; gap: 14px;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
}
.stat-icon.si-blue { background: #409EFF; }
.stat-icon.si-green { background: #67c23a; }
.stat-icon.si-red { background: #f56c6c; }
.stat-icon.si-orange { background: #e6a23c; }
.stat-info .num { font-size: 24px; font-weight: 700; color: var(--em-text); }
.stat-info .num small { font-size: 13px; font-weight: 500; color: var(--em-info); margin-left: 2px; }
.stat-info .label { font-size: 13px; color: var(--em-text-sub); margin-top: 2px; }

.empty-row td { text-align: center; color: #c0c4cc; padding: 40px 0 !important; }

/* ============================================================
   Element 组件皮肤（本地 index.css 仅含图标字体，组件样式在此补齐）
   ============================================================ */
/* Element Plus 自带按钮/标签样式，不再手写覆盖 */

.panel-header .link { color: var(--em-primary); font-size: 13px; cursor: pointer; }
.panel-header .link:hover { text-decoration: underline; }

/* ===== 顶栏全局场景筛选 ===== */
.global-scene {
  display: flex; align-items: center; gap: 6px; color: #c6d2e3; font-size: 13px;
  padding: 4px 10px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .2);
}
.global-scene:hover { background: rgba(255, 255, 255, .1); }
.global-scene-select {
  background: transparent; border: none; color: #fff; height: 26px; outline: none;
  cursor: pointer; font-size: 13px;
}
.global-scene-select option { color: #303133; background: #fff; }

/* ===== 工作台：今日值班横幅 ===== */
.duty-banner {
  display: flex; align-items: center; gap: 16px; padding: 14px 20px; flex-wrap: wrap;
  background: linear-gradient(90deg, #ecf5ff 0%, #f0f9eb 100%);
  border-radius: 6px; font-size: 13px;
}
.duty-item { display: flex; align-items: center; gap: 6px; }
.duty-label { color: var(--em-info); }
.duty-value { color: var(--em-text); font-weight: 500; }
.duty-value i { color: var(--em-primary); margin-right: 2px; }
.duty-phone { color: var(--em-success); font-size: 12px; }
.duty-divider { width: 1px; height: 24px; background: #dcdfe6; }

.stat-row.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ===== 工作台：三栏驾驶舱 ===== */
.dash-grid { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-list { padding: 8px 0; }
.dash-list-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 16px; border-bottom: 1px solid #f0f2f5; font-size: 13px;
}
.dash-list-item:last-child { border-bottom: none; }
.dash-list-item b { display: block; color: var(--em-text); font-size: 13px; }
.dash-list-item small { color: var(--em-info); font-size: 11px; }
.dash-list-item .lv {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 4px; color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center; font-weight: bold;
}
.lv.red { background: #f56c6c; }
.lv.orange { background: #e6a23c; }
.lv.blue { background: #409EFF; }

.map-placeholder {
  height: 260px; margin: 8px; border-radius: 6px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #e8f4fd 0%, #d4ecf7 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--em-text-sub); font-size: 13px;
}
.map-placeholder i { font-size: 40px; color: var(--em-primary); }
.map-placeholder small { color: var(--em-info); }
.map-point {
  position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #f56c6c;
  box-shadow: 0 0 0 4px rgba(245, 108, 108, .3);
}
.map-point.p1 { top: 30%; left: 40%; }
.map-point.p2 { top: 55%; left: 60%; background: #e6a23c; box-shadow: 0 0 0 4px rgba(230, 162, 60, .3); }
.map-point.p3 { top: 45%; left: 25%; background: #67c23a; box-shadow: 0 0 0 4px rgba(103, 194, 56, .3); }

/* ===== 图表占位（未接 echarts） ===== */
.chart-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-box {
  height: 240px; margin: 8px; border-radius: 6px; background: #f5f7fa;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: #b0b8c4; font-size: 13px;
}
.chart-box i { font-size: 34px; }

/* 工作台隐藏侧栏（body.home） */
body.home .sidebar { display: none; }
body.home .main-container { padding-left: 0; }
body.home .topbar-toggle { display: none; }

@media (max-width: 1200px) {
  .stat-row, .stat-row.cols-3, .dash-grid, .chart-row { grid-template-columns: 1fr; }
  .logo { width: 160px; } .logo span { display: none; }
}
/* 窄屏（<640px 才隐藏侧栏，640~768 之间保持显示，避免 in-app 浏览器 718px 视口丢失侧边菜单） */
@media (max-width: 640px) {
  .sidebar { display: none; }
  .main-container { padding-left: 0; }
  .topbar-toggle { display: none; }
}

/* ===== Vue 列表页：表格铺满剩余高度 ===== */
.page-flex { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.flex-panel { flex: 1; display: flex; flex-direction: column; margin-bottom: 0; }
.flex-panel .search-bar { flex-shrink: 0; }
.flex-table { flex: 1; }
.flex-table .el-table__body-wrapper { overflow-y: auto !important; }
.page-bar { flex-shrink: 0; padding: 10px 16px; justify-content: flex-end; border-top: 1px solid #f0f2f5;text-align:right; }
/* 操作列 el-link */
.op-link { margin-right: 12px; font-size: 13px; }
.op-link:last-child { margin-right: 0; }


.el-dialog__body {
    padding: 0;
}

.el-dialog__title{
    font-size:15px;
}
.el-dialog__footer .el-button + .el-button,
.el-message-box__btns .el-button + .el-button{
    margin-left: 10px;
}
/* ===== 头像下拉菜单 ===== */
.avatar {
    position: relative;
}
.avatar-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0; min-width: 180px;
    background: #fff; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,21,41,.16);
    padding: 8px 0; display: none; z-index: 2000;
}
.avatar-dropdown.open { display: block; }
.dropdown-user { display: flex; align-items: center; gap: 10px; padding: 8px 16px; }
.dropdown-avatar {
    width: 36px; height: 36px; border-radius: 50%; background: var(--em-primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0;
}
.dropdown-name { font-size: 14px; color: #303133; font-weight: 600; }
.dropdown-sub { font-size: 12px; color: #909399; margin-top: 2px; }
.dropdown-divider { height: 1px; background: #ebeef5; margin: 8px 0; }
.dropdown-item {
    padding: 9px 16px; font-size: 13.5px; color: #606266; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.dropdown-item:hover { background: #f5f7fa; color: var(--em-primary); }

/* ===== 列表页 el-select：白底、指针、箭头随 flex 自动垂直居中 ===== */
.search-bar .el-select .el-input { display: flex; align-items: center; }
.search-bar .el-select .el-input__inner {
  background: #fff !important;
  height: 32px;
  line-height: 30px;
  cursor: pointer;
  flex: 1;
}
.search-bar .el-select .el-select__caret {
  position: static;
  line-height: 1;
  font-size: 14px;
  margin: 0 8px 0 0;
  cursor: pointer;
  transition: transform .3s;
}
.search-bar .el-select.is-open .el-select__caret,
.search-bar .el-select--focused .el-select__caret {
  transform: rotate(180deg);
}

/*列表页-表格样式*/
.el-table th.el-table__cell {
    background: #f5f7fa;
    color: #909399;
    font-size: 13px;
    text-align: center;
    padding:5px;
}

.el-table td.el-table__cell {
    font-size: 13px;
    text-align: center;
    padding: 6px;
}

/* 权限菜单树 */
.menu-tree {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #ebeef5;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fafbfc;
}

/* 组织架构页：左树右详情 */
.org-page { display: flex; gap: 16px; align-items: flex-start; }
.org-left { width: 320px; flex-shrink: 0; }
.org-right { flex: 1; }
.org-tree-node { flex: 1; display: flex; justify-content: space-between; align-items: center; padding-right: 8px; }
.org-node-op i { margin-left: 10px; color: #909399; cursor: pointer; }
.org-node-op i:hover { color: var(--em-primary); }
.org-detail { padding: 18px 20px; }
.org-empty { padding: 60px 0; text-align: center; color: #c0c4cc; }
.el-tree-node__content{height:30px;}

