/* 非凡网络：首页卡片悬浮增强 v2.5.29
 * 基于 Zibll 后台已设置的卡片模式增强：桌面 5 列、优先 800x800 源图、标题加粗完整换行、复用文章摘要、悬浮显示分类/作者/时间/收藏。
 */

/* 隐藏首页顶部“排序 / 更新 / 浏览 / 点赞 / 评论”筛选条，目标站同款更干净 */
body.ffwl-home-cards-enabled.ffwl-home-hide-filter-enabled .ajax-option[win-ajax-replace="filter"],
body.ffwl-home-cards-enabled.ffwl-home-hide-filter-enabled .ajax-option.ajax-replace,
body.ffwl-home-cards-enabled.ffwl-home-hide-filter-enabled .ajax-option.ajax-replace + div:empty {
    display: none !important;
}

/* 首页卡片容器：不居中单个卡片，始终从左侧开始排列 */
body.ffwl-home-cards-enabled .posts-row {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    align-content: flex-start !important;
    text-align: left !important;
    margin-left: -8px !important;
    margin-right: -8px !important;
    gap: 0 !important;
}

body.ffwl-home-cards-enabled .posts-row > *:not(.post_ajax_loader) {
    margin-left: 8px !important;
    margin-right: 8px !important;
}

@media (min-width: 1200px) {
    body.ffwl-home-cards-enabled .posts-row > .posts-item.card,
    body.ffwl-home-cards-enabled .posts-row > posts.posts-item.card,
    body.ffwl-home-cards-enabled .site-layout-1 .posts-row > .posts-item.card,
    body.ffwl-home-cards-enabled .site-layout-1 .posts-row > posts.posts-item.card,
    body.ffwl-home-cards-enabled .fluid-widget-wrap .posts-row > .posts-item.card,
    body.ffwl-home-cards-enabled .fluid-widget-wrap .posts-row > posts.posts-item.card {
        flex: 0 0 calc(20% - 16px) !important;
        width: calc(20% - 16px) !important;
        max-width: calc(20% - 16px) !important;
        min-width: 0 !important;
        display: inline-block !important;
        vertical-align: top !important;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    body.ffwl-home-cards-enabled .posts-row > .posts-item.card,
    body.ffwl-home-cards-enabled .posts-row > posts.posts-item.card {
        flex: 0 0 calc(25% - 16px) !important;
        width: calc(25% - 16px) !important;
        max-width: calc(25% - 16px) !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    body.ffwl-home-cards-enabled .posts-row > .posts-item.card,
    body.ffwl-home-cards-enabled .posts-row > posts.posts-item.card {
        flex: 0 0 calc(33.333% - 16px) !important;
        width: calc(33.333% - 16px) !important;
        max-width: calc(33.333% - 16px) !important;
    }
}

@media (min-width: 480px) and (max-width: 767px) {
    body.ffwl-home-cards-enabled .posts-row {
        margin-left: -5px !important;
        margin-right: -5px !important;
    }

    body.ffwl-home-cards-enabled .posts-row > *:not(.post_ajax_loader) {
        margin-left: 5px !important;
        margin-right: 5px !important;
    }

    body.ffwl-home-cards-enabled .posts-row > .posts-item.card,
    body.ffwl-home-cards-enabled .posts-row > posts.posts-item.card {
        flex: 0 0 calc(50% - 10px) !important;
        width: calc(50% - 10px) !important;
        max-width: calc(50% - 10px) !important;
    }
}

body.ffwl-home-cards-enabled .ffwl-home-post-card {
    position: relative !important;
    box-sizing: border-box !important;
    border: 1px solid transparent !important;
    overflow: hidden !important;
    transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease, background .22s ease !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card:hover {
    border-color: #0d9bff !important;
    box-shadow: 0 14px 34px rgba(18, 119, 255, .14), 0 0 0 1px rgba(13, 155, 255, .08) !important;
    transform: translateY(-2px) translateZ(0);
}

/* 缩略图：PHP 优先换到 800x800 源图；前端显示比例恢复为目标站类似的横向卡片比例 */
body.ffwl-home-cards-enabled .ffwl-home-post-card .post-graphic,
body.ffwl-home-cards-enabled .ffwl-home-post-card .item-thumbnail,
body.ffwl-home-cards-enabled .ffwl-home-post-card .post-thumbnail {
    width: 100% !important;
    max-width: 100% !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card .item-thumbnail {
    position: relative !important;
    display: block !important;
    height: 0 !important;
    padding-bottom: 70% !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    background: #eef2f7 !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card .item-thumbnail > a,
body.ffwl-home-cards-enabled .ffwl-home-post-card .item-thumbnail .img-thumb,
body.ffwl-home-cards-enabled .ffwl-home-post-card .item-thumbnail .video-thumb-box,
body.ffwl-home-cards-enabled .ffwl-home-post-card .item-thumbnail .swiper,
body.ffwl-home-cards-enabled .ffwl-home-post-card .item-thumbnail .swiper-container {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card .item-thumbnail img,
body.ffwl-home-cards-enabled .ffwl-home-post-card img.wp-post-image,
body.ffwl-home-cards-enabled .ffwl-home-post-card img.fit-cover {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
    border-radius: 8px !important;
}


/* 标题：加粗、允许换行完整显示，取消 Zibll 默认省略号/行截断 */
body.ffwl-home-cards-enabled .ffwl-home-post-card .item-heading,
body.ffwl-home-cards-enabled .ffwl-home-post-card .item-title,
body.ffwl-home-cards-enabled .ffwl-home-post-card .post-title,
body.ffwl-home-cards-enabled .ffwl-home-post-card .ffwl-home-card-title {
    display: block !important;
    margin: 9px 0 7px !important;
    padding: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    color: #30343a !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.42 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card .item-heading a,
body.ffwl-home-cards-enabled .ffwl-home-post-card .item-title a,
body.ffwl-home-cards-enabled .ffwl-home-post-card .post-title a,
body.ffwl-home-cards-enabled .ffwl-home-post-card .ffwl-home-card-title-link {
    display: block !important;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: 700 !important;
    line-height: inherit !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow: visible !important;
    text-overflow: clip !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
}

/* 摘要：优先复用文章 AI 文摘/摘要，仿目标站灰底信息块 */
body.ffwl-home-cards-enabled .ffwl-home-post-card .ffwl-home-card-excerpt,
body.ffwl-home-cards-enabled .ffwl-home-post-card .item-excerpt.ffwl-home-card-excerpt,
body.ffwl-home-cards-enabled .ffwl-home-post-card .post-excerpt.ffwl-home-card-excerpt,
body.ffwl-home-cards-enabled .ffwl-home-post-card .entry-summary.ffwl-home-card-excerpt {
    display: -webkit-box !important;
    margin: 0 0 10px !important;
    padding: 7px 10px !important;
    min-height: 42px !important;
    max-height: 48px !important;
    border-radius: 5px !important;
    background: rgba(245, 245, 245, .96) !important;
    color: #8d939d !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.42 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .015) !important;
}

body.ffwl-home-cards-enabled.dark-theme .ffwl-home-post-card .ffwl-home-card-excerpt,
body.dark-theme.ffwl-home-cards-enabled .ffwl-home-post-card .ffwl-home-card-excerpt {
    background: rgba(255, 255, 255, .08) !important;
    color: rgba(255, 255, 255, .62) !important;
}

/* 分类目录默认不占正文区域，只在悬浮时以左上角胶囊显示 */
body.ffwl-home-cards-enabled .ffwl-home-post-card .item-tags,
body.ffwl-home-cards-enabled .ffwl-home-post-card .post-tags,
body.ffwl-home-cards-enabled .ffwl-home-post-card .meta-cat,
body.ffwl-home-cards-enabled .ffwl-home-post-card .post-cat {
    display: none !important;
}

/* 默认状态：隐藏作者/发布时间区域，只保留评论、浏览、点赞 */
body.ffwl-home-cards-enabled .ffwl-home-post-card .item-meta > .meta-author,
body.ffwl-home-cards-enabled .ffwl-home-post-card .post-meta > .meta-author,
body.ffwl-home-cards-enabled .ffwl-home-post-card .posts-meta > .meta-author,
body.ffwl-home-cards-enabled .ffwl-home-post-card .meta-bottom > .meta-author,
body.ffwl-home-cards-enabled .ffwl-home-post-card .item-meta > .item-author,
body.ffwl-home-cards-enabled .ffwl-home-post-card .post-meta > .item-author,
body.ffwl-home-cards-enabled .ffwl-home-post-card .posts-meta > .item-author,
body.ffwl-home-cards-enabled .ffwl-home-post-card .meta-bottom > .item-author,
body.ffwl-home-cards-enabled .ffwl-home-post-card .item-meta > .icon-circle,
body.ffwl-home-cards-enabled .ffwl-home-post-card .post-meta > .icon-circle,
body.ffwl-home-cards-enabled .ffwl-home-post-card .posts-meta > .icon-circle,
body.ffwl-home-cards-enabled .ffwl-home-post-card .meta-bottom > .icon-circle {
    display: none !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card .item-meta,
body.ffwl-home-cards-enabled .ffwl-home-post-card .post-meta,
body.ffwl-home-cards-enabled .ffwl-home-post-card .posts-meta,
body.ffwl-home-cards-enabled .ffwl-home-post-card .meta-bottom {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    min-height: 24px !important;
    transition: opacity .18s ease, visibility .18s ease !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card .meta-right,
body.ffwl-home-cards-enabled .ffwl-home-post-card .meta-left {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin-left: 0 !important;
    color: #aeb4bd !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card .meta-right item,
body.ffwl-home-cards-enabled .ffwl-home-post-card .meta-left item,
body.ffwl-home-cards-enabled .ffwl-home-post-card .meta-right a,
body.ffwl-home-cards-enabled .ffwl-home-post-card .meta-left a {
    color: inherit !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card:hover .ffwl-home-card-original-meta {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* 悬浮左上角分类目录 */
body.ffwl-home-cards-enabled .ffwl-home-card-cat {
    position: absolute !important;
    z-index: 8 !important;
    top: 14px !important;
    left: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    max-width: calc(100% - 78px) !important;
    height: 24px !important;
    padding: 0 10px !important;
    border-radius: 5px !important;
    background: linear-gradient(135deg, #ff5f69, #ff7568) !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 24px !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-shadow: 0 8px 18px rgba(255, 91, 104, .28) !important;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card:hover .ffwl-home-card-cat {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* 悬浮底部作者、头像、发布时间 */
body.ffwl-home-cards-enabled .ffwl-home-card-hover-meta {
    position: absolute !important;
    z-index: 7 !important;
    left: 14px !important;
    right: 14px !important;
    bottom: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    min-height: 24px !important;
    color: #888f9a !important;
    font-size: 12px !important;
    line-height: 24px !important;
    opacity: 0;
    transform: translateY(5px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card:hover .ffwl-home-card-hover-meta {
    opacity: 1;
    transform: translateY(0);
}

body.ffwl-home-cards-enabled .ffwl-home-card-author-wrap,
body.ffwl-home-cards-enabled .ffwl-home-card-time {
    display: inline-flex !important;
    align-items: center !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.ffwl-home-cards-enabled .ffwl-home-card-author-wrap {
    max-width: 66% !important;
}

body.ffwl-home-cards-enabled .ffwl-home-card-avatar {
    flex: 0 0 auto !important;
    width: 18px !important;
    height: 18px !important;
    margin-right: 6px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    background: #eef2f7 !important;
}

body.ffwl-home-cards-enabled .ffwl-home-card-avatar img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

body.ffwl-home-cards-enabled .ffwl-home-card-avatar-placeholder {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    background: radial-gradient(circle at 50% 35%, #20242c 0 28%, transparent 29%), radial-gradient(circle at 50% 100%, #20242c 0 45%, transparent 46%) !important;
    opacity: .88;
}

body.ffwl-home-cards-enabled .ffwl-home-card-author {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.ffwl-home-cards-enabled .ffwl-home-card-time::before {
    content: "";
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: #ff5464;
    box-shadow: 0 0 0 3px rgba(255, 84, 100, .12);
}

body.ffwl-home-cards-enabled.dark-theme .ffwl-home-post-card:hover,
body.dark-theme.ffwl-home-cards-enabled .ffwl-home-post-card:hover {
    border-color: #0d9bff !important;
    box-shadow: 0 10px 28px rgba(13, 155, 255, .18), 0 0 0 1px rgba(13, 155, 255, .12) !important;
}

body.ffwl-home-cards-enabled.dark-theme .ffwl-home-card-hover-meta,
body.dark-theme.ffwl-home-cards-enabled .ffwl-home-card-hover-meta {
    color: rgba(255, 255, 255, .72) !important;
}

@media (max-width: 767px) {
    body.ffwl-home-cards-enabled .ffwl-home-card-cat {
        top: 10px !important;
        left: 10px !important;
    }

    body.ffwl-home-cards-enabled .ffwl-home-card-hover-meta {
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        font-size: 11px !important;
    }
}

/* v2.5.20：卡片悬浮右上角 Zibll 原生收藏按钮 */
body.ffwl-home-cards-enabled .ffwl-home-post-card > .ffwl-home-card-favorite {
    position: absolute !important;
    z-index: 10 !important;
    top: 12px !important;
    right: 12px !important;
    width: 34px !important;
    height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    border: 1px solid rgba(255, 255, 255, .86) !important;
    background: rgba(255, 255, 255, .88) !important;
    color: #aeb4bd !important;
    text-decoration: none !important;
    box-shadow: 0 8px 22px rgba(40, 54, 76, .14) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0 !important;
    transform: translateY(-4px) scale(.96) !important;
    pointer-events: none !important;
    transition: opacity .18s ease, transform .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card:hover > .ffwl-home-card-favorite {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card > .ffwl-home-card-favorite:hover {
    color: #ffbf1f !important;
    background: #fff !important;
    box-shadow: 0 10px 26px rgba(255, 177, 31, .26) !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card > .ffwl-home-card-favorite.actived {
    color: #ffb300 !important;
    background: #fff9e8 !important;
    border-color: rgba(255, 190, 36, .65) !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card > .ffwl-home-card-favorite[disabled] {
    cursor: wait !important;
    opacity: .72 !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card > .ffwl-home-card-favorite svg,
body.ffwl-home-cards-enabled .ffwl-home-post-card > .ffwl-home-card-favorite .icon,
body.ffwl-home-cards-enabled .ffwl-home-post-card > .ffwl-home-card-favorite .ffwl-home-card-favorite-svg {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    fill: currentColor !important;
}

body.ffwl-home-cards-enabled .ffwl-home-post-card > .ffwl-home-card-favorite text,
body.ffwl-home-cards-enabled .ffwl-home-post-card > .ffwl-home-card-favorite count {
    display: none !important;
}

@media (max-width: 767px) {
    body.ffwl-home-cards-enabled .ffwl-home-post-card > .ffwl-home-card-favorite {
        top: 10px !important;
        right: 10px !important;
        width: 32px !important;
        height: 32px !important;
    }
}
