.#{$ns}List {
  position: relative;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 8px;

  &-items {
    border-radius: var(--List-borderRadius);
    // Aug
    // border: var(--List-borderWidth) solid var(--List-borderColor);
    border-top: var(--List-borderWidth) solid var(--List-borderColor);
    border-bottom: var(--List-borderWidth) solid var(--List-borderColor);
    background: var(--saas-main-bg);
    flex: 1;
    overflow: auto;
    @include media-breakpoint-up(sm) {
      // margin: 0 8px;
      border: var(--List-borderWidth) solid var(--List-borderColor);
      border-top: 0;
    }
    .#{$ns}ListItem-wapper {
      padding: 8px;

      .#{$ns}ListItem-content {
        padding-right: 16px;

        .listItem-box {
          display: flex;

          .listItem-head {
            display: flex;
          }

          .listItem-image {
            width: 200px;
            margin-right: 16px;
            overflow: hidden;
            border: 1px solid var(--saas-border-color);
            text-align: center;

            .#{$ns}Container {
              width: 100%;
              height: 100%;
            }

            .#{$ns}Card-img {
              height: 100%;
            }

            .#{$ns}Cell-img-wrapper {
              img {
                width: 80px !important;
                height: unset;
              }
            }

            .#{$ns}Cell-img-wrapper+.#{$ns}Cell-img-wrapper {
              display: none;
            }
          }

          .listItem-icon {
            width: 20px;
            height: 20px;

            .fa {
              font-size: 20px;
            }
          }

          .resources {
            display: inline-block;
            line-height: 1;
          }

          .listItem-body {
            flex: 1;

            .listItem-desc {
              color: var(--saas-font-size-dark-black);
            }

            .top-content {
              display: flex;
              justify-content: flex-start;
              // margin-bottom: 5px;

              .#{$ns}ListItem-title,
              .#{$ns}ListItem-subtitle {
                @include ellipsis();
                width: unset;
                max-width: 105px;
                margin-right: 8px;
              }

              .#{$ns}ListItem-title {
                max-width: 300px;
              }

              .top-item {
                display: flex;
                align-items: center;
              }

              .#{$ns}ListItemtitile {
                max-width: 600px;
              }

              .#{$ns}ListItem-subtitle {
                color: #373737;
                display: flex;
              }

              .tags {
                display: flex;
                align-items: center;

                .tag-item {
                  @include ellipsis();
                  max-width: 100px;
                  margin: 0 2px;
                  border-radius: 4px;
                  background-color: var(--saas-crud-advanced-modle-body-condition-color);
                  font-size: 12px;
                  color: var(--saas-font-size-dark-black);
                  width: unset;
                  height: 16px;
                  padding: 0px 4px;
                  display: flex;
                  justify-content: center;
                  align-items: center;
                }
              }
            }
          }
        }

        .#{$ns}Hbox {
          display: flex;
          flex-wrap: wrap;
          font-size: 12px;

          .#{$ns}Hbox-col {
            width: 33%;
            flex-grow: 0;
            flex-basis: unset;
            min-height: 28px;
            display: flex;
            align-items: center;
            overflow: hidden;

            .#{$ns}ListItem-field {
              flex: 1;
              width: 100%;

              .#{$ns}ListItem-fieldLabel {
                width: 40%;
                min-width: 40%;
                display: flex;
                align-items: center;

                span {
                  @include ellipsis();
                  width: auto;
                  max-width: calc(100% - 3px);
                }
              }

              .#{$ns}ListItem-fieldValue {
                padding: 0 12px;
                @include ellipsis();

                >.#{$ns}ListItem-fieldValue {
                  padding: 0;
                }

                .#{$ns}Form-item {
                  margin-bottom: 0;
                }

                &.is-linkUrl {
                  color: #4f86f4;
                  cursor: pointer;
                }
              }
            }
          }
        }

        .listItem-desc {
          @include ellipsis();
          color: #B4B6BA;
          height: 42px;
          font-size: 12px
        }
      }
    }
  }

  &-toolbar {
    @include clearfix();
    display: flex;
    flex-wrap: wrap;
    align-items: center; // Aug
    padding: 8px 0 0;
    >.#{$ns}List-actions {
      @include media-breakpoint-up(sm) {
        margin-bottom: 8px;
      }
    }
    @include media-breakpoint-up(sm) {
      .#{$ns}Crud-toolbar-tool--head {
        width: auto;
        padding-left: 8px;
        border: 0.0625rem solid #eceff8;
        .#{$ns}List-toolbar-page {
          float: left;
          padding: 0;
          .#{$ns}List-actions {
            margin-bottom: 0;
            height: 32px;
            line-height: 32px;
            font-size: 12px;
            cursor: pointer;
            color: var(--saas-font-size-dark-black);
            .#{$ns}Context-checkall {
              margin-bottom: 0;
              color: var(--saas-font-size-dark-black);
              margin-right: 0.25rem;
            }
          }
        }
        .#{$ns}Crud-toolbar {
          width: auto;
        }
      }
    }
    @include media-breakpoint-down(sm) {
      .#{$ns}Crud-toolbar.footer {
        .#{$ns}Crud-toolbar-tool--actions {
          width: 100%;
          display: flex;
        }
      }
    }
  }

  &-toolbar:nth-last-child(1) {
    padding: 0 8px;
    background-color: var(--Layout-header-bg);

    @include media-breakpoint-down(sm) {
      padding: 8px;
    }
  }

  &-actions {
    display: inline-block;

    >* {
      margin-right: var(--Crud-toolbar-gap);
    }
  }

  &-header {
    padding: var(--List-toolbar-marginY) var(--List-toolbar-marginX);

    >*+.#{$ns}Button,
    >*+.#{$ns}ButtonGroup,
    >*+.#{$ns}ButtonToolbar {
      margin-left: var(--Crud-toolbar-gap);
    }
  }

  &-statistic {
    width: 100%;
    margin-bottom: var(--List-toolbar-marginY);
  }

  &-header+&-toolbar {
    padding-top: 0;
  }

  &-heading {
    padding: var(--gap-xs) 0;
  }

  &-fixedTop {
    position: absolute;
    background: var(--white);
    z-index: -1;
    opacity: 0;
    box-shadow: var(--List-fixedTop-boxShadow);
    // padding: var(--gap-sm);

    &.in {
      position: fixed;
      opacity: 1;
      z-index: $zindex-affix;
    }

    .#{$ns}Cards-toolbar {
      margin-bottom: 0;
    }

    &:empty {
      display: none;
    }
  }

  &--unsaved &-heading {
    background: var(--List--unsaved-heading-bg);
    color: var(--List--unsaved-heading-color);
    padding: var(--gap-xs) var(--gap-sm);
    margin-bottom: var(--gap-sm);
  }

  &-dragTip {
    width: 100%;
    color: var(--info);
    clear: both;
    margin-top: var(--gap-xs);
  }

  &-placeholder {
    color: var(--text--muted-color);
    text-align: center;
    min-height: var(--List-placeholder-height);
    line-height: var(--List-placeholder-height);
  }
}

.#{$ns}ListGroup {
  max-width: px2rem(400px);
  display: flex;
  flex-direction: column;

  &-item {
    position: relative;
    display: block;
    padding: var(--ListItem-paddingY) var(--ListItem-paddingX);
    margin-bottom: px2rem(-1px);
    background: var(--white);
    border: var(--ListItem-borderWidth) solid var(--List-borderColor);

    &:first-child {
      border-top-left-radius: var(--borderRadius);
      border-top-right-radius: var(--borderRadius);
    }

    &:last-child {
      border-bottom-left-radius: var(--borderRadius);
      border-bottom-right-radius: var(--borderRadius);
      margin-bottom: 0;
    }

    &:hover {
      // todo
      z-index: 1;
    }

    &.is-active {
      // todo
      z-index: 2;
    }

    &.is-disabled {
      color: var(--text--muted-color);
    }
  }

  &--expanded {
    .#{$ns}ListGroup-item {
      border-radius: var(--borderRadius);

      margin-bottom: var(--gap-sm);

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

.#{$ns}ListItem {
  @include clearfix();

  &+& {
    border-top: var(--ListItem-borderWidth) solid var(--saas-border-color);
  }

  &.is-checked {
    background-color: #e6f7ff;
  }

  width: 100%;
  position: relative;
  display: inline-flex;
  padding: 0;

  &::before,
  &::after {
    content: none;
  }

  &:nth-child(even) {
    background: var(--ListItem--strip-bg);
  }

  &-checkBtn {
    margin-right: var(--gap-sm);
  }

  &-dragBtn {
    cursor: move;
    margin-right: var(--gap-sm);
  }

  &--actions-at-left &-actions {
    margin-right: var(--gap-base);
  }

  &-title {
    margin: 0;
    padding: 0;
    font-size: 15px;
    color: var(--text--loud-color);
    font-weight: var(--fontWeightMd);
  }

  &-content {
    overflow: hidden;
    flex: 1;
  }

  &-field {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
  }

  &-fieldValue {
    position: relative;
    flex-basis: 0;
    flex-grow: 1;
    max-width: 100%;
    width: 0;
    overflow: hidden;
    text-overflow: ellipsis;

    &.is-linkUrl {
      color: #4f86f4;
      cursor: pointer;
    }
  }

  &-fieldLabel {
    width: px2rem(150px);
    color: var(--saas-font-size-dark-black);
  }

  // Aug 选中样式并不好看
  // &.is-checked {
  //   background: var(--ListItem-onChecked-bg);
  //   border-color: var(--ListItem-onChecked-borderColor);
  //   color: var(--ListItem-onChecked-color);

  //   + .#{$ns}ListItem {
  //     border-color: var(--ListItem-onChecked-borderColor);
  //   }

  //   .#{$ns}ListItem-fieldLabel {
  //     color: var(--ListItem-onChecked-fieldLabel-color);
  //   }
  // }

  &.is-modified,
  &.is-moved {
    background: var(--ListItem-onModified-bg);
    border-color: var(--ListItem-onModified-borderColor);
    color: var(--ListItem-onModified-color);

    +.#{$ns}ListItem {
      border-color: var(--ListItem-onModified-borderColor);
    }

    .#{$ns}ListItem-fieldLabel {
      color: var(--ListItem-onModified-fieldLabel-color);
    }
  }

  &.is-dragging {
    opacity: var(--ListItem-onDragging-opacity);
  }

  &--hasItemAction {
    cursor: pointer;
  }

  &--hasItemAction:hover {
    color: var(--ListMenu-item--onHover-color);
    background: var(--ListMenu-item--onHover-bg);
  }

}

// Jay
@mixin ellipse {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.#{$ns}ListItem-wapper {
  .#{$ns}ListItem.expand+.#{$ns}ListItem-footable {
    display: flex;
  }

  &+& {
    // Aug
    // border-top: var(--ListItem-borderWidth) solid var(--ListItem-borderColor);
    border-top: var(--ListItem-borderWidth) solid var(--saas-border-color);
  }

  .#{$ns}ListItem-footable {
    display: none;
    padding: var(--ListItem-paddingY) var(--ListItem-paddingX);
    padding-top: 0;
    background-color: #f5f5f5;
    color: #333;
    font-size: 12px;
    font-weight: 500;
  }

  .footItem {
    margin: 5px 8px 0 0;

    .label {
      text-align: right;
      color: #818181;
    }

    .value {
      @include ellipse();
    }
  }
}

@include media-breakpoint-down(sm) {
  #List-item-content {

    .#{$ns}List {
      font-size: 13px;

      &-items {
        margin: 0;
        padding: 4px 8px 0;

        .#{$ns}ListItem-wapper {
          padding: 8px 0;

        }

        .#{$ns}ListItem-wapper+.#{$ns}ListItem-wapper {
          border: none;
        }
      }
    }

    .#{$ns}ListItem {
      flex-direction: column;


      &::before,
      &::after {
        content: none;
      }

      &-wapper {
        &+& {
          border: none;
        }
      }

      &-content {
        padding: 0;
      }

      &-fieldLabel {
        width: auto;
        display: inline-block;
      }

      &-actions {
        padding: 4px 0;
        overflow-x: scroll;
        display: flex;
        flex-wrap: nowrap;
        justify-content: right;

        button {
          margin-right: 5px;
        }
      }
    }

    .listItem {
      &-box {
        align-items: center;

        .#{$ns}Hbox {
          margin-bottom: 5px;
          text-overflow: ellipsis;
          white-space: nowrap;
          display: block;
        }

        .listItem-desc,
        .#{$ns}Hbox {
          flex-wrap: nowrap;
          font-size: 13px;

          &-col {
            width: auto;
            display: inline-flex;
          }
        }

        .listItem-desc {
          height: auto;
        }
      }

      &-body {
        padding: 8px 8px 0;
        overflow: hidden;
      }

      &-head {
        display: flex;
        justify-content: center;
        margin-right: 5px;
      }

      &-image {
        margin: 0;
        width: 84px;
        height: 84px;
        display: flex;
        align-items: center;
        justify-content: center;
      }
    }
  }
}