
/* Animation Classes */
.onload-animation {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Progressive Delays for Siblings */
.onload-animation:nth-child(1) { animation-delay: 0ms; }
.onload-animation:nth-child(2) { animation-delay: 50ms; }
.onload-animation:nth-child(3) { animation-delay: 100ms; }
.onload-animation:nth-child(4) { animation-delay: 150ms; }
.onload-animation:nth-child(5) { animation-delay: 200ms; }
.onload-animation:nth-child(6) { animation-delay: 250ms; }
.onload-animation:nth-child(7) { animation-delay: 300ms; }
.onload-animation:nth-child(8) { animation-delay: 350ms; }
.onload-animation:nth-child(9) { animation-delay: 400ms; }
.onload-animation:nth-child(10) { animation-delay: 450ms; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Post Card Hover Effects */
.post-card-wrapper {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.post-card-image {
    position: relative;
    overflow: hidden;
}

.post-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.post-card-wrapper:hover .post-card-image::after {
    background: rgba(0, 0, 0, 0.1);
}

/* Grid/List Layout Transitions */
.post-list-container {
    transition: opacity 0.3s ease;
}

/* Custom Scrollbar for TOC */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--scrollbar-bg);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-bg-hover);
}

/* View Transitions API 主题切换动画 */
/* 为整个文档根元素设置视图过渡 */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.5s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    /* 使用混合模式使颜色过渡更平滑 */
    mix-blend-mode: normal;
}

/* 视图过渡组 - 使用交叉淡化效果 */
::view-transition-group(root) {
    animation-duration: 0.5s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* 淡出旧视图 - 使用更平滑的曲线 */
::view-transition-old(root) {
    animation-name: theme-fade-out;
    /* 确保背景色同步切换 */
    z-index: 2;
}

/* 淡入新视图 - 使用更平滑的曲线 */
::view-transition-new(root) {
    animation-name: theme-fade-in;
    /* 确保新视图在上层 */
    z-index: 1;
}

/* 定义淡出动画 - 使用更平滑的缓动函数 */
@keyframes theme-fade-out {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* 定义淡入动画 - 使用更平滑的缓动函数 */
@keyframes theme-fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
