/* 登录页面样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 50%, #bae6fd 100%);
  background-size: 200% 200%;
  animation: loginBgPulse 8s ease infinite;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-bg {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* --- 入场动画 --- */
@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes loginFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes loginSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
@keyframes loginSpin {
  to { transform: rotate(360deg); }
}
@keyframes loginBgPulse {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.login-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  animation: loginCardIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-brand {
  text-align: center;
  margin-bottom: 36px;
  animation: loginFadeIn 0.8s ease both;
}

.login-logo {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  transition: transform 0.3s ease;
}
.login-logo:hover {
  transform: scale(1.1) rotate(-5deg);
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a1d23;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 14px;
  color: #9ca3af;
}

.login-form .form-group {
  margin-bottom: 20px;
  animation: loginSlideUp 0.5s ease both;
}
.login-form .form-group:nth-child(1) { animation-delay: 0.2s; }
.login-form .form-group:nth-child(2) { animation-delay: 0.3s; }

.login-form .form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #5c6370;
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #b0b7c3;
  pointer-events: none;
}

.form-input-lg {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1px solid #e0e2e6;
  border-radius: 10px;
  font-size: 15px;
  color: #1a1d23;
  background: #f9fafb;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  font-family: inherit;
}

.form-input-lg:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
  background: #ffffff;
}

.form-input-lg::placeholder {
  color: #c0c7cf;
}

.pw-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: #b0b7c3;
  padding: 4px;
  display: flex;
  align-items: center;
}

.pw-toggle:hover { color: #0ea5e9; }
.pw-toggle svg { width: 20px; height: 20px; }

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  animation: loginShake 0.4s ease;
  transition: all 0.2s ease;
}

.btn-login {
  width: 100%;
  padding: 13px;
  background: #0ea5e9;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  letter-spacing: 2px;
  font-family: inherit;
  position: relative;
  overflow: hidden;
  animation: loginSlideUp 0.5s ease 0.4s both;
}

.btn-login:hover {
  background: #4a8ac4;
  box-shadow: 0 4px 14px rgba(91, 155, 213, 0.35);
}

.btn-login:active {
  transform: scale(0.97);
}

.btn-login:disabled {
  background: #a0c4e6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 登录按钮加载状态 */
.btn-login .btn-content { display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-login:disabled .btn-text { opacity: 0.7; }
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loginSpin 0.6s linear infinite;
}

.login-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 12px;
  color: #b0b7c3;
  line-height: 1.8;
  animation: loginFadeIn 0.6s ease 0.6s both;
}

.login-help {
  color: #c0c7cf;
  font-size: 12px;
}

/* 响应式 */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* 修改密码弹窗 */
#changePwdModal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: #fff; border-radius: 16px; padding: 32px;
  width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-box .form-group { margin-bottom: 16px; }
.modal-box .form-label { display: block; font-size: 14px; color: #374151; margin-bottom: 6px; font-weight: 500; }
.modal-box .form-input {
  width: 100%; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 14px; outline: none; transition: border-color 0.2s;
}
.modal-box .form-input:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,0.1); }
