.contact-container{
    /*background-color: #404237;*/
    background-color: #7C806F;
    color:#a5d63f;
}

.navbar-default {
    /*background-color:#2D3025 ;*/
    background-color:#A8AC9C ;
}

.navbar-default .navbar-text {
    color: #FFF;
}
.navbar-default .navbar-nav > li > a,.navbar-default .navbar-nav > li > a:hover {
    color: #FFF;
}

.contact-container {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
    height: 30px;
}

.contact {
    width: 90%;
    margin: 0 auto;
    line-height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-left {
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.contact-left img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    vertical-align: middle;
}

.contact-left span {
    margin-right: 5px;
    font-size: 14px;
}

.contact-right {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.contact-right img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    vertical-align: middle;
}

.contact-right span {
    font-size: 14px;
}


.navbar-fixed-top{
    top:30px;
}

.container {
    width: 90%;
}
.main-content {
    position: relative;
    padding-top: 80px;
    /*min-height: 100vh; !* 确保有足够高度 *!*/
    /*flex: 1; !* 占据剩余空间 *!*/
}

.search-box {
    position: relative;
    width: 100vw;           /* 视口宽度 */
    height: 100vh;          /* 视口高度 */
    overflow: hidden;       /* 防止图片溢出 */
    display: flex;          /* 启用Flex布局 */
    justify-content: center; /* 水平居中 */
    align-items: center;    /* 垂直居中 */
    margin: 0;          /* 确保自身无外边距 */
    padding: 0;         /* 确保自身无内边距 */
}

.img-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;            /* 图片在底层 */
}

.img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;     /* 关键：图片覆盖整个容器，不变形 */
}

/* 搜索框容器 */
.search-form {
    position: relative;
    z-index: 2;            /* 搜索框在图片上层 */
    max-width: 65%;      /* 搜索框最大宽度 */
    height: 8%;
    width: 60%;            /* 响应式：屏幕90%宽度 */
    /*box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);*/
    top: -30vh;
}
.search-form form {
    height: 100%;
}
.search-form h1 {
    color: #000;
}
/* 搜索容器 */
.search-container {
    display: flex;
    height: 100%;
    border-radius: 6px; /* 整体圆角 */
    overflow: hidden; /* 确保子元素不溢出圆角 */
}

/* 输入框调整 */
.search-input {
    flex: 1;
    border: 1px solid #ddd;
    border-right: none; /* 移除与按钮相邻的边框 */
    padding: 0 15px;
    font-size: 16px;
    height: 100%;
    box-sizing: border-box; /* 包含padding和border在高度内 */
}

/* 聚焦效果 */
.search-input:focus {
    outline: none;          /* 移除外轮廓线 */
    border: none;           /* 同时移除边框（可选） */
    box-shadow: none;       /* 移除阴影（如果有） */
}

/* 按钮容器 */
.search-button {
    flex-shrink: 0;
    width: 60px;
    color: white;
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: #a5d63f;
}

.product-class-list {
    position: absolute;
    width: 60vw;           /* 视口宽度 */
    overflow: hidden;       /* 防止图片溢出 */
    display: flex;          /* 启用Flex布局 */
    justify-content: center; /* 水平居中 */
    align-items: flex-start;    /* 垂直居中 */
    margin: 0;          /* 确保自身无外边距 */
    padding: 30px;         /* 确保自身无内边距 */
    z-index: 3;
    background-color: #fff;
    right: 20vw;
    border-radius: 10px;
}

.product-class-list ul{
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

/* 2. 去除 Bootstrap 默认的列表样式 */
.product-class-list li {
    list-style: none !important;
    margin-bottom: 5px;
}

/* 3. 设置所有 a 标签为黑色 */
.product-class-list a {
    color: #333 !important;
    text-decoration: none !important;
}

/* 4. 悬停效果 */
.product-class-list a:hover {
    color: #333 !important;
}

.technology-class-list {
    position: absolute;
    width: 60vw;           /* 视口宽度 */
    overflow: hidden;       /* 防止图片溢出 */
    display: flex;          /* 启用Flex布局 */
    justify-content: center; /* 水平居中 */
    align-items: flex-start;    /* 垂直居中 */
    margin: 0;          /* 确保自身无外边距 */
    padding: 30px;         /* 确保自身无内边距 */
    z-index: 3;
    background-color: #fff;
    right: 20vw;
    border-radius: 10px;
}

/* 3. 设置所有 a 标签为黑色 */
.technology-class-list a {
    color: #333 !important;
    text-decoration: none !important;
    margin-right: 50px;
    margin-bottom: 30px;
    white-space: nowrap;
}

/* 4. 悬停效果 */
.technology-class-list a:hover {
    color: #333 !important;
}

.content-box {
    position: relative;
    width: 80vw;           /* 视口宽度 */
    overflow: hidden;       /* 防止图片溢出 */
    display: flex;          /* 启用Flex布局 */
    justify-content: center; /* 水平居中 */
    align-items: flex-start;    /* 垂直居中 */
    margin: 0;          /* 确保自身无外边距 */
    padding: 30px;         /* 确保自身无内边距 */
    z-index: 3;
    background-color: #fff;
    left: 10vw;
    top: -40vh;
    border-radius: 10px;
}

.technology-box {
    position: relative;
    width: 80vw;
    overflow: hidden;
    margin: 0;
    padding: 30px;
    z-index: 3;
    background-color: #FFF;
    left: 10vw;
    top: -35vh;
    /*margin: -15vh auto 0 auto; !* 修改这里：使用负margin替代top *!*/
    border-radius: 10px;
    /* 添加滚动以便查看所有项目 */
    overflow-x: auto; /* 水平滚动 */
    white-space: nowrap; /* 防止换行 */
}
.technology-item {
    flex: 0 0 auto; /* 不伸缩，不收缩，自动宽度 */
    margin-right: 30px; /* 项目间距 */
    text-align: center;
    display: inline-flex; /* 行内flex布局 */
    flex-direction: column;
    align-items: center;
}

/* 最后一个项目不需要右边距 */
.technology-item:last-child {
    margin-right: 0;
}

/* 图片等比缩放 */
.technology-item img {
    width: 100%;
    max-width: 17vw; /* 缩小图片宽度 */
    height: auto; /* 高度自动，保持比例 */
    aspect-ratio: 340/170; /* 保持2:1的宽高比 */
    object-fit: contain; /* 包含整个图片 */
    border-radius: 8px;
    background-color: #f0f0f0; /* 图片加载时的背景色 */
}

.technology-item span {
    margin-top: 10px;
    font-size: 16px;
    white-space: nowrap; /* 文字不换行 */
    overflow: hidden;
    text-overflow: ellipsis; /* 文字过长显示省略号 */
    max-width: 200px; /* 与图片同宽 */
}




.product-box {
    position: relative;
    width: 80vw;
    overflow: hidden;
    margin: 0;
    padding: 30px;
    z-index: 3;
    background-color: #FFF;
    left: 10vw;
    top: -35vh;
    /*margin: -15vh auto 0 auto; !* 修改这里：使用负margin替代top *!*/
    border-radius: 10px;
    /* 添加滚动以便查看所有项目 */
    overflow-x: auto; /* 水平滚动 */
    white-space: nowrap; /* 防止换行 */
}
.product-item {
    flex: 0 0 auto; /* 不伸缩，不收缩，自动宽度 */
    margin-right: 30px; /* 项目间距 */
    display: inline-flex; /* 行内flex布局 */
    flex-direction: column;
}

/* 最后一个项目不需要右边距 */
.product-item:last-child {
    margin-right: 0;
}

/* 图片等比缩放 */
.product-item img {
    width: 100%;
    max-width: 17vw; /* 缩小图片宽度 */
    height: 20vh; /* 高度自动，保持比例 */
    aspect-ratio: 340/170; /* 保持2:1的宽高比 */
    object-fit: contain; /* 包含整个图片 */
    border-radius: 8px;
    background-color: #f0f0f0; /* 图片加载时的背景色 */
}
.product-item .title {
    margin-top: 10px;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap; /* 文字不换行 */
    overflow: hidden;
    text-overflow: ellipsis; /* 文字过长显示省略号 */
    max-width: 17vw; /* 缩小图片宽度 */
}
.product-item span {
    font-size: 14px;
    white-space: nowrap; /* 文字不换行 */
    overflow: hidden;
    text-overflow: ellipsis; /* 文字过长显示省略号 */
    max-width: 17vw; /* 缩小图片宽度 */
}

/* 媒体查询：移动端适配 */
@media (max-width: 768px) {
    .technology-box,
    .product-box {
        overflow-x: visible !important;
        overflow-y: visible !important;
    }

    body, html {
        overflow-x: hidden;
        width: 100%;
    }
    /* 主要内容区域调整 */
    .content-box,
    .technology-box,
    .product-box {
        width: 90vw !important;  /* 缩小宽度 */
        left: 5vw !important;    /* 居中调整 */
        top: -35vh !important;   /* 减小负值 */
        padding: 15px !important; /* 减少内边距 */
    }
    .search-box {
        height: 70vh;
    }

    /* 搜索框调整 */
    .search-form {
        width: 85vw !important;
        max-width: 85vw !important;
        height: 8vh ;
        top: -20vh ;
    }

    .search-form h1 {
        font-size: 20px !important;
        letter-spacing: 0.1em !important;
        margin-bottom: 15px !important;
    }

    .img-box {
        height: 70%;
    }

    /* 轮播图高度调整 */
    .content-box {
        height: 30vh !important;
    }

    #myCarousel,
    .carousel-inner,
    .item,
    .item img {
        height: 25vh !important;
    }

    /* 技术服务和技术产品列表调整 */
    .technology-item-box,
    .product-item-box {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important; /* 两列布局 */
        gap: 15px !important;
        width: 100% !important;
        overflow-x: visible !important;
        white-space: normal !important;
    }

    /* 单个项目调整 */
    .technology-item,
    .product-item {
        display: flex !important;
        flex-direction: column !important;
        margin-right: 0 !important;
        margin-bottom: 15px !important;
        width: 100% !important;
    }
    .technology-item {
        align-items: center !important;
    }

    /* 图片调整 */
    .technology-item img,
    .product-item img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16/9 !important; /* 更通用的比例 */
    }

    .product-item img {
        height: 120px !important;
        object-fit: cover !important;
    }

    /* 文字调整 */
    .technology-item span,
    .product-item .title,
    .product-item span {
        font-size: 14px !important;
        text-align: center !important;
    }

    /* 标题调整 */
    .technology-box h2,
    .product-box h2 {
        font-size: 20px !important;
        margin-bottom: 20px !important;
        text-align: center !important;
    }

    /* 导航栏调整 */
    .navbar.navbar-default > .container {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .navbar.navbar-default .navbar-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .navbar.navbar-default .navbar-header:before,
    .navbar.navbar-default .navbar-header:after {
        display: none !important;
        content: none !important;
    }

    .navbar.navbar-default .navbar-brand {
        float: none !important;
        display: flex !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 8px 0 !important;
        height: 56px !important;
        line-height: 1 !important;
    }

    .navbar.navbar-default .navbar-brand img {
        height: 40px !important;
        width: auto !important;
        display: block !important;
    }

    .navbar.navbar-default .navbar-toggle {
        float: none !important;
        margin: 0 0 0 auto !important;
        align-self: center !important;
    }

    .nav.navbar-nav li a {
        padding: 10px 8px !important;
        font-size: 14px !important;
    }

    #navbar {
        background-color: #fff;
    }

    .navbar-default .navbar-nav > li > a, .navbar-default .navbar-nav > li > a:hover {
        color: #000;
        text-align: center;
    }

    /* 下拉菜单调整 */
    .product-class-list,
    .technology-class-list {
        width: 90vw !important;
        right: 5vw !important;
        padding: 15px !important;
        max-height: 50vh !important;
        overflow-y: auto !important;
    }

    .product-class-list .col-md-12 {
        padding: 0 !important;
        margin-bottom: 15px !important;
    }

    .product-class-list h4 {
        font-size: 16px !important;
    }

    .product-class-list li {
        display: inline-block !important;
        margin-right: 10px !important;
        margin-bottom: 5px !important;
    }

    .technology-class-list .col-md-12 span {
        display: inline-block !important;
        margin-right: 10px !important;
        margin-bottom: 10px !important;
    }

    .technology-class-list a {
        margin-right: 0 !important;
        margin-bottom: 0 !important;
    }
    .contact-container {
        height: auto;
        padding: 5px 0;
        position: relative;
    }

    .contact {
        width: 95%;
        flex-direction: column;
        align-items: flex-start;
        line-height:0;
        gap: 3px; /* 两行之间的间距 */
    }

    /* 第一行：客服热线 */
    .contact-left {
        width: 100%;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    .contact-left img {
        width: 24px;
        height: 24px;
        margin-right: 15px;
        flex-shrink: 0; /* 防止图标被压缩 */
    }

    .contact-left span {
        font-size: 14px;
        line-height: 1.5;
    }

    /* 第二行：登录/注册 */
    .contact-right {
        width: 100%;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    .contact-right img {
        width: 24px;
        height: 24px;
        margin-right: 15px;
        flex-shrink: 0;
    }

    .contact-right span {
        font-size: 14px;
        line-height: 1.5;
    }

    /* 调整导航栏位置 */
    .navbar.navbar-default.navbar-fixed-top {
        top: 0 !important; /* 去掉之前的top值 */
        position: relative !important;
    }
    .main-content {
        padding-top:0;
        top: -10vh;
    }
}

@media (max-width: 991px) {
    .navbar.navbar-default > .container {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .navbar.navbar-default .navbar-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .navbar.navbar-default .navbar-header:before,
    .navbar.navbar-default .navbar-header:after {
        display: none !important;
        content: none !important;
    }

    .navbar.navbar-default .navbar-brand {
        float: none !important;
        display: flex !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 8px 0 !important;
        height: 56px !important;
        line-height: 1 !important;
    }

    .navbar.navbar-default .navbar-toggle {
        float: none !important;
        margin: 0 0 0 auto !important;
        align-self: center !important;
    }
}
