:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  --bg: #101619;
  --panel: #182125;
  --border: #334147;
  --foreground: #eef5f3;
  --quiet: #a7b8ba;
  --accent: #b1ebd5;
  --danger: #ffb4ad;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--foreground); }
h1, h2, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--foreground);
  background: #202b30;
  white-space: nowrap;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #2a393e; }
button:disabled { color: #85969a; opacity: .68; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button.primary { background: var(--accent); border-color: var(--accent); color: #122f28; font-weight: 650; }
button.primary:hover:not(:disabled) { background: #d0f8e8; }
input, select, textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #10191c;
  color: var(--foreground);
}
textarea { resize: vertical; }
.monitor-mark {
  display: inline-block;
  width: 23px;
  height: 17px;
  border: 2px solid var(--accent);
  border-radius: 3px;
  position: relative;
  color: var(--accent);
}
.monitor-mark::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2px;
  bottom: -5px;
  background: currentColor;
  border-radius: 1px;
}
.login {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 20px;
}
.signin {
  width: min(100%, 400px);
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.signin h1 { font-size: 26px; letter-spacing: .025em; margin: 15px 0 5px; }
.signin > p { color: var(--quiet); }
.signin form { margin-top: 23px; display: grid; gap: 8px; }
.signin input, .signin select { margin-bottom: 9px; min-height: 43px; }
.signin button { margin-top: 4px; min-height: 42px; }
.form-error { color: var(--danger); min-height: 1.25em; }
.desk {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 300px;
  padding: max(0px, env(safe-area-inset-top)) max(0px, env(safe-area-inset-right))
           max(0px, env(safe-area-inset-bottom)) max(0px, env(safe-area-inset-left));
}
.header, .toolbar, .statusbar { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.header { min-height: 63px; padding: 0 21px; border-bottom: 1px solid var(--border); }
.brand, .account, .actions, .zoom, .connection { display: flex; align-items: center; gap: 9px; }
.brand { gap: 12px; }
.header h1 { font-size: 16px; font-weight: 650; white-space: nowrap; }
.account { color: var(--quiet); font-family: ui-monospace, monospace; }
.workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin: 14px 18px 17px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
}
.desk.expanded .header { display: none; }
.desk.expanded .workspace { margin: 0; border: 0; border-radius: 0; }
.toolbar { flex-wrap: wrap; padding: 9px 10px; }
.modes { display: flex; gap: 2px; border-radius: 8px; background: #0e171a; padding: 3px; }
.modes button { background: transparent; border-color: transparent; min-width: 66px; min-height: 32px; }
.modes button[aria-pressed="true"], #right-click[aria-pressed="true"] {
  background: #29443e;
  border-color: #42675c;
  color: #d5f8e9;
}
button.call { color: var(--accent); }
button.call[data-active] { color: var(--danger); background: #412c2d; border-color: #725052; }
.viewport {
  flex: 1;
  min-height: 0;
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  background: #080e10;
  outline-offset: -3px;
}
.viewport[data-mode="control"] { cursor: crosshair; }
.viewport[data-pannable] { cursor: grab; }
.viewport:active[data-pannable] { cursor: grabbing; }
#screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center;
  max-width: none;
  pointer-events: none;
}
.screen-message {
  max-width: 80%;
  color: var(--quiet);
  text-align: center;
  line-height: 1.6;
}
.notice {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  width: max-content;
  max-width: calc(100% - 25px);
  padding: 8px 12px;
  border: 1px solid #617476;
  border-radius: 7px;
  background: #18262b;
  pointer-events: none;
}
.statusbar { padding: 6px 10px; color: var(--quiet); }
.connection { gap: 6px; white-space: nowrap; }
.dot { display: inline-block; height: 7px; width: 7px; border-radius: 50%; background: #849699; }
.dot[data-online] { background: #82d8b6; }
.guidance { text-align: center; font-size: 12px; }
.zoom { gap: 3px; }
.zoom button { min-height: 30px; padding: 0 8px; }
dialog {
  width: min(490px, calc(100% - 26px));
  padding: 17px;
  border: 1px solid #4a5b60;
  border-radius: 12px;
  background: var(--panel);
  color: var(--foreground);
}
dialog::backdrop { background: #060b0cb8; }
.sheet-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; }
.sheet-title h2 { font-size: 17px; }
dialog label { display: block; margin-bottom: 7px; color: var(--quiet); }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.sheet-status { min-height: 1.25em; margin-top: 8px; color: var(--quiet); }
@media (max-width: 580px) {
  input, select, textarea { font-size: 16px; }
  .header { padding: 0 10px; min-height: 49px; }
  .workspace { margin: 6px; }
  .toolbar { gap: 4px; padding: 5px; }
  .toolbar button { padding-inline: 8px; min-height: 36px; }
  .modes button { min-width: 45px; }
  .actions { flex-wrap: wrap; gap: 4px; }
  .control-tool:disabled { display: none; }
  .statusbar { padding: 5px; font-size: 12px; gap: 4px; }
  .guidance { font-size: 11px; }
}
