/* ============================================
   Login Page — Premium UI v2
   AI 大模型学习之路
   ============================================ */

.login-page {
  display: flex;
  min-height: 100vh;
  background: var(--gray-50);
  overflow: hidden;
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
}

/* ===== 动态背景粒子 ===== */
.particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.3);
  animation: floatUp 15s linear infinite;
}

.particle:nth-child(1)  { left: 5%;  animation-delay: 0s;    animation-duration: 12s; }
.particle:nth-child(2)  { left: 15%; animation-delay: 2s;    animation-duration: 18s; }
.particle:nth-child(3)  { left: 25%; animation-delay: 4s;    animation-duration: 14s; }
.particle:nth-child(4)  { left: 35%; animation-delay: 1s;    animation-duration: 20s; }
.particle:nth-child(5)  { left: 45%; animation-delay: 3s;    animation-duration: 16s; }
.particle:nth-child(6)  { left: 55%; animation-delay: 5s;    animation-duration: 13s; }
.particle:nth-child(7)  { left: 65%; animation-delay: 0.5s;  animation-duration: 17s; }
.particle:nth-child(8)  { left: 75%; animation-delay: 2.5s;  animation-duration: 15s; }
.particle:nth-child(9)  { left: 85%; animation-delay: 4.5s;  animation-duration: 19s; }
.particle:nth-child(10) { left: 92%; animation-delay: 6s;    animation-duration: 14s; }
.particle:nth-child(11) { left: 10%; animation-delay: 7s;    animation-duration: 22s; width: 3px; height: 3px; }
.particle:nth-child(12) { left: 30%; animation-delay: 8s;    animation-duration: 16s; width: 6px; height: 6px; }
.particle:nth-child(13) { left: 50%; animation-delay: 9s;    animation-duration: 18s; width: 3px; height: 3px; }
.particle:nth-child(14) { left: 70%; animation-delay: 10s;   animation-duration: 20s; width: 5px; height: 5px; }
.particle:nth-child(15) { left: 88%; animation-delay: 11s;   animation-duration: 15s; width: 3px; height: 3px; }

@keyframes floatUp {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ===== 网格背景 ===== */
.grid-bg {
  position: fixed;
  top: 0; left: 0;
  width: 50%;
  height: 100%;
  background-image:
    linear-gradient(rgba(124, 58, 237, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(to right, black 60%, transparent);
  -webkit-mask-image: linear-gradient(to right, black 60%, transparent);
}

/* ===== 左侧品牌区 ===== */
.login-left {
  flex: 1;
  background: linear-gradient(135deg, #0A0E27 0%, #1A0B3E 40%, #1E1065 70%, #0F0530 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 48px;
}

/* 装饰性光晕 */
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: pulse 6s ease-in-out infinite;
}

.glow-1 {
  top: -10%; right: -5%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.4) 0%, transparent 70%);
}

.glow-2 {
  bottom: -15%; left: -8%;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
  animation-delay: 2s;
}

.glow-3 {
  top: 40%; left: 30%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, transparent 70%);
  animation-delay: 4s;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50%      { transform: scale(1.15); opacity: 0.6; }
}

.login-left-content {
  position: relative;
  z-index: 2;
  max-width: 480px;
}

/* 品牌标识 */
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-brand .cloud-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 8px rgba(124, 58, 237, 0.6));
  animation: float 3s ease-in-out infinite;
}

.login-brand span:last-child {
  font-size: 17px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.3px;
  font-family: 'Space Grotesk', sans-serif;
}

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

/* 徽章 */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #A78BFA;
  margin-bottom: 28px;
  backdrop-filter: blur(10px);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #A78BFA;
  box-shadow: 0 0 8px #A78BFA;
  animation: dotBlink 1.5s ease-in-out infinite;
}

@keyframes dotBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.8); }
}

/* ===== 主标题 — 酷炫字体设计 ===== */
.login-hero-title {
  font-size: 52px;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1.5px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

/* 渐变文字 */
.gradient-text {
  background: linear-gradient(135deg, #A78BFA 0%, #818CF8 30%, #6EE7B7 60%, #A78BFA 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 5s ease-in-out infinite;
  font-weight: 700;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* 描边文字 */
.title-outline {
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.5);
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  letter-spacing: -1px;
  transition: all 0.4s ease;
}

.title-outline:hover {
  -webkit-text-stroke: 2px rgba(167, 139, 250, 0.8);
  -webkit-text-fill-color: rgba(167, 139, 250, 0.1);
}

/* ===== 描述文字 ===== */
.login-hero-desc {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.9;
  margin-bottom: 36px;
  font-weight: 400;
}

.desc-highlight {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.3px;
}

/* ===== 统计 ===== */
.login-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.login-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.login-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.login-stat:hover {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.3);
  transform: translateY(-3px);
}

.login-stat:hover::before {
  opacity: 1;
}

.login-stat .stat-num {
  font-size: 30px;
  font-weight: 700;
  background: linear-gradient(135deg, #A78BFA, #818CF8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1;
}

.login-stat .stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ===== 技术标签 ===== */
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  transition: all 0.3s ease;
  cursor: default;
}

.tech-tag:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.4);
  color: #C4B5FD;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

/* ===== 右侧登录表单 ===== */
.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 420px;
  position: relative;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  padding: 40px;
  box-shadow:
    0 4px 24px rgba(124, 58, 237, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: cardEnter 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card:hover {
  box-shadow:
    0 12px 48px rgba(124, 58, 237, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.06);
  transform: translateY(-3px);
}

/* 卡片顶部渐变光带 */
.login-card-glow {
  position: absolute;
  top: -1px; left: 15%; right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #7C3AED, #818CF8, #6EE7B7, #7C3AED, transparent);
  border-radius: 2px;
  opacity: 0.7;
  animation: glowShift 4s ease-in-out infinite;
}

@keyframes glowShift {
  0%, 100% { opacity: 0.5; left: 20%; right: 20%; }
  50%      { opacity: 0.9; left: 10%; right: 10%; }
}

/* 标题 */
.login-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  font-family: 'Space Grotesk', sans-serif;
}

.login-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 32px;
  font-weight: 400;
}

/* ===== 表单 ===== */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  letter-spacing: 0.2px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.input-wrap:focus-within .input-icon {
  opacity: 1;
  transform: scale(1.1);
}

.input-wrap input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  border: 2px solid var(--gray-200);
  border-radius: 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--gray-900);
  background: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  outline: none;
}

.input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
  background: #fff;
}

.input-wrap input::placeholder {
  color: var(--gray-300);
}

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  z-index: 1;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.toggle-password:hover {
  opacity: 1;
}

/* ===== 登录按钮 ===== */
.btn-login {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 2px;
  margin-top: 4px;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.45);
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

/* 按钮光扫效果 */
.btn-shine {
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transition: left 0.6s ease;
}

.btn-login:hover .btn-shine {
  left: 150%;
}

.btn-login.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-login.loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

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

/* ===== 错误提示 ===== */
.login-error {
  display: none;
  padding: 10px 14px;
  background: var(--red-light);
  border: 1px solid var(--red);
  border-radius: 10px;
  font-size: 13px;
  color: #991B1B;
  animation: shake 0.4s ease;
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-8px); }
  75%      { transform: translateX(8px); }
}

/* ===== 分割线 ===== */
.login-divider {
  text-align: center;
  margin: 28px 0 14px;
  position: relative;
  font-size: 12px;
  color: var(--gray-500);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
}

.login-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gray-200), transparent);
}

.login-divider span {
  position: relative;
  background: rgba(255, 255, 255, 0.9);
  padding: 0 16px;
}

/* ===== 页脚 ===== */
.login-footer {
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 8px;
}

/* ===== 成功状态 ===== */
.login-card > .login-success {
  display: block;
  text-align: center;
  padding: 40px 0;
}

.login-success .success-icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.login-success h3 {
  font-size: 22px;
  color: var(--gray-900);
  margin-bottom: 8px;
  font-family: 'Space Grotesk', sans-serif;
}

.login-success p {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 24px;
}

.login-success .user-badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--green-light);
  color: var(--green);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}

.btn-go-learn {
  display: inline-block;
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.btn-go-learn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.4);
  color: #fff;
}

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

  .login-left {
    padding: 28px 20px;
    min-height: auto;
  }

  .login-hero-title {
    font-size: 34px;
  }

  .login-hero-desc {
    font-size: 13px;
    margin-bottom: 24px;
  }

  .desc-highlight {
    font-size: 12px;
  }

  .login-stats {
    gap: 10px;
  }

  .login-stat {
    padding: 12px 8px;
  }

  .login-stat .stat-num {
    font-size: 22px;
  }

  .tech-tags {
    margin-bottom: 8px;
  }

  .login-right {
    padding: 32px 20px;
  }

  .grid-bg {
    width: 100%;
    height: 40%;
    top: 0;
  }
}
