/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 35px 0;
    text-align: center;
}

header h1 {
    font-size: 2em;
    margin-bottom: 8px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* 导航栏样式 */
nav {
    background-color: #333;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    transition: transform 0.3s ease-in-out;
}

nav.hidden {
    transform: translateY(-100%);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    position: absolute;
    top: 20px;
    right: 20px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 15px 10px;
    display: block;
    transition: background-color 0.3s;
}

nav ul li a:hover,
nav ul li a.active {
    background-color: #555;
}

/* 轮播图样式 */
.slider {
    position: relative;
    height: 500px;
    overflow: hidden;
    margin-top: 0; /* 减小与header的间距 */
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    bottom: 30px;
    left: 30px;
    color: white;
    background: rgba(0, 0, 0, 0.2); /* 增加透明度 */
    padding: 10px;
    border-radius: 5px;
    max-width: 30%;
}

.slide-content h2 {
    font-size: 2em;
    margin-bottom: 1px;
}

.slider-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 20px;
}

.slider-controls span {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5em;
    transition: background 0.3s;
}

.slider-controls span:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* 公司介绍样式 */
.about {
    padding: 10px 0;
    background-color: #f8f9fa;
}

.about h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 10px;
    color: #d32f2f;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: bold;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.about-content {
    display: flex;
    gap: 10px;
    align-items: center;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 8px;
    font-size: 1em;
    text-indent: 2em;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 服务项目样式 */
.services {
    padding: 15px 0;
}

.services h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 15px;
    color: #333;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.service-item {
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.service-item:hover {
    transform: translateY(-10px);
}

.service-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 8px;
}

.service-item h3 {
    font-size: 1.4em;
    margin-bottom: 6px;
    color: #333;
}

/* 案例展示样式 */
.gallery {
    padding: 15px 0;
    background-color: #f8f9fa;
}

.gallery h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 15px;
    color: #333;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 4px; /* 减小证书之间的间距 */
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    border-radius: 10px;
    transition: transform 0.3s;
}

.gallery-item img:hover {
    transform: scale(1.05);
}

/* 合作伙伴样式 */
.partners {
    padding: 10px 0;
}

.partners h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 10px;
    color: #333;
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.partner-item img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s;
    cursor: pointer;
}

.partner-item img:hover {
    transform: scale(1.05);
}

/* 联系我们样式 */
.contact {
    padding: 15px 0;
}

.contact h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 15px;
    color: #333;
}

.contact-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.contact-info h3,
.contact-form h3 {
    font-size: 1.4em;
    margin-bottom: 8px;
    color: #333;
}

.contact-info p {
    margin-bottom: 6px;
    font-size: 1em;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 15px 0;
}

/* 图片放大模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    max-height: 80%;
    object-fit: contain;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

.modal-content, #caption {
    animation-name: zoom;
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {transform: scale(0)}
    to {transform: scale(1)}
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    header {
        padding: 25px 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    nav ul {
        position: fixed;
        top: 70px;
        left: 0;
        background-color: #333;
        width: 100%;
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    
    nav ul.show {
        transform: translateX(0);
    }
    
    nav ul li {
        margin: 5px 0;
    }
    
    .slider {
        height: 300px;
        margin-top: 0; /* 减小与header的间距 */
    }
    
    .slide-content {
        left: 20px;
        bottom: 20px;
        max-width: 80%;
    }
    
    .slide-content h2 {
        font-size: 1.5em;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .partners-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 100%;
    }
}