/**
 * 文章卡片样式 - 异形波浪设计
 * QiMeng Theme - Article Card Module
 */

/* ========================================
   卡片基础样式
   ======================================== */

.qm-card {
    background: #fff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.qm-article-cards .qm-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
    align-items: stretch;
    border: 0;
}

.qm-article-cards .qm-card::before {
    content: none;
}

.qm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========================================
   缩略图样式
   ======================================== */

.qm-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: visible;
    background: #f3f4f6;
    border-radius: 0.75rem 0.75rem 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0.75rem;
    padding-top: 0.5rem;
    transition: background 0.3s ease;
}

/* 添加精致几何装饰图案 */
.qm-card-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/pattern-decorative.svg');
    background-size: 120px 120px;
    background-repeat: repeat;
    background-position: 0 0;
    pointer-events: none;
    z-index: 0;
    border-radius: 0.75rem 0.75rem 0 0;
    opacity: 0.6;
    mix-blend-mode: overlay;
}

.qm-card-thumb .qm-mockup-image {
    width: 75%;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.qm-card-thumb .qm-mockup-screen {
    position: absolute;
    top: 22%;
    left: 20%;
    width: 60%;
    height: 38%;
    background-size: cover;
    background-position: center top;
    border-radius: 2px;
    z-index: 0;
}

/* 为屏幕区域添加精致几何装饰 */
.qm-card-thumb .qm-mockup-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/pattern-decorative.svg');
    background-size: 80px 80px;
    background-repeat: repeat;
    background-position: 0 0;
    pointer-events: none;
    border-radius: 2px;
    opacity: 0.4;
    mix-blend-mode: overlay;
    z-index: 1;
}

.qm-card-thumb .qm-mockup-frame {
    position: relative;
    width: 75%;
    height: auto;
    object-fit: contain;
    z-index: 2;
}

.qm-card-thumb .qm-mockup-image {
    position: relative;
    z-index: 2;
}

.qm-card:hover .qm-card-thumb .qm-mockup-image,
.qm-card:hover .qm-card-thumb .qm-mockup-frame {
    transform: scale(1.05);
}

/* ========================================
   卡片内容样式
   ======================================== */

.qm-card-content {
    padding: 1rem;
    padding-left: 1.25rem;
    padding-top: 3.5rem;
    position: relative;
    z-index: 3;
    background: #fff;
    margin-top: -30%;
    clip-path: url(#qm-curve-clip);
}

.dark .qm-card-content {
    background: #1f2937;
}

.qm-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.qm-card:hover .qm-card-title {
    color: #7c3aed;
}

.qm-card-excerpt {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 0.625rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* ========================================
   分类和标签样式
   ======================================== */

.qm-card-taxonomies {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.375rem;
    margin-bottom: 0.625rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.qm-card-taxonomies::-webkit-scrollbar {
    display: none;
}

.qm-category-badge,
.qm-tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 彩色标签 - 亮色模式 */
.qm-category-badge:nth-child(1),
.qm-tag-badge:nth-child(1) {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

.qm-category-badge:nth-child(2),
.qm-tag-badge:nth-child(2) {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.qm-category-badge:nth-child(3),
.qm-tag-badge:nth-child(3) {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.qm-category-badge:nth-child(4),
.qm-tag-badge:nth-child(4) {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

/* 彩色标签 - 暗色模式 */
.dark .qm-category-badge:nth-child(1),
.dark .qm-tag-badge:nth-child(1) {
    background: rgba(124, 58, 237, 0.2);
    color: #a78bfa;
}

.dark .qm-category-badge:nth-child(2),
.dark .qm-tag-badge:nth-child(2) {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

.dark .qm-category-badge:nth-child(3),
.dark .qm-tag-badge:nth-child(3) {
    background: rgba(249, 115, 22, 0.2);
    color: #fb923c;
}

.dark .qm-category-badge:nth-child(4),
.dark .qm-tag-badge:nth-child(4) {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

/* ========================================
   底部作者和统计样式
   ======================================== */

.qm-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
}

.qm-card-author {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.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-author-name {
    font-size: 0.6875rem;
    color: #6b7280;
    max-width: 4rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.qm-card-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qm-card-stats span {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    font-size: 0.6875rem;
    color: #9ca3af;
}

.qm-card-stats i {
    font-size: 0.625rem;
}

/* ========================================
   响应式网格布局
   ======================================== */

.qm-article-cards {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
    .qm-article-cards {
        gap: 1.75rem;
    }
}

@media (min-width: 1024px) {
    .qm-article-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* 搜索结果页专用：一行最多5个 */
.qm-search-results .qm-article-cards {
    gap: 1.5rem;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
    .qm-search-results .qm-article-cards {
        gap: 1.75rem;
    }
}

@media (min-width: 1024px) {
    .qm-search-results .qm-article-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1280px) {
    .qm-search-results .qm-article-cards {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1536px) {
    .qm-search-results .qm-article-cards {
        grid-template-columns: repeat(5, 1fr);
        gap: 2rem;
    }
}

/* ========================================
   移动端卡片优化 (< 640px)
   ======================================== */

@media (max-width: 639px) {
    .qm-article-cards .qm-card .qm-card-thumb {
        aspect-ratio: 4 / 3;
        padding: 0.5rem;
    }
    
    .qm-article-cards .qm-card .qm-card-thumb .qm-mockup-image,
    .qm-article-cards .qm-card .qm-card-thumb .qm-mockup-frame {
        width: 70%;
    }
    
    .qm-article-cards .qm-card .qm-card-content {
        margin-top: -25%;
        padding: 0.625rem;
        padding-top: 2.5rem;
    }
    
    /* 移动端标题 */
    .qm-article-cards .qm-card .qm-card-title {
        font-size: 0.8125rem;
        margin-bottom: 0.25rem;
        line-height: 1.4;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
    
    /* 移动端摘要 - 隐藏 */
    .qm-article-cards .qm-card .qm-card-excerpt {
        display: none;
    }
    
    /* 移动端分类标签 */
    .qm-article-cards .qm-card .qm-card-taxonomies {
        margin-bottom: 0.375rem;
        gap: 0.25rem;
    }
    
    .qm-article-cards .qm-card .qm-category-badge,
    .qm-article-cards .qm-card .qm-tag-badge {
        font-size: 0.625rem;
        padding: 0.1875rem 0.5rem;
    }
    
    .qm-article-cards .qm-card .qm-card-footer {
        padding-top: 0.375rem;
        margin-top: 0.375rem;
    }
    
    .qm-article-cards .qm-card .qm-author-avatar {
        width: 1.125rem;
        height: 1.125rem;
    }
    
    .qm-article-cards .qm-card .qm-author-name {
        font-size: 0.625rem;
        max-width: 3rem;
    }
    
    .qm-article-cards .qm-card .qm-card-stats {
        gap: 0.375rem;
    }
    
    .qm-article-cards .qm-card .qm-card-stats span {
        font-size: 0.625rem;
    }
    
    .qm-article-cards .qm-card .qm-card-stats i {
        font-size: 0.5625rem;
    }
    
    /* 卡片 hover 效果减弱 */
    .qm-article-cards .qm-card:hover {
        transform: translateY(-2px);
    }
}

/* ========================================
   深色模式
   ======================================== */

.dark .qm-card {
    background: #1f2937;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dark .qm-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 暗色模式精致几何装饰调整 */
.dark .qm-card-thumb::before {
    background-image: url('../images/pattern-decorative.svg');
    opacity: 0.4;
    mix-blend-mode: screen;
}

.dark .qm-card-thumb .qm-mockup-screen::after {
    background-image: url('../images/pattern-decorative.svg');
    opacity: 0.3;
    mix-blend-mode: screen;
}

.dark .qm-card-title {
    color: #f3f4f6;
}

.dark .qm-card:hover .qm-card-title {
    color: #a78bfa;
}

/* ========================================
   空状态
   ======================================== */

.qm-cards-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1.5rem;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dark .qm-cards-empty {
    background: #1f2937;
}

.qm-cards-empty-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 9999px;
}

.dark .qm-cards-empty-icon {
    background: #374151;
}

.qm-cards-empty-icon i {
    font-size: 1.25rem;
    color: #9ca3af;
}

.qm-cards-empty-text {
    color: #6b7280;
    font-size: 0.875rem;
}

.dark .qm-cards-empty-text {
    color: #9ca3af;
}


    width: 1.25rem;

    height: 1.25rem;

    border-radius: 9999px;

    object-fit: cover;

    border: 2px solid rgba(255,255,255,0.5);

}



.qm-author-name {

    font-size: 0.6875rem;

    color: #6b7280;

    max-width: 4rem;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    font-weight: 500;

}



.qm-card-stats {

    display: flex;

    align-items: center;

    gap: 0.5rem;

}



.qm-card-stats span {

    display: flex;

    align-items: center;

    gap: 0.125rem;

    font-size: 0.6875rem;

    color: #9ca3af;

}



.qm-card-stats i {

    font-size: 0.625rem;

}



/* ========================================

   响应式网格布局

   ======================================== */



.qm-article-cards {

    display: grid;

    gap: 1.5rem;
    grid-template-columns: repeat(2, 1fr);

}



@media (min-width: 640px) {

    .qm-article-cards {

        gap: 1.75rem;
    }

}



@media (min-width: 1024px) {

    .qm-article-cards {

        grid-template-columns: repeat(3, 1fr);

        gap: 2rem;
    }
}

/* 搜索结果页专用：一行最多5个 */
.qm-search-results .qm-article-cards {
        gap: 1.5rem;

    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
    .qm-search-results .qm-article-cards {
        gap: 1.75rem;
    }
}

@media (min-width: 1024px) {
    .qm-search-results .qm-article-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1280px) {
    .qm-search-results .qm-article-cards {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1536px) {
    .qm-search-results .qm-article-cards {
        grid-template-columns: repeat(5, 1fr);
        gap: 2rem;
    }

}



/* ========================================

   移动端卡片优化 (< 640px)

   ======================================== */



@media (max-width: 639px) {

    .qm-article-cards .qm-card .qm-card-thumb {

        aspect-ratio: 4 / 3;

        padding: 0.5rem;

    }

    

    .qm-article-cards .qm-card .qm-card-thumb .qm-mockup-image,

    .qm-article-cards .qm-card .qm-card-thumb .qm-mockup-frame {

        width: 70%;

    }

    

    .qm-article-cards .qm-card .qm-card-content {

        margin-top: -25%;

        padding: 0.625rem;

        padding-top: 2.5rem;

    }

    

    /* 移动端标题 */

    .qm-article-cards .qm-card .qm-card-title {

        font-size: 0.8125rem;

        margin-bottom: 0.25rem;

        line-height: 1.4;

        -webkit-line-clamp: 2;

        line-clamp: 2;

    }

    

    /* 移动端摘要 - 隐藏 */

    .qm-article-cards .qm-card .qm-card-excerpt {

        display: none;

    }

    

    /* 移动端分类标签 */

    .qm-article-cards .qm-card .qm-card-taxonomies {

        margin-bottom: 0.375rem;

        gap: 0.25rem;

    }

    

    .qm-article-cards .qm-card .qm-category-badge,

    .qm-article-cards .qm-card .qm-tag-badge {

        font-size: 0.625rem;

        padding: 0.1875rem 0.5rem;

    }

    

    .qm-article-cards .qm-card .qm-card-footer {

        padding-top: 0.375rem;

        margin-top: 0.375rem;

    }

    

    .qm-article-cards .qm-card .qm-author-avatar {

        width: 1.125rem;

        height: 1.125rem;

    }

    

    .qm-article-cards .qm-card .qm-author-name {

        font-size: 0.625rem;

        max-width: 3rem;

    }

    

    .qm-article-cards .qm-card .qm-card-stats {

        gap: 0.375rem;

    }

    

    .qm-article-cards .qm-card .qm-card-stats span {

        font-size: 0.625rem;

    }

    

    .qm-article-cards .qm-card .qm-card-stats i {

        font-size: 0.5625rem;

    }

    

    /* 卡片 hover 效果减弱 */

    .qm-article-cards .qm-card:hover {

        transform: translateY(-2px);

    }

}



/* ========================================

   深色模式

   ======================================== */



.dark .qm-card {

    background: #1f2937;

}



.dark .qm-card-title {

    color: #f3f4f6;

}



.dark .qm-card:hover .qm-card-title {

    color: #a78bfa;

}



/* ========================================

   空状态

   ======================================== */



.qm-cards-empty {

    grid-column: 1 / -1;

    text-align: center;

    padding: 3rem 1.5rem;

    background: #fff;

    border-radius: 0.75rem;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);

}



.dark .qm-cards-empty {

    background: #1f2937;

}



.qm-cards-empty-icon {

    width: 3.5rem;

    height: 3.5rem;

    margin: 0 auto 0.75rem;

    display: flex;

    align-items: center;

    justify-content: center;

    background: #f3f4f6;

    border-radius: 9999px;

}



.dark .qm-cards-empty-icon {

    background: #374151;

}



.qm-cards-empty-icon i {

    font-size: 1.25rem;

    color: #9ca3af;

}



.qm-cards-empty-text {

    color: #6b7280;

    font-size: 0.875rem;

}



.dark .qm-cards-empty-text {

    color: #9ca3af;

}


