/* ==========================================
   CSS Grid 瀑布流：必须配合 JS 使用
   ========================================== */
.xhs-waterfall {
    display: grid;
    /* 1. 基础列数配置 */
    grid-template-columns: repeat(5, 1fr);
    /* 2. 🌟 极其重要：网格行高必须设为 1px，JS 才能精准计算跨度 */
    grid-auto-rows: 1px;
    /* 3. 网格间距 */
    grid-gap: 16px;

    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start; /* 防止内容拉伸 */
}

/* 响应式断点 */
@media (max-width: 1200px) { .xhs-waterfall { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 992px) { .xhs-waterfall { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .xhs-waterfall { grid-template-columns: repeat(2, 1fr); } }

.xhs-item {
    /* 取消之前 Flex 布局可能残留的 width */
    width: 100% !important;
    box-sizing: border-box;
    /* 默认给个跨度，防止加载前堆叠在一起 */
    grid-row-end: span 200;
}

.xhs-card {
    /* 确保卡片不会被强制撑开 */
    height: fit-content;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 4. 确保图片块不会产生额外的底部间距 */
.card-img-box {
    width: 100%;
    line-height: 0; /* 消除图片下方的基线空白 */
}

.card-img-box img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   卡片细节样式
   ========================================== */
.xhs-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #f2f2f2;
    transition:
        box-shadow 0.25s cubic-bezier(.4,0,.2,1),
        border-color 0.25s cubic-bezier(.4,0,.2,1);
}

.xhs-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

/* 图片适配 */
.card-img-box {
    width: 100%;
    background-color: #f9f9f9;
    overflow: hidden;
    position: relative;
}

.card-img-box img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.xhs-card:hover .card-img-box img {
    transform: scale(1.035);
}

.card-img-box::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0) 65%,
        rgba(0,0,0,0.04) 100%
    );
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.xhs-card:hover .card-img-box::after {
    opacity: 1;
}

.no-img-placeholder {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 40px;
}

/* 文字内容区 */
.card-info {
    padding: 12px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin-bottom: 8px;
    /* 标题最多显示两行，超出省略 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.xhs-card:hover .card-title {
    color: #111;
}

/* 底部作者与点赞区 */
.card-footer-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.author-info {
    display: flex;
    align-items: center;
    max-width: 65%;
}

.avatar-sm {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 6px;
}

.username {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.like-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.like-btn.active {
    color: #ff2442;
}

.like-btn.active .heart-icon::before {
    content: "\f004"; /* 实心心形 */
    font-weight: 900;
}

.like-btn:hover {
    color: #ff2442;
}

/* ==========================================
   空状态样式
   ========================================== */
.empty-state {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-content {
    text-align: center;
    max-width: 400px;
}

.empty-icon {
    font-size: 64px;
    color: #eee;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.empty-text {
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
}

.btn-create {
    background: #ff2442;
    color: #fff !important;
    padding: 10px 32px;
    border-radius: 24px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.2);
}

/* ==========================================
   卡片「真」点赞样式（对齐详情页）
   ========================================== */

.card-verify {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: color 0.2s ease;
}

.card-verify .true-circle {
    width: 22px;
    height: 22px;
    border: 1.5px solid #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    margin-right: 6px;
    transition:
        border-color 0.2s ease,
        color 0.2s ease,
        background-color 0.2s ease;
}

.card-verify:hover {
    color: #ff2442;
}

.card-verify:hover .true-circle {
    border-color: #ff2442;
    color: #ff2442;
}

.card-verify.verify-btn-active {
    color: #ff2442;
}

.card-verify.verify-btn-active .true-circle {
    border-color: #ff2442;
    color: #ff2442;
    background: rgba(255, 36, 66, 0.06);
}