/* 首页动态美化效果 */

body.zib-home-fx {
    --zib-fx-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* 背景光晕 */
body.zib-home-fx .content-wrap {
    position: relative;
}

body.zib-home-fx .content-wrap::before,
body.zib-home-fx .content-wrap::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(80px);
    opacity: 0.35;
    will-change: transform;
}

body.zib-home-fx .content-wrap::before {
    width: 420px;
    height: 420px;
    top: 120px;
    left: -80px;
    background: radial-gradient(circle, var(--focus-color, #469cf5) 0%, transparent 70%);
    animation: zibOrbDrift1 18s ease-in-out infinite;
}

body.zib-home-fx .content-wrap::after {
    width: 360px;
    height: 360px;
    bottom: 80px;
    right: -60px;
    background: radial-gradient(circle, #ff9a56 0%, transparent 70%);
    animation: zibOrbDrift2 22s ease-in-out infinite;
}

@keyframes zibOrbDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, 30px) scale(1.08); }
}

@keyframes zibOrbDrift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-30px, -40px) scale(1.1); }
}

/* 滚动入场 */
body.zib-home-fx .zib-reveal-item {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s var(--zib-fx-ease), transform 0.65s var(--zib-fx-ease);
    will-change: opacity, transform;
}

body.zib-home-fx .zib-reveal-item.zib-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* 文章卡片悬停 */
body.zib-home-fx .posts-item {
    transition: transform 0.35s var(--zib-fx-ease), box-shadow 0.35s var(--zib-fx-ease), background 0.35s;
}

body.zib-home-fx .posts-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

body.zib-home-fx .posts-item .item-heading > a {
    transition: color 0.25s;
}

body.zib-home-fx .posts-item:hover .item-heading > a {
    color: var(--focus-color);
}

body.zib-home-fx .posts-item .item-thumbnail {
    overflow: hidden;
}

body.zib-home-fx .posts-item .item-thumbnail img {
    transition: transform 0.5s var(--zib-fx-ease);
}

body.zib-home-fx .posts-item:hover .item-thumbnail img {
    transform: scale(1.06);
}

/* Tab 导航 */
body.zib-home-fx .index-tab ul > li {
    transition: background 0.3s var(--zib-fx-ease), transform 0.3s var(--zib-fx-ease), color 0.3s;
}

body.zib-home-fx .index-tab ul > li:not(.active):hover {
    transform: translateY(-2px);
}

body.zib-home-fx .home-tab-content {
    animation: zibFadeDown 0.7s var(--zib-fx-ease) both;
}

@keyframes zibFadeDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 排序栏 */
body.zib-home-fx .ajax-option {
    animation: zibFadeDown 0.6s var(--zib-fx-ease) 0.1s both;
}

/* 浮动按钮 */
body.zib-home-fx .float-right .float-btn {
    transition: transform 0.3s var(--zib-fx-ease), box-shadow 0.3s, background 0.3s;
    animation: zibFloatIn 0.5s var(--zib-fx-ease) both;
}

body.zib-home-fx .float-right .float-btn:nth-child(1) { animation-delay: 0.05s; }
body.zib-home-fx .float-right .float-btn:nth-child(2) { animation-delay: 0.1s; }
body.zib-home-fx .float-right .float-btn:nth-child(3) { animation-delay: 0.15s; }
body.zib-home-fx .float-right .float-btn:nth-child(4) { animation-delay: 0.2s; }
body.zib-home-fx .float-right .float-btn:nth-child(5) { animation-delay: 0.25s; }
body.zib-home-fx .float-right .float-btn:nth-child(6) { animation-delay: 0.3s; }

body.zib-home-fx .float-right .float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

@keyframes zibFloatIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 小工具模块 */
body.zib-home-fx .zib-widget {
    animation: zibFadeDown 0.6s var(--zib-fx-ease) both;
}

/* 页脚 */
body.zib-home-fx .footer {
    animation: zibFadeUp 0.8s var(--zib-fx-ease) both;
}

@keyframes zibFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 导航栏滚动效果 */
body.zib-home-fx .navbar-top.zib-nav-scrolled {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s, backdrop-filter 0.3s;
}

/* 低性能设备降级 */
body.fps-accelerat.zib-home-fx .zib-reveal-item {
    opacity: 1;
    transform: none;
    transition: none;
}

body.fps-accelerat.zib-home-fx .content-wrap::before,
body.fps-accelerat.zib-home-fx .content-wrap::after,
body.fps-accelerat.zib-home-fx .float-right .float-btn,
body.fps-accelerat.zib-home-fx .home-tab-content,
body.fps-accelerat.zib-home-fx .ajax-option,
body.fps-accelerat.zib-home-fx .zib-widget,
body.fps-accelerat.zib-home-fx .footer {
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    body.zib-home-fx .zib-reveal-item,
    body.zib-home-fx .content-wrap::before,
    body.zib-home-fx .content-wrap::after,
    body.zib-home-fx .float-right .float-btn,
    body.zib-home-fx .home-tab-content,
    body.zib-home-fx .ajax-option,
    body.zib-home-fx .zib-widget,
    body.zib-home-fx .footer {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
