@import '../../../styles/element-variables';
$selectedColor: rgba(246, 247, 250, 1);
$lighterBlue: #409eff;

.container {
  position: relative;
  width: 100%;
  height: 100%;
}

.components-list {
  box-sizing: border-box;
  height: 100%;

  .components-part {
    background: #fff;
    border-radius: 4px;
    padding: 10px 10px 0;
    margin-bottom: 10px;

    &:last-child {
      margin-bottom: 0;
    }
  }

  .components-draggable {
    margin-right: -10px;
  }

  .components-item {
    display: inline-block;
    width: 110px;
    margin: 0 10px 10px 0;
    transition: transform 0ms !important;

    &.disabled {
      .components-body {
        background: rgba(246, 247, 250, 1);
        cursor: not-allowed;
        border: none !important;
        color: #999 !important;

        .icon-ym {
          color: #999 !important;
        }

        &:hover {
          border: none !important;
          color: #999 !important;

          .icon-ym {
            color: #999 !important;
          }
        }
      }
    }
  }
}

.components-title {
  font-size: 14px;
  color: #043254;
  line-height: 30px;
  margin-bottom: 10px;
  font-weight: bold;
}

.components-body {
  padding-left: 8px;
  background: $selectedColor;
  font-size: 12px;
  height: 36px;
  cursor: move;
  border: 1px dashed $selectedColor;
  border-radius: 3px;
  color: #043254;
  line-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  i {
    color: $--color-primary;
    line-height: 16px;
    height: 16px;
    margin-right: 4px;
  }

  &:hover {
    border: 1px dashed #409eff;
    color: #409eff;

    i {
      color: #409eff;
    }
  }
}

.left-board {
  width: 250px;
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  overflow: hidden;
  border-radius: 4px;
}

.left-scrollbar {
  height: 100%;
  overflow: hidden;

  .el-scrollbar__wrap {
    overflow-x: auto;
  }
}

.center-scrollbar {
  height: calc(100% - 42px);
  overflow: hidden;
  box-sizing: border-box;

  .el-scrollbar__wrap {
    overflow-x: auto;
  }

  .el-scrollbar__view {
    overflow-x: hidden;
  }
}

.center-board {
  height: 100%;
  width: auto;
  margin: 0 350px 0 260px;
  box-sizing: border-box;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;

  .jnpf-editor-quill {
    .ql-editor {
      min-height: 100px !important;
    }
  }

  .table-tip {
    width: 100%;
    color: #999;
    text-align: center;
    position: absolute;
    top: 60px;
    font-size: 14px;

    &.tab-tip {
      top: 45px;
    }

    &.card-tip {
      top: 30px;
    }
  }
}

.empty-info {
  position: absolute;
  top: 20%;
  left: calc(50% - 250px);

  &.app-empty-info {
    top: calc(50% - 150px);
    left: calc(50% - 150px);

    .empty-img {
      width: 300px;
      height: 300px;
    }
  }

  .empty-img {
    width: 500px;
    height: 500px;
  }
}

.action-bar {
  position: relative;
  height: 42px;
  text-align: right;
  padding: 0 15px;
  box-sizing: border-box;
  border-bottom: 1px solid #dcdfe6;

  .delete-btn {
    color: #f56c6c !important;
  }
}

.logo {
  position: absolute;
  left: 12px;
  top: 6px;
  line-height: 30px;
  color: #00afff;
  font-weight: 600;
  font-size: 17px;
  white-space: nowrap;

  > img {
    width: 30px;
    height: 30px;
    vertical-align: top;
  }

  .github {
    display: inline-block;
    vertical-align: sub;
    margin-left: 15px;

    > img {
      height: 22px;
    }
  }
}

.center-board-row {
  padding: 12px 12px 15px 12px;
  box-sizing: border-box;
  height: 100%;

  & > .el-form {
    height: calc(100vh - 150px);
  }

  .el-tabs__header {
    margin: 0;
  }
}

.ipadbody {
  .center-board-row > .el-form {
    height: 550px;
  }
}

.drawing-board {
  height: 100%;
  position: relative;
  .drawing-item-resize {
    position: absolute;
    bottom: 5px;
    right: 3px;
    cursor: e-resize;
    color: #b9b9cb;
    i {
      // 旋转30度
      transform: rotate(40deg);
      font-size: 20px;
    }
  }
  .el-select {
    width: 100%;
  }

  .components-body {
    padding: 0;
    margin: 0;
    font-size: 0;
  }

  .sortable-ghost {
    position: relative;
    display: block;
    overflow: hidden;

    i {
      display: none;
    }

    .el-form-item {
      i {
        display: inline;
      }
    }

    &::before {
      content: ' ';
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      height: 3px;
      background: #409eff;
      z-index: 2;
    }
  }

  .components-item.sortable-ghost {
    width: 100%;
    height: 60px;
    background-color: $selectedColor;
  }

  .active-from-item {
    & > .el-form-item {
      background: $selectedColor;
      border: 1px solid #409eff;
    }

    & > .drawing-item-copy,
    & > .drawing-item-delete {
      display: block;
    }

    & > .component-name {
      color: $lighterBlue;
    }
  }

  .el-form-item {
    margin-bottom: 10px !important;
  }
}

.drawing-item {
  position: relative;
  cursor: move;

  &.unfocus-bordered:not(.active-from-item) > div:first-child {
    border: 1px dashed #ccc;
  }

  .el-form-item {
    border: 1px dashed #e2e0e0;
    padding: 10px;
  }
}

.drawing-row-item {
  position: relative;
  cursor: move;
  box-sizing: border-box;
  border: 1px dashed #ccc;
  padding: 10px 2px;
  margin-bottom: 10px;

  .drawing-item-copy {
    right: 48px !important;
  }

  .drawing-item-delete {
    right: 16px !important;
  }

  .drawing-row-item {
    margin-bottom: 2px;
  }

  &.drawing-row-item-table {
    padding-top: 15px;

    .el-col {
      margin-top: 15px;
    }
  }

  .el-form-item {
    margin-bottom: 0;
  }

  .drag-wrapper {
    min-height: 80px;
  }

  &.active-from-item {
    border-color: $lighterBlue;
  }

  .component-name {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 18px;
    color: #bbb;
    display: inline-block;
    padding: 5px 6px 0;
  }
}

.drawing-item,
.drawing-row-item {
  &:hover {
    & > .el-form-item {
      background: $selectedColor;
    }

    & > .drawing-item-copy,
    & > .drawing-item-delete {
      display: block;
    }
  }

  & > .drawing-item-copy,
  & > .drawing-item-delete {
    display: none;
    position: absolute;
    bottom: 11px;
    width: 28px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    font-size: 12px;
    background: $--color-primary;
    cursor: pointer;
    z-index: 1;
  }

  & > .drawing-item-copy {
    right: 36px;
    color: #fff !important;

    &:hover {
      color: #fff;
    }
  }

  & > .drawing-item-delete {
    right: 8px;
    color: #fff;

    &:hover {
      color: #fff;
    }
  }
}

.drawing-row-item .el-card__body > .el-col {
  margin-top: 0 !important;
  margin-bottom: 10px;
}

.table-wrapper-web {
  overflow: auto;
  display: flex;
  width: 100%;

  & > .el-col {
    width: 220px !important;
    flex-shrink: 0;

    .el-form-item {
      margin-bottom: 0 !important;
    }
  }
}
