:root {
  --primary: #6a5ae0;
  --primary-deep: #5647ca;
  --primary-soft: #f0effc;
  --page: #faf8ff;
  --surface: #ffffff;
  --ink: #292735;
  --text: #615e6d;
  --muted: #777382;
  --line: #e5e3ed;
  --danger: #c92f4c;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--page); font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
button, input { font: inherit; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, 1.05fr) minmax(440px, .95fr); }
.welcome { position: relative; min-height: 100vh; overflow: hidden; padding: 46px clamp(42px, 6vw, 90px); color: #fff; background: var(--primary); }
.welcome::after { content: ""; position: absolute; width: 420px; height: 420px; right: -170px; top: -160px; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; box-shadow: 0 0 0 64px rgba(255,255,255,.035), 0 0 0 128px rgba(255,255,255,.025); }
.welcome-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.welcome-brand img { width: 46px; height: 46px; border-radius: 50%; }
.welcome-brand strong, .welcome-brand small { display: block; }
.welcome-brand strong { font-size: 18px; font-weight: 600; }
.welcome-brand small { margin-top: 2px; color: rgba(255,255,255,.72); font-size: 11px; }
.welcome-copy { position: relative; z-index: 1; max-width: 560px; margin-top: clamp(90px, 16vh, 160px); }
.welcome-copy p { margin: 0 0 14px; color: rgba(255,255,255,.72); font-size: 13px; }
.welcome-copy h1 { max-width: 13em; margin: 0; font-size: clamp(32px, 3.2vw, 50px); line-height: 1.25; font-weight: 600; letter-spacing: -.025em; text-wrap: balance; }
.welcome-copy span { display: block; max-width: 36em; margin-top: 24px; color: rgba(255,255,255,.78); font-size: 14px; line-height: 1.8; }
.tiger-illustration { position: absolute; z-index: 1; right: clamp(20px, 5vw, 76px); bottom: clamp(20px, 4vh, 46px); width: min(43%, 330px); height: auto; object-fit: contain; filter: drop-shadow(0 16px 18px rgba(58,43,155,.2)); }

.login-panel { display: grid; place-items: center; min-width: 0; padding: 48px; background: var(--surface); }
.login-form { width: min(100%, 390px); }
.mobile-brand { display: none; }
.login-form header { margin-bottom: 38px; }
.login-form h2 { margin: 0; font-size: 28px; line-height: 1.3; font-weight: 600; letter-spacing: 0; }
.login-form header p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.login-form > label { display: grid; gap: 8px; margin-top: 20px; color: var(--text); font-size: 13px; font-weight: 500; }
.login-form input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fbfbfd; outline: none; transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease; }
.login-form input::placeholder { color: #777382; }
.login-form input:hover { border-color: #cbc7da; }
.login-form input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(106,90,224,.13); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 58px; }
.password-field button { position: absolute; inset: 0 8px 0 auto; width: 46px; border: 0; color: var(--primary); background: transparent; font-size: 12px; cursor: pointer; }
.password-field button:focus-visible { outline: 2px solid rgba(106,90,224,.35); outline-offset: -4px; border-radius: 7px; }
.login-error { min-height: 22px; margin: 10px 0 2px; color: var(--danger); font-size: 12px; line-height: 22px; }
.login-button { width: 100%; height: 48px; border: 0; border-radius: 10px; color: #fff; background: var(--primary); font-weight: 500; cursor: pointer; transition: background 160ms ease, transform 160ms ease; }
.login-button:hover { background: var(--primary-deep); }
.login-button:active { transform: translateY(1px); }
.login-button:focus-visible { outline: 3px solid rgba(106,90,224,.28); outline-offset: 3px; }
.login-button:disabled { cursor: wait; opacity: .72; }
.login-button.loading span::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 8px; border-radius: 50%; background: currentColor; animation: pulse 900ms ease-in-out infinite alternate; }
.security-note { margin: 18px 0 0; color: var(--muted); font-size: 11px; text-align: center; }

@keyframes pulse { to { opacity: .25; transform: scale(.65); } }

@media (max-width: 880px) {
  .login-page { display: block; background: linear-gradient(180deg, var(--primary-soft) 0, var(--page) 100%); }
  .welcome { display: none; }
  .login-panel { min-height: 100vh; padding: 32px 24px; background: transparent; }
  .login-form { padding: 30px 24px; border-radius: 16px; background: #fff; box-shadow: 0 6px 8px rgba(64,54,120,.08); }
  .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; }
  .mobile-brand img { width: 42px; height: 42px; border-radius: 50%; }
  .mobile-brand strong { font-size: 15px; font-weight: 600; }
  .login-form h2 { font-size: 24px; }
}

@media (max-width: 430px) {
  .login-panel { padding: 20px 16px; }
  .login-form { padding: 26px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
