/* ==========================================================
   海望智联 — 全站共享样式
   主样式由 Tailwind CSS (CDN) 提供，本文件负责补充：
   1. 平滑滚动 & sticky header 偏移
   2. 滚动渐显动画
   3. 面包屑 & 文本工具类
   4. 自定义滚动条
   ========================================================== */

html {
  scroll-padding-top: 90px;
  scroll-behavior: smooth;
}

body { text-rendering: optimizeLegibility; }

/* ---------- 滚动渐显动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }

/* ---------- 尊重用户的动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* ---------- 文本截断 ---------- */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 当前激活的导航项（基于 data-nav 属性匹配） ---------- */
.nav-link[data-active="true"] {
  color: #1f5ae0;
  background-color: #eef6ff;
}

/* ---------- 内页通用：页头 hero ---------- */
.page-hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 50px;
  background: linear-gradient(to bottom, transparent, #fff);
  pointer-events: none;
}

/* ---------- 渐变文字 ---------- */
.text-gradient {
  background: linear-gradient(135deg, #599fff 0%, #1845b4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 锚点定位偏移（带 sticky header） ---------- */
[id] { scroll-margin-top: 96px; }

/* ---------- 自定义滚动条（桌面） ---------- */
@media (min-width: 1024px) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: #f1f5f9; }
  ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; border: 2px solid #f1f5f9; }
  ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
}

/* ---------- 卡片悬浮光线 ---------- */
.card-glow { position: relative; }
.card-glow::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(94,159,255,.5), transparent 40%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s;
}
.card-glow:hover::before { opacity: 1; }

/* 保持明亮主题 */
html { color-scheme: light; }
