@import './_reset.mcss';
@import './iconfont.mcss';

.hz-m-wrap {
  $size = 24px;
  position: relative;
  /*overflow: hidden;*/
  .hz-u-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    user-select: none;
  }
  .hz-m-area {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    cursor: crosshair;
  }
  .hz-m-item {
    position: absolute;
    display: block;
    &:hover {
      .hz-m-bridge, .hz-m-info {
        display: block;
      }
    }
  }
  .hz-m-info {
    display: none;
    position: absolute;
    padding: 5px 10px;
    line-height: 20px;
    opacity: .8;
    color: #fff;
    z-index: 10;
    background-color: #000;
    cursor: default;
    user-select: none;
    white-space: nowrap;
    a {
      text-decoration: underline;
      cursor: pointer;
      color: #fff;
      word-break: break-word;
      white-space: normal;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      &:hover {
        text-decoration: underline;
      }
    }
  }
  .hz-m-link {
    color: #fff;
    &:hover {
      text-decoration: none;
    }
  }
  .hz-m-box {
    $color = #e31414;
    $settedColor = #373950;
    position: relative;
    width: 100%;
    height: 100%;
    box-shadow: 0 0 6px #000;
    background-color: $color;
    font-size: 12px;
    cursor: pointer;
    color: #fff;
    opacity: .8;
    & > li {
      position: absolute;
      text-align: center;
      user-select: none;
    }
    &.hz-z-hidden > li {
      display: none;
    }
    &.hz-m-hoverbox {
      &:hover {
        box-shadow: 0 0 0 2px $settedColor;
      }
      .hz-icon:hover {
        background-color: $settedColor;
      }
    }
    &.hz-m-settedbox {
      background-color: $settedColor;
      &.hz-m-hoverbox {
        &:hover {
          box-shadow: 0 0 0 2px $color;
        }
        .hz-icon:hover {
          background-color: $color;
        }
      }
    }
    .hz-icon {
      width: $size;
      height: $size;
      line-height: $size;
      font-size: 20px;
      text-align: center;
      &:hover {
        background-color: $color;
        opacity: 0.8;
      }
    }
    .hz-u-index {
      top: 0;
      left: 0;
      width: $size;
      height: $size;
      line-height: $size;
      background-color: #000;
    }
    .hz-u-tip {
      top: 50%;
      width: 100%;
      transform: translateY(-50%);
    }
    .hz-u-close {
      top: 0;
      right: 0;
    }
    .hz-m-btns {
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
    }
    .hz-m-copy {
      display: inline-block;
    }
    .hz-icon-edit, .hz-icon-copy {
      display: inline-block;
      border-radius: 2px;
      box-sizing: border-box;
      border: 1px solid rgba(255, 255, 255, .4);
    }
    .hz-small-icon {
      border: 0;
      border-radius: 0;
    }
    .hz-u-square {
      $squareSize = 8px;
      width: $squareSize;
      height: $squareSize;
      opacity: .8;
      &:after {
        content: '';
        position: absolute;
        top: $squareSize * .25;
        left: $squareSize * .25;
        width: $squareSize * .5;
        height: $squareSize * .5;
        border-radius: $squareSize * .5;
        background-color: #fff;
      }
    }
    .hz-u-square-tl {
      top: -4px;
      left: -4px;
      cursor: nw-resize;
    }
    .hz-u-square-tc {
      top: -4px;
      left: 50%;
      transform: translateX(-50%);
      cursor: n-resize;
    }
    .hz-u-square-tr {
      top: -4px;
      right: -4px;
      cursor: ne-resize;
    }
    .hz-u-square-cl {
      top: 50%;
      left: -4px;
      transform: translateY(-50%);
      cursor: w-resize;
    }
    .hz-u-square-cr {
      top: 50%;
      right: -4px;
      transform: translateY(-50%);
      cursor: w-resize;
    }
    .hz-u-square-bl {
      bottom: -4px;
      left: -4px;
      cursor: sw-resize;
    }
    .hz-u-square-bc {
      bottom: -4px;
      left: 50%;
      transform: translateX(-50%);
      cursor: s-resize;
    }
    .hz-u-square-br {
      bottom: -4px;
      right: -4px;
      cursor: se-resize;
    }
  }
  .hz-m-bridge {
    display: none;
    cursor: default;
    li {
      position: absolute;
      width: 36px;
      height: 36px;
      background: transparent;
    }
    .hz-u-bridge-tl {
      top: -18px;
      left: -18px;
    }
    .hz-u-bridge-tr {
      top: -18px;
      right: -18px;
    }
    .hz-u-bridge-bl {
      bottom: -18px;
      left: -18px;
    }
    .hz-u-bridge-br {
      bottom: -18px;
      right: -18px;
    }
  }
}

// 查看态时图片 hover 样式控制
.hz-m-view {
  .hz-m-area {
    cursor: default;
  }
  .hz-m-info a {
    text-decoration: none;
  }
}