/* ============================================
   Nexus CoreFlow - 现代简约设计系统
   参考 Vercel / Linear / Notion 设计风格
   ============================================ */

:root {
  /* 色彩系统 */
  --bg: #ffffff;
  --bg-secondary: #f8f9fb;
  --bg-tertiary: #f1f3f5;
  
  --surface: #ffffff;
  --surface-hover: #f8f9fb;
  --surface-active: #f1f3f5;
  
  --text-primary: #0f1419;
  --text-secondary: #536474;
  --text-tertiary: #8b949e;
  
  --border: #e1e8ed;
  --border-hover: #d1d9de;
  
  /* 主色调 - 紫色/蓝色渐变 */
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-light: #ede9fe;
  --primary-gradient: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  --primary-gradient-hover: linear-gradient(135deg, #6d28d9 0%, #2563eb 100%);
  
  /* 辅助色 */
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --error: #ef4444;
  --error-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;
  
  /* 间距系统 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  
  /* 圆角系统 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* 阴影系统 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.1);
  
  /* 字体系统 */
  --font-sans: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  
  /* 字号系统 */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  
  /* 布局 */
  --container: 1200px;
  --container-wide: 1400px;
  --header-height: 72px;
}

/* ============================================
   基础重置
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
}

[hidden] {
  display: none !important;
}

/* ============================================
   排版
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: var(--text-6xl); }
h2 { font-size: var(--text-5xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* ============================================
   布局组件
   ============================================ */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-wide {
  max-width: var(--container-wide);
}

.section {
  padding: var(--space-4xl) 0;
}

.section-sm {
  padding: var(--space-2xl) 0;
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ============================================
   按钮系统
   ============================================ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  height: 44px;
  padding: 0 var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

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

/* 主要按钮 */
.button-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-gradient-hover);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.3);
  transform: translateY(-1px);
}

/* 次要按钮 */
.button-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.button-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.button-disabled {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  border: 1px solid var(--border);
  box-shadow: none;
}

.button-disabled:hover {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  transform: none;
}

/* 文本按钮 */
.button-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0 var(--space-md);
}

.button-ghost:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.site-profile-link {
  gap: var(--space-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
}

.site-profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient);
  color: #ffffff;
  font-size: var(--text-xs);
  font-weight: 800;
}

/* 按钮尺寸 */
.button-sm {
  height: 36px;
  padding: 0 var(--space-md);
  font-size: var(--text-xs);
}

.button-lg {
  height: 52px;
  padding: 0 var(--space-xl);
  font-size: var(--text-base);
}

/* ============================================
   卡片系统
   ============================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all 0.2s ease;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.card-elevated {
  border: none;
  box-shadow: var(--shadow-lg);
}

.card-elevated:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
}

/* ============================================
   导航栏
   ============================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--text-primary);
  text-decoration: none;
}

.logo img {
  height: 36px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav a {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav a:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.nav a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* ============================================
   Hero 区域
   ============================================ */

.hero {
  padding: var(--space-4xl) 0;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

.hero h1 {
  margin-bottom: var(--space-lg);
  font-size: var(--text-6xl);
  line-height: 1.1;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text {
  max-width: 640px;
  margin: 0 auto var(--space-xl);
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

/* ============================================
   标签/徽章
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-error {
  background: var(--error-light);
  color: var(--error);
}

/* ============================================
   表单元素
   ============================================ */

.form-group {
  margin-bottom: var(--space-md);
}

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

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--surface);
  transition: all 0.2s ease;
}

.form-input:hover {
  border-color: var(--border-hover);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

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

textarea.form-input {
  height: auto;
  padding: var(--space-md);
  min-height: 120px;
  resize: vertical;
}

/* ============================================
   工具类
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

/* ============================================
   响应式
   ============================================ */

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --space-4xl: 64px;
    --text-6xl: 2.5rem;
    --text-5xl: 2rem;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .nav {
    display: none;
  }
  
  .hero-actions {
    flex-direction: column;
  }
  
  .hero-actions .button {
    width: 100%;
  }
}

/* ============================================
   动画
   ============================================ */

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

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

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.animate-slide-in {
  animation: slideIn 0.4s ease forwards;
}

/* 延迟动画 */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
