/* =========================================================
 * 泰沣云 · 污染源在线监控平台 —— 管理端样式
 * ========================================================= */
:root {
  --bg: #F1F5F6;
  --surface: #FFFFFF;
  --surface-2: #F8FBFB;
  --ink: #0D1F26;
  --ink-2: #41565F;
  --muted: #7C919A;
  --line: #E2EAEC;
  --line-soft: #EDF3F4;
  --brand: #0E7A78;
  --brand-d: #0A5F5D;
  --brand-2: #12A594;
  --brand-soft: #E6F3F1;
  --ok: #12855C;
  --ok-bg: #E6F5EE;
  --danger: #BC2F25;
  --danger-bg: #FDECEA;
  --warn: #9A6206;
  --warn-bg: #FDF3E1;
  --info: #2B62C4;
  --info-bg: #EAF1FD;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(13, 31, 38, .04), 0 6px 18px -12px rgba(13, 31, 38, .18);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #CBD8DB; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #AFC1C5; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 布局 ---------------- */
.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 226px; flex: 0 0 226px;
  background: linear-gradient(180deg, #0B1E25 0%, #07161B 100%);
  display: flex; flex-direction: column;
  position: relative; z-index: 20;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
}
.brand-mark {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
  background: linear-gradient(140deg, #12A594, #0B6E6C);
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(18, 165, 148, .28);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-txt strong { color: #fff; font-size: 16.5px; letter-spacing: .06em; display: block; line-height: 1.1; }
.brand-txt span { color: #6E8A93; font-size: 12px; letter-spacing: .04em; }

.nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.nav::-webkit-scrollbar { width: 0; }
.nav-group { color: #516B74; font-size: 12px; letter-spacing: .12em; padding: 16px 10px 7px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 11px; border-radius: 8px;
  color: #93AAB2; font-size: 13px; cursor: pointer;
  transition: background .16s, color .16s;
  user-select: none;
}
.nav-item svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; opacity: .9; }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #DDEBED; }
.nav-item.on { background: rgba(18, 165, 148, .13); color: #FFFFFF; }
.nav-item.on svg { stroke: #2FC4B2; opacity: 1; }
.nav-item.on::before {
  content: ''; position: absolute; left: -10px; top: 11px;
  width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: #12A594;
}
.nav-badge {
  margin-left: auto; min-width: 18px; height: 17px; padding: 0 5px;
  background: #C0392B; color: #fff; border-radius: 9px;
  font-size: 10.5px; display: grid; place-items: center; font-weight: 600;
}
.sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  color: #7C949C; font-size: 11.5px;
}
.sidebar-foot .live { width: 6px; height: 6px; border-radius: 50%; background: #2FC4B2; box-shadow: 0 0 0 3px rgba(47, 196, 178, .18); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.topbar {
  height: 58px; flex: 0 0 58px; background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 22px;
  position: relative; z-index: 10;
}
.topbar h1 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: .01em; }
.topbar .crumb { color: var(--muted); font-size: 13px; margin-top: 1px; }
.tb-search {
  margin-left: auto; display: flex; align-items: center; gap: 7px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 0 10px; height: 32px; width: 230px;
  color: var(--muted);
}
.tb-search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 13.5px; color: var(--ink); }
.tb-search input::placeholder { color: #A6B7BD; }
.tb-icon {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  border: 1px solid var(--line); background: #fff; cursor: pointer; position: relative; color: var(--ink-2);
}
.tb-icon:hover { background: var(--surface-2); }
.tb-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.tb-icon .badge {
  position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px;
  background: #C0392B; color: #fff; font-size: 10px; border-radius: 8px;
  display: grid; place-items: center; border: 2px solid #fff; font-weight: 600;
}
.tb-user { display: flex; align-items: center; gap: 8px; padding-left: 4px; }
.tb-user .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(140deg, #0E7A78, #12A594);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.tb-user .u-name { font-size: 14px; line-height: 1.2; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-user .u-role { font-size: 12px; color: var(--muted); }

.view { flex: 1; overflow-y: auto; padding: 18px 22px 34px; scroll-behavior: smooth; }
.view-enter { animation: fadeUp .26s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-width: 0;
}
.card-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line-soft);
}
.card-title { font-size: 15px; font-weight: 600; letter-spacing: .01em; display: flex; align-items: center; gap: 7px; }
.card-title::before {
  content: ''; width: 3px; height: 12px; border-radius: 2px;
  background: linear-gradient(180deg, #12A594, #0E7A78);
}
.card-sub { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.card-bd { padding: 14px 16px; }
.card-bd.flush { padding: 0; }

.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mt14 { margin-top: 14px; }

/* KPI */
.kpi { padding: 15px 16px 13px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi-ico svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.kpi-val { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi-val small { font-size: 13.5px; font-weight: 400; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 6px; min-height: 30px; }
.kpi-trend { font-size: 11px; display: flex; align-items: center; gap: 4px; }
.kpi-trend.up { color: var(--ok); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend.flat { color: var(--muted); }
.kpi-spark { width: 78px; height: 30px; flex: 0 0 78px; }
.kpi-desc { font-size: 11px; color: var(--muted); }

/* 标签 / 状态 */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 5px; font-size: 11px; font-weight: 500; line-height: 1.5;
  white-space: nowrap;
}
.tag.ok { color: var(--ok); background: var(--ok-bg); }
.tag.danger { color: var(--danger); background: var(--danger-bg); }
.tag.warn { color: var(--warn); background: var(--warn-bg); }
.tag.info { color: var(--info); background: var(--info-bg); }
.tag.mute { color: #61757D; background: #EFF4F5; }
.tag.solid-danger { color: #fff; background: #C0392B; }
.tag .dot-s { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: 0 0 7px; }
.dot.ok { background: #16A06B; box-shadow: 0 0 0 3px rgba(22, 160, 107, .14); }
.dot.danger { background: #C0392B; box-shadow: 0 0 0 3px rgba(192, 57, 43, .14); }
.dot.warn { background: #D68910; box-shadow: 0 0 0 3px rgba(214, 137, 16, .14); }
.dot.live { background: #16A06B; animation: pulse 1.8s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(22, 160, 107, .35); } 50% { box-shadow: 0 0 0 5px rgba(22, 160, 107, 0); } }

/* 表格 */
.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 13px;
  padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
table.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr { transition: background .14s; }
table.tbl tbody tr:hover { background: #F7FBFB; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl tr.row-danger td:first-child { box-shadow: inset 2px 0 0 #C0392B; }
table.tbl tr.row-warn td:first-child { box-shadow: inset 2px 0 0 #D68910; }
table.tbl tbody tr.row-on { background: var(--brand-soft); }
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }

/* 按钮 / 分段控件 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 30px; padding: 0 11px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 13.5px; cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #C9D8DB; background: var(--surface-2); }
.btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-d); border-color: var(--brand-d); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 13px; }
.btn-danger { color: var(--danger); border-color: #EBC8C8; }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-text { border: 0; background: transparent; color: var(--brand); padding: 0 2px; height: auto; }
.btn-text:hover { background: transparent; text-decoration: underline; }

.seg { display: inline-flex; background: #EFF4F5; border-radius: 8px; padding: 2px; gap: 2px; }
.seg button {
  border: 0; background: transparent; height: 26px; padding: 0 11px; border-radius: 6px;
  font-size: 11.5px; color: #61757D; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(13, 31, 38, .12); }

/* 进度条 */
.bar { height: 5px; border-radius: 3px; background: #EDF2F3; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--brand-2); transition: width .6s cubic-bezier(.3, .8, .3, 1); }

/* 图表宿主 */
.ch-host { position: relative; width: 100%; }

/* 折线图常驻图例（系列/因子名称） */
.ch-legend {
  position: absolute; top: 4px; left: 44px; right: 14px;
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 11px; color: #5A7078; white-space: nowrap;
}
.ch-legend .ch-lg { display: inline-flex; align-items: center; cursor: pointer; }
.ch-legend .ch-lg i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 5px; }

/* 焦点曲线因子名称标签（悬停/点击曲线时显示） */
.ch-badge {
  position: absolute; display: none; pointer-events: none; z-index: 6;
  background: #FFFFFF; border: 1px solid #D7E2E5; border-radius: 4px;
  padding: 4px 10px; font-size: 12px; color: #33454C;
  box-shadow: 0 4px 14px rgba(20, 40, 50, .14); white-space: nowrap;
}
.ch-badge i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.ch-badge span { margin-right: 8px; }
.ch-badge b { font-variant-numeric: tabular-nums; }

/* 提示框中焦点系列高亮 */
.ch-tip .on { font-weight: 600; text-shadow: 0 0 6px currentColor; }
.ch-svg { display: block; width: 100%; }
.ch-grid { stroke: #EDF2F3; stroke-width: 1; }
.ch-axis { stroke: #DCE7E9; stroke-width: 1; }
.ch-ylab { fill: #90A6AE; font-size: 11.5px; font-family: inherit; font-variant-numeric: tabular-nums; }
.ch-xlab { fill: #90A6AE; font-size: 11.5px; font-family: inherit; font-variant-numeric: tabular-nums; }
.ch-limit { stroke: #C0392B; stroke-width: 1; stroke-dasharray: 4 4; opacity: .5; }
.ch-limit-lab { fill: #B33C2E; font-size: 9px; font-family: inherit; }
.ch-vline { stroke: #9CB2BA; stroke-width: 1; stroke-dasharray: 3 3; }
.ch-tip {
  position: absolute; display: none; z-index: 6; pointer-events: none;
  background: rgba(10, 27, 33, .94); color: #fff; border-radius: 8px;
  padding: 7px 10px; font-size: 11px; line-height: 1.75; min-width: 132px;
  box-shadow: 0 10px 26px -10px rgba(0, 0, 0, .45);
  backdrop-filter: blur(4px);
}
.ch-tip em { display: block; font-style: normal; opacity: .6; font-size: 10px; margin-bottom: 3px; letter-spacing: .02em; }
.ch-tip i { display: inline-block; width: 6px; height: 6px; border-radius: 2px; margin-right: 6px; }
.ch-tip .tr { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.ch-tip .tr b { margin-left: auto; float: none; padding-left: 18px; }
.ch-tip span { opacity: .82; }
.ch-tip b { float: right; margin-left: 14px; font-variant-numeric: tabular-nums; font-weight: 600; }
.ch-donut { display: block; }
.ch-donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.ch-donut-center b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ch-donut-center span { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* 水平条排行 */
.hb-row { display: flex; align-items: center; gap: 9px; padding: 5.5px 0; font-size: 12px; }
.hb-rank {
  width: 17px; height: 17px; flex: 0 0 17px; border-radius: 5px; display: grid; place-items: center;
  font-size: 10px; font-weight: 600; color: #7C919A; background: #EFF4F5;
}
.hb-row:nth-child(1) .hb-rank { background: #FDECEA; color: #BC2F25; }
.hb-row:nth-child(2) .hb-rank { background: #FDF3E1; color: #9A6206; }
.hb-row:nth-child(3) .hb-rank { background: #EAF1FD; color: #2B62C4; }
.hb-name { width: 108px; flex: 0 0 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hb-track { flex: 1; height: 6px; background: #EFF4F5; border-radius: 3px; overflow: hidden; }
.hb-track > i { display: block; height: 100%; border-radius: 3px; }
.hb-val { width: 52px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 11.5px; }

/* 列表 */
.list-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .14s;
}
.list-row:hover { background: #F7FBFB; }
.list-row:last-child { border-bottom: 0; }
.list-row.on { background: var(--brand-soft); box-shadow: inset 2px 0 0 var(--brand); }
.li-main { flex: 1; min-width: 0; }
.li-t { font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.li-s { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; gap: 10px; }

/* 站点卡片 */
.site-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px;
  background: #fff; cursor: pointer; transition: all .16s; position: relative;
}
.site-card:hover { border-color: #BFD5D6; box-shadow: 0 4px 14px -8px rgba(13, 31, 38, .25); }
.site-card.on { border-color: var(--brand-2); box-shadow: 0 0 0 2px rgba(18, 165, 148, .14); }
.site-card .sc-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.site-card .sc-name { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.site-card .sc-meta { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.site-card .sc-nums { display: flex; gap: 14px; margin-top: 9px; }
.site-card .sc-num b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; display: block; line-height: 1.2; }
.site-card .sc-num span { font-size: 10px; color: var(--muted); }

/* 任务看板 */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.board-col { background: #F7FAFA; border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 200px; }
.board-hd { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 9px; font-size: 12px; font-weight: 600; }
.board-hd span { color: var(--muted); font-weight: 400; font-size: 11px; }
.task-card {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 11px; margin-bottom: 9px; cursor: pointer; transition: all .15s;
}
.task-card:hover { border-color: #BFD5D6; box-shadow: 0 4px 12px -8px rgba(13, 31, 38, .3); transform: translateY(-1px); }
.task-card .tc-t { font-size: 12px; font-weight: 600; display: flex; justify-content: space-between; gap: 6px; }
.task-card .tc-s { font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.task-card .tc-f { margin-top: 8px; display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); }

/* SOP 步骤条 */
.sop { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 4px 0 2px; }
.sop-step { display: flex; align-items: center; flex: 0 0 auto; }
.sop-dot {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #D6E1E3; background: #fff;
  display: grid; place-items: center; font-size: 9px; color: #A6B7BD; flex: 0 0 18px;
}
.sop-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 2px; }
.sop-item span { font-size: 10px; color: #8AA0A8; white-space: nowrap; }
.sop-item.done .sop-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.sop-item.done span { color: var(--ink-2); }
.sop-item.now .sop-dot { background: #fff; border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 122, 120, .12); font-weight: 700; }
.sop-item.now span { color: var(--brand); font-weight: 600; }
.sop-line { width: 18px; height: 1px; background: #DCE7E9; margin: 0 1px 14px; flex: 0 0 18px; }

/* 视频占位 */
.video-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.video-cell {
  position: relative; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden;
  background: radial-gradient(120% 120% at 30% 20%, #1E3B44 0%, #0B1E25 70%);
  border: 1px solid #16333B;
}
.video-cell::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.024) 0 1px, transparent 1px 3px);
}
.video-cell .vc-tag {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  font-size: 9px; color: #E6F3F1; background: rgba(0, 0, 0, .4);
  padding: 1px 5px; border-radius: 3px; display: flex; align-items: center; gap: 4px;
}
.video-cell .vc-tag i { width: 4px; height: 4px; border-radius: 50%; background: #FF4D3D; animation: blink 1.4s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.video-cell .vc-cam { position: absolute; inset: 0; display: grid; place-items: center; color: #2E5661; }
.video-cell .vc-cam svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.4; }
.video-cell .vc-name { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 7px 5px; font-size: 9.5px; color: #B9CFD5; background: linear-gradient(transparent, rgba(0,0,0,.5)); z-index: 2; }

/* 过滤行 */
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 27px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--line);
  background: #fff; font-size: 11.5px; color: #5C737C; display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
}
.chip:hover { border-color: #BFD5D6; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* 空状态 */
.empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 12px; }

/* 图例 */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--ink-2); }
.legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-right: 5px; }

/* 站点详情头 */
.site-hero {
  display: flex; align-items: center; gap: 16px; padding: 15px 18px;
  background: linear-gradient(100deg, #0D2B31 0%, #12454A 55%, #0E6E6C 100%);
  border-radius: var(--radius); color: #fff; margin-bottom: 14px; position: relative; overflow: hidden;
}
.site-hero::after {
  content: ''; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(47,196,178,.28), transparent 65%); border-radius: 50%;
}
.site-hero h2 { margin: 0; font-size: 17px; letter-spacing: .01em; }
.site-hero .sh-meta { font-size: 11.5px; color: #A8C6C9; margin-top: 5px; display: flex; gap: 14px; flex-wrap: wrap; }
.site-hero .sh-right { margin-left: auto; text-align: right; position: relative; z-index: 2; }
.site-hero .sh-right .big { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* 策略开关 */
.switch { width: 34px; height: 19px; border-radius: 10px; background: #D8E3E5; position: relative; cursor: pointer; transition: background .2s; flex: 0 0 34px; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch.on { background: var(--brand-2); }
.switch.on::after { transform: translateX(15px); }

/* 报表预览 */
.report-paper {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 26px 30px;
  box-shadow: 0 10px 30px -22px rgba(13, 31, 38, .5);
}
.report-paper h3 { margin: 0 0 4px; font-size: 16px; }
.report-paper .rp-sub { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.report-paper hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.rp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rp-kpi { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; }
.rp-kpi b { font-size: 19px; font-variant-numeric: tabular-nums; display: block; }
.rp-kpi span { font-size: 10.5px; color: var(--muted); }
.rp-text { font-size: 12px; line-height: 1.9; color: var(--ink-2); }
.rp-text b { color: var(--ink); }

/* =========================================================
 * 数据接入 / 权限标识 新增样式
 * ========================================================= */
.mode-chip {
  display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 20px; background: var(--ok-bg); color: var(--ok);
  font-size: 11px; border: 1px solid #CDEADF; white-space: nowrap;
}
.mode-chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(18, 133, 92, .14); }
.mode-chip.demo { background: var(--warn-bg); color: var(--warn); border-color: #F3E0BE; }
.mode-chip.off { background: var(--danger-bg); color: var(--danger); border-color: #F6D4D0; }

.role-tag {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px;
  border-radius: 5px; font-size: 10.5px; background: var(--brand-soft); color: var(--brand-d);
  border: 1px solid #CFE7E4; vertical-align: 1px;
}
.role-tag.ent { background: var(--info-bg); color: var(--info); border-color: #D3E1F8; }

.ds-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ds-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 15px; background: var(--surface); position: relative; }
.ds-card.on { border-color: #CFE7E4; box-shadow: inset 3px 0 0 var(--brand-2); }
.ds-card.off { background: var(--surface-2); opacity: .82; }
.ds-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.ds-name { font-size: 12.5px; font-weight: 600; line-height: 1.45; }
.ds-proto { font-family: Consolas, monospace; font-size: 10.5px; color: var(--brand-d); background: var(--brand-soft); padding: 1px 6px; border-radius: 4px; }
.ds-endpoint { font-family: Consolas, monospace; font-size: 11px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 6px; padding: 6px 8px; word-break: break-all; margin-bottom: 9px; }
.ds-meta { display: flex; gap: 14px; font-size: 11px; color: var(--muted); }
.ds-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ds-acts { display: flex; gap: 6px; margin-top: 11px; }
.ds-note { font-size: 10.5px; color: var(--muted); line-height: 1.7; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line-soft); }

.frame-viz {
  font-family: Consolas, "Courier New", monospace; font-size: 11px; line-height: 2;
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 12px 14px; color: var(--ink-2); overflow-x: auto; white-space: pre;
}
.frame-viz b { color: var(--brand); }
.frame-viz em { color: var(--danger); font-style: normal; }
.pkt-raw {
  font-family: Consolas, monospace; font-size: 11px; line-height: 1.75; color: #B9D3D8;
  background: #0B1E25; border-radius: 8px; padding: 11px 13px; margin: 0;
  white-space: pre-wrap; word-break: break-all;
}
.pkt-row { cursor: pointer; }
.pkt-row:hover td { background: var(--surface-2); }
.pkt-detail td { background: #FBFDFD; padding: 0 !important; }
.pkt-detail .inner { padding: 11px 13px; }
.crc-ok { color: var(--ok); }
.crc-bad { color: var(--danger); font-weight: 600; }

.stat-line { display: flex; align-items: center; gap: 8px; font-size: 11.5px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); }
.stat-line:last-child { border-bottom: 0; }
.stat-line span:first-child { color: var(--muted); flex: 1; }
.stat-line b { font-variant-numeric: tabular-nums; }

.notice-bar {
  display: flex; align-items: center; gap: 9px; padding: 9px 13px; border-radius: 9px;
  background: var(--info-bg); color: var(--info); font-size: 11.5px; border: 1px solid #D3E1F8;
}
.notice-bar.warn { background: var(--warn-bg); color: var(--warn); border-color: #F3E0BE; }
.notice-bar b { font-weight: 600; }
.notice-bar > svg { width: 15px; height: 15px; flex: 0 0 15px; }

.readonly-note { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }

@media (max-width: 1280px) {
  .ds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .ds-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 轻提示 */
.yw-toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(0);
  background: #0D1F26; color: #EAF4F5; padding: 10px 18px; border-radius: 22px;
  font-size: 12.5px; box-shadow: 0 10px 28px -10px rgba(13, 31, 38, .6); z-index: 999;
  opacity: 1; transition: opacity .4s, transform .4s; max-width: 70vw;
}
.yw-toast.err { background: #8E2119; }
.yw-toast.out { opacity: 0; transform: translateX(-50%) translateY(10px); }
.switch.locked { opacity: .45; cursor: not-allowed; }

/* =========================================================
 * 站点管理弹窗
 * ========================================================= */
.modal-mask {
  position: fixed; inset: 0; background: rgba(9, 26, 34, .42); z-index: 200;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px);
}
.modal {
  width: 540px; max-width: calc(100vw - 40px); background: var(--surface);
  border-radius: 14px; box-shadow: 0 24px 60px -18px rgba(9, 26, 34, .5);
  overflow: hidden; animation: modalIn .18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-hd { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 0; font-size: 14px; }
.modal-x { cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 7px; border-radius: 6px; }
.modal-x:hover { color: var(--ink); background: var(--surface-2); }
.modal-bd { padding: 14px 18px 4px; }
.modal-ft { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line-soft); margin-top: 10px; }
.f-row { flex: 1; margin-bottom: 10px; min-width: 0; }
.f-row label { display: block; font-size: 11.5px; color: var(--ink-2); margin-bottom: 5px; }
.f-row label i { color: var(--danger); font-style: normal; }
.f-row input, .f-row select {
  width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 10px; font-size: 12.5px; background: var(--surface); color: var(--ink); outline: none;
}
.f-row input:focus, .f-row select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 2px rgba(18, 165, 148, .12); }
.f-2col { display: flex; gap: 10px; }
.site-card.off { opacity: .58; }
.site-card.off .sc-name::after { content: '（已停用）'; font-weight: 400; color: var(--muted); font-size: 10.5px; }
.card-hd .btn-sm { flex-shrink: 0; }

/* 响应式 */
@media (max-width: 1280px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .sidebar { width: 64px; flex: 0 0 64px; }
  .brand-txt, .nav-group, .nav-item span, .nav-badge, .sidebar-foot span { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .brand { justify-content: center; padding: 18px 0 14px; }
  .g-2-1, .g-1-2, .g-1-1 { grid-template-columns: minmax(0, 1fr); }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .g4, .g3, .g5 { grid-template-columns: minmax(0, 1fr); }
  .tb-search { display: none; }
  .view { padding: 14px; }
  .board { grid-template-columns: minmax(0, 1fr); }
}

/* ===== 运维点位 / 工程师团队 ===== */
.pt-search {
  display: flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 10px; height: 29px; width: 196px; color: var(--muted);
}
.pt-search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 12px; color: var(--ink); }
.pt-search input::placeholder { color: #A6B7BD; }
.sel-inline {
  height: 28px; padding: 0 6px; border: 1px solid var(--line); border-radius: 7px;
  background: #fff; font-size: 11.5px; color: var(--ink); max-width: 148px; outline: none; cursor: pointer;
}
.sel-inline:hover { border-color: #BFD5D6; }
.sel-inline:focus { border-color: var(--brand-2); box-shadow: 0 0 0 2px rgba(18, 165, 148, .12); }
.cb { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }
