/* ============ 侧边栏（PC 端）============= */
.sidebar-nav {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.nav-group { display: flex; flex-direction: column; }
.nav-parent {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 18px;
  background: transparent;
  color: #1e293b;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0;
  border: 0;
  border-left: 3px solid transparent;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-parent:hover { background: #f1f5f9; }
.nav-parent.active {
  background: linear-gradient(90deg, rgba(51,112,196,.12), transparent);
  color: #2856a3;
  border-left-color: #2856a3;
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-arrow {
  width: 14px; height: 14px;
  margin-left: auto;
  transition: transform .2s;
}
.nav-group.expanded .nav-arrow { transform: rotate(90deg); }

.nav-children {
  display: flex;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  background: #f8fafc;
}
.nav-group.expanded .nav-children { max-height: 600px; }

.nav-group-title {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 22px 4px 22px;
}

.nav-children-group { padding: 4px 12px 4px 0; }

.nav-child {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 24px;
  font-size: 13px;
  color: #475569;
  background: transparent;
  border: 0;
  border-radius: 0;
  border-left: 2px solid transparent;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-child:hover { background: #e2e8f0; color: #0f172a; }
.nav-child.active {
  background: #ffffff;
  color: #2856a3;
  border-left-color: #2856a3;
  font-weight: 500;
}

/* ============ 移动端底部 Tab Bar ============ */
.bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: #64748b;
  background: transparent;
  border: 0;
  border-top: 2px solid transparent;
  cursor: pointer;
  transition: color .2s, background .2s;
  padding: 0;
}
.bottom-icon { width: 22px; height: 22px; }
.bottom-tab.active {
  color: #2856a3;
  border-top-color: #2856a3;
  background: linear-gradient(180deg, rgba(40,86,163,.08), transparent);
}
.bottom-tab:active { background: rgba(40,86,163,.1); }

/* ============ 二级导航弹出层 ============ */
.subnav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  width: 100%;
}
.subnav-item:active { background: #e0e7ff; transform: scale(.98); }
.subnav-item-icon {
  width: 32px; height: 32px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: #e0e7ff;
  color: #2856a3;
}

/* ============ 通用页面头部 ============ */
.page-header {
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
@media (min-width: 768px) {
  .page-header { padding: 20px 32px; }
}
.page-path {
  font-size: 12px;
  color: #64748b;
}
.page-path span { color: #2856a3; font-weight: 500; }
.page-title {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

/* ============ 卡片 ============ */
.card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.card-pad { padding: 20px; }
@media (min-width: 768px) { .card-pad { padding: 24px; } }

/* ============ 工具栏（筛选 / 新增按钮）============= */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 12px 12px 0 0;
}

.filter-input {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.filter-input:focus { border-color: #2856a3; }

.filter-select {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  background: #fff url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 10px center;
  appearance: none;
  cursor: pointer;
  outline: none;
  padding-right: 28px;
}
.filter-select:focus { border-color: #2856a3; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }

.btn-primary {
  background: linear-gradient(135deg, #3370c4, #2856a3);
  color: #fff;
  box-shadow: 0 4px 12px rgba(40,86,163,.22);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-secondary {
  background: #fff;
  color: #2856a3;
  border-color: #cbd5e1;
}
.btn-secondary:hover { background: #f1f5f9; border-color: #2856a3; }

.btn-ghost {
  background: transparent;
  color: #64748b;
  border-color: transparent;
}
.btn-ghost:hover { background: #f1f5f9; color: #1e293b; }

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16,185,129,.22);
}
.btn-success:hover { filter: brightness(1.08); }

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245,158,11,.22);
}
.btn-warning:hover { filter: brightness(1.08); }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239,68,68,.22);
}
.btn-danger:hover { filter: brightness(1.08); }

.btn-info {
  background: linear-gradient(135deg, #06b6d4, #0e7490);
  color: #fff;
  box-shadow: 0 4px 12px rgba(6,182,212,.22);
}
.btn-info:hover { filter: brightness(1.08); }

.btn-link {
  background: transparent;
  color: #2856a3;
  padding: 0 8px;
  height: auto;
}
.btn-link:hover { color: #1e3a8a; text-decoration: underline; }

/* ============ 表格 ============ */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl thead th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 500;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.tbl tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}
.tbl tbody tr:hover { background: #f8fafc; }

/* ============ 徽标 tag ============ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 12px;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
}
.tag-blue { background: #dbeafe; color: #1e40af; }
.tag-green { background: #d1fae5; color: #065f46; }
.tag-amber { background: #fef3c7; color: #92400e; }
.tag-red { background: #fee2e2; color: #991b1b; }
.tag-violet { background: #ede9fe; color: #5b21b6; }
.tag-slate { background: #e2e8f0; color: #334155; }
.tag-emerald { background: #a7f3d0; color: #047857; }

/* ============ 容器最大宽度 ============ */
#main-inner { max-width: 1280px; }

/* ============ 滚动条 ============ */
#main { scrollbar-color: #cbd5e1 transparent; }
#main::-webkit-scrollbar { width: 8px; }
#main::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ============ Emoji 头像圆形占位 ============ */
.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #2856a3;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.avatar-lg {
  width: 56px; height: 56px;
  font-size: 20px;
  background: linear-gradient(135deg, #3370c4, #2856a3);
  color: #fff;
}

/* ============ 通用横条小图标按钮 ============ */
.icon-btn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  border: 0; cursor: pointer;
  transition: all .15s;
}
.icon-btn:hover { background: #e2e8f0; color: #1e293b; }
.icon-btn svg { width: 14px; height: 14px; }

/* ============ 按钮「跳转外部」角标 ============ */
.btn-external::after {
  content: '↗';
  font-size: 11px;
  margin-left: 4px;
  opacity: .7;
}

/* ============ 紧凑表格行（移动端自适应减少密度）============= */
@media (max-width: 640px) {
  .tbl thead th, .tbl tbody td { padding: 9px 10px; font-size: 12px; }
  .toolbar { padding: 12px; gap: 8px; }
  .page-header { padding: 12px 16px; }
}

/* ============ KPI 数字 ============ */
.kpi-num {
  font-variant: tabular-nums;
  font-feature-settings: "tnum";
}

/* ============ 时间轴 ============ */
.tl {
  position: relative;
  padding-left: 22px;
}
.tl::before {
  content: '';
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: #e2e8f0;
}
.tl-item {
  position: relative;
  padding-bottom: 18px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: '';
  position: absolute;
  left: -19px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #2856a3;
}
.tl-item.amber::before { border-color: #d97706; }
.tl-item.red::before   { border-color: #dc2626; }
.tl-item.green::before { border-color: #059669; }

/* ============ 电池/状态指示 ============ */
.dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  display: inline-block;
  background: #cbd5e1;
}
.dot-success { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.dot-warn { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.dot-danger { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.18); }
