/* 基础样式设置 */
:root{
    --primary-color: #4B7BE5;
    --secondary-color: #436abf;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

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

ul {
    list-style: none;
}

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

.section-title {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
}

.section-title:after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--secondary-color);
}

/* 头部导航 */
header {
    position: sticky;
    top: 0;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.logo {
    flex: 0 0 auto;
}

.logo h1 {
    font-size: 24px;
    color: #333;
}

/* 头部搜索框 */
.header-search {
    flex: 0 1 500px;
    margin: 0 20px;
    position: relative;
}

.header-search form {
    display: flex;
    position: relative;
}

/* 搜索框选择器样式增强 */
.header-search select {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 110px;
    padding: 8px 25px 8px 15px;
    border: none;
    border-radius: 20px;
    background-color: rgba(75, 123, 229, 0.1);
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234B7BE5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    z-index: 2;
}

.header-search select:hover {
    background-color: rgba(75, 123, 229, 0.15);
}

.header-search select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(75, 123, 229, 0.25);
}

.header-search select option {
    background-color: #fff;
    color: #333;
    padding: 10px;
}

/* 调整输入框内边距，确保不会与选择器重叠 */
.header-search input {
    width: 100%;
    padding: 12px 45px 12px 130px;
    border: 2px solid #eaeaea;
    border-radius: 50px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-color: #f9f9f9;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    z-index: 1;
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 3px 8px rgba(75, 123, 229, 0.15);
    width: calc(100% + 20px);
}

.header-search button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    z-index: 2;
}

.header-search button:hover {
    color: var(--primary-color);
    background-color: rgba(75, 123, 229, 0.1);
}

.search-icon {
    font-style: normal;
    display: inline-block;
    transition: transform 0.3s ease;
}

.header-search button:hover .search-icon {
    transform: scale(1.1);
}

.header-search::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.header-search:focus-within::before {
    width: 100%;
}

/* 搜索框占位符样式 */
.header-search input::placeholder {
    color: #aaa;
    transition: opacity 0.3s ease;
}

.header-search input:focus::placeholder {
    opacity: 0.7;
}

nav {
    flex: 1 0 auto;
    display: flex;
    justify-content: flex-end;
}

nav > ul {
    display: flex;
}

nav ul li {
    margin-left: 20px;
    position: relative;
}

nav ul li a {
    padding: 10px;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--secondary-color);
}
nav ul li a.active {
    color: var(--primary-color);
}

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

.has-dropdown > a:after {
    content: '▼';
    font-size: 10px;
    margin-left: 5px;
    display: inline-block;
    vertical-align: middle;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 0 0 4px 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

/* 普通下拉菜单 */
.dropdown-list {
    padding: 10px 0;
}

.dropdown-list li a {
    display: block;
    padding: 8px 20px;
    color: #666;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.dropdown-list li a:hover {
    background: #f5f5f5;
    color: var(--primary-color);
    padding-left: 25px;
}

/* 宽版产品下拉菜单 */
.mega-menu {
    width: 100%;
    min-width: 800px;
    max-height: 600px; /* 限制最大高度，避免过长 */
    overflow-y: auto;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    padding: 30px;
}

.mega-menu-content {
    /* 改用column布局实现瀑布流 */
    column-count: 3; /* 默认5列 */
    column-gap: 10px;
    width: 100%;
}

.mega-menu-column {
    /* 调整为内联块，允许在列中流动 */
    display: inline-block;
    width: 100%;
    padding: 0 10px;
    margin-bottom: 20px;
    break-inside: avoid; /* 避免在列中间断开 */
}

.mega-menu-column:last-child {
    border-right: none;
}

.mega-menu-column h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 16px;
    position: relative;
    padding-bottom: 8px;
    white-space: nowrap; /* 不换行 */
    overflow: hidden;
    text-overflow: ellipsis; /* 文本溢出显示省略号 */
}

.mega-menu-column h4:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary-color);
}

.mega-menu-column ul {
    display: block;
}

.mega-menu-column ul li {
    margin: 0;
    display: block;
}

.mega-menu-column ul li a {
    display: block;
    padding: 6px 0;
    font-weight: normal;
    color: #666;
    font-size: 14px;
    white-space: nowrap; /* 不换行 */
    overflow: hidden;
    text-overflow: ellipsis; /* 文本溢出显示省略号 */
}

.mega-menu-column ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

/* 显示下拉菜单 */
.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.has-dropdown:hover .mega-menu {
    transform: translateX(-50%) translateY(0);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 2px 0;
    transition: all 0.3s ease;
}

/* 主横幅 */
.hero {
    background: #f5f5f5;
    padding: 80px 0;
    text-align: center;
    color: white;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* 服务类别 */
.services {
    padding: 60px 0;
    background: #fff;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.service-item {
    text-align: center;
    padding: 20px;
    transition: transform 0.3s ease;
}

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

.service-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 15px;
}

.service-icon a img{
    border-radius: 50%;
}

/* 产品展示 */
.products {
    padding: 60px 0;
    background: #f9f9f9;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-item {
    background: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.product-item:hover {
    transform: translateY(-5px);
}

.product-image {
    height: 200px;
    background: #eee;
}
.product-image img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-item h3, .product-item p {
    padding: 15px;
}


.service-icons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.icon-item {
    text-align: center;
}

.icon {
    width: 60px;
    height: 60px;
    background: #eee;
    border-radius: 50%;
    margin: 0 auto 10px;
}

/* 最新动态 */
.news {
    padding: 60px 0;
    background: #fff;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.news-item {
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.news-image {
    height: 200px;
    background: #eee;
}
.news-image img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.news-item h3, .news-item p {
    padding: 15px;
}

/* 友情链接 */
.friend-links {
    padding: 40px 0;
    background: #f5f5f5;
}

.link-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.link-item {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    font-size: 14px;
    color: #666;
    border: 1px solid #eee;
}
.link-item img{
    width: 50px;
    margin-right: 10px;
}

.link-item:hover {
    color: var(--primary-color);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

@media (max-width: 768px) {
    .link-grid {
        gap: 10px;
    }
    
    .link-item {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 页脚 */
footer {
    background: #333;
    color: #fff;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

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

.footer-qrcode {
    text-align: center;
}

.qrcode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qrcode {
    width: 120px;
    height: 120px;
    background: #fff;
    margin: 15px auto 10px;
    position: relative;
}
.qrcode img{
    height: 100%;
}
.qrcode:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: rgba(0,0,0,0.1);
    background-size: contain;
}

.footer-qrcode p {
    font-size: 14px;
    color: #ddd;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .service-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .partner-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* 响应式下拉菜单 */
    .mega-menu {
        min-width: 100%;
        width: 100%;
        position: static;
        transform: none;
        padding: 15px;
        max-height: none;
    }
    
    .mega-menu-content {
        column-count: 3; /* 在中等屏幕上减少列数 */
    }
    
    /* 响应式搜索框 */
    .header-search {
        flex: 0 1 250px;
        margin: 0 10px;
    }
    
    .header-search input:focus {
        width: 100%; /* 在中等屏幕上不再扩展 */
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        display: none;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }
    
    nav.active {
        display: block;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav ul li {
        margin: 0;
    }
    
    nav ul li a {
        display: block;
        padding: 15px;
        border-bottom: 1px solid #eee;
    }
    
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .partner-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .about .container {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 移动端隐藏下拉菜单 */
    .dropdown-menu, .mega-menu {
        display: none !important; /* 强制隐藏，不论什么状态 */
        visibility: hidden;
        opacity: 0;
    }
    
    /* 隐藏下拉菜单指示器 */
    .has-dropdown > a:after {
        display: none;
    }
    
    /* 确保导航子菜单正确显示 */
    nav ul li {
        position: relative;
        border-bottom: 1px solid #eee;
    }
    
    nav ul li:last-child {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .logo {
        width: 150px;
    }
    .service-grid {
        grid-template-columns: 1fr;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .partner-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .qrcode {
        width: 100px;
        height: 100px;
    }
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
}

.back-to-top:before {
    content: '↑';
    font-weight: bold;
}

@media (max-width: 480px) {
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }
}

/* 响应式调整 */
@media (max-width: 576px) {
    .header-search select {
        width: 80px;
        font-size: 12px;
        padding: 6px 20px 6px 10px;
    }
    
    .header-search input {
        padding: 10px 40px 10px 90px;
        font-size: 13px;
    }
}
