:root {
  --bg:#0f1419; --panel:#171e26; --line:#26313c; --fg:#dbe4ec; --muted:#8394a3;
  --accent:#3bea6b; --accent2:#4aa8ff; --danger:#ff6b6b;
}
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--fg);
  font:14px/1.5 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
.topbar { display:flex; justify-content:space-between; align-items:center;
  padding:10px 16px; background:var(--panel); border-bottom:1px solid var(--line); }
.brand { font-weight:700; font-size:16px; letter-spacing:.5px; }
.topright { display:flex; align-items:center; gap:10px; }
.dot { display:inline-block; width:10px; height:10px; border-radius:50%; }
.dot.on { background:var(--accent); box-shadow:0 0 6px var(--accent); }
.dot.off { background:var(--danger); }
#main { display:flex; gap:16px; padding:16px; align-items:flex-start; flex-wrap:wrap; }
.panel { background:var(--panel); border:1px solid var(--line); border-radius:8px;
  min-width:340px; flex:1 1 360px; }
.panel.detail { flex:2 1 640px; }
.panel-head { display:flex; justify-content:space-between; align-items:center;
  padding:10px 14px; border-bottom:1px solid var(--line); font-weight:600; }
.host-list { padding:8px; }
.empty { color:var(--muted); padding:20px; text-align:center; }
.host-row { padding:10px; border:1px solid var(--line); border-radius:6px; margin-bottom:8px; cursor:pointer; }
.host-row:hover { border-color:var(--accent2); }
.host-row.sel { border-color:var(--accent); background:#1b2631; }
.hr-main { display:flex; gap:14px; align-items:center; flex-wrap:wrap; }
.hr-name { font-weight:700; font-size:15px; }
.hr-ip { color:var(--accent2); }
.hr-os { color:var(--muted); }
.hr-sub { display:flex; gap:14px; flex-wrap:wrap; color:var(--muted); margin-top:6px; font-size:12.5px; }
.hr-last { margin-left:auto; }
.btn { background:var(--accent2); color:#04121f; border:none; border-radius:5px;
  padding:7px 14px; cursor:pointer; font-weight:600; }
.btn:hover { filter:brightness(1.1); }
.btn.small { padding:4px 10px; font-size:12.5px; }
.btn.tiny { padding:2px 8px; font-size:11.5px; margin-right:4px; }
.btn.ghost { background:transparent; color:var(--fg); border:1px solid var(--line); }
.toolbar { display:flex; flex-wrap:wrap; gap:8px; padding:12px 14px; }
.detail-out { margin:0; padding:14px; min-height:200px; white-space:pre-wrap;
  word-break:break-word; background:#0b0f14; border-top:1px solid var(--line); }
.hidden { display:none !important; }
.data-table { width:100%; border-collapse:collapse; background:#0b0f14; }
.data-table th, .data-table td { border:1px solid var(--line); padding:5px 8px; text-align:left;
  font-size:12.5px; }
.data-table th { background:var(--panel); position:sticky; top:0; }
.td-actions { white-space:nowrap; }
/* modal */
.modal { position:fixed; inset:0; background:rgba(0,0,0,.6); display:flex;
  align-items:center; justify-content:center; z-index:50; }
.modal-box { background:var(--panel); border:1px solid var(--line); border-radius:8px;
  padding:22px; width:300px; }
.modal-box h3 { margin-top:0; }
.modal-box label { display:block; margin-bottom:10px; }
.modal-box input { width:100%; margin-top:4px; padding:7px; background:#0b0f14;
  border:1px solid var(--line); color:var(--fg); border-radius:5px; }
.modal-actions { display:flex; gap:8px; margin-top:14px; }
.err { color:var(--danger); margin-top:8px; }
/* toast */
.toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%);
  padding:10px 18px; border-radius:6px; z-index:60; background:var(--panel);
  border:1px solid var(--line); }
.toast.ok { border-color:var(--accent); color:var(--accent); }
.toast.err { border-color:var(--danger); color:var(--danger); }
/* shell */
.shell-wrap { background:#0b0f14; border-top:1px solid var(--line); }
.shell-screen { min-height:300px; max-height:60vh; overflow:auto; margin:0; padding:12px;
  font-family:Consolas, Menlo, monospace; font-size:13px; white-space:pre-wrap; }
.shell-input-row { display:flex; gap:6px; padding:8px 12px; border-top:1px solid var(--line); }
.shell-input { flex:1; padding:7px; background:#0b0f14; border:1px solid var(--line);
  color:var(--fg); border-radius:5px; }
/* file manager */
.fm-head { padding:12px 14px; border-top:1px solid var(--line); }
.fm-link { color:var(--accent2); margin-right:10px; text-decoration:none; }
.fm-link:hover { text-decoration:underline; }
.fm-box { padding:0 14px 14px; }
.fm-path { color:var(--accent); margin-bottom:8px; font-weight:600; }

/* ===================== 多窗口 + 任务栏 ===================== */
#main { flex-wrap:nowrap; }
#side { flex:0 0 340px; min-width:300px; max-width:380px; align-self:stretch; }
#side .host-list { overflow:auto; max-height:calc(100vh - 140px); }
#workspace { flex:1 1 auto; display:flex; flex-direction:column; min-width:0;
  height:calc(100vh - 132px); }
#hostToolbar { padding:10px 12px; background:var(--panel); border:1px solid var(--line);
  border-radius:8px; margin-bottom:10px; }
#hostToolbar .tb-host { font-weight:700; margin-right:auto; color:var(--accent); }
#desktop-area { flex:1; position:relative; overflow:hidden; background:#0a0e13;
  border:1px solid var(--line); border-radius:8px; }
#desktop { position:absolute; inset:0; }
#desktopHint { margin:30px auto; max-width:400px; }

.window { position:absolute; background:var(--panel); border:1px solid var(--line);
  border-radius:6px; box-shadow:0 8px 28px rgba(0,0,0,.45);
  display:flex; flex-direction:column; min-width:340px; min-height:220px; }
.window-titlebar { display:flex; align-items:center; gap:8px; padding:6px 10px;
  background:#1b2631; border-bottom:1px solid var(--line); cursor:default;
  user-select:none; }
.wt-icon { font-size:13px; }
.wt-title { flex:1; font-weight:600; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wt-btns { display:flex; gap:4px; }
.wt-btn { background:transparent; border:none; color:var(--fg); cursor:pointer;
  padding:2px 7px; border-radius:3px; font-size:12px; line-height:1; }
.wt-btn:hover { background:#26313c; }
.wt-btn.close:hover { background:var(--danger); color:#fff; }
.window-content { flex:1; overflow:auto; display:flex; flex-direction:column; }
.window-content.nopad { padding:0; }
.detail-out { margin:0; padding:14px; flex:1; white-space:pre-wrap; overflow:auto; }

#taskbar { position:fixed; left:0; right:0; bottom:0; height:44px; z-index:1000;
  background:var(--panel); border-top:1px solid var(--line);
  display:flex; align-items:center; padding:0 10px; gap:6px; }
#taskbar-items { display:flex; gap:6px; flex-wrap:nowrap; overflow-x:auto; align-items:center; }
.taskbar-item { display:flex; align-items:center; gap:6px; padding:5px 10px; border-radius:5px;
  cursor:pointer; color:var(--muted); font-size:12.5px; white-space:nowrap;
  border:1px solid transparent; max-width:200px; }
.taskbar-item:hover { background:#1b2631; }
.taskbar-item.active { background:var(--accent2); color:#04121f; font-weight:600; }
.taskbar-item .t-name { overflow:hidden; text-overflow:ellipsis; }
.taskbar-item .t-close { margin-left:4px; opacity:.55; padding:0 2px; }
.taskbar-item .t-close:hover { opacity:1; }

body { padding-bottom:48px; }

/* ===================== 窗口拖动 + 缩放 ===================== */
.window-titlebar { cursor:move; }
.window-titlebar.dragging { cursor:grabbing; user-select:none; }
.win-resize { position:absolute; z-index:5; }
.win-resize.rse { right:0; bottom:0; width:14px; height:14px; cursor:nwse-resize; }
.win-resize.rsw { left:0; bottom:0; width:14px; height:14px; cursor:nesw-resize; }
.win-resize.rne { right:0; top:0; width:14px; height:14px; cursor:nesw-resize; }
.win-resize.rnw { left:0; top:0; width:14px; height:14px; cursor:nwse-resize; }
.win-resize.re { right:-2px; top:14px; bottom:14px; width:7px; cursor:ew-resize; }
.win-resize.rw { left:-2px; top:14px; bottom:14px; width:7px; cursor:ew-resize; }
.win-resize.rs { left:14px; right:14px; bottom:-2px; height:7px; cursor:ns-resize; }
.win-resize.rn { left:14px; right:14px; top:-2px; height:7px; cursor:ns-resize; }
.win-resize.rse::after { content:""; position:absolute; right:2px; bottom:2px; width:8px; height:8px;
  border-right:2px solid var(--muted); border-bottom:2px solid var(--muted); opacity:.4; }
.window.max .win-resize { display:none; }
.window.max .window-titlebar { cursor:default; }

/* ===================== Android RMM 扩展 ===================== */
.brand-sub { font-size:11px; color:var(--muted); font-weight:400; margin-left:6px; }
.root-badge { display:inline-block; padding:0 6px; border-radius:8px; font-size:10.5px;
  background:#3a2b12; color:#ffb84d; border:1px solid #6b4e1d; margin-left:6px; }
.noroot-badge { display:inline-block; padding:0 6px; border-radius:8px; font-size:10.5px;
  background:#1a2530; color:var(--muted); border:1px solid var(--line); margin-left:6px; }
.hdel { float:right; color:var(--danger); cursor:pointer; opacity:.5; font-size:11px; }
.hdel:hover { opacity:1; }

/* 远程桌面 */
.screen-wrap { flex:1; display:flex; flex-direction:column; background:#000; min-height:0; }
.screen-video-box { flex:1; display:flex; align-items:center; justify-content:center; min-height:0; overflow:hidden; }
.screen-video-box video { max-width:100%; max-height:100%; background:#000; outline:none; }
.screen-video-box.ctl video { cursor:crosshair; }
.screen-toolbar { display:flex; flex-wrap:wrap; gap:6px; align-items:center;
  padding:8px 10px; border-top:1px solid var(--line); background:var(--panel); }
.screen-toolbar select, .screen-toolbar input[type=text] {
  background:#0b0f14; color:var(--fg); border:1px solid var(--line); border-radius:4px; padding:3px 6px; }
.screen-status { color:var(--muted); font-size:11.5px; margin-left:auto; }
.btn.tgl-on { background:var(--accent); }
.btn.warn { background:#ffb84d; }

/* 按键记录 */
.kl-toolbar { display:flex; gap:8px; padding:10px 12px; border-bottom:1px solid var(--line); align-items:center; }
.kl-count { color:var(--muted); font-size:12px; margin-left:auto; }
.kl-scroll { flex:1; overflow:auto; }
.kl-ev { color:var(--accent2); font-weight:600; }
.kl-app { color:#c792ea; }

/* APP 管理 */
.app-toolbar { display:flex; gap:8px; padding:10px 12px; border-bottom:1px solid var(--line); align-items:center; }
.app-toolbar input[type=text] { flex:1; background:#0b0f14; border:1px solid var(--line);
  color:var(--fg); border-radius:5px; padding:6px 9px; }
.app-label { font-weight:600; }
.app-pkg { color:var(--muted); font-size:11.5px; font-family:Consolas,monospace; }
.app-sys { color:var(--muted); font-size:10.5px; border:1px solid var(--line); border-radius:6px; padding:0 5px; }

/* 文件管理扩展 */
.fm-upload { display:none; }