/* ==========================================================================
   官网进阶滚动动效层（仅 transform / opacity / filter / clip-path）
   与现有布局、颜色、卡片结构完全解耦；移动端自动降级。
   ========================================================================== */
.scroll-progress {
    height: 2px !important;
    will-change: transform, width;
}

html.motion-pro .hero-line-inner .char,
html.motion-pro .section-title.motion-split .char {
    display: inline-block;
    will-change: transform, opacity, filter;
    backface-visibility: hidden;
}

html.motion-pro .motion-will-change {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* 自定义光标 */
#motion-cursor {
    position: fixed;
    left: 0;
    top: 0;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border-radius: 50%;
    z-index: 2147483000;
    pointer-events: none;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    opacity: 0;
    transform: translate3d(-100px,-100px,0);
    will-change: transform, opacity;
    background: rgba(0,47,167,.18);
    border: 1px solid rgba(0,47,167,.55);
    box-shadow: 0 0 0 4px rgba(0,47,167,.06), 0 8px 30px rgba(0,47,167,.18);
    transition: width .25s ease, height .25s ease, margin .25s ease, background .25s ease, border-color .25s ease, opacity .25s ease;
}
html.motion-cursor-ready #motion-cursor { display: flex; opacity: 1; }
html.motion-cursor-ready,
html.motion-cursor-ready body,
html.motion-cursor-ready a,
html.motion-cursor-ready button,
html.motion-cursor-ready .btn,
html.motion-cursor-ready summary { cursor: none !important; }
html.motion-cursor-ready input,
html.motion-cursor-ready textarea,
html.motion-cursor-ready select,
html.motion-cursor-ready [contenteditable="true"] { cursor: auto !important; }
#motion-cursor.is-view {
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    background: rgba(0,47,167,.92);
    border-color: rgba(255,255,255,.45);
    box-shadow: 0 0 0 5px rgba(0,47,167,.1), 0 18px 50px rgba(0,47,167,.3);
}

/* 服务卡：悬停由 JS transform，阴影预留 transition */
html.motion-pro .svc-card {
    transition: box-shadow .35s ease, border-color .35s ease;
    will-change: transform;
}
html.motion-pro .svc-card .svc-icon,
html.motion-pro .svc-card .svc-icon-img {
    transition: transform .35s cubic-bezier(.2,.7,.2,1);
    will-change: transform;
}

/* 案例：桌面端横向轨道（仅在 JS 启用时） */
html.motion-pro .home-cases.motion-case-horizontal {
    overflow: hidden;
}
html.motion-pro .home-cases.motion-case-horizontal .container {
    width: 100%;
    max-width: none;
    padding-inline: 32px;
}
html.motion-pro .home-cases.motion-case-horizontal .case-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: max-content;
    align-items: stretch;
    gap: 22px;
}
html.motion-pro .home-cases.motion-case-horizontal .case-card {
    flex: 0 0 clamp(300px, 32vw, 460px);
    width: auto;
    will-change: transform;
}

/* CTA 呼吸光 */
html.motion-pro .home-cta .btn-gradient.motion-cta-pulse {
    animation: motion-cta-breathe 3.4s ease-in-out infinite;
}
@keyframes motion-cta-breathe {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,211,238,.08), 0 18px 42px -20px rgba(0,47,167,.35); }
    50% { box-shadow: 0 0 0 9px rgba(34,211,238,.04), 0 25px 58px -18px rgba(0,47,167,.5); }
}

/* 新闻图片视差：只作用于内部图片，不改容器尺寸 */
html.motion-pro .news-feature-media,
html.motion-pro .news-mini-thumb,
html.motion-pro .case-media {
    overflow: hidden;
}
html.motion-pro .news-feature-media img,
html.motion-pro .news-mini-thumb img,
html.motion-pro .case-media img {
    will-change: transform;
    backface-visibility: hidden;
}

/* 手机端关闭光标、案例横向、卡片悬停 */
@media (max-width: 1024px) {
    #motion-cursor { display: none !important; }
    html.motion-cursor-ready, html.motion-cursor-ready body,
    html.motion-cursor-ready a, html.motion-cursor-ready button,
    html.motion-cursor-ready .btn, html.motion-cursor-ready summary { cursor: auto !important; }
}


/* 保留原有 #vr-spotlight 光球效果；不显示心形 VIEW 光标 */
#motion-cursor { display: none !important; }


/* 案例 3D 隧道遮罩（JS 动态添加） */
html.motion-pro .case-media { position: relative; }
html.motion-pro .motion-case-veil {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: block;
    pointer-events: none;
    background: rgba(0, 0, 0, .62);
    opacity: 0;
    will-change: opacity;
}
html.motion-pro .home-cases.motion-case-horizontal .case-card { cursor: grab; }
html.motion-pro .home-cases.motion-case-horizontal.is-dragging .case-card { cursor: grabbing; }

/* Three.js 粒子层：适配当前浅色官网，不覆盖文案 */
html.motion-pro .hero--home .hero-bg #heroParticles {
    display: block !important;
    z-index: 1 !important;
    opacity: .34 !important;
    mix-blend-mode: multiply !important;
    pointer-events: none;
}
@media (max-width: 1024px) {
    html.motion-pro .hero--home .hero-bg #heroParticles { display: none !important; }
    html.motion-pro .motion-case-veil { display: none; }
}


/* Three.js 粒子挂载在 #homeHero 上，绕开被浅色主题隐藏的 .hero-bg */
html.motion-pro #homeHero { position: relative; }
html.motion-pro #homeHero > #heroParticles {
    display: block !important;
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    opacity: .5;
    mix-blend-mode: normal;
    pointer-events: none;
}
html.motion-pro #homeHero > .hero-inner { position: relative; z-index: 2; }
@media (max-width: 1024px) {
    html.motion-pro #homeHero > #heroParticles { display: none !important; }
}


/* 原有径向光球：hover 可点击元素时扩大 */
#vr-spotlight { transition: opacity .45s ease, background .45s ease; }
body.spotlight-hover #vr-spotlight {
    background: radial-gradient(560px circle at var(--vr-mx, 50%) var(--vr-my, 40%), rgba(0, 47, 167, .12), transparent 64%) !important;
}


/* 全屏独立区块（仅桌面动效层加类，不改原 HTML） */
html.motion-pro .motion-screen {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
html.motion-pro .motion-screen > .container,
html.motion-pro .motion-screen > .hero-inner {
    width: 100%;
}
@media (max-width: 768px) {
    html.motion-pro .motion-screen { min-height: auto; }
}


/* 产品/案例卡 hover：只保留图片放大，卡片自身不位移 */
@media (hover: hover) and (pointer: fine) {
    html.motion-pro .p-card:hover,
    html.motion-pro .product-card:hover {
        transform: none !important;
        translate: none !important;
    }
    html.motion-pro .case-card:hover {
        /* 用 hover 瞬间的完整 transform 快照，保留当前 x/y/scale，绝不横向/纵向跳动 */
        transform: var(--motion-case-transform, none) !important;
        translate: none !important;
    }
}
