:root {
  color-scheme: light;
  --auth-bg: #f8fafc;
  --auth-ink: #101722;
  --auth-muted: #657286;
  --auth-soft: #8a96a8;
  --auth-line: rgba(44, 67, 104, 0.1);
  --auth-indigo: #1769ee;
  --auth-cyan: #25bec8;
  --auth-error: #c83f50;
  --auth-surface: rgba(255, 255, 255, 0.86);
  --auth-input: rgba(249, 251, 254, 0.94);
  --auth-shadow: 0 28px 72px rgba(57, 82, 122, 0.13);
  --font-sans: Inter, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", system-ui, -apple-system, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --auth-bg: #151b26;
  --auth-ink: #f3f6fc;
  --auth-muted: #a8b4c6;
  --auth-soft: #7f8ba0;
  --auth-line: rgba(206, 218, 244, 0.14);
  --auth-indigo: #78a2ff;
  --auth-cyan: #52d0d8;
  --auth-error: #ff8794;
  --auth-surface: rgba(29, 38, 53, 0.82);
  --auth-input: rgba(18, 25, 36, 0.82);
  --auth-shadow: 0 28px 72px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--auth-bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--auth-ink);
  background: var(--auth-bg);
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  color: #fff;
  background: #101722;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.auth-page {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #fff;
}

.ambient-scene {
  position: absolute;
  z-index: -3;
  inset: -4%;
  pointer-events: none;
  background:
    radial-gradient(62% 78% at 12% 19%, rgba(91, 116, 236, 0.12), transparent 70%),
    radial-gradient(56% 74% at 78% 88%, rgba(37, 190, 200, 0.13), transparent 72%),
    linear-gradient(90deg, rgba(250, 251, 255, 0.94) 0 52%, rgba(247, 251, 255, 0.92) 52% 100%);
  animation: field-drift 14s ease-in-out infinite alternate;
  will-change: transform;
}

.ambient-plane,
.ambient-sweep {
  display: none;
}

:root[data-theme="dark"] .auth-page {
  background: var(--auth-bg);
}

:root[data-theme="dark"] .ambient-scene {
  background:
    radial-gradient(62% 78% at 12% 19%, rgba(73, 91, 182, 0.2), transparent 70%),
    radial-gradient(56% 74% at 78% 88%, rgba(24, 128, 139, 0.17), transparent 72%),
    linear-gradient(90deg, rgba(21, 27, 38, 0.98) 0 52%, rgba(18, 24, 35, 0.97) 52% 100%);
}

.auth-header {
  position: absolute;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(520px, 1.04fr) minmax(460px, 0.96fr);
  pointer-events: none;
}

.brand-lockup,
.header-actions {
  pointer-events: auto;
}

.brand-lockup {
  display: inline-flex;
  width: fit-content;
  margin-top: clamp(32px, 4vw, 56px);
  margin-left: clamp(44px, 6vw, 104px);
  align-items: center;
  gap: 11px;
  color: var(--auth-ink);
  font-size: 18px;
  font-weight: 760;
  line-height: 1;
  text-decoration: none;
}

.brand-lockup img {
  display: block;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-word {
  transform: translateY(-1px);
}

.header-actions {
  display: flex;
  width: min(460px, calc(100% - 64px));
  min-height: 38px;
  margin-top: clamp(44px, 4.8vw, 64px);
  align-items: center;
  justify-self: center;
  gap: 8px;
}

.portal-link,
.icon-control {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: var(--auth-muted);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease;
}

.portal-link {
  gap: 7px;
  padding: 0 8px 0 0;
}

.portal-link svg,
.icon-control svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.portal-link:hover,
.icon-control:hover,
.language-picker.is-open .language-trigger {
  color: var(--auth-indigo);
  background: rgba(255, 255, 255, 0.54);
}

:root[data-theme="dark"] .portal-link:hover,
:root[data-theme="dark"] .icon-control:hover,
:root[data-theme="dark"] .language-picker.is-open .language-trigger {
  background: rgba(255, 255, 255, 0.06);
}

.language-picker {
  position: relative;
  margin-left: auto;
}

.language-trigger {
  min-width: 62px;
  padding: 0 8px;
  gap: 6px;
}

.language-trigger > span {
  min-width: 19px;
  text-align: center;
}

.language-trigger .chevron {
  width: 13px;
  height: 13px;
  transition: transform 180ms ease;
}

.language-picker.is-open .chevron {
  transform: rotate(180deg);
}

.language-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: 150px;
  padding: 6px;
  border: 1px solid rgba(76, 104, 148, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(57, 82, 122, 0.15);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  transition: opacity 160ms ease, transform 160ms ease;
}

:root[data-theme="dark"] .language-menu {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(29, 38, 53, 0.95);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.language-picker.is-open .language-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.language-menu button {
  display: grid;
  min-height: 38px;
  padding: 0 9px;
  grid-template-columns: 30px 1fr;
  align-items: center;
  border-radius: 5px;
  color: var(--auth-muted);
  background: transparent;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.language-menu button:hover,
.language-menu button[aria-selected="true"] {
  color: var(--auth-ink);
  background: rgba(23, 105, 238, 0.07);
}

.language-menu button b {
  font-weight: 650;
}

.theme-toggle {
  width: 36px;
  flex: 0 0 36px;
}

.auth-layout {
  display: grid;
  min-height: 100svh;
  grid-template-columns: minmax(520px, 1.04fr) minmax(460px, 0.96fr);
}

.brand-stage {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(32px, 4vw, 56px) clamp(44px, 6vw, 104px);
  flex-direction: column;
  isolation: isolate;
}

.brand-stage::before {
  position: absolute;
  z-index: -2;
  inset: 10% -10% 5% -8%;
  background-image:
    linear-gradient(rgba(50, 91, 158, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(50, 91, 158, 0.055) 1px, transparent 1px);
  background-size: 38px 38px;
  content: "";
  mask-image: linear-gradient(110deg, transparent 4%, #000 27%, #000 70%, transparent 96%);
  -webkit-mask-image: linear-gradient(110deg, transparent 4%, #000 27%, #000 70%, transparent 96%);
  opacity: 0.72;
  transform: perspective(900px) rotateX(57deg) rotateZ(-7deg) translate3d(-2%, 4%, 0);
  transform-origin: 50% 60%;
  animation: grid-drift 13s ease-in-out infinite alternate;
}

.brand-stage::after {
  position: absolute;
  z-index: -1;
  inset: -28% -36%;
  background: linear-gradient(108deg, transparent 40%, rgba(82, 116, 245, 0.035) 45%, rgba(86, 158, 238, 0.12) 49%, rgba(37, 190, 200, 0.08) 53%, transparent 59%);
  content: "";
  opacity: 0;
  transform: translate3d(-24%, 0, 0);
  animation: ribbon-pass 10s ease-in-out 1.4s infinite;
}

:root[data-theme="dark"] .brand-stage::before {
  background-image:
    linear-gradient(rgba(142, 166, 214, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(142, 166, 214, 0.07) 1px, transparent 1px);
}

.stage-story {
  position: relative;
  top: -76px;
  width: min(560px, 100%);
  margin: auto 0;
  padding: 12px 0;
  animation: rise 720ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.stage-copy {
  width: 100%;
}

.stage-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--auth-indigo);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.stage-kicker i {
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, rgba(23, 105, 238, 0.18), var(--auth-indigo));
  transform-origin: right center;
  animation: eyebrow-line 3.2s ease-in-out infinite;
}

.stage-kicker b {
  font-weight: inherit;
}

.stage-copy h1 {
  max-width: 550px;
  margin: 16px 0 0;
  color: var(--auth-ink);
  font-size: 56px;
  font-weight: 850;
  line-height: 1.04;
}

.stage-copy h1:lang(zh) {
  max-width: none;
  font-size: 52px;
  white-space: nowrap;
}

.stage-copy p {
  max-width: 540px;
  margin: 20px 0 0;
  color: var(--auth-muted);
  font-size: 16px;
  font-weight: 450;
  line-height: 1.7;
}

.model-field {
  position: relative;
  width: min(560px, 100%);
  height: clamp(340px, 34vw, 420px);
  max-width: 560px;
  margin-top: 26px;
  isolation: isolate;
}

.field-grid {
  display: none;
}

.field-aura {
  position: absolute;
  z-index: -1;
  inset: 3% -3% 0 6%;
  border-radius: 50%;
  background:
    radial-gradient(38% 54% at 18% 50%, rgba(23, 105, 238, 0.14), transparent 72%),
    radial-gradient(34% 48% at 74% 45%, rgba(91, 116, 236, 0.12), transparent 74%),
    radial-gradient(24% 42% at 92% 62%, rgba(37, 190, 200, 0.13), transparent 76%);
  filter: blur(18px);
  opacity: 0.72;
  pointer-events: none;
  transform: scale(0.98);
  animation: route-aura 7.6s ease-in-out infinite alternate;
}

.route-map {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.route-wave {
  fill: none;
  stroke-width: 1.05;
  stroke-linecap: round;
  opacity: 0;
  transform-box: view-box;
  transform-origin: 68px 130px;
  vector-effect: non-scaling-stroke;
  animation: signal-wave 7.2s cubic-bezier(0.18, 0.58, 0.28, 1) infinite;
}

.wave-one {
  stroke: rgba(23, 105, 238, 0.64);
}

.wave-two {
  stroke: rgba(91, 116, 236, 0.56);
  animation-delay: -2.4s;
}

.wave-three {
  stroke: rgba(37, 190, 200, 0.6);
  animation-delay: -4.8s;
}

.route-origin {
  fill: #fff;
  stroke: rgba(23, 105, 238, 0.72);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: signal-origin 2.8s ease-in-out infinite;
}

:root[data-theme="dark"] .route-origin {
  fill: #27344a;
}

.route-scan {
  position: absolute;
  z-index: 1;
  top: 7%;
  bottom: 7%;
  left: 56px;
  width: 132px;
  background: linear-gradient(90deg, transparent, rgba(91, 116, 236, 0.08) 34%, rgba(37, 190, 200, 0.16) 52%, transparent 100%);
  filter: blur(12px);
  mask-image: linear-gradient(180deg, transparent, #000 18% 82%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18% 82%, transparent);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-150px, 0, 0) skewX(-8deg);
  animation: signal-scan 9.2s ease-in-out 1.1s infinite;
}

.gateway-node {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 8px;
  display: flex;
  width: 118px;
  height: 118px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 35%, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.82) 58%, rgba(231, 242, 255, 0.5));
  box-shadow: inset 0 0 0 1px rgba(91, 116, 236, 0.12), 0 22px 45px rgba(41, 88, 156, 0.11);
  isolation: isolate;
  transform: translateY(-50%);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
}

.gateway-node::before {
  position: absolute;
  z-index: -1;
  inset: -10px;
  padding: 1px;
  border-radius: 50%;
  background: conic-gradient(from 40deg, transparent 0 18%, rgba(23, 105, 238, 0.62) 31%, rgba(37, 190, 200, 0.7) 46%, transparent 62% 100%);
  content: "";
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  opacity: 0.68;
  pointer-events: none;
  animation: endpoint-orbit 8s linear infinite;
}

.gateway-halo {
  position: absolute;
  z-index: -2;
  inset: -24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(23, 105, 238, 0.16), rgba(37, 190, 200, 0.07) 42%, transparent 72%);
  filter: blur(6px);
  opacity: 0.72;
  animation: endpoint-halo 3.6s ease-in-out infinite;
}

:root[data-theme="dark"] .gateway-node {
  background: radial-gradient(circle at 42% 35%, rgba(58, 73, 98, 0.92), rgba(32, 43, 61, 0.82));
}

.gateway-node img {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  object-fit: contain;
  animation: endpoint-logo 4.6s ease-in-out infinite;
}

.gateway-node small {
  position: relative;
  z-index: 1;
  margin-top: 9px;
  color: var(--auth-muted);
  font-size: 9px;
  font-weight: 750;
}

.gateway-node code {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  color: var(--auth-ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.model-node {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  min-width: 70px;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  color: var(--auth-muted);
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, -50%);
  animation: model-float var(--float-duration, 4.8s) ease-in-out var(--float-delay, -0.5s) infinite alternate;
  will-change: transform;
}

.model-mark {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(81, 94, 142, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 20px rgba(57, 82, 122, 0.09), inset 0 1px rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: model-pulse var(--pulse-duration, 6.2s) ease-in-out var(--pulse-delay, -0.5s) infinite;
}

:root[data-theme="dark"] .model-mark {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(43, 54, 72, 0.78);
}

.model-mark img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.model-mark img.theme-model-mark-dark {
  display: none;
}

:root[data-theme="dark"] .model-mark img.theme-model-mark-light {
  display: none;
}

:root[data-theme="dark"] .model-mark img.theme-model-mark-dark {
  display: block;
}

.model-mark-kimi img {
  width: 24px;
  height: 24px;
}

.model-mark-glm img {
  width: 23px;
  height: 20px;
}

.model-node small {
  font-size: 10px;
  font-weight: 750;
  opacity: 0.7;
  white-space: nowrap;
  animation: label-pulse var(--pulse-duration, 6.2s) ease-in-out var(--pulse-delay, -0.5s) infinite;
}

.node-openai { top: 20%; left: 49%; --float-duration: 4.2s; --float-delay: 0s; --pulse-duration: 5.4s; --pulse-delay: 0s; }
.node-claude { top: 20%; left: 75%; --float-duration: 4.75s; --float-delay: -0.43s; --pulse-duration: 6.2s; --pulse-delay: -0.77s; }
.node-grok { top: 50%; left: 37%; --float-duration: 5.3s; --float-delay: -0.86s; --pulse-duration: 7s; --pulse-delay: -1.54s; }
.node-gemini { top: 50%; left: 62%; --float-duration: 5.85s; --float-delay: -1.29s; --pulse-duration: 5.4s; --pulse-delay: -2.31s; }
.node-kimi { top: 50%; left: 87%; --float-duration: 4.2s; --float-delay: -1.72s; --pulse-duration: 6.2s; --pulse-delay: -3.08s; }
.node-deepseek { top: 80%; left: 49%; --float-duration: 4.75s; --float-delay: -2.15s; --pulse-duration: 7s; --pulse-delay: -3.85s; }
.node-glm { top: 80%; left: 75%; --float-duration: 5.3s; --float-delay: -2.58s; --pulse-duration: 5.4s; --pulse-delay: -4.62s; }

.stage-footer {
  display: flex;
  margin-top: 46px;
  flex-wrap: wrap;
  gap: 10px 22px;
  color: var(--auth-muted);
  font-size: 14px;
  font-weight: 650;
}

.stage-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stage-note svg {
  width: 16px;
  height: 16px;
  color: var(--auth-indigo);
}

.stage-state {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: -1px;
  padding: 0;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.stage-copyright {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--auth-muted);
  font-size: 11px;
}

.auth-workspace {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  min-height: 100svh;
  height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 96px clamp(32px, 6vw, 96px) 68px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  scrollbar-width: thin;
}

.auth-panel {
  position: relative;
  width: min(460px, 100%);
  padding: 40px 38px;
  border: 1px solid rgba(76, 104, 148, 0.11);
  border-radius: 8px;
  background: var(--auth-surface);
  box-shadow: var(--auth-shadow), inset 0 1px rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  animation: rise 720ms cubic-bezier(0.2, 0.75, 0.2, 1) 80ms both;
}

:root[data-theme="dark"] .auth-panel {
  border-color: rgba(255, 255, 255, 0.11);
  box-shadow: var(--auth-shadow), inset 0 1px rgba(255, 255, 255, 0.08);
}

.spectral-rail,
.view-index {
  display: none;
}

.auth-view {
  width: 100%;
}

.auth-view.is-active {
  animation: view-enter 260ms ease both;
}

.auth-view h2:focus {
  outline: none;
}

.view-heading {
  margin-bottom: 52px;
  text-align: left;
}

.view-heading h2 {
  margin: 0;
  color: var(--auth-ink);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.view-heading > p {
  margin: 8px 0 0;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.5;
}

.view-heading strong {
  color: var(--auth-ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.auth-view form {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.field {
  min-width: 0;
}

.field label,
.label-row > label {
  display: block;
  margin-bottom: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
}

:root[data-theme="dark"] .field label,
:root[data-theme="dark"] .label-row > label {
  color: #cad4e4;
}

.label-row {
  display: flex;
  margin-bottom: 8px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.label-row > label {
  margin-bottom: 0;
}

.label-row > span {
  color: var(--auth-soft);
  font-size: 12px;
}

.input-shell {
  position: relative;
  display: flex;
  min-height: 52px;
  align-items: center;
  border: 1px solid rgba(74, 88, 137, 0.18);
  border-radius: 8px;
  background: var(--auth-input);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

:root[data-theme="dark"] .input-shell {
  border-color: rgba(206, 218, 244, 0.16);
}

.input-shell:hover {
  border-color: rgba(23, 105, 238, 0.38);
}

.input-shell:focus-within {
  border-color: rgba(52, 64, 84, 0.34);
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.38),
    0 8px 22px rgba(39, 55, 73, 0.055);
}

:root[data-theme="dark"] .input-shell:focus-within {
  border-color: rgba(222, 232, 242, 0.32);
  background: rgba(17, 29, 39, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    0 9px 24px rgba(0, 0, 0, 0.16);
}

.input-shell > svg {
  width: 18px;
  height: 18px;
  margin-left: 14px;
  flex: 0 0 auto;
  color: #a5b0c1;
}

.input-shell input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 14px;
  border: 0;
  outline: 0;
  color: var(--auth-ink);
  background: transparent;
  font-size: 14px;
  line-height: 20px;
}

.input-shell input::placeholder {
  color: #a9b3c2;
  opacity: 1;
}

:root[data-theme="dark"] .input-shell input::placeholder {
  color: #7f8ba0;
}

.input-readonly {
  opacity: 0.82;
}

.password-toggle {
  display: inline-flex;
  width: 44px;
  height: 50px;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  color: #9aa6b8;
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--auth-indigo);
}

.password-toggle svg {
  width: 17px;
  height: 17px;
}

.text-action,
.route-switch button,
.verify-actions button,
.back-action {
  padding: 0;
  color: var(--auth-indigo);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.text-action:hover,
.route-switch button:hover,
.verify-actions button:hover,
.back-action:hover {
  color: #0d5bd8;
}

:root[data-theme="dark"] .text-action:hover,
:root[data-theme="dark"] .route-switch button:hover,
:root[data-theme="dark"] .verify-actions button:hover,
:root[data-theme="dark"] .back-action:hover {
  color: #a9c2ff;
}

.field-hint,
.field-error {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.field-hint {
  color: var(--auth-soft);
}

.field-error {
  color: var(--auth-error);
}

.field-error:empty {
  display: none;
}

.field.has-error .input-shell,
.otp-field.has-error .otp-shell {
  border-color: var(--auth-error);
  box-shadow: 0 0 0 3px rgba(200, 63, 80, 0.1);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  width: 100%;
  min-height: 50px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 750;
  line-height: 20px;
  cursor: pointer;
  transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.primary-button {
  color: #fff;
  background: #1769ee;
  box-shadow: 0 14px 28px rgba(23, 105, 238, 0.22);
}

.primary-button:hover {
  background: #0d5bd8;
  box-shadow: 0 16px 34px rgba(23, 105, 238, 0.28);
  transform: translateY(-1px);
}

:root[data-theme="dark"] .primary-button {
  color: #0d1727;
  background: #78a2ff;
  box-shadow: 0 14px 28px rgba(46, 91, 184, 0.28);
}

:root[data-theme="dark"] .primary-button:hover {
  background: #91b3ff;
}

.secondary-button {
  border: 1px solid rgba(74, 88, 137, 0.15);
  color: var(--auth-ink);
  background: rgba(255, 255, 255, 0.62);
}

:root[data-theme="dark"] .secondary-button {
  border-color: rgba(206, 218, 244, 0.14);
  background: rgba(42, 53, 71, 0.76);
}

.secondary-button:hover {
  transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(0);
}

.primary-button svg,
.secondary-button svg {
  width: 17px;
  height: 17px;
}

.primary-button[aria-busy="true"] {
  cursor: wait;
}

.primary-button[aria-busy="true"] svg {
  display: none;
}

.primary-button[aria-busy="true"]::after {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  animation: button-spin 680ms linear infinite;
}

.route-switch {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  margin: 0;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  transform: translateY(58px);
}

.route-switch button {
  margin-left: 6px;
  font-size: 14px;
}

.back-action {
  display: inline-flex;
  margin: 0 0 28px;
  align-items: center;
  gap: 7px;
  color: var(--auth-muted);
}

.back-action svg {
  width: 16px;
  height: 16px;
}

.otp-shell {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  cursor: text;
}

.otp-shell input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.otp-shell > span {
  display: grid;
  aspect-ratio: 1 / 1.08;
  place-items: center;
  border: 1px solid rgba(74, 88, 137, 0.18);
  border-radius: 8px;
  background: var(--auth-input);
  color: var(--auth-ink);
  font-size: 19px;
  font-weight: 750;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.otp-shell > span::after {
  content: attr(data-digit);
}

.otp-shell:focus-within > span.is-current {
  border-color: var(--auth-indigo);
  box-shadow: 0 0 0 3px rgba(93, 100, 216, 0.12);
}

.otp-shell > span.is-filled {
  border-color: rgba(23, 105, 238, 0.35);
}

.verify-actions {
  display: flex;
  margin-top: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.verify-actions button:disabled {
  color: var(--auth-soft);
  cursor: not-allowed;
}

.result-mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  place-items: center;
  border: 1px solid rgba(23, 105, 238, 0.18);
  border-radius: 50%;
  color: var(--auth-indigo);
  background: rgba(23, 105, 238, 0.07);
}

.result-mark svg {
  width: 22px;
  height: 22px;
}

.result-complete {
  color: #168769;
  border-color: rgba(22, 135, 105, 0.2);
  background: rgba(22, 135, 105, 0.08);
}

.result-heading {
  margin-bottom: 32px;
}

.workspace-footer {
  display: none;
}

.prototype-toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  display: flex;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(76, 104, 148, 0.13);
  border-radius: 8px;
  color: var(--auth-ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 46px rgba(57, 82, 122, 0.18);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: opacity 180ms ease, transform 180ms ease;
}

:root[data-theme="dark"] .prototype-toast {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(29, 38, 53, 0.95);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.36);
}

.prototype-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.prototype-toast svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--auth-indigo);
}

.prototype-toast button {
  margin-left: 4px;
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes field-drift {
  from { transform: translate3d(-1%, 0, 0) scale(1.01); }
  to { transform: translate3d(1.5%, -1%, 0) scale(1.035); }
}

@keyframes grid-drift {
  from { background-position: 0 0, 0 0; transform: perspective(900px) rotateX(57deg) rotateZ(-7deg) translate3d(-2%, 4%, 0); }
  to { background-position: 19px 10px, 19px 10px; transform: perspective(900px) rotateX(57deg) rotateZ(-6deg) translate3d(1%, 1%, 0); }
}

@keyframes ribbon-pass {
  0%, 56% { opacity: 0; transform: translate3d(-24%, 0, 0); }
  64% { opacity: 0.85; }
  88%, 100% { opacity: 0; transform: translate3d(24%, 0, 0); }
}

@keyframes eyebrow-line {
  0%, 100% { opacity: 0.45; transform: scaleX(0.72); }
  50% { opacity: 1; transform: scaleX(1); }
}

@keyframes route-aura {
  from { opacity: 0.54; transform: translate3d(-1%, 1%, 0) scale(0.97); }
  to { opacity: 0.82; transform: translate3d(1.5%, -1%, 0) scale(1.03); }
}

@keyframes signal-wave {
  0% { opacity: 0; transform: scale(0.18); }
  13% { opacity: 0.64; }
  62% { opacity: 0.28; }
  100% { opacity: 0; transform: scale(1.08); }
}

@keyframes signal-origin {
  0%, 100% { opacity: 0.48; transform: scale(0.78); }
  50% { opacity: 1; transform: scale(1.32); }
}

@keyframes signal-scan {
  0%, 14% { opacity: 0; transform: translate3d(-150px, 0, 0) skewX(-8deg); }
  28% { opacity: 0.72; }
  76% { opacity: 0.34; }
  100% { opacity: 0; transform: translate3d(510px, 0, 0) skewX(-8deg); }
}

@keyframes endpoint-orbit {
  to { transform: rotate(360deg); }
}

@keyframes endpoint-halo {
  0%, 100% { opacity: 0.48; transform: scale(0.92); }
  50% { opacity: 0.82; transform: scale(1.04); }
}

@keyframes endpoint-logo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes model-float {
  from { transform: translate(-50%, calc(-50% - 2px)); }
  to { transform: translate(-50%, calc(-50% + 3px)); }
}

@keyframes model-pulse {
  0%, 100% {
    border-color: rgba(81, 94, 142, 0.12);
    box-shadow: 0 8px 20px rgba(57, 82, 122, 0.09), inset 0 1px rgba(255, 255, 255, 0.94);
    transform: scale(0.98);
  }
  38%, 68% {
    border-color: rgba(37, 190, 200, 0.5);
    box-shadow: 0 0 0 5px rgba(23, 105, 238, 0.08), 0 12px 28px rgba(23, 105, 238, 0.2), inset 0 1px rgba(255, 255, 255, 0.98);
    transform: scale(1.06);
  }
}

@keyframes label-pulse {
  0%, 100% { color: var(--auth-muted); opacity: 0.64; }
  38%, 68% { color: var(--auth-ink); opacity: 1; }
}

@keyframes button-spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 1280px) {
  .auth-header,
  .auth-layout {
    grid-template-columns: minmax(700px, 58%) minmax(520px, 42%);
  }

  .brand-stage {
    padding-right: clamp(36px, 3vw, 56px);
    padding-left: clamp(64px, 5vw, 104px);
  }

  .brand-lockup {
    margin-left: clamp(64px, 5vw, 104px);
  }

  .stage-story {
    top: -8px;
    width: min(760px, 100%);
    padding-bottom: 18px;
  }

  .stage-copy p {
    max-width: 600px;
  }

  .model-field {
    width: min(760px, 100%);
    height: clamp(272px, 17vw, 320px);
    max-width: 760px;
    margin-top: 30px;
  }

  .gateway-node {
    left: 12px;
    width: 132px;
    height: 132px;
  }

  .gateway-node img {
    width: 40px;
    height: 40px;
  }

  .model-mark {
    width: 42px;
    height: 42px;
  }

  .model-mark img {
    width: 26px;
    height: 26px;
  }

  .model-node small {
    font-size: 11px;
  }

  .stage-footer {
    margin-top: 24px;
  }

  .auth-workspace {
    padding-right: clamp(32px, 4vw, 72px);
    padding-left: clamp(40px, 4vw, 72px);
  }
}

@media (max-width: 1180px) and (min-width: 981px) {
  .brand-stage {
    padding-right: 44px;
    padding-left: 44px;
  }

  .brand-lockup {
    margin-left: 44px;
  }

  .stage-copy h1 {
    font-size: 48px;
  }

  .stage-copy h1:lang(zh) {
    font-size: 40px;
  }

  .model-field {
    height: 232px;
  }

  .gateway-node {
    left: 0;
    width: 104px;
    height: 104px;
  }

  .gateway-node img {
    width: 30px;
    height: 30px;
  }

  .gateway-node small,
  .gateway-node code {
    font-size: 8px;
  }

  .model-mark {
    width: 32px;
    height: 32px;
  }

  .model-mark img {
    width: 19px;
    height: 19px;
  }

  .model-node small {
    font-size: 9px;
  }

  .stage-footer {
    margin-top: 30px;
  }
}

@media (max-width: 980px) {
  .auth-page {
    overflow: clip;
  }

  .auth-header {
    position: relative;
    display: flex;
    min-height: 68px;
    padding: 12px 16px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .brand-lockup {
    margin: 0;
    gap: 8px;
    font-size: 17px;
  }

  .brand-lockup img {
    width: 44px;
    height: 44px;
  }

  .header-actions {
    width: auto;
    min-height: 36px;
    margin: 0;
    justify-self: auto;
    gap: 4px;
  }

  .auth-layout {
    display: block;
    min-height: calc(100svh - 68px);
  }

  .brand-stage {
    display: none;
  }

  .auth-workspace {
    min-height: calc(100svh - 68px);
    height: auto;
    overflow: visible;
    padding: 28px 16px 40px;
    justify-content: flex-start;
  }

  .auth-panel {
    margin-bottom: 52px;
    padding: 30px 24px;
  }

  .route-switch {
    position: absolute;
    margin: 0;
    transform: translateY(52px);
  }

  .workspace-footer {
    display: flex;
    width: min(460px, 100%);
    margin-top: 4px;
    justify-content: center;
    gap: 4px;
    color: var(--auth-muted);
    font-size: 11px;
  }
}

@media (max-width: 600px) {
  .auth-header {
    padding: 10px 14px;
  }

  .portal-link {
    width: 34px;
    padding: 0;
  }

  .portal-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .auth-workspace {
    padding-right: 14px;
    padding-left: 14px;
  }

  .view-heading {
    margin-bottom: 36px;
  }

  .auth-view form {
    gap: 26px;
  }

  .otp-shell {
    gap: 6px;
  }
}

@media (max-width: 420px) {
  .brand-lockup img {
    width: 40px;
    height: 40px;
  }

  .auth-panel {
    padding: 26px 18px;
  }

  .route-switch {
    transform: translateY(48px);
  }

  .view-heading h2 {
    font-size: 25px;
  }

  .language-trigger {
    min-width: 52px;
    padding: 0 5px;
  }

  .language-trigger > svg:first-child {
    display: none;
  }
}

@media (max-height: 780px) and (min-width: 981px) {
  .stage-story {
    top: 14px;
  }

  .stage-copy h1 {
    font-size: 44px;
  }

  .stage-copy h1:lang(zh) {
    font-size: 40px;
  }

  .stage-copy p {
    margin-top: 14px;
    font-size: 14px;
  }

  .model-field {
    height: 220px;
    margin-top: 16px;
  }

  .stage-footer {
    margin-top: 16px;
  }

  .auth-workspace {
    padding-top: 128px;
    padding-bottom: 48px;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .route-wave {
    opacity: 0.28;
    transform: scale(0.72);
  }
}

/* Study 06 keeps the reference authentication composition and motion while
   carrying the selected Maxdle portal's color field into a quieter auth shell. */
:root {
  --auth-bg: #f4f7fb;
  --auth-ink: #12171d;
  --auth-muted: #5f6c79;
  --auth-soft: #84909c;
  --auth-line: rgba(25, 45, 66, 0.1);
  --auth-indigo: #2f6bff;
  --auth-surface: rgba(255, 255, 255, 0.9);
  --auth-input: rgba(248, 250, 252, 0.95);
  --auth-shadow: 0 28px 74px rgba(36, 59, 84, 0.14), 0 5px 18px rgba(36, 59, 84, 0.08);
  --auth-column-shift: min(clamp(28px, 2.3vw, 58px), max(0px, calc((100vw - 984px) * 0.5)));
  --font-sans: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", sans-serif;
}

:root[data-theme="dark"] {
  --auth-bg: #0c1218;
  --auth-ink: #f0f4f7;
  --auth-muted: #a2afbb;
  --auth-soft: #7f8d9a;
  --auth-line: rgba(226, 237, 246, 0.1);
  --auth-indigo: #86aaff;
  --auth-surface: rgba(18, 26, 34, 0.88);
  --auth-input: rgba(9, 21, 31, 0.82);
  --auth-shadow: 0 34px 96px rgba(0, 0, 0, 0.42), 0 5px 18px rgba(0, 0, 0, 0.25);
}

.auth-page,
:root[data-theme="dark"] .auth-page {
  background: var(--auth-bg);
}

.ambient-scene {
  background:
    radial-gradient(62% 78% at 12% 19%, rgba(47, 107, 255, 0.1), transparent 70%),
    radial-gradient(56% 74% at 78% 88%, rgba(24, 139, 105, 0.08), transparent 72%),
    linear-gradient(var(--auth-bg), var(--auth-bg));
}

:root[data-theme="dark"] .ambient-scene {
  background:
    radial-gradient(62% 78% at 12% 19%, rgba(73, 104, 184, 0.2), transparent 70%),
    radial-gradient(56% 74% at 78% 88%, rgba(31, 122, 109, 0.14), transparent 72%),
    linear-gradient(var(--auth-bg), var(--auth-bg));
}

.auth-header {
  position: absolute;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  grid-template-columns: minmax(520px, 1.04fr) minmax(460px, 0.96fr);
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
}

.brand-lockup {
  margin-top: clamp(24px, 2.8vw, 40px);
  margin-left: clamp(44px, 6vw, 104px);
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  pointer-events: auto;
}

.brand-lockup img {
  width: 36px;
  height: 36px;
}

.header-actions {
  position: relative;
  left: calc(-1 * var(--auth-column-shift));
  width: min(430px, calc(100% - 64px));
  min-height: 36px;
  margin-top: clamp(26px, 3vw, 42px);
  justify-self: center;
  gap: 8px;
  pointer-events: auto;
}

.portal-link,
.icon-control {
  min-height: 36px;
  border-radius: 7px;
  color: var(--auth-muted);
  font-size: 12px;
  font-weight: 600;
}

.portal-link {
  padding: 0 9px;
}

.portal-link:hover,
.icon-control:hover,
.language-picker.is-open .language-trigger {
  color: var(--auth-ink);
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="dark"] .portal-link:hover,
:root[data-theme="dark"] .icon-control:hover,
:root[data-theme="dark"] .language-picker.is-open .language-trigger {
  background: rgba(255, 255, 255, 0.06);
}

.language-trigger {
  min-width: 76px;
  padding: 0 9px;
  border: 1px solid transparent;
  background: rgba(237, 242, 247, 0.82);
  font-family: "SFMono-Regular", "SF Mono", Menlo, Monaco, "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
}

:root[data-theme="dark"] .language-trigger {
  background: rgba(255, 255, 255, 0.045);
}

.theme-toggle {
  width: 36px;
  flex-basis: 36px;
}

@media (min-width: 1280px) {
  .auth-header {
    grid-template-columns: minmax(700px, 58%) minmax(520px, 42%);
  }

  .brand-lockup {
    margin-left: clamp(92px, 7vw, 174px);
  }

  .brand-stage {
    padding-left: clamp(92px, 7vw, 174px);
  }
}

a:focus-visible,
button:focus-visible,
.otp-shell:focus-within {
  outline: 2px solid var(--auth-indigo);
  outline-offset: 3px;
}

.input-shell input:focus-visible {
  outline: none;
}

.auth-panel {
  left: calc(-1 * var(--auth-column-shift));
  width: min(430px, 100%);
  padding: 22px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

:root[data-theme="dark"] .auth-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 980px) {
  .auth-header {
    position: relative;
    top: 0;
    right: auto;
    left: auto;
    display: flex;
    width: 100%;
    min-height: 60px;
    margin: 0;
    padding: 10px 16px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .brand-lockup {
    margin: 0;
    gap: 8px;
    font-size: 17px;
  }

  .brand-lockup img {
    width: 32px;
    height: 32px;
  }

  .header-actions {
    left: 0;
    width: auto;
    min-height: 40px;
    margin: 0;
    justify-self: auto;
  }

  .auth-layout,
  .auth-workspace {
    min-height: calc(100svh - 60px);
  }

  .auth-workspace {
    padding-top: 24px;
  }

  .auth-panel {
    left: 0;
    width: min(430px, 100%);
    padding: 22px 0;
  }
}

@media (max-width: 600px) {
  .auth-header {
    padding: 9px 10px 9px 14px;
  }

  .language-trigger {
    min-width: 54px;
    padding: 0 6px;
  }

  .auth-workspace {
    padding-right: 14px;
    padding-left: 14px;
  }
}
