/**
 * 文章列表样式
 * 布局：左侧缩略图，右侧标题+摘要+分类标签等信息
 * 响应式：一行两个（所有端）
 */

/* 文章列表容器 */
.qm-post-list-container {
    margin-bottom: 2rem;
}

/* 文章列表项 */
.qm-post-list-item {
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 150px; /* 固定高度，与缩略图保持一致 */
    display: flex;
    flex-direction: row; /* 默认横向布局：左侧图片，右侧内容 */
}

.qm-post-list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* 缩略图区域 - 只保留电脑样机缩略图，无背景，横向居中 */
.qm-post-list-thumb {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    position: relative;
    overflow: visible;
    background: transparent;
    border-radius: 0.5rem 0 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.qm-post-list-thumb > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.qm-post-list-thumb .qm-mockup-image {
    width: 75%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
    margin: 0 auto;
    display: block;
}

.qm-post-list-thumb .qm-mockup-screen {
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 38%;
    background-size: cover;
    background-position: center top;
    border-radius: 2px;
    z-index: 0;
}

.qm-post-list-thumb .qm-mockup-frame {
    position: relative;
    width: 75%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    z-index: 2;
    margin: 0 auto;
    display: block;
}

.qm-post-list-item:hover .qm-post-list-thumb .qm-mockup-image,
.qm-post-list-item:hover .qm-post-list-thumb .qm-mockup-frame {
    transform: scale(1.05);
}

/* 内容区域 */
.qm-post-list-content {
    flex: 1;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0; /* 确保flex子元素可以收缩 */
    overflow: hidden; /* 防止内容溢出 */
    height: 150px; /* 与缩略图高度保持一致 */
}

/* 标题 - 与文章卡片保持一致，超过一行省略 */
.qm-post-list-title {
    margin: 0 0 0.375rem 0;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    min-width: 0; /* 允许flex子元素收缩 */
}

.qm-post-list-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.qm-post-list-item:hover .qm-post-list-title a {
    color: #2563eb;
}

/* 摘要 - 移动端一行省略，桌面端两行省略 */
.qm-post-list-excerpt {
    margin: 0 0 0.5rem 0;
    color: #6b7280;
    font-size: 0.6875rem;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    width: 100%;
    min-width: 0; /* 允许flex子元素收缩 */
    display: -webkit-box;
    -webkit-line-clamp: 1; /* 移动端默认一行 */
    line-clamp: 1;
    -webkit-box-orient: vertical;
    word-break: break-word;
    max-height: calc(1.5em * 1); /* 限制高度为一行 */
}

/* 分类标签容器 - 使用统一的文章卡片标签样式 */
.qm-post-list-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.qm-post-list-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    font-size: 0.6875rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    font-weight: 500;
    visibility: visible;
    opacity: 1;
    transition: all 0.2s ease;
}

/* 底部信息 - 与文章卡片保持一致（使用相同的类名） */
.qm-post-list-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.25rem;
    margin-top: 0.25rem;
    border-top: 1px solid #f3f4f6;
}

/* 作者信息 */
.qm-post-list-meta .qm-card-author {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.qm-post-list-meta .qm-author-avatar {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.5);
}

.qm-post-list-meta .qm-author-name {
    font-size: 0.6875rem;
    color: #6b7280;
    max-width: 4rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    text-decoration: none;
}

/* 统计信息 */
.qm-post-list-meta .qm-card-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.qm-post-list-meta .qm-card-stats .qm-card-stat {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    font-size: 0.6875rem;
    color: #9ca3af;
    text-decoration: none;
}

.qm-post-list-meta .qm-card-stats .qm-card-stat i {
    font-size: 0.625rem;
}

.qm-post-list-meta .qm-card-stats .qm-card-stat[data-stat-type] {
    cursor: pointer;
    user-select: none;
}

.qm-post-list-meta .qm-card-stats .qm-card-stat[data-stat-type] i {
    color: currentColor;
}

.qm-post-list-meta .qm-card-stats .qm-card-like:hover {
    color: #f97373;
}

.qm-post-list-meta .qm-card-stats .qm-card-like.active {
    color: #ef4444;
}

.qm-post-list-meta .qm-card-stats .qm-card-fav:hover {
    color: #f59e0b;
}

.qm-post-list-meta .qm-card-stats .qm-card-fav.active {
    color: #f97316;
}

/* 响应式调整 - 移动端一行一个，桌面端一行两个 */
@media (max-width: 575.98px) {
    .qm-post-list-item {
        height: 120px; /* 移动端固定高度 */
    }
    
    .qm-post-list-thumb {
        width: 120px;
        height: 120px;
        padding: 0.375rem;
        border-radius: 0.5rem 0 0 0.5rem;
    }
    
    .qm-post-list-thumb > a {
        height: 100%;
    }
    
    .qm-post-list-content {
        padding: 0.5rem;
        height: 120px; /* 与缩略图高度保持一致 */
    }
    
    .qm-post-list-title {
        font-size: 0.8125rem;
        margin-bottom: 0.375rem;
    }
    
    .qm-post-list-excerpt {
        font-size: 0.6875rem;
        margin-bottom: 0.5rem;
    }
    
    .qm-post-list-badges {
        gap: 0.5rem;
        margin-bottom: 0.375rem;
    }
    
    .qm-post-list-badge {
        padding: 0.15rem 0.5rem;
        font-size: 0.6875rem;
    }
    
    .qm-post-list-meta {
        padding-top: 0.25rem;
        margin-top: 0.25rem;
    }
    
    .qm-post-list-meta .qm-author-name {
        font-size: 0.625rem;
        max-width: 3rem;
    }
    
    .qm-post-list-meta .qm-author-avatar {
        width: 1rem;
        height: 1rem;
    }
    
    .qm-post-list-meta .qm-card-stats .qm-card-stat {
        font-size: 0.625rem;
    }
    
    .qm-post-list-meta .qm-card-stats .qm-card-stat i {
        font-size: 0.625rem;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .qm-post-list-item {
        height: 140px;
    }
    
    .qm-post-list-thumb {
        width: 160px;
        height: 140px;
        padding: 0.5rem;
    }
    
    .qm-post-list-content {
        padding: 0.75rem;
        height: 140px;
    }
}

@media (min-width: 768px) {
    .qm-post-list-item {
        height: 150px;
    }
    
    .qm-post-list-thumb {
        width: 180px;
        height: 150px;
        padding: 0.625rem;
    }
    
    .qm-post-list-content {
        padding: 0.75rem;
        height: 150px;
    }
    
    .qm-post-list-title {
        font-size: 0.9375rem;
    }
    
    .qm-post-list-excerpt {
        font-size: 0.8125rem;
        -webkit-line-clamp: 2; /* 桌面端两行 */
        line-clamp: 2;
        max-height: calc(1.5em * 2); /* 限制高度为两行 */
    }
    
    .qm-post-list-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }
}

@media (min-width: 1024px) {
    .qm-post-list-item {
        height: 150px;
    }
    
    .qm-post-list-thumb {
        width: 200px;
        height: 150px;
        padding: 0.75rem;
        padding-top: 0.5rem;
    }
    
    .qm-post-list-content {
        padding: 0.75rem;
        padding-left: 0.875rem;
        height: 150px;
    }
    
    .qm-post-list-title {
        font-size: 0.8125rem;
        margin-bottom: 0.375rem;
    }
    
    .qm-post-list-excerpt {
        font-size: 0.6875rem;
        margin-bottom: 0.5rem;
        -webkit-line-clamp: 2; /* 大屏幕两行 */
        line-clamp: 2;
        max-height: calc(1.5em * 2); /* 限制高度为两行 */
    }
    
    .qm-post-list-meta {
        padding-top: 0.25rem;
        margin-top: 0.25rem;
    }
    
    .qm-post-list-meta .qm-author-name {
        font-size: 0.625rem;
        max-width: 3rem;
    }
    
    .qm-post-list-meta .qm-author-avatar {
        width: 1rem;
        height: 1rem;
    }
    
    .qm-post-list-meta .qm-card-stats .qm-card-stat {
        font-size: 0.625rem;
    }
    
    .qm-post-list-meta .qm-card-stats .qm-card-stat i {
        font-size: 0.625rem;
    }
}

/* 空状态 */
.qm-post-list-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.qm-post-list-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.qm-post-list-empty-text {
    margin: 0;
    font-size: 1rem;
}

/* 首页文章列表模块：移除背景几何 SVG 装饰 */
.qm-article-list-module .qm-card-thumb::before,
.qm-article-list-module .qm-card-thumb .qm-mockup-screen::after {
    background-image: none !important;
}

