/**
 * 燕喜堂企业优势单页 - 导航菜单样式
 *
 * 此文件包含 header-nav-wrapper 导航菜单div使用的所有CSS样式
 * 包括PC端和移动端响应式设计
 */

/* ============================================
 * 网格容器基础样式
 * ============================================ */

/* 网格容器清除浮动 */
#header-nav-wrapper .nav-grid::after {
  content: "";
  clear: left;
  display: block;
}

/* 网格box容器 - 宽度100%，隐藏溢出 */
#header-nav-wrapper > div > .nav-grid {
  width: 100%;
  overflow: hidden;
  position: static;
}

/* 网格单元格 - 左浮动 */
#header-nav-wrapper > div > .nav-cell {
  float: left;
  position: static;
}

/* 信号网格box - 最小高度继承 */
#header-nav-wrapper > .nav-grid.nav-signal {
  min-height: inherit;
}

/* 信号网格单元格 - 最小高度强制继承 */
#header-nav-wrapper > .nav-grid.nav-signal > .nav-cell {
  min-height: inherit !important;
}

/* 主网格容器 - 居中对齐，宽度100% */
#header-nav-wrapper {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* ============================================
 * 响应式网格布局
 * ============================================ */

/* 移动端：屏幕宽度≤768px */
@media screen and (max-width: 768px) {
  #header-nav-wrapper > .nav-grid > .nav-cell:nth-child(1n + 1) {
    width: 100%;
    margin-left: 0%;
    margin-right: 0%;
    margin-top: 0rem;
    margin-bottom: 0rem;
    clear: left;
  }
}

/* PC端：屏幕宽度≥769px */
@media screen and (min-width: 769px) {
  #header-nav-wrapper > .nav-grid > .nav-cell:nth-child(1n + 1) {
    width: 100%;
    margin-left: 0%;
    margin-right: 0%;
    margin-top: 0rem;
    margin-bottom: 0rem;
    clear: left;
  }
}

/* 平板端：769px≤屏幕宽度≤1024px */
@media screen and (max-width: 1024px) and (min-width: 769px) {
  #header-nav-wrapper > .nav-grid > .nav-cell:nth-child(1n + 1) {
    width: 100%;
    margin-left: 0%;
    margin-right: 0%;
    margin-top: 0rem;
    margin-bottom: 0rem;
    clear: left;
  }
}

/* ============================================
 * 导航容器样式
 * ============================================ */

/* 静态导航容器 - 固定定位在顶部 */
#header-nav {
  min-height: 0px;
  padding-left: 0px;
  padding-right: 0px;
  display-radio: 1;
  padding-top: 0px;
  padding-bottom: 0px;
  position: fixed;
  width: 100%;
  max-width: none;
  min-width: 0px;
  height: auto;
  max-height: none;
  margin-top: 0px;
  margin-right: 0px;
  margin-bottom: 0px;
  margin-left: 0px;
  top: 0px;
  bottom: auto;
  left: 50%;
  right: auto;
  z-index: 11;
  transform: translate(-50%, 0px);
  inset: 0px auto auto 50%;
  content: "tc";
  background: transparent;
}

/* 导航容器内部 - 弹性布局，最大宽度1100px */
#header-nav .nav-container {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  width: auto;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  display-radio: flex;
  margin-top: 16px;
  margin-bottom: 16px;
}

/* 容器内项目 - 弹性比例1 */
#header-nav .nav-container > .nav-item {
  flex: 1;
  max-width: 100%;
  max-height: 100%;
}

/* 导航box - 占据全部宽度，居中对齐 */
#header-nav .nav-container .nav-box {
  flex: 0 0 100%;
  align-self: center;
}

/* ============================================
 * 导航菜单主体样式
 * ============================================ */

/* 一级菜单容器 - 右对齐的弹性布局 */
#header-nav .main-nav .nav-menu-level1 {
  display: flex;
  justify-content: flex-end;
}

/* 图标容器 - 45x45px，居中显示 */
#header-nav .main-nav .nav-icon-box {
  height: 45px;
  width: 45px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 打开菜单图标 - 宽度100% */
#header-nav .main-nav .nav-icon-open {
  width: 100%;
}

/* 关闭菜单图标 - 宽度100%，高度30px */
#header-nav .main-nav .nav-icon-close {
  width: 100%;
  height: 30px;
}

/* 移动端菜单按钮 - PC端隐藏 */
#header-nav .main-nav .nav-menu-btn {
  display: none;
}

/* ============================================
 * 二级菜单样式
 * ============================================ */

/* 二级菜单容器 - 默认隐藏，绝对定位 */
#header-nav .main-nav .nav-menu-level2 {
  display: none;
  height: 0px;
  background: #fff;
  width: 160px !important;
  position: absolute;
  left: 50%;
  top: 100%;
  z-index: 99;
  transform: translateX(-30px);
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  overflow: hidden;
  box-shadow: 0 6px 12px rgb(0 0 0 / 18%);
  transition: 0.15s; /* 从0.5s改为0.15s，使过渡更快 */
  padding-top: 8px;
  padding-bottom: 5px;
}

/* 三级菜单容器 - 默认隐藏 */
#header-nav .main-nav .nav-menu-level3 {
  display: none;
  height: auto;
  padding: 15px 0;
  background: #fff;
  width: 130px;
  position: absolute;
  top: 0;
  left: 100%;
  z-index: 9;
  border-radius: 5px;
  border-top-left-radius: 0px;
}

/* ============================================
 * 菜单项样式
 * ============================================ */

/* 一级菜单项 - 相对定位，无边框，右边距35px */
#header-nav .main-nav .nav-item-level1 {
  position: relative;
  border: none;
  margin-right: 35px;
}

/* 二级菜单项 - 相对定位，宽度100% */
#header-nav .main-nav .nav-item-level2 {
  position: relative;
  width: 100%;
}

/* 三级菜单项 - 宽度100% */
#header-nav .main-nav .nav-item-level3 {
  width: 100%;
}

/* ============================================
 * 菜单链接样式
 * ============================================ */

/* 一级菜单链接 - 居中对齐 */
#header-nav .main-nav .nav-item-level1 a {
  font-size: 14px;
  padding-top: 15px;
  padding-bottom: 15px;
  padding-left: 15px;
  line-height: 20px;
  display: block;
  text-align: center;
}

/* 二级菜单链接 - 左对齐，灰色文字 */
#header-nav .main-nav .nav-item-level2 a {
  font-size: 14px;
  color: #6f7276;
  line-height: 30px;
  display: block;
  text-align: left;
  opacity: 1;
  transition: all ease 0.3s;
  padding: 3px 0px 3px 20px;
}

/* 二级菜单链接悬停效果 */
#header-nav .main-nav .nav-item-level2 a:hover {
  opacity: 1;
}

/* ============================================
 * 菜单内部元素样式
 * ============================================ */

/* 一级菜单项容器 */
#header-nav .main-nav .nav-menu-item1 {
  display-radio: 1;
}

/* 通用一级菜单项容器 */
#header-nav .nav-menu-item1 {
  display-radio: 1;
}

/* 二级菜单项容器 - 深灰色文字 */
#header-nav .main-nav .nav-menu-item2 {
  display-radio: 1;
  color: rgba(51, 51, 51, 1);
}

/* 二级菜单项悬停效果 - 浅灰色背景，快速过渡 */
#header-nav .main-nav .nav-menu-item2 {
  transition: background-color 0.1s ease; /* 添加快速背景色过渡 */
}
#header-nav .main-nav .nav-menu-item2:hover {
  background-color: #f5f5f5;
}

/* 二级菜单项悬停时链接变绿色 */
#header-nav .main-nav .nav-item-level2 a {
  transition: color 0.1s ease; /* 快速颜色过渡 */
}
#header-nav .main-nav .nav-item-level2:hover a {
  color: #08c881;
}

/* 三级菜单项容器 - 中灰色文字 */
#header-nav .main-nav .nav-menu-item3 {
  display-radio: 1;
  color: rgba(102, 102, 102, 1);
}

/* ============================================
 * 通用组件样式
 * ============================================ */

/* 菜单标题 - 白色文字，14px */
.nav-title {
  color: #fff;
  font-size: 14px;
}

/* 办公入口菜单项 - 顶部内边距14px */
.oa {
  padding-top: 14px;
}

/* 办公入口链接 - 圆角边框样式 */
.oa > a {
  font-size: 12px;
  border: 1px solid #c5c8c9;
  border-radius: 11px;
  height: 20px;
  line-height: 20px;
  padding: 0 10px !important;
  color: #fff;
}

/* ============================================
 * 菜单交互效果
 * ============================================ */

/* 一级菜单项悬停时显示二级菜单 - 绿色底部边框 */
.nav-item-level1:hover .nav-menu-level2 {
  display: block !important; /* 确保显示 */
  height: auto !important;
  transition: 0.15s; /* 从0.5s改为0.15s */
  border-bottom: 3px solid #08c881;
}

/* 二级菜单容器自身悬停效果 */
#header-nav .main-nav .nav-menu-level2:hover {
  height: auto !important;
  transition: 0.5s;
}

/* ============================================
 * Logo样式
 * ============================================ */

/* Logo - 燕喜堂品牌Logo */
.logo {
  background: url(../image/yxtLogo.png) no-repeat center;
  width: 145px;
  height: 50px;
  display: block;
  background-size: 100% !important;
  float: left;
  background-image: url(../image/yxtLogo.png);
  background-repeat: no-repeat;
  background-image: url(../image/yxtLogo.png);
  background-repeat: no-repeat;
}

/* ============================================
 * 特定菜单项隐藏箭头图标
 * ============================================ */

/* 第4个一级菜单项隐藏箭头 */
#header-nav .main-nav .nav-item-level1:nth-child(4) .nav-arrow-icon {
  display: none;
}

/* 第6个一级菜单项隐藏箭头 */
#header-nav .main-nav .nav-item-level1:nth-child(6) .nav-arrow-icon {
  display: none;
}

/* 第8个一级菜单项隐藏箭头 */
#header-nav .main-nav .nav-item-level1:nth-child(8) .nav-arrow-icon {
  display: none;
}

/* 第7个一级菜单项的二级菜单位置调整 */
#header-nav .main-nav .nav-item-level1:nth-child(7) .nav-menu-level2 {
  transform: translateX(-17px);
}

/* ============================================
 * 滚动时导航栏样式变化
 * ============================================ */

/* 滚动时导航栏 - 白色背景，阴影效果 */
.nav-scrolled #header-nav {
  transition: all 0.3s;
  background: #fff;
  box-shadow: 0 0 10px rgb(0 0 0 / 10%);
}

/* 滚动时Logo更换 */
.nav-scrolled .logo {
  background-image: url(../image/yxtLogo.png);
  background-repeat: no-repeat;
  background-image: url(../image/yxtLogo.png);
  background-repeat: no-repeat;
}

/* 滚动时标题文字变深灰色 */
.nav-scrolled .nav-title {
  color: #333;
}

/* 滚动时办公入口链接变深灰色 */
.nav-scrolled .oa a {
  font-size: 12px;
  border: 1px solid #c5c8c9;
  border-radius: 11px;
  height: 20px;
  line-height: 20px;
  padding: 0 10px !important;
  color: #333;
}

/* 滚动时导航栏层级最高 */
.nav-scrolled {
  z-index: 11111111111111111111;
}

/* ============================================
 * PC端/移动端Logo显示控制
 * ============================================ */

/* 移动端Logo - 默认隐藏 */
.logo-mobile {
  display: none;
}

/* PC端Logo - 默认显示 */
.logo-desktop {
  display: block;
}

/* ============================================
 * 移动端（≤768px）响应式样式
 * ============================================ */

@media screen and (max-width: 768px) {
  /* 导航容器内边距重置 */
  #header-nav {
    padding-left: 0px;
    padding-right: 0px;
    padding-top: 0px;
    padding-bottom: 0px;
  }

  /* 一级菜单容器 - 块级布局，白色背景，高度自适应 */
  #header-nav .main-nav .nav-menu-level1 {
    display: block;
    width: 100%;
    height: auto;
    background: #fff;
  }

  /* 图标容器显示 */
  #header-nav .main-nav .nav-icon-box {
    display: block;
  }

  /* 导航菜单内容 - 固定定位全屏覆盖 */
  #header-nav .main-nav .nav-menu-content {
    display: none;
    padding: 0px;
    height: 100%;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #fbfbfb;
    z-index: 99;
    background-image: url(https://omo-oss-image.thefastimg.com/portal-saas/pg2024122415235745726/cms/image/e49bec7b-79bd-44f0-98fb-e261d8bfcad1.png);
    background-position: 0.3rem;
    background-repeat: no-repeat;
    background-size: 91px;
  }

  /* 导航菜单按钮显示 */
  #header-nav .main-nav .nav-menu-btn {
    display: flex;
    justify-content: flex-end;
  }

  /* 二级、三级菜单 - 左右内边距15px，无背景 */
  #header-nav .main-nav .nav-menu-level2,
  #header-nav .main-nav .nav-menu-level3 {
    padding: 0 15px;
    background: none;
  }

  /* 箭头图标 - 右浮动，旋转过渡效果 */
  #header-nav .main-nav .nav-arrow-icon {
    float: right;
    transition: 0.5s;
    height: 40px;
    margin-top: 10px;
    color: #d9d9d9;
  }

  /* 箭头悬停效果 - 旋转90度 */
  #header-nav .main-nav .nav-arrow-hover {
    transition: 0.5s;
    transform: rotate(90deg);
  }

  /* 二级、三级菜单 - 移动端重新定位 */
  #header-nav .main-nav .nav-menu-level2,
  #header-nav .main-nav .nav-menu-level3 {
    width: 100%;
    left: 0;
    transform: translateX(0);
    position: inherit;
    border-radius: 0;
    width: 100% !important;
    border-bottom: 0px;
    background: #f6f7fa;
    box-shadow: 0 6px 12px rgb(0 0 0 / 0%);
  }

  /* 一级菜单项 - 底部边框分隔，行高50px */
  #header-nav .main-nav .nav-item-level1 {
    border-bottom: 1px solid rgb(0 0 0 / 5%);
    line-height: 50px;
    font-size: 14px;
    margin-right: 0px;
    overflow: hidden;
  }

  /* 一级、二级菜单链接 - 左对齐，内联显示 */
  #header-nav .main-nav .nav-item-level1 a,
  #header-nav .main-nav .nav-item-level2 a {
    line-height: 50px;
    font-size: 14px;
    padding: 0;
    display: inline;
    text-align: left;
    opacity: 1;
    float: left;
  }

  /* 菜单标题 - 移动端弹性布局 */
  #header-nav .nav-title {
    font-size: 0.3rem;
    color: #2c313b;
    display: flex;
    height: 1.2rem;
    justify-content: space-between;
    align-items: center;
  }

  /* SVG图标 - 移动端显示 */
  #header-nav svg {
    display: block !important;
    color: #fff;
    height: 49px;
    width: 24px !important;
    padding: 11px 0px;
    float: right;
  }

  /* 滚动时SVG图标变绿色 */
  .nav-scrolled svg {
    color: rgba(8, 200, 129, 1) !important;
  }

  /* Logo - 移动端尺寸调整 */
  .logo {
    width: 91px;
    flex: 0 0 1.82rem;
    height: 46px;
  }

  /* 导航容器 - 移动端边距重置 */
  #header-nav .nav-container {
    margin-top: 0px;
    margin-bottom: 0px;
    padding: 0 0.3rem;
  }

  /* 关闭图标 - 移动端样式 */
  #header-nav .main-nav .nav-icon-close {
    color: rgb(211 211 211) !important;
    height: auto;
  }

  /* 导航菜单内的导航按钮 - 左右内边距 */
  .nav-menu-content .nav-menu-btn {
    padding: 0 0.3rem;
  }

  /* 办公入口 - 移动端隐藏 */
  .oa {
    display: none;
  }

  /* 一级菜单项 - 移动端溢出隐藏 */
  #header-nav .main-nav .nav-menu-item1 {
    overflow: hidden;
    padding: 0 0.3rem;
  }

  /* 二级菜单项 - 移动端溢出隐藏 */
  #header-nav .main-nav .nav-item-level2 {
    overflow: hidden;
  }

  /* 二级菜单内箭头图标 - 移动端隐藏 */
  #header-nav .main-nav .nav-menu-level1 li ul li p svg {
    display: none !important;
  }

  /* 第7个一级菜单项的二级菜单位置 - 移动端重置 */
  #header-nav .main-nav .nav-item-level1:nth-child(7) .nav-menu-level2 {
    transform: translateX(-0px);
  }

  /* 移动端Logo显示 */
  .logo-mobile {
    display: block;
  }

  /* PC端Logo隐藏 */
  .logo-desktop {
    display: none;
  }

  /* HTML根字体大小 - 移动端50px（用于rem单位） */
  html {
    font-size: 50px;
  }
}

/* ============================================
 * PC端（≥769px）特定样式
 * ============================================ */

@media screen and (min-width: 769px) {
  /* 箭头图标 - PC端旋转90度，绝对定位 */
  #header-nav .main-nav .nav-arrow-icon {
    transform: rotate(90deg);
    position: absolute;
    top: 19px;
    float: right;
    right: -20px;
    display: inline-block;
    vertical-align: middle;
    border-top: 4px solid\9;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    margin-left: 2px;
    color: #fff;
  }

  /* 二级菜单项内箭头图标 - PC端隐藏 */
  #header-nav .main-nav .nav-item-level2 .nav-arrow-icon {
    display: none;
  }

  /* 图标容器 - PC端隐藏 */
  #header-nav .main-nav .nav-icon-box {
    display: none;
  }
}
