/* ============================================
   华富微官网 — 设计系统
   工业精密风 · OKLCH 色彩 · 模块化排版
   ============================================ */

/* ===== CSS Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'SimSun', serif;
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: 'DM Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* ===== 设计令牌 ===== */
:root {
  /* 色彩 — 硅灰底板 */
  --color-bg:              oklch(14% 0.008 260);
  --color-surface:         oklch(18% 0.006 255);
  --color-surface-raised:  oklch(22% 0.005 252);
  --color-border:          oklch(25% 0.004 260);

  /* 铜色强调 */
  --color-accent:          oklch(65% 0.12 55);
  --color-accent-hover:    oklch(72% 0.13 58);
  --color-accent-muted:    oklch(45% 0.08 55);

  /* 文字层级 */
  --color-text-primary:    oklch(92% 0.002 260);
  --color-text-secondary:  oklch(72% 0.003 260);
  --color-text-muted:      oklch(52% 0.002 260);

  /* 语义色 */
  --color-success:         oklch(62% 0.12 160);
  --color-warning:         oklch(68% 0.14 70);
  --color-error:           oklch(55% 0.18 20);
  --color-info:            oklch(60% 0.08 240);

  /* 排版 — Major Third (1.25) */
  --text-xs:    clamp(0.75rem, 0.7rem + 0.25vw, 0.8rem);
  --text-sm:    clamp(0.875rem, 0.82rem + 0.28vw, 0.95rem);
  --text-base:  1rem;
  --text-lg:    clamp(1.125rem, 1.02rem + 0.5vw, 1.25rem);
  --text-xl:    clamp(1.25rem, 1.08rem + 0.85vw, 1.5rem);
  --text-2xl:   clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
  --text-3xl:   clamp(2rem, 1.5rem + 2.5vw, 3rem);
  --text-4xl:   clamp(2.5rem, 1.6rem + 4.5vw, 4.5rem);

  /* 间距基准 = 24px */
  --space-unit: 1.5rem;
  --space-xs:   0.375rem;
  --space-sm:   0.75rem;
  --space-md:   1.5rem;
  --space-lg:   2.25rem;
  --space-xl:   3rem;
  --space-2xl:  4.5rem;
  --space-3xl:  6rem;

  /* 圆角 */
  --radius-sm:  0.25rem;
  --radius-md:  0.375rem;
  --radius-lg:  0.5rem;
  --radius-xl:  0.75rem;

  /* 阴影 */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg:  0 10px 25px rgba(0,0,0,0.4);

  /* 过渡 */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;

  /* 容器 */
  --container-max: 1280px;
  --container-padding: var(--space-md);
}

/* ===== 布局工具类 ===== */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container-narrow {
  max-width: 860px;
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* ===== 跳过导航（无障碍） ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-accent);
  color: var(--color-bg);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  z-index: 10000;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: var(--space-md);
}

/* ===== 网格 ===== */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: var(--space-lg); }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: var(--space-lg); }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ===== 间距工具 ===== */
.section {
  padding-block: var(--space-3xl);
}

.section-sm {
  padding-block: var(--space-xl);
}

.section-lg {
  padding-block: var(--space-2xl);
}

/* ===== 文字工具 ===== */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }

/* ===== 料号专用字体 ===== */
.part-number {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ===== 焦点样式 ===== */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ===== 减少动效 ===== */
@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;
  }
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-surface-raised);
  border-radius: 4px;
}

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