/**
 * 登录页面样式
 */

/* 登录界面容器 */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 10000;
  padding: 20px;
}

/* 登录卡片 */
.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  animation: loginSlideUp 0.5s ease-out;
}

@keyframes loginSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 登录头部 */
.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  width: 100px;
  height: 100px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 4px 0;
  letter-spacing: 2px;
}

.login-subtitle {
  font-size: 16px;
  color: #666;
  margin: 0;
}

/* 登录表单 */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group-login {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group-login label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.form-group-login input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  outline: none;
  transition: all 0.3s ease;
  background: #f8f9fa;
  box-sizing: border-box;
}

.form-group-login input:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group-login input::placeholder {
  color: #999;
}

/* 错误消息 */
.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fee2e2;
  border-radius: 8px;
  color: #dc2626;
  font-size: 14px;
  animation: loginShake 0.5s ease-in-out;
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* 登录按钮 */
.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 8px;
}

.login-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.login-btn:active:not(:disabled) {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* 登录加载动画 */
.login-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: loginSpin 0.8s linear infinite;
}

@keyframes loginSpin {
  to {
    transform: rotate(360deg);
  }
}

/* 密码输入框容器 */
.password-input-wrapper {
  position: relative;
  width: 100%;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 48px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.toggle-password:hover {
  color: #667eea;
}

.toggle-password svg {
  width: 20px;
  height: 20px;
}

/* ========== 工具栏用户信息 ========== */
.current-user-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 隐藏邮箱，只显示角色 */
.current-user-info .user-email {
  display: none;
}

.current-user-info .user-role {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.current-user-info .user-role.admin {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.current-user-info .user-role.user {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #4f46e5;
}

/* ========== 响应式设计 ========== */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
  }
  
  .login-title {
    font-size: 24px;
  }
  
  .login-logo {
    width: 56px;
    height: 56px;
  }
}

/* 工具栏响应式 */
@media (max-width: 900px) {
  .user-status-wrap {
    padding: 4px 8px;
  }
  
  .current-user-info .user-role {
    font-size: 10px;
    padding: 2px 8px;
  }
  
  .btn-mode span {
    display: none;
  }
  
  .btn-mode {
    padding: 8px 12px;
  }
  
  .btn-action span {
    display: none;
  }
  
  .btn-action {
    padding: 8px 10px;
  }
  
  .mode-switcher {
    gap: 4px;
  }
}

