/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    color: #eee;
    overflow: hidden;
}

/* 顶部标题栏 */
.header {
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border-bottom: 2px solid #e94560;
}

.header-content h1 {
    font-size: 24px;
    color: #fff;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* 主容器 */
.main-container {
    display: flex;
    height: calc(100vh - 90px);
}

/* 左侧边栏 */
.sidebar {
    width: 320px;
    background: #16213e;
    padding: 15px;
    overflow-y: auto;
    border-right: 1px solid #0f3460;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #0f3460;
    border-radius: 3px;
}

/* 控制面板 */
.panel {
    background: #0f3460;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #e94560;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(233,69,96,0.3);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 复选框样式 */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 0;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #e94560;
    cursor: pointer;
}

.checkbox-label span {
    font-size: 14px;
}

/* 单选框样式 */
.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 5px;
    transition: background 0.2s;
}

.radio-label:hover {
    background: rgba(255,255,255,0.1);
}

.radio-label input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #e94560;
    cursor: pointer;
}

.radio-label span {
    font-size: 14px;
}

/* 输入框和按钮 */
.input-group {
    display: flex;
    gap: 8px;
}

.input-group input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #1a1a2e;
    color: #fff;
    font-size: 13px;
}

.input-group input:focus {
    outline: none;
    border-color: #e94560;
}

.input-group input::placeholder {
    color: #666;
}

button {
    padding: 10px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

#btnSearch {
    background: #e94560;
    color: #fff;
}

#btnSearch:hover {
    background: #d63851;
}

.btn-primary {
    background: linear-gradient(135deg, #e94560 0%, #c23a51 100%);
    color: #fff;
    width: 100%;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233,69,96,0.4);
}

/* 下拉选择框 */
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #1a1a2e;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #e94560;
}

option {
    background: #1a1a2e;
    padding: 10px;
}

/* 统计结果 */
.stats-result {
    margin-top: 12px;
    padding: 12px;
    background: rgba(233,69,96,0.1);
    border-radius: 5px;
    border-left: 3px solid #e94560;
}

.stats-result p {
    font-size: 13px;
    margin: 5px 0;
}

.stats-result .highlight {
    color: #e94560;
    font-weight: 600;
}

/* 滑块 */
.slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 8px;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #1a1a2e;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e94560;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* 统计容器 */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 5px;
}

.stat-label {
    font-size: 13px;
    color: #aaa;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #e94560;
}

/* 地图容器 */
.map-wrapper {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

/* 图例 */
.legend {
    position: absolute;
    bottom: 60px;
    right: 20px;
    background: rgba(15, 52, 96, 0.95);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    z-index: 1000;
}

.legend-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #e94560;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 12px;
}

.legend-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 3px;
}

.legend-icon.heatmap {
    background: linear-gradient(to right, blue, cyan, lime, yellow, red);
}

/* 比例尺 */
.scale-line {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(15, 52, 96, 0.9);
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 12px;
    color: #fff;
    z-index: 1000;
}

/* 弹窗 */
.popup {
    display: none;
    position: absolute;
    background: #fff;
    color: #333;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 2000;
    min-width: 200px;
}

.popup.show {
    display: block;
}

.popup-content {
    position: relative;
    padding: 15px;
}

.popup-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.popup-close:hover {
    color: #333;
}

#popup-body h4 {
    margin-bottom: 8px;
    color: #e94560;
}

#popup-body p {
    font-size: 13px;
    margin: 5px 0;
    color: #666;
}

#popup-body .info-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

#popup-body .info-row:last-child {
    border-bottom: none;
}

#popup-body .info-label {
    color: #999;
}

#popup-body .info-value {
    font-weight: 500;
}

/* 加载动画 */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 3000;
}

.loading.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: #e94560;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    margin-top: 15px;
    color: #fff;
    font-size: 14px;
}

/* 页脚 */
.footer {
    background: #0f3460;
    padding: 10px 20px;
    text-align: center;
    font-size: 12px;
    color: #888;
    border-top: 1px solid #1a1a2e;
}

/* OpenLayers 自定义样式 */
.ol-control button {
    background: #0f3460 !important;
    color: #fff !important;
}

.ol-control button:hover {
    background: #e94560 !important;
}

.ol-zoom {
    top: 10px;
    left: auto;
    right: 10px;
}

.ol-attribution {
    background: rgba(15, 52, 96, 0.8) !important;
    color: #aaa !important;
    font-size: 11px;
}

.ol-attribution a {
    color: #e94560 !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 200px;
    }

    .header-content h1 {
        font-size: 18px;
    }

    .legend {
        bottom: 70px;
        right: 10px;
        font-size: 11px;
    }
}
