/* --- 网格容器 --- */
.front-page-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px 15px;                 /* 行间距20px，列间距15px */
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    min-width: 0;
	margin-top: -30px !important;   /* 增加顶部间距 */
}

/* 响应式 */
@media (max-width: 1400px) {
    .front-page-container {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .front-page-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }
}

/* --- 卡片 --- */
.front-page-container .post-card {
    display: flex;
    flex-direction: column;
    height: 100%;                   /* 关键：撑满所在网格区域 */
    min-width: 0;
    overflow: hidden;
}

/* 竖图卡片跨两行 */
.front-page-container .post-card:has(.vertical-thumb) {
    grid-row: span 2;
}

/* --- 缩略图容器 --- */
.front-page-container .thumb-link {
    display: block;
    background-color: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
    flex-shrink: 0;
}

/* 横图：固定宽高比16:9，高度由宽度决定 */
.front-page-container .thumb-link:not(.vertical-thumb) {
    aspect-ratio: 16 / 9;
    /* 不设 flex，高度自动由宽度计算 */
}

/* 竖图：填充剩余空间，不设固定宽高比（允许拉伸容器） */
.front-page-container .thumb-link.vertical-thumb {
    flex: 1;                         /* 占据标题和元数据之外的所有空间 */
    aspect-ratio: 3/4;
    min-height: 0;
}

/* --- 图片：始终保持原始比例，不变形 --- */
.front-page-container .thumb-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;               /* 裁剪填充，横图保持16:9，竖图容器拉伸但图片按自身比例裁剪 */
    display: block;
}

/* --- 标题：固定高度（两行） --- */
.front-page-container .post-card h3 {
    margin: 6px 0 0 0;
    font-size: 15px;
    line-height: 1.4;
    height: 2.8em;                  /* 固定为两行高度 */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
    flex-shrink: 0;                /* 禁止压缩 */
}

.front-page-container .post-card h3 a {
    text-decoration: none !important;
    color: #333;
}

/* --- 元数据栏：固定高度 --- */
.front-page-container .post-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    height: 32px;                  /* 固定高度，防止撑开 */
    flex-shrink: 0;
    overflow: hidden;
    font-size: 13px;
    color: #666;
}

/* 作者信息 */
.front-page-container .author-info {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    white-space: nowrap;
    font-size: 14px;
    flex-shrink: 1;
    min-width: 0;
}
.front-page-container .author-info img {
    border-radius: 50%;
    width: 28px;
    height: 28px;
    object-fit: cover;
    flex-shrink: 0;
}
.front-page-container .author-info a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 浏览量 */
.front-page-container .meta-stats {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #999;
    font-size: 14px;
    flex-shrink: 0;
}
.front-page-container .meta-stats svg {
    width: 1.1em;
    height: auto;
    flex-shrink: 0;
}

/* 发布时间 */
.front-page-container .post-time {
    color: #999;
    font-size: 14px;
    flex-shrink: 0;
    white-space: nowrap;
}

body {
    padding-left: 200px;
    padding-right: 200px;
    box-sizing: border-box;
}
body.nav-collapsed {
    padding-left: 72px;
    padding-right: 72px;
}
