/**
 * ═══════════════════════════════════════════════════════════════
 * 灵极乌托邦 Design System v4.0
 * 
 * 设计理念：
 * - 极简科技风（参考 Higgsfield）
 * - 品牌色来自 Logo：紫粉 → 青蓝 渐变
 * - 高亮色：荧光柠檬 #CCFF00（区别于 Higgsfield 的纯黄）
 * - 轻量优先：CSS 渐变 > 图片
 * ═══════════════════════════════════════════════════════════════
 */

:root {
  /* ════════════════════════════════════════════════════════════
     1. 背景层次
     ════════════════════════════════════════════════════════════ */
  --bg-void: #050508;              /* 深空底色 */
  --bg-surface: #0a0a0f;           /* 卡片/面板 */
  --bg-elevated: #101018;          /* 悬浮层/弹窗 */
  --bg-hover: #15151f;             /* 悬停背景 */
  
  /* ════════════════════════════════════════════════════════════
     2. 品牌色（极简黄色系）
     ════════════════════════════════════════════════════════════ */
  --brand-primary: #CCFF00;        /* 荧光柠檬黄 */
  --brand-dim: #a8d900;            /* 暗黄 */
  --brand-dark: #0a0a0f;           /* 深黑 */
  
  /* 品牌渐变（黄色系） */
  --gradient-brand: linear-gradient(135deg, #CCFF00 0%, #a8d900 100%);
  --gradient-brand-horizontal: linear-gradient(90deg, #CCFF00 0%, #a8d900 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(204,255,0,0.08) 0%, rgba(168,217,0,0.08) 100%);
  
  /* ════════════════════════════════════════════════════════════
     3. 高亮/选中色（荧光柠檬）
     ════════════════════════════════════════════════════════════ */
  --accent-yellow: #CCFF00;        /* 主高亮：荧光柠檬 */
  --accent-yellow-dim: #a8d900;    /* 暗一点 */
  --accent-yellow-glow: rgba(204, 255, 0, 0.15);
  
  /* ════════════════════════════════════════════════════════════
     4. 功能色
     ════════════════════════════════════════════════════════════ */
  --color-success: #22c55e;        /* 成功/在线 */
  --color-warning: #f59e0b;        /* 警告 */
  --color-error: #ef4444;          /* 错误/HOT */
  --color-info: var(--accent-yellow); /* 信息 */
  
  /* ════════════════════════════════════════════════════════════
     5. 文字
     ════════════════════════════════════════════════════════════ */
  --text-primary: #f0f0f5;         /* 主文字 */
  --text-secondary: #888898;       /* 次要 */
  --text-muted: #505060;           /* 弱化 */
  --text-inverse: #000000;         /* 反色（在亮背景上） */
  
  /* ════════════════════════════════════════════════════════════
     6. 边框
     ════════════════════════════════════════════════════════════ */
  --border-subtle: rgba(255,255,255,0.06);
  --border-default: rgba(255,255,255,0.1);
  --border-hover: rgba(255,255,255,0.15);
  --border-brand: rgba(204,255,0,0.4);
  --border-accent: rgba(204,255,0,0.4);
  
  /* ════════════════════════════════════════════════════════════
     7. 圆角
     ════════════════════════════════════════════════════════════ */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* ════════════════════════════════════════════════════════════
     8. 过渡
     ════════════════════════════════════════════════════════════ */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
  
  /* ════════════════════════════════════════════════════════════
     9. 阴影（轻量）
     ════════════════════════════════════════════════════════════ */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow-brand: 0 0 20px rgba(204,255,0,0.2);
  --shadow-glow-accent: 0 0 20px var(--accent-yellow-glow);
  
  /* ════════════════════════════════════════════════════════════
     10. 字体
     ════════════════════════════════════════════════════════════ */
  --font-sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  
  /* 字号 */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 36px;
  --text-4xl: 48px;
  --text-5xl: 64px;
}

/* ════════════════════════════════════════════════════════════════
   全局重置
   ════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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-color: var(--bg-void);
}

a {
  color: inherit;
  text-decoration: none;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ════════════════════════════════════════════════════════════════
   通用组件
   ════════════════════════════════════════════════════════════════ */

/* --- 容器 --- */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .container { padding: 0 40px; }
}

/* --- 卡片 --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-base);
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.card-interactive:hover {
  border-color: var(--border-brand);
  box-shadow: var(--shadow-glow-brand);
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  transition: var(--transition-base);
  white-space: nowrap;
}

/* 品牌渐变按钮 */
.btn-brand {
  background: var(--gradient-brand);
  color: #fff;
}

.btn-brand:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow-brand);
}

/* 高亮按钮（荧光柠檬） */
.btn-accent {
  background: var(--accent-yellow);
  color: var(--text-inverse);
}

.btn-accent:hover {
  background: var(--accent-yellow-dim);
  box-shadow: var(--shadow-glow-accent);
}

/* 轮廓按钮 */
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

/* 幽灵按钮 */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

/* --- 标签 --- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-accent {
  background: var(--accent-yellow);
  color: var(--text-inverse);
}

.tag-brand {
  background: var(--accent-yellow);
  color: #000;
}

.tag-hot {
  background: var(--color-error);
  color: #fff;
}

.tag-new {
  background: var(--brand-cyan);
  color: var(--text-inverse);
}

.tag-outline {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}

/* --- 导航链接 --- */
.nav-link {
  padding: 8px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.nav-link.active {
  color: var(--accent-yellow);
  background: rgba(204,255,0,0.1);
}

/* --- 标签页/Tab --- */
.tab {
  padding: 8px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  transition: var(--transition-fast);
  cursor: pointer;
}

.tab:hover {
  color: var(--text-secondary);
}

.tab.active {
  color: var(--accent-yellow);
  background: rgba(204,255,0,0.1);
}

/* --- 输入框 --- */
.input {
  width: 100%;
  padding: 12px 16px;
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition-base);
}

.input::placeholder {
  color: var(--text-muted);
}

.input:focus {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 0 2px rgba(204,255,0,0.15);
}

/* --- 分割线 --- */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 24px 0;
}

/* --- 标题样式 --- */
.section-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

/* 渐变标题 */
.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 高亮标题（黄色） */
.highlight-text {
  color: var(--accent-yellow);
}

/* ════════════════════════════════════════════════════════════════
   响应式断点
   ════════════════════════════════════════════════════════════════ */

/* 移动端优先 */
@media (max-width: 768px) {
  :root {
    --text-4xl: 36px;
    --text-5xl: 48px;
  }
  
  .container {
    padding: 0 16px;
  }
  
  .btn {
    min-height: 44px;
    font-size: var(--text-base);
  }
}

/* ════════════════════════════════════════════════════════════════
   实用类
   ════════════════════════════════════════════════════════════════ */

/* 文字对齐 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* 弹性布局 */
.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-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

/* 网格布局 */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sm\:grid-cols-1 { grid-template-columns: 1fr; }
}

/* 间距 */
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }

/* 隐藏 */
.hidden { display: none; }

@media (max-width: 768px) {
  .sm\:hidden { display: none; }
}

@media (min-width: 769px) {
  .md\:hidden { display: none; }
}

/* ════════════════════════════════════════════════════════════════
   iOS / 移动端 GPU 性能优化
   
   问题：backdrop-filter: blur() 在 iOS Safari 上是 GPU 密集型操作，
   导致滚动卡顿和页面切换延迟。background-attachment: fixed 在 iOS 上
   每帧重绘整个背景层，严重影响滚动流畅度。
   
   策略：移动端降级 blur 值或移除，桌面端完全不受影响。
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* 修复 iOS Safari 的 background-attachment: fixed 性能问题 */
  body {
    background-attachment: scroll !important;
  }

  /* 导航栏：blur(20px) → blur(4px)，视觉差异极小但 GPU 负担大幅降低 */
  .navbar,
  .top-bar {
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
  }

  /* 弹窗/遮罩层：保留轻微模糊即可 */
  .wechat-backdrop,
  .modal-backdrop {
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
  }
}
