@import (reference) '../../styles/variables.less';

.@{prefix}-toc {
  list-style: none;
  margin: 12px 0 0;
  padding: 4px 0;
  border-inline-start: 1px solid @c-border;

  @{dark-selector} & {
    border-inline-start-color: @c-border-dark;
  }

  &::selection,
  & ::selection {
    background: @c-primary-light;
  }

  &:empty {
    display: none;
  }

  > li {
    > a {
      display: block;
      margin: 6px 0;
      padding: 3px 12px;
      color: @c-text-secondary;
      font-size: 13px;
      font-family: PingFangSC-Regular;
      line-height: 1;
      text-decoration: none;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;

      @{dark-selector} & {
        color: @c-text-secondary-dark;
      }

      &:hover {
        color: @c-text;
        @{dark-selector} & {
          color: @c-text-dark;
        }
      }

      &.active {
        margin-inline-start: -1px;
        color: @c-primary;
        border-inline-start: 1px solid @c-primary;
      }
    }

    &[data-depth='3'] > a {
      padding-inline-start: 20px;
    }
  }
}
