/* ========== 登录页整体布局 ========== */

.login-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 40%, #fff 100%);
}

.login-body .site-header {
  background: rgba(255, 255, 255, 0.72);
}

.login-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 60px) 20px;
}

/* ========== 卡片容器 ========== */

.login-card {
  width: min(420px, 100%);
  padding: clamp(28px, 5vw, 44px) clamp(24px, 5vw, 40px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 8px 40px rgba(23, 32, 51, 0.08);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  margin-bottom: 16px;
  border-radius: 10px;
}

.login-header h2 {
  margin-bottom: 4px;
  font-size: 24px;
}

.login-desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ========== Tab 切换 ========== */

.tab-bar {
  display: flex;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wash);
  overflow: hidden;
}

.tab {
  flex: 1;
  padding: 12px 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  color: #fff;
  background: var(--blue);
}

/* ========== 表单 ========== */

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input::placeholder {
  color: #c0c6d0;
}

.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.12);
}

.field input.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(223, 63, 70, 0.1);
}

.field input.success {
  border-color: var(--green);
}

.field-hint {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.field-hint.error {
  color: var(--red);
}

/* ========== 消息区 ========== */

.message {
  min-height: 20px;
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  display: none;
}

.message.show {
  display: block;
}

.message.error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.message.success {
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

/* ========== 提交按钮 ========== */

.submit-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border: none;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s, opacity 0.2s;
}

.submit-btn:hover {
  background: #155ddb;
}

.submit-btn:active {
  background: #1150c7;
}

.submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* 加载旋转 */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ========== 底部提示 ========== */

.login-footer-text {
  margin: 24px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* ========== 响应式 ========== */

@media (max-width: 480px) {
  .login-card {
    border: none;
    box-shadow: none;
    background: transparent;
  }
}