@import "../../style/variables.less";
@import "../../style/mixins.less";

.table-container {
  -webkit-text-size-adjust: none; /*允许缩小至12px以下*/
  -ms-text-size-adjust: none;
  color: #333;

  .color-grey {
    color: #999!important;
  }
  .color-smoke {
    color: #CCC!important;
  }
  .color-blue {
    color: #0859AC!important;
  }

  .toolbar {
    padding: 8px 14px;
    background-color: #ebebeb;
  }

  .btn {
    font-weight: normal;
    &:hover { color: #333; }
  }

}

.table {
  width: 100%;
  table-layout: auto;



  th {
    background-color: #EBEBEB;
    font-weight: normal;
    padding: 7px 5px 6px;
    color: #999;
    border-bottom: 1px solid #e1e1e1;

    &:first-child {
      padding-left: 14px;
    }
    &:last-child {
      padding-right: 14px;
    }
    a {
      color: #999;
      &:hover {
        color: #666;
      }
      &.sort {
        color: #666;
        .iconfont {
          font-size: 10px;
          vertical-align: 2px;
        }
      }
    }
  }

  .no-data {
    th {
      color: #ccc;
      a{
        color: #ccc;
      }
    }
  }

  tbody {
    a {
      color: #333;
      &:hover { color: #0859AC; }
    }

    tr {
      td {
        border-bottom: 1px solid #e1e1e1;
        padding: 10px 5px 9px;

        &:first-child {
          padding-left: 14px;
        }
        &:last-child {
          padding-right: 14px;
        }
        &.sort {
          background-color: #ebebeb;
        }
        &.table-child-td {
          padding: 0 40px;
        }

        .operation {
          visibility: hidden;
          a {
            color: #0859AC;
          }
        }
      }
      &:hover td,
      &.hover td,
      &.current td {
        background-color: #ebebeb;
        .operation {
          visibility: visible;
          a {
            color: #0859AC;
          }
        }
      }
      &:hover td.table-child-td {
        background: none;
      }

      .operation-list {
        li {
          padding: 3px 0;
        }
      }

      &.none {
        .create-btn {
          padding-top: 15px;
          display: inline-block;
          position: relative;

          .icon-point-to {
            position: absolute;
            right: -26px;
            top: 0;
          }
        }
        td {
          height: 131px;
          font-size: 14px;
          text-align: center;
          color: #666;
          background: none;
        }

        &:hover td {
          background: none;
        }
      }

      &.selected {
        td {
          background-color: #f2f2f2;
        }
      }
    }
  }

  tfoot td {
    background-color: #f7f7f7;
    border-bottom: 1px solid #e1e1e1;
    padding: 0 14px;
    height: 38px;
  }

  td, th {
    &.left {
      text-align: left;
    }
    &.center {
      text-align: center;
    }
    &.right {
      text-align: right;
    }
  }

  .link {
    color: #555;
    :hover {
      color: #000;
    }
  }

  .url-overflow {
    width: 250px;
    overflow: hidden;
    display: block;
    white-space: nowrap;
  }


  /* 向下三角形小icon */
  .icon-horn,
  .icon-horn-tilt {
    display: inline-block;
    width: 0px;
    height: 0px;
    line-height: 0px;
    font-size: 0px;
    overflow: hidden;
    border-style: solid;
    border-width: 3px 3px 0 3px;
    border-color: #999 transparent transparent transparent;
    _border-color: #999 #FFFFFF #FFFFFF #FFFFFF;
  }
  /* 斜下三角形小icon */
  .icon-horn-tilt {
    border-width: 3px 3px 3px 3px;
    border-color: transparent #999 #999 transparent;
    _border-color: #FFFFFF #999 #999 #FFFFFF;
  }

  /*打开关闭按钮*/
  .icon-expend,
  .icon-collapse {
    width: 11px;
    display: inline-block;
    cursor: pointer;
    vertical-align: middle;
    height: 11px;
    font-size: 0;
    background: url(http://img01.taobaocdn.com/tps/i1/T1o0jIXkNhXXaSrQza-22-11.png) no-repeat;
  }

  .icon-expend {
    background-position: -11px 0;
  }
  /*.icon-expend-collapse {
    font-style: normal;
    border: 1px solid #777;
    display: inline-block;
    width: 9px;
    height: 9px;
    text-align: center;
    line-height: 9px;
    line-height: 8px\9;
    border-radius: 2px;
    box-shadow: 1px 1px 0 rgba(0,0,0,0.1);
    cursor: pointer;
    background: white;
    font-size: 10px;
    color: black;
    overflow: hidden;
    font-family: simsun;
  }

  :root .icon-expend-collapse {
    line-height: 10px\9;
  }*/
}

/* 用于在 table 标签之外实现 foot 的，这样就不用去计算 td 的 colspan 需要多少了  */
.table-foot {
  background-color: #f7f7f7;
  border-bottom: 1px solid #e1e1e1;
  padding: 5px 14px;
}

.table-settings {
  float: right;
  padding: 0 6px!important;
  .iconfont {
    color: #666;
  }
}

/*title*/
.table-title {
  margin-bottom: 40px;
  li {
    float: left;
    margin-right: 30px;
    &.selected {
      h2 {
        a {
          color: #333;
          font-size: 32px;
        }
      }
    }
  }
  h2 {
    margin: 0;
    a {
      color: #999;
    }
  }
}

.table-data {
  margin: -20px 0 35px 14px;
  .data-font {
    font-size: 18px;
    font-weight: bold;
  }
  li {
    float: left;
    width: 150px;
  }
}


.table-more {
  display: block;
  position: relative;
  zoom: 1;
  .icon-horn-tilt {
    position: absolute;
    right: 0;
    bottom: -5px;
  }

}

.table-namewrap {
  height: 18px;
  overflow: hidden;
  /*white-space: nowrap;*/
}



/* 子表格样式 */
.table-child {
  width: 100%;
  thead {
    th {
      border: 0;
      background: none;
      border-bottom: 1px dashed #e1e1e1;
    }
  }

  tbody {
    td {
      border: 0;

    }

    tr {
      td {
        background: none!important;
        border-bottom: 1px solid #e1e1e1;
      }

      &:hover {
        td {
          background: #EBEBEB!important;
        }

        .operation {
          visibility: visible!important;
        }
      }

      &:last-child {
        td {
          border-bottom: none;
        }
      }

      .operation {
        visibility: hidden!important;
        _visibility: visible;
      }
    }



  }

}

.table-info,
.table-change {
  position: absolute;
  /*width: 70px;*/
  left: -5px;
  top: -10px;
  padding: 10px 12px 8px;
  background-color: #FFF;
  border: 1px solid #ccc\9;
  text-align: left;
  display: none;
  line-height: 1.8;
  .border-radius(2px);
  .box-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
  border-collapse: separate;
  /*padding: 5px 0;*/
  /*left: 6px;*/
  width: 100px;
  p {
    margin: 0;
  }
  li {
    height: 25px;
    line-height: 25px;
    padding: 2px 9px;
    padding: 0px 7px 2px 8px\9;
    cursor: pointer;

    &:hover {
      background-color: #F0F0F0;
    }
    &.selected {
      cursor: default;
      .table-cur {
        display: block;
      }
    }
  }
}

.table-change {
  padding: 5px 0;
}

:root .table-info {
  border: none;
}

:root .table-change {
  border: none;
}

.table-handle,
.table-icon {
  width: 45px;
  margin: 0 auto;
  zoom: 1;
  height: 18px;
  line-height: 18px;
  position: relative;
  text-align: center;
}

/* 短图标时 */
.table-icon-short {
  width: 20px;
  float: left;
  margin:0 3px;
  display: inline;
  .table-info {
    left: 20px;
  }
}

.table-handle {
  .icon-horn {
    position: absolute;
    top: 8px;
    right: 0;
  }
}

.table-cur {
  color: #999;
  font-size: 10px;
  float: right;
  display: none;
}
