:root {
  --bg: #111318;
  --panel: #1b1e26;
  --line: #2a2f3a;
  --fg: #e7e9ee;
  --dim: #8b93a3;
  --accent: #4f8cff;
  --ok: #35c46b;
  --warn: #ffb020;
  --bad: #ff5d5d;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 -apple-system, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  overscroll-behavior: none;
}

.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 120% at 50% 0%, #1c2230 0%, var(--bg) 60%);
  padding: 20px;
}

.login form {
  width: min(360px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login h1 { margin: 0; font-size: 20px; }
.login .sub { margin: -6px 0 6px; color: var(--dim); font-size: 13px; }
.login .foot { margin: 4px 0 0; color: var(--dim); font-size: 12px; text-align: center; }

.login input {
  background: #12151c;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--fg);
  font-size: 16px;
  padding: 12px 13px;
  outline: none;
  letter-spacing: 0.06em;
}

.login input:focus { border-color: var(--accent); }

.login button {
  background: var(--accent);
  border: 0;
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  padding: 12px;
}

.login button:hover { filter: brightness(1.08); }

.err { color: var(--bad); min-height: 18px; margin: 0; font-size: 13px; }

/* ---------- 主界面 ---------- */
.app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.foot-bar { border-bottom: 0; border-top: 1px solid var(--line); }

.spacer { flex: 1; }

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dim);
  flex: 0 0 auto;
}

.dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(53, 196, 107, .7); }
.dot.off { background: var(--bad); }
.dot.wait { background: var(--warn); animation: pulse 1s infinite; }

@keyframes pulse { 50% { opacity: .3; } }

.name { font-weight: 600; }
.meta { color: var(--dim); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }

.icon-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--fg);
  cursor: pointer;
  font-size: 16px;
  height: 30px;
  width: 34px;
}

.icon-btn:hover { background: #262b36; }

select {
  background: #12151c;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--fg);
  padding: 3px 5px;
  font-size: 12px;
}

/* ---------- UAC 横幅 ---------- */
.uac-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(90deg, #4a2c05, #2a1c08);
  border-bottom: 1px solid #7a4c12;
  flex: 0 0 auto;
  animation: flash 1.2s ease-in-out infinite;
}

@keyframes flash { 50% { background: linear-gradient(90deg, #5d3807, #33220a); } }

.uac-icon { color: var(--warn); font-size: 16px; }
.uac-banner span:not(.uac-icon) { font-weight: 600; flex: 1; }

.uac-banner button {
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
}

.allow { background: var(--ok); color: #06210f; }
.deny { background: #3a3f4b; color: var(--fg); }

/* ---------- 画面 ---------- */
.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #05070b;
  display: grid;
  place-items: center;
  overflow: hidden;
}

#screen {
  max-width: 100%;
  max-height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  image-rendering: auto;
}

.placeholder {
  position: absolute;
  color: var(--dim);
  font-size: 13px;
  pointer-events: none;
}

@media (max-width: 640px) {
  .foot-bar .meta:first-child { display: none; }
}
