:root {
  color: #3f2c27;
  background: #f4eee8;
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background: #f4eee8;
}

button,
input {
  font: inherit;
}

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

.auth-shell {
  display: grid;
  grid-template-columns: minmax(480px, 56fr) minmax(430px, 44fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.brand-scene {
  position: relative;
  display: flex;
  min-height: 100%;
  padding: clamp(42px, 6.5vw, 96px);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 16% 8%, rgb(255 255 255 / 86%), transparent 38%),
    linear-gradient(145deg, #f7eee6 0%, #eaded4 48%, #e8e3d8 100%);
}

.brand-scene::before {
  position: absolute;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(115deg, rgb(255 255 255 / 38%), transparent 42%),
    repeating-linear-gradient(
      0deg,
      rgb(108 81 64 / 2.4%) 0,
      rgb(108 81 64 / 2.4%) 1px,
      transparent 1px,
      transparent 4px
    );
  content: "";
  opacity: 0.72;
  mix-blend-mode: multiply;
}

.brand-scene::after {
  position: absolute;
  right: -18%;
  bottom: -30%;
  z-index: -2;
  width: min(66vw, 860px);
  aspect-ratio: 1;
  border: 1px solid rgb(167 127 98 / 40%);
  border-radius: 50%;
  box-shadow:
    0 0 0 54px rgb(255 253 249 / 9%),
    0 0 0 55px rgb(167 127 98 / 22%),
    0 0 0 116px rgb(255 253 249 / 6%);
  content: "";
}

.brand-scene__wash {
  position: absolute;
  z-index: -1;
  border-radius: 44% 56% 62% 38% / 56% 39% 61% 44%;
  filter: blur(1px);
  opacity: 0.58;
}

.brand-scene__wash--rose {
  top: -14%;
  right: -15%;
  width: min(52vw, 680px);
  height: min(38vw, 510px);
  transform: rotate(-12deg);
  background:
    radial-gradient(ellipse at 30% 44%, rgb(218 164 158 / 66%), transparent 63%),
    radial-gradient(ellipse at 70% 20%, rgb(198 147 137 / 34%), transparent 58%);
}

.brand-scene__wash--sage {
  bottom: -18%;
  left: -17%;
  width: min(46vw, 620px);
  height: min(34vw, 460px);
  transform: rotate(14deg);
  background: radial-gradient(
    ellipse at 58% 36%,
    rgb(151 157 132 / 43%),
    transparent 66%
  );
}

.brand-scene__arc {
  position: absolute;
  z-index: -1;
  border: 1px solid rgb(168 126 92 / 42%);
  border-radius: 50%;
}

.brand-scene__arc--one {
  top: 12%;
  right: 7%;
  width: 240px;
  height: 460px;
  transform: rotate(34deg);
  border-color: rgb(168 126 92 / 32%) transparent transparent
    rgb(168 126 92 / 32%);
}

.brand-scene__arc--two {
  right: 20%;
  bottom: 8%;
  width: 380px;
  height: 190px;
  transform: rotate(-18deg);
  border-color: rgb(168 126 92 / 26%) rgb(168 126 92 / 26%) transparent
    transparent;
}

.brand-copy {
  display: flex;
  width: min(100%, 780px);
  min-height: 100%;
  flex-direction: column;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  display: inline-block;
  width: 60px;
  height: 60px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.brand-mark img,
.identity-chip__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-kicker {
  margin: 0 0 4px;
  color: #9a745b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.brand-lockup h1 {
  margin: 0;
  color: #4a322b;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(22px, 2.1vw, 31px);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-message {
  margin: auto 0;
  padding: clamp(72px, 11vh, 150px) 0;
}

.brand-message__eyebrow {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 21px;
  color: #9c7156;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.brand-message__eyebrow::before {
  width: 42px;
  height: 1px;
  background: #b68a69;
  content: "";
}

.brand-message h2 {
  max-width: 690px;
  margin: 0;
  color: #412d27;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(38px, 4.15vw, 66px);
  font-weight: 500;
  line-height: 1.31;
  letter-spacing: 0.025em;
}

.brand-message > p:last-child {
  max-width: 570px;
  margin: 28px 0 0;
  color: rgb(73 54 47 / 72%);
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.9;
}

.brand-capabilities {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgb(83 61 51 / 64%);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.brand-capabilities i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #a77f62;
}

.brand-footnote {
  position: absolute;
  right: clamp(34px, 5vw, 72px);
  bottom: clamp(26px, 3.5vw, 52px);
  margin: 0;
  color: rgb(112 85 70 / 45%);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  letter-spacing: 0.16em;
  writing-mode: vertical-rl;
}

.auth-stage {
  position: relative;
  display: grid;
  min-height: 100%;
  padding: clamp(38px, 6vw, 84px);
  place-items: center;
  border-left: 1px solid rgb(160 120 91 / 16%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 74%), transparent 28%),
    #fffdf9;
}

.auth-stage::before {
  position: absolute;
  top: clamp(28px, 4vw, 58px);
  right: clamp(28px, 4vw, 58px);
  width: 92px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(168 126 92 / 42%));
  content: "";
}

.auth-panel {
  width: min(100%, 420px);
  transition: opacity 180ms ease;
}

.auth-panel[data-mode="loading"] {
  opacity: 0.72;
}

.auth-heading__eyebrow {
  margin: 0 0 14px;
  color: #9c7156;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.auth-heading h2 {
  margin: 0;
  color: #3e2a24;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(35px, 3vw, 48px);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.auth-heading > p:last-child {
  min-height: 52px;
  margin: 15px 0 0;
  color: rgb(70 51 44 / 61%);
  font-size: 14px;
  line-height: 1.8;
}

.identity-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 27px 0 25px;
  padding: 13px 15px;
  border: 1px solid rgb(161 119 86 / 17%);
  border-radius: 16px;
  background: linear-gradient(
    105deg,
    rgb(246 237 227 / 82%),
    rgb(255 255 255 / 66%)
  );
}

.identity-chip__avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.identity-chip > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.identity-chip small {
  color: rgb(74 54 46 / 48%);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.identity-chip strong {
  color: #463029;
  font-size: 14px;
  font-weight: 650;
}

.identity-chip__status {
  padding: 5px 9px;
  border-radius: 999px;
  color: #866046;
  background: rgb(233 217 201 / 72%);
  font-size: 11px;
}

.form-notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgb(178 83 65 / 20%);
  border-radius: 12px;
  color: #873f35;
  background: #fff4f0;
  font-size: 13px;
  line-height: 1.55;
}

.form-notice[data-tone="success"] {
  border-color: rgb(101 134 93 / 22%);
  color: #4d7148;
  background: #f2f7ee;
}

.field {
  display: block;
  margin: 0 0 18px;
}

.field[hidden] {
  display: none !important;
}

.field__label {
  display: block;
  margin: 0 0 9px;
  color: #4b342c;
  font-size: 13px;
  font-weight: 620;
}

.password-control {
  position: relative;
  display: block;
}

.password-control input {
  width: 100%;
  height: 54px;
  padding: 0 70px 0 16px;
  border: 1px solid rgb(112 78 61 / 18%);
  border-radius: 14px;
  outline: none;
  color: #3e2a24;
  background: #f7f3ef;
  box-shadow: inset 0 1px 1px rgb(74 47 34 / 3%);
  font-size: 16px;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.password-control input::placeholder {
  color: rgb(78 60 52 / 37%);
}

.password-control input:hover {
  border-color: rgb(136 92 69 / 38%);
}

.password-control input:focus {
  border-color: #a8795f;
  background: #fffdfa;
  box-shadow: 0 0 0 4px rgb(168 121 95 / 11%);
}

.password-control input:-webkit-autofill {
  -webkit-text-fill-color: #3e2a24;
  box-shadow: 0 0 0 1000px #f7f3ef inset;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  min-width: 52px;
  height: 36px;
  padding: 0 10px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  outline: none;
  color: rgb(82 57 47 / 56%);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.password-toggle:hover {
  color: #6e4c3b;
  background: rgb(132 90 68 / 7%);
}

.password-toggle:focus-visible {
  box-shadow: 0 0 0 3px rgb(168 121 95 / 16%);
}

.password-hint {
  margin: -5px 0 19px;
  color: rgb(77 57 49 / 53%);
  font-size: 12px;
  line-height: 1.65;
}

.remember-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 2px 0 24px;
  color: #4c352d;
  cursor: pointer;
  user-select: none;
}

.remember-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.remember-row__box {
  position: relative;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin-top: 1px;
  border: 1px solid rgb(118 81 62 / 29%);
  border-radius: 6px;
  background: #f7f3ef;
  transition: 150ms ease;
}

.remember-row input:checked + .remember-row__box {
  border-color: #7a5a49;
  background: #7a5a49;
}

.remember-row input:checked + .remember-row__box::after {
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  transform: rotate(43deg);
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  content: "";
}

.remember-row input:focus-visible + .remember-row__box {
  box-shadow: 0 0 0 4px rgb(168 121 95 / 14%);
}

.remember-row > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.remember-row strong {
  font-size: 13px;
  font-weight: 590;
}

.remember-row small {
  color: rgb(76 53 45 / 48%);
  font-size: 11px;
  line-height: 1.45;
}

.submit-button {
  display: flex;
  width: 100%;
  height: 55px;
  align-items: center;
  justify-content: space-between;
  padding: 0 19px 0 22px;
  border: 1px solid #6f4c3b;
  border-radius: 15px;
  color: #fff;
  background:
    linear-gradient(110deg, rgb(255 255 255 / 7%), transparent 42%),
    #765241;
  box-shadow:
    0 13px 24px rgb(91 58 43 / 18%),
    inset 0 1px 0 rgb(255 255 255 / 18%);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.submit-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background-color: #684636;
  box-shadow:
    0 16px 29px rgb(91 58 43 / 22%),
    inset 0 1px 0 rgb(255 255 255 / 18%);
}

.submit-button:active:not(:disabled) {
  transform: translateY(0);
}

.submit-button:focus-visible {
  outline: 3px solid rgb(168 121 95 / 23%);
  outline-offset: 3px;
}

.submit-button:disabled {
  border-color: #bda99d;
  background: #bda99d;
  box-shadow: none;
  cursor: wait;
  opacity: 0.7;
}

.submit-button__arrow {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  background: rgb(255 255 255 / 11%);
  font-size: 19px;
  font-weight: 400;
}

.submit-button[data-busy="true"] .submit-button__arrow {
  animation: pulse-arrow 900ms ease-in-out infinite alternate;
}

.auth-footnote {
  margin: 23px 0 0;
  color: rgb(75 54 46 / 42%);
  font-size: 11px;
  line-height: 1.65;
  text-align: center;
}

.mobile-brand {
  display: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.noscript-notice {
  position: fixed;
  inset: auto 20px 20px;
  z-index: 10;
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  color: #fff;
  background: #7a5a49;
  text-align: center;
}

@keyframes pulse-arrow {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: minmax(360px, 48fr) minmax(420px, 52fr);
  }

  .brand-scene {
    padding: 48px;
  }

  .brand-message h2 {
    font-size: 44px;
  }

  .brand-message > p:last-child {
    font-size: 15px;
  }
}

@media (max-width: 760px) {
  .auth-shell {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
    background:
      radial-gradient(circle at 86% 4%, rgb(218 172 160 / 25%), transparent 34%),
      linear-gradient(160deg, #f5ede6, #fffdf9 42%);
  }

  .brand-scene {
    display: none;
  }

  .auth-stage {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    justify-content: flex-start;
    padding:
      max(24px, env(safe-area-inset-top))
      max(24px, env(safe-area-inset-right))
      max(30px, env(safe-area-inset-bottom))
      max(24px, env(safe-area-inset-left));
    border: 0;
    background: transparent;
  }

  .auth-stage::before {
    top: 39px;
    right: 24px;
    width: 56px;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 clamp(47px, 10vh, 86px);
  }

  .brand-mark--mobile {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    font-size: 16px;
  }

  .mobile-brand > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .mobile-brand p {
    margin: 0;
    color: #483129;
    font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
    font-size: 17px;
    font-weight: 600;
  }

  .mobile-brand span:last-child {
    color: rgb(85 61 51 / 51%);
    font-size: 10px;
    letter-spacing: 0.14em;
  }

  .auth-panel {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
  }

  .auth-heading h2 {
    font-size: 38px;
  }

  .identity-chip {
    margin-top: 24px;
  }
}

@media (max-width: 390px) {
  .auth-stage {
    padding-right: 20px;
    padding-left: 20px;
  }

  .mobile-brand {
    margin-bottom: 44px;
  }

  .auth-heading h2 {
    font-size: 35px;
  }

  .auth-heading > p:last-child {
    min-height: 46px;
    font-size: 13px;
  }

  .identity-chip {
    margin-top: 21px;
    margin-bottom: 22px;
  }

  .identity-chip__status {
    display: none;
  }
}

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