/* ==========================================================================
   华那科技官网 - 基础样式
   ========================================================================== */

/* CSS 变量 */
:root {
  /* 品牌色 */
  --color-primary: #E60000;
  --color-primary-dark: #B30000;
  --color-primary-light: #FF3333;

  --color-tech-blue: #0066CC;
  --color-tech-blue-dark: #003D7A;
  --color-tech-blue-light: #3385D6;

  /* 中性色 */
  --color-bg: #FFFFFF;
  --color-bg-soft: #F7F8FA;
  --color-bg-gray: #F0F2F5;
  --color-border: #E5E5E5;
  --color-border-light: #EEEEEE;

  --color-text: #1F2937;
  --color-text-secondary: #4B5563;
  --color-text-muted: #6B7280;
  --color-text-light: #9CA3AF;

  --color-footer-bg: #1A2332;
  --color-footer-text: #B8C2CC;
  --color-footer-heading: #FFFFFF;
  --color-footer-border: #2A3445;

  /* 状态色 */
  --color-success: #10B981;
  --color-warning: #F59E0B;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
               Helvetica, Arial, sans-serif;

  /* 字号 */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-md: 18px;
  --fs-lg: 20px;
  --fs-xl: 24px;
  --fs-2xl: 30px;
  --fs-3xl: 36px;
  --fs-4xl: 48px;

  /* 字重 */
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* 间距 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* 容器 */
  --container-max: 1440px;
  --container-padding: 24px;

  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);

  /* 过渡 */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* 层级 */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-header: 300;
  --z-modal: 400;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: 116px; /* 固定导航(80px) + 顶部条(36px)占位 */
}

img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary);
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* 排版 */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-bold);
  line-height: 1.3;
  color: var(--color-text);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

p {
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

/* 容器 */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* 通用工具类 */
.text-primary { color: var(--color-primary); }
.text-tech { color: var(--color-tech-blue); }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.text-white { color: #fff; }

.bg-soft { background-color: var(--color-bg-soft); }
.bg-gray { background-color: var(--color-bg-gray); }

.font-bold { font-weight: var(--fw-bold); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-medium { font-weight: var(--fw-medium); }

.section {
  padding: var(--space-20) 0;
}

.section-sm {
  padding: var(--space-12) 0;
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: 1;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(230, 0, 0, 0.3);
}

.btn-tech {
  background-color: var(--color-tech-blue);
  color: #fff;
}

.btn-tech:hover {
  background-color: var(--color-tech-blue-dark);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: #fff;
}

.btn-ghost {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
}

.btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--fs-base);
}

/* 区块标题 */
.section-title {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-title h2 {
  font-size: var(--fs-3xl);
  color: var(--color-text);
  margin-bottom: var(--space-3);
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 3px;
  background-color: var(--color-primary);
  border-radius: 2px;
}

.section-title .subtitle {
  color: var(--color-text-muted);
  font-size: var(--fs-md);
  margin-top: var(--space-6);
}

.section-title-left {
  text-align: left;
  margin-bottom: var(--space-10);
}

.section-title-left h2 {
  font-size: var(--fs-3xl);
  position: relative;
  padding-left: var(--space-4);
}

.section-title-left h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 28px;
  background-color: var(--color-primary);
  border-radius: 2px;
}

/* 通用栅格 */
.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); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.animate-fade-in { animation: fadeIn 0.6s ease forwards; }
.animate-fade-in-up { animation: fadeInUp 0.8s ease forwards; }
.animate-slide-in-left { animation: slideInLeft 0.6s ease forwards; }

/* 响应式 */
@media (max-width: 1199px) {
  :root {
    --fs-3xl: 30px;
    --fs-4xl: 40px;
  }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 991px) {
  .section { padding: var(--space-12) 0; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  :root {
    --fs-3xl: 24px;
    --fs-4xl: 28px;
    --fs-2xl: 22px;
    --container-padding: 16px;
  }

  .section { padding: var(--space-10) 0; }

  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5,
  .grid-6 { grid-template-columns: 1fr; }

  .section-title h2 { font-size: var(--fs-2xl); }
}
