/* 分类滚动小工具基础样式 */
.category-scroll-widget {
    margin-bottom: 20px;
}

.scroll-content-wrapper {
    position: relative;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scrolling-content {
    padding: 10px;
    animation: scroll 10s linear infinite;
}

.scrolling-content:hover {
    animation-play-state: paused;
}

/* 连续滚动动画 */
@keyframes scroll {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

/* 复制内容以实现连续滚动效果 */
.scrolling-content .scroll-post-item.clone {
    opacity: 0.95;
}

.scroll-post-item {
    padding: 15px 0;
    border-bottom: 1px dashed #eaeaea;
    margin-bottom: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.scroll-post-item:hover {
    background: #f9f9f9;
    border-radius: 6px;
    margin-left: 5px;
    margin-right: 5px;
}

.scroll-post-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* 图片样式 - 自适应宽度并居中 */
.post-image {
    margin: 0 auto 10px auto;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.scroll-post-thumbnail {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 150px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.scroll-post-thumbnail:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 标题样式 */
.post-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    padding: 0 10px;
}

.post-title a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 600;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: #3498db;
}

/* 内容样式 */
.post-content {
    font-size: 13px;
    line-height: 1.6;
    color: #555;
    text-align: center;
    padding: 0 15px;
    margin-bottom: 8px;
}

.post-content a {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: color 0.3s ease;
}

.post-content a:hover {
    color: #3498db;
}

/* 发布时间样式 */
.post-date {
    font-size: 11px;
    color: #888;
    text-align: center;
    margin-top: 5px;
    font-style: italic;
    line-height: 1.4;
}

.post-date:before {
    content: "🕒 ";
    margin-right: 3px;
    font-style: normal;
}

/* 确保在没有图片的情况下内容也居中 */
.scroll-post-item > * {
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .scroll-content-wrapper {
        height: 300px !important;
    }
    
    .scroll-post-item {
        padding: 12px 0;
    }
    
    .scroll-post-item:hover {
        margin-left: 3px;
        margin-right: 3px;
    }
    
    .post-image {
        margin: 0 auto 8px auto;
    }
    
    .post-title,
    .post-content {
        padding: 0 10px;
    }
    
    .post-content {
        margin-bottom: 6px;
    }
    
    .post-date {
        font-size: 10px;
        margin-top: 4px;
    }
    
    .scrolling-content {
        animation-duration: 8s;
    }
    
    .scroll-post-thumbnail {
        max-height: 120px;
    }
}

@media (max-width: 480px) {
    .scrolling-content {
        padding: 8px;
        animation-duration: 6s;
    }
    
    .scroll-post-item {
        padding: 10px 0;
    }
    
    .post-title {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .post-content {
        font-size: 12px;
        line-height: 1.5;
        padding: 0 8px;
        margin-bottom: 5px;
    }
    
    .post-date {
        font-size: 10px;
        margin-top: 3px;
    }
    
    .scroll-post-thumbnail {
        max-height: 100px;
    }
}

/* 加载状态 */
.scroll-content-wrapper.loading {
    opacity: 0.7;
}

.scroll-content-wrapper.loading::after {
    content: '加载中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 14px;
}

/* 空状态 */
.scroll-content-wrapper.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
    min-height: 100px;
}