/* ==================================================================
   资源卡片组件样式
   ================================================================== */

/* 资源项目卡片 */
.resource-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-normal);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.resource-item:hover {
    border-color: var(--primary-color);
}

/* 封面区域 */
.resource-cover {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 比例 */
    overflow: hidden;
    background: linear-gradient(135deg, var(--gradient-purple) 0%, var(--gradient-purple-dark) 100%);
    position: relative;
}

.resource-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.resource-item:hover .resource-cover img {
    transform: scale(1.05);
}

.cover-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 16px;
    font-weight: 500;
}

/* 内容区域 */
.resource-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* 资源标题 */
.resource-title {
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.5;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 标签区域 */
.resource-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: auto;
    padding-bottom: 16px;
}

.resource-tags .tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* 栏目标签：主题蓝色背景 + 白色文字 */
.tag-category {
    background: var(--primary-color) !important;
    color: var(--text-white) !important;
}

/* 下载区域 */
.resource-download {
    margin-top: auto;
}

.download-btn {
    display: block;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: var(--text-white);
    border-radius: 24px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.2);
    position: relative;
    overflow: hidden;
    width: 100%;
    text-align: center;
    cursor: pointer;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s ease;
}

.download-btn:hover::before {
    left: 100%;
}

.download-btn:active {
    transform: translateY(0);
}

/* ==================================================================
   主题适配（暗色/浅色）
   ================================================================== */

/* 暗色主题 */
[data-theme="dark"] .resource-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .resource-item:hover {
    border-color: var(--primary-color);
}

[data-theme="dark"] .resource-title {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .resource-download {
    border-top-color: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* 浅色主题 */
[data-theme="light"] .resource-item {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

/* ==================================================================
   响应式设计
   ================================================================== */

/* 移动端: 0 - 767px */
@media (max-width: 767px) {
    .resource-item {
        padding: 16px;
    }
    
    .resource-title {
        font-size: 16px;
    }
    
    .resource-download {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
    }
}

