/**
 * 电脑 Mockup 卡片样式
 * 使用前端 SVG 叠加方式
 */

/* ========================================
   卡片容器
   ======================================== */

.qm-card.qm-card-mockup {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    gap: 0;
    align-items: stretch;
}

.qm-card.qm-card-mockup::before {
    content: none;
}

.qm-card.qm-card-mockup:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ========================================
   Mockup 区域 - SVG 叠加方式
   ======================================== */

.qm-mockup-area {
    position: relative;
    overflow: hidden;
    /* 基于 SVG viewBox 200 100 1200 980 的宽高比 */
    aspect-ratio: 1200 / 980;
    /* 贴边显示，无边距 */
    width: 100%;
    margin: 0;
    /* 圆角只在顶部 */
    border-radius: 12px 12px 0 0;
}

.qm-mockup-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 缩略图 - 定位到屏幕区域 */
.qm-mockup-screen {
    position: absolute;
    /* 屏幕区域坐标（基于 viewBox 200 100 1200 980）*/
    /* 屏幕在 SVG 中: x=288, y=187, w=1024, h=576 */
    /* left: (288-200)/1200 = 7.33% */
    /* top: (187-100)/980 = 8.88% */
    /* width: 1024/1200 = 85.33% */
    /* height: 576/980 = 58.78% */
    left: 7.33%;
    top: 8.88%;
    width: 85.33%;
    height: 58.78%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #1a1a2e;
    z-index: 0;
    transition: transform 0.4s ease;
    transform: scale(0.94);
    transform-origin: center;
}

.qm-card.qm-card-mockup:hover .qm-mockup-screen {
    transform: scale(0.97);
}

/* SVG 框架 - 覆盖在缩略图上方 */
.qm-mockup-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}


/* ========================================
   卡片内容区域
   ======================================== */

.qm-card.qm-card-mockup > a {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 100%;
}

.qm-card.qm-card-mockup .qm-card-content {
    padding: 14px;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 160px;
    flex: 1;
}

/* 标题 */
.qm-card.qm-card-mockup .qm-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 8px 0;
}

.qm-card.qm-card-mockup:hover .qm-card-title {
    color: #7c3aed;
}

/* 摘要 */
.qm-card.qm-card-mockup .qm-card-excerpt {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 10px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    word-break: break-all;
}

/* 分类/标签区域 - 横向滚动 */
.qm-card-tags {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 2px;
}

.qm-card-tags::-webkit-scrollbar {
    display: none;
}

.qm-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 分类标签多色 */
.qm-tag-cat[data-index="0"] { background: rgba(124, 58, 237, 0.1); color: #7c3aed; }
.qm-tag-cat[data-index="1"] { background: rgba(236, 72, 153, 0.1); color: #ec4899; }
.qm-tag-cat[data-index="2"] { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.qm-tag-cat[data-index="3"] { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.qm-tag-cat[data-index="4"] { background: rgba(249, 115, 22, 0.1); color: #f97316; }
.qm-tag-cat[data-index="5"] { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

/* 底部信息 */
.qm-card.qm-card-mockup .qm-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
    margin-top: auto;
}

/* 作者信息 */
.qm-card-author {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qm-author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.qm-author-name {
    font-size: 12px;
    color: #6b7280;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qm-card-time {
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========================================
   深色模式
   ======================================== */

.dark .qm-card.qm-card-mockup {
    background: #1f2937;
}

.dark .qm-mockup-area {
    background: #111827;
}

.dark .qm-card.qm-card-mockup .qm-card-content {
    background: #1f2937;
}

.dark .qm-card.qm-card-mockup .qm-card-title {
    color: #f9fafb;
}

.dark .qm-card.qm-card-mockup .qm-card-excerpt {
    color: #9ca3af;
}

.dark .qm-card.qm-card-mockup .qm-card-footer {
    border-top-color: #374151;
}


/* ========================================
   移动端优化 (< 640px)
   ======================================== */

@media (max-width: 639px) {
    /* 卡片内容区域 */
    .qm-card.qm-card-mockup .qm-card-content {
        padding: 10px;
        min-height: auto;
    }
    
    /* 标题 - 单行省略 */
    .qm-card.qm-card-mockup .qm-card-title {
        font-size: 12px;
        margin-bottom: 4px;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }
    
    /* 摘要 - 两行省略 */
    .qm-card.qm-card-mockup .qm-card-excerpt {
        font-size: 10px;
        margin-bottom: 6px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        line-height: 1.4;
    }
    
    /* 分类标签 - 横向滚动 */
    .qm-card-tags {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
        margin-bottom: 6px;
        padding-bottom: 2px;
    }
    
    .qm-card-tags::-webkit-scrollbar {
        display: none;
    }
    
    .qm-tag {
        font-size: 9px;
        padding: 1px 6px;
        flex-shrink: 0;
    }
    
    /* 底部信息 */
    .qm-card.qm-card-mockup .qm-card-footer {
        padding-top: 6px;
    }
    
    .qm-author-avatar {
        width: 14px;
        height: 14px;
    }
    
    .qm-author-name {
        font-size: 9px;
        max-width: 40px;
    }
    
    .qm-card-time {
        font-size: 9px;
    }
    
    .qm-card-time i {
        font-size: 8px;
    }
}
