/* ============================================
   千企汇官网 · 全局动效系统
   ============================================ */

/* --- 滚动触发动画（基础类） --- */
.fade-in,
.fade-up,
.fade-down,
.fade-left,
.fade-right,
.zoom-in,
.slide-up {
    opacity: 0;
    transition: opacity .6s cubic-bezier(.22,1,.36,1),
                transform .6s cubic-bezier(.22,1,.36,1);
}
.fade-up    { transform: translateY(40px); }
.fade-down  { transform: translateY(-40px); }
.fade-left  { transform: translateX(-40px); }
.fade-right { transform: translateX(40px); }
.zoom-in    { transform: scale(.92); }
.slide-up   { transform: translateY(60px); }

/* 可见状态 */
.fade-in.visible,
.fade-up.visible,
.fade-down.visible,
.fade-left.visible,
.fade-right.visible,
.zoom-in.visible,
.slide-up.visible {
    opacity: 1;
    transform: none;
}

/* 交错延迟（给子元素用） */
.stagger > .visible:nth-child(1) { transition-delay: .00s; }
.stagger > .visible:nth-child(2) { transition-delay: .10s; }
.stagger > .visible:nth-child(3) { transition-delay: .20s; }
.stagger > .visible:nth-child(4) { transition-delay: .30s; }
.stagger > .visible:nth-child(5) { transition-delay: .40s; }
.stagger > .visible:nth-child(6) { transition-delay: .50s; }

/* --- 数字滚动（计数器） --- */
.counter-wrap {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}
.counter {
    display: inline-block;
    transition: transform .3s;
}

/* --- 卡片悬浮动效 --- */
.card-hover-lift {
    transition: transform .35s cubic-bezier(.22,1,.36,1),
                box-shadow .35s cubic-bezier(.22,1,.36,1);
}
.card-hover-lift:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 18px 50px rgba(0,0,0,.12) !important;
}

/* --- 按钮脉冲 --- */
@keyframes btn-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(79,70,229,.4); }
    50%      { box-shadow: 0 0 0 10px rgba(79,70,229,0); }
}
.btn-pulse:hover {
    animation: btn-pulse 1.2s infinite;
}

/* --- Hero 背景粒子/光晕 --- */
.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.hero-particles .particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    animation: particle-float linear infinite;
}
@keyframes particle-float {
    0%   { transform: translateY(0) scale(1);   opacity: .6; }
    50%  { transform: translateY(-80px) scale(1.15); opacity: 1; }
    100% { transform: translateY(0) scale(1);   opacity: .6; }
}

/* --- 打字机光标闪烁 --- */
@keyframes blink {
    0%,100% { border-right-color: var(--blue,#4F46E5); }
    50%      { border-right-color: transparent; }
}
.typewriter {
    border-right: 2px solid var(--blue,#4F46E5);
    animation: blink .7s step-end infinite;
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
}

/* --- 进度条（页面顶部） --- */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg,var(--blue,#4F46E5),var(--cyan,#06B6D4));
    z-index: 9999;
    width: 0%;
    transition: width .15s linear;
    pointer-events: none;
}

/* --- 返回顶部按钮 --- */
#back-to-top {
    position: fixed;
    bottom: 32px; right: 32px;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--blue,#4F46E5);
    color: #fff;
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .35s, transform .35s, background .25s;
    z-index: 9000;
    box-shadow: 0 4px 18px rgba(79,70,229,.35);
    border: none;
}
#back-to-top.show {
    opacity: 1;
    transform: translateY(0);
}
#back-to-top:hover {
    background: var(--blue-dark,#4338CA);
}

/* --- 导航栏滚动收缩 --- */
.header-scrolled {
    box-shadow: 0 2px 24px rgba(0,0,0,.08) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}

/* --- 图片懒加载淡入 --- */
.img-lazy {
    opacity: 0;
    transition: opacity .6s;
}
.img-lazy.loaded {
    opacity: 1;
}

/* --- 技能条动画 --- */
@keyframes skill-fill {
    from { width: 0; }
}
.skill-bar .skill-fill {
    animation: skill-fill 1.4s cubic-bezier(.22,1,.36,1) forwards;
}

/* --- 装饰转盘 --- */
@keyframes spin-slow {
    from { transform: rotate(0deg);   }
    to   { transform: rotate(360deg); }
}
.spin-slow {
    animation: spin-slow 30s linear infinite;
}

/* --- 响应式 --- */
@media (max-width:768px) {
    #back-to-top { bottom:20px; right:20px; width:40px; height:40px; font-size:17px; }
    .fade-up    { transform: translateY(24px); }
    .fade-left,
    .fade-right { transform: translateY(20px); }
}
