/* 网格容器 */
.zib-grid-container {
    width: 100%;
    padding: 15px 0;
}

/* 内容网格 - 电脑端5列 */
.zib-content-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    width: 100%;
}

/* 内容卡片 */
.zib-content-card {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid #f5f5f5;
}

.zib-content-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #e0e0e0;
}

/* 卡片链接 */
.card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

/* 图片容器 */
.card-image {
    position: relative;
    width: 100%;
    height: 130px;
    overflow: hidden;
}

/* 特色图片 */
.featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.zib-content-card:hover .featured-image {
    transform: scale(1.08);
}

/* 图片标题 - 浅色背景优化 */
.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 12px;
    background: rgb(225 225 225 / 90%); /* 浅色半透明背景 */
    color: #333333; /* 深色文字 */
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
    box-sizing: border-box;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* 卡片信息区域 */
.card-info {
    padding: 15px;
}

/* 描述文本 - 严格两行显示优化 */
.card-description {
    margin: 0 0 15px 0;
    font-size: 13px;
    line-height: 1.5; /* 调整行高，确保两行紧凑显示 */
    color: #555555;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 强制两行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 39px; /* 精确计算两行高度（13px * 1.5 * 2 = 39px） */
    word-break: break-all; /* 允许长词换行 */
}

/* 统计数据区域 */
.card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

/* 分类标签 */
.meta-category {
    background: #f0f8ff;
    color: #1677ff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

/* 数据统计组 */
.stats-group {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* 统计项 */
.stat-item {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666666;
    gap: 4px;
    white-space: nowrap;
}

.stat-item i {
    font-size: 11px;
}

/* 浏览量样式 */
.stat-item.views {
    color: #666666;
}

/* 点赞量样式 */
.stat-item.likes {
    color: #ff4d4f;
}

/* 下部元数据 */
.card-meta-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999999;
}

/* 作者信息 */
.author-info {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

/* 作者头像 */
.author-avatar {
    width: 16px !important;
    height: 16px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #eeeeee;
    display: block !important;
    flex-shrink: 0;
}

/* 作者名称 */
.author-name {
    max-width: 70px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
}

/* 日期 */
.meta-date {
    color: #999999;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 无内容提示 */
.no-content {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: #999;
    font-size: 15px;
    background: #f9f9f9;
    border-radius: 10px;
}

/* 响应式布局优化 */
@media (max-width: 1200px) {
    .zib-content-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
    
    .card-info {
        padding: 12px;
    }
}

@media (max-width: 992px) {
    .zib-content-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .card-image {
        height: 120px;
    }
    
    .card-description {
        margin-bottom: 12px;
    }
}

@media (max-width: 768px) {
    .zib-content-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .card-image {
        height: 100px;
    }
    
    .image-caption {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .card-info {
        padding: 10px;
    }
    
    .card-description {
        font-size: 12px;
        height: 36px; /* 手机端两行高度（12px * 1.5 * 2 = 36px） */
        margin-bottom: 10px;
        word-break: break-all;
    }
    
    .card-stats {
        margin-bottom: 8px;
        padding-bottom: 8px;
    }
    
    .meta-category {
        font-size: 11px;
        padding: 2px 6px;
        max-width: 50%;
    }
    
    .stats-group {
        gap: 6px;
    }
    
    .stat-item {
        font-size: 11px;
    }
    
    .author-name {
        max-width: 60px;
        font-size: 11px;
    }
    
    .meta-date {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .zib-content-grid {
        gap: 10px;
    }
    
    .card-image {
        height: 90px;
    }
    
    .image-caption {
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .card-info {
        padding: 8px;
    }
    
    .stats-group {
        gap: 4px;
    }
}

/* 暗色主题适配 */
[data-theme="dark"] .zib-content-card {
    background: #1f1f1f;
    border-color: #333;
}

[data-theme="dark"] .image-caption {
    background: rgba(31, 31, 31, 0.9);
    color: #e0e0e0;
    border-top-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .card-description {
    color: #cccccc;
}

[data-theme="dark"] .meta-category {
    background: #2a3856;
    color: #40a9ff;
}

[data-theme="dark"] .card-stats {
    border-bottom-color: #333;
}

[data-theme="dark"] .stat-item {
    color: #aaaaaa;
}

[data-theme="dark"] .stat-item.likes {
    color: #ff7a75;
}

[data-theme="dark"] .card-meta-bottom,
[data-theme="dark"] .meta-date {
    color: #aaaaaa;
}

[data-theme="dark"] .no-content {
    background: #292929;
    color: #aaaaaa;
}