/* 无界指纹浏览器 · 动效层 v1 —— 参考现代 SaaS 官网的入场与微交互 */
html { scroll-behavior: smooth; scroll-padding-top: 96px; }

/* 1. 滚动渐入 */
.reveal {
  opacity: 0;
  transform: translate3d(0, 64px, 0) scale(0.992);
  transform-origin: 50% 0;
  backface-visibility: hidden;
  transition: opacity 920ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 1080ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }

/* 2. Hero 分层入场与光斑漂移 */
@keyframes unbFadeUp { from { opacity: 0; transform: translate3d(0, 28px, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes unbFadeInRight { from { opacity: 0; transform: translate3d(36px, 22px, 0) scale(0.97); } to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } }
@keyframes unbFloat { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, -11px, 0); } }
@keyframes unbDrift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(28px, -22px, 0) scale(1.06); } }
@keyframes unbGradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.hero-badge, .hero-title, .hero-sub, .hero-actions, .hero-meta, .hero-metrics {
  animation: unbFadeUp 0.86s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-badge { animation-delay: 0.04s; }
.hero-title { animation-delay: 0.12s; }
.hero-sub { animation-delay: 0.2s; }
.hero-actions { animation-delay: 0.28s; }
.hero-meta { animation-delay: 0.34s; }
.hero-metrics { animation-delay: 0.4s; }
.hero-visual { animation: unbFadeInRight 1.05s cubic-bezier(0.16, 1, 0.3, 1) 0.18s both; }

.float-card { animation: unbFloat 4.6s ease-in-out infinite alternate; }
.float-card--b { animation-duration: 5.4s; animation-delay: 0.6s; }
.float-card--c { animation-duration: 6.2s; animation-delay: 1.1s; }

.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px);
  pointer-events: none; z-index: 0;
}
.hero::before {
  width: 520px; height: 520px; top: -120px; right: -60px;
  background: rgba(45, 90, 255, 0.16);
  animation: unbDrift 16s ease-in-out infinite alternate;
}
.hero::after {
  width: 420px; height: 420px; bottom: -160px; left: -80px;
  background: rgba(124, 92, 255, 0.12);
  animation: unbDrift 20s ease-in-out infinite alternate-reverse;
}
.hero .container { position: relative; z-index: 1; }

.hero-title .grad, .metrics-grid strong {
  background-size: 200% 200%;
  animation: unbGradientShift 9s ease infinite;
}

/* 3. 按钮与卡片微交互 */
.btn {
  position: relative; overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease,
    background 0.25s ease, border-color 0.25s ease;
}
.btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, rgba(255,255,255,0) 20%, rgba(255,255,255,0.32) 45%, rgba(255,255,255,0) 70%);
  transform: translateX(-130%); transition: transform 0.6s ease; pointer-events: none;
}
.btn:hover::after { transform: translateX(130%); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(45, 90, 255, 0.34); }
.btn-ghost:hover { transform: translateY(-2px); }

.risk-card, .bento-card, .scene-card, .resource-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}
.risk-card:hover, .scene-card:hover, .resource-card:hover {
  transform: translateY(-6px); border-color: #d3ddf5;
}
.bento-icon, .risk-icon {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
}
.bento-card:hover .bento-icon, .risk-card:hover .risk-icon {
  transform: translateY(-3px) scale(1.06) rotate(-3deg);
}
.module-chip {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease,
    color 0.3s ease, box-shadow 0.3s ease;
}
.module-chip:hover { box-shadow: 0 12px 26px rgba(45, 90, 255, 0.12); }
.metrics-band { background-size: 200% 200%; animation: unbGradientShift 14s ease infinite; }

/* 4. FAQ 展开 */
@keyframes unbFaqIn { from { opacity: 0; transform: translate3d(0, -6px, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
.faq-item[open] .faq-body, .manual-hero .eyebrow, .manual-hero .manual-title, .manual-hero .manual-sub, .manual-hero .manual-meta, .manual-content > .manual-section { animation: unbFaqIn 0.32s ease both; }
.faq-item { transition: border-color 0.25s ease, box-shadow 0.25s ease; }
.faq-item:hover { border-color: #cfdbf7; box-shadow: 0 10px 26px rgba(17, 38, 74, 0.07); }

/* 5. 导航与页脚 */
.nav-brand img.nav-logo { transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.nav-brand:hover img.nav-logo { transform: rotate(-4deg) scale(1.06); }
.site-footer .footer-col a { transition: color 0.2s ease, transform 0.2s ease; display: inline-block; }
.site-footer .footer-col a:hover { transform: translateX(2px); }

/* 7. 内页（条款 / 手册）头部入场 */
.manual-hero .eyebrow,
.manual-hero .manual-title,
.manual-hero .manual-sub,
.manual-hero .manual-meta {
  animation: unbFadeUp 0.86s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.manual-hero .eyebrow { animation-delay: 0.04s; }
.manual-hero .manual-title { animation-delay: 0.12s; }
.manual-hero .manual-sub { animation-delay: 0.2s; }
.manual-hero .manual-meta { animation-delay: 0.28s; }

.manual-content > .manual-section { animation: unbFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both; }
.manual-content > .manual-section:nth-child(2) { animation-delay: 0.06s; }
.manual-content > .manual-section:nth-child(3) { animation-delay: 0.12s; }
.manual-content > .manual-section:nth-child(4) { animation-delay: 0.18s; }
.manual-content > .manual-section:nth-child(5) { animation-delay: 0.24s; }

/* 6. 尊重减弱动效偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.visible, .hero-badge, .hero-title, .hero-sub, .hero-actions,
  .hero-meta, .hero-metrics, .hero-visual, .float-card, .hero::before, .hero::after,
  .hero-title .grad, .metrics-grid strong, .metrics-band, .faq-item[open] .faq-body, .manual-hero .eyebrow, .manual-hero .manual-title, .manual-hero .manual-sub, .manual-hero .manual-meta, .manual-content > .manual-section {
    animation: none !important; transition: none !important;
    opacity: 1 !important; transform: none !important;
  }
  .btn::after { display: none; }
}
