/* 登录、注册的窄屏布局按内容排布，不随视口高度缩放表单；找回密码共用此布局。 */
@media (max-width: 1023px) {
  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    background: #fff;
  }

  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-shell__body {
    flex: 1;
    height: auto;
  }

  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-shell__entry {
    display: block;
    height: auto;
    overflow: visible;
    padding: max(28px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 24px max(24px, env(safe-area-inset-left));
    background: linear-gradient(180deg, #f2f6ff 0, #fff 240px);
  }

  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-shell__card {
    width: 100%;
    max-width: 440px;
    min-height: 0;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    zoom: 1;
  }

  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-shell__card-brand {
    width: 128px;
    margin: 0 0 28px;
    transform: none;
  }

  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-shell__card-header {
    margin: 0 0 28px;
    transform: none;
  }

  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-shell__card-header h2 {
    font-size: 28px;
    line-height: 1.35;
  }

  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-form__field {
    gap: 8px;
  }

  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-form__field label {
    font-size: 14px;
  }

  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-form input:not([type="checkbox"]),
  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-form select {
    height: 52px;
    min-height: 52px;
    border-radius: 12px;
    background: #f8faff;
    font-size: 16px;
  }

  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-form__toggle {
    width: 50px;
    height: 50px;
    border-radius: 11px;
  }

  .auth-shell--login .auth-form__modes {
    gap: 4px;
    padding: 4px;
    border: 0;
    border-radius: 14px;
    background: #edf2fa;
  }

  .auth-shell--login .auth-form__modes button {
    flex: 1;
    min-height: 44px;
    padding: 8px;
    border: 0;
    border-radius: 10px;
  }

  .auth-shell--login .auth-form__modes button[aria-pressed="true"] {
    background: #fff;
    box-shadow: 0 2px 6px rgb(31 58 105 / 8%);
  }

  .auth-shell--login .auth-form__options {
    min-height: 44px;
    margin: -8px 0;
    font-size: 14px;
  }

  .auth-shell--login .auth-form__options > * {
    display: flex;
    min-height: 44px;
    align-items: center;
  }

  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-form__submit {
    min-height: 52px;
    margin: 0;
    border-radius: 12px;
    background: #1768f2;
    box-shadow: 0 6px 16px rgb(23 104 242 / 16%);
    font-size: 16px;
  }

  .auth-shell--login .auth-form__login-alternate { margin-top: 24px; }
  .auth-shell--login .auth-form__divider::before,
  .auth-shell--login .auth-form__divider::after { display: none; }
  .auth-shell--login .auth-form__divider { justify-content: center; }
  .auth-shell--login .auth-form__secondary {
    min-height: 48px;
    margin-top: 8px;
    border: 0;
    border-radius: 12px;
    background: #edf4ff;
    font-size: 15px;
  }

  .auth-shell--register .auth-form__code-send {
    min-height: 52px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 14px;
  }

  .auth-shell--register .auth-form__terms {
    min-height: 44px;
    font-size: 13px;
    line-height: 1.7;
  }

  .auth-shell--register .auth-form__terms input {
    flex-shrink: 0;
    min-height: 18px;
  }

  .auth-shell--register .auth-form__register {
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 14px;
  }

  .auth-shell--register .auth-form__register::before,
  .auth-shell--register .auth-form__register::after { display: none; }
  .auth-shell--register .auth-form__register a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }

  .auth-shell--forgot .auth-form__secondary {
    min-height: 48px;
    margin-top: 0;
    border-radius: 12px;
    background: #edf4ff;
    font-size: 15px;
  }

  .auth-shell--forgot .auth-form__register {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 0;
    border-top: 0;
    font-size: 14px;
  }

  .auth-shell--forgot .auth-form__register a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-shell__footer {
    flex-direction: column;
    justify-content: center;
    height: auto;
    min-height: 0;
    padding: 8px 24px max(20px, env(safe-area-inset-bottom));
    gap: 4px;
    border: 0;
    background: #fff;
    text-align: center;
  }

  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-shell__footer-links {
    justify-content: center;
  }

  .auth-shell:is(.auth-shell--login, .auth-shell--register, .auth-shell--forgot) .auth-shell__footer a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }
}

