@import '../../var.less';

/* fix: 修复 react-photo-view 上面图片可能不显示的问题 */
.PhotoView__PhotoWrap {
  .PhotoView__PhotoBox {
    width: 100%;
    height: 50px;
  }
}
.upload {
  .text {
    &-list-item {
      position: relative;
      border-bottom: 1px solid @gray-light-color;

      &:last-child {
        margin-bottom: 10px;
      }

      .text {
        height: 38px;
        max-width: 85%;
        overflow: hidden;
        font-size: 16px;
        line-height: 38px;
        color: @font-regular;
        text-align: left;

        .name {
          display: -webkit-box;
          max-width: 100%;
          overflow: hidden;
          text-overflow: ellipsis;
          -webkit-box-orient: vertical;
          -webkit-line-clamp: 1;
        }
      }

      .icon {
        position: absolute;
        top: 0;
        right: 0;
        line-height: 38px;
      }
    }

    &-list-item.error {
      .text {
        color: @danger-color;
      }
    }
  }

  .picture-card {
    margin-bottom: -10px;

    &-list-item {
      position: relative;
      display: inline-block;
      width: 81px;
      height: 81px;
      padding: 6px;
      margin-right: 7px;
      margin-bottom: 10px;
      line-height: 81px;
      text-align: center;
      vertical-align: middle;
      border: 1px solid @gray-base-color;
      border-radius: 4px;
      box-sizing: border-box;

      &:last-child {
        margin-bottom: 10px;
      }

      .content {
        display: inline-block;
        width: 100%;
        height: 100%;
        overflow: hidden;

        .icon {
          margin-top: 3px;
          font-size: 36px;
          line-height: 36px;
        }

        .label {
          margin-top: 4px;
          font-size: 22px;
          line-height: 15px;
        }

        .img {
          width: 100%;
          font-size: 12px;
          line-height: 15px;
        }

        .delete-btn {
          position: absolute;
          top: -9px;
          right: -9px;
          padding: 0;
          margin: 0;
          font-size: 18px;
          line-height: 18px;
        }
      }
    }

    &-list-item.error {
      color: @danger-color;
      border-color: @danger-color;

      .label {
        margin-top: 4px;
        font-size: 12px;
        line-height: 15px;
      }

      .icon {
        //line-height: 18px;
        //font-size: 18px;
        i {
          color: @danger-color;
        }
      }

      .delete-btn {
        color: @danger-color;
      }
    }

    .upload-button-picture {
      border: 1px dashed @gray-base-color;
      // background-color: #fafafa;
      .icon {
        // color: #999999;
        color: @primary-color;
      }

      .label {
        font-size: 14px;
        // color: #8c8c8c;
        color: @primary-color;
      }
    }
  }

  .picture {
    &-list-item {
      position: relative;
      padding: 8px;
      margin-bottom: 10px;
      border: 1px solid @gray-base-color;
      border-radius: 4px;

      .content {
        height: 48px;
        overflow: hidden;
        line-height: 48px;

        div {
          vertical-align: middle;
        }

        .label {
          display: inline-block;
          width: calc(100% - 100px);
          //white-space: nowrap;
          //text-overflow: ellipsis;
          //overflow: hidden;
          font-size: 14px;
          line-height: 16px;
          color: @font-regular;

          .name {
            display: -webkit-box;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
          }
        }

        .img {
          display: inline-block;
          width: 50px;
          height: 50px;
          margin-right: 8px;
          overflow: hidden;

          img {
            width: 100%;
            font-size: 12px;
            line-height: 15px;
          }
        }

        .delete-btn {
          position: absolute;
          top: 50%;
          right: 0;
          padding: 0;
          margin: -9px 0 0;
          font-size: 18px;
        }
      }
    }

    &-list-item.error {
      color: @danger-color;
      border-color: @danger-color;

      .label {
        color: @danger-color;
      }

      .delete-btn {
        color: @danger-color;
      }
    }

    .upload-button-picture {
      background-color: #fafafa;
      border: 1px dashed @gray-base-color;

      .icon {
        color: #999;
      }

      .label {
        color: #8c8c8c;
      }
    }
  }

  .upload-button-text {
    position: relative;
    height: 40px;
    line-height: 40px;
    color: @primary-color;
    text-align: center;
    border: 1px dashed @primary-color;
    border-radius: 1px;
  }

  &-input {
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    width: 100%;
    height: 100%;
    opacity: 0;
  }

  &-popup {
    &-radio {
      .weui-cell {
        height: 54px;
        padding: 0;
        line-height: 53px;
        text-align: center;

        &::before {
          left: 0;
        }
      }
    }

    &-popup-cancel {
      height: 78px;
      margin-top: 12px;
      font-size: 18px;
      line-height: 53px;
      color: @primary-color;
      background-color: @container-background-color;
      border: none;
      border-radius: 0;

      &::after {
        border: none;
        border-radius: 0;
      }
    }

    &-content {
      background: @white-color;

      .form_wrap_radio {
        padding: 10px 10px 0;
      }

      .upload-popup-cancel {
        border-top: 1px solid @gray-light-color;
      }
    }
  }

  .preview-btn {
    color: @primary-color;
    text-align: right;
  }
  .preview-empty {
    color: @font-secondary;
    text-align: right;
  }
  &-preview-modal{
    touch-action: pan-y;
    * {
      touch-action: pan-y;
    } // ios 默认滑动事件报错处理
  }
}
