/**
 * 表格样式
 * @file common/css/esui/Table.less
 */

@table-background-color: #F6F7FB;
@table-border-color: #ECEFF8;

.ui-table {
    font-size: 12px;
    color: #333;

    table {
        table-layout: fixed;
        border-collapse: collapse;
    }
}

.ui-table-head {
    background: @table-background-color;
}

.ui-table-foot {
    background: @table-background-color;
}

.ui-table-head table,
.ui-table-body table,
.ui-table-foot table {
    border-width: 1px 0 1px 1px;
    border-color: #E5E5E5;
    border-style: solid;
}

.ui-table-body table,
.ui-table-foot table {
    border-width: 0 1px;
}

.ui-table-foot table {
    border-width: 0 1px 1px 0;
}

// 表头选择复选框、单选框
.ui-table-select-all,
.ui-table-multi-select,
.ui-table-single-select {
    margin: 0;
}

.ui-table-multi-select {
    float: left;
}

// 表头单元格DIV容器
.ui-table-hcell-text {
    height: 40px;
    line-height: 40px;
    overflow: hidden;
    padding: 0 16px;
    text-align: left;
    font-size: 14px;
    border-right: 1px solid #E5E5E5;
}

// 表尾单元格
.ui-table-fcell {
    border-right: 1px solid #E5E5E5;
}

// 表尾单元格DIV容器
.ui-table-fcell-text {
    height: 40px;
    line-height: 40px;
    overflow: hidden;
    padding: 0 16px;
    text-align: left;
    font-size: 14px;
}

// 表格内容单元格容器
.ui-table-cell-text,
.ui-table-body-nodata {
    line-height: 20px;
    overflow: hidden;
    padding: 10px 16px;
    text-align: left;
    color: #333;
}

.ui-table-cell-sel,
.ui-table-hcell-sel {
    padding: 0 0 0 16px;
    border-right: none;
}

.ui-table-scroll-x {
    height: 20px;
    overflow-x: scroll;
    overflow-y: hidden;
}

// 表头单元格提示
.ui-table-htip {
    margin: 0 4px 0 0;
}

// 表头单元格排序标识
.ui-table-hsort {
    position: relative;
    .inline-block();
    font-size: 14px;
    color: #666;
    top: 2px;
    line-height: 30px;
    font-family: "iconfont";
    &:before {
        content: "\e711";
    }
}

.ui-table-hcell-asc .ui-table-hsort {
    &:before {
        content: "\e713";
    }
}

.ui-table-hcell-desc .ui-table-hsort {
    &:before {
        content: "\e712";
    }
}

.ui-table-cell-align-left .ui-table-cell-text,
.ui-table-cell-align-left .ui-table-hcell-text {
    text-align: left;
}
.ui-table-cell-align-right .ui-table-cell-text,
.ui-table-cell-align-right .ui-table-hcell-text,
.ui-table-cell-align-right .ui-table-fcell-text {
    text-align: right;
}
.ui-table-cell-align-center .ui-table-cell-text,
.ui-table-cell-align-center .ui-table-hcell-text {
    text-align: center;
}

.ui-table-cell-break .ui-table-cell-text,
.ui-table-cell-break .ui-table-hcell-text {
    word-wrap: break-word;
    word-break: break-all;
    height: auto;
}

// 可排序列的表头样式Hover
.ui-table-hcell-sort-hover {
    cursor: pointer;
}

.ui-table-hcell-sort-hover .ui-table-hsort {
    display: inline-block;
    *display: inline;
}

.ui-table-body {
    background: #FFF;
    border-bottom: 1px solid #ddd;
    *position: relative;
}

.ui-table-body-nodata {
    border: 1px solid #ddd;
    border-width: 0 1px;
    text-align: center;
}

.ui-table-row {
    background: #FFF;
    border-bottom: 1px solid #ddd;
    zoom: 1;
}

.ui-table-row-last {
    border-bottom: 0;
}

// 行表格移上
.ui-table-row-hover {
    background: @table-background-color;
}

.ui-table-editor {
    background: #FFF;
    border: 1px solid #C7C7C7;
    padding: 20px;
    // width: 200px;
    .box-shadow();
    .border-radius(3px);
}
.ui-table-editor-note {
    color: #CCC;
}
.ui-table-editor-opt {
    overflow: hidden;
    zoom: 1;

    .ui-button {
        margin: 10px 6px 0 0;
    }
}
.ui-table-editor-error {
    clear: left;
    margin-bottom: 5px;

    .ui-textbox-validity-label {
        padding-left: 0;
    }
}
.ui-table-editor-tip {
    color: #666;
    font-size: 12px;
}
.ui-table-editor .ui-textbox {
    float: left;
}

.ui-table-editor .ui-button-group {
    margin: 10px 0;
}


// 行表格选中
.ui-table-row-selected table {
    background: @table-background-color;
}

// 行表格展开
.ui-table-row-unfolded {
    background: #FFF;
}

// 定义拖拽鼠标指针
.ui-table .ui-table-startdrag,
.ui-table .ui-table-startdrag .ui-table-thcntr {
    cursor: col-resize;
}

// 拖拽显示的竖线
.ui-table-mark {
    height: 400px;
    width: 1px;
    overflow: hidden;
    background: #000;
    position: absolute;
}

.ui-table-cell-editentry {
    width: 12px;
    height: 20px;
    display: none;
    cursor: pointer;
    background: url(https://cdn.bdstatic.com/san-xui/0.0.0/esui/edit.png) 0 -65px no-repeat;
    margin-left: 10px;

    &:hover {
        background-position: 0 3px;
    }
}

.ui-table-cell-align-right .ui-table-cell-editentry {
    left: 2px;
    right: auto;
}

.ui-table-row-hover .ui-table-cell-editentry {
    .inline-block();
}

// 子表格收起展开按钮
.ui-table-subentry {
    margin-left: 20px;
    color: #108CEE;
    cursor: pointer;

    .iconfont {
        font-size: 12px;
    }
}
.ui-table-subentry-opened {
    .rotateZ(-180deg);
}

.ui-table-subentryfield table {
    border: 0;
}
.ui-table-subentryfield table tr td:first-child {
    width: 30px;
}

.ui-table-subrow {
    background: #F6F7FB;
    padding: 20px 50px;
    zoom: 1;
}
.ui-table-subrow-last {
    border-width: 1px 1px 0;
}
.ui-panel {
    position: relative;
}

.main-wrap-new {
    .ui-table-cell-sel,
    .ui-table-hcell-sel,
    .ui-table-hcell-text {
        font-size: 12px;
    }

    .ui-table-body-nodata {
        border: 1px solid @table-border-color;
    }

    .ui-table-hcell-text-first,
    .ui-table-cell-text-first {
        min-width: 20px;
        padding-left: 20px;
    }

    .ui-table-row-hover,
    .ui-table-row-selected table {
        background: #F5FBFF;
    }

    .ui-table-hcell-text {
        border-right-color: #FFF;
    }
    .ui-table-hcell-text-last {
        border-right: none;
    }

    .ui-table-body {
        border: none;
    }
    .ui-table-row {
        border-bottom: 1px solid @table-border-color;
    }
    .ui-table-head table {
        border: none;
    }

    .ui-table-body table {
        border: none;
    }

    .ui-table-head {
        z-index: 10;
    }
}
