body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background-color: #f5f5f5;
            margin: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }

        .filter-container {
            background: white;
            border-radius: 12px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            width: 100%;
            /* max-width: 400px; */
            border: 1px solid #e0e0e0;
        }

        .filter-header {
            background-color: #f8f9fa;
            padding: 16px 20px;
            border-bottom: 1px solid #e0e0e0;
            font-weight: 600;
            font-size: 18px;
            color: #333;
        }

        .search-container {
            padding: 16px 20px;
            border-bottom: 1px solid #e0e0e0;
        }

        .search-input {
            width: 100%;
            padding: 10px 16px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 16px;
            outline: none;
            transition: border-color 0.2s;
            box-sizing: border-box;
        }

        .search-input:focus {
            border-color: #7d4ba1;
            box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
        }

        .filter-list {
            max-height: 300px;
            overflow-y: auto;
        }

        .filter-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 20px;
            border-bottom: 1px solid #f0f0f0;
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .filter-item:hover {
            background-color: #f8f9fa;
        }

        .filter-item:last-child {
            border-bottom: none;
        }

        .filter-item.selected {
            background-color: #e3f2fd;
            color: #1976d2;
        }

        .filter-label {
            font-size: 16px;
            color: #333;
            flex-grow: 1;
        }

        .filter-item.selected .filter-label {
            color: #8742aa;
            font-weight: 500;
        }

        .filter-count {
            background-color: #6b42a4;
            color: white;
            display: inline-flex;       /* 用 flex 来居中 */
            align-items: center;        /* 垂直居中 */
            justify-content: center;    /* 水平居中 */
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 14px;
            font-weight: 500;
            min-width: 30px;
            height: 24px;               /* 固定高度，防止字体差异 */
            box-sizing: border-box;     /* 确保 padding 影响内容区 */
        }

        .filter-item.selected .filter-count {
            background-color: #19d2c9;
        }

        .no-results {
            padding: 20px;
            text-align: center;
            color: #666;
            font-style: italic;
        }

        /* Scrollbar styling */
        .filter-list::-webkit-scrollbar {
            width: 6px;
        }

        .filter-list::-webkit-scrollbar-track {
            background: #f1f1f1;
        }

        .filter-list::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 3px;
        }

        .filter-list::-webkit-scrollbar-thumb:hover {
            background: #a1a1a1;
        }



        .umap-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.umap-header h1 {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
}

.info-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-panel h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.info-panel ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.info-panel li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    color: #6c757d;
    font-size: 14px;
}

.info-panel li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.controls {
    margin-bottom: 20px;
}

.toggle-buttons {
    display: flex;
    gap: 3px;
    background: #f1f3f4;
    padding: 3px;
    border-radius: 25px;
    margin-bottom: 15px;
}

.toggle-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    background: transparent;
    color: #666;
}

.toggle-btn.active {
    background: #17a2b8;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

.file-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.file-input {
    display: none;
}

.file-label, .demo-btn {
    padding: 8px 16px;
    border: 1px solid #17a2b8;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.file-label {
    background: white;
    color: #17a2b8;
}

.file-label:hover {
    background: #17a2b8;
    color: white;
}

.demo-btn {
    background: #17a2b8;
    color: white;
    border: none;
}

.demo-btn:hover {
    background: #138496;
}

.success-message {
    color: #28a745;
    font-weight: 500;
    padding: 5px 10px;
    background: #d4edda;
    border-radius: 15px;
    font-size: 12px;
    margin-top: 10px;
    display: block;
    width: 100%;
}

.plot-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    display: flex; /* 添加flex布局 */
    gap: 15px; /* 添加间距 */
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
    color: #6c757d;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #17a2b8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.zoom-controls {
    position: absolute;
    top: 10px;
    right: 230px; /* 向左移动，为图例让出空间 */
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1000;
}

.zoom-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    background: #f8f9fa;
    transform: scale(1.1);
}

.legend {
    position: static; /* 改为static定位 */
    background: white;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    max-height: 400px; /* 增加最大高度 */
    overflow-y: auto;
    min-width: 200px; /* 增加最小宽度 */
    width: 200px; /* 固定宽度 */
    font-size: 12px;
    flex-shrink: 0; /* 防止压缩 */
}

.legend-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #495057;
    font-size: 13px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.legend-item:hover {
    opacity: 0.7;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
    border: 1px solid #ddd;
}

.legend-label {
    font-size: 11px;
    color: #555;
}

.tooltip {
    position: absolute;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.statistics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #17a2b8;
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: 12px;
}

/* 确保内容不会溢出 col-md-6 */
.col-md-6 {
    padding-left: 15px;
    padding-right: 15px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .file-controls {
        flex-direction: column;
    }
    
    .statistics {
        grid-template-columns: 1fr;
    }
    
    .plot-container {
        height: 800px;
        flex-direction: column; /* 小屏幕时垂直排列 */
    }
    
    .legend {
        width: 100%;
        max-height: 150px;
        order: -1; /* 在小屏幕时将图例放在上方 */
    }
    
    .zoom-controls {
        right: 10px; /* 小屏幕时恢复原位置 */
    }


}

.plot-container {
    position: relative;
    width: 100%;
    height: 600px; /* 添加固定高度 */
    margin: 0 auto;
    display: flex;
    gap: 15px;
}

/* 确保UMAP画布占满容器 */
.plot-container canvas,
.plot-container svg {
    width: 100% !important;
    height: 100% !important;
}

/* 如果使用Plotly或其他图表库 */
.plot-container .plotly-graph-div {
    width: 100% !important;
    height: 100% !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .plot-container {
        height: 500px; /* 移动端稍小一些 */
        flex-direction: column;
    }
}