:root {
  color-scheme: dark;
  --auth-ink: #f0e9db;
  --auth-muted: #aaa69b;
  --auth-accent: #bba275;
  --auth-accent-strong: #dbc38c;
  --auth-line: #817156;
  --auth-panel: rgba(10, 15, 18, .92);
  --auth-danger: #e69a8d;
  --auth-success: #bfd7a6;
}

@font-face {
  font-family: "Ark Pixel";
  src: url("../assets/fonts/0066 方舟像素字体｜Ark Pixel/版本 V2025.08.24/（OTF）12px-proportional-V2025.08.24/ark-pixel-12px-proportional-zh_cn.otf") format("opentype");
  font-display: swap;
}

* { box-sizing: border-box; }

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--auth-ink);
  background: #080b0d;
  font-family: "Ark Pixel", "Microsoft YaHei", "PingFang SC", sans-serif;
}

button,
input { font: inherit; }

.auth-page .scene-slideshow {
  position: fixed;
  z-index: 0;
  background-position: center center;
}

.auth-page .scene-slideshow::after {
  background:
    linear-gradient(90deg, rgba(5, 8, 10, .9) 0%, rgba(5, 8, 10, .58) 45%, rgba(5, 8, 10, .42) 72%, rgba(5, 8, 10, .7) 100%),
    linear-gradient(0deg, rgba(5, 8, 10, .86), transparent 66%);
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(300px, 1.1fr) minmax(340px, 440px);
  grid-template-areas: "brand card" ". note";
  align-content: center;
  column-gap: clamp(48px, 8vw, 150px);
  min-height: 100svh;
  padding: 104px clamp(32px, 8vw, 150px) 54px;
}

.auth-shell::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 4px);
  pointer-events: none;
}

.back-link {
  position: absolute;
  top: 28px;
  left: clamp(32px, 8vw, 150px);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--auth-line);
  border-radius: 2px;
  background: rgba(17, 22, 24, .86);
  color: #eadbc0;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.back-link:hover,
.back-link:focus-visible {
  border-color: var(--auth-accent-strong);
  background: #3e3524;
}

.auth-brand {
  grid-area: brand;
  align-self: center;
  width: min(650px, 100%);
  margin: 0 0 0 36px;
}

.auth-brand .title-kicker { margin: 0; }

.auth-brand h2 {
  margin: 18px 0 10px;
  color: var(--auth-ink);
  font-size: clamp(38px, 4.6vw, 72px);
  font-weight: normal;
  line-height: 1.35;
  letter-spacing: .04em;
  text-shadow: 0 6px 24px #000;
}

.auth-brand h2 span {
  display: block;
  color: #dbc394;
  font-size: 1.24em;
}

.auth-brand .title-english { margin: 0 0 26px; }

.auth-brand p:last-child {
  margin: 0;
  color: #bcbdb8;
  font-size: 14px;
  line-height: 1.9;
}

.auth-card {
  grid-area: card;
  align-self: center;
  width: 100%;
  padding: clamp(28px, 3vw, 38px);
  border: 1px solid var(--auth-line);
  border-radius: 2px;
  background: var(--auth-panel);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
}

.auth-copy {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(129, 113, 86, .48);
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--auth-accent);
  font-size: 11px;
  letter-spacing: .15em;
}

.auth-copy h1 {
  margin: 0 0 12px;
  color: var(--auth-ink);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: .06em;
}

.auth-copy p:last-child,
.auth-note p {
  margin: 0;
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span:first-child {
  color: #ded3c0;
  font-size: 14px;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid rgba(187, 162, 117, .5);
  border-radius: 2px;
  outline: none;
  background: rgba(3, 6, 8, .84);
  color: var(--auth-ink);
  caret-color: var(--auth-accent-strong);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.field input:hover { border-color: var(--auth-accent); }

.field input:focus-visible {
  border-color: var(--auth-accent-strong);
  background: rgba(8, 12, 14, .96);
  box-shadow: 0 0 0 2px rgba(219, 195, 140, .16);
}

.form-message {
  min-height: 20px;
  margin: -2px 0 0;
  color: var(--auth-danger);
  font-size: 13px;
  line-height: 1.5;
}

.form-message.is-success { color: var(--auth-success); }

.field-assist {
  margin: -8px 0 -2px;
  font-size: 13px;
  text-align: right;
}

.field-assist a {
  color: #d7c7a2;
  text-underline-offset: 4px;
}

.field-assist a:hover,
.field-assist a:focus-visible { color: var(--auth-ink); }

.submit-button {
  min-height: 50px;
  padding: 12px 20px;
  border: 1px solid #b29a68;
  border-radius: 2px;
  background: #3e3524;
  color: #eadbc0;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.submit-button:hover,
.submit-button:focus-visible {
  border-color: var(--auth-accent-strong);
  background: #51432d;
}

.submit-button:disabled,
.field input:disabled {
  cursor: wait;
  opacity: .62;
}

.switch-page {
  margin: 22px 0 0;
  color: var(--auth-muted);
  font-size: 13px;
  text-align: center;
}

.switch-page a {
  color: #d7c7a2;
  text-underline-offset: 4px;
}

.switch-page a:hover,
.switch-page a:focus-visible { color: var(--auth-ink); }

.auth-note {
  grid-area: note;
  width: 100%;
  margin-top: 14px;
  padding: 13px 16px;
  border: 1px solid rgba(129, 113, 86, .5);
  background: rgba(7, 11, 13, .72);
}

.auth-note span {
  display: block;
  margin-bottom: 5px;
  color: var(--auth-accent);
  font-size: 10px;
  letter-spacing: .13em;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid #dfc99b;
  outline-offset: 4px;
}

@media (min-width: 1100px) {
  .auth-brand { margin-left: clamp(150px, 14vw, 320px); }
}

@media (max-width: 880px) {
  .auth-page .scene-slideshow { background-position: 62% center; }

  .auth-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "brand" "card" "note";
    gap: 28px;
    align-content: start;
    padding: 92px 24px 38px;
  }

  .back-link {
    top: 22px;
    left: 24px;
  }

  .auth-brand,
  .auth-card,
  .auth-note {
    width: min(480px, 100%);
    justify-self: center;
  }

  .auth-brand { margin-left: 0; }

  .auth-brand h2 { font-size: clamp(34px, 9vw, 52px); }
  .auth-brand p:last-child { display: none; }
}

@media (max-width: 520px) {
  .auth-page .scene-slideshow::after {
    background: linear-gradient(180deg, rgba(5, 8, 10, .62), rgba(5, 8, 10, .94) 48%, #05080a 100%);
  }

  .auth-shell {
    gap: 22px;
    padding: 82px 16px 28px;
  }

  .back-link {
    top: 16px;
    left: 16px;
    min-height: 40px;
    padding-inline: 14px;
  }

  .auth-brand h2 {
    margin-top: 14px;
    font-size: 34px;
  }

  .auth-brand .title-english {
    margin-bottom: 0;
    font-size: 10px;
    letter-spacing: .14em;
  }

  .auth-card { padding: 24px 20px; }
  .auth-copy { margin-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .back-link,
  .field input,
  .submit-button { transition: none; }
}
