/* ========== 登录页样式 ========== */

/* 重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: url('/templates/pc/images/login-bg.png') no-repeat center center fixed;
  background-size: cover;
}

input, button {
  font-family: inherit;
  outline: none;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

/* 登录页容器 */
.login-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 背景渐变 */
.login-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #7cb8f0 0%, #5ba3e8 25%, #4a94e0 50%, #3a7bd5 75%, #2c6bc9 100%);
  z-index: -2;
}

/* 背景装饰层 */
.login-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* 装饰圆圈 */
.bg-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.circle-1 {
  width: 280px;
  height: 280px;
  top: -60px;
  left: -40px;
}

.circle-2 {
  width: 180px;
  height: 180px;
  top: 15%;
  left: 8%;
  background: rgba(255, 255, 255, 0.05);
}

.circle-3 {
  width: 120px;
  height: 120px;
  bottom: 20%;
  left: 12%;
  background: rgba(255, 255, 255, 0.06);
}

.circle-4 {
  width: 220px;
  height: 220px;
  bottom: -50px;
  left: 3%;
  background: rgba(255, 255, 255, 0.04);
}

/* 盾牌装饰 */
.bg-shield {
  position: absolute;
  top: 50%;
  left: 18%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 240px;
  opacity: 0.6;
}

.bg-shield svg {
  width: 100%;
  height: 100%;
}

/* 主体容器 */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 960px;
  padding: 20px;
  gap: 0;
}

/* 左侧欢迎区 */
.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background: linear-gradient(to bottom right, rgba(255,255,255,0.3), rgba(0,102,255,0.3));
}

.welcome-text {
  text-align: center;
  color: #fff;
}

.welcome-en {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 2px;
  margin-bottom: 12px;
  opacity: 0.95;
}

.brand-name {
  font-size: 42px;
  font-weight: 600;
  letter-spacing: 6px;
  opacity: 0.95;
}

/* 右侧登录卡片 */
.login-right {
  flex: 0 0 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 40px 36px 36px;
}

.login-title {
  font-size: 18px;
  font-weight: 500;
  color: #333;
  margin-bottom: 28px;
  text-align: left;
}

/* 表单 */
.login-form {
  width: 100%;
}

.form-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  margin-bottom: 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

.form-group:hover {
  border-color: #40a9ff;
}

.form-group:focus-within {
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.15);
}

/* 输入框图标 */
.input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 100%;
  flex-shrink: 0;
}

.input-icon svg {
  width: 18px;
  height: 18px;
  color: #bfbfbf;
  transition: color 0.2s;
}

.form-group:focus-within .input-icon svg {
  color: #1890ff;
}

/* 输入框 */
.form-input {
  flex: 1;
  height: 100%;
  padding: 0 12px 0 0;
  font-size: 14px;
  color: #333;
  background: transparent;
}

.form-input::placeholder {
  color: #bfbfbf;
}

/* 验证码组 */
.form-group-captcha {
  padding-right: 0;
}

.captcha-input {
  width: 0;
  flex: 1;
}

.captcha-img {
  width: 100px;
  height: 38px;
  margin: 2px 2px 2px 0;
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
  background: #f5f5f5;
}

/* 记住我 */
.form-remember {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  margin-top: -4px;
}

.remember-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.remember-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.check-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  margin-right: 8px;
  transition: all 0.2s;
  background: #fff;
}

.check-box svg {
  width: 12px;
  height: 12px;
  color: #fff;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s;
}

.remember-label input[type="checkbox"]:checked + .check-box {
  background: #1890ff;
  border-color: #1890ff;
}

.remember-label input[type="checkbox"]:checked + .check-box svg {
  opacity: 1;
  transform: scale(1);
}

.remember-text {
  font-size: 13px;
  color: #666;
}

/* 登录按钮 */
.btn-login {
  width: 100%;
  height: 42px;
  border-radius: 4px;
  background: linear-gradient(135deg, #40a9ff 0%, #1890ff 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 2px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.btn-login:hover {
  background: linear-gradient(135deg, #69c0ff 0%, #40a9ff 100%);
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.35);
  transform: translateY(-1px);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(24, 144, 255, 0.25);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

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

/* 消息提示 */
.toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #fff;
  border-radius: 4px;
  padding: 10px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  border-left: 4px solid #1890ff;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast.success {
  border-left-color: #52c41a;
}

.toast.error {
  border-left-color: #f5222d;
}

.toast.warning {
  border-left-color: #faad14;
}

.toast-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 响应式 */
@media (max-width: 768px) {
  .login-container {
    flex-direction: column;
    padding: 16px;
  }

  .login-left {
    min-height: auto;
    margin-bottom: 24px;
  }

  .welcome-en {
    font-size: 24px;
  }

  .brand-name {
    font-size: 32px;
  }

  .login-right {
    flex: 0 0 auto;
    width: 100%;
    max-width: 400px;
  }

  .login-card {
    padding: 28px 24px;
  }

  .bg-shield {
    display: none;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 24px 20px;
  }

  .login-title {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .form-group {
    height: 42px;
    margin-bottom: 14px;
  }
}

/* IE兼容 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  .login-page::before {
    background: #3a7bd5;
  }
}
