﻿
.table-div-row,
.table-div-row > :where(.thead, .tbody) {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

.table-div-row {
    width: 100%;
}

.table-div-row > .thead {
    flex-shrink: 0;
    width: calc(100% - 17px);
    height: 50px;
    background-color: #00a5a6;
    border: 1px solid #00a5a6;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    color: #ffffff;
    font-weight: 700;
}

.table-div-row > .tbody {
    width: 100%;
    height: calc(100% - 50px);
    overflow-x: hidden;
    overflow-y: auto;
}

.table-div-row > :where(.thead, .tbody) > .tr {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

.table-div-row > .thead > .tr {
    height: 100%;
}

.table-div-row > .tbody > .tr {
    flex-shrink: 0;
    height: 50px;
    background-color: #ffffff;
    border-right: 1px solid #dedede;
    border-bottom: 1px solid #dedede;
    border-left: 1px solid #dedede;
}

.table-div-row > .tbody > .tr:nth-child(even) {
    background-color: #f9fbfd;
}

.table-div-row > .tbody > .tr:not(.select):hover {
    background-color: #f6f7f7;
}

.table-div-row > .tbody > .tr:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.table-div-row > :where(.thead, .tbody) > .tr > .td {
    flex: 1;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.table-div-row > .tbody > .tr > .td + .td {
    border-left: 1px solid #dedede;
}

.table-div-row > .thead > .tr > .td { font-size: 15px; }

.table-div-row > .tbody > .tr > .td {
    color: #7c7c7c;
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
}

.table-div-row > :where(.thead, .tbody) > .tr > .td > span,
.table-div-row > .tbody > .tr > .td > p {
    max-width: calc(100% - 20px);
    /* 文字超出出現省略號... */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* --------------------- */
}

.table-div-row > :where(.thead, .tbody) > .tr > .td > input[type="checkbox"] {
    width: 20px;
    height: 20px;
    box-sizing: border-box;
    cursor: pointer;
}
.table-div-row> :where(.thead, .tbody) > .tr > .td > .tr > .td > input[type="number"] {
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    box-sizing: border-box;
}

.table-div-row > .tbody > .tr > .td > i { cursor: pointer; font-size: 20px; }

/* 手機 */
@media screen and (max-width: 767px) {
    .table-div {
        width: 100%;
    }

    .table-div > .thead {
        display: none;
    }

    .table-div > .tbody {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 20px;
    }

    .table-div > .tbody > .tr {
        width: 100%;
        border: 1px solid #00a5a6;
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
        align-content: flex-start;
        flex-wrap: wrap;
    }

    .table-div > .tbody > .tr > .td {
        width: 100%;
        height: 50px;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        font-size: 14px;
    }

    .table-div > .tbody > .tr > .td.td-full { width: 100%; }

    .table-div > .tbody > .tr > .td + .td { border-top: 1px solid #00a5a6; }

    .table-div > .tbody > .tr > .td::before {
        content: attr(data-title);
        min-width: 84px;
        height: 100%;
        background-color: #00a5a6;
        box-sizing: border-box;
        color: #ffffff;
        display: flex;
        justify-content: center;
        align-items: center;
        font-weight: 700;
        margin-right: 10px;
        padding: 0px 10px;
        white-space: nowrap;
    }
    
    .table-div > :where(.thead, .tbody) > .tr > .td > input[type="checkbox"] { width: 20px; height: 20px; box-sizing: border-box; }

    .table-div > .tbody > .tr > .td > input:focus { border: none; }
}

/* 平版 */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .table-div {
        width: 100%;
    }

    .table-div > .thead {
        display: none;
    }

    .table-div > .tbody {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 20px;
    }

    .table-div > .tbody > .tr {
        width: 100%;
        border: 1px solid #00a5a6;
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
        align-content: flex-start;
        flex-wrap: wrap;
    }

    .table-div > .tbody > .tr > .td {
        width: 100%;
        height: 50px;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        font-size: 14px;
    }

    .table-div > .tbody > .tr > .td.td-full { width: 100%; }

    .table-div > .tbody > .tr > .td + .td { border-top: 1px solid #00a5a6; }

    .table-div > .tbody > .tr > .td::before {
        content: attr(data-title);
        min-width: 84px;
        height: 100%;
        background-color: #00a5a6;
        box-sizing: border-box;
        color: #ffffff;
        display: flex;
        justify-content: center;
        align-items: center;
        font-weight: 700;
        margin-right: 10px;
        padding: 0px 10px;
        white-space: nowrap;
    }
    
    .table-div > :where(.thead, .tbody) > .tr > .td > input[type="checkbox"] { width: 20px; height: 20px; box-sizing: border-box; }

    .table-div > .tbody > .tr > .td > input:focus { border: none; }
}

/* PC */
@media screen and (min-width: 1025px) {
    .table-div {
        width: 100%;
    }

    .table-div,
    .table-div > :where(.thead, .tbody) {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
    }
    
    .table-div > .thead {
        flex-shrink: 0;
        width: calc(100% - 17px);
        height: 50px;
        background-color: #00a5a6;
        border: 1px solid #00a5a6;
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
        color: #ffffff;
        font-weight: 700;
    }
    
    .table-div > .tbody {
        width: 100%;
        height: calc(100% - 50px);
        overflow-x: hidden;
        overflow-y: auto;
    }
    
    .table-div > :where(.thead, .tbody) > .tr {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
    }
    
    .table-div > .thead > .tr {
        height: 100%;
    }
    
    .table-div > .tbody > .tr {
        flex-shrink: 0;
        height: 50px;
        background-color: #ffffff;
        border-right: 1px solid #dedede;
        border-bottom: 1px solid #dedede;
        border-left: 1px solid #dedede;
    }
    
    .table-div > .tbody > .tr:nth-child(even) {
        background-color: #f9fbfd;
    }
    
    .table-div > .tbody > .tr:not(.select):hover {
        background-color: #f6f7f7;
    }
    
    .table-div > .tbody > .tr:last-child {
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
    }
    
    .table-div > :where(.thead, .tbody) > .tr > .td {
        flex: 1;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .table-div > .thead > .tr > .td { font-size: 15px; }
    
    .table-div > .tbody > .tr > .td {
        color: #7c7c7c;
        font-size: 14px;
        font-weight: 700;
        overflow: hidden;
    }
    
    .table-div > .tbody > .tr > .td + .td {
        border-left: 1px solid #dedede;
    }

    .table-div > :where(.thead, .tbody) > .tr > .td > input[type="checkbox"] {
        width: 20px;
        height: 20px;
        box-sizing: border-box;
        cursor: pointer;
    }
    
    .table-div > .tbody > .tr > .td > p {
        max-width: calc(100% - 20px);
        /* 文字超出出現省略號... */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        /* --------------------- */
    }

    .table-div > .tbody > .tr > .td > i { cursor: pointer; font-size: 20px; }
}