:root {
  --ink: #16131f;
  --accent: #002FA7;
  --white: #fff;
  --muted: rgba(22, 19, 31, .58);
  --line: rgba(22, 19, 31, .3);
  font-family: DengXian, "等线", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--white);
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button, input { border-radius: 0; }
button:focus-visible, input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button:disabled { cursor: wait; }

.login-page { display: flex; flex-direction: column; height: 100svh; min-height: 680px; padding: 0 4.5vw; }
.login-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 84px; flex: 0 0 84px; }
.wordmark { font-family: "Segoe Script", "Lucida Handwriting", cursive; font-weight: 400; letter-spacing: -1.5px; }
.header-wordmark { object-fit: contain; width: 170px; height: auto; display: block; color: var(--accent); font-size: 34px; line-height: 1.35; }
.release-version { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.login-main { display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(0, .87fr); gap: 7vw; flex: 1; min-height: 0; }
.login-art { position: relative; overflow: hidden; min-width: 0; min-height: 0; margin: 0; background: var(--ink); }
.login-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.login-art picture { display: contents; }
.art-signature { position: absolute; inset: auto 38px 38px; display: flex; flex-direction: column; gap: 9px; color: var(--white); pointer-events: none; }
.art-wordmark { font-size: 80px; line-height: 1.35; }
.art-caption { font-size: 12px; line-height: 1.5; letter-spacing: 3px; }
.login-panel { display: flex; align-items: center; min-width: 0; padding-right: 2vw; }
.login-content { width: 100%; max-width: 384px; }
.eyebrow { margin: 0; color: var(--accent); font-size: 11px; line-height: 1.5; letter-spacing: 2.7px; }
.login-intro h1 { margin: 22px 0 16px; font-size: 32px; line-height: 1.3; font-weight: 400; letter-spacing: 1px; }
.login-description { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
#login-form { margin-top: 34px; }
[hidden] { display: none !important; }
#password-setup-form { margin-top: 26px; }
.setup-active .login-intro h1 { margin-top: 17px; font-size: 28px; }
.setup-active .login-field + .login-field { margin-top: 18px; }
.setup-hint { margin: 18px 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.setup-switch { padding: 6px 0; min-height: 32px; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.setup-switch:hover { color: var(--accent); }
.login-field.is-valid .field-row { border-color: #278454; }
.login-field.is-valid .field-row:focus-within { box-shadow: 0 1px 0 #278454; }
.login-field + .login-field { margin-top: 23px; }
.login-field label { display: block; margin-bottom: 5px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.field-row { position: relative; height: 50px; border-bottom: 1px solid var(--line); transition: border-color .15s; }
.field-row:focus-within { border-color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
.field-row input { display: block; width: 100%; height: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; font-size: 15px; line-height: normal; }
.field-row input::placeholder { color: rgba(22, 19, 31, .43); opacity: 1; font-size: 14px; }
.field-row input:autofill { box-shadow: 0 0 0 100px var(--white) inset; }
.field-row input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px var(--white) inset; -webkit-text-fill-color: var(--ink); caret-color: var(--ink); }
.password-row input { padding-right: 60px; }
.password-toggle { position: absolute; top: 2px; right: -8px; min-width: 52px; min-height: 44px; padding: 0 8px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.password-toggle:hover { color: var(--accent); }
.login-field.is-invalid .field-row { border-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }
.login-options { display: flex; align-items: center; min-height: 56px; }
.remember-choice { display: inline-flex; align-items: center; gap: 9px; min-height: 36px; color: var(--muted); font-size: 12px; cursor: pointer; }
.remember-choice input { appearance: none; position: relative; width: 14px; height: 14px; margin: 0; border: 1px solid var(--line); background: var(--white); cursor: pointer; flex: none; }
.remember-choice input:checked { border-color: var(--ink); background: var(--ink); }
.remember-choice input:checked::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid var(--white); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.login-submit { display: flex; align-items: center; justify-content: center; gap: 22px; width: 100%; height: 50px; padding: 0 24px; border: 1px solid var(--ink); background: var(--ink); color: var(--white); font-size: 14px; letter-spacing: 2px; transition: background .15s, border-color .15s; }
.login-submit:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
.login-submit:disabled { opacity: .72; }
.submit-arrow { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; }
.login-error { min-height: 23px; margin: 10px 0 0; color: var(--accent); font-size: 13px; line-height: 1.7; }
.desktop-note { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.login-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 70px; flex: 0 0 70px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.desktop-required { display: none; }

@media (max-width: 1199px) and (min-width: 1024px) {
  .login-panel { padding-right: 0; }
  .art-signature { right: 28px; bottom: 30px; left: 28px; }
}

@media (max-width: 1023px) {
  .login-page { min-height: 100svh; height: auto; padding: 0 max(24px, env(safe-area-inset-left)); }
  .login-header { height: 82px; flex-basis: 82px; border-bottom: 1px solid #e8e7ea; }
  .header-wordmark { width: 150px; }
  .login-main { display: block; flex: 1; padding: clamp(34px,8vh,76px) 0 30px; }
  .login-art { display: none; }
  .login-panel { display: block; padding: 0; }
  .login-content { max-width: 420px; margin: auto; }
  .login-intro h1 { font-size: 30px; font-weight: 300; margin: 18px 0 12px; }
  .eyebrow { font-size: 12px; }
  .field-row input { font-size: 16px; }
  .field-row input::placeholder { font-size: 15px; }
  .login-field label,.login-description { color: #68636f; }
  .remember-choice { min-height: 44px; font-size: 13px; }
  .remember-choice input { width: 18px; height: 18px; }
  .remember-choice input:checked::after { left: 5px; top: 2px; width: 5px; height: 9px; }
  .setup-switch { min-height: 44px; }
  .login-error { min-height: 24px; }
  .login-footer { height: auto; min-height: 58px; padding-bottom: max(12px,env(safe-area-inset-bottom)); font-size: 12px; }
  .footer-desktop-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
