/* stylelint-disable font-family-no-missing-generic-family-keyword */
/* stylelint-disable selector-class-pattern */
$--area-title-font-size: 16px;

.gy-area-title {
  font-size: $--area-title-font-size;
  font-weight: bold;
  padding-left: 12px;
  margin-bottom: 12px;
  position: relative;
  width: 100%;

  & ~ & {
    margin-top: 30px;
  }

  &::before {
    position: absolute;
    width: 6px;
    height: $--area-title-font-size;
    background: $--color-primary;
    display: block;
    content: "";
    left: 0;
  }
}

.gy-option {
  font-size: 13px;
  margin: 8px 0;
}

.gy-form {
  --fix: 60px;

  .addbtn-restyle {
    border: 1px dashed $--color-primary;
    color: $--color-primary;
    background: transparent;
    font-weight: bold;

    &.mt {
      margin-top: 16px;
    }
  }

  .el-radio__input {
    .el-radio__inner {
      width: 16px;
      height: 16px;
      border: 1px solid $--color-primary;
      background: rgba($--color-primary, 0.1);
      border-radius: 20%;
    }

    &.is-checked {
      .el-radio__inner {
        &::after {
          background: rgba($--color-primary, 1);
          width: 80%;
          height: 80%;
          border-radius: 30%;
        }
      }
    }

    &.middle {
      align-items: center;
    }
  }

  .gy-unform-content {
    padding: 0 0 0 12px;
  }

  font-family:
    "Source Han Sans CN-Bold",
    "Source Han Sans CN";

  &.mb,
  .mb {
    margin-bottom: 10px;
  }

  .gy-form-item {
    display: flex;

    &.middle {
      align-self: center;
      height: 100%;
      display: flex;
      align-items: center;
    }

    .el-textarea {
      width: auto;
      flex-grow: 1;
      flex-basis: 0;
    }

    .gy-label {
      flex-basis: auto;
      min-width: var(--fix);
      padding: 0 0 0 12px;
      height: 100%;
      vertical-align: top;
      color: #333;
      font-weight: bold;
      font-size: 12px;
      box-sizing: border-box;

      &.require {
        position: relative;

        &::before {
          position: absolute;
          width: 6px;
          display: block;
          content: "*";
          color: #e00;
          left: 6px;
        }
      }

      &.middle {
        align-self: center;
        height: 100%;
        display: flex;
        align-items: center;
      }

      &.right {
        padding: 0 12px 0 0;
        text-align: right;
      }
    }

    .gy-in {
      flex-grow: 1;
      flex-basis: 0;
      line-height: 1.3;
    }

    .gy-label + div {
      .red,
      &.red {
        color: #eb5b5c;
      }
    }
  }

  /* form 行排 */
  &.inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;

    .gy-form-item {
      margin-right: 20px;
    }

    .el-input {
      width: auto;
    }
  }
}

.gy-table {
  box-shadow: 0 0 0 1px  $--color-primary;
  border-radius: 4px;
  overflow: hidden;
  padding: 0;

  table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-weight: normal;
  }

  td {
    box-sizing: border-box;
    margin: 0;
    border: none;
    border: 1px solid #efefef;
  }

  thead {
    background: $--color-primary;
    border: 1px solid $--color-primary;
    color: #fff;

    td {
      border: none;
    }
  }

  tr.blod {
    td {
      font-weight: bold;
      padding: 8px 6px;
    }
  }
}

.gy-el-table {
  .el-table {
    border-radius: 4px;
    border: 1px solid $--color-primary;
  }

  .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
    background: rgba($--color-primary, 0.05);
  }

  .el-table .el-table__cell.el-table-column--selection .cell {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.gy-form,
.gy-el-table {
  .el-checkbox__input {
    .el-checkbox__inner {
      width: 16px;
      height: 16px;
      border: 1px solid $--color-primary;
      background: rgba($--color-primary, 0.1);
      border-radius: 20%;

      &::after {
        background: rgba($--color-primary, 1);
        width: 80%;
        height: 80%;
        border-radius: 30%;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) scale(0);
        border: none;
        transition: transform 0.05s ease-in 0.05s;
      }
    }

    &.is-checked {
      .el-checkbox__inner {
        &::after {
          transform: translate(-50%, -50%) scale(1);
        }
      }
    }

    &.middle {
      align-items: center;
    }
  }

  .gy-check .header,
  .el-table__header .el-table-column--selection {
    .el-checkbox__input {
      .el-checkbox__inner {
        border: 1px solid #fff;

        &::after {
          background: #fff;
        }
      }
    }
  }
}
