/* 作品集页面样式 */

/* 页面标题区域 */
.page-header {
    background: linear-gradient(135deg, #000000 0%, #111111 50%, #000000 100%);
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
}

.page-title {
    font-family: 'Playfair Display', 'Times New Roman', serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 1.3rem;
    color: #cccccc;
    font-weight: 300;
    animation: fadeInUp 1s ease 0.2s both;
    letter-spacing: 0.02em;
}

/* 作品展示区域 */
.portfolio-gallery {
    padding: 80px 0;
    background: #0a0a0a;
    min-height: 100vh;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #111111;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item .zoom-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #000000;
    z-index: 2;
    transition: transform 0.3s ease;
}

.gallery-item:hover .zoom-icon {
    transform: translate(-50%, -50%) scale(1);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.close-btn {
    position: absolute;
    top: -50px;
    right: 0;
    color: #ffffff;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1001;
}

.close-btn:hover {
    color: #cccccc;
}

/* 模态框导航按钮 */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.prev-btn {
    margin-left: 2rem;
}

.next-btn {
    margin-right: 2rem;
}

/* 图片计数器 */
.image-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 0;
    color: #cccccc;
    font-size: 1.1rem;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #333333;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-header {
        padding: 100px 0 60px;
    }
    
    .page-title {
        font-size: 2.8rem;
    }
    
    .page-subtitle {
        font-size: 1.1rem;
    }
    
    .portfolio-gallery {
        padding: 60px 0;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .gallery-item img {
        height: 250px;
    }
    
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .nav-btn {
        font-size: 1.5rem;
        padding: 0.8rem;
    }
    
    .prev-btn {
        margin-left: 1rem;
    }
    
    .next-btn {
        margin-right: 1rem;
    }
    
    .close-btn {
        top: -40px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 2.4rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .gallery-item img {
        height: 280px;
    }
    
    .nav-btn {
        font-size: 1.2rem;
        padding: 0.6rem;
    }
    
    .prev-btn {
        margin-left: 0.5rem;
    }
    
    .next-btn {
        margin-right: 0.5rem;
    }
}

@media (max-width: 360px) {
    .page-title {
        font-size: 2rem;
    }
    
    .gallery-item img {
        height: 250px;
    }
    
    .nav-btn {
        font-size: 1rem;
        padding: 0.5rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .gallery-item:hover {
        transform: none;
    }
    
    .gallery-item:hover img {
        transform: none;
    }
    
    .gallery-item:hover::before {
        opacity: 0;
    }
    
    .gallery-item:hover .zoom-icon {
        transform: translate(-50%, -50%) scale(0);
    }
    
    .gallery-item:active {
        transform: scale(0.98);
    }
    
    .nav-btn:active {
        transform: scale(0.95);
    }
}
