/* ===================================================================
 * 济南合煦智能科技有限公司 — 设计系统
 * 文件：design-system.css
 * 说明：全局 CSS 变量、重置样式、排版基础
 * =================================================================== */

/* ----- 引入字体 ----- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Noto+Sans+SC:wght@300;400;500;600;700;900&display=swap');

/* ===================================================================
 * 1. CSS 变量 — 设计令牌
 * =================================================================== */
:root {
  /* --- 主色调：科技蓝（从公司宣传素材提取） --- */
  --primary-h: 215;
  --primary-s: 100%;
  --primary-l: 55%;
  --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  --primary-light: hsl(var(--primary-h), var(--primary-s), 70%);
  --primary-lighter: hsl(var(--primary-h), var(--primary-s), 85%);
  --primary-dark: hsl(var(--primary-h), var(--primary-s), 40%);
  --primary-darker: hsl(var(--primary-h), var(--primary-s), 25%);

  /* --- 强调色：青色高光 --- */
  --accent-h: 185;
  --accent-s: 100%;
  --accent: hsl(var(--accent-h), var(--accent-s), 50%);
  --accent-light: hsl(var(--accent-h), var(--accent-s), 75%);

  /* --- 暖色强调：活力金 --- */
  --warm-h: 35;
  --warm: hsl(var(--warm-h), 95%, 55%);
  --warm-light: hsl(var(--warm-h), 95%, 70%);

  /* --- 成功/警告/错误 --- */
  --success: hsl(150, 70%, 45%);
  --warning: hsl(40, 95%, 55%);
  --error: hsl(0, 75%, 55%);

  /* --- 深色背景梯度 --- */
  --bg-1: hsl(222, 47%, 5%);
  --bg-2: hsl(222, 40%, 8%);
  --bg-3: hsl(222, 35%, 12%);
  --bg-4: hsl(222, 30%, 16%);
  --bg-5: hsl(222, 25%, 20%);

  /* --- 表面色（卡片、面板） --- */
  --surface-1: hsla(220, 25%, 12%, 0.85);
  --surface-2: hsla(220, 20%, 16%, 0.8);
  --surface-3: hsla(220, 18%, 20%, 0.75);

  /* --- 毛玻璃效果 --- */
  --glass-bg: hsla(222, 35%, 10%, 0.4);
  --glass-bg-hover: hsla(222, 35%, 14%, 0.6);
  --glass-border: hsla(0, 0%, 100%, 0.08);
  --glass-border-hover: hsla(215, 100%, 60%, 0.3);
  --glass-blur: 24px;

  /* --- 文字色 --- */
  --text-1: hsl(0, 0%, 96%);
  --text-2: hsl(210, 10%, 72%);
  --text-3: hsl(210, 8%, 50%);
  --text-4: hsl(210, 6%, 35%);

  /* --- 边框色 --- */
  --border-1: hsla(0, 0%, 100%, 0.06);
  --border-2: hsla(0, 0%, 100%, 0.1);
  --border-3: hsla(0, 0%, 100%, 0.15);

  /* --- 字体 --- */
  --font-cn: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --font-en: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  --font-base: var(--font-en), var(--font-cn);

  /* --- 字号 --- */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  --text-5xl: 3rem;       /* 48px */
  --text-6xl: 3.75rem;    /* 60px */
  --text-7xl: 4.5rem;     /* 72px */

  /* --- 间距 --- */
  --space-1: 0.25rem;     /* 4px */
  --space-2: 0.5rem;      /* 8px */
  --space-3: 0.75rem;     /* 12px */
  --space-4: 1rem;        /* 16px */
  --space-5: 1.25rem;     /* 20px */
  --space-6: 1.5rem;      /* 24px */
  --space-8: 2rem;        /* 32px */
  --space-10: 2.5rem;     /* 40px */
  --space-12: 3rem;       /* 48px */
  --space-16: 4rem;       /* 64px */
  --space-20: 5rem;       /* 80px */
  --space-24: 6rem;       /* 96px */
  --space-32: 8rem;       /* 128px */

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

  /* --- 阴影 --- */
  --shadow-sm: 0 2px 8px hsla(222, 47%, 0%, 0.4);
  --shadow-md: 0 8px 24px hsla(222, 47%, 0%, 0.5);
  --shadow-lg: 0 16px 40px hsla(222, 47%, 0%, 0.6);
  --shadow-xl: 0 24px 60px hsla(222, 47%, 0%, 0.7);
  --shadow-glow: 0 0 40px hsla(var(--primary-h), var(--primary-s), 55%, 0.2);
  --shadow-glow-lg: 0 0 80px hsla(var(--primary-h), var(--primary-s), 55%, 0.3);
  --shadow-glow-accent: 0 0 40px hsla(var(--accent-h), var(--accent-s), 50%, 0.25);

  /* --- 过渡 --- */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out: cubic-bezier(0.42, 0, 0.58, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
  --duration-slower: 600ms;

  /* --- 层级 --- */
  --z-below: -1;
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-toast: 600;
  --z-tooltip: 700;

  /* --- 容器宽度 --- */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1440px;
  --container-padding: var(--space-6);
}

/* ===================================================================
 * 2. CSS 重置
 * =================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-5) var(--bg-1);
}

body {
  font-family: var(--font-base);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-1);
  background-color: var(--bg-1);
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- 自定义滚动条 --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-1);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-5);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

/* --- 选中文本样式 --- */
::selection {
  background: hsla(var(--primary-h), var(--primary-s), 50%, 0.3);
  color: var(--text-1);
}

/* ===================================================================
 * 3. 排版基础
 * =================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-base);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-1);
  letter-spacing: 0.02em;
}

h1 {
  font-size: var(--text-5xl);
  font-weight: 800;
  line-height: 1.15;
}

h2 {
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: 1.2;
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
}

h4 {
  font-size: var(--text-xl);
  font-weight: 600;
}

h5 {
  font-size: var(--text-lg);
  font-weight: 500;
}

h6 {
  font-size: var(--text-base);
  font-weight: 500;
}

p {
  color: var(--text-2);
  line-height: 1.8;
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--accent);
}

strong, b {
  font-weight: 700;
  color: var(--text-1);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
  color: var(--text-3);
}

/* --- 列表 --- */
ul, ol {
  list-style: none;
}

/* --- 图片 --- */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- 表单元素 --- */
button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* --- 分隔线 --- */
hr {
  border: none;
  height: 1px;
  background: var(--border-1);
  margin: var(--space-8) 0;
}

/* ===================================================================
 * 4. 容器与通用布局工具
 * =================================================================== */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

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

.container--wide {
  max-width: var(--container-2xl);
}

/* --- 区块间距 --- */
.section {
  padding: var(--space-20) 0;
  position: relative;
}

.section--lg {
  padding: var(--space-32) 0;
}

/* --- 区块标题 --- */
.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-header__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: hsla(var(--primary-h), var(--primary-s), 50%, 0.1);
  border: 1px solid hsla(var(--primary-h), var(--primary-s), 50%, 0.2);
  border-radius: var(--radius-full);
}

.section-header__title {
  font-size: var(--text-4xl);
  font-weight: 800;
  margin-bottom: var(--space-4);
  background: linear-gradient(135deg, var(--text-1) 0%, var(--text-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-header__desc {
  font-size: var(--text-lg);
  color: var(--text-3);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.8;
}

/* --- Flex/Grid 工具类 --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* --- 文本对齐 --- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* --- 隐藏/显示 --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===================================================================
 * 5. 响应式断点
 * =================================================================== */
@media (max-width: 1279px) {
  :root {
    --text-5xl: 2.5rem;
    --text-6xl: 3rem;
    --text-7xl: 3.5rem;
  }
}

@media (max-width: 1023px) {
  :root {
    --text-4xl: 2rem;
    --text-5xl: 2.25rem;
    --text-6xl: 2.5rem;
    --container-padding: var(--space-5);
  }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  .section { padding: var(--space-16) 0; }
  .section--lg { padding: var(--space-20) 0; }
}

@media (max-width: 767px) {
  :root {
    --text-3xl: 1.5rem;
    --text-4xl: 1.75rem;
    --text-5xl: 2rem;
    --container-padding: var(--space-4);
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5 {
    grid-template-columns: 1fr;
  }

  .section { padding: var(--space-12) 0; }
  .section-header { margin-bottom: var(--space-10); }
  .section-header__title { font-size: var(--text-3xl); }
}
