:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  --paper: #f3f1ed;
  --panel: #fffefa;
  --ink: #22212a;
  --muted: #605c6c;
  --edge: #dcd7e2;
  --input: #ffffff;
  --tab-well: #f4f0fa;
  --tab-active: #fffefa;
  --accent: #6550c9;
  --accent-hover: #5240ae;
  --accent-ink: #513caa;
  --focus: #826bdb;
  --soft: #efebfb;
  --shadow: 0 22px 60px -28px #31235164, 0 4px 16px #2f23410b;
  --illustration-grid: #c2b2eb50;
  --illustration-paper: #fffcf8;
  --illustration-seam: #d5c8e7;
  --illustration-line: #e2dbe9;
  --error-ink: #982647;
  --error-paper: #fff0f4;
  --room-color: #cdbaf3a8;
  --room-warmth: #f0d4bf91;
  --ripple-edge: #7951c8d4;
  --ripple-shine: #fffbffd9;
  --grain: #71618c24;
}

:root[data-auth-theme="dark"] {
  color-scheme: dark;
  --paper: #15161b;
  --panel: #212229;
  --ink: #f5f1fb;
  --muted: #bdb7cc;
  --edge: #41404e;
  --input: #171820;
  --tab-well: #191a22;
  --tab-active: #34294d;
  --accent: #715bdd;
  --accent-hover: #644ecd;
  --accent-ink: #cfbfff;
  --focus: #b298ff;
  --soft: #312749;
  --shadow: 0 24px 68px -24px #000b, 0 4px 16px #0003;
  --illustration-grid: #a98bea3d;
  --illustration-paper: #25242f;
  --illustration-seam: #503e75;
  --illustration-line: #51485d;
  --error-ink: #ffc0ce;
  --error-paper: #472734;
  --room-color: #4a2b7d7d;
  --room-warmth: #5e362c67;
  --ripple-edge: #c8acffdb;
  --ripple-shine: #e3d6ff65;
  --grain: #ccc0ea27;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--ink);
  background: var(--paper);
}

.auth-ambience {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 70%, var(--room-color), transparent 53%),
    radial-gradient(ellipse at 91% 2%, var(--room-warmth), transparent 50%);
}
.auth-ambience::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, var(--grain) .6px, transparent .8px) 0 0 / 5px 5px;
  mask-image: linear-gradient(118deg, #000 4%, transparent 77%);
}
.auth-ripple {
  position: absolute;
  z-index: 1;
  width: clamp(220px, 25vw, 330px);
  aspect-ratio: 1;
  translate: -50% -50%;
}
.auth-ripple i {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--ripple-edge);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--ripple-shine);
  opacity: 0;
  animation: auth-ripple-out 1280ms cubic-bezier(.15, .46, .25, 1) both;
}
.auth-ripple i:nth-child(2) { animation-delay: 115ms; }
.auth-ripple i:nth-child(3) { animation-delay: 230ms; }

@keyframes auth-ripple-out {
  0% { scale: .08; opacity: 0; }
  11% { opacity: .94; }
  55% { opacity: .54; }
  100% { scale: 1; opacity: 0; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .studio-illustration { translate: var(--illustration-x, 0px) var(--illustration-y, 0px); }
  .illustration-sheet-back {
    translate: calc(var(--illustration-x, 0px) * -.5) calc(var(--illustration-y, 0px) * -.5);
  }
  .illustration-mark {
    translate: calc(var(--illustration-x, 0px) * .75) calc(var(--illustration-y, 0px) * .75);
  }
}
@media (prefers-reduced-motion: reduce) {
  .auth-ripple { display: none; }
}

a { color: var(--accent-ink); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1260px;
  margin: 0 auto;
  padding: 34px clamp(24px, 5vw, 76px) 0;
}

.auth-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding: 3px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--tab-well);
  color: var(--muted);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}

.auth-theme-toggle span {
  padding: 6px 9px;
  border-radius: inherit;
  white-space: nowrap;
}

.auth-theme-toggle:hover { border-color: var(--focus); }
.auth-theme-toggle[aria-pressed="false"] span:first-child,
.auth-theme-toggle[aria-pressed="true"] span:last-child {
  background: var(--tab-active);
  color: var(--accent-ink);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 680;
  text-decoration: none;
}

.wordmark-icon {
  display: grid;
  position: relative;
  width: 39px;
  height: 39px;
  border-radius: 12px;
  background: var(--accent);
  box-shadow: 0 4px 9px #4c319236;
}

.wordmark-icon i, .wordmark-icon::before, .wordmark-icon::after {
  position: absolute;
  left: 10px;
  height: 2px;
  border-radius: 2px;
  background: white;
  content: "";
}
.wordmark-icon::before { width: 19px; top: 12px; }
.wordmark-icon i { width: 13px; top: 18px; }
.wordmark-icon::after { width: 8px; top: 24px; }

.entry {
  width: min(100%, 1260px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  align-items: start;
  gap: clamp(38px, 6vw, 95px);
  margin: clamp(52px, 9vh, 104px) auto 0;
  padding: 0 clamp(24px, 5vw, 76px) 72px;
}

.site-filing { padding: 0 20px 24px; text-align: center; font-size: .82rem; }
.site-filing a { color: var(--muted); text-underline-offset: .18em; }

.intro { padding-top: 20px; }
.intro h1 {
  margin: 0;
  font-family: "Songti SC", "Noto Serif CJK SC", SimSun, Georgia, serif;
  font-size: clamp(2rem, 4.7vw, 4rem);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.13;
}
.intro p {
  max-width: 28rem;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.studio-illustration {
  position: relative;
  isolation: isolate;
  width: min(100%, 445px);
  height: 260px;
  margin-top: 44px;
}
.illustration-grid {
  position: absolute;
  inset: 8px 3px 7px 0;
  border-radius: 24px;
  background: radial-gradient(circle, var(--illustration-grid) 1.5px, transparent 1.5px) 0 0 / 16px 16px, var(--soft);
  mask-image: linear-gradient(to right, #000 76%, transparent);
}
.illustration-sheet {
  position: absolute;
  width: 54%;
  height: 184px;
  border: 1px solid var(--illustration-seam);
  border-radius: 14px;
}
.illustration-sheet-back {
  top: 39px;
  left: 28%;
  background: var(--soft);
  transform: rotate(11deg);
}
.illustration-sheet-front {
  display: flex;
  flex-direction: column;
  gap: 11px;
  top: 27px;
  left: 14%;
  padding: 24px 21px;
  background: var(--illustration-paper);
  box-shadow: 0 12px 28px #38265b29;
  transform: rotate(-6deg);
}
.illustration-sheet-front i {
  width: 22%;
  height: 8px;
  border-radius: 4px;
  background: var(--accent);
}
.illustration-sheet-front b {
  height: 14px;
  width: 69%;
  border-radius: 4px;
  background: var(--accent-ink);
  opacity: .8;
}
.illustration-sheet-front span {
  display: block;
  width: 94%;
  height: 5px;
  border-radius: 3px;
  background: var(--illustration-line);
}
.illustration-sheet-front span:nth-of-type(2) { width: 81%; }
.illustration-sheet-front span:nth-of-type(4) { width: 62%; }
.illustration-mark {
  position: absolute;
  display: grid;
  place-items: center;
  top: 57px;
  left: 76%;
  width: 54px;
  height: 54px;
  border: 1px solid var(--illustration-seam);
  border-radius: 15px;
  background: var(--panel);
  box-shadow: 0 6px 16px #38265b17;
  transform: rotate(9deg);
}
.illustration-mark i {
  width: 23px;
  height: 23px;
  border: 2px solid var(--accent);
  border-radius: 7px;
  transform: rotate(45deg);
}

.account {
  min-width: 0;
  padding: clamp(20px, 3vw, 31px);
  border: 1px solid var(--edge);
  border-radius: 23px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.account-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--edge);
  border-radius: 11px;
  background: var(--tab-well);
}
.account-nav a {
  border-radius: 7px;
  padding: 9px 10px;
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 600;
}
.account-nav a[aria-current="page"] {
  color: var(--accent-ink);
  background: var(--tab-active);
  box-shadow: 0 1px 4px #291b4924;
}

.account-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  margin-top: 23px;
}
.account-form h2 {
  margin: 0 0 8px;
  font-size: 1.38rem;
  line-height: 1.35;
}
.account-form label {
  font-size: .9rem;
  font-weight: 630;
}
.account-form input {
  min-width: 0;
  width: 100%;
  height: 45px;
  padding: 9px 11px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  color: var(--ink);
  background: var(--input);
  font: inherit;
}
.account-form input::placeholder { color: var(--muted); }
.account-form > input, .password-field, .code-field { margin-bottom: 6px; }

.password-field, .code-field {
  display: flex;
  align-items: center;
  position: relative;
}
.password-field > input { padding-right: 62px; }
.code-input {
  padding-right: 115px !important;
  letter-spacing: .14em;
  font-variant-numeric: tabular-nums;
}
.password-field > button, .code-field > button { position: absolute; right: 8px; }

button {
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}
button:disabled { opacity: .59; cursor: default; }
.text-button {
  padding: 5px 7px;
  border-radius: 5px;
  color: var(--accent-ink);
  font-size: .875rem;
}
.text-button:hover:not(:disabled) { background: var(--soft); }
.primary {
  height: 46px;
  margin-top: 9px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 620;
}
.primary:hover:not(:disabled) { background: var(--accent-hover); }

.account-links {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.account-links a, .return-link {
  width: fit-content;
  color: var(--accent-ink);
  font-size: .875rem;
  text-decoration: none;
}
.account-links a:hover, .return-link:hover { text-decoration: underline; }
.return-link { margin-top: 6px; }

.field-note, .form-description {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.55;
}
.message {
  margin: 13px 0 0;
  padding: 9px 11px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-size: .875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.message:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
}
.message[data-tone="error"] { color: var(--error-ink); background: var(--error-paper); }

@media (max-width: 900px) {
  .entry {
    max-width: 580px;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: clamp(30px, 5vh, 46px);
    padding-bottom: 40px;
  }
  .intro { padding-top: 0; }
  .intro h1 { font-size: clamp(1.82rem, 6vw, 2.65rem); }
  .intro p { margin-top: 9px; }
  .studio-illustration { display: none; }
}
@media (max-width: 400px) {
  .site-header { padding: 23px 16px 0; }
  .entry { padding-inline: 13px; }
  .account { padding: 17px; }
}

