html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 980px) {
  .lp-header-inner {
    gap: 8px;
    min-width: 0;
    padding-left: 14px;
    padding-right: 14px;
  }

  .lp-brand {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .lp-brand img {
    flex: none;
  }

  .lp-account {
    max-width: 104px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* 移动菜单内已有完整语言列表，顶部重复按钮在窄屏隐藏。 */
  .lp-header .hc-nav-item:has(> .hc-lang-btn) {
    display: none !important;
  }

  .hc-burger {
    flex: none;
  }
}

@media (max-width: 640px) {
  .lp-hero h1,
  .lp-content-head h2 {
    overflow-wrap: anywhere;
  }

  .site-footer,
  .site-footer * {
    min-width: 0;
  }
}

/* ── 国际版字体自适应（2026-11-17）：外文比中文宽得多，导航不换行、标题自动缩放并均衡断行 ── */
html:not([lang^="zh"]) .lp-header-inner { gap: clamp(12px, 2vw, 28px); }
html:not([lang^="zh"]) .lp-nav { gap: clamp(12px, 1.6vw, 24px); flex-wrap: nowrap; min-width: 0; }
html:not([lang^="zh"]) .lp-nav a,
html:not([lang^="zh"]) .lp-nav .hc-nav-item > a,
html:not([lang^="zh"]) .lp-nav .hc-nav-item > button {
  white-space: nowrap;
  font-size: clamp(13px, 1.15vw, 15.5px);
  letter-spacing: 0;
}
html[lang="vi"] .lp-nav a,
html[lang="vi"] .lp-nav .hc-nav-item > a,
html[lang="vi"] .lp-nav .hc-nav-item > button,
html[lang="id"] .lp-nav a { font-size: clamp(12.5px, 1.05vw, 14.5px); }
html:not([lang^="zh"]) .lp-brand { font-size: clamp(17px, 1.7vw, 22px); letter-spacing: .02em; white-space: nowrap; }
/* 个人 / 登录按钮：不折行，过长省略 */
html:not([lang^="zh"]) .lp-account { white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

/* 页面大标题：按语言放宽可用宽度、均衡断行，避免一词一行 */
html:not([lang^="zh"]) h1,
html:not([lang^="zh"]) h2 { text-wrap: balance; overflow-wrap: break-word; hyphens: manual; }
html[lang="vi"] .lp-hero h1, html[lang="id"] .lp-hero h1 { font-size: clamp(34px, 4.2vw, 58px); line-height: 1.12; }
html[lang="en"] .lp-hero h1 { font-size: clamp(38px, 4.6vw, 64px); line-height: 1.08; }
html:not([lang^="zh"]) .lp-content-head h2,
html:not([lang^="zh"]) .cd-title, html:not([lang^="zh"]) .ch-head h1 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.2; }
/* 卡片标题、课时标题：最多两行，超出省略 */
html:not([lang^="zh"]) .ch-card-body h3 { font-size: 15.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
