@import './token.less';

.@{ns}-Record {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translate(0,0);

  &-header {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    padding-left: 10px;
    padding-top: 10px;
    align-items: center;
    &-title {
      font-size: 15px;
      color: #303030;
      font-weight: 500;
    }

  }

  &-main{
    position: relative;
    flex-shrink: 1;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    &-tabs{
      flex-shrink: 0;
      flex-grow: 0;
      border-bottom: 1px solid #e8e8e8;
      box-sizing: border-box;
      color: #606060;
      display: flex;
      font-variant: tabular-nums;
      overflow: hidden;
      position: relative;

      &-container{

        align-items: center;
        display: flex;
        flex: 1;
        flex-wrap: nowrap;
        overflow: hidden;

        .@{ns}-Record-tabs-item{
          box-shadow: inset 0 -3px 0 0 #0000;
          border-left: 10px solid #0000;
          height: 30px;
          line-height: 30px;
          padding: 0 5px;
          font-size: 12px;
          cursor: pointer;

          &-label{
            max-width: 120px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }

          &__active{
            box-shadow: inset 0 -3px 0 0 var(--primary-onActive);
            color: var(--primary-color);
          }
        }
      }
    }
    &-tabs-placeholder{
      height: @size-3;
      flex-shrink: 0;
    }

    &-content{
      flex-shrink: 1;
      flex-grow: 1;
      overflow-y: auto;
      overflow-x: hidden;
      flex-direction: column;
      display: flex;
      padding: 10px 10px 30px;
      margin-bottom: 42px;
      &.hidefooter{
        margin-bottom: 0;
      }
      // 评论 变更记录
      .@{ns}-Record-message {
        display: flex;

        &-icon{
          flex: 0 0 auto;
          margin: 10px 0;
          width: 30px;
        }

        &-member-avatar{
          width: 16px;
          height: 16px;
          border-radius: 16px;
          display: inline-block;
          vertical-align: middle;
          line-height: 1;
          overflow: hidden;
          img{
            display: inline-block;
            height: 100%;
            width: 100%;
          }
          svg{
            color: #909090;
          }
        }


        &-info{
          min-width: 0;
          flex: 1;
          margin: 10px 0;
          font-size: 12px;
          color: #303030;
        }

        &-user{
          font-size: 12px;
          font-weight: 500;
        }

        &-diff{
          display: inline;
          line-height: 1.5;
          color: #909090;

          &-link{
            text-decoration: underline; 
            cursor: pointer;
            user-select: none;
            &:hover{
              svg{
                color: var(--primary-5);
              }
              color: var(--primary-5);
            }
            &:active{
              svg{
                color: var(--primary-7);
              }
              color: var(--primary-7);
            }
          }

          .diff-remove{
            color: #ea0d0d;
            text-decoration: line-through;
            text-decoration-color: #ea0d0d;
            background-color: rgba(234,13,13,.1);
            vertical-align: middle;
            margin: 0 5px;
          }
          .diff-add{
            color: #24b47e;
            background-color: rgba(36,180,126,.1);
            margin-right: 10px;
            vertical-align: middle;
            margin: 0 5px;
          }
          svg{
            width: 10px;
            height: 10px;
            margin: 0 5px;
            color: #909090;
            margin: 0;
          }
        }

        &-content{
          display: inline;
          word-break: break-all;
          line-height: 1.5;

          &-text{
            white-space: pre-wrap;
          }
        }

        &-quote{
          border-left: solid 3px #909090;
          background: var(--color-fill-2);
          padding: 9px;
          margin: 5px 0;
          color: #606060;
          overflow: hidden;
          font-size: 12px;

          & > span{
            display: inline-block;
          }

          &-author{
            font-weight: 500;
          }
          &-text{
            padding-right: 5px;
            line-height: 18px;
            font-size: 12px;
            word-break: break-all;
            white-space: pre-wrap;
            margin-right: 5px;
          }
        }

        .is-deleted{
          color: #909090 !important;
        }

        &-footer{
          position: relative;
          margin-top: 5px;
        }

        &-time{
          font-size: 12px;
          cursor: default;
          display: inline-block;
          color: #909090;
        }

        &-action{
          display: inline-block;
          float: right;
          opacity: 0;
          color: #606060;

          &>span{
            padding: 0 10px;
            position: relative;
            cursor: pointer;
            &:not(:last-child){
              &::after{
                content: "";
                display: inline-block;
                position: absolute;
                right: 0;
                top: 3px;
                width: 1px;
                height: 12px;
                background: #dedede;
              }
            }
            &:hover{
              color: var(--primary-onHover);
            }
          }
        }

        &-update-time{
          position: absolute;
          display: inline-block;
          color: #909090;
          right: 0;
        }

        &:hover{
          .@{ns}-Record-message-action{
            opacity: 1;
          }
        }
      }

      // 图片
      .news-fileimg {
        margin: 5px;
        width: 68px;
        height: 68px;
        position: relative;

        .fileimg-hover {
          text-align: center;
          line-height: 68px;
          display: none;
          transition: 0.3;
        }

        &:hover .fileimg-hover {
          display: block;
          position: absolute;
          top: 0;
          bottom: 0;
          left: 0;
          right: 0;
          background: rgba(0, 0, 0, 0.2);
          color: #fff;
          cursor: pointer;
        }

        >img {
          width: 100%;
          height: 100%;
        }
      }

      // 附件
      .news-fileBox {
        position: relative;
        display: flex;
        padding: 7px;
        height: 54px;
        border-radius: 5px;
        background: var(--color-fill-2);
        align-items: center;

        .file-icon {
          display: inline-block;
          font-size: 31px;
          color: #C2C2C2;
          margin-right: 14px;
        }

        .news-filehover {
          position: absolute;
          right: 0px;
          border-radius: 30% 0 0 30%;
          top: 0;
          bottom: 0;
          right: 0px;
          width: 30px;
          display: flex;
          align-items: center;
          transition: .5s;
          visibility: collapse;

          >span {
            position: absolute;
            display: inline-block;
            border-bottom: 5px;
            right: 20px;
            height: 30px;
            width: 30px;
            border-radius: 2px;
            background: #fff;
            line-height: 30px;
            text-align: center;
            cursor: pointer;
            color: #909090;
            &:hover {
              color: #1890ff;
            }
          }
        }

        &:hover .news-filehover {
          right: 0px;
          visibility: visible;
          transition-timing-function: ease;
          background: #5e5e5e20;
          border-radius: 5px;
          width: 100%;
        }
      }

    }
  }



  &-nodata {
    height: 100px;
    line-height: 100px;
    text-align: center;
    color: #888;
  }

  &-foot {
    position: fixed;
    width: 100%;
    bottom: 0;
    flex: 0 0 auto;
    background-color: #fff;

    &-reply {
      position: relative;
      display: flex;
      margin: 5px 0;
      padding: 10px 10px;
      background: var(--color-fill-2);
      justify-content: space-between;

      &::before {
        position: absolute;
        top: 0px;
        bottom: 0px;
        left: 0px;
        content: '';
        display: block;
        height: 100%;
        width: 2px;
        background: #888;
      }

      >div:last-child {
        cursor: pointer;
      }
    }


    &-entry {
      display: flex;
      flex-wrap: wrap;
      border: 1px solid #efefef;
      box-shadow: 0 -2px 4px 0 rgba(0, 0, 0, .05);

      &-textarea {
        width: 100%;
        padding: 10px;

        textarea {
          display: block;
          width: 100%;
          border: 1px solid transparent;
          outline: none
        }

        & div {
          display: flex;
          justify-content: flex-end;
          align-items: center;

          span {
            margin: 0 10px;
            cursor: pointer;

            &:hover {
              color: #1890ff;
            }
          }
        }

      }

      &-none {
        width: 100%;
        display: flex;
        justify-content: space-between;
        padding: 0px 10px;

        &>span{
          padding: 10px;
          display: block;
          color: #888;
          width: 80%;
        }
      }

      &-static{
        opacity: .7;
        cursor: not-allowed;
      }
    }
  }
}

