:root {
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-head: var(--font-body);
  --page-bg: #eef7fc;
  --page-bg-soft: #ddedf0;
  --surface: #ffffff;
  --surface-soft: #fbfdff;
  --text: #12324a;
  --muted: #52718a;
  --faint: #7891a4;
  --line: #d5e6ef;
  --accent: #0059ff;
  --accent-hover: #004bd6;
  --accent-soft: rgba(0, 89, 255, 0.09);
  --focus-ring: rgba(0, 89, 255, 0.18);
  --danger: #b42318;
  --radius-card: 16px;
  --radius-control: 12px;
  --shadow-near: 0 24px 48px rgba(18, 50, 74, 0.12);
  --shadow-mid: 0 12px 24px rgba(18, 50, 74, 0.08);
  --shadow-far: 0 4px 12px rgba(18, 50, 74, 0.06);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--page-bg);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.skip-link {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 20;
  padding: 12px 16px;
  border-radius: var(--radius-control);
  background: var(--text);
  color: var(--surface);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-72px);
  transition: transform 0.2s var(--ease-standard);
}

.skip-link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  transform: translateY(0);
}

.tech-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.94) 0, rgba(255, 255, 255, 0.7) 240px, rgba(255, 255, 255, 0) 560px),
    radial-gradient(circle at 12% 18%, rgba(32, 160, 224, 0.13) 0, rgba(32, 160, 224, 0) 340px),
    radial-gradient(circle at 88% 80%, rgba(0, 89, 255, 0.1) 0, rgba(0, 89, 255, 0) 360px),
    linear-gradient(180deg, #f8fcfe 0%, var(--page-bg) 48%, #e4f1f7 100%);
}

.tech-field::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(18, 50, 74, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 50, 74, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 45%, transparent 0, transparent 220px, rgba(0, 0, 0, 0.6) 520px, rgba(0, 0, 0, 0.12) 100%);
}

.orbit-map {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(1200px, 118vw);
  min-width: 900px;
  transform: translate(-50%, -50%);
}

.orbit-spin {
  animation: orbit-rotate 8s linear infinite;
}

.scan-line {
  stroke-dasharray: 8 16;
  animation: scan-drift 6s ease-in-out infinite alternate;
}

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: calc(100dvh - 48px);
  place-items: center;
  padding: 48px 16px 72px;
}

.login-card {
  position: relative;
  width: min(100%, 448px);
  padding: 40px;
  overflow: hidden;
  border: 1px solid rgba(213, 230, 239, 0.92);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(252, 254, 255, 0.96) 100%);
  box-shadow: var(--shadow-near), inset 0 0 0 1px rgba(255, 255, 255, 0.78);
  animation: card-in 0.65s var(--ease-out) 0.08s both;
  backdrop-filter: blur(14px);
}

.login-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: calc(var(--radius-card) - 1px);
  pointer-events: none;
}

.brand-block,
.heading-block {
  position: relative;
  z-index: 1;
  text-align: center;
}

.brand-logo {
  display: block;
  width: 184px;
  height: auto;
  margin: 0 auto;
}

.brand-kicker {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.heading-block {
  margin-top: 24px;
}

.heading-block h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  text-wrap: balance;
}

.heading-block p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.02em;
  line-height: 1.7;
}

.login-form {
  position: relative;
  z-index: 1;
  margin-top: 32px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-field label {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.input-shell {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-soft);
  box-shadow: var(--shadow-far);
  transition: border-color 0.18s var(--ease-standard), box-shadow 0.18s var(--ease-standard), background-color 0.18s var(--ease-standard);
}

.input-shell:hover {
  border-color: #b8d6e7;
  background: var(--surface);
}

.input-shell:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--focus-ring), var(--shadow-far);
}

.form-field.is-invalid .input-shell {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.1), var(--shadow-far);
}

.field-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 20px;
  height: 20px;
  color: var(--faint);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-shell input {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 48px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  outline: 0;
}

.input-shell input:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

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

.input-shell input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px var(--surface-soft) inset;
  transition: background-color 9999s ease-out;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--faint);
  transform: translateY(-50%);
  transition: background-color 0.18s var(--ease-standard), color 0.18s var(--ease-standard);
}

.password-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.password-toggle .icon-eye-off {
  display: none;
}

.password-toggle[aria-pressed="true"] .icon-eye {
  display: none;
}

.password-toggle[aria-pressed="true"] .icon-eye-off {
  display: block;
}

.field-error {
  display: block;
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.login-button {
  display: inline-flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--surface);
  box-shadow: 0 12px 24px rgba(0, 89, 255, 0.18);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: transform 0.22s var(--ease-standard), background-color 0.22s var(--ease-standard), box-shadow 0.22s var(--ease-standard);
}

.login-button:hover {
  background: var(--accent-hover);
  box-shadow: 0 16px 32px rgba(0, 89, 255, 0.22);
  transform: translateY(-1px);
}

.login-button:active {
  box-shadow: 0 8px 16px rgba(0, 89, 255, 0.16);
  transform: translateY(0);
}

.login-button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.login-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 0.22s var(--ease-standard);
}

.login-button:hover svg {
  transform: translateX(2px);
}

.form-status {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.01em;
  line-height: 1.6;
  text-align: center;
}

.form-status.is-error {
  color: var(--danger);
  font-weight: 600;
}

.login-button:disabled {
  cursor: wait;
  background: var(--accent-hover);
}

.page-footer {
  position: fixed;
  right: 0;
  bottom: 14px;
  left: 0;
  z-index: 1;
  padding: 0 16px;
  pointer-events: none;
  text-align: center;
}

.page-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes scan-drift {
  from {
    stroke-dashoffset: 0;
    opacity: 0.64;
  }
  to {
    stroke-dashoffset: 48;
    opacity: 0.38;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .login-shell {
    padding-top: 40px;
  }

  .login-card {
    width: min(100%, 440px);
  }
}

@media (max-width: 767px) {
  .orbit-map {
    width: 980px;
    min-width: 980px;
  }

  .login-shell {
    min-height: calc(100dvh - 40px);
    padding: 32px 16px 64px;
  }

  .login-card {
    padding: 32px 24px;
  }

  .brand-logo {
    width: 164px;
  }

  .brand-kicker {
    font-size: 12px;
  }

  .heading-block h1 {
    font-size: 24px;
    line-height: 1.4;
  }

  .heading-block p {
    font-size: 14px;
  }

  .input-shell input {
    height: 50px;
    font-size: 16px;
  }

  .login-button {
    min-height: 52px;
  }

  .page-footer {
    bottom: 10px;
  }

  .page-footer p {
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .login-card {
    padding: 28px 20px;
  }

  .brand-logo {
    width: 152px;
  }

  .heading-block h1 {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
