.append('<tr><td colspan="10" class="text-center">暫無有效記錄</td></tr>');
                    }
                } else {
                    $(countSelector).text(0);
                    tableBody.append('<tr><td colspan="10" class="text-center">暫無記錄</td></tr>');
                }
            } catch (e) {
                console.error('更新全部歷史記錄時發生錯誤:', e);
                $(countSelector).text(0);
                tableBody.append(`<tr><td colspan="10" class="text-c