/* style.css - Device Monitor (Apple Style System Status) */
:root { color-scheme: light; }

* { box-sizing: border-box; }

html { background: #f5f7fb; }
html.dark { background: #06101d; }
/* Full-viewport backdrop: a real fixed element so the day/night base color
   repaints reliably on iOS when switching theme (overscroll area otherwise
   keeps the old color until a reload). */
.theme-backdrop { position: fixed; inset: 0; z-index: -1; background: #f5f7fb; }
html.dark .theme-backdrop { background: #06101d; }

/* 无 view_note 权限时，隐藏设备备注（用户）列与相关展示 */
body.no-view-note .td-user,
body.no-view-note .td-note,
body.no-view-note .dev-note,
body.no-view-note .mob-dev-note,
body.no-view-note .live-room-note,
body.no-view-note .bulk-device-note,
body.no-view-note th.th-user,
body.no-view-note .overview-card-user,
body.no-view-note .ss-note-row { display: none !important; }
/* 个人主页：对所有登录用户可见（不受 no-view-note 隐藏影响），与 Live 状态分隔 */
.ss-homepage-row { margin-top: 6px; }

/* --- 「預備中」徽标：首页「状况」列里紧挨「放送中」显示 ---
   形态与 .live-badge 完全对称（同尺寸/圆角/字重/圆点+发光），只把绿色换成橙色、
   闪得更快一点（1s vs 1.4s），表示"还没开播、正在预备"。 */
.prep-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #ea580c;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #f97316;
  animation: prepPulse 1s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(249, 115, 22, 0.6);
  vertical-align: middle;
  letter-spacing: .02em;
  white-space: nowrap;
  cursor: pointer;
}
.prep-badge:hover { filter: brightness(1.12); text-decoration: underline; }
.prep-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f97316;
  animation: prepDot 1s ease-in-out infinite;
  box-shadow: 0 0 6px #f97316;
  display: inline-block;
  vertical-align: middle;
  margin-right: 2px;
}
@keyframes prepPulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.22), inset 0 0 4px rgba(249, 115, 22, 0.08);
    text-shadow: 0 0 8px rgba(249, 115, 22, 0.6);
  }
  50% {
    opacity: .5;
    box-shadow: 0 0 3px rgba(249, 115, 22, 0.08);
    text-shadow: none;
  }
}
@keyframes prepDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: .5; }
}
body.dark .prep-badge { color: #fb923c; border-color: #fb923c; }
body.dark .prep-badge::before { background: #fb923c; box-shadow: 0 0 6px #fb923c; }

/* --- 直播设置：批量勾选设备（紧凑列表，非卡片）--- */
.bulk-pick-toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0;
}
.bulk-device-list {
  max-height: 260px; overflow-y: auto;
  border: 1px solid #e2e8f0; border-radius: 8px;
  background: #fff; padding: 4px;
}
.bulk-device-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 6px; font-size: 13px;
  cursor: pointer; min-width: 0;
}
.bulk-device-row:hover { background: #f1f5f9; }
.bulk-device-row input[type="checkbox"] { flex: 0 0 auto; margin: 0; }
.bulk-device-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bulk-device-note { color: #0284c7; font-size: 12px; white-space: nowrap; }
.bulk-device-tag {
  margin-left: auto; flex: 0 0 auto;
  font-size: 11px; color: #64748b;
  background: #f1f5f9; border: 1px solid #e2e8f0;
  border-radius: 999px; padding: 1px 7px;
}
body.dark .bulk-device-list { background: #131c31; border-color: #1e293b; }
body.dark .bulk-device-row:hover { background: #1e293b; }
body.dark .bulk-device-note { color: #38bdf8; }
body.dark .bulk-device-tag { color: #94a3b8; background: #0f172a; border-color: #1e293b; }
body {
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: transparent; /* 关键：底色交给 html（明暗由 html.dark 控制），让 z-index:-1 的背景层可见，绝不被 body 实心底色吃掉 */
  color: #0f172a;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ===== Header ===== */
header {
  padding: 24px 20px 14px;
  border-bottom: 1px solid #e5e5e7;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ===== Layout ===== */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.main { padding: 18px 20px 40px; }
.row { display: flex; align-items: center; gap: 10px; }
.toolbar { display: flex; justify-content: flex-start; align-items: center; gap: 16px; flex-wrap: wrap; }
.toolbar > div:first-child { min-width: 0; }
.toolbar .row { margin-left: auto; }
.title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.site-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  flex: 0 0 auto;
}
.muted { color: #64748b; font-size: 13px; }

/* ===== Header loading: 电脑互联 animation ===== */
.status-loading { display: inline-flex; align-items: center; gap: 6px; }
.status-logo { display: block; }
.status-logo .sl-dev-l { animation: slPulseL 1.6s ease-in-out infinite; transform-origin: 9px 12px; }
.status-logo .sl-dev-r { animation: slPulseR 1.6s ease-in-out infinite; transform-origin: 35px 12px; }
.status-logo .sl-sig { animation: slFlow 1s linear infinite; }
.status-logo .sl-packet { animation: slPacket 1.5s ease-in-out infinite; }
@keyframes slPulseL { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes slPulseR { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes slFlow { to { stroke-dashoffset: -12; } }
@keyframes slPacket {
  0% { transform: translateX(0); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateX(12px); opacity: 0; }
}
body.dark .status-logo .sl-sig { stroke: #64748b; }

/* ===== PWA 开屏动画（logo + 电脑连接动画，无虚化背景） ===== */
.pwa-splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: #f5f7fb;
  transition: opacity .5s ease, visibility .5s ease;
}
.dark .pwa-splash { background: #06101d; }
.pwa-splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.pwa-splash-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pwa-splash-logo { opacity: .95; }
.pwa-splash-anim { display: block; }
.pwa-splash-anim .sl-dev-l { animation: slPulseL 1.6s ease-in-out infinite; transform-origin: 9px 12px; }
.pwa-splash-anim .sl-dev-r { animation: slPulseR 1.6s ease-in-out infinite; transform-origin: 35px 12px; }
.pwa-splash-anim .sl-sig { animation: slFlow 1s linear infinite; }
.pwa-splash-anim .sl-packet { animation: slPacket 1.5s ease-in-out infinite; }
.dark .pwa-splash-anim .sl-sig { stroke: #64748b; }
.pwa-splash-title { font-size: 20px; font-weight: 700; color: #0f172a; letter-spacing: .04em; }
.dark .pwa-splash-title { color: #e2e8f0; }
.pwa-splash-status { font-size: 13px; color: #64748b; }

/* ===== Header status dot (after load) ===== */
.hs-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: hsPulse 1.8s ease-out infinite;
}
@keyframes hsPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ===== Cards / Stats ===== */
.grid.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card {
  background: #fff;
  border: 1px solid #e5e5e7;
  border-radius: 18px;
  padding: 16px;
  text-align: center;
}
.card .muted { font-size: 12px; margin-bottom: 6px; }
.stat-num { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat-num.green { color: #16a34a; }
.stat-num.red { color: #dc2626; }
.stat-num.yellow { color: #d97706; }

/* ===== Panels ===== */
.top-panels { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.panel {
  background: #fff;
  border: 1px solid #e5e5e7;
  border-radius: 18px;
  padding: 16px;
}
.panel-title { font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 10px; }
.section { margin-top: 14px; }

/* ===== Table ===== */
.table-wrap { overflow: visible; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 8px; color: #64748b; font-weight: 600; border-bottom: 1px solid #e5e5e7; }
td { padding: 10px 8px; border-bottom: 1px solid #f0f0f2; vertical-align: top; }
tr:hover td { background: #f8fafc; }
.empty { text-align: center; color: #94a3b8; padding: 40px 20px; }

/* ===== Status dot ===== */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.15); }
.status-dot.offline { background: #ef4444; }

/* ===== Pills ===== */
.pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pill-blue { background: #f3f4f6; color: #6b7280; font-size: 10px; font-weight: 600; }

/* ===== Mono ===== */
.mono { font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace; }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 6px; }
.tab {
  background: transparent;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
}
.tab.active { background: #0f172a; color: #fff; }

/* ===== Views ===== */
.view { display: none; }
.view.active { display: block; }

/* ===== Buttons ===== */
.btn {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn.warn { background: #fef3c7; color: #b45309; border-color: #fde68a; }

/* ===== Split layout ===== */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ===== KV / Overview ===== */
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; }

/* ===== Dark overrides for new classes ===== */
body.dark .card { background: #0f172a; border-color: #223041; }
body.dark .panel { background: #0f172a; border-color: #223041; }
body.dark .tab.active { background: #1d4ed8; color: #fff; }
body.dark th { color: #8ea0b8; border-bottom-color: #223041; }
body.dark td { border-bottom-color: #1e293b; }
body.dark tr:hover td { background: #111827; }
body.dark .btn { background: #132038; color: #e8f0ff; border-color: #2b3545; }
body.dark .btn.primary { background: #1d4ed8; border-color: #1d4ed8; }
body.dark .btn.warn { background: #451a03; color: #fcd34d; border-color: #78350f; }
body.dark .empty { color: #64748b; }

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .grid.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-panels { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid.cards { grid-template-columns: 1fr 1fr; }
  .wrap { padding: 0 14px; }
  .main { padding: 14px 14px 30px; }
}

.refresh-fab {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 9999;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #0f172a;
  font-size: 12px;
  border: 1px solid #dbe3ef;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
  backdrop-filter: blur(8px);
}

.refresh-fab:hover { opacity: .82; }

.ss-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  text-align: left;
}

.ss-title { font-size: 32px; font-weight: 700; letter-spacing: -.02em; }

.ss-overall {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #e5e5e7;
  border-radius: 999px;
  background: #fff;
  color: #1d1d1f;
  font-weight: 600;
}

.ss-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  color: #64748b;
  font-size: 14px;
}

.ss-meta b { color: #0f172a; font-weight: 700; }

/* Overall progress bar */
.overall-bar-wrap { margin-top: 14px; max-width: 460px; width: 100%; }

.overall-bar {
  height: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  display: flex;
}

.bar-online { background: #22c55e; transition: width .6s ease; }
.bar-offline { background: #ef4444; transition: width .6s ease; }

.bar-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ===== Main grid ===== */
main { padding: 24px 20px 40px; max-width: 1280px; margin: 0 auto; }

.ss-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 4px;
}

.ss-col {
  background: #fff;
  border: 1px solid #e5e5e7;
  border-radius: 22px;
  padding: 18px 18px 10px;
}

.ss-col-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }

.ss-col-title .col-count {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.ss-col-title .col-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}

.col-status.all-online { background: #dcfce7; color: #16a34a; }
.col-status.some-offline { background: #fee2e2; color: #dc2626; }

.ss-device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.ss-device {
  display: flex;
  width: 100%;
  break-inside: avoid;
  border: 0;
  border-top: 1px solid #f0f0f2;
  background: transparent;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.ss-device:first-of-type { border-top: 0; }
.ss-device:hover { opacity: .82; }

.ss-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}

.ss-dot-offline {
  animation: ssOfflineBlink 1.8s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, .55);
}

@keyframes ssOfflineBlink {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, .12), 0 0 8px rgba(239, 68, 68, .30);
  }
  50% {
    opacity: .28;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .10), 0 0 14px rgba(239, 68, 68, .52);
  }
}

.ss-name-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.ss-name {
  font-size: 15px;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.ss-name .alias-mark { color: #94a3b8; font-size: .8em; margin-left: 3px; }

.ss-offline-for { font-size: 12px; color: #b91c1c; font-weight: 700; }

.ss-sub-sep { color: #cbd5e1; font-size: 11px; margin: 0 2px; }

.ss-suffix-mini {
  font-size: 10px;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 999px;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-region-mini {
  font-size: 11px;
  color: #475569;
  background: #f1f5f9;
  padding: 1px 7px;
  border-radius: 999px;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-note-tag {
  font-size: 11px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.ss-mon-mini {
  font-size: 11px;
  font-weight: 700;
  color: #7c3aed;
  background: #f5f3ff;
  padding: 1px 7px;
  border-radius: 999px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: #64748b;
}

.empty-icon { color: #94a3b8; margin-bottom: 16px; }
.empty-state h2 { font-size: 18px; color: #0f172a; margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .32);
  backdrop-filter: blur(6px) saturate(150%);
  -webkit-backdrop-filter: blur(6px) saturate(150%);
  animation: fadeIn .18s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: #fff;
  border-radius: 24px;
  border: 1px solid #e5e5e7;
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .18);
  animation: slideUp .22s ease;
  overflow: hidden;
}

@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 14px;
  border-bottom: 1px solid #f0f0f2;
}

.modal-title-wrap { min-width: 0; }

.modal-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }

.modal-sub { font-size: 11px; color: #64748b; margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; line-height: 1.25; }

.modal-close {
  background: #f1f5f9;
  border: none;
  font-size: 20px;
  color: #475569;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
  line-height: 1;
  padding: 0;
}

.modal-close:hover { background: #e2e8f0; }

.modal-body { padding: 18px 24px 24px; overflow-y: auto; }

/* Tabs */
.modal-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 18px;
}

.modal-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}

.modal-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .1);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Detail grid (Apple style key-value) */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 6px 0;
}

.ss-k { font-size: 12px; color: #64748b; margin-bottom: 4px; }
.ss-v { font-size: 14px; word-break: break-word; overflow-wrap: anywhere; font-weight: 500; }

.ss-v.online-text { color: #16a34a; font-weight: 700; }
.ss-v.offline-text { color: #dc2626; font-weight: 700; }

.offline-periods { grid-column: 1 / -1; margin-bottom: 8px; }
.offline-periods h5 { font-size: 12px; color: #64748b; margin: 0 0 6px; font-weight: 500; }
.offline-period-item { font-size: 13px; color: #dc2626; padding: 3px 0; border-bottom: 1px dashed #e2e8f0; }
.offline-period-item:last-child { border-bottom: none; }

/* Network speed cards */
.net-speed-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }

.net-speed-card {
  background: #f8fafc;
  border: 1px solid #e5e5e7;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.net-speed-label { font-size: 12px; color: #64748b; margin-bottom: 6px; }

.net-speed-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: #0f172a; }

.section-title { font-size: 14px; font-weight: 700; margin: 20px 0 10px; color: #0f172a; }
.section-title.danger { color: #dc2626; }

/* IP history (with checkbox + region + suffix) */
.ip-history { display: flex; flex-direction: column; gap: 0; }

.ss-v-region {
  font-size: 12px;
  color: #64748b;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 500;
  margin-top: 2px;
}

/* Monitors block in device detail */
.screen-monitors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}
.mon-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  min-width: 0;
}
.mon-item:first-of-type {
  border-top: 1px solid #e2e8f0;
}
.mon-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.mon-sub {
  padding-left: 28px;
}
.mon-badge {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mon-name {
  font-size: 13px;
  color: #1e293b;
  font-weight: 600;
  min-width: 0;
  word-break: break-word;
}
.mon-primary {
  font-size: 10px;
  color: #16a34a;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
  margin-left: 4px;
}
.mon-res {
  display: inline-flex;
  font-size: 12px;
  color: #64748b;
  font-family: ui-monospace, Consolas, monospace;
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 6px;
}
.mon-res-empty {
  color: #94a3b8;
}
@media (max-width: 420px) {
  .screen-monitors {
    grid-template-columns: 1fr;
  }
}


.ip-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-top: 1px solid #f0f0f2;
  font-size: 13px;
  cursor: pointer;
}

.ip-history-item:hover { background: #f8fafc; }

.ip-history-item:first-of-type { border-top: 0; }

.ip-check {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  accent-color: #2563eb;
  cursor: pointer;
}

.ip-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.ip-history-item .ip-addr {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.ip-history-item .ip-current {
  background: #dcfce7;
  color: #16a34a;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ip-suffix-tag {
  background: #f3f4f6;
  color: #6b7280;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ip-first-tag {
  background: #eff6ff;
  color: #2563eb;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ip-region { color: #64748b; font-size: 12px; }
.ip-region.unknown { color: #94a3b8; }

.ip-history-item .ip-time {
  color: #94a3b8;
  font-size: 11px;
  text-align: right;
  flex: 0 0 auto;
  line-height: 1.5;
}

/* IP suffix toolbar */
.ip-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e5e5e7;
  border-radius: 12px;
}

.ip-toolbar-info { font-size: 12px; color: #64748b; font-weight: 600; }

.ip-toolbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

#ip-suffix-input {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  width: 180px;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}

#ip-suffix-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.btn-sm { padding: 7px 14px !important; font-size: 12px !important; }

.btn-ghost {
  background: #fff;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}

.btn-ghost:hover { background: #f1f5f9; }

.loading-text { color: #94a3b8; font-size: 13px; }

/* Timeline: 3 days, hourly cells */
.timeline-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
}

.lg { display: inline-flex; align-items: center; gap: 5px; }

.lg-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.lg-dot.on { background: linear-gradient(180deg, #4ade80, #16a34a); }
.lg-dot.off { background: linear-gradient(180deg, #fda4af, #f87171); }
.lg-dot.nodata { background: #eef2f7; border: 1px solid #e2e8f0; }
.lg-dot.future { background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 2px, #e2e8f0 2px, #e2e8f0 4px); }

.timeline-days { display: flex; flex-direction: column; gap: 10px; }

.tl-day-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: center;
}

.tl-day-label {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: #64748b;
  line-height: 1.5;
  min-width: 0;
}

.tl-day-label b { color: #0f172a; font-size: 12px; white-space: nowrap; }

.tl-cells {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 2px;
}

.tl-cell {
  height: 18px;
  border-radius: 3px;
  background: #eef2f7;
  cursor: default;
  transition: transform .1s;
}

.tl-cell:hover { transform: scale(1.25); }

.tl-cell.on { background: linear-gradient(180deg, #4ade80, #16a34a); }
.tl-cell.off { background: linear-gradient(180deg, #fda4af, #f87171); }
.tl-cell.nodata { background: #eef2f7; }
.tl-cell.future { background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 3px, #e2e8f0 3px, #e2e8f0 6px); }

.tl-hour-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #94a3b8;
  margin-top: 4px;
  margin-left: 130px;
}

/* Edit form */
.edit-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label { font-size: 13px; font-weight: 600; color: #0f172a; }

.form-hint { font-weight: 400; color: #94a3b8; font-size: 12px; }

.form-group input,
.form-group textarea {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #f8fafc;
  transition: border-color .15s, background .15s;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  align-self: flex-start;
}

.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { background: #93c5fd; cursor: default; }

.save-status { font-size: 13px; color: #16a34a; font-weight: 600; margin-left: 10px; }

/* Danger zone */
.danger-zone {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #f0f0f2;
}

.danger-desc { font-size: 13px; color: #64748b; margin: 0 0 12px; }

.btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}

.btn-danger:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .ss-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .ss-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ss-title { font-size: 26px; }
}

@media (max-width: 560px) {
  .ss-grid { grid-template-columns: 1fr; }
  .ss-device-grid { grid-template-columns: 1fr; }
  .ss-title { font-size: 22px; }
  .modal-card { max-height: calc(100vh - 24px); border-radius: 18px; }
  /* 设备详情弹窗的「总览」网格：保留 2 列（每列约 160px，足够显示中文+数字），
     避免 16 个字段全部纵向一列要拖动很久。
     此处不要改 1fr——之前在这里 1fr 是导致用户抱怨"拖动好多东西"的根因。 */
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  .net-speed-row { grid-template-columns: 1fr; }
  .tl-day-row { grid-template-columns: 86px 1fr; }
  .tl-day-label b { font-size: 11px; white-space: normal; }
  .tl-cell { height: 14px; }
  .tl-hour-scale { margin-left: 96px; }
  .ip-toolbar { flex-direction: column; align-items: stretch; }
  .ip-toolbar-actions { width: 100%; }
  #ip-suffix-input { flex: 1; width: auto; }
}

/* ===== Hardware ===== */
.hardware-disks { display: flex; flex-direction: column; gap: 12px; }

.disk-list { display: flex; flex-direction: column; gap: 12px; }

.disk-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* USB 设备列表（硬件页） */
.usb-item { padding: 10px 14px; gap: 4px; }
.usb-item.is-phone {
  background: #f0fdf4;
  border-color: #86efac;
}
body.dark .usb-item.is-phone {
  background: #052e16;
  border-color: #15803d;
}
.usb-phone-badge { margin-left: 4px; font-weight: 400; }

/* 列表/卡片里的手机图标：绿色=当前插着手机，灰色=7 天内曾有但已断开 */
.usb-phone-icon {
  width: 13px;
  height: 13px;
  flex: none;
  margin-left: 4px;
  vertical-align: -1px;
  cursor: default;
}
.usb-phone-icon.on { color: #16a34a; }
.usb-phone-icon.off { color: #94a3b8; opacity: 0.85; }
body.dark .usb-phone-icon.on { color: #4ade80; }
body.dark .usb-phone-icon.off { color: #64748b; }
/* 投屏软件（QtScrcpy / scrcpy）连着手机：青蓝色，和「USB 插着」的绿区分开 */
.usb-phone-icon.mirror.on { color: #0891b2; }
.usb-phone-icon.mirror.off { color: #cbd5e1; }
body.dark .usb-phone-icon.mirror.on { color: #22d3ee; }
body.dark .usb-phone-icon.mirror.off { color: #64748b; }
/* USB 上插着手机但还没投屏 —— 琥珀色，表示「可以投」 */
.usb-phone-icon.attached.on { color: #f59e0b; }
body.dark .usb-phone-icon.attached.on { color: #fbbf24; }
.mirror-on { color: #0891b2; }
.mirror-off { color: #94a3b8; }
/* ⚠️ 掉了手机：USB 插着手机但投屏软件连不上 → 红色 + 中间感叹号 */
.usb-phone-icon.dropped { color: #ef4444; }
body.dark .usb-phone-icon.dropped { color: #f87171; }
.mirror-attached { color: #b45309; }
body.dark .mirror-attached { color: #fbbf24; }
body.dark .mirror-on { color: #22d3ee; }
body.dark .mirror-off { color: #8ea0b8; }
/* ⚠️ 这里的修饰类名必须避开主题容器类名（.tile / .apple / .minimal 等），
   否则容器样式会被套到图标上：图标变隐形且撑高度 */
.usb-phone-icon.mob,
.usb-phone-icon.apple,
.usb-phone-icon.minimal,
.usb-phone-icon.tile-ic { width: 12px; height: 12px; }
.usb-phone-icon.ss { width: 15px; height: 15px; }

/* 移动端展开详情：MAC 右侧的手机型号 */
.mob-phone-model {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  font-size: 12px;
  font-weight: 600;
  max-width: 100%;
}
.mob-phone-model .usb-phone-icon { margin-left: 0; width: 12px; height: 12px; }
.mob-phone-model-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mob-phone-model.on { color: #16a34a; }
.mob-phone-model.off { color: #94a3b8; }
body.dark .mob-phone-model.on { color: #4ade80; }
body.dark .mob-phone-model.off { color: #64748b; }

.disk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.disk-drive {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.disk-drive::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.disk-size { color: #64748b; font-weight: 500; font-size: 13px; }

.disk-bar-wrap {
  position: relative;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.disk-bar { position: absolute; left: 0; top: 0; height: 100%; border-radius: 999px; transition: width .4s ease; }
/* 比上次多占用的部分：同色系更深的一档（最小 5px + 亮色分隔线，细小增量也看得见） */
.disk-bar-inc {
  position: absolute;
  top: 0;
  height: 100%;
  min-width: 5px;
  background: #14532d;
  border-left: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
  transition: width .4s ease, left .4s ease;
}
body.dark .disk-bar-inc { background: #4ade80; border-left-color: rgba(6, 40, 20, .85); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
body.dark .disk-bar-inc.disk-inc-warn { background: #fb923c; border-left-color: rgba(67, 20, 7, .85); }
body.dark .disk-bar-inc.disk-inc-danger { background: #f87171; border-left-color: rgba(69, 10, 10, .85); }

.disk-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
}

body.dark .disk-item { background: #0f172a; border-color: #223041; }
body.dark .disk-bar-wrap { background: #1e293b; }

/* Scrollbar */
.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-thumb { background: #d3d9e3; border-radius: 4px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }

/* ===== Login Page ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #f5f7fb;
}

.login-card {
  background: #fff;
  border-radius: 22px;
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, .06);
  text-align: center;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: #f0f7ff;
  border-radius: 18px;
  margin-bottom: 16px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #0f172a;
}

.login-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 24px;
}

.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }

.login-form .form-group { gap: 5px; }

.login-form .form-group label { font-size: 13px; font-weight: 600; color: #0f172a; }

.login-form .form-group input {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  background: #f8fafc;
  transition: border-color .15s, background .15s;
  width: 100%;
}

.login-form .form-group input:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.login-remember {
  font-size: 13px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-remember input { accent-color: #2563eb; }

.login-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  margin-top: 4px;
}

.login-btn:hover { background: #1d4ed8; }
.login-btn:disabled { background: #93c5fd; cursor: default; }

.login-error {
  font-size: 13px;
  color: #dc2626;
  font-weight: 600;
  text-align: center;
  min-height: 18px;
}

/* 登录页语言选择 */
.login-lang {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #eef2f8;
  display: flex;
  justify-content: center;
}
body.dark .login-lang { border-top-color: #223041; }
.login-lang-select {
  width: 100%;
  max-width: 220px;
  padding: 9px 12px;
  font-size: 13px;
  text-align: center;
}

/* ===== User Menu ===== */
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
}

.btn-logout {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}

.btn-logout:hover { background: #e2e8f0; }

/* ===== Theme toggle button ===== */
.theme-toggle {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .15s;
  flex: 0 0 auto;
  line-height: 1;
  padding: 0;
}
.theme-toggle:hover { background: #e2e8f0; transform: scale(1.06); }

/* ============================================================
   Dark theme (参考 check.heytee.top 备份站配色)
   ============================================================ */
body.dark { color-scheme: dark; }
body.dark {
  background: linear-gradient(180deg, #06101d, #0b1220);
  color: #e5eefb;
}

/* Header */
body.dark header {
  background: rgba(7, 17, 31, .92);
  border-bottom-color: #223041;
}
body.dark .ss-title { color: #e5eefb; }
body.dark .ss-meta { color: #8ea0b8; }
body.dark .ss-meta b { color: #e5eefb; }

/* Overall pill + bar */
body.dark .ss-overall {
  background: #0f172a;
  border-color: #223041;
  color: #e8f0ff;
}
body.dark .overall-bar { background: #1e293b; }
body.dark .bar-legend { color: #8ea0b8; }

/* Columns / cards */
body.dark .ss-col {
  background: linear-gradient(180deg, rgba(15,23,42,.96), rgba(15,23,42,.9));
  border-color: #223041;
}
body.dark .ss-col-title { color: #e5eefb; }
body.dark .ss-col-title .col-count { color: #8ea0b8; }
body.dark .col-status.all-online { background: #073b1e; color: #bbf7d0; }
body.dark .col-status.some-offline { background: #3b0b0b; color: #fecaca; }

/* Device rows */
body.dark .ss-device { border-top-color: #223041; color: #e5eefb; }
body.dark .ss-name { color: #e5eefb; }
body.dark .ss-name .alias-mark { color: #64748b; }
body.dark .ss-sub-sep { color: #475569; }
body.dark .ss-offline-for { color: #f87171; }
body.dark .ss-suffix-mini { background: #1f2937; color: #9ca3af; }
body.dark .ss-region-mini { background: #172033; color: #bfd3ef; }
body.dark .ss-note-tag { color: #8ea0b8; }
body.dark .ss-mon-mini { background: #2a1a4a; color: #c4b5fd; }

/* Empty state */
body.dark .empty-state { color: #8ea0b8; }
body.dark .empty-state h2 { color: #e5eefb; }

/* Modal */
body.dark .modal-card {
  background: #0f172a;
  border-color: #223041;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
}
body.dark .modal-header { border-bottom-color: #223041; }
body.dark .modal-title { color: #e5eefb; }
body.dark .modal-sub { color: #8ea0b8; }
body.dark .modal-close { background: #1e293b; color: #bfd3ef; }
body.dark .modal-close:hover { background: #2b3545; }
body.dark .modal-tabs { background: #111827; }
body.dark .modal-tab { color: #8ea0b8; }
body.dark .modal-tab.active { background: #1d4ed8; color: #fff; box-shadow: none; }

/* Detail grid */
body.dark .ss-k { color: #8ea0b8; }
body.dark .ss-v { color: #e5eefb; }
body.dark .ss-v-region { color: #8ea0b8; }
body.dark .section-title { color: #e5eefb; }
body.dark .offline-periods h5 { color: #8ea0b8; }
body.dark .offline-period-item { color: #f87171; border-bottom-color: #2b3545; }

/* Network speed cards */
body.dark .net-speed-card { background: #111827; border-color: #223041; }
body.dark .net-speed-label { color: #8ea0b8; }
body.dark .net-speed-value { color: #e5eefb; }

/* Monitors block */
body.dark .mon-item { border-color: #223041; background: #111827; }
body.dark .mon-badge { background: #172554; color: #bfdbfe; }
body.dark .mon-name { color: #e5eefb; }
body.dark .mon-primary { background: #073b1e; color: #bbf7d0; border-color: #14532d; }
body.dark .mon-res { background: #0f172a; color: #8ea0b8; border-color: #223041; }

/* IP history */
body.dark .ip-history-item { border-top-color: #223041; }
body.dark .ip-history-item:hover { background: #111827; }
body.dark .ip-history-item .ip-addr { color: #e5eefb; }
body.dark .ip-history-item .ip-current { background: #073b1e; color: #bbf7d0; }
body.dark .ip-suffix-tag { background: #1f2937; color: #9ca3af; }
body.dark .ip-first-tag { background: #172554; color: #93c5fd; }
body.dark .ip-region { color: #8ea0b8; }
body.dark .ip-toolbar { background: #111827; border-color: #223041; }
body.dark .ip-toolbar-info { color: #8ea0b8; }
body.dark #ip-suffix-input { background: #0b1526; border-color: #2b3545; color: #e5eefb; }

/* Buttons */
body.dark .btn-ghost { background: #132038; color: #e8f0ff; border-color: #2b3545; }
body.dark .btn-ghost:hover { background: #1c2a45; }
body.dark .btn-danger { background: #3b0b0b; color: #fecaca; border-color: #7f1d1d; }
body.dark .btn-danger:hover { background: #dc2626; color: #fff; }
body.dark .btn-logout { background: #132038; color: #e8f0ff; border-color: #2b3545; }
body.dark .btn-logout:hover { background: #1c2a45; }
body.dark .theme-toggle { background: #132038; color: #e8f0ff; border-color: #2b3545; }
body.dark .theme-toggle:hover { background: #1c2a45; }
body.dark .user-menu { color: #bfd3ef; }

/* Timeline */
body.dark .timeline-legend { color: #8ea0b8; }
body.dark .tl-day-label { color: #8ea0b8; }
body.dark .tl-day-label b { color: #e5eefb; }
body.dark .tl-cell { background: #1e293b; }
body.dark .tl-cell.on { background: linear-gradient(180deg, #22c55e, #15803d); }
body.dark .tl-cell.off { background: linear-gradient(180deg, #ef4444, #b91c1c); }
body.dark .tl-cell.nodata { background: #1e293b; }
body.dark .tl-cell.future { background: repeating-linear-gradient(45deg, #111827, #111827 3px, #1e293b 3px, #1e293b 6px); }
body.dark .lg-dot.nodata { background: #1e293b; border-color: #2b3545; }
body.dark .lg-dot.future { background: repeating-linear-gradient(45deg, #111827, #111827 2px, #1e293b 2px, #1e293b 4px); }
body.dark .tl-hour-scale { color: #64748b; }

/* Edit form */
body.dark .form-group label { color: #e5eefb; }
body.dark .form-group input,
body.dark .form-group textarea {
  background: #0b1526;
  border-color: #2b3545;
  color: #e5eefb;
}
body.dark .form-group input:focus,
body.dark .form-group textarea:focus { background: #0f1a2e; }
body.dark .danger-zone { border-top-color: #223041; }
body.dark .danger-desc { color: #8ea0b8; }
body.dark .loading-text { color: #64748b; }

/* Refresh fab */
body.dark .refresh-fab {
  background: rgba(15, 23, 42, .92);
  color: #e5eefb;
  border-color: #2b3545;
}

/* Scrollbar */
body.dark .modal-body::-webkit-scrollbar-thumb { background: #2b3545; }

/* Login page */
body.dark .login-page { background: linear-gradient(180deg, #06101d, #0b1220); }
body.dark .login-card { background: #0f172a; border: 1px solid #223041; }
body.dark .login-logo { background: #172033; }
body.dark .login-title { color: #e5eefb; }
body.dark .login-subtitle { color: #8ea0b8; }
body.dark .login-form .form-group label { color: #e5eefb; }
body.dark .login-form .form-group input { background: #0b1526; border-color: #2b3545; color: #e5eefb; }
body.dark .login-form .form-group input:focus { background: #0f1a2e; }
body.dark .login-remember { color: #bfd3ef; }

/* ============================================================
   Power events log
   ============================================================ */
.power-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #475569;
}
.lg-dot.pw-boot { background: #22c55e; }
.lg-dot.pw-shutdown { background: #ef4444; }
.lg-dot.pw-suspend { background: #f59e0b; }
.lg-dot.pw-resume { background: #3b82f6; }
.lg-dot.pw-agent { background: #8b5cf6; }

.power-events-list {
  max-height: 380px;
  overflow-y: auto;
}

.pw-event {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid #f1f5f9;
  font-size: 13px;
}
.pw-event:first-child { border-top: none; }

.pw-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex: 0 0 auto;
}
.pw-icon.boot { background: #22c55e; }
.pw-icon.shutdown { background: #ef4444; }
.pw-icon.suspend { background: #f59e0b; }
.pw-icon.resume { background: #3b82f6; }
.pw-icon.agent_start { background: #8b5cf6; }
.pw-icon.agent_stop { background: #64748b; }
.pw-icon.default { background: #94a3b8; }

.pw-body { flex: 1; min-width: 0; }
.pw-time {
  font-size: 11px;
 color: #64748b; font-size: 12px; margin-bottom: 2px; }
.pw-label {
  font-size: 11px;
 font-weight: 600; color: #1e293b; }
.pw-reason {
  font-size: 10px;
 color: #64748b; font-size: 12px; margin-top: 1px; }

body.dark .pw-event { border-top-color: #223041; }
body.dark .pw-time {
  font-size: 11px;
 color: #8ea0b8; }

/* ============================================================
   Device management: IP groups + compact grid
   ============================================================ */
#group-panels {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  align-items: start;
}
.group-block {
  margin-bottom: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.group-title {
  font-weight: 700;
  font-size: 13px;
  color: #334155;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.group-count { color: #64748b; font-weight: 500; }
.group-device-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.dev-check-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  font-size: 12px;
}
.dev-check-card:hover { background: #f1f5f9; }
.dev-check-card input { cursor: pointer; }
.dev-check-card-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.dev-check-card-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.dev-check-card-mac {
  color: #94a3b8;
  font-size: 10px;
  text-align: right;
}

body.dark .group-block { background: #0f172a; border-color: #223041; }
body.dark .group-title { color: #e5eefb; }
body.dark .group-count { color: #8ea0b8; }
body.dark .dev-check-card { background: #111827; border-color: #223041; color: #e5eefb; }
body.dark .dev-check-card:hover { background: #1e293b; }
body.dark .dev-check-card-mac { color: #64748b; }

@media (max-width: 1200px) {
  #group-panels { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .group-device-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .group-device-grid { grid-template-columns: 1fr; }
}

/* Table row device name link */
.row-device-name { color: #2563eb; text-decoration: none; font-weight: 600; display:inline-flex; align-items:center; justify-content:center; gap:6px; text-align:center; }
.row-device-name:hover { text-decoration: underline; }
body.dark .row-device-name { color: #60a5fa; }

/* Small button */
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 10px; }
.btn-clear { background:#f1f5f9; color:#475569; border-color:#e2e8f0; }
body.dark .btn-clear { background:#1e293b; color:#94a3b8; border-color:#334155; }
body.dark .pw-label {
  font-size: 11px;
 color: #e5eefb; }
body.dark .pw-reason {
  font-size: 10px;
 color: #8ea0b8; }

/* ============================================================
   TikTok Live badge + sessions
   ============================================================ */
.live-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  background: #22c55e;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 0 7px;
  border-radius: 999px;
  vertical-align: middle;
  animation: livePulse 1.4s ease-in-out infinite;
}
body.dark .live-count-badge { background: #22c55e; color: #fff; }

.day-count-label { color: #64748b; font-size: 13px; font-weight: 500; }
.day-count-badge {
  display: inline-block;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  min-width: 14px;
  text-align: center;
}
body.dark .day-count-label { color: #94a3b8; }
body.dark .day-count-badge { color: #e2e8f0; }
.live-room-ended-tag {
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}
body.dark .live-room-ended-tag { background: #1e293b; color: #94a3b8; border-color: #334155; }
/* 「最近结束」里标记该设备结束上一场后又开了新的一场 */
.live-room-relive-tag {
  color: #b45309;
  font-size: 10px;
  font-weight: 600;
  background: #fef3c7;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #fde68a;
  white-space: nowrap;
}
body.dark .live-room-relive-tag { background: #422c0b; color: #fbbf24; border-color: #78350f; }
.live-timeline-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.live-timeline-chips::-webkit-scrollbar { height: 6px; }
.live-timeline-chips::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.live-timeline-chips::-webkit-scrollbar-track { background: transparent; }
.live-timeline-chip {
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, border-color .15s, color .15s;
}
.live-timeline-chip:hover { border-color: #94a3b8; }
.live-timeline-chip.active { background: #22c55e; color: #fff; border-color: #22c55e; }
.live-timeline-chip-count {
  background: rgba(0,0,0,0.08);
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}
.live-timeline-chip.active .live-timeline-chip-count { background: rgba(255,255,255,0.28); }
body.dark .live-timeline-chip { background: #1e293b; color: #cbd5e1; border-color: #334155; }
body.dark .live-timeline-chip:hover { border-color: #475569; }
body.dark .live-timeline-chip.active { background: #22c55e; color: #fff; border-color: #22c55e; }
body.dark .live-timeline-chips::-webkit-scrollbar-thumb { background: #334155; }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #16a34a;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #22c55e;
  animation: livePulse 1.4s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.2), inset 0 0 4px rgba(57, 255, 20, 0.08);
  vertical-align: middle;
  margin-left: 4px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: liveDot 1.4s ease-in-out infinite;
  box-shadow: 0 0 6px #22c55e;
  display: inline-block;
  vertical-align: middle;
  margin-right: 2px;
}

@keyframes livePulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.2), inset 0 0 4px rgba(57, 255, 20, 0.08);
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
  }
  50% {
    opacity: 0.88;
    box-shadow: 0 0 22px rgba(57, 255, 20, 0.5), inset 0 0 10px rgba(57, 255, 20, 0.18);
    text-shadow: 0 0 16px rgba(57, 255, 20, 0.9), 0 0 28px rgba(57, 255, 20, 0.35);
  }
}

@keyframes liveDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.6; }
}

/* Monitor icon with count number */
.monitor-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin-left: 2px;
}
.monitor-icon svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  color: #64748b;
}
.monitor-icon-num {
  position: absolute;
  z-index: 1;
  top: 5px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  color: #475569;
  line-height: 1;
}
body.dark .monitor-icon svg { color: #8ea0b8; }
body.dark .monitor-icon-num { color: #cbd5e1; }

/* Status cell stack (default theme table) */
.status-cell-stack {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.apple-dev-mon .monitor-icon { margin-left: 0; }
.apple-dev-mon .monitor-icon svg { color: inherit; opacity: 0.7; }
.apple-dev-mon .monitor-icon-num { color: inherit; opacity: 0.9; }

/* Status cell wrapper ("状况" column) */
.status-cell-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Live status cards in modal */
.live-status-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.live-status-card {
  background: #f8fafc;
  border: 1px solid #e5e5e7;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.live-status-label { font-size: 12px; color: #64748b; margin-bottom: 6px; }
.live-status-value { font-size: 18px; font-weight: 700; color: #0f172a; }

/* Live sessions list */
.live-sessions-list {
  max-height: 320px;
  overflow-y: auto;
}

.live-session-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid #f1f5f9;
  font-size: 13px;
}
.live-session-item:first-child { border-top: none; }

.live-session-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #39ff14;
  margin-top: 4px;
  flex: 0 0 auto;
  box-shadow: 0 0 6px #39ff14;
}

.live-session-body { flex: 1; min-width: 0; }
.live-session-time { font-weight: 600; color: #1e293b; }
.live-session-dur { color: #64748b; font-size: 12px; margin-top: 2px; }

/* 云手机使用时段：与直播段合并展示在同一时间线，用青色区分（取色同「云手机使用中」） */
.live-session-dot.cp {
  background: #06b6d4;
  box-shadow: 0 0 6px rgba(6, 182, 212, .8);
}
.cp-session-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #06b6d4;
  background: rgba(34, 211, 238, .12);
  border: 1px solid rgba(34, 211, 238, .35);
  border-radius: 999px;
  padding: 0 6px;
  margin-right: 4px;
  vertical-align: 1px;
}
.live-now-text { color: #16a34a; font-weight: 700; }
.live-now-text.cp { color: #06b6d4; }

/* Dark theme */
body.dark .live-badge {
  background: transparent;
  border-color: #4ade80;
  color: #4ade80;
}
body.dark .live-status-card { background: #111827; border-color: #223041; }
body.dark .live-status-label { color: #8ea0b8; }
body.dark .live-status-value { color: #e5eefb; }
body.dark .live-session-item { border-top-color: #223041; }
body.dark .live-session-time { color: #e5eefb; }
body.dark .live-session-dur { color: #8ea0b8; }
body.dark .live-session-dot.cp { background: #67e8f9; box-shadow: 0 0 6px rgba(103, 232, 249, .8); }
body.dark .cp-session-tag { color: #67e8f9; background: rgba(103, 232, 249, .12); border-color: rgba(103, 232, 249, .3); }
body.dark .live-now-text { color: #4ade80; }
body.dark .live-now-text.cp { color: #67e8f9; }

/* Responsive */
@media (max-width: 560px) {
  .live-status-row { grid-template-columns: 1fr; }
}



.theme-select {
  background: #fff;
  color: #0f172a;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
}
body.dark .theme-select {
  background: #132038;
  color: #e8f0ff;
  border-color: #2b3545;
}
.lang-select {
  background: #fff;
  color: #0f172a;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
  max-width: 168px;
}
body.dark .lang-select {
  background: #132038;
  color: #e8f0ff;
  border-color: #2b3545;
}
.view-toggle {
  display: none;
  gap: 4px;
  align-items: center;
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  padding: 3px;
}
.view-toggle button {
  border: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.view-toggle button.active { background: #3b82f6; color: #fff; }
body.dark .view-toggle { background: #132038; border-color: #2b3545; }
body.dark .view-toggle button { color: #e8f0ff; }
body.dark .view-toggle button.active { background: #3b82f6; color: #fff; }
@media (min-width: 641px) and (pointer: coarse) {
  .view-toggle { display: inline-flex; }
  .btn-logout { display: none; }
}
/* Heatmap tap tooltip (mobile has no hover) */
#heat-tip {
  position: fixed;
  z-index: 9999;
  display: none;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
  padding: 6px 10px;
  border-radius: 9px;
  max-width: 72vw;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  pointer-events: none;
  white-space: normal;
  word-break: break-word;
}
body.dark #heat-tip { background: #0f172a; color: #e8f0ff; border: 1px solid #2b3545; }
@media (hover: none) {
  .speed-slot, .live-slot { cursor: pointer; }
  .speed-slot:active, .live-slot:active { outline: 2px solid #3b82f6; outline-offset: 1px; }
}
.apple-dashboard {
  margin-top: 14px;
}
.apple-hero, .apple-group-card {
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.98));
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 12px 40px rgba(15,23,42,.08);
  /* 防止网格/弹性子项默认 min-width:auto 撑破视口（设备名 nowrap 时） */
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
}
.apple-hero-top, .apple-group-head, .group-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.apple-hero-title { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.apple-hero-sub, .apple-group-meta, .apple-progress-legend, .apple-dev-sub, .nav-card span { color: #64748b; font-size: 13px; }
.apple-overall-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px;
  background: #f8fafc; border: 1px solid #e2e8f0; font-weight: 700;
}
.apple-meta-row, .apple-progress-legend {
  display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px;
}
.apple-progress { margin-top: 14px; height: 10px; background: #e5e7eb; border-radius: 999px; overflow: hidden; display:flex; }
.apple-progress-on { background: #22c55e; }
.apple-progress-off { background: #ef4444; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display:inline-block; margin-right:6px; }
.legend-dot.on { background:#22c55e; }
.legend-dot.off { background:#ef4444; }
.live-legend-item { display:inline-flex; align-items:center; gap:6px; color:#22c55e; font-weight:600; }
body.dark .live-legend-item { color:#4ade80; }
.prep-legend-item { display:inline-flex; align-items:center; gap:6px; color:#f97316; font-weight:600; }
body.dark .prep-legend-item { color:#fb923c; }
.prep-bottom-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f97316;
  animation: prepDot 1s ease-in-out infinite;
  box-shadow: 0 0 6px #f97316;
}
body.dark .prep-bottom-dot { background: #fb923c; box-shadow: 0 0 6px #fb923c; }
.apple-group-grid, .nav-grid {
  display: grid; gap: 14px; margin-top: 14px;
}
.nav-grid { grid-template-columns: repeat(4, 1fr); }
/* 多列布局（而非 grid）：设备按「竖向」排列 —— 先填满第一列再往右，
   无需预先知道设备数量，浏览器自动按内容平衡各列高度。 */
.apple-dev-grid {
  columns: 4;
  column-gap: 10px;
  margin-top: 10px;
}
.apple-dev-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  border: none;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  min-height: 0;
  white-space: nowrap;
  overflow: hidden;
  /* 多列布局：单个设备条目不允许被拆到两列 */
  width: 100%;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
.apple-dev-item:hover { background: rgba(0,0,0,.04); }
.apple-dev-idx { display: none; }
.apple-dev-text { display:flex; align-items:center; gap:2px; min-width:0; overflow:hidden; }
/* 分组占满整行后单格很宽（~350px），字号保持原大小即可完整显示 */
.apple-dev-name { font-weight: 700; font-size: 13px; color: #0f172a; white-space: nowrap; }
.apple-dev-suffix { font-size: 12px; color: #94a3b8; white-space: nowrap; }
.apple-dev-offline { font-size: 11px; color: #be123c; margin-left: 4px; white-space: nowrap; }
.apple-icon-live { width: 14px; height: 14px; color: #22c55e; flex-shrink:0; animation: appleIconBlink 1.3s ease-in-out infinite; }
.apple-icon-screen-alert { width: 14px; height: 14px; color: #ef4444; flex-shrink:0; }
@keyframes appleIconBlink { 0%,100%{opacity:1} 50%{opacity:.25} }
body.dark .apple-dev-name { color: #e2e8f0; }
body.dark .apple-dev-suffix { color: #64748b; }
body.dark .apple-dev-offline { color: #fda4af; }
body.dark .apple-icon-live { color: #4ade80; }

/* 首页「放送中」指示器：点击跳转到该设备详情的 Live */
.apple-live-trigger { cursor: pointer; display: inline-flex; align-items: center; padding: 2px; margin: -2px -2px -2px 2px; border-radius: 6px; }
.apple-live-trigger:hover { background: rgba(34,197,94,0.16); }
.apple-live-dur {
  color: #16a34a; font-size: 9px; font-weight: 700; line-height: 1;
  margin-left: 2px; white-space: nowrap; flex-shrink: 0;
}
body.dark .apple-live-dur { color: #4ade80; }
.live-badge-live { cursor: pointer; }
.live-badge-live:hover { filter: brightness(1.1); text-decoration: underline; }
.minimal-rec-frame[data-minimal-live] { cursor: pointer; border-radius: 8px; }
.minimal-rec-frame[data-minimal-live]:hover { background: rgba(34,197,94,0.14); }
body.dark .apple-icon-screen-alert { color: #f87171; }
body.dark .apple-dev-item:hover { background: rgba(255,255,255,.05); }
.apple-dev-offline { font-size: 11px; color: #be123c; font-weight: 700; }
.apple-dev-stack { display:flex; flex-direction:column; gap:4px; min-width:0; flex:1; }
.apple-dev-name { font-weight: 700; }
.apple-dev-state { font-size: 12px; font-weight: 700; color: #475569; }
.dev-suffix { font-size: 10px; font-weight: 600; color: #6b7280; background:#f3f4f6; padding:1px 6px; border-radius:999px; }
.dev-note { font-size: 10px; font-weight: 600; color: #2563eb; background:#eff6ff; padding:1px 6px; border-radius:999px; margin-left:2px; }
body.dark .dev-note { background:#1e3a5f; color:#93c5fd; }
/* 直播时间段/实时网速 设备名：绝对在一行（设备名 + 后缀 + 用户 + 红色昵称） */
/* 设备名行：固定在设备列宽内、单行；超长整体省略，避免溢出压到首个热力图方块 */
.dev-name-line { white-space: nowrap; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.dev-homepage-nick { font-size: 9px; font-weight: 700; color: #fe2c55; background:#fff0f3; padding:1px 6px; border-radius:999px; margin-left:2px; vertical-align: bottom; }
body.dark .dev-homepage-nick { background:#3a1620; color:#ff7a98; }
/* 位置页说明：机柜层编号含义提示（底层=1 中层=2 上层=3），红色突出；
   word-spacing 拉开各项间隔（HTML 连续空格会被折叠，只能靠 CSS），便于分清三项 */
.md-hint-red { color:#fe2c55; font-weight:600; margin-right:8px; word-spacing:12px; }
body.dark .md-hint-red { color:#ff7a98; }

/* OS column color levels */
.os-name { color: #3b82f6; font-weight: 600; }
.uptime-badge { font-weight: 700; }
.uptime-green { color: #16a34a; }
.uptime-purple { color: #9333ea; }
.uptime-orange { color: #f59e0b; }
.uptime-red { color: #ef4444; }
.uptime-blink { animation: uptimeBlink 1.2s ease-in-out infinite; }
@keyframes uptimeBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
body.dark .os-name { color: #60a5fa; }
body.dark .uptime-green { color: #4ade80; }
body.dark .uptime-purple { color: #c084fc; }
body.dark .uptime-orange { color: #fbbf24; }
body.dark .uptime-red { color: #f87171; }

.nav-card {
  border: 1px solid #e5e7eb; background: #fff; border-radius: 18px; padding: 18px; text-align:left; cursor:pointer; font:inherit;
  display:flex; flex-direction:column; gap:8px;
}
.nav-card.static { cursor: default; }
.nav-card strong { font-size: 17px; }
.ip-group-block { border-left: 3px solid #2563eb; padding-left: 12px; }
/* Viettel 等可能设置了分流的 IP：同步后缀前给出警示（红字） */
.ip-warn-viettel { margin: 8px 0 2px; padding: 6px 10px; font-size: 12px; line-height: 1.5; font-weight: 600;
  color: #dc2626; background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; }
body.dark .ip-warn-viettel { color: #f87171; background: #3a1717; border-color: #7f1d1d; }
/* 未分组区块：独占整行，钉在设备管理最下方 */
.ungrouped-block { grid-column: 1 / -1; border-left: 3px solid #f59e0b; padding-left: 12px; }
.ungrouped-block .group-title { flex-wrap: wrap; }
.ug-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.ug-group-sel {
  font-size: 12px; padding: 4px 6px; border-radius: 8px; max-width: 150px;
  border: 1px solid #e2e8f0; background: #fff; color: #334155;
}
.ug-empty { padding: 6px 2px; font-size: 12px; }
body.dark .ug-group-sel { background: #0f172a; border-color: #334155; color: #e5eefb; }
body.apple-theme .panel, body.apple-theme .card {
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(15,23,42,.06);
}
body.apple-theme {
  background: linear-gradient(180deg, #f4f7fb 0%, #eef4ff 100%);
}
body.dark.apple-theme {
  background: linear-gradient(180deg, #020617 0%, #0f172a 100%);
}
body.dark .apple-hero, body.dark .apple-group-card, body.dark .nav-card {
  background: rgba(15,23,42,.88); border-color:#223041; box-shadow:none;
}
body.dark .apple-overall-pill { background:#132038; border-color:#2b3545; color:#e8f0ff; }
body.dark .dev-suffix { background:#1f2937; color:#9ca3af; }

#stat-cards, .top-panels { display: none !important; }
.dashboard-filters-panel { margin-top: 14px; }
#dashboard-table-wrap { margin-top: 14px; }
body:not(.apple-theme) .apple-dashboard .apple-group-grid { display: none; }
body:not(.apple-theme) .apple-hero {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,250,252,.98));
}
body.dark:not(.apple-theme) .apple-hero {
  background: rgba(15,23,42,.92);
  border-color: #223041;
  box-shadow: none;
}

.live-badge-apple { margin-left: 2px; }
.apple-dev-sub .live-badge-apple { vertical-align: middle; }

.screen-alert-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 2px 5px;
  border-radius: 999px;
  background: #fff1f2;
  color: #be123c;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  vertical-align: middle;
}
.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Screen block in modal */
.screen-block {
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.screen-header {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
}
.screen-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.screen-alert-summary {
  font-size: 13px;
  color: #be123c;
  display: flex;
  align-items: center;
  gap: 8px;
}
.screen-alert-reasons {
  font-weight: 600;
}
.screen-ok-summary {
  font-size: 13px;
  color: #16a34a;
  font-weight: 600;
}
body.dark .screen-header { color: #e5eefb; }
body.dark .screen-toggles { background: #111827; border-color: #223041; }
body.dark .screen-alert-summary { color: #fda4af; }
body.dark .screen-ok-summary { color: #bbf7d0; }

/* Apple theme device card screen line */
.apple-dev-mon {
  font-size: 12px;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.apple-dev-mon.alert {
  color: #be123c;
}
.apple-dev-mon.alert .apple-mon-text {
  font-weight: 600;
}
body.dark .apple-dev-mon {
  color: #8ea0b8;
}
body.dark .apple-dev-mon.alert {
  color: #fda4af;
}

/* Live cam badge (recorder icon only, no border, no text) */
.live-cam-badge {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: #22c55e;
  line-height: 1;
  padding: 0;
  border: none;
}
.live-cam-badge svg {
  width: 14px;
  height: 14px;
  color: #22c55e;
  animation: liveBlink 1.4s ease-in-out infinite;
}
.live-cam-text { display: none; }
@keyframes liveBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.apple-dev-item .status-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
}
body.dark .screen-alert-badge {
  background:#3f0d19;
  color:#fda4af;
}

/* Live bottom bar (broadcasting count at bottom of dashboard) */
.live-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #22c55e;
  background: transparent;
  color: #22c55e;
  font-size: 13px;
  font-weight: 600;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.live-bottom-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: liveBlink 1.2s ease-in-out infinite;
}
body.dark .live-bottom-bar {
  border-color: #22c55e;
  color: #22c55e;
}
body.dark .live-bottom-dot {
  background: #22c55e;
}
/* 分组卡片在所有宽度下都是 1 列（占满整行），故不再需要分档改列数 */
@media (max-width: 640px) {
  /* 手机端：一个分组占满整行，区域内 3 列设备。
     相比原来的「2 分组 × 2 列」，每行设备数从 4 减到 3，
     单格宽度从 ~73px 增到 ~110px，避免设备名/后缀挤压换行。 */
  /* 全部方块（hero / 分组卡 / 设备栏）统一锁到视口宽度，避免任何方块超出画面；
     同时让「其他方块」与「设备栏」等宽对齐。 */
  .apple-dashboard { max-width: 100%; overflow-x: hidden; }
  .apple-hero, .apple-group-card { max-width: 100%; min-width: 0; }
  .apple-group-grid { grid-template-columns: 1fr; min-width: 0; }
  .apple-dev-grid { columns: 3; column-gap: 6px; min-width: 0; }
  .apple-dev-item { gap: 4px; padding: 3px 2px; }
  .apple-dev-name { font-size: 11px; }
  .apple-dev-suffix { font-size: 10px; }
  .apple-dev-offline { font-size: 9px; margin-left: 2px; }
  .apple-icon-live, .apple-icon-screen-alert { width: 12px; height: 12px; }
}
@media (max-width: 420px) {
  .apple-dev-grid { columns: 3; column-gap: 4px; }
  .apple-dev-name { font-size: 10px; }
}


.default-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.default-group-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(15,23,42,.06);
}
.default-dev-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.default-dev-card {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.default-dev-card:hover {
  box-shadow: 0 8px 18px rgba(15,23,42,.08);
  transform: translateY(-1px);
}
.default-dev-head {
  display:flex;
  align-items:center;
  gap:10px;
}
.default-dev-name { font-weight: 700; color: #0f172a; }
.default-dev-sub { font-size: 12px; color: #64748b; margin-top: 6px; }
@media (max-width: 900px) {
  .default-dev-grid { grid-template-columns: 1fr; }
}


.default-table-group {
  margin-top: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(15,23,42,.06);
  overflow: hidden;
}
.default-table-group-head {
  padding: 16px 18px 10px;
  border-bottom: 1px solid #eef2f7;
}
.default-table-group-title {
  font-size: 18px;
  font-weight: 800;
}
.default-table-group-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}
.grouped-device-table {
  min-width: 1100px;
}
body.dark .default-table-group {
  background:#0f172a;
  border-color:#223041;
  box-shadow:none;
}
body.dark .default-table-group-head {
  border-bottom-color:#223041;
}
body.dark .default-table-group-meta {
  color:#8ea0b8;
}


.screen-toggle-list {
  display:flex;
  flex-wrap:wrap;
  gap:10px 16px;
}
.screen-toggle-list .toggle-inline {
  padding: 4px 0;
}


.settings-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap:14px;
}
.settings-card, .export-group-card {
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:20px;
  padding:16px;
  box-shadow:0 10px 28px rgba(15,23,42,.06);
}
.settings-card textarea {
  width:100%;
  min-height:220px;
  border:1px solid #dbe3ef;
  border-radius:12px;
  padding:12px;
  font:inherit;
  background:#fff;
  color:#0f172a;
}
.export-toolbar {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
  margin-bottom:14px;
}
.export-groups {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap:14px;
}
/* 无 view_note 权限：隐藏导出工具栏的「导出用户」选项（与页面其他用户展示位一致） */
body.no-view-note .export-note-opt { display:none; }
.export-group-head {
  padding-bottom:10px;
  border-bottom:1px solid #eef2f7;
  margin-bottom:10px;
}
.export-device-list {
  display:flex;
  flex-direction:column;
  gap:8px;
}
.export-device-row {
  display:flex;
  flex-wrap:wrap;
  gap:4px 12px;
  align-items:center;
  border-top:1px solid #f1f5f9;
  padding-top:8px;
}
.export-device-row:first-child { border-top:0; padding-top:0; }
.export-device-main { font-weight:600; white-space:nowrap; }
.export-device-hw {
  width:100%;
  font-size:11px;
  line-height:1.4;
  word-break:break-all;
}
body.dark .settings-card,
body.dark .export-group-card {
  background:#0f172a;
  border-color:#223041;
  box-shadow:none;
}
body.dark .settings-card textarea {
  background:#111827;
  color:#e5eefb;
  border-color:#223041;
}
body.dark .export-group-head,
body.dark .export-device-row { border-color:#223041; }

/* Sortable group list */
.sortable-list { display:flex; flex-direction:column; gap:6px; min-height:120px; }
.sortable-item {
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; background:#f8fafc; border:1px solid #e2e8f0;
  border-radius:10px; cursor:move; user-select:none;
  transition:transform .15s, box-shadow .15s;
}
.sortable-item:hover { background:#f1f5f9; }
.sortable-item.dragging {
  opacity:.6; transform:scale(1.02);
  box-shadow:0 8px 24px rgba(15,23,42,.12);
}
.sortable-handle {
  color:#94a3b8; font-size:14px; line-height:1;
  cursor:grab;
}
.sortable-label { font-size:14px; color:#0f172a; flex:1; }
body.dark .sortable-item { background:#111827; border-color:#223041; }
body.dark .sortable-item:hover { background:#1a2535; }
body.dark .sortable-label { color:#e5eefb; }


.copy-mac-btn {
  margin-left: 8px;
  border: 1px solid #dbe3ef;
  background: #fff;
  color: #2563eb;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.5;
  cursor: pointer;
}
.copy-mac-btn:hover { background:#eff6ff; }
.copy-mac-btn.copied { color:#16a34a; border-color:#bbf7d0; background:#f0fdf4; }
.copy-mac-btn.disabled { color:#94a3b8; cursor:default; }
.mac-copy-row, .mac-copy-cell {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.mac-copy-inline {
  display:inline-flex;
  align-items:center;
}
body.dark .copy-mac-btn {
  background:#0f172a;
  border-color:#223041;
  color:#93c5fd;
}
body.dark .copy-mac-btn:hover { background:#132038; }
body.dark .copy-mac-btn.copied { background:#052e16; border-color:#166534; color:#86efac; }


.settings-form-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap:12px;
}
.settings-form-grid label {
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:13px;
  color:#475569;
}
.settings-form-grid input[type="number"],
.settings-form-grid input[type="color"] {
  width:100%;
  min-height:38px;
  border:1px solid #dbe3ef;
  border-radius:10px;
  background:#fff;
}
.disk-usage-inline {
  width:128px;
  margin:0 auto;
  text-align:center;
}
.disk-usage-top {
  font-size:11px;
  font-weight:600;
  margin-bottom:3px;
  white-space:nowrap;
}
.disk-usage-bar {
  position: relative;
  width:100%;
  height:6px;
  background:#e5e7eb;
  border-radius:999px;
  overflow:hidden;
}
.disk-usage-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height:100%;
  border-radius:999px;
}
/* 比上次多占用的部分：同色系更深的一档（最小 5px 保证细小增量也看得见，左侧亮色分隔线区分两段） */
.disk-usage-bar-inc {
  position: absolute;
  top: 0;
  height: 100%;
  min-width: 5px;
  background: #14532d;
  border-left: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
  transition: width .4s ease, left .4s ease;
}
/* 增量段 / +XG 徽章配色：安全=深绿 / 警告=深橙 / 危险=深红 */
.disk-usage-bar-inc.disk-inc-warn,
.disk-bar-inc.disk-inc-warn,
.disk-usage-inc-tag.disk-inc-warn { background: #9a3412; }
.disk-usage-bar-inc.disk-inc-danger,
.disk-bar-inc.disk-inc-danger,
.disk-usage-inc-tag.disk-inc-danger { background: #7f1d1d; }
.disk-inc-text.disk-inc-warn { color: #9a3412; }
.disk-inc-text.disk-inc-danger { color: #7f1d1d; }
/* 「+8.9G」徽章：与增量段同色，字号再小一号不抢主文字 */
.disk-usage-inc-tag {
  margin-left: 3px;
  padding: 0 3px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: #14532d;
  vertical-align: 1px;
}
body.dark .disk-usage-bar-inc { background: #4ade80; border-left-color: rgba(6, 40, 20, .85); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
body.dark .disk-usage-bar-inc.disk-inc-warn { background: #fb923c; border-left-color: rgba(67, 20, 7, .85); }
body.dark .disk-usage-bar-inc.disk-inc-danger { background: #f87171; border-left-color: rgba(69, 10, 10, .85); }
body.dark .disk-usage-inc-tag { color: #06301a; background: #4ade80; }
body.dark .disk-usage-inc-tag.disk-inc-warn { color: #431407; background: #fb923c; }
body.dark .disk-usage-inc-tag.disk-inc-danger { color: #450a0a; background: #f87171; }
.disk-inc-text { font-weight: 700; font-size: 9px; color: #14532d; }
body.dark .disk-inc-text { color: #4ade80; }
body.dark .disk-inc-text.disk-inc-warn { color: #fb923c; }
body.dark .disk-inc-text.disk-inc-danger { color: #f87171; }
/* 基线来源标注（较昨日 / 较每周快照） */
.disk-inc-src {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
}
body.dark .disk-inc-src { color: #8ea0b8; }
.hw-gauges {
  display:flex;
  gap:22px;
  justify-content:center;
  margin-bottom:10px;
}
/* 只有两个圈（CPU/内存，没上报 GPU）时：仍然按「三个圈」的网格占位居中，
   用一个不可见的第三个槽位把两个圈推到与三圈行第一个圈相同的左边缘 */
.hw-gauges.hw-gauges-2 {
  justify-content:center;
}
.hw-gauges.hw-gauges-2::after {
  content:'';
  flex:0 0 var(--hw-gw, 54px);
  visibility:hidden;
  pointer-events:none;
}
.hw-gauge {
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:5px;
}
.hw-gauge-circle {
  width:54px;
  height:54px;
  border-radius:50%;
  background:conic-gradient(var(--c) calc(var(--p) * 1%), #e5e7eb 0);
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
}
.hw-gauge-circle::before {
  content:'';
  position:absolute;
  inset:6px;
  border-radius:50%;
  background:#fff;
}
.hw-gauge-num {
  position:relative;
  font-size:12px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
}
.hw-gauge-lbl {
  font-size:11px;
  color:#64748b;
}
.hw-gauge-tip {
  position:absolute;
  bottom:calc(100% + 8px);
  left:50%;
  transform:translateX(-50%);
  background:#0f172a;
  color:#e2e8f0;
  border:1px solid #1e293b;
  padding:7px 10px;
  border-radius:8px;
  font-size:11px;
  line-height:1.55;
  white-space:nowrap;
  text-align:left;
  opacity:0;
  pointer-events:none;
  transition:opacity .12s ease;
  z-index:30;
  box-shadow:0 6px 18px rgba(0,0,0,.25);
}
.hw-gauge:hover .hw-gauge-tip { opacity:1; }
.hw-gauge-tip .gt-title {
  font-weight:700;
  margin-bottom:3px;
  color:#fff;
}
.hw-gauge-tip b { color:#fff; }
body.dark .hw-gauge-circle { background:conic-gradient(var(--c) calc(var(--p) * 1%), #334155 0); }
body.dark .hw-gauge-circle::before { background:#0f172a; }
body.dark .hw-gauge-num { color:#cbd5e1; }
body.dark .hw-gauge-lbl { color:#94a3b8; }

/* 仪表下方温度小字（探针上报 CPU/GPU 温度；高温标红） */
.hw-gauge-sub {
  font-size:10px;
  line-height:1;
  color:#94a3b8;
  font-variant-numeric:tabular-nums;
  margin-top:-1px;
}
.hw-gauge-sub.hw-temp-hot { color:#ef4444; font-weight:700; }
body.dark .hw-gauge-sub { color:#64748b; }
body.dark .hw-gauge-sub.hw-temp-hot { color:#f87171; }
.td-hardware .hw-gauge-sub { font-size:9px; }
/* 温度徽章（硬件弹窗 / 设备摘要 / 移动端卡片共用）；默认跟随文字色，高温标红 */
.hw-temp { font-weight:600; font-variant-numeric:tabular-nums; }
.hw-temp.hw-temp-hot { color:#ef4444; }
body.dark .hw-temp.hw-temp-hot { color:#f87171; }

/* 首页表格「硬件」列：圆形 CPU/内存 仪表（紧凑） */
.td-hardware .hw-gauges { --hw-gw:32px; gap:12px; margin-bottom:0; }
.td-hardware .hw-gauge-circle { width:32px; height:32px; }
.td-hardware .hw-gauge-circle::before { inset:4px; }
.td-hardware .hw-gauge-num { font-size:10px; }
.td-hardware .hw-gauge-lbl { font-size:9px; }
.td-hardware .hw-gauge-tip { z-index:40; }
body.dark .td-hardware .hw-gauge-lbl { color:#94a3b8; }
@media (max-width: 640px) {
  .grouped-device-table td.td-hardware { display:none; }
}

body.dark .settings-form-grid label { color:#cbd5e1; }
body.dark .settings-form-grid input[type="number"],
body.dark .settings-form-grid input[type="color"] {
  border-color:#223041;
  background:#111827;
}
body.dark .disk-usage-bar { background:#223041; }

.grouped-device-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.grouped-device-table th,
.grouped-device-table td {
  text-align: center;
  vertical-align: middle;
}
.grouped-device-table td {
  padding: 10px 8px;
}
.grouped-device-table th {
  font-size: 11px;
}
/* Hide mobile-only columns on desktop */
.grouped-device-table td.td-group,
.grouped-device-table td.td-cpu-mem,
.grouped-device-table td.td-uptime-rate,
.grouped-device-table td.td-note,
.grouped-device-table th.th-mob {
  display: none;
}
.td-center {
  text-align: center;
}
/* 默认主题表格：C盘容量 / CPU·RAM·GPU / Current Up·Down 可点击跳转 */
.td-clickable { cursor: pointer; transition: background-color .12s ease; }
.td-clickable:hover { background-color: rgba(59,130,246,.10); }
body.dark .td-clickable:hover { background-color: rgba(96,165,250,.18); }
/* 电脑端默认首页：设备名称靠左（带后缀时各行列对齐更整齐），仅作用于名称链接，不影响「详情」按钮 */
@media (min-width: 701px) {
  td.td-name { text-align: left; }
  td.td-name .row-device-name { justify-content: flex-start; text-align: left; }
  th.th-name { text-align: left; }
}
.row-note-edit {
  cursor: pointer;
  color: #2563eb;
  transition: color .15s;
}
.row-note-edit:hover {
  color: #1d4ed8;
  text-decoration: underline;
}
body.dark .row-note-edit {
  color: #60a5fa;
}
body.dark .row-note-edit:hover {
  color: #93c5fd;
}
.net-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  line-height: 1.25;
}
.net-line {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  white-space:nowrap;
}
.net-label {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:16px;
  height:16px;
  border-radius:999px;
  background:#eff6ff;
  color:#2563eb;
  font-size:10px;
  font-weight:700;
}
.mac-copy-cell {
  justify-content: center;
  border-bottom: none !important;
}
.mac-copy-inline {
  white-space: nowrap;
}
.copy-mac-btn {
  margin-left: 0;
  padding: 1px 6px;
  font-size: 10px;
}
body.dark .net-label {
  background:#132038;
  color:#93c5fd;
}


.mac-copy-box {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
  width:100%;
}
.grouped-device-table td.mac-copy-cell,
.grouped-device-table td .mac-copy-box {
  text-align:center;
}
.status-stack {
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  line-height:1.2;
}
.status-main {
  font-size:12px;
  font-weight:700;
}
.status-main.online { color:#16a34a; }
.status-main.offline { color:#dc2626; }
.status-sub {
  font-size:11px;
  color:#94a3b8;
  text-align:center;
  word-break:break-word;
}
.net-label {
  min-width:36px;
  padding:0 6px;
}
body.dark .status-sub { color:#8ea0b8; }



/* 设备详情弹窗「总览」面板：2 列网格卡片布局
   修复前 .device-overview-grid/.overview-card/.overview-pair/.overview-list 全部缺失基础样式，
   导致 8 个 overview-card 纵向堆叠，状态等所有信息排成一列，要拖动很久 */
.device-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.overview-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  min-width: 0;
}
.overview-card.overview-card-full { grid-column: 1 / -1; }  /* 「用户」卡占满整行 */
.overview-card h4 {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin: 0 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #eef2f7;
}
.overview-pair {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 3px 0; min-width: 0;
}
.overview-pair > span { color: #94a3b8; font-size: 11px; flex-shrink: 0; }
.overview-pair > strong {
  color: #0f172a; font-weight: 600; font-size: 12px;
  text-align: right; word-break: break-all; min-width: 0;
}
.overview-muted { color: #94a3b8; }
.overview-alert-line { margin: 4px 0; font-size: 11px; }
.overview-list {
  margin-top: 6px; display: flex; flex-direction: column; gap: 3px;
  max-height: 160px; overflow-y: auto;
}
.overview-list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #eef2f7; border-radius: 6px;
  padding: 4px 7px; font-size: 11px; min-width: 0;
}
.overview-list-item > strong { color: #475569; font-weight: 600; }
.overview-list-item > span { color: #0f172a; word-break: break-all; min-width: 0; }
/* Live 时间段单行显示（2026/08/29 20:04:03 ~ 次日 05:18:47） */
.overview-list-item.live-span-item { justify-content: flex-start; }
.overview-list-item.live-span-item > span { word-break: normal; font-variant-numeric: tabular-nums; }
.overview-note { font-size: 12px; color: #0f172a; font-weight: 500; }
.overview-other { margin-top: 6px; font-size: 12px; color: #0f172a; font-weight: 500; }
.ov-label { color: #94a3b8; font-weight: 600; }
.homepage-link { color: #2563eb; text-decoration: none; word-break: break-all; display: inline-flex; align-items: center; gap: 4px; }
.homepage-link:hover { color: #1d4ed8; opacity: 0.85; }
body.dark .homepage-link { color: #60a5fa; }
body.dark .homepage-link:hover { color: #93c5fd; }
.hp-logo { width: 22px; height: 22px; display: block; flex-shrink: 0; }
/* 主页头像（替代 TikTok logo 时出现）：圆形、不抢高度，和 logo 同一套尺寸规则 */
.hp-av { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; display: block; flex-shrink: 0; background: #e2e8f0; }
/* 头像加载失败时的兜底 logo：平时藏着，img 的 onerror 给 <a> 加 .hp-av-fail 后才显示 */
.hp-logo-fb { display: none; }
.homepage-link.hp-av-fail .hp-logo-fb { display: block; }
.hp-handle { font-size: 12px; font-weight: 600; color: #0f172a; line-height: 1; white-space: nowrap; }
.hp-tiktok:hover .hp-handle { color: #1d4ed8; }
body.dark .hp-handle { color: #e2e8f0; }
body.dark .hp-tiktok:hover .hp-handle { color: #93c5fd; }
/* 直播卡片里主页跳转的 @id 小字体 */
.hp-handle-sm { font-size: 10px; font-weight: 500; color: #64748b; }
.hp-live-jump { margin-left: 2px; }
/* 直播卡片：个人主页跳转换行显示（名称下一行），logo 缩小，左对齐与下方时间对齐；无主页时留空行保持时间位置一致 */
/* min-height 需 >= 暱称+@handle 两行的高度，没有主页的卡片才会留一样高的空行、时间行不错位 */
.live-room-homepage { display: flex; align-items: center; gap: 4px; min-height: 28px; }
.live-room-homepage .hp-logo { width: 13px; height: 13px; }
body.dark .hp-handle-sm { color: #94a3b8; }
/* 直播卡专用：暱称一行、@handle 下一行。
   align-items:center → logo 在左侧跨两行垂直居中，与右侧「暱称+id」整块齐平（不是只贴第一行顶部） */
.homepage-link.hp-stack { align-items: center; }
.hp-stack-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.hp-stack-txt .hp-nick { font-size: 10px; font-weight: 600; color: #0f172a; }
.hp-stack-txt .hp-at { font-size: 9px; font-weight: 500; color: #64748b; }
body.dark .hp-stack-txt .hp-nick { color: #e2e8f0; }
body.dark .hp-stack-txt .hp-at { color: #94a3b8; }
body.dark .overview-other { color: #e2e8f0; }
body.dark .overview-card { background: #131c31; border-color: #1e293b; }
body.dark .overview-card h4 { color: #94a3b8; border-color: #1e293b; }
body.dark .overview-pair > strong { color: #e2e8f0; }
body.dark .overview-list-item { background: #0f172a; border-color: #1e293b; }
body.dark .overview-list-item > strong { color: #94a3b8; }
body.dark .overview-list-item > span { color: #e2e8f0; }
body.dark .overview-note { color: #e2e8f0; }
body.dark .overview-alert-line { color: #cbd5e1; }


.device-overview-header .device-overview-sub {
  font-size: 10px !important;
  line-height: 1.3 !important;
  color: #64748b;
}
.device-overview-grid .power-card .overview-list-item strong {
  font-size: 10px !important;
  line-height: 1.25 !important;
}
.device-overview-grid .power-card .overview-list-item span {
  font-size: 10px !important;
  line-height: 1.25 !important;
}
body.dark .device-overview-header .device-overview-sub {
  color: #8ea0b8;
}

.modal-sub span { font-size: 11px; line-height: 1.25; }


.traffic-hours-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
}
.traffic-hour-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 9px;
  background: #f8fafc;
}
.traffic-hour-time { font-size: 10px; color: #64748b; margin-bottom: 4px; }
.traffic-hour-total { font-size: 13px; font-weight: 800; color: #0f172a; }
.traffic-hour-split { font-size: 10px; color: #64748b; margin-top: 3px; line-height:1.25; }
.heatmap-toolbar {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:14px;
}
.traffic-ranking-panel, .traffic-heatmap-panel {
  margin-top: 16px;
}
.traffic-ranking-list {
  display:grid;
  gap:10px;
}
.traffic-rank-item {
  display:grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items:center;
  padding: 10px 12px;
  border:1px solid #e2e8f0;
  border-radius: 12px;
  background:#f8fafc;
}
.traffic-rank-no {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background:#dbeafe;
  color:#1d4ed8;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
}
.traffic-rank-main { display:flex; flex-direction:column; min-width:0; }
.traffic-rank-main strong { font-size: 14px; color:#0f172a; }
.traffic-rank-main span { font-size: 11px; color:#64748b; }
.traffic-rank-total { font-size: 14px; font-weight: 800; color:#0f172a; }
.traffic-heatmap-scroll { overflow-x:auto; padding-bottom: 8px; }
.traffic-heatmap-cols {
  display:flex;
  align-items:flex-start;
  gap:6px;
  min-width:max-content;
}
.traffic-day-col { display:flex; flex-direction:column; gap:4px; align-items:center; }
.traffic-day-label { font-size:10px; color:#64748b; margin-bottom:2px; }
.traffic-heat-cell {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background:#ebedf0;
}
.traffic-heat-cell.lv1 { background:#9be9a8; }
.traffic-heat-cell.lv2 { background:#40c463; }
.traffic-heat-cell.lv3 { background:#30a14e; }
.traffic-heat-cell.lv4 { background:#216e39; }
.traffic-heatmap-legend {
  display:flex;
  align-items:center;
  gap:6px;
  justify-content:flex-end;
  font-size:11px;
  color:#64748b;
  margin-top:10px;
}
.traffic-heatmap-legend i {
  width:12px;
  height:12px;
  border-radius:3px;
  display:inline-block;
  background:#ebedf0;
}
.traffic-heatmap-legend .lv1 { background:#9be9a8; }
.traffic-heatmap-legend .lv2 { background:#40c463; }
.traffic-heatmap-legend .lv3 { background:#30a14e; }
.traffic-heatmap-legend .lv4 { background:#216e39; }
body.dark .traffic-hour-card,
body.dark .traffic-rank-item {
  background:#0f172a;
  border-color:#223041;
}
body.dark .traffic-hour-total,
body.dark .traffic-rank-main strong,
body.dark .traffic-rank-total {
  color:#e5eefb;
}
body.dark .traffic-hour-time,
body.dark .traffic-hour-split,
body.dark .traffic-rank-main span,
body.dark .traffic-day-label,
body.dark .traffic-heatmap-legend {
  color:#8ea0b8;
}
body.dark .traffic-rank-no {
  background:#132038;
  color:#93c5fd;
}
body.dark .traffic-heat-cell.lv0,
body.dark .traffic-heatmap-legend .lv0 { background:#1f2937; }

.traffic-day-cards {
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:8px;
  margin:10px 0 12px;
}
.traffic-day-card {
  border:1px solid #e2e8f0;
  border-radius:12px;
  padding:10px;
  background:#f8fafc;
  text-align:left;
  cursor:pointer;
  color:inherit;
  font:inherit;
}
.traffic-day-card.active {
  border-color:#2563eb;
  box-shadow:0 0 0 2px rgba(37,99,235,.12);
}
.traffic-day-card:hover {
  border-color:#93c5fd;
  box-shadow:0 8px 24px rgba(37,99,235,.10);
}
.traffic-day-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.traffic-day-date { font-size:12px; color:#64748b; }
.traffic-day-tag {
  font-size:10px;
  color:#1d4ed8;
  background:#dbeafe;
  border-radius:999px;
  padding:2px 6px;
  font-weight:700;
}
.traffic-day-total { font-size:14px; font-weight:800; color:#0f172a; }
.traffic-day-split { font-size:10px; color:#64748b; margin-top:3px; }
.traffic-hours-title { font-size:12px; font-weight:700; margin:2px 0 8px; color:#0f172a; }
.traffic-hours-grid-inner {
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:8px;
}
@media (max-width: 900px) {
  .traffic-hours-grid-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .traffic-day-cards, .traffic-hours-grid-inner { grid-template-columns: 1fr; }
}
body.dark .traffic-day-card {
  background:#0f172a;
  border-color:#223041;
}
body.dark .traffic-day-total,
body.dark .traffic-hours-title {
  color:#e5eefb;
}
body.dark .traffic-day-date,
body.dark .traffic-day-split {
  color:#8ea0b8;
}
body.dark .traffic-day-tag {
  background:#132038;
  color:#93c5fd;
}

.traffic-stats-cards {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap:16px;
  margin-top: 16px;
}
.traffic-stat-card {
  position:relative;
  overflow:hidden;
  border-radius:24px;
  padding:18px;
  background:linear-gradient(180deg, rgba(255,255,255,.96), rgba(241,245,249,.96));
  border:1px solid rgba(226,232,240,.95);
  box-shadow:0 18px 44px rgba(15,23,42,.08);
}
.traffic-stat-top {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.traffic-stat-name { font-size:18px; font-weight:800; color:#0f172a; }
.traffic-stat-meta { font-size:12px; color:#64748b; margin-top:4px; }
.traffic-stat-pill {
  padding:6px 10px;
  border-radius:999px;
  background:#eef2ff;
  color:#4338ca;
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}
.traffic-stat-big {
  font-size:30px;
  font-weight:900;
  letter-spacing:-0.02em;
  color:#0f172a;
  margin-top:16px;
}
.traffic-stat-sub { font-size:12px; color:#64748b; margin-top:6px; }
.traffic-stat-grid {
  margin-top:16px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
}
.traffic-stat-grid div {
  border-radius:16px;
  background:rgba(255,255,255,.75);
  border:1px solid #e2e8f0;
  padding:12px;
}
.traffic-stat-grid span { display:block; font-size:11px; color:#64748b; margin-bottom:5px; }
.traffic-stat-grid strong { font-size:15px; color:#0f172a; }
body.dark .traffic-stat-card {
  background:linear-gradient(180deg, rgba(15,23,42,.98), rgba(17,24,39,.98));
  border-color:#243244;
  box-shadow:none;
}
body.dark .traffic-stat-name,
body.dark .traffic-stat-big,
body.dark .traffic-stat-grid strong { color:#e5eefb; }
body.dark .traffic-stat-meta,
body.dark .traffic-stat-sub,
body.dark .traffic-stat-grid span { color:#8ea0b8; }
body.dark .traffic-stat-grid div { background:rgba(30,41,59,.55); border-color:#223041; }
body.dark .traffic-stat-pill { background:#1e293b; color:#c7d2fe; }
@media (max-width: 640px) {
  .traffic-stats-cards { grid-template-columns: 1fr; }
  .traffic-stat-big { font-size:26px; }
}

/* 实时网速：按出口 IP 聚合 */
.net-speed-summary {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px;
}
.ns-sum-item {
  background: rgba(255,255,255,.85);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 120px;
}
.ns-sum-item span { display: block; font-size: 11px; color: #64748b; margin-bottom: 4px; }
.ns-sum-item strong { font-size: 17px; color: #0f172a; font-variant-numeric: tabular-nums; }

/* 主站记事本 */
/* 主站记事本：列表 + 进入式编辑 */
.np-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.np-row {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  padding: 12px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .05s;
}
.np-row:hover { border-color: #38bdf8; box-shadow: 0 6px 18px rgba(15,23,42,.07); }
.np-row:active { transform: scale(.995); }
.np-row-main { flex: 1; min-width: 0; }
.np-row-title { font-size: 15px; font-weight: 700; color: #0f172a; }
.np-row-preview { font-size: 12.5px; color: #64748b; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11px; color: #2563eb; white-space: nowrap; }
.np-editor { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
/* ---- 记事本待办能力 ---- */
.np-check { display: flex; align-items: center; flex: none; cursor: pointer; padding: 4px; }
.np-check input { width: 18px; height: 18px; cursor: pointer; accent-color: #16a34a; }
.np-row.np-done { opacity: .62; background: #f8fafc; }
.np-row.np-done .np-row-title { text-decoration: line-through; color: #94a3b8; }
/* 置顶且已完成：保持正常颜色、不划线（指定的置顶项不被弱化） */
.np-row.np-done.np-pinned { opacity: 1; background: #fffdf5; }
.np-row.np-done.np-pinned .np-row-title { text-decoration: none; color: #0f172a; }
.np-dev-tag {
  display: inline-block; font-size: 11px; font-weight: 600; color: #4338ca;
  background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 999px; padding: 1px 8px; margin-left: 6px;
}
.np-done-tag {
  display: inline-block; font-size: 11px; font-weight: 600; color: #15803d;
  background: #dcfce7; border: 1px solid #86efac; border-radius: 999px; padding: 1px 8px; margin-left: 6px;
}
/* ---- 记事本置顶能力 ---- */
.np-row-actions { display: flex; flex: none; align-items: center; }
.np-pin-btn {
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
  color: #64748b; background: #f1f5f9; border: 1px solid #e2e8f0;
  border-radius: 999px; padding: 4px 12px; transition: color .15s, background .15s, border-color .15s;
}
.np-pin-btn:hover { color: #0f172a; border-color: #cbd5e1; }
.np-pin-btn.active { color: #b45309; background: #fef3c7; border-color: #fcd34d; }
.np-pin-tag {
  display: inline-block; font-size: 11px; font-weight: 700; color: #b45309;
  background: #fef3c7; border: 1px solid #fcd34d; border-radius: 999px; padding: 1px 8px; margin-left: 6px;
}
.np-row.np-pinned { border-color: #fcd34d; }
.np-pin-wrap { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.np-pin-wrap input { width: 17px; height: 17px; cursor: pointer; accent-color: #d97706; }
.np-done-wrap { display: flex; align-items: center; gap: 6px; margin-left: auto; margin-right: auto; font-size: 13px; font-weight: 600; cursor: pointer; }
.np-done-wrap input { width: 17px; height: 17px; cursor: pointer; accent-color: #16a34a; }
.np-extra { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.np-field { display: flex; flex-direction: column; gap: 6px; }
.np-field > label { font-size: 12px; font-weight: 600; color: #475569; }
.np-dev-pick { position: relative; }
.np-push-list { display: flex; flex-direction: column; gap: 4px; max-height: 132px; overflow-y: auto; }
.np-push-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #334155; cursor: pointer; }
.np-push-item input { cursor: pointer; accent-color: #2563eb; }
body.dark .np-dev-tag { color: #a5b4fc; background: #1e293b; border-color: #334155; }
body.dark .np-done-tag { color: #86efac; background: #14361f; border-color: #166534; }
body.dark .np-row.np-done { background: #0f172a; }
body.dark .np-row.np-done.np-pinned { opacity: 1; background: #1a1407; }
body.dark .np-row.np-done.np-pinned .np-row-title { text-decoration: none; color: #e5eefb; }
body.dark .np-pin-btn { color: #94a3b8; background: #1e293b; border-color: #334155; }
body.dark .np-pin-btn:hover { color: #e5eefb; border-color: #475569; }
body.dark .np-pin-btn.active { color: #fcd34d; background: #3a2c0a; border-color: #78551a; }
body.dark .np-pin-tag { color: #fcd34d; background: #3a2c0a; border-color: #78551a; }
body.dark .np-row.np-pinned { border-color: #78551a; }
body.dark .np-push-item { color: #cbd5e1; }
/* ---- 记事本定时推送 ---- */
.np-remind { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.np-remind .input { width: auto; min-width: 92px; }
.np-rem-on, .np-rem-skip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #334155; cursor: pointer; }
.np-rem-skip { font-size: 12px; color: #64748b; }
.np-rem-hint { font-size: 11.5px; margin-top: 2px; }
.np-rem-tag {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; white-space: nowrap;
}
body.dark .np-rem-on, body.dark .np-rem-skip { color: #cbd5e1; }
body.dark .np-rem-tag { color: #7dd3fc; background: #0c2b3d; border-color: #155e75; }
body.dark .np-field > label { color: #94a3b8; }
/* ---- 手机端记事本行：标题独占首行，时间+置顶按钮换到第二行，避免标题被挤压换行 ---- */
@media (max-width: 640px) {
  .np-row { flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; padding: 10px 12px; }
  .np-row-main { flex: 1 1 calc(100% - 44px); min-width: 0; }
  .np-row-title { font-size: 14px; line-height: 1.35; }
  .np-row-preview { font-size: 12px; }
  /* 时间移到第二行左侧，横向排列更紧凑 */
  .np-row-meta {
    order: 3; flex: 1 1 auto; flex-direction: row; align-items: center;
    justify-content: flex-start; gap: 10px; font-size: 10.5px; color: #94a3b8; margin-top: 2px;
  }
  body.dark .np-row-meta { color: #64748b; }
  /* 置顶按钮移到第二行右侧 */
  .np-row-actions { order: 4; flex: 0 0 auto; justify-content: flex-end; margin-top: 2px; }
}
/* ---- 首页待办事项提示条 / 弹窗 ---- */
.todo-banner {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  background: #fffbeb; border: 1px solid #fcd34d; color: #92400e;
  border-radius: 12px; padding: 10px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.todo-banner:hover { background: #fef3c7; }
.todo-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; flex: none;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .18);
}
.todo-mask {
  position: fixed; inset: 0; z-index: 3000; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.todo-panel {
  background: #fff; border-radius: 16px; width: 100%; max-width: 520px;
  max-height: 80vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
}
.todo-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #e2e8f0; }
.todo-head-title { font-size: 15px; font-weight: 700; color: #0f172a; }
.todo-list { overflow-y: auto; padding: 8px 12px; }
.todo-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 6px; border-bottom: 1px solid #f1f5f9; }
.todo-item:last-child { border-bottom: none; }
.todo-check { flex: none; padding-top: 2px; }
.todo-check input { width: 17px; height: 17px; cursor: pointer; accent-color: #16a34a; }
.todo-main { min-width: 0; flex: 1; }
.todo-title { font-size: 13.5px; font-weight: 700; color: #0f172a; }
.todo-content { font-size: 12.5px; color: #64748b; margin-top: 3px; word-break: break-word; }
.todo-foot { padding: 12px 16px; border-top: 1px solid #e2e8f0; display: flex; justify-content: flex-end; }
body.dark .todo-banner { background: #3b2f10; border-color: #b45309; color: #fcd34d; }
body.dark .todo-panel { background: #0f172a; border: 1px solid #223041; }
body.dark .todo-head, body.dark .todo-foot { border-color: #223041; }
body.dark .todo-head-title, body.dark .todo-title { color: #e5eefb; }
body.dark .todo-content { color: #94a3b8; }
body.dark .todo-item { border-color: #1a2436; }
.np-editor-bar { display: flex; align-items: center; gap: 10px; }
.np-edit-title { font-size: 16px; font-weight: 700; color: #0f172a; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; background: #f8fafc; }
.np-edit-title:focus { outline: 2px solid #38bdf8; outline-offset: 0; border-color: #38bdf8; background: #fff; }
.np-edit-content { width: 100%; min-height: 320px; resize: vertical; font-size: 14px; line-height: 1.7; color: #1e293b; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; background: #f8fafc; font-family: inherit; }
.np-edit-content:focus { outline: 2px solid #38bdf8; outline-offset: 0; border-color: #38bdf8; background: #fff; }
/* 预览态：渲染正文（含可点击链接），外观对齐 textarea */
.np-content-preview { width: 100%; min-height: 320px; box-sizing: border-box; font-size: 14px; line-height: 1.7; color: #1e293b; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; background: #f8fafc; font-family: inherit; overflow-y: auto; word-break: break-word; }
.np-content-preview a { color: #2563eb; text-decoration: underline; }
.np-content-preview a:hover { color: #1d4ed8; }
.np-editor-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.np-editor-status { font-size: 12px; color: #16a34a; }
.np-editor-meta { font-size: 11.5px; color: #2563eb; }
body.dark .np-row { background: #0e1626; border-color: #223041; }
body.dark .np-row:hover { border-color: #38bdf8; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
body.dark .np-row-title { color: #e5eefb; }
body.dark .np-row-preview { color: #8ea0b8; }
body.dark .np-row-meta { color: #60a5fa; }
body.dark .np-edit-title { color: #e5eefb; background: #0b1220; border-color: #2b3a4d; }
body.dark .np-edit-content { color: #cdd9e6; background: #0b1220; border-color: #2b3a4d; }
body.dark .np-content-preview { color: #cdd9e6; background: #0b1220; border-color: #2b3a4d; }
body.dark .np-content-preview a { color: #60a5fa; }
body.dark .np-editor-status { color: #4ade80; }
body.dark .np-editor-meta { color: #60a5fa; }
.btn.small { padding: 5px 12px; font-size: 12px; }
.btn.danger { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
.btn.danger:hover { background: #fecaca; }
body.dark .btn.danger { background: #3b1d1d; color: #fca5a5; border-color: #5b2a2a; }
body.dark .btn.danger:hover { background: #5b2a2a; }
/* 记事本回收站 */
.np-trash-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.np-trash-row { cursor: default; }
.np-trash-row:hover { border-color: #e2e8f0; box-shadow: none; }
body.dark .np-trash-row:hover { border-color: #223041; box-shadow: none; }
.np-trash-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.np-trash-actions .btn { white-space: nowrap; }
/* 实时网速峰值条 */
.net-peak {
  margin-top: 12px; margin-bottom: 4px;
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  border-radius: 14px; padding: 9px 14px; color: #fff;
}
.net-peak .np-grid {
  display: grid; grid-template-columns: auto 1fr 1fr;
  gap: 4px 16px; align-items: center;
}
.net-peak .np-row { display: contents; }
.net-peak .np-head { border-bottom: 1px solid rgba(255,255,255,.25); padding-bottom: 5px; margin-bottom: 1px; }
.net-peak .np-head .np-k,
.net-peak .np-head .np-v { font-size: 11px; opacity: .9; font-weight: 700; letter-spacing: .3px; }
.net-peak .np-head .np-v { text-align: center; }
.net-peak .np-k { font-size: 12.5px; opacity: .95; white-space: nowrap; padding-right: 6px; }
.net-peak .np-v { display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 10px; }
.net-peak .np-period { font-size: 15px; font-weight: 800; letter-spacing: .3px; }
.net-peak .np-up { font-size: 12.5px; color: #5eead4; font-variant-numeric: tabular-nums; }
.net-peak .np-down { font-size: 12.5px; color: #93c5fd; font-variant-numeric: tabular-nums; }
.net-peak .np-muted { font-size: 13px; opacity: .8; }
.net-peak .np-peak-muted { font-size: 13px; opacity: .9; }
body.dark .net-peak { background: linear-gradient(135deg, #0c4a6e 0%, #312e81 100%); }
.ns-sum-item strong.up { color: #0d9488; }
.ns-sum-item strong.down { color: #2563eb; }
.ns-sum-time { margin-left: auto; }
.net-speed-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.ns-card {
  border-radius: 22px;
  padding: 13px 15px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(241,245,249,.96));
  border: 1px solid rgba(226,232,240,.95);
  box-shadow: 0 18px 44px rgba(15,23,42,.08);
  display: flex;
  flex-direction: column;
  height: 300px;
}
.ns-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ns-ip-wrap { min-width: 0; }
.ns-ip { font-size: 14px; font-weight: 800; color: #0f172a; word-break: break-all; line-height: 1.3; }
.ns-ip-sub { font-size: 11px; color: #64748b; margin-top: 2px; word-break: break-all; line-height: 1.3; }
.ns-count { font-size: 11px; color: #4338ca; background: #eef2ff; padding: 3px 9px; border-radius: 999px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.ns-total { display: flex; gap: 8px; margin-top: 10px; }
.ns-total-item {
  flex: 1; border-radius: 16px; background: rgba(255,255,255,.75);
  border: 1px solid #e2e8f0; padding: 10px;
}
.ns-total-item span { display: block; font-size: 10px; color: #64748b; margin-bottom: 4px; }
.ns-total-item strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.ns-total-item strong.up { color: #0d9488; }
.ns-total-item strong.down { color: #2563eb; }
.ns-devs { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; flex: 1 1 auto; overflow-y: auto; min-height: 0; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(100,116,139,.4) transparent; }
.ns-devs::-webkit-scrollbar { width: 6px; }
.ns-devs::-webkit-scrollbar-thumb { background: rgba(100,116,139,.4); border-radius: 3px; }
.select { min-height: 34px; padding: 6px 10px; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff; color: #0f172a; font-size: 13px; cursor: pointer; }
body.dark .select { background: #0b1220; border-color: #2b3a4d; color: #e5eefb; }
.ns-dev {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 12px;
  background: rgba(248,250,252,.9);
  border: 1px solid #eef2f7;
  font-size: 12px;
}
.ns-dev.is-off { opacity: .5; }
.ns-dev-name { color: #334155; font-weight: 600; word-break: break-all; }
.ns-on { color: #16a34a; font-size: 10px; font-weight: 700; }
.ns-off { color: #94a3b8; font-size: 10px; font-weight: 700; }
.ns-dev-up { color: #0d9488; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ns-dev-down { color: #2563eb; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.dark .net-speed-summary .ns-sum-item { background: rgba(30,41,59,.55); border-color: #223041; }
body.dark .net-speed-summary .ns-sum-item span { color: #8ea0b8; }
body.dark .net-speed-summary .ns-sum-item strong { color: #e5eefb; }
body.dark .ns-card {
  background: linear-gradient(180deg, rgba(15,23,42,.98), rgba(17,24,39,.98));
  border-color: #243244; box-shadow: none;
}
body.dark .ns-ip { color: #e5eefb; }
body.dark .ns-ip-sub { color: #8ea0b8; }
body.dark .ns-count { background: #1e293b; color: #c7d2fe; }
body.dark .ns-total-item { background: rgba(30,41,59,.55); border-color: #223041; }
body.dark .ns-total-item span { color: #8ea0b8; }
body.dark .ns-total-item strong { color: #e5eefb; }
body.dark .ns-dev { background: rgba(30,41,59,.4); border-color: #223041; }
body.dark .ns-dev-name { color: #cbd5e1; }
body.dark .ns-dev-up { color: #2dd4bf; }
body.dark .ns-dev-down { color: #93c5fd; }
@media (max-width: 640px) {
  .net-speed-cards { grid-template-columns: 1fr; }
  .ns-sum-time { margin-left: 0; }
}

/* 直播时间段：设备筛选面板（TX / VN 系列快捷 + 单设备勾选统计） */
.lt-device-filter {
  margin-top:14px;
  padding:10px 12px;
  border:1px solid #e2e8f0;
  border-radius:10px;
  background:#f8fafc;
}
.lt-filter-quick {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.lt-filter-label { font-size:13px; font-weight:600; }
.lt-filter-search {
  flex:0 1 200px;
  min-width:140px;
  padding:5px 9px;
  font-size:13px;
  border:1px solid #cbd5e1;
  border-radius:6px;
  background:#fff;
  color:inherit;
}
.lt-filter-count { font-size:12px; color:#64748b; }
.lt-device-list {
  display:flex;
  flex-wrap:wrap;
  gap:6px 16px;
  margin-top:9px;
  max-height:168px;
  overflow-y:auto;
}
.lt-dev-item {
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-size:13px;
  cursor:pointer;
  user-select:none;
}
.lt-dev-item input { margin:0; cursor:pointer; }
body.dark .lt-device-filter { background:#0f172a; border-color:#1e293b; }
body.dark .lt-filter-search { background:#0b1220; border-color:#334155; color:#e2e8f0; }
body.dark .lt-filter-count { color:#94a3b8; }

.live-timeline-grid {
  margin-top:16px;
  display:grid;
  gap:12px;
}
.live-timeline-stats {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:2px;
}
.stat-pill {
  display:flex;
  flex-direction:column;
  gap:2px;
  padding:8px 14px;
  border-radius:10px;
  background:#f1f5f9;
  border:1px solid #e2e8f0;
  min-width:140px;
  flex:1 1 140px;
}
.stat-pill .stat-k {
  font-size:11px;
  color:#64748b;
  font-weight:600;
}
.stat-pill .stat-v {
  font-size:17px;
  font-weight:800;
  color:#0f172a;
  line-height:1.2;
}
.stat-pill .stat-sub {
  font-size:11px;
  color:#94a3b8;
}
.stat-peak { background:#ecfdf5; border-color:#a7f3d0; }
.stat-peak .stat-v { color:#047857; }
.stat-trough { background:#fff7ed; border-color:#fed7aa; }
.stat-trough .stat-v { color:#c2410c; }
.stat-total { background:#eff6ff; border-color:#bfdbfe; }
.stat-total .stat-v { color:#1d4ed8; }
.stat-empty { flex:1 1 100%; color:#64748b; font-size:13px; }
.timeline-group {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}
.live-timeline-head,
.live-timeline-row {
  display:grid;
  grid-template-columns: 180px 1fr;
  gap:12px;
  align-items:end;
}
.live-timeline-head {
  font-size:12px;
  color:#64748b;
  font-weight:700;
}
.live-timeline-device {
  padding:0 0 2px 0;
  background:transparent;
  border:none;
  border-radius:0;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
}
.live-timeline-device strong {
  display:block;
  font-size:14px;
  color:#0f172a;
  line-height:1.3;
}
.live-timeline-device > span {
  display:block;
  margin-top:4px;
  font-size:11px;
  color:#64748b;
}
.live-timeline-track {
  min-width:0;
  position: relative;
}
/* 跨自然日虚竖线 */
.day-divider {
  position: absolute; top: 0; bottom: 0; width: 0;
  border-left: 1px dashed #94a3b8;
  z-index: 2; pointer-events: none;
}
body.dark .day-divider { border-left-color: #64748b; }

/* 直播时间段：鼠标悬停竖线 + 当前时间段直播设备数 */
.live-timeline-grid { position: relative; }
/* 直播时间段：鼠标悬停竖线（对齐参考，点击固定为橙色） */
.live-timeline-cursor {
  position: absolute; top: 0; width: 2px; background: #2563eb;
  pointer-events: none; z-index: 5; display: none;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, .25);
}
body.dark .live-timeline-cursor { background: #60a5fa; box-shadow: 0 0 0 1px rgba(96, 165, 250, .25); }
.live-timeline-cursor.ltPinned { background: #f59e0b; box-shadow: 0 0 0 1.5px rgba(245, 158, 11, .35); }
body.dark .live-timeline-cursor.ltPinned { background: #fbbf24; box-shadow: 0 0 0 1.5px rgba(251, 191, 36, .35); }
/* 白色可固定浮层：直播时间段 hover 显示「直播时间 几时几分 ~ 几时几分 · X台」（复制网速色块 speed-tip） */
.lt-tip {
  position: fixed; z-index: 9999; display: none;
  background: #ffffff; color: #0f172a; font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 8px; border: 1px solid #e2e8f0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22); pointer-events: none;
  white-space: nowrap; max-width: 80vw;
}
.lt-tip.pinned { outline: 2px solid #3b82f6; outline-offset: 2px; }
body.dark .lt-tip { background: #1e293b; color: #e2e8f0; border-color: #334155; }
.live-timeline-hour-labels,
.live-timeline-bars {
  display:grid;
  grid-template-columns: repeat(var(--timeline-cols, 24), minmax(0, 1fr));
  gap: var(--slot-gap, 4px);
}
.live-timeline-hour-labels {
  min-height: 16px;
  margin-bottom: 4px;
}
.live-timeline-hour-labels span {
  font-size:10px;
  color:#94a3b8;
  text-align:center;
}
.live-slot {
  height:22px;
  border-radius:6px;
  background:#e5e7eb;
  border:1px solid #dbe3ee;
}
.live-slot.live {
  background:#ef4444;
  border-color:#dc2626;
}
.live-slot.idle {
  background:#e5e7eb;
}
.live-timeline-hour-labels.daily-labels span {
  font-size:11px;
  font-weight:600;
}
body.dark .live-timeline-device {
  background:transparent;
  border:none;
}
body.dark .live-timeline-device strong { color:#e5eefb; }
body.dark .live-timeline-device > span,
body.dark .live-timeline-head,
body.dark .live-timeline-hour-labels span { color:#8ea0b8; }
body.dark .live-slot.idle { background:#1f2937; border-color:#334155; }
body.dark .live-timeline-stats .stat-pill { background:#132038; border-color:#223041; }
body.dark .live-timeline-stats .stat-k { color:#8ea0b8; }
body.dark .live-timeline-stats .stat-v { color:#e5eefb; }
body.dark .live-timeline-stats .stat-sub { color:#6b7d96; }
body.dark .stat-peak { background:#0c2a22; border-color:#14532d; }
body.dark .stat-peak .stat-v { color:#34d399; }
body.dark .stat-trough { background:#2a1a0c; border-color:#7c2d12; }
body.dark .stat-trough .stat-v { color:#fb923c; }
body.dark .stat-total { background:#0c1a2e; border-color:#1e3a5f; }
body.dark .stat-total .stat-v { color:#60a5fa; }
body.dark .heatmap-group,
body.dark .timeline-group { border-top-color: #223041; }
@media (max-width: 900px) {
  .live-timeline-head,
  .live-timeline-row { grid-template-columns: 1fr; }
}

/* Push settings */
.push-keys-list { display:flex; flex-direction:column; gap:8px; margin-top:10px; }
/* 预备中超时 / 下播没关推 的规则列表：配置多台时长列表，改为内部滚动，避免整页被撑高 */
#prep-alert-list, #live-end-no-close-alert-list { max-height: 600px; overflow-y: auto; padding-right: 4px; }
/* 推送渠道管理：渠道列表过长时改为内部滚动，避免整页被撑高（只针对渠道列表，不影响其它预警列表） */
#push-keys-list {
  max-height: 340px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 4px;
}
#push-keys-list::-webkit-scrollbar { width: 8px; }
#push-keys-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
#push-keys-list::-webkit-scrollbar-track { background: transparent; }
body.dark #push-keys-list::-webkit-scrollbar-thumb { background: #334155; }
@media (max-width: 640px) { #push-keys-list { max-height: 280px; } }
.push-key-item {
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; padding:10px 12px; border-radius:10px;
  border:1px solid #e2e8f0; background:#fff;
  flex-wrap:wrap;
}
.push-key-info { display:flex; flex-direction:column; gap:2px; min-width:140px; }
.push-key-info strong { font-size:14px; color:#0f172a; }
.push-key-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.push-key-actions .toggle-inline { font-size:13px; }
.cpa-sel-wrap { margin-right:2px; display:flex; align-items:center; }
.push-key-item.disabled-item { opacity:0.6; }
.pk-only-badge {
  display:inline-block; margin-left:6px; padding:1px 7px; border-radius:999px;
  font-size:11px; font-weight:600; line-height:1.6; color:#1d4ed8;
  background:#eff6ff; border:1px solid #bfdbfe; vertical-align:middle;
}
body.dark .pk-only-badge { color:#93c5fd; background:#172554; border-color:#1e40af; }
.im-events { display:flex; flex-wrap:wrap; gap:4px 14px; margin-top:6px; max-width:680px; }
.im-events label { font-size:13px; color:#334155; cursor:pointer; }
body.dark .im-events label { color:#cbd5e1; }
/* 按设备分人（device_push_routes） */
.droute-k-item {
  display:inline-flex; align-items:center; gap:5px; font-size:13px; color:#334155; cursor:pointer;
  padding:3px 9px; border:1px solid #cbd5e1; border-radius:999px; background:#f8fafc;
}
.droute-k-item:hover { border-color:#6366f1; color:#4338ca; }
.droute-k-item.off { opacity:.55; }
body.dark .droute-k-item { color:#cbd5e1; border-color:#334155; background:#1e293b; }
body.dark .droute-k-item:hover { border-color:#6366f1; color:#a5b4fc; }
.droute-multi { display:flex; flex-wrap:wrap; gap:4px 8px; max-height:180px; overflow-y:auto; padding:6px; border:1px solid #e2e8f0; border-radius:8px; background:#f8fafc; max-width:440px; }
body.dark .droute-multi { border-color:#223041; background:#0f172a; }
.droute-multi-ops { margin-top:5px; display:flex; gap:6px; }
.droute-row {
  display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
  padding:8px 10px; border:1px solid #e2e8f0; border-radius:8px; background:#fff;
}
body.dark .droute-row { border-color:#223041; background:#0f172a; }
.droute-row-main { display:flex; align-items:center; gap:8px; flex-wrap:wrap; min-width:0; }

/* 预警规则设备多选面板（预备中超时 / 下播没关推 添加用） */
.dev-multi-picker { border:1px solid var(--border,#e2e8f0); border-radius:8px; padding:8px; min-width:240px; flex:1 1 260px; max-width:380px; background:rgba(148,163,184,.06); }
body.dark .dev-multi-picker { border-color:#334155; background:rgba(148,163,184,.08); }
.dmp-bar { display:flex; gap:6px; margin-bottom:6px; }
.dmp-search { flex:1 1 auto; min-width:0; padding:5px 8px; border:1px solid var(--border,#e2e8f0); border-radius:6px; font-size:13px; background:#fff; color:inherit; }
body.dark .dmp-search { background:#0f172a; border-color:#334155; }
.dmp-list { max-height:180px; overflow:auto; display:flex; flex-direction:column; gap:2px; padding-right:2px; }
.dmp-item { display:flex; align-items:center; gap:6px; padding:3px 4px; border-radius:5px; cursor:pointer; line-height:1.3; }
.dmp-item:hover { background:rgba(99,102,241,.12); }
.dmp-item input[type="checkbox"] { width:15px; height:15px; margin:0; flex:0 0 auto; cursor:pointer; }
.dmp-nm { font-weight:600; font-size:13px; color:#0f172a; }
body.dark .dmp-nm { color:#f1f5f9; }
.dmp-sub { font-size:12px; color:#64748b; }
body.dark .dmp-sub { color:#94a3b8; }
.dmp-foot { margin-top:6px; font-size:12px; color:#64748b; }
body.dark .dmp-foot { color:#94a3b8; }
.dmp-opts { display:flex; flex-direction:column; gap:8px; align-items:flex-start; }
.dmp-count { font-weight:700; color:#4338ca; }
body.dark .dmp-count { color:#a5b4fc; }
.droute-sel-cell { display:inline-flex; align-items:center; flex:0 0 auto; }
.droute-sel-cell input[type="checkbox"] { width:16px; height:16px; margin:0; cursor:pointer; }
.bulk-bar .btn.danger:disabled { opacity:.5; cursor:not-allowed; }
.droute-dev { font-weight:700; font-size:13px; color:#0f172a; }
body.dark .droute-dev { color:#f1f5f9; }
.droute-ev {
  font-size:11px; padding:1px 7px; border-radius:999px; background:#eef2ff; color:#4338ca; border:1px solid #c7d2fe;
}
body.dark .droute-ev { background:#1e1b4b; color:#a5b4fc; border-color:#3730a3; }
.droute-keys-txt { font-size:12px; color:#475569; }
body.dark .droute-keys-txt { color:#94a3b8; }
.droute-badge { font-size:11px; padding:1px 7px; border-radius:999px; background:#dcfce7; color:#15803d; }
.droute-badge.off { background:#f1f5f9; color:#64748b; }
body.dark .droute-badge { background:#14532d; color:#86efac; }
body.dark .droute-badge.off { background:#1e293b; color:#94a3b8; }
.droute-row-ops { display:flex; gap:6px; flex-wrap:wrap; }
.im-edit-box { padding:12px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px; }
body.dark .im-edit-box { background:#0b1220; border-color:#1e293b; }
.im-edit-box input[type="number"] { width:54px; }
.im-edit-box input:not([type="number"]) { padding:4px 8px; border:1px solid #cbd5e1; border-radius:6px; }
body.dark .push-key-item { background:#0f172a; border-color:#1e293b; }
body.dark .push-key-info strong { color:#e5eefb; }
body.dark .push-key-info .muted { color:#8ea0b8; }

/* ===== Mobile comprehensive optimization ===== */
@media (max-width: 640px) {
  /* ---- General ---- */
  .wrap { padding: 0 12px; }
  .main { padding: 12px 12px 24px; }
  .btn { min-height: 40px; padding: 8px 12px; font-size: 13px; }
  input, select, textarea { min-height: 40px; padding: 8px 10px; font-size: 14px; }
  .grid.cards { grid-template-columns: 1fr; gap: 10px; }

  /* ---- Header / Toolbar（手机：两行紧凑） ---- */
  header { padding: 8px 12px 5px; position: relative; }
  .toolbar { flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .toolbar > div:first-child { flex: 1 1 auto; min-width: 0; }
  .toolbar .row { margin-left: 0; flex: 1 1 100%; order: 3; flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
  #site-probe { flex: 0 1 auto; order: 2; height: 26px; gap: 9px; padding: 2px 8px; max-width: 62%; }
  .title { font-size: 16px; }
  .site-logo { width: 30px; height: 30px; }
  .tabs { flex-wrap: wrap; gap: 4px; }
  .tab { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
  .theme-select { font-size: 12px; padding: 4px 8px; min-height: 30px; }
  .theme-toggle { font-size: 14px; padding: 2px 7px; min-height: 30px; }
  .lang-select { font-size: 12px; padding: 4px 8px; min-height: 30px; }
  .btn-logout { font-size: 12px; padding: 5px 10px; min-height: 30px; }
  #user-name { display: none; }
  .lang-select { font-size: 12px; padding: 6px 8px; min-height: 34px; max-width: 156px; position: absolute; top: 10px; right: 12px; z-index: 5; }
  .theme-toggle { width: 34px; height: 34px; font-size: 14px; }
  .user-menu { font-size: 12px; gap: 6px; }
  .btn-logout { display: none; }

  /* ---- Login ---- */
  .login-page { padding: 12px; }
  .login-card { padding: 24px 18px 20px; max-width: 100%; border-radius: 16px; }
  .login-logo { width: 48px; height: 48px; border-radius: 14px; }
  .login-title { font-size: 18px; }
  .login-subtitle { font-size: 12px; }
  .login-form .form-group label { font-size: 12px; }
  .login-form input { min-height: 44px; }
  .login-btn { min-height: 44px; font-size: 14px; }
  .login-lang { margin-top: 14px; padding-top: 12px; }
  .login-lang-select { min-height: 44px; font-size: 14px; max-width: 100%; }

  /* ---- Dashboard (default) ---- */
  .ss-title { font-size: 20px; }
  .ss-overall { padding: 8px 12px; font-size: 12px; gap: 6px; }
  .ss-meta { flex-wrap: wrap; gap: 6px; }
  .ss-meta .pill { font-size: 10px; padding: 2px 6px; }
  .net-speed-value { font-size: 18px; }
  .section-title { font-size: 13px; margin: 14px 0 8px; }

  /* ---- Apple theme ----
     手机端为「1 分组 × 3 列设备」，每格约 110px，字号需比 2 列时更紧凑 */
  .apple-hero { padding: 12px; border-radius: 12px; }
  .apple-hero-title { font-size: 18px; }
  .apple-hero-sub { font-size: 11px; }
  .apple-overall { padding: 6px 10px; font-size: 11px; }
  .apple-group-card { padding: 10px; border-radius: 14px; }
  .apple-dev-item { padding: 2px 2px; gap: 3px; }
  .apple-dev-name { font-size: 11px; }
  .apple-dev-suffix { font-size: 10px; }
  .apple-dev-offline { font-size: 9px; margin-left: 1px; }
  .apple-icon-live, .apple-icon-screen-alert { width: 12px; height: 12px; }
  .apple-group-title { font-size: 12px; }
  .apple-group-meta { font-size: 10px; }

  /* ---- Tables -> Mobile Cards ---- */
  .grouped-device-table { font-size: 12px; display: block; }
  .grouped-device-table thead { display: none; }
  .grouped-device-table tbody { display: block; }
  .grouped-device-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    padding: 12px;
    background: var(--card-bg, #fff);
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid var(--border, #e2e8f0);
  }
  body.dark .grouped-device-table tr {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
  .grouped-device-table td {
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .grouped-device-table td::before {
    content: attr(data-label);
    font-size: 10px;
    color: #94a3b8;
    flex-shrink: 0;
  }
  /* Desktop columns hidden on mobile */
  .grouped-device-table td.td-os,
  .grouped-device-table td.td-disk,
  .grouped-device-table td.td-action,
  .grouped-device-table th.th-mob { display: none; }
  /* Mobile-only columns shown */
  .grouped-device-table td.td-group,
  .grouped-device-table td.td-cpu-mem,
  .grouped-device-table td.td-uptime-rate,
  .grouped-device-table td.td-note { display: flex; }
  /* Grid placement for mobile card layout */
  .grouped-device-table td.td-status { grid-column: 1; grid-row: 1; }
  .grouped-device-table td.td-group { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .grouped-device-table td.td-group::before { display: none; }
  .grouped-device-table td.td-name { grid-column: 1 / -1; grid-row: 2; font-size: 14px; font-weight: 600; }
  .grouped-device-table td.td-name::before { display: none; }
  .grouped-device-table td.td-mac { grid-column: 1 / -1; grid-row: 3; font-size: 11px; }
  .grouped-device-table td.td-mac::before { display: none; }
  .grouped-device-table td.td-cpu-mem { grid-column: 1; grid-row: 4; }
  .grouped-device-table td.td-uptime-rate { grid-column: 2; grid-row: 4; justify-content: flex-end; }
  .grouped-device-table td.td-note { grid-column: 1 / -1; grid-row: 5; font-size: 11px; color: #64748b; }
  .grouped-device-table td.td-condition { grid-column: 1; grid-row: 6; }
  .grouped-device-table td.td-condition::before { display: none; }
  .grouped-device-table td.td-net { grid-column: 2; grid-row: 6; justify-content: flex-end; }
  .grouped-device-table td.td-net::before { display: none; }
  .table-wrap { margin: 0 -12px; padding: 0 12px; }

  /* ---- Modal ---- */
  .modal-card { max-width: 96%; border-radius: 14px; max-height: calc(100vh - 16px); }
  .modal-header { padding: 14px 16px 10px; }
  .modal-title { font-size: 16px; }
  .modal-sub { font-size: 10px; }
  .modal-body { padding: 12px 16px 16px; }
  .modal-tabs {
    /* 7 个 tab 在 350px 容器里用 flex:1 会被压成「一字一行」竖排。
       改为 4 列网格：2 行整齐排布，每 tab 等宽、文字完整 */
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 4px;
  }
  .modal-tab { padding: 6px 4px; font-size: 11px; }
  .modal-close { width: 32px; height: 32px; }

  /* ---- Modal info grid ---- */
  .detail-grid { gap: 10px 12px; }
  .ss-k { font-size: 11px; }
  .ss-v { font-size: 13px; }
  .screen-block { gap: 8px; }
  .screen-header { font-size: 13px; }
  .screen-toggles { padding: 8px 10px; gap: 8px 12px; }
  .screen-toggles .toggle-inline { font-size: 12px; }
  .mon-item { padding: 8px 10px; }
  .mon-badge { width: 18px; height: 18px; font-size: 10px; }

  /* ---- 设备详情「总览」面板：保留 2 列网格，缩小间距和字号，
         8 张卡片原本纵向堆叠（修基础样式后已 2 列 4 行），再紧凑化减少滚动 ---- */
  .device-overview-grid { gap: 8px; }
  .overview-card { padding: 8px 10px; font-size: 11px; }
  .overview-card h4 { font-size: 11px; margin-bottom: 4px; padding-bottom: 3px; }
  .overview-pair { padding: 2px 0; }
  .overview-pair > span,
  .overview-pair > strong { font-size: 11px; }
  .overview-list-item { font-size: 10px; padding: 3px 6px; }
  .overview-note { font-size: 11px; }
  .overview-list { max-height: 120px; }

  /* ---- Page settings ---- */
  .settings-card, .export-group-card { padding: 14px; border-radius: 12px; }
  .settings-card h3 { font-size: 14px; }
  .sortable-item { padding: 8px 10px; gap: 8px; }
  .sort-handle { width: 24px; height: 24px; }

  /* ---- Device export ---- */
  .export-group-card .row { flex-direction: column; align-items: stretch; gap: 8px; }

  /* ---- Traffic stats ---- */
  .traffic-stats-cards { grid-template-columns: 1fr; gap: 10px; }
  .traffic-stat-card { padding: 14px; }
  .traffic-stat-name { font-size: 15px; }
  .traffic-stat-big { font-size: 24px; }
  .traffic-day-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .traffic-day-card { padding: 10px 12px; }
  .traffic-rank-item { padding: 8px 10px; }

  /* ---- Timeline (modal) ---- */
  .tl-day-row { grid-template-columns: 70px 1fr; gap: 6px; }
  .tl-day-label b { font-size: 10px; }
  .tl-day-label span { font-size: 9px; }
  .tl-cells { gap: 1px; }
  .tl-cell { height: 16px; border-radius: 2px; min-width: 4px; }
  .tl-hour-scale { margin-left: 76px; font-size: 9px; }

  /* ---- Live timeline ---- */
  .live-timeline-head { display: none; }
  .live-timeline-row { grid-template-columns: 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid #e2e8f0; }
  .live-timeline-device { padding: 0; background: transparent; border: none; }
  .live-timeline-device strong { font-size: 13px; }
  .live-timeline-device span { font-size: 11px; }
  .live-timeline-bars { gap: 2px; }
  .live-slot { min-width: 6px; height: 18px; }
  .daily-labels span { font-size: 10px; }
  .daily-bars { gap: 3px; }

  /* ---- Push settings ---- */
  .push-key-item { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; }
  .push-key-info { min-width: 0; }
  .push-key-actions { flex-wrap: wrap; gap: 8px; }
  .push-key-actions .toggle-inline { font-size: 12px; }

  /* ---- Sort bar / filters ---- */
  .sort-bar, .filter-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .sort-bar .row, .filter-bar .row { justify-content: space-between; }

  /* ---- Misc ---- */
  .refresh-fab { top: 6px; right: 6px; padding: 5px 8px; font-size: 11px; }
  .hardware-disks { gap: 8px; }
  .disk-item { padding: 10px 12px; gap: 6px; }
  .disk-header { font-size: 13px; }
  .ip-history-item { padding: 8px 4px; font-size: 12px; }
  .ip-toolbar { gap: 8px; }
}

/* ---- Speed heatmap (hourly traffic) ---- */
.speed-heatmap-grid {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}
.heatmap-group {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}
.speed-heatmap-head,
.speed-heatmap-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: end;
}
.speed-heatmap-head {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
}
.speed-heatmap-device {
  padding: 0 0 2px 0;
  background: transparent;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.speed-heatmap-device strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
  line-height: 1.3;
}
.speed-heatmap-device > span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
}
.speed-heatmap-track {
  min-width: 0;
}
.speed-heatmap-labels,
.speed-heatmap-bars {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 4px;
}
.speed-heatmap-labels {
  min-height: 16px;
  margin-bottom: 4px;
}
.speed-heatmap-labels span {
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
}
.speed-slot {
  height: 18px;
  border-radius: 5px;
  background: #e5e7eb;
  border: 1px solid #dbe3ee;
  cursor: pointer;
}
.speed-slot.lv0 { background: #e5e7eb; border-color: #dbe3ee; }
.speed-slot.lv1 { background: #bbf7d0; border-color: #86efac; }
.speed-slot.lv2 { background: #4ade80; border-color: #22c55e; }
.speed-slot.lv3 { background: #16a34a; border-color: #15803d; }
.speed-slot.lv4 { background: #dc2626; border-color: #b91c1c; }
.speed-slot.lv5 { background: #111111; border-color: #000000; }

/* 每小时网速色块：自定义可固定 tooltip */
.speed-tip {
  position: fixed; z-index: 9999; display: none;
  background: #0b1220; color: #e5eefb; font-size: 12px; font-weight: 500;
  padding: 6px 10px; border-radius: 8px; border: 1px solid #223041;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3); pointer-events: none;
  white-space: nowrap; max-width: 80vw;
}
.speed-tip.pinned { outline: 2px solid #3b82f6; outline-offset: 2px; }
.speed-heatmap-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 12px;
  color: #64748b;
}
.speed-heatmap-legend i {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid;
}
.speed-heatmap-legend i.lv0 { background: #e5e7eb; border-color: #dbe3ee; }
.speed-heatmap-legend i.lv1 { background: #bbf7d0; border-color: #86efac; }
.speed-heatmap-legend i.lv2 { background: #4ade80; border-color: #22c55e; }
.speed-heatmap-legend i.lv3 { background: #16a34a; border-color: #15803d; }
.speed-heatmap-legend i.lv4 { background: #dc2626; border-color: #b91c1c; }
.speed-heatmap-legend i.lv5 { background: #111111; border-color: #000000; }
body.dark .speed-heatmap-device {
  background: transparent;
  border: none;
}
body.dark .speed-heatmap-device strong { color: #e5eefb; }
body.dark .speed-heatmap-device > span,
body.dark .speed-heatmap-head,
body.dark .speed-heatmap-labels span { color: #8ea0b8; }
body.dark .speed-slot.lv0 { background: #1f2937; border-color: #334155; }
body.dark .speed-slot.lv1 { background: #14532d; border-color: #166534; }
body.dark .speed-slot.lv2 { background: #15803d; border-color: #166534; }
body.dark .speed-slot.lv3 { background: #22c55e; border-color: #4ade80; }
body.dark .speed-slot.lv4 { background: #ef4444; border-color: #f87171; }
body.dark .speed-slot.lv5 { background: #000000; border-color: #333333; }
@media (max-width: 900px) {
  .speed-heatmap-head,
  .speed-heatmap-row { grid-template-columns: 1fr; }
}

/* ---- Account management ---- */
.settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.settings-table th,
.settings-table td {
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  text-align: left;
}
.settings-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #334155;
}
.settings-table tr:hover {
  background: #f8fafc;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-admin {
  background: #dbeafe;
  color: #1d4ed8;
}
.badge-user {
  background: #f3f4f6;
  color: #6b7280;
}
.nav-hidden {
  display: none !important;
}
.df-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
/* 账户管理「可见设备」区块：按设备用户批量分享 */
.df-note-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}
.df-note-row .form-hint { font-size: 12px; }
.df-note-row select {
  padding: 3px 6px;
  font-size: 12px;
  border: 1px solid #d5dbe4;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  max-height: 30px;
}
body.dark .df-note-row select { background: #131c31; border-color: #334155; color: #e2e8f0; }
/* 设备勾选列表里紧跟设备名后的「用户」小字（区分同名机器、便于核对批量结果） */
.df-dev-note { color: #64748b; font-size: 11px; font-weight: 500; }
body.dark .df-dev-note { color: #94a3b8; }
.badge-super {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}
body.dark .settings-table th {
  background: #1e293b;
  color: #e5eefb;
  border-color: #334155;
}
body.dark .settings-table td {
  border-color: #334155;
}
body.dark .settings-table tr:hover {
  background: #1e293b;
}
body.dark .badge-admin {
  background: #1e3a8a;
  color: #93c5fd;
}
body.dark .badge-user {
  background: #374151;
  color: #9ca3af;
}
body.dark .badge-super {
  background: #78350f;
  color: #fcd34d;
  border-color: #92400e;
}

/* Permission checkboxes */
.perm-checks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
}
.perm-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  color: #334155;
  cursor: pointer;
  user-select: none;
}
.perm-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  cursor: pointer;
}
body.dark .perm-check { color: #bfd3ef; }
@media (max-width: 640px) {
  .perm-checks { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .traffic-day-cards { grid-template-columns: 1fr; }
}

/* ============================================================
   Settings sub-tabs
   ============================================================ */
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}
.settings-tab {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.settings-tab:hover { background: #f1f5f9; color: #334155; }
.settings-tab.active { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
body.dark .settings-tabs { border-color: #223041; }
body.dark .settings-tab { color: #8ea0b8; }
body.dark .settings-tab:hover { background: #1e293b; color: #e5eefb; }
body.dark .settings-tab.active { background: #1e3a5f; color: #93c5fd; border-color: #3b82f6; }

/* ============================================================
   Live Room
   ============================================================ */
.live-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.live-room-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* --- 即将直播（预热中）：精简卡片，只保留 设备名 / 用户 / 网速 --- */
.upcoming-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: #d97706;
  font-size: 11px; font-weight: 800;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid #f59e0b;
  vertical-align: middle; margin-left: 4px;
  letter-spacing: 0.02em; white-space: nowrap;
}
.upcoming-live-card { padding: 8px 10px; gap: 4px; border-style: dashed; border-color: #fcd34d; position: relative; }
.upcoming-live-top { font-size: 13px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding-right: 70px; }
.upcoming-prep-dur {
  position: absolute; top: 6px; right: 8px;
  font-size: 11px; font-weight: 700; color: #ea580c;
  background: rgba(249, 115, 22, 0.12); border: 1px solid #f97316;
  border-radius: 999px; padding: 1px 8px; white-space: nowrap; line-height: 1.4;
}
body.dark .upcoming-prep-dur { color: #fb923c; background: rgba(249, 115, 22, 0.18); }
.upcoming-live-speed { display: flex; align-items: baseline; gap: 10px; font-size: 11px; font-variant-numeric: tabular-nums; }
.upcoming-down { color: #0284c7; font-weight: 700; }
.upcoming-up { color: #94a3b8; }
body.dark .upcoming-live-card { background: #131c31; border-color: #78350f; }
body.dark .upcoming-badge { color: #fbbf24; border-color: #b45309; }
body.dark .upcoming-down { color: #38bdf8; }
body.dark .upcoming-up { color: #64748b; }
.live-room-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.live-room-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #ef4444;
  animation: livePulse 1.2s infinite;
  flex-shrink: 0;
}
.live-room-card-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
}
.live-room-mac { font-family: ui-monospace, monospace; }
.live-room-card-start {
  font-size: 10px;
  color: #ef4444;
  margin-top: 2px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
body.dark .live-room-card { background: #0f172a; border-color: #223041; color: #e5eefb; }
body.dark .live-room-card-info { color: #8ea0b8; }
body.dark .live-room-card-start { color: #f87171; }

/* 设备名含中文时允许换行，避免撑破卡片（flex 子项需 min-width:0） */
.live-room-name {
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.live-room-suffix {
  font-size: 12px; font-weight: 600; color: #64748b; margin-left: 4px;
}
body.dark .live-room-suffix { color: #94a3b8; }

.live-room-day-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.live-room-day-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.live-room-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  gap: 6px;
}
.live-room-name-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
.live-room-day-header span { color: #64748b; font-size: 11px; }
.live-room-day-total { color: #16a34a; font-weight: 700; font-size: 11px; background: #f0fdf4; padding: 2px 8px; border-radius: 999px; border: 1px solid #bbf7d0; }
body.dark .live-room-day-total { background: #052e16; color: #4ade80; border-color: #166534; }
.live-room-day-sessions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.live-room-day-session {
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: ui-monospace, monospace;
  word-break: break-word;
  overflow-wrap: anywhere;
}
body.dark .live-room-day-card { background: #0f172a; border-color: #223041; color: #e5eefb; }
body.dark .live-room-day-session { background: #1e293b; color: #94a3b8; }

@media (max-width: 1200px) {
  .live-room-day-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .live-room-day-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .live-room-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .live-room-card { padding: 8px 9px; font-size: 12px; }
  .live-room-card-top { font-size: 12px; }
  .live-room-card-start { font-size: 9px; }
  .live-room-day-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .live-room-day-card { padding: 8px 9px; font-size: 12px; }
  .live-room-day-header { font-size: 12px; }
  .live-room-day-header span { font-size: 10px; }
  .live-room-day-session { font-size: 10px; padding: 2px 5px; }
  .live-room-day-total { font-size: 10px; padding: 2px 6px; }
  .live-timeline-chip { font-size: 11px; padding: 4px 9px; }
  .live-timeline-chip-count { font-size: 10px; }
  .live-room-ended-tag { font-size: 9px; padding: 1px 6px; }
}
@media (max-width: 420px) {
  .live-room-grid { grid-template-columns: repeat(2, 1fr); }
  .live-room-day-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 近30天 / 近自然月：每天总数条 + 设备时长列表（不显示时间段） */
.live-range-days {
  display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px;
  padding: 8px 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
}
body.dark .live-range-days { background: #0f172a; border-color: #223041; }
.live-range-day {
  display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15;
  min-width: 38px; padding: 3px 4px; border-radius: 7px;
  font-size: 11px; color: #94a3b8; background: #fff; border: 1px solid #e2e8f0;
}
body.dark .live-range-day { background: #1e293b; border-color: #334155; color: #64748b; }
.live-range-day b { font-size: 13px; font-weight: 800; color: #cbd5e1; margin-top: 1px; }
.live-range-day.has { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.live-range-day.has b { color: #1d4ed8; }
body.dark .live-range-day.has { background: #172554; border-color: #1e40af; color: #93c5fd; }
body.dark .live-range-day.has b { color: #93c5fd; }
/* 可点击：点日期展开当天直播间 */
.live-range-day { cursor: pointer; transition: transform .08s ease, box-shadow .08s ease; }
.live-range-day:hover { box-shadow: 0 1px 4px rgba(37,99,235,.25); transform: translateY(-1px); }
.live-range-day.active { background: #2563eb; border-color: #2563eb; color: #fff; box-shadow: 0 1px 6px rgba(37,99,235,.4); }
.live-range-day.active b { color: #fff; }
body.dark .live-range-day.active { background: #3b82f6; border-color: #3b82f6; }
.live-range-panels { margin-bottom: 4px; }
.live-range-panel { margin-top: 2px; padding-top: 8px; border-top: 1px dashed #e2e8f0; }
body.dark .live-range-panel { border-top-color: #223041; }
.live-range-panel-title { font-size: 13px; font-weight: 700; color: #0f172a; margin: 6px 2px 8px; }
body.dark .live-range-panel-title { color: #e5eefb; }
.live-range-panel-title b { color: #2563eb; margin-left: 2px; }
body.dark .live-range-panel-title b { color: #93c5fd; }
/* 直播间标记 */
/* ============================================================
   Speed heatmap: label alignment helpers
   ============================================================ */
.empty-labels { visibility: hidden; }

/* ============================================================
   Minimal Theme
   ============================================================ */
.minimal-hero {
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e5e5e7;
  border-radius: 14px;
  margin-bottom: 12px;
}
.minimal-hero-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #64748b;
  flex-wrap: wrap;
}
.minimal-hero-stats .stat-on { color: #16a34a; font-weight: 700; }
.minimal-hero-stats .stat-off { color: #dc2626; font-weight: 700; }
.minimal-hero-stats .stat-live { color: #16a34a; font-weight: 700; }

.minimal-group-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.minimal-group {
  background: #fff;
  border: 1px solid #e5e5e7;
  border-radius: 14px;
  padding: 10px 12px;
}
.minimal-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}
.minimal-group-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.minimal-group-meta {
  font-size: 11px;
  color: #94a3b8;
}

.minimal-dev-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.minimal-dev-item {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  transition: all .15s ease;
}
.minimal-dev-item:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}
.minimal-dev-online { border-color: #bbf7d0; background: #f0fdf4; }
.minimal-dev-offline { border-color: #fecaca; background: #fef2f2; }
.minimal-dev-live {
  border-color: #16a34a;
  background: #052e16;
  padding: 4px 6px;
}

.minimal-rec-frame {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #000;
  border: 1px solid #16a34a;
  border-radius: 4px;
  padding: 3px 6px;
  animation: minimalRecPulse 1.4s ease-in-out infinite;
}
@keyframes minimalRecPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.35); border-color: #16a34a; }
  50% { box-shadow: 0 0 8px 2px rgba(34,197,94,0.6); border-color: #4ade80; }
}
.minimal-rec-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: recDotBlink 1s step-end infinite;
  flex-shrink: 0;
}
@keyframes recDotBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}
.minimal-rec-name {
  font-size: 12px;
  font-weight: 600;
  color: #4ade80;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.minimal-rec-suffix {
  font-size: 10px;
  color: #86efac;
  flex-shrink: 0;
}

.minimal-dev-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.minimal-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.minimal-status-dot.online { background: #22c55e; }
.minimal-status-dot.offline { background: #ef4444; }
.minimal-dev-name {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.minimal-dev-suffix {
  font-size: 10px;
  color: #64748b;
  flex-shrink: 0;
}
.minimal-dev-offtime {
  font-size: 10px;
  color: #ef4444;
  margin-top: 2px;
}

body.dark .minimal-hero { background: #0f172a; border-color: #1e293b; }
body.dark .minimal-hero-stats { color: #8ea0b8; }
body.dark .minimal-group { background: #0f172a; border-color: #1e293b; }
body.dark .minimal-group-name { color: #e5eefb; }
body.dark .minimal-dev-item { background: #1e293b; border-color: #334155; }
body.dark .minimal-dev-item:hover { background: #27354f; }
body.dark .minimal-dev-online { border-color: #166534; background: #052e16; }
body.dark .minimal-dev-offline { border-color: #7f1d1d; background: #450a0a; }
body.dark .minimal-dev-name { color: #e5eefb; }
body.dark .minimal-dev-suffix { color: #8ea0b8; }
body.dark .minimal-dev-offtime { color: #f87171; }

@media (max-width: 1200px) {
  .minimal-group-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .minimal-group-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .minimal-dev-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 360px) {
  .minimal-dev-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   移动端默认主题：设备长条列表（点击展开简版详情）
   仅 ≤640px 生效；电脑端仍走原表格，不受影响
   ============================================================ */
@media (max-width: 640px) {
  .mob-dev-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }

  .mob-dev-group {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
  }
  .mob-dev-group-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 9px 12px;
    background: #f8fafc; border-bottom: 1px solid #eef2f7;
  }
  .mob-dev-group-title {
    font-size: 13px; font-weight: 700; color: #0f172a;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .mob-dev-group-meta { font-size: 11px; color: #64748b; flex-shrink: 0; }

  .mob-dev-item { border-bottom: 1px solid #f1f5f9; }
  .mob-dev-item:last-child { border-bottom: none; }

  /* 长条本体：撑满手机宽度。
     固定 height + 子元素统一 line-height，保证所有行等高（不受字体/内容影响） */
  .mob-dev-bar {
    display: flex; align-items: center; gap: 6px;
    width: 100%; height: 50px; padding: 0 12px;
    box-sizing: border-box; line-height: 1;
    background: transparent; border: none; font: inherit;
    text-align: left; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-dev-bar:active { background: rgba(15, 23, 42, .04); }
  .mob-dev-bar > * { line-height: 1; }
  .mob-dev-bar .status-dot { flex-shrink: 0; }

  .mob-dev-namewrap {
    display: flex; align-items: center; gap: 3px;
    min-width: 0; flex: 0 1 auto;
  }
  .mob-dev-name {
    font-size: 14px; font-weight: 700; color: #0f172a;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0; flex: 0 1 auto;
  }
  .mob-dev-note {
    font-size: 11px; color: #64748b; flex-shrink: 0;
    max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .mob-dev-note.empty { color: #cbd5e1; }
  /* 吃掉剩余空间，把右侧元素推到行尾 */
  .mob-spacer { flex: 1 1 0; min-width: 2px; }

  /* 屏幕异常：红色显示器 logo，闪烁 */
  .mob-screen-alert {
    width: 15px; height: 15px; flex-shrink: 0; color: #dc2626;
    animation: mobAlertBlink 1.5s ease-in-out infinite;
  }
  @keyframes mobAlertBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
  }

  /* C 盘容量：圆形百分比环 + 容量文字，颜色随比例变化 */
  .mob-disk { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; }
  .mob-disk-ring { position: relative; width: 26px; height: 26px; flex-shrink: 0; }
  .mob-disk-ring svg { width: 100%; height: 100%; display: block; transform: rotate(-90deg); }
  .mob-disk-ring .ring-bg { fill: none; stroke: #e2e8f0; stroke-width: 4.5; }
  .mob-disk-ring .ring-fg { fill: none; stroke-width: 4.5; stroke-linecap: round; }
  .mob-disk-pct {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 800; line-height: 1;
    font-variant-numeric: tabular-nums;
  }
  .mob-disk-cap {
    display: inline-flex; flex-direction: column; align-items: center;
    font-size: 9px; color: #94a3b8; flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    width: 38px; line-height: 1.1;
  }
  .mob-disk-num { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38px; }
  .mob-disk-bar { width: 100%; height: 1px; background: #cbd5e1; margin: 1px 0; }

  /* CPU / 内存 双横线（上 CPU 蓝、下 内存 紫），位于硬盘圆环前 */
  .mob-cpu-mem {
    display: inline-flex; flex-direction: column; gap: 3px;
    width: 50px; flex-shrink: 0;
  }
  .mob-meter { display: flex; align-items: center; gap: 3px; }
  .mob-meter-lbl {
    font-size: 9px; font-weight: 800; width: 9px; flex-shrink: 0;
    font-variant-numeric: tabular-nums;
  }
  .mob-meter-cpu .mob-meter-lbl { color: #38bdf8; }
  .mob-meter-mem .mob-meter-lbl { color: #a78bfa; }
  .mob-meter-track {
    flex: 1; height: 6px; border-radius: 3px;
    background: #e2e8f0; overflow: hidden;
  }
  .mob-meter-fill { display: block; height: 100%; border-radius: 3px; }
  body.dark .mob-meter-track { background: #1e293b; }

  /* 网速上下行配色同步（下蓝 / 上绿蓝-青） */
  .net-label.down { background: #eff6ff; color: #2563eb; }
  .net-label.up { background: #ecfdf5; color: #0d9488; }
  .net-val { font-weight: 700; font-variant-numeric: tabular-nums; }
  .net-val.down { color: #2563eb; }
  .net-val.up { color: #0d9488; }
  body.dark .net-label.down { background: #132038; color: #93c5fd; }
  body.dark .net-label.up { background: #042f2e; color: #2dd4bf; }
  body.dark .net-val.down { color: #93c5fd; }
  body.dark .net-val.up { color: #2dd4bf; }

  /* 放送中：摄像机绿色闪烁 logo（不带字；详情里的"放送中"文字徽标保持不变） */
  .mob-live-cam {
    width: 15px; height: 15px; flex-shrink: 0; color: #22c55e;
    animation: mobCamBlink 1.4s ease-in-out infinite;
  }
  @keyframes mobCamBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: .25; }
  }
  /* 云手机使用中：手机闪烁 logo，取色同「云手机使用中」徽标 */
  .mob-cloudphone-icon {
    width: 15px; height: 15px; flex-shrink: 0; color: #06b6d4;
    animation: mobCamBlink 1.4s ease-in-out infinite;
  }
  body.dark .mob-cloudphone-icon { color: #67e8f9; }
  /* 展开详情：云手机今日累计使用分钟（使用中高亮，取色同「云手机使用中」） */
  .mob-cloudphone-min { color: #0891b2; font-weight: 600; }
  .mob-cloudphone-min.active { color: #06b6d4; }
  body.dark .mob-cloudphone-min { color: #22d3ee; }
  body.dark .mob-cloudphone-min.active { color: #67e8f9; text-shadow: 0 0 6px rgba(103, 232, 249, .5); }
  .mob-cloudphone-live {
    font-size: 10px; font-weight: 600; color: #06b6d4;
    background: rgba(34, 211, 238, .12);
    border: 1px solid rgba(34, 211, 238, .35);
    padding: 1px 6px; border-radius: 999px; white-space: nowrap;
  }
  body.dark .mob-cloudphone-live { color: #67e8f9; }
  .mob-dev-chevron {
    width: 15px; height: 15px; flex-shrink: 0; color: #94a3b8;
    transition: transform .18s ease;
  }
  .mob-dev-item.expanded .mob-dev-chevron { transform: rotate(180deg); }

  /* 手机端隐藏搜索栏的筛选下拉框：屏幕窄，两个 select 会把搜索框挤到第二行 */
  #status-filter, #group-filter { display: none; }

  /* 展开的简版详情 */
  .mob-dev-detail {
    padding: 6px 12px 12px;
    background: #f8fafc;
    border-top: 1px solid #eef2f7;
    animation: mobFadeIn .16s ease;
  }
  @keyframes mobFadeIn { from { opacity: 0; } to { opacity: 1; } }

  .mob-detail-row {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 0; border-bottom: 1px solid #eef2f7;
  }
  .mob-detail-name-row {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px;
    justify-content: flex-end; text-align: right;
    padding: 2px 0 8px; margin-bottom: 2px;
    border-bottom: 1px solid #e2e8f0;
  }
  .mob-detail-name {
    font-size: 13px; font-weight: 800; color: #0f172a;
    min-width: 0; word-break: break-word; overflow-wrap: anywhere;
  }
  .mob-detail-name-row .homepage-link { margin-left: 0; margin-right: auto; align-self: center; flex-shrink: 0; }
  /* 手机端展开详情：主页 logo 比直播卡大一些（16px，直播卡是 13px），暱称/id 分两行、logo 左侧垂直居中。
     右侧的「位置 / 设备名 / 后缀」维持原样不动。 */
  .mob-detail-name-row .hp-logo { width: 16px; height: 16px; }
  /* 首行用主页头像替掉 TikTok logo：比 logo 略大一圈（18px vs 16px），高度不额外占 */
  .mob-detail-name-row .hp-av { width: 18px; height: 18px; }
  .mob-detail-name-row .hp-logo-fb { width: 16px; height: 16px; }
  /* 手机端设备行横向太挤：隐藏 USB 手机图标（型号文字保留），电脑端不受影响 */
  .mob-dev-detail .usb-phone-icon { display: none; }
  .mob-detail-name-row .hp-stack-txt .hp-nick { font-size: 11px; }
  .mob-detail-name-row .hp-stack-txt .hp-at { font-size: 9px; }
  body.dark .mob-detail-name-row { border-bottom-color: #1e293b; }
  body.dark .mob-detail-name { color: #f1f5f9; }
  .mob-detail-row-stack { align-items: flex-start; }
  .mob-detail-label {
    font-size: 11px; color: #94a3b8; flex-shrink: 0; width: 58px;
  }
  .mob-detail-value {
    font-size: 12px; color: #0f172a; flex: 1; min-width: 0;
    word-break: break-word; line-height: 1.45;
  }
  .mob-detail-sub { font-size: 10px; color: #94a3b8; margin-top: 2px; line-height: 1.35; }
  .mob-muted { color: #94a3b8; }

  .mob-alert-tag {
    display: inline-block; font-size: 10px; font-weight: 700;
    color: #be123c; background: #ffe4e6; padding: 1px 6px; border-radius: 999px;
  }

  .mob-net { font-weight: 700; font-size: 12px; }
  .mob-net.down { color: #2563eb; }
  .mob-net.up { color: #0d9488; }

  /* CPU / 内存：按占比变色（<40 绿 / 40-65 青 / 65-85 橙 / ≥85 红） */
  .mob-pct { font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
  .mob-pct.ok { color: #16a34a; }
  .mob-pct.mid { color: #0891b2; }
  .mob-pct.warn { color: #f59e0b; }
  .mob-pct.danger { color: #dc2626; }
  .mob-pct.na { color: #94a3b8; }
  body.dark .mob-pct.ok { color: #4ade80; }
  body.dark .mob-pct.mid { color: #22d3ee; }
  body.dark .mob-pct.warn { color: #fbbf24; }
  body.dark .mob-pct.danger { color: #f87171; }
  body.dark .mob-pct.na { color: #64748b; }
  .mob-detail-sub-inline { font-size: 10px; color: #94a3b8; font-weight: 400; }
  body.dark .mob-detail-sub-inline { color: #64748b; }

  /* MAC 复制按钮 */
  .mob-copy-btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 6px;
    padding: 3px 7px; font: inherit; font-size: 11px; color: #334155;
    cursor: pointer; max-width: 100%;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-copy-btn:active { background: #f1f5f9; }
  .mob-copy-btn.copied { border-color: #22c55e; color: #16a34a; background: #f0fdf4; }
  .mob-copy-icon { width: 12px; height: 12px; flex-shrink: 0; opacity: .55; }
  .mob-copy-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* 直播时间段 */
  .mob-detail-sessions { margin-top: 8px; padding-top: 8px; border-top: 1px solid #eef2f7; }
  .mob-detail-sessions-title { width: auto; display: block; margin-bottom: 5px; }
  .mob-detail-loading { font-size: 11px; color: #94a3b8; }
  .mob-session-list { display: flex; flex-direction: column; gap: 5px; }
  .mob-session-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: #334155; line-height: 1.4;
    background: #fff; border: 1px solid #eef2f7; border-radius: 7px; padding: 5px 8px;
  }
  .mob-session-dot { width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; flex-shrink: 0; }
  .mob-session-dot.live {
    background: #22c55e; box-shadow: 0 0 5px rgba(34, 197, 94, .8);
    animation: liveDot 1.4s ease-in-out infinite;
  }
  .mob-session-time { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mob-session-dur { color: #94a3b8; flex-shrink: 0; }
  .mob-live-now { color: #16a34a; font-weight: 700; }

  /* ---- 深色模式 ---- */
  body.dark .mob-dev-group { background: #0f172a; border-color: #1e293b; }
  body.dark .mob-dev-group-head { background: #131c31; border-color: #1e293b; }
  body.dark .mob-dev-group-title { color: #e2e8f0; }
  body.dark .mob-dev-item { border-color: #1e293b; }
  body.dark .mob-dev-bar:active { background: rgba(255, 255, 255, .04); }
  body.dark .mob-dev-name { color: #e2e8f0; }
  body.dark .mob-dev-note { color: #94a3b8; }
  body.dark .mob-dev-note.empty { color: #475569; }
  body.dark .mob-dev-detail { background: #131c31; border-color: #1e293b; }
  body.dark .mob-detail-row { border-color: #1e293b; }
  body.dark .mob-detail-value { color: #e2e8f0; }
  body.dark .mob-detail-sub,
  body.dark .mob-muted { color: #64748b; }
  body.dark .mob-copy-btn { background: #1e293b; border-color: #334155; color: #cbd5e1; }
  body.dark .mob-copy-btn.copied { background: #14361f; border-color: #22c55e; color: #4ade80; }
  body.dark .mob-session-item { background: #0f172a; border-color: #1e293b; color: #cbd5e1; }
  body.dark .mob-detail-sessions { border-color: #1e293b; }
  body.dark .mob-net.down { color: #60a5fa; }
  body.dark .mob-net.up { color: #2dd4bf; }
  body.dark .mob-disk-ring .ring-bg { stroke: #334155; }
  body.dark .mob-disk-cap { color: #64748b; }
  body.dark .mob-disk-bar { background: #475569; }
  body.dark .mob-screen-alert { color: #f87171; }
  body.dark .mob-alert-tag { background: #3f0d19; color: #fda4af; }
}

/* 推送设置 → 定时日报预览区 */
.daily-report-preview {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.65;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
}
body.dark .daily-report-preview {
  background: #131c31;
  border-color: #1e293b;
  color: #cbd5e1;
}

/* 推送日志（设置页，最近 24 小时） */
.push-logs { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-height: 440px; overflow-y: auto; }
.push-log-item { border: 1px solid rgba(120,140,170,.22); border-radius: 10px; padding: 8px 10px; background: rgba(255,255,255,.02); }
.push-log-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #94a3b8; }
.push-log-time { font-variant-numeric: tabular-nums; }
.push-log-type { font-weight: 700; padding: 1px 6px; border-radius: 6px; font-size: 11px; white-space: nowrap; }
.push-log-type.type-device_offline { background: #fee2e2; color: #b91c1c; }
.push-log-type.type-device_online { background: #dcfce7; color: #15803d; }
.push-log-type.type-ip_change { background: #dbeafe; color: #1d4ed8; }
.push-log-type.type-monitor_alert { background: #fef3c7; color: #b45309; }
.push-log-type.type-monitor_recover { background: #dcfce7; color: #15803d; }
.push-log-type.type-group_offline { background: #ffedd5; color: #c2410c; }
.push-log-type.type-cloudphone_usage { background: #cffafe; color: #0e7490; }
.push-log-type.type-daily_report { background: #ede9fe; color: #6d28d9; }
.push-log-type.type-test { background: #e2e8f0; color: #475569; }
.push-log-type.type- { background: #e2e8f0; color: #475569; }
.push-log-dev { margin-left: auto; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.push-log-title { margin-top: 4px; font-weight: 600; font-size: 13px; color: #e2e8f0; }
.push-log-content { margin-top: 3px; font-size: 12px; color: #cbd5e1; white-space: pre-wrap; word-break: break-word; }
body.dark .push-log-item { background: rgba(255,255,255,.03); }
body.dark .push-log-title { color: #e2e8f0; }

/* --- 「云手机流量监控」徽标：青色，与 .live-badge / .prep-badge 对称 ---
   非 active 时为静态青色描边（仅标识"选入云手机监控"）；active（使用中）才闪。 */
.cloudphone-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #0891b2;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #06b6d4;
  vertical-align: middle;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition: filter .15s ease;
}
.cloudphone-badge:hover { filter: brightness(1.12); text-decoration: underline; }
.cloudphone-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #06b6d4;
  display: inline-block;
  vertical-align: middle;
  margin-right: 2px;
}
.cloudphone-badge.active {
  color: #06b6d4;
  border-color: #22d3ee;
  animation: cpPulse 1s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.2), inset 0 0 4px rgba(34, 211, 238, 0.08);
}
.cloudphone-badge.active::before {
  background: #22d3ee;
  animation: cpDot 1s ease-in-out infinite;
  box-shadow: 0 0 6px #22d3ee;
}
@keyframes cpPulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.22), inset 0 0 4px rgba(34, 211, 238, 0.08);
    text-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
  }
  50% {
    opacity: 0.5;
    box-shadow: 0 0 3px rgba(34, 211, 238, 0.08);
    text-shadow: none;
  }
}
@keyframes cpDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
}
body.dark .cloudphone-badge { color: #22d3ee; border-color: #22d3ee; }
body.dark .cloudphone-badge::before { background: #22d3ee; }
body.dark .cloudphone-badge.active { color: #67e8f9; border-color: #67e8f9; }
body.dark .cloudphone-badge.active::before { background: #67e8f9; box-shadow: 0 0 6px #67e8f9; }

/* 统计栏图例（首页"云手机 X 台"） */
.cloudphone-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #0891b2;
  font-weight: 700;
}
.cloudphone-bottom-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #06b6d4;
  box-shadow: 0 0 6px #06b6d4;
  display: inline-block;
}
body.dark .cloudphone-legend-item { color: #22d3ee; }
body.dark .cloudphone-bottom-dot { background: #22d3ee; box-shadow: 0 0 6px #22d3ee; }

/* 云手机流量专页 */
.cloudphone-summary { margin: 8px 0 14px; }
.cloudphone-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #334155;
}
.cloudphone-over-flag {
  color: #dc2626;
  font-weight: 800;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid #dc2626;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
}
.cloudphone-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.cloudphone-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}
.cloudphone-card.active {
  border-color: #22d3ee;
  box-shadow: 0 0 0 1px #22d3ee inset, 0 0 14px rgba(34, 211, 238, 0.18);
}
.cloudphone-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.cloudphone-card-head strong { font-size: 15px; }
.cloudphone-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}
.cloudphone-card-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cloudphone-k { font-size: 12px; color: #64748b; }
.cloudphone-card-grid strong { font-size: 14px; color: #0f172a; }
.cloudphone-cap { margin-top: 10px; }
.cloudphone-cap-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.cloudphone-cap-fill {
  height: 100%;
  border-radius: 999px;
  background: #06b6d4;
  transition: width 0.3s ease;
}
.cloudphone-cap-fill.over { background: #dc2626; }
.cloudphone-cap-text { font-size: 12px; color: #64748b; margin-top: 4px; }
body.dark .cloudphone-summary-row { color: #cbd5e1; }
body.dark .cloudphone-card { background: #0b1b2e; border-color: #1e3a52; }
body.dark .cloudphone-card.active { border-color: #22d3ee; }
body.dark .cloudphone-k { color: #94a3b8; }
body.dark .cloudphone-card-grid strong { color: #e2e8f0; }
body.dark .cloudphone-cap-bar { background: #1e3a52; }
body.dark .cloudphone-cap-text { color: #94a3b8; }

/* --- 云手机「使用记录」--- */
.cloudphone-usage { margin-top: 4px; display: flex; flex-direction: column; gap: 10px; }
.cp-usage-block {
  border: 1px solid rgba(120,140,170,.2);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(15,23,42,.02);
}
.cp-usage-block.active { border-color: rgba(255,140,0,.5); }
.cp-usage-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.cp-usage-head strong { font-size: 14px; }
.cp-usage-stat { margin-left: auto; font-size: 12px; color: #64748b; text-align: right; }
.cp-seg-list { display: flex; flex-direction: column; }
.cp-seg-row {
  display: flex;
  gap: 14px;
  font-size: 13px;
  padding: 3px 0;
  border-top: 1px dashed rgba(120,140,170,.14);
}
.cp-seg-row:first-child { border-top: none; }
.cp-seg-time { min-width: 168px; color: #334155; font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, Consolas, monospace; }
.cp-seg-dur { min-width: 96px; color: #15803d; }
.cp-seg-traffic { color: #64748b; }
body.dark .cp-usage-block { background: rgba(255,255,255,.02); border-color: rgba(120,140,170,.25); }
body.dark .cp-usage-block.active { border-color: rgba(255,140,0,.55); }
body.dark .cp-usage-stat { color: #94a3b8; }
body.dark .cp-seg-time { color: #cbd5e1; }
body.dark .cp-seg-dur { color: #4ade80; }
body.dark .cp-seg-traffic { color: #94a3b8; }
body.dark .cp-seg-row { border-top-color: rgba(120,140,170,.18); }

/* --- 預備中：橙色闪烁 "Ready" 徽标（紧贴设备名 / 用户名之后）--- */
/* 預備中 Ready 标：手机端默认主题折叠条 —— 橙色摄像头、无字、无框、闪烁 */
.mob-prep-cam {
  width: 16px; height: 16px; flex-shrink: 0; margin-left: 6px;
  color: #ea580c;
  animation: prepReadyBlink 1.4s ease-in-out infinite;
}
@keyframes prepReadyBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
body.dark .mob-prep-cam { color: #fb923c; }

/* 預備中 Ready 标（手机版详情 / 苹果卡共用：橙色摄像头 + Ready Xm） */
.mob-detail-ready {
  display: inline-flex; align-items: center; gap: 5px;
  color: #ea580c; font-weight: 800; font-size: 14px;
  background: rgba(249, 115, 22, 0.12); border: 1px solid #f97316;
  border-radius: 999px; padding: 2px 10px;
  animation: prepReadyBlink 1.4s ease-in-out infinite;
}
.mob-ready-cam { width: 15px; height: 15px; flex-shrink: 0; color: #ea580c; }
body.dark .mob-detail-ready { color: #fb923c; border-color: #fb923c; background: rgba(251, 146, 60, 0.15); }
body.dark .mob-ready-cam { color: #fb923c; }
.apple-dev-ready {
  display: inline-flex; align-items: center; gap: 3px;
  color: #ea580c; font-weight: 800; font-size: 10px; margin-left: 5px; flex-shrink: 0;
  animation: prepReadyBlink 1.4s ease-in-out infinite;
  cursor: pointer;
}
.apple-dev-ready:hover { filter: brightness(1.12); text-decoration: underline; }
.apple-icon-ready { width: 12px; height: 12px; flex-shrink: 0; color: #ea580c; }
body.dark .apple-dev-ready { color: #fb923c; }
body.dark .apple-icon-ready { color: #fb923c; }

/* 云手机 逐设备徽标（Apple 主题，点击跳 Live，与默认主题 cloudphone-badge 同色系） */
.apple-dev-cp {
  display: inline-flex; align-items: center; gap: 3px;
  color: #0891b2; font-weight: 800; font-size: 10px; margin-left: 5px; flex-shrink: 0;
  cursor: pointer;
}
.apple-dev-cp.active { color: #06b6d4; }
.apple-dev-cp:hover { filter: brightness(1.12); text-decoration: underline; }
.apple-icon-cp { width: 12px; height: 12px; flex-shrink: 0; color: #0891b2; }
.apple-dev-cp.active .apple-icon-cp { color: #06b6d4; }
body.dark .apple-dev-cp { color: #22d3ee; }
body.dark .apple-dev-cp.active { color: #67e8f9; }
body.dark .apple-icon-cp { color: #22d3ee; }
body.dark .apple-dev-cp.active .apple-icon-cp { color: #67e8f9; }

/* 最近结束直播 提示（灰色 over 字样，无框无摄像机，与預備中橙色 / 放送中绿色对称） */
.recent-ended-badge {
  display: inline; color: #64748b; font-size: 11px; font-weight: 700;
  vertical-align: middle; letter-spacing: .02em; white-space: nowrap;
}
.recent-ended-badge::before { content: none; }
body.dark .recent-ended-badge { color: #94a3b8; }

.mob-recent-ended-badge {
  display: inline; font-size: 10px; font-weight: 800; letter-spacing: 0.03em;
  color: #64748b; margin-left: 6px; flex-shrink: 0; vertical-align: middle;
}
body.dark .mob-recent-ended-badge { color: #94a3b8; }

.mob-detail-ended {
  display: inline; font-size: 11px; font-weight: 700;
  color: #64748b; margin-left: 6px;
}
body.dark .mob-detail-ended { color: #94a3b8; }

.apple-dev-ended {
  display: inline; color: #64748b; font-weight: 800; font-size: 11px; margin-left: 5px; flex-shrink: 0;
}
body.dark .apple-dev-ended { color: #94a3b8; }

.recent-ended-legend-item { display:inline-flex; align-items:center; gap:6px; color:#64748b; font-weight:600; }
body.dark .recent-ended-legend-item { color:#94a3b8; }
.recent-ended-bottom-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #94a3b8;
}
body.dark .recent-ended-bottom-dot { background: #64748b; }

.recent-ended-dur {
  display:inline-block; font-size:11px; font-weight:700; color:#475569;
  background: rgba(100,116,139,0.14); border:1px solid #94a3b8; border-radius:999px; padding:1px 8px; margin-bottom:6px;
}
body.dark .recent-ended-dur { color:#cbd5e1; border-color:#64748b; background: rgba(148,163,184,0.18); }
.recent-ended-card { border-left: 3px solid #94a3b8 !important; }

/* 手机版折叠条：离线设备标示离线时长 */
.mob-dev-offline {
  display: inline-flex; align-items: center; font-size: 10px; font-weight: 700;
  color: #dc2626; background: rgba(239, 68, 68, 0.12); border: 1px solid #ef4444;
  border-radius: 999px; padding: 1px 7px; margin-left: 6px; flex-shrink: 0;
}
body.dark .mob-dev-offline { color: #f87171; border-color: #ef4444; background: rgba(239, 68, 68, 0.18); }
@media (max-width: 640px) {
  .mob-dev-offline { margin-left: 5px; }
}

/* --- 移动端（≤640px）：隐藏"设备总数/在线/离线/分组"，图例改为独立胶囊避免挤行 --- */
@media (max-width: 640px) {
  .apple-meta-row { display: none; }
  .apple-progress-legend {
    gap: 6px 8px;
    margin-top: 10px;
  }
  .apple-progress-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
  }
  body.dark .apple-progress-legend > span {
    background: #0b1b2e;
    border-color: #1e3a52;
  }
  .mob-prep-cam { margin-left: 5px; }
}

/* ===== 此站探针（顶部 header，主题选择左侧，线条风，贴顶不撑高） ===== */
.site-probe-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 3px 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.6);
  height: 30px;
  box-sizing: border-box;
  white-space: nowrap;
}
body.dark .site-probe-bar {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(51, 65, 85, 0.55);
}
.spb-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.spb-k {
  font-size: 10px;
  color: #64748b;
  letter-spacing: 0.3px;
}
body.dark .spb-k { color: #94a3b8; }
.spb-spark {
  width: 46px;
  height: 18px;
  display: block;
}
.spb-v {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  line-height: 1;
}
body.dark .spb-v { color: #e2e8f0; }
.spb-host {
  font-size: 10px;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.dark .spb-host { color: #64748b; }
/* 页首刷新按钮（此站探针旁） */
.spb-refresh {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border-radius: 8px; cursor: pointer;
  border: 1px solid #cbd5e1; background: #f8fafc; color: #475569;
}
.spb-refresh:hover { background: #eef2ff; border-color: #6366f1; color: #4338ca; }
.spb-refresh:active { transform: scale(.92); }
body.dark .spb-refresh { background: #1e293b; border-color: #334155; color: #cbd5e1; }
body.dark .spb-refresh:hover { background: #1e1b4b; border-color: #6366f1; color: #a5b4fc; }
.spb-refresh svg { width: 15px; height: 15px; display: block; }
.spb-refresh.spinning svg { animation: spb-spin .7s linear infinite; }
@keyframes spb-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
/* 线条（复用于 header sparkline） */
.sp-line {
  fill: none;
  stroke: #0ea5e9;
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.sp-area {
  fill: rgba(14, 165, 233, 0.12);
  stroke: none;
}
.spb-item:nth-child(2) .sp-line { stroke: #8b5cf6; }
.spb-item:nth-child(2) .sp-area { fill: rgba(139, 92, 246, 0.12); }
/* 手机端收窄：隐藏 host 与运行，避免拥挤换行 */
@media (max-width: 760px) {
  .spb-host { display: none; }
  .spb-uptime { display: none; }
  .site-probe-bar { gap: 9px; padding: 3px 8px; }
  .spb-spark { width: 36px; }
  /* 手机端探针框放宽，避免 CPU/内存 百分比出框 */
  #site-probe { max-width: 82%; flex: 0 0 auto; }
}

/* 当前直播间：自然月记录下拉（最近 3 个自然月可选切换） */
.live-month-select {
  font-size: 12px;
  padding: 2px 6px;
  border: 1px solid #d5dbe3;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}
body.dark .live-month-select {
  background: #0b1526;
  border-color: #2b3545;
  color: #e5eefb;
}

/* 手机端顶部栏右下角：刷新按钮（默认隐藏，仅手机端显示） */
.mob-refresh-btn { display: none; }
@media (max-width: 640px) {
  .mob-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px; padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .15s ease, background .15s ease;
  }
  .mob-refresh-btn svg { width: 17px; height: 17px; }
  .mob-refresh-btn:active { transform: scale(.9); }
  .mob-refresh-btn.spinning svg { animation: mobRefreshSpin .7s linear infinite; }
  @keyframes mobRefreshSpin { to { transform: rotate(360deg); } }
  body.dark .mob-refresh-btn {
    background: #0f172a;
    border-color: #1e293b;
    color: #94a3b8;
  }
}

/* 可折叠区块标题（如「最近 8 小时结束的直播间」）：按钮外观贴近普通标题 */
.section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  user-select: none;
}
.section-toggle:hover .toggle-text { text-decoration: underline; }
.section-toggle .toggle-arrow {
  font-size: 10px;
  line-height: 1;
  color: #64748b;
}
body.dark .section-toggle .toggle-arrow { color: #8ea0b8; }

/* ============================================================
   全屏呼吸灯主题（第四个主题，value=fullscreen）
   原理：取各设备「上一次上报」状态（online/offline/is_live/cloudphone）作为底图，
   在线设备用 CSS 呼吸动画持续「呼吸」，模拟实时跳动。暗色沉浸式。
   ============================================================ */
.fullscreen-dashboard {
  background: #ffffff;
  border-radius: 16px;
  padding: 0;
  margin-top: 14px;
  min-height: calc(100vh - 150px);
  color: #0f172a;
  overflow: hidden;
}
body.fullscreen-theme { background: #eef2f7; }

.fs-bar {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 20px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid #e2e8f0;
  backdrop-filter: blur(6px);
}
.fs-title { font-size: 17px; font-weight: 800; letter-spacing: .04em; color: #0f172a; }
.fs-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: #64748b; align-items: center; }
.fs-leg::before { content: ''; display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.fs-leg-on::before { background: #22c55e; }
.fs-leg-part::before { background: #f97316; }
.fs-leg-zero::before { background: #ef4444; }
.fs-leg-cur::before { background: transparent; box-shadow: 0 0 0 2px #0284c7; }

.fs-group { margin: 18px 20px; }
.fs-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; padding-left: 2px; }
.fs-group-name { font-size: 14px; font-weight: 800; color: #0369a1; letter-spacing: .03em; border-left: 3px solid #0ea5e9; padding-left: 8px; }
.fs-group-meta { font-size: 11px; color: #94a3b8; }

/* 横向滚动容器：每台设备一行，行内一条连续热力图横向铺开，铺满屏幕宽度 */
.fs-scroll { overflow-x: auto; padding-bottom: 6px; }
.fs-inner { width: 100%; min-width: max-content; }
.fs-axis, .fs-device { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 8px; }
.fs-axis { margin-bottom: 4px; }
.fs-device { margin: 5px 0; cursor: pointer; border-radius: 6px; padding: 1px 4px; }
.fs-device:hover { background: rgba(14,165,233,.10); }
.fs-axis-name, .fs-device-name { position: sticky; left: 0; z-index: 2; }
.fs-axis-name { background: #ffffff; }
.fs-device-name { font-size: 11px; font-weight: 600; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #ffffff; padding-right: 6px; }
.fs-device:hover .fs-device-name { color: #0284c7; }

.fs-strip { display: flex; align-items: center; justify-content: space-between; }
.fs-axis-h { flex: 0 0 16px; width: 16px; font-size: 10px; color: #94a3b8; text-align: center; }
.fs-axis-h.major { color: #475569; font-weight: 700; }
.fs-cell { flex: 0 0 16px; width: 16px; height: 14px; border-radius: 4px; background: #22c55e; }
.fs-cell.on { background: #22c55e; }
.fs-cell.off-zero { background: #ef4444; }
.fs-cell.now { outline: 2px solid #0284c7; outline-offset: 1px; }

/* 深色模式：第四主题（热力图）适配 */
body.dark.fullscreen-theme { background: #03050b; }
body.dark .fullscreen-dashboard { background: #0b0f17; color: #e2e8f0; }
body.dark .fs-bar { background: linear-gradient(180deg, rgba(8,12,22,.96), rgba(8,12,22,.82)); border-bottom-color: rgba(148,163,184,.12); }
body.dark .fs-title { color: #f1f5f9; }
body.dark .fs-legend { color: #94a3b8; }
body.dark .fs-leg-cur::before { box-shadow: 0 0 0 2px #38bdf8; }
body.dark .fs-group-name { color: #7dd3fc; border-left-color: #38bdf8; }
body.dark .fs-group-meta { color: #7c8aa0; }
body.dark .fs-axis-name, body.dark .fs-device-name { background: #0b0f17; color: #cdd9e6; }
body.dark .fs-device:hover { background: rgba(56,189,248,.08); }
body.dark .fs-device:hover .fs-device-name { color: #38bdf8; }
body.dark .fs-axis-h { color: #5b6b80; }
body.dark .fs-axis-h.major { color: #aab8c9; }
body.dark .fs-cell.now { outline-color: #38bdf8; }

/* ===== 机器分布 ===== */
.md-table { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.md-group {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
  box-shadow: 0 8px 22px rgba(15,23,42,.05);
}
.md-group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; background: linear-gradient(90deg,#eef2ff,#f8fafc);
  border-bottom: 1px solid #e2e8f0;
  border-top-left-radius: 16px; border-top-right-radius: 16px;
}
.md-group-title { font-size: 15px; font-weight: 800; color: #4f46e5; }
.md-row {
  display: grid; grid-template-columns: 160px 1fr; gap: 16px;
  padding: 12px 14px; align-items: start;
  border-bottom: 1px solid #f1f5f9;
}
.md-group .md-row:last-child { border-bottom: none; }
.md-col-a { display: flex; flex-direction: column; gap: 4px; }
.md-rack { font-size: 15px; font-weight: 800; color: #0f172a; }
.md-count { font-size: 11px; color: #64748b; }
.md-col-b { display: flex; flex-direction: column; gap: 10px; }
.md-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; align-items: center; }
.md-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe;
  border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 600;
}
.md-chip-x {
  border: none; background: transparent; color: #6d28d9; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 2px; border-radius: 999px;
}
.md-chip-x:hover { background: #ddd6fe; }
.md-empty { color: #94a3b8; font-size: 12px; }
.md-add { position: relative; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.md-add-input { flex: 1; min-width: 140px; max-width: 260px; }
.md-chip-edit { gap: 6px; padding: 2px 6px 2px 8px; }
/* 位置页精准搜索命中的设备：标黄突出，便于在整层里一眼找到 */
.md-chip-hit { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
body.dark .md-chip.md-chip-hit { background: #92400e; color: #fde68a; border-color: #f59e0b; box-shadow: 0 0 0 1px #f59e0b; }
.md-chip-name { white-space: nowrap; }
/* 机柜层改名：层名 + ✏️ 同行；改名时层名原位换成输入框 */
.md-rack-line { display: inline-flex; align-items: center; gap: 6px; }
.md-rename-btn {
  border: none; background: transparent; cursor: pointer;
  font-size: 12px; line-height: 1; padding: 2px 4px; border-radius: 6px; opacity: .65;
}
.md-rename-btn:hover { opacity: 1; background: #eef2ff; }
body.dark .md-rename-btn:hover { background: #1e293b; }
.md-rename-wrap { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.md-rename-input { width: 96px; min-width: 96px; padding: 3px 6px; font-size: 13px; font-weight: 700; }

/* ---- 实时网速页：IP 流量统计（当天 / 近 N 天回查） ---- */
.ip-traffic { margin: 10px 0 14px; }
.ipt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; cursor: pointer; user-select: none; }
.ipt-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.ipt-toggle { margin-left: 8px; font-size: 11px; font-weight: 600; color: #3b82f6; }
.ipt-collapsed { display: none; }
.ipt-total { font-size: 12px; color: #64748b; }
.ipt-total .up { color: #ef4444; }
.ipt-total .down { color: #16a34a; }
.ipt-table { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.ipt-row { display: grid; grid-template-columns: minmax(120px, 1.4fr) 80px 50px 1fr 1fr 1fr; gap: 8px; padding: 6px 10px; font-size: 12px; align-items: center; }
.ipt-row + .ipt-row { border-top: 1px solid #eef2f7; }
.ipt-th { background: #f8fafc; font-weight: 700; color: #475569; }
.ipt-ip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; min-width: 0; }
/* ISP / 地区：显示在 IP 下方的小字，过长省略（悬停看完整） */
.ipt-region { display: block; font-family: inherit; font-size: 11px; font-weight: 400; color: #64748b; margin-top: 1px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.dark .ipt-region { color: #94a3b8; }
.ipt-suffix { font-weight: 700; color: #4338ca; }
/* 最低流量时段表：5 列（IP / 昨日最低 / 昨日流量 / 当日最低 / 当日流量） */
.iqt-row { grid-template-columns: minmax(120px, 1.2fr) 70px 1fr 1fr 1fr 1fr; }

/* ---- 主页核对（homepage-check）---- */
.hc-badge { display:inline-block; margin-left:5px; min-width:16px; padding:0 5px; border-radius:999px; background:#ef4444; color:#fff; font-size:10px; font-weight:700; line-height:16px; text-align:center; vertical-align:middle; }
.hc-section-title { font-size:13px; font-weight:700; margin:12px 0 6px; }
.hc-table { border:1px solid #e2e8f0; border-radius:8px; overflow:hidden; }
.hc-row { display:grid; grid-template-columns: minmax(110px,1.2fr) minmax(110px,1.4fr) 100px 100px minmax(150px,1.7fr) 104px; gap:8px; padding:7px 10px; font-size:12px; align-items:center; }
/* 白名单区块：设备 / 白名单主页 / 当前主页 / 加入时间 / 操作 */
.hc-row.hc-wl-head, .hc-row.hc-wl-row { grid-template-columns: minmax(110px,1.2fr) minmax(110px,1.4fr) 130px 150px 104px; }
.hc-act { text-align:right; }
.hc-wl-btn { padding:3px 8px; border:1px solid #cbd5e1; border-radius:6px; background:#fff; color:#334155; font-size:11px; cursor:pointer; white-space:nowrap; }
.hc-wl-btn:hover { border-color:#6366f1; color:#4338ca; }
.hc-wl-btn.hc-wl-out { border-color:#fca5a5; color:#b91c1c; }
.hc-wl-btn.hc-wl-out:hover { background:#fef2f2; }
.hc-wl-tag { display:inline-block; margin-left:6px; padding:0 6px; border-radius:999px; background:#dcfce7; color:#15803d; font-size:9px; font-weight:700; }
.hc-wl-ok { color:#16a34a; font-size:11px; }
.hc-wl-warn { color:#ea580c; font-size:11px; }
body.dark .hc-wl-btn { background:#1e293b; border-color:#475569; color:#e2e8f0; }
body.dark .hc-wl-btn:hover { border-color:#818cf8; color:#a5b4fc; }
body.dark .hc-wl-btn.hc-wl-out { border-color:#7f1d1d; color:#fca5a5; }
body.dark .hc-wl-tag { background:#14532d; color:#86efac; }
.hc-start b { display:block; font-size:12px; }
.hc-dur { display:block; font-size:10px; color:#64748b; font-weight:400; }
.hc-status-inline { display:block; font-size:10px; color:#94a3b8; font-weight:400; margin-top:2px; }
.hc-live-tag { display:inline-block; padding:0 5px; border-radius:999px; background:#16a34a; color:#fff; font-size:9px; font-weight:700; vertical-align:middle; }
body.dark .hc-dur { color:#94a3b8; }
.hc-row + .hc-row { border-top:1px solid #eef2f7; }
.hc-head { background:#f8fafc; font-weight:700; color:#475569; }
.hc-dev { font-weight:600; }
.hc-time { display:block; font-weight:400; font-size:10px; color:#94a3b8; }
/* ID 核对行里「软件实际登录账号」小字；与填写主页不符时橙色告警 */
.hc-studio { color:#0891b2; }
.hc-studio-warn { color:#b45309; font-weight:700; }
.hc-studio-idle { color:#94a3b8; font-weight:400; font-size:10px; margin-left:4px; }
/* 「写入个人主页」小按钮：和同一行的小字/链接保持一致的紧凑观感 */
.studio-apply-btn {
  display: inline-block; padding: 0 6px; height: 17px; line-height: 15px;
  font-size: 10px; font-weight: 600; cursor: pointer;
  color: #0f766e; background: #f0fdfa;
  border: 1px solid #99f6e4; border-radius: 5px;
  vertical-align: 1px;
}
.studio-apply-btn:hover { background:#ccfbf1; border-color:#5eead4; }
body.dark .studio-apply-btn { color:#5eead4; background:#042f2e; border-color:#0f766e; }
body.dark .studio-apply-btn:hover { background:#0b3f3d; }
body.dark .hc-studio { color:#22d3ee; }
body.dark .hc-studio-warn { color:#fbbf24; }
body.dark .hc-studio-idle { color:#64748b; }
.hc-home a { color:#3b82f6; text-decoration:none; word-break:break-all; }
.hc-note { display:block; font-weight:400; font-size:10px; color:#94a3b8; margin-top:2px; }
.hc-row.hc-mismatch { background:#fef2f2; }
.hc-row.hc-mismatch .hc-diff { color:#ef4444; font-weight:700; }
/* offline = 系统认为在播、TikTok 侧却回报未在直播（橙色，与红色「疑似错误」区分） */
.hc-row.hc-offline { background:#fff7ed; }
.hc-row.hc-offline .hc-diff { color:#ea580c; font-weight:700; }
.hc-row.hc-ok .hc-diff { color:#16a34a; }
.hc-row.hc-unknown { color:#64748b; }

/* ---- 直播观众记录（ID 页 → 直播观众记录）---- */
.range-btn {
  display:inline-block; padding:4px 12px; border:1px solid #cbd5e1; border-radius:999px;
  font-size:12px; color:#475569; cursor:pointer; user-select:none; background:#fff; white-space:nowrap;
}
.range-btn:hover { border-color:#94a3b8; }
.range-btn.active { background:#0d9488; border-color:#0d9488; color:#fff; }
.la-date {
  padding:3px 8px; border:1px solid #cbd5e1; border-radius:6px; font-size:12px; color:#334155;
  background:#fff; height:28px;
}
.la-section-title { font-size:13px; font-weight:700; color:#0f172a; margin:14px 0 8px; }
.la-table { border:1px solid #e2e8f0; border-radius:8px; overflow:hidden; }
.la-row {
  display:grid;
  grid-template-columns: minmax(120px,1.4fr) minmax(90px,1fr) minmax(110px,1.3fr) 64px 76px 78px minmax(140px,1.8fr);
  gap:8px; padding:7px 10px; font-size:12px; align-items:center;
}
.la-row.la-head { background:#f1f5f9; font-weight:700; color:#334155; }
.la-row + .la-row { border-top:1px solid #eef2f7; }
.la-row a { color:#0d9488; text-decoration:none; }
.la-row a:hover { text-decoration:underline; }
.la-row .up { color:#16a34a; font-weight:700; }
.la-row .down { color:#2563eb; }
.la-row small { color:#94a3b8; }
/* 合并后列数变化：按账号汇总 5 列、场次明细 6 列（各去掉了设备数/最高单场/进入） */
.la-row.la-sum {
  grid-template-columns: minmax(110px,1.4fr) minmax(96px,1fr) 70px 70px minmax(100px,1fr);
}
.la-row.la-det {
  grid-template-columns: minmax(130px,1.6fr) minmax(84px,1fr) minmax(110px,1.3fr) 70px 84px minmax(120px,1.6fr);
}
/* 手机端：表格保持紧凑横排（不拆成卡片），列太宽时整表横向滑动查看全部，适合眼力好的用户一眼扫完 */
@media (max-width: 680px) {
  .la-table { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  .la-row,
  .la-row.la-sum,
  .la-row.la-det {
    font-size: 11px; gap: 5px; padding: 6px 8px;
    min-width: max-content;
  }
  .la-row > span { white-space: nowrap; }
}

/* ---- 弹窗「TikTok 主页」页签：头像 + 暱称 + 主页/直播间入口 ---- */
.tt-card { display:flex; gap:16px; align-items:flex-start; padding:6px 0 12px; }
.tt-left { flex:0 0 auto; }
.tt-avatar {
  position:relative; display:flex; align-items:center; justify-content:center;
  width:72px; height:72px; border-radius:50%; overflow:visible;
  background:#f1f5f9; border:2px solid #e2e8f0; text-decoration:none;
}
.tt-avatar-img { width:72px; height:72px; border-radius:50%; object-fit:cover; display:block; }
.tt-avatar-ph { font-size:28px; line-height:1; }
/* 直播中：红色光圈 + 呼吸感，点击直达直播间 */
.tt-avatar-live { border-color:#ef4444; box-shadow:0 0 0 3px rgba(239,68,68,.25); }
.tt-avatar-badge {
  position:absolute; bottom:-6px; left:50%; transform:translateX(-50%);
  background:#ef4444; color:#fff; font-size:9px; font-weight:800; letter-spacing:.5px;
  padding:1px 6px; border-radius:999px; border:2px solid #fff;
}
.tt-right { min-width:0; display:flex; flex-direction:column; gap:4px; }
.tt-name { font-size:16px; font-weight:800; color:#0f172a; word-break:break-all; }
.tt-at { font-size:12px; color:#64748b; }
.tt-status { font-size:12px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.tt-live-on { color:#dc2626; font-weight:800; }
.tt-live-off { color:#94a3b8; }
.tt-hint { font-size:11px; color:#94a3b8; }
.tt-actions { display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin-top:4px; }
.tt-actions .btn { padding:3px 9px; font-size:11px; }
.tt-refresh-btn { display:inline-flex; align-items:center; justify-content:center; padding:3px 7px; line-height:1; }
.tt-refresh-ico { width:14px; height:14px; display:block; }
/* TikTok 卡片动作：房子（主页）/ 摄像机（直播间）图标按钮 */
.tt-ico-btn { padding:4px 8px !important; display:inline-flex; align-items:center; justify-content:center; line-height:1; }
.tt-ico { width:16px; height:16px; display:block; }
.tt-expired-note { padding:6px 0 2px; font-size:11px; }
@media (max-width: 640px) {
  .tt-actions { flex-wrap:nowrap; gap:4px; }
  .tt-actions .btn { padding:2px 6px; font-size:10px; }
  .tt-refresh-btn { padding:2px 5px; }
  .tt-refresh-ico { width:12px; height:12px; }
}
.tt-rows { margin-top:6px; }
.tt-row { display:flex; gap:12px; padding:8px 0; border-top:1px solid #f1f5f9; }
.tt-row .ss-k { flex:0 0 150px; font-size:12px; color:#64748b; }
.tt-row .ss-v { font-size:13px; min-width:0; word-break:break-all; }
body.dark .tt-avatar { background:#1e293b; border-color:#334155; }
body.dark .tt-avatar-badge { border-color:#0f172a; }
body.dark .tt-name { color:#e5eefb; }
body.dark .tt-row { border-top-color:#1e293b; }
body.dark .hc-table { border-color:#334155; }
body.dark .hc-head { background:#1e293b; color:#cbd5e1; }
body.dark .hc-row + .hc-row { border-top-color:#334155; }
body.dark .hc-row.hc-mismatch { background:#3a1620; }
body.dark .hc-row.hc-offline { background:#3a2410; }
body.dark .range-btn { background:#1e293b; border-color:#334155; color:#cbd5e1; }
body.dark .range-btn.active { background:#0d9488; border-color:#0d9488; color:#fff; }
body.dark .la-date { background:#1e293b; border-color:#334155; color:#e5eefb; }
body.dark .la-table { border-color:#334155; }
body.dark .la-row.la-head { background:#1e293b; color:#cbd5e1; }
body.dark .la-row + .la-row { border-top-color:#334155; }
body.dark .la-row a { color:#2dd4bf; }
body.dark .la-section-title { color:#e5eefb; }
.ipt-row .up { color: #ef4444; }
.ipt-row .down { color: #16a34a; }
.ipt-daily { margin-top: 8px; }
.ipt-daily-title { font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 4px; }
.ipt-daily-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ipt-day { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: #f1f5f9; color: #475569; white-space: nowrap; }
body.dark .ipt-table { border-color: #334155; }
body.dark .ipt-th { background: #1e293b; color: #cbd5e1; }
body.dark .ipt-row + .ipt-row { border-top-color: #334155; }
body.dark .ipt-day { background: #1e293b; color: #cbd5e1; }
body.dark .ipt-total { color: #94a3b8; }
.md-move {
  font-size: 11px; font-weight: 600; color: #4338ca; background: #fff;
  border: 1px solid #c7d2fe; border-radius: 999px; padding: 1px 4px; cursor: pointer;
}
.md-move:focus { outline: 2px solid #38bdf8; outline-offset: 0; }
.md-suggest {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 100;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15,23,42,.18); overflow: hidden; min-width: 200px; max-height: 220px; overflow-y: auto;
}
.md-suggest-item { padding: 7px 12px; font-size: 13px; color: #1e293b; cursor: pointer; }
.md-suggest-item:hover { background: #eef2ff; color: #3730a3; }
.mob-loc-badge {
  display: inline-block; font-size: 11px; font-weight: 700; color: #fff;
  background: #6366f1; border-radius: 8px; padding: 2px 8px; white-space: nowrap;
}
.status-sub.md-loc { color: #4338ca; font-weight: 600; }
.status-sub.md-loc-empty { color: #cbd5e1; }
body.dark .md-group { background: #0e1626; border-color: #223041; box-shadow: 0 8px 22px rgba(0,0,0,.35); }
body.dark .md-group-head { background: linear-gradient(90deg,#172036,#0e1626); border-color: #223041; }
body.dark .md-group-title { color: #a5b4fc; }
body.dark .md-row { border-color: #1a2636; }
body.dark .md-rack { color: #e5eefb; }
body.dark .md-count { color: #8ea0b8; }
body.dark .md-chip { background: #1e293b; color: #c7d2fe; border-color: #334155; }
body.dark .md-chip-x { color: #a5b4fc; }
body.dark .md-chip-x:hover { background: #334155; }
body.dark .md-empty { color: #64748b; }
body.dark .md-move { background: #0b1220; color: #a5b4fc; border-color: #334155; }
body.dark .md-suggest { background: #0e1626; border-color: #223041; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
body.dark .md-suggest-item { color: #cdd9e6; }
body.dark .md-suggest-item:hover { background: #1e293b; color: #c7d2fe; }
body.dark .mob-loc-badge { background: #4f46e5; }
body.dark .status-sub.md-loc-empty { color: #475569; }

/* ===== 第五主题：科技方块（Metro 磁贴风）=====
   方块网格展示设备；每块含 状态灯 / 设备名 / 用户(note) / 后缀 / TikTok(暱称+@id 两行) */
.tiles-hero {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 12px 14px; margin-bottom: 14px;
  border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc;
}
.tiles-hero-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px; font-weight: 700; letter-spacing: 0.18em; color: #0f172a;
}
.tiles-hero-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.tiles-stat {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid #e2e8f0; background: #fff; color: #475569;
}
.tiles-stat b { font-size: 13px; margin-right: 4px; color: #0f172a; }
.tiles-stat.on b { color: #16a34a; }
.tiles-stat.off b { color: #dc2626; }
.tiles-stat.live b { color: #0d9488; }

.tiles-group { margin-bottom: 18px; }
.tiles-group-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-bottom: 8px; padding: 0 2px;
}
.tiles-group-name { font-size: 13px; font-weight: 700; color: #0f172a; }
.tiles-group-meta { font-size: 11px; color: #64748b; }

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

.tile {
  position: relative;
  min-height: 104px;
  padding: 10px 11px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  display: flex; flex-direction: column; gap: 5px;
  cursor: pointer; overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15, 23, 42, .10); }
/* 左侧状态色条 */
.tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #94a3b8; }
.tile-online::before { background: #22c55e; }
.tile-offline::before { background: #ef4444; }
.tile-live::before { background: #0d9488; }

.tile-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tile-led {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: #94a3b8; box-shadow: 0 0 0 2px rgba(148, 163, 184, .18);
}
.tile-online .tile-led { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, .75); }
.tile-offline .tile-led { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, .55); }
.tile-live .tile-led { background: #0d9488; box-shadow: 0 0 7px rgba(13, 148, 136, .8); animation: tilesPulse 1.3s infinite; }
@keyframes tilesPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.tile-name {
  font-size: 13px; font-weight: 700; color: #0f172a; line-height: 1.25;
  min-width: 0; word-break: break-word; overflow-wrap: anywhere;
}
.tile-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 0; }
.tile-user {
  font-size: 11px; font-weight: 600;
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8;
  border-radius: 6px; padding: 1px 6px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile-empty { color: #cbd5e1; }
/* 手机端科技方块：数字再大 1px（相对全局 +1px 再 +1px），小屏更易辨认编号 */
@media (max-width: 640px) {
  .tile-name .dev-num { font-size: calc(1em + 2px); }
}
.tile-suffix {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px; color: #64748b; background: #f1f5f9;
  border-radius: 5px; padding: 1px 5px;
}
/* TikTok：logo 在左 + 暱称一行 + @id 一行；无主页时也占位，保持各块高度一致 */
.tile-homepage { margin-top: auto; min-height: 30px; display: flex; align-items: center; }
.tile-hp { display: flex; align-items: center; gap: 6px; text-decoration: none; min-width: 0; }
.tile-hp-logo { flex: 0 0 auto; display: flex; align-items: center; }
.tile-hp-logo .hp-logo { width: 18px; height: 18px; }
.tile-hp-body { display: flex; flex-direction: column; justify-content: center; line-height: 1.15; min-width: 0; }
.tile-hp-name { font-size: 11px; font-weight: 600; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-hp-time { font-size: 10px; font-weight: 500; color: #475569; margin-top: 1px; white-space: nowrap; }
.tile-hp-time.live { color: #16a34a; font-weight: 600; }
.tile-hp-time.pred { color: #64748b; }
.tile-offtime { font-size: 10px; color: #94a3b8; }

.tile-live { border-color: #5eead4; background: #f0fdfa; }
.tile-offline { background: #fbfbfc; }
.tile-offline .tile-name { color: #64748b; }

/* ── 科技方块-B版：卡片底层用 TikTok 头像做左浅右深渐变背景，hover 整体变深 ── */
.tile-b { position: relative; isolation: isolate; overflow: hidden; background: #475569; }
.tile-b-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.tile-b-ov {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, .95), rgba(0, 0, 0, .60));
  transition: background .2s ease;
}
.tile-b:hover .tile-b-ov { background: linear-gradient(135deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, .85)); }
.tile-b-noav { background: linear-gradient(135deg, #f1f5f9, #334155) !important; }
.tile-b::before { z-index: 2; }   /* 左侧状态色条压在渐变遮罩之上，保持在线/离线指示可见 */
.tile-b .tile-top, .tile-b .tile-meta, .tile-b .tile-homepage, .tile-b .tile-offtime, .tile-b .tile-suffix { position: relative; z-index: 1; }
.tile-b .tile-name {
  display: inline-block;
  background: rgba(15, 23, 42, .55);
  color: #fff !important;
  border-radius: 7px;
  padding: 2px 7px;
  text-shadow: none !important;
}
.tile-b .tile-cpu-txt { color: #e2e8f0 !important; text-shadow: 0 1px 2px rgba(0, 0, 0, .55) !important; }
.tile-b .tile-cpu-logo { color: #cbd5e1 !important; }
/* 落在浅色区的文字加半透明深色胶囊底衬 + 白字：纯白左上 / 深色右下两端都清晰可读 */
.tile-b .tile-offtime {
  display: inline-block;
  background: rgba(15, 23, 42, .55);
  color: #fff !important;
  border-radius: 6px;
  padding: 1px 6px;
  text-shadow: none !important;
}
.tile-b .tile-cpu { background: rgba(15, 23, 42, .55); border-radius: 8px; padding: 3px 5px; }
/* 科技方块-B：TikTok 块落在头像背景上，整块加半透明深色胶囊 + 浅色字，纯白左上 / 深色右下都清晰 */
.tile-b .tile-hp { background: rgba(15, 23, 42, .55); border-radius: 6px; padding: 2px 6px; }
.tile-b .tile-hp-name { color: #fff !important; text-shadow: 0 1px 2px rgba(0, 0, 0, .6) !important; }
.tile-b .tile-hp-time { color: #cbd5e1 !important; }
.tile-b .tile-hp-time.live { color: #4ade80 !important; }
.tile-b .tile-hp-time.pred { color: #cbd5e1 !important; }

/* 暗色适配 */
body.dark .tiles-hero { background: #0f172a; border-color: #223041; }
body.dark .tiles-hero-title { color: #e5eefb; }
body.dark .tiles-stat { background: #131c31; border-color: #223041; color: #94a3b8; }
body.dark .tiles-stat b { color: #e5eefb; }
body.dark .tiles-group-name { color: #e5eefb; }
body.dark .tile { background: #0f172a; border-color: #223041; }
body.dark .tile:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
body.dark .tile-name { color: #e5eefb; }
body.dark .tile-user { background: #172554; border-color: #1e40af; color: #93c5fd; }
body.dark .tile-suffix { background: #1e293b; color: #94a3b8; }
body.dark .tile-live { background: #042f2e; border-color: #0f766e; }
body.dark .tile-offline { background: #0d1424; }
body.dark .tile-offline .tile-name { color: #94a3b8; }
body.dark .tile-empty { color: #475569; }
body.dark .tile-hp-name { color: #e5eefb; }
body.dark .tile-hp-time { color: #94a3b8; }
body.dark .tile-hp-time.live { color: #34d399; }
body.dark .tile-hp-time.pred { color: #94a3b8; }

/* 设备右上角 CPU 角标：绝对定位，不占文档流、不改变方块高度 */
.tile-top { padding-right: 46px; }
.tile-cpu {
  position: absolute; top: 9px; right: 9px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  line-height: 1; pointer-events: auto; z-index: 3;
  cursor: pointer; padding: 4px; border-radius: 8px;
  transition: background .15s ease;
}
.tile-cpu:hover { background: rgba(37, 99, 235, .12); }
.tile-cpu:hover .tile-cpu-logo { color: #2563eb; }
.tile-b .tile-cpu:hover { background: rgba(255, 255, 255, .22); }
.tile-b .tile-cpu:hover .tile-cpu-logo { color: #fff; }
.tile-cpu-logo { width: 14px; height: 14px; color: #64748b; display: block; }
.tile-cpu-logo svg { width: 14px; height: 14px; display: block; }
.tile-cpu-txt {
  font-size: 9px; font-weight: 700; color: #475569; letter-spacing: .2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap;
}
body.dark .tile-cpu-logo { color: #94a3b8; }
body.dark .tile-cpu-txt { color: #94a3b8; }

@media (max-width: 640px) {
  .tiles-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tile { min-height: 96px; padding: 8px 9px; }
}

/* 设置页：可搜索设备组合框 */
.dev-combo { position: relative; }
.dev-combo-input {
  width: 100%; box-sizing: border-box; padding: 8px 10px;
  border: 1px solid var(--border, #d0d7de); border-radius: 8px;
  background: var(--input-bg, #fff); color: var(--text, #1f2937); font-size: 14px;
}
.dev-combo-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 240px; overflow-y: auto; background: var(--card-bg, #fff);
  border: 1px solid var(--border, #d0d7de); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 4px;
}
.dev-combo-item {
  padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--text, #1f2937);
}
.dev-combo-item:hover { background: var(--hover-bg, #f1f5f9); }
.dc-note { color: var(--muted, #94a3b8); font-size: 12px; }
.dc-homepage { color: #fe2c55; font-size: 12px; font-weight: 600; }
.dev-combo-empty { padding: 8px 9px; color: var(--muted, #94a3b8); font-size: 13px; }

/* 设置页：清空确认弹窗 */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45); padding: 16px;
}
.modal-box {
  width: 100%; max-width: 420px; background: var(--card-bg, #fff); color: var(--text, #1f2937);
  border-radius: 12px; padding: 18px 20px; box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.modal-box h3 { margin: 0 0 8px; }
.modal-box p { margin: 8px 0; line-height: 1.5; }
.modal-dev {
  background: var(--hover-bg, #f1f5f9); border-radius: 8px; padding: 10px 12px; margin: 10px 0;
  font-size: 14px; line-height: 1.7;
}
.modal-box code {
  background: var(--hover-bg, #f1f5f9); padding: 1px 6px; border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

/* ===== 用户统计（按用户聚合机器 / 主页 / 直播天数） ===== */
.us-table { overflow-x: auto; }
.us-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.us-tbl th {
  background: #f1f5f9; color: #334155; font-weight: 700; text-align: left;
  padding: 8px 10px; border-bottom: 1px solid #e2e8f0; white-space: nowrap; font-size: 12px;
}
.us-tbl td { padding: 7px 10px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
.us-tbl tr.us-group td { background: #eef2ff; border-bottom: 1px solid #dbeafe; padding: 7px 10px; }
.us-tbl tr.us-group-none td { background: #fff7ed; border-bottom: 1px solid #fed7aa; }
.us-uname { font-weight: 700; font-size: 14px; color: #1e293b; margin-right: 10px; }
.us-nouser { color: #b45309; }
.us-gmeta { font-size: 12px; color: #64748b; }
.us-dev:hover td { background: #f8fafc; }
.us-dev-recent td.us-num b { color: #16a34a; }
.us-dev-idle { color: #94a3b8; }
.us-name b { font-size: 13px; }
.us-suffix {
  display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700;
  color: #4338ca; background: #eef2ff; border-radius: 999px; padding: 1px 6px;
}
.us-sub { display: block; font-size: 11px; color: #94a3b8; }
.us-homepage { max-width: 340px; word-break: break-all; display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; row-gap: 2px; }
.us-hp { color: #2563eb; text-decoration: none; font-size: 12px; }
.us-hp:hover { text-decoration: underline; }
.us-hpname { display: block; flex-basis: 100%; font-size: 11px; color: #dc2626; }
.us-num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.us-num b { font-size: 14px; }
.us-time { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12px; color: #475569; }
.us-yes { color: #16a34a; font-weight: 700; }
.us-no { color: #94a3b8; }
.us-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #475569; cursor: pointer; }
.us-modal {
  position: fixed; inset: 0; z-index: 9999; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(15, 23, 42, .55);
}
.us-modal-card {
  background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
  width: min(1100px, 100%); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
}
.us-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid #e2e8f0;
}
.us-modal-head h3 { margin: 0; font-size: 16px; color: #0f172a; }
.us-modal-body { padding: 14px 18px; overflow: auto; }
.us-modal-foot { padding: 12px 18px; border-top: 1px solid #e2e8f0; display: flex; gap: 10px; justify-content: flex-end; }
body.dark .us-tbl th { background: #1e293b; color: #cbd5e1; border-bottom-color: #334155; }
body.dark .us-tbl td { border-bottom-color: #24334a; color: #dbe4f0; }
body.dark .us-tbl tr.us-group td { background: #1e2a45; border-bottom-color: #334155; }
body.dark .us-tbl tr.us-group-none td { background: #3a2410; border-bottom-color: #4a3418; }
body.dark .us-uname { color: #e5eefb; }
body.dark .us-nouser { color: #fbbf24; }
body.dark .us-dev:hover td { background: #1a2337; }
body.dark .us-suffix { color: #a5b4fc; background: #1e2a45; }
body.dark .us-hp { color: #7dd3fc; }
body.dark .us-time { color: #9fb0c8; }
body.dark .us-dev-idle { color: #64748b; }
body.dark .us-modal-card { background: #0f172a; }
body.dark .us-modal-head { border-bottom-color: #24334a; }
body.dark .us-modal-head h3 { color: #e5eefb; }
body.dark .us-modal-foot { border-top-color: #24334a; }
body.dark .us-check { color: #9fb0c8; }

/* ===== 「设置与其他」聚合入口 ===== */
.nav-card.more-card.more-card-active {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, .22);
}
.nav-card.more-card.more-card-active strong { color: #4338ca; }
body.dark .nav-card.more-card.more-card-active {
  border-color: #818cf8;
  box-shadow: 0 0 0 2px rgba(129, 140, 248, .3);
}
body.dark .nav-card.more-card.more-card-active strong { color: #a5b4fc; }

/* 用户统计：上月（最近一个完整自然月）直播天数，有值则高亮 */
.us-num .us-pm-hit { color: #4338ca; }
body.dark .us-num .us-pm-hit { color: #a5b4fc; }

/* 用户统计：月份分组之间的竖虚线（区分不同自然月的数值） */
.us-tbl th.us-sep, .us-tbl td.us-sep { border-left: 2px dashed #c7d2e0; }
body.dark .us-tbl th.us-sep, body.dark .us-tbl td.us-sep { border-left-color: #4a5b74; }

/* 用户统计：每个用户栏目顶部重复的列头（长列表滚动时对照各列含义） */
.us-tbl tr.us-subhead th {
  background: #f8fafc; color: #475569; font-size: 11px; padding: 5px 10px;
  border-bottom: 1px solid #e2e8f0; border-top: 2px solid #dbeafe;
}
body.dark .us-tbl tr.us-subhead th { background: #18233a; color: #9fb0c8; border-top-color: #334155; }

/* 用户统计：重复登记（同 hostname 多 id）红方块 + 提示 */
/* 用户统计·主页重复标记：主页列旁的小色块（同主页簇同色），无文字、不换行，点击跳历史ID定位 */
.us-dup { display:inline-block; width:12px; height:12px; border-radius:3px; background:var(--dup,#e11d48); box-shadow:0 0 0 1px rgba(0,0,0,.10); cursor:pointer; vertical-align:middle; flex:0 0 auto; }
.us-dup:hover { outline:2px solid var(--dup,#e11d48); outline-offset:1px; }
body.dark .us-dup { background:var(--dup,#f43f5e); box-shadow:0 0 0 1px rgba(255,255,255,.14); }
/* 从用户统计跳历史ID后的悬浮返回按钮 */
.us-back-float { position:fixed; right:18px; bottom:18px; z-index:1200; display:none; align-items:center; gap:6px; padding:9px 14px; border:none; border-radius:22px; background:#2563eb; color:#fff; font-size:13px; font-weight:600; cursor:pointer; box-shadow:0 6px 18px rgba(37,99,235,.35); }
.us-back-float:hover { background:#1d4ed8; }
body.dark .us-back-float { background:#3b82f6; box-shadow:0 6px 18px rgba(0,0,0,.45); }
body.dark .us-back-float:hover { background:#2563eb; }

/* 历史ID页：从用户统计跳转过来时高亮定位的卡片 */
.idh-card.idh-locate-flash { animation: idhFlash 1.1s ease-in-out 2; outline:2px solid #2563eb; outline-offset:2px; }
@keyframes idhFlash {
  0%,100% { box-shadow:0 0 0 0 rgba(37,99,235,0); }
  50% { box-shadow:0 0 0 5px rgba(37,99,235,.35); }
}
body.dark .idh-card.idh-locate-flash { outline-color:#60a5fa; }

/* ---- 推送设置：二级菜单（渠道管理 / iMessage 发送）---- */
.push-subtabs { display:flex; gap:6px; margin:0 0 12px; flex-wrap:wrap; }
.push-tab { padding:5px 14px; border:1px solid #e2e8f0; border-radius:999px; background:#fff; color:#475569; font-size:13px; cursor:pointer; }
.push-tab.active { background:#4338ca; border-color:#4338ca; color:#fff; font-weight:600; }
body.dark .push-tab { background:#111c33; border-color:#334155; color:#cbd5e1; }
body.dark .push-tab.active { background:#4338ca; border-color:#4338ca; color:#fff; }

/* ---- iMessage 推送格式编辑卡片 ---- */
.im-fmt-card { padding:12px 14px; border:1px solid #e2e8f0; border-radius:8px; margin-bottom:12px; background:#fff; }
.im-fmt-head { display:flex; gap:10px; align-items:baseline; flex-wrap:wrap; margin-bottom:8px; }
.im-fmt-row { display:flex; gap:10px; align-items:flex-start; margin-bottom:8px; flex-wrap:wrap; }
.im-fmt-label { min-width:72px; font-size:12px; color:#64748b; padding-top:5px; }
.im-fmt-fields { display:flex; flex-wrap:wrap; gap:4px 14px; flex:1; }
.im-fmt-field { font-size:12px; color:#334155; cursor:pointer; }
.im-fmt-actions { gap:8px; align-items:center; }
.im-fmt-status { font-size:12px; }
.im-grp { border:1px solid #eef2f7; border-radius:8px; padding:10px 12px; margin:10px 0; background:#f8fafc; }
.im-grp-title { font-weight:600; font-size:13px; color:#334155; margin-bottom:8px; display:flex; justify-content:space-between; align-items:center; gap:10px; }
body.dark .im-grp { background:#111a2b; border-color:#334155; }
body.dark .im-grp-title { color:#e2e8f0; }
.im-fmt-preview { margin:8px 0 0; padding:10px 12px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:6px; font-size:12px; white-space:pre-wrap; word-break:break-all; }
body.dark .im-fmt-card { background:#0b1220; border-color:#334155; }
body.dark .im-fmt-field { color:#cbd5e1; }
body.dark .im-fmt-label { color:#94a3b8; }
body.dark .im-fmt-preview { background:#111c33; border-color:#334155; color:#e2e8f0; }

/* ================= 性能统计页 ================= */
.pf-status { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.pf-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
}
.pf-chip.on { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.pf-chip.live { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.pf-chip.warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.pf-chip.muted { background: #f8fafc; color: #94a3b8; }
body.dark .pf-chip { background: #131c31; color: #cbd5e1; border-color: #223041; }
body.dark .pf-chip.on { background: #052e16; color: #6ee7b7; border-color: #15803d; }
body.dark .pf-chip.live { background: #450a0a; color: #fca5a5; border-color: #991b1b; }
body.dark .pf-chip.warn { background: #422006; color: #fcd34d; border-color: #92400e; }
body.dark .pf-chip.muted { background: #0f172a; color: #64748b; }

.pf-picker { border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; background: #fff; }
body.dark .pf-picker { border-color: #223041; background: #0f172a; }
.pf-picker-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pf-picked-count { font-size: 12px; color: #64748b; }
body.dark .pf-picked-count { color: #94a3b8; }
.pf-device-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 6px; max-height: 260px; overflow: auto; padding-right: 4px;
}
.pf-dev-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; font-size: 12px;
}
.pf-dev-item:hover { background: #f8fafc; }
.pf-dev-item.picked { background: #eff6ff; border-color: #bfdbfe; }
body.dark .pf-dev-item:hover { background: #131c31; }
body.dark .pf-dev-item.picked { background: #0c1e3d; border-color: #1e40af; }
.pf-dev-name { font-weight: 600; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.dark .pf-dev-name { color: #e2e8f0; }
.pf-dev-live { flex: none; font-size: 10px; font-weight: 700; color: #b91c1c; background: #fee2e2; border-radius: 4px; padding: 1px 4px; }
/* 「旧 id」标记：设备重装过探针，这条是旧编号留下的历史数据 */
.pf-dev-stale { flex: none; font-size: 10px; font-weight: 700; color: #92400e; background: #fef3c7; border-radius: 4px; padding: 1px 4px; }
body.dark .pf-dev-stale { color: #fcd34d; background: rgba(120, 53, 15, .45); }
.pf-dev-idle { flex: none; font-size: 10px; color: #94a3b8; }
.pf-dev-note { flex: none; font-size: 11px; color: #64748b; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.dark .pf-dev-note { color: #94a3b8; }
.pf-dev-samples { margin-left: auto; flex: none; font-size: 11px; color: #94a3b8; }
.pf-dev-rec { margin-left: auto; flex: none; font-size: 11px; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.pf-dev-rec.have { color: #047857; background: #d1fae5; font-weight: 600; }
.pf-dev-rec.none { color: #94a3b8; background: #f1f5f9; }
body.dark .pf-dev-rec.have { color: #6ee7b7; background: rgba(6, 78, 59, .45); }
body.dark .pf-dev-rec.none { color: #94a3b8; background: rgba(148, 163, 184, .12); }
.pf-rec-toggle { flex: none; font-size: 12px; color: #475569; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
body.dark .pf-rec-toggle { color: #cbd5e1; }

.pf-charts { margin-top: 16px; display: grid; gap: 12px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1500px) { .pf-charts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .pf-charts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .pf-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px)  { .pf-charts { grid-template-columns: minmax(0, 1fr); } }
.pf-chart-card { position: relative; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; background: #fff; min-width: 0; }
body.dark .pf-chart-card { border-color: #223041; background: #0f172a; }
/* 展开按钮固定钉在卡片最右上角，标题/数值换行也不会把它挤走 */
.pf-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; padding-right: 62px; }
/* 展开的卡片置顶（order 优先），不用往上翻就能看到；多张展开时按点开顺序排在最前 */
.pf-chart-card.expanded { grid-column: 1 / -1; order: -1; border-color: #6366f1; box-shadow: 0 2px 12px rgba(99,102,241,.15); }
/* 顶栏 sticky，滚动定位时留出它的高度，别把设备名那行压在底下 */
.pf-chart-card { scroll-margin-top: 120px; }
.pf-chart-card .pf-chart-title { cursor: pointer; }
.pf-chart-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-exp-btn {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  flex: none; font-size: 11px; padding: 2px 8px; border-radius: 6px; cursor: pointer;
  border: 1px solid #cbd5e1; background: #f8fafc; color: #475569;
}
.pf-exp-btn:hover { background: #eef2ff; border-color: #6366f1; color: #4338ca; }
body.dark .pf-exp-btn { background: #1e293b; border-color: #334155; color: #cbd5e1; }
body.dark .pf-exp-btn:hover { background: #1e1b4b; border-color: #6366f1; color: #a5b4fc; }
.pf-chart-card:not(.expanded) .pf-chart-title { font-size: 12px; }
/* 用户：纯文字，不占多余字符（原本带 👤 和药丸边框，太挤） */
.pf-dev-user {
  flex: 0 1 auto; min-width: 0; font-size: 11px; font-weight: 500; color: #64748b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.dark .pf-dev-user { color: #94a3b8; }
/* 采集模式徽章只在大图显示，小图省字符 */
.pf-chart-card:not(.expanded) .pf-mode-badge { display: none; }
.pf-chart-card:not(.expanded) .pf-chart-now { font-size: 11px; gap: 6px; }
.pf-chart-card:not(.expanded) .pf-chart-foot { margin-top: 4px; }
.pf-picker.collapsed .pf-device-list { display: none; }
.pf-picker.collapsed .pf-picker-head { margin-bottom: 0; }
.pf-collapse-btn { font-size: 11px; padding: 2px 8px; }
/* 标题一律单行、超长省略，绝不撑出卡片（小图只有 1/5 宽） */
.pf-chart-title {
  font-size: 14px; font-weight: 700; color: #0f172a;
  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap;
  flex: 1 1 auto; min-width: 0; overflow: hidden;
}
.pf-c-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.dark .pf-chart-title { color: #f1f5f9; }
.pf-chart-now { display: flex; gap: 10px; font-size: 12px; font-weight: 600; flex-wrap: wrap; }
.pf-chart-count { color: #94a3b8; font-weight: 400; }
.pf-canvas-wrap { position: relative; width: 100%; min-width: 0; }
/* JS 给 canvas 写的是固定 px 宽；容器变窄时（展开/收起、换列数）别让它顶出卡片 */
.pf-canvas { display: block; width: 100%; max-width: 100%; cursor: crosshair; }
.pf-tip {
  position: absolute; z-index: 5; pointer-events: none;
  background: rgba(15, 23, 42, 0.92); color: #f8fafc;
  border-radius: 6px; padding: 6px 8px; font-size: 11px; line-height: 1.5;
  white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.pf-tip-time { font-weight: 700; margin-bottom: 2px; }
.pf-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
/* 读数气泡：一行小字（原来四行太大，缩放时会盖住整张图） */
.pf-tip.compact { font-size: 10px; padding: 3px 6px; line-height: 1.35; border-radius: 5px; }
.pf-tip.compact.big { font-size: 11px; padding: 4px 8px; }
.pf-tip.compact i { width: 6px; height: 6px; margin-right: 3px; margin-left: 6px; }
.pf-tip.compact.big i { width: 7px; height: 7px; }
.pf-tip.compact i:first-of-type { margin-left: 0; }
.pf-tip.compact b { font-weight: 700; margin-right: 6px; }
.pf-chart-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.pf-hint { font-size: 11px; color: #94a3b8; }
/* 「重置缩放」改成纯图标：回旋箭头 + 下方双向箭头线 */
.pf-reset {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0; border-radius: 6px; cursor: pointer;
  border: 1px solid #cbd5e1; background: #f8fafc; color: #475569;
}
.pf-reset:hover { background: #eef2ff; border-color: #6366f1; color: #4338ca; }
.pf-reset:active { transform: scale(.92); }
body.dark .pf-reset { background: #1e293b; border-color: #334155; color: #cbd5e1; }
body.dark .pf-reset:hover { background: #1e1b4b; border-color: #6366f1; color: #a5b4fc; }
.pf-reset-ico { width: 15px; height: 15px; display: block; }

/* 性能图下方时间轴滑块：轨道 = 全量时间，窗口 = 当前可视区段（拖动平移 / 拖两端缩放） */
.pf-time-slider { display: flex; align-items: center; margin-top: 8px; height: 22px; user-select: none; -webkit-user-select: none; touch-action: none; }
.pf-time-track { position: relative; flex: 1 1 auto; height: 6px; border-radius: 999px; background: #e2e8f0; }
.pf-time-win {
  position: absolute; top: 50%; transform: translateY(-50%); height: 12px; min-width: 10px;
  border-radius: 999px; background: rgba(99,102,241,.35); border: 1px solid #6366f1; cursor: grab;
}
.pf-time-win:active { cursor: grabbing; }
.pf-time-handle {
  position: absolute; top: 50%; transform: translateY(-50%); width: 10px; height: 18px;
  border-radius: 3px; background: #fff; border: 1px solid #6366f1; cursor: ew-resize; z-index: 2;
}
.pf-time-handle.l { left: -5px; }
.pf-time-handle.r { right: -5px; }
body.dark .pf-time-track { background: #1e293b; }
body.dark .pf-time-win { background: rgba(99,102,241,.45); border-color: #818cf8; }
body.dark .pf-time-handle { background: #0f172a; border-color: #818cf8; }

/* 长期采集模式：每台设备的下拉 + 图表徽章 */
.pf-mode-sel {
  flex: none; margin-left: auto;
  font-size: 11px; padding: 2px 4px;
  border: 1px solid #cbd5e1; border-radius: 6px;
  background: #fff; color: #334155; cursor: pointer;
}
.pf-mode-sel.dim { opacity: 0.45; }
body.dark .pf-mode-sel { background: #0f172a; color: #cbd5e1; border-color: #334155; }
.pf-dev-samples { margin-left: 0 !important; }
.pf-mode-badge {
  flex: none; font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 999px;
  background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe;
}
.pf-mode-badge.always { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
body.dark .pf-mode-badge { background: #1e1b4b; color: #a5b4fc; border-color: #4338ca; }
body.dark .pf-mode-badge.always { background: #431407; color: #fdba74; border-color: #c2410c; }

/* ---- 记事本：任务 / 公告栏 两列 ---- */
.np-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .np-columns { grid-template-columns: 1fr; } }
.np-col {
  min-width: 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px;
}
body.dark .np-col { background: #0f172a; border-color: #223041; }
.np-col-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding-bottom: 8px; border-bottom: 1px solid #eef2f7;
}
body.dark .np-col-head { border-color: #1e293b; }
.np-col-title { margin: 0; font-size: 15px; font-weight: 700; color: #0f172a; }
body.dark .np-col-title { color: #f1f5f9; }
.np-col .np-list { margin-top: 10px; max-height: 62vh; overflow: auto; padding-right: 2px; }
.np-row.np-notice { border-left: 3px solid #f59e0b; }
.np-editor.is-notice .np-done-wrap { display: none; }
.np-kind-tag {
  flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: #eef2ff; color: #4338ca;
}
body.dark .np-kind-tag { background: #1e1b4b; color: #a5b4fc; }

/* ---- 记事本：拖拽换栏（任务 <-> 公告栏） ---- */
.np-row[draggable="true"] { cursor: grab; }
.np-row.np-dragging { opacity: .45; cursor: grabbing; }
.np-list.np-drop-target { outline: 2px dashed #6366f1; outline-offset: -3px; border-radius: 10px; background: rgba(99,102,241,.05); }
.np-list.np-drop-over { background: rgba(99,102,241,.13); }
/* 标题旁的「可拖动」演示动画（拖过一次后不再出现） */
.np-drag-hint {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 8px;
  font-size: 11px; font-weight: 500; color: #94a3b8; vertical-align: middle;
}
body.dark .np-drag-hint { color: #64748b; }
.np-drag-hint .np-dh-track {
  position: relative; display: inline-block; width: 30px; height: 12px;
  border-radius: 4px; border: 1px dashed #c7d2fe; background: rgba(99,102,241,.06);
}
body.dark .np-drag-hint .np-dh-track { border-color: #3730a3; background: rgba(99,102,241,.12); }
.np-drag-hint .np-dh-card {
  position: absolute; top: 1px; left: 1px; width: 14px; height: 8px; border-radius: 2px;
  background: #6366f1; box-shadow: 0 1px 3px rgba(99,102,241,.5);
  animation: npdh-slide 2.4s ease-in-out infinite;
}
/* 公告栏那侧反向滑，表示往左拖回任务栏 */
.np-drag-hint.rev .np-dh-card { animation-name: npdh-slide-rev; }
@keyframes npdh-slide {
  0%   { transform: translateX(0); opacity: 0; }
  12%  { transform: translateX(0); opacity: 1; }
  55%  { transform: translateX(13px); opacity: 1; }
  75%  { transform: translateX(13px); opacity: 1; }
  100% { transform: translateX(0); opacity: 0; }
}
@keyframes npdh-slide-rev {
  0%   { transform: translateX(13px); opacity: 0; }
  12%  { transform: translateX(13px); opacity: 1; }
  55%  { transform: translateX(0); opacity: 1; }
  75%  { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(13px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .np-drag-hint .np-dh-card { animation: none; opacity: .9; }
}

/* ---- 屏幕检测设置：名称白名单 chips ---- */
.screen-name-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 28px;
}
.screen-name-hint {
  color: #94a3b8;
  font-size: 11px;
  margin-left: 2px;
}
body.dark .screen-name-hint { color: #7c8ba1; }
.screen-name-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px 9px;
  border-radius: 999px;
  background: rgba(59, 130, 246, .12);
  border: 1px solid rgba(59, 130, 246, .35);
  color: #1d4ed8;
  font-size: 12px;
  line-height: 1.4;
  max-width: 100%;
}
body.dark .screen-name-chip {
  background: rgba(96, 165, 250, .14);
  border-color: rgba(96, 165, 250, .38);
  color: #bfdbfe;
}
.screen-name-del {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: .6;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.screen-name-del:hover { opacity: 1; color: #dc2626; }

/* ============================================================
   关于 / 更新日志（视图 about-log）
   ============================================================ */
.about-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.about-sub { font-size: 12px; }
.cl-day { position: relative; margin-left: 6px; padding: 0 0 16px 16px; border-left: 2px solid #e2e8f0; }
.cl-day:last-child { padding-bottom: 0; border-left-color: transparent; }
.cl-date { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cl-dot { width: 9px; height: 9px; border-radius: 50%; background: #2563eb; margin-left: -21px; box-shadow: 0 0 0 3px #eff6ff; flex-shrink: 0; }
.cl-date-text { font-weight: 700; font-size: 14px; color: #0f172a; }
.cl-count { font-size: 11px; color: #64748b; }
.cl-new { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #dcfce7; color: #15803d; font-weight: 600; }
.cl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cl-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px; }
.cl-title { font-weight: 600; font-size: 13px; color: #0f172a; }
.cl-desc { font-size: 12px; color: #64748b; margin-top: 2px; line-height: 1.5; }
body.dark .cl-day { border-left-color: #334155; }
body.dark .cl-dot { background: #60a5fa; box-shadow: 0 0 0 3px #1e293b; }
body.dark .cl-date-text { color: #e5eefb; }
body.dark .cl-count { color: #8ea0b8; }
body.dark .cl-new { background: #14532d; color: #86efac; }
body.dark .cl-item { background: #111827; border-color: #223041; }
body.dark .cl-title { color: #e5eefb; }
body.dark .cl-desc { color: #8ea0b8; }

/* ============================================================
   硬件变更页（视图 hw-changes）
   ============================================================ */
.hw-chg-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.hw-chg-sel {
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
}
body.dark .hw-chg-sel { background: #111827; border-color: #334155; color: #e5eefb; }
.hw-chg-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px; }
.hw-chg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hw-chg-time { font-size: 11px; color: #94a3b8; font-variant-numeric: tabular-nums; }
.hw-chg-dev { font-weight: 600; font-size: 13px; color: #0f172a; }
.hw-chg-dev.stale { color: #92400e; }
body.dark .hw-chg-dev.stale { color: #fcd34d; }
.hw-chg-note { font-size: 11px; color: #64748b; }
.hw-chg-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #4338ca;
}
.hw-chg-badge.hw-chg-cpu { background: #dbeafe; color: #1d4ed8; }
.hw-chg-badge.hw-chg-ram { background: #ede9fe; color: #6d28d9; }
.hw-chg-badge.hw-chg-motherboard { background: #dcfce7; color: #15803d; }
.hw-chg-badge.hw-chg-gpu { background: #ffedd5; color: #c2410c; }
.hw-chg-diff { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; line-height: 1.5; }
.hw-chg-old { color: #94a3b8; text-decoration: line-through; }
.hw-chg-arrow { color: #94a3b8; font-weight: 700; }
.hw-chg-new { color: #0f172a; font-weight: 600; }
body.dark .hw-chg-item { background: #111827; border-color: #223041; }
body.dark .hw-chg-dev { color: #e5eefb; }
body.dark .hw-chg-new { color: #e5eefb; }
body.dark .hw-chg-note { color: #8ea0b8; }
body.dark .hw-chg-time, body.dark .hw-chg-arrow { color: #64748b; }
body.dark .hw-chg-old { color: #64748b; }
body.dark .hw-chg-badge { background: #312e81; color: #c7d2fe; }
body.dark .hw-chg-badge.hw-chg-cpu { background: #1e3a8a; color: #bfdbfe; }
body.dark .hw-chg-badge.hw-chg-ram { background: #4c1d95; color: #ddd6fe; }
body.dark .hw-chg-badge.hw-chg-motherboard { background: #14532d; color: #bbf7d0; }
body.dark .hw-chg-badge.hw-chg-gpu { background: #7c2d12; color: #fed7aa; }

/* ============================================================
   手机/窄屏首页：隐藏设备行的 USB 手机图标
   —— 首页 System Status（默认主题 / 卡片主题）在窄屏横向太挤，
      手机图标是纯装饰（型号文字保留），窄屏直接隐藏；电脑端照常显示。
   ============================================================ */
@media (max-width: 768px) {
  #apple-dashboard .usb-phone-icon,
  .grouped-device-table .usb-phone-icon { display: none; }
}
/* ============================================================
   ID Hub（一级标签「ID」）—— 三个二级面板：
     ① 直播面板：TikTok 主页卡片墙（扑克牌比例，5 张一行）
     ② ID核对：原有的主页核对
     ③ 历史ID：每台设备用过的 TikTok 账号
   ============================================================ */
.idhub-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}
body.dark .idhub-tabs { border-color: #1f2a44; }
.idhub-tab {
  position: relative;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: all .16s ease;
}
.idhub-tab:hover { color: #0f172a; background: #e2e8f0; }
.idhub-tab.active {
  color: #fff;
  background: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .35);
}
body.dark .idhub-tab { color: #94a3b8; background: #111c31; }
body.dark .idhub-tab:hover { color: #e2e8f0; background: #1c2942; }
body.dark .idhub-tab.active { color: #fff; background: #2563eb; }

.idhub-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.idhub-bar .muted { max-width: 620px; font-size: 12px; line-height: 1.6; }
.idhub-bar-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---- ① 直播面板：卡片墙 ---- */
.ttc-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
@media (max-width: 1400px) { .ttc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .ttc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px)  { .ttc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px)  { .ttc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 手机端 ID→直播面板：正方形小扑克卡，一行 3 个，字体缩小，去掉涨幅徽标 */
@media (max-width: 640px) {
  .ttc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .ttc-card { aspect-ratio: 1 / 1; min-height: 0; padding: 7px; border-radius: 10px; }
  .ttc-body { padding: 24px 5px 20px; gap: 3px; }
  .ttc-av-wrap { width: 46px; height: 46px; }
  .ttc-av-img, .ttc-av-fb { width: 46px; height: 46px; }
  .ttc-av-fb { font-size: 18px; }
  .ttc-card.is-live .ttc-av-wrap::after { inset: -4px; border-width: 2px; }
  .ttc-nick { font-size: 11px; margin-top: 5px; }
  .ttc-stats { font-size: 9px; gap: 5px; }
  .ttc-stat i, .ttc-stat b { font-size: 9px; }
  .ttc-delta { display: none; }
  .ttc-time { font-size: 10px; margin-top: 4px; }
  .ttc-corner { font-size: 8px; line-height: 1.2; max-width: 50%; }
  .ttc-corner.tl { font-size: 9px; top: 5px; left: 6px; }
  .ttc-corner.tr { top: 5px; right: 6px; }
  .ttc-corner.bl { bottom: 5px; left: 6px; }
  .ttc-corner.br { bottom: 5px; right: 6px; }
  .ttc-live-badge { font-size: 8px; padding: 1px 5px; letter-spacing: .3px; }
}

.ttc-card {
  position: relative;
  display: block;
  aspect-ratio: 5 / 7;
  min-height: 250px;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.ttc-card:hover { transform: translateY(-3px); }
/* 直播中：绿色炫光框（呼吸） */
.ttc-card.is-live {
  border-color: #22c55e;
  animation: ttcGlow 2.2s ease-in-out infinite;
}
/* 未直播：灰色框 + 轻微降饱和 */
.ttc-card.is-off {
  border-color: #cbd5e1;
  filter: saturate(.5);
}
body.dark .ttc-card { background: #0f172a; border-color: #1f2a44; }
body.dark .ttc-card.is-off { border-color: #334155; }

@keyframes ttcGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(34,197,94,.45), 0 0 14px rgba(34,197,94,.35), 0 0 30px rgba(34,197,94,.16); }
  50%      { box-shadow: 0 0 0 1px rgba(34,197,94,.85), 0 0 22px rgba(34,197,94,.62), 0 0 48px rgba(34,197,94,.32); }
}

/* 四角信息：左上设备号 / 右上用户 / 左下后缀 / 右下发送中或预计开播 */
.ttc-corner {
  position: absolute;
  max-width: 52%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.35;
  z-index: 2;
}
.ttc-corner.tl { top: 8px; left: 10px; font-weight: 700; font-size: 12px; color: #0f172a; }
.ttc-corner.tr { top: 8px; right: 10px; text-align: right; color: #64748b; }
.ttc-corner.bl { bottom: 8px; left: 10px; color: #64748b; }
.ttc-corner.br { bottom: 8px; right: 10px; }
.ttc-corner .live-badge { margin-left: 0; }
.ttc-offrow { font-size: 11px; color: #64748b; font-weight: 700; }
body.dark .ttc-corner.tl { color: #e2e8f0; }
body.dark .ttc-corner.bl, body.dark .ttc-offrow { color: #94a3b8; }

/* 直播中：右下角小 LIVE 绿闪徽标（取代文字「放送中」） */
.ttc-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #22c55e;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
  box-shadow: 0 0 10px rgba(34,197,94,.7);
  animation: ttcLiveFlash 1.1s ease-in-out infinite;
}
body.dark .ttc-live-badge { background: #16a34a; }
@keyframes ttcLiveFlash {
  0%, 100% { opacity: 1;   box-shadow: 0 0 12px rgba(34,197,94,.9); }
  50%      { opacity: .4;  box-shadow: 0 0 4px rgba(34,197,94,.35); }
}

/* 直播面板排序工具条 */
.ttc-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.ttc-sort-label { font-size: 12px; color: #64748b; font-weight: 600; }
.ttc-sort-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  cursor: pointer;
  transition: all .16s ease;
}
.ttc-sort-btn:hover { background: #e2e8f0; color: #0f172a; }
.ttc-sort-btn.active {
  color: #fff;
  background: #22c55e;
  border-color: #22c55e;
  box-shadow: 0 2px 8px rgba(34,197,94,.35);
}
body.dark .ttc-sort-label { color: #94a3b8; }
body.dark .ttc-sort-btn { color: #94a3b8; background: #111c31; border-color: #1f2a44; }
body.dark .ttc-sort-btn:hover { color: #e2e8f0; background: #1c2942; }
body.dark .ttc-sort-btn.active { color: #fff; background: #16a34a; border-color: #16a34a; }

/* ===== Live 页 iPod Cover Flow（方块专辑封面墙，仅显示直播中 / 預備中） ===== */
.ttc-cf {
  position: relative;
  width: 100%;
  grid-column: 1 / -1; /* 横跨 .ttc-grid 的全部列，避免被压成单列窄带 */
  min-width: 0;
  height: 232px;
  margin-top: 16px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  outline: none;
}
.ttc-cf:focus-visible { box-shadow: 0 0 0 2px rgba(34,197,94,.5); border-radius: 12px; }
.ttc-cf-strip {
  display: flex;
  align-items: center;
  height: 100%;
  transition: transform .4s cubic-bezier(.22,.61,.36,1);
}
.ttc-cf.dragging .ttc-cf-strip { transition: none; }
.cf-cover {
  flex: 0 0 auto;
  position: relative;
  width: 154px;
  height: 154px;
  margin-left: -52px;
  z-index: 1;
  transition: transform .18s ease, filter .18s ease;
  cursor: pointer;
}
.cf-cover:first-child { margin-left: 0; }
.cf-cover:hover { transform: scale(1.06); z-index: 50; }
.cf-cover.is-live { z-index: 3; }
.cf-cover.is-prep { z-index: 2; }
.cf-cover.is-off { z-index: 1; filter: grayscale(0.55) brightness(0.92); }
.cf-cover.is-live:hover,
.cf-cover.is-prep:hover,
.cf-cover.is-off:hover { z-index: 50; }
.cf-link {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #0f172a;
  box-shadow: 0 10px 30px rgba(15,23,42,.35);
}
.cf-cover.is-live .cf-link { box-shadow: 0 0 0 2px rgba(34,197,94,.55), 0 10px 26px rgba(15,23,42,.4); }
.cf-cover.is-prep .cf-link { box-shadow: 0 0 0 2px rgba(245,158,11,.55), 0 10px 26px rgba(15,23,42,.4); }
.cf-cover.is-live:hover .cf-link {
  box-shadow: 0 0 0 2px rgba(34,197,94,.95), 0 0 26px rgba(34,197,94,.6), 0 10px 30px rgba(15,23,42,.4);
  animation: ttcGlow 2.2s ease-in-out infinite;
}
.cf-cover.is-prep:hover .cf-link {
  box-shadow: 0 0 0 2px rgba(245,158,11,.95), 0 0 22px rgba(245,158,11,.5), 0 10px 30px rgba(15,23,42,.4);
}
.cf-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.cf-art-fb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #ec4899);
}
.cf-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,0) 45%);
  pointer-events: none;
}
.cf-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 9px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.74));
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cf-nick {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cf-sub { display: flex; gap: 8px; font-size: 11px; opacity: .92; }
.cf-status { font-size: 11px; font-weight: 700; margin-top: 1px; }
.cf-status.live { color: #4ade80; }
.cf-status.prep { color: #fbbf24; }
.cf-status.off { color: #cbd5e1; opacity: .92; }
.cf-label {
  position: absolute;
  top: 6px;
  font-size: 10px;
  line-height: 1.2;
  z-index: 3;
  max-width: 60%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,.85);
  color: #fff;
}
.cf-label.tl { left: 7px; font-weight: 700; }
.cf-label.tr { right: 7px; text-align: right; opacity: .92; }
.cf-badge { position: absolute; top: 7px; left: 50%; transform: translateX(-50%); z-index: 4; }
.ttc-cf-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(15,23,42,.55);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 20;
  display: flex; align-items: center; justify-content: center;
  transition: background .16s ease;
}
.ttc-cf-nav:hover { background: rgba(15,23,42,.82); }
.ttc-cf-nav.prev { left: 6px; }
.ttc-cf-nav.next { right: 6px; }
.ttc-cf-dots {
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  display: flex; justify-content: center; gap: 6px;
  z-index: 20;
}
.ttc-cf-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(148,163,184,.6);
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.ttc-cf-dot.active { background: #22c55e; transform: scale(1.35); }

/* 手机端 ID 直播面板：方形专辑封面网格（一行 3 个），代替扑克牌卡 */
.ttc-cf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  grid-column: 1 / -1; /* 横跨 .ttc-grid 全部列，避免被压成单列窄带 */
  min-width: 0;
}
.ttc-cf-grid .cf-cover {
  width: auto !important;
  height: auto !important;
  margin-left: 0 !important;
  aspect-ratio: 1 / 1;
  flex: none;
}
.ttc-cf-grid .cf-link { border-radius: 10px; }
.ttc-cf-grid .cf-nick { font-size: 11px; }
.ttc-cf-grid .cf-sub { font-size: 9px; gap: 6px; }
.ttc-cf-grid .cf-status { font-size: 9px; }
.ttc-cf-grid .cf-label { font-size: 9px; }
.ttc-cf-grid .cf-art-fb { font-size: 40px; }

@media (max-width: 600px) {
  .ttc-cf { height: 188px; }
  .cf-cover { width: 118px; height: 118px; margin-left: -40px; }
  .cf-art-fb { font-size: 42px; }
}

body.dark .cf-link { background: #0f172a; }
body.dark .cf-sub { opacity: .85; }
body.dark .cf-status.off { color: #e2e8f0; opacity: .7; }

.ttc-body {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 10px 28px;
  gap: 6px;
}
.ttc-av-wrap { position: relative; width: 76px; height: 76px; flex-shrink: 0; }
.ttc-av-img, .ttc-av-fb {
  position: absolute;
  inset: 0;
  width: 76px; height: 76px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #e2e8f0;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(148,163,184,.55);
}
body.dark .ttc-av-img, body.dark .ttc-av-fb { background: #1c2942; box-shadow: 0 0 0 2px #0f172a, 0 0 0 3px rgba(148,163,184,.45); }
.ttc-av-fb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: #64748b;
}
/* 直播中：模仿 TikTok 个人主页的开播红圈光晕，缓慢呼吸 */
.ttc-card.is-live .ttc-av-wrap::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 3px solid #ef4444;
  box-shadow: 0 0 12px rgba(239,68,68,.85), inset 0 0 10px rgba(239,68,68,.35);
  animation: ttcRing 1.7s ease-in-out infinite;
}
@keyframes ttcRing {
  0%, 100% { transform: scale(1);    opacity: .95; }
  50%      { transform: scale(1.06); opacity: .5; }
}

.ttc-nick {
  margin-top: 12px;
  max-width: 100%;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.dark .ttc-nick { color: #e2e8f0; }

.ttc-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  row-gap: 2px;
  font-size: 11px;
  color: #475569;
}
.ttc-stat { display: inline-flex; align-items: baseline; gap: 3px; }
.ttc-stat i { font-style: normal; color: #94a3b8; font-size: 10px; }
.ttc-stat b { font-weight: 700; color: #0f172a; font-size: 11px; }
body.dark .ttc-stat { color: #94a3b8; }
body.dark .ttc-stat b { color: #e2e8f0; }
/* 涨跌幅：涨=红、跌=绿（与行情习惯一致的小标签） */
.ttc-delta { font-style: normal; font-weight: 700; font-size: 10px; margin-left: 4px; }
.ttc-delta u { text-decoration: none; opacity: .8; margin-left: 2px; font-weight: 600; }
.ttc-up { color: #ef4444; }
.ttc-down { color: #16a34a; }

.ttc-time { margin-top: 8px; font-size: 12px; color: #64748b; text-align: center; }
.ttc-time.live { color: #16a34a; font-weight: 700; }
.ttc-time.prep { color: #f59e0b; font-weight: 700; }
.ttc-time.over { color: #94a3b8; }
.ttc-time.pred { color: #64748b; }
.ttc-time.muted-t { color: #94a3b8; }
.ttc-aud { margin-top: 2px; font-size: 11px; color: #38bdf8; text-align: center; font-weight: 600; }
body.dark .ttc-aud { color: #38bdf8; }
.cf-meta .ttc-aud { text-align: left; }

/* ---- ③ 历史 ID：表格 ---- */
/* 历史 ID：设备卡片 + 当前/历史时间轴（手机端友好，不依赖 hover） */
.idh-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
@media (max-width: 640px) { .idh-cards { grid-template-columns: 1fr; } }
.idh-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff;
}
body.dark .idh-card { background: #0f172a; border-color: #1f2a44; }
.idh-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.idh-card-title { font-size: 14px; font-weight: 700; color: #0f172a; }
body.dark .idh-card-title { color: #e2e8f0; }
.idh-card-user { font-size: 12px; color: #64748b; white-space: nowrap; }
.idh-nouser { color: #94a3b8; }
.idh-gone { font-size: 11px; color: #ef4444; font-weight: 400; margin-left: 4px; }
.idh-sec { display: flex; flex-direction: column; gap: 6px; }
.idh-sec-label { font-size: 11px; font-weight: 700; color: #64748b; letter-spacing: .03em; }
body.dark .idh-sec-label { color: #94a3b8; }

/* 历史 ID 页「总编辑」模式下的账号编辑控件 */
.idh-edit-row { display: flex; gap: 6px; align-items: stretch; }
.idh-edit-row .idh-edit-homepage {
  flex: 1 1 auto; min-width: 0; font-size: 12px;
  padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #0f172a;
}
body.dark .idh-edit-row .idh-edit-homepage { background: #0b1220; border-color: #2b3a4d; color: #e2e8f0; }
.idh-edit-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.idh-edit-hint { font-size: 11px; color: #ef4444; }

/* 当前账号行 */
.idh-cur-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  background: rgba(34,197,94,.07); border: 1px solid rgba(34,197,94,.35);
}
.idh-cur-empty { background: #f1f5f9; border-color: #e2e8f0; color: #94a3b8; font-size: 12px; justify-content: center; }
body.dark .idh-cur-empty { background: #131c31; border-color: #1f2a44; color: #64748b; }
.idh-badge {
  margin-left: auto; flex-shrink: 0; font-size: 11px; font-weight: 700; color: #16a34a;
  background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.4);
  padding: 2px 8px; border-radius: 999px;
}
body.dark .idh-badge { color: #4ade80; }

/* 头像尺寸 */
.idh-av { position: relative; flex-shrink: 0; overflow: hidden; border-radius: 50%; background: #e2e8f0; }
.idh-av .ttc-av-img, .idh-av .ttc-av-fb {
  width: 100%; height: 100%; font-size: 14px; box-shadow: none;
  background: #e2e8f0; display: flex; align-items: center; justify-content: center;
}
body.dark .idh-av { background: #1c2942; }
body.dark .idh-av .ttc-av-img, body.dark .idh-av .ttc-av-fb { background: #1c2942; }
.idh-av-lg { width: 44px; height: 44px; }
.idh-av-sm { width: 34px; height: 34px; }

/* 历史ID：正在直播的设备 → 当前账号头像红框闪烁 */
.idh-av-live {
  box-shadow: 0 0 0 2px #22c55e, 0 0 0 5px rgba(34,197,94,.35);
  animation: idhLiveBlink 1.1s ease-in-out infinite;
}
@keyframes idhLiveBlink {
  0%, 100% { box-shadow: 0 0 0 2px #22c55e, 0 0 0 5px rgba(34,197,94,.35); }
  50%      { box-shadow: 0 0 0 2px #22c55e, 0 0 0 9px rgba(34,197,94,0); }
}
.idh-card-live .idh-cur-row { background: rgba(34,197,94,.06); border-color: rgba(34,197,94,.4); }
.idh-live-tag {
  margin-left: 6px; font-size: 11px; font-weight: 700; color: #16a34a;
  background: rgba(34,197,94,.14); border: 1px solid rgba(34,197,94,.45);
  padding: 1px 7px; border-radius: 999px; vertical-align: middle;
  animation: idhLiveBlink 1.1s ease-in-out infinite;
}
body.dark .idh-av-live { box-shadow: 0 0 0 2px #4ade80, 0 0 0 5px rgba(74,222,128,.35); animation: idhLiveBlinkDark 1.1s ease-in-out infinite; }
@keyframes idhLiveBlinkDark {
  0%, 100% { box-shadow: 0 0 0 2px #4ade80, 0 0 0 5px rgba(74,222,128,.35); }
  50%      { box-shadow: 0 0 0 2px #4ade80, 0 0 0 9px rgba(74,222,128,0); }
}
body.dark .idh-card-live .idh-cur-row { background: rgba(74,222,128,.08); border-color: rgba(74,222,128,.45); }
body.dark .idh-live-tag { color: #4ade80; background: rgba(74,222,128,.16); border-color: rgba(74,222,128,.5); }
.idh-sync-off {
  margin-left: 6px; font-size: 11px; font-weight: 700; color: #b45309;
  background: rgba(245,158,11,.16); border: 1px solid rgba(245,158,11,.5);
  padding: 1px 7px; border-radius: 999px; vertical-align: middle;
}
body.dark .idh-sync-off { color: #fbbf24; background: rgba(245,158,11,.18); border-color: rgba(245,158,11,.55); }
.idh-edit-hint { font-size: 11px; color: #ef4444; }
.idh-resume-row .idh-edit-hint { color: #b45309; }

/* 文字元信息 */
.idh-meta { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; flex: 1; }
.idh-nick { font-size: 13px; font-weight: 700; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idh-at { font-size: 11px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idh-range { font-size: 11px; color: #94a3b8; margin-top: 1px; }
body.dark .idh-nick { color: #e2e8f0; }
body.dark .idh-range { color: #cbd5e1; }
.idh-none { font-size: 12px; color: #94a3b8; }

/* 历史时间轴 */
.idh-tl { position: relative; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.idh-tl::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: #e2e8f0; }
body.dark .idh-tl::before { background: #1f2a44; }
.idh-tl-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc;
}
.idh-tl-item::before {
  content: ''; position: absolute; left: -15px; top: 50%; transform: translateY(-50%);
  width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; border: 2px solid #fff;
}
body.dark .idh-tl-item { background: #131c31; border-color: #1f2a44; }
body.dark .idh-tl-item::before { background: #475569; border-color: #0f172a; }
.idh-link { cursor: pointer; text-decoration: none; color: inherit; }
.idh-tl-item.idh-link:hover, .idh-tl-item.idh-link:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.idh-tl-row { display: flex; align-items: center; gap: 8px; }
.idh-row-del { flex: 0 0 auto; padding: 3px 10px; font-size: 12px; }
.idh-row-del:hover { filter: brightness(0.95); }

/* ===== 实时网速 → 子菜单（网络优化） ===== */
.net-speed-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.ns-tab {
  padding: 7px 16px; border: 1px solid #e2e8f0; border-radius: 999px;
  background: #fff; color: #475569; font-size: 13px; font-weight: 600; cursor: pointer;
}
.ns-tab:hover { border-color: #cbd5e1; }
.ns-tab.active { background: #2563eb; border-color: #2563eb; color: #fff; }
body.dark .ns-tab { background: #0f172a; border-color: #1f2a44; color: #94a3b8; }
body.dark .ns-tab.active { background: #3b82f6; border-color: #3b82f6; color: #fff; }

.ns-opt-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ns-opt-summary {
  font-size: 13px; color: #475569; background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; line-height: 1.7;
}
.ns-opt-summary strong { color: #0f172a; }
body.dark .ns-opt-summary { background: #0f172a; border-color: #1f2a44; color: #94a3b8; }
body.dark .ns-opt-summary strong { color: #e2e8f0; }

.not-table { display: flex; flex-direction: column; gap: 6px; }
.not-row {
  display: grid; grid-template-columns: 1.1fr 0.7fr 0.7fr 0.9fr 0.9fr 1.1fr 1.1fr 0.8fr;
  gap: 8px; align-items: center; padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 10px;
  background: #fff; font-size: 13px;
}
.not-row.not-th { background: transparent; border: none; padding: 0 12px 2px; font-size: 12px; font-weight: 700; color: #64748b; }
.not-row[data-suffix] { cursor: pointer; transition: border-color .15s, background .15s; }
.not-row[data-suffix]:hover { border-color: #2563eb; background: #f5f8ff; }
body.dark .not-row { background: #0f172a; border-color: #1f2a44; }
body.dark .not-row.not-th { color: #94a3b8; }
body.dark .not-row[data-suffix]:hover { background: #131c31; border-color: #3b82f6; }
.not-sfx { font-weight: 700; color: #0f172a; }
.not-best { font-weight: 700; color: #16a34a; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; line-height: 1.25; }
.not-best-main { font-size: 13px; }
.not-tz-sub { font-size: 10px; font-weight: 600; color: #64748b; white-space: nowrap; }
body.dark .not-tz-sub { color: #94a3b8; }
.not-occ-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #fef2f2; color: #dc2626; font-weight: 700; font-size: 12px; }
body.dark .not-sfx { color: #e2e8f0; }
body.dark .not-occ-badge { background: #3f1d1d; color: #f87171; }
.up { color: #2563eb; }
.down { color: #16a34a; }

.ns-opt-detail { margin-top: 16px; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 16px; background: #fff; }
body.dark .ns-opt-detail { background: #0f172a; border-color: #1f2a44; }
.not-rec { font-size: 14px; color: #0f172a; margin-bottom: 10px; }
.not-rec strong { color: #16a34a; }
body.dark .not-rec { color: #e2e8f0; }
.not-ok { font-size: 13px; color: #16a34a; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 10px 12px; }
body.dark .not-ok { background: #0e2a17; border-color: #14532d; color: #4ade80; }
.not-warn { font-size: 13px; color: #b45309; margin: 0 0 10px; }
body.dark .not-warn { color: #fbbf24; }
.not-occ-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.not-occ-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 10px; border: 1px solid #fecaca; border-radius: 8px; background: #fff5f5; font-size: 13px;
}
body.dark .not-occ-item { background: #2a1414; border-color: #5b2020; }
.not-occ-name { font-weight: 700; color: #0f172a; }
.not-occ-ip { font-size: 11px; color: #64748b; }
body.dark .not-occ-name { color: #e2e8f0; }
body.dark .not-occ-ip { color: #94a3b8; }
.not-targets-label { font-size: 13px; color: #475569; margin: 0 0 8px; font-weight: 600; }
body.dark .not-targets-label { color: #94a3b8; }
.not-targets { display: flex; gap: 10px; flex-wrap: wrap; }
.not-target {
  flex: 1 1 140px; min-width: 130px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc;
  display: flex; flex-direction: column; gap: 3px;
}
.not-target.best { border-color: #16a34a; background: #f0fdf4; }
.not-target-sfx { font-weight: 700; color: #0f172a; }
body.dark .not-target { background: #131c31; border-color: #1f2a44; }
body.dark .not-target.best { background: #0e2a17; border-color: #16a34a; }
body.dark .not-target-sfx { color: #e2e8f0; }

@media (max-width: 640px) {
  .not-row { grid-template-columns: 1fr 0.8fr 0.8fr 1fr 1fr; }
  .not-row.not-th span:nth-child(6), .not-row.not-th span:nth-child(7), .not-row.not-th span:nth-child(8),
  .not-row[data-suffix] span:nth-child(6), .not-row[data-suffix] span:nth-child(7), .not-row[data-suffix] span:nth-child(8) { display: none; }
  .not-row[data-suffix]::after { content: '详情 ›'; color: #2563eb; font-size: 12px; font-weight: 600; justify-self: end; }
}

/* 设备名：英文（字母）段小 1px，数字段大 1px（fmtNameHtml 包裹），中文等保持原样 */
.dev-alpha { font-size: calc(1em - 1px); }
.dev-num { font-size: calc(1em + 1px); }

/* ===== 网络探针 / 故障报告 ===== */
.np-head, .fr-head { margin: 18px 0 12px; }
.np-head h2, .fr-head h2 { font-size: 20px; margin: 0 0 4px; }
.np-head p, .fr-head p { margin: 0; font-size: 13px; }
.np-card, .fr-block {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 14px 16px; margin-bottom: 14px;
}
.np-card-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: flex-start; }
.np-title { display: flex; flex-direction: column; }
.np-name { font-weight: 600; font-size: 15px; }
.np-sub { color: #64748b; font-size: 12px; }
.np-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 12px; color: #475569; }
.np-ip { font-family: ui-monospace, monospace; }
.np-mac { font-family: ui-monospace, monospace; background: #eef2ff; color: #4338ca; padding: 1px 8px; border-radius: 6px; }
.np-ver { font-family: ui-monospace, monospace; color: #64748b; }
.np-badge { padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.np-badge.ok { background: #dcfce7; color: #16a34a; }
.np-badge.fault { background: #fee2e2; color: #dc2626; }
.np-switch { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.np-targets { margin-top: 12px; }
.np-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.np-tbl th { text-align: left; color: #64748b; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid #e2e8f0; }
.np-tbl td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.np-tbl input { width: 100%; max-width: 160px; padding: 4px 6px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; }
.np-tg-addr { font-family: ui-monospace, monospace; word-break: break-all; }
.np-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.np-add input { padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; }
.np-add .np-add-target { min-width: 220px; }
.np-add .np-add-label { min-width: 120px; }
.np-add .np-add-int, .np-add .np-add-to { width: 90px; }
.np-count { font-size: 12px; }
.np-warn { color: #dc2626; font-size: 12px; margin: 6px 0 0; }
.np-empty { padding: 24px; text-align: center; color: #64748b; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 12px; }
.np-badge.pending { background: #fef3c7; color: #b45309; }
.kuma-sec-title { margin: 18px 0 8px; font-size: 15px; }
.kuma-add-card { margin-top: 8px; }
.kuma-add select, .kuma-tbl select { padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; background: #fff; color: inherit; }
.kuma-tbl .km-host { font-family: ui-monospace, monospace; font-size: 12px; }
.kuma-tbl .km-active { width: auto; }
body.dark .kuma-add select, body.dark .kuma-tbl select { background: #0b1220; border-color: #223041; }
.fr-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .fr-settings { grid-template-columns: 1fr; } }
.fr-block h3 { margin: 0 0 10px; font-size: 15px; }
.fr-thresh-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.fr-thresh-row label { display: flex; flex-direction: column; font-size: 12px; color: #475569; gap: 4px; }
.fr-thresh-row input { padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; width: 110px; }
.fr-key-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.fr-key-add input, .fr-key-add select { padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; }
.fr-key-add #fr-k-name { min-width: 110px; }
.fr-key-add #fr-k-sc, .fr-key-add #fr-k-tg-token { min-width: 180px; }
.fr-toolbar { display: flex; gap: 12px; align-items: center; margin: 14px 0 8px; font-size: 13px; }
.fr-tbl td { font-size: 13px; }
.ok { color: #16a34a; font-weight: 600; }
.fault { color: #dc2626; font-weight: 600; }
.btn-mini { padding: 4px 10px; font-size: 12px; border: 1px solid #cbd5e1; background: #f1f5f9; border-radius: 6px; cursor: pointer; }
.btn-mini.danger { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.btn-mini:disabled { opacity: .5; cursor: not-allowed; }

body.dark .np-card, body.dark .fr-block { background: #0f172a; border-color: #223041; }
body.dark .np-tbl th { color: #8ea0b8; border-bottom-color: #223041; }
body.dark .np-tbl td { border-bottom-color: #1e293b; }
body.dark .np-tbl input, body.dark .np-add input, body.dark .fr-thresh-row input,
body.dark .fr-key-add input, body.dark .fr-key-add select, body.dark .btn-mini {
  background: #0b1220; border-color: #283548; color: #e2e8f0;
}
body.dark .np-badge.ok { background: #14361f; color: #4ade80; }
body.dark .np-badge.fault { background: #3a1414; color: #f87171; }
body.dark .np-empty { background: #0b1220; border-color: #223041; color: #8ea0b8; }
body.dark .btn-mini { background: #1e293b; border-color: #334155; color: #e2e8f0; }
body.dark .btn-mini.danger { color: #f87171; border-color: #7f1d1d; background: #2a1414; }

/* ── 副本专用：从生产 VPS 拉 24h 增量（生产环境无接口 → 按钮隐藏） ── */
.sync-pull-btn { margin-left: 2px; }
.sync-pull-btn.spinning svg { animation: spb-spin .9s linear infinite; }
.sync-hud {
  position: fixed; right: 16px; bottom: 16px; z-index: 9999;
  width: 268px; max-width: calc(100vw - 32px);
  padding: 10px 12px 12px; border-radius: 12px;
  background: #fff; border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
  font-size: 12px; color: #0f172a;
  transition: opacity .5s ease;
}
body.dark .sync-hud {
  background: #0f172a; border-color: #1e293b; color: #e2e8f0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.sync-hud-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sync-hud-title { font-weight: 600; font-size: 12.5px; }
.sync-hud-x {
  border: 0; background: transparent; color: #94a3b8;
  font-size: 17px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.sync-hud-x:hover { color: #6366f1; }
.sync-hud-msg { color: #475569; line-height: 1.5; word-break: break-word; }
body.dark .sync-hud-msg { color: #94a3b8; }
.sync-hud-bar {
  margin-top: 8px; height: 4px; border-radius: 3px;
  background: #e2e8f0; overflow: hidden;
}
body.dark .sync-hud-bar { background: #1e293b; }
.sync-hud-bar > i {
  display: block; height: 100%; width: 2%; border-radius: 3px;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  transition: width .4s ease;
}
.sync-hud-ok .sync-hud-bar > i { background: linear-gradient(90deg, #22c55e, #14b8a6); }
.sync-hud-ok .sync-hud-title { color: #16a34a; }
.sync-hud-err .sync-hud-bar > i { background: #ef4444; }
.sync-hud-err .sync-hud-title { color: #dc2626; }
.sync-hud-fade { opacity: 0; pointer-events: none; }

/* ── 实时网速：预备开播 / 按账号分组的直播时段（11-13） ── */
.ns-live-badge {
  display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 999px;
  background: #dc2626; color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .5px;
  vertical-align: 1px; line-height: 1.5;
  animation: nsLivePulse 2s ease-in-out infinite;
}
@keyframes nsLivePulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.ns-prep-badge {
  display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 999px;
  background: rgba(245, 158, 11, .15); color: #b45309; border: 1px solid rgba(245, 158, 11, .4);
  font-size: 10px; font-weight: 700; vertical-align: 1px; white-space: nowrap;
}
body.dark .ns-prep-badge { background: rgba(245, 158, 11, .12); color: #fbbf24; border-color: rgba(245, 158, 11, .35); }
.ns-live-lines {
  grid-column: 1 / -1;
  margin-top: 2px; padding-top: 4px; border-top: 1px dashed #e2e8f0;
  display: flex; flex-direction: column; gap: 3px;
}
body.dark .ns-live-lines { border-top-color: #26324a; }
.ns-live-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 11px; }
.ns-live-acc { color: #7c3aed; font-weight: 700; font-size: 10.5px; white-space: nowrap; }
.ns-live-acc-unk { color: #94a3b8; font-weight: 600; }
body.dark .ns-live-acc { color: #c4b5fd; }
.ns-live-segs { display: flex; flex-wrap: wrap; gap: 4px; }
.ns-live-seg {
  padding: 1px 6px; border-radius: 7px; background: rgba(148, 163, 184, .14);
  color: #475569; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 10.5px;
}
.ns-live-seg.on { background: rgba(220, 38, 38, .12); color: #dc2626; font-weight: 700; }
body.dark .ns-live-seg { background: rgba(51, 65, 85, .55); color: #94a3b8; }
body.dark .ns-live-seg.on { background: rgba(220, 38, 38, .2); color: #f87171; }

/* ── 设备卡片性能页签：采集模式切换按钮 ── */
#mp-mode.mp-always {
  color: #b45309; border-color: rgba(245, 158, 11, .5); background: rgba(245, 158, 11, .08);
}
body.dark #mp-mode.mp-always { color: #fbbf24; border-color: rgba(245, 158, 11, .4); background: rgba(245, 158, 11, .1); }

/* ── IP 跳动通知（电脑端右侧铃铛，移动端隐藏） ── */
.ip-bell-dot {
  position: absolute; top: 4px; right: 4px; width: 9px; height: 9px;
  border-radius: 50%; background: #ef4444; border: 2px solid #fff;
  animation: ipDotPulse 1.6s ease-in-out infinite;
}
body.dark .ip-bell-dot { border-color: #0f172a; }
@keyframes ipDotPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
#ip-bell {
  position: fixed; right: 10px; top: 50%; transform: translateY(-50%);
  z-index: 9000; width: 38px; height: 38px; border-radius: 50%;
  background: #fff; border: 1px solid #e2e8f0; color: #475569;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .12);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: color .2s, border-color .2s, background .2s;
}
#ip-bell:hover { color: #6366f1; border-color: #c7d2fe; }
#ip-bell.open { color: #6366f1; background: #eef2ff; border-color: #c7d2fe; }
body.dark #ip-bell { background: #0f172a; border-color: #26324a; color: #94a3b8; }
body.dark #ip-bell:hover, body.dark #ip-bell.open { color: #a5b4fc; background: #1e293b; border-color: #3b4d6b; }
#ip-bell-panel {
  position: fixed; right: 56px; top: 50%; transform: translateY(-50%);
  z-index: 9000; width: 300px; max-width: calc(100vw - 80px);
  max-height: 60vh; overflow-y: auto;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, .18);
  padding: 12px 14px;
}
body.dark #ip-bell-panel { background: #0f172a; border-color: #26324a; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.ip-bell-head { margin-bottom: 8px; display: flex; flex-direction: column; gap: 2px; }
.ip-bell-title { font-weight: 700; font-size: 13.5px; color: #0f172a; }
body.dark .ip-bell-title { color: #e2e8f0; }
.ip-bell-sub { font-size: 10.5px; color: #94a3b8; }
.ip-bell-item {
  padding: 7px 8px; border-radius: 9px; background: rgba(148, 163, 184, .1);
  margin-bottom: 6px;
}
.ip-bell-row1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ip-bell-name { font-size: 12px; font-weight: 700; color: #334155; word-break: break-all; }
body.dark .ip-bell-name { color: #cbd5e1; }
.ip-bell-time { font-size: 10px; color: #94a3b8; white-space: nowrap; }
.ip-bell-ips {
  margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-variant-numeric: tabular-nums; font-size: 11.5px;
}
.ip-bell-ips .ip-old { color: #94a3b8; text-decoration: line-through; word-break: break-all; }
.ip-bell-ips .ip-arrow { color: #f59e0b; font-weight: 700; }
.ip-bell-ips .ip-new { color: #dc2626; font-weight: 700; word-break: break-all; }
body.dark .ip-bell-ips .ip-old { color: #64748b; }
body.dark .ip-bell-ips .ip-new { color: #f87171; }
@media (max-width: 900px) {
  #ip-bell { display: none !important; }
  #ip-bell-panel { right: 12px; }
}

/* ── 手机端：System Status 标题在半小时内有 IP 变动时替换为提示（点击看明细） ── */
.ip-hero-alert {
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-align: left;
  color: #dc2626; display: inline-flex; align-items: center; gap: 9px;
}
.ip-hero-dot {
  width: 11px; height: 11px; border-radius: 50%; background: #ef4444;
  animation: ipDotPulse 1.6s ease-in-out infinite; flex: none;
}


/* ── IP 跳动通知：分组设置 ── */
.ip-bell-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#ip-bell-gear {
  border: 0; background: transparent; color: #94a3b8; cursor: pointer;
  padding: 3px; border-radius: 6px; display: flex; align-items: center;
}
#ip-bell-gear:hover { color: #6366f1; background: rgba(99, 102, 241, .1); }
#ip-bell-settings {
  margin: 8px 0; padding: 9px 10px; border-radius: 9px;
  background: rgba(99, 102, 241, .06); border: 1px solid rgba(99, 102, 241, .18);
}
body.dark #ip-bell-settings { background: rgba(99, 102, 241, .08); border-color: rgba(99, 102, 241, .25); }
.ip-bell-set-title { font-size: 11.5px; font-weight: 700; color: #4f46e5; margin-bottom: 6px; }
body.dark .ip-bell-set-title { color: #a5b4fc; }
#ip-bell-group-list { display: flex; flex-wrap: wrap; gap: 5px 12px; }
.ip-bell-group-item {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  font-size: 12px; color: #334155; user-select: none;
}
.ip-bell-group-item input { accent-color: #6366f1; margin: 0; }
body.dark .ip-bell-group-item { color: #cbd5e1; }
.ip-bell-set-hint { margin-top: 6px; font-size: 10.5px; color: #94a3b8; line-height: 1.5; }
.ip-bell-filter-tip {
  font-size: 10.5px; color: #4f46e5; background: rgba(99, 102, 241, .08);
  border-radius: 7px; padding: 3px 8px; margin-bottom: 7px;
}
body.dark .ip-bell-filter-tip { color: #a5b4fc; }

/* ── IP 通知面板：半小时分界线 ── */
.ip-bell-sep {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 0 7px; font-size: 10.5px; font-weight: 700; color: #dc2626;
}
.ip-bell-sep::after { content: ""; flex: 1; height: 1px; background: rgba(220, 38, 38, .25); }
.ip-bell-sep-old { color: #94a3b8; }
.ip-bell-sep-old::after { background: #e2e8f0; }
body.dark .ip-bell-sep-old { color: #64748b; }
body.dark .ip-bell-sep-old::after { background: #26324a; }
