/*
 * 上海安弗真空技术有限公司 — 基础样式 (Base CSS)
 * 包含：CSS 变量、重置样式、排版基础、通用工具类
 * 版本: 2.0
 */

/* ===================== CSS 自定义属性 ===================== */
:root {
  /* 主色系 */
  --primary: #0099CC;
  --primary-dark: #007aa3;
  --primary-light: #e6f5fa;
  --primary-rgb: 0, 153, 204;

  /* 强调色 */
  --accent: #16b4b9;
  --accent-dark: #11989c;
  --accent-light: #d4f5f6;

  /* 中性色 */
  --text-dark: #1a1a2e;
  --text-body: #333333;
  --text-gray: #6b7280;
  --text-light: #9ca3af;
  --text-white: #ffffff;

  /* 背景色 */
  --bg-white: #ffffff;
  --bg-light: #f5f6fa;
  --bg-gray: #f0f1f5;
  --bg-dark: #1a1a2e;

  /* 边框 */
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.12);

  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 50%;

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* 字体 */
  --font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  --font-heading: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;

  /* 字号体系 */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  --text-4xl: 36px;
  --text-5xl: 48px;

  /* 行高 */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

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

  /* 容器宽度 */
  --container-max: 1280px;
  --container-padding: 5%;
}

/* ===================== 重置样式 ===================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-body);
  background-color: var(--bg-white);
  min-width: 320px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

nav + .hero-slider {
  margin-top: 0;
}

/* ===================== 排版 ===================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text-dark);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-md);
  color: var(--text-body);
}

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

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

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  border: 0;
}

ul, ol {
  list-style: none;
}

em {
  font-style: normal;
}

strong {
  font-weight: 600;
}

/* ===================== 表单重置 ===================== */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

input[type="button"],
input[type="submit"],
input[type="reset"] {
  -webkit-appearance: none;
}

textarea {
  -webkit-appearance: none;
  resize: vertical;
}

input {
  border-radius: 0;
}

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

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

::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #9ca3af;
}

/* ===================== 通用工具类 ===================== */
.container {
  width: 90%;
  max-width: var(--container-max);
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* 清除浮动 */
.clearfix::after {
  content: '';
  display: block;
  height: 0;
  clear: both;
}

.clearfix {
  zoom: 1;
}

/* 单行省略 */
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 换行 */
.wordwrap {
  word-break: break-all;
  word-wrap: break-word;
}

/* 点击高亮 */
*, a, button, input {
  -webkit-tap-highlight-color: rgba(255, 0, 0, 0);
}

/* ===================== 通用动画 ===================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

/* 滚动渐入（Intersection Observer 触发） */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* 交错动画延迟 */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Shimmer 加载效果 */
.shimmer {
  background: rgba(255,255,255,0.2);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* 悬浮动画 */
.float-anim {
  animation: float 3s ease-in-out infinite;
}

/* 脉冲动画 */
.pulse-anim {
  animation: pulse 2s ease-in-out infinite;
}

/* 渐变背景动画 */
.gradient-bg {
  background: var(--primary);
  background-size: 400% 400%;
}