/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

/* 修正：Container 仅负责宽度和居中，移除全局 Flex，避免布局冲突 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    /* 移除 display: flex; justify-content: space-between; */
}

/* 头部导航 - 单独设置 Flex */
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 15px;
    color: black;
    flex-shrink: 0;
}

.logo span {
    font-size: 14px;
}

.highlight {
    color: #ff0000;
}

.logo img {
    height: 70px;
    width: auto;
}

.nav ul {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    white-space: nowrap;
}

.nav a.active {
    color: #ffffff;
    font-weight: bold;
    background-color: #0056b3;
    border-radius: 50px;
    padding: 10px 20px;
}

.nav a:hover {
    font-weight: bold;
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* 轮播图容器 */
.slider-container {
    margin-top: 80px;
    position: relative;
    overflow: hidden;
    height: 650px;
    width: 100%;
}

.slider {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
    width: 100%;
}

.slider img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prev-btn,
.next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
}

.prev-btn { left: 20px; }
.next-btn { right: 20px; }

/* 关于我们部分 */
.about-section h1 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 4rem;
    color: #4ca7ed;
    background: #262525;
    padding: 10px 0;
    margin-top: 10px;
}

/* 修正：About Row 需要 Flex，但 Container 不需要 */
.about-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 60px;
}

.about-text {
    flex: 1;
    padding: 20px;
}

.about-text p {
    line-height: 1.6;
    color: #000;
    font-size: 24px;
    font-family: "Times New Roman";
    font-weight: 700;
}

.about-image {
    flex: 1;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

@media (max-width: 768px) {
    .about-row {
        flex-direction: column;
        gap: 20px;
    }
    .about-image { order: 1; width: 100%; }
    .about-text { order: 2; width: 100%; padding: 10px 0; }
    .about-section h1 { font-size: 2rem; }
}

/* --- Product Display Section Styles --- */
.product-display { padding-bottom: 50px; }

.product-banner {
    background-image: url('../img/P1.jpg');
    background-size: cover;
    background-position: center;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 140px;
}

.product-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.product-banner .title {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 60px 15px;
}

.product-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-img {
    width: 100%;
    height: 250px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.product-img img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-item:hover .product-img img {
    transform: scale(1.1);
}

.product-info {
    padding: 15px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-info h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

/* 桌面端：中间列向上偏移40% - 九宫格错位效果 */
@media (min-width: 769px) {
    .product-grid { 
        grid-auto-rows: minmax(250px, auto); 
    }
    .product-grid .product-item:nth-child(3n+2) {
        transform: translateY(-50%);
        z-index: 1;
    }
    .product-grid .product-item:nth-child(3n+2):hover {
        transform: translateY(calc(-50% - 5px));
    }
}

@media (max-width: 768px) {
    .product-banner { height: 250px; }
    .product-banner .title { font-size: 2rem; }
    .product-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 15px; 
        padding: 40px 15px;
    }
    .product-grid .product-item:nth-child(3n+2) { 
        transform: none; 
        z-index: auto; 
    }
    .product-img {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .product-grid { 
        grid-template-columns: 1fr; 
    }
}

/* --- Field Service Section Styles (与 About Us 完全一致的结构) --- */
.field-service {
    padding-bottom: 80px;
    background-color: #262525;
    color: #fff;
}

.service-banner {
    background-image: url('../img/F1.png');
    background-size: cover;
    background-position: center;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 60px;
}

.service-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.service-banner .title {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 3.5rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0;
    font-weight: bold;
}

/* 关键：与 .about-row 完全相同的 flex 布局 */
.service-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 60px;
}

.service-text {
    flex: 1;
    padding: 20px;
}

.service-text h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #fff;
    line-height: 1.3;
}

.service-image {
    flex: 1;
}

.service-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    display: block;
}

/* 移动端适配 - 完全复制 about-row 的响应式规则 */
@media (max-width: 768px) {
    .service-banner {
        height: 250px;
    }
    .service-banner .title {
        font-size: 2rem;
    }
    .service-row {
        flex-direction: column;
        gap: 20px;
        margin-bottom: 40px;
    }
    .service-image {
        order: 1;
        width: 100%;
    }
    .service-text {
        order: 2;
        width: 100%;
        padding: 10px 0;
        text-align: center;
    }
    .service-text h2 {
        font-size: 1.5rem;
        text-align: center;
    }
}

/* --- Contact Us Section Styles --- */
.contact-us {
    padding: 80px 0;
    background-color: #262525;
    color: #fff;
}

.contact-banner {
    background-image: url('../img/C1.jpg');
    background-size: cover;
    background-position: center;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 60px;
}

.contact-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.contact-banner .title {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 3.5rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0;
    font-weight: bold;
}

.contact-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-info h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #fff;
}

.contact-info p {
    margin: 10px 0;
    color: #ccc;
    line-height: 1.6;
    font-size: 1rem;
}

.contact-form {
    flex: 1;
    min-width: 300px;
    /* background: rgba(255, 255, 255, 0.05); */
    padding: 30px;
    border-radius: 8px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 20px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #ddd;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #444;
    background-color: #333;
    color: #fff;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-group textarea {
    resize: vertical;
    height: 120px;
}

.submit-btn {
    background-color: #3498db;
    color: white;
    padding: 12px 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s;
    display: inline-block;
}

.submit-btn:hover {
    background-color: #2980b9;
}

/* 表单提交状态消息 */
.form-messege {
    margin-top: 15px;
    font-size: 0.95rem;
    line-height: 1.5;
    min-height: 1.5em;
}

.form-messege.success {
    color: #28a745;
}

.form-messege.error {
    color: #e74c3c;
}

/* 邮箱链接样式 */
.email-link {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.email-link:hover {
    color: #ff0000;
    text-decoration: underline;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

/* 页脚 */
.footer {
    background-color: #1a1a1a;
    color: #fff;
    padding: 30px 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-content p {
    margin: 10px 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-content p:first-child {
    font-weight: bold;
}

/* 联系我们部分的移动端适配 */
@media (max-width: 768px) {
    .contact-banner { height: 250px; }
    .contact-banner .title { font-size: 2rem; }
    
    .contact-container {
        flex-direction: column;
        gap: 40px;
    }
    
    .contact-info, .contact-form {
        width: 100%;
        min-width: auto;
    }
    
    .form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .contact-form {
        padding: 20px;
    }

    /* 移动端调整滚动偏移 */
    html {
        scroll-padding-top: 80px;
    }

    /* 导航栏移动端 */
    .menu-toggle {
        display: flex;
    }
    
    .nav {
        position: fixed;
        top: 80px;
        left: 100%;
        width: 100%;
        height: calc(100vh - 100px);
        background: white;
        transition: 0.3s;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    }
    
    .nav.active {
        left: 0%;
    }
    
    .nav ul {
        flex-direction: column;
        padding: 20px;
    }
    
    .nav a {
        display: block;
        padding: 12px;
    }
    
    .nav a.active {
        display: inline-block;
    }

    /* 轮播图移动端 */
    .slider-container {
        height: 400px;
        margin-top: 80px;
    }
    
    .prev-btn, .next-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    /* 邮箱链接移动端 */
    .email-link {
        word-break: break-all;
    }
}

@media (max-width: 480px) {
    .logo span {
        font-size: 14px;
    }
    
    .logo img {
        height: 50px;
    }
    
    .slider-container {
        height: 300px;
    }
    
    .about-text p {
        font-size: 16px;
    }
    
    .service-text h2 {
        font-size: 1.3rem;
    }
    
    .contact-info h3 {
        font-size: 1.3rem;
    }
    
    .contact-info p {
        font-size: 0.9rem;
    }
}