/* ==================== CSS 变量定义 ==================== */
:root {
  /* 颜色系统 */
  --color-bg-primary: #0f172a;
  --color-bg-secondary: #1e293b;
  --color-bg-card: rgba(30, 41, 59, 0.6);
  --color-text-primary: #f1f5f9;
  --color-text-secondary: #cbd5e1;
  --color-text-muted: #94a3b8;

  /* 渐变色 */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-secondary: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
  --gradient-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);

  /* 间距 */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* 圆角 */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-full: 9999px;

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);

  /* 动画 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ==================== 全局样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
  background: var(--gradient-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==================== 容器布局 ==================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-lg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* 背景装饰 */
.container::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  33% {
    transform: translate(30px, -30px) rotate(120deg);
  }

  66% {
    transform: translate(-20px, 20px) rotate(240deg);
  }
}

/* ==================== 头部 ==================== */
.header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  animation: fadeInDown 0.8s ease;
}

.logo {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--spacing-md);
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  animation: pulse 2s ease-in-out infinite;
}

.logo-icon {
  font-size: 2.5rem;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: var(--shadow-glow);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.5);
  }
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-sm);
}

.subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  font-weight: 400;
}

/* ==================== 卡片组件 ==================== */
.card {
  background: var(--color-bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 450px;
  animation: fadeInUp 0.8s ease;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* ==================== 按钮组件 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-google {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-google:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.4);
}

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

.btn-github {
  background: linear-gradient(135deg, #24292e 0%, #1a1e22 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-github:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(36, 41, 46, 0.4);
}

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

.btn-email {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-email:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(5, 150, 105, 0.4);
}

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

.btn-text {
  background: transparent;
  color: var(--color-text-secondary);
  border: none;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
}

.btn-text:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
  font-size: 1.25rem;
}

/* ==================== 表单样式 ==================== */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.75rem;
}

.form-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.form-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), 0 4px 12px rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

/* 输入框图标 */
.form-group::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  opacity: 0.6;
  transition: opacity var(--transition-normal);
  pointer-events: none;
  margin-top: 0.875rem;
}

.form-group:has(#email-input)::before {
  content: '📧';
}

.form-group:has(#password-input)::before {
  content: '🔒';
}

.form-group:has(.form-input:focus)::before {
  opacity: 1;
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.button-group .btn {
  flex: 1;
}

/* ==================== 用户信息展示 ==================== */
.user-profile {
  text-align: center;
}

.avatar-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto var(--spacing-lg);
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid transparent;
  background: var(--gradient-primary);
  padding: 4px;
  animation: avatarGlow 3s ease-in-out infinite;
}

@keyframes avatarGlow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
  }

  50% {
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.6);
  }
}

.user-name {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
  color: var(--color-text-primary);
}

.user-email {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-lg);
}

.user-info-grid {
  display: grid;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  text-align: left;
}

.info-item {
  background: rgba(255, 255, 255, 0.05);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal);
}

.info-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateX(5px);
}

.info-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-size: 1rem;
  color: var(--color-text-primary);
  font-weight: 500;
  word-break: break-all;
}

/* ==================== 隐藏/显示状态 ==================== */
.hidden {
  display: none !important;
}

/* ==================== 加载动画 ==================== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

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

/* ==================== 动画关键帧 ==================== */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .container {
    padding: var(--spacing-md);
  }

  .title {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .card {
    padding: var(--spacing-lg);
  }

  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
  }

  .avatar-container {
    width: 100px;
    height: 100px;
  }

  .user-name {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .logo {
    width: 60px;
    height: 60px;
  }

  .logo-icon {
    font-size: 2rem;
  }

  .title {
    font-size: 1.75rem;
  }

  .card {
    padding: var(--spacing-md);
  }
}

/* ==================== 辅助功能 ==================== */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 焦点样式 */
*:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}