:root {
  color-scheme: dark;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #f5f3fb;
  background: #090e20;
  --login-galaxy: url("./assets/login-nebula.png");
  --login-muted: #c1bbd3;
  --login-gold: #e5ccaa;
  --login-line: #c8b9ef38;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 280px;
  min-height: 100svh;
  padding: 26px clamp(24px, 4.2vw, 72px);
  isolation: isolate;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(100deg, #070e2352, #0d112519 50%, #0a10242e),
    var(--login-galaxy) center / cover #0b1024;
}
.universe-nebula-image {
  background-image: var(--login-galaxy);
  background-position: center;
  mask-image: none;
  opacity: .88;
  mix-blend-mode: normal;
  animation: login-galaxy-drift 48s ease-in-out infinite alternate;
}
.universe-planet-wrap { display: none; }
.universe-cloud { opacity: .24; }
.universe-grain { opacity: .015; }
.universe-stars { opacity: .62; }
.universe-shade { background: linear-gradient(100deg, #080d223d, #0e102312 50%, #080e2429); }
.universe-scene[data-running="false"] .universe-nebula-image { animation-play-state: paused; }
@keyframes login-galaxy-drift {
  from { transform: translate(-.6%, .3%) scale(1.01); }
  to { transform: translate(.8%, -.4%) scale(1.035); }
}

.entry {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(26px, 4vh, 42px);
  width: min(100%, 1240px);
  min-height: calc(100svh - 52px);
  margin: 0 auto;
}
.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 80px;
  flex: 0 0 auto;
}
.login-wordmark { display: flex; align-items: center; gap: 15px; min-width: 0; }
.login-header-avatar[data-login-brand] {
  --login-header-avatar-height: 76px;
  position: relative;
  flex: 0 0 94px;
  width: 94px;
  height: 76px;
  min-width: 0;
  margin: 0;
  border: 0;
  background: none;
}
.login-wordmark-copy { display: grid; gap: 5px; min-width: 0; }
.login-wordmark-copy strong { color: #f5f0fc; font-size: 30px; font-weight: 750; line-height: 1.3; letter-spacing: .045em; }
.login-wordmark-copy > span { color: #dbd4e9; font-size: 17px; font-weight: 600; line-height: 1.6; letter-spacing: .065em; white-space: nowrap; }
.school-mark.school-mark--header { flex: 0 0 auto; width: clamp(320px, 26vw, 360px); max-width: 100%; }
.school-mark--header > img { display: block; width: 100%; height: auto; }

/* A single shared panel contains both the form and the decorative course scene. */
.login-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr);
  align-items: stretch;
  width: 100%;
  margin-block: auto;
  padding: 36px clamp(34px, 3.8vw, 54px);
  border: 1px solid var(--login-line);
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 90% 40%, #8870b916, transparent 60%),
    linear-gradient(112deg, #1c1b35ed, #1a1c35d9 52%, #1c1c36d4);
  box-shadow: 0 28px 90px #0305164d, inset 0 1px #ffffff0b;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  isolation: isolate;
}
.login-layout::before,
.login-layout::after { content: ""; position: absolute; height: 1px; pointer-events: none; }
.login-layout::before { top: -1px; right: 16%; left: 12%; background: linear-gradient(90deg, transparent, #e1c9f9a6 42%, #cab9ed52 68%, transparent); }
.login-layout::after { bottom: -1px; right: 15%; left: 48%; background: linear-gradient(90deg, transparent, #d2bc915c, transparent); }
.login-panel {
  min-width: 0;
  width: 100%;
  padding: 0 clamp(30px, 3.6vw, 52px) 0 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.login-panel h1 { margin: 0; color: #fbf7ff; font-size: 34px; line-height: 1.4; font-weight: 700; letter-spacing: .025em; }
.intro { margin: 10px 0 22px; color: var(--login-muted); font-size: 16px; font-weight: 500; line-height: 1.6; letter-spacing: .02em; overflow-wrap: anywhere; }
.login-panel label { display: grid; gap: 8px; margin-top: 17px; color: #e6e0f2; font-size: 17px; font-weight: 550; line-height: 1.6; letter-spacing: .025em; }
.login-panel form > label:first-child { margin-top: 0; }
.login-panel input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 11px 15px;
  border: 1px solid #b7a8d951;
  border-radius: 11px;
  background: #101127a8;
  color: #fbf8ff;
  font: 18px/1.6 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: .02em;
  caret-color: #ead0b2;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.login-panel input::placeholder { color: #b8accb; opacity: 1; font-size: inherit; font-weight: 400; }
.login-panel input:not([type="checkbox"]):focus { outline: none; border-color: #c2a8e8; background: #18172e; box-shadow: 0 0 0 3px #baa0e319; }
.entry :is(button, input[type="checkbox"]):focus-visible { outline: 2px solid #dec3f4; outline-offset: 4px; }
.password-field { position: relative; min-width: 0; }
.login-panel .password-field input { padding-right: 75px; }
.entry #toggle-password {
  position: absolute;
  right: 7px;
  bottom: 6px;
  min-width: 56px;
  min-height: 40px;
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #d3c3e6;
  font-size: 16px;
  font-weight: 550;
  line-height: 1.6;
}
.entry #toggle-password:hover { color: #fff6ff; background: #cbb7e512; }
#password-label[hidden] + #toggle-password { display: none !important; }
.login-panel label.remember { display: flex; align-items: center; gap: 10px; margin: 17px 0 0; color: #d8cee7; font-size: 16px; font-weight: 500; line-height: 1.6; letter-spacing: .01em; cursor: pointer; }
.login-panel input[type="checkbox"] { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; accent-color: #d0b5eb; }
.entry button { font-family: inherit; color: #e0d2ee; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.entry .primary {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 11px 16px;
  border: 1px solid #ecdcff5e;
  border-radius: 11px;
  background: linear-gradient(108deg, #dfc7f3, #c3b9e8);
  color: #2d203e;
  box-shadow: 0 6px 25px #aa81c925, inset 0 1px #ffffff40;
  font-size: 18px;
  line-height: 1.6;
  font-weight: 700;
  letter-spacing: .045em;
  transition: filter 150ms ease, box-shadow 150ms ease;
}
.entry .primary:hover { filter: brightness(1.055); box-shadow: 0 7px 24px #b098d132, inset 0 1px #ffffff40; }
.entry .primary:active { filter: brightness(.98); }
#login > .primary { margin-top: 20px; }
.entry button:disabled { opacity: .68; cursor: wait; }
#login-nav { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; margin-top: 20px; padding-top: 14px; border-top: 1px solid #d5bff225; }
#login-nav button { min-height: 38px; padding: 6px 0; border: 0; background: none; color: #d1bde8; font-size: 16px; font-weight: 550; line-height: 1.6; letter-spacing: .015em; transition: color 150ms ease; }
#login-nav button:hover { color: #fff0ff; }
#login-nav #school { width: 100%; min-height: 46px; margin-top: 4px; padding: 8px 12px; border: 1px solid #bdb0dc3d; border-radius: 10px; }
#notice { margin: 15px 0 0; color: #ffd3ca; font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
#notice:empty { display: none; }
#handoff { color: #e1d9ed; font-size: 17px; line-height: 1.7; overflow-wrap: anywhere; }
#handoff > p { margin-top: 0; }
#handoff code { display: block; padding: 14px; border: 1px solid #c6a6e23b; border-radius: 10px; background: #111127; color: #f0dafa; font-size: 18px; line-height: 1.6; user-select: all; }
#handoff .primary { margin-top: 17px; }

.login-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding-left: clamp(28px, 3.3vw, 48px);
  border-left: 1px solid #cab3e625;
}
.login-hero h2 { margin: 0 0 18px; color: #f3eafa; font-size: clamp(27px, 2.35vw, 33px); font-weight: 650; line-height: 1.6; letter-spacing: .055em; text-align: center; text-wrap: balance; }
.login-brand-stage[data-login-brand] {
  --login-brand-height: 380px;
  width: 100%;
  max-width: 580px;
  height: var(--login-brand-height);
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

@media (min-width: 901px) and (max-width: 1100px) {
  body { padding-inline: 28px; }
  .login-layout { padding-inline: 32px; }
  .login-panel { padding-right: 28px; }
  .login-hero { padding-left: 28px; }
  .login-hero h2 { font-size: 27px; letter-spacing: .025em; }
  #login-nav { column-gap: 12px; }
  #login-nav button { font-size: 16px; }
}

@media (min-width: 901px) and (max-height: 820px) {
  body { padding-top: 14px; padding-bottom: 14px; }
  .entry { min-height: calc(100svh - 28px); gap: 18px; }
  .login-header { min-height: 64px; }
  .login-header-avatar[data-login-brand] { --login-header-avatar-height: 64px; flex-basis: 80px; width: 80px; height: 64px; }
  .school-mark.school-mark--header { width: 320px; }
  .login-layout { padding-block: 22px; }
  .login-panel h1 { font-size: 30px; }
  .intro { margin-top: 6px; margin-bottom: 14px; }
  .login-panel label { margin-top: 12px; gap: 6px; font-size: 16px; }
  .login-panel input:not([type="checkbox"]) { min-height: 48px; padding-block: 9px; font-size: 18px; }
  .entry #toggle-password { bottom: 4px; }
  .login-panel label.remember { margin-top: 12px; font-size: 16px; }
  .entry .primary { min-height: 50px; padding-block: 9px; }
  #login > .primary { margin-top: 14px; }
  #login-nav { margin-top: 14px; padding-top: 10px; }
  #login-nav button { min-height: 34px; padding-block: 5px; font-size: 16px; }
  .login-hero h2 { margin-bottom: 8px; font-size: 28px; }
  .login-brand-stage[data-login-brand] { --login-brand-height: 360px; }
}

@media (max-width: 900px) {
  body { padding: 24px; }
  .entry { min-height: calc(100svh - 48px); gap: 28px; }
  .login-header { min-height: 76px; gap: 24px; }
  .login-wordmark-copy strong { font-size: 28px; }
  .login-wordmark-copy > span { font-size: 16px; }
  .school-mark.school-mark--header { width: min(40vw, 330px); }
  .login-layout { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 32px; margin-block: 0; padding: 32px; }
  .login-panel { order: 1; justify-self: center; max-width: 520px; padding: 0; }
  .login-hero { order: 2; width: 100%; max-width: 580px; justify-self: center; padding: 28px 0 0; border-left: 0; border-top: 1px solid #cab3e625; }
  .login-hero h2 { margin-bottom: 12px; font-size: 28px; }
  .login-brand-stage[data-login-brand] { --login-brand-height: 320px; }
}

@media (max-width: 600px) {
  body { padding: 18px; }
  .entry { min-height: calc(100svh - 36px); gap: 22px; }
  .login-header { min-height: 60px; gap: 14px; }
  .login-wordmark { gap: 9px; }
  .login-header-avatar[data-login-brand] { --login-header-avatar-height: 56px; flex-basis: 68px; width: 68px; height: 56px; }
  .login-wordmark-copy { gap: 3px; }
  .login-wordmark-copy strong { font-size: 25px; line-height: 1.3; }
  .login-wordmark-copy > span { font-size: 15px; line-height: 1.6; letter-spacing: 0; }
  .school-mark.school-mark--header { width: min(38vw, 226px); }
  .login-layout { gap: 26px; padding: 25px 24px 20px; border-radius: 22px; }
  .login-panel h1 { font-size: 30px; }
  .intro { margin: 8px 0 20px; font-size: 16px; }
  .login-panel label { margin-top: 16px; font-size: 16px; }
  .login-panel input:not([type="checkbox"]) { font-size: 16px; }
  .login-panel label.remember { margin-top: 16px; font-size: 15px; }
  #login-nav { gap: 6px 13px; justify-content: flex-start; }
  #login-nav button { font-size: 15px; }
  .login-hero { padding-top: 23px; }
  .login-hero h2 { font-size: 23px; letter-spacing: .025em; }
  .login-brand-stage[data-login-brand] { --login-brand-height: 240px; }
}

@media (max-width: 400px) {
  .login-header { gap: 10px; }
  .login-wordmark { gap: 8px; }
  .login-header-avatar[data-login-brand] { --login-header-avatar-height: 48px; flex-basis: 58px; width: 58px; height: 48px; }
  .login-wordmark-copy strong { font-size: 23px; }
  .login-wordmark-copy > span { font-size: 15px; letter-spacing: 0; }
}

@media (max-width: 360px) {
  body { padding: 14px 12px; }
  .entry { min-height: calc(100svh - 28px); gap: 20px; }
  .login-header { min-height: 57px; gap: 6px; }
  .login-wordmark { gap: 6px; }
  .login-header-avatar[data-login-brand] { --login-header-avatar-height: 38px; flex-basis: 44px; width: 44px; height: 38px; }
  .login-wordmark-copy strong { font-size: 23px; }
  .login-wordmark-copy > span { font-size: 15px; letter-spacing: 0; }
  .school-mark.school-mark--header { width: 33vw; }
  .login-layout { padding-inline: 20px; }
  .login-hero h2 { font-size: 21px; }
  .login-brand-stage[data-login-brand] { --login-brand-height: 210px; }
}

[hidden] { display: none !important; }
html[data-motion="off"] .universe-nebula-image { animation: none; }
html[data-motion="off"] .entry :is(input, button) { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .universe-nebula-image { animation: none; }
  .entry :is(input, button) { transition: none; }
}
