/* 作品展示页面样式 */

/* 页面头部 */
.portfolio-page {
    min-height: 100vh;
    padding-top: 80px;
    background: #f5f5f5;
}

.portfolio-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem 0 2rem;
    color: white;
    text-align: center;
}

.portfolio-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.portfolio-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* 分类筛选标签 */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.filter-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

/* 瀑布流容器 */
.portfolio-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* 作品卡片 */
.portfolio-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    break-inside: avoid;
}

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

/* 作者信息 */
.card-author {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #f0f0f0;
}

.author-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.author-info h4 {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 0.2rem;
}

.author-info span {
    font-size: 0.8rem;
    color: #999;
}

/* 卡片文字内容 */
.card-content-text {
    padding: 1rem 1.2rem;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

.card-content-text p {
    margin: 0;
}

/* 图片网格 */
.card-images {
    padding: 0 1.2rem 1rem;
}

.image-grid {
    display: grid;
    gap: 0.5rem;
}

.image-grid.grid-1 {
    grid-template-columns: 1fr;
}

.image-grid.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.image-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.portfolio-image {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-image:hover img {
    transform: scale(1.05);
}

/* 卡片操作按钮 */
.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-top: 1px solid #f0f0f0;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: #f5f5f5;
}

.action-btn .icon {
    font-size: 1.1rem;
}

.action-btn.like-btn:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.action-btn.like-btn.active {
    color: #e74c3c;
}

.action-btn.favorite-btn:hover {
    color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}

.action-btn.favorite-btn.active {
    color: #f39c12;
}

.action-btn.more-btn {
    margin-left: auto;
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 3rem 0;
}

.load-more-btn {
    padding: 1rem 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* 图片预览模态框 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.image-modal.active {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
}

.modal-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-title {
        font-size: 2rem;
    }
    
    .filter-tabs {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .image-grid.grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .portfolio-container {
        padding: 1rem;
    }
    
    .image-grid.grid-2,
    .image-grid.grid-3 {
        grid-template-columns: 1fr;
    }
    
    .card-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .action-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* 隐藏元素（筛选用） */
.portfolio-card.hidden {
    display: none;
}

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

.portfolio-card {
    animation: fadeInUp 0.5s ease forwards;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
