/* Isolated login presentation; workspace themes and the payment gate are unchanged. */
#authGate.login-gate {
  --login-bg: #0d1011;
  --login-ink: #f0f3f4;
  --login-muted: #a3adab;
  --login-line: #303c39;
  --login-accent: #8ce9bd;
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: none;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  isolation: isolate;
  background: var(--login-bg);
  color: var(--login-ink);
  color-scheme: dark;
  font-family: "IBM Plex Sans", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}
#authGate *, #authGate *::before, #authGate *::after { box-sizing: border-box; letter-spacing: 0; }
#authGate .login-canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
#authGate .login-masthead,
#authGate .login-footer { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 20px; }
#authGate .login-masthead { min-height: 104px; padding: max(24px, env(safe-area-inset-top)) 48px 24px; }
#authGate .login-wordmark { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 20px; font: 500 20px/1.4 "IBM Plex Mono", monospace; }
#authGate .login-wordmark-sep { height: 16px; width: 1px; background: #3a4b41; }
#authGate .login-edition { font-size: 11px; color: var(--login-muted); }
#authGate .login-main { position: relative; display: flex; align-items: center; width: min(1160px, calc(100% - 128px)); min-height: 580px; flex: 1 0 auto; margin: 0 auto; padding: 40px 0 64px; }
#authGate .gate-card.login-access {
  position: relative;
  width: 400px;
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: transparent !important;
  color: var(--login-ink);
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none;
}
#authGate .login-eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 25px; color: var(--login-muted); font-size: 12px; line-height: 1.5; }
#authGate .login-eyebrow > span { width: 5px; height: 5px; background: var(--login-accent); }
#authGate .gate-brand.brand-v2 { justify-content: flex-start; gap: 14px; padding: 0; margin: 0 0 30px; }
#authGate .gate-brand h1 { margin: 0; font-size: 44px; font-weight: 650; line-height: 1.3; }
#authGate .brand-name { color: var(--login-ink); font-size: inherit; font-weight: inherit; line-height: inherit; }
#authGate .gate-symbol { width: 48px; height: 48px; flex: 0 0 48px; }
#authGate .login-welcome { margin: 0 0 9px; font-size: 19px; font-weight: 500; line-height: 1.5; color: var(--login-ink); }
#authGate .gate-trial-hint { margin: 0 0 32px; color: var(--login-muted); font-size: 12px; text-align: left; line-height: 1.7; }
#authGate .login-fields { display: flex; flex-direction: column; }
#authGate .gate-card .gate-field { display: block; margin: 0 0 9px; color: #c6d2cb; font-size: 13px; line-height: 1.5; }
#authGate .login-input-wrap { position: relative; margin-bottom: 21px; width: 100%; }
#authGate .login-input-wrap > svg { position: absolute; top: 17px; left: 16px; width: 18px; height: 18px; color: #81978a; pointer-events: none; }
#authGate .gate-card input[type="text"],
#authGate .gate-card input[type="password"] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 52px;
  min-height: 52px;
  padding: 0 48px 0 46px;
  border: 1px solid var(--login-line) !important;
  border-radius: 6px !important;
  background: #141c1c !important;
  color: var(--login-ink) !important;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 160ms, box-shadow 160ms, background 160ms;
}
#authGate input::placeholder { color: #74867b; opacity: 1; }
#authGate .gate-card input:hover { border-color: #4c6556 !important; }
#authGate .gate-card input:focus-visible { border-color: var(--login-accent) !important; box-shadow: 0 0 0 3px rgb(140 233 189 / 12%); background: #192322 !important; }
#authGate .gate-card input.invalid { border-color: #f08e87 !important; box-shadow: none !important; }
#authGate .gate-card input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px #192322 inset; -webkit-text-fill-color: var(--login-ink); caret-color: var(--login-ink); }
#authGate .login-icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  border: 1px solid #2a3a31;
  border-radius: 6px;
  background: #101913;
  color: #aabdb0;
  cursor: pointer;
}
#authGate .login-icon-button[hidden] { display: none; }
#authGate .login-icon-button:hover { color: var(--login-ink); border-color: #718e79; }
#authGate .login-icon-button:focus-visible { outline: 2px solid var(--login-accent); outline-offset: 3px; }
#authGate .login-icon-button svg { width: 17px; height: 17px; pointer-events: none; }
#authGate .login-icon-button::after { content: attr(aria-label); position: absolute; z-index: 2; top: calc(100% + 8px); right: 0; width: max-content; max-width: 180px; padding: 6px 9px; border: 1px solid #3c5042; border-radius: 4px; background: #152019; color: var(--login-ink); font-size: 12px; line-height: 1.5; visibility: hidden; opacity: 0; pointer-events: none; }
#authGate .login-icon-button:hover::after, #authGate .login-icon-button:focus-visible::after { visibility: visible; opacity: 1; }
#authGate .login-password-toggle { position: absolute; top: 6px; right: 6px; border: 0; background: transparent; }
#authGate .gate-err { margin: -4px 0 16px; color: #ffaaa0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
#authGate .gate-card .row.login-actions { position: relative; display: flex; margin: 5px 0 20px; }
#authGate #btnLogin { width: 100%; height: 52px; min-height: 52px; padding: 0 52px; border: 1px solid #a6f2cd; border-radius: 6px !important; background: var(--login-accent) !important; color: #112b1c !important; font-size: 15px; font-weight: 650; line-height: 1.4; text-align: center; transition: background 160ms, box-shadow 160ms; }
#authGate #btnLogin:hover { background: #b0f3d1 !important; box-shadow: 0 0 26px rgb(140 233 189 / 10%); }
#authGate #btnLogin:focus-visible { outline: 2px solid var(--login-ink); outline-offset: 4px; }
#authGate #btnLogin:disabled { opacity: 0.65; cursor: wait; }
#authGate .login-submit-arrow { position: absolute; top: 17px; right: 18px; width: 18px; height: 18px; color: #183e29; pointer-events: none; }
#authGate .login-actions:has(#btnLogin:disabled) .login-submit-arrow { opacity: 0.35; }
#authGate .login-mode-switch { margin: -8px 0 14px; text-align: center; line-height: 1.7; }
#authGate .login-mode-link {
  display: inline-block;
  margin: 0;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: #b7e7cb;
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
#authGate .login-mode-link:hover { color: #d7f6e4; }
#authGate .login-mode-link:focus-visible { outline: 2px solid var(--login-ink); outline-offset: 3px; border-radius: 4px; }
#authGate[data-auth-mode="register"] .login-welcome { letter-spacing: 0.01em; }
#authGate .gate-contact { margin: 0; color: #a8b9ae; font-size: 15px; line-height: 1.75; text-align: center; user-select: text; }
#authGate .gate-contact span { color: #e2ebe5; font-weight: 600; }
#authGate .gate-contact a { color: #e8f5ee; font-size: 16px; font-weight: 700; letter-spacing: 0.02em; text-decoration: none; pointer-events: auto; }
#authGate .gate-contact a:hover { text-decoration: underline; }
/* 登录模式提示；注册模式隐藏（无自助重置） */
#authGate[data-auth-mode="register"] .gate-contact { display: none; }
#authGate .login-field-caption { position: absolute; right: -22px; bottom: 54px; display: flex; flex-direction: column; gap: 7px; width: 330px; color: #a9bdac; font: 400 12px/1.5 "IBM Plex Mono", monospace; pointer-events: none; }
#authGate .login-caption-index { margin-bottom: 2px; color: #7e9d86; font-size: 11px; }
#authGate .login-simulation { color: #71877a; font-size: 10px; }
#authGate .login-footer { min-height: 76px; margin: 0 48px; padding: 20px 0 max(20px, env(safe-area-inset-bottom)); border-top: 1px solid #213027; color: #789080; font: 400 11px/1.7 "IBM Plex Mono", monospace; }
#authGate .gate-safety { margin: 0; color: #9aad9e; font-family: "IBM Plex Sans", sans-serif; font-size: 12px; text-align: left; line-height: 1.7; }
@media (min-width: 1600px) {
  #authGate .login-main { width: min(1280px, calc(100% - 192px)); }
  #authGate .gate-card.login-access { width: 420px; }
  #authGate .gate-brand h1 { font-size: 48px; }
}
@media (max-width: 1000px) {
  #authGate .login-main { width: calc(100% - 96px); }
  #authGate .login-field-caption { right: 0; width: 230px; font-size: 11px; }
}
@media (max-width: 760px) {
  #authGate .login-masthead { min-height: 80px; padding: max(20px, env(safe-area-inset-top)) 24px 16px; }
  #authGate .login-wordmark { gap: 12px; font-size: 17px; }
  #authGate .login-edition { font-size: 9px; }
  #authGate .login-wordmark-sep { height: 12px; }
  #authGate .login-main { width: calc(100% - 48px); min-height: 570px; padding: 30px 0 44px; }
  #authGate .gate-card.login-access { width: 400px; margin: auto; }
  #authGate .gate-brand h1 { font-size: 38px; }
  #authGate .gate-brand.brand-v2 { gap: 12px; margin-bottom: 26px; }
  #authGate .login-eyebrow { margin-bottom: 23px; }
  #authGate .gate-trial-hint { margin-bottom: 28px; }
  #authGate .login-field-caption { display: none; }
  #authGate .login-footer { margin: 0 24px; min-height: 70px; padding-top: 16px; align-items: flex-start; }
  #authGate .login-footer > span { display: none; }
  #authGate .gate-card input[type="text"], #authGate .gate-card input[type="password"] { font-size: 16px; border-radius: 6px; }
  #authGate .login-icon-button { width: 44px; height: 44px; flex-basis: 44px; }
  #authGate .login-password-toggle { top: 4px; right: 4px; }
}
@media (max-width: 360px) {
  #authGate .login-edition, #authGate .login-wordmark-sep { display: none; }
  #authGate .gate-brand h1 { font-size: 32px; }
  #authGate .gate-symbol { width: 40px; height: 40px; flex-basis: 40px; }
  #authGate .login-main { min-height: 540px; }
  #authGate .gate-trial-hint { font-size: 11px; }
}
@media (max-height: 720px) and (min-width: 761px) {
  #authGate .login-masthead { min-height: 76px; padding-top: 18px; padding-bottom: 18px; }
  #authGate .login-main { min-height: 520px; padding-top: 20px; padding-bottom: 32px; }
  #authGate .login-footer { min-height: 60px; padding-top: 14px; padding-bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  #authGate input, #authGate button { transition: none !important; }
}
