/* ============================================
   15分钟生活圈 - 样式表
   硬朗科研风格 - 精确与锐利
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a365d;
    --secondary-color: #2c5282;
    --accent-color: #c53030;
    --danger-color: #c53030;
    --warning-color: #c05621;
    --dark-color: #1a202c;
    --light-color: #f7fafc;
    --border-color: #2d3748;
    --sidebar-width: 340px;
    --font-mono: 'SF Mono', 'Consolas', 'Monaco', monospace;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #e2e8f0;
    color: var(--dark-color);
    line-height: 1.5;
    font-size: 14px;
}

/* 应用容器 */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ============================================
   侧边栏
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    background: var(--primary-color);
    color: white;
    padding: 20px 16px;
    border-bottom: 3px solid var(--accent-color);
}

.sidebar-header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}

.sidebar-header .subtitle {
    font-size: 0.8rem;
    opacity: 0.85;
    font-family: var(--font-mono);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.sidebar-footer {
    padding: 12px 20px;
    background: var(--light-color);
    font-size: 0.75rem;
    color: #7f8c8d;
    text-align: center;
}

/* ============================================
   城市选择器
   ============================================ */

.city-selector-container {
    margin-bottom: 8px;
}

.city-selector {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.city-selector:focus {
    border-color: var(--primary-color);
}

.city-selector:hover {
    border-color: var(--primary-color);
}

.city-info {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

/* ============================================
   地址搜索
   ============================================ */

.search-container {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

#search-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

#search-input:focus {
    border-color: var(--primary-color);
}

#search-input::placeholder {
    color: #aaa;
}

.search-btn,
.locate-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-btn:hover,
.locate-btn:hover {
    border-color: var(--primary-color);
    background: #f0f8ff;
}

.locate-btn.locating {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.search-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

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

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

.search-result-item .name {
    font-weight: 500;
    color: var(--dark-color);
    font-size: 0.9rem;
}

.search-result-item .address {
    font-size: 0.8rem;
    color: #888;
    margin-top: 2px;
}

/* ============================================
   面板样式
   ============================================ */

.panel {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.panel h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--dark-color);
}

.panel h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 12px 0 8px;
    color: var(--dark-color);
}

.placeholder {
    color: #95a5a6;
    font-style: italic;
    font-size: 0.9rem;
}

/* ============================================
   评分卡片
   ============================================ */

.score-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    margin-bottom: 16px;
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.score-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
}

.score-label {
    font-size: 0.75rem;
    color: #7f8c8d;
}

.grade-badge {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.grade-badge.grade-A { background: var(--secondary-color); }
.grade-badge.grade-B { background: #27ae60; }
.grade-badge.grade-C { background: var(--warning-color); }
.grade-badge.grade-D { background: #e67e22; }
.grade-badge.grade-E { background: var(--danger-color); }

.summary {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

/* ============================================
   雷达图
   ============================================ */

.radar-chart-container {
    margin: 16px 0;
    background: #fafafa;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e0e0e0;
}

#radar-chart {
    width: 100%;
    height: 280px;
    min-width: 280px;
}

/* ============================================
   分类评分
   ============================================ */

.category-scores {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.category-icon {
    font-size: 1.2rem;
}

.category-info {
    flex: 1;
}

.category-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark-color);
}

.category-name .poi-count-badge {
    font-size: 0.75rem;
    font-weight: 400;
    color: #718096;
    margin-left: 2px;
}

.category-bar {
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.category-score-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-color);
    min-width: 40px;
    text-align: right;
}

/* ============================================
   POI 来源统计
   ============================================ */

.poi-source-stats {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed #ddd;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.source-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #888;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 12px;
}

.source-icon {
    font-size: 0.8rem;
}

.source-label {
    color: #666;
}

.source-count {
    font-weight: 600;
    color: #555;
}

.source-stat-total {
    margin-left: auto;
    font-size: 0.75rem;
    color: #999;
    font-style: italic;
}

/* ============================================
   建议
   ============================================ */

.suggestions ul {
    list-style: none;
    font-size: 0.85rem;
}

.suggestions li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.suggestions li:last-child {
    border-bottom: none;
}

/* ============================================
   图例
   ============================================ */

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

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.legend-color {
    width: 24px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid rgba(0,0,0,0.3);
}

/* ============================================
   地图容器
   ============================================ */

.map-container {
    flex: 1;
    position: relative;
}

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

/* ============================================
   分析进度面板（硬朗风格）
   ============================================ */

/* 地图区域进度遮罩 */
.map-progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 32, 44, 0.7);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.map-progress-overlay.active {
    display: flex;
}

.analysis-progress {
    width: 420px;
    max-height: 380px;
    background: #ffffff;
    border: 2px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    overflow: hidden;
}

.progress-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--primary-color);
    color: white;
    border-bottom: 3px solid var(--accent-color);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.progress-log {
    max-height: 240px;
    overflow-y: auto;
    padding: 0;
    background: #f8fafc;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.82rem;
    font-family: var(--font-mono);
    color: var(--dark-color);
    border-bottom: 1px solid #e2e8f0;
}

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

.progress-item.completed {
    color: #166534;
    background: #f0fdf4;
}

.progress-item.completed .progress-icon {
    color: #16a34a;
}

.progress-item.error {
    color: #991b1b;
    background: #fef2f2;
}

.progress-item.error .progress-icon {
    color: #dc2626;
}

.progress-item.current {
    color: var(--primary-color);
    font-weight: 600;
    background: #eff6ff;
}

.progress-icon {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    font-weight: 700;
}

.progress-icon.loading {
    animation: blink 0.8s step-end infinite;
}

.progress-text {
    flex: 1;
}

.progress-time {
    font-size: 0.75rem;
    color: #64748b;
    margin-left: auto;
    font-weight: 500;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .analysis-progress {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
    }
}

/* ============================================
   旧的加载指示器（保留兼容）
   ============================================ */

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #ddd;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin-top: 16px;
    font-size: 1rem;
    color: var(--dark-color);
}

/* ============================================
   Leaflet 自定义样式
   ============================================ */

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.poi-popup {
    font-size: 0.9rem;
}

.poi-popup h4 {
    margin: 0 0 8px;
    color: var(--dark-color);
}

.poi-popup p {
    margin: 4px 0;
    color: #555;
}

.poi-popup .category-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* ============================================
   POI 筛选面板
   ============================================ */

.poi-filter-controls {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.poi-filter-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.filter-checkbox:hover {
    background: #f8f9fa;
}

.filter-checkbox input[type="checkbox"] {
    /* 使用原生复选框，自定义硬朗样式 */
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 2px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s;
    background: #fff;
}

.filter-checkbox input[type="checkbox"]:hover {
    border-color: var(--primary-color);
}

.filter-checkbox input[type="checkbox"]:checked {
    background: var(--check-color, var(--primary-color));
    border-color: var(--check-color, var(--primary-color));
}

.filter-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    color: white;
    font-size: 11px;
    font-weight: 700;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.filter-checkbox .checkmark {
    display: none;
}

.filter-checkbox > span:last-child {
    pointer-events: none;
    font-size: 0.85rem;
}

/* ============================================
   等时圈图层控制 - 硬朗风格
   ============================================ */

.isochrone-controls {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.isochrone-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 8px;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.15s;
}

.isochrone-toggle:last-child {
    border-bottom: none;
}

.isochrone-toggle:hover {
    background: #f7fafc;
}

/* 等时圈开关使用原生复选框样式 */
.isochrone-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 36px;
    height: 20px;
    background: #cbd5e0;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.isochrone-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.isochrone-toggle input[type="checkbox"]:checked {
    background: var(--toggle-color, var(--primary-color));
}

.isochrone-toggle input[type="checkbox"]:checked::after {
    transform: translateX(16px);
}

.isochrone-toggle input[type="checkbox"]:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.isochrone-toggle input[type="checkbox"]:disabled::after {
    transform: translateX(16px);
}

.toggle-slider {
    display: none; /* 不再使用单独的slider元素 */
}

.toggle-slider.locked::after {
    transform: translateX(16px);
}

.toggle-label {
    font-size: 0.85rem;
    color: var(--dark-color);
    font-weight: 500;
}

.isochrone-toggle:last-child .toggle-label {
    color: #718096;
}

.toggle-slider.locked {
    opacity: 0.7;
}

.toggle-label {
    font-size: 0.9rem;
    color: #333;
}

.toggle-label small {
    color: #999;
    font-size: 0.8em;
}

/* ============================================
   步行速度配置
   ============================================ */

.speed-presets {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.speed-preset {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.speed-preset:hover {
    border-color: var(--primary-color);
    background: #f0f8ff;
}

.speed-preset.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.speed-custom {
    margin-bottom: 12px;
}

.speed-custom label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.speed-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.speed-input-group input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

.speed-input-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.speed-input-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.speed-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 30px;
}

.speed-unit {
    font-size: 0.85rem;
    color: #666;
}

.speed-hint {
    font-size: 0.8rem;
    color: #888;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
}

.speed-hint strong {
    color: var(--primary-color);
}

/* ============================================
   POI 详情卡片（改进版）
   ============================================ */

.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    min-width: 200px;
}

.poi-popup {
    padding: 0;
}

.poi-popup-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

.poi-popup-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.poi-popup-header .poi-icon {
    font-size: 1.2rem;
}

.poi-popup-body {
    padding: 12px 16px;
}

.poi-popup-body .poi-category {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    margin-bottom: 8px;
}

.poi-popup-body .poi-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.poi-popup-body .poi-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #555;
}

.poi-popup-body .poi-info-item .label {
    color: #888;
    min-width: 50px;
}

.poi-popup-body .poi-info-item .value {
    font-weight: 500;
    color: var(--dark-color);
}

.poi-popup-body .poi-distance {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.poi-popup-body .distance-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.poi-popup-body .walk-time {
    font-size: 0.85rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: rgba(0,0,0,0.8);
    color: white;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 10000;
    animation: fadeInUp 0.3s ease;
}

.toast.error {
    background: var(--danger-color);
}

.toast.success {
    background: var(--secondary-color);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ============================================
   响应式设计
   ============================================ */

/* 移动端顶部栏 - 默认隐藏 */
.mobile-header {
    display: none;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 12px 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 1001;
}

.mobile-header h1 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.toggle-sidebar-btn,
.mobile-locate-btn,
.close-sidebar-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-sidebar-btn:hover,
.mobile-locate-btn:hover,
.close-sidebar-btn:hover {
    background: rgba(255,255,255,0.3);
}

.close-sidebar-btn {
    display: none;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

/* 移动端遮罩层 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    /* 显示移动端顶部栏 */
    .mobile-header {
        display: flex;
    }
    
    .app-container {
        flex-direction: column;
    }
    
    /* 侧边栏改为抽屉式 */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        max-height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-header {
        position: relative;
        padding: 20px 16px;
    }
    
    .sidebar-header h1 {
        font-size: 1.3rem;
        padding-right: 40px;
    }
    
    .close-sidebar-btn {
        display: flex;
    }
    
    /* 地图占满剩余空间 */
    .map-container {
        flex: 1;
        height: calc(100vh - 64px);
    }
    
    /* 隐藏桌面端侧边栏头部标题（移动端用顶栏） */
    
    /* 面板样式优化 */
    .panel {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .panel h3 {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
    
    /* 搜索框优化 */
    .search-container {
        flex-wrap: nowrap;
    }
    
    #search-input {
        flex: 1;
        min-width: 0;
        font-size: 16px; /* 防止 iOS 自动缩放 */
    }
    
    .search-btn,
    .locate-btn {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }
    
    /* 速度预设按钮 */
    .speed-presets {
        flex-wrap: nowrap;
        gap: 6px;
    }
    
    .speed-preset {
        flex: 1;
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    
    /* POI筛选列表优化 */
    .poi-filter-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .filter-checkbox {
        font-size: 0.85rem;
        padding: 8px;
    }
    
    /* 评分卡片优化 */
    .score-card {
        padding: 16px;
    }
    
    .score-circle {
        width: 70px;
        height: 70px;
    }
    
    .score-value {
        font-size: 1.8rem;
    }
    
    /* 雷达图容器 */
    .radar-chart-container {
        margin: 12px 0;
    }
    
    #radar-chart {
        height: 220px !important;
    }
    
    /* 分类评分优化 */
    .category-scores {
        gap: 8px;
    }
    
    .category-score-item {
        padding: 10px;
    }
    
    /* 图例优化 */
    .legend {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .legend-item {
        flex: 1 0 45%;
        font-size: 0.85rem;
    }
    
    /* POI 弹出框优化 */
    .leaflet-popup-content {
        min-width: 200px;
        max-width: 280px;
    }
    
    .poi-popup {
        padding: 10px;
    }
    
    .poi-popup h4 {
        font-size: 1rem;
    }
    
    /* 底部留出安全区域（iPhone等） */
    .sidebar-footer {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
}

/* 小屏手机进一步优化 */
@media (max-width: 375px) {
    .mobile-header h1 {
        font-size: 1rem;
    }
    
    .sidebar {
        width: 90%;
    }
    
    .panel h3 {
        font-size: 0.9rem;
    }
    
    .speed-preset {
        font-size: 0.8rem;
        padding: 8px 4px;
    }
    
    .poi-filter-list {
        grid-template-columns: 1fr;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 50%;
        max-width: 300px;
    }
    
    .map-container {
        height: 100vh;
    }
    
    .mobile-header {
        padding: 8px 16px;
    }
}


/* ============================================
   可分析区域提示
   ============================================ */

/* 地图上贴在蓝框顶边的标签 */
.coverage-label {
    background: #2563eb;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}

.coverage-label::before {
    border-top-color: #2563eb;
}

/* 侧栏里的规模说明 */
.coverage-stats {
    color: #64748b;
    font-size: 12px;
}

/* 「框外不可分析」这句要能一眼看到 */
.coverage-hint {
    color: #b45309;
    font-size: 12px;
    font-weight: 600;
}

/* 选择器里没有数据的城市 */
.city-selector option:disabled {
    color: #94a3b8;
}

.toast.info {
    background: #2563eb;
}
