/* 登录页角色动画：作用域限制在 #anim-login-root；配色与注册页 auth-section / auth-body 一致 */
#anim-login-root {
  --background: #ffffff;
  --foreground: #0f172a;
  --muted: #64748b;
  --border: rgba(148, 163, 184, 0.45);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: rgba(99, 102, 241, 0.08);
  --red-400: #ef4444;
  --red-950: #fef2f2;
  --red-900: #fecaca;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}

#anim-login-root *,
#anim-login-root *::before,
#anim-login-root *::after {
  box-sizing: border-box;
}

#anim-login-root a {
  color: inherit;
  text-decoration: none;
}

#anim-login-root .min-h-screen {
  min-height: calc(100vh - 9rem);
  padding: 32px 0 48px;
  /* 与注册页 .auth-section 一致（并铺浅灰底，与前台 goodlist 等区域协调） */
  background-color: #f8fafc;
  background-image: radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 60%);
}

@media (min-width: 992px) {
  #anim-login-root .min-h-screen {
    min-height: calc(100vh - 10rem);
    padding: 60px 0 80px;
  }
}

#anim-login-root .grid {
  display: grid;
}

@media (min-width: 1024px) {
  #anim-login-root .lg\:grid-cols-2 {
    grid-template-columns: 1fr 1fr;
  }
  #anim-login-root .lg\:flex {
    display: flex;
  }
  #anim-login-root .lg\:hidden {
    display: none;
  }
}

#anim-login-root .hidden {
  display: none;
}

#anim-login-root .flex {
  display: flex;
}

#anim-login-root .flex-col {
  flex-direction: column;
}

#anim-login-root .items-center {
  align-items: center;
}

#anim-login-root .items-end {
  align-items: flex-end;
}

#anim-login-root .justify-center {
  justify-content: center;
}

#anim-login-root .justify-between {
  justify-content: space-between;
}

#anim-login-root .flex-wrap {
  flex-wrap: wrap;
}

#anim-login-root .relative {
  position: relative;
}

#anim-login-root .absolute {
  position: absolute;
}

#anim-login-root .inset-0 {
  inset: 0;
}

#anim-login-root .bottom-0 {
  bottom: 0;
}

#anim-login-root .z-20 {
  z-index: 20;
}

#anim-login-root .gap-2 {
  gap: 0.5rem;
}

#anim-login-root .gap-3 {
  gap: 0.75rem;
}

#anim-login-root .gap-6 {
  gap: 1.5rem;
}

#anim-login-root .gap-8 {
  gap: 2rem;
}

#anim-login-root .p-8 {
  padding: 2rem;
}

#anim-login-root .mb-2 {
  margin-bottom: 0.5rem;
}

#anim-login-root .mb-10 {
  margin-bottom: 2.5rem;
}

#anim-login-root .mb-12 {
  margin-bottom: 3rem;
}

#anim-login-root .mt-6 {
  margin-top: 1.5rem;
}

#anim-login-root .mt-8 {
  margin-top: 2rem;
}

#anim-login-root .mr-2 {
  margin-right: 0.5rem;
}

#anim-login-root .text-center {
  text-align: center;
}

#anim-login-root .text-sm {
  font-size: 0.875rem;
}

#anim-login-root .text-lg {
  font-size: 1.125rem;
}

#anim-login-root .text-3xl {
  font-size: 1.875rem;
  line-height: 1.2;
}

#anim-login-root .font-medium {
  font-weight: 500;
}

#anim-login-root .font-semibold {
  font-weight: 600;
}

#anim-login-root .font-bold {
  font-weight: 700;
}

#anim-login-root .font-normal {
  font-weight: 400;
}

#anim-login-root .tracking-tight {
  letter-spacing: -0.025em;
}

#anim-login-root .text-muted-foreground {
  color: var(--muted);
}

#anim-login-root .text-primary {
  color: var(--primary);
}

#anim-login-root .w-full {
  width: 100%;
}

#anim-login-root .size-4 {
  width: 1rem;
  height: 1rem;
}

#anim-login-root .size-5 {
  width: 1.25rem;
  height: 1.25rem;
}

#anim-login-root .size-8 {
  width: 2rem;
  height: 2rem;
}

#anim-login-root .size-64 {
  width: 16rem;
  height: 16rem;
}

#anim-login-root .size-96 {
  width: 24rem;
  height: 24rem;
}

#anim-login-root .rounded-lg {
  border-radius: 0.5rem;
}

#anim-login-root .rounded-md {
  border-radius: calc(0.5rem - 2px);
}

#anim-login-root .rounded-full {
  border-radius: 9999px;
}

#anim-login-root .border {
  border: 1px solid var(--border);
}

#anim-login-root .rounded-lg.border {
  border-color: rgba(148, 163, 184, 0.35);
}

#anim-login-root .panel-left {
  display: none;
  flex-direction: column;
  justify-content: center;
  color: var(--foreground);
  overflow: hidden;
  background: transparent;
}

@media (min-width: 1024px) {
  #anim-login-root .panel-left {
    display: flex;
  }
}

#anim-login-root .blur-3xl {
  filter: blur(64px);
}

#anim-login-root .top-1\/4 {
  top: 25%;
}

#anim-login-root .right-1\/4 {
  right: 25%;
}

#anim-login-root .bottom-1\/4 {
  bottom: 25%;
}

#anim-login-root .left-1\/4 {
  left: 25%;
}

#anim-login-root .bg-primary-foreground\/10 {
  background: rgba(99, 102, 241, 0.1);
}

#anim-login-root .bg-primary-foreground\/5 {
  background: rgba(99, 102, 241, 0.05);
}

#anim-login-root .brand-ic {
  background: rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

#anim-login-root .brand-ic svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#anim-login-root .space-y-5 > * + * {
  margin-top: 1.25rem;
}

#anim-login-root .space-y-2 > * + * {
  margin-top: 0.5rem;
}

#anim-login-root label.text-sm {
  display: block;
}

#anim-login-root .input-ctrl {
  width: 100%;
  height: 3rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  background: var(--background);
  color: var(--foreground);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#anim-login-root .input-ctrl:focus {
  border-color: var(--primary);
  box-shadow:
    0 0 0 2px var(--background),
    0 0 0 4px color-mix(in oklab, var(--primary) 35%, transparent);
}

#anim-login-root .pr-10 {
  padding-right: 2.5rem;
}

#anim-login-root .toggle-eye {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  transition: color 0.15s;
}

#anim-login-root .toggle-eye:hover {
  color: var(--foreground);
}

#anim-login-root .toggle-eye svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

#anim-login-root .remember-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#anim-login-root .remember-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  cursor: pointer;
}

#anim-login-root .cursor-pointer {
  cursor: pointer;
}

#anim-login-root .btn-submit {
  width: 100%;
  height: 3rem;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 0.375rem;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}

#anim-login-root .btn-submit:hover:not(:disabled) {
  background: var(--primary-hover);
}

#anim-login-root .btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

#anim-login-root .eye-shell {
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: height 0.15s, width 0.15s;
}

#anim-login-root .eye-shell.blinking {
  height: 2px !important;
  min-height: 2px;
}

#anim-login-root .eye-shell.blinking .pupil-dot {
  opacity: 0;
}

#anim-login-root .pupil-dot {
  border-radius: 9999px;
  transition: transform 0.1s ease-out;
}

#anim-login-root .char-block {
  position: absolute;
  bottom: 0;
  transition: transform 0.7s ease-in-out, left 0.7s ease-in-out, height 0.7s ease-in-out;
  transform-origin: bottom center;
}

#anim-login-root .eyes-abs {
  position: absolute;
  display: flex;
  transition: left 0.7s ease-in-out, top 0.7s ease-in-out, transform 0.2s ease-out;
}

#anim-login-root .eyes-abs.fast {
  transition: left 0.2s ease-out, top 0.2s ease-out;
}

#anim-login-root .hand-o {
  position: absolute;
  width: 36px;
  height: 44px;
  background: linear-gradient(165deg, #ffd4b8 0%, #ff9b6b 45%, #ea8a5c 100%);
  border-radius: 50% 50% 45% 45%;
  pointer-events: none;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.06);
  bottom: auto;
  transition:
    top 0.5s cubic-bezier(0.34, 1.12, 0.64, 1),
    left 0.5s cubic-bezier(0.34, 1.12, 0.64, 1),
    opacity 0.35s ease,
    transform 0.5s cubic-bezier(0.34, 1.12, 0.64, 1);
  opacity: 0;
}

#anim-login-root .hand-o.l {
  top: calc(var(--orange-eye-top, 90px) + 78px);
  left: calc(var(--orange-eye-left, 82px) - 18px);
  transform: rotate(-16deg);
  transform-origin: 50% 0%;
  z-index: 6;
}

#anim-login-root .hand-o.r {
  top: calc(var(--orange-eye-top, 90px) + 78px);
  left: calc(var(--orange-eye-left, 82px) + 58px);
  transform: rotate(16deg);
  transform-origin: 50% 0%;
  z-index: 6;
}

#anim-login-root .hand-o.up {
  opacity: 1;
}

#anim-login-root .hand-o.up.l {
  z-index: 12;
  width: 28px;
  height: 30px;
  border-radius: 55% 55% 48% 48%;
  top: calc(var(--orange-eye-top, 90px) + 5px);
  left: calc(var(--orange-eye-left, 82px) - 22px);
  transform: rotate(26deg);
  transform-origin: 96% 4%;
}

#anim-login-root .hand-o.up.r {
  z-index: 12;
  width: 28px;
  height: 30px;
  border-radius: 55% 55% 48% 48%;
  top: calc(var(--orange-eye-top, 90px) + 5px);
  left: calc(var(--orange-eye-left, 82px) + 48px);
  transform: rotate(-26deg);
  transform-origin: 4% 4%;
}

#anim-login-root #sceneBox.laughing {
  animation: anim-login-laughBob 0.4s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes anim-login-laughBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #anim-login-root .char-block,
  #anim-login-root .eyes-abs,
  #anim-login-root .pupil-dot,
  #anim-login-root .eye-shell {
    transition-duration: 0.01ms !important;
  }

  #anim-login-root #sceneBox.laughing {
    animation: none;
  }

  #anim-login-root .hand-o {
    transition-duration: 0.01ms !important;
  }
}

#anim-login-root .h-\[500px\] {
  height: 500px;
}

#anim-login-root .anim-login-form-col {
  background: transparent;
}

/* 与注册页 .auth-card 同系的圆角毛玻璃 */
#anim-login-root .anim-login-glass {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.55)),
    rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 22px 45px rgba(15, 23, 42, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
  overflow: hidden;
  padding: 28px 24px 24px;
}

@media (max-width: 576px) {
  #anim-login-root .anim-login-glass {
    padding: 22px 18px 20px;
    border-radius: 16px;
  }
}

#anim-login-root .btn-submit-register {
  background: #10b981;
}

#anim-login-root .btn-submit-register:hover:not(:disabled) {
  background: #059669;
}

#anim-login-root .btn-send-code {
  height: 3rem;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.375rem;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

#anim-login-root .btn-send-code:hover {
  background: var(--accent);
}

#anim-login-root .anim-register-terms .remember-row {
  align-items: flex-start;
}

#anim-login-root .anim-register-terms .remember-row input[type="checkbox"] {
  margin-top: 0.2rem;
}

/* 插件注入的验证码等 */
#anim-login-root .anim-login-hook .form-control,
#anim-login-root .anim-login-hook input {
  background: var(--background);
  color: var(--foreground);
  border-color: color-mix(in oklab, var(--border) 60%, transparent);
}

#anim-login-root .anim-login-hook label {
  color: var(--muted);
}
