:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-2: #f7faff;
  --text: #172033;
  --muted: #607089;
  --line: #dbe4ef;
  --accent: #2f80ed;
  --danger: #ef4444;
  --ok: #22c55e;
  --orange: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
.button {
  border: 1px solid #cfd9e6;
  border-radius: 5px;
  padding: 8px 12px;
  background: #fff;
  color: #1d2b43;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  border-color: #9bb7da;
  background: #f6faff;
}

button.secondary,
.button.secondary {
  background: #f8fbff;
}

input,
select {
  border: 1px solid #cfd9e6;
  border-radius: 5px;
  padding: 7px 9px;
  background: #fff;
  color: var(--text);
  min-width: 0;
}

label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #1f2d43;
  font-size: 13px;
  white-space: nowrap;
}

h1,
h2,
p {
  margin-top: 0;
}

p,
.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.center-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.home,
.auth-card {
  width: min(560px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 12px 34px rgba(28, 48, 84, .08);
}

.auth-grid,
.actions,
.row,
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.status {
  min-height: 22px;
  color: var(--muted);
}

.status.ok {
  color: var(--ok);
}

.status.bad {
  color: var(--danger);
}

.desktop-login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #eef3f8;
}

.desktop-login-card {
  width: min(900px, calc(100vw - 28px));
  height: min(600px, calc(100vh - 28px));
  min-height: 520px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
}

.login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 54px;
}

.login-form-panel h2 {
  margin: 0 0 30px;
  color: #0f172a;
  font-size: 30px;
}

.login-input {
  height: 48px;
  width: 100%;
  display: grid;
  grid-template-columns: 26px 1fr 30px;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 13px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  color: #9aa4b2;
  background: #fff;
}

.login-input input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
}

.login-input button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #9aa4b2;
}

.remember-row {
  justify-content: flex-start;
  margin: 0 0 20px;
  color: #4b5563;
  font-size: 14px;
}

.remember-row input {
  width: 18px;
  height: 18px;
  accent-color: #3b82f6;
}

.login-primary {
  height: 45px;
  border: 0;
  border-radius: 7px;
  background: #3b82f6;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.32);
}

.login-link,
.theme-link {
  align-self: center;
  border: 0;
  background: transparent;
  color: #3b82f6;
  margin-top: 12px;
  padding: 2px 6px;
}

.theme-link {
  color: #374151;
}

.login-art-panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 56% 18%, rgba(255,255,255,.38) 0 2px, transparent 3px),
    linear-gradient(155deg, #3b82f6 0%, #1ea7e1 45%, #08b6ce 100%);
}

.login-art-panel::before,
.login-art-panel::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  filter: blur(1px);
}

.login-art-panel::before {
  width: 420px;
  height: 420px;
  right: -150px;
  top: -90px;
}

.login-art-panel::after {
  width: 320px;
  height: 320px;
  left: 30px;
  bottom: -120px;
}

.login-close {
  position: absolute;
  z-index: 2;
  right: 30px;
  top: 30px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.spark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
}

.spark.s1 { left: 12%; top: 14%; }
.spark.s2 { left: 24%; top: 26%; }
.spark.s3 { left: 66%; top: 23%; }
.spark.s4 { left: 82%; top: 74%; }
.spark.s5 { left: 36%; top: 68%; width: 8px; height: 8px; }
.spark.s6 { left: 54%; top: 52%; width: 3px; height: 3px; }

.version-row {
  position: absolute;
  right: 32px;
  bottom: 30px;
  display: flex;
  gap: 10px;
}

.version-row span {
  padding: 12px 18px;
  border-radius: 8px;
  background: rgba(8, 92, 126, 0.72);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
}

.login-dark .desktop-login-page {
  background: #0f172a;
}

.login-dark .desktop-login-card,
.login-dark .login-form-panel {
  background: #111827;
}

.login-dark .login-form-panel h2,
.login-dark .theme-link {
  color: #e5eefb;
}

.login-dark .login-input {
  border-color: #334155;
  background: #182235;
}

.login-dark .login-input input {
  color: #e5eefb;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

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

.topbar h1 {
  font-size: 18px;
  margin: 0;
}

.panel {
  min-width: 0;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.phone-main {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 14px;
  padding: 14px;
}

.phone-controls {
  padding: 14px;
}

.video-wrap {
  display: grid;
  place-items: center;
  min-height: 360px;
  background: #05070a;
}

.video-wrap video,
.video-wrap canvas,
.video-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.phone-video {
  min-height: calc(100vh - 92px);
}

.phone-auth-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 12%, rgba(47, 128, 237, .22), transparent 32%),
    radial-gradient(circle at 84% 78%, rgba(34, 197, 94, .18), transparent 30%),
    linear-gradient(145deg, #0d1728, #101827 54%, #172033);
}

.phone-auth-card {
  width: min(430px, 100%);
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .32);
  border-radius: 18px;
  padding: 28px;
}

.phone-auth-card h2 {
  font-size: 25px;
  margin-bottom: 8px;
}

.phone-auth-card .auth-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.phone-auth-card input,
.phone-auth-card button {
  width: 100%;
  height: 46px;
  border-radius: 12px;
}

.phone-auth-card button:not(.secondary) {
  border-color: #2f80ed;
  background: #2f80ed;
  color: #fff;
  font-weight: 700;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  margin-bottom: 16px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #2f80ed, #22c55e);
  font-size: 13px;
  font-weight: 700;
}

.phone-camera-page {
  overflow: hidden;
  background: #000;
}

.phone-camera-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
  color: #fff;
  touch-action: manipulation;
}

.phone-camera-shell video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.camera-top {
  position: absolute;
  left: max(28px, env(safe-area-inset-left));
  right: max(28px, env(safe-area-inset-right));
  top: max(22px, env(safe-area-inset-top));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  z-index: 5;
  pointer-events: none;
}

.fps-readout {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(22px, 6vw, 34px);
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .55);
}

.orange-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff9f1c;
}

.camera-top .tiny {
  justify-self: center;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, .1);
}

.camera-icon {
  justify-self: end;
  width: 62px;
  height: 62px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 48px;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .55);
  pointer-events: auto;
}

.camera-settings {
  position: absolute;
  right: 18px;
  top: 94px;
  z-index: 10;
  width: min(330px, calc(100vw - 36px));
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 16px;
  background: rgba(12, 18, 30, .78);
  backdrop-filter: blur(16px);
}

.camera-settings label {
  color: #fff;
  justify-content: space-between;
}

.camera-settings select,
.camera-settings button {
  border-radius: 10px;
}

.camera-settings button:not(.secondary) {
  border-color: #2f80ed;
  background: #2f80ed;
  color: #fff;
}

.camera-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 31vh;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
}

.round-action,
.pill-action {
  height: 58px;
  min-width: 58px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}

.pill-action {
  min-width: 112px;
  padding: 0 24px;
  font-size: 24px;
}

.pill-action.active {
  border-color: rgba(47, 128, 237, .95);
  background: rgba(47, 128, 237, .42);
}

.eye-off {
  font-size: 28px;
}

.camera-sliders {
  position: absolute;
  left: max(26px, env(safe-area-inset-left));
  right: max(26px, env(safe-area-inset-right));
  bottom: max(36px, env(safe-area-inset-bottom));
  z-index: 5;
  display: grid;
  gap: 34px;
}

.camera-slider-label {
  display: grid;
  grid-template-columns: auto auto;
  gap: 16px;
  color: #fff;
  font-size: clamp(23px, 6vw, 36px);
  font-weight: 700;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .55);
}

.camera-slider-label span:nth-child(2) {
  justify-self: end;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.camera-slider-label input {
  grid-column: 1 / -1;
  width: 100%;
  padding: 0;
  border: 0;
  accent-color: #2f80ed;
}

.blackout-cover {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #000;
  pointer-events: auto;
}

/* Desktop client, styled like a compact Windows tool. */
.desktop-os {
  overflow: hidden;
  background: #f2f6fb;
}

.os-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: 48px 1fr 28px;
  background: #f2f6fb;
}

.os-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  padding: 0 9px 0 2px;
  background: #eaf2fb;
  border-bottom: 1px solid #d9e4ef;
  font-size: 13px;
}

.os-brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.os-logo {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border-radius: 3px;
  background: linear-gradient(135deg, #4ea8ff, #7c3aed);
  color: white;
  font-size: 10px;
  font-weight: 700;
}

.os-window-buttons {
  display: flex;
  gap: 18px;
}

.os-window-buttons span {
  width: 10px;
  height: 1px;
  background: #111827;
}

.os-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: #ffffff;
  border-bottom: 1px solid #dfe8f3;
  overflow-x: auto;
  overflow-y: hidden;
}

.os-toolbar select {
  height: 32px;
  padding: 4px 28px 4px 9px;
}

.tool-btn {
  height: 32px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #d1dbe8;
  background: #fff;
  color: #24324a;
}

.tool-btn.orange {
  border-color: #f6b23b;
  background: #f59e0b;
  color: #fff;
}

.toolbar-spacer,
.status-spacer {
  flex: 1;
}

.green-dot {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: #22c55e;
  display: inline-block;
  flex: 0 0 auto;
}

.green-dot.off {
  background: #94a3b8;
}

.green-dot.tiny {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.os-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(620px, 2fr) minmax(430px, 1fr);
  gap: 14px;
  padding: 8px;
}

.capture-board,
.right-monitor {
  min-width: 0;
  min-height: 0;
}

.capture-board {
  overflow: hidden;
}

.os-card-grid {
  height: 100%;
  display: grid;
  gap: 5px;
  padding: 0;
  overflow: hidden;
}

.slot.os-slot {
  position: relative;
  min-height: 0;
  aspect-ratio: auto;
  border: 1px solid #d9e2ee;
  border-radius: 7px;
  background: #f8fbff;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .58);
}

.slot.os-slot.active {
  outline: 2px solid #2f80ed;
  outline-offset: -2px;
}

.slot.os-slot img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .08s linear;
  will-change: transform;
}

.slot-number {
  position: absolute;
  right: 5px;
  bottom: 5px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: rgba(17, 24, 39, .78);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.slot-number.empty {
  background: #8b96a6;
}

.frame-count {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, .58);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.next-badge {
  position: absolute;
  right: 6px;
  top: 6px;
  padding: 2px 7px;
  border-radius: 5px;
  background: #174ea6;
  color: white;
  font-size: 12px;
}

.right-monitor {
  display: grid;
  grid-template-rows: 1fr 8px .72fr auto;
  gap: 8px;
  overflow: hidden;
}

.record-playback-mode .right-monitor {
  grid-template-rows: .42fr 8px 1.22fr auto;
}

.record-playback-mode .selected-monitor {
  min-height: 420px;
}

.monitor-card {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #dde6f0;
  background: #111827;
}

.monitor-card video,
.monitor-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.selected-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #8ea0b6;
  background: #f8fbff;
}

.live-overlay {
  position: absolute;
  left: 20px;
  top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

.live-overlay .blue {
  color: #248cff;
}

.floating-gear {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
}

.monitor-separator {
  height: 6px;
  border-radius: 99px;
  background: #d9e1ec;
}

.frame-controls {
  display: grid;
  gap: 7px;
  padding: 8px 10px 12px;
  border: 1px solid #dfe8f3;
  border-radius: 8px;
  background: #fff;
}

.frame-controls input[type="range"] {
  flex: 1;
  accent-color: #2f80ed;
  padding: 0;
}

.play-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.mini {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.mini.green {
  border-color: #22c55e;
  background: #22c55e;
  color: #fff;
}

.mini.blue {
  border-color: #3993ff;
  background: #3993ff;
  color: #fff;
}

.mini.danger {
  border-color: #ef4444;
  background: #ef4444;
  color: #fff;
}

.record-speed {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #d6e2f0;
  border-radius: 6px;
  color: #53627a;
  background: #fff;
  font-size: 12px;
}

.record-speed select {
  height: 22px;
  min-width: 64px;
  border: 0;
  background: transparent;
  font-size: 12px;
  color: inherit;
}

.os-statusbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  border-top: 1px solid #dfe8f3;
  background: #fff;
  color: #53627a;
  font-size: 12px;
}

.dark-mode {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #182235;
  --text: #e5eefb;
  --muted: #95a3b8;
  --line: #26364d;
  background: #0f172a;
}

.dark-mode .os-shell,
.dark-mode.desktop-os {
  background: #0f172a;
}

.dark-mode .os-titlebar,
.dark-mode .os-toolbar,
.dark-mode .os-statusbar,
.dark-mode .frame-controls {
  background: #111827;
  border-color: #26364d;
}

.dark-mode input,
.dark-mode select,
.dark-mode button,
.dark-mode .tool-btn {
  background: #182235;
  color: #e5eefb;
  border-color: #31435f;
}

.dark-mode .slot.os-slot,
.dark-mode .selected-empty {
  background: #172033;
  border-color: #26364d;
}

@media (max-width: 1100px) {
  .os-shell {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto auto 28px;
  }

  .os-workspace,
  .phone-main {
    grid-template-columns: 1fr;
  }

  .os-card-grid {
    min-height: 60vh;
  }

  .right-monitor {
    min-height: 80vh;
  }
}

.admin-page {
  min-height: 100vh;
  margin: 0;
  background: #eef3f8;
  color: #1f2937;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  background: linear-gradient(135deg, #0f172a, #1f4f8f);
  color: #fff;
}

.admin-topbar h1,
.admin-panel h2 {
  margin: 0;
}

.admin-topbar p,
.admin-panel p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.admin-keybar,
.admin-search {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-keybar input,
.admin-search input {
  min-width: 220px;
  height: 38px;
  border: 1px solid #d9e3ef;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.admin-layout {
  display: grid;
  gap: 18px;
  padding: 22px 28px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.admin-stats article {
  padding: 18px;
  border: 1px solid #d9e3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.admin-stats span {
  display: block;
  color: #64748b;
  font-size: 13px;
}

.admin-stats strong {
  display: block;
  margin-top: 8px;
  color: #0f172a;
  font-size: 30px;
}

.admin-panel {
  border: 1px solid #d9e3ef;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.admin-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid #e4edf7;
}

.admin-panel-head p {
  color: #64748b;
}

.admin-table-wrap {
  overflow: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.admin-table th,
.admin-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.admin-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
}

.admin-table td strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
}

.admin-table td small {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
}

.empty-cell {
  height: 120px;
  color: #64748b;
  text-align: center !important;
}

.bad-text {
  color: #dc2626;
}

.tag,
.online-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tag.ok {
  color: #047857;
  background: #d1fae5;
}

.tag.danger {
  color: #b91c1c;
  background: #fee2e2;
}

.tag.formal {
  color: #1d4ed8;
  background: #dbeafe;
}

.tag.trial {
  color: #92400e;
  background: #fef3c7;
}

.online-pill {
  margin-right: 5px;
  color: #334155;
  background: #eef2f7;
}

.admin-actions {
  min-width: 260px;
}

.admin-actions button {
  height: 30px;
  margin: 2px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
}

.admin-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 16px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.admin-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.admin-toast.bad {
  background: #b91c1c;
}

.binding-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
}

.binding-card {
  position: relative;
  width: min(380px, calc(100vw - 36px));
  padding: 26px;
  border: 1px solid #d9e3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  text-align: center;
}

.binding-card h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 22px;
}

.binding-card p {
  margin: 0 auto 18px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.binding-card img {
  width: 280px;
  height: 280px;
  border: 1px solid #e4edf7;
  border-radius: 8px;
  background: #f8fafc;
}

.binding-card strong {
  display: block;
  margin-top: 14px;
  color: #2563eb;
  font-size: 14px;
  word-break: break-all;
}

.binding-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eef2f7;
  color: #475569;
  font-size: 22px;
  cursor: pointer;
}

/* 画面设置面板 */
.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
}

.settings-card {
  position: relative;
  width: min(380px, calc(100vw - 36px));
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  border: 1px solid #d9e3ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e8edf3;
}

.settings-header h3 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 600;
}

.settings-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #eef2f7;
  color: #475569;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.settings-body {
  padding: 14px 20px 20px;
}

.setting-row {
  margin-bottom: 16px;
}

.setting-row:last-child {
  margin-bottom: 0;
}

.setting-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 500;
}

.setting-value {
  color: #64748b;
  font-size: 13px;
  font-weight: 400;
}

.setting-segment {
  display: flex;
  gap: 6px;
}

.seg-btn {
  flex: 1;
  padding: 7px 0;
  border: 1px solid #d1dbe8;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.seg-btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.seg-btn.active {
  border-color: #3b82f6;
  background: #3b82f6;
  color: #fff;
}

.setting-row input[type="range"] {
  width: 100%;
  height: 6px;
  margin: 6px 0;
  border-radius: 3px;
  background: #e2e8f0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.setting-row input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.setting-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #94a3b8;
  font-size: 12px;
  margin-top: 2px;
}

.mini-btn {
  padding: 4px 10px;
  border: 1px solid #d1dbe8;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  cursor: pointer;
}

.mini-btn.green {
  border-color: #22c55e;
  background: #22c55e;
  color: #fff;
}

.mini-btn.active {
  border-color: #3b82f6;
  background: #3b82f6;
  color: #fff;
}

.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
}

.toggle-inline input {
  cursor: pointer;
}

.dark-mode .settings-card {
  background: #1e293b;
  border-color: #334155;
}

.dark-mode .settings-header {
  border-bottom-color: #334155;
}

.dark-mode .settings-header h3 {
  color: #f1f5f9;
}

.dark-mode .setting-label {
  color: #cbd5e1;
}

.dark-mode .seg-btn {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

.dark-mode .seg-btn:hover {
  border-color: #3b82f6;
  background: #1e3a5f;
}

.dark-mode .mini-btn {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

.dark-mode .setting-row input[type="range"] {
  background: #334155;
}

#remoteVideo,
#nativeFrame {
  transform-origin: center center;
}

@media (max-width: 900px) {
  .desktop-login-card {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .login-form-panel {
    padding: 34px 24px;
  }

  .login-art-panel {
    min-height: 180px;
  }

  .admin-topbar,
  .admin-panel-head,
  .admin-keybar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-keybar input,
  .admin-search input {
    min-width: 0;
    width: 100%;
  }
}
