:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel2: #1e222e;
  --line: #262b38;
  --text: #e6e9f0;
  --muted: #8b93a7;
  --accent: #4f6df5;
  --ok: #22c55e;
  --bad: #ef4444;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.topbar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 8px; }
.brand strong { font-size: 14px; letter-spacing: .5px; }
.brand .sub { color: var(--muted); font-size: 12px; }

.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(239,68,68,.15);
  transition: .2s;
}
.dot.on {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}

.login { display: flex; gap: 8px; }
.login input {
  width: 210px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  outline: none;
}
.login input:focus { border-color: var(--accent); }

button {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  transition: .15s;
}
button:hover { border-color: var(--accent); color: #fff; }
button:active { transform: translateY(1px); }
button.mini { padding: 5px 10px; font-size: 12px; }

.layout {
  display: flex;
  height: calc(100% - 52px);
}

.sidebar {
  width: 300px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.devices {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 260px;
  overflow: auto;
}
.devices li {
  padding: 9px 11px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 4px;
}
.devices li:hover { background: var(--panel2); }
.devices li.active {
  background: rgba(79,109,245,.14);
  border-color: var(--accent);
}
.devices .name { font-weight: 600; }
.devices .meta { color: var(--muted); font-size: 11px; }
.devices .empty { color: var(--muted); padding: 12px; }

.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.log {
  margin: 0;
  padding: 10px 12px;
  font: 11px/1.5 ui-monospace, Consolas, monospace;
  color: #9ae6b4;
  background: #0b0d12;
  flex: 1;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background:
    radial-gradient(800px 400px at 50% 0%, rgba(79,109,245,.08), transparent),
    var(--bg);
}

.screen-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  border: 1px solid var(--line);
  background: #000;
}

#screen {
  display: block;
  max-height: calc(100vh - 160px);
  width: auto;
  cursor: crosshair;
  touch-action: none;
}

.hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  background: rgba(0,0,0,.55);
  pointer-events: none;
}

.statusbar {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
}
