$primary-color: #409eff;
$primary-active-color: #ecf5ff;
$primary-background-color: #ecf8ff;

*,
:after,
:before {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

body {
  margin: 0 !important;
}

#app {
  font-family: Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  min-height: 100%;
  height: 100%;
}
.header-title {
  padding-right: 10px;
}
.page-designer {
  height: 100%;

  .fields-list {
    padding: 10px 0;
    width: 100%;
    height: 100%;

    .field-title {
      padding: 8px 12px;
      font-size: 13px;
    }

    ul {
      position: relative;
      overflow: hidden;
      padding: 0 10px 10px;
      margin: 0;
    }

    .field-label {
      font-size: 12px;
      display: block;
      width: 48%;
      line-height: 26px;
      position: relative;
      float: left;
      left: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      margin: 1%;
      color: #333;
      border: 1px solid #f4f6fc;

      &:hover {
        color: $primary-color;
        border: 1px dashed $primary-color;
      }

      & > a {
        display: block;
        cursor: move;
        background: #f4f6fc;
        border: 1px solid #f4f6fc;

        .icon {
          margin-right: 6px;
          margin-left: 8px;
          font-size: 14px;
          display: inline-block;
          vertical-align: middle;
        }

        span {
          display: inline-block;
          vertical-align: middle;
        }
      }
    }

    .field-label-disabled {
      font-size: 12px;
      display: block;
      width: 48%;
      line-height: 26px;
      position: relative;
      float: left;
      left: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      margin: 1%;
      color: #333;
      border: 1px solid #f4f6fc;

      &:hover {
        color: gray;
        border: 1px dashed gray;
      }

      & > a {
        display: block;
        cursor: not-allowed;
        background: #f4f6fc;
        border: 1px solid #f4f6fc;

        .icon {
          margin-right: 6px;
          margin-left: 8px;
          font-size: 14px;
          display: inline-block;
          vertical-align: middle;
        }

        span {
          display: inline-block;
          vertical-align: middle;
        }
      }
    }
  }

  .widget-page-container {
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;

    .widget-container-header {
      height: 45px !important;
      line-height: 45px;
      font-size: 18px;
      border-bottom: solid 2px #e4e7ed;
      text-align: right;
    }

    .el-main {
      padding: 0;
      position: relative;
    }
  }

  .widget-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    .widget-list {
      height: 100%;
      min-height: calc(100vh - 45px);
      padding: 20px;
      background: #f7f7f7;

      .widget-item {
        padding: 5px 10px 18px;
        margin: 0;
        position: relative;
        border-left: 5px solid transparent;

        &:after {
          position: absolute;
          left: 0;
          right: 0;
          bottom: 0;
          top: 0;
          display: block;
          z-index: 1001;
        }

        &:hover {
          background: $primary-background-color;
          cursor: move;
        }

        &.active {
          border-left: 3px solid $primary-color;
          background: $primary-active-color;
        }

        .widget-action-delete {
          position: absolute;
          right: 5px;
          bottom: -14px;
          z-index: 1002;
        }

        .widget-action-clone {
          position: absolute;
          right: 40px;
          bottom: -14px;
          z-index: 1002;
        }
      }

      .widget-card {
        position: relative;
        padding: 2px;
        float: left;
        background: #fff;

        &__content {
          display: flex;
          padding: 10px 5px;
          width: 100%;
          height: 100%;
          overflow-y: hidden;
          outline: 1px dashed #ccc;
          outline-offset: -1px;
          min-height: 103px;

          .ghost {
            background: white;
            border-left: 5px solid $primary-color;
            box-sizing: border-box;
            font-size: 0;
            content: '';
            overflow: hidden;
            padding: 0 !important;
            position: relative;
            outline: none 0;
            height: 100%;
            min-height: 90px;
            width: 0 !important;
            min-width: 0 !important;
            margin: 1px 2px 0 2px;
          }
        }

        &_body {
          min-height: 80px;
          border: 1px dotted #333;
        }

        &__item {
          position: relative;
          min-width: 33.3%;
          width: 33.3%;
          padding: 1px;
          height: 100%;

          &.required {
            .el-table__header .cell::before {
              content: '*';
              color: #f56c6c;
              margin-right: 4px;
            }
          }

          &.active {
            outline: 1px solid $primary-color;
            outline-offset: -1px;
          }

          &:hover {
            outline: 1px solid $primary-color;
            outline-offset: -1px;
            cursor: move;
          }

          &:after {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            top: 0;
            display: block;
            content: '';
            z-index: 1001;
          }

          .widget-card-action-delete {
            position: absolute;
            right: 0;
            bottom: 0;
            z-index: 1002;
          }

          .widget-card-action-clone {
            position: absolute;
            right: 30px;
            bottom: 0;
            z-index: 1002;

            i {
              font-size: 10px;
            }
          }

          .el-button--small.is-circle {
            padding: 5px;
          }
        }

        &.active {
          border-left: 3px solid $primary-color;
          background: $primary-active-color;
        }

        &:hover {
          background: $primary-background-color;
          cursor: move;
        }

        .widget-action-delete {
          position: absolute;
          right: 10px;
          bottom: -12px;
          z-index: 1001;
        }

        .widget-action-clear {
          position: absolute;
          right: 50px;
          bottom: -12px;
          z-index: 1001;
        }

        .widget-action-clone {
          position: absolute;
          right: 90px;
          bottom: -12px;
          z-index: 1001;
        }
      }

      .widget-group {
        position: relative;
        width: 100%;
        float: left;
        padding: 2px;
        background: #fff;

        &__head {
          margin: 10px;
        }

        &__body {
          min-height: 150px;
          height: 100%;
          outline: 1px dashed #ccc;
          outline-offset: -1px;
          overflow: hidden;
          padding-bottom: 15px;

          .ghost {
            background: white;
            border-left: 5px solid $primary-color;
            box-sizing: border-box;
            font-size: 0;
            content: '';
            overflow: hidden;
            padding: 0 !important;
            position: relative;
            outline: none 0;
            height: 100%;
            min-height: 57px;
            width: 0 !important;
            min-width: 0 !important;
            margin: 1px 2px 0 2px;
          }
        }

        &__item {
          padding: 10px;
          margin: 3px;
          position: relative;
          border-left: 5px solid transparent;
          background: white;

          &.required {
            .el-form-item__label::before {
              content: '*';
              color: #f56c6c;
              margin-right: 4px;
            }
          }

          &.active {
            outline: 1px solid $primary-color;
            outline-offset: -1px;
          }

          &:hover {
            outline: 1px solid $primary-color;
            outline-offset: -1px;
            cursor: move;
          }

          &:after {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            top: 0;
            display: block;
            content: '';
            z-index: 1001;
          }

          &--delete {
            position: absolute;
            right: 5px;
            bottom: -14px;
            z-index: 1002;
            padding: 6px;
          }

          &--clone {
            position: absolute;
            right: 39px;
            bottom: -14px;
            z-index: 1002;
            padding: 6px;
          }
        }

        &.active {
          border-left: 3px solid $primary-color;
          background: $primary-active-color;
        }

        &:hover {
          background: $primary-background-color;
          cursor: move;
        }

        .widget-action-delete {
          position: absolute;
          right: 10px;
          bottom: -12px;
          z-index: 1001;
        }

        .widget-action-clear {
          position: absolute;
          right: 50px;
          bottom: -12px;
          z-index: 1001;
        }

        .widget-action-clone {
          position: absolute;
          right: 90px;
          bottom: -12px;
          z-index: 1001;
        }
      }
      .widget-tab {
        position: relative;
        float: left;
        .el-tabs__header {
          margin-bottom: 0;
        }
        .content {
          background: #fff;
        }
        &.active {
          border-left: 3px solid $primary-color;
          background: $primary-active-color;
        }

        &:hover {
          background: $primary-background-color;
          cursor: move;
        }

        .widget-action-delete {
          position: absolute;
          right: 10px;
          bottom: -12px;
          z-index: 1001;
        }

        .widget-action-clear {
          position: absolute;
          right: 50px;
          bottom: -12px;
          z-index: 1001;
        }

        .widget-action-clone {
          position: absolute;
          right: 90px;
          bottom: -12px;
          z-index: 1001;
        }
      }

      .iconfont {
        font-size: 13px;
      }

      .el-button--small.is-circle {
        padding: 7px;
      }
    }

    .ghost {
      background: white;
      border-top: 5px solid $primary-color;
      box-sizing: border-box;
      font-size: 0;
      content: '';
      overflow: hidden;
      padding: 0 !important;
      position: relative;
      outline: none 0;
      height: 0 !important;
      width: 100%;
      margin: 2px 0;
    }
  }

  .button-group {
    position: relative;
    padding: 2px;
    width: 100%;
    min-width: 100px;

    &.active {
      border-left: 3px solid $primary-color;
      background: $primary-active-color;
    }

    &:hover {
      background: $primary-background-color;
      cursor: move;
    }

    .widget-action-delete {
      position: absolute;
      right: 10px;
      bottom: -12px;
      z-index: 1001;
      border-left-width: 1px;
    }

    .widget-action-clear {
      position: absolute;
      right: 50px;
      bottom: -12px;
      z-index: 1001;
      border-left-width: 1px;
    }

    .widget-action-clone {
      position: absolute;
      right: 90px;
      bottom: -12px;
      z-index: 1001;
      border-left: 1px;
    }

    &__body {
      min-height: 80px;
      height: 100%;
      outline: 1px dashed #ccc;
      outline-offset: -1px;
      overflow: hidden;
      padding-bottom: 15px;
      width: 100%;
      min-width: 240px;

      .ghost {
        background: white;
        border-left: 5px solid $primary-color;
        box-sizing: border-box;
        font-size: 0;
        content: '';
        overflow: hidden;
        padding: 0 !important;
        position: relative;
        outline: none 0;
        height: 100%;
        min-height: 57px;
        width: 0 !important;
        min-width: 0 !important;
        margin: 1px 2px 0 2px;
      }
    }

    &__item {
      padding: 10px;
      margin: 3px;
      position: relative;
      border-left: 5px solid transparent;
      background: white;
      float: left;

      &.required {
        .el-form-item__label::before {
          content: '*';
          color: #f56c6c;
          margin-right: 4px;
        }
      }

      &.active {
        outline: 1px solid $primary-color;
        outline-offset: -1px;
      }

      &:hover {
        outline: 1px solid $primary-color;
        outline-offset: -1px;
        cursor: move;
      }

      &:after {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        display: block;
        content: '';
        z-index: 1001;
      }

      &--delete {
        position: absolute;
        right: 5px;
        bottom: -14px;
        z-index: 1002;
        padding: 6px;
      }

      &--clone {
        position: absolute;
        right: 39px;
        bottom: -14px;
        z-index: 1002;
        padding: 6px;
      }
    }
  }

  .widget-config-container {
    margin-top: 5px;
    //position: relative;

    .el-tabs__header {
      width: 380px;
      height: 45px;
      background: white;
      z-index: 1000;
    }

    .el-tabs__content {
      margin-top: 20px;
    }

    .widget-config {
      .el-tabs__header {
        position: relative;
        display: block;
        top: 0;
        margin: 0;
      }

      .el-tabs__content {
        margin-top: 0;
      }

      .ghost {
        background: #fff;
        border: 1px dashed $primary-color;
      }

      ul {
        margin: 0;
        padding: 0;

        li {
          display: flex;
          align-items: center;
          width: 100%;

          .ghost {
            list-style: none;
            font-size: 0;
            height: 35px;
          }
        }
      }
    }
    .avue-group__item {
      padding: 0;
    }
  }

  .el-container {
    height: 100vh;

    .el-main {
      height: calc(100% - 45px);
    }
  }

  .danger {
    color: #f56c6c;
  }

  .warning {
    color: #e6a23c;
  }
}

.drawer-foot {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  display: flex;

  button {
    width: 50%;
  }
}

.preview-page {
  overflow-y: scroll;
  height: 83vh;
}
