/* 资质证书页面样式 */
.certificates-section {
    padding: 60px 0;
    background-color: #f8f9fa;
}

.certificates-section .section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

.certificates-section .section-desc {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin-bottom: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.certificates-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    justify-items: center;
}

.certificate-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.certificate-item:hover {
    transform: translateY(-5px);
}

.certificate-image-container {
    width: 100%;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    overflow: hidden;
    cursor: pointer;
}

.certificate-item:hover .certificate-image-container {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.certificate-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 4px;
    transition: transform 0.3s ease;
    min-height: 200px;
    background-color: #fafafa;
}

.certificate-item:hover .certificate-image {
    transform: scale(1.02);
}

.certificate-caption {
    margin-top: 15px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    text-align: center;
}

/* 第二行居中显示 */
.certificate-item-center {
    grid-column: 2 / 3; /* 占据中间一列，实现居中 */
    max-width: 400px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .certificates-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
    
    .certificate-item-center {
        grid-column: 2 / 3; /* 保持居中 */
        max-width: 400px;
    }
}

@media (max-width: 992px) {
    .certificates-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .certificate-item-center {
        grid-column: 1 / 3; /* 占满整行，然后通过max-width和margin居中 */
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .certificates-section {
        padding: 40px 0;
    }
    
    .certificates-section .section-title {
        font-size: 28px;
    }
    
    .certificates-section .section-desc {
        font-size: 14px;
        margin-bottom: 30px;
        padding: 0 15px;
    }
    
    .certificates-gallery {
        grid-template-columns: 1fr;
        gap: 25px;
        max-width: 500px;
    }
    
    .certificate-item-center {
        grid-column: 1;
        max-width: 100%;
    }
    
    .certificate-image-container {
        padding: 10px;
    }
    
    .certificate-caption {
        font-size: 14px;
        margin-top: 10px;
    }
    
    .certificate-image {
        min-height: 180px;
    }
}

/* 模态框样式（用于点击放大查看） */
.certificate-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    align-items: center;
    justify-content: center;
}

.certificate-modal.active {
    display: flex;
}

.certificate-modal-content {
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.certificate-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.certificate-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    z-index: 10000;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s ease;
}

.certificate-modal-close:hover {
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
}

