/**
 * 登录注册页面样式
 * 包含：登录弹窗、表单、协议等所有样式
 */

/* ========== 遮罩层 ========== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.login-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ========== 弹窗容器 ========== */
.login-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 800px;
  max-width: 90vw;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  overflow: hidden;
}

.login-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* ========== 弹窗内容区 ========== */
.login-modal-content {
  display: flex;
  min-height: 480px;
}

/* ========== 左侧推广区 ========== */
.login-promo {
  width: 340px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.login-promo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.login-promo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 24px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
}

.login-promo-text {
  font-size: 24px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
}

.login-promo-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
}

/* ========== 右侧登录区 ========== */
.login-form-container {
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
}

/* ========== 关闭按钮 ========== */
.login-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}

.login-close-btn:hover {
  background: #e5e7eb;
}

.login-close-btn svg {
  width: 16px;
  height: 16px;
  color: #6b7280;
}

/* ========== 登录方式切换 ========== */
.login-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 24px;
}

.login-tab-item {
  padding: 12px 0;
  font-size: 14px;
  color: #6b7280;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.login-tab-item:hover {
  color: #409eff;
}

.login-tab-item.active {
  color: #409eff;
  font-weight: 500;
}

.login-tab-item.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #409eff;
}

/* ========== 登录表单 ========== */
.login-form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.login-input-group {
  margin-bottom: 16px;
}

.login-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  color: #1f2937;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.login-input:focus {
  outline: none;
  border-color: #409eff;
  box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.1);
}

.login-input::placeholder {
  color: #9ca3af;
}

.login-password-wrapper {
  position: relative;
}

.login-password-wrapper .login-input {
  padding-right: 80px;
}

.forgot-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #409eff;
  text-decoration: none;
  cursor: pointer;
}

.forgot-password:hover {
  text-decoration: underline;
}

/* ========== 登录按钮 ========== */
.login-submit-btn {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  margin-top: 8px;
}

.login-submit-btn:hover {
  opacity: 0.9;
}

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

/* ========== 协议区域 ========== */
.login-agreement {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: #6b7280;
}

.login-agreement input[type="checkbox"] {
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.login-agreement label {
  line-height: 1.5;
}

.login-agreement a {
  color: #409eff;
  text-decoration: none;
  white-space: nowrap;
}

.login-agreement a:hover {
  text-decoration: underline;
}

/* 扫码登录协议样式 */
.login-agreement-qrcode {
  margin-top: 20px;
  justify-content: center;
}

/* ========== 底部区域 ========== */
.login-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 20px;
}

/* 第三方登录 */
.third-party-login {
  display: flex;
  gap: 12px;
}

.third-party-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}

.third-party-btn:hover {
  opacity: 0.8;
}

.third-party-btn svg {
  width: 28px;
  height: 28px;
}

/* 注册入口 */
.register-link {
  font-size: 14px;
  color: #409eff;
  text-decoration: none;
}

.register-link:hover {
  text-decoration: underline;
}

/* ========== 扫码登录区域 ========== */
.login-qrcode-content {
  flex: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.login-qrcode-content.active {
  display: flex;
}

.login-qrcode-img {
  width: 290px;
  height: 290px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.login-qrcode-tip {
  font-size: 13px;
  color: #6b7280;
  text-align: center;
}

/* ========== 短信登录区域 ========== */
.login-sms-content {
  flex: 1;
  display: none;
  flex-direction: column;
}

.login-sms-content.active {
  display: flex;
}

.sms-code-wrapper {
  display: flex;
  gap: 12px;
}

.sms-code-wrapper .login-input {
  flex: 1;
}

.send-sms-btn {
  height: 44px;
  padding: 0 16px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  color: #409eff;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.send-sms-btn:hover {
  background: #e5e7eb;
}

.send-sms-btn:disabled {
  color: #9ca3af;
  cursor: not-allowed;
}

/* ========== 注册区域 ========== */
.login-register-content {
  flex: 1;
  display: none;
  flex-direction: column;
}

.login-register-content.active {
  display: flex;
}

.login-register-content .login-input-group {
  margin-bottom: 12px;
}

.login-register-content .login-input {
  height: 40px;
}

.login-register-content .login-submit-btn {
  margin-top: 4px;
}

.login-register-content .login-submit-btn:disabled {
  background: linear-gradient(135deg, #9ca3af 0%, #9ca3af 100%);
}

/* ========== 响应式适配 ========== */
@media (max-width: 768px) {
  .login-modal {
    width: 95vw;
    max-height: 90vh;
  }

  .login-modal-content {
    flex-direction: column;
    min-height: auto;
  }

  .login-promo {
    display: none;
  }

  .login-form-container {
    padding: 24px;
  }

  .login-tabs {
    gap: 16px;
  }
}

/* ========== 基础样式 ========== */
