/* QFY热门内容小工具样式 */
.qfy-hot-content-widget {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* 日间模式默认颜色 - 由夜间模式媒体查询控制 */

/* 标题样式 - 简化确保居中有效 */
.qfy-title {
    margin: 0 0 15px 0;
    padding: 0;
    line-height: 1.2;
    font-weight: bold;
    width: 100%;
    display: block;
}

/* 左侧标题 */
.qfy-title.qfy-left {
    text-align: left;
}

/* 居中标题 - 使用最简单可靠的方法 */
.qfy-title.qfy-center {
    text-align: center;
    display: block;
    margin: 0 auto;
}

/* 标题包装器 - 确保正确布局 */
.qfy-title-wrapper {
    width: 100%;
    display: block;
}

.qfy-title-wrapper.qfy-left .qfy-title {
    text-align: left;
}

.qfy-title-wrapper.qfy-center .qfy-title {
    text-align: center;
    margin: 0 auto;
}

.zib-color {
    color: var(--theme-color, #007bff) !important;
}

.title-black {
    color: #000 !important;
}

/* 阿里字体库样式 */
.alifont1 {
    font-family: "Alibaba PuHuiTi", "Microsoft YaHei", sans-serif;
    font-weight: 700;
}

.alifont2 {
    font-family: "Alibaba Sans", "Microsoft YaHei", sans-serif;
    font-weight: 600;
}

.alifont3 {
    font-family: "Alifont Artistic", "Microsoft YaHei", sans-serif;
    font-style: italic;
}

.alifont4 {
    font-family: "Alifont Bold", "Microsoft YaHei", sans-serif;
    font-weight: 800;
}

.alifont5 {
    font-family: "Alifont Light", "Microsoft YaHei", sans-serif;
    font-weight: 300;
}

.alifont6 {
    font-family: "Alifont Medium", "Microsoft YaHei", sans-serif;
    font-weight: 500;
}

/* 滚动样式 */
.scroll-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.scroll-wrapper {
    display: flex;
    white-space: nowrap;
    animation: scroll-left 30s linear infinite;
}

.scroll-container[data-direction="right"] .scroll-wrapper {
    animation: scroll-right 30s linear infinite;
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes scroll-right {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* 固定样式 */
.fixed-container {
    display: grid;
    grid-template-columns: repeat(var(--columns, 4), 1fr);
    gap: 10px;
    margin: 0;
    padding: 0;
}

.fixed-container .qfy-post-item {
    flex-direction: column;
    align-items: flex-start;
    min-height: auto;
    padding: 10px;
}

.fixed-container .post-thumbnail {
    width: 100%;
    height: 120px;
    margin-bottom: 8px;
}

.fixed-container .post-content {
    margin-left: 0;
    max-width: 100%;
    min-height: auto;
}

.qfy-hot-content-widget .fixed-container .post-title {
    font-size: 14px;
    line-height: 1.4;
    margin: 0 0 6px 0;
}

.qfy-hot-content-widget .fixed-container .post-excerpt {
    font-size: 13px;
    line-height: 1.4;
}

/* 文章项样式 */
.qfy-post-item {
    display: flex;
    align-items: stretch;
    text-decoration: none;
    margin: 0;
    padding: 8px;
    border: none;
    background: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    min-height: 80px;
}

.qfy-post-item:hover {
    transform: translateY(-3px);
    background: rgba(0, 123, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-thumbnail {
    position: relative;
    width: 120px;
    height: 80px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    transition: transform 0.3s ease;
}

.qfy-post-item:hover .post-thumbnail img {
    transform: scale(1.05);
}

.corner-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    width: auto !important;
    height: auto !important;
    max-width: 30px;
    max-height: 30px;
    z-index: 2;
    transition: transform 0.3s ease;
}

.qfy-post-item:hover .corner-badge {
    transform: scale(1.1) rotate(5deg);
}

.post-content {
    margin-left: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-height: 80px;
    max-width: calc(100% - 135px);
}

.qfy-hot-content-widget .post-title {
    font-size: 16px;
    line-height: 1.3;
    font-weight: 600;
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.6em;
    word-break: break-word;
}

.qfy-hot-content-widget .post-excerpt {
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.8em;
    word-break: break-word;
}

.qfy-hot-content-widget .qfy-post-item:hover .post-title {
    /* 颜色由夜间模式媒体查询控制 */
}

.qfy-hot-content-widget .qfy-post-item:hover .post-excerpt {
    /* 颜色由夜间模式媒体查询控制 */
}

/* 作者信息 */
.qfy-author-info {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 12px;
    text-align: center;
}

.qfy-author-info a {
    text-decoration: none;
}

.qfy-author-info a:hover {
    text-decoration: underline;
}

/* 子比主题夜间模式适配 */
@media (prefers-color-scheme: dark) {
    .qfy-hot-content-widget {
        background: transparent;
    }
    
    .qfy-hot-content-widget .title-black {
        color: #ffffff !important;
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.8), 0 0 10px rgba(255, 255, 255, 0.5);
    }
    
    .qfy-hot-content-widget .zib-color {
        color: #ffffff !important;
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.8), 0 0 10px rgba(255, 255, 255, 0.5);
    }
    
    .qfy-hot-content-widget .qfy-title {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.8), 0 0 10px rgba(255, 255, 255, 0.5);
    }
    
    .qfy-hot-content-widget .post-title,
    .qfy-hot-content-widget .fixed-container .post-title {
        color: #ffffff !important;
    }
    
    .qfy-hot-content-widget .post-excerpt,
    .qfy-hot-content-widget .fixed-container .post-excerpt {
        color: #e0e0e0 !important;
    }
    
    .qfy-hot-content-widget .qfy-post-item:hover {
        background: rgba(77, 171, 247, 0.05);
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
    }
    
    .qfy-hot-content-widget .qfy-post-item:hover .post-title,
    .qfy-hot-content-widget .fixed-container .qfy-post-item:hover .post-title {
        color: #ff69b4 !important; /* 粉色 */
    }
    
    .qfy-hot-content-widget .qfy-post-item:hover .post-excerpt,
    .qfy-hot-content-widget .fixed-container .qfy-post-item:hover .post-excerpt {
        color: #ff69b4 !important; /* 粉色 */
    }
    
    .qfy-hot-content-widget .qfy-author-info {
        color: #e0e0e0 !important;
        border-top-color: #444 !important;
    }
    
    .qfy-hot-content-widget .qfy-author-info a {
        color: #ff69b4 !important;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .fixed-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .post-thumbnail {
        width: 100px;
        height: 70px;
    }
    
    .post-content {
        margin-left: 10px;
        max-width: calc(100% - 110px);
    }
    
    .post-title {
        font-size: 14px;
    }
    
    .post-excerpt {
        font-size: 12px;
    }
    
    .qfy-title {
        font-size: 20px !important;
    }
}

@media (max-width: 480px) {
    .fixed-container {
        grid-template-columns: 1fr;
    }
    
    .post-thumbnail {
        width: 100px;
        height: 80px;
    }
    
    .post-content {
        margin-left: 12px;
        max-width: calc(100% - 112px);
    }
    
    .scroll-wrapper {
        animation-duration: 20s;
    }
    
    .qfy-title {
        font-size: 18px !important;
    }
}

/* 滚动暂停效果 */
.scroll-container:hover .scroll-wrapper {
    animation-play-state: paused;
}

/* 确保无缝衔接 */
.scroll-wrapper .qfy-post-item {
    flex-shrink: 0;
}

/* 去除所有边框和多余间距 */
.qfy-hot-content-widget * {
    box-sizing: border-box;
    border: none;
    outline: none;
}

.qfy-content {
    margin: 0;
    padding: 0;
}

/* 自定义滚动速度 */
.scroll-container[data-speed="10"] .scroll-wrapper {
    animation-duration: 10s;
}

.scroll-container[data-speed="20"] .scroll-wrapper {
    animation-duration: 20s;
}

.scroll-container[data-speed="30"] .scroll-wrapper {
    animation-duration: 30s;
}

.scroll-container[data-speed="40"] .scroll-wrapper {
    animation-duration: 40s;
}

.scroll-container[data-speed="50"] .scroll-wrapper {
    animation-duration: 50s;
}

.scroll-container[data-speed="60"] .scroll-wrapper {
    animation-duration: 60s;
}