/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    width: 100%;
    overflow-x: hidden; /* 防止水平滚动 */
}

/* 删除顶部边框线 */
/* body::before {
    content: "";
    display: block;
    height: 3px;
    width: 100%;
    background-color: #f7941d;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
} */

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* 头部样式 */
header {
    display: flex;
    justify-content: flex-start; /* 改为flex-start使整个header左对齐 */
    align-items: flex-start; /* 改为flex-start使元素从顶部对齐 */
    padding-top: 0; /* 移除顶部内边距 */
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
    height: 125px; /* 保持header高度为125px */
    width: 100%; /* 宽度100% */
    max-width: 100%; /* 移除最大宽度限制 */
    margin: 0; /* 移除居中 */
}

.logo-container {
    padding-left: 128px; /* 保持左侧内边距185px */
    padding-top: 0; /* 确保logo从顶部开始 */
    display: flex;
    align-items: flex-start; /* 改为flex-start使logo从顶部对齐 */
    width: auto; /* 自动宽度 */
    margin-right: 30px; /* 恢复右侧间距，使logo和菜单有适当间隔 */
}

.logo-container img {
    height: 96px; /* 保持logo大小 */
    margin-top: 0; /* 确保logo从顶部开始 */
}

nav {
    flex-grow: 1; /* 恢复占用可用空间 */
    margin-right: 0; /* 移除右侧边距 */
    margin-top: 28px; /* 添加顶部边距，使菜单位于适当位置 */
}

.main-menu {
    display: flex;
    justify-content: flex-start; /* 改为flex-start使菜单项左对齐 */
    margin-left: 0; /* 保持无左边距 */
    height: 100%; /* 确保菜单高度占满导航区域 */
}

.main-menu > li {
    position: relative;
    margin: 0 15px; /* 增加菜单项间距 */
    display: flex;
    align-items: center; /* 垂直居中 */
    height: 100%; /* 确保菜单项高度占满 */
}

.main-menu > li > a {
    display: block;
    padding: 4px 20px; /* 增加内边距 */
    color: #333;
    font-weight: normal;
    transition: background-color 0.3s;
    font-size: 16px; /* 增加字体大小 */
    text-transform: none;
}

/* 移除第一个菜单项（比例阀）的默认橙色背景 */
.main-menu > li:first-child > a {
    background-color: transparent; /* 移除背景色 */
    color: #333;
}

/* 鼠标悬停时的样式 */
.main-menu > li > a:hover,
.main-menu > li:hover > a {
    background-color: #f7941d;
    color: #333;
}

/* 一级下拉菜单样式 */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 100%; /* 确保子菜单至少与父菜单项一样宽 */
    background-color: #333;
    display: none;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.main-menu > li:hover > .submenu {
    display: block;
}

.submenu li {
    position: relative;
    display: block;
    width: 100%;
}

.submenu li a {
    display: block;
    padding: 12px 20px;
    color: #fff;
    border-bottom: 1px solid #444;
    transition: background-color 0.3s;
    font-size: 14px;
    white-space: nowrap; /* 防止文本换行 */
}

.submenu li a:hover {
    background-color: #444;
}

/* 二级下拉菜单样式 */
.has-submenu {
    position: relative;
}

.submenu-level2 {
    position: absolute;
    top: 0;
    left: 100%;
    width: auto; /* 自动宽度 */
    min-width: 250px; /* 最小宽度 */
    background-color: #333;
    display: none;
    z-index: 101;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

.has-submenu:hover .submenu-level2 {
    display: block;
}

.submenu-level2 li a {
    display: block;
    padding: 12px 15px;
    color: #fff;
    border-bottom: 1px solid #444;
    transition: background-color 0.3s;
    font-size: 14px;
    white-space: nowrap; /* 防止文本换行 */
}

.submenu-level2 li a:hover {
    background-color: #444;
}


/* Banner区域样式 */
.hero {
    background-image: url('../images/iqvalves/banner.jpg'); /* 恢复使用CSS背景图片 */
    background-size: cover;
    background-position: center;
    height: 500px;
    position: relative;
    width: 100%;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    z-index: 2;
}

.hero-content h1 {
    font-family: "Times New Roman", Times, serif;
    font-size: 36px;
    font-style: italic;
    color: #1e5b80; /* 蓝色，与图片中一致 */
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

/* 内容区域通用样式 */
section {
    padding: 60px 0;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.text-content {
    flex: 1;
    padding: 0 30px;
}

.image-container {
    flex: 1;
    text-align: center; /* 默认居中对齐 */
}

/* 比例阀和比例阀驱动器部分的图片右对齐 */
.proportional-valves .image-container,
.valve-driver .image-container {
    text-align: right; /* 图片右对齐 */
}

/* 比例阀驱动器和保持电路部分的图片向左移动20px */
.valve-driver .image-container img {
    margin-right: 80px; /* 向左移动20px */
}

/* 开关电磁阀部分的图片左对齐 */
.solenoid-valves .image-container {
    text-align: left; /* 图片左对齐 */
}

h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
}

p {
    margin-bottom: 20px;
    line-height: 1.6;
}

.learn-more {
    display: inline-block;
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.learn-more:hover {
    background-color: #f7941d;
}

/* 特定区域样式 */
.proportional-valves {
    background-color: #f9f9f9;
}

.mission {
    background-color: transparent; /* 改为透明背景 */
    color: #fff;
    text-align: center;
    padding: 0; /* 移除内边距 */
    position: relative;
    overflow: hidden; /* 防止内容溢出 */
}

/* 使用图片作为内容而非背景 */
.mission-image {
    width: 100%;
    display: block;
    position: relative;
}

/* 添加半透明遮罩，确保文字可读性 */
.mission::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(51, 51, 51, 0.7); /* 深色半透明遮罩 */
    z-index: 1;
}

.mission-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2; /* 确保内容在遮罩上方 */
    width: 100%;
}

.mission h2 {
    color: #fff;
}

/* 修改开关电磁阀部分的布局，使图片在左边，文字在右边 */
.solenoid-valves .content-container {
    flex-direction: row; /* 改为row，使图片在左，文字在右 */
}

/* 为什么选择我们 */
.why-choose-us {
    background-color: #f9f9f9;
    text-align: center;
    padding: 60px 20px;
}

.features {
    display: flex;
    justify-content: center;
    max-width: 1200px;
    margin: 40px auto 0;
}

.feature {
    flex: 1;
    padding: 0 20px;
    max-width: 300px;
}

.icon {
    margin-bottom: 20px;
}

.icon img {
    height: 60px;
}

h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

/* 页脚样式 */
footer {
    background-color: #222;
    color: #fff;
    padding: 50px 0 20px;
}

.footer-content {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.company-info {
    flex: 1;
}

.footer-links {
    flex: 2;
}

.footer-links ul {
    columns: 2;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ccc;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #f7941d;
}

.footer-logo {
    flex: 1;
    text-align: right;
    display: flex;
    justify-content: flex-end; /* 确保内容靠右对齐 */
    margin-left: auto; /* 将元素推到最右侧 */
}

.footer-logo img {
    height: 230px;
    margin-right: 0; /* 确保图片没有右边距 */
}

.copyright {
    max-width: 1200px;
    margin: 30px auto 0;
    padding: 20px 20px 0;
    border-top: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-media img {
    height: 24px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .content-container, 
    .features,
    .footer-content {
        flex-direction: column;
    }
    
    .text-content, 
    .image-container,
    .feature {
        width: 100%;
        max-width: 100%;
        margin-bottom: 30px;
    }
    
    .solenoid-valves .content-container {
        flex-direction: column;
    }
}

/* 移动端菜单样式 */
.mobile-menu-toggle {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 20px;
    cursor: pointer;
    z-index: 1002;
    width: 40px;
    height: 40px;
    text-align: center;
    background-color: transparent;
    border-radius: 4px;
}

.menu-icon {
    font-size: 36px;
    line-height: 40px;
    display: block;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 1001;
    overflow-y: auto;
    padding-top: 60px;
}

.mobile-menu-close {
    position: fixed;
    top: 20px;
    right: 20px;
    cursor: pointer;
    z-index: 1003;
    width: 40px;
    height: 40px;
    text-align: center;
    background-color: transparent;
    border-radius: 4px;
}

.close-icon {
    font-size: 36px;
    line-height: 40px;
    display: block;
}

.mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-top: 20px;
}

.mobile-menu li {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.mobile-menu a {
    color: #333;
    text-decoration: none;
    font-size: 18px;
    display: block;
}

.mobile-menu .submenu {
    display: none;
    padding-left: 20px;
    position: static;
    background-color: #f9f9f9;
    box-shadow: none;
    margin-top: 10px;
}

.mobile-menu .submenu li {
    border-bottom: none;
    padding: 10px 0;
}

.mobile-menu .submenu a {
    color: #333;
    border-bottom: none;
}

.mobile-menu .has-submenu > a {
    display: inline-block;
    width: calc(100% - 40px);
}

.mobile-menu .submenu-toggle {
    position: absolute;
    right: 20px;
    top: 15px;
    width: 30px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    cursor: pointer;
    background-color: transparent;
    border-radius: 4px;
}

.mobile-menu .submenu-toggle i {
    font-size: 24px;
    font-style: normal;
    font-weight: normal;
    display: block;
    line-height: 30px;
}

/* 媒体查询 - 仅在小屏幕设备上应用移动端样式 */
@media (max-width: 767px) {
    body {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    header {
        height: 70px;
        padding: 10px 0;
        justify-content: center;
        position: relative;
    }
    
    .logo-container {
        padding-left: 0;
        justify-content: center;
        width: 100%;
        margin-right: 0;
        height: 100%;
        display: flex;
        align-items: center;
    }
    
    .logo-container img {
        height: 50px;
    }
    
    .main-menu {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    /* 确保容器居中 */
    .container {
        width: 100%;
        padding: 0 15px;
        margin: 0 auto;
    }
}

/* 平板设备横屏时显示桌面菜单 */
@media (min-width: 768px) and (max-width: 992px) {
    header {
        height: 100px;
    }
    
    .logo-container {
        padding-left: 20px;
    }
    
    .logo-container img {
        height: 70px;
    }
    
    .main-menu {
        display: flex;
        margin-top: 15px;
    }
    
    .main-menu > li > a {
        padding: 4px 10px;
        font-size: 14px;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
} 