/* =========================================================
   德灵生科 BIOHMG · 视觉焕新共享样式
   设计语言：生命科学绿（#1D9E75）+ 深绿墨色背景 + 网格/光斑装饰
   仅做视觉与交互增强，不影响现有 Tailwind CDN 工具类
   ========================================================= */

:root {
  --brand-50: #eefbf6;
  --brand-100: #d5f5e8;
  --brand-300: #6fd6b3;
  --brand-500: #1D9E75;
  --brand-600: #178a65;
  --brand-700: #137055;
  --brand-900: #0a2e22;
  --brand-950: #06231a;
}

html { scroll-behavior: smooth; }

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- 品牌渐变文字 ---------- */
.text-gradient {
  background: linear-gradient(120deg, #1D9E75 0%, #0ea5a0 55%, #178a65 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 深绿墨色品牌背景 ---------- */
.bg-brand-dark {
  background:
    radial-gradient(1100px 560px at 82% -12%, rgba(29, 158, 117, 0.28), transparent 60%),
    radial-gradient(900px 520px at -10% 110%, rgba(14, 165, 160, 0.16), transparent 55%),
    linear-gradient(135deg, #0a2e22 0%, #06231a 100%);
}

/* 页头用的深色背景（图片 + 深绿蒙版，比旧 slate-900 更协调） */
.hero-cover {
  background-color: #07261d;
  background-size: cover;
  background-position: center;
}
.hero-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px 400px at 70% -10%, rgba(29, 158, 117, 0.25), transparent 60%),
    linear-gradient(120deg, rgba(7, 38, 29, 0.92) 0%, rgba(8, 40, 50, 0.82) 55%, rgba(6, 35, 26, 0.92) 100%);
}

/* ---------- 网格纹理（深色区块） ---------- */
.bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* 浅色区块的细网格 */
.bg-grid-light {
  background-image:
    linear-gradient(rgba(13, 60, 40, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 60, 40, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ---------- 光斑装饰 ---------- */
.blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(72px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

/* ---------- 顶部通知条 ---------- */
.topbar a:hover { opacity: 1; }

/* ---------- 导航：滚动阴影 ---------- */
.site-header {
  transition: box-shadow .3s ease, background-color .3s ease, border-color .3s ease;
}
.site-header.scrolled {
  box-shadow: 0 10px 30px -12px rgba(2, 30, 20, 0.18);
  border-color: transparent;
}

/* 当前导航项指示条 */
.nav-link {
  position: relative;
  transition: color .25s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--brand-500);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width .28s ease;
}
.nav-link:hover::after,
.nav-link.active::after { width: 60%; }

/* ---------- 卡片悬浮 ---------- */
.card-hover {
  transition: transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s ease, border-color .4s ease;
  will-change: transform;
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 45px -18px rgba(13, 60, 40, 0.28);
  border-color: rgba(29, 158, 117, 0.35);
}

/* 图标容器渐变 */
.icon-box {
  background: linear-gradient(135deg, #1D9E75, #0ea5a0);
}

/* 品牌描边图标容器 */
.icon-soft {
  background: var(--brand-50);
  color: var(--brand-600);
}

/* 区块小标题（眉题） */
.eyebrow {
  letter-spacing: 0.18em;
}

/* 主按钮光泽 */
.btn-glow {
  box-shadow: 0 12px 30px -10px rgba(29, 158, 117, 0.55);
}
.btn-glow:hover {
  box-shadow: 0 16px 38px -10px rgba(29, 158, 117, 0.7);
}

/* 分隔波浪/斜切（如需） */
.section-divider {
  height: 60px;
  background: var(--brand-50);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

/* ---------- 滚动揭示动效 ---------- */
/* 内容默认始终可见；JS 加载后给轻微上浮入场，不滚动也不会出现大片空白 */
.reveal, .no-js .reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
}
.js .reveal {
  transform: translateY(26px);
}
.reveal.in, .js .reveal.in {
  transform: translateY(0);
}
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
.reveal.d5 { transition-delay: .40s; }

/* Hero 入场（首屏直接播放，不依赖滚动） */
.hero-rise {
  opacity: 0;
  transform: translateY(30px);
  animation: heroRise 1s cubic-bezier(.2, .7, .2, 1) forwards;
}
.hero-rise.d1 { animation-delay: .12s; }
.hero-rise.d2 { animation-delay: .24s; }
.hero-rise.d3 { animation-delay: .36s; }
.hero-rise.d4 { animation-delay: .48s; }
@keyframes heroRise {
  to { opacity: 1; transform: none; }
}

/* 数字/统计滚动块 */
.stat-num { font-variant-numeric: tabular-nums; }

/* ---------- 回到顶部 ---------- */
#to-top {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, background-color .3s ease;
}
#to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* 平滑锚点时的 header 偏移 */
:target { scroll-margin-top: 96px; }

/* ---------- 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .js .reveal, .hero-rise { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; }
  .card-hover:hover { transform: none; }
}

/* ---------- 产品网格骨架（products.html 由 JS 填充时复用） ---------- */
.product-card {
  background: #fff;
  border: 1px solid #eef2f0;
  border-radius: 16px;
  overflow: hidden;
  transition: transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s ease, border-color .4s ease;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 45px -18px rgba(13, 60, 40, .28);
  border-color: rgba(29, 158, 117, .35);
}
