.liuyt-toc {
  display: none;
}

body.single-post .wp-block-post-content > :where(h2, h3, h4) {
  scroll-margin-top: 7rem;
}

@media (min-width: 1440px) {
  .liuyt-toc {
    --liuyt-toc-left: max(1rem, calc((100vw - 960px) / 2 - 15.5rem));
    --liuyt-toc-right: max(1rem, calc((100vw - 960px) / 2 - 15.5rem));
    position: fixed;
    top: var(--liuyt-toc-top, 24rem);
    left: var(--liuyt-toc-left);
    z-index: 9;
    display: block;
    width: 13rem;
    max-height: calc(100vh - var(--liuyt-toc-top, 24rem) - 1.5rem);
    overflow: auto;
    padding: 0.2rem 0 0.5rem;
    color: rgba(35, 35, 35, 0.56);
    font-family: var(--xiaoxiao-font-sans-zh, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    scrollbar-width: none;
    scrollbar-color: transparent transparent;
    transition: left 180ms ease, right 180ms ease;
  }

  .liuyt-toc.is-right {
    right: var(--liuyt-toc-right);
    left: auto;
  }

  .liuyt-toc::-webkit-scrollbar {
    width: 0;
  }

  .liuyt-toc::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 999px;
  }

  .liuyt-toc__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0 0 1rem;
  }

  .liuyt-toc__title {
    color: rgba(35, 35, 35, 0.88);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
  }

  .liuyt-toc__side-toggle {
    display: inline-grid;
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    place-items: center;
    color: rgba(35, 35, 35, 0.5);
    font: inherit;
    font-size: 0.95rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 160ms ease, color 160ms ease;
    cursor: pointer;
    user-select: none;
  }

  .liuyt-toc__header:hover .liuyt-toc__side-toggle,
  .liuyt-toc__side-toggle:focus-visible {
    opacity: 1;
  }

  .liuyt-toc__side-toggle:hover,
  .liuyt-toc__side-toggle:focus-visible {
    color: #222222;
    outline: none;
  }

  .liuyt-toc__list {
    position: relative;
    display: grid;
    gap: 0.8rem;
    margin: 0;
    padding: 0 0 0 1rem;
    list-style: none;
  }

  .liuyt-toc__list::before {
    position: absolute;
    top: 0.1rem;
    bottom: 0.15rem;
    left: 0;
    width: 1px;
    background: rgba(35, 35, 35, 0.14);
    content: "";
  }

  .liuyt-toc__item {
    margin: 0;
    padding: 0;
  }

  .liuyt-toc__link {
    position: relative;
    display: grid;
    grid-template-columns: 2.45rem minmax(0, 1fr);
    column-gap: 0.65rem;
    align-items: baseline;
    color: inherit;
    text-decoration: none;
  }

  .liuyt-toc__link::before {
    position: absolute;
    top: 0.58rem;
    left: -1.05rem;
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background: #d8d8d8;
    content: "";
    transition: background-color 160ms ease, transform 160ms ease;
  }

  .liuyt-toc__number {
    color: rgba(35, 35, 35, 0.24);
    font-size: 1.55rem;
    font-weight: 750;
    line-height: 0.95;
    letter-spacing: 0;
    transition: color 160ms ease;
  }

  .liuyt-toc__text {
    display: block;
    min-width: 0;
    color: rgba(35, 35, 35, 0.62);
    font-size: 0.76rem;
    font-weight: 560;
    line-height: 1.45;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    transition: color 160ms ease, font-weight 160ms ease;
  }

  .liuyt-toc__item--h3,
  .liuyt-toc__item--h4 {
    margin-top: -0.35rem;
  }

  .liuyt-toc__item--h3 .liuyt-toc__link,
  .liuyt-toc__item--h4 .liuyt-toc__link {
    grid-template-columns: 0.9rem minmax(0, 1fr);
    column-gap: 0.45rem;
    padding-left: 2.15rem;
  }

  .liuyt-toc__item--h3 .liuyt-toc__link::before,
  .liuyt-toc__item--h4 .liuyt-toc__link::before {
    top: 0.56rem;
    width: 0.32rem;
    height: 0.32rem;
    background: rgba(35, 35, 35, 0.18);
  }

  .liuyt-toc__branch {
    width: 0.55rem;
    height: 1px;
    background: rgba(35, 35, 35, 0.22);
  }

  .liuyt-toc__item--h3 .liuyt-toc__text,
  .liuyt-toc__item--h4 .liuyt-toc__text {
    color: rgba(35, 35, 35, 0.48);
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.42;
  }

  .liuyt-toc__item--h4 .liuyt-toc__link {
    padding-left: 2.75rem;
  }

  .liuyt-toc__item--h4 .liuyt-toc__text {
    font-size: 0.68rem;
  }

  .liuyt-toc__link:hover .liuyt-toc__text,
  .liuyt-toc__link:hover .liuyt-toc__number,
  .liuyt-toc__link.is-active .liuyt-toc__text,
  .liuyt-toc__link.is-active .liuyt-toc__number {
    color: #222222;
  }

  .liuyt-toc__link:hover::before,
  .liuyt-toc__link.is-active::before {
    background: #222222;
    transform: scale(1.18);
  }

  .liuyt-toc__link.is-active .liuyt-toc__text {
    font-weight: 720;
  }
}

@media (min-width: 1440px) and (max-height: 760px) {
  .liuyt-toc {
    top: var(--liuyt-toc-top, 14rem);
    max-height: calc(100vh - var(--liuyt-toc-top, 14rem) - 1.25rem);
  }
}
