/* Extracted from legacy Custom-Fee-Table.php */

/* 表格容器样式 - 允许水平滚动 */
.custom-fee-table {
    overflow-x: auto;
    margin: 0px 0;
    width: 100%;
    max-width: 100%;
}

/* 表格基本样式 */
.custom-fee-table .dce-acf-repeater-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    min-width: 600px !important;
    table-layout: fixed !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 表格单元格通用样式 - 高特异性，增加padding */
.custom-fee-table .dce-acf-repeater-table th,
.custom-fee-table .dce-acf-repeater-table td {
    padding: 9px 7px !important;
    text-align: center !important;
    border: 1px solid #dee2e6 !important;
    white-space: nowrap !important;
    font-size: 0.9rem !important;
    vertical-align: middle !important;
    line-height: 1.5 !important;
    margin: 0 !important;
}

/* 表头样式 - 高特异性 */
.custom-fee-table .dce-acf-repeater-table thead th {
    background-color: steelblue !important;
    color: white !important;
    font-weight: 600 !important;
    border: 1px solid #4682b4 !important;
}

/* 奇偶行背景色 - 高特异性覆盖外部样式 */
.custom-fee-table .dce-acf-repeater-table tbody tr:nth-child(odd) td {
    background-color: #fff !important;
}

.custom-fee-table .dce-acf-repeater-table tbody tr:nth-child(even) td {
    background-color: #fafafa !important;
}

/* 悬停效果 - 高特异性 */
.custom-fee-table .dce-acf-repeater-table tbody tr:hover td {
    background-color: #f2f3f4 !important;
}

/* 列宽设置 - 高特异性 */
.custom-fee-table .dce-acf-repeater-table th:nth-child(1),
.custom-fee-table .dce-acf-repeater-table td:nth-child(1) {
    width: 15% !important;
    white-space: nowrap !important;
    font-weight: 600 !important; /* 首列字体加粗 */
}

.custom-fee-table .dce-acf-repeater-table th:nth-child(2),
.custom-fee-table .dce-acf-repeater-table td:nth-child(2) {
    width: 25% !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

.custom-fee-table .dce-acf-repeater-table th:nth-child(3),
.custom-fee-table .dce-acf-repeater-table td:nth-child(3) {
    width: 15% !important;
    white-space: nowrap !important;
}

.custom-fee-table .dce-acf-repeater-table th:nth-child(4),
.custom-fee-table .dce-acf-repeater-table td:nth-child(4) {
    width: 25% !important;
    white-space: nowrap !important;
}

.custom-fee-table .dce-acf-repeater-table th:nth-child(5),
.custom-fee-table .dce-acf-repeater-table td:nth-child(5) {
    width: 20% !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

/* 学费列特殊样式 - 高特异性，更新颜色为steelblue */
.custom-fee-table .dce-acf-repeater-table td:nth-child(4) {
    font-weight: 600 !important;
    color: steelblue !important;
}

.custom-fee-table .dce-acf-repeater-table td:nth-child(4) .repeater-item {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    display: inline-block !important;
}

/* 数字列样式 - 高特异性 */
.custom-fee-table .dce-acf-repeater-table td:nth-child(1) .repeater-item,
.custom-fee-table .dce-acf-repeater-table td:nth-child(3) .repeater-item,
.custom-fee-table .dce-acf-repeater-table td:nth-child(4) .repeater-item {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    display: inline-block !important;
}

/* 文字列样式 - 高特异性 */
.custom-fee-table .dce-acf-repeater-table td:nth-child(2) .repeater-item,
.custom-fee-table .dce-acf-repeater-table td:nth-child(5) .repeater-item {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    display: inline-block !important;
}

/* 专门处理外部样式的覆盖 - 针对 .dce-acf-repeater-table tr td:first-child */
.custom-fee-table .dce-acf-repeater-table tr td:first-child {
    background-color: white !important;
    font-weight: 600 !important; /* 首列字体加粗，覆盖外部样式 */
}

/* 专门处理外部样式的覆盖 - 针对 table tbody>tr:nth-child(odd)>td */
.custom-fee-table table tbody tr:nth-child(odd) td,
.custom-fee-table table tbody tr:nth-child(odd) th {
    background-color: white !important;
}

.custom-fee-table table tbody tr:nth-child(even) td,
.custom-fee-table table tbody tr:nth-child(even) th {
    background-color: #fafafa !important;
}

/* 专门处理外部样式的覆盖 - 针对 table td, table th */
.custom-fee-table table td,
.custom-fee-table table th {
    border: 1px solid #dee2e6 !important;
    line-height: 1.5 !important;
    padding: 10px 8px !important;
    vertical-align: middle !important;
}

/* 确保repeater-item元素正确显示 */
.custom-fee-table .repeater-item {
    display: inline-block !important;
    box-sizing: border-box !important;
}

/* 响应式设计 - 移动设备 */
@media (max-width: 768px) {
    .custom-fee-table .dce-acf-repeater-table {
        min-width: 100% !important;
        width: 100% !important;
    }

    .custom-fee-table .dce-acf-repeater-table th,
    .custom-fee-table .dce-acf-repeater-table td {
        padding: 10px 8px !important;
        font-size: 0.8rem !important;
    }
}
