/* ==== Table View Panel ==== */
.table-view-panel {
    /* 固定定位在底部 */
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;

    /* 默认收起状态 */
    height: 0;
    overflow: hidden;

    /* 毛玻璃效果 */
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);

    /* 平滑过渡动画 */
    transition: height 0.3s ease;
}

/* 表格展开状态 */
.table-view-panel.open {
    height: 400px;
}

/* 拖拽手柄 */
.table-drag-handle {
    height: 8px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), transparent);
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.table-drag-handle::before {
    content: '';
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.table-drag-handle:hover::before {
    background: var(--primary-color);
}

.table-view-panel .table-header {
    padding: 10px 20px;
    background: rgba(30, 30, 30, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.table-view-panel .table-header h3 {
    margin: 0;
    color: #4a90e2;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-view-panel .table-controls {
    display: flex;
    gap: 8px;
}

.btn-table-control {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    background: #333;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-table-control:hover {
    background: #4a90e2;
}

#featureTable {
    flex: 1;
    overflow: hidden;
}

/* Tabulator 自定义暗色主题 */
.tabulator {
    background: #1a1a1a;
    border: none;
    font-family: inherit;
}

.tabulator .tabulator-header {
    background: #252525;
    border-bottom: 2px solid #333;
}

.tabulator .tabulator-header .tabulator-col {
    background: #252525;
    border-right: 1px solid #333;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
    color: #4a90e2;
    font-weight: 600;
    padding: 8px;
}

.tabulator .tabulator-tableholder .tabulator-table {
    background: #1a1a1a;
    color: #e0e0e0;
}

.tabulator .tabulator-row {
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
}

.tabulator .tabulator-row.tabulator-row-even {
    background: #1e1e1e;
}

.tabulator .tabulator-row:hover {
    background: rgba(74, 144, 226, 0.1);
    cursor: pointer;
}

.tabulator .tabulator-row.tabulator-selected {
    background: rgba(74, 144, 226, 0.25);
}

.tabulator .tabulator-row .tabulator-cell {
    border-right: 1px solid #2a2a2a;
    padding: 8px;
}

.tabulator .tabulator-row .tabulator-cell.tabulator-editing input {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #4a90e2;
    padding: 4px 8px;
}

.tabulator .tabulator-footer {
    background: #252525;
    border-top: 1px solid #333;
}

/* 表格浮动按钮 */
.floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #4a90e2;
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
    transition: all 0.3s;
    z-index: 999;
}

.floating-btn:hover {
    transform: scale(1.1);
    background: #357abd;
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.6);
}

.floating-btn:active {
    transform: scale(0.95);
}

/* 当表格展开时，浮动按钮上移 */
body:has(.table-view-panel.open) .floating-btn {
    bottom: 420px;
}

/* ==== Table Locate Button ==== */
.table-locate-btn {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.table-locate-btn:hover {
    background: linear-gradient(135deg, #357abd, #2968a3);
    transform: scale(1.1);
}

.table-locate-btn i {
    font-size: 0.8rem;
}

/* ==== Table Scrollbars ==== */
.table-view-panel #featureTable {
    overflow: auto !important;
}

.tabulator {
    overflow: auto !important;
}

.tabulator-tableHolder {
    overflow: auto !important;
}

/* Custom scrollbar styling */
.tabulator-tableHolder::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.tabulator-tableHolder::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.tabulator-tableHolder::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}

.tabulator-tableHolder::-webkit-scrollbar-thumb:hover {
    background: #777;
}