@tool-bar-height : 40px;
@status-bar-height : 30px;
@side-bar-width : 290px;
@side-bar-row-height : 50px;
@side-bar-head-height : 40px;
@chrome-color: #dfdfdf;
@bar-icon-color: #909090;
@standard-blue: #3b99fc;
@highdpi: ~"(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)";
.at2x(@path, @w: auto, @h: auto) {
  background-image: url(@path);
  @at2x_path: ~`@{path}.replace(/\.\w+$/, function(match) { return "@2x" + match; })`;
  @media @highdpi {
    background-image: url("@{at2x_path}");
    background-size: @w @h;
  }
}
.font-hei() {
  font-family: "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif;
}

.font-kai() {
  font-family: Baskerville, Georgia, "Liberation Serif", "Kaiti SC", STKaiti, "AR PL UKai CN", "AR PL UKai HK", "AR PL UKai TW", "AR PL UKai TW MBE", "AR PL KaitiM GB", KaiTi, KaiTi_GB2312, "TW\-Kai", serif;
}

.font-song() {
  font-family: Georgia, "Nimbus Roman No9 L", "Songti SC", STSong, "AR PL New Sung", "AR PL SungtiL GB", NSimSun, SimSun, "TW\-Sung", "WenQuanYi Bitmap Song", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", serif;
}

.font-fang-song() {
  font-family: Baskerville, "Times New Roman", "Liberation Serif", STFangsong, FangSong, FangSong_GB2312, "CWTEX\-F", serif;
}

.font-ming() {
  font-family: Georgia, "Nimbus Roman No9 L", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", PMingLiU, MingLiU, serif;
}

.font-mono() {
  font-family: "ubuntu mono", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
}

html, body {
  .font-hei() !important;
  height: 100%;
  -webkit-user-select: none;
}

a[ng-click] {
  cursor: pointer;
}

.ng-cloak {
  display: none!important;
}

canvas {
  width: 400px;
  height: 400px;
  display: none!important;
}
.notify-box {
  float: left;
  position: absolute;
  z-index: 5;
  text-align: center;
  width: 100%;
  display: inline-block;
  opacity: 1;
  top: @tool-bar-height - 100;
  height: 40px;
  .message-box {
    @border-radius: 5px;
    display: inline-block;
    height: 40px;
    line-height: 40px;
    background-color: #d6d6d6;
    border-radius: @border-radius;

    .logo {
      display: inline-block;
      width: 40px;
    }
    .message {
      display: inline-block;
      margin-right: 16px;

    }
    .link {
      display: inline-block;
    }
    .btn-close {
      display: inline-block;
      width: 26px;
      margin-left: 16px;
      margin-right: 0;
      background-color: @standard-blue;
      border-top-right-radius: @border-radius;
      border-bottom-right-radius: @border-radius;
      color: white;
    }
  }
}

.notify-animation {
  display: inline-block;
  opacity: 0;
  -webkit-animation-name: notify;
  -webkit-animation-duration: 2s;
  -webkit-animation-timing-function: ease-in;
}

@-webkit-keyframes notify {
  @final-top: @tool-bar-height + 10;
  0% {
    opacity: 1;
  }
  10% {
    top: @final-top;
    opacity: 1;
  }
  80% {
    top: @final-top;
    opacity: 1;
  }
  100% {
    top: @final-top;
    opacity: 0;
  }
}

button.btn.btn-default {
  outline: none !important;
  &:hover, &:focus {
    outline: none !important;
  }
}

.tool-bar {
  z-index: 10;
}

.tool-bar {
  .btn-open, .btn-clean {
    padding: 0;
    width: 36px;
    height: 36px;
    outline: none;
    border: none;
    color: @bar-icon-color;
    background-size: contain !important;
    margin: 0 6px;
  }
  .btn-open {
    background: url(../img/open.png) no-repeat center center;
    &:hover {
      background: url(../img/open_hover.png) no-repeat;
    }
  }
  .btn-clean {
    background: url(../img/remove.png) no-repeat center center;
    &:hover {
      background: url(../img/remove_hover.png) no-repeat;
    }
  }
  .btn-group {
    .btn {
      border-radius: 2px;
    }
  }
}

.solid-border-top-bottom {
  border-top: 1px solid #4d4d4d;
}

// global end ==================================

.tool-bar {
  position: absolute;
  top: 0;
  width: 100%;
  height: @tool-bar-height;
  background-color: @chrome-color;
  padding: 3px 0 0 13px;

  .tool-right {
    float: right;
    margin-top: 10px;
    margin-right: 20px;
    font-size: 12px;
    span {
      color: #8e8e8e;
      margin-right: 8px;
    }
    .separator {
      display: inline-block;
      width: 1px;
      height: 10px;
      background-color: #a4a4a4;
      margin: auto 5px;
    }
    a {
      color: @standard-blue;
      text-decoration: none;
      &:hover {
        color: @standard-blue;
        text-decoration: none;
      }
    }
  }
}

// .tool-bar end ==============================================

.main {
  -webkit-user-select: none;
  height: 100%;
  padding-top: @tool-bar-height;
  background-color: #262626;
}

.drop-view {
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  .drop-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 500px;
    height: 400px;
    border-radius: 20px;
    border: 2px dashed #2d2d2d;
    background: #0b0b0b;
    p:nth-of-type(1) {
      font-size: 19pt;
      color: rgba(192, 192, 192, 0.8)
    }
    p:nth-of-type(2) {
      font-size: 13pt;
      color: rgba(192, 192, 192, 0.4)
    }
  }
}

.file-list-view {
  height: 100%;

  .main-view {
    height: 100%;
    width: 100%;
    padding-right: @side-bar-width;
    padding-bottom: @side-bar-head-height;
  }
  .status-bar {
    overflow: hidden;
    position: relative;
    margin-top: -@status-bar-height;
    padding: 0 10px;
    height: @status-bar-height;
    background-color: #2b2b2b;
    .text {
      display: block;
      line-height: @status-bar-height;
      font-size: 12px;
      text-align: center;
      color: rgba(255, 255, 255, 0.86);
      font-weight: 100;
    }
  }
  .top-bar {
    height: @side-bar-head-height;
    background-color: #151515;
    border-bottom: 1px solid #313131;
    position: relative;
    @font-color: #ebebeb;
    color: @font-color;

    .diff-tool, .list-tool {
      width: 100%;
      height: 100%;
    }
    .tool-left, .tool-right {
      line-height: @side-bar-head-height;
      position: absolute;
      height: 100%;
    }
    .tool-left {
      left: 25px;
    }
    .tool-right {
      right: 10px;
    }
    .tool-center {
      display: flex;
      width: 100%;
      height: 100%;
      align-items: center;
      justify-content: center;
    }
    .diff-tool .tool-left{
      .left-info {
        color: #707070;
        font-size: 12px;
      }
    }
    .diff-tool .tool-center {
      .button-group {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-left: 25px;
        margin-right: 25px;
        @border-radius: 10px;
        .btn-left {
          border-top-left-radius: @border-radius;
          border-bottom-left-radius: @border-radius;
          border-top-right-radius: 0 !important;
          border-bottom-right-radius: 0 !important;
          z-index: 1;
        }
        .btn-right {
          z-index: 0;
          margin-left: -1px;
          border-top-right-radius: @border-radius;
          border-bottom-right-radius: @border-radius;
          border-top-left-radius: 0 !important;
          border-bottom-left-radius: 0 !important;
          &:hover {
            z-index: 2;
          }
        }
      }

      .btn.btn-default {
        height: 20px;
        padding: 0 12px 0 12px;

        border: 1px solid #5b5b5b;
        border-radius: @border-radius;
        background: linear-gradient(to bottom, #4b4b4b, #000000);
        text-shadow: none;
        box-shadow: none;
        outline: none !important;
        color: #d2d2d2;
        font-size: 10px;

        i {
          margin-right: 6px;
          font-size: 10px;
        }
        &.active:hover {
          border-color: #5b5b5b;
          color: #d2d2d2;
          background: linear-gradient(to bottom, #000000, #4b4b4b);
        }
        &:hover {
          color: #ffffff;
          border-color: #a1a1a1;
          background: linear-gradient(to bottom, #4b4b4b, #000000);
        }
      }
    }
  }
  .canvas {
    height: 100%;
    width: 100%;
    padding: 10px 10px @status-bar-height + 10 10px;
    overflow-y: scroll;
    position: relative;
    background: url(../img/noise.png) repeat;
    background-size: 40px 40px;
  }

  ::-webkit-scrollbar {
    width: 12px;
    background: #1f1f1f;
  }

  ::-webkit-scrollbar-thumb {
    background: #0f0f0f;
    -webkit-border-radius: 100px;
  }

  .tool-compare {
  }
  .tool-zoom {
  }

  @slider-bar-width: 200px;
  .slider-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    width: @slider-bar-width;
    height: 100%;

    input[type=range] {
      float: left;
      width: 130px;
      margin: 0 6px 0 6px;
      outline: none !important;
      background: none;

      -webkit-appearance: none;

    }
    input[type=range]:focus {
      outline: none;
    }
    input[type=range]::-webkit-slider-runnable-track {
      width: 100%;
      height: 6px;
      box-shadow: 0 0 0 #000000, 0 0 0 #0d0d0d;
      cursor: pointer;
      background: @standard-blue;
      border-radius: 6.7px;
      //      margin-top: 5px;
    }
    input[type=range]::-webkit-slider-thumb {
      box-shadow: 0.9px 0.9px 3.7px #909090, 0 0 0.9px #9d9d9d;
      border: 0.5px solid #909090;
      height: 16px;
      width: 16px;
      border-radius: 30px;
      background: #ffffff;
      -webkit-appearance: none;
      margin-top: -5px;
    }
    input[type=range]:focus::-webkit-slider-runnable-track {
      background: #54a6fc;
    }

    a {
      float: left;
      color: #272727;
      border: 1px solid #707070;
      border-radius: 2px;
      &.zoom-out {
        width: 15px;
        height: 12px;
        //        margin-top: 2px;
      }
      &.zoom-in {
        width: 20px;
        height: 16px;
      }
    }
  }

  .bg-switcher {
    a {
      display: inline-block;
      height: 15px;
      width: 20px;
      border: 1px solid #aeaeae;
      margin-right: 8px;
      border-radius: 2px;

      &.active, &:hover {
        border: 2px solid #008bf5;
      }

      &.bg-transparent {
        background: url("../img/bg-transparent.png");
        background-size: contain;
      }
      &.bg-dark {
        background-color: #333;
      }
      &.bg-white {
        background-color: #ffffff;
      }
    }
  }
  .canvas.diff-view {
    overflow: hidden;
  }
  .canvas .diff-box {
    position: absolute;
    .ori-box{
      position: absolute;
      left: 0;
      top: 0;
      border-right:2px solid rgba(0,0,0,0.7);
      overflow: hidden;
      cursor: move;
    }
    .cur-box {
      cursor: move;
    }
    &.move-mode img {
      cursor: move;
      &.cur {
//        cursor: move;
      }

      &.ori {
//        cursor: move;
      }
    }

  }
  .diff-zoom-info {
    @width: 220px;
    width: @width;
    height: 50px;
    line-height: 50px;
    display: none;

    position: fixed;
    top: 350px;
    left: 50%;
    margin-left: -(@side-bar-width + @width) / 2;
    text-align: center;

    color: white;
    background-color: rgba(0, 0, 0, 0.3);

    border-radius: 30px;
    font-size: 20px;
    z-index: 99;
  }

  .diff-zoom-info-animation {
    display: inline-block;
    opacity: 0;
    pointer-events: none;
    -webkit-animation-name: zoom-info;
    -webkit-animation-duration: 2s;
    -webkit-animation-timing-function: ease-in;
  }

  @-webkit-keyframes zoom-info {
    0% {
      opacity: 1;
    }
    10% {
      opacity: 1;
    }
    80% {
      opacity: 1;
    }
    100% {
      opacity: 0;
    }
  }

  .file-box {
    @image-background-width: 100px;
    @image-background-height: 100px;

    float: left;
    width: 102px;
    height: 150px;
    margin: 15px 20px;
    text-align: center;
    position: relative;
    .badge {
      position: absolute;
      left: 2px;
      top: 2px;
      padding: 2px;
      background: #272727;
      font-weight: normal;
      display: none;

      &.compress-larger {
        display: block;
        .icon {
          background: url("../img/face.svg") no-repeat;
          background-size: contain;
          svg, span {
            display: none;
          }
        }
      }

      &.compressed {
        display: block;
      }

      .icon {
        float: left;
        border-radius: 100px;
        @pieWidth: 16px;
        @pieHeight: 16px;
        width: @pieWidth;
        height: @pieHeight;
        svg {
          width: @pieWidth;
          height: @pieHeight;
        }
        .pie {
          fill: #66af22;
        }
      }

      span {
        display: none;
        margin-left: 5px;
        margin-top: 3px;
        margin-right: 8px;
        font-size: 12px;
        font-weight: 200;
        &.compress-rate {
          i {
            padding-right: 2px;
          }
          color: #66af22;
        }
      }
    }

    .image-box {
      border-radius: 5px;
      width: @image-background-width;
      height: @image-background-height;
      background-color: #373737;
      position: relative;
      .mask {
        width: 100%;
        height: 100%;
        position: absolute;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        background-color: rgba(12, 12, 12, 0.6);
        border-radius: 5px;
        .icon {
          width: 48px;
          height: 48px;
          .icon-outer {
            border: 3px solid white;
            border-radius: 100px;
            width: 100%;
            height: 100%;
            padding: 2px;
            .icon-inner {
              width: 100%;
              height: 100%;
              position: relative;
              svg {
                width: 100%;
                height: 100%;
                position: absolute;
                left: 0;
                path {
                  fill: white;
                }
              }
            }
          }
          .limit, .compressing, .error, .waiting {
            width: 100%;
            height: 100%;
          }
          .limit, .error, .waiting {
            .icon-inner {
              background-repeat: no-repeat;
              background-size: contain;
            }
            svg {
              display: none;
            }
          }
          .limit .icon-inner {
            background-image: url("../img/lock.svg");
          }
          .error .icon-inner {
            background-image: url("../img/error.svg");
          }
          .waiting .icon-inner {
            background-image: url("../img/waiting.svg");
          }

        }
        .text {
          margin-top: 10px;
          font-size: 12px;
          font-weight: 100;

          color: white;
        }
      }
      .img {
        width: 100%;
        height: 100%;
      }
      img {
        max-width: @image-background-height - 15px;
        max-height: @image-background-width - 15px;
      }
    }

    .name {
      max-width: 100%;
      display: inline-block;
      padding: 3px 14px;
      margin-top: 8px;
      border-radius: 100px;
      line-height: 16px;
      color: #ffffff;
      font-size: 14px;
      font-weight: 200;
      user-select: none;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .info {
      font-size: 7pt;
      color: #9b9b9b;
      .fa-long-arrow-right {
        padding: 0 5px;
      }
    }

    &.active, &:hover {
      .badge.compressed {
        span {
          display: inline-block;
        }
      }
      .name {
        background-color: @standard-blue;
      }
    }
    &:hover {
      .image-box {
        box-shadow: 0 0 0 1px #666;
      }
    }
    &.active {
      .image-box {
        box-shadow: 0 0 1px 2px @standard-blue;
      }
    }
  }

  // .file-list-view end ------------------------------------------------

  .side-bar {
    position: relative;
    width: @side-bar-width;
    overflow: hidden;
    height: 100%;
    float: right;
    background-color: #272727;
    text-align: center;
    .about-background {
      position: absolute;
      bottom: 0;
      width: 100%;
      height: @status-bar-height;
      background-color: #363636;
    }
    .header {
      line-height: @side-bar-head-height;
      height: @side-bar-head-height;
      font-size: 14px;
      color: white;
      text-overflow: ellipsis;
      white-space: nowrap;
      //      background: linear-gradient(to bottom, #434343, #353535);
    }

    table {
      width: 100%;

      tr {
        width: 100%;
        font-size: 12px;
        color: #9b9b9b;
        vertical-align: top;
        &:nth-of-type(odd) {
          background-color: #474747;
        }
      }

      .icon {
        width: 30px;
        line-height: @side-bar-row-height;
        font-size: 14px;
      }

      .side-bar-label {
        width: 80px;
        line-height: @side-bar-row-height;
        text-align: left;
        word-break: break-all;
      }
      .detail {
        text-align: left;
        line-height: 18px;
        word-break: break-all;
        color: #eaeaea;
        padding-top: 15px;
        .directory {
          width: 140px;
        }
        .reveal {
          float: right;
          width: 20px;
          height: 20px;
          margin-right: 10px;
          background-size: contain !important;
          background: url(../img/slider_bar_reveal.png) no-repeat center center;
          &:hover {
            background: url(../img/slider_bar_reveal_hover.png) no-repeat center center;
          }
        }
      }
    }

    .icon-buttons {
      margin-top: 10px;
      padding: 0 12px;
      a {
        display: inline-block;
        padding: 0 0 0 26px;
        line-height: 20px;
        font-size: 13px;
        color: #979797;
        text-decoration: none;
        margin: 0 10px;
        background-repeat: no-repeat;

        &:hover, &:focus {
          text-decoration: none;
          color: #fdfdfd;
        }
        &.compress {
          .at2x('../img/compress_normal.png', 20px, 20px);
          &:hover, &:focus {
            .at2x('../img/compress_hover.png', 20px, 20px);
          }
        }
        &.restore {
          .at2x('../img/restore_normal.png', 20px, 20px);
          &:hover, &:focus {
            .at2x('../img/restore_hover.png', 20px, 20px);
          }
        }
      }
    }
    .buttons {
      line-height: 48px;
      padding: 0 12px;
      margin-top: 30px;
      .btn {
        padding: 0 15px;
        margin: 0 -15px;
        width: 150px;
        height: 36px;
        line-height: 24px;
        border: none;
        border-radius: 100px;
        text-align: center;
        font-size: 12px;

        &:focus {
          outline: none !important;
        }

        &.btn-primary {
          background-color: #3b8bfa;

          &:hover {
            background-color: lighten(#3b8bfa, 5%);
          }
        }

        &.btn-warning {
          background-color: #ffd634;
          color: #75580c;

          &:hover {
            background-color: lighten(#ffd634, 9%);
          }
        }
      }
    }
  }
}

// .main end ==============================================
.about {
  position: fixed;
  right: 16px;
  bottom: 6px;

  button {
    padding: 0;
    background: none;
    border: none;
    outline: none;
    color: @bar-icon-color;
    i {
      position: absolute;
      top: 2px;
      font-size: 16px;
    }
    span {
      margin-left: 18px;
      font-size: 11px;
    }
    &:hover {
      color: lighten(@bar-icon-color, 10%);
    }
  }
}

// about-view

@font-size-default: 12px;
@border-radius: 12px;
@body-padding: 0px;

.modal, .modal-dialog, .modal-content, .modal-body {
  background-color: transparent !important;
  border-radius: @border-radius !important;

}

.modal-dialog {
  width: 300px !important;
  height: 457px !important;
  margin-left: 150px;
}

.modal-content {
  width: 100%;
  height: 100%;
  margin-top: 50%;
  .modal-body {
    padding: 0;
    width: 100%;
    height: 100%;
    -webkit-box-shadow: 0 0 13px 3px rgba(0, 0, 0, 0.5);

    .close-button {
      position: absolute;
      top: -17px;
      right: -16px;
      width: 32px;
      height: 32px;
      .at2x('../img/about_btn_close.png', 32px, 32px);
      cursor: pointer;

    }
    .upper, .lower {
      -webkit-user-select: none;
    }

    .upper {
      width: 100%;
      height: 50%;
      text-align: center;
      background-color: #eab20c;
      border-top-left-radius: @border-radius;
      border-top-right-radius: @border-radius;
      img, video {
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        margin-top: 18px;
        max-height: 230px;
        max-width: 205px;
      }
    }

    .lower {
      width: 100%;
      height: 50%;
      background-color: #283036;
      color: white;
      border-bottom-left-radius: @border-radius;
      border-bottom-right-radius: @border-radius;
      text-align: left;
      .btn.btn-default {
        font-size: @font-size-default;
        color: #876911;
        background: #ffd633;
        width: 102px;
        height: 25px;
        border-radius: 30px;
        line-height: 25px;
        padding: 0;

        border: none;
        text-shadow: none;
        box-shadow: none;

      }

      .about-panel {
        width: 100%;
        height: 100%;
        @padding: 18px;
        padding: @padding;

        .introduction {
          word-break: break-all;
          padding: 20 - @padding;
          font-size: @font-size-default;
        }
        .foot-box {
          position: absolute;
          left: 0;
          bottom: 18px + @body-padding;
          width: 100%;
          padding-left: 20  + @body-padding;
          padding-right: 20  + @body-padding;
          .ver-line {
            font-size: @font-size-default;
            @space: 10px;

            span {
              color: #dfdfdf;
            }

            .mid-separator {
              margin-left: @space;
              color: #49545d;
            }

            a {
              margin-left: @space;
              color: #3b8bf9;
            }
          }

          .login-line {
            margin-top: 25px;
            @login-padding: 40 - @padding;
            bottom: 0;

            .btn.btn-default {
              margin-left: @login-padding;
            }
          }

          .logged-line {
            margin-top: 25px;
            @login-padding: 40 - @padding;
            bottom: 0;
            width: 100%;
            text-align: center;
            .logged-box {
              display: inline-block;
              height: 25px;
              background-color: #1f252a;
              border-radius: 30px;
              @logo-width: 25px;
              .logo {
                display: inline-block;
                width: @logo-width;
                height: @logo-width;
                line-height: @logo-width;
                border-radius: 100px;
                background-color: #ffd633;
                margin-left: 12px;
                img {
                  max-width: @logo-width;
                  max-height: @logo-width;
                  padding: 3px;
                }
              }
              .email {
                display: inline-block;
                line-height: 25px;
                text-align: center;
                font-size: @font-size-default;
                margin-left: 18px;

              }

            }
          }

        }

      }

      .login-view {
        @padding: 18px;
        padding: @padding;
        text-align: center;
        font-size: @font-size-default;
        position: relative;
        height: 100%;

        input.form-control {
          text-align: center;
          display: inline-block;
          margin-bottom: 16px;
          width: 200px;
          height: 25px;
          border-radius: 30px;
          font-size: @font-size-default;
        }

        button {
          margin-top: 4px;
          margin-bottom: 15px;
        }

        a {
          color: white;
        }

        span.mid-separator {
          display: inline-block;
          margin: auto 10px;
          width: 1px;
          height: 9px;
          background-color: rgba(255, 255, 255, 0.3);
        }

        .foot-message {
          display: inline-block;
          padding: @body-padding;
          width: 100%;
          line-height: 34px;
          position: absolute;
          left: 0;
          bottom: 0;
          background-color: #242b31;
          color: #ef4343;
          font-weight: bold;
          border-bottom-left-radius: @border-radius;
          border-bottom-right-radius: @border-radius;
        }

      }

    }
  }

}

