/* ================================================
   khot.cn - Enhanced v2 Animations & Interactions
   Added: 2026-06-17
   ================================================ */

/* === 1. 页面渐入动画 === */
.page-fade-in {
    animation: pageFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === 2. 高级滚动渐入 (推移变体) === */
.reveal-slide-up {
    opacity: 0; transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-slide-up.revealed { opacity: 1; transform: translateY(0); }

.reveal-slide-left {
    opacity: 0; transform: translateX(-40px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-slide-left.revealed { opacity: 1; transform: translateX(0); }

.reveal-slide-right {
    opacity: 0; transform: translateX(40px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-slide-right.revealed { opacity: 1; transform: translateX(0); }

.reveal-scale {
    opacity: 0; transform: scale(0.92);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-scale.revealed { opacity: 1; transform: scale(1); }

/* === 3. 3D卡片悬停倾效 === */
.card-tilt {
    perspective: 1000px;
}
.card-tilt-inner {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}
.card-tilt:hover .card-tilt-inner {
    transform: rotateY(3deg) rotateX(-3deg);
}

/* === 4. 渐变文字动画 === */
.gradient-text {
    background: linear-gradient(135deg, #1890ff, #40a9ff, #7c3aed, #1890ff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}
@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* === 5. 呼吸光晕 (CTA按钮) === */
.glow-pulse {
    position: relative;
}
.glow-pulse::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    background: linear-gradient(135deg, #1890ff, #40a9ff);
    opacity: 0;
    z-index: -1;
    animation: glowPulse 2s ease-in-out infinite;
    transition: opacity 0.3s;
}
.glow-pulse:hover::after { opacity: 0.5; }
@keyframes glowPulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50%      { transform: scale(1.05); opacity: 0.6; }
}

/* === 6. 毛玻璃效果 (Glassmorphism) === */
.glass-card {
    background: rgba(26, 35, 50, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}
.glass-card-light {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
}

/* === 7. 浮动上下的元素 === */
.float-up-down {
    animation: floatUpDown 3s ease-in-out infinite;
}
@keyframes floatUpDown {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

/* === 8. 渐变边框动画 (高级版) === */
.gradient-border {
    position: relative;
    isolation: isolate;
    border-radius: 12px;
    background: #1a2332;
}
.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(90deg, #1890ff, #7c3aed, #06b6d4, #1890ff);
    background-size: 300% 100%;
    z-index: -1;
    animation: gradientBorderMove 4s linear infinite;
}
@keyframes gradientBorderMove {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* === 9. 网格交错渐入 === */
.stagger-fade-in > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger-fade-in.revealed > *:nth-child(1) { transition-delay: 0s; }
.stagger-fade-in.revealed > *:nth-child(2) { transition-delay: 0.08s; }
.stagger-fade-in.revealed > *:nth-child(3) { transition-delay: 0.16s; }
.stagger-fade-in.revealed > *:nth-child(4) { transition-delay: 0.24s; }
.stagger-fade-in.revealed > *:nth-child(5) { transition-delay: 0.32s; }
.stagger-fade-in.revealed > *:nth-child(6) { transition-delay: 0.40s; }
.stagger-fade-in.revealed > *:nth-child(7) { transition-delay: 0.48s; }
.stagger-fade-in.revealed > *:nth-child(8) { transition-delay: 0.56s; }
.stagger-fade-in.revealed > * { opacity: 1; transform: translateY(0); }

/* === 10. 动态数字滚动动画 (Count-up) === */
.count-up-visible .count-up-anim {
    display: inline-block;
    animation: countPop 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes countPop {
    0%   { transform: scale(0.5); opacity: 0; }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* === 11. 加载骨架屏闪烁 === */
.shimmer {
    background: linear-gradient(90deg, #1a2332 25%, #2a3545 50%, #1a2332 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === 12. 平滑滚动条增强 === */
html {
    scroll-behavior: smooth;
}

/* === 13. 图片放大悬停效果 === */
.img-zoom-hover {
    overflow: hidden;
    border-radius: 12px;
}
.img-zoom-hover img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.img-zoom-hover:hover img {
    transform: scale(1.08);
}

/* === 14. 卡片抬起效果 (更精致的悬停) === */
.card-lift {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px -8px rgba(24, 144, 255, 0.2);
}

/* === 15. 霓虹文字效果 === */
.neon-text {
    text-shadow: 0 0 7px rgba(24, 144, 255, 0.6),
                 0 0 20px rgba(24, 144, 255, 0.4),
                 0 0 40px rgba(24, 144, 255, 0.2);
}

/* === 16. 分隔线动画 === */
.divider-animated {
    height: 2px;
    background: linear-gradient(90deg, transparent, #1890ff, transparent);
    border: none;
    margin: 24px 0;
    animation: dividerSlide 3s ease-in-out infinite;
}
@keyframes dividerSlide {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* === 17. 脉动圆点 (在线状态) === */
.dot-pulse {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #52c41a;
    animation: dotPulse 1.5s ease-in-out infinite;
}
@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(82, 196, 26, 0.5); }
    50%      { box-shadow: 0 0 0 6px rgba(82, 196, 26, 0); }
}

/* === 18. 波纹按钮 (补充) === */
.ripple-btn {
    position: relative;
    overflow: hidden;
}
.ripple-btn::after {
    content: '';
    position: absolute;
    top: var(--ripple-y, 50%);
    left: var(--ripple-x, 50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease-out, height 0.6s ease-out, opacity 0.6s ease-out;
    opacity: 0;
    pointer-events: none;
}
.ripple-btn:active::after {
    width: 300px;
    height: 300px;
    opacity: 1;
}

/* === 19. 移动端底部导航栏 (增强) === */
@media (max-width: 768px) {
    .float-consult {
        right: 12px;
        bottom: 80px;
    }
    .mobile-nav--open .mobile-nav-panel {
        transform: translateX(0);
    }
    .mobile-nav-panel {
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* === 20. 无障碍 - 跳转链接 === */
.skip-link {
    position: fixed;
    top: -100%;
    left: 16px;
    padding: 8px 16px;
    background: #1890ff;
    color: #fff;
    z-index: 100000;
    border-radius: 0 0 8px 8px;
    font-size: 14px;
    transition: top 0.3s;
}
.skip-link:focus {
    top: 0;
}

/* === 21. 数字跳动入场 === */
.num-roll {
    display: inline-block;
    animation: numRoll 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes numRoll {
    0%   { transform: translateY(20px) rotateX(90deg); opacity: 0; }
    100% { transform: translateY(0) rotateX(0); opacity: 1; }
}

/* === 22. Toast 通知样式 (防止遗漏) === */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: #1a2332;
    border: 1px solid #2a3545;
    color: #e8edf3;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 360px;
}
.toast.show {
    transform: translateX(0);
}
.toast-success { border-left: 3px solid #52c41a; }
.toast-info    { border-left: 3px solid #1890ff; }
.toast-warning { border-left: 3px solid #faad14; }

/* === 23. 鼠标跟随视差光效 === */
.mouse-parallax {
    transition: transform 0.3s ease-out;
}

/* === 24. 页脚回到底部动画 === */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1890ff, #096dd9);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(24, 144, 255, 0.3);
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(24, 144, 255, 0.5);
}

/* === 25. 打印优化 === */
@media print {
    .site-header, .site-footer, .float-consult,
    .ai-assistant-btn, .ai-chat-panel,
    .back-to-top, #page-progress {
        display: none !important;
    }
    body { background: #fff; color: #000; }
    a { color: #000; text-decoration: underline; }
}

/* === 26. 暗色模式增强 === */
.theme-dark .glass-card {
    background: rgba(26, 35, 50, 0.75);
    border-color: rgba(255, 255, 255, 0.06);
}

/* === 27. 预览加载动画 (骨架) === */
.skeleton-card {
    background: #1a2332;
    border-radius: 12px;
    padding: 24px;
}
.skeleton-line {
    height: 14px;
    border-radius: 7px;
    margin-bottom: 12px;
    background: linear-gradient(90deg, #2a3545 25%, #3a4555 50%, #2a3545 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-line:last-child { width: 60%; }
