/* ==========================================================================
   base.css — 博汇数创设计系统
   变量 / 重置 / 排版 / 栅格 / 动画工具类
   ========================================================================== */

/* ---------- 1. 设计令牌（CSS 变量） ---------- */
:root {
  /* 背景层（浅色科技风） */
  --bg-base: #FFFFFF;
  --bg-soft: #F4F8FF;      /* 板块浅蓝底 */
  --bg-card: #FFFFFF;
  --bg-float: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-input: #F6F9FE;

  /* 主渐变（蓝色强调，参考浅色科技风） */
  --grad-primary: linear-gradient(135deg, #165DFF 0%, #3B8EFF 100%);
  --grad-primary-hover: linear-gradient(135deg, #0A50F0 0%, #2C7DF5 100%);
  --grad-cyan: linear-gradient(135deg, #06B6D4 0%, #3B8EFF 100%);
  --grad-text: linear-gradient(135deg, #165DFF 0%, #4F8FFF 55%, #06B6D4 100%);

  /* 强调色 */
  --c-blue: #165DFF;
  --c-purple: #6D5CFF;
  --c-cyan: #0891B2;
  --c-cyan-2: #06B6D4;

  /* 文字 */
  --t-primary: #0F1F3D;
  --t-secondary: #475569;
  --t-muted: #8A98AD;
  --t-soft: #1E293B;

  /* 边框/描边 */
  --border-soft: rgba(15, 31, 61, 0.09);
  --border-mid: rgba(22, 93, 255, 0.22);
  --border-strong: rgba(22, 93, 255, 0.4);

  /* 阴影 */
  --shadow-card: 0 10px 30px rgba(22, 93, 255, 0.08);
  --shadow-glow: 0 14px 40px rgba(22, 93, 255, 0.18);
  --shadow-glow-purple: 0 16px 44px rgba(109, 92, 255, 0.22);

  /* 间距（8px 栅格） */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 40px;
  --sp-6: 48px;
  --sp-8: 64px;
  --sp-12: 96px;

  /* 容器 */
  --container: 1280px;

  /* 圆角 */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;

  /* 过渡 */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.5s;

  /* 导航高度 */
  --nav-h: 72px;

  /* 按钮高度 */
  --btn-h-sm: 32px;   /* 紧凑：分类筛选、小标签按钮 */
  --btn-h-md: 44px;   /* 默认：导航/正文 CTA */
  --btn-h-lg: 56px;   /* 大：CTA 横幅、抽屉主操作 */

  /* 图标按钮尺寸（不含文字） */
  --icon-btn: 40px;

  /* 按钮内边距（横向） */
  --btn-pad-x-sm: 14px;
  --btn-pad-x-md: 24px;
  --btn-pad-x-lg: 32px;

  /* 按钮字号 */
  --btn-font-sm: 13px;
  --btn-font-md: 15px;
  --btn-font-lg: 16px;
}

/* ---------- 2. 重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--t-secondary);
  font-size: 17px;
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 锚点跳转避让固定导航 */
[id] {
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

/* 全局细线网格（浅色） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(22, 93, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 93, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
}

/* 柔和径向光晕（浅蓝紫） */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(620px circle at 12% 8%, rgba(22, 93, 255, 0.10), transparent 45%),
    radial-gradient(720px circle at 88% 14%, rgba(109, 92, 255, 0.09), transparent 45%),
    radial-gradient(520px circle at 50% 96%, rgba(6, 182, 212, 0.06), transparent 45%);
  pointer-events: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* ---------- 3. 排版 ---------- */
h1,
h2,
h3,
h4 {
  color: var(--t-primary);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0;
}

h1 { font-size: clamp(38px, 5.4vw, 56px); }
h2 { font-size: clamp(28px, 3.8vw, 42px); }
h3 { font-size: clamp(22px, 2.6vw, 32px); font-weight: 600; }
h4 { font-size: 24px; font-weight: 600; }

p { color: var(--t-secondary); }

.text-gradient {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.text-muted { color: var(--t-muted); }
.text-cyan { color: var(--c-cyan); }

/* ---------- 4. 栅格 / 容器 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: var(--sp-12);
  position: relative;
}

.section-sm { padding-block: var(--sp-8); }

.grid { display: grid; gap: var(--sp-3); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }

/* 区块标题 */
.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--sp-6);
}

.section-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-cyan);
  font-weight: 600;
  margin-bottom: var(--sp-2);
  padding: 7px 16px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-pill);
  background: rgba(22, 93, 255, 0.06);
}

.section-head p {
  margin-top: var(--sp-2);
  font-size: 19px;
  color: var(--t-secondary);
}

/* ---------- 5. 动画工具类 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

@keyframes float-up-down {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes data-flow {
  0% { transform: translateY(100%); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(-100%); opacity: 0; }
}

@keyframes border-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

/* ---------- 6. 辅助类 ---------- */
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.text-center { text-align: center; }
.hidden { display: none !important; }
.bg-soft { background: var(--bg-soft); }
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-mid), transparent);
  border: 0;
  margin-block: var(--sp-6);
}

/* ---------- 7. 响应式断点 ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --nav-h: 60px;
    --btn-h-md: 36px;
    --btn-h-lg: 48px;
    --btn-h-sm: 28px;
    --icon-btn: 36px;
    --btn-font-md: 14px;
    --btn-font-lg: 15px;
  }
  .section { padding-block: var(--sp-8); }
  .section-sm { padding-block: var(--sp-6); }
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
  .container { padding-inline: 20px; }
  h1 { font-size: clamp(32px, 8.5vw, 42px); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
