/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
    height: 100vh;
    overflow: hidden;
    background: #f5f5f5;
}

/* 顶部导航栏 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    position: relative;
}

.header-content {
    max-width: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-info {
    font-size: 14px;
    opacity: 0.9;
}

/* 地图容器 */
#map {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
}

/* 侧边栏样式 */
.sidebar {
    position: absolute;
    top: 80px;
    left: 10px;
    width: 320px;
    max-height: calc(100vh - 90px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    overflow-y: auto;
    z-index: 100;
}

.panel-section {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.panel-section:last-child {
    border-bottom: none;
}

.panel-section h3 {
    color: #333;
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

/* 图层切换 */
.layer-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.layer-btn {
    padding: 8px 12px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.layer-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.layer-btn:hover {
    border-color: #667eea;
}

/* 定位按钮 */
.btn-location {
    width: 100%;
    padding: 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-location:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* 城市选择 */
.city-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.search-box input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 控制组 */
.control-group {
    margin-bottom: 12px;
}

.control-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-size: 13px;
}

.control-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-secondary.active {
    background: #ff6b6b;
}

.btn-danger {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

/* 状态文本 */
.status-text {
    font-size: 12px;
    color: #666;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-top: 8px;
}

.result-box {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
    max-height: 150px;
    overflow-y: auto;
}

/* 半径控制 */
.radius-control {
    margin-bottom: 12px;
}

.radius-control label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: #555;
}

.radius-control input[type="range"] {
    width: 100%;
}

/* 统计信息 */
.stats-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
}

.stat-value {
    font-weight: bold;
    color: #667eea;
    font-size: 16px;
}

/* 右侧结果面板 */
.results-panel {
    position: absolute;
    top: 80px;
    right: 10px;
    width: 350px;
    max-height: calc(100vh - 90px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    overflow-y: auto;
    z-index: 100;
}

.count-badge {
    background: #667eea;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 15px;
}

/* POI列表 */
.poi-list {
    list-style: none;
    max-height: 500px;
    overflow-y: auto;
}

.poi-item {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s;
}

.poi-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.poi-name {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}

.poi-addr {
    font-size: 12px;
    color: #888;
    margin-bottom: 3px;
}

.poi-distance {
    font-size: 11px;
    color: #667eea;
    font-weight: 500;
}

/* 信息窗口样式 */
.info-window {
    padding: 5px;
}

.info-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
}

.info-content {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
}

.info-content div {
    margin-bottom: 4px;
}

.info-address {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid #eee;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 80%;
    max-width: 1000px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close-btn:hover {
    color: #000;
}

.chart-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.chart-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.chart-box h4 {
    text-align: center;
    color: #333;
    margin-bottom: 15px;
}

/* 图例 */
.legend {
    position: absolute;
    bottom: 20px;
    left: 10px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    z-index: 100;
    min-width: 150px;
}

.legend-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 10px;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.legend-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 8px;
}

.legend-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #4A90E2;
    background: rgba(74, 144, 226, 0.2);
    margin-right: 8px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .sidebar {
        width: 280px;
    }
    .results-panel {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .sidebar,
    .results-panel {
        width: calc(100% - 20px);
        max-height: 200px;
    }
    
    .chart-container {
        grid-template-columns: 1fr;
    }
    
    .legend {
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}