/* Start of Selection */
/**
 * EIP 查詢列表頁：表格樣式 + 篩選區（手機底部滑入面板）
 * 使用頁面請在 <main> 加上 class eip-query-page
 */

/* 表格（僅限查詢列表頁，避免影響全站其他表格） */
.eip-query-page .table th {
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.eip-query-page .table td {
    vertical-align: middle;
}

.eip-query-page .table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* --- 光棒效果 START --- */
/* 點擊 tr 後停留光棒(左側藍色條)的樣式。tr 需加 .tr-active（多層背景繪製，避免 tr::before 在表格中多佔一欄） */
.eip-query-result-table tbody tr.tr-active {
    box-shadow:
        0 0 0 2px #007bff1a,
        -2px 0 10px 0 rgba(65, 173, 255, 0.35);
    background-color: #e9f5ff !important;
    background-image: linear-gradient(
        to bottom,
        #1b6be1 0%,
        #41adff 30%,
        #9be8ff 70%,
        #41adff 100%
    );
    background-size: 3px 100%;
    background-position: left top;
    background-repeat: no-repeat;
    /* 以免和 hover 顏色衝突 */
    transition: background-color 0.2s, box-shadow 0.2s;
}
.eip-query-result-table tbody tr.tr-active td {
    /* 讓列背景（含左側光棒）可穿透顯示 */
    background-color: transparent;
}
/* --- 光棒效果 END --- */

.eip-query-page .pagination {
    margin-bottom: 0;
}

/**
 * 查詢列表頁：整頁不捲動，僅結果表格區捲動（需在 <main> 額外加 class）
 * 使用方式：
 * - <main class="... eip-query-page eip-query-page--table-scroll">
 * - 查詢結果卡片加 class：eip-query-result-card
 * - 表格容器加 class：eip-query-result-table
 */
.eip-query-page--table-scroll {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.eip-query-page--table-scroll .eip-query-result-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.eip-query-page--table-scroll .eip-query-result-table {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

/* 凍結表頭（僅在表格捲動容器內生效） */
.eip-query-page--table-scroll .eip-query-result-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bs-table-bg, #fff);
}

/* 僅在特定頁面鎖住瀏覽器捲動（由頁面 JS 動態加在 body 上） */
body.eip-table-scroll-lock {
    overflow: hidden;
}

/* 手機版：篩選區變為底部滑入面板 */
@media (max-width: 767.98px) {
    #filterSection {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1045;
        margin-bottom: 0 !important;
        border-radius: 1rem 1rem 0 0 !important;
        max-height: 70vh;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15) !important;
    }

    #filterSection.show {
        transform: translateY(0);
    }

    #filterCollapse {
        display: block !important;
        height: auto !important;
    }
}

#filterBackdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1040;
}

#filterBackdrop.show {
    display: block;
}