/* 主样式文件 - 数字花园博客 */

/* CSS自定义属性 - 设计系统 */
:root {
  /* 颜色系统 - 避免平庸的蓝紫渐变 */
  --primary-hue: 280;
  --secondary-hue: 45;
  --accent-hue: 160;
  
  /* 主色调 */
  --color-primary: hsl(var(--primary-hue), 60%, 65%);
  --color-primary-light: hsl(var(--primary-hue), 40%, 85%);
  --color-primary-dark: hsl(var(--primary-hue), 80%, 45%);
  
  /* 辅助色 */
  --color-secondary: hsl(var(--secondary-hue), 70%, 60%);
  --color-accent: hsl(var(--accent-hue), 50%, 55%);
  
  /* 中性色 */
  --color-background: hsl(220, 25%, 8%);
  --color-surface: hsl(220, 20%, 12%);
  --color-surface-alt: hsl(220, 15%, 16%);
  
  /* 文本颜色 */
  --color-text-primary: hsl(220, 15%, 92%);
  --color-text-secondary: hsl(220, 10%, 70%);
  --color-text-muted: hsl(220, 8%, 50%);
  
  /* 毛玻璃效果变量 */
  --glass-bg: hsla(220, 25%, 15%, 0.4);
  --glass-border: hsla(220, 15%, 40%, 0.2);
  --glass-shadow: 0 8px 32px hsla(0, 0%, 0%, 0.3);
  --glass-blur: 12px;
  
  /* 间距系统 */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  
  /* 字体系统 */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, 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: 2rem;
  --text-4xl: 2.5rem;
  
  /* 动画参数 */
  --transition-fast: 0.15s ease-out;
  --transition-base: 0.3s ease-out;
  --transition-slow: 0.5s ease-out;
  
  /* 边框半径 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 全局基础样式 */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-background);
  color: var(--color-text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* 背景层 */
.background-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

/* 动态光球背景 */
.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.6;
  animation: float 20s infinite ease-in-out;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, 
    hsla(var(--primary-hue), 70%, 60%, 0.4) 0%,
    hsla(var(--primary-hue), 50%, 40%, 0.2) 50%,
    transparent 100%);
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle,
    hsla(var(--secondary-hue), 80%, 65%, 0.3) 0%,
    hsla(var(--secondary-hue), 60%, 45%, 0.15) 50%,
    transparent 100%);
  top: 50%;
  right: -150px;
  animation-delay: -7s;
}

.orb-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle,
    hsla(var(--accent-hue), 60%, 55%, 0.25) 0%,
    hsla(var(--accent-hue), 40%, 35%, 0.1) 50%,
    transparent 100%);
  bottom: -250px;
  left: 30%;
  animation-delay: -14s;
}

/* 光球浮动动画 */
@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(100px, -100px) rotate(120deg);
  }
  66% {
    transform: translate(-50px, 50px) rotate(240deg);
  }
}

/* 粒子场效果 */
.particle-field {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(1px 1px at 25% 25%, hsla(var(--primary-hue), 50%, 70%, 0.3), transparent),
    radial-gradient(1px 1px at 75% 75%, hsla(var(--accent-hue), 50%, 70%, 0.2), transparent),
    radial-gradient(1px 1px at 50% 10%, hsla(var(--secondary-hue), 50%, 70%, 0.25), transparent);
  background-size: 120px 120px, 80px 80px, 100px 100px;
  animation: particleMove 30s linear infinite;
}

@keyframes particleMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-100px, -50px);
  }
}

/* 主内容容器 */
.main-content {
  position: relative;
  z-index: 1;
  padding-top: 100px;
  min-height: 100vh;
}

/* 通用文本样式 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

/* 链接样式 */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* 按钮基础样式 */
button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
}

/* SVG图标通用样式 */
svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 容器布局 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* 响应式设计 */
@media (max-width: 768px) {
  :root {
    --space-lg: 1rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
  }
  
  .container {
    padding: 0 var(--space-md);
  }
  
  .main-content {
    padding-top: 80px;
  }
}

/* 可访问性改进 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .gradient-orb {
    animation: none;
  }
  
  .particle-field {
    animation: none;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  :root {
    --color-text-primary: #ffffff;
    --color-text-secondary: #e0e0e0;
    --glass-border: hsla(220, 15%, 60%, 0.4);
  }
}