/* 素材库页面样式 */

/* 顶部操作栏 */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.content-header h1 {
    font-size: 20px;
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.search-filter {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.search-filter input {
    width: 200px;
    height: 32px;
    padding: 0 var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.filter-btn {
    height: 32px;
    padding: 0 var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--white);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    transition: all 0.3s;
}

.filter-btn:hover {
    background-color: var(--bg-color);
}

/* 筛选标签栏 */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.filter-tag {
    padding: var(--space-xs) var(--space-md);
    border-radius: 16px;
    background-color: var(--bg-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-tag:hover {
    background-color: var(--border-color);
}

.filter-tag.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* 素材网格 */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-lg);
}

/* 素材卡片 */
.material-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s;
}

.material-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.material-preview {
    position: relative;
    height: 120px;
    overflow: hidden;
}

.material-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.text-preview {
    padding: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--primary-light);
    color: var(--text-primary);
    font-size: 12px;
    overflow: hidden;
}

.text-preview p {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.material-actions {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    opacity: 0;
    transition: opacity 0.3s;
}

.material-preview:hover .material-actions {
    opacity: 1;
}

.material-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.3s;
}

.material-action-btn:hover {
    background-color: var(--primary);
    color: var(--white);
}

.material-info {
    padding: var(--space-md);
}

.material-info h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.material-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.material-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.material-type-tag {
    padding: 2px var(--space-sm);
    border-radius: var(--radius-md);
    background-color: var(--bg-color);
    font-size: 12px;
    color: var(--text-secondary);
}

.material-status-tag {
    padding: 2px var(--space-sm);
    border-radius: var(--radius-md);
    font-size: 12px;
}

.material-status-tag:contains("使用中") {
    background-color: var(--primary-light);
    color: var(--primary);
}

.material-status-tag:contains("未使用") {
    background-color: var(--bg-color);
    color: var(--text-secondary);
}

/* 上传素材卡片 */
.upload-card {
    border: 2px dashed var(--border-color);
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    height: 220px;
}

.upload-card:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.upload-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.upload-card:hover .upload-icon {
    background-color: var(--white);
    color: var(--primary);
}

.upload-card p {
    font-size: 14px;
    color: var(--text-secondary);
}

.upload-card:hover p {
    color: var(--primary);
}

/* 素材预览模态框 */
.material-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-container {
    position: relative;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 1001;
}

.modal-header {
    height: 64px;
    padding: 0 var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 500;
}

.close-modal-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background-color 0.3s;
}

.close-modal-btn:hover {
    background-color: var(--bg-color);
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

.preview-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.preview-container img, 
.preview-container video {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.preview-container .text-content {
    max-width: 600px;
    padding: var(--space-lg);
    background-color: var(--primary-light);
    border-radius: var(--radius-md);
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.material-details p {
    margin-bottom: var(--space-xs);
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: var(--space-sm);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        margin-top: var(--space-md);
    }
    
    .search-filter {
        flex: 1;
    }
    
    .search-filter input {
        width: 100%;
    }
    
    .materials-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .modal-container {
        width: 95%;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .modal-actions {
        width: 100%;
        justify-content: space-between;
    }
}
