@charset "UTF-8";
@import "./progress.css";
@import "./common/var.css";

@component-namespace el {
  @b upload {
    width: 360px;

    @e input {
      display: none;
    }
    @e inner {
      display: inline-block;
      position: relative;

      & iframe {
        position: absolute;
        z-index: -1;
        top: 0;
        left: 0;
        opacity: 0;
        filter: alpha(opacity=0);
      }
    }
    @e files {
      margin: 0;
      padding: 0;
      list-style: none;
      margin-bottom: 10px;
    }
    @e file {
      transition: all .5s cubic-bezier(.55,0,.1,1);
      font-size: 14px;
      color: #475669;
      line-height: 32px;
      position: relative;
      box-sizing: border-box;
      border-radius: 4px;
      width: 100%;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      position: relative;

      a {
        color: #475669;
        transition: color .3s;
        padding-left: 4px;

        [class^="el-icon"] {
          color: #99a9bf;
          margin-right: 7px;
          height: 100%;
          line-height: inherit;
        }
      }
      & .el-progress {
        position: absolute;
        bottom: -3px;
        width: 100%;
      }
      & .el-progress__text {
        position: absolute;
        right: 0;
        top: -10px;
        right: 0;
      }
      .el-progress-bar {
        margin-right: 0;
        padding-right: 0;
      }
      &:hover {
        background-color: #eff2f7;
      }
      @when finished {
        & a:hover {
          color: var(--link-hover-color);
          cursor: pointer;
        }
        &:hover {
          .el-upload__btn-delete {
            display: block;
            cursor: pointer;
          }   
        }
      }
    }
    @e tip {
      font-size: 12px;
      color: #8492a6;
      margin-top: 7px;
    }
    @e btn-delete {
      position: absolute;
      right: 15px;
      top: 0;
      font-size: 12px;
      color: var(--color-primary);
      display: none;
    }
  }
  @b dragger {
    background-color: #f9fafc;
    border: 1px solid #c0ccda;
    box-sizing: border-box;
    width: 360px;
    height: 180px;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;

    & .el-upload__inner {
      display: block;
      height: 100%;
    }
    & .el-icon-upload {
      font-size: 67px;
      color: #99a9bf;
      margin: 40px 0 16px;
      line-height: 50px;
    }

    & + .el-upload__tip {
      text-align: center;
    }
    & ~ .el-upload__files {
      margin-top: 7px;
      padding-top: 5px;
      border-top: 1px solid rgba(#c0ccda, .2);
    }

    @e cover {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      z-index: 10;
      cursor: default;
      @utils-vertical-center;

      & img {
        display: block;
        width: 100%;
        height: auto;
      }

      @e progress {
        display: inline-block;
        vertical-align: middle;
        position: static;
        width: 243px;

        & + .el-upload__inner {
          opacity: 0;
        }
      }

      @e content {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
      }

      @e interact {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(#000, .72);
        text-align: center;

        & .btn {
          display: inline-block;
          color: #fff;
          font-size: 14px;
          cursor: pointer;
          vertical-align: middle;
          transition: var(--md-fade-transition);
          margin-top: 60px;

          & i {
            margin-top: 0;
          }

          & span {
            opacity: 0;
            transition: opacity .15s linear;
          }

          &:not(:first-child) {
            margin-left: 35px;
          }

          &:hover {
            transform: translateY(-13px);

            & span {
              opacity: 1;
            }
          }

          & i {
            color: #fff;
            display: block;
            font-size: 24px;
            line-height: inherit;
            margin: 0 auto 5px;
          }
        }
      }

      @e title {
        position: absolute;
        bottom: 0;
        left: 0;
        background-color: #fff;
        height: 36px;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: normal;
        text-align: left;
        padding: 0 10px;
        margin: 0;
        line-height: 36px;
        font-size: 14px;
        color: #475669;
      }

      & + .el-upload__inner {
        opacity: 0;
        position: relative;
        z-index: 1;
      }
    }

    @e text {
      color: #99a9bf;
      font-size: 14px;
      text-align: center;

      & em {
        color: var(--color-primary);
        font-style: normal;
      }
    }

    &:not(.is-showCover):hover {
      border-color: var(--color-primary);
    }

    @when dragOver {
      background-color: rgba(32, 159, 255, .06);
      border: 2px dashed var(--color-primary);
    }
  }
}
