/* 全局样式 - 暗色主题 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
    overflow: hidden;
    background: #0a0e1a;
    color: #e0e0e0;
}

/* 顶部标题栏 - 深色主题（精简） */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 45px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.header h1 {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* 头部右侧区域：统计 + 图例按钮 */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-legend-btn {
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: #bfdbfe;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.6);
    transition: all 0.2s ease;
}

.header-legend-btn:hover {
    background: rgba(59, 130, 246, 0.35);
    color: #fff;
}

.stats-bar {
    display: flex;
    gap: 12px;
    font-size: 12px;
}

.stat-item {
    background: rgba(59, 130, 246, 0.12);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s;
}

.stat-item:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

/* 语言切换按钮 */
.language-toggle-btn {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 10px;
}

.language-toggle-btn:hover {
    background: rgba(59, 130, 246, 0.4);
    border-color: rgba(59, 130, 246, 0.5);
    color: #fff;
}

/* 移动端菜单按钮（汉堡菜单） - 默认隐藏，移动端显示 */
.mobile-menu-btn {
    display: none; /* 桌面端隐藏 */
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 12px;
    z-index: 10001;
    flex-shrink: 0;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background: #60a5fa;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover span {
    background: #fff;
}

/* 菜单打开状态动画 */
.sidebar.active ~ .header .mobile-menu-btn span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.sidebar.active ~ .header .mobile-menu-btn span:nth-child(2) {
    opacity: 0;
}

.sidebar.active ~ .header .mobile-menu-btn span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* 侧边栏 - 右侧深色风格 */
.sidebar {
    position: fixed;
    top: 45px;
    right: 0;
    width: 340px;
    height: calc(100vh - 45px);
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(15px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    z-index: 10000; /* 必须高于 sidebar-overlay (9997) */
    padding: 20px;
    transition: transform 0.3s ease;
}

.sidebar-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    color: #f0f0f0;
    font-size: 16px;
    font-weight: 500;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.sidebar-toggle:hover {
    color: #fff;
}

/* 侧边栏关闭按钮 */
.sidebar-close-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border-radius: 4px;
}

.sidebar-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* 侧边栏隐藏状态 */
.sidebar.collapsed {
    transform: translateX(100%);
}

/* 折叠后的小巧工具条 */
.sidebar-collapsed-bar {
    position: fixed;
    top: 80px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.sidebar-collapsed-bar button {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #d1d5db;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-collapsed-bar button:hover {
    background: rgba(59, 130, 246, 0.9);
    color: #fff;
    transform: translateX(-5px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.filter-section {
    margin-bottom: 25px;
}

.filter-section h4 {
    color: #d1d5db;
    font-size: 13px;
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    color: #d1d5db;
    font-size: 13px;
}

.filter-group label:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #fff;
}

.filter-group input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 11px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background: rgba(107, 114, 128, 0.3);
    color: #d1d5db;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.btn-secondary:hover {
    background: rgba(107, 114, 128, 0.5);
    color: #fff;
}

.legend-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#legendContent {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 6px;
    transition: all 0.2s;
    color: #d1d5db;
}

.legend-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #fff;
}

.legend-item img {
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* 地图容器 - 全屏 */
#map {
    position: fixed;
    top: 45px;
    left: 0;
    right: 340px;
    bottom: 32px;
    background: #0a0e1a;
    transition: right 0.3s ease;
}

#map.fullscreen {
    right: 0;
}

/* 底部状态栏（精简） */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 340px;
    height: 32px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 1000;
    transition: right 0.3s ease;
}

.bottom-bar.fullscreen {
    right: 0;
}

.coordinates-display {
    color: #9ca3af;
    font-size: 11px;
    font-family: 'Courier New', monospace;
}

.coordinates-display span {
    margin-right: 5px;
}

#lat-display, #lng-display {
    color: #60a5fa;
    font-weight: 600;
}

.scale-info {
    color: #9ca3af;
    font-size: 11px;
    flex-shrink: 0;
}

.footer-inline {
    color: #9ca3af;
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.footer-inline strong {
    color: #60a5fa;
    font-weight: 600;
}

.footer-inline a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-inline a:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* 左侧图例面板 */
.legend-panel {
    position: fixed;
    top: 80px;
    left: 20px;
    width: 280px;
    max-height: calc(100vh - 180px);
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 900;
    overflow: hidden;
    transition: all 0.3s;
}

.legend-panel.hidden {
    transform: translateX(-320px);
    opacity: 0;
}

.legend-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.legend-header h3 {
    color: #f0f0f0;
    font-size: 15px;
    font-weight: 500;
    margin: 0;
}

.legend-toggle {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.legend-toggle:hover {
    color: #fff;
}

.legend-content {
    padding: 15px;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

.legend-category {
    margin-bottom: 15px;
}

.legend-category-title {
    color: #60a5fa;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(96, 165, 250, 0.2);
}

.legend-sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px;
    margin: 3px 0;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 12px;
    color: #d1d5db;
}

.legend-sub-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #fff;
}

.legend-sub-item img {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* Leaflet 控件样式调整 */
.leaflet-control-zoom a {
    background-color: rgba(17, 24, 39, 0.9) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.leaflet-control-zoom a:hover {
    background-color: rgba(59, 130, 246, 0.9) !important;
}

/* 加载提示 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 20px;
}

.loading-overlay.hidden {
    display: none;
}

/* 移动端侧边栏遮罩层 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9997;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* 移动端浮动筛选按钮 - 默认隐藏 */
.mobile-floating-filter-btn {
    display: none; /* 默认隐藏，仅移动端显示 */
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.mobile-floating-filter-btn:active {
    transform: scale(0.95);
}

.mobile-floating-filter-btn svg {
    width: 24px;
    height: 24px;
}

.mobile-floating-filter-btn span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 自定义 Popup 样式 - 专业简洁（参考P2） */
.leaflet-popup-content-wrapper {
    background: rgba(17, 24, 39, 0.97) !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6) !important;
    padding: 12px !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: auto !important;
    min-width: 260px !important;
    max-width: 300px !important;
}

.leaflet-popup-tip {
    background: rgba(17, 24, 39, 0.98) !important;
}

.custom-popup {
    font-family: 'Microsoft YaHei', sans-serif;
}

.custom-popup h3 {
    margin: 0 0 8px 0;
    color: #f0f0f0;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
    font-weight: 400;
    word-wrap: break-word;
}

.custom-popup p {
    margin: 4px 0;
    font-size: 11px;
    color: #d1d5db;
    line-height: 1.4;
    word-wrap: break-word;
}

.custom-popup strong {
    color: #9ca3af;
    display: inline-block;
    min-width: 60px;
    font-weight: 400;
}

.severity-high {
    color: #e74c3c;
    font-weight: bold;
}

.severity-medium {
    color: #f39c12;
    font-weight: bold;
}

.severity-low {
    color: #27ae60;
    font-weight: bold;
}

.popup-link {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.8);
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 400;
    transition: all 0.2s;
    text-align: center;
    width: 100%;
}

.popup-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* 灾害图标样式增强 */
.disaster-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    transition: transform 0.2s;
}

.disaster-icon:hover {
    transform: scale(1.1);
}

/* 根据严重程度添加光晕效果 */
.severity-高 {
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.8)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.severity-中 {
    filter: drop-shadow(0 0 6px rgba(251, 146, 60, 0.6)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.severity-低 {
    filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.5)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

/* 所有标记的基础样式 */
.custom-marker-icon,
.custom-cluster-icon {
    background: transparent !important;
    border: none !important;
}

.marker-wrapper,
.cluster-marker {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: all 0.2s;
    cursor: pointer;
}

.marker-wrapper:hover,
.cluster-marker:hover {
    transform: scale(1.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
}

.cluster-count {
    color: white;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* 多事件弹窗样式 */
.cluster-popup-content {
    max-height: 400px;
    overflow-y: auto;
}

.cluster-header {
    padding: 10px 0;
    margin-bottom: 12px;
    background: transparent;
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
    border-left: 4px solid;
    padding-left: 12px;
}

.cluster-header h3 {
    margin: 0 0 6px 0;
    color: #f0f0f0;
    font-size: 15px;
    font-weight: 500;
}

.cluster-severity {
    margin: 0;
    font-size: 12px;
    color: #d1d5db;
}

.cluster-severity strong {
    color: #60a5fa;
}

.cluster-events-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cluster-event-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s;
}

.cluster-event-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.event-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    font-weight: bold;
    font-size: 12px;
    flex-shrink: 0;
}

.event-details {
    flex: 1;
    min-width: 0;
}

.event-details h4 {
    margin: 0 0 6px 0;
    color: #f0f0f0;
    font-size: 13px;
    font-weight: 500;
    word-wrap: break-word;
}

.event-details p {
    margin: 3px 0;
    font-size: 12px;
    color: #d1d5db;
}

.popup-link-small {
    display: inline-block;
    margin-top: 6px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
}

.popup-link-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* 事件详情模态窗口 */
.details-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
}

.details-modal-content {
    background: rgba(17, 24, 39, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    max-width: 700px;
    max-height: 80vh;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.details-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 32px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.details-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.details-modal-body {
    padding: 20px;
    max-height: 75vh;
    overflow-y: auto;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
}

.loading-spinner .spinner {
    margin: 0 auto 20px;
}

.loading-spinner p {
    color: #9ca3af;
    font-size: 14px;
}

.event-details-content {
    padding: 10px 0;
}

/* 标题栏 */
.details-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
}

.details-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.details-title-row h2 {
    color: #f0f0f0;
    font-size: 18px;
    margin: 0;
    flex: 1;
    line-height: 1.4;
}

.severity-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.details-category {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #9ca3af;
    font-size: 13px;
}

.category-icon {
    font-size: 14px;
}

/* 时间信息 */
.details-time-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.time-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(34, 197, 94, 0.08));
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.time-icon {
    font-size: 18px;
    line-height: 1;
}

.time-item h5 {
    color: #9ca3af;
    font-size: 11px;
    margin: 0 0 4px 0;
    text-transform: uppercase;
    font-weight: 500;
}

.time-item p {
    color: #f0f0f0;
    font-size: 13px;
    margin: 0;
    font-weight: 500;
}

/* 位置信息 */
.details-location-section {
    margin-bottom: 20px;
}

.details-location-section h3 {
    color: #f0f0f0;
    font-size: 14px;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.section-icon {
    font-size: 16px;
}

.location-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.location-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.location-item.full {
    grid-column: 1 / -1;
}

.location-item h5 {
    color: #9ca3af;
    font-size: 11px;
    margin: 0 0 4px 0;
    text-transform: uppercase;
    font-weight: 500;
}

.location-item p {
    color: #f0f0f0;
    font-size: 13px;
    margin: 0;
    line-height: 1.4;
}

/* 详细描述 */
.details-description-section {
    margin-bottom: 20px;
}

.details-description-section h3 {
    color: #f0f0f0;
    font-size: 14px;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.description-box {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(59, 130, 246, 0.08));
    padding: 12px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.description-box p {
    color: #d1d5db;
    font-size: 13px;
    margin: 0;
    line-height: 1.6;
}

/* 来源链接 */
.details-source-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.source-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(34, 197, 94, 0.2));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    color: #60a5fa;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.source-link-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(34, 197, 94, 0.3));
    border-color: rgba(59, 130, 246, 0.5);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.error-message {
    text-align: center;
    padding: 40px 20px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 15px;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-message h3 {
    color: #ef4444;
    font-size: 16px;
    margin: 0 0 10px 0;
}

.error-message p {
    color: #f0f0f0;
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.error-detail {
    color: #9ca3af !important;
    font-size: 12px !important;
    margin-bottom: 20px !important;
    font-family: monospace;
}

/* 滚动条美化 */
/* Scrollbar Styling - Global */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.8);
}

/* Modal Scrollbar */
.details-modal-body::-webkit-scrollbar {
    width: 6px;
}

.details-modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.details-modal-body::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 3px;
}

.details-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

/* Map adjusted for single bottom bar */
#map {
    bottom: 40px !important;
}

/* 滚动条美化 */
.sidebar::-webkit-scrollbar,
#legendContent::-webkit-scrollbar,
.legend-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
#legendContent::-webkit-scrollbar-track,
.legend-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.sidebar::-webkit-scrollbar-thumb,
#legendContent::-webkit-scrollbar-thumb,
.legend-content::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
#legendContent::-webkit-scrollbar-thumb:hover,
.legend-content::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.8);
}

/* ========================================
   Mobile Responsive Styles
   ======================================== */
@media screen and (max-width: 768px) {
    /* 显示移动端菜单按钮 - 强制显示！ */
    .mobile-menu-btn {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: relative !important;
    }
    
    /* Header 优化 */
    .header {
        height: 50px;
        padding: 0 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .header h1 {
        font-size: 13px;
        flex: 1;
        margin: 0 6px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        order: 2; /* 标题在中间 */
    }
    
    .mobile-menu-btn {
        order: 1; /* 菜单按钮在最左边 */
    }
    
    .header-right {
        order: 3;
        gap: 6px;
    }
    
    .stats-bar {
        display: none; /* 小屏仍然隐藏统计，保留 Legend 按钮 */
    }
    
    .header-legend-btn {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }
    
    /* Sidebar 全屏覆盖优化 */
    .sidebar {
        width: 100%;
        max-width: 340px;
        top: 0;
        height: 100vh;
        transform: translateX(100%);
        z-index: 9998;
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.7);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding-top: 60px; /* 为关闭按钮留空间 */
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        transform: translateX(100%);
    }
    
    /* 侧边栏头部：移动端不再吸顶，随内容滚动 */
    .sidebar-header {
        position: static;
        top: auto;
        background: transparent;
        padding-top: 0;
        padding-bottom: 12px;
    }
    
    /* 侧边栏关闭按钮增强 */
    .sidebar-close-btn {
        width: 36px;
        height: 36px;
        font-size: 32px;
    }
    
    /* Map 全屏显示 */
    #map {
        right: 0 !important;
        top: 50px;
        bottom: 0;
    }
    
    /* Bottom bar - 在移动端保持显示，但使用紧凑布局 */
    .bottom-bar {
        right: 0;
        height: 32px;
        padding: 4px 10px;
        font-size: 10px;
        gap: 4px;
    }
    
    .bottom-bar .coordinates-display {
        font-size: 10px;
    }
    
    .bottom-bar .scale-info {
        font-size: 9px;
    }
    
    .bottom-bar .footer-inline {
        font-size: 9px;
        white-space: nowrap;
    }
    
    /* Legend panel 移动端优化 */
    .legend-panel {
        width: calc(100% - 40px);
        max-width: 320px;
        left: 20px;
        top: 70px;
        max-height: calc(100vh - 150px);
        border-radius: 8px;
    }
    
    .legend-panel.hidden {
        transform: translateX(-100vw);
    }
    
    /* 侧边栏折叠工具条在移动端同样保留，作为稳定入口 */
    .sidebar-collapsed-bar {
        display: flex;
    }
    
    /* 显示移动端浮动筛选按钮（额外入口，可选） */
    .mobile-floating-filter-btn {
        display: flex !important;
    }
    
    /* 当侧边栏打开时隐藏浮动按钮 */
    body.sidebar-open .mobile-floating-filter-btn {
        opacity: 0;
        pointer-events: none;
    }
    
    /* Modal 移动端优化 */
    .details-modal-content {
        width: calc(100% - 20px);
        margin: 10px;
        max-height: 92vh;
        border-radius: 12px;
    }
    
    .details-modal-body {
        padding: 16px;
        max-height: 80vh;
    }
    
    .details-modal-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 28px;
    }
    
    /* 筛选器按钮增大以便触摸 */
    .btn-primary,
    .btn-secondary {
        padding: 14px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    .filter-group label {
        padding: 12px;
        font-size: 14px;
        border-radius: 8px;
    }
    
    .filter-group input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 12px;
    }
    
    /* Popup 移动端优化 */
    .leaflet-popup-content-wrapper {
        border-radius: 8px !important;
    }
    
    .custom-popup h3 {
        font-size: 14px;
    }
    
    .custom-popup p {
        font-size: 12px;
    }
    
    .popup-link,
    .popup-link-small {
        padding: 10px 14px;
        font-size: 12px;
        border-radius: 6px;
    }
    
    /* 增强触摸目标大小 */
    .legend-toggle-btn,
    .expand-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* 图例面板内容 */
    .legend-category-title {
        font-size: 14px;
        padding-bottom: 6px;
    }
    
    .legend-sub-item {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .legend-sub-item img {
        width: 24px;
        height: 24px;
    }
}

@media screen and (max-width: 480px) {
    /* Extra small screens */
    .header h1 {
        font-size: 11px;
    }
    
    .mobile-menu-btn {
        width: 28px;
        height: 24px;
    }
    
    .mobile-menu-btn span {
        height: 2.5px;
    }
    
    /* 侧边栏全宽 */
    .sidebar {
        max-width: 100%;
    }
    
    /* 筛选器区域 */
    .filter-section h4 {
        font-size: 12px;
    }
    
    .filter-group label {
        font-size: 13px;
    }
    
    /* 图例面板 */
    .legend-panel {
        width: calc(100% - 20px);
        left: 10px;
        top: 60px;
    }
    
    .legend-header h3 {
        font-size: 14px;
    }
    
    /* Modal */
    .details-modal-content {
        width: calc(100% - 10px);
        margin: 5px;
    }
    
    .details-header .details-title-row h2 {
        font-size: 16px;
    }
    
    .location-grid {
        grid-template-columns: 1fr; /* 单列布局 */
    }
    
    .details-time-section {
        grid-template-columns: 1fr; /* 单列布局 */
    }
}
