/* ==========================================================
   登录页样式
   背景：聊天截图（完整显示，不裁剪）
   ========================================================== */

.login-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fafafa url("../assets/chat_bg.png") no-repeat center / contain fixed;
}

/* ---- 登录卡舞台 ---- */

.login-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px 64px;
  min-height: calc(100vh - 80px);
}

.login-card {
  width: min(340px, 88%);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(21, 107, 188, 0.16);
  padding: 34px 30px 28px;
  text-align: center;
  animation: cardIn 0.5s ease;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.login-card.shake {
  animation: cardShake 0.45s ease;
}

@keyframes cardShake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* 头像框：圆角方形 */
.card-avatar {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 20px;
  border-radius: 30px;
  border: 4px solid #ffffff;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

/* ---- 输入框 ---- */

.login-card .field {
  margin-bottom: 14px;
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #dfe6ee;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.9);
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.login-card input::placeholder {
  color: #a9b4c2;
}

.login-card input:focus {
  border-color: var(--must-blue);
  box-shadow: 0 0 0 3px rgba(21, 107, 188, 0.12);
}

/* ---- 错误提示与按钮 ---- */

.login-error {
  min-height: 20px;
  margin: 2px 0 8px;
  font-size: 13px;
  color: #d64550;
}

.login-submit {
  display: inline-block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #1f7ad2, var(--must-blue));
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 6px;
  text-indent: 6px;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: filter 0.2s ease, transform 0.15s ease;
}

.login-submit:hover {
  filter: brightness(1.07);
}

.login-submit:active {
  transform: scale(0.97);
}

.login-submit:disabled {
  cursor: default;
  filter: none;
}

/* ---- 已登录状态 ---- */

.already-card .already-title {
  font-size: 20px;
  font-weight: 700;
  color: #222222;
  margin-bottom: 6px;
}

.already-card .already-sub {
  font-size: 14px;
  color: #8a94a6;
  margin-bottom: 22px;
}

.already-card .already-enter {
  letter-spacing: 2px;
  text-indent: 2px;
}

.logout-btn {
  display: inline-block;
  margin-top: 14px;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: #a9b4c2;
  text-decoration: underline;
  cursor: pointer;
}

.logout-btn:hover {
  color: #d64550;
}

/* ---- 登录成功：欢迎语 ---- */

.success-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  text-align: center;
}

.success-card .card-avatar {
  animation: successIn 0.7s ease 0.05s both;
}

.success-text {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 4px;
  text-indent: 4px;
  color: var(--ink);
  animation: successIn 0.7s ease;
}

@keyframes successIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- 小屏适配 ---- */

@media (max-width: 860px) {
  .login-body {
    background-position: center 30%;
  }

  .login-card {
    padding: 26px 22px 24px;
  }

  .card-avatar {
    width: 80px;
    height: 80px;
  }
}
