/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 科技深色系配色 */
  --bg-primary: #060a12;
  --bg-secondary: #0d1421;
  --bg-card: rgba(13, 20, 33, 0.85);
  --bg-input: rgba(20, 30, 48, 0.6);
  --bg-glass: rgba(255, 255, 255, 0.03);
  
  --text-primary: #ffffff;
  --text-secondary: #a8b2c1;
  --text-muted: #5a6677;
  
  /* 渐变色系 */
  --accent-cyan: #00d4ff;
  --accent-green: #00ff88;
  --accent-purple: #7c3aed;
  --accent-pink: #f472b6;
  
  /* 渐变定义 */
  --gradient-main: linear-gradient(135deg, #00d4ff 0%, #00ff88 50%, #7c3aed 100%);
  --gradient-text: linear-gradient(135deg, #00d4ff 0%, #00ff88 100%);
  --gradient-glow: linear-gradient(135deg, rgba(0,212,255,0.3) 0%, rgba(0,255,136,0.3) 100%);
  
  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(0, 212, 255, 0.4);
  
  --glow-cyan: 0 0 30px rgba(0, 212, 255, 0.4);
  --glow-green: 0 0 20px rgba(0, 255, 136, 0.3);
  --glow-purple: 0 0 40px rgba(124, 58, 237, 0.5);
  
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  height: 100%;
  width: 100%;
}

body {
  min-height: 100%;
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* 背景粒子画布 */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* 渐变遮罩 */
.gradient-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse 60% 40% at 15% 50%, rgba(0, 212, 255, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 30%, rgba(0, 255, 136, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 40% 50% at 70% 70%, rgba(124, 58, 237, 0.1) 0%, transparent 50%);
  z-index: 1;
  pointer-events: none;
}

/* 主容器 */
#app {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
}

.main-container {
  display: flex;
  width: 100%;
  max-width: 1150px;
  height: 90%;
  max-height: 680px;
  gap: var(--spacing-2xl);
  align-items: center;
}

/* ==================== 左侧区域 ==================== */
.left-section {
  flex: 1.3;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  padding-left: var(--spacing-md);
}

/* Logo区域 */
.brand-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.logo-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-name {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 移除不再需要的样式 */
.logo-container, .logo-glow, .logo-ring {
  display: none;
}

/* Hero内容 */
.hero-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 6px 14px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--accent-cyan);
  width: fit-content;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-cyan);
  border-radius: 50%;
  animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(0, 212, 255, 0); }
}

.hero-title {
  display: flex;
  flex-direction: column;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.title-line {
  display: block;
}

.hero-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.hero-description br {
  display: block;
  content: "";
  margin-top: 0.25rem;
}

.highlight {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 500;
}

/* 核心数据 */
.stats-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-number {
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.stat-unit {
  font-size: 0.9rem;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border-color);
}

/* 功能列表 */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: var(--transition);
  cursor: default;
}

.feature-item:hover {
  background: rgba(0, 212, 255, 0.05);
  border-color: var(--border-hover);
  transform: translateX(6px);
}

.feature-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(0, 255, 136, 0.1) 100%);
  border-radius: 10px;
  flex-shrink: 0;
}

.feature-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent-cyan);
}

.feature-text h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.feature-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==================== 右侧登录区域 ==================== */
.right-section {
  flex: 0.9;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: var(--spacing-xl) var(--spacing-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  backdrop-filter: blur(24px);
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.6),
    0 0 60px -20px rgba(124, 58, 237, 0.4);
}

.login-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.login-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 登录表单 */
.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
  pointer-events: none;
  transition: var(--transition);
}

.form-input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: var(--transition);
}

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

.form-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), var(--glow-cyan);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  stroke: var(--accent-cyan);
}

/* 密码切换按钮 */
.toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password .eye-icon {
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
  transition: var(--transition);
}

.toggle-password:hover .eye-icon {
  stroke: var(--accent-cyan);
}

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

.remember-me {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.remember-me input {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  position: relative;
  transition: var(--transition);
}

.remember-me input:checked + .checkbox-custom {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
  border-color: transparent;
}

.remember-me input:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid var(--bg-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.forgot-link {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  text-decoration: none;
  transition: var(--transition);
}

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

/* 登录按钮 */
.login-btn {
  width: 100%;
  padding: 14px;
  background: var(--gradient-main);
  background-size: 200% 200%;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--glow-cyan);
  animation: gradientShift 4s ease infinite;
}

.login-btn:disabled {
  background: var(--bg-input);
  box-shadow: none;
  animation: none;
  cursor: not-allowed;
  opacity: 0.6;
}

.login-btn:disabled:hover {
  transform: none;
}

.login-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 
    0 15px 40px -10px rgba(0, 212, 255, 0.5),
    var(--glow-cyan);
}

.login-btn:active:not(:disabled) {
  transform: translateY(0);
}

.login-btn.loading .btn-text {
  opacity: 0;
}

.login-btn.loading .btn-loader {
  display: block;
}

.btn-loader {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Toast提示 */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 14px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  z-index: 1000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: var(--accent-green);
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

.toast.error {
  border-color: #ef4444;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.toast-message {
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* ==================== 滑动验证码 ==================== */
.captcha-container {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: var(--spacing-md);
  user-select: none;
}

.captcha-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.captcha-refresh {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.captcha-refresh svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  transition: var(--transition);
}

.captcha-refresh:hover svg {
  stroke: var(--accent-cyan);
}

.captcha-refresh:hover {
  transform: rotate(180deg);
}

.captcha-body {
  position: relative;
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, #1a2332 0%, #0d1520 100%);
  border-radius: 10px;
  overflow: hidden;
}

.captcha-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.captcha-shade {
  position: absolute;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  pointer-events: none;
}

.captcha-puzzle {
  position: absolute;
  width: 50px;
  height: 50px;
  background-size: cover;
  background-position: center;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.captcha-slider {
  position: relative;
  height: 40px;
  margin-top: var(--spacing-sm);
  background: var(--bg-input);
  border-radius: 20px;
  overflow: hidden;
}

.slider-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  transition: var(--transition);
}

.slider-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 36px;
  height: 36px;
  background: var(--gradient-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: transform 0.1s ease;
  z-index: 3;
}

.slider-thumb svg {
  width: 16px;
  height: 16px;
  stroke: white;
  fill: none;
}

.slider-thumb:active {
  cursor: grabbing;
}

.slider-thumb.success {
  background: var(--accent-green);
}

.slider-thumb.fail {
  background: #ef4444;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.captcha-result {
  margin-top: var(--spacing-sm);
  text-align: center;
  font-size: 0.8rem;
  min-height: 20px;
}

.captcha-result.success {
  color: var(--accent-green);
}

.captcha-result.fail {
  color: #ef4444;
}

/* 验证码通过后的样式 */
.captcha-container.verified {
  border-color: rgba(0, 255, 136, 0.3);
}

.captcha-container.verified .slider-track {
  background: rgba(0, 255, 136, 0.1);
}

.captcha-container.verified .slider-hint {
  color: var(--accent-green);
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 950px) {
  html {
    overflow-y: auto;
    position: relative;
  }
  
  body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  #app {
    height: auto;
    min-height: 100%;
    padding: var(--spacing-md);
    align-items: flex-start;
    padding-top: var(--spacing-xl);
  }
  
  .main-container {
    flex-direction: column;
    max-height: none;
    height: auto;
    gap: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
  }
  
  .left-section {
    align-items: center;
    text-align: center;
    padding-left: 0;
    gap: var(--spacing-lg);
  }
  
  .brand-logo {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .brand-text {
    align-items: center;
  }
  
  .hero-badge {
    margin: 0 auto;
  }
  
  .hero-title {
    font-size: 1.7rem;
    align-items: center;
  }
  
  .hero-description {
    font-size: 0.9rem;
    text-align: center;
  }
  
  .stats-row {
    width: 100%;
    justify-content: center;
  }
  
  .feature-list {
    width: 100%;
  }
  
  .feature-item {
    justify-content: center;
  }
  
  .feature-item:hover {
    transform: none;
  }
  
  .right-section {
    height: auto;
    width: 100%;
  }
  
  .login-card {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  #app {
    padding: var(--spacing-sm);
    padding-top: var(--spacing-lg);
  }
  
  .login-card {
    padding: var(--spacing-lg) var(--spacing-md);
    border-radius: 20px;
  }
  
  .logo-container {
    width: 48px;
    height: 48px;
  }
  
  .logo-glow {
    width: 70px;
    height: 70px;
  }
  
  .logo-icon {
    width: 44px;
    height: 44px;
  }
  
  .logo-ring {
    width: 54px;
    height: 54px;
  }
  
  .brand-name {
    font-size: 1.4rem;
  }
  
  .hero-title {
    font-size: 1.4rem;
  }
  
  .hero-description {
    font-size: 0.85rem;
  }
  
  .stats-row {
    padding: var(--spacing-sm) var(--spacing-md);
    gap: var(--spacing-md);
  }
  
  .stat-number {
    font-size: 1.2rem;
  }
  
  .stat-label {
    font-size: 0.65rem;
  }
  
  .login-title {
    font-size: 1.2rem;
  }
  
  .form-input {
    padding: 12px 12px 12px 42px;
    font-size: 0.9rem;
  }
  
  .login-btn {
    padding: 13px;
    font-size: 0.95rem;
  }
}

@media (max-height: 650px) and (max-width: 950px) {
  #app {
    padding-top: var(--spacing-md);
  }
  
  .left-section {
    gap: var(--spacing-md);
  }
  
  .hero-content {
    margin-bottom: 0;
  }
  
  .stats-row {
    padding: var(--spacing-xs) var(--spacing-md);
  }
}

/* 安全区域适配 - iPhone刘海屏 */
@supports (padding: max(0px)) {
  #app {
    padding-left: max(var(--spacing-md), env(safe-area-inset-left));
    padding-right: max(var(--spacing-md), env(safe-area-inset-right));
    padding-bottom: max(var(--spacing-md), env(safe-area-inset-bottom));
  }
  
  .toast {
    top: max(20px, env(safe-area-inset-top));
  }
}
