/* ============================================================
   小红书风格瀑布流（zibll-toolkit）
   - 复用主题自带 $.fn.waterfall 引擎
   - 仅做视觉层（圆角/阴影/悬浮/自然高度/标题截断）
   ============================================================ */

.waterfall-box {
    position: relative;
}

/* ---------- 文章卡片 ---------- */
.posts-row.waterfall-box {
    margin-left: 0;
    margin-right: 0;
}

.posts-row.waterfall-box > .posts-item {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--main-radius, 10px);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    margin: 0 6px 12px !important;
}

.posts-row.waterfall-box > .posts-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

/* 缩略图自然高度（瀑布流核心，覆盖主题比例占位） */
.waterfall-box .posts-item .item-thumbnail {
    padding-bottom: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    border-radius: 0 !important;
}

.waterfall-box .posts-item .item-thumbnail > a,
.waterfall-box .posts-item .item-thumbnail .relative {
    position: static !important;
    display: block;
}

.waterfall-box .posts-item .item-thumbnail img {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: unset !important;
    aspect-ratio: auto !important;
    transition: none;
}

/* 无图卡片：浅色背景纯文字块 */
.posts-row.waterfall-box > .posts-item:not(.has-thumb) {
    background: #fafafa;
}

/* 文本区 */
.waterfall-box .posts-item .item-body {
    padding: 10px 12px 12px;
}

.waterfall-box .posts-item .item-heading {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 8px;
}

.waterfall-box .posts-item .item-heading a {
    color: inherit;
}

/* 隐藏列表模式下多余的标签/徽章，更贴近小红书 */
.waterfall-box .posts-item .item-tags,
.waterfall-box .posts-item .item-meta .meta-tags {
    display: none;
}

.waterfall-box .posts-item .item-meta {
    font-size: 12px;
    color: #999;
}

/* ---------- 论坛帖子卡片 ---------- */
.ajaxpager.waterfall-box > .forum-posts {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--main-radius, 10px) !important;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    margin: 0 6px 12px !important;
}

.ajaxpager.waterfall-box > .forum-posts:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

/* 论坛封面自然高度 */
.waterfall-box .forum-posts .forum-lists-cover {
    margin-bottom: 10px;
    border-radius: var(--main-radius, 10px) var(--main-radius, 10px) 0 0;
    overflow: hidden;
}

.waterfall-box .forum-posts .forum-lists-cover,
.waterfall-box .forum-posts .forum-lists-cover .relative {
    height: auto !important;
}

.waterfall-box .forum-posts .forum-lists-cover img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: unset !important;
    transition: none;
}

.waterfall-box .forum-posts .forum-title {
    font-size: 15px;
    font-weight: 600;
}

/* ---------- 响应式列宽（桌面端由后台选项注入内联样式覆盖） ---------- */
@media (max-width: 767px) {
    .posts-row.waterfall-box > .posts-item,
    .ajaxpager.waterfall-box > .forum-posts {
        width: calc((100% - 10px) / 2) !important;
        margin: 0 5px 10px !important;
    }
}

@media (min-width: 768px) and (max-width: 1099px) {
    .posts-row.waterfall-box > .posts-item,
    .ajaxpager.waterfall-box > .forum-posts {
        width: calc((100% - 32px) / 3) !important;
        margin: 0 8px 16px !important;
    }
}
