/**
 * 通用样式 - 现代深色卡片风格
 */

/* ========== 引入字体 ========== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

/* ========== CSS 变量 ========== */
:root {
  /* 主色 */
  --primary: #818cf8;
  --primary-light: #a5b4fc;
  --primary-dark: #6366f1;
  --primary-bg: rgba(129, 140, 248, 0.12);
  
  /* 状态色 */
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.12);
  --error: #f87171;
  --error-bg: rgba(248, 113, 113, 0.12);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.12);
  
  /* 背景 */
  --bg-page: #0c0f1a;
  --bg-card: #161b2e;
  --bg-muted: #1e2439;
  --bg-overlay: rgba(0, 0, 0, 0.7);
  
  /* 边框 */
  --border-light: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  
  /* 文字 */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
  
  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* 过渡 */
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* ========== 重置 ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  line-height: 1.5;
}

/* ========== Logo ========== */
.logo {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: 2px;
}

.logo span {
  display: inline-block;
  transition: transform var(--transition), filter var(--transition);
}

.logo span:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 2px 8px currentColor);
}

.logo-1 { color: #f472b6; }
.logo-2 { color: #fb923c; }
.logo-3 { color: #facc15; }
.logo-4 { color: #4ade80; }
.logo-5 { color: #22d3ee; }
.logo-6 { color: #818cf8; }
.logo-7 { color: #e879f9; }

.subtitle {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 28px;
  text-align: center;
  letter-spacing: 0.5px;
}

/* ========== 卡片 ========== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

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

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-muted);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: var(--text-muted);
}

/* ========== 按钮 ========== */
.btn {
  width: 100%;
  padding: 13px 20px;
  background: var(--primary);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), background var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}

.btn:hover:not(:disabled) {
  background: var(--primary-light);
  box-shadow: 0 4px 16px rgba(129, 140, 248, 0.3);
}

.btn:active:not(:disabled) {
  opacity: 0.9;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1.5px solid var(--border-medium);
  box-shadow: none;
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-muted);
  border-color: var(--text-muted);
  color: var(--text-primary);
  box-shadow: none;
}

.reset-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 16px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  font-family: inherit;
}

.reset-btn:hover {
  background: var(--bg-muted);
  color: var(--text-secondary);
}

/* ========== 分割线 ========== */
.divider {
  height: 1px;
  background: var(--border-medium);
  margin: 24px 0;
}

/* ========== 提示框 ========== */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 18px;
  display: none;
  align-items: center;
  gap: 8px;
  line-height: 1.5;
}

.alert.error {
  background: var(--error-bg);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: #fca5a5;
}

.alert.success {
  background: var(--success-bg);
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: #6ee7b7;
}

.alert.warning {
  background: var(--warning-bg);
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: #fcd34d;
}

/* ========== 加载动画 ========== */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

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

.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ========== 动画 ========== */
.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ========== 响应式 ========== */
@media (max-width: 480px) {
  body {
    padding: 16px;
  }
  
  .card {
    padding: 24px;
    border-radius: var(--radius-lg);
  }
  
  .logo {
    font-size: 22px;
  }
}
