/**
 * @author pei-qiao.peng 
 * @date   2015/1/15.
 * @email  ppq1991@gmail.com
 * @github https://github.com/ppq1991/
 * @blog   http://pengpeiqiao.tk/
 */

@font-default: \5FAE\8F6F\96C5\9ED1;
@font-size-base: 12px;
@color-default: #000;
@line-height-base: 24px;
@drag-offset: 30px;
@drag-line-height: 40px;
@drag-ico-width: 20px;
@drag-ico-height: 22px;
@drag-toggle-width: 22px;
@drag-toggle-height: 36px;
@flower-size: 40px;
@flower-margin: 15px;
@flower-text-size: 18px;
@color-li-height: 14px;
@color-li-width: 45px;

body {
  -webkit-user-select: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #F2F2F2;
  font-family: @font-default;
  font-size: @font-size-base;
}

p {
  margin: 0 5px;
  padding: 0;
}

.drag {
  position: absolute;
  top: 0;
  right: 0;
  > div {
    -webkit-transition: all .5s;
    position: absolute;
    top: -@drag-offset;
    width: @drag-ico-width;
    &.active {
      top: 0;
    }
    &:before {
      content: '';
      position: absolute;
      top: 0;
      left: @drag-ico-width / 2;
      height: @drag-line-height + 5;
      width: 1px;
      background-color: #52abff;
    }
    > div {
      position: absolute;
      top: @drag-line-height;
      background-position: center 0;
      background-repeat: no-repeat;
      width: @drag-ico-width;
      cursor: pointer;
      &:hover {
        background-position: center -@drag-ico-height;
      }
      &:active {
        background-position: center -@drag-ico-height * 2;
      }
    }
  }
}

#drag-post {
  right: 80px;
  > div {
    background-image: url('../../../../images/chat/drag/sound.png');
    height: 22px;
  }
}

#drag-mic {
  right: 45px;
  > div {
    background-image: url('../../../../images/chat/drag/user.png');
    height: 22px;
  }
}

#drag-toggle {
  width: @drag-toggle-width !important;
  right: 10px;
  > div {
    background-image: url('../../../../images/chat/drag/arrow-up.png');
    width: @drag-toggle-width !important;
    height: @drag-toggle-height;
    &:hover {
      background-position: center -@drag-toggle-height;
    }
    &:active {
      background-position: center -@drag-toggle-height * 2;
    }
  }
  &:before {
    left: @drag-toggle-width / 2 !important;
  }
  &.down {
    > div {
      background-image: url('../../../../images/chat/drag/arrow-down.png');
    }
  }
}

#input-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #E8E8E8;
}

#input-tools {
  position: relative;
  height: 30px;
  > div {
    position: absolute;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: 0 0;
  }
}

#input-box {
  margin: 5px 10px;
  height: 30px;
}

#btn-send {
  cursor: pointer;
  position: absolute;
  bottom: 5px;
  right: 10px;
  width: 50px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  color: #ffffff;
  background-color: #00A2FF;
  &:hover {
    background-color: #2EB0FB;
  }
  &:active {
    background-color: #038EDE;
  }
  &.disabled, &.disabled:hover, &.disabled:active {
    cursor: default;
    background-color: #ACADAE;
  }
}

#btn-emoji {
  top: 5px;
  left: 10px;
  width: 22px;
  height: 21px;
  background-image: url('../../../../images/chat/expression.png');
  &:hover {
    background-position: 0 -21px;
  }
  &:active {
    background-position: 0 -42px;
  }
}

#btn-clear {
  top: 7px;
  left: 40px;
  margin-left: 5px;
  width: 22px;
  height: 18px;
  background-image: url('../../../../images/chat/trash.png');
  &:hover {
    background-position: 0 -18px;
  }
  &:active {
    background-position: 0 -36px;
  }
}

#btn-hint {
  top: 3px;
  right: 10px;
  width: 19px;
  height: 24px;
  background-image: url('../../../../images/chat/tips.png');
  &:hover {
    background-image: url('../../../../images/chat/tips2.png');
    > span {
      display: block;
    }
  }
  > span {
    display: none;
    width: 152px;
    position: absolute;
    bottom: 24px;
    right: 19px;
    border: 1px solid #61838F;
    padding: 3px 5px;
    box-shadow: 2px 2px 3px #61838F;
    border-radius: 3px;
    background-color: #FFF;
    -webkit-transition: width .5s;
  }
}

#flower-container {
  cursor: pointer;
  position: absolute;
  right: @flower-margin;
  top: -(@flower-size + @flower-margin);
  width: @flower-size;
  height: @flower-size;
  background-color: rgba(178, 178, 178, 0.6);
  background-image: url("../../../../images/chat/rose-40x40.png");
  border-radius: 5px;
  &:hover {
    background-color: rgba(178, 178, 178, 0.8);
    #flower-tip {
      display: block;
    }
  }
}

#flower-text {
  position: absolute;
  top: -(@flower-text-size / 2) + 2;
  right: -(@flower-text-size / 2) + 2;
  width: @flower-text-size;
  height: @flower-text-size;
  background-color: #E50606;
  border-radius: @flower-text-size / 2;
  color: #ffffff;
  text-align: center;
}

#flower-tip {
  display: none;
  width: 165px;
  position: absolute;
  bottom: @flower-size;
  right: @flower-size;
  border: 1px solid #61838F;
  padding: 3px 5px;
  box-shadow: 2px 2px 3px #61838F;
  border-radius: 3px;
  background-color: #FFF;
  -webkit-transition: width .5s;
  span {
    color: #ff3f4e;
  }
  p {
    margin: 0;
    padding: 0;
  }
}

#input-style {
  display: none;
  cursor: default !important;
  top: -202px;
  left: 0;
  width: 300px;
  height: 200px;
  border: 1px solid #969696;
  background-color: #F6F6F6;
}

#input-style-btns {
  position: absolute;
  left: 5px;
  top: 5px;
  width: 290px;
  height: 20px;
  > div {
    float: left;
    background-repeat: no-repeat;
    width: 20px;
    height: 19px;
    cursor: pointer;
  }
}

#style-color {
  margin-right: 10px;
  background-position: 0 0;
  background-image: url('../../../../images/chat/color.jpg');
  &:hover {
    background-position: 0 -38px;
  }
  &:active {
    background-position: 0 -19px;
  }
  &.disabled {
    background-position: 0 -57px;
  }
}

#style-b {
  background-image: url('../../../../images/chat/font.jpg');
  background-position: 0 0;
  &:hover {
    background-position: 0 -19px;
  }
  &:active, &.active {
    background-position: 0 -38px;
  }
  &.disabled {
    background-position: 0 -57px;
  }
}

#style-i {
  background-image: url('../../../../images/chat/font.jpg');
  background-position: center 0;
  &:hover {
    background-position: center -19px;
  }
  &:active, &.active {
    background-position: center -38px;
  }
  &.disabled {
    background-position: center -57px;
  }
}

#style-u {
  background-image: url('../../../../images/chat/font.jpg');
  background-position: right 0;
  &:hover {
    background-position: right -19px;
  }
  &:active, &.active {
    background-position: right -38px;
  }
  &.disabled {
    background-position: right -57px;
  }
}

#style-color-list {
  display: none;
  position: absolute;
  left: 5px;
  top: 30px;
  width: @color-li-width + 2;
  height: (@color-li-height + 2) * 9;
  padding: 1px;
  margin: 0;
  border: 1px solid #60BDC0;
  background-color: #FFF;
  > li {
    cursor: pointer;
    width: @color-li-width;
    height: @color-li-height;
    list-style-type: none;
    border: 1px solid #fff;
    &:hover, &.active {
      border: 1px solid #60BDC0;
    }
  }
}

#emoji-box {
  position: absolute;
  left: 5px;
  top: 30px;
  border-collapse: collapse;
  border-spacing: 0;
  td {
    cursor: pointer;
    position: relative;
    border: 1px solid #D8DADB;
    width: 31px;
    height: 30px;
    padding: 0;
    background-color: #fff;
    text-align: center;
    &:hover {
      background-color: #AFF5F7;
    }
    > img {
      position: absolute;
      top: 1px;
      left: 1px;
    }
  }
}

.ac-chat {
  -webkit-user-select: initial;
  font-size: @font-size-base;
  color: @color-default;
  line-height: @line-height-base;
  overflow-x: hidden;
  overflow-y: auto;
  p {
    padding: 0 20px;
  }
  .line-style-1 {
    color: #666;
    background-position: -4px 0;
    background-repeat: no-repeat;
  }
  .line-style-2 {
    line-height: 24px;
    font-size: 14px;
    word-break: break-all;
    > img {
      width: 28px;
      height: 28px;
      margin: 0;
      vertical-align: text-bottom;
    }
  }
  .line-style-3 {
    display: -webkit-flex;
    line-height: 32px;
    margin: 2px 5px;
    background-position: -4px center;
    background-repeat: no-repeat;
    > em {
      margin-right: 5px;
    }
    > .img {
      background-repeat: no-repeat;
      background-position: center;
      width: 32px;
      height: 32px;
      display: inline-block;
      margin: 0 5px;
    }
  }
  .line-style-4 {
    position: relative;
    line-height: 24px;
    font-size: 14px;
    > img {
      width: 28px;
      height: 28px;
      margin: 0;
      vertical-align: text-bottom;
    }
    &:before {
      position: absolute;
      top: 11px;
      left: 5px;
      content: '';
      width: 4px;
      height: 4px;
      background-color: #A5A5A5;
      border-radius: 2px;
    }
  }
  .msg-sys-1 {
    background: url("../img/ico-sys-1.jpg") left 5px no-repeat;
  }

  .msg-sys-2 {
    background: url("../img/ico-sys-2.jpg") left 5px no-repeat;
  }
  .link-name {
    color: #0B5EE7;
    text-decoration: underline;
    cursor: pointer;
    font-style: normal;
    margin-right: 10px;
  }
}


::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  -webkit-border-radius: 10px;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  -webkit-border-radius: 10px;
  border-radius: 10px;
  background: rgba(210, 210, 210, 0.4);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(197, 197, 197, 0.6);
}
::-webkit-scrollbar-thumb:active{
  background: rgba(179, 179, 179, 0.8);
}