/* LLN系统 - 企业商务正式样式 */

/* 全局样式 */
:root {
  --primary-color: #1a3a52;     /* 深蓝色背景 */
  --secondary-color: #2c5f8d;   /* 企业蓝 */
  --text-dark: #333333;         /* 深灰文字 */
  --text-light: #666666;        /* 浅灰文字 */
  --text-muted: #999999;        /* 静音灰 */
  --border-color: #d9d9d9;      /* 边框灰 */
  --border-light: #f0f0f0;      /* 浅边框 */
  --white: #ffffff;             /* 白色 */
  --error-color: #d32f2f;       /* 错误红 */
  --success-color: #388e3c;     /* 成功绿 */
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
  --border-radius: 8px;
}

/* =================================
   基础样式和重置
================================= */

/* 全局基础样式 */
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  line-height: 1.5;
  color: var(--text-dark);
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* 登录页面专用样式 */
body.login-body {
  background: var(--primary-color);
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
}

/* 登录卡片容器 */
.login-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 40px 30px;
  transition: all 0.3s ease;
  position: relative;
}

/* Logo区域 */
.logo-section {
  text-align: center;
  margin-bottom: 30px;
}

.logo-icon {
  width: 80px;
  height: 80px;
  background: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  font-size: 36px;
  color: var(--secondary-color);
  font-weight: bold;
  box-shadow: var(--shadow);
  position: relative;
}

.logo-title {
  color: var(--text-dark);
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0;
}

.logo-subtitle {
  color: var(--text-light);
  font-size: 14px;
  margin: 5px 0 0 0;
  font-weight: 300;
  letter-spacing: 0;
}

/* 表单样式 - 自定义输入框 */
.input-group-custom {
  position: relative;
  margin-bottom: 20px;
}

.input-custom {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-dark);
  padding: 12px 40px 12px 16px;
  font-size: 14px;
  transition: all 0.3s ease;
  height: 44px;
  line-height: 1.5;
  box-sizing: border-box;
  outline: none;
}

.input-custom:focus {
  background: var(--white);
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(44, 95, 141, 0.1);
  color: var(--text-dark);
}

.input-custom::placeholder {
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.input-custom:focus::placeholder {
  color: var(--text-muted);
}

.label-custom {
  position: absolute;
  top: -8px;
  left: 15px;
  background: var(--white);
  color: rgba(51, 51, 51, 0.8);
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  z-index: 3;
}

.label-custom svg {
  margin-right: 5px;
  width: 14px;
  height: 14px;
}

.input-custom:focus + .label-custom {
  color: var(--secondary-color);
}

/* 按钮样式 */
.btn-login {
  background: var(--secondary-color);
  border: 1px solid var(--secondary-color);
  border-radius: 6px;
  color: var(--white);
  font-weight: 600;
  font-size: 16px;
  padding: 12px 20px;
  width: 100%;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  margin: 10px 0;
  text-transform: none;
  letter-spacing: 0;
  position: relative;
  overflow: hidden;
  text-shadow: none;
  cursor: pointer;
  height: 44px;
  line-height: 20px;
}

.btn-login:hover {
  background: #1e4620;
  box-shadow: var(--shadow-lg);
  transform: none;
  border-color: #1e4620;
}

.btn-login:active {
  transform: none;
}

/* 记住我和忘记密码 */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  color: var(--text-light);
  font-size: 14px;
}

.form-check {
  display: flex;
  align-items: center;
}

.form-check-input {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  margin-right: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-check-input:checked {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
}

.form-check-label {
  color: var(--text-light);
  cursor: pointer;
  user-select: none;
}

.forgot-password {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.forgot-password:hover {
  color: #1e4620;
  text-decoration: underline;
}

/* 错误提示样式 */
.alert-custom {
  background: #fee;
  border: 1px solid #f5a9a9;
  border-radius: 6px;
  color: var(--error-color);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-custom:empty {
  display: none;
}

/* 隐藏空的告警容器 */
#alertContainer:empty {
  display: none;
}

/* 成功提示样式 */
.alert-success-custom {
  background: #f0f5f0;
  border: 1px solid #c3e6cb;
  border-radius: 6px;
  color: var(--success-color);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
}

/* 后台错误信息美化样式 */
.error-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.btn-close-custom {
  background: none;
  border: none;
  color: rgba(211, 47, 47, 0.8);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
}

.btn-close-custom:hover {
  color: var(--error-color);
  background: rgba(211, 47, 47, 0.1);
  transform: scale(1.1);
}

.btn-close-custom:active {
  transform: scale(0.95);
}

/* 淡入动画 */
.fade-in {
  animation: fadeInAlert 0.3s ease-out;
}

@keyframes fadeInAlert {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 注册链接 */
.register-section {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.register-text {
  color: var(--text-light);
  font-size: 14px;
  margin: 0;
}

.register-link {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-left: 5px;
}

.register-link:hover {
  color: #1e4620;
  text-decoration: underline;
}

/* 输入框图标 */
.input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  z-index: 10;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 4px;
  border-radius: 4px;
}

.input-icon:hover {
  color: var(--secondary-color);
  background: rgba(44, 95, 141, 0.05);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .login-card {
    padding: 30px 20px;
    margin: 10px;
  }

  .logo-icon {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }

  .logo-title {
    font-size: 24px;
  }

  .form-options {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .login-card {
    padding: 25px 15px;
  }

  .input-custom {
    padding: 10px 36px 10px 12px;
    font-size: 16px;
  }
}

@media (max-width: 360px) {
  body {
    padding: 10px;
  }

  .login-card {
    padding: 25px 15px;
  }
}
