:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #162033;
  --text-secondary: #596579;
  --text-muted: #7b8799;
  --border: #d9e2ef;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --transition: 180ms ease;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 85% 5%, rgb(219 234 254 / 78%), transparent 26rem),
    radial-gradient(circle at 4% 94%, rgb(224 231 255 / 58%), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 18px;
}

.login-card {
  width: min(440px, 100%);
  padding: clamp(24px, 5vw, 36px);
  border: 1px solid rgb(203 213 225 / 88%);
  border-radius: 20px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 22px 58px rgb(15 23 42 / 12%);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e8edf4;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgb(37 99 235 / 12%);
  border-radius: 14px;
  background: linear-gradient(145deg, #3679ef, #1f59c8);
  box-shadow: 0 8px 18px rgb(37 99 235 / 20%);
  color: #fff;
  font-size: 19px;
  font-weight: 760;
}

.login-brand p,
.login-brand h1,
.auth-status h2,
.auth-status p,
.security-note { margin: 0; }

.login-brand p {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.login-brand h1 {
  margin-top: 2px;
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.auth-status {
  display: grid;
  justify-items: center;
  padding: 34px 8px 28px;
  text-align: center;
}

.status-spinner {
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  border: 3px solid #dbeafe;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.auth-status h2 {
  font-size: 19px;
  line-height: 1.35;
}

.auth-status p {
  margin-top: 8px;
  color: var(--text-secondary);
}

.qq-login {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe5f2;
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.qq-login:hover {
  border-color: #8bb4f7;
  box-shadow: 0 8px 22px rgb(37 99 235 / 12%);
}

.qq-login:active { transform: translateY(1px); }

.qq-login:focus-visible {
  outline: 3px solid rgb(37 99 235 / 20%);
  outline-offset: 3px;
}

.qq-login img {
  display: block;
  width: 230px;
  max-width: 100%;
  height: auto;
}

.security-note {
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.is-redirecting .qq-login { opacity: 0.72; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
  .login-shell {
    align-items: start;
    padding: 18px 12px;
  }

  .login-card {
    margin-top: max(0px, 4vh);
    padding: 22px 18px;
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
