@media only screen and (max-width: 1299px) {
  .sidetoc {
    display: none;
  }
}

@media only screen and (min-width: 1300px) {
  .sidebar-hidden main {
    position: relative;
  }
  .sidetoc {
    margin-left: auto;
    margin-right: auto;
    left: calc(100% + (var(--content-max-width)) / 3 - 160px);
    position: absolute;
  }
  .pagetoc {
    position: fixed;
    top: 64px;
    width: 220px;
    height: calc(100vh - var(--menu-bar-height) - 0.67em * 4);
    padding-top: 80px;
    margin-right: 16px;
    padding-bottom: 40px;
    overflow: auto;
    /* right: 0; */
  }
  .pagetoc > :last-child {
    margin-bottom: 64px;
  }
  .pagetoc a {
    width: fit-content;
    font-size: 1.4rem;
    border-left: 1px solid transparent;
    color: var(--slate-400) !important;
    display: block;
    padding: 1px var(--sp-1-5);
    margin: 4px 0 4px 12px;
    text-align: left;
    text-decoration: none !important;
    text-decoration-color: hsl(0, 0%, 0%, 0.1);
    border-radius: var(--round-m);
    font-weight: 500;
    letter-spacing: 0.015rem;
  }
  .pagetoc a:hover {
    text-decoration: none !important;
  }
  .pagetoc a.active {
    text-decoration: none !important;
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active) !important;
  }
  .pagetoc a.active:hover {
    text-decoration: none !important;
  }
  .pagetoc .active {
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
  }
  .pagetoc a:not(.active):hover {
    background: rgba(var(--rgb-slate-700), 0.4);
  }
  .pagetoc .pagetoc-H1 {
    display: none;
  }
  .pagetoc .pagetoc-H3 {
    margin-left: 24px;
  }
  .pagetoc .pagetoc-H4 {
    margin-left: 36px;
  }
  .pagetoc .pagetoc-H5 {
    /* display: none; */
    margin-left: 48px;
  }
  .pagetoc .pagetoc-H6 {
    display: none;
  }
  .toc-title {
    margin: 0;
    margin-bottom: 8px;
    padding-left: 12px;
    font-size: 1.4rem;
    color: var(--slate-400) !important;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    letter-spacing: 0.015rem;
    font-style: italic;
  }
}

@media only screen and (min-width: 1299px) and (max-width: 1599px) {
  .sidebar-visible .sidetoc {
    display: none;
  }
}

@media only screen and (min-width: 1600px) {
  .sidebar-hidden main {
    position: relative;
  }

  .sidebar-visible main {
    position: relative;
  }
}
