/* Article navigation mirrors the TensorWorld website's SiteNav. */
:root { --report-header-height:65px; scroll-padding-top:calc(var(--report-header-height) + 12px); }
.tw-nav { position:sticky; top:0; z-index:50; background:white; color:#1c1721; font:400 16px/1.5 var(--body); }
.tw-nav::after { content:""; position:absolute; inset:auto 0 0; height:1px; pointer-events:none; background:url("https://tensorworld-blog.cdn.bcebos.com/blog/_files/static/111e4aedc5d67601fe35b4ed082c8e337afdf0eb/assets/site-nav/divider.svg") repeat-x left center / auto 1px; }
.tw-nav a { color:inherit; text-decoration:none; }
.tw-nav button { font:inherit; color:inherit; cursor:pointer; background:none; border:0; padding:0; }
.tw-nav a:is(:hover,:focus-visible) { color:#bb3deb; }
.tw-nav-bar { display:flex; align-items:center; justify-content:space-between; height:var(--report-header-height); padding-inline:33px; max-width:1440px; margin-inline:auto; }
.tw-nav-logo { display:block; width:154px; height:33px; object-fit:contain; object-position:left; }
.tw-nav-desktop { display:none; align-items:center; gap:32px; }
.tw-nav-mobile { display:flex; align-items:center; gap:12px; }
.tw-nav nav > a { font-weight:500; white-space:nowrap; }
.tw-nav-desktop .tw-nav-join { display:inline-flex; align-items:center; justify-content:center; width:93px; height:30px; border:1px solid #d9d9d9; border-radius:52px; }
.tw-nav-desktop .tw-nav-join:is(:hover,:focus-visible) { color:#faf8fc; background:#650fad; border-color:#650fad; }
.tw-nav-languages { display:flex; align-items:center; gap:6px; white-space:nowrap; font-size:14px; font-weight:500; color:#605b65; }
.tw-nav-languages a { display:inline-flex; align-items:center; min-height:32px; }
.tw-nav-languages [aria-current] { color:#592384; text-decoration:underline; text-underline-offset:3px; }
.tw-nav-languages span { color:#8a858e; }
.tw-nav .tw-nav-toggle { display:flex; position:relative; width:29px; height:29px; align-items:center; justify-content:center; flex-direction:column; gap:4.4px; border:1px solid #e6e6e6; border-radius:5px; background:#fefffe; }
.tw-nav-toggle i { display:block; width:15px; height:1.765px; background:#1c1721; border-radius:13px; }
.tw-nav-close i { position:absolute; transform:rotate(45deg); }
.tw-nav-close i:last-child { transform:rotate(-45deg); }
.tw-nav dialog { position:fixed; inset:0 0 auto; width:100%; max-width:none; height:397px; max-height:100dvh; margin:0; padding:0; border:0; border-radius:0 0 25px 25px; background:#fefffe; color:inherit; }
.tw-nav dialog[open] { display:flex; flex-direction:column; }
.tw-nav dialog::backdrop { background:#666c; }
:root:has(#tw-nav-menu[open]) { overflow:hidden; }
.tw-nav dialog .tw-nav-bar { width:100%; flex-shrink:0; }
.tw-nav-menu-links { display:flex; flex-direction:column; flex:1; min-height:0; overflow:auto; padding-inline:42px; }
.tw-nav-menu-links > a { padding-block:18px; border-bottom:1px solid #e6e6e6; font-size:26px; line-height:1; }
.tw-nav-menu-links > a:first-child { padding-top:12px; }
.tw-nav-menu-links .tw-nav-languages { margin-block:auto 28px; font-size:22px; }
/* The website maps Chinese weight 500 to its static SemiBold face.
   Use the same semibold weight in the article's variable Source Han Serif. */
:lang(zh) .tw-nav-languages { font-weight:600; }
@media (max-width:479px) {
  .tw-nav-bar { padding-inline:16px; }
  .tw-nav-logo { width:clamp(104px, 30vw, 144px); }
  .tw-nav-mobile { gap:8px; }
}

@media (max-width:359px) {
  .tw-nav-logo { width:90px; }
  .tw-nav-mobile .tw-nav-blog { font-size:14px; }
  .tw-nav-mobile .tw-nav-languages { gap:4px; font-size:12px; }
}

@media (min-width:768px) {
  :root { --report-header-height:64px; }
  .tw-nav-desktop { display:flex; }
  .tw-nav-mobile { display:none; }
  .tw-nav-logo { height:auto; }
}
@media (min-width:1280px) {
  .article-layout > .toc { top:var(--report-header-height); max-height:calc(100vh - var(--report-header-height)); }
}
@media (min-width:1440px) {
  :root { --report-header-height:75px; }
  .tw-nav-bar { padding-inline:80px; }
}
@media print { .tw-nav { display:none; } }
