/* 确保 body 和 html 没有默认的 margin 和 padding */
html, body {
    margin: 0;
    padding: 0;
}



/* 页面容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 大标题样式 */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #0e63be;
    margin-bottom: 20px;
}

.service-title-en {
    position: absolute;
    left: 50%;
    top: 50%; /* 调整此值以控制叠加的高度，确保在中文下方 */
    transform: translateY(0); /* 不再需要垂直居中 */
    font-size: 0.9em; /* 根据需要调整大小 */
    color: rgba(104, 102, 102, 0.5); /* 设置颜色和透明度 */
}

/* 横线样式 */
.header-line {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
    width: 100%; /* 确保容器宽度占满 */
}

.header-line .line {
    height: 4px; /* 中间部分的高度 */
    background: linear-gradient(to right, transparent, #4354e9, transparent); /* 渐变效果 */
    flex: 1; /* 让横线自动扩展 */
    max-width: 700px; /* 设置最大宽度 */
    position: relative; /* 使伪元素相对于此元素定位 */
}

.header-line .line::before,
.header-line .line::after {
    position: absolute;
    top: 0;
    height: 2px; /* 两头部分的高度 */
}

.header-line .line::before {
    left: -20px; /* 左侧位置 */
    right: 100%; /* 使其在左侧 */
}


.header-line .dot {
    width: 8px;
    height: 8px;
    background-color: #e8e6f3;
    border-radius: 50%;
    margin: 0 20px; /* 增加圆点与横线的间距 */
}



/* 导航栏点击事件 */
document.querySelectorAll('.sidebar-item').forEach(item => {
    item.addEventListener('click', function() {
        /* 移除所有激活状态 */
        document.querySelectorAll('.sidebar-item').forEach(i => i.classList.remove('active'));
        document.querySelectorAll('.content-section').forEach(section => section.classList.remove('active'));

        /* 激活当前项 */
        this.classList.add('active');
        const target = this.getAttribute('data-target');
        document.getElementById(target).classList.add('active');
    });
});



.close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #555;
    z-index: 2;
}

.close:hover {
    color: #333;
}

/* 模块通用样式 */
.content-section {
    display: flex;
    align-items: stretch; /* 使内容填满整个高度 */
    height: 400px; /* 模块高度 */
    background-color: #007bff; /* 蓝色背景 */
    margin-bottom: 0; /* 移除模块间距 */
    padding: 0; /* 移除内边距 */
    color: white; /* 文字颜色 */
    z-index: 1; /* 确保模块在弹窗下方 */
}

.content-wrapper {
    display: flex;
    align-items: stretch; /* 使内容填满整个高度 */
    width: 100%;
    height: 100%; /* 确保填满父容器 */
}

.content-text {
    flex: 1; /* 使文本部分填满剩余空间 */
    text-align: center; /* 使文本居中 */
    position: relative;
}

.content-text h2 {
    font-size: 32px; /* 字体大小 */
    transition: opacity 0.3s ease; /* 过渡效果 */
    text-align: center; /* 确保标题居中 */
    display: block; /* 使标题成为块级元素 */
    width: 100%; /* 确保标题占满整个宽度 */
    top: 35%;

    position: absolute;
}

.content-text .details-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    padding: 10px 20px;
    background-color: transparent; /* 透明背景 */
    color: #ffffff; /* 白色文字 */
    text-decoration: none;
    border: 2px solid #ffffff; /* 白色边框 */
    border-radius: 5px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.content-section:hover .section-title {
    opacity: 0;
}

.content-section:hover .details-btn {
    opacity: 1;
}

.content-image {
    flex: 1; /* 使图片部分填满剩余空间 */
    height: 100%; /* 确保填满父容器 */
    overflow: hidden;
}

.content-image img {
    width: 100%;
    height: 100%; /* 确保图片填满容器 */
    object-fit: cover; /* 图片填满容器 */
}

/* 弱电工程师模块 */
.weak-current-engineer {
    background-color: #007bff; /* 蓝色背景 */
}

/* 网络工程师模块 */
.network-engineer {
    background-color: #0056b3; /* 深蓝色背景 */
}

/* 营业担当/销售（会日语）模块 */
.sales-japanese {
    background-color: #004080; /* 更深蓝色背景 */
}

/* 联系我们模块 */
.contact-us {
    background-color: #00264d; /* 最深蓝色背景 */
}

.modal {
    display: flex; /* 使用flex布局 */
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
    width: 90%; /* 确保弹窗宽度为100% */
    height: 100%; /* 确保弹窗高度为100% */
    padding: 10px; /* 添加内边距 */
    position: fixed; /* 固定在视口中 */
    top: 0; /* 顶部对齐 */
    left: 0; /* 左侧对齐 */
    z-index: 1000; /* 确保弹窗在最上层 */
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 80%; /* 调整弹窗宽度为80% */
    max-width: 500px; /* 设置最大宽度为500px */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative; /* 使用相对定位 */
    top: auto; /* 移除顶部定位 */
    left: auto; /* 移除左侧定位 */
    transform: none; /* 移除居中变换 */
}

/* 关闭按钮样式 */
.close {
    position: absolute; /* 绝对定位 */
    top: 10px; /* 距离顶部 10px */
    right: 10px; /* 距离右侧 10px */
    font-size: 24px; /* 字体大小 */
    cursor: pointer; /* 鼠标悬停时变成手形光标 */
    color: #555; /* 颜色 */
}

.close:hover {
    color: #333; /* 悬停时颜色变化 */
}

.map-container {
    margin-top: 20px; /* 添加与文本的间距 */
    width: 100%; /* 确保地图容器宽度为100% */
    height: auto; /* 高度自适应 */
}

/* 响应式调整 - 仅针对手机端 */
@media (max-width: 768px) {
    .container {
        padding: 10px; /* 添加内边距以适应手机屏幕 */
    }

    .phone-button {
        display: none; /* 隐藏电话按钮 */
    }

    .page-header {
        margin-bottom: 20px; /* 减少标题下方的间距 */
    }

    .page-header h1 {
        font-size: 1.8rem; /* 调整大标题字体大小 */
    }

    .header-line {
        margin-top: 20px; /* 减少横线的上边距 */
    }

    .header-line .line {
        height: 3px; /* 调整横线的高度 */
    }

    .header-line .dot {
        width: 6px; /* 调整圆点的大小 */
        height: 6px;
    }

    .content-section {
        flex-direction: column; /* 垂直排列内容 */
        margin-bottom: 20px; /* 增加内容模块之间的间距 */
    }

    .content-wrapper {
        flex-direction: column; /* 垂直排列内容 */
        align-items: center; /* 水平居中 */
    }

    .content-text {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 20px 0;
        position: static;
    }
    
    .content-text h2 {
        position: static;
        margin-bottom: 15px;
        font-size: 20px;
    }
    
    .content-text .details-btn {
        position: static;
        transform: none;
        opacity: 1;
        margin-top: 5px;
        padding: 8px 16px;
        background-color: rgba(255, 255, 255, 0.2);
        color: #ffffff;
        border: 1px solid white;
        border-radius: 20px;
        font-size: 14px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
    }
    
    .content-text .details-btn:hover {
        background-color: rgba(255, 255, 255, 0.3);
        transform: translateY(-2px);
    }
    
    .content-section:hover .section-title {
        opacity: 1;
    }

    .content-image {
        width: 100%; /* 图片宽度为100% */
        text-align: center; /* 居中对齐 */
        margin-top: 10px; /* 图片与文本之间的间距 */
    }

    .content-image img {
        max-width: 100%; /* 确保图片占满容器宽度 */
        height: auto; /* 保持图片比例 */
        border-radius: 8px; /* 圆角 */
    }
    
    .modal-content {
        background: linear-gradient(to bottom, #ffffff, #f7f9fc);
        padding: 25px 20px;
        border-radius: 16px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .modal-content h2 {
        font-size: 20px;
        color: #0056b3;
        margin-bottom: 15px;
        padding-bottom: 8px;
        border-bottom: 2px solid #e6f0ff;
        text-align: center;
    }
    
    .modal-content p {
        font-size: 15px;
        line-height: 1.5;
        margin-bottom: 10px;
        color: #444;
    }
    
    .modal-content ul, .modal-content ol {
        margin-left: 10px;
        padding-left: 15px;
        margin-bottom: 15px;
    }
    
    .modal-content li {
        margin-bottom: 8px;
        font-size: 14px;
        line-height: 1.4;
    }
    
    .close {
        position: absolute;
        top: 12px;
        right: 12px;
        background-color: #f0f4f8;
        color: #0056b3;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        font-size: 18px;
    }

    .map-container {
        margin-top: 20px; /* 添加与文本的间距 */
        width: 100%; /* 确保地图容器宽度为100% */
        height: auto; /* 高度自适应 */
    }
}

/* 浮动联系图标样式 */
.floating-contact {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background-color: #f0f0f0; /* 改为浅灰色背景 */
    border-radius: 4px; /* 改为小圆角，呈现方形效果 */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.contact-icon:hover {
    background-color: #e0e0e0; /* 悬停时变为稍深的灰色 */
    transform: scale(1.1);
}

.contact-icon i {
    color: #666; /* 图标颜色改为深灰色 */
    font-size: 20px;
}

.contact-icon::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.contact-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .floating-contact {
        right: 10px;
    }
    
    .contact-icon {
        width: 40px;
        height: 40px;
    }
    
    .contact-icon i {
        font-size: 16px;
    }

    /* 在移动端隐藏tooltip */
    .contact-icon::before {
        display: none;
    }
}

/* 移动端联系信息样式 */
.mobile-contact-info {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.mobile-contact-content {
    background-color: white;
    border-radius: 8px;
    position: relative;
    width: 80%;
    max-width: 300px;
    text-align: center;
}

.close-mobile-contact {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.mobile-contact-text {
    font-size: 16px;
    color: #333;
    margin: 20px 0;
}




