:root {
  --blue: #3d8bfd;
  --blue-dark: #1f6fe0;
  --blue-bg: #eaf2ff;
  --bg: #f5f6f8;
  --card: #fff;
  --line: #e5e6eb;
  --line-soft: #f2f3f5;
  --text: #1f2329;
  --sub: #86909c;
  --muted: #a1a7b0;
  --green: #23a55a;
  --orange: #f59e0b;
  --red: #f53f3f;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 13px; color: var(--text); background: var(--bg);
  display: flex; overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 13px; }
svg { flex-shrink: 0; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d9dce1; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #c4c8ce; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 侧边栏 ---------------- */
.sidebar {
  width: 200px; min-width: 200px; background: #fff; height: 100vh;
  display: flex; flex-direction: column; padding: 16px 12px 12px;
  border-right: 1px solid #eceef1;
}
.logo { display: flex; align-items: center; gap: 8px; padding: 2px 6px 0; }
.logo-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #4d97ff, #1f6fe0);
  display: flex; align-items: center; justify-content: center;
}
.logo-text { font-size: 16px; font-weight: 700; }
.menu-label { font-size: 10px; color: #b0b6bf; letter-spacing: 1px; margin: 22px 8px 6px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 8px; color: #4e5969; cursor: pointer; margin-bottom: 2px;
  user-select: none; font-size: 13.5px;
}
.menu-item:hover { background: #f2f5f9; }
.menu-item.active { background: var(--blue-bg); color: var(--blue-dark); font-weight: 600; }
.menu-item svg { width: 16px; height: 16px; }
.menu-badge {
  margin-left: auto; background: #ffece8; color: #f53f3f;
  font-size: 10px; padding: 1px 5px; border-radius: 8px; font-weight: 600;
}
.side-bottom { margin-top: auto; display: flex; flex-direction: column; }
.qr-box { text-align: center; padding: 10px 6px 4px; border-top: 1px solid #f0f1f4; }
.qr-img { width: 92px; height: 92px; margin: 6px auto 4px; display: block; }
.qr-tip { font-size: 11px; color: var(--sub); margin-bottom: 8px; }
.dl-btn {
  display: block; width: 100%; text-align: center; border: 1px solid var(--line);
  background: #fff; color: #4e5969; border-radius: 8px; padding: 7px 0;
  font-size: 12.5px; margin-bottom: 8px; cursor: pointer;
}
.dl-btn:hover { border-color: var(--blue); color: var(--blue-dark); }
.user-card { display: flex; align-items: center; gap: 9px; padding: 10px 8px; margin-top: 6px; border-top: 1px solid #f0f1f4; cursor: pointer; border-radius: 8px; }
.user-card:hover { background: #f7f8fa; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #e8f7ee;
  color: var(--green); font-weight: 700; display: flex; align-items: center;
  justify-content: center; font-size: 14px;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--sub); }
.logout { display: flex; align-items: center; gap: 8px; padding: 9px 10px; color: #4e5969; cursor: pointer; border-radius: 8px; }
.logout:hover { background: #f2f5f9; }

/* ---------------- 主区域 ---------------- */
.main { flex: 1; overflow-y: auto; padding: 18px 22px 26px; }
.view { display: none; }
.view.active { display: block; }
.page-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; padding-left: 2px; }
.page-title { font-size: 18px; font-weight: 700; }
.head-stat { font-size: 13px; color: var(--sub); }
.head-stat b { font-weight: 600; }
.head-stat .on { color: var(--green); }
.head-stat .off { color: var(--orange); }
.page-actions { margin-left: auto; display: flex; gap: 8px; }

.btn {
  height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: #4e5969; cursor: pointer; display: inline-flex;
  align-items: center; gap: 5px; white-space: nowrap;
}
.btn:hover { border-color: var(--blue); color: var(--blue-dark); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 1px 2px rgba(31,35,41,.04); }
.stat-label { font-size: 12px; color: var(--sub); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.stat-value small { font-size: 12px; color: var(--sub); font-weight: 400; margin-left: 4px; }
.stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.panel { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(31,35,41,.04); margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); font-weight: 600; }
.panel-head .btn { margin-left: auto; }
.panel-body { padding: 6px 16px 12px; }

/* 工具栏 */
.toolbar { background: #fff; border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 1px 2px rgba(31,35,41,.04); margin-bottom: 14px; }
.toolbar-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box {
  display: flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  border-radius: 8px; padding: 0 10px; height: 34px; background: #fff; min-width: 220px; flex: 0 1 250px;
}
.search-box:focus-within { border-color: var(--blue); }
.search-box input { border: none; outline: none; flex: 1; background: transparent; min-width: 0; }
.sel { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #4e5969; padding: 0 8px; outline: none; cursor: pointer; }
.sel:hover { border-color: #c9cdd4; }
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; height: 34px; }
.seg button { border: none; background: #fff; padding: 0 13px; color: #4e5969; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.seg button.active { background: var(--blue); color: #fff; }
.icon-btn {
  width: 34px; height: 34px; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #4e5969;
}
.icon-btn:hover { border-color: var(--blue); color: var(--blue-dark); }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 门店卡片 */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.card {
  background: #fff; border-radius: var(--radius); padding: 12px 13px 10px;
  box-shadow: 0 1px 2px rgba(31,35,41,.04); display: flex; flex-direction: column;
  border: 1px solid transparent; transition: box-shadow .15s, border-color .15s;
  position: relative; cursor: pointer;
}
.card:hover { box-shadow: 0 4px 14px rgba(31,35,41,.09); }
.card.selected { border-color: var(--blue); background: #fbfdff; }
.card-check {
  position: absolute; left: 10px; top: 10px; width: 15px; height: 15px;
  border: 1px solid var(--line); border-radius: 4px; background: #fff;
  display: none; align-items: center; justify-content: center; z-index: 2;
}
.card:hover .card-check, .card.selected .card-check { display: flex; }
.card-check input { display: none; }
.card-check svg { opacity: 0; }
.card-check.on { background: var(--blue); border-color: var(--blue); }
.card-check.on svg { opacity: 1; }
.card.top-off .card-top { opacity: .85; }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; padding-left: 20px; min-height: 18px; }
.dots { display: flex; gap: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #d4d7de; }
.dot.on { background: var(--green); }
.tag-on { background: var(--blue-bg); color: var(--blue-dark); font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.tag-off { color: var(--orange); font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 3px; }
.store-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.store-id { font-size: 12px; color: var(--sub); font-weight: 400; }
.remark-row { font-size: 11.5px; color: var(--muted); margin: 2px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-row { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #4e5969; line-height: 22px; white-space: nowrap; }
.card-row .k { color: var(--sub); }
.v-blue { color: var(--blue-dark); font-weight: 600; }
.plus { color: var(--blue-dark); font-size: 11px; }
.card-mid { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 2px; gap: 8px; }
.card-side { text-align: right; font-size: 11.5px; color: var(--muted); line-height: 18px; white-space: nowrap; }
.expire { color: var(--orange); }
.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line-soft); margin-top: 8px; padding-top: 7px;
  font-size: 12px; color: #4e5969; gap: 6px;
}
.card-foot .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-btn { border: none; background: #f2f3f5; color: var(--sub); min-width: 26px; height: 22px; border-radius: 6px; cursor: pointer; }
.more-btn:hover { background: var(--line); color: #4e5969; }

/* 卡片头部：编号徽章 + 名称 + 在线徽章 */
.store-head { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.store-no {
  flex: none; background: var(--green); color: #fff; font-size: 12px; font-weight: 700;
  padding: 1px 8px; border-radius: 5px; line-height: 18px; min-width: 26px; text-align: center;
}
.store-head .store-name { flex: 1 1 auto; }
.st-badge {
  flex: none; display: flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 20px; line-height: 16px;
}
.st-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-badge.on { background: #e8f7ee; color: #23a55a; }
.st-badge.off { background: #fdf1e7; color: var(--orange); }
.card-row .row-val { color: #1d2129; overflow: hidden; text-overflow: ellipsis; }
.card-row .row-right { margin-left: auto; color: var(--sub); font-size: 11.5px; flex: none; }
.copy-ic { flex: none; color: #c9cdd4; cursor: pointer; vertical-align: -1px; }
.copy-ic:hover { color: var(--blue); }
.more-fab {
  flex: none; width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--sub);
  font-size: 13px; letter-spacing: 1px; line-height: 1; padding: 0 0 3px;
  display: flex; align-items: center; justify-content: center;
}
.more-fab:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-bg); }

/* 卡片右下角 ··· 弹出菜单 */
.ctx-menu {
  position: fixed; z-index: 1200; min-width: 168px; padding: 5px;
  background: #fff; border: 1px solid var(--line-soft); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(31,35,41,.14); animation: ctxIn .12s ease-out;
}
@keyframes ctxIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ctx-item { padding: 8px 14px; font-size: 13px; color: #1d2129; cursor: pointer; border-radius: 6px; white-space: nowrap; }
.ctx-item:hover { background: #f5f6f8; }
.ctx-item.hl { color: var(--blue); font-weight: 600; }

/* ================= 概览（首页） ================= */
.ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 16px; }
.ov-card {
  background: #fff; border-radius: 10px; padding: 20px 22px 16px; cursor: pointer;
  box-shadow: 0 1px 3px rgba(31,35,41,.05); transition: box-shadow .15s, transform .15s;
}
.ov-card:hover { box-shadow: 0 6px 18px rgba(31,35,41,.10); transform: translateY(-1px); }
.ov-icon {
  width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.ov-icon.blue { background: #eaf0ff; color: #5b6ef5; }
.ov-icon.gray { background: #f2f3f5; color: #86909c; }
.ov-icon.green { background: #e7f9f0; color: #22c58e; }
.ov-num { font-size: 30px; font-weight: 700; color: #1d2129; letter-spacing: -.5px; line-height: 1.1; }
.ov-label { font-size: 13px; color: #4e5969; margin-top: 5px; font-weight: 500; }
.ov-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* 异常网吧红色面板 */
.alert-panel {
  background: #fff; border-radius: 10px; overflow: hidden; margin-bottom: 16px;
  border: 1px solid #fde3e3; box-shadow: 0 1px 3px rgba(31,35,41,.05);
}
.alert-head {
  display: flex; align-items: center; padding: 11px 16px;
  background: #fff5f5; border-bottom: 1px solid #fde3e3;
}
.alert-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: #d43030; }
.alert-title::before { content: '!'; width: 15px; height: 15px; border-radius: 50%; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; line-height: 15px; text-align: center; flex: none; }
.alert-badge {
  background: #e5484d; color: #fff; font-size: 11px; min-width: 18px; height: 18px;
  border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px;
}
.alert-head .btn { margin-left: auto; }
.alert-panel table { margin: 0; }
.alert-panel th { background: #fff; border-bottom: 1px solid #fde3e3; color: #d43030; }
.alert-panel tbody tr:hover { background: #fffafa; }
.st-no-red {
  display: inline-block; background: #fdecec; color: #e5484d; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 5px; margin-right: 8px; vertical-align: 1px;
}

/* 趋势图 */
.trend-sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 10px; }
.trend-legend { margin-left: auto; display: flex; gap: 16px; font-size: 12px; color: #4e5969; font-weight: 400; }
.trend-legend .lg { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.lg-store { background: #5b6ef5; }
.lg-off { background: #d9dce5; }
.lg-term { background: #22c58e; }

/* 趋势图悬停 tooltip */
#trendChart { position: relative; }
.trend-tip {
  position: absolute; z-index: 30; min-width: 158px; display: none;
  background: #fff; border-radius: 10px; padding: 10px 14px; pointer-events: none;
  box-shadow: 0 6px 22px rgba(31,35,41,.16), 0 0 0 1px rgba(31,35,41,.04);
}
.trend-tip .tt-date { font-size: 13px; font-weight: 700; color: #1d2129; margin-bottom: 7px; }
.trend-tip .tt-row {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: #4e5969; line-height: 22px; white-space: nowrap;
}
.trend-tip .tt-row i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.trend-tip .tt-row b { margin-left: auto; color: #1d2129; font-weight: 600; padding-left: 14px; }

/* 表格 */
.table-wrap { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(31,35,41,.04); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; padding: 10px 14px; color: var(--sub); font-weight: 500; background: #fafbfc; border-bottom: 1px solid #f0f1f4; white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid #f5f6f8; color: #4e5969; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f7faff; }
.st-on { color: var(--green); font-weight: 600; }
.st-off { color: var(--orange); font-weight: 600; }
.row-actions { display: flex; gap: 6px; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 14px; padding: 12px 4px 0; font-size: 12.5px; color: #4e5969; }
.page-btns { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.pg { min-width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; color: #4e5969; }
.pg.cur { background: var(--blue); border-color: var(--blue); color: #fff; }
.pg:hover:not(.cur):not(:disabled) { border-color: var(--blue); color: var(--blue-dark); }
.pg:disabled { opacity: .45; cursor: not-allowed; }

/* 抽屉 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.mask.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 760px; max-width: 94vw;
  background: #fff; z-index: 50; transform: translateX(102%); transition: transform .24s ease;
  display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0,0,0,.12);
}
.drawer.show { transform: translateX(0); }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: flex-start; gap: 10px; }
.drawer-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.drawer-sub { font-size: 12px; color: var(--sub); margin-top: 4px; }
.drawer-body { padding: 16px 20px 24px; overflow-y: auto; flex: 1; }

/* ================= 门店详情页（宽版） ================= */
.drawer.wide { width: min(1240px, 96vw); }
.detail-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-soft); margin-bottom: 14px; }
.detail-tab { padding: 8px 16px; font-size: 13px; color: var(--sub); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; user-select: none; }
.detail-tab:hover { color: var(--text); }
.detail-tab.active { color: #1d6fe8; border-bottom-color: #1d6fe8; font-weight: 600; }

.server-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.server-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #4e5969; background: #f2f7ff; border: 1px solid #d6e6ff; border-radius: 8px; padding: 5px 12px; }
.server-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #23a55a; }

.top-cards { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 18px; }
@media (max-width: 1100px) { .top-cards { grid-template-columns: 1fr 1fr; } }

.top-card { background: #fff; border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px; position: relative; min-height: 168px; display: flex; flex-direction: column; }
.top-card .tc-link { position: absolute; top: 12px; right: 12px; font-size: 11.5px; color: #86909c; cursor: pointer; }
.top-card .tc-link:hover { color: #1d6fe8; }
.tc-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.tc-icon { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.tc-desc { font-size: 12px; color: #86909c; margin-top: 6px; line-height: 1.6; }
.tc-nums { display: flex; gap: 18px; margin-top: 12px; }
.tc-num b { font-size: 20px; font-weight: 700; }
.tc-num span { display: block; font-size: 11.5px; color: #86909c; margin-top: 2px; }
.tc-foot { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.tc-bar { height: 5px; border-radius: 3px; background: #f0f1f4; overflow: hidden; }
.tc-bar i { display: block; height: 100%; border-radius: 3px; background: #23a55a; }
.tc-bar-label { font-size: 11px; color: #86909c; display: flex; justify-content: space-between; }
.tc-actions { margin-top: auto; padding-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* 服务器画面卡 */
.srv-view { position: relative; border-radius: 10px; overflow: hidden; background: #10141a; flex: 1; min-height: 110px; }
.srv-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.srv-view img.ready { opacity: 1; }
.srv-view .srv-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #5d6673; font-size: 12.5px; }
.srv-view .srv-meta { position: absolute; left: 10px; bottom: 8px; color: #e5e8ec; font-size: 11.5px; text-shadow: 0 1px 3px rgba(0,0,0,.8); line-height: 1.5; }
.srv-view .srv-ver { position: absolute; right: 8px; top: 8px; background: rgba(0,0,0,.55); color: #dfe3e8; font-size: 10.5px; border-radius: 5px; padding: 2px 7px; }
.srv-view .srv-btns { position: absolute; left: 10px; bottom: 8px; display: flex; gap: 6px; }
.srv-btn { height: 24px; padding: 0 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,.28); background: rgba(0,0,0,.45); color: #fff; font-size: 11.5px; cursor: pointer; backdrop-filter: blur(3px); }
.srv-btn:hover { background: rgba(0,0,0,.65); }
.srv-btn.primary { background: #1d6fe8; border-color: #1d6fe8; }
.srv-btn.primary:hover { background: #1a5fc7; }

/* 客户机板块 */
.cli-section { margin-top: 4px; }
.cli-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cli-search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; height: 32px; background: #fff; width: 260px; }
.cli-search input { border: none; outline: none; flex: 1; font-size: 12.5px; background: transparent; }

.cli-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 12px; }
.cli-card { position: relative; border-radius: 10px; overflow: hidden; background: #10141a; aspect-ratio: 16/9.6; cursor: pointer; }
.cli-card img.shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cli-card .ver-chip { position: absolute; right: 6px; top: 6px; background: rgba(0,0,0,.55); color: #dfe3e8; font-size: 10px; border-radius: 4px; padding: 1px 6px; z-index: 2; }
.cli-card .cli-name { position: absolute; left: 10px; bottom: 34px; color: #fff; font-size: 15px; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.9); z-index: 2; }
.cli-card .cli-sub { position: absolute; left: 10px; bottom: 14px; color: #cfd6dd; font-size: 11px; text-shadow: 0 1px 4px rgba(0,0,0,.9); z-index: 2; }
.cli-card .cli-btns { position: absolute; left: 8px; bottom: 8px; display: none; gap: 6px; z-index: 3; }
.cli-card:hover .cli-btns { display: flex; }
.cli-card .cli-btns .srv-btn { height: 26px; font-size: 11px; }
.cli-card.offline { background: #e8eaee; }
.cli-card.offline .off-hint { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #9aa1ab; font-size: 12px; z-index: 1; }
.cli-num { position: absolute; left: 10px; top: 8px; right: 64px; color: #fff; font-size: 14px; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.9); z-index: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.cli-live { position: absolute; left: 10px; top: 30px; display: inline-flex; align-items: center; gap: 5px; background: rgba(0,0,0,.45); color: #7be3a2; font-size: 10px; border-radius: 5px; padding: 2px 7px; z-index: 2; }
.cli-live i { width: 6px; height: 6px; border-radius: 50%; background: #23a55a; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.cli-card.offline .cli-name, .cli-card.offline .cli-sub { color: #4e5969; text-shadow: none; }
.cli-card.offline .cli-num { color: #9aa1ab; text-shadow: none; }
.cli-card.offline .ver-chip { background: rgba(255,255,255,.75); color: #86909c; }
.close-btn { margin-left: auto; border: none; background: transparent; cursor: pointer; color: var(--sub); font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.close-btn:hover { background: #f2f3f5; }
.kv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; margin-bottom: 16px; }
.kv { font-size: 12.5px; }
.kv .k { color: var(--sub); margin-bottom: 3px; }
.kv .v { font-weight: 600; word-break: break-all; }
.token-box { display: flex; align-items: center; gap: 8px; background: #f7f8fa; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; font-family: Consolas, monospace; font-size: 12px; color: #4e5969; margin-bottom: 16px; }
.token-box span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.section-title { font-size: 13px; font-weight: 600; margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title .btn { margin-left: auto; }

/* 弹窗 */
.modal {
  position: fixed; z-index: 60; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.97);
  background: #fff; border-radius: 14px; width: 460px; max-width: 92vw; max-height: 86vh;
  display: none; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal.show { display: flex; animation: pop .18s ease forwards; }
@keyframes pop { to { transform: translate(-50%, -50%) scale(1); } }
.modal-head { padding: 16px 18px 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; }
.modal-body { padding: 14px 18px 6px; overflow-y: auto; }
.modal-foot { padding: 12px 18px 16px; display: flex; gap: 8px; justify-content: flex-end; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--sub); margin-bottom: 5px; }
.field input[type=text], .field input[type=number], .field input[type=password], .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none; background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); }
.field textarea { resize: vertical; min-height: 74px; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.6; }
.check-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.check-list label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.check-list label:hover { background: #f7f8fa; }

/* 批量操作条 */
.batch-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, calc(100% + 60px));
  background: #1f2329; color: #fff; border-radius: 12px; padding: 10px 12px 10px 16px;
  display: flex; align-items: center; gap: 8px; z-index: 55;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: transform .22s ease;
}
.batch-bar.show { transform: translate(-50%, 0); }
.batch-bar .cnt { font-size: 12.5px; margin-right: 6px; color: #d5d8dd; }
.batch-bar .btn { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; height: 30px; }
.batch-bar .btn:hover { background: rgba(255,255,255,.22); color: #fff; }
.batch-bar .btn.primary { background: var(--blue); }
.batch-bar .clear { margin-left: 4px; cursor: pointer; color: #a9aeb6; padding: 0 4px; }

/* 提示 */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #fff; border-radius: 10px; padding: 9px 16px; font-size: 13px;
  box-shadow: 0 6px 20px rgba(31,35,41,.14); display: flex; align-items: center; gap: 8px;
  animation: slideDown .2s ease; border-left: 3px solid var(--green);
}
.toast.err { border-left-color: var(--red); }
.toast.info { border-left-color: var(--blue); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } }

.empty { text-align: center; color: var(--muted); padding: 50px 0; font-size: 13px; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 20px; font-size: 11px; background: #f2f3f5; color: var(--sub); }
.badge.warn { background: #fff7e8; color: var(--orange); }
.badge.dan { background: #ffece8; color: var(--red); }
.badge.ok { background: #e8f7ee; color: var(--green); }
.term-ver-old { color: var(--orange); }

/* 登录页 */
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }
.login-box { width: 360px; background: #fff; border-radius: 16px; padding: 30px 30px 26px; box-shadow: 0 10px 40px rgba(31,35,41,.1); }
.login-logo { display: flex; align-items: center; gap: 9px; justify-content: center; margin-bottom: 6px; }
.login-title { font-size: 19px; font-weight: 700; }
.login-sub { text-align: center; font-size: 12.5px; color: var(--sub); margin: 6px 0 22px; }
.login-box .field input { height: 40px; }
.login-btn { width: 100%; height: 42px; border: none; border-radius: 10px; background: var(--blue); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.login-btn:hover { background: var(--blue-dark); }
.login-tip { margin-top: 16px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }
.login-err { color: var(--red); font-size: 12.5px; min-height: 18px; margin-bottom: 6px; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { padding: 14px; }
}

/* ---------------- 侧边栏接入命令 ---------------- */
.agent-cmd {
  font-family: Consolas, monospace; font-size: 10.5px; color: #86909c;
  background: #f7f8fa; border: 1px dashed #e5e6eb; border-radius: 6px;
  padding: 6px 7px; margin-bottom: 8px; word-break: break-all; line-height: 1.5;
  text-align: left;
}

/* ---------------- 远程桌面 ---------------- */
.rd {
  position: fixed; inset: 0; z-index: 90; background: #0b0d10;
  display: none; flex-direction: column;
}
.rd.show { display: flex; }
.rd-bar {
  height: 46px; background: #14181d; color: #e5e8ec;
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border-bottom: 1px solid #23282f; flex-shrink: 0; font-size: 13px;
}
.rd-dot { width: 8px; height: 8px; border-radius: 50%; background: #23a55a; box-shadow: 0 0 6px #23a55a; }
.rd-meta { font-size: 11.5px; color: #8b949e; }
.rd-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.rd-btn {
  height: 28px; padding: 0 12px; border-radius: 6px; border: 1px solid #2c333b;
  background: #1d232a; color: #c9d1d9; cursor: pointer; font-size: 12px;
}
.rd-btn:hover { background: #262d36; border-color: #3d4650; }
.rd-quality { appearance: auto; width: auto; padding-right: 6px; }
.rd-btn.danger { border-color: #6b2b2b; color: #ff9c9c; }
.rd-btn.danger:hover { background: #3a1f1f; }
.rd-input {
  height: 28px; width: 230px; border-radius: 6px; border: 1px solid #2c333b;
  background: #0f1419; color: #e5e8ec; padding: 0 10px; outline: none; font-size: 12.5px;
}
.rd-input:focus { border-color: #3d8bfd; }
.rd-stage {
  flex: 1; position: relative; overflow: hidden; display: flex;
  align-items: center; justify-content: center; cursor: default; outline: none;
}
.rd-stage img { max-width: 100%; max-height: 100%; display: none; user-select: none; }
.rd-stage img.ready { display: block; }
.rd-hint { position: absolute; color: #6b7280; font-size: 13px; }
.rd-hint.hide { display: none; }
.rd:fullscreen .rd-bar { display: none; }
.rd-stage:fullscreen { background: #000; }

/* ---------------- 进程 / 文件面板 ---------------- */
.pane-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pane-table th { position: sticky; top: 0; background: #fafbfc; z-index: 1; }
.pane-scroll { max-height: 52vh; overflow: auto; border: 1px solid #f0f1f4; border-radius: 8px; }
.crumb { font-family: Consolas, monospace; font-size: 12px; color: #4e5969; background: #f7f8fa; border-radius: 6px; padding: 6px 10px; margin-bottom: 8px; word-break: break-all; }
.file-row { cursor: pointer; }
.file-row:hover td { background: #f7faff; }
.mono { font-family: Consolas, monospace; }
.dim { color: #86909c; }

/* 门店接入码 */
.code-box { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.code-box b {
  font-family: Consolas, monospace; font-size: 19px; letter-spacing: 2px;
  color: #1d6fe8; background: #f2f7ff; border: 1px dashed #b9d3fb;
  border-radius: 7px; padding: 5px 10px; flex: 1; text-align: center;
}
