if (hexo-config('toc.enable')) {
  .post-toc {
    font-size: $font-size-small;

    ol {
      list-style: none;
      margin: 0;
      padding: 0 2px 0 10px;
      text-align: left;

      > :last-child {
        margin-bottom: 5px;
      }

      > ol {
        padding-left: 0;
      }

      a {
        transition: all $transition-ease;
      }
    }

    .nav-item {
      line-height: 1.8;
      overflow: hidden;
      text-overflow: ellipsis;

      if (not hexo-config('toc.wrap')) {
        white-space: nowrap;
      }
    }

    .nav {
      if (not hexo-config('toc.expand_all')) {
        .nav-child {
          --height: 0;
          height: 0;
          opacity: 0;
          overflow: hidden;
          transition-property: height, opacity, visibility;
          transition: $transition-ease;
          visibility: hidden;
        }

        .active > .nav-child {
          height: var(--height, auto);
          opacity: 1;
          visibility: unset;
        }
      }

      .active > a {
        border-bottom-color: $sidebar-highlight;
        color: $sidebar-highlight;
      }

      .active-current > a {
        color: $sidebar-highlight;

        &:hover {
          color: $sidebar-highlight;
        }
      }
    }
  }
}
