@charset "utf-8";
/* 🌈 XiunoBBS 帖子列表布局 + 标题自动换行居中 */

/* 基础 */
.kandyui * {
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* 容器布局 */
.cols {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 0 8px;
    margin: 0 auto;
    gap: 12px;
}

/* 每个帖子块 */
.cols > li {
    list-style: none;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* 图片容器 */
.cols > li .img-wrapper {
    width: 100%;
    padding-top: 100%; /* 保持正方形比例 */
    position: relative;
    overflow: hidden;
    background-color: #f5f5f5;
}

.cols > li .img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* hover 动效 */
.cols > li:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cols > li:hover img {
    filter: brightness(1.05);
}

/* ===== 标题两行换行 + 居中 ===== */
.cols > li .title,
.threadlist li .title,
.threadlist .thread .title,
.threadlist .thread h3 a {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;             /* 限制显示两行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
    white-space: normal !important;    /* 允许换行 */
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.4em;
    margin: 8px 0 10px;
    padding: 0 6px;
    height: 2.8em;                     /* 两行高度固定 */
    transition: color .2s;
}

/* 悬停变色 */
.cols > li .title:hover,
.threadlist li .title:hover,
.threadlist .thread h3 a:hover {
    color: #007bff;
    text-decoration: none;
}

/* ===== 响应式布局 ===== */
/* 电脑端 - 4列 */
@media (min-width: 768px) {
    .cols > li {
        width: calc(25% - 9px);
    }
}

/* 平板 - 3列 */
@media (min-width: 576px) and (max-width: 767px) {
    .cols > li {
        width: calc(33.333% - 8px);
    }
}

/* 手机端 - 3列 + 标题略小 */
@media (max-width: 575px) {
    .cols {
        gap: 10px;
        padding: 0 6px;
        justify-content: center;
    }
    .cols > li {
        width: calc(33.333% - 7px);
    }
    .cols > li .title,
    .threadlist li .title,
    .threadlist .thread h3 a {
        font-size: 12px;
        margin: 6px 0 8px;
        padding: 0 4px;
        height: 2.8em;
        line-height: 1.4em;
    }
}
