$orangeColor: #f78b22;
$greenColor: #30b039;
$darkBlueColor: #15388b;
$lineColor: #b2b2b2;
$backgroundColor: #f5f6f9;

.wk-approve-flow-wrap {
  width: 100%;
  background-color: $backgroundColor;
  overflow: auto;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;

  .el-button-group {
    position: fixed;
    right: 40px;
    top: 90px;
    z-index: 2;
  }
}

.wk-approve-flow {
  display: inline-block;
  position: relative;
  width: 100%;
  padding: 50px 0;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  min-width: min-content;
  transform-origin: 50% 0px 0px;

  // 新建按钮外层
  .add-node-btn-wrap {
    width: 240px;
    display: inline-flex;
    flex-shrink: 0;
    position: relative;

    &::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: -1;
      margin: auto;
      width: 1px;
      height: 100%;
      background-color: $lineColor;
    }
  }

  // 新建按钮
  .add-node-btn {
    user-select: none;
    width: 240px;
    padding: 20px 0px 32px;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
    -webkit-box-flex: 1;
    flex-grow: 1;
    z-index: 1;

    .el-button {
      padding: 6px;
      box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
      transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
      &:hover {
        transform: scale(1.3);
        box-shadow: 0 13px 27px 0 rgba(0, 0, 0, 0.1);
      }
    }
  }

  // 节点
  .wk-node {
    display: inline-flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    padding: 0 50px;
    position: relative;

    &-wrap {
      display: inline-flex;
      flex-direction: column;
      position: relative;
      width: 220px;
      min-height: 72px;
      flex-shrink: 0;
      background: #FFFFFF;
      border-radius: 4px;
      cursor: pointer;

      &:not(.is-first)::before {
        content: '';
        position: absolute;
        top: -8px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 4px;
        border-style: solid;
        border-width: 8px 6px 4px;
        border-color: $lineColor transparent transparent;
      }

      &::after {
        pointer-events: none;
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 2;
        border-radius: 4px;
        border: 1px solid transparent;
        transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);
        box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1);
      }

      .header {
        position: relative;
        display: flex;
        align-items: center;
        padding-left: 16px;
        padding-right: 30px;
        width: 100%;
        height: 24px;
        line-height: 24px;
        font-size: 12px;
        color: #FFFFFF;
        text-align: left;
        border-radius: 4px 4px 0px 0px;
        .title {
          line-height: 15px;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
        }

        .el-input--mini .el-input__inner {
          height: 20px;
          line-height: 20px;
        }

        .close {
          visibility: hidden;
          position: absolute;
          right: 10px;
          top: 50%;
          transform: translateY(-50%);
          width: 20px;
          height: 20px;
          font-size: 14px;
          color: #fff;
          line-height: 20px;
        }
      }

      .body {
        position: relative;
        font-size: 14px;
        padding: 16px;
        padding-right: 30px;
        .content {
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 3;
          -webkit-box-orient: vertical;
        }

        .el-icon-arrow-right {
          position: absolute;
          right: 10px;
          top: 50%;
          transform: translateY(-50%);
          width: 20px;
          height: 14px;
          font-size: 14px;
          color: #333;
        }
      }

      &:not(.is-disabled):hover {
        .close {
          visibility: visible;
        }

        &::after {
          border: 1px solid $xr-color-primary;
          box-shadow: 0 0 6px 0 rgba(50, 150, 250, 0.3);
        }
      }

      &:not(.is-disabled).is-error {
        &::after {
          border: 1px solid #f56c6c;
        }
      }

      &.is-disabled {
        cursor: unset;
      }
    }
  }

  // 条件节点
  .wk-conditon-node {
    display: inline-flex;
    width: 100%;
    &-wrap {
      display: flex;
      box-orient: vertical;
      flex-direction: column;
      flex-wrap: wrap;
      align-items: center;
      min-height: 270px;
      width: 100%;
      flex-shrink: 0;

      .conditon-wrap-body {
        display: flex;
        overflow: visible;
        min-height: 180px;
        height: auto;
        border-bottom: 1px solid $lineColor;
        border-top: 1px solid $lineColor;
        position: relative;
        margin-top: 13px;

        .add-btn {
          position: absolute;
          top: -14px;
          left: 50%;
          transform: translateX(-50%);
          transform-origin: center center;
          cursor: pointer;
          z-index: 1;
          box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
          border-radius: 13px;
          border-color: $xr-color-primary;
          color: $xr-color-primary;
          padding: 6px 10px;
          font-size: 12px;

          &:hover {
            background-color: white;
            transform: translateX(-50%) scale(1.05);
            box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.1);
          }
        }
      }

      .condition {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        position: relative;
        background: $backgroundColor;

        .cover-line {
          position: absolute;
          height: 3px;
          width: 50%;
          background-color: $backgroundColor;

          &.is-top-left {
            top: -2px;
            left: -1px;
          }

          &.is-bottom-left {
            bottom: -2px;
            left: -1px;
          }

          &.is-top-right {
            top: -2px;
            right: -1px;
          }

          &.is-bottom-right {
            bottom: -2px;
            right: -1px;
          }
        }

        &::before {
          content: "";
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          z-index: 0;
          margin: auto;
          width: 1px;
          height: 100%;
          background-color: $lineColor;
        }

        &-node {
          min-height: 220px;
          display: inline-flex;
          box-orient: vertical;
          box-direction: normal;
          flex-direction: column;
          -webkit-box-flex: 1;

          &-wrap {
            padding-top: 30px;
            padding-right: 50px;
            padding-left: 50px;
            justify-content: center;
            display: inline-flex;
            box-align: center;
            align-items: center;
            box-orient: vertical;
            box-direction: normal;
            flex-direction: column;
            -webkit-box-flex: 1;
            flex-grow: 1;
            position: relative;
            &::before {
              content: "";
              position: absolute;
              top: 0;
              left: 0;
              right: 0;
              bottom: 0;
              margin: auto;
              width: 1px;
              height: 100%;
              background-color: $lineColor;;
            }
          }
        }

        &-wrap {
          position: relative;
          width: 220px;
          min-height: 72px;
          background: #FFFFFF;
          border-radius: 4px;
          padding: 14px 19px;
          cursor: pointer;

          &::after {
            pointer-events: none;
            content: '';
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 2;
            border-radius: 4px;
            border: 1px solid transparent;
            transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);
            box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1);
          }

          &:hover {
            .close {
              visibility: visible !important;
            }

            &::after {
              border: 1px solid $xr-color-primary;
              box-shadow: 0 0 6px 0 rgba(50, 150, 250, 0.3);
            }
          }

          &.is-error {
            &::after {
              border: 1px solid #f56c6c;
            }
          }

          .header {
            position: relative;
            font-size: 12px;
            color: #30b039;
            text-align: left;
            line-height: 16px;

            .title {
              overflow: hidden;
              white-space: nowrap;
              text-overflow: ellipsis;
              max-width: 120px;
              display: inline-block;
            }

            .el-input--mini .el-input__inner {
              max-width: 120px;
              height: 20px;
              line-height: 20px;
            }

            .el-input--mini {
              display: inline;
            }

            .priority {
              float: right;
              margin-right: 12px;
              color: #999;
            }

            .close {
              visibility: hidden;
              position: absolute;
              right: -12px;
              top: 50%;
              transform: translateY(-50%);
              width: 20px;
              height: 20px;
              font-size: 14px;
              color: #999;
              line-height: 20px;
              text-align: center;
            }
          }

          .content {
            margin-top: 5px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
          }
        }

      }
    }
  }

  // 结束节点
  .wk-end-node {
    .circle {
      width: 6px;
      height: 6px;
      margin: auto;
      border-radius: 50%;
      background: $lineColor;
    }

    .text {
      text-align: center;
      margin-top: 5px;
    }
  }
}

.el-popper {
  .add-node-approve {
    padding: 5px 0;
  }
  .add-node-approve-btn {
    list-style: none;
    line-height: 36px;
    padding: 0 20px;
    margin: 0;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    outline: none;

    i {
      margin-right: 5px;
      &.is-orange {
        color: $orangeColor;
      }

      &.is-green {
        color: $greenColor;
      }
    }

    &:hover {
      background-color: #ecf5ff;
      color: $xr-color-primary;
    }
  }
}
