/* 添加一些基础动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }



    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* 背景图片样式 */
/* 横幅区域背景 */
.headerBox {
    background-image: url('./assets/bannerbg.jpg');
}
@media (max-width: 768px) {
    .headerBox {
        background-size: contain !important;
        background-position: center;
        background-repeat: no-repeat;
        background-image: url('./assets/h5bannerbg.jpg');
    }
    
}
/* 硬件开发部分背景 */
.yingjianBox {
    background-image: url('./assets/h5hardbg.jpg');
}

/* 促膝生活部分背景 */
#cuxi > div:nth-child(2) > div {
    background-image: url('./assets/cuxibg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: block;
    padding: 2rem;
    width: 100%;
    height: 100%;
}
.cuxi-box > text {
    display: flex;
    position: absolute;
    text-align: center;
    line-height: 100%;
    white-space: nowrap;
    letter-spacing: 2.5rem;
    font-size: 5rem;
    color: rgba(227, 226, 226, 1);
    left: 105%;
    top: 0;
}
/* 应用到各个部分的进入动画 */
section {
    animation: fadeIn 0.8s ease-out forwards;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1d3fe;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #93c5fd;
}

.cuxi-left {
    display: flex;
    gap: 20px;
    flex-direction: column;
    justify-content: center;
}
.cuxi-box {
    display: flex;
    position: relative;
    background-image: url('./assets/ownedtitle.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 650px;
    height: 80px; /* 可以根据需要调整高度 */
}

.jiegouBox,.jiegouBox2 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative; /* 用于伪元素定位 */
    z-index: 1; /* 确保盒子在连接线之上 */
}
.jiegouBox:nth-child(1)::after {
    content: '';
    position: absolute;
    top: 50%; /* 垂直居中 */
    right: -1rem; /* 从盒子右侧延伸 */
    width: 2rem; /* 线的长度，与gap一致 */
    height: 2px; /* 线的粗细 */
    background-color: #ccc; /* 线的颜色 */
    transform: translateY(-50%); /* 垂直居中调整 */
}
.jiegouBox:nth-child(2)::after {
    content: '';
    position: absolute;
    top: 50%; /* 垂直居中 */
    right: -1rem; /* 从盒子右侧延伸 */
    width: 2rem; /* 线的长度，与gap一致 */
    height: 2px; /* 线的粗细 */
    background-color: #ccc; /* 线的颜色 */
    transform: translateY(-50%); /* 垂直居中调整 */
}
.jiegouBox21:nth-child(1)::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    top: 85px;
    left: 50%;
    width: 2px;
    height: 11rem;
    margin-top: 20px;
    background-color: #ccc;
    transform: translateX(-50%) rotate(10deg);
}
.jiegouBox21:nth-child(2)::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    top: 100px;
    left: 50%;
    width: 2px;
    height: 6rem;
    background-color: #ccc;
    transform: translateX(-50%) rotate(30deg);
}
.jiegouBox21:nth-child(4)::after {
    content: '';
    position: absolute;
    top: -65px;
    left: 40%;
    width: 2px;
    height: 6rem;
    background-color: #ccc;
    transform: translateX(50%) rotate(-30deg);
}
.jiegouBox21:nth-child(5)::after {
    content: '';
    position: absolute;
    top: -155px;
    left: 40%;
    width: 2px;
    height: 11rem;
    background-color: #ccc;
    transform: translateX(50%) rotate(-10deg);
}
.jiegouBox2::after {
    content: '';
    position: absolute;
    top: 50%; /* 垂直居中 */
    right: -1rem; /* 从盒子右侧延伸 */
    width: 2rem; /* 线的长度，与gap一致 */
    height: 2px; /* 线的粗细 */
    background-color: #ccc; /* 线的颜色 */
    transform: translateY(-50%); /* 垂直居中调整 */
}
.jiegouBox:nth-child(4)::after {
    content: '';
    position: absolute;
    top: 50%; /* 垂直居中 */
    right: -1rem; /* 从盒子右侧延伸 */
    width: 2rem; /* 线的长度，与gap一致 */
    height: 2px; /* 线的粗细 */
    background-color: #ccc; /* 线的颜色 */
    transform: translateY(-50%); /* 垂直居中调整 */
}
.jiegouBox:nth-child(5)::after {
    content: '';
    position: absolute;
    top: 50%; /* 垂直居中 */
    right: -1rem; /* 从盒子右侧延伸 */
    width: 2rem; /* 线的长度，与gap一致 */
    height: 2px; /* 线的粗细 */
    background-color: #ccc; /* 线的颜色 */
    transform: translateY(-50%); /* 垂直居中调整 */
}
/* 为所有图片添加过渡效果和初始状态 */
.jiegouBox img {
    position: relative; /* 必须开启定位，z-index才生效 */
    z-index: 5; /* 提升图片层级，确保覆盖连接线 */
    transition: transform 0.3s ease; /* 平滑放大过渡 */
    transform-origin: center; /* 从图片中心放大，视觉更自然 */
}

.jiegouBox21 img {
    position: relative; /* 必须开启定位，z-index才生效 */
    z-index: 10; /* 提升图片层级，确保覆盖连接线 */
    transition: transform 0.3s ease; /* 平滑放大过渡 */
    transform-origin: center; /* 从图片中心放大，视觉更自然 */
}

/* 鼠标悬浮时只放大图片 */
.jiegouBox:hover img {
    z-index: 5; /* 提升图片层级，确保覆盖连接线 */
    transform: scale(1.2); /* 放大到1.2倍，可调整数值 */
}

.jiegouBox21:hover img {
    z-index: 4; /* 提升图片层级，确保覆盖连接线 */
    transform: scale(1.2); /* 放大到1.2倍，可调整数值 */
}

/* 确保其他元素（文字、容器）不被放大 */
.jiegouBox, .jiegouBox21,
.jiegouBox text, .jiegouBox21 text {
    transition: none; /* 取消其他元素的过渡效果 */
    transform: none !important; /* 强制取消其他元素的缩放 */
}
.jiegouBox21 {
    display: flex;
    position: relative;
    flex-direction: column;
    align-items: center;
}
.jiegouBox21:nth-child(1) {
    left: -150px;
}
.jiegouBox21:nth-child(2) {
    left: -60px;
}
.jiegouBox21:nth-child(4) {
    left: -60px;
}
.jiegouBox21:nth-child(5) {
    left: -150px;
}
/* 响应式设计 - 手机适配 */
@media (max-width: 768px) {
    #cuxi>div:nth-child(2) {
        margin-top: 1rem !important;
        min-height: auto !important;
        max-height: none !important;
    }

    .ruanjianBox {
        padding-top: 0 !important;
        padding-bottom: 1rem !important;
    }

    .gongkeBox {
        padding-top: 0 !important;
        padding-bottom: 1rem !important;
    }

    .cuxi-box {
        display: flex;
        position: relative;
        background-image: url('./assets/h5ownedtitle.jpg');
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
        width: 100%;
        height: 50px;
    }

    #cuxi > div:nth-child(2) > div {
        padding: 0;
    }

    .cuxi-rong {
        background-image: url('./assets/h5cuxibg.png');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        display: block;
        width: 100%;
        height: 500px;
    }

    #cuxi .cuxi-left {
        width: 100% !important;
        text-align: center;
    }

    #cuxi .cuxi-right {
        width: 100% !important;
    }

    #cuxi .cuxi-right>img {
        width: 100vw !important;
    }

    #cuxi .cuxi-title {
        font-size: 30px !important;
    }

    #cuxi .cuxi-content {
        font-size: 14px !important;
        letter-spacing: 5px !important;
        line-height: 1.5;
    }

    #cuxi>div:first-child img {
        max-height: 100px;
        object-fit: contain;
    }

    #cuxi>div:nth-child(2)>div>div {
        flex-direction: column !important;
        gap: 2rem;
    }

    #cuxi .cuxi-right img {
        max-width: 80% !important;
        margin: 0 auto;
        display: block;
    }
}

/* 平板适配 */
@media (max-width: 1024px) and (min-width: 769px) {
    #cuxi .cuxi-left {
        width: 40% !important;
    }

    #cuxi .cuxi-title {
        font-size: 40px !important;
    }

    #cuxi .cuxi-content {
        font-size: 16px !important;
        letter-spacing: 8px !important;
    }

    /* 硬件开发部分文字 - 平板适配 */
    .max-w-7xl > .flex > div:nth-child(2) p {
        font-size: 16px;
        line-height: 1.6;
    }
}

/* 硬件开发部分文字 - 移动端适配 */
@media (max-width: 768px) {
    .max-w-7xl > .flex > div:nth-child(2) {
        padding: 1rem !important;
        width: 100% !important;
    }
    
    .max-w-7xl > .flex > div:nth-child(2) p {
        font-size: 14px;
        line-height: 1.5;
        text-align: justify;
        margin-bottom: 1rem;
    }
}

/* 导航栏移动端居中 */
@media (max-width: 768px) {
    #mainNav .container {
        justify-content: center !important;
    }
    #mainNav .container > div {
        justify-content: center !important;
        width: 100%;
    }
    
    /* GONKG BUSINESS SERVICES 文字移动端居中 */
    #gongke .text-center.relative > div:nth-child(2) {
        position: relative !important;
        bottom: 2.5rem !important;
        left: auto !important;
        transform: none !important;
        margin-top: 1.2rem !important;
        display: block !important;
        text-align: center !important;
        width: 100% !important;
    }

    .gongkeBox2 {
       margin-bottom: 1rem !important;
    }
}

/* CONTACT US 文字左右添加与背景颜色相同的方块 */
#contact .text-center.relative h2 span:nth-child(2) {
    position: relative;
    display: inline-block;
    padding: 0 15px;
}

.conBox::before,
.conBox::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 300px;
    height: 43px;
    background: rgba(239, 239, 239, 1);
    transform: translateY(-50%);
    z-index: 1;
}

.conBox::before {
    left: -320px;
}

.conBox::after {
    right: -300px;
}

/* 移动端适配 - CONTACT US 文字和方块 */
@media (max-width: 768px) {
    /* 调整CONTACT US文字大小和间距 */
    #contact .text-center.relative h2 span:nth-child(2) {
        padding: 0 10px;
        text-align: center;
        letter-spacing: 0.15em !important;
        font-size: clamp(0.8rem, 2vw, 2rem) !important;
    }
    
    /* 调整左右方块大小和位置 */
    .conBox::before,
    .conBox::after {
        width: 100px;
        height: 25px;
    }
    
    .conBox::before {
        left: -110px;
    }
    
    .conBox::after {
        right: -100px;
    }
    
    /* 确保在更小屏幕上的适配 */
    @media (max-width: 480px) {
        .conBox::before,
        .conBox::after {
            width: 60px;
            height: 20px;
        }
        
        .conBox::before {
            left: -70px;
        }
        
        .conBox::after {
            right: -60px;
        }
        
        #contact .text-center.relative h2 span:nth-child(2) {
            letter-spacing: 0.1em !important;
            font-size: clamp(0.7rem, 2vw, 1.5rem) !important;
        }
    }
}
