/* 导航栏子菜单样式 - 传统中国风设计 */

/* 字体定义 */
@font-face {
    font-family: 'ChangChengChangSong';
    src: url('../fonts/长城长宋体.TTF') format('truetype');
    font-display: swap;
    font-weight: normal;
    font-style: normal;
}

/* 主导航菜单字体大小设置 */
.nav-menu a {
    font-size: 12pt !important;
    font-family: 'ChangChengChangSong', 'Microsoft YaHei', Arial, sans-serif !important;
    font-weight: normal !important;
}

/* 子菜单容器样式 */
.submenu {
    display: none ;
    position: absolute !important;
    top: 100% !important;
    left: 25px !important; /* 向右偏移半个一级菜单按钮宽度 */
    background: transparent !important; /* 移除大背景 */
    min-width: auto !important; /* 改为自动宽度 */
    border: none !important; /* 移除边框 */
    border-radius: 0 !important;
    box-shadow: none !important; /* 移除阴影 */
    z-index: 1000 !important;
    padding: 0 !important; /* 移除padding */
    margin-top: 10px !important; /* 与一级菜单的间距 */
    font-size: 0 !important; /* 消除所有空白 */
    white-space: nowrap !important; /* 防止换行 */
    letter-spacing: -1px !important; /* 强制消除间距 */
}

/* 移除特殊位置调整，使用统一定位 */





/* 子菜单显示逻辑 - 只在悬停一级菜单时显示二级菜单 */
.has-submenu:hover > .submenu {
    display: inline-block !important;
}

/* 二级菜单项样式 */
.submenu li {
    display: inline-block ;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    font-size: 0 !important; /* 消除inline-block元素之间的空白 */
    vertical-align: top !important; /* 确保顶部对齐 */
    margin-right: 0 !important; /* 确保没有右边距 */
    line-height: 0 !important; /* 消除行高造成的间距 */
}

/* 二级菜单项基础样式 */
.submenu a {
    color: #FFFFFF !important;
    padding: 0 !important; /* 移除padding，让背景图片控制尺寸 */
    display: block !important;
    text-decoration: none !important;
    font-size: 14px !important; /* 增加字体大小 */
    font-weight: 500 !important;
    font-family: 'ChangChengChangSong', 'Microsoft YaHei', Arial, sans-serif !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    border: none !important; /* 移除黄色边框 */
    border-radius: 0 !important; /* 移除圆角 */
    position: relative !important;
    margin: 0 !important; /* 将间距减小到0 */
    /* 背景图片由具体的选择器设置，这里不设置背景 */
    width: 36px !important; /* 设置固定宽度与背景图片一致 */
    height: 149.5px !important; /* 设置固定高度与背景图片一致 */
    line-height: 1.2 !important; /* 调整行高 */
    text-align: center !important; /* 文字居中 */
    letter-spacing: 5px !important; /* 统一调节每个字和每个字之间的间距为5像素 */
}

/* 没有三级菜单的二级菜单项背景图片 */
.submenu li:not(.has-submenu) a {
    background-image: url('../img/sel2nochild.png') !important;
    background-size: 36px 149.5px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    width: 36px !important;
    height: 149.5px !important;
    display: flex !important; /* 使用flex布局 */
    align-items: center !important; /* 垂直居中 */
    justify-content: center !important; /* 水平居中 */
    text-align: center !important; /* 文字居中 */
}

/* 有三级菜单的二级菜单项背景图片 */
.submenu li.has-submenu a {
    background-image: url('../img/sel2haschild.png') !important;
    background-size: 36px 149.5px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    width: 36px !important;
    height: 149.5px !important;
    display: flex !important; /* 使用flex布局 */
    align-items: center !important; /* 垂直居中 */
    justify-content: center !important; /* 水平居中 */
    text-align: center !important; /* 文字居中 */
}

.submenu a:hover {
    color: #FFD700 !important;
    transform: translateY(-1px);
    box-shadow: none; /* 移除悬停时的阴影 */
    border: none; /* 确保悬停时也没有边框 */
}

/* 子菜单项前的装饰元素 */
.submenu a::before {
    content: ''; /* 移除装饰符号 */
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: #FFD700;
    font-size: 6px;
    opacity: 0.7;
}

.submenu a:hover::before {
    color: #FFFFFF;
    opacity: 1;
}

/* 三级菜单样式 - 横向排列，显示在二级菜单下方 */
.submenu .submenu {
    top: 100% !important; /* 显示在二级菜单下方 */
    left: 0 !important; /* 与二级菜单项左边缘对齐 */
    transform: none !important; /* 移除transform */
    margin-top: 0 !important; /* 与二级菜单保持0距离 */
    margin-left: 0 !important; /* 重置左边距 */
    background: transparent !important; /* 移除大背景 */
    border: none !important;
    min-width: auto !important; /* 改为自动宽度 */
    display: none ; /* 默认隐藏 */
    padding: 0 !important; /* 移除padding */
    gap: 0 !important;
    box-shadow: none !important;
    font-size: 0 !important; /* 消除所有空白 */
    overflow: hidden !important; /* 清除浮动 */
    white-space: nowrap !important; /* 确保内容不换行，强制水平排列 */
}

/* 移除企业文化下三级菜单的特殊位置调整，使用统一定位 */

/* 移除更精确的三级菜单位置调整，使用统一定位 */

/* 确保第一个二级菜单项与一级菜单左边缘精确对齐 */
.submenu li:first-child {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

.submenu li:first-child a {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* 确保第一个三级菜单项与二级菜单项左边缘精确对齐 */
.submenu .submenu li:first-child {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

.submenu .submenu li:first-child a {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* 三级菜单显示逻辑 - 只在悬停二级菜单时显示 */
.submenu .has-submenu:hover > .submenu {
    display: flex !important; /* 使用flex布局实现水平排列 */
    flex-direction: row !important; /* 明确指定水平方向 */
}

/* 三级菜单项样式 - 横向排列 */
.submenu .submenu li {
    display: inline-block !important; /* 在flex容器中使用block */
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0 !important; /* 消除所有空白 */
    flex-shrink: 0 !important; /* 防止项目收缩 */
}

/* 三级菜单项背景图片 - 使用更具体的选择器确保优先级 */
.submenu .submenu a,
.submenu .submenu li a {
    padding: 3px 6px; /* 缩小padding */
    border: none;
    border-bottom: none;
    margin: 0; /* 将间距减小到0 */
    text-align: center;
    border-radius: 0; /* 移除圆角 */
    background-image: url('../img/sel2nochild.png') !important;
    background-size: 36px 149.5px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    width: 36px !important;
    height: 149.5px !important;
    border: none !important; /* 移除黄色边框 */
    font-size: 14px !important; /* 确保字体大小显示，覆盖父元素的font-size: 0 */
    font-family: 'ChangChengChangSong', 'Microsoft YaHei', Arial, sans-serif !important;
    display: inline-flex !important; /* 改为inline-flex以支持水平排列 */
    align-items: center !important; /* 垂直居中 */
    justify-content: center !important; /* 水平居中 */
    letter-spacing: 5px !important; /* 统一调节每个字和每个字之间的间距为5像素 */
    vertical-align: top !important; /* 确保顶部对齐 */
}

.submenu .submenu a:hover {
    transform: translateY(-1px); /* 向上移动而不是向右 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 有子菜单的项目添加箭头指示 */
.has-submenu > a::after {
    content: ''; /* 移除箭头符号 */
    font-size: 10px;
    margin-left: 5px;
    color: #FFD700;
    display: inline-block;
    transition: transform 0.3s ease;
}

.submenu .has-submenu > a::after {
    content: ''; /* 移除箭头符号 */
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #FFD700;
}

/* 悬停时箭头效果 */
.has-submenu:hover > a::after {
    transform: rotate(180deg);
}

.submenu .has-submenu:hover > a::after {
    transform: translateY(-50%) rotate(180deg);
    color: #FFFFFF;
}

/* 最后一个子菜单项移除底部边框 */
.submenu li:last-child a {
    border-bottom: none;
}

/* 移除子菜单的装饰边框 */
.submenu::before {
    display: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
    /* 移动端主导航菜单字体大小 */
    .nav-menu a {
        font-size: 12pt !important;
        font-family: 'ChangChengChangSong', 'Microsoft YaHei', Arial, sans-serif !important;
        font-weight: normal !important;
    }
    
    .submenu {
        position: static;
        transform: none;
        margin-top: 0;
        margin-left: 20px;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        min-width: auto;
        padding: 5px 0;
        gap: 0;
    }
    
    /* 移动端关于我们的二级菜单位置调整 */
    .nav-menu li:nth-child(2) .submenu {
        left: auto;
    }
    
    .submenu li {
        text-align: left;
        margin: 0;
        padding: 0;
        flex: none;
        font-size: 13px; /* 移动端恢复字体大小 */
    }
    
    .submenu a {
        padding: 0; /* 移除padding，让背景图片控制尺寸 */
        font-size: 13px;
        font-family: 'ChangChengChangSong', 'Microsoft YaHei', Arial, sans-serif;
        border: none; /* 移除黄色边框 */
        border-radius: 0; /* 移除圆角 */
        margin: 0; /* 将间距减小到0 */
        text-align: center; /* 文字居中 */
        background: linear-gradient(135deg, #8B0000 0%, #A52A2A 100%);
        width: 36px; /* 设置固定宽度与背景图片一致 */
        height: 149.5px; /* 设置固定高度与背景图片一致 */
        letter-spacing: 5px; /* 统一调节每个字和每个字之间的间距为5像素 */
    }
    
    /* 移动端二级菜单背景图片 */
    .submenu li:not(.has-submenu) a {
        background-image: url('../img/sel2nochild.png');
        background-size: 36px 149.5px;
        background-position: center;
        background-repeat: no-repeat;
        width: 36px;
        height: 149.5px;
    }
    
    .submenu li.has-submenu a {
        background-image: url('../img/sel2haschild.png');
        background-size: 36px 149.5px;
        background-position: center;
        background-repeat: no-repeat;
        width: 36px;
        height: 149.5px;
    }
    
    .submenu a::before {
        left: 4px;
        font-size: 6px;
        content: ''; /* 移除装饰符号 */
    }
    
    /* 移动端三级菜单恢复垂直排列 */
    .submenu .submenu {
        margin-left: 20px;
        background: transparent;
        border: none;
        min-width: auto;
        padding: 5px 0;
    }
    
    .submenu .submenu li {
        text-align: left;
    }
    
    .submenu .submenu a {
        padding: 4px 7.5px;
        font-size: 13px; /* 与移动端二级菜单文字大小一致 */
        font-family: 'ChangChengChangSong', 'Microsoft YaHei', Arial, sans-serif;
        margin: 0; /* 将间距减小到0 */
        text-align: center; /* 文字居中 */
        background-image: url('../img/sel2nochild.png') !important;
        background-size: 36px 149.5px !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        width: 36px;
        height: 149.5px;
        display: flex; /* 使用flex布局 */
        align-items: center; /* 垂直居中 */
        justify-content: center; /* 水平居中 */
        letter-spacing: 5px; /* 统一调节每个字和每个字之间的间距为5像素 */
    }
    
    /* 移动端子菜单显示逻辑 */
    .has-submenu.active .submenu {
        display: block;
    }
}

/* 小屏幕适配 */
@media (max-width: 480px) {
    /* 小屏幕主导航菜单字体大小 */
    .nav-menu a {
        font-size: 12pt !important;
        font-family: 'ChangChengChangSong', 'Microsoft YaHei', Arial, sans-serif !important;
        font-weight: normal !important;
    }
    
    .submenu {
        margin-left: 15px;
        min-width: auto;
    }
    
    .submenu .submenu {
        margin-left: 15px;
        min-width: auto;
    }
    
    .submenu a {
        padding: 0; /* 移除padding，让背景图片控制尺寸 */
        font-size: 12px;
        font-family: 'ChangChengChangSong', 'Microsoft YaHei', Arial, sans-serif;
        width: 36px; /* 设置固定宽度与背景图片一致 */
        height: 149.5px; /* 设置固定高度与背景图片一致 */
        letter-spacing: 5px; /* 统一调节每个字和每个字之间的间距为5像素 */
    }
} 