/* MEILI AI v5 · motion layer
   在 v4 产物之上叠加，不改任何栅格 / 文案 / 图片。
   只动 transform / opacity / filter；reduced-motion 下全部退化为静态。 */

:root {
  --v5-ease: cubic-bezier(.16, 1, .3, 1);
  --v5-fast: .45s;
}

/* ================================================================
   1. 首屏入场：按 <br> 分行，行遮罩上浮
   ================================================================ */
.v4-hero h1 .v5-line {
  display: block; overflow: hidden;
  padding-bottom: .08em; margin-bottom: -.08em;
}
.v4-hero h1 .v5-line__inner {
  display: block; transform: translateY(114%);
  animation: v5-hero-line 1.2s var(--v5-ease) both;
  will-change: transform;
}
@keyframes v5-hero-line {
  from { transform: translateY(114%); }
  to { transform: none; }
}

.v4-hero .v4-hero__aside,
.v4-hero .v4-hero__meta { animation: v5-hero-up 1s var(--v5-ease) both; }
.v4-hero .v4-hero__aside { animation-delay: .24s; }
.v4-hero .v4-hero__meta { animation-delay: .42s; }
@keyframes v5-hero-up {
  from { opacity: 0; transform: translateY(18px); }
}

/* 首屏颗粒 */
.v5-grain {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ================================================================
   2. 通用入场 → v5.21 双向
   进场慢上浮、退场快下沉：往下滚是流，往上滚是倒带。
   三个状态互斥，由 sections.js 挂：
     v5-wait 还没滚到（藏在下面，不播动画）
     v5-in   在活动区
     v5-out  已经滚过去
   ================================================================ */
html.js-motion:not(.reveal-all) [data-reveal] {
  opacity: 0; transform: translateY(28px); filter: none;
}
html.js-motion:not(.reveal-all) [data-reveal].v5-in {
  opacity: 1; transform: none;
  transition: opacity 1s var(--v5-ease), transform 1.1s var(--v5-ease);
  transition-delay: calc((var(--i, 0) * 0.62 + var(--v5-seg, 0)) * 55ms);
}
html.js-motion:not(.reveal-all) [data-reveal].v5-out {
  opacity: 0; transform: translateY(-16px); filter: none;
  transition: opacity .34s var(--v5-ease), transform .34s var(--v5-ease);
  transition-delay: 0s;
}

/* ================================================================
   3. 区块标题：行遮罩（JS 按实际换行拆分）
   ================================================================ */
.v5-split .v5-line {
  display: block; overflow: hidden;
  padding-bottom: .08em; margin-bottom: -.08em;
}
.v5-split .v5-line__inner {
  display: block; transform: translateY(110%);
  transition: transform 1.15s var(--v5-ease);
  will-change: transform;
}
.v5-split.in .v5-line__inner { transform: none; }

/* ================================================================
   4. 按钮：磁吸 + 扫光 + 箭头旋转
   ================================================================ */
.v5-magnetic { will-change: transform; }
.v4-btn-ghost.v5-magnetic { transition: transform .45s var(--v5-ease), color .3s, border-color .3s; }
.c-btn--solid,
.v4-btn-solid { position: relative; overflow: hidden; }
.c-btn--solid::after,
.v4-btn-solid::after {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 18%, rgba(255, 255, 255, .32) 50%, transparent 82%);
  transform: translateX(-120%);
  transition: transform .8s var(--v5-ease);
}
.c-btn--solid:hover::after,
.v4-btn-solid:hover::after { transform: translateX(120%); }
.v4-btn-solid::after {
  background: linear-gradient(100deg, transparent 18%, rgba(0, 150, 223, .20) 50%, transparent 82%);
}
.c-btn--solid > *,
.v4-btn-solid > * { position: relative; z-index: 1; }

.v4-nav__cta i,
.v4-btn-solid span[aria-hidden] { transition: transform .5s var(--v5-ease); }
.v4-nav__cta:hover i,
.v4-btn-solid:hover span[aria-hidden] { transform: rotate(-45deg); }

/* ================================================================
   5. 卡片：聚光 + 倾斜
   ================================================================ */
.v5-tilt {
  position: relative; isolation: isolate;
  transform-style: preserve-3d;
  transition: transform .5s var(--v5-ease);
  will-change: transform;
}
.v5-spot {
  position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  pointer-events: none; opacity: 0;
  transition: opacity .4s var(--v5-ease);
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
              rgba(56, 182, 242, .16), transparent 62%);
}
.v5-tilt:hover .v5-spot { opacity: 1; }

/* ================================================================
   6. 导航：滚动收缩成悬浮胶囊
   ================================================================ */
@media (min-width: 1024px) {
  .v4-nav__inner {
    max-width: 1440px; margin-inline: auto;
    border: 1px solid transparent; border-radius: var(--r-pill);
    transition: max-width .7s var(--v5-ease), transform .7s var(--v5-ease),
                background .7s var(--v5-ease), border-color .7s var(--v5-ease),
                box-shadow .7s var(--v5-ease);
  }
  .v4-nav.is-stuck {
    background: transparent;
    border-bottom-color: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .v4-nav.is-stuck .v4-nav__inner {
    max-width: 1240px;
    transform: translateY(6px);
    background: rgba(5, 7, 12, .94);
    border-color: var(--line-1);
    box-shadow: 0 20px 60px -24px rgba(0, 0, 0, .85);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ================================================================
   7. CTA：指针跟随的径向光 + 颗粒
   ================================================================ */
.h-cta { position: relative; isolation: isolate; }
.h-cta::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0; transition: opacity .6s var(--v5-ease);
  background: radial-gradient(620px circle at var(--gx, 72%) var(--gy, 28%),
              rgba(2, 139, 215, .20), transparent 60%);
}
.h-cta:hover::before { opacity: 1; }
.h-cta > .l-container { position: relative; z-index: 1; }

/* ================================================================
   8. 跑马灯悬停暂停
   ================================================================ */
@media (hover: hover) {
  .c-marquee:hover .c-marquee__track { animation-play-state: paused; }
}

/* ================================================================
   9. 尊重站点自己的"减少动效"开关（html 去掉 js-motion）
   ================================================================ */
html:not(.js-motion) .v5-line__inner,
html:not(.js-motion) .v5-magnetic,
html:not(.js-motion) .v5-tilt { transform: none !important; }
html:not(.js-motion) .v4-hero h1 .v5-line__inner { animation: none !important; }
html:not(.js-motion) .v5-tilt:hover .v5-spot { opacity: 0; }
html:not(.js-motion) .v4-hero__copy { transform: none !important; opacity: 1 !important; }
html:not(.js-motion) .v4-hero__aside,
html:not(.js-motion) .v4-hero__meta { animation: none !important; }
html:not(.js-motion) .h-cta::before { display: none; }

/* ================================================================
   10. reduced motion / 触屏兜底
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  .v5-line__inner { transform: none !important; animation: none !important; }
  .v4-hero .v4-hero__aside,
  .v4-hero .v4-hero__meta { animation: none !important; opacity: 1 !important; transform: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; }
  .v5-tilt, .v5-magnetic { transform: none !important; }
  .v4-nav__inner { transition: none !important; transform: none !important; }
}

/* ================================================================
   11. AIGC 区块头重排：chip 跟标题、note 全宽脚注、右侧只留导语
   ================================================================ */
.c-head--aigc { align-items: start; }
.c-head--aigc > div:first-child { display: grid; gap: var(--sp-3); align-content: start; }
.c-head--aigc .c-head__title { margin-top: 0; max-width: none; }
.c-head--aigc .c-head__aside { align-content: start; justify-self: start; max-width: none; }
.c-head--aigc .c-head__lead { max-width: none; }
.c-head--aigc .c-chips { margin-top: var(--sp-1); }
.c-head--aigc .c-note {
  grid-column: 1 / -1; margin-top: var(--sp-5); padding-top: var(--sp-3);
  border-top: 1px solid var(--line-1); max-width: none;
}
@media (min-width: 1024px) {
  .c-head--aigc { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--sp-5) var(--sp-7); }
  .c-head--aigc .c-head__aside { grid-column: 2; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .c-head--aigc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .c-head--aigc .c-head__aside { grid-column: 2; }
}
@media (max-width: 767px) {
  .c-head--aigc .c-head__aside { grid-column: auto; max-width: none; }
  .c-head--aigc .c-note { grid-column: auto; }
}

/* ================================================================
   12. 中文段落：只在标点处换行，避免「每一 / 步」被拆开
   ================================================================ */
.v5-flow {
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
  text-wrap: pretty;
}

/* ================================================================
   13. 行业卡片图标
   ================================================================ */
.h-ind__name { display: inline-flex; align-items: center; gap: 10px; }
.h-ind__icon { width: 20px; height: 20px; flex: none; color: var(--t-accent); opacity: .9; }
.h-ind__card:hover .h-ind__icon { opacity: 1; filter: drop-shadow(0 0 8px rgba(2, 139, 215, .4)); }
