.nut-popover {
  overflow-y: inherit;
  transform: inherit;

  // 遮罩
  .more-background {
    opacity: 0;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 10;
    left: 0;
    top: 0;
  }

  .popover-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border: 8px solid transparent;
  }
  // top
  &[data-popper-placement^='top'] {
    .popover-arrow {
      bottom: 0;
      border-top-color: $popover-white-background-color;
      border-bottom-width: 0;
      margin-bottom: -8px;
    }
  }

  &[data-popper-placement='top'] {
    .popover-arrow {
      left: 50%;
      transform: translateX(-50%);
    }
  }

  &[data-popper-placement='top-start'] {
    .popover-arrow {
      left: 16px;
      transform: translateX(0%);
    }
  }

  &[data-popper-placement='top-end'] {
    .popover-arrow {
      right: 16px;
      transform: translateX(0%);
    }
  }

  // left
  &[data-popper-placement^='left'] {
    .popover-arrow {
      right: 0px;
      border-left-color: $popover-white-background-color;
      border-right-width: 0;
      margin-right: -8px;
    }
  }

  &[data-popper-placement='left'] {
    .popover-arrow {
      top: 50%;
      transform: translateY(-50%);
    }
  }

  &[data-popper-placement='left-start'] {
    .popover-arrow {
      top: 16px;
      transform: translateY(0%);
    }
  }

  &[data-popper-placement='left-end'] {
    .popover-arrow {
      bottom: 16px;
      transform: translateY(0%);
    }
  }

  // right

  &[data-popper-placement^='right'] {
    .popover-arrow {
      left: 0px;
      border-right-color: $popover-white-background-color;
      border-left-width: 0;
      margin-left: -8px;
    }
  }

  &[data-popper-placement='right'] {
    .popover-arrow {
      top: 50%;
      transform: translateY(-50%);
    }
  }

  &[data-popper-placement='right-start'] {
    .popover-arrow {
      top: 16px;
      transform: translateY(0%);
    }
  }

  &[data-popper-placement='right-end'] {
    .popover-arrow {
      bottom: 16px;
      transform: translateY(0%);
    }
  }
  // bottom
  &[data-popper-placement^='bottom'] {
    .popover-arrow {
      top: 0px;
      border-bottom-color: $popover-white-background-color;
      border-top-width: 0;
      margin-top: -8px;
    }
  }

  &[data-popper-placement='bottom'] {
    .popover-arrow {
      left: 50%;
      transform: translateX(-50%);
    }
  }

  &[data-popper-placement='bottom-start'] {
    .popover-arrow {
      left: 16px;
      transform: translateX(0%);
    }
  }

  &[data-popper-placement='bottom-end'] {
    .popover-arrow {
      right: 16px;
      transform: translateX(0%);
    }
  }

  .popover-menu {
    display: block;
    background: $popover-white-background-color;
    border-radius: 5px;
    font-size: 14px;
    font-family: PingFangSC;
    font-weight: normal;
    color: $popover-primary-text-color;
    box-shadow: 0 2px 12px rgb(50 50 51 / 12%);
    .popover-menu-item {
      display: flex;
      align-items: center;
      padding-bottom: 8px;
      padding: 8px 0;
      margin: 0 8px;
      border-bottom: 1px solid $popover-border-bottom-color;

      &:last-child {
        border-bottom: none;
      }
      .popover-menu-name {
        display: block;
        margin-right: 12px;
        margin-left: 8px;
      }
    }
  }

  .disabled {
    color: $popover-disable-color;
    cursor: not-allowed;
  }
}

.nut-popover--dark {
  color: $popover-white-background-color;

  &[data-popper-placement^='top'] {
    .popover-arrow {
      border-top-color: $popover-dark-background-color;
    }
  }

  &[data-popper-placement^='left'] {
    .popover-arrow {
      border-left-color: $popover-dark-background-color;
    }
  }

  &[data-popper-placement^='right'] {
    .popover-arrow {
      border-right-color: $popover-dark-background-color;
    }
  }

  &[data-popper-placement^='bottom'] {
    .popover-arrow {
      border-bottom-color: $popover-dark-background-color;
    }
  }

  .popover-menu {
    background: $popover-dark-background-color;
    color: $popover-white-background-color;
  }
}

// Taro
.nut-popover-taro {
  position: relative;
  display: inline-block;
  .more-background {
    opacity: 0;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 10;
    left: 0;
    top: 0;
  }

  .popover-content {
    position: absolute;
    z-index: 12;
    min-width: 80px;

    .popover-arrow {
      position: absolute;
      width: 0;
      height: 0;
      border: 8px solid transparent;
    }

    .popover-menu {
      box-shadow: 0 2px 12px rgb(50 50 51 / 12%);
      border-radius: 5px;
      font-size: 14px;
      font-family: PingFangSC;
      font-weight: normal;
      color: $popover-primary-text-color;
      background: $popover-white-background-color;
      .popover-menu-item {
        display: flex;
        align-items: center;
        padding: 8px 0;
        margin: 0 8px;
        border-bottom: 1px solid $popover-border-bottom-color;
        &:last-child {
          border-bottom: none;
        }
        .popover-menu-name {
          margin-right: 12px;
          margin-left: 8px;
          width: 100%;
        }
      }
    }
  }
  // bottom
  .popover-content--bottom {
    left: 50%;
    transform: translateX(-50%);
    .popover-arrow {
      top: 0px;
      border-bottom-color: $popover-white-background-color;
      border-top-width: 0;
      margin-top: -8px;
      left: 50%;
      transform: translateX(-50%);
    }
  }

  .popover-content--bottom-start {
    .popover-arrow {
      top: 0px;
      border-bottom-color: $popover-white-background-color;
      border-top-width: 0;
      margin-top: -8px;
      left: 16px;
      transform: translateX(0%);
    }
  }

  .popover-content--bottom-end {
    right: 0;
    .popover-arrow {
      top: 0px;
      border-bottom-color: $popover-white-background-color;
      border-top-width: 0;
      margin-top: -8px;
      right: 16px;
      transform: translateX(0%);
    }
  }

  // top
  .popover-content--top {
    left: 50%;
    transform: translateX(-50%);
    .popover-arrow {
      bottom: 0;
      border-top-color: $popover-white-background-color;
      border-bottom-width: 0;
      margin-bottom: -8px;

      left: 50%;
      transform: translateX(-50%);
    }
  }

  .popover-content--top-start {
    .popover-arrow {
      bottom: 0;
      border-top-color: $popover-white-background-color;
      border-bottom-width: 0;
      margin-bottom: -8px;

      left: 16px;
      transform: translateX(0%);
    }
  }

  .popover-content--top-end {
    right: 0;
    .popover-arrow {
      bottom: 0;
      border-top-color: $popover-white-background-color;
      border-bottom-width: 0;
      margin-bottom: -8px;

      right: 16px;
      transform: translateX(0%);
    }
  }
  // left
  .popover-content--left {
    top: 50%;
    transform: translateY(-50%);
    .popover-arrow {
      right: 0px;
      border-left-color: $popover-white-background-color;
      border-right-width: 0;
      margin-right: -8px;
      top: 50%;
      transform: translateY(-50%);
    }
  }
  .popover-content--left-start {
    top: 0%;
    .popover-arrow {
      right: 0px;
      border-left-color: $popover-white-background-color;
      border-right-width: 0;
      margin-right: -8px;
      top: 16px;
      transform: translateX(0%);
    }
  }

  .popover-content--left-end {
    bottom: 0%;
    .popover-arrow {
      right: 0px;
      border-left-color: $popover-white-background-color;
      border-right-width: 0;
      margin-right: -8px;
      bottom: 16px;
      transform: translateX(0%);
    }
  }
  // right
  .popover-content--right {
    top: 50%;
    transform: translateY(-50%);
    .popover-arrow {
      left: 0px;
      border-right-color: $popover-white-background-color;
      border-left-width: 0;
      margin-left: -8px;
      top: 50%;
      transform: translateY(-50%);
    }
  }

  .popover-content--right-start {
    top: 0%;
    .popover-arrow {
      left: 0px;
      border-right-color: $popover-white-background-color;
      border-left-width: 0;
      margin-left: -8px;
      top: 16px;
      transform: translateY(0%);
    }
  }

  .popover-content--right-end {
    bottom: 0%;
    .popover-arrow {
      left: 0px;
      border-right-color: $popover-white-background-color;
      border-left-width: 0;
      margin-left: -8px;
      bottom: 16px;
      transform: translateY(0%);
    }
  }

  .disabled {
    color: $popover-disable-color;
    cursor: not-allowed;
  }
}

.nut-popover-taro--dark {
  color: $popover-white-background-color;
  .popover-content--bottom,
  .popover-content--bottom-start,
  .popover-content--bottom-end {
    .popover-arrow {
      border-bottom-color: $popover-dark-background-color;
    }
  }
  .popover-content--top,
  .popover-content--top-start,
  .popover-content--top-end {
    .popover-arrow {
      border-top-color: $popover-dark-background-color;
    }
  }
  .popover-content--left,
  .popover-content--left-start,
  .popover-content--left-end {
    .popover-arrow {
      border-left-color: $popover-dark-background-color;
    }
  }
  .popover-content--right,
  .popover-content--right-start,
  .popover-content--right-end {
    .popover-arrow {
      border-right-color: $popover-dark-background-color;
    }
  }
  .popover-menu {
    background: $popover-dark-background-color !important;
    color: $popover-white-background-color !important;
  }
}
