/* 登录参考页：极简黑白、胶囊表单与分步动效，限定在认证页面。 */
body.auth-flow {
  --auth-bg: #fff;
  --auth-surface: #f7f7f8;
  --auth-ink: #111;
  --auth-sub: #555;
  --auth-muted: #777;
  --auth-line: #e8e8eb;
  --auth-ease: cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
  height: auto !important;
  min-height: var(--lm-viewport-height, 100dvh) !important;
  overflow-x: clip;
  overflow-y: auto !important;
  background: var(--auth-bg) !important;
  color: var(--auth-ink);
  -webkit-font-smoothing: antialiased;
}
html.dark body.auth-flow {
  --auth-bg: #111113;
  --auth-surface: #1d1d20;
  --auth-ink: #f5f5f7;
  --auth-sub: #c1c1c7;
  --auth-muted: #a0a0a8;
  --auth-line: #36363b;
}
body.auth-flow [hidden] {
  display: none !important;
}
body.auth-flow .mobile-container {
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: var(--lm-viewport-height, 100dvh) !important;
  max-height: none !important;
  margin: 0 !important;
  padding: max(24px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left)) !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--auth-bg) !important;
  color: var(--auth-ink);
  box-shadow: none !important;
}
.auth-flow .auth-header,
.auth-flow .auth-footer {
  width: min(100%, 960px);
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex: none;
}
.auth-flow .auth-header {
  min-height: 38px;
}
.auth-flow .auth-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--auth-ink);
  text-decoration: none;
  min-width: 0;
}
.auth-flow .auth-brand img {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
}
.auth-flow .logo-text {
  margin: 0;
  color: var(--auth-ink);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.auth-flow .brand-sub,
.auth-flow .auth-home {
  font-size: 12px;
  color: var(--auth-muted);
  white-space: nowrap;
}
.auth-flow .auth-home {
  padding: 8px 0 8px 8px;
  text-decoration: none;
}
.auth-flow .auth-home span {
  margin-left: 4px;
}
.auth-flow .main-content {
  width: min(100%, 420px);
  max-width: 420px;
  flex: none;
  margin: auto;
  padding: 36px 0 !important;
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: var(--auth-ink);
  box-shadow: none;
}
.auth-flow .auth-progress {
  width: 56px;
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
}
.auth-flow .auth-progress i {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: var(--auth-line);
  transition: background 0.2s;
}
.auth-flow .auth-progress i.done {
  background: var(--auth-ink);
}
.auth-flow .auth-step-title {
  font-size: 28px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.025em;
  margin: 0 0 10px;
  color: var(--auth-ink);
}
.auth-flow .auth-step-note {
  margin: 0 0 30px;
  color: var(--auth-sub);
  font-size: 14px;
  line-height: 1.7;
  text-wrap: pretty;
}
.auth-flow :is(.input-group, .qq-nickname-input) {
  width: 100%;
  height: 52px;
  min-width: 0;
  margin-bottom: 14px;
  padding: 0 21px;
  border: 1px solid var(--auth-line);
  border-radius: 999px;
  background: var(--auth-bg) !important;
  color: var(--auth-ink);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.auth-flow :is(.input-group, .qq-nickname-input):focus-within {
  border-color: var(--auth-ink);
  box-shadow: 0 0 0 1px var(--auth-ink);
}
.auth-flow :is(.input-group, .qq-nickname-input) input {
  min-width: 0;
  font-size: 16px;
  color: var(--auth-ink);
  background: transparent;
  font-family: inherit;
}
.auth-flow input::placeholder {
  color: var(--auth-muted);
  opacity: 1;
}
.auth-flow .qq-nickname-input input {
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.auth-flow .username-hint {
  margin: 0 8px 12px;
  color: var(--auth-sub);
  font-size: 12px;
  line-height: 1.6;
}
.auth-flow .username-hint:empty {
  display: none;
}
.auth-flow :is(.login-btn, .register-btn, .oauth-btn) {
  width: 100%;
  min-height: 52px;
  height: auto;
  padding: 14px 20px;
  margin: 10px 0 0;
  border: 1px solid var(--auth-ink);
  border-radius: 999px;
  background: var(--auth-ink);
  color: var(--auth-bg);
  font: inherit;
  font-size: 15px;
  font-weight: 550;
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    opacity 0.2s,
    transform 0.15s;
}
.auth-flow .oauth-btn {
  margin-top: 0;
  border-color: var(--auth-line);
  background: var(--auth-bg);
  color: var(--auth-ink);
}
.auth-flow :is(.login-btn, .register-btn, .oauth-btn):active {
  transform: scale(0.985);
}
.auth-flow :is(.login-btn, .register-btn, .oauth-btn):disabled {
  opacity: 0.55;
  cursor: wait;
}
.auth-flow .spinner {
  border-color: var(--auth-bg);
  border-top-color: transparent;
}
.auth-flow .auth-switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.auth-flow :is(.auth-switch button, .auth-back, .login-help button) {
  border: 0;
  background: transparent;
  padding: 8px 0;
  color: var(--auth-sub);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.auth-flow .login-help {
  margin-top: 12px;
  text-align: right;
}
.auth-flow .auth-back {
  margin-top: 12px;
}
.auth-flow .tabs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 28px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--auth-sub);
  font-size: 13px;
}
.auth-flow .tabs .tab {
  flex: none;
  padding: 5px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--auth-ink);
  box-shadow: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.auth-flow .tabs .tab.active {
  display: none;
}
.auth-flow .tabs:has([data-tab="login"].active) .auth-route-note::before {
  content: "没有账号？";
}
.auth-flow .tabs:has([data-tab="register"].active) .auth-route-note::before {
  content: "已有账号？";
}
.auth-flow:has(#oauth-pending-panel:not(.hidden)) .tabs {
  display: none;
}
.auth-flow .register-type-selector {
  gap: 8px;
  margin-bottom: 22px;
  background: transparent;
  border: 0;
  padding: 0;
}
.auth-flow .register-type {
  padding: 10px 14px;
  border: 1px solid var(--auth-line);
  border-radius: 999px;
  color: var(--auth-sub);
  background: var(--auth-bg);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.auth-flow .register-type.active {
  background: var(--auth-surface);
  border-color: var(--auth-ink);
  color: var(--auth-ink);
}
.auth-flow .avatar-upload-area {
  margin: 0 0 22px;
  gap: 12px;
}
.auth-flow .avatar-preview {
  width: 76px;
  height: 76px;
  border: 1px dashed var(--auth-line);
  border-radius: 50%;
  background: var(--auth-surface);
}
.auth-flow :is(.avatar-upload-btn, .fill-nickname-btn) {
  border: 0;
  background: transparent;
  color: var(--auth-sub);
  padding: 8px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.auth-flow .auth-field label {
  display: block;
  margin: 16px 0 8px;
  color: var(--auth-sub);
  font-size: 13px;
}
.auth-flow
  .auth-field
  :is(input[type="date"], input[type="text"], input[type="password"]) {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 21px;
  border: 1px solid var(--auth-line);
  border-radius: 999px;
  background: var(--auth-bg);
  color: var(--auth-ink);
  font: inherit;
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
}
.auth-flow .auth-field input:focus {
  border-color: var(--auth-ink);
  box-shadow: 0 0 0 1px var(--auth-ink);
}
.auth-flow .auth-field small {
  display: block;
  margin: 7px 4px 14px;
  color: var(--auth-muted);
  font-size: 12px;
  line-height: 1.7;
}
.auth-flow .auth-checkbox {
  display: flex !important;
  align-items: center;
  gap: 9px;
  margin: 16px 0 22px !important;
  line-height: 1.6;
}
.auth-flow .auth-checkbox input {
  width: 17px;
  height: 17px;
  flex: none;
  accent-color: var(--auth-ink);
}
.auth-flow .agreement {
  margin: 26px 0 0;
  color: var(--auth-muted);
  font-size: 11px;
  line-height: 1.8;
}
.auth-flow .agreement a {
  color: var(--auth-sub);
}
.auth-flow .radio-circle {
  border-color: var(--auth-line);
  background: var(--auth-bg);
}
.auth-flow .radio-circle.checked {
  border-color: var(--auth-ink);
  background: var(--auth-ink);
}
.auth-flow .radio-circle.checked::after {
  border-color: var(--auth-bg);
}
.auth-flow .auth-footer {
  color: var(--auth-muted);
  font-size: 11px;
  line-height: 1.7;
  padding-top: 16px;
}
.auth-flow .version-info {
  margin: 0;
  color: inherit;
  font-size: inherit;
}
.auth-flow .auth-submit-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  font-size: 12px;
  color: var(--auth-sub);
}
.auth-flow .auth-indicator {
  width: 36px;
  height: 2px;
  flex: none;
  position: relative;
  overflow: hidden;
  background: var(--auth-line);
}
.auth-flow .auth-indicator::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--auth-ink);
  animation: authPulse 1.4s ease-in-out infinite;
}
.auth-flow .auth-dialog {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #11111166;
  backdrop-filter: blur(5px);
}
.auth-flow :is(.auth-dialog-card, .recovery-card) {
  width: min(100%, 400px);
  max-height: calc(var(--lm-viewport-height, 100dvh) - 40px);
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--auth-line);
  border-radius: 24px;
  background: var(--auth-bg);
  color: var(--auth-ink);
  box-shadow: 0 20px 70px #0002;
}
.auth-flow .auth-dialog-card h2 {
  font-size: 22px;
  font-weight: 650;
  margin: 0 0 12px;
}
.auth-flow :is(.auth-dialog-card p, .recovery-card p) {
  color: var(--auth-sub);
  line-height: 1.8;
  font-size: 13px;
}
.auth-flow .auth-dialog-card a {
  color: var(--auth-ink);
  text-underline-offset: 3px;
}
.auth-flow .auth-dialog-card .captcha-row {
  display: flex !important;
  margin: 22px 0 16px;
}
.auth-flow :is(.captcha-question, .captcha-row input, .captcha-refresh) {
  border-color: var(--auth-line);
  background: var(--auth-surface);
  color: var(--auth-ink);
}
.auth-flow .auth-dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.auth-flow :is(.auth-dialog-actions button, .recovery-actions button) {
  flex: 1;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--auth-line);
  border-radius: 999px;
  background: var(--auth-surface);
  color: var(--auth-sub);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.auth-flow .auth-dialog-actions button:last-child,
.auth-flow .recovery-actions .recovery-primary {
  border-color: var(--auth-ink);
  background: var(--auth-ink);
  color: var(--auth-bg);
}
.auth-flow .auth-dialog-actions button:disabled {
  opacity: 0.5;
}
.auth-flow .oauth-pending-card {
  background: var(--auth-surface);
  border-color: var(--auth-line);
}
.auth-flow .oauth-pending-title {
  color: var(--auth-ink);
}
.auth-flow .oauth-pending-sub {
  color: var(--auth-sub);
}
.auth-flow .recovery-head button {
  color: var(--auth-sub);
}
.auth-flow .toast {
  z-index: 3500;
  border-radius: 999px;
  background: #111e;
  color: #fff;
}
.auth-flow .toast.error {
  background: #9e302aed;
}
.auth-flow :is(button, a, input):focus-visible {
  outline: 2px solid var(--auth-ink);
  outline-offset: 4px;
}
.auth-flow [data-auth-step][hidden] {
  display: none !important;
}
.auth-flow
  :is(#login-panel, #register-panel)[data-step="captcha"]
  .captcha-row {
  display: flex;
  margin: 22px 0;
}
.auth-flow .auth-progress {
  width: 90px;
}
@media (max-width: 600px) {
  body.auth-flow .mobile-container {
    padding: max(20px, env(safe-area-inset-top))
      max(20px, env(safe-area-inset-right))
      max(18px, env(safe-area-inset-bottom))
      max(20px, env(safe-area-inset-left)) !important;
  }
  .auth-flow .brand-sub {
    display: none;
  }
  .auth-flow .main-content {
    padding: 28px 0 !important;
  }
  .auth-flow .auth-step-title {
    font-size: 26px;
  }
  .auth-flow .auth-dialog {
    padding: 16px;
  }
  .auth-flow :is(.auth-dialog-card, .recovery-card) {
    padding: 24px 20px;
    max-height: calc(var(--lm-viewport-height, 100dvh) - 32px);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .auth-flow
    .auth-stage-enter[data-transition="odd"]
    :is(
      .auth-step-title,
      .auth-step-note,
      .input-group,
      .auth-field,
      .login-btn,
      .register-btn
    ) {
    animation: authStageA 0.55s var(--auth-ease) both;
  }
  .auth-flow
    .auth-stage-enter[data-transition="even"]
    :is(
      .auth-step-title,
      .auth-step-note,
      .input-group,
      .auth-field,
      .login-btn,
      .register-btn
    ) {
    animation: authStageB 0.55s var(--auth-ease) both;
  }
  .auth-flow .auth-stage-enter .auth-step-note {
    animation-delay: 0.06s !important;
  }
  .auth-flow .auth-stage-enter :is(.input-group, .auth-field) {
    animation-delay: 0.12s !important;
  }
  .auth-flow .auth-stage-enter :is(.login-btn, .register-btn) {
    animation-delay: 0.18s !important;
  }
  .auth-flow .auth-dialog-card {
    animation: authStageA 0.25s var(--auth-ease) both;
  }
}
@media (prefers-reduced-motion: reduce) {
  .auth-flow *,
  .auth-flow *::before,
  .auth-flow *::after {
    animation: none !important;
    transition: none !important;
  }
}
@keyframes authStageA {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes authStageB {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes authPulse {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}
