:root {
  /* 基底 */
  --cyber-bg: #050508;
  --cyber-bg-elevated: #0a0e17;
  --cyber-bg-card: rgba(10, 14, 23, 0.85);
  --cyber-bg-input: rgba(255, 255, 255, 0.04);
  --cyber-bg-hover: rgba(255, 255, 255, 0.06);
  
  /* 霓虹色 */
  --cyber-primary: #00f0ff;
  --cyber-secondary: #ff00ff;
  --cyber-accent: #ff6b35;
  --cyber-success: #00ff9d;
  --cyber-warning: #f59e0b;
  --cyber-danger: #ef4444;
  
  /* 文字 */
  --cyber-text: #e0f2f1;
  --cyber-text-secondary: #a0b0c0;
  --cyber-text-dim: #6a7a8a;
  
  /* 边框与发光 */
  --cyber-border: rgba(0, 240, 255, 0.15);
  --cyber-border-hover: rgba(0, 240, 255, 0.5);
  --cyber-glow-primary: 0 0 20px rgba(0, 240, 255, 0.35);
  --cyber-glow-secondary: 0 0 20px rgba(255, 0, 255, 0.35);
  --cyber-glow-accent: 0 0 20px rgba(255, 107, 53, 0.35);
  
  /* 空间 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  
  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  
  /* 动画 */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  
  /* 导航与侧边栏 */
  --nav-height: 64px;
  --nav-height-mobile: 56px;
  --bottom-nav-height: 60px;
  
  /* 字体 */
  --font-heading: 'Orbitron', 'Rajdhani', 'Noto Sans SC', system-ui, sans-serif;
  --font-body: 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* 亮色模式 */
[data-theme="light"] {
  --cyber-bg: #f0f2f5;
  --cyber-bg-elevated: #ffffff;
  --cyber-bg-card: rgba(255, 255, 255, 0.9);
  --cyber-bg-input: rgba(0, 0, 0, 0.03);
  --cyber-bg-hover: rgba(0, 0, 0, 0.05);
  --cyber-text: #0a0e17;
  --cyber-text-secondary: #4a5568;
  --cyber-text-dim: #718096;
  --cyber-border: rgba(0, 240, 255, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.16);
}

/*  prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 全局基础 */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--cyber-text);
  background: var(--cyber-bg);
  min-width: 320px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 背景网格 */
.cyber-bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* 扫描线 */
.cyber-scanlines {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  opacity: 0;
  transition: opacity 0.3s;
}

body[data-scanlines="1"] .cyber-scanlines {
  opacity: 1;
}

/* 图片默认处理 */
img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--cyber-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--cyber-border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cyber-primary);
}

a {
  color: var(--cyber-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--cyber-text);
  text-shadow: 0 0 8px var(--cyber-primary);
}

img {
  max-width: 100%;
  height: auto;
}

/* 背景网格 */
.cyber-bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.4;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* 扫描线 */
.cyber-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.8) 2px,
    rgba(0, 0, 0, 0.8) 4px
  );
  display: none;
}

body[data-scanlines="1"] .cyber-scanlines {
  display: block;
}

/* 字体加载 */
.cyber-font-orbitron { --font-heading: 'Orbitron', 'Noto Sans SC', system-ui, sans-serif; }
.cyber-font-rajdhani { --font-heading: 'Rajdhani', 'Noto Sans SC', system-ui, sans-serif; }
