/* ==========================================================================
   全站统一 header —— 一份 HTML 导航，靠媒体查询适配移动端 / PC
   --------------------------------------------------------------------------
   断点：1180px（导航 9 项需要更宽才不换行）
   移动端菜单为纯 CSS 开关（checkbox + label），不依赖任何 JS
   命名统一 sa- 前缀，避免与 Tailwind 工具类冲突
   ========================================================================== */

/* ---------- 顶部公告栏 ---------- */
.sa-topbar {
  background: #172554;
  color: #d1d5db;
  font-size: 12px;
  line-height: 1.5;
  border-bottom: 1px solid #1e3a8a;
}

.sa-topbar__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sa-topbar__group {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  text-align: center;
}

.sa-topbar a {
  color: inherit;
  text-decoration: none;
  transition: color .15s;
}

.sa-topbar a:hover { color: #fff; }

.sa-topbar__tel {
  color: #fbbf24;
  font-weight: 600;
}

.sa-topbar__tel:hover {
  color: #fcd34d;
  text-decoration: underline;
}

/* 窄屏隐藏的次要信息 */
.sa-topbar__wide { display: none; }

/* 仅屏幕阅读器可见 */
.sa-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 主导航 ---------- */
.sa-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .06);
}

.sa-nav__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 6px 16px;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ---------- 品牌 ---------- */
.sa-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  text-decoration: none;
}

/* 品牌 LOGO：images/logo.png（600×400 源图，3:2 白底不透明，符合百度站点 logo 规范）。
   3:2 的图在页头只能靠高度控制尺寸，宽度自动 = 1.5 × 高度。
   三重保险，任何情况下都不会撑破页面：
     ① HTML 的 width/height 写的是显示尺寸（108×72），不是源图 600×400；
     ② max-width:100% + 容器 min-width:0，容器变窄时图片跟着缩；
     ③ 导航高度 = logo 高度 + 上下各 6px，min-height 与之一一对应。 */
.sa-brand__logo {
  display: block;
  width: auto;
  height: 64px;
  max-width: 100%;
}

@media (min-width: 1180px) {
  .sa-brand__logo { height: 72px; }
}

/* ---------- 移动端开关（纯 CSS，无 JS） ---------- */
.sa-nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sa-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  color: #374151;
  cursor: pointer;
  transition: background .15s;
}

.sa-burger:hover { background: #f9fafb; }

.sa-burger i {
  font-size: 24px;
  line-height: 1;
}

.sa-burger__close { display: none; }

.sa-nav-toggle:checked + .sa-burger .sa-burger__open { display: none; }
.sa-nav-toggle:checked + .sa-burger .sa-burger__close { display: inline; }
.sa-nav-toggle:focus-visible + .sa-burger { outline: 2px solid #1d4ed8; outline-offset: 2px; }

/* ---------- 菜单（移动端：抽屉） ---------- */
.sa-nav__menu {
  list-style: none;
  margin: 0;
  padding: 8px 12px 16px;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .08);
  max-height: 75vh;
  overflow-y: auto;
  display: none;
}

.sa-nav-toggle:checked ~ .sa-nav__menu {
  display: flex;
  flex-direction: column;
}

.sa-nav__item { position: relative; }

.sa-nav__link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 6px;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, color .15s;
}

.sa-nav__link:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.sa-nav__link[aria-current="page"] { color: #1d4ed8; }

.sa-nav__caret {
  font-size: 11px;
  line-height: 1;
  opacity: .7;
  transition: transform .2s;
}

/* 子菜单（移动端：常驻展开 + 缩进） */
.sa-nav__sub {
  list-style: none;
  margin: 0 0 4px;
  padding: 0 0 0 12px;
  border-left: 2px solid #e5e7eb;
}

.sa-nav__sub a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: #4b5563;
  font-size: 13px;
  text-decoration: none;
  transition: background .15s, color .15s;
}

.sa-nav__sub a:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.sa-nav__sub a[aria-current="page"] {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

/* ---------- 主 CTA ---------- */
.sa-nav__item--cta { order: -1; }

.sa-nav__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 4px 0 8px;
  padding: 11px 18px;
  border-radius: 6px;
  background: #d97706;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
  transition: background .15s;
}

.sa-nav__cta:hover {
  background: #b45309;
  color: #fff;
}

/* ==========================================================================
   PC 端（≥1180px）：横向排布，子菜单改为悬停下拉
   ========================================================================== */
@media (min-width: 1180px) {
  .sa-topbar__inner {
    flex-direction: row;
    justify-content: space-between;
    padding: 8px 24px;
  }

  .sa-topbar__group { text-align: left; }
  .sa-topbar__wide { display: inline; }

  .sa-nav__inner {
    padding: 6px 24px;
    min-height: 84px;
    justify-content: flex-start;
    gap: 20px;
  }

  /* 汉堡与开关在 PC 端不参与布局 */
  .sa-burger,
  .sa-nav-toggle { display: none; }

  .sa-nav__menu {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    padding: 0;
    max-height: none;
    overflow: visible;
    border: none;
    box-shadow: none;
    background: transparent;
  }

  /* 防止移动端开过菜单后缩放到 PC 端仍停留在 block 状态 */
  .sa-nav-toggle:checked ~ .sa-nav__menu { display: flex; flex-direction: row; }

  .sa-nav__item--cta {
    order: 0;
    margin-left: 10px;
  }

  .sa-nav__link {
    padding: 8px 9px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
  }

  .sa-nav__link[aria-current="page"] {
    font-weight: 600;
    box-shadow: inset 0 -2px 0 #1d4ed8;
    border-radius: 6px 6px 0 0;
  }

  .sa-nav__link:hover { background: #eff6ff; }

  .sa-nav__sub {
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 60;
    min-width: 16rem;
    margin: 0;
    padding: 6px 0;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .12);
    display: none;
  }

  /* 悬停或键盘聚焦时展开 */
  .sa-nav__item:hover > .sa-nav__sub,
  .sa-nav__item:focus-within > .sa-nav__sub { display: block; }

  /* 箭头在 <a> 内部，不能用直接子选择器 */
  .sa-nav__item--has-sub:hover .sa-nav__caret { transform: rotate(180deg); }

  .sa-nav__sub a {
    padding: 8px 16px;
    border-radius: 0;
    font-size: 13px;
  }

  .sa-nav__cta {
    margin: 0;
    padding: 10px 20px;
  }
}
