/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
    overflow: hidden;
}

/* 头部样式 */
.header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.header p {
    font-size: 12px;
    opacity: 0.9;
}

/* 地图容器 */
#map {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
}

/* 左侧控制面板 */
.control-panel {
    position: absolute;
    top: 100px;
    left: 20px;
    width: 320px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    overflow-y: auto;
    z-index: 100;
}

.panel-section {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.panel-section:last-child {
    border-bottom: none;
}

.panel-section h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

/* 图层切换 */
.layer-switch {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.layer-switch label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.layer-switch label:hover {
    background: #f5f5f5;
}

.layer-switch input[type="radio"],
.layer-switch input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
}

/* 搜索框 */
.search-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-box input[type="text"] {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.search-box input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

/* 按钮样式 */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #28a745;
    color: white;
}

.btn-secondary:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
    width: 100%;
}

.btn-danger:hover {
    background: #c82333;
}

/* 状态文本 */
.status-text {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* 半径控制 */
.radius-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radius-control label {
    font-weight: bold;
    color: #555;
}

.radius-control input[type="number"] {
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
}

.radius-info {
    margin-top: 10px;
    padding: 8px;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
}

.radius-info small {
    font-size: 11px;
    color: #856404;
}

/* 统计信息 */
.stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.stat-label {
    font-weight: bold;
    color: #555;
}

.stat-value {
    color: #667eea;
    font-size: 18px;
    font-weight: bold;
}

/* 右侧结果列表 */
.result-panel {
    position: absolute;
    top: 100px;
    right: 20px;
    width: 350px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.result-panel h3 {
    padding: 20px;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
    font-size: 16px;
}

.result-list {
    overflow-y: auto;
    flex: 1;
}

.poi-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
}

.poi-item:hover {
    background: linear-gradient(to right, #f0f8ff, #e6f2ff);
    transform: translateX(5px);
}

.poi-name {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}

.poi-addr {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

.poi-distance {
    font-size: 11px;
    color: #667eea;
    margin-top: 5px;
}

/* 弹出窗口样式 */
.ol-popup {
    position: absolute;
    background-color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #cccccc;
    bottom: 12px;
    left: -50px;
    min-width: 280px;
    z-index: 1000;
}

.ol-popup:after,
.ol-popup:before {
    top: 100%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}

.ol-popup:after {
    border-top-color: white;
    border-width: 10px;
    left: 48px;
    margin-left: -10px;
}

.ol-popup:before {
    border-top-color: #cccccc;
    border-width: 11px;
    left: 48px;
    margin-left: -11px;
}

.ol-popup-closer {
    text-decoration: none;
    position: absolute;
    top: 8px;
    right: 8px;
    color: #c3c3c3;
    font-size: 20px;
}

.ol-popup-closer:hover {
    color: #999;
}

.ol-popup-closer:after {
    content: "✖";
}

#popup-content h4 {
    margin: 0 0 10px 0;
    color: #667eea;
    font-size: 16px;
}

#popup-content p {
    margin: 5px 0;
    font-size: 13px;
    color: #555;
}

/* 图例 */
.legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    z-index: 100;
}

.legend h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    font-size: 12px;
}

.legend-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    display: inline-block;
}

/* 滚动条样式 */
.control-panel::-webkit-scrollbar,
.result-list::-webkit-scrollbar {
    width: 6px;
}

.control-panel::-webkit-scrollbar-track,
.result-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb,
.result-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb:hover,
.result-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .control-panel,
    .result-panel {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .control-panel {
        width: calc(100% - 40px);
        max-height: 40vh;
    }
    
    .result-panel {
        display: none;
    }
    
    .legend {
        bottom: 10px;
        right: 10px;
        font-size: 11px;
    }
}