/* ========================================
   华佰技术官网 - 工程美学设计系统
   Engineering Aesthetics Design System
   ======================================== */

/* CSS Variables - 工程化设计令牌 */
:root {
  /* 核心色彩系统 - 冷静工程灰调 */
  --color-bg-primary: #050505;
  --color-bg-secondary: #0a0a0a;
  --color-bg-tertiary: #111111;
  --color-bg-elevated: #1a1a1a;
  --color-bg-surface: #222222;
  
  /* 工程强调色 - 低饱和工业蓝 */
  --color-brand-primary: #3b82f6;
  --color-brand-secondary: #60a5fa;
  --color-brand-accent: #22d3ee;
  --color-brand-dim: rgba(59, 130, 246, 0.1);
  
  /* 功能色 */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  
  /* 文字系统 - 灰度层级 */
  --color-text-primary: #fafafa;
  --color-text-secondary: #a3a3a3;
  --color-text-tertiary: #737373;
  --color-text-muted: #525252;
  --color-text-dim: #404040;
  
  /* 边框系统 */
  --color-border: rgba(255, 255, 255, 0.06);
  --color-border-strong: rgba(255, 255, 255, 0.12);
  --color-border-brand: rgba(59, 130, 246, 0.3);
  
  /* 渐变系统 */
  --gradient-hero: linear-gradient(180deg, var(--color-bg-secondary) 0%, var(--color-bg-primary) 100%);
  --gradient-accent: linear-gradient(135deg, var(--color-brand-primary), var(--color-brand-accent));
  --gradient-glow: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.15) 0%, transparent 60%);
  --gradient-grid: linear-gradient(to right, var(--color-border) 1px, transparent 1px),
                   linear-gradient(to bottom, var(--color-border) 1px, transparent 1px);
  
  /* 字体系统 - 工程化 */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-engineering: 'Inter', sans-serif;
  
  /* 字号系统 - 响应式 */
  --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;
  --text-5xl: 3rem;
  --text-6xl: 4rem;
  --text-7xl: 5rem;
  
  /* 间距系统 - 8pt网格 */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --space-40: 10rem;
  
  /* 圆角系统 */
  --radius-none: 0;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  
  /* 动效系统 - 稳重ToB风格 */
  --duration-instant: 100ms;
  --duration-fast: 200ms;
  --duration-base: 400ms;
  --duration-slow: 600ms;
  --duration-slower: 800ms;
  
  --ease-linear: linear;
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-engineering: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-stable: cubic-bezier(0.25, 0.1, 0.25, 1);
  
  /* 布局系统 */
  --max-width: 1280px;
  --header-height: 64px;
  --grid-unit: 4px;
  
  /* 工程装饰 */
  --grid-size: 60px;
  --grid-opacity: 0.03;
}

/* Reset & Base - 工程化基础 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-overflow-scrolling: touch;
}

/* Selection - 工程蓝 */
::selection {
  background: rgba(59, 130, 246, 0.3);
  color: var(--color-text-primary);
}

/* ========================================
   图片懒加载样式
   ======================================== */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.5s ease;
}

img[loading="lazy"].loaded,
img[loading="lazy"]:not([src]) {
  opacity: 1;
}

/* 图片占位符 */
.img-placeholder {
  background: var(--color-bg-tertiary);
  position: relative;
  overflow: hidden;
}

.img-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Typography - 工程化排版 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum' 1;
}

/* 工程标签 */
.label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-tertiary);
  font-weight: 500;
}

.label-accent {
  color: var(--color-brand-primary);
}

/* 渐变文字 */
.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 技术数值 */
.text-metric {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' 1;
  font-variant-numeric: tabular-nums;
}

/* Layout Utilities - 系统化布局 */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-32) 0;
  position: relative;
}

.section-header {
  margin-bottom: var(--space-16);
  position: relative;
}

.section-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: calc(-1 * var(--space-8));
  width: 40px;
  height: 2px;
  background: var(--gradient-accent);
}

/* 工程网格背景 */
.bg-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, var(--grid-opacity)) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, var(--grid-opacity)) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  pointer-events: none;
}

.bg-grid-dense {
  background-size: 20px 20px;
  --grid-opacity: 0.02;
}

/* 工程辉光 */
.bg-glow {
  position: absolute;
  width: 800px;
  height: 800px;
  background: var(--gradient-glow);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
  opacity: 0.6;
}

/* Grid System - 工程网格 */
.grid {
  display: grid;
  gap: var(--space-6);
}

.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 Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Components - 工程化组件 */

/* Button - 机械感按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--duration-base) var(--ease-stable);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: transparent;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: var(--color-brand-primary);
  color: white;
  border: 1px solid transparent;
}

.btn-primary:hover {
  background: var(--color-brand-secondary);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-secondary);
}

.btn-outline:hover {
  border-color: var(--color-brand-primary);
  color: var(--color-text-primary);
  background: var(--color-brand-dim);
}

/* Card - 结构化卡片 */
.card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: all var(--duration-base) var(--ease-stable);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card:hover {
  border-color: var(--color-border-brand);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* 工程卡片 */
.card-engineering {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  position: relative;
}

.card-engineering::after {
  content: '';
  position: absolute;
  top: -1px;
  left: var(--space-6);
  width: 40px;
  height: 2px;
  background: var(--color-brand-primary);
}

/* Scroll Reveal - 滚动显示动画 */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slow) var(--ease-engineering),
              transform var(--duration-slow) var(--ease-engineering);
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* 数据浮现效果 */
.data-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-base) var(--ease-stable),
              transform var(--duration-base) var(--ease-stable);
}

.data-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-base) var(--ease-stable),
              transform var(--duration-base) var(--ease-stable);
}

.stagger-children.active > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.active > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children.active > *:nth-child(2) { transition-delay: 100ms; }
.stagger-children.active > *:nth-child(3) { transition-delay: 200ms; }
.stagger-children.active > *:nth-child(4) { transition-delay: 300ms; }
.stagger-children.active > *:nth-child(5) { transition-delay: 400ms; }
.stagger-children.active > *:nth-child(6) { transition-delay: 500ms; }

/* Header - 工程化头部 */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(5, 5, 5, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  transition: transform var(--duration-base) var(--ease-engineering);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo - 工程化 */
.logo {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text-primary);
}

.logo-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* Nav - 工程导航 */
.nav {
  display: flex;
  gap: var(--space-8);
}

.nav-link {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  transition: color var(--duration-fast);
  position: relative;
  padding: var(--space-2) 0;
  text-decoration: none;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-brand-primary);
  transition: width var(--duration-base) var(--ease-engineering);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Navigation CTA Button */
.nav-cta {
  margin-left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--color-brand-primary);
  color: white !important;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--color-brand-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

@media (max-width: 1024px) {
  .nav-cta {
    display: none;
  }
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10001; /* 确保在导航菜单之上 */
}

.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--color-text-primary);
  transition: all var(--duration-fast);
}

/* 汉堡菜单动画 */
.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 48px;
  height: 48px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--duration-base) var(--ease-engineering);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.back-to-top:hover {
  border-color: var(--color-brand-primary);
  background: var(--color-bg-tertiary);
  transform: translateY(0) scale(1.05);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-icon {
  width: 20px;
  height: 20px;
  color: var(--color-text-secondary);
}

/* Footer - 工程化页脚 */
.footer {
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  padding: var(--space-20) 0 var(--space-8);
}

/* 移动端底部固定CTA */
.mobile-sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-bg-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
  z-index: 1000;
  gap: var(--space-3);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.mobile-sticky-cta .btn {
  flex: 1;
  justify-content: center;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  min-height: 48px;
  min-width: 44px;
  touch-action: manipulation;
}

@media (max-width: 768px) {
  .mobile-sticky-cta {
    display: flex;
  }
  
  body {
    padding-bottom: 80px;
  }
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer-brand p {
  color: var(--color-text-tertiary);
  margin-top: var(--space-4);
  font-size: var(--text-sm);
}

.footer-links h4 {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-4);
  font-weight: 500;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-2);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  transition: color var(--duration-fast);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-brand-secondary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.footer-copyright {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

/* 3D Canvas Container */
.canvas-container {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Technical Decorations */
.tech-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 1px solid var(--color-border-strong);
}

.tech-corner-tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.tech-corner-tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.tech-corner-bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.tech-corner-br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

/* Hover位移效果 */
.hover-lift {
  transition: transform var(--duration-base) var(--ease-stable),
              box-shadow var(--duration-base) var(--ease-stable);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* 数据标签Hover效果 */
.data-tag {
  transition: all var(--duration-fast);
}

.data-tag:hover {
  background: var(--color-brand-dim);
  border-color: var(--color-border-brand);
  color: var(--color-brand-primary);
}

/* ========================================
   响应式断点系统
   ======================================== */

/* iPad Pro / 大屏平板 (1024px - 1366px) */
@media (max-width: 1366px) {
  :root {
    --text-5xl: 2.75rem;
    --text-6xl: 3.5rem;
    --space-32: 7rem;
  }
  
  .section {
    padding: var(--space-24) 0;
  }
}

/* iPad / 平板 (768px - 1024px) */
@media (max-width: 1024px) {
  :root {
    --text-5xl: 2.5rem;
    --text-6xl: 3rem;
    --space-32: 6rem;
    --space-16: 3rem;
  }
  
  .container {
    padding: 0 var(--space-5);
  }
  
  .section {
    padding: var(--space-20) 0;
  }
  
  .section-header {
    margin-bottom: var(--space-12);
  }
  
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }
  
  .nav {
    gap: var(--space-6);
  }
}

/* 大屏手机 (481px - 768px) */
@media (max-width: 768px) {
  :root {
    --text-4xl: 2rem;
    --text-5xl: 2.25rem;
    --text-6xl: 2.75rem;
    --space-32: 5rem;
    --space-24: 4rem;
    --space-16: 2.5rem;
  }
  
  .container {
    padding: 0 var(--space-4);
  }
  
  .section {
    padding: var(--space-16) 0;
  }
  
  .section-header {
    margin-bottom: var(--space-10);
  }
  
  .section-header::before {
    display: none;
  }
  
  /* 全屏抽屉式菜单 - 增强版 */
  .nav {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 8, 0.98); /* 更深的背景色确保对比度 */
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-8) var(--space-6);
    gap: var(--space-4);
    z-index: 10000; /* 确保在所有元素之上 */
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
  }
  
  .nav.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  /* 移动端菜单开启时禁用背景滚动 */
  body.nav-open {
    overflow: hidden;
  }
  
  .nav-link {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: #ffffff;
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-lg);
    transition: all var(--duration-fast);
    min-height: 56px;
    display: flex;
    align-items: center;
    text-align: center;
    letter-spacing: 0.02em;
    background: rgba(255, 255, 255, 0.05); /* 添加微弱背景增强可读性 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 200px;
    justify-content: center;
  }
  
  .nav-link:hover,
  .nav-link.active {
    background: rgba(59, 130, 246, 0.25);
    color: #fff;
    transform: scale(1.05);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
  }
  
  .nav-link::after {
    display: none;
  }
  
  .nav-cta {
    display: flex;
    margin-top: var(--space-6);
    padding: var(--space-4) var(--space-10);
    justify-content: center;
    font-size: var(--text-lg);
    font-weight: 600;
    min-height: 56px;
    background: var(--color-brand-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.5);
  }
  
  .nav-cta:hover {
    background: var(--color-brand-secondary);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5);
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }
  
  /* 触摸设备优化 */
  .card:hover,
  .hover-lift:hover {
    transform: none;
    box-shadow: none;
  }
  
  .card:active,
  .hover-lift:active {
    transform: scale(0.98);
  }
}

/* 小屏手机 (<= 480px) */
@media (max-width: 480px) {
  :root {
    --text-3xl: 1.75rem;
    --text-4xl: 2rem;
    --text-5xl: 2.25rem;
    --space-6: 1.25rem;
    --space-8: 1.5rem;
    --space-12: 2rem;
    --space-16: 2.5rem;
    --space-20: 3rem;
  }
  
  html {
    font-size: 14px;
  }
  
  .container {
    padding: 0 var(--space-4);
  }
  
  .btn {
    width: 100%;
    padding: var(--space-4) var(--space-6);
  }
  
  .back-to-top {
    width: 44px;
    height: 44px;
    bottom: var(--space-4);
    right: var(--space-4);
  }
}

/* 超小屏手机 (<= 360px) */
@media (max-width: 360px) {
  html {
    font-size: 13px;
  }
  
  .container {
    padding: 0 var(--space-3);
  }
}

/* ========================================
   横屏优化
   ======================================== */

@media (max-height: 600px) and (orientation: landscape) {
  .section {
    padding: var(--space-12) 0;
  }
  
  .page-hero {
    min-height: auto;
    padding: calc(var(--header-height) + var(--space-8)) 0 var(--space-12);
  }
}

/* ========================================
   深色模式优化
   ======================================== */

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg-primary: #050505;
    --color-bg-secondary: #0a0a0a;
  }
}

/* ========================================
   减少动画偏好
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ========================================
   打印样式
   ======================================== */

@media print {
  .header,
  .footer,
  .back-to-top,
  .canvas-container,
  .bg-grid,
  .bg-glow {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
}
