/* 只调整产品页的标题功能栏和独立导航，沿用原有色彩与字号。 */
:root {
  --product-title-height: 68px;
  --product-nav-height: 54px;
}

/* clip 不创建横向滚动容器，让导航可以在页面内正常吸顶。 */
body { overflow-x: clip; }
#productTopbar .nav-in { justify-content: space-between; }
#productTopbar [hidden] { display: none !important; }

.chapter-nav {
  position: sticky;
  top: var(--product-title-height);
  z-index: 79;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}
.chapter-nav-links {
  display: flex;
  align-items: center;
  justify-content: safe center;
  gap: 26px;
  min-height: 52px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chapter-nav-links::-webkit-scrollbar { display: none; }
.chapter-nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 0 0 auto;
  min-height: 44px;
  color: var(--paper);
  font-size: 12px;
  white-space: nowrap;
}
.chapter-nav-links a:hover,
.chapter-nav-links a:focus-visible { color: var(--blood); }
.chapter-nav-links a:focus-visible { outline: 1px solid var(--blood); outline-offset: -1px; }
section[id] { scroll-margin-top: calc(var(--product-title-height) + var(--product-nav-height)); }

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 82;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--blood);
  border-radius: 50%;
  color: var(--blood);
  background: var(--ink);
  font: 24px var(--sans);
  cursor: pointer;
}
.back-to-top[hidden] { display: none !important; }
.back-to-top:hover { background: var(--navy, #071426); }
.back-to-top:focus-visible { outline: 2px solid var(--blood); outline-offset: 4px; }

@media (max-width: 600px) {
  :root { --product-title-height: 58px; }
  .chapter-nav-links { gap: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* 手机开发与系统标题长词折行，避免网格或文本撑宽页面。 */
@media (max-width: 600px) {
  #updates .updates-top > .reveal:first-child { min-width: 0; }
  #updates .updates-top > .reveal:first-child > h2.h2[data-product-copy="development"] { overflow-wrap: anywhere; }
  section.systems > .wrap > .reveal > h2.h2[data-i18n="t040"] { overflow-wrap: anywhere; }
}
