/* ============================================================
   FormatLab - 认证页样式（登录/注册）
   简洁、统一、友好
   ============================================================ */

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 24px;
}

.auth-container {
  display: flex;
  gap: 48px;
  max-width: 1000px;
  width: 100%;
  align-items: center;
}

/* ---- 动画区域 ---- */
.auth-animation {
  flex: 1;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
  border-radius: 24px;
  padding: 40px;
  box-shadow: inset 0 2px 30px rgba(59, 130, 246, 0.12);
  position: relative;
  overflow: hidden;
}

.auth-animation::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%);
  animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(5%, 5%) rotate(180deg); }
}

.animation-container {
  position: relative;
  width: 100%;
  height: 320px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 20px;
  padding-bottom: 40px;
}

/* 角色基础样式 - 统一朝前 */
.character {
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.character:hover {
  transform: translateY(-12px) scale(1.08);
  box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

/* 橙色角色 - 小橙子 */
.orange-character {
  width: 120px;
  height: 120px;
  background: linear-gradient(145deg, #fb923c 0%, #f97316 50%, #ea580c 100%);
  border-radius: 50%;
  z-index: 3;
  animation: float-orange 2.5s ease-in-out infinite;
}

@keyframes float-orange {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(-3deg); }
}

.orange-character::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 20px;
  background: #22c55e;
  border-radius: 50% 50% 0 0;
}

/* 紫色角色 - 小葡萄 */
.purple-character {
  width: 110px;
  height: 140px;
  background: linear-gradient(145deg, #a78bfa 0%, #8b5cf6 50%, #7c3aed 100%);
  z-index: 2;
  border-radius: 55px 55px 35px 35px;
  animation: float-purple 3s ease-in-out infinite;
  animation-delay: 0.3s;
}

@keyframes float-purple {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-25px) rotate(2deg); }
}

.purple-character::before {
  content: '';
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 35px;
  height: 20px;
  background: #10b981;
  border-radius: 50%;
}

/* 黑色角色 - 小黑猫 */
.black-character {
  width: 100px;
  height: 130px;
  background: linear-gradient(145deg, #4b5563 0%, #374151 50%, #1f2937 100%);
  z-index: 3;
  border-radius: 50px 50px 40px 40px;
  animation: float-black 2.8s ease-in-out infinite;
  animation-delay: 0.6s;
}

@keyframes float-black {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(-2deg); }
}

.black-character::before,
.black-character::after {
  content: '';
  position: absolute;
  top: -18px;
  width: 25px;
  height: 30px;
  background: linear-gradient(145deg, #4b5563 0%, #374151 100%);
  border-radius: 50% 50% 0 0;
}

.black-character::before { left: 12px; transform: rotate(-12deg); }
.black-character::after { right: 12px; transform: rotate(12deg); }

/* 黄色角色 - 小柠檬 */
.yellow-character {
  width: 100px;
  height: 110px;
  background: linear-gradient(145deg, #facc15 0%, #eab308 50%, #ca8a04 100%);
  z-index: 2;
  border-radius: 50% 50% 45% 45%;
  animation: float-yellow 2.6s ease-in-out infinite;
  animation-delay: 0.9s;
}

@keyframes float-yellow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-22px) rotate(3deg); }
}

.yellow-character::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 25px;
  background: #22c55e;
  border-radius: 0 0 4px 4px;
}

/* 眼睛样式 - 统一朝前 */
.eye {
  position: absolute;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  top: 35px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  animation: blink 4s infinite;
}

@keyframes blink {
  0%, 45%, 55%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.1); }
}

.eye::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: #1a1a2e;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.orange-character .eye { top: 38px; }
.orange-character .left-eye { left: 22px; }
.orange-character .right-eye { right: 22px; }

.purple-character .eye { top: 45px; }
.purple-character .left-eye { left: 22px; }
.purple-character .right-eye { right: 22px; }

.black-character .eye { top: 42px; }
.black-character .left-eye { left: 18px; }
.black-character .right-eye { right: 18px; }

.yellow-character .eye { top: 35px; }
.yellow-character .left-eye { left: 20px; }
.yellow-character .right-eye { right: 20px; }

/* 嘴巴样式 */
.mouth {
  position: absolute;
  width: 28px;
  height: 14px;
  border-radius: 0 0 14px 14px;
  background: #1a1a2e;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  transition: all 0.3s ease;
}

.orange-character .mouth { top: 72px; }
.purple-character .mouth { top: 78px; }
.black-character .mouth { top: 75px; }
.yellow-character .mouth { top: 65px; }

/* 腮红 */
.character::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 12px;
  background: rgba(255, 100, 100, 0.35);
  border-radius: 50%;
  top: 55px;
}

.orange-character::after {
  left: 15px;
  box-shadow: 72px 0 0 rgba(255, 100, 100, 0.35);
}

.purple-character::after {
  left: 15px;
  box-shadow: 72px 0 0 rgba(255, 100, 100, 0.35);
  top: 60px;
}

.black-character::after {
  left: 12px;
  box-shadow: 68px 0 0 rgba(255, 100, 100, 0.35);
  top: 58px;
}

.yellow-character::after {
  left: 12px;
  box-shadow: 64px 0 0 rgba(255, 100, 100, 0.35);
  top: 50px;
}

/* 输入框聚焦时的角色动画 - 动作幅度更大 */
.username-focus .orange-character {
  transform: translateX(-50px) translateY(-60px) scale(1.25) rotate(-10deg);
}

.username-focus .purple-character {
  transform: translateY(-80px) rotate(-15deg) scale(1.2);
}

.password-focus .black-character {
  transform: translateX(50px) translateY(-30px) rotate(30deg) scale(0.9);
}

.password-focus .black-character .eye {
  height: 3px;
  border-radius: 0;
  animation: none;
}

.password-focus .black-character .eye::after {
  display: none;
}

.password-focus .yellow-character {
  transform: translateX(40px) translateY(-50px) rotate(-25deg) scale(1.15);
}

.password-focus .yellow-character .eye {
  height: 4px;
  border-radius: 0;
  animation: none;
}

.password-focus .yellow-character .eye::after {
  display: none;
}

/* 输入时的开心动画 */
.typing-happy .mouth {
  width: 36px;
  height: 18px;
  border-radius: 0 0 18px 18px;
}

.typing-happy .character {
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-25px); }
}

/* 角色点击效果 */
.character.clicked {
  animation: wiggle 0.6s ease;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg) scale(1.1); }
  25% { transform: rotate(-15deg) scale(1.15); }
  75% { transform: rotate(15deg) scale(1.15); }
}

/* ---- 认证卡片 ---- */
.auth-card {
  flex: 1;
  max-width: 400px;
  background: #fff;
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: bounce-icon 2s ease-in-out infinite;
}

@keyframes bounce-icon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.auth-card h2 {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 10px;
}

.subtitle-text {
  font-size: 15px;
  color: #6b7280;
  margin: 0;
}

/* ---- 表单 ---- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-input {
  padding: 14px 18px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 16px;
  background: #fff;
  color: #1a1a2e;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
  transform: translateY(-2px);
}

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

.password-group { position: relative; }

.password-input { padding-right: 52px; }

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #9ca3af;
  padding: 8px;
  transition: all 0.2s;
  border-radius: 50%;
}

.password-toggle:hover { 
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.input-hint, .input-status {
  font-size: 13px;
  margin: 0;
}

.input-hint { color: #9ca3af; }
.input-status.success { color: #10b981; }
.input-status.error { color: #ef4444; }

/* 密码强度条 */
.password-strength {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.strength-bar {
  flex: 1;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0;
  transition: width 0.3s, background 0.3s;
}

.strength-fill.weak { background: #ef4444; }
.strength-fill.medium { background: #f59e0b; }
.strength-fill.strong { background: #10b981; }

.strength-text {
  font-size: 13px;
  color: #6b7280;
  white-space: nowrap;
}

/* ---- 表单选项 ---- */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-options .checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: #4b5563;
  cursor: pointer;
}

.form-options .checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #3b82f6;
  cursor: pointer;
}

.forgot-link {
  font-size: 15px;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.forgot-link:hover { color: #2563eb; }

/* ---- 分隔线 ---- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
  color: #9ca3af;
  font-size: 14px;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
}

/* ---- 社交登录 ---- */
.social-login { display: flex; gap: 12px; }

.social-btn {
  flex: 1;
  padding: 14px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  color: #4b5563;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 500;
}

.social-btn:hover {
  background: #f9fafb;
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
}

.social-icon { font-size: 20px; font-weight: 700; }

/* 微信登录按钮 */
.wechat-login-area {
  position: relative;
}
.wechat-btn {
  width: 100%;
  border-color: #07c160;
  color: #07c160;
}
.wechat-btn:hover {
  background: #f0faf4;
  border-color: #05a650;
  color: #05a650;
  box-shadow: 0 6px 20px rgba(7, 193, 96, 0.2);
}
.wechat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #07c160;
  color: #fff;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
}

/* 二维码容器 */
.wechat-qrcode-container {
  margin-top: 16px;
  text-align: center;
  position: relative;
  animation: qrcodeIn 0.35s ease;
}
@keyframes qrcodeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.close-qrcode-btn {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border: none;
  background: #e5e7eb;
  color: #6b7280;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}
.close-qrcode-btn:hover {
  background: #ef4444;
  color: #fff;
}
.qrcode-img {
  display: inline-block;
  padding: 12px;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  min-width: 180px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qrcode-image {
  width: 180px;
  height: 180px;
  display: block;
}
.qrcode-loading,
.qrcode-error,
.qrcode-expired {
  color: #999;
  font-size: 14px;
  padding: 40px 20px;
}
.qrcode-error { color: #ef4444; }
.qrcode-expired {
  color: #999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.qrcode-tip {
  font-size: 14px;
  color: #6b7280;
  margin: 12px 0 6px;
}
.qrcode-status {
  font-size: 13px;
  font-weight: 500;
  margin: 4px 0;
  min-height: 20px;
  transition: color 0.3s;
}
.status-pending { color: #f59e0b; }
.status-scanned { color: #3b82f6; }
.status-success { color: #07c160; }
.status-expired { color: #9ca3af; }
.btn-refresh-qrcode {
  margin-top: 8px;
  padding: 8px 20px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-refresh-qrcode:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #eff6ff;
}
.btn-recheck-qrcode {
  margin-top: 8px;
  padding: 10px 20px;
  border: 2px solid #07c160;
  border-radius: 8px;
  background: #f0faf4;
  color: #059669;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  min-height: 44px;
}
.btn-recheck-qrcode:hover {
  background: #07c160;
  color: #fff;
  box-shadow: 0 4px 14px rgba(7, 193, 96, 0.35);
}
.btn-recheck-qrcode:disabled {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

.link {
  color: #3b82f6;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.link:hover { color: #2563eb; }

/* ---- 消息提示 ---- */
.message-box {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 15px;
  margin-top: 18px;
  animation: slideIn 0.3s ease;
}

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

.message-box.success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.message-box.error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.message-box.info {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ---- 按钮 ---- */
.auth-card .btn {
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-card .btn.primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.auth-card .btn.primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.45);
}

.auth-card .btn.primary:active {
  transform: translateY(-1px);
}

.auth-card .full-width { width: 100%; }

/* ---- 隐藏 ---- */
.hidden { display: none !important; }

/* 加载动画 */
.auth-card .loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ---- 邮箱验证码 ---- */
.email-row {
  position: relative;
}

.email-input {
  padding-right: 120px !important;
}

.send-code-btn {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: auto;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  z-index: 2;
}

.send-code-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
}

.send-code-btn:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

.send-code-btn.counting {
  background: #e2e8f0;
  color: #64748b;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .auth-container {
    flex-direction: column;
    gap: 24px;
  }

  .auth-animation {
    min-height: 280px;
    width: 100%;
    order: -1;
    padding: 30px;
  }

  .animation-container { 
    height: 220px; 
    gap: 15px;
  }

  .orange-character { width: 85px; height: 85px; }
  .purple-character { width: 75px; height: 95px; }
  .black-character { width: 70px; height: 90px; }
  .yellow-character { width: 70px; height: 80px; }

  .orange-character .eye,
  .purple-character .eye,
  .black-character .eye,
  .yellow-character .eye {
    width: 16px;
    height: 16px;
  }

  .orange-character .eye::after,
  .purple-character .eye::after,
  .black-character .eye::after,
  .yellow-character .eye::after {
    width: 9px;
    height: 9px;
  }

  .mouth { width: 20px; height: 10px; }

  .auth-card { padding: 32px 28px; max-width: 100%; }
}

@media (max-width: 480px) {
  .auth-main { padding: 16px; }
  .auth-card { padding: 28px 24px; }
  .auth-card h2 { font-size: 22px; }
}
