@import '../../style/mixins/hairline.less';

@list-color: #888;
@list-item-hover-color: #f8f8f8;

.am-list {
  &-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding-left: 16px;
    font-size: 15px;
    line-height: 1.4;
    color: @color-text-title;
    &-hover {
      // hover 样式
      background-color: @list-item-hover-color;
    }
  }
  &-prefix {
    margin-right: 16px;
  }
  &-thumb {
    width: 30px;
    height: 30px;
    margin-right: 16px;
  }
  &-line {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    align-self: stretch;
    padding-right: 15px;
    min-height: 52px;
    overflow: hidden;
  }
  &-content, &-extra {
    line-height: 1.5;
    width: auto;
    padding-top: 7px;
    padding-bottom: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  &-content {
    flex: 1;
    color: @color-text-base;
    font-size: 17px;
    text-align: left;
  }
  &-extra {
    flex-basis: 36%;
    color: @list-color;
    font-size: 16px;
    text-align: right;
  }
  &-brief {
    color: @list-color;
    font-size: 14px;
  }
  &-wrap {
    .am-list-content, .am-list-extra {
      white-space: normal;
      word-break: break-all;
    }
  }
  &-arrow {
    display: block;
    width: 15px;
    height: 15px;
    margin-left: 8px;
    background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAaCAYAAAC+aNwHAAAAAXNSR0IArs4c6QAAAdxJREFUOBGlVT1Lw1AUbSSBdMnQf9ChU6GFtr9AEMFBiouDuOikoGixiGgRSi2i1KJTR0fHbuLi5mRbcO7QnyAIQjCSek7ghtc0DQm+5d537z0n97yvpFIYg8GgMxqNavSTjqXhcNgCqOa6bgf+eWICABwBTafTFkiuZB7HaiyChAZMUwCapnXL5XIsSR4BgWyfHQgJbA8k+yCbKrE51ydgBp2cwbSlCuDHUqm0C+tKLGhnCJjEbpxiQa+lEOAnkGzD/kpMtXMETEJOHXJulMJ+Op3ezOfzP0rMc5eCAc6h/RamruSqtm33J5OJqcQ8N7QDKeLh4vmQOWS86rq+XiwWvyUW2oEkof0OoGOZQ9ay4zgv4/HYklhkB1KE3TmEfy9zkL4bhrFaKBQ+YxEQCDkHkPOgkHyAaCVSghRH2VgdREnQo9iZw5k4wuJ1lbo3y7LWcrncF2OREriNKpjbyMUTMAkWSkDbJ8jzQHkD4OdMJrORzWZtidGGdsCjjJwPht83TbMaBJNgroOkl2mmA17nwE3kdd5C+6E3kR34BHxQMPffAvg9gHcAXvgW+AT4cgOr7b9GAHUrlcoebORr5BHgy5dwmpxwANSO+x6ynhIMOhwAXwCc+Gn/14/lDyH1t+arhvp8AAAAAElFTkSuQmCC);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: 50% 50%;
    &-empty {
      visibility: hidden;
    }
  }
  &-line-bottom {
    .hairline('bottom');
  }
  // 子元素垂直对齐
  &-top {
    .am-list-line {
      align-items: flex-start;
    }
  }
  &-middle {
    .am-list-line {
      align-items: center;
    }
  }
  &-bottom {
    .am-list-line {
      align-items: flex-end;
    }
  }
  // 多行
  &-multiple {
    .am-list-line {
      padding: 6px 15px 6px 0;
    }
    .am-list-thumb {
      width: 36px;
      height: 36px;
    }
  }
  &-item.last {
    .am-list-line-bottom::after {
      display: none;
    }
  }
}
