/* ============================================
   麦晟云科技 - 极简白科技设计系统
   global.css: CSS变量 + Reset + 基础样式
   ============================================ */

/* ----- CSS Variables ----- */
:root {
  /* 背景层级 */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f5;
  --bg-card: #ffffff;
  --bg-card-hover: #fafbfc;
  --bg-elevated: #ffffff;
  --bg-inverse: #111827;

  /* 品牌色 */
  --brand: #0083df;
  --brand-50: #e6f4fc;
  --brand-100: #b3e0f7;
  --brand-200: #80cbf2;
  --brand-300: #4db5ed;
  --brand-400: #1a9fe8;
  --brand-500: #0083df;
  --brand-600: #0069b5;
  --brand-700: #004f8a;
  --brand-800: #003560;
  --brand-900: #001b36;
  --gradient-brand: linear-gradient(135deg, #0083df, #00b4d8);

  /* 文字色 */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;
  --text-brand: #0083df;

  /* 边框与分割线 */
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --border-brand: rgba(0, 131, 223, 0.3);
  --divider: #e5e7eb;

  /* 语义色 */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.08);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.08);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.08);
  --info: #0083df;
  --info-bg: rgba(0, 131, 223, 0.08);

  /* 字体族 */
  --font-sans: 'Inter', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;

  /* 字号阶梯 */
  --text-hero: clamp(2.5rem, 6vw, 4rem);
  --text-h1: clamp(2rem, 4vw, 2.75rem);
  --text-h2: clamp(1.5rem, 3vw, 2rem);
  --text-h3: clamp(1.15rem, 2vw, 1.5rem);
  --text-h4: clamp(1rem, 1.5vw, 1.25rem);
  --text-body: 1rem;
  --text-body-lg: 1.125rem;
  --text-small: 0.875rem;
  --text-xs: 0.75rem;
  --text-data: clamp(2.5rem, 5vw, 3.5rem);
  --text-data-sm: clamp(1.5rem, 3vw, 2.25rem);

  /* 字重 */
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* 行高 */
  --lh-tight: 1.2;
  --lh-normal: 1.6;
  --lh-relaxed: 1.8;

  /* 间距系统（8px网格） */
  --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;

  /* 阴影系统 */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.05);
  --shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-nav: 0 1px 3px rgba(0, 0, 0, 0.05);

  /* 圆角系统 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* 动画/过渡 */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-reveal: 800ms cubic-bezier(0.16, 1, 0.3, 1);

  /* 布局常量 */
  --container-max: 1200px;
  --container-narrow: 900px;
  --header-height: 72px;
  --section-padding: var(--space-24);
}

/* ----- Reset ----- */
*, *::before, *::after {
  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-body);
  font-weight: var(--fw-normal);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input, textarea, select {
  font: inherit;
  color: inherit;
}

/* ----- Typography ----- */
h1, h2, h3, h4 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); }

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

/* ----- Layout ----- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

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

/* ----- Section ----- */
.section {
  padding: var(--section-padding) 0;
}

.section-alt {
  background-color: var(--bg-secondary);
}

.section-inverse {
  background-color: var(--bg-inverse);
  color: var(--text-inverse);
}

.section-inverse h2,
.section-inverse h3 {
  color: var(--text-inverse);
}

.section-inverse p {
  color: rgba(255, 255, 255, 0.7);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-16);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  font-size: var(--text-body-lg);
  color: var(--text-muted);
}

/* ----- Reveal Animation ----- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-reveal), transform var(--transition-reveal);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.stagger.visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(4) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(5) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(6) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }

/* ----- Reduced Motion ----- */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html { scroll-behavior: auto; }
}

/* ----- Responsive ----- */
@media (max-width: 1023px) {
  :root {
    --section-padding: var(--space-16);
  }
}

@media (max-width: 767px) {
  :root {
    --section-padding: var(--space-12);
  }
  .container {
    padding: 0 var(--space-4);
  }
}

/* ----- Utility ----- */
.text-center { text-align: center; }
.text-brand { color: var(--text-brand); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-medium { font-weight: var(--fw-medium); }
.font-semibold { font-weight: var(--fw-semibold); }

/* Counter animation */
[data-counter] {
  font-variant-numeric: tabular-nums;
}
