:root {
    --primary-color: #4361ee;
    --primary-hover: #3a56d4;
    --secondary-color: #6c757d;
    --light-bg: #f8f9fa;
    --dark-text: #212529;
    --border-color: #e9ecef;
    --success-color: #2ecc71;
}

/* 作品集封面区域 */
.portfolio-header {
    position: relative;
    height: 300px;
    background-color: #f8f9fa;
    overflow: hidden;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.portfolio-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
    z-index: 2;
}

.portfolio-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    color: white;
    z-index: 3;
}

.portfolio-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.portfolio-description {
    font-size: 1.1rem;
    max-width: 80%;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.portfolio-meta {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

.portfolio-author {
    display: flex;
    align-items: center;
    margin-right: 1.5rem;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 0.5rem;
    border: 2px solid rgba(255,255,255,0.5);
}

/* 作品集内容区域 */
.portfolio-content {
    padding: 2rem 0;
}

/* 搜索和排序区域样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    margin-bottom: 0.5rem;
}

.section-actions {
    display: flex;
    align-items: stretch; /* 确保子元素拉伸到相同高度 */
    gap: 10px; /* 元素之间的间距 */
}

.search-container {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

#articleSearchInput {
    width: 100%;
    height: 38px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
}

.sort-dropdown .btn {
    height: 38px;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    display: inline-flex;
    align-items: center;
    background-color: #fff;
    color: #495057;
}

.sort-dropdown .btn:hover {
    background-color: #f8f9fa;
}

.sort-dropdown .btn i {
    margin-right: 5px;
}

/* 文章网格 */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.article-card {
    display: block;
    text-decoration: none;
    color: var(--dark-text);
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    text-decoration: none;
    color: var(--dark-text);
}

.article-cover {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-cover img {
    transform: scale(1.05);
}

.card-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-excerpt {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-top: 0.75rem;
}

.article-author {
    display: flex;
    align-items: center;
    margin-right: 0.5rem;
}

.article-author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid rgba(0,0,0,0.1);
}

.article-author .author-name {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin: 0;
}

.article-date {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.article-date i {
    margin-right: 0.25rem;
    font-size: 0.8rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.empty-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-description {
    font-size: 1rem;
    color: var(--secondary-color);
    max-width: 500px;
    margin: 0 auto;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .portfolio-header {
        height: 250px;
    }

    .portfolio-title {
        font-size: 2rem;
    }

    .portfolio-description {
        max-width: 100%;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .section-actions {
        width: 100%;
        margin-top: 1rem;
    }

    .search-container {
        max-width: none;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.stagger-children > * {
    opacity: 0;
}

.stagger-children > *.fade-in {
    animation-delay: calc(var(--child-index, 0) * 100ms);
}

/* 添加卡片点击动画 */
@keyframes cardClick {
    0% { transform: scale(1); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
    50% { transform: scale(0.98); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
    100% { transform: scale(1); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
}

.card-clicked {
    animation: cardClick 0.3s ease;
}

/* 确保整个卡片可点击 */
.article-card {
    cursor: pointer;
    position: relative;
}

/* 确保卡片内的链接不影响整体点击 */
.article-card * {
    pointer-events: none;
}

/* 但允许链接本身可点击 */
.article-card a {
    pointer-events: auto;
}