/* ==== 全局变量 ==== */
:root {
    --primary-color: #1677FF;
    --primary-hover: #4096ff;
    --primary-active: #0958d9;
    /* 毛玻璃背景 - 更透明以确保 blur 可见 */
    --bg-glass: rgba(30, 30, 30, 0.65);
    --bg-glass-light: rgba(40, 40, 40, 0.55);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-highlight: rgba(255, 255, 255, 0.12);
    --text-primary: #e0e0e0;
    --text-secondary: #888;
    --shadow-float: 0 10px 40px rgba(0, 0, 0, 0.35);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;
    --gap-md: 16px;
    --gap-sm: 8px;
    --control-height: 36px;
    --font-mono: 'SF Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* ==== 统一悬浮面板基类 ==== */
.floating-panel {
    /* 毛玻璃效果 */
    background: var(--bg-glass) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;

    /* 圆角与边框 */
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--border-glass) !important;

    /* 阴影：外阴影 + 内高光 */
    box-shadow:
        var(--shadow-float),
        var(--shadow-inset) !important;

    /* 文字颜色 */
    color: var(--text-primary) !important;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background-color: #121212;
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ==== 地图全屏 ==== */
#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* ==== 左侧悬浮控制面板 ==== */
#controls {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 280px;
    max-height: calc(100vh - 32px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease, opacity 0.2s ease;
}

/* 应用悬浮面板基类样式 */
#controls:not(.collapsed) {
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-float), var(--shadow-inset);
}

#controls .panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--gap-md) var(--gap-md);
}

/* ==== Dock 折叠模式 ==== */
#controls.collapsed {
    width: 56px;
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-float);
}

/* 折叠时完全隐藏内容区域 */
#controls.collapsed .panel-header h2,
#controls.collapsed .panel-content {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

#controls.collapsed .panel-header {
    justify-content: center;
    padding: var(--gap-sm);
    border-bottom: none;
}

#controls.collapsed .btn-toggle-toolbar i {
    transform: rotate(180deg);
}

/* ==== Dock 图标列表 ==== */
/* 仅在折叠状态显示 */
#controls.collapsed .dock-icons {
    display: flex !important;
    flex-direction: column;
    gap: var(--gap-sm);
    padding: var(--gap-sm);
}

/* 展开时完全隐藏 Dock 图标 */
#controls:not(.collapsed) .dock-icons {
    display: none !important;
}

.dock-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.dock-icon:hover {
    background: var(--primary-color);
    color: white;
}

.dock-icon[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 52px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1001;
}

/* Dock 图标 FontAwesome 显示确保 */
.dock-icon i,
.dock-icon i.fa-solid,
.dock-icon i.fa-regular {
    font-size: 18px !important;
    color: inherit !important;
    opacity: 1 !important;
    display: inline-block !important;
    visibility: visible !important;
    line-height: 1 !important;
}

.dock-icon:hover i {
    color: white !important;
}

/* ==== 面板头部 ==== */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--gap-md);
    border-bottom: 1px solid var(--border-glass);
    flex-shrink: 0;
}

.panel-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.btn-toggle-toolbar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-toggle-toolbar:hover {
    background: var(--primary-color);
    color: white;
}

.btn-toggle-toolbar i {
    transition: transform 0.3s ease;
}

/* ==== 右侧图层面板（悬浮卡片） ==== */
#layerPanel {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 320px;
    max-height: calc(100vh - 32px);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#layerPanel.open {
    display: flex;
}

/* 图层面板固定头部 */
.layer-panel-header {
    flex-shrink: 0;
    padding: var(--gap-md);
    border-bottom: 1px solid var(--border-glass);
}

.layer-panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.layer-panel-title h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.layer-panel-title h2 i {
    color: var(--primary-color);
}

/* 图层搜索框 */
.layer-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    height: var(--control-height);
}

.layer-search-box i {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.layer-search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.layer-search-box input::placeholder {
    color: var(--text-secondary);
}

.btn-clear-search {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.btn-clear-search:hover {
    color: var(--text-primary);
}

/* 图层面板可滚动内容区域 */
.layer-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* 图层分组（可折叠） */
.layer-section {
    border-bottom: 1px solid var(--border-glass);
}

.layer-section:last-child {
    border-bottom: none;
}

.layer-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px var(--gap-md);
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.layer-section-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.layer-section-header h3 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.layer-section-header h3 i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.layer-section-count {
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.section-toggle {
    color: var(--text-secondary);
    transition: transform 0.2s;
    font-size: 0.75rem;
}

.layer-section.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.layer-section-content {
    padding: 0 var(--gap-md) var(--gap-md);
}

.layer-section.collapsed .layer-section-content {
    display: none;
}

/* 图层列表滚动区域 */
.layer-list-scroll {
    max-height: 40vh;
    overflow-y: auto;
}

/* ==== Accordion 手风琴 ==== */
.accordion-section {
    border-bottom: 1px solid var(--border-glass);
}

.accordion-section:last-child {
    border-bottom: none;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px var(--gap-md);
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.accordion-header h3 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
}

.accordion-header h3 i {
    color: var(--primary-color);
    width: 18px;
    text-align: center;
}

.accordion-header .collapse-icon {
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.accordion-section.collapsed .accordion-header .collapse-icon {
    transform: rotate(-90deg);
}

.accordion-content {
    padding: 0 var(--gap-md) var(--gap-md);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accordion-section.collapsed .accordion-content {
    display: none;
}

.btn-toggle-toolbar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #3d3d3d;
    color: #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.btn-toggle-toolbar:hover {
    background: #4a9eff;
}

.btn-toggle-toolbar i {
    transition: transform 0.3s ease;
}

#layerPanel {
    border-left: 1px solid #333;
    display: none;
    /* Hidden by default, toggled by button */
}

/* Editor Panel Overlay */
#editorPanel {
    position: absolute;
    bottom: 20px;
    left: 340px;
    right: 20px;
    height: 400px;
    background: rgba(30, 30, 30, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

#geojsonEditor {
    width: 100%;
    height: 300px;
    background: #121212;
    color: #f0f0f0;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    resize: none;
    margin-bottom: 15px;
    flex-grow: 1;
    line-height: 1.5;
}

.panel h2 {
    margin-top: 0;
    font-size: 1rem;
    color: #fff;
    text-align: center;
    margin-bottom: var(--gap-md);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ==== 控件组样式 ==== */
.control-group {
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
}

.control-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.control-group select,
.control-group input[type="file"],
.control-group input[type="number"],
.control-group input[type="text"] {
    height: var(--control-height);
    padding: 0 12px;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transition: border-color 0.2s, background 0.2s;
}

.control-group select:focus,
.control-group input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.control-group input[type="file"] {
    padding: 8px;
    height: auto;
}

/* ==== 按钮系统 ==== */
/* 主按钮（Primary） */
.control-group button,
.btn-primary {
    height: var(--control-height);
    padding: 0 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--primary-color);
    color: white;
}

.control-group button:hover,
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.control-group button:active,
.btn-primary:active {
    background: var(--primary-active);
    transform: translateY(0);
}

/* 次按钮（Secondary / Outline） */
.btn-secondary,
.btn-outline {
    height: var(--control-height);
    padding: 0 16px;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    color: var(--text-primary);
}

.btn-secondary:hover,
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 文字按钮（Text） */
.btn-text {
    height: var(--control-height);
    padding: 0 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    color: var(--text-secondary);
}

.btn-text:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* 按钮行 */
.btn-row {
    flex-direction: row !important;
    gap: var(--gap-sm);
}

.btn-row button {
    flex: 1;
}

/* Checkbox 样式 */
.control-group input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* 等宽数字 */
.mono,
.coordinates,
.lat-lng {
    font-family: var(--font-mono);
}

/* ==== 输入框组合样式 ==== */
.input-with-btn {
    display: flex;
    gap: var(--gap-sm);
}

.input-with-btn input {
    flex: 1;
}

.input-with-btn button {
    width: var(--control-height);
    padding: 0;
    flex-shrink: 0;
}

.coord-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap-sm);
}

/* 图标按钮 */
.btn-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
}

/* 拾取的坐标显示 */
.picked-coords {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    min-height: 20px;
}

/* Accordion header actions */
.accordion-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Checkbox 行 */
.checkbox-row label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* ==== 地图缩放控件（左下角） ==== */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow-float) !important;
    margin-left: 16px !important;
    margin-bottom: 16px !important;
}

.leaflet-control-zoom a {
    background: var(--bg-glass) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-primary) !important;
    /* 增大点击区域到 44x44px */
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
    font-size: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.leaflet-control-zoom a:hover {
    background: var(--primary-color) !important;
    color: white !important;
}

.leaflet-control-zoom-in {
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
    border-bottom: none !important;
}

.leaflet-control-zoom-out {
    border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
}

/* 隐藏分隔线 */
.divider,
hr.divider {
    display: none;
}

/* ==== 自定义滚动条 ==== */
.panel-content::-webkit-scrollbar,
#layerList::-webkit-scrollbar,
.accordion-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track,
#layerList::-webkit-scrollbar-track,
.accordion-content::-webkit-scrollbar-track {
    background: transparent;
}

.panel-content::-webkit-scrollbar-thumb,
#layerList::-webkit-scrollbar-thumb,
.accordion-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover,
#layerList::-webkit-scrollbar-thumb:hover,
.accordion-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Layer list items */
#layerList {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.layer-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 3px solid #4a90e2;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.layer-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.layer-name {
    font-weight: 600;
    color: #f0f0f0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.layer-type {
    font-size: 0.75rem;
    color: #888;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.layer-actions {
    display: flex;
    gap: 6px;
}

.layer-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
}

.layer-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.layer-btn.delete {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.layer-btn.delete:hover {
    background: #e74c3c;
    color: #fff;
}

/* Leaflet map container adjustments */
.leaflet-container {
    background: #0e0e0e;
}

/* Divider */
.divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    margin: 20px 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Layer labels */
.layer-label {
    background: rgba(0, 0, 0, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px !important;
    color: #fff !important;
    font-size: 0.85rem !important;
    padding: 4px 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
    font-family: 'Segoe UI', sans-serif !important;
}

.layer-label::before {
    border-top-color: rgba(0, 0, 0, 0.8) !important;
    line-height: 1.5;
}

.panel h2 {
    margin-top: 0;
    font-size: 1.1rem;
    color: #fff;
    text-align: center;
    margin-bottom: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.control-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: #aaa;
}

.control-group select,
.control-group input[type="file"],
.control-group input[type="number"],
.control-group input[type="text"],
.control-group button {
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
}

.control-group select,
.control-group input[type="number"],
.control-group input[type="text"] {
    background: #2c2c2c;
    color: #e0e0e0;
    border: 1px solid #444;
    transition: border-color 0.2s;
}

.control-group select:focus,
.control-group input:focus {
    border-color: #4a90e2;
}

.control-group button {
    background: #4a90e2;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.control-group button:hover {
    background: #357ab8;
    transform: translateY(-1px);
}

.control-group button:active {
    transform: translateY(0);
}

.control-group input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

/* Layer list items */
#layerList {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.layer-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 3px solid #4a90e2;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.layer-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.layer-name {
    font-weight: 600;
    color: #f0f0f0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.layer-type {
    font-size: 0.75rem;
    color: #888;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.layer-actions {
    display: flex;
    gap: 6px;
}

.layer-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
}

.layer-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.layer-btn.delete {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.layer-btn.delete:hover {
    background: #e74c3c;
    color: #fff;
}

/* Leaflet map container adjustments */
.leaflet-container {
    background: #0e0e0e;
}

/* Divider */
.divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    margin: 20px 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Layer labels */
.layer-label {
    background: rgba(0, 0, 0, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px !important;
    color: #fff !important;
    font-size: 0.85rem !important;
    padding: 4px 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
    font-family: 'Segoe UI', sans-serif !important;
}

.layer-label::before {
    border-top-color: rgba(0, 0, 0, 0.8) !important;
}

/* Context Menu */
.context-menu {
    position: absolute;
    background: rgba(35, 35, 35, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px 0;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 10000;
}

.context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    color: #e0e0e0;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.context-menu-item:hover {
    background: rgba(74, 144, 226, 0.2);
    color: #fff;
}

/* ==== Leaflet Draw 工具栏 - 玻璃风格 ==== */
.leaflet-draw-section {
    background: var(--bg-glass) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border-glass) !important;
    box-shadow: var(--shadow-float) !important;
    overflow: hidden;
}

.leaflet-draw-toolbar {
    background: transparent !important;
    border: none !important;
}

.leaflet-draw-toolbar a,
.leaflet-draw-actions a {
    /* 尺寸: 内容30px + padding 4px = 38px */
    width: 38px !important;
    height: 38px !important;
    padding: 4px !important;
    /* 用于居中 Sprite */

    /* 关键设置：让 Sprite 坐标相对于内容框计算 */
    background-origin: content-box !important;
    background-clip: content-box !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    background-repeat: no-repeat !important;

    /* 移除 background-position 和 background-size 的强制覆盖 */

    /* 布局 */
    display: block !important;
    position: relative !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 4px !important;
    margin-bottom: 3px !important;
    box-sizing: border-box !important;

    /* 隐藏文字 */
    font-size: 0 !important;
    color: transparent !important;
    text-indent: -9999px !important;
    overflow: hidden !important;
}

/* 隐藏按钮内部的所有子元素及伪元素 */
.leaflet-draw-toolbar a>*,
.leaflet-draw-actions a>*,
.leaflet-draw-toolbar a::before,
.leaflet-draw-actions a::before,
.leaflet-draw-toolbar a::after,
.leaflet-draw-actions a::after {
    display: none !important;
    content: none !important;
}

.leaflet-draw-toolbar a:hover,
.leaflet-draw-actions a:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* Disabled state */
.leaflet-draw-toolbar .leaflet-disabled {
    background-color: rgba(200, 200, 200, 0.5) !important;
    border-color: rgba(100, 100, 100, 0.3) !important;
}

.leaflet-draw-toolbar .leaflet-disabled>* {
    opacity: 0.5 !important;
}

/* Leaflet Draw 工具栏定位 - 避免被左侧面板遮挡 */
.leaflet-draw {
    z-index: 999 !important;
}

/* 重置 Leaflet 默认的控件容器定位 */
.leaflet-top.leaflet-left {
    /* 默认状态：面板展开时 */
    /* 面板宽度 280px + 左偏移 16px + 间距 16px = 312px */
    left: 312px !important;
    top: 16px !important;
}

/* 折叠状态：使用 body 类选择器 */
/* 折叠后 Dock 宽度 56px + 左偏移 16px + 间距 16px = 88px */
body.ui-collapsed .leaflet-top.leaflet-left {
    left: 88px !important;
}

/* 确保工具栏本身没有额外偏移 */
.leaflet-left .leaflet-draw {
    margin-left: 0 !important;
    margin-top: 0 !important;
}

/* Custom Marker Icon Container */
.custom-marker-icon {
    background: transparent !important;
    border: none !important;
}

.custom-marker-wrapper {
    position: relative;
    width: 30px;
    height: 42px;
}

.custom-marker-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.9);
    position: relative;
    z-index: 2;
    transition: transform 0.2s;
}

.custom-marker-circle:hover {
    transform: scale(1.1);
}

.custom-marker-circle i {
    color: white;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.custom-marker-tip {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid;
    z-index: 1;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

/* ===== Event Tracker Panel ===== */
#eventTrackerPanel {
    width: 320px;
    border-left: 1px solid #333;
    display: none;
}


.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    flex: 1;
}

#closeEventTrackerBtn {
    background: #e74c3c;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
    z-index: 10;
    position: relative;
}

#closeEventTrackerBtn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}


.tracker-section {
    margin-bottom: 25px;
}

.tracker-section h3 {
    font-size: 0.9rem;
    color: #4a90e2;
    margin: 0 0 12px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Card-style Lists */
.todo-item,
.url-item,
.timeline-event {
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.todo-item:hover,
.url-item:hover,
.timeline-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-color: #4a90e2;
}

/* Component Styles */
.todo-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.url-input-group,
.timeline-input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.todo-input-group input {
    flex: 1;
    min-width: 0;
}

.url-input-group input[type="text"],
.url-input-group input[type="url"] {
    flex: 1 1 100%;
    min-width: 0;
}

.timeline-input-group input[type="datetime-local"] {
    flex: 1 1 45%;
    min-width: 120px;
}

.timeline-input-group input[type="text"] {
    flex: 1 1 45%;
    min-width: 80px;
}

.todo-input-group input,
.url-input-group input,
.timeline-input-group input {
    background: #1a1a1a;
    border: 1px solid #444;
    padding: 10px 12px;
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}


.timeline-input-group input[type="datetime-local"] {
    font-family: 'Consolas', monospace;
    color-scheme: dark;
}

.todo-input-group input:focus,
.url-input-group input:focus,
.timeline-input-group input:focus {
    border-color: #4a90e2;
    outline: none;
}

.todo-input-group button,
.url-input-group button,
.timeline-input-group button {
    background: #4a90e2;
    color: white;
    border: none;
    width: 38px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-weight: normal;
    padding: 0;
}

.todo-input-group button:hover,
.url-input-group button:hover,
.timeline-input-group button:hover {
    background: #357ab8;
    transform: translateY(-1px);
}

/* Specific Item Tweaks */
.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.todo-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4a90e2;
}

.todo-item-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #e0e0e0;
}

.todo-item-text.completed {
    color: #666;
    text-decoration: line-through;
}

.todo-item-time {
    font-size: 0.75rem;
    color: #666;
    margin-left: 8px;
    white-space: nowrap;
}

.todo-item-delete,
.url-item-delete,
.timeline-event-delete {
    background: transparent;
    color: #666;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.todo-item-delete:hover,
.url-item-delete:hover,
.timeline-event-delete:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

/* URL Items */
.url-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.url-item a {
    flex: 1;
    color: #4a90e2;
    text-decoration: none;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.url-item a:hover {
    text-decoration: underline;
}

/* Timeline specific */
.timeline-event {
    border-left: 3px solid #4a90e2;
    padding-left: 15px;
    padding-right: 35px;
    /* Make room for delete button */
}

/* Remove old dot styles as we are using cards now */
.timeline-event::before {
    display: none;
}

#timelineDisplay {
    padding-left: 0;
}

.timeline-event-date {
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    color: #4a90e2;
    margin-bottom: 6px;
    font-weight: bold;
}

.timeline-event-title {
    font-size: 1rem;
    font-weight: 500;
    color: #e0e0e0;
    margin-bottom: 4px;
}

.timeline-event-description {
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.4;
    margin-top: 4px;
}

.timeline-event-delete {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Notes Textarea */
#eventNotes {
    width: 100%;
    background: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95rem;
    resize: vertical;
    outline: none;
    min-height: 100px;
    transition: border-color 0.2s;
}

#eventNotes:focus {
    border-color: #4a90e2;
}

/* Save Button */
#saveEventDataBtn {
    width: 100%;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    margin-top: 10px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(46, 204, 113, 0.2);
    transition: all 0.2s;
    font-size: 1rem;
}

#saveEventDataBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(46, 204, 113, 0.3);
}

.timeline-input-group input[type="text"] {
    flex: 2;
}

.timeline-input-group input[type="datetime-local"] {
    flex: 1.5;
}

/* ==== Event List View Styles ==== */
#eventListView {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#eventListContainer {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
    padding-right: 5px;
}

.event-card {
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-card:hover {
    border-color: #4a90e2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.event-card-info {
    flex: 1;
}

.event-card-date {
    font-size: 0.8rem;
    color: #4a90e2;
    margin-bottom: 4px;
    font-family: 'Consolas', monospace;
}

.event-card-name {
    font-size: 1rem;
    font-weight: 500;
    color: #e0e0e0;
}

.event-card-actions {
    display: flex;
    gap: 8px;
}

.event-card-actions button {
    padding: 6px 12px;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit {
    background: #4a90e2;
    color: white;
}

.btn-edit:hover {
    background: #357ab8;
}

.btn-delete {
    background: transparent;
    color: #e74c3c;
    border: 1px solid #e74c3c !important;
}

.btn-delete:hover {
    background: #e74c3c;
    color: white;
}

.btn-add-event {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: linear-gradient(135deg, #4a90e2, #357ab8);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* Event Edit View */
#eventEditView {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.edit-view-header {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.btn-back {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #444;
    color: #aaa;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

#currentEventName {
    flex: 1;
    padding: 10px 12px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
}

#currentEventName:focus {
    border-color: #4a90e2;
    outline: none;
}

.scrollable-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    max-height: calc(100vh - 320px);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #444;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ==== Archive Section Styles ==== */
.archive-section {
    margin-top: 10px;
}

.archive-section h3 {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 10px;
}

.archive-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.archive-controls select {
    flex: 1;
    padding: 8px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    font-size: 0.85rem;
}

.archive-controls button {
    padding: 8px 12px;
    font-size: 0.85rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.archive-controls button:first-of-type {
    background: #4a90e2;
    color: white;
}

.archive-controls button:last-of-type {
    background: #2ecc71;
    color: white;
}

.archive-controls button:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.archive-hint {
    font-size: 0.75rem;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

/* ==== New Archive Management Styles ==== */
.archive-create {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.archive-create input {
    flex: 1;
    padding: 8px 10px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    font-size: 0.85rem;
}

.archive-create button {
    padding: 8px 14px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.archive-create button:hover {
    background: #357ab8;
}

.archive-list {
    max-height: 200px;
    overflow-y: auto;
}

.archive-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #252525;
    border-radius: 4px;
    margin-bottom: 6px;
    border: 1px solid #333;
}

.archive-item:hover {
    border-color: #4a90e2;
}

.archive-item-name {
    flex: 1;
    font-size: 0.85rem;
    color: #e0e0e0;
}

.archive-item-date {
    font-size: 0.7rem;
    color: #666;
    margin-right: 10px;
}

.archive-item-actions {
    display: flex;
    gap: 5px;
}

.archive-item-actions button {
    padding: 4px 8px;
    font-size: 0.75rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.archive-item-actions .load-btn {
    background: #2ecc71;
    color: white;
}

.archive-item-actions .delete-btn {
    background: transparent;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.current-archive {
    margin-top: 12px;
    padding: 10px;
    background: rgba(74, 144, 226, 0.15);
    border: 1px solid #4a90e2;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.current-archive span {
    font-size: 0.85rem;
    color: #4a90e2;
}

.current-archive button {
    padding: 6px 12px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* ==== Attachment Styles ==== */
.attachment-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.attachment-upload input[type="file"] {
    display: none;
}

.upload-btn {
    padding: 8px 14px;
    background: #4a90e2;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.upload-btn:hover {
    background: #357ab8;
}

.upload-hint {
    font-size: 0.75rem;
    color: #666;
}

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

.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #252525;
    border-radius: 4px;
    border: 1px solid #333;
}

.attachment-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.attachment-item-icon {
    font-size: 1.2rem;
}

.attachment-item-name {
    font-size: 0.85rem;
    color: #e0e0e0;
}

.attachment-item-size {
    font-size: 0.7rem;
    color: #666;
}

.attachment-item-actions {
    display: flex;
    gap: 5px;
}

.attachment-item-actions button {
    padding: 4px 8px;
    font-size: 0.75rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    background: #4a90e2;
    color: white;
}

.attachment-item-actions .delete-btn {
    background: transparent;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

/* ==== Icon Picker Modal ==== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.icon-picker-modal {
    background: #2a2a2a;
    border-radius: 12px;
    width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #444;
}

.modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
}

.btn-close-modal {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #444;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-close-modal:hover {
    background: #e74c3c;
}

.icon-preview-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #222;
}

.icon-preview {
    transform: scale(2);
    margin: 10px 0 20px;
}

#selectedIconLabel {
    color: #aaa;
    font-size: 0.9rem;
}

.picker-section {
    padding: 16px 20px;
    border-top: 1px solid #333;
}

.picker-section label {
    display: block;
    color: #aaa;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.selected {
    border-color: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.icon-option {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
    border-radius: 8px;
    cursor: pointer;
    color: #ccc;
    font-size: 1.1rem;
    border: 2px solid transparent;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.icon-option:hover {
    background: #444;
    transform: scale(1.1);
}

.icon-option.selected {
    border-color: #4a90e2;
    background: #3a3a3a;
    color: #4a90e2;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #444;
}

.btn-cancel {
    padding: 8px 20px;
    border-radius: 6px;
    border: 1px solid #555;
    background: transparent;
    color: #ccc;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-cancel:hover {
    background: #333;
}

.btn-apply {
    padding: 8px 24px;
    border-radius: 6px;
    border: none;
    background: #4a90e2;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-apply:hover {
    background: #3a80d2;
}

/* ==== Import Modal ==== */
.import-modal {
    background: #2a2a2a;
    border-radius: 12px;
    width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
}

.import-stats {
    padding: 16px 20px;
    background: #222;
}

.import-stats h4 {
    margin: 0 0 12px 0;
    color: #aaa;
    font-size: 0.9rem;
    font-weight: normal;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #333;
    border-radius: 6px;
}

.stat-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.stat-icon.point {
    background: #4a90e2;
}

.stat-icon.line {
    background: #e2a04a;
}

.stat-icon.polygon {
    background: #4ae24a;
}

.stat-icon.other {
    background: #9b4ae2;
}

.stat-info {
    flex: 1;
}

.stat-count {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.stat-label {
    font-size: 0.75rem;
    color: #888;
}

.import-mode-section {
    padding: 16px 20px;
    border-top: 1px solid #333;
}

.import-mode-section>label {
    display: block;
    color: #aaa;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.import-mode-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #333;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.radio-option:hover {
    background: #3a3a3a;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #4a90e2;
}

.radio-label {
    font-weight: 500;
    color: #fff;
}

.radio-option small {
    width: 100%;
    margin-left: 26px;
    color: #888;
    font-size: 0.8rem;
}

/* ==== Enhanced Layer List ==== */
.layer-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background: #2a2a2a;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #333;
}

.layer-btn-main {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    background: #333;
    color: #e0e0e0;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, transform 0.1s;
}

.layer-btn-main:hover {
    background: #3d3d3d;
    transform: translateX(2px);
}

.layer-icon {
    font-size: 1rem;
    width: 24px;
    text-align: center;
}

.layer-btn-main .layer-name {
    flex: 1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-btn-main .layer-type {
    font-size: 0.75rem;
    color: #888;
    background: #444;
    padding: 2px 6px;
    border-radius: 4px;
}

.event-badge {
    background: #4a90e2;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.layer-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.layer-actions .layer-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    background: #3a3a3a;
    color: #aaa;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.layer-actions .layer-btn:hover {
    background: #4a90e2;
    color: white;
}

.layer-actions .layer-btn.delete:hover {
    background: #e74c3c;
}

/* ==== Marker Popup Enhancements ==== */
.marker-popup h3 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #333;
}

.marker-popup p {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
}

.btn-copy {
    padding: 2px 8px;
    font-size: 0.75rem;
    border: none;
    border-radius: 3px;
    background: #4a90e2;
    color: white;
    cursor: pointer;
    margin-left: 4px;
}

.btn-copy:hover {
    background: #3a80d2;
}

.popup-events {
    background: #f5f5f5;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
}

.popup-events-header {
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #ddd;
}

.popup-event-item {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 4px 0;
    font-size: 0.8rem;
}

.popup-event-date {
    color: #4a90e2;
    font-weight: 500;
    font-size: 0.75rem;
}

.popup-event-name {
    color: #333;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.popup-event-more {
    text-align: center;
    color: #888;
    font-size: 0.75rem;
    font-style: italic;
    margin-top: 6px;
}

.popup-actions {
    display: flex;
    gap: 6px;
}

.btn-popup-action {
    flex: 1;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    background: #4a90e2;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background 0.2s;
}

.btn-popup-action:hover {
    background: #3a80d2;
}

/* ==== Share Modal ==== */
.btn-share {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-share:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-row {
    display: flex;
    gap: 8px;
}

.btn-row button {
    flex: 1;
}

.share-modal {
    background: #2a2a2a;
    border-radius: 12px;
    width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
}

.share-preview-section {
    padding: 20px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.share-loading {
    color: #888;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.share-options {
    display: flex;
    gap: 10px;
    padding: 20px;
}

.share-option-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border: 1px solid #444;
    border-radius: 10px;
    background: #333;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
}

.share-option-btn:hover {
    background: #3d3d3d;
    border-color: #4a90e2;
    transform: translateY(-2px);
}

.share-option-btn i {
    font-size: 1.4rem;
    color: #4a90e2;
}

.share-option-btn span {
    font-size: 0.85rem;
}

.share-status {
    padding: 12px 20px;
    margin: 0 20px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
}

.share-status.success {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.share-status.error {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* ==== Property Drawer (Side Panel) ==== */
.property-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
}

.property-drawer.active {
    pointer-events: all;
}

.drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}

.property-drawer.active .drawer-overlay {
    background: rgba(0, 0, 0, 0.5);
    pointer-events: all;
}

.drawer-content {
    position: absolute;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 90vw;
    height: 100%;
    background: #2a2a2a;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.3);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.property-drawer.active .drawer-content {
    right: 0;
}

.drawer-header {
    padding: 20px;
    background: #333;
    border-bottom: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.drawer-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #fff;
}

.btn-close-drawer {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #444;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close-drawer:hover {
    background: #e74c3c;
    transform: rotate(90deg);
}

.drawer-body {
    height: calc(100vh - 200px);
    max-height: 800px;
    overflow-y: auto;
    padding: 20px;
}

.drawer-body::-webkit-scrollbar {
    width: 8px;
}

.drawer-body::-webkit-scrollbar-track {
    background: #222;
}

.drawer-body::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.drawer-body::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.property-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.property-section:last-child {
    border-bottom: none;
}

.property-section h3 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: #4a90e2;
    font-weight: 600;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #aaa;
    font-weight: 500;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #4a90e2;
}

/* Coordinate Display */
.coord-display {
    background: #1a1a1a;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid #333;
}

.coord-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.coord-item:last-of-type {
    margin-bottom: 12px;
}

.coord-item label {
    font-size: 0.85rem;
    color: #888;
}

.coord-item span {
    font-family: 'Courier New', monospace;
    color: #4a90e2;
    font-weight: 600;
}

.btn-copy-coord {
    width: 100%;
    padding: 8px;
    background: #333;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-copy-coord:hover {
    background: #4a90e2;
    border-color: #4a90e2;
}

/* Icon Preview */
.icon-preview-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-icon-display {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: #1a1a1a;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-marker {
    position: relative;
    width: 36px;
    height: 48px;
    background: #4a90e2;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-marker i {
    transform: rotate(45deg);
    font-size: 1.2rem;
    color: white;
}

.btn-change-icon {
    flex: 1;
    padding: 10px 14px;
    background: #333;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-change-icon:hover {
    background: #4a90e2;
    border-color: #4a90e2;
}

/* Custom Properties */
.custom-props-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.custom-prop-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
}

.custom-prop-item span {
    min-width: 80px;
    font-size: 0.85rem;
    color: #4a90e2;
    font-weight: 600;
}

.custom-prop-item input {
    flex: 1;
    padding: 6px 8px;
    background: #222;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    font-size: 0.85rem;
}

.custom-prop-item button {
    padding: 6px 12px;
    background: #e74c3c;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.custom-prop-item button:hover {
    background: #c0392b;
}

.add-property-form {
    display: flex;
    gap: 6px;
}

.add-property-form input {
    flex: 1;
    padding: 8px 10px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
}

.add-property-form button {
    padding: 8px 14px;
    background: #4a90e2;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: background 0.2s;
}

.add-property-form button:hover {
    background: #357abd;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    width: 100%;
    padding: 12px;
    background: #333;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #4a90e2;
    border-color: #4a90e2;
}

.action-btn.danger {
    background: #2a2020;
    border-color: #5a3030;
}

.action-btn.danger:hover {
    background: #e74c3c;
    border-color: #e74c3c;
}

/* Drawer Footer */
.drawer-footer {
    padding: 16px 20px;
    background: #222;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.drawer-footer .btn-cancel,
.drawer-footer .btn-save {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.drawer-footer .btn-cancel {
    background: #3a3a3a;
    color: #aaa;
}

.drawer-footer .btn-cancel:hover {
    background: #444;
    color: #fff;
}

.drawer-footer .btn-save {
    background: #4a90e2;
    color: white;
}

.drawer-footer .btn-save:hover {
    background: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* ==== Marker Highlight Animation ==== */
.marker-pin.highlighted {
    animation: markerPulse 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

@keyframes markerPulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    }

    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1));
    }
}

/* ===== Property Editor Modal ===== */
.property-editor-modal {
    background: rgba(30, 30, 30, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid #444;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.property-section {
    margin-bottom: 20px;
}

.property-section label,
.property-section h4 {
    display: block;
    margin-bottom: 8px;
    color: #e0e0e0;
    font-size: 0.9rem;
    font-weight: 600;
}

.property-section h4 {
    font-size: 1rem;
    color: #4a90e2;
    margin-top: 5px;
}

.property-section input {
    width: 100%;
    padding: 10px;
    background: #2c2c2c;
    border: 1px solid #444;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.property-section input:focus {
    border-color: #4a90e2;
    outline: none;
}

#customPropertyList {
    margin-bottom: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.custom-prop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.custom-prop-item:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(74, 144, 226, 0.3);
}

.custom-prop-item span {
    font-weight: 600;
    color: #4a90e2;
    min-width: 100px;
    font-size: 0.85rem;
}

.custom-prop-item input {
    flex: 1;
    padding: 6px 10px;
    font-size: 0.85rem;
}

.custom-prop-item button {
    padding: 6px 12px;
    background: rgba(231, 76, 60, 0.8);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.custom-prop-item button:hover {
    background: #e74c3c;
    transform: translateY(-1px);
}

.add-property-row {
    display: flex;
    gap: 8px;
}

.add-property-row input {
    flex: 1;
}

.add-property-row button {
    padding: 10px 20px;
    background: #4a90e2;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    font-weight: 500;
}

.add-property-row button:hover {
    background: #357ab8;
    transform: translateY(-1px);
}

/* ==== Group Marker & Spiderfy Styles ==== */
.group-marker-icon {
    background: transparent !important;
    border: none !important;
}

.group-marker-icon .marker-pin.group-marker {
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(74, 144, 226, 0.4);
    border: 2px solid white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.group-marker-icon .marker-pin.group-marker:hover {
    transform: rotate(-45deg) scale(1.1);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.6);
}

.group-marker-icon .marker-pin.group-marker i {
    transform: rotate(45deg);
    color: white;
    font-size: 16px;
}

/* 数量徽标 */
.group-marker-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    min-width: 22px;
    min-height: 22px;
    width: auto;
    height: auto;
    padding: 2px 5px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    z-index: 10;
    box-sizing: border-box;
    animation: badgePop 0.3s ease-out;
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }

    70% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* 放射连接线 */
.spider-leg {
    stroke-dasharray: 4, 4;
    animation: legDash 0.5s linear infinite;
}

@keyframes legDash {
    to {
        stroke-dashoffset: -8;
    }
}

/* 展开状态的子标记 */
.spiderfied-marker .marker-pin {
    animation: spiderfyIn 0.2s ease-out;
}

@keyframes spiderfyIn {
    0% {
        opacity: 0;
        transform: rotate(-45deg) scale(0.5);
    }

    100% {
        opacity: 1;
        transform: rotate(-45deg) scale(1);
    }
}

/* ==== Layer Statistics Styles ==== */
.layer-stats {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.stats-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 10px;
}

.stats-total {
    font-size: 28px;
    font-weight: bold;
    color: #4a90e2;
}

.stats-label {
    font-size: 14px;
    color: #888;
}

.stats-group-badge {
    background: #ff6b6b;
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

.stats-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stats-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.stats-type {
    width: 60px;
    color: #aaa;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.stats-bar-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #4a90e2, #67b7dc);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.stats-count {
    color: #ccc;
    min-width: 24px;
    text-align: right;
}

.stats-empty {
    color: #666;
    font-size: 12px;
    text-align: center;
    padding: 10px 0;
}

/* ==== Selection Highlight Styles ==== */
.layer-item.selected {
    background: rgba(74, 144, 226, 0.2);
    border-left: 3px solid #4a90e2;
}

.layer-item.selected .layer-btn-main {
    color: #4a90e2;
}

/* Table row selected */
.tabulator-row.tabulator-selected {
    background: rgba(74, 144, 226, 0.3) !important;
}

.tabulator-row.tabulator-selected:hover {
    background: rgba(74, 144, 226, 0.4) !important;
}

/* Layer disabled state */
.layer-item.hidden {
    opacity: 0.5;
}

.layer-item.hidden .layer-btn-main {
    text-decoration: line-through;
}

/* ==== Custom Group Management Styles ==== */

/* Selection Mode Body Class */
body.selection-mode #map {
    cursor: crosshair;
}

body.selection-mode .marker-pin {
    cursor: pointer;
}

/* Multi-select Mode Indicator */
body.selection-mode::before {
    content: "📦 选择模式 - 点击标记加入组";
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(74, 144, 226, 0.95);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Selection Highlight for Markers */
.marker-pin.selection-highlight {
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.8), 0 0 20px rgba(255, 107, 107, 0.6) !important;
    animation: selectionPulse 1s infinite;
}

@keyframes selectionPulse {

    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.8), 0 0 20px rgba(255, 107, 107, 0.6);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(255, 107, 107, 0.6), 0 0 30px rgba(255, 107, 107, 0.4);
    }
}

/* Custom Group Section */
.custom-group-section {
    margin-top: 10px;
}

.custom-group-section h3 {
    font-size: 0.95rem;
    color: #fff;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.group-selection-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.group-selection-controls button {
    background: linear-gradient(135deg, #4a90e2, #357ab8);
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.group-selection-controls button:hover {
    background: linear-gradient(135deg, #357ab8, #2968a3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

#finishSelectionBtn {
    background: linear-gradient(135deg, #27ae60, #1e8449) !important;
}

#finishSelectionBtn:hover {
    background: linear-gradient(135deg, #1e8449, #196f3d) !important;
}

#selectionCount {
    font-size: 0.85rem;
    color: #ff6b6b;
    font-weight: 600;
    text-align: center;
    padding: 6px;
    background: rgba(255, 107, 107, 0.15);
    border-radius: 4px;
}

/* Custom Group List */
.custom-group-list {
    max-height: 200px;
    overflow-y: auto;
}

.empty-groups {
    color: #666;
    font-size: 0.85rem;
    text-align: center;
    padding: 15px;
    font-style: italic;
}

.custom-group-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    border-left: 4px solid #ff6b6b;
}

.custom-group-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.group-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
}

.group-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.group-name {
    font-weight: 500;
    color: #f0f0f0;
    font-size: 0.9rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-count {
    background: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.group-actions {
    display: flex;
    gap: 4px;
}

.group-actions button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    color: #aaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.group-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.group-actions button.delete:hover {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

/* ==== Timeline Section Styles (地图历史) ==== */

.timeline-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0;
}

.timeline-section:not(.collapsed) .timeline-header {
    margin-bottom: 10px;
}

.timeline-header:hover {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin: -6px;
    padding: 6px;
}

.timeline-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: #fff;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-header h3 i {
    color: #4a90e2;
}

.timeline-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-header-actions button {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.timeline-header-actions button:hover {
    background: linear-gradient(135deg, #357abd, #2968a3);
    transform: scale(1.05);
}

.collapse-icon {
    color: #888;
    transition: transform 0.3s ease;
}

.timeline-section.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.timeline-list {
    max-height: 150px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* 折叠状态 */
.timeline-section.collapsed .timeline-list {
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* 左侧面板收起时隐藏历史地图 */
#controls.collapsed .timeline-section,
#controls.collapsed .timeline-section+.divider {
    display: none;
}

.timeline-empty {
    color: #666;
    font-size: 0.8rem;
    text-align: center;
    padding: 10px;
    font-style: italic;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.timeline-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.timeline-item.active {
    background: rgba(74, 144, 226, 0.15);
    border-left-color: #4a90e2;
}

.timeline-marker {
    font-size: 0.8rem;
    color: #666;
    flex-shrink: 0;
}

.timeline-item.active .timeline-marker {
    color: #4a90e2;
}

.timeline-content {
    flex: 1;
    cursor: pointer;
    min-width: 0;
}

.timeline-name {
    font-weight: 500;
    color: #f0f0f0;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-date {
    font-size: 0.75rem;
    color: #888;
}

.timeline-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.timeline-item:hover .timeline-actions {
    opacity: 1;
}

.timeline-actions button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    color: #aaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all 0.2s;
}

.timeline-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.timeline-actions button.delete:hover {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

/* ==== Dashboard Panel Styles ==== */

/* Dashboard button (right bottom, offset from table button) */
.dashboard-btn {
    right: 90px !important;
    background: linear-gradient(135deg, #9b59b6, #8e44ad) !important;
}

.dashboard-btn:hover {
    background: linear-gradient(135deg, #8e44ad, #7d3c98) !important;
}

/* Dashboard panel (right top) */
.dashboard-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    max-height: calc(100vh - 450px);
    background: rgba(30, 30, 30, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;

    /* Default: hidden */
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    transition: all 0.3s ease;
}

.dashboard-panel.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(155, 89, 182, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px 12px 0 0;
}

.dashboard-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-header h3 i {
    color: #9b59b6;
}

.btn-close-dashboard {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close-dashboard:hover {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

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

.dashboard-empty {
    color: #666;
    font-size: 0.85rem;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Overview section */
.dashboard-overview {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.overview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

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

.overview-label {
    flex: 1;
    color: #888;
    font-size: 0.85rem;
}

.overview-value {
    font-weight: 600;
    color: #fff;
    font-size: 0.9rem;
}

/* Layer breakdown */
.dashboard-layer {
    margin-bottom: 16px;
}

.dashboard-layer .layer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.dashboard-layer .layer-name {
    font-weight: 600;
    color: #f0f0f0;
    font-size: 0.9rem;
}

.dashboard-layer .layer-status {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
}

.dashboard-layer .layer-status.visible {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
}

.dashboard-layer .layer-status.hidden {
    background: rgba(127, 140, 141, 0.2);
    color: #7f8c8d;
}

.dashboard-layer .layer-count {
    margin-left: auto;
    font-size: 0.85rem;
    color: #aaa;
}

.layer-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Type statistics with color preview */
.type-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.type-stat-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.stat-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.symbol-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
}

.stat-type {
    flex: 1;
    color: #ccc;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-count {
    font-weight: 600;
    color: #9b59b6;
    font-size: 0.9rem;
    min-width: 24px;
    text-align: right;
}

.type-empty {
    color: #666;
    font-size: 0.8rem;
    text-align: center;
    padding: 10px;
    font-style: italic;
}

/* ==== Unified Tools FAB Menu ==== */

.tools-fab-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

.tools-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tools-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.5);
}

.tools-fab.active {
    transform: rotate(45deg);
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.tools-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    /* 毛玻璃效果 - 半透明背景 */
    background: rgba(20, 20, 20, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);

    /* 横向排列 */
    display: flex;
    flex-direction: row;
    gap: 4px;

    /* Default: hidden */
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    pointer-events: none;
    transition: all 0.2s ease;
}

.tools-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.tools-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
}

.tools-menu-item:hover {
    background: rgba(74, 144, 226, 0.2);
    color: #fff;
}

.tools-menu-item i {
    width: 20px;
    text-align: center;
    color: #4a90e2;
}

/* Hide old floating buttons */
.floating-btn {
    display: none !important;
}

/* Dashboard button offset - deprecated */
.dashboard-btn {
    display: none !important;
}

/* ==== Layer Details Panel Styles ==== */

.layer-list-section h3,
.layer-details-panel h3,
.layer-actions-section h3 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #fff;
    font-weight: 600;
}

.layer-details-panel {
    max-height: 280px;
    overflow-y: auto;
}

.layer-details-content {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 12px;
}

.layer-details-content .no-selection {
    color: #666;
    font-size: 0.85rem;
    text-align: center;
    padding: 20px 10px;
    font-style: italic;
}

.layer-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.layer-detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #888;
    font-size: 0.85rem;
}

.detail-value {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
}

.style-distribution {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.distribution-title {
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.style-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.style-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.style-icon {
    width: 18px;
    text-align: center;
    color: #888;
    font-size: 0.75rem;
}

.style-type {
    flex: 1;
    color: #ccc;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.style-count {
    color: #4a90e2;
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 30px;
    text-align: right;
}

.style-more {
    color: #666;
    font-size: 0.75rem;
    text-align: center;
    padding: 6px 0;
    font-style: italic;
}

.layer-quick-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.layer-quick-actions button {
    flex: 1;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.layer-quick-actions button:hover {
    background: linear-gradient(135deg, #357abd, #2968a3);
    transform: translateY(-1px);
}

.layer-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layer-action-buttons .btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.layer-action-buttons .btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-1px);
}

/* ==== Layer Search Bar ==== */
.layer-search-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.layer-search-bar input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 8px 12px;
    color: #fff;
    font-size: 0.85rem;
}

.layer-search-bar input::placeholder {
    color: #888;
}

.layer-search-bar input:focus {
    outline: none;
    border-color: #4a90e2;
    background: rgba(255, 255, 255, 0.12);
}

.layer-search-bar button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 8px 12px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}

.layer-search-bar button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ==== Search Results ==== */
.search-results-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    margin-bottom: 12px;
    max-height: 150px;
    overflow-y: auto;
}

.search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.search-result-item:hover {
    background: rgba(74, 144, 226, 0.2);
}

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

.result-name {
    color: #fff;
    font-size: 0.85rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-type {
    color: #888;
    font-size: 0.75rem;
    margin-left: 8px;
}

.result-more,
.no-results {
    padding: 8px 12px;
    color: #666;
    font-size: 0.75rem;
    text-align: center;
    font-style: italic;
}

/* ==== Scrollable Style Distribution ==== */
.style-distribution-scroll {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.style-distribution-scroll::-webkit-scrollbar {
    width: 6px;
}

.style-distribution-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.style-distribution-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.style-distribution-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==== Browse Mode Styles ==== */

/* 浏览按钮 */
.timeline-header-actions .browse-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.timeline-header-actions .browse-btn:hover {
    background: linear-gradient(135deg, #8e44ad, #7d3c98);
}

/* 浏览模式状态条 */
.browse-mode-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(142, 68, 173, 0.2));
    border: 1px solid rgba(155, 89, 182, 0.4);
    border-radius: 8px;
    margin: 10px 0;
}

.browse-mode-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.browse-mode-label {
    color: #9b59b6;
    font-size: 0.75rem;
    font-weight: 600;
}

.browse-mode-snapshot {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
}

.browse-mode-actions {
    display: flex;
    gap: 8px;
}

.browse-mode-actions button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.browse-mode-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.browse-mode-actions button.exit {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #e74c3c;
}

.browse-mode-actions button.exit:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
}

/* 浏览模式提示 */
.browse-mode-hint {
    background: rgba(155, 89, 182, 0.15);
    border: 1px dashed rgba(155, 89, 182, 0.4);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    color: #bb8fce;
    font-size: 0.8rem;
    text-align: center;
}

/* 浏览模式下的快照项 */
.timeline-item.browse-mode {
    border-left: 3px solid #9b59b6;
}

.timeline-item.browse-mode:hover {
    background: rgba(155, 89, 182, 0.15);
}

.timeline-item.browse-mode.active {
    background: rgba(155, 89, 182, 0.25);
    border-left-color: #e74c3c;
}

/* 时间线计数 */
.timeline-meta {
    display: flex;
    gap: 10px;
    align-items: center;
}

.timeline-count {
    color: #888;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ==== 浏览模式专用样式 ==== */

/* 浏览模式地图遮罩提示 */
.browse-mode-map-overlay {
    position: fixed;
    top: 70px;
    right: 16px;
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.browse-overlay-content {
    background: rgba(155, 89, 182, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

.browse-overlay-content i {
    font-size: 1rem;
}

/* 浏览模式下禁用右键菜单编辑操作 */
body.browse-mode-active #contextMenu .context-menu-item[onclick*="edit"],
body.browse-mode-active #contextMenu .context-menu-item[onclick*="delete"],
body.browse-mode-active #contextMenu .context-menu-item[onclick*="change"] {
    opacity: 0.4;
    pointer-events: none;
}

/* 浏览模式下禁用属性抽屉编辑 */
body.browse-mode-active #propertyDrawer input,
body.browse-mode-active #propertyDrawer textarea,
body.browse-mode-active #propertyDrawer select,
body.browse-mode-active #propertyDrawer button:not(.btn-close) {
    opacity: 0.5;
    pointer-events: none;
}

/* 浏览模式状态条 - 左上角悬浮小条 */
.browse-mode-bar {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(155, 89, 182, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(155, 89, 182, 0.4);
    color: white;
    font-size: 0.85rem;
}

.browse-mode-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.browse-mode-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.browse-mode-snapshot {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 10px;
    border-radius: 12px;
}

/* 浏览模式按钮样式 */
.browse-mode-bar button {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.browse-mode-bar button.exit {
    background: rgba(231, 76, 60, 0.9);
    padding: 6px 8px;
}

.browse-mode-bar button.apply {
    background: rgba(46, 204, 113, 0.9);
}

.browse-mode-bar button:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 浏览模式提示 */
.browse-mode-hint {
    background: rgba(155, 89, 182, 0.1);
    border: 1px dashed rgba(155, 89, 182, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: #9b59b6;
    text-align: center;
}

/* ==== Leaflet.draw 工具栏修复 ==== */

/* 工具栏容器定位 - 避免与左侧面板重叠 */
.leaflet-top.leaflet-left {
    left: 310px !important;
    top: 16px !important;
    transition: left 0.3s ease;
}

/* 左侧面板折叠时调整位置 */
body.ui-collapsed .leaflet-top.leaflet-left {
    left: 80px !important;
}

/* 工具栏整体样式 */
.leaflet-draw.leaflet-control {
    background: var(--bg-glass) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border-glass) !important;
    box-shadow: var(--shadow-float) !important;
    overflow: hidden;
    margin: 0 !important;
}

/* 工具栏按钮 - 修复图标显示 */
.leaflet-draw-toolbar a,
.leaflet-draw-actions a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;

    /* 背景色 - 不使用 background shorthand 以保留 sprite */
    background-color: transparent !important;
    background-repeat: no-repeat !important;
    /* 让 Leaflet.draw 自行设置 background-position */

    /* 图标居中 */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    border: none !important;
    border-radius: 0 !important;
    transition: background-color 0.2s !important;
}

.leaflet-draw-toolbar a:hover,
.leaflet-draw-actions a:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* 隐藏按钮内的子元素（防止双图标） */
.leaflet-draw-toolbar a>*,
.leaflet-draw-actions a>*,
.leaflet-draw-toolbar a::before,
.leaflet-draw-actions a::before,
.leaflet-draw-toolbar a::after,
.leaflet-draw-actions a::after {
    display: none !important;
    content: none !important;
}

/* 分隔线 */
.leaflet-draw-toolbar-top {
    border-bottom: 1px solid var(--border-glass) !important;
}

/* 动作按钮样式 */
.leaflet-draw-actions {
    background: var(--bg-glass) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: var(--radius-sm) !important;
}

.leaflet-draw-actions a {
    color: var(--text-primary) !important;
    font-size: 0.75rem !important;
    padding: 0 10px !important;
    width: auto !important;
}

/* ==== Zoom 控件样式 ==== */
.leaflet-control-zoom {
    background: var(--bg-glass) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border-glass) !important;
    box-shadow: var(--shadow-float) !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    background: transparent !important;
    color: var(--text-primary) !important;
    border: none !important;
    font-size: 18px !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.leaflet-control-zoom-in {
    border-bottom: 1px solid var(--border-glass) !important;
}

/* ==== 表格定位按钮样式 ==== */
.table-locate-btn {
    background: transparent;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.table-locate-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.table-locate-btn i {
    font-size: 14px;
}

/* 表格滚动条增强 */
#featureTable .tabulator-tableholder {
    overflow: auto !important;
}

#featureTable .tabulator-tableholder::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#featureTable .tabulator-tableholder::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

#featureTable .tabulator-tableholder::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#featureTable .tabulator-tableholder::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==== 右下角工具菜单毛玻璃 ==== */
.tools-fab-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.tools-fab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-glass) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid var(--border-glass) !important;
    box-shadow: var(--shadow-float) !important;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
}

.tools-fab:hover {
    background: var(--primary-color) !important;
    color: white;
    transform: scale(1.05);
}

.tools-menu {
    position: absolute;
    bottom: 60px;
    right: 0;
    background: var(--bg-glass) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-float) !important;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.tools-menu.open {
    display: flex;
}

.tools-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    text-align: left;
    white-space: nowrap;
}

.tools-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tools-menu-item i {
    width: 18px;
    text-align: center;
    color: var(--primary-color);
}

/* ==== 图层面板搜索框样式 ==== */
.layer-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    margin: 0 var(--gap-md) var(--gap-sm);
}

.layer-search-box i {
    color: var(--text-secondary);
    font-size: 14px;
}

.layer-search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.layer-search-box input::placeholder {
    color: var(--text-secondary);
}

.btn-clear-search {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-clear-search:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* 图层列表滚动区域 */
.layer-list-scroll {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

.layer-list-scroll::-webkit-scrollbar {
    width: 6px;
}

.layer-list-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.layer-list-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.layer-list-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==== backdrop-filter 降级方案 ==== */
@supports not (backdrop-filter: blur(10px)) {

    .floating-panel,
    #controls,
    .leaflet-draw.leaflet-control,
    .leaflet-control-zoom,
    .tools-fab,
    .tools-menu,
    #layerPanel {
        background: rgba(30, 30, 40, 0.95) !important;
    }
}

/* ==== 图层面板显示/隐藏 ==== */
.layer-panel {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 320px;
    max-height: calc(100vh - 32px);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.2s ease;
    transform: translateX(100%);
    opacity: 0;
}

.layer-panel.open {
    display: flex;
    transform: translateX(0);
    opacity: 1;
}

/* ==== Marker Clustering Styles ==== */
/* 聚合点样式 - 与项目整体风格一致 */

.marker-cluster-custom {
    background: transparent;
}

.cluster-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.cluster-icon:hover {
    transform: scale(1.1);
}

/* 小聚合点 (< 100) */
.cluster-small {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6ec857 0%, #4cae34 100%);
    font-size: 13px;
}

/* 中聚合点 (100-499) */
.cluster-medium {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #f5a623 0%, #e0910b 100%);
    font-size: 14px;
}

/* 大聚合点 (500+) */
.cluster-large {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    font-size: 15px;
}

/* 覆盖默认 MarkerCluster 样式 */
.marker-cluster-custom .cluster-icon span {
    display: block;
}


/* ==== 危险按钮样式 ==== */
.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-danger:active {
    transform: translateY(0);
}


/* ==== 隐藏图层样式 ==== */
.layer-item.layer-hidden {
    opacity: 0.5;
}

.layer-item.layer-hidden .layer-name {
    text-decoration: line-through;
    color: #888;
}

/* ==== 样式编辑器面板 ==== */
.layer-style-editor {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-top: 10px;
}

.style-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.style-row label {
    flex: 0 0 80px;
    font-size: 0.85rem;
    color: #ccc;
}

.style-row input[type="color"] {
    width: 40px;
    height: 32px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

.style-row input[type="range"] {
    flex: 1;
    accent-color: #4a90e2;
}

.style-row input[type="number"] {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 0.9rem;
}

.style-value {
    min-width: 40px;
    text-align: center;
    font-size: 0.85rem;
    color: #aaa;
}


/* ==== 图层列表项样式 ==== */
.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.layer-item.selected {
    background: rgba(74, 144, 226, 0.2);
    border-left: 3px solid #4a90e2;
}

.layer-item.layer-hidden {
    opacity: 0.5;
}

.layer-item.layer-hidden .layer-name {
    text-decoration: line-through;
    color: #888;
}

/* 图层主按钮 */
.layer-btn-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    text-align: left;
    padding: 4px;
    min-width: 0;
}

.layer-btn-main:hover {
    color: #4a90e2;
}

.layer-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.layer-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
}

.layer-type {
    font-size: 0.7rem;
    color: #888;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.event-badge {
    background: #e24a4a;
    color: white;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 10px;
    margin-left: 4px;
}

/* 图层操作按钮容器 */
.layer-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.layer-item:hover .layer-actions {
    opacity: 1;
}

/* 图层操作按钮 */
.layer-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
}

.layer-btn:hover {
    background: rgba(74, 144, 226, 0.3);
    color: #4a90e2;
}

.layer-btn.delete:hover {
    background: rgba(226, 74, 74, 0.3);
    color: #e24a4a;
}

/* ==== 事件追踪器面板 ==== */
#eventTrackerPanel {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 400px;
    max-height: calc(100vh - 32px);
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-float);
    z-index: 1100;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#eventTrackerPanel[style*="flex"] {
    display: flex !important;
}

#eventTrackerPanel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-glass);
}

#eventTrackerPanel .panel-header h2 {
    margin: 0;
    font-size: 1rem;
}

#eventListView {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 60vh;
    overflow-y: auto;
}

#eventListContainer {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-card {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.event-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-add-event {
    padding: 10px;
    background: rgba(74, 144, 226, 0.2);
    border: 1px dashed rgba(74, 144, 226, 0.5);
    border-radius: 8px;
    color: #4a90e2;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-event:hover {
    background: rgba(74, 144, 226, 0.3);
}

.empty-state {
    text-align: center;
    padding: 24px;
    color: #888;
}


/* ==== 事件追踪器面板 ==== */
#eventTrackerPanel {
    position: fixed;
    top: 16px;
    left: 320px;
    width: 400px;
    max-height: calc(100vh - 32px);
    z-index: 1001;
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-float);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#eventTrackerPanel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-glass);
}

#eventTrackerPanel .panel-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #4a90e2;
}

#eventTrackerPanel .panel-header button {
    padding: 6px 12px;
    background: rgba(255, 100, 100, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 6px;
    color: #ff6b6b;
    cursor: pointer;
    transition: all 0.2s;
}

#eventTrackerPanel .panel-header button:hover {
    background: rgba(255, 100, 100, 0.3);
}

#eventTrackerFeatureName {
    padding: 10px 16px;
    margin: 0;
    background: rgba(74, 144, 226, 0.1);
    border-bottom: 1px solid var(--border-glass);
}

#eventListView,
#eventEditView {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

#eventListContainer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.event-card {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.event-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #4a90e2;
}

.btn-add-event {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
}

.tracker-section {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.tracker-section h3 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #4a90e2;
}

.edit-view-header {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.edit-view-header .btn-back {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
}

.edit-view-header input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    color: white;
    font-size: 1rem;
}


/* UI Updates */
.layer-btn.active {
    color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
}

.disabled-by-cluster {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Browse Mode UI Locks */
body.browse-mode-active .layer-actions {
    display: none !important;
}

/* Layer Group Styles */
.layer-group-header {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    font-weight: 500;
    user-select: none;
}

.layer-group-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.layer-group-content {
    padding-left: 0;
}

.layer-group-content .layer-item {
    padding-left: 20px;
    border-left: 2px solid transparent;
}

.layer-group-content .layer-item:hover {
    border-left-color: var(--primary-color);
}


/* Selection Mode Visual Feedback */
body.selection-mode {
    cursor: crosshair;
}

body.selection-mode .map-container::before {
    content: '🎯 选择模式已激活 - 点击标记进行选择';
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(74, 158, 255, 0.95);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.marker-pin.selection-highlight {
    filter: drop-shadow(0 0 8px #4a9eff) brightness(1.3);
    transform: scale(1.15);
    transition: all 0.2s;
}


/* Selection Mode Fixes */
body.selection-mode {
    cursor: crosshair;
}

/* 确保选择模式下标记仍可点击 */
body.selection-mode .leaflet-marker-icon {
    cursor: pointer !important;
    pointer-events: auto !important;
}

body.selection-mode .custom-marker-icon {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* 选中高亮效果 */
.selection-highlight {
    filter: drop-shadow(0 0 8px #4a90e2) brightness(1.2);
    transform: scale(1.15);
    transition: all 0.2s ease;
}

/* 选择计数器样式 */
#selectionCount {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(74, 144, 226, 0.95);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    font-size: 0.9rem;
}


/* Layer Hidden State */
.layer-item.layer-hidden {
    opacity: 0.5;
}

.layer-item.layer-hidden .layer-name {
    text-decoration: line-through;
    opacity: 0.7;
}

/* Custom Group Selection Mode */
body.selection-mode * {
    cursor: crosshair !important;
}

.selection-highlight .marker-pin {
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.6) !important;
    transform: scale(1.15);
    transition: all 0.2s;
}


/* ==== Radius Rings Configuration ==== */
.section-hint {
    font-size: 0.8rem;
    color: #888;
    margin: -8px 0 12px 0;
}

.radius-rings-config {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.radius-ring-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.radius-ring-option:hover {
    background: rgba(22, 119, 255, 0.1);
    border-color: rgba(22, 119, 255, 0.3);
}

.radius-ring-option.selected {
    background: rgba(22, 119, 255, 0.2);
    border-color: #1677FF;
    color: #1677FF;
}

.radius-ring-option input[type="checkbox"] {
    display: none;
}

.radius-ring-option .radius-label {
    font-size: 0.85rem;
    font-weight: 500;
}

.radius-ring-option.selected .radius-label {
    color: #1677FF;
}

.radius-ring-option::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.2s;
}

.radius-ring-option.selected::before {
    background: #1677FF;
    border-color: #1677FF;
    box-shadow: inset 0 0 0 2px rgba(30, 30, 30, 0.8);
}

/* ==== 绘图工具栏默认隐藏 ==== */
/* 由左侧面板的"绘图工具"按钮控制显示/隐藏 */
.leaflet-draw {
    display: none;
}

/* ==== Screenshot Mode - Pure Map Only ==== */
/* 外部面板隐藏（仍使用 body.screenshot-mode 控制） */
body.screenshot-mode #controls,
body.screenshot-mode #layerPanel,
body.screenshot-mode #eventTrackerPanel,
body.screenshot-mode #iconPickerModal,
body.screenshot-mode #contextMenu,
body.screenshot-mode .toast-container,
body.screenshot-mode #briefMessageToast,
body.screenshot-mode .floating-panel,
body.screenshot-mode .table-view-toggle,
body.screenshot-mode #tableViewContainer,
body.screenshot-mode #featureTableContainer,
body.screenshot-mode .screenshot-loading-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* 截图模式：强制隐藏地图内部的所有控件 - 直接针对 #map */
#map.screenshot-mode .leaflet-control-container,
#map.screenshot-mode .leaflet-draw-toolbar,
#map.screenshot-mode .leaflet-bar,
#map.screenshot-mode .leaflet-control,
#map.screenshot-mode .leaflet-control-zoom,
#map.screenshot-mode .leaflet-control-attribution {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Keep map visible */
body.screenshot-mode #map {
    display: block !important;
    visibility: visible !important;
}

/* Screenshot Loading Overlay */
.screenshot-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.screenshot-loading-overlay .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* Screenshot Preview Modal */
.screenshot-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.screenshot-preview-modal img {
    max-width: 90vw;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.screenshot-preview-modal .actions {
    display: flex;
    gap: 12px;
}

.screenshot-preview-modal button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.screenshot-preview-modal .btn-download {
    background: #4a90e2;
    color: white;
}

.screenshot-preview-modal .btn-download:hover {
    background: #357abd;
}

.screenshot-preview-modal .btn-close {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.screenshot-preview-modal .btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==== Compact Map Labels (紧凑标签模式) ==== */
/* 覆盖 Leaflet 默认 tooltip 样式 */
.leaflet-tooltip.compact-map-label {
    /* 深色半透明背景 + 背景模糊 */
    background: rgba(30, 30, 30, 0.85) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    /* 去除默认边框和箭头 */
    border: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;

    /* 文字颜色 */
    color: #fff !important;

    /* 紧凑 padding 和圆角 */
    padding: 4px 8px !important;
    border-radius: 4px !important;

    /* 允许鼠标穿透，可点击底下的标记 */
    pointer-events: none !important;

    /* 禁用默认箭头 */
    white-space: normal !important;
}

/* 移除 Leaflet tooltip 的箭头 */
.leaflet-tooltip.compact-map-label::before {
    display: none !important;
}

/* 标签内容容器 */
.compact-map-label .label-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* 标签头部：名称 + 类型 */
.compact-map-label .label-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

/* 名称：粗体、不换行 */
.compact-map-label .label-name {
    font-weight: bold;
    font-size: 12px;
    white-space: nowrap;
    color: #fff;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 类型：小胶囊样式 */
.compact-map-label .label-type {
    display: inline-block;
    background: #1677FF;
    color: #fff;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 地址：浅灰色、多行截断（最多3行） */
.compact-map-label .label-address {
    /* 基础字体设置 */
    color: #ccc;
    font-size: 10px;
    line-height: 1.3;
    /* 增加行高提升可读性 */
    margin-top: 2px;

    /* 核心：多行截断 (最多3行) */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* 限制为 3 行 */
    -webkit-box-orient: vertical;
    /* 垂直排列 */
    overflow: hidden;
    /* 超出隐藏 */

    /* 布局设置 */
    white-space: normal;
    /* 允许文本换行 */
    max-width: 160px;
    /* 稍微放宽宽度，让换行更自然 */
    text-overflow: ellipsis;
}


/* ==== Marker Popup - 自定义字段布局 ==== */
.marker-popup .popup-title {
    margin: 0 0 10px 0;
    color: #4a90e2;
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.2;
}

.marker-popup .popup-fields {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.marker-popup .popup-field-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.88rem;
    line-height: 1.4;
}

.marker-popup .popup-field-label {
    color: #aaa;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 40px;
}

.marker-popup .popup-field-label::after {
    content: ':';
}

.marker-popup .popup-field-value {
    color: #eee;
    word-break: break-word;
    text-align: right;
}

.marker-popup .popup-coords {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: monospace;
    font-size: 0.82rem;
}

.marker-popup .btn-copy-coords {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 2px;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.marker-popup .btn-copy-coords:hover { opacity: 1; }

.marker-popup .popup-no-fields {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
}


/* ==== Popup Config Modal ==== */
.popup-config-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-config-modal {
    background: rgba(28, 28, 35, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    min-width: 400px;
    max-width: 480px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    padding: 0 0 20px 0;
    color: #e0e0e0;
}

.popup-config-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    background: rgba(28, 28, 35, 0.98);
    z-index: 1;
}

.popup-config-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-config-close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}
.popup-config-close-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.popup-config-desc {
    margin: 12px 20px 4px;
    font-size: 0.85rem;
    color: #888;
}

/* 字段列表 */
.popup-field-list {
    margin: 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.popup-config-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    transition: background 0.15s;
}
.popup-config-row:hover { background: rgba(255, 255, 255, 0.07); }

/* Toggle switch */
.popup-config-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.popup-config-toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: #444;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.popup-config-toggle input:checked + .toggle-slider { background: #1677FF; }
.popup-config-toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

.popup-config-label {
    flex: 1;
    font-size: 0.9rem;
    color: #e0e0e0;
}

.popup-config-key {
    font-size: 0.75rem;
    color: #666;
    font-family: monospace;
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.popup-config-builtin {
    font-size: 0.72rem;
    color: #555;
    background: rgba(255,255,255,0.04);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.06);
}

.popup-config-del-btn {
    background: none;
    border: none;
    color: #e24a4a;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.popup-config-del-btn:hover { background: rgba(226, 74, 74, 0.15); }

/* 添加字段区 */
.popup-add-field {
    margin: 16px 16px 0;
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
}

.popup-add-field h4 {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: #aaa;
    font-weight: normal;
}

.popup-add-field-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.popup-add-field-row input {
    flex: 1;
    min-width: 100px;
    padding: 7px 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    color: #e0e0e0;
    font-size: 0.85rem;
}
.popup-add-field-row input:focus {
    outline: none;
    border-color: #1677FF;
    background: rgba(22, 119, 255, 0.08);
}

/* 操作按钮 */
.popup-config-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 16px 20px 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.07);
}