/* ========================================
   卡片相关样式 - 资源卡片、热门下载、标签、按钮
   【风格统一版】去边框化 + 轻阴影 + 轻量化标签
   ======================================== */

/* ========= 资源网格 ========= */
.home-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 10px;
}

/* ========================================
   资源卡片
   ======================================== */

.resource-card {
    display: flex;
    gap: 14px;
    background: white;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    align-items: center;
    overflow: hidden;
    width: 100%;
    min-height: 80px;
}

.resource-card:active {
    transform: translateY(1px);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.06);
}

.resource-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    background: #f3f4f6;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.resource-card-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.resource-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========= 标签（轻量化：极淡背景，接近无背景） ========= */
.resource-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.resource-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.tag-resolution {
    background: rgba(37, 99, 235, 0.06);
    color: #2563EB;
}
.tag-recommend {
    background: rgba(220, 38, 38, 0.06);
    color: #dc2626;
}
.tag-hot {
    background: rgba(147, 51, 234, 0.06);
    color: #9333ea;
}
.tag-new {
    background: rgba(5, 150, 105, 0.06);
    color: #059669;
}
.tag-package {
    background: rgba(217, 119, 6, 0.06);
    color: #d97706;
}

/* ========= 统计信息 ========= */
.resource-card-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: #9ca3af;
    flex-wrap: wrap;
}
.resource-card-stats i {
    font-size: 10px;
    margin-right: 2px;
}
.resource-card-stats span {
    white-space: nowrap;
}
.star-rating {
    color: #f59e0b;
}

/* ========= 描述 ========= */
.resource-card-desc {
    font-size: 11px;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========= 按钮 ========= */
.resource-card-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
    width: 50px;
}

.btn-sm {
    padding: 4px 0;
    border-radius: 18px;
    font-size: 10px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: center;
    width: 100%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-sm:active {
    transform: scale(0.94);
}

.btn-download {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}
.btn-run {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: white;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}
.btn-remove {
    background: linear-gradient(135deg, #f87171, #ef4444);
    color: white;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}

/* ========================================
   热门下载横向滚动
   ======================================== */

.hot-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0 8px 0;
}

.hot-scroll::-webkit-scrollbar {
    display: none;
}

.hot-item {
    flex: 0 0 80px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hot-item:active {
    transform: scale(0.94);
}

.hot-item img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    background: #f3f4f6;
    margin-bottom: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.hot-item .title {
    font-size: 11px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #111827;
    line-height: 1.3;
}

.hot-item .downloads {
    font-size: 10px;
    color: #9ca3af;
}

/* ========================================
   响应式断点
   ======================================== */

/* ========== 超小屏手机（< 400px） ========== */
@media (max-width: 399px) {
    .resource-card {
        padding: 10px 12px;
        min-height: 70px;
        gap: 10px;
        border-radius: 12px;
    }
    .resource-card-icon {
        width: 56px;
        height: 56px;
        border-radius: 10px;
    }
    .resource-card-title {
        font-size: 13px;
    }
    .resource-card-buttons {
        width: 48px;
        gap: 4px;
    }
    .btn-sm {
        font-size: 10px;
        padding: 5px 0;
        border-radius: 14px;
    }
    .resource-tag {
        font-size: 9px;
        padding: 1px 6px;
    }
    .resource-card-stats {
        font-size: 10px;
        gap: 6px;
    }
    .resource-card-stats i {
        font-size: 9px;
    }
    .resource-card-desc {
        font-size: 10px;
    }

    .hot-item {
        flex: 0 0 62px;
    }
    .hot-item img {
        width: 58px;
        height: 58px;
        border-radius: 10px;
    }
    .hot-item .title {
        font-size: 10px;
    }
    .hot-item .downloads {
        font-size: 9px;
    }
}

/* ========== 手机（400-767px） ========== */
@media (min-width: 400px) and (max-width: 767px) {
    .resource-card {
        padding: 12px 14px;
        min-height: 78px;
        gap: 14px;
        border-radius: 12px;
    }
    .resource-card-icon {
        width: 64px;
        height: 64px;
        border-radius: 12px;
    }
    .resource-card-title {
        font-size: 14px;
    }
    .resource-card-buttons {
        width: 58px;
        gap: 5px;
    }
    .btn-sm {
        font-size: 11px;
        padding: 6px 0;
        border-radius: 18px;
    }
    .resource-tag {
        font-size: 10px;
        padding: 1px 8px;
    }
    .resource-card-stats {
        font-size: 11px;
        gap: 8px;
    }
    .resource-card-desc {
        font-size: 11px;
    }

    .hot-item {
        flex: 0 0 74px;
    }
    .hot-item img {
        width: 68px;
        height: 68px;
        border-radius: 12px;
    }
    .hot-item .title {
        font-size: 11px;
    }
}

/* ========== 平板（768-1023px） ========== */
@media (min-width: 768px) and (max-width: 1023px) {
    .home-grid {
        gap: 14px;
    }

    .resource-card {
        padding: 14px 18px;
        min-height: 92px;
        gap: 16px;
        border-radius: 14px;
    }
    .resource-card-icon {
        width: 76px;
        height: 76px;
        border-radius: 14px;
    }
    .resource-card-title {
        font-size: 15px;
    }
    .resource-card-buttons {
        width: 60px;
        gap: 5px;
    }
    .btn-sm {
        font-size: 11.5px;
        padding: 6px 0;
        border-radius: 20px;
    }
    .resource-tag {
        font-size: 11px;
        padding: 2px 10px;
    }
    .resource-card-stats {
        font-size: 12px;
        gap: 12px;
    }
    .resource-card-desc {
        font-size: 12px;
    }

    .hot-item {
        flex: 0 0 88px;
    }
    .hot-item img {
        width: 80px;
        height: 80px;
        border-radius: 14px;
    }
    .hot-item .title {
        font-size: 13px;
    }
}

/* ========== 桌面（1024-1399px） ========== */
@media (min-width: 1024px) and (max-width: 1399px) {
    .home-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .resource-card {
        padding: 16px 20px;
        min-height: 100px;
        gap: 18px;
        border-radius: 14px;
    }
    .resource-card-icon {
        width: 84px;
        height: 84px;
        border-radius: 14px;
    }
    .resource-card-title {
        font-size: 16px;
    }
    .resource-card-buttons {
        width: 62px;
        gap: 6px;
    }
    .btn-sm {
        font-size: 11.5px;
        padding: 6px 0;
        border-radius: 20px;
    }
    .resource-tag {
        font-size: 11px;
        padding: 2px 12px;
    }
    .resource-card-stats {
        font-size: 12px;
        gap: 14px;
    }
    .resource-card-desc {
        font-size: 12px;
    }

    .hot-item {
        flex: 0 0 104px;
    }
    .hot-item img {
        width: 92px;
        height: 92px;
        border-radius: 14px;
    }
    .hot-item .title {
        font-size: 14px;
    }
}

/* ========== 大屏（≥1400px） ========== */
@media (min-width: 1400px) {
    .home-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .resource-card {
        padding: 18px 24px;
        min-height: 112px;
        gap: 20px;
        border-radius: 16px;
    }
    .resource-card-icon {
        width: 92px;
        height: 92px;
        border-radius: 16px;
    }
    .resource-card-title {
        font-size: 17px;
    }
    .resource-card-buttons {
        width: 66px;
        gap: 6px;
    }
    .btn-sm {
        font-size: 12px;
        padding: 6px 0;
        border-radius: 20px;
    }
    .resource-tag {
        font-size: 12px;
        padding: 2px 14px;
    }
    .resource-card-stats {
        font-size: 13px;
        gap: 16px;
    }
    .resource-card-desc {
        font-size: 13px;
    }

    .hot-item {
        flex: 0 0 120px;
    }
    .hot-item img {
        width: 104px;
        height: 104px;
        border-radius: 16px;
    }
    .hot-item .title {
        font-size: 15px;
    }
    .hot-item .downloads {
        font-size: 12px;
    }
}