/**
 * @date: 2024/1/16
 * @author: 小红
 * @fileName: variable
 * @Description: 公用
 */
@use "util";


hr {
  position: relative;
  margin: 30px auto;
  border: 1px dashed var(--theme);
  width: calc(100% - 5px);
  height: 0;
  overflow: visible;

  &::before {
    font-family: "Font Awesome 6 Pro", serif;
    font-weight: 900;
    -webkit-font-smoothing: antialiased;
    display: var(--fa-display, inline-block);
    font-style: normal;
    font-variant: normal;
    line-height: 1;
    text-rendering: auto;
    position: absolute;
    top: -10px;
    left: 5%;
    z-index: 1;
    color: var(--theme);
    content: "\f2dc";
    font-size: 18px;
    transition: 1s ease-in-out;
  }
}

a:hover {
  color: var(--link-hover-color);
}

// 为空
.empty {
  @include util.flex-center;
  flex-direction: column;
  padding: 20px 5px;
  color: #888;
  text-align: center;

  &-svg {
    width: 90px;
    height: 90px;
    margin-bottom: 20px;
    fill: currentColor
  }
}

//侧边
.side {
  //移动端侧边栏菜单
  &-bar {
    @include util.useThemeVar((
      cd-background-color:(#f6f8fa, #121212),
      cd-border-color:(#e3e8f7, #3d3d3f),
      cd-data-background-color:(#fff, #1b1c20),
      cd-data-num-text-color:(#1f2d3d, rgba(255, 255, 255, 0.9)),
    ));

    & {
      position: fixed;
      top: 0;
      right: -300px;
      z-index: 110;
      overflow-x: hidden;
      overflow-y: auto;
      width: 300px;
      height: 100%;
      transition: transform .5s;
      background-color: var(--cd-background-color);
      border-left: 1px solid var(--cd-border-color);
      border-radius: 12px 0 0 12px;
    }

    $cd-border-radius: 8px;

    &.active {
      transform: translate3d(-100%, 0, 0);
    }

    > .avatar {
      display: block;
      height: 100px;
      width: 100px;
      border-radius: 50%;
      border: 5px solid #ffffff;
      filter: none;
      transition: transform .3s;
      object-fit: cover;
      margin: 20px auto;
    }

    > .site-data {
      display: table;
      table-layout: fixed;
      padding: 5px;
      background-color: var(--cd-data-background-color);
      border: 1px solid var(--cd-border-color);
      border-radius: $cd-border-radius;
      margin: 0 auto;
      width: 90%;
      text-align: center;

      > .item {
        display: table-cell;

        > .num {
          display: block;
          margin-top: -0.32em;
          font-size: 1.4em;
          color: var(--cd-data-num-text-color);
          @include util.text-overflow;
        }
      }
    }

    > hr {
    }

    .bar {
      padding: 0 20px;

      &-item {
        margin: 10px 0;

        &.active {
          .bar-children {
            display: flex;
          }

          .fa-chevron-left {
            transform: rotate(-90deg);
          }
        }

        > .link {
          border-radius: $cd-border-radius;
          background-color: var(--cd-data-background-color);
          border: 1px solid var(--cd-border-color);
          padding: 8px 28px;
          font-size: 1.2em;
          display: flex;
          justify-content: flex-start;
          align-items: baseline;
          @include util.text-overflow;

          > .name {
            flex: 1;
            padding: 0 8px;
          }

          > i {
            transition: .3s ease-in-out;
          }
        }
      }

      &-children {
        padding: 8px 6px 0;
        display: none;
        flex-wrap: wrap;
        flex-direction: row;

        &--item {
          width: calc(50% - 8px);
          margin: 4px;
        }

        &--link {
          display: block;
          border-radius: $cd-border-radius;
          background-color: var(--cd-data-background-color);
          border: 1px solid var(--cd-border-color);
          text-align: center;
          font-size: 1.1em;
          padding: 3px;
          @include util.text-overflow;
        }
      }
    }
  }

  //侧边小部件 按钮
  &-btn {
    right: -48px;
    bottom: 40px;
    opacity: 0;
    transition: opacity .5s, transform .5s;
    position: fixed;
    z-index: 80;

    &.active {
      opacity: 1;
      transform: translateX(-58px)
    }

    & > .button {
      margin: .5rem 0;
      width: 35px;
      height: 35px;
      font-size: .9rem;
      transition: .3s ease 0s;
    }
  }
}