/*
 * @Author: 焦质晔
 * @Date: 2021-02-09 09:27:46
 * @Last Modified by: 焦质晔
 * @Last Modified time: 2024-11-05 18:56:46
 */
@use '../../style/src/themes' as *;
@use '../../style/src/mixins/reset' as *;

$prefix: '#{$qm-prefix}-anchor';

.#{$prefix} {
  @include reset-component();
  display: flex;
  .anchor-nav {
    display: flex;
    flex: none;
    .item {
      display: flex;
      align-items: center;
      height: $height-base;
      position: relative;
      cursor: pointer;
      &.actived {
        color: $primary-color;
        &::after {
          content: '';
          position: absolute;
          background-color: $primary-color;
        }
      }
      span {
        @include text-overflow-cut();
        display: block;
      }
    }
  }
  &-left {
    flex-direction: row;
    .anchor-nav {
      flex-direction: column;
      margin-right: $height-base;
      border-right: 1px solid $border-color-base;
      .item {
        justify-content: flex-end;
        padding: 0 $padding-base;
        &.actived {
          &::after {
            width: 2px;
            right: -2px;
            top: 0;
            bottom: 0;
          }
        }
      }
    }
  }
  &-top {
    flex-direction: column;
    .anchor-nav {
      flex-direction: row;
      margin-bottom: $margin-base;
      border-bottom: 1px solid $border-color-base;
      .item {
        justify-content: center;
        padding: 0 $padding-base + 2px;
        &.actived {
          &::after {
            height: 2px;
            bottom: -2px;
            left: $padding-base;
            right: $padding-base;
          }
        }
      }
    }
  }
  .anchor-container {
    flex: auto;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }
  // ------ size ------
  // 40  36  32  28
  &--large {
    .anchor-nav {
      .item {
        height: $height-lg;
      }
    }
  }
  &--small {
    .anchor-nav {
      .item {
        height: $height-sm + 2px;
        font-size: 13px;
      }
    }
  }
}
