/* 群控控制台 · 手机优先的深色监控风格 */
:root {
  --bg: #0f1621;
  --panel: #18212f;
  --panel2: #1e2939;
  --line: #263449;
  --text: #e6edf7;
  --muted: #8fa3bf;
  --blue: #3b82f6;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; }

/* 顶部栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: rgba(15, 22, 33, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex: none;
}
.topbar .title { font-weight: 600; font-size: 15px; }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: 12px; }
.topbar .out { color: var(--muted); font-size: 13px; padding: 4px 8px; }

/* 底部导航（手机） */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; border-top: 1px solid var(--line);
  background: rgba(24, 33, 47, .97); backdrop-filter: blur(10px);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; text-align: center; padding: 10px 4px 12px;
  color: var(--muted); font-size: 12px;
}
.tabbar a.on { color: var(--blue); }
.tabbar .ico { display: block; font-size: 16px; line-height: 1.2; }

/* 容器 */
.wrap { padding: 14px; max-width: 1280px; margin: 0 auto; }
.wrap.mini { padding-bottom: 76px; }

/* 卡片 */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.card .hd {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.card .hd h3 { font-size: 14px; }
.card .hd .right { margin-left: auto; }

/* 设备卡 */
.machine { position: relative; }
.machine .name { font-size: 16px; font-weight: 600; }
.machine .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.dot.on { background: var(--green); }
.dot.off { background: #64748b; }

/* 实例行 */
.inst {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--line);
}
.inst:first-of-type { border-top: 0; }
.inst .idx {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--panel2); color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.inst .body { flex: 1; min-width: 0; }
.inst .l1 { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inst .l2 { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inst .acts { display: flex; gap: 6px; flex: none; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 12px; border-radius: 9px; font-size: 13px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger  { background: transparent; border-color: #7f2b2b; color: #f87171; }
.btn.small   { padding: 5px 9px; font-size: 12px; border-radius: 8px; }
.btn.ghost   { background: transparent; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* 表单 */
input[type=text], input[type=password], select {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  background: #0d141d; border: 1px solid var(--line); color: var(--text);
  font-size: 15px; outline: none;
}
input:focus, select:focus { border-color: var(--blue); }
label.fld { display: block; margin: 10px 0 6px; color: var(--muted); font-size: 12px; }

/* 徽章 */
.badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; border: 1px solid transparent;
}
.badge.ok    { background: rgba(34,197,94,.14);  color: #4ade80; border-color: rgba(34,197,94,.3); }
.badge.warn  { background: rgba(245,158,11,.14); color: #fbbf24; border-color: rgba(245,158,11,.3); }
.badge.bad   { background: rgba(239,68,68,.14);  color: #f87171; border-color: rgba(239,68,68,.3); }
.badge.mute  { background: rgba(148,163,184,.12);color: #94a3b8; border-color: rgba(148,163,184,.25); }

/* 截图 */
.shot {
  width: 100%; border-radius: 10px; border: 1px solid var(--line);
  background: #0b1119; display: block; aspect-ratio: 16/9; object-fit: contain;
}

/* 大屏网格 */
.wall {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tile .cap { padding: 8px 10px; display: flex; align-items: center; gap: 8px; }
.tile .cap .t { font-size: 13px; font-weight: 600; }
.tile .cap .s { margin-left: auto; font-size: 11px; color: var(--muted); }
.tile .pic { position: relative; background: #0b1119; }
.tile .pic img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: contain; }
.tile .pic .none {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #4b5c74; font-size: 12px;
}

/* 日志表 */
.logs { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.logs th, .logs td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.logs th { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.logs td.dim { color: var(--muted); }
.logs .act { color: var(--blue); }

/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: #1f2a3a; border: 1px solid var(--line); color: var(--text);
  padding: 9px 16px; border-radius: 999px; font-size: 13px; z-index: 60;
  opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 86vw;
}
.toast.show { opacity: 1; }

.empty { color: var(--muted); text-align: center; padding: 26px 10px; font-size: 13px; }

/* 桌面端放宽 */
@media (min-width: 760px) {
  .tabbar { display: none; }
  .wrap.mini { padding-bottom: 14px; }
  .toast { bottom: 24px; }
}

/* 窄屏：收紧留白、隐藏用户名，避免横向溢出 */
@media (max-width: 480px) {
  .topbar .uname { display: none; }
  .topbar .title { font-size: 14px; }
  .wrap { padding: 10px; }
  .card { padding: 12px; }
  .btn { padding: 6px 10px; }
  .btn.small { padding: 5px 8px; font-size: 12px; }
  .card .hd h3 { font-size: 13px; }
}
