/* 全站中英文切换 */

body.lang-en .zh-only { display: none !important; }
body.lang-en .en-only { display: block !important; }
body:not(.lang-en) .en-only { display: none !important; }
body:not(.lang-en) .zh-only { display: inline; }
body:not(.lang-en) .zh-only.block,
body:not(.lang-en) p > .zh-only:only-child,
body:not(.lang-en) h2 > .zh-only:only-child,
body:not(.lang-en) h3 > .zh-only:only-child {
  display: block;
}

/* ── 英文排版：衬线标题 + 无衬线界面 ── */
body.lang-en {
  --font-serif: var(--font-serif-en, 'EB Garamond', Georgia, serif);
  --font-sans: var(--font-sans-en, 'Source Sans 3', system-ui, sans-serif);
  --font-latin: var(--font-serif-en, 'EB Garamond', Georgia, serif);
  font-family: var(--font-serif);
  line-height: 1.65;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1;
}

body.lang-en h1,
body.lang-en h2,
body.lang-en h3,
body.lang-en h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: 0.02em;
}

body.lang-en p,
body.lang-en li,
body.lang-en blockquote,
body.lang-en address {
  line-height: 1.75;
}

body.lang-en .baopu-site-switcher,
body.lang-en .switcher-nav-primary a,
body.lang-en .switcher-subnav a,
body.lang-en .baopu-mobile-nav-link,
body.lang-en .baopu-mobile-nav-title,
body.lang-en .section-label,
body.lang-en .portal-card p,
body.lang-en .portal-card-cta,
body.lang-en .portal-card-note,
body.lang-en .course-card p,
body.lang-en .program-card p,
body.lang-en .feed-meta,
body.lang-en .portal-footer,
body.lang-en .portal-address,
body.lang-en .portal-address-link,
body.lang-en .cal-toolbar,
body.lang-en .cal-legend,
body.lang-en .cal-table th,
body.lang-en .cal-chip,
body.lang-en .cal-event-item,
body.lang-en .cal-event-title,
body.lang-en .cal-event-loc,
body.lang-en .cal-month-label,
body.lang-en .cal-weekly,
body.lang-en .baopu-lang-toggle .lang-btn,
body.lang-en input,
body.lang-en textarea,
body.lang-en select,
body.lang-en button,
body.lang-en .search-input,
body.lang-en .nav-link,
body.lang-en .main-nav a,
body.lang-en .mobile-nav-link,
body.lang-en .toggle-btn,
body.lang-en .pc-tip-banner {
  font-family: var(--font-sans);
  letter-spacing: 0.025em;
}

body.lang-en .portal-hero-tagline,
body.lang-en .portal-hero-slogan {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0.1em;
}

body.lang-en .portal-hero-slogan {
  font-weight: 300;
  letter-spacing: 0.06em;
}

body.lang-en .portal-card h2,
body.lang-en .section-header h2,
body.lang-en .portal-about-text h2,
body.lang-en .portal-feed-col h3,
body.lang-en .course-card h3,
body.lang-en .program-card h3,
body.lang-en .portal-address h3,
body.lang-en .logo-text h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: 0.03em;
}

body.lang-en .portal-chant blockquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

body.lang-en .portal-chant cite {
  font-family: var(--font-sans);
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

body.lang-en .hero-name-en,
body.lang-en .en-only.hero-label {
  font-family: var(--font-latin);
  font-weight: 400;
}

body.lang-en .hero-label,
body.lang-en .hero-subtitle,
body.lang-en .stat-label,
body.lang-en .section-subtitle,
body.lang-en .archive-filter-btn,
body.lang-en .book-meta,
body.lang-en .footer-col h4 {
  font-family: var(--font-sans);
  letter-spacing: 0.03em;
}

body.lang-en .stat-num,
body.lang-en .section-title {
  font-family: var(--font-serif);
  font-weight: 500;
}

.baopu-lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 4px;
  border: 1px solid rgba(160, 115, 42, 0.32);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 0 rgba(247, 242, 233, 0.04);
}

.baopu-lang-toggle .lang-btn {
  border: none;
  background: transparent;
  color: rgba(247, 242, 233, 0.65);
  font-family: var(--font-sans, 'Noto Sans SC', sans-serif);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  line-height: 1.4;
}

.baopu-lang-toggle .lang-btn:hover {
  color: #F7F2E9;
  background: rgba(160, 115, 42, 0.15);
}

.baopu-lang-toggle .lang-btn.is-active {
  color: #A0732A;
  background: rgba(160, 115, 42, 0.18);
  font-weight: 600;
}

.baopu-site-switcher-inner {
  flex-wrap: wrap;
}

.switcher-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

/* 教授页：统一顶栏已含语言切换，隐藏页内重复按钮 */
body:has(.baopu-site-switcher) .site-header .lang-toggle {
  display: none !important;
}

@media (max-width: 768px) {
  .baopu-site-switcher-inner {
    height: auto;
    min-height: 40px;
    padding: 6px 12px;
    row-gap: 6px;
  }

  .switcher-brand-img {
    height: 24px;
  }

  .switcher-right {
    width: 100%;
    justify-content: space-between;
  }

  .switcher-nav-wrap {
    flex: 1;
    min-width: 0;
  }

  .baopu-lang-toggle .lang-btn {
    padding: 4px 8px;
    font-size: 0.65rem;
  }
}
