/* 全局变量 */
html {
  --header-height: 72px;
}

/* 头部基础样式 */
.base-header {
  position: relative;
  width: 100%;
  z-index: 1100;
  height: var(--header-height, 72px);
  background: var(--white-color);
  transition: all 0.3s;
}

.base-header .base-maxwidth {
  display: flex;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.base-header .logo {
  margin: auto 0;
  max-width: 130px;
  max-height: 40px;
}

/* 头部内容区 */
.base-header .base-header-msg {
  display: flex;
  justify-content: space-between;
}

/* 主菜单 */
.base-header .menu {
  list-style: none;
  display: flex;
  align-items: center;
}

.base-header .main-menu {
  margin-right: 40px;
  height: 100%;
  position: relative;
}

.base-header .main-menu:last-child {
  margin-right: 0;
}

.base-header .main-menu .name {
  position: relative;
  display: flex;
  align-items: center;
}

.base-header .main-menu .name:not(.base-btn) {
  line-height: 1.3;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
  justify-content: center;
  text-align: center;
  height: 100%;
}

.base-header .main-menu .name svg {
  margin: 3px 0 0 8px;
  width: 13px;
  height: 7px;
  transition: all 0.3s;
}

.base-header .main-telephone {
  height: fit-content;
}

.base-header .main-telephone .menu-left {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--light-color);
  white-space: nowrap;
}

.base-header .main-telephone .menu-left svg {
  color: var(--white-color);
}

.base-header .main-telephone .menu-right {
  margin-left: 10px;
  height: fit-content;
  white-space: nowrap;
  line-height: 1.2;
}

.base-header .main-telephone .menu-top {
  color: var(--text-light-color);
}

.base-header .main-telephone .menu-bottom {
  color: var(--light-color);
  font-size: 26px;
  font-weight: 700;
}

/* 二级菜单默认隐藏 */
.base-header .main-menu.secondary .menu-secondary {
  position: absolute;
  z-index: 9;
  left: 50%;
  transform: translateX(-50%);
  width: fit-content;
  background: var(--white-color);
  top: -100vh;
  opacity: 0;
  transition: opacity 0.3s;
}

/* 二级菜单展开 */
.base-header .main-menu.active .menu-secondary {
  top: var(--header-height);
  opacity: 1;
  padding: 10px 0;
  background: #fff;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 0 20px rgba(0, 0, 0, .1);
  border-bottom: 4px solid #0554f2;
}

.base-header .main-menu.active .name svg {
  transform: rotate(180deg);
}

/* 二级菜单内容 */
.base-header .menu-secondary-list {
  display: flex;
  justify-content: space-between;
}

.base-header .menu-secondary-list h3 {
  padding-bottom: 16px;
  font-size: 18px;
  font-weight: 500;
}

.base-header .menu-secondary-list .secondary-card {
  width: 100%;
}

.base-header .menu-secondary-list .secondary-card-ul a {
  color: var(--text-primary-color);
  padding: 0 24px;
  white-space: nowrap;
  min-height: 40px;
  display: flex;
  align-items: center;
  text-align: left;
  line-height: 1.2;
}

.base-header .menu-secondary-list .secondary-card-ul a:hover {
  color: var(--light-color);
}

@media (min-width: 1025px) {

  /* 遮罩层 */
  .base-header-mask {
    content: '';
    display: block;
    position: fixed;
    z-index: 9;
    inset: 0;
    background: #000;
    opacity: .5;
    cursor: pointer;
  }

  .base-header .main-menu .name:not(.base-btn):hover {
    color: var(--light-color);
  }

  .base-header .main-menu a.name:not(.base-btn)::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 3px 3px 0 0;
    width: 100%;
    max-width: 50px;
    height: 3px;
    transition: background 0.3s;
  }

  .base-header .main-menu a.name:not(.base-btn):hover::before {
    background: var(--light-color);
  }

  /* 菜单下划线动画 */
  .base-header .main-menu .name::after {
    content: '';
    position: absolute;
    margin: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 0;
    height: 2px;
    opacity: 0;
    transition: all .3s;
  }

  /* 下划线激活状态 */
  .base-header .main-menu.secondary.active .name::after,
  .base-header .main-menu:hover .name::after {
    opacity: 1;
    width: 100%;
  }

  /* 按钮菜单居中 */
  .base-header .main-menu:has(.base-btn) {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* 背景hover效果 */
  .base-header .menu-secondary-list.block-bg .product-item::after {
    content: '';
    position: absolute;
    z-index: -1;
    top: 0;
    left: -8px;
    width: calc(100% + 16px);
    height: 100%;
    opacity: 0;
    border-radius: 8px;
    transition: all .3s;
  }

  /* 单行菜单特殊样式 */
  .base-header .single-row .menu-secondary-list {
    justify-content: center;
  }

  /* 左侧菜单布局 */
  .base-header .left-menu {
    position: relative;
    display: flex;
    align-items: center;
  }

  /* 隐藏移动端菜单按钮 */
  .mobile-menu {
    display: none;
  }
}

@media (max-width: 1300px) {
  .base-header .main-menu {
    margin-right: 20px;
  }
}

@media (max-width: 1100px) {
  .base-header .main-menu {
    margin-right: 10px;
  }
}

@media (max-width: 1024px) {
  html {
    --header-height: 50px;
  }

  .base-header {
    --header-bottom: 1px solid #f0f0f0;
    
    position: fixed;
    top: 0;
    background: #fff;
    color: #111;
    box-shadow: 0 0 10px rgba(0, 0, 0, .1);
  }

  .base-header .base-maxwidth {
    padding: 0 16px;
  }

  .base-header-msg {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: var(--primary-color);
    transform: translateX(100%)!important;
    transition: transform 0.4s ease;
    overflow-y: auto;
    z-index: 999;
  }

  .base-header-msg.active {
    transform: translateX(0)!important;
  }

  .base-header .menu {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 0 20px;
  }

  .base-header .main-menu {
    width: 100%;
    height: auto;
    margin-right: 0;
    border-bottom: var(--header-bottom);
  }

  .base-header .main-menu.not-border {
    border-bottom: none;
  }

  .base-header .main-menu.last {
    display: none;
  }

  .base-header .main-menu .name:not(.base-btn) {
    height: auto;
    line-height: unset;
    padding: 16px 0;
    font-size: 16px;
    font-weight: 500;
    justify-content: space-between;
    width: 100%;
    color: var(--white-color);
  }

  .base-header .main-menu.secondary .menu-secondary,
  .base-header .menu-secondary-list,
  .base-header .menu-secondary-list .secondary-card-ul,
  .base-header .menu-secondary-list .secondary-card-ul li,
  .base-header .menu-secondary-list .secondary-card-ul a {
    width: 100%;
  }

  .base-header .menu-secondary-list .secondary-card-ul a {
    color: var(--white-color);
    padding-left: 0;
    margin-left: 20px;
    border-bottom: var(--header-bottom);
  }

  .base-header .menu-secondary-list .secondary-card-ul li:last-child a {
    border-bottom: none;
  }

  /* 手风琴核心 */
  .base-header .main-menu.secondary .menu-secondary {
    position: static;
    transform: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease;
    padding: 0;
    background: unset;
    border-radius: 0;
    border: none;
  }

  .base-header .main-menu.secondary.active .menu-secondary {
    height: auto;
  }

  .secondary-card-ul {
    padding: 0 0 20px;
  }

  .secondary-card-ul li a {
    padding: 14px 20px;
    font-size: 15px;
  }

  /* 汉堡按钮 */
  .mobile-menu {
    display: block;
    width: 24px;
    height: 24px;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 1000;
  }

  .mobile-menu-icon,
  .mobile-menu-icon::before,
  .mobile-menu-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: #111;
    border-radius: 2px;
    transition: all 0.3s;
  }

  .mobile-menu-icon {
    top: 50%;
    transform: translateY(-50%);
  }

  .mobile-menu-icon::before {
    top: -8px;
  }

  .mobile-menu-icon::after {
    top: 8px;
  }

  .base-header-msg.active+.mobile-menu .mobile-menu-icon {
    background: transparent;
  }

  .base-header-msg.active+.mobile-menu .mobile-menu-icon::before {
    transform: rotate(-45deg);
    top: 0;
  }

  .base-header-msg.active+.mobile-menu .mobile-menu-icon::after {
    transform: rotate(45deg);
    top: 0;
  }

  /* 隐藏不需要 */
  .main-telephone {
    display: none;
  }

  header .base-btn {
    margin-top: 20px;
  }
}