/* =========================================================
   邮箱注册模式 - 登录页样式
   蓝紫渐变风格，与主界面保持一致
   ========================================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f64f59 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* 背景装饰 */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.1) 0%, transparent 50%),
              radial-gradient(circle at 70% 70%, rgba(255,255,255,0.08) 0%, transparent 50%);
  animation: bgMove 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes bgMove {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-2%, -1%) rotate(1deg); }
  66% { transform: translate(1%, 2%) rotate(-1deg); }
}

/* 登录容器 */
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

/* Logo 区域 */
.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.5px;
}

/* 主卡片 */
.login-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25), 0 4px 16px rgba(102,126,234,0.3);
  overflow: hidden;
}

/* 顶部渐变条 */
.login-card::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2, #f64f59);
}

/* Tab 导航 */
.tab-nav {
  display: flex;
  border-bottom: 1px solid #f0eef8;
  padding: 0 20px;
}

.tab-btn {
  flex: 1;
  padding: 16px 8px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn:hover { color: #667eea; }
.tab-btn.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.tab-btn .tab-icon {
  font-size: 18px;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Noto Sans SC", sans-serif;
  margin-right: 4px;
}

/* Tab 内容 */
.tab-content {
  display: none;
  padding: 24px 28px 28px;
}

.tab-content.active { display: block; }

/* 表单 */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e8e6f5;
  border-radius: 10px;
  font-size: 14px;
  color: #1a1a2e;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  background: #fafbff;
}

.form-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.12);
  background: #fff;
}

.form-input.error { border-color: #e05252; }
.form-input.success { border-color: #11998e; }

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

/* 验证码输入行 */
.code-row {
  display: flex;
  gap: 10px;
}

.code-row .form-input { flex: 1; }

/* 按钮 */
.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  box-shadow: 0 4px 16px rgba(102,126,234,0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(102,126,234,0.45);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #f0eef8;
  color: #667eea;
  font-size: 13px;
  padding: 10px;
}

.btn-secondary:hover { background: #e8e6f5; }

/* 发送验证码按钮 */
.btn-code {
  flex-shrink: 0;
  padding: 12px 14px;
  border: 2px solid #667eea;
  border-radius: 10px;
  background: transparent;
  color: #667eea;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  min-width: 90px;
}

.btn-code:hover:not(:disabled) {
  background: #667eea;
  color: #fff;
}

.btn-code:disabled {
  border-color: #ccc;
  color: #ccc;
  cursor: not-allowed;
}

/* 社交登录区 */
.social-login {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f0eef8;
}

.social-login-label {
  text-align: center;
  font-size: 12px;
  color: #aaa;
  margin-bottom: 16px;
  position: relative;
}

.social-login-label::before,
.social-login-label::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: #e8e6f5;
}

.social-login-label::before { left: 0; }
.social-login-label::after { right: 0; }

.social-btns {
  display: flex;
  gap: 12px;
}

.social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 2px solid #e8e6f5;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
}

.social-btn:hover {
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102,126,234,0.15);
}

.social-btn .icon { font-size: 18px; }
.social-btn.wechat .icon { color: #07c160; }
.social-btn.qq .icon { color: #12b7f5; }

/* 暂未开通状态 */
.social-btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  border-color: #e0e0e0;
  background: #f8f8f8;
  color: #999;
}
.social-btn.disabled:hover {
  border-color: #e0e0e0;
  color: #999;
  transform: none;
  box-shadow: none;
}
.social-btn.disabled .icon {
  filter: grayscale(0.7);
  opacity: 0.6;
}
.social-btn .soon-tag {
  font-size: 10px;
  font-weight: 500;
  color: #999;
  background: #f0f0f0;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

/* 底部链接 */
.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
}

.login-footer a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-weight: 600;
}

.login-footer a:hover { opacity: 0.85; }

/* Toast 提示 */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast {
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  animation: toastIn 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.success { background: rgba(17,153,142,0.92); }
.toast.error { background: rgba(224,82,82,0.92); }
.toast.info { background: rgba(102,126,234,0.92); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 错误提示 */
.field-error {
  font-size: 11px;
  color: #e05252;
  margin-top: 5px;
  display: none;
}

.field-error.show { display: block; }

/* 注册Tab专属 */
.reg-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.reg-type-tab {
  flex: 1;
  padding: 10px;
  border: 2px solid #e8e6f5;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.reg-type-tab.active {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

/* QR 弹窗 */
.qr-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.qr-modal.show { display: flex; }

.qr-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.qr-box h3 {
  font-size: 16px;
  color: #1a1a2e;
  margin-bottom: 6px;
}

.qr-box p {
  font-size: 12px;
  color: #888;
  margin-bottom: 20px;
}

.qr-placeholder {
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
  background: #f5f5f5;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed #ddd;
}

.qr-placeholder .icon-big { font-size: 48px; }
.qr-placeholder .icon-text { font-size: 12px; color: #aaa; }

.qr-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e8e6f5;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.qr-box .btn-close {
  background: #f0eef8;
  color: #667eea;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
}

/* 绑定提示卡片 */
.bind-tip {
  background: #fafbff;
  border: 1px solid #e0e8f8;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
  font-size: 12px;
  color: #667eea;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.bind-tip .icon { font-size: 16px; flex-shrink: 0; }

/* 响应式 */
@media (max-width: 480px) {
  body { padding: 12px; align-items: flex-start; padding-top: 40px; }
  .login-card { border-radius: 16px; }
  .tab-content { padding: 20px 18px 24px; }
  .login-header { margin-bottom: 20px; }
  .login-logo { font-size: 24px; }
}
