* {
    box-sizing: border-box;
}
body {
    margin: 0;
    padding: 10px;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

#map-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    height: calc(100vh - 20px);
}
#map {
    flex: 1;
    background: rgb(176, 229, 255);
    border: 1px solid #ddd;
    position: relative;
    overflow: hidden;
    min-width: 300px;
}
#sidebar {
    width: 300px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-y: auto;
}

/* 地图工具栏按钮 */
.map-tool-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.map-tool-btn:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.map-tool-btn.active {
    background: #1890ff;
    color: white;
    border-color: #1890ff;
}

/* 工具提示 */
.map-tool-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 50px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* 侧边栏面板 */
.sidebar-panel {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.sidebar-panel h3 {
    margin-top: 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* 图层名称截断 */
.layer-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 150px;
}

/* 搜索结果项 */
.search-result-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: #f0f9ff;
}

.search-result-item:last-child {
    border-bottom: none;
}
@media (max-width: 768px) {
    #map-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    #sidebar {
        width: 100%;
        order: -1;
        max-height: 300px;
    }
    #map {
        height: 600px;
        min-height: 400px;
    }
}
.control-panel {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.control-panel h3 {
    margin-top: 0;
    color: #333;
}
.btn {
    padding: 6px 12px;
    margin: 4px 4px 4px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}
.btn:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}
.btn.active {
    background: #1890ff;
    color: white;
    border-color: #1890ff;
}
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}
#layer-list {
    max-height: 200px;
    overflow-y: auto;
}
.layer-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}
.layer-item:hover {
    background: #f5f5f5;
}
.layer-item.active {
    background: #e6f7ff;
}
#info-panel {
    margin-top: 20px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 14px;
}
#file-upload {
    margin: 10px 0;
}
#stats-panel {
    margin-top: 20px;
    padding: 10px;
    background: #f0f9ff;
    border-radius: 4px;
}
canvas {
    display: block;
}
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
