 /* ============================================
   站点顶部导航
   命名前缀 sh- (site header)
   ============================================ */

:root {
  --sh-h:           90px;       /* 默认高度 */
  --sh-h-sticky:    64px;       /* 滚动态高度 */
  --sh-pad-x:       40px;       /* 左右内边距 */
  --sh-text-light:  #ffffff;    /* 透明状态文字 */
  --sh-text-dark:   #555555;    /* 白底状态文字 */
  --sh-accent:      #881e4f;    /* 主题色 */
  --sh-ease:        cubic-bezier(.25, .8, .25, 1);
}

/* ---- 顶栏骨架 ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  transition:
    background-color .35s var(--sh-ease),
    box-shadow .35s var(--sh-ease);
}

.site-header.is-solid,
body.has-solid-header .site-header {
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

.sh-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--sh-pad-x);
  height: var(--sh-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: height .35s var(--sh-ease);
}

.site-header.is-solid .sh-container {
  height: var(--sh-h-sticky);
}

/* ---- Logo 双图切换 ---- */
.sh-logo {
  position: relative;
  width: 210px;
  height: 52px;
  flex-shrink: 0;
  display: block;
}

.sh-logo img {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  max-height: 100%;
  max-width: 100%;
  transition: opacity .35s var(--sh-ease);
}

.sh-logo .sh-logo-dark { opacity: 0; }

.site-header.is-solid .sh-logo .sh-logo-light,
body.has-solid-header .sh-logo .sh-logo-light { opacity: 0; }

.site-header.is-solid .sh-logo .sh-logo-dark,
body.has-solid-header .sh-logo .sh-logo-dark { opacity: 1; }

/* ---- 桌面导航 ---- */
.sh-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.sh-menu {
  display: flex;
  align-items: center;
  gap: 36px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sh-menu > li {
  position: relative;
}

.sh-menu > li > a {
  display: inline-block;
  padding: 10px 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--sh-text-light);
  text-decoration: none;
  white-space: nowrap;
  transition: color .3s;
}

.site-header.is-solid .sh-menu > li > a,
body.has-solid-header .sh-menu > li > a {
  color: var(--sh-text-dark);
}

.sh-menu > li > a:hover,
.sh-menu > li > a:focus {
  color: var(--sh-accent);
}

/* ---- 子菜单 ---- */
.sh-submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 8px);
  min-width: 168px;
  padding: 8px 0;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity .25s var(--sh-ease),
    transform .25s var(--sh-ease),
    visibility .25s var(--sh-ease);
}

.sh-menu > li.has-sub:hover .sh-submenu,
.sh-menu > li.has-sub:focus-within .sh-submenu,
.sh-menu > li.has-sub.is-expanded .sh-submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.sh-submenu a {
  display: block;
  padding: 10px 24px;
  font-size: 14px;
  color: #555;
  text-align: center;
  text-decoration: none;
  transition: background-color .2s, color .2s;
}

.sh-submenu a:hover {
  background: #f7f2f5;
  color: var(--sh-accent);
}

/* ---- 汉堡按钮（PC 隐藏） ---- */
.sh-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  position: relative;
}

.sh-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  margin: 5px auto;
  background: #fff;
  border-radius: 2px;
  transition: transform .3s, opacity .3s, background-color .3s;
}

.site-header.is-solid .sh-toggle span,
body.has-solid-header .sh-toggle span { background: #333; }

.site-header.is-open .sh-toggle span:nth-child(1) { transform: translateY(7px)  rotate(45deg);  }
.site-header.is-open .sh-toggle span:nth-child(2) { opacity: 0; }
.site-header.is-open .sh-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- 移动端遮罩 ---- */
.sh-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}

.sh-backdrop.is-show {
  opacity: 1;
  visibility: visible;
}

/* ---- 回到顶部 ---- */
.sh-top {
  position: fixed;
  right: 24px;
  bottom: 48px;
  z-index: 900;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sh-accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: 0 6px 18px rgba(136, 30, 79, .35);

  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity .3s, transform .3s, visibility .3s;
}

.sh-top.is-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sh-top span {
  font-size: 10px;
  line-height: 1;
}

/* ============================================
   响应式：<= 1024px 进入移动模式
   ============================================ */
@media (max-width: 1024px) {
  :root {
    --sh-h:        60px;
    --sh-h-sticky: 60px;
    --sh-pad-x:    16px;
  }

  /* 移动端导航常驻白底，logo 固定用深色版 */
  .site-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  }
  .sh-logo { width: 140px; height: 36px; }
  .site-header .sh-logo .sh-logo-light { opacity: 0; }
  .site-header .sh-logo .sh-logo-dark  { opacity: 1; }
  .sh-toggle span { background: #333; }

  /* 移动菜单：从顶部展开 */
  .sh-nav {
    position: fixed;
    top: var(--sh-h);
    left: 0;
    right: 0;
    z-index: 1000;
    display: block;
    background: #fff;
    border-top: 1px solid #eee;
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s var(--sh-ease);
  }

  .site-header.is-open .sh-nav {
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sh-menu {
    display: block;
    padding: 8px 16px;
    gap: 0;
  }

  .sh-menu > li { border-bottom: 1px solid #f0f0f0; }
  .sh-menu > li:last-child { border-bottom: 0; }

  .sh-menu > li > a {
    display: block;
    padding: 14px 0;
    font-size: 16px;
    color: var(--sh-text-dark);
  }

  .sh-menu > li.has-sub > a::after {
    content: "+";
    float: right;
    font-size: 20px;
    line-height: 1;
    color: #999;
    transition: transform .3s;
  }
  .sh-menu > li.has-sub.is-expanded > a::after {
    content: "−";
  }

  /* 移动端子菜单：可折叠 */
   

  .sh-menu > li.has-sub.is-expanded .sh-submenu {
    max-height: 600px;
  }

  .sh-submenu a {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
  }
  .sh-submenu a:last-child { border-bottom: 0; }

  .sh-toggle { display: block; }

  /* 打开菜单时锁定页面滚动 */
  body.sh-menu-open { overflow: hidden; }

  .sh-top { right: 16px; bottom: 24px; }
}@media (max-width: 1024px) {

  /* —— 基础折叠态：覆盖桌面端所有打开状态，包括 is-expanded —— */
  .sh-submenu,
  .site-header .sh-menu > li.has-sub .sh-submenu,
  .site-header .sh-menu > li.has-sub:hover .sh-submenu,
  .site-header .sh-menu > li.has-sub:focus-within .sh-submenu {
    position: static;
    left: auto;
    top: auto;
    transform: none;          /* ★ 关键：把桌面的 translate(-50%,0) 彻底干掉 */
    min-width: 0;
    padding: 0;
    background: #fafafa;
    box-shadow: none;
    border-radius: 0;

    max-height: 0;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transition: max-height .3s var(--sh-ease);
  }

  /* —— 展开态 —— */
  .site-header .sh-menu > li.has-sub.is-expanded .sh-submenu {
    max-height: 600px;
  }
}