/* ============================================================
   抱朴统一站点 — 单条顶栏
   ============================================================ */

.baopu-site-switcher {
  position: sticky;
  top: 0;
  z-index: 200;
  background:
    linear-gradient(180deg, rgba(160, 115, 42, 0.07) 0%, transparent 42%),
    linear-gradient(90deg, #0a1419 0%, #101f28 50%, #0a1419 100%);
  border-bottom: 1px solid rgba(160, 115, 42, 0.22);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
  font-family: var(--font-sans, 'Noto Sans SC', sans-serif);
}

.baopu-site-switcher::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(160, 115, 42, 0.45) 20%,
    rgba(247, 242, 233, 0.18) 50%,
    rgba(160, 115, 42, 0.45) 80%,
    transparent 100%
  );
  pointer-events: none;
}

.baopu-site-switcher-inner {
  max-width: var(--max-width, 1280px);
  margin: 0 auto;
  padding: 10px 24px 11px;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.switcher-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 0;
  padding-right: 20px;
  margin-right: 4px;
  border-right: 1px solid rgba(160, 115, 42, 0.22);
}

.switcher-brand-img {
  height: 34px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.35));
  transition: opacity 0.25s, transform 0.25s;
}

.switcher-brand:hover .switcher-brand-img {
  opacity: 0.92;
  transform: translateY(-1px);
}

.switcher-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  min-width: 0;
  flex: 1;
  justify-content: flex-end;
}

.switcher-nav-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  justify-content: center;
}

.switcher-nav-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 100%;
  max-width: 680px;
}

.switcher-nav-primary {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(160, 115, 42, 0.28);
  box-shadow: inset 0 1px 0 rgba(247, 242, 233, 0.05);
}

.switcher-nav-primary a {
  position: relative;
  color: rgba(247, 242, 233, 0.72);
  font-family: var(--font-serif, 'Noto Serif SC', serif);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  padding: 7px 22px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.22s, background 0.22s, box-shadow 0.22s;
}

.switcher-nav-primary a:hover {
  color: #F7F2E9;
  background: rgba(160, 115, 42, 0.12);
}

.switcher-nav-primary a.is-active {
  color: #1a1208;
  background: linear-gradient(180deg, #E8C97A 0%, #C99A3C 100%);
  box-shadow: 0 2px 8px rgba(160, 115, 42, 0.35);
}

.switcher-subnav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 4px;
}

.switcher-subnav a {
  position: relative;
  color: rgba(247, 242, 233, 0.62);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.22s, background 0.22s;
}

.switcher-subnav a + a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 24%;
  bottom: 24%;
  width: 1px;
  background: rgba(160, 115, 42, 0.22);
  pointer-events: none;
}

.switcher-subnav a:hover {
  color: #F7F2E9;
  background: rgba(160, 115, 42, 0.14);
}

/* 学刊 / 教授页：搜索框并入顶栏 */
.switcher-search {
  flex-shrink: 1;
  min-width: 0;
  max-width: 220px;
}

.switcher-search .search-input,
.switcher-search .search-input:focus {
  width: 100%;
  max-width: 220px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(160, 115, 42, 0.35);
  color: #F7F2E9;
}

.switcher-search .search-input::placeholder {
  color: rgba(247, 242, 233, 0.45);
}

.switcher-search .search-icon {
  color: rgba(247, 242, 233, 0.5);
}

/* 移动端汉堡 */
.switcher-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(160, 115, 42, 0.35);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.25s, background 0.25s;
}

.switcher-mobile-toggle:hover {
  border-color: rgba(160, 115, 42, 0.55);
  background: rgba(160, 115, 42, 0.1);
}

.switcher-mobile-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: rgba(247, 242, 233, 0.75);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.switcher-mobile-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.switcher-mobile-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.switcher-mobile-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 移动端抽屉 */
.baopu-mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(10, 20, 25, 0.55);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.baopu-mobile-nav-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.baopu-mobile-nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 601;
  width: min(320px, 88vw);
  height: 100%;
  background: linear-gradient(180deg, #101f28 0%, #0f1c24 100%);
  border-left: 1px solid rgba(160, 115, 42, 0.32);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  overflow-y: auto;
}

.baopu-mobile-nav-panel.is-open {
  transform: translateX(0);
}

.baopu-mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(160, 115, 42, 0.2);
}

.baopu-mobile-nav-title {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: #A0732A;
}

.baopu-mobile-nav-close {
  border: none;
  background: none;
  color: rgba(247, 242, 233, 0.7);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
}

.baopu-mobile-nav-inner {
  padding: 10px 12px 16px;
}

.baopu-mobile-nav-group {
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid rgba(160, 115, 42, 0.16);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.baopu-mobile-nav-group-title {
  padding: 8px 14px;
  font-family: var(--font-serif, 'Noto Serif SC', serif);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: #E8C97A;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.18);
  border-bottom: 1px solid rgba(160, 115, 42, 0.14);
}

.baopu-mobile-nav-link {
  display: block;
  padding: 11px 16px 11px 24px;
  color: rgba(247, 242, 233, 0.78);
  text-decoration: none;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(160, 115, 42, 0.06);
  transition: background 0.2s, color 0.2s;
}

.baopu-mobile-nav-link:last-child {
  border-bottom: none;
}

.baopu-mobile-nav-link--main {
  padding-left: 16px;
  font-family: var(--font-serif, 'Noto Serif SC', serif);
  font-weight: 600;
  color: rgba(247, 242, 233, 0.94);
  background: rgba(160, 115, 42, 0.06);
}

.baopu-mobile-nav-link--sub {
  font-size: 0.84rem;
  color: rgba(247, 242, 233, 0.68);
}

.baopu-mobile-nav-link.is-active {
  color: #E8C97A;
  background: rgba(160, 115, 42, 0.1);
}

.baopu-mobile-nav-link:hover {
  background: rgba(160, 115, 42, 0.12);
  color: #F7F2E9;
}

body.baopu-mobile-nav-open {
  overflow: hidden;
}

/* 隐藏子站原顶栏（已整合） */
body.baopu-journal-page .site-header[hidden],
body.baopu-professor-page .site-header[hidden] {
  display: none !important;
}

/* 整合后隐藏学刊站「推荐电脑端」横幅 */
.pc-tip-banner {
  display: none !important;
}

/* 门户页：切换器不 sticky（门户自有 Hero） */
body.baopu-portal .baopu-site-switcher {
  position: relative;
}

@media (max-width: 1100px) {
  .switcher-nav-primary a {
    padding: 6px 16px;
    font-size: 0.78rem;
  }

  .switcher-subnav a {
    font-size: 0.68rem;
    padding: 4px 10px;
  }

  .switcher-brand {
    padding-right: 14px;
  }
}

@media (max-width: 768px) {
  .baopu-site-switcher-inner {
    padding: 8px 12px;
    flex-wrap: wrap;
    min-height: 52px;
  }

  .switcher-brand {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
  }

  .switcher-brand-img {
    height: 28px;
  }

  .switcher-nav-wrap {
    display: none;
  }

  .switcher-mobile-toggle {
    display: flex;
  }

  .switcher-search {
    flex: 1;
    max-width: none;
  }

  .switcher-search .search-input,
  .switcher-search .search-input:focus {
    max-width: none;
  }
}

/* ── 统一顶栏：特色课程下拉菜单 ── */
.switcher-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-bottom: 6px;
  margin-bottom: -6px;
}

.switcher-dropdown-toggle {
  position: relative;
  color: rgba(247, 242, 233, 0.72);
  font-family: var(--font-serif, 'Noto Serif SC', serif);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  padding: 7px 18px;
  border-radius: 999px;
  white-space: nowrap;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.22s, background 0.22s;
}

.switcher-dropdown-toggle:hover {
  color: #F7F2E9;
  background: rgba(160, 115, 42, 0.12);
}

.switcher-dropdown-toggle.is-active {
  color: #1a1208;
  background: linear-gradient(180deg, #E8C97A 0%, #C99A3C 100%);
  box-shadow: 0 2px 8px rgba(160, 115, 42, 0.35);
}

.switcher-dropdown-caret {
  font-size: 0.62rem;
  transition: transform 0.25s ease;
  opacity: 0.75;
  display: inline-block;
}

.switcher-dropdown-wrap:hover .switcher-dropdown-caret,
.switcher-dropdown-wrap.is-open .switcher-dropdown-caret {
  transform: rotate(180deg);
}

.switcher-dropdown-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  margin-top: 2px;
  min-width: 175px;
  background: linear-gradient(180deg, #101e26 0%, #0c171e 100%);
  border: 1px solid rgba(197, 155, 76, 0.38);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  padding: 6px;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease;
}

/* 向上小箭头装饰 */
.switcher-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #101e26;
  border-left: 1px solid rgba(197, 155, 76, 0.38);
  border-top: 1px solid rgba(197, 155, 76, 0.38);
}

/* 鼠标防滑落隐形安全桥梁（Hover Tunnel）：无缝覆盖按钮与下拉菜单间的所有空隙与外围 */
.switcher-dropdown-menu::after {
  content: '';
  position: absolute;
  top: -14px;
  left: -12px;
  right: -12px;
  height: 16px;
  background: transparent;
  pointer-events: auto;
}

.switcher-dropdown-wrap:hover .switcher-dropdown-menu,
.switcher-dropdown-wrap:focus-within .switcher-dropdown-menu,
.switcher-dropdown-wrap.is-open .switcher-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.switcher-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 15px;
  color: rgba(247, 242, 233, 0.85);
  font-family: var(--font-serif, 'Noto Serif SC', serif);
  font-size: 0.84rem;
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.18s ease;
  cursor: pointer;
}

.switcher-dropdown-item:hover:not(.is-disabled) {
  color: #fff;
  background: rgba(160, 115, 42, 0.25);
}

.switcher-dropdown-item.is-active {
  color: #c59b4c;
  background: rgba(160, 115, 42, 0.14);
  font-weight: 600;
}

.switcher-dropdown-item.is-disabled {
  color: rgba(247, 242, 233, 0.35);
  cursor: default;
  pointer-events: none;
}

.switcher-dropdown-tag {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(247, 242, 233, 0.45);
  font-family: var(--font-sans);
}
