/* ============================================================
   RemoteAssist · 控制端样式表（v=20261121n）
   深色科技风：分层玻璃面板 / 蓝色品牌色 / 克制的动效
   ============================================================ */

:root {
  --bg: #05070b;
  --bg-deep: #04060a;
  --surface: #0b111a;
  --surface-2: #101825;
  --surface-3: #15202f;
  --line: #1c2634;
  --line-soft: #141d29;
  --text: #e8eef8;
  --muted: #8b97a9;
  --dim: #59657a;
  --accent: #4c8dff;
  --accent-2: #82b4ff;
  --accent-3: #a8ccff;
  --ok: #37d99b;
  --warn: #f5b556;
  --danger: #ff5f6f;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 30px 80px #0000006b, 0 2px 0 #ffffff0a inset;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei UI", "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 560px at 6% -18%, #1e4a9c33, transparent 60%),
    radial-gradient(900px 500px at 104% -6%, #0c567333, transparent 58%),
    radial-gradient(700px 420px at 50% 118%, #0a1b3a26, transparent 70%),
    var(--bg);
}

/* ------------------------------------------------------------ topbar */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(11px + var(--safe-top)) clamp(14px, 3vw, 26px) 11px;
  border-bottom: 1px solid #ffffff0a;
  background: linear-gradient(180deg, #080c13f0, #070a0fbd);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  position: relative;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.logo {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: linear-gradient(150deg, #6ea4ff 0%, #3c7bf0 55%, #2a5dd0 100%);
  box-shadow: 0 0 0 1px #8fbaff33, 0 8px 22px #2f6bdd55;
  position: relative;
}
.logo::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #dbe8ff);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 620; font-size: 13.5px; letter-spacing: 0.4px; color: #e3eaf6; }
.brand-sub { font-size: 10.5px; color: var(--dim); letter-spacing: 1.2px; }

.conn-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0c131dd9;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  max-width: 52vw;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .2s, border-color .2s, background .2s;
}

.dot {
  width: 7px; height: 7px; flex: 0 0 auto;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 3px #5d67791a;
}
.dot.online { background: var(--ok); box-shadow: 0 0 0 3px #37d99b22, 0 0 12px #37d99b88; }
.dot.wait { background: var(--warn); box-shadow: 0 0 0 3px #f5b55622; animation: pulse 1.6s ease-in-out infinite; }
.dot.err { background: var(--danger); box-shadow: 0 0 0 3px #ff5f6f22; }

.conn-state:has(.dot.online) { color: #a9e9cd; border-color: #37d99b3d; background: #0c1d1acc; }
.conn-state:has(.dot.wait) { color: #f0cf9a; border-color: #f5b55635; }
.conn-state:has(.dot.err) { color: #ffb3ba; border-color: #ff5f6f38; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .38; } }

.hud {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #0b121ccc;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 0 #ffffff08 inset;
}
.hud span {
  padding: 5px 12px;
  font-size: 11.5px;
  color: #94a5bd;
  border-left: 1px solid #ffffff0a;
  white-space: nowrap;
}
.hud span:first-child { border-left: 0; }
.hud span#hudTime { color: #c3d3e8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .5px; }
.hud span.good { color: var(--ok); }
.hud span.warn { color: var(--warn); }
.hud span.bad { color: var(--danger); }

/* ------------------------------------------------------------- stage */

.stage {
  padding: clamp(18px, 3.6vw, 40px);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  overflow: auto;
}

/* ------------------------------------------------------------- login */

.login {
  width: min(880px, 100%);
  display: grid;
  grid-template-columns: 0.92fr 1fr;
  gap: 0;
  padding: 0;
  border-radius: var(--radius-lg);
  border: 1px solid #223044;
  background:
    linear-gradient(160deg, #0f1825f5 0%, #0a1018fa 55%, #080d14fd 100%);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.login::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #6ea4ff66, #34d3c84d, transparent);
}
.login::after {
  content: "";
  position: absolute;
  width: 420px; height: 420px;
  right: -160px; top: -200px;
  border-radius: 50%;
  background: radial-gradient(circle, #2f6bdd26, transparent 62%);
  pointer-events: none;
}

.login-intro {
  position: relative;
  padding: clamp(24px, 3vw, 36px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  border-right: 1px solid #ffffff08;
  background:
    radial-gradient(600px 320px at 0% 0%, #1b3c7a2e, transparent 60%),
    linear-gradient(200deg, #0c1522, #080d15);
  overflow: hidden;
}
.login-intro::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, #4c8dff33, transparent);
}

.logo-lg {
  width: 54px; height: 54px; border-radius: 15px;
  box-shadow: 0 0 0 1px #8fbaff33, 0 14px 34px #2f6bdd66;
}
.logo-lg::after { inset: 16px; }

.login-intro h2 {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 640;
  letter-spacing: .3px;
  color: #eaf1fb;
}
.intro-sub { margin: 0; font-size: 12.5px; color: #7f8ea6; letter-spacing: .2px; }

.feat {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 11px;
}
.feat li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  line-height: 1.55;
  color: #9dacbf;
}
.feat svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; color: #6ea4ff; opacity: .95; }

.login-body {
  position: relative;
  padding: clamp(24px, 3.2vw, 38px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #4c8dff30;
  background: #4c8dff12;
  color: var(--accent-2);
  font-size: 11px;
  letter-spacing: 0.4px;
  margin-bottom: 13px;
}

.login h1 {
  font-size: clamp(20px, 2.6vw, 24px);
  line-height: 1.35;
  margin: 0 0 8px;
  font-weight: 640;
  letter-spacing: 0.2px;
  color: #eef4fd;
}
.sub { margin: 0 0 22px; color: var(--muted); font-size: 12.5px; line-height: 1.68; }

form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; }
.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #93a1b6;
  letter-spacing: .5px;
}
.field-tip { color: #5f6c80; letter-spacing: 0; font-size: 11px; }

/* 协助码输入框右侧的整段粘贴按钮 */
.field { position: relative; }
#codeInput { padding-right: 84px; }
.paste-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid #4c8dff33;
  background: #15274580;
  color: #a9c6f4;
  font-size: 11.5px;
  letter-spacing: .3px;
  transition: background .15s, border-color .15s, color .15s;
}
.paste-btn:hover { background: #1c3157; border-color: #4c8dff66; color: #cfe1ff; }
.paste-btn:active { transform: translateY(-50%) scale(.97); }
.paste-btn svg { width: 13px; height: 13px; opacity: .85; }

input {
  height: 50px;
  width: 100%;
  padding: 0 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #060a10;
  color: var(--text);
  font-size: 16px; /* 防止 iOS 聚焦缩放 */
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  box-shadow: 0 1px 0 #ffffff08 inset;
}
#codeInput {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 17px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
}
#pinInput { letter-spacing: 6px; font-variant-numeric: tabular-nums; font-weight: 600; }
input::placeholder { color: #45506380; letter-spacing: normal; font-weight: 400; }
#pinInput.ready { border-color: #4c8dff55; box-shadow: 0 0 0 3px #4c8dff14; }

input:focus {
  border-color: #4c8dff7d;
  box-shadow: 0 0 0 3px #4c8dff1f, 0 1px 0 #ffffff10 inset;
  background: #070c14;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:focus-visible, input:focus-visible, textarea:focus-visible, .kb:focus-visible {
  outline: 2px solid #4c8dff80;
  outline-offset: 2px;
}

#connectBtn {
  height: 52px;
  margin-top: 6px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: linear-gradient(180deg, #639cff 0%, #3c78ea 52%, #2f66d8 100%);
  color: #f7fbff;
  font-weight: 640;
  font-size: 14.5px;
  letter-spacing: 0.5px;
  box-shadow: 0 12px 30px #2f6bdd4d, 0 1px 0 #ffffff40 inset, 0 -12px 24px #1b4bb066 inset;
  transition: transform .12s, filter .18s, opacity .18s, box-shadow .18s;
}
#connectBtn svg { width: 17px; height: 17px; opacity: .9; transition: transform .18s; }
#connectBtn:hover { filter: brightness(1.07); box-shadow: 0 16px 36px #2f6bdd59, 0 1px 0 #ffffff47 inset; }
#connectBtn:hover svg { transform: translateX(2px); }
#connectBtn:active { transform: translateY(1px); filter: brightness(.97); }
#connectBtn:disabled { opacity: .5; cursor: default; filter: grayscale(.25); box-shadow: none; }

.err { min-height: 18px; margin: 13px 0 0; color: #ff97a2; font-size: 12.5px; }

.footnote {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #ffffff0d;
  color: var(--dim);
  font-size: 11px;
}
.footnote span {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #ffffff0d;
  background: #ffffff05;
}

/* ------------------------------------------------------------ remote */

.remote {
  width: min(1200px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.viewport {
  position: relative;
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid #1e2938;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 26px 70px #00000073, 0 0 0 1px #ffffff06 inset, 0 0 40px #1b4bb014;
  touch-action: none;
  outline: none;
}
.viewport:focus-visible { border-color: #4c8dff55; }

#screen {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 232px);
  object-fit: contain;
  background: var(--bg-deep);
  cursor: default;
}
.viewport.is-waiting { aspect-ratio: 16 / 9; }
.viewport.is-waiting #screen { height: 100%; }

.cursor {
  position: fixed;
  width: 9px; height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: #ffffffe6;
  box-shadow: 0 0 0 2px #4c8dffcc, 0 0 16px #4c8dffaa;
  pointer-events: none;
  z-index: 30;
}

.placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #75839a;
  font-size: 13px;
  letter-spacing: .4px;
  background:
    radial-gradient(420px 220px at 50% 42%, #4c8dff12, transparent 70%),
    repeating-linear-gradient(45deg, #ffffff05 0 1px, transparent 1px 13px),
    #05080d;
}
.placeholder #waitText { max-width: 86%; text-align: center; overflow-wrap: anywhere; }

.spinner {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid #ffffff14;
  border-top-color: var(--accent);
  box-shadow: 0 0 18px #4c8dff33;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------- toolbar */

.toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b121bd9;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 12px 32px #00000059;
}

.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #ffffff0f;
  background: #131c28;
  color: #c5d1e2;
  font-size: 12.5px;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.tool:hover { background: #18232f; border-color: #ffffff1a; }
.tool:active { transform: translateY(1px); }
.tool.active { background: #4c8dff21; border-color: #4c8dff66; color: #d5e6ff; }
.tool.danger {
  margin-left: auto;
  color: #ffb3bb;
  border-color: #ff5f6f33;
  background: #23131a;
}
.tool.danger:hover { background: #2e1720; border-color: #ff5f6f5c; }
.tool svg { width: 15px; height: 15px; opacity: .92; }

/* ------------------------------------------------------------- keybar */

.keybar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b121bd9;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.kb {
  min-width: 44px;
  height: 36px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid #ffffff12;
  background: linear-gradient(180deg, #18222f, #131b26);
  color: #c5d1e2;
  font-size: 12px;
  box-shadow: 0 1px 0 #ffffff0d inset, 0 2px 4px #00000047;
  transition: background .12s, border-color .12s, transform .08s;
}
.kb:active { transform: translateY(1px); background: #1d2937; }
.kb.active { background: #4c8dff26; border-color: #4c8dff80; color: #d6e6ff; }
.kb.danger { color: #ff9aa4; margin-left: auto; }
.kbsep { width: 1px; background: #ffffff12; margin: 2px 3px; }

/* ------------------------------------------------------------ drawers */

.textdrawer {
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b121bd9;
}
.textdrawer textarea {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  resize: none;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #060a10;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
}
.textdrawer textarea:focus { border-color: #4c8dff88; }
.textdrawer .tool { flex: 0 0 auto; }

.touchpad {
  padding: 9px 12px;
  border: 1px dashed #ffffff14;
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-size: 11.5px;
  text-align: center;
}

/* -------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  transform: translateX(-50%) translateY(10px);
  max-width: min(440px, calc(100vw - 28px));
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #4c8dff3d;
  background: #0c1420ed;
  color: #dce8ff;
  font-size: 12.5px;
  line-height: 1.55;
  box-shadow: 0 18px 44px #00000080;
  opacity: 0;
  transition: opacity .22s, transform .22s;
  pointer-events: none;
  z-index: 40;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ------------------------------------------------------------- footer */

.footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 10px 16px calc(12px + var(--safe-bottom));
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.3px;
  border-top: 1px solid #ffffff08;
}
.footer span { white-space: nowrap; }

.mobile-only { display: none; }
.quickpad { display: none; }

/* ---------------------------------------------------- states / motion */

.err.shake { animation: shake .32s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.remote.is-paused .quickpad,
.remote.is-paused .touchpad { opacity: .34; filter: grayscale(.35); }
.remote.is-viewonly .tool[data-act="pause"],
.remote.is-viewonly .quickpad { display: none !important; }

.immersive-exit {
  position: fixed;
  top: calc(12px + var(--safe-top));
  right: 12px;
  z-index: 60;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #ffffff26;
  background: #0b111cd9;
  color: #d2deef;
  font-size: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.immersive-exit:active { background: #162031; }

body.immersive .topbar,
body.immersive .footer { display: none; }
body.immersive .stage {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  max-width: none;
  display: flex;
}
body.immersive .remote { width: 100%; height: 100%; gap: 0; }
body.immersive .viewport { flex: 1; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
body.immersive #screen { max-height: none; height: 100%; object-fit: contain; }
body.immersive .toolbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  margin: 0;
  padding-bottom: calc(8px + var(--safe-bottom));
  background: linear-gradient(0deg, #05080dee, transparent);
  border: 0;
  z-index: 50;
  box-shadow: none;
  backdrop-filter: none;
}
body.immersive .hud {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: #0b121ce6;
}

/* ================================================== 平板 / 手机 ====== */

@media (max-width: 900px) {
  /* 登录：单列，品牌信息交给顶栏，卡片只留表单 */
  .login { grid-template-columns: 1fr; width: min(460px, 100%); }
  .login-intro { display: none; }
  .login-intro {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-right: 0;
    border-bottom: 1px solid #ffffff0a;
    background: linear-gradient(200deg, #0d1929, #080e16);
  }
  .logo-lg { width: 40px; height: 40px; border-radius: 12px; }
  .logo-lg::after { inset: 12px; }
  .login-intro h2 { font-size: 16px; margin: 0; }
  .intro-sub { display: none; }
  .feat { display: none; }
  .login-body { padding: 20px 22px 24px; }
}

@media (max-width: 900px) {
  .topbar {
    padding: calc(9px + var(--safe-top)) 14px 9px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .logo { width: 26px; height: 26px; border-radius: 8px; }
  .logo::after { inset: 7.5px; }
  .brand-name { font-size: 13px; }
  .brand-sub { display: none; }

  .conn-state { padding: 5px 10px; font-size: 11px; }

  .hud {
    order: 3;
    width: 100%;
    justify-content: space-between;
    border-radius: 11px;
  }
  .hud span { flex: 1; text-align: center; padding: 5px 2px; font-size: 10.5px; letter-spacing: .02em; }

  .stage {
    padding: 10px 12px calc(6px + var(--safe-bottom));
    align-items: stretch;
    min-height: calc(100dvh - 92px);
  }

  .login { margin: auto; border-radius: 18px; }
  .login h1 { font-size: 19px; }
  .sub { font-size: 12px; margin-bottom: 18px; }
  input { height: 48px; }
  #connectBtn { height: 50px; }

  .remote {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .viewport {
    flex: 1 1 auto;
    width: 100%;
    min-height: 34dvh;
    max-height: none;
    aspect-ratio: auto;
    margin: 0 auto;
    border-radius: 14px;
  }
  #screen {
    width: 100%; height: 100%;
    max-height: none; min-height: 0;
    object-fit: contain;
  }

  .quickpad {
    flex: 0 0 auto;
    margin: 0;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #0c141f, #090f18);
    box-shadow: 0 1px 0 #ffffff0a inset, 0 10px 30px #0000003d;
  }
  .qp-title { font-size: 11px; color: var(--dim); letter-spacing: .06em; text-align: center; }
  .qp-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    grid-auto-rows: 52px;
    gap: 9px;
    align-content: start;
  }
  .quickpad .kb {
    height: 52px;
    font-size: 13px;
    border-radius: 12px;
  }
  .quickpad .kb[data-mod] { color: #b8c8dd; }
  .quickpad .kb[data-mod].active {
    background: #4c8dff2b;
    border-color: #4c8dff8c;
    color: #dbeaff;
    box-shadow: 0 0 16px #4c8dff33;
  }

  .touchpad {
    padding: 5px 10px;
    font-size: 11px;
    background: none;
    border-style: none;
    text-align: center;
  }

  .toolbar {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    gap: 5px;
    padding: 6px;
    border-radius: 14px;
    background: #0a0f17e0;
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    box-shadow: 0 10px 28px #0000006b;
  }
  .tool { flex: 1; height: 44px; padding: 0 4px; font-size: 12px; flex-direction: column; gap: 3px; }
  .tool svg { width: 17px; height: 17px; }
  .tool .label { font-size: 10.5px; letter-spacing: 0; }
  .tool.danger { margin-left: 0; }

  .mobile-only { display: inline-flex; }
  .footer { display: none; }

  .keybar { flex-wrap: nowrap; overflow-x: auto; padding: 6px; }
  .kb { flex: 0 0 auto; min-width: 46px; height: 40px; }
  .textdrawer textarea { min-height: 46px; }
  .toast { bottom: calc(100px + var(--safe-bottom)); }
}

@media (max-width: 900px) and (orientation: portrait) {
  .quickpad { display: flex; }
  #keyBtn { display: none; }
}

@media (max-width: 900px) {
  .remote.drawer-open .quickpad,
  .remote.drawer-open .toolbar,
  .remote.drawer-open #touchpad { display: none !important; }

  .textdrawer {
    position: fixed;
    left: 0; right: 0; bottom: var(--kb, 0px);
    z-index: 45;
    margin: 0;
    border-radius: 16px 16px 0 0;
    border-width: 1px 0 0;
    padding: 10px 12px calc(10px + var(--safe-bottom));
    background: #0a121ceb;
    box-shadow: 0 -20px 44px #00000073;
    transition: bottom .12s ease-out;
  }
  .textdrawer textarea { min-height: 46px; max-height: 34dvh; font-size: 15px; }
  .textdrawer .tool { flex: 0 0 auto; height: 44px; padding: 0 16px; }
}

/* 小屏登录：去掉开场条里的副标题，收紧留白 */
@media (max-width: 430px) {
  .login-intro { padding: 14px 18px; }
  .logo-lg { width: 34px; height: 34px; border-radius: 10px; }
  .logo-lg::after { inset: 10px; }
  .login-body { padding: 16px 18px 20px; }
  .login h1 { font-size: 18px; }
  .sub { font-size: 11.5px; margin-bottom: 16px; }
  input { height: 46px; }
  #connectBtn { height: 48px; font-size: 14px; }
  .footnote { margin-top: 14px; padding-top: 13px; }
}

/* 横屏手机：把画面铺满，工具栏悬浮 */
@media (max-height: 560px) and (orientation: landscape) {
  .topbar {
    position: absolute; inset: 0 0 auto 0;
    background: linear-gradient(180deg, #05080df5 0%, #05080db3 62%, transparent 100%);
    border: 0;
    padding: 8px 16px;
    backdrop-filter: none;
  }
  .brand-sub { display: none; }
  .logo { width: 24px; height: 24px; }
  .logo::after { inset: 7px; }
  .conn-state { font-size: 11px; padding: 5px 10px; }
  .hud, .touchpad, .footer { display: none; }
  .stage { padding: 0; min-height: 100dvh; }

  .login { padding: 0; max-height: calc(100dvh - 20px); width: min(520px, 96vw); }
  .login-intro { display: none; }
  .login-body { padding: 14px 18px 16px; overflow-y: auto; }
  .login h1 { font-size: 16px; margin-bottom: 8px; }
  .login .sub { display: none; }
  .login .badge { margin-bottom: 10px; padding: 3px 8px; font-size: 10px; }
  .login label { gap: 5px; }
  .login input { height: 38px; }
  .login #connectBtn { height: 42px; margin-top: 2px; }
  .login .footnote { display: none; }

  .remote { width: 100%; height: 100dvh; gap: 0; }
  .viewport { flex: 1 1 auto; min-height: 0; height: 100%; width: 100%; border: 0; border-radius: 0; box-shadow: none; }
  #screen { width: 100%; height: 100%; max-height: none; object-fit: contain; }
  .toolbar {
    position: absolute; left: 50%; transform: translateX(-50%);
    bottom: calc(8px + var(--safe-bottom));
    background: #0b121be6;
    backdrop-filter: blur(14px);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 6px;
    width: auto;
  }
  .tool { flex: 0 0 auto; height: 38px; padding: 0 14px; flex-direction: row; gap: 7px; }
  .tool .label { font-size: 12px; }
  .tool.danger { margin-left: 4px; }
  .quickpad { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media (hover: none) {
  .tool:hover { background: #131c28; border-color: #ffffff0f; }
  .tool.danger:hover { background: #23131a; border-color: #ff5f6f33; }
  #connectBtn:hover { filter: none; }
  #connectBtn:hover svg { transform: none; }
}

/* ==================================================== 20261122b 控制体验 ==== */

/* 填齐协助码和密码后，主按钮给一点“可以按了”的暗示 */
#connectBtn.ready {
  box-shadow: 0 14px 34px #2f6bdd66, 0 1px 0 #ffffff4d inset, 0 0 0 3px #4c8dff1f;
}

/* 错误提示前面加一个感叹号标记，扫一眼就知道出问题了 */
.err { display: flex; align-items: center; gap: 7px; }
.err:empty { display: block; }
.err::before {
  content: "!";
  display: none;
  flex: 0 0 auto;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #ff5f6f26;
  color: #ff97a2;
  font-size: 11px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}
.err:not(:empty)::before { display: inline-block; }

/* 暂停控制时，画面上压一层提示，避免误以为对方卡了 */
.remote.is-paused .viewport::after {
  content: "键鼠已暂停 · 画面继续传输";
  position: absolute;
  left: 50%; top: 14px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: #2a1f0fe6;
  border: 1px solid #ffb4544d;
  color: #ffd9a0;
  font-size: 11.5px;
  letter-spacing: .3px;
  pointer-events: none;
  z-index: 20;
}

/* 首次上手引导 */
.guide {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 55;
  width: min(420px, calc(100vw - 32px));
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid #223044;
  background: linear-gradient(170deg, #101a28f7, #0a1018fa);
  box-shadow: 0 0 0 100vmax #05080dd1, 0 30px 80px #000000a6, 0 1px 0 #ffffff12 inset;
  animation: guide-in .22s ease-out;
}
@keyframes guide-in {
  from { opacity: 0; transform: translate(-50%, -46%) scale(.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.guide-head { display: flex; align-items: center; margin-bottom: 10px; }
.guide-badge {
  font-size: 11px;
  letter-spacing: .5px;
  color: #a8ccff;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #4c8dff33;
  background: #4c8dff12;
}
.guide-close {
  margin-left: auto;
  width: 28px; height: 28px;
  border-radius: 9px;
  background: #ffffff0a;
  color: #9aa7ba;
  font-size: 16px;
  line-height: 1;
}
.guide-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 9px; }
.guide-list li {
  font-size: 12.5px;
  line-height: 1.6;
  color: #9dacbf;
  padding-left: 15px;
  position: relative;
}
.guide-list li::before {
  content: "";
  position: absolute; left: 0; top: 8px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #4c8dff8c;
}
.guide-list b { color: #dfeaf8; font-weight: 600; }
.guide-ok {
  width: 100%;
  height: 44px;
  border-radius: 11px;
  background: linear-gradient(180deg, #639cff, #3a76e8);
  color: #f6faff;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: 0 10px 24px #2f6bdd4d, 0 1px 0 #ffffff33 inset;
}
.guide-ok:active { transform: translateY(1px); }

@media (max-width: 900px) {
  .guide {
    top: auto; bottom: calc(12px + var(--safe-bottom));
    left: 12px; right: 12px;
    transform: none;
    width: auto;
    border-radius: 18px;
    padding: 16px 16px 14px;
  }
  @keyframes guide-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  /* 手机上 HUD 收得更紧，把高度还给画面 */
  .hud span { padding: 4px 2px; font-size: 10px; }
}

/* ===================================================== 20261122c 视觉收口 ==== */

/* 画面顶部一条渐隐的品牌光线，让大屏不那么"黑盒子" */
.viewport::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #6ea4ff66, #34d3c84d, transparent);
  z-index: 12;
  pointer-events: none;
}

/* 等待画面时，中心有一圈很轻的呼吸光，说明"活着在等" */
.placeholder::before {
  content: "";
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, #4c8dff1f, transparent 66%);
  animation: breathe 3.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes breathe {
  0%, 100% { opacity: .45; transform: scale(.94); }
  50%      { opacity: 1;   transform: scale(1.04); }
}
.placeholder > * { position: relative; z-index: 1; }

/* 桌面端工具栏收窄成一条居中胶囊，别横跨整屏 */
@media (min-width: 901px) {
  .toolbar { width: fit-content; min-width: 0; margin: 0 auto; padding: 6px 8px; }
  .tool { height: 36px; padding: 0 13px; }
  .tool:hover { transform: translateY(-1px); }
  .tool:active { transform: translateY(0); }
}

/* 关闭自适应后的画质按钮：灰一点并带一条斜杠提示 */
.tool.locked { color: #7d8b9f; }
.tool.locked::after {
  content: "";
  position: absolute;
  width: 16px; height: 1px;
  background: #7d8b9f;
  transform: rotate(-24deg);
  opacity: .7;
}
.tool[data-act="quality"] { position: relative; }

/* ============================================ 20261122f 全尺寸屏幕适配 ==== */

/* 桌面/平板横屏：整页按 100dvh 撑满，画面用剩余空间而不是固定 16:9 小窗，
   换任何分辨率都不会出现一条细缝似的画面。 */
@media (min-width: 901px) {
  html, body { height: 100%; }
  body { min-height: 100dvh; display: flex; flex-direction: column; }
  .topbar, .footer { flex: 0 0 auto; }
  .stage {
    flex: 1 1 auto;
    min-height: 0;
    padding: clamp(12px, 1.8vw, 26px);
    align-items: stretch;
    overflow: auto;
  }
  .remote {
    width: min(1600px, 100%);
    height: 100%;
    min-height: 0;
    margin: 0 auto;
    justify-content: flex-start;
  }
  .viewport {
    flex: 1 1 auto;
    min-height: 0;
    aspect-ratio: auto;
  }
  #screen {
    width: 100%;
    height: 100%;
    max-height: none;
    min-height: 0;
    object-fit: contain;
  }
  .viewport.is-waiting { aspect-ratio: auto; }
  .toolbar { flex: 0 0 auto; }
  /* 带鱼屏不至于把画面拉得过于宽扁：给画面一个舒适上限 */
  .remote { max-width: min(1600px, 96vw); }
}

/* 平板竖屏：按键铺 6 列，少占一行高度 */
@media (min-width: 600px) and (max-width: 900px) and (orientation: portrait) {
  .qp-grid { grid-template-columns: repeat(6, minmax(0,1fr)); }
  .quickpad .kb { font-size: 12px; }
}

/* 手机竖屏：快捷键盘行高跟着屏高走，小屏两行搞定 */
@media (max-width: 599px) and (orientation: portrait) {
  .quickpad { padding: 9px; gap: 7px; }
  .qp-grid {
    grid-template-columns: repeat(4, minmax(0,1fr));
    grid-auto-rows: clamp(36px, 6.2vh, 50px);
    gap: 7px;
  }
  .quickpad .kb { height: 100%; font-size: 12.5px; }
  .qp-title { font-size: 10px; letter-spacing: .04em; }
}
@media (max-width: 430px) and (max-height: 760px) and (orientation: portrait) {
  .qp-title { display: none; }
  .qp-grid { grid-template-columns: repeat(6, minmax(0,1fr)); grid-auto-rows: clamp(32px, 5.6vh, 42px); gap: 6px; }
  .quickpad { padding: 7px; }
  .quickpad .kb { font-size: 11.5px; }
  .touchpad { display: none; }
}

/* 手机横屏但不算很矮（例如折叠屏展平）：也把画面铺满 */
@media (max-height: 620px) {
  .stage { align-items: stretch; }
}

/* 登录页在矮屏上允许内部滚动，不要把按钮顶出屏幕 */
@media (max-height: 700px) and (min-width: 901px) {
  .login { max-height: calc(100dvh - 40px); overflow: auto; }
}
@media (max-width: 900px) {
  .login { max-height: calc(100dvh - 24px); overflow: auto; }
}

/* 折叠屏/超窄屏（<340px）再收一档，避免文字挤压 */
@media (max-width: 340px) {
  .stage { padding: 8px 9px calc(4px + var(--safe-bottom)); }
  .brand-name { font-size: 12px; }
  .tool .label { font-size: 10px; }
  .tool { height: 42px; }
  .qp-grid { gap: 5px; }
  .quickpad .kb { font-size: 11px; border-radius: 10px; }
  .login-body { padding: 14px 14px 16px; }
}

/* 超窄屏按键不撑破网格 */
.qp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 600px) and (max-width: 900px) and (orientation: portrait) {
  .qp-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 430px) and (max-height: 760px) and (orientation: portrait) {
  .qp-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 300px) and (max-height: 760px) and (orientation: portrait) {
  .qp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.quickpad .kb { min-width: 0; padding: 0 2px; white-space: nowrap; }

/* 登录卡片保持自然高度并居中，只有控制页才铺满 */
.stage { align-items: center; }
.remote { align-self: stretch; height: auto; min-height: 0; }
@media (max-width: 900px) {
  .remote { flex: 1 1 auto; }
}

/* 超小屏隐藏页脚标签，把空间留给表单 */
@media (max-width: 380px) {
  .footnote { display: none; }
  .login .sub { margin-bottom: 14px; }
}

/* ============================================ 20261122g 品牌标识 ATWOPLUS ==== */

/* 品牌标用官方 A2+ 商标（透明底 PNG），不再用生成的蓝圆点 */
.logo {
  background: none;
  box-shadow: none;
  border-radius: 0;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px #2f6bdd2e);
}
.logo::after { display: none; }
.logo-lg {
  width: 56px;
  height: 56px;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.logo-lg::after { display: none; }

.brand-name {
  font-weight: 700;
  letter-spacing: 1.2px;
  font-size: 13px;
  text-transform: uppercase;
}
.brand-zh {
  font-weight: 500;
  font-size: 12px;
  color: #8d9cb2;
  letter-spacing: .5px;
  margin-left: 4px;
}
@media (max-width: 900px) {
  .brand-zh { display: none; }
}

/* ======================================= 20261122h 连接过程可见化 ==== */

.connect-veil {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  background:
    radial-gradient(680px 420px at 50% 35%, #12233b80, transparent 70%),
    #05080def;
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
}
.cv-card {
  width: min(400px, 100%);
  padding: 26px 24px 20px;
  border-radius: 20px;
  border: 1px solid #223044;
  background: linear-gradient(165deg, #0f1a28f2, #080e16fa);
  box-shadow: 0 30px 80px #000000a6, 0 1px 0 #ffffff10 inset;
  text-align: center;
}
.cv-logo {
  width: 44px; height: 44px;
  object-fit: contain;
  margin: 0 auto 12px;
  display: block;
  filter: drop-shadow(0 6px 18px #2f6bdd33);
}
.cv-card h3 { margin: 0; font-size: 17px; font-weight: 600; color: #e9f1fb; letter-spacing: .3px; }
.cv-sub { margin: 6px 0 18px; font-size: 12.5px; color: #93a3b8; }

.cv-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; text-align: left; }
.cv-steps li {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: #6f7f93;
  transition: color .25s;
}
.cv-dot {
  width: 16px; height: 16px; flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid #2b3a4d;
  background: #0b1220;
  position: relative;
}
.cv-steps li[data-state="active"] { color: #dbe8ff; }
.cv-steps li[data-state="active"] .cv-dot {
  border-color: #4c8dff;
  box-shadow: 0 0 0 3px #4c8dff22, 0 0 14px #4c8dff66;
}
.cv-steps li[data-state="active"] .cv-dot::after {
  content: "";
  position: absolute; inset: 3px;
  border-radius: 50%;
  background: #4c8dff;
  animation: cvpulse 1.1s ease-in-out infinite;
}
@keyframes cvpulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.cv-steps li[data-state="done"] { color: #8fa2b8; }
.cv-steps li[data-state="done"] .cv-dot {
  border-color: #34d3c8;
  background: #34d3c81a;
}
.cv-steps li[data-state="done"] .cv-dot::after {
  content: "";
  position: absolute; left: 5px; top: 1px;
  width: 4px; height: 8px;
  border: 1.5px solid #4ee0d3;
  border-top: 0; border-left: 0;
  transform: rotate(42deg);
}
.cv-foot { display: flex; align-items: center; gap: 12px; border-top: 1px solid #ffffff0a; padding-top: 14px; }
.cv-hint { flex: 1; text-align: left; font-size: 11.5px; color: #6f7f93; line-height: 1.45; }
.cv-hint.warn { color: #ffca7a; }
.cv-cancel {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid #ffffff17;
  background: #ffffff0a;
  color: #c3d0e2;
  font-size: 12.5px;
}
.cv-cancel:active { background: #ffffff14; }
@media (max-width: 430px) {
  .cv-card { padding: 22px 18px 16px; }
  .cv-card h3 { font-size: 16px; }
}

/* ========================================= 20261122j 视觉打磨（页面美观） ==== */

/* 背景：在原有蓝绿光晕上补一层品牌红的极淡氛围光，让红色标不孤单 */
body {
  background:
    radial-gradient(1200px 560px at 6% -18%, #1e4a9c3d, transparent 60%),
    radial-gradient(900px 500px at 104% -8%, #22c7b80f, transparent 55%),
    radial-gradient(900px 560px at 96% 4%, #0c567329, transparent 58%),
    radial-gradient(700px 420px at 50% 118%, #0a1b3a2e, transparent 70%),
    var(--bg);
}

/* 顶栏：底边加一条很淡的渐变亮线，品牌标和状态之间不空 */
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #3f86ff33 12%, #2fd6c233 42%, transparent 88%);
  pointer-events: none;
}

/* 登录卡片：顶部一道高光边 + 更细腻的双层投影 */
.login {
  border-color: #24334a;
  box-shadow:
    0 40px 90px #0000008c,
    0 1px 0 #ffffff10 inset,
    0 0 0 1px #0c1520 inset,
    0 0 70px #0e2c5a2e;
  overflow: hidden;
}
.login::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #9dc0ff66, #ffffff26 55%, transparent);
  pointer-events: none;
}

/* 标题：极淡的银蓝渐变字，比纯白更有层次 */
.login h1 {
  background: linear-gradient(180deg, #f4f8ff 12%, #c9d9ee 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 特性列表：图标放进小圆角底板，行距更松弛 */
.feat li {
  align-items: center;
  font-size: 12.5px;
  color: #a3b1c4;
  padding: 2px 0;
}
.feat svg {
  width: 26px; height: 26px;
  padding: 6px;
  border-radius: 9px;
  border: 1px solid #4c8dff26;
  background: linear-gradient(160deg, #4c8dff18, #4c8dff07);
  color: #86b2ff;
  margin-top: 0;
  flex: 0 0 auto;
}

/* 输入框：平时更暗，悬停微亮，聚焦给一圈柔和光环 */
input, textarea {
  border-color: #22303f;
  background: #0a1119;
  transition: border-color .16s, box-shadow .18s, background .16s;
}
input:hover, textarea:hover { border-color: #2c3b4e; }
input:focus, textarea:focus {
  border-color: #4c8dff8c;
  background: #0b1420;
  box-shadow: 0 0 0 3px #4c8dff1f, 0 0 22px #2f6bdd26 inset;
}

/* 主按钮：顶部一道高光，底部压一点暗，更像可点的实体键 */
#connectBtn {
  position: relative;
  background: linear-gradient(180deg, #6aa1ff 0%, #3d7aec 50%, #2c62d6 100%);
  box-shadow:
    0 14px 34px #2f6bdd5c,
    0 1px 0 #ffffff4d inset,
    0 -14px 26px #1b4bb070 inset;
  overflow: hidden;
}
#connectBtn::after {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 42%;
  border-radius: 11px 11px 0 0;
  background: linear-gradient(180deg, #ffffff26, transparent);
  pointer-events: none;
}

/* 徽标：加一颗跳动的小点，暗示“一次性” */
.badge { border-color: #4c8dff3d; background: #4c8dff14; }
.badge::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #6ea4ff;
  box-shadow: 0 0 8px #6ea4ff;
}

/* 页脚信息条：文字调亮一档，不再像免责声明 */
.footnote { border-top-color: #ffffff12; }
.footnote span { border-color: #ffffff14; background: #ffffff0a; color: #7d8a9d; }

/* 画面容器：外发光更收敛，边框带一点由上到下的冷光 */
.viewport {
  border-color: #1b2634;
  box-shadow:
    0 30px 80px #00000078,
    0 0 0 1px #ffffff07 inset,
    0 0 60px #16305c33;
}

/* HUD：数值和单位分开看，单位灰一档 */
.hud { border-color: #1d2937; background: #0a111ad9; box-shadow: 0 1px 0 #ffffff08 inset; }

/* 工具栏：玻璃感更强，顶部加一条细高光 */
.toolbar {
  background: #0a1018de;
  box-shadow: 0 14px 36px #00000066, 0 1px 0 #ffffff0d inset;
}
.tool {
  transition: background .16s, border-color .16s, transform .16s, color .16s;
}

/* =================================== 20261122k 登录页重做（单列 · 更干净） ==== */

.login {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
  width: min(468px, 100%);
  padding: 0;
  border-radius: 22px;
  border: 1px solid #23324a;
  background: linear-gradient(180deg, #0d1624 0%, #0a1119 46%, #080d15 100%);
  box-shadow:
    0 44px 100px #0000008f,
    0 1px 0 #ffffff12 inset,
    0 0 90px #12316333;
  overflow: hidden;
}

/* 顶部品牌条：左标右状态，视觉重心不再悬空 */
.login-hero {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 20px 24px 18px;
  background:
    radial-gradient(460px 130px at 10% 0%, #3f86ff22, transparent 72%),
    linear-gradient(180deg, #101a29, #0c131d);
  border-bottom: 1px solid #ffffff10;
}
.login-hero .logo-lg {
  width: 32px;
  height: 32px;
  margin: 0;
  flex: 0 0 auto;
}
.hero-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero-name {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: .6px;
  color: #eff4fc;
}
.hero-sub { font-size: 11px; color: #7f8ea3; letter-spacing: .4px; }
.hero-pill {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #37d99b3d;
  background: #37d99b14;
  color: #7fe6bd;
  font-size: 10.5px;
  white-space: nowrap;
}

/* 表单区：留白更大，层级从“标签→字段→按钮”一条线走下来 */
.login-body {
  padding: 28px 26px 24px;
  justify-content: flex-start;
}
.login h1 {
  font-size: 23px;
  line-height: 1.4;
  font-weight: 650;
  color: #f2f7ff;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  letter-spacing: .2px;
  margin: 0 0 8px;
}
.sub { color: #8fa0b5; font-size: 12.5px; line-height: 1.7; margin-bottom: 22px; }

/* 输出框更高更“厚”，贴纸感 */
.login input { height: 52px; font-size: 15px; border-radius: 12px; }
.login #connectBtn { height: 54px; font-size: 15px; border-radius: 13px; }

/* 页脚三枚标签改成实心小胶囊，收在卡片底部 */
.footnote {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid #ffffff10;
  gap: 8px;
}
.footnote span {
  padding: 4px 10px;
  font-size: 10.5px;
  border-radius: 8px;
  border: 1px solid #ffffff12;
  background: #ffffff08;
  color: #7b889b;
}

/* 徽标：贴纸式，不再是一行小字 */
.badge {
  padding: 5px 11px 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .login { width: min(468px, 100%); border-radius: 20px; }
  .login-hero { padding: 16px 18px 14px; }
  .login-hero .logo-lg { width: 28px; height: 28px; }
  .hero-name { font-size: 14px; }
  .login-body { padding: 22px 20px 20px; }
  .login h1 { font-size: 20px; }
  .login input { height: 50px; font-size: 15px; }
  .login #connectBtn { height: 52px; }
  /* 小屏留出呼吸空间，卡片不要贴边 */
  .stage { padding: 14px 14px calc(10px + var(--safe-bottom)); }
}
@media (max-width: 380px) {
  .hero-pill { display: none; }
  .login-body { padding: 18px 16px 16px; }
  .login h1 { font-size: 18.5px; }
  .sub { font-size: 12px; margin-bottom: 16px; }
}

/* 超矮屏（横屏手机）压缩品牌条 */
@media (max-height: 620px) and (orientation: landscape) {
  .login-hero { display: none; }
  .login-body { padding: 16px 20px; }
  .login h1 { font-size: 18px; }
  .login .sub { display: none; }
}

/* ============================ 20261122l 大屏构图（别让卡片孤零零挂在黑底上） ==== */

.stage { position: relative; }
.login { position: relative; z-index: 1; }

@media (min-width: 901px) {
  /* 极淡的网格 + 右下角巨大 A2+ 水印，给大屏一点纵深，不抢内容 */
  .stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(#ffffff0d 1px, transparent 1px),
      linear-gradient(90deg, #ffffff0d 1px, transparent 1px);
    background-size: 72px 72px;
    -webkit-mask-image: radial-gradient(72% 62% at 50% 46%, #000 24%, transparent 76%);
    mask-image: radial-gradient(72% 62% at 50% 46%, #000 24%, transparent 76%);
    opacity: .55;
    pointer-events: none;
  }

/* 大屏上卡片跟着放大一档，不然显得空 */
@media (min-width: 1200px) {
  .login { width: min(520px, 100%); }
  .login-hero { padding: 24px 28px 20px; }
  .login-hero .logo-lg { width: 36px; height: 36px; }
  .hero-name { font-size: 16.5px; }
  .hero-sub { font-size: 11.5px; }
  .login-body { padding: 32px 30px 28px; }
  .login h1 { font-size: 25px; }
  .sub { font-size: 13px; margin-bottom: 24px; }
  .login input { height: 56px; font-size: 15.5px; }
  .login #connectBtn { height: 56px; font-size: 15.5px; }
  .badge { font-size: 11.5px; }
}

/* ==================================== 20261122o 画面缩放（Ctrl+滚轮） ==== */

.zoom-pill {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 18;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid #ffffff1f;
  background: #0b121ce6;
  color: #cbd8ea;
  font-size: 11px;
  letter-spacing: .4px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.zoom-pill:active { background: #16202e; }
