/* Shared classic site header. Scoped to .site-header so legacy page styles stay isolated. */
.site-header {
  --header-red: #ee3231;
  --header-ink: #333;
  --header-muted: #646566;
  position: relative;
  z-index: 100;
  height: auto !important;
  min-height: 132px;
  background: #f7f7f7;
  color: var(--header-ink)
}

.site-header * {
  box-sizing: border-box
}

.site-header .site-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 1240px;
  max-width: calc(100% - 30px);
  height: 52px;
  margin: 0 auto;
  padding: 0 18px;
  background: #f7f7f7;
  /* border: 1px solid #ededed; */
  /* border-top: 0; */
  border-radius: 0 0 4px 4px
}

.site-header .kefu {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--header-muted);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap
}

.site-header .kefu .name,
.site-header .kefu .tel {
  display: inline-flex;
  align-items: center
}

/* .site-header .kefu .name:before{content:"";width:4px;height:4px;margin-right:8px;border-radius:50%;background:var(--header-red)} */
.site-header .kefu .tel {
  color: #777
}

.site-header .site-account,
.site-header .loginReg {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--header-muted);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap
}

.site-header .site-account a {
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease
}

.site-header .site-account a:hover {
  color: var(--header-red)
}

/* 账号区统一顺序：购物车、学习中心、用户菜单。 */
.site-header .site-account .site-cart {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid #e7e7e7;
  border-radius: 4px;
  background: #fff;
  color: #666;
}
.site-header .site-account .site-cart .layui-icon,
.site-header .site-account .xuexi .layui-icon {
  color: currentColor;
  font-size: 16px;
  line-height: 1;
}
.site-header .site-account .site-cart { position: relative; }
.site-header .site-account .site-cart-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--header-red);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
  box-sizing: border-box;
}
.site-header .site-account .site-cart-count[data-cart-count="0"] { display: none; }
.site-header .site-account .site-cart:hover {
  border-color: #efaaa7;
  background: #fff8f7;
}

.site-header .site-account .login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 8px 14px;
  border: 1px solid var(--header-red);
  border-radius: 4px;
  background: var(--header-red);
  color: #fff
}

.site-header .site-account .login:hover {
  background: #d92827;
  color: #fff
}

.site-header .site-account .regist {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #666
}

.site-header .site-account .regist:hover {
  border-color: #efaaa7;
  background: #fff8f7;
  color: var(--header-red)
}

.site-header .site-account .xuexi {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border: 1px solid #f1c5c2;
  border-radius: 4px;
  background: #fff8f7;
  color: var(--header-red)
}

.site-header .site-account .xuexi:hover {
  border-color: var(--header-red);
  background: #fff0ee
}

.site-header .site-account .tuichu {
  padding: 7px 0 7px 12px;
  border-left: 1px solid #ddd;
  color: #888
}

.site-header .site-account .tuichu:hover {
  color: var(--header-red)
}

.site-header .site-user {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 150px;
  padding: 7px 10px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  background: #fff;
  color: #444;
  cursor: pointer
}

.site-header .site-user-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.site-header .site-user .layui-icon {
  color: #aaa;
  font-size: 12px
}

.site-header .layui-dropdown-menu {
  min-width: 132px;
  padding: 6px 0;
  border: 1px solid #eee;
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(0,0,0,.1)
}
.site-header .layui-dropdown-menu li {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 16px;
  color: #555;
  font-size: 14px;
  line-height: 38px;
  white-space: nowrap
}
.site-header .layui-dropdown-menu li:hover {
  color: var(--header-red);
  background: #fff5f4
}
.site-header .layui-dropdown-menu li .layui-icon {
  width: 16px;
  color: #999;
  font-size: 16px;
  text-align: center
}
.site-header .layui-dropdown-menu li:hover .layui-icon { color: var(--header-red) }

/* layui 2.11 escapes HTML in dropdown titles; keep titles as text and add icons safely. */
.site-header .layui-dropdown-menu li .layui-menu-body-title {
  display: flex;
  align-items: center;
  gap: 9px;
}
.site-header .layui-dropdown-menu li .layui-menu-body-title::before {
  display: inline-block;
  width: 16px;
  color: #999;
  font-family: layui-icon !important;
  font-size: 16px;
  line-height: 1;
  text-align: center;
}
.site-header .layui-dropdown-menu li:nth-child(1) .layui-menu-body-title::before { content: "\e652"; }
.site-header .layui-dropdown-menu li:nth-child(2) .layui-menu-body-title::before { content: "\e63c"; }
.site-header .layui-dropdown-menu li:nth-child(3) .layui-menu-body-title::before { content: "\e682"; }
.site-header .layui-dropdown-menu li:hover .layui-menu-body-title::before { color: var(--header-red); }

.site-header .topnav {
  float: none;
  clear: both;
  width: 100%;
  height: 80px;
  border-bottom: 1px solid #eee;
  background: #fff
}

.site-header .topnav nav {
  width: 1240px;
  max-width: calc(100% - 30px);
  height: 80px;
  margin: 0 auto
}

.site-header #starlist {
  display: flex;
  align-items: center;
  height: 80px;
  margin: 0;
  padding: 0;
  list-style: none
}

.site-header #starlist>li {
  position: relative;
  height: 80px;
  margin: 0;
  padding: 0
}

.site-header #starlist>li.logo {
  display: flex;
  align-items: center;
  width: 290px;
  margin-right: 20px
}

.site-header #starlist>li.logo>a {
  display: flex;
  align-items: center;
  height: 80px;
  padding: 0
}

.site-header .logoImg {
  display: block;
  width: auto;
  max-width: 205px;
  height: 50px;
  object-fit: contain
}

.site-header .logoGif {
  display: block;
  width: auto;
  height: 46px;
  margin-left: 9px;
  object-fit: contain
}

.site-header #starlist>li:not(.logo)>a {
  display: flex;
  align-items: center;
  height: 80px;
  padding: 0 15px;
  color: var(--header-ink);
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease
}

.site-header #starlist>li:not(.logo)>a:hover,
.site-header #starlist>li:not(.logo)>a#selected,
.site-header #starlist>li.active>a,
.site-header #starlist .menu:hover>a {
  color: var(--header-red);
  background: #fff8f7
}

.site-header #starlist .menu>span {
  position: absolute;
  right: 5px;
  bottom: 35px;
  width: 0;
  height: 0;
  border: 4px solid transparent;
  border-top-color: #aaa;
  transform: translateY(2px);
  transition: border-top-color .2s ease, transform .2s ease
}

.site-header #starlist .menu:hover>span,
.site-header #starlist .menu:focus-within>span {
  border-top-color: var(--header-red);
  transform: translateY(4px)
}

.site-header #starlist .sub {
  position: absolute;
  top: 76px;
  left: 0;
  z-index: 10;
  display: block;
  visibility: hidden;
  min-width: 178px;
  margin: 0;
  padding: 7px 0;
  border: 1px solid #e8e8e8;
  border-top: 2px solid var(--header-red);
  border-radius: 0 0 4px 4px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
  list-style: none;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease
}

.site-header #starlist .menu:hover>.sub,
.site-header #starlist .menu:focus-within>.sub {
  visibility: visible;
  opacity: 1;
  transform: translateY(0)
}

.site-header #starlist .sub li {
  margin: 0;
  padding: 0
}

.site-header #starlist .sub a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 18px;
  color: #555;
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s ease, background-color .18s ease, padding-left .18s ease
}

.site-header #starlist .sub a:hover,
.site-header #starlist .sub a:focus {
  padding-left: 22px;
  background: #fff5f4;
  color: var(--header-red)
}

.site-header #mnavh {
  display: none
}

.site-header a:focus-visible,
.site-header #mnavh:focus-visible {
  outline: 2px solid rgba(238, 50, 49, .55);
  outline-offset: 2px
}

/* Learning center keeps its own Layui shell while sharing brand accents. */
.learning-shell {
  background: #fff;
  border-top: 3px solid var(--header-red);
  color: #333
}

@media (max-width:1100px) {
  .site-header #starlist>li.logo {
    width: 240px
  }

  .site-header #starlist>li:not(.logo)>a {
    padding: 0 9px;
    font-size: 15px
  }

  .site-header .logoGif {
    display: none
  }
}

@media (max-width:768px) {
  .site-header {
    min-height: 102px;
  }
  .site-header .site-topbar {
    height: 46px;
    max-width: calc(100% - 24px);
    padding: 0 10px;
    border-radius: 0 0 3px 3px
  }

  .site-header .kefu {
    display: none
  }

  .site-header .site-account {
    margin-left: auto;
    gap: 8px;
    font-size: 12px
  }

  .site-header .site-account .site-user {
    max-width: 120px;
    padding: 6px 8px
  }

  .site-header .site-account .site-user-name {
    max-width: 78px
  }

  .site-header .site-account .login {
    min-width: 60px;
    padding: 7px 10px
  }

  .site-header .site-account .regist {
    min-width: 44px;
    padding: 6px 8px
  }

  .site-header .site-account .xuexi {
    padding: 6px 8px
  }

  .site-header .site-account .site-cart {
    padding: 6px 8px
  }

  .site-header .site-account .tuichu {
    padding: 6px 0 6px 8px
  }

  .site-header .topnav,
  .site-header .topnav nav {
    height: 56px
  }

  .site-header .topnav nav {
    max-width: calc(100% - 24px)
  }

  .site-header #starlist {
    position: absolute;
    top: 102px;
    left: 0;
    right: 0;
    display: none;
    height: auto;
    padding: 5px 12px;
    border-top: 1px solid #eee;
    background: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .1)
  }

  .site-header #starlist.is-open {
    display: block
  }

  .site-header #starlist>li,
  .site-header #starlist>li.logo {
    display: block;
    width: auto;
    height: auto;
    margin: 0
  }

  .site-header #starlist>li.logo {
    display: none
  }

  .site-header #starlist>li:not(.logo)>a {
    height: 43px;
    padding: 0 14px;
    border-bottom: 1px solid #f2f2f2;
    font-size: 15px
  }

  .site-header #starlist .menu>span {
    right: 17px;
    bottom: 20px
  }

  .site-header #starlist .sub {
    position: static;
    display: none;
    visibility: visible;
    min-width: 0;
    padding: 0;
    border: 0;
    border-left: 2px solid #f1c0bc;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    opacity: 1;
    transform: none
  }

  .site-header #starlist .menu:hover>.sub,
  .site-header #starlist .menu:focus-within>.sub {
    display: block
  }

  .site-header #starlist .sub a {
    padding: 9px 28px;
    font-size: 14px
  }

  .site-header .topnav nav:before {
    content: "";
    display: block;
    width: 190px;
    height: 56px;
    background: url('/static/index/images/logo.png') left center/contain no-repeat
  }

  .site-header #mnavh {
    position: absolute;
    top: 46px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 56px;
    margin: 0;
    cursor: pointer
  }

  .site-header #mnavh .navicon,
  .site-header #mnavh .navicon:before,
  .site-header #mnavh .navicon:after {
    display: block;
    width: 22px;
    height: 2px;
    background: #555;
    content: "";
    transition: transform .2s ease
  }

  .site-header #mnavh .navicon {
    position: relative
  }

  .site-header #mnavh .navicon:before {
    position: absolute;
    top: -7px
  }

  .site-header #mnavh .navicon:after {
    position: absolute;
    top: 7px
  }
}

@media (prefers-reduced-motion:reduce) {
  .site-header * {
    transition: none !important
  }
}
