/* css/card.css - 资源卡片通用样式 */

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
    padding: 16px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 文本截断 */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* 资源卡片基础样式 */
.resource-img {
    width: 56px;
    height: 56px;
}
.resource-title {
    font-size: 15px;
}
.resource-vendor, .resource-stats, .resource-desc {
    font-size: 13px;
}
.resource-tag {
    font-size: 12px;
}
.resource-download-btn, .resource-run-btn {
    font-size: 13px;
    padding: 6px 12px;
}

/* 桌面端样式 */
@media (min-width: 768px) {
    .resource-img {
        width: 80px;
        height: 80px;
    }
    .resource-title {
        font-size: 17px;
    }
    .resource-vendor, .resource-stats, .resource-desc {
        font-size: 15px;
    }
    .resource-tag {
        font-size: 14px;
        padding: 3px 6px;
    }
    .resource-download-btn, .resource-run-btn {
        font-size: 15px;
        padding: 8px 16px;
    }
}

/* 修复：图标容器垂直居中 */
.card-hover .flex.items-start {
    align-items: center !important;
}

/* 确保整个卡片内容垂直居中 */
.card-hover .flex-1.min-w-0.flex.flex-col {
    justify-content: space-between;
    min-height: 140px;
}

/* 时间显示优化 */
.resource-time {
    display: flex;
    align-items: flex-start;
    line-height: 1.2;
    font-size: 11px;
    text-align: left;
    min-width: 85px;
}

.resource-time .flex.flex-col {
    margin-left: 2px;
}

.resource-date {
    font-weight: 500;
}

.resource-time-detail {
    font-size: 10px;
    color: #6b7280;
    margin-top: 1px;
}

.resource-time .fa-clock-o {
    color: #9ca3af;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 0;
}

/* 底部操作栏布局优化 */
.card-bottom-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 32px;
    gap: 8px;
}

.card-buttons {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

/* 按钮样式优化 */
.resource-download-btn,
.resource-run-btn {
    min-width: 65px;
    height: 36px;
    text-align: center;
    justify-content: center;
    font-size: 13px;
    padding: 8px 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    border-radius: 6px;
    font-weight: 500;
}

/* 收藏/删除按钮增大 */
.favorite-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.favorite-btn .fa {
    font-size: 14px !important;
}

/* 按钮组间距调整 */
.card-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

/* 底部操作栏高度调整 */
.card-bottom-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 40px;
    gap: 12px;
}

/* 移动端按钮适配 */
@media (max-width: 767px) {
    .resource-download-btn,
    .resource-run-btn {
        min-width: 60px;
        height: 32px;
        font-size: 12px;
        padding: 5px 8px;
    }
    
    .favorite-btn {
        width: 30px !important;
        height: 30px !important;
    }
    
    .card-buttons {
        gap: 6px;
    }
}

/* 桌面端按钮进一步增大 */
@media (min-width: 768px) {
    .resource-download-btn,
    .resource-run-btn {
        min-width: 70px;
        height: 38px;
        font-size: 14px;
        padding: 9px 14px;
    }
    
    .favorite-btn {
        width: 34px !important;
        height: 34px !important;
    }
    
    .favorite-btn .fa {
        font-size: 15px !important;
    }
}

/* 按钮悬停效果增强 */
.resource-download-btn:hover,
.resource-run-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.favorite-btn:hover {
    background-color: #f3f4f6 !important;
    transform: scale(1.1);
}

/* 确保时间区域有足够空间 */
.resource-time {
    min-width: 90px;
}

/* 移动端专属网格布局 */
.home-grid {
    grid-template-columns: repeat(1, 1fr);
}
/* 平板和桌面端专属网格布局 */
@media (min-width: 768px) {
    .home-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}