/* ==========================================================================
   global.css — 全局样式：CSS变量 + Reset + 排版 + 工具类 + 动画关键帧
   青岛青云之志科技有限公司官网
   ========================================================================== */

/* === 9.1 CSS 变量清单 === */
:root {
  /* === 色彩 === */
  --color-primary: #0A5CFF;
  --color-secondary: #00D4FF;
  --color-bg-dark: #0A1628;
  --color-bg-light: #F5F7FA;
  --color-white: #FFFFFF;
  --color-text-dark: #1A1A2E;
  --color-text-light: #6B7280;
  --color-error: #EF4444;
  --color-success: #10B981;
  --gradient-primary: linear-gradient(135deg, #0A5CFF, #00D4FF);
  --gradient-dark: linear-gradient(135deg, #0A1628, #0A5CFF);

  /* === 字体 === */
  --font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-family-number: "DIN Alternate", "PingFang SC", "Helvetica Neue", sans-serif;

  /* === 字号 === */
  --fs-banner-title: 48px;
  --fs-page-title: 36px;
  --fs-card-title: 20px;
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-data-number: 48px;

  /* === 间距（8px基数） === */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;

  /* === 圆角 === */
  --radius-card: 12px;
  --radius-button: 8px;
  --radius-input: 8px;

  /* === 阴影 === */
  --shadow-card: 0 4px 20px rgba(10, 92, 255, 0.08);
  --shadow-card-hover: 0 8px 30px rgba(10, 92, 255, 0.15);

  /* === 布局 === */
  --container-max-width: 1200px;
  --navbar-height: 64px;

  /* === 过渡 === */
  --transition-base: 0.3s ease;
}

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

html {
  font-size: var(--fs-body);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--color-text-dark);
  background-color: var(--color-white);
  overflow-x: hidden;
}

/* === 基础排版 === */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-dark);
}

h1 {
  font-size: var(--fs-page-title);
}

h2 {
  font-size: var(--fs-page-title);
}

h3 {
  font-size: var(--fs-card-title);
}

p {
  margin-bottom: var(--space-sm);
  color: var(--color-text-dark);
}

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

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

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

ul, ol {
  list-style: none;
}

/* === 布局容器 === */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
  width: 100%;
}

/* === 响应式栅格工具类 === */
.grid {
  display: grid;
  gap: var(--space-md);
}

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

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

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

/* === 文本工具类 === */
.u-text-center {
  text-align: center;
}

.u-text-left {
  text-align: left;
}

.u-text-right {
  text-align: right;
}

.u-text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.u-text-white {
  color: var(--color-white) !important;
}

.u-text-light {
  color: var(--color-text-light);
}

.u-text-primary {
  color: var(--color-primary);
}

/* === 间距工具类 === */
.u-mt-xs { margin-top: var(--space-xs); }
.u-mt-sm { margin-top: var(--space-sm); }
.u-mt-md { margin-top: var(--space-md); }
.u-mt-lg { margin-top: var(--space-lg); }
.u-mt-xl { margin-top: var(--space-xl); }
.u-mt-2xl { margin-top: var(--space-2xl); }

.u-mb-xs { margin-bottom: var(--space-xs); }
.u-mb-sm { margin-bottom: var(--space-sm); }
.u-mb-md { margin-bottom: var(--space-md); }
.u-mb-lg { margin-bottom: var(--space-lg); }
.u-mb-xl { margin-bottom: var(--space-xl); }
.u-mb-2xl { margin-bottom: var(--space-2xl); }

.u-pt-xl { padding-top: var(--space-xl); }
.u-pb-xl { padding-bottom: var(--space-xl); }
.u-pt-2xl { padding-top: var(--space-2xl); }
.u-pb-2xl { padding-bottom: var(--space-2xl); }

/* === 区块工具类 === */
.section {
  padding: var(--space-2xl) 0;
}

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

.section--dark {
  background-color: var(--color-bg-dark);
  color: var(--color-white);
}

.section--dark h2,
.section--dark h3 {
  color: var(--color-white);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section__title {
  font-size: var(--fs-page-title);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.section__subtitle {
  font-size: var(--fs-body);
  color: var(--color-text-light);
  max-width: 700px;
  margin: 0 auto;
}

.section--dark .section__subtitle {
  color: rgba(255, 255, 255, 0.7);
}

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

@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 floating {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-30px) translateX(15px);
    opacity: 0.8;
  }
}

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

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

/* === 入场动画类 === */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-animated {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll--left {
  transform: translateX(-40px);
}

.animate-on-scroll--left.is-animated {
  transform: translateX(0);
}

.animate-on-scroll--right {
  transform: translateX(40px);
}

.animate-on-scroll--right.is-animated {
  transform: translateX(0);
}

/* === 响应式断点 === */
/* 平板: 768px - 1023px */
@media (max-width: 1023px) {
  :root {
    --fs-banner-title: 40px;
    --fs-page-title: 32px;
    --fs-data-number: 40px;
  }

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

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

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

/* 移动端: < 768px */
@media (max-width: 767px) {
  :root {
    --fs-banner-title: 32px;
    --fs-page-title: 28px;
    --fs-data-number: 36px;
    --fs-card-title: 18px;
  }

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

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

  .container {
    padding: 0 var(--space-sm);
  }

  .section__title {
    font-size: var(--fs-page-title);
  }
}
