/* ===================================================================
   B01 登录页样式 — 基于 V27A 视觉迁移，去除业务逻辑残留
   =================================================================== */

:root {
  --bg: #f4f7f3;
  --text: #25372f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { border: 0; cursor: pointer; }

/* ---- 登录页：屏幕居中 + 磨砂装饰 ---- */

.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background-color: #8e9863; /* 草原山谷主色 fallback，避免首屏白/灰 */
  background-image: var(--login-bg-image, url("/images/login-bg-v1.webp"));
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.login-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  --stage-unit: 1vw;
  max-width: 95vw;
}

/* ---- 登录卡片 ---- */

.login-auth-wrap {
  position: relative;
  width: clamp(220px, calc(var(--stage-unit) * 16.5), 280px);
  color: #fff;
  text-align: center;
}

.login-logo-title {
  font-size: clamp(23px, calc(var(--stage-unit) * 1.76), 31px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.035em;
  text-shadow: 0 1px 12px rgba(0,0,0,.18);
}

.login-logo-subtitle {
  margin-top: calc(var(--stage-unit) * .78);
  margin-bottom: clamp(22px, calc(var(--stage-unit) * 2.85), 38px);
  font-size: clamp(12px, calc(var(--stage-unit) * .95), 16px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: .015em;
  text-shadow: 0 1px 10px rgba(0,0,0,.16);
}

/* ---- 登录表单 ---- */

.login-form {
  display: grid;
  gap: clamp(14px, calc(var(--stage-unit) * 1.85), 26px);
}

.login-field {
  position: relative;
}

.login-field label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.login-field input {
  width: 100%;
  height: clamp(36px, calc(var(--stage-unit) * 2.78), 44px);
  border: 0;
  border-radius: clamp(7px, calc(var(--stage-unit) * .55), 10px);
  background: rgba(255,255,255,.96);
  color: #25372f;
  padding: 0 clamp(15px, calc(var(--stage-unit) * 1.45), 22px);
  outline: none;
  font-size: clamp(13px, calc(var(--stage-unit) * .94), 15px);
  font-weight: 520;
  box-shadow: 0 calc(var(--stage-unit) * .35) calc(var(--stage-unit) * 1.4) rgba(0,0,0,.08);
}

.login-field input::placeholder {
  color: rgba(29,29,31,.58);
}

.login-field input:focus {
  box-shadow:
    0 0 0 calc(var(--stage-unit) * .2) rgba(255,255,255,.52),
    0 calc(var(--stage-unit) * .42) calc(var(--stage-unit) * 1.55) rgba(0,0,0,.12);
}

.login-error {
  min-height: calc(var(--stage-unit) * 1.25);
  color: #fff;
  font-size: calc(var(--stage-unit) * .86);
  font-weight: 800;
  text-shadow: 0 1px 8px rgba(0,0,0,.28);
}

.login-error:empty {
  display: none;
}

.login-button {
  width: 100%;
  height: clamp(36px, calc(var(--stage-unit) * 2.78), 44px);
  border-radius: clamp(7px, calc(var(--stage-unit) * .55), 10px);
  background: #355944;
  color: #fff;
  font-size: clamp(13px, calc(var(--stage-unit) * 1.02), 16px);
  font-weight: 760;
  letter-spacing: .01em;
  box-shadow: 0 calc(var(--stage-unit) * .45) calc(var(--stage-unit) * 1.45) rgba(0,0,0,.2);
  transition: transform .18s ease, background .18s ease;
}

.login-button:hover {
  background: #284b36;
  transform: translateY(calc(var(--stage-unit) * -.08));
}

.login-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-card-footer {
  margin-top: clamp(18px, calc(var(--stage-unit) * 3.2), 38px);
  color: rgba(255,255,255,.9);
  font-size: clamp(9px, calc(var(--stage-unit) * .68), 12px);
  line-height: 1.45;
  font-weight: 500;
  text-shadow: 0 1px 8px rgba(0,0,0,.2);
}

.login-card-footer div {
  margin: 0;
}

/* ---- 磨砂玻璃登录容器（背景层） ---- */

.login-glass-wrap {
  max-width: 95vw;
  padding: clamp(22px, 3.8vh, 40px) clamp(18px, 4.5vw, 40px);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: clamp(18px, 2.4vw, 32px);
  backdrop-filter: blur(22px) saturate(1.04);
  -webkit-backdrop-filter: blur(22px) saturate(1.04);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.04);
  opacity: 0;
  animation: loginFadeIn .8s ease .12s forwards;
  transition: transform 0.1s ease-out;
}

/* ---- 光标跟随光晕 ---- */

.login-cursor-glow {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--stage-unit) * 34);
  height: calc(var(--stage-unit) * 34);
  border-radius: 999px;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity .42s ease;
  will-change: transform, opacity;
  background:
    radial-gradient(circle,
      rgba(255,255,255,.44) 0%,
      rgba(255,255,255,.32) 16%,
      rgba(255,255,255,.20) 34%,
      rgba(255,255,255,.09) 56%,
      rgba(255,255,255,0) 78%);
  filter: blur(calc(var(--stage-unit) * 1.45));
  mix-blend-mode: soft-light;
}

.login-screen.cursor-active .login-cursor-glow {
  opacity: .88;
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .login-cursor-glow {
    display: none;
  }
}

/* ---- 动画 ---- */

@keyframes loginFadeIn {
  from {
    opacity: 0;
    transform: translateY(calc(var(--stage-unit) * -1));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- 无障碍 ---- */

@media (prefers-reduced-motion: reduce) {
  .login-glass-wrap {
    animation: none;
    opacity: 1;
  }
  .login-button {
    transition: none;
  }
}

/* ---- 响应式 ---- */

@media (max-height: 760px) {
  .login-logo-subtitle {
    margin-bottom: clamp(14px, calc(var(--stage-unit) * 2), 24px);
  }
  .login-form {
    gap: clamp(10px, calc(var(--stage-unit) * 1.35), 18px);
  }
  .login-card-footer {
    margin-top: clamp(12px, calc(var(--stage-unit) * 2.1), 24px);
  }
}

@media (max-width: 780px) {
  .login-auth-wrap {
    width: min(76vw, 260px);
  }
}
