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

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ========== ArcGIS Pro 风格的顶部导航栏 ========== */

/* 专业化头部容器 */
.pro-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 60px;
}

/* 标题区域 */
.pro-title {
    margin-right: 30px;
}

.pro-title h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

/* 专业化菜单栏 */
.pro-navbar {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

/* 菜单项 */
.pro-menu-item {
    position: relative;
}

.pro-menu-item > span {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    user-select: none;
}

.pro-menu-item > span:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 下拉菜单 */
.pro-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    padding: 8px 0;
    z-index: 1100;
    animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pro-menu-item:hover .pro-dropdown,
.pro-dropdown:hover {
    display: block;
}

/* 下拉菜单项 */
.pro-dropdown a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.pro-dropdown a:hover {
    background: #f0f4ff;
    color: #2a5298;
}

/* 分隔线 */
.dropdown-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 5px 0;
}

/* 子菜单 */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > span {
    display: block;
    padding: 10px 20px;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-submenu > span:hover {
    background: #f0f4ff;
    color: #2a5298;
}

/* 子菜单下拉框 */
.pro-dropdown-sub {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 0;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    padding: 8px 0;
    z-index: 1200;
}

.dropdown-submenu:hover .pro-dropdown-sub,
.pro-dropdown-sub:hover {
    display: block;
}

.pro-dropdown-sub a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.pro-dropdown-sub a:hover {
    background: #f0f4ff;
    color: #2a5298;
}

/* 旧版头部样式（保留以防需要） */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-text h1 {
    font-size: 24px;
    margin-bottom: 5px;
    font-weight: 600;
}

.header-text p {
    font-size: 14px;
    opacity: 0.9;
}

/* 语言切换器 */
.language-switcher {
    display: flex;
    gap: 8px;
}

.lang-btn {
    padding: 8px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: white;
    color: #2a5298;
    border-color: white;
    font-weight: 600;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 左侧控制面板 */
.sidebar {
    width: 300px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 900;
}

.panel {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.panel h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #2a5298;
    font-weight: 600;
}

/* 图层控制 */
.layer-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.layer-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 5px;
    transition: background 0.3s;
}

.layer-item:hover {
    background: #f5f5f5;
}

.layer-item input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.layer-item label {
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

/* 底图选择 */
.basemap-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.basemap-btn {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}

.basemap-btn:hover {
    border-color: #2a5298;
    background: #f0f4ff;
}

.basemap-btn.active {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

/* 工具箱 */
.tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-btn {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-btn:hover {
    background: #f0f4ff;
    border-color: #2a5298;
    transform: translateX(3px);
}

.tool-btn span {
    font-size: 16px;
}

/* 信息面板 */
.info-content {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1.6;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
}

.info-content p {
    margin-bottom: 8px;
}

.info-content strong {
    color: #2a5298;
}

/* 地图容器 */
.map-container {
    flex: 1;
    position: relative;
    background: #e0e0e0;
}

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

/* 地图工具栏 */
.map-toolbar {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 800;
}

.toolbar-btn {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.toolbar-btn:hover {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
    transform: scale(1.1);
}

/* 坐标显示 */
.coordinates-display {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 800;
    font-weight: 500;
}

/* 底部状态栏 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 10px 30px;
    font-size: 13px;
    z-index: 1000;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.separator {
    opacity: 0.5;
}

#status-text {
    color: #4caf50;
    font-weight: 600;
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar,
.info-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.info-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb,
.info-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.info-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Leaflet 弹出窗口自定义样式 */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.3);
}

.leaflet-popup-content {
    margin: 15px;
    font-size: 14px;
    line-height: 1.6;
}

.leaflet-popup-content h4 {
    color: #2a5298;
    margin-bottom: 10px;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 250px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .map-toolbar {
        top: 10px;
        right: 10px;
    }
    
    .coordinates-display {
        bottom: 10px;
        left: 10px;
        font-size: 11px;
    }
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2a5298;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

/* 要素列表 */
.feature-list {
    max-height: 300px;
    overflow-y: auto;
    font-size: 13px;
}

.feature-list p {
    color: #999;
    text-align: center;
    padding: 20px;
}

.feature-group {
    margin-bottom: 15px;
}

.feature-group h4 {
    font-size: 13px;
    color: #2a5298;
    margin-bottom: 8px;
    padding: 5px;
    background: #f0f4ff;
    border-radius: 3px;
}

.feature-group ul {
    list-style: none;
}

.feature-group li {
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.feature-group li:hover {
    background: #f9f9f9;
}

.feature-name {
    flex: 1;
    font-size: 13px;
}

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

.feature-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 3px 6px;
    border-radius: 3px;
    transition: background 0.3s;
}

.feature-actions button:hover {
    background: #e0e0e0;
}

.action-btn {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: #2a5298;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s;
}

.action-btn:hover {
    background: #1e3c72;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h3 {
    margin: 0;
    color: #2a5298;
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

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

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2a5298;
}

.form-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
}

.form-group input[type="range"] {
    width: calc(100% - 50px);
    margin-right: 10px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.style-editor,
.geometry-info {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.style-editor h4,
.geometry-info h4 {
    font-size: 14px;
    color: #2a5298;
    margin-bottom: 10px;
}

#geometry-details {
    font-size: 13px;
    line-height: 1.8;
    color: #666;
}

#geometry-details p {
    margin: 5px 0;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #2a5298;
    color: white;
}

.btn-primary:hover {
    background: #1e3c72;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* 批量重命名模态框 */
.rename-options {
    margin-top: 15px;
}

.preview-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.preview-section h4 {
    font-size: 14px;
    color: #2a5298;
    margin-bottom: 10px;
}

.preview-list {
    max-height: 200px;
    overflow-y: auto;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
    font-size: 13px;
}

.preview-item {
    padding: 5px;
    margin-bottom: 5px;
    background: white;
    border-radius: 3px;
    display: flex;
    justify-content: space-between;
}

.preview-item .old-name {
    color: #999;
    text-decoration: line-through;
}

.preview-item .new-name {
    color: #27ae60;
    font-weight: 500;
}

/* Leaflet.draw 样式覆盖 - 横排显示 */
.leaflet-draw-toolbar {
    display: flex !important;
    flex-direction: row !important;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 5px;
}

.leaflet-draw-toolbar a {
    background-color: white !important;
    margin: 0 2px !important;
    border-radius: 3px !important;
}

.leaflet-draw-toolbar a:hover {
    background-color: #f0f4ff !important;
}

/* 调整绘图工具栏位置 */
.leaflet-top.leaflet-left {
    top: 80px !important;
    left: 50% !important;
    transform: translateX(-50%);
}

.leaflet-draw-section {
    display: flex !important;
    flex-direction: row !important;
}

.leaflet-draw-toolbar-top {
    margin-top: 0 !important;
}
  
/* ͼ�㵼�� */  
.layer-import-section {  
    margin-top: 15px;  
    padding-top: 15px;  
    border-top: 1px solid #e0e0e0;  
}  
  
/* ������Դ */  
.data-resources p {  
    font-size: 13px;  
    color: #666;  
    margin-bottom: 10px;  
}  
  
.resource-links {  
    display: flex;  
    flex-direction: column;  
    gap: 8px;  
}  
  
.resource-link {  
    display: flex;  
    align-items: center;  
    gap: 8px;  
    padding: 10px;  
    background: #f9f9f9;  
    border-radius: 5px;  
    text-decoration: none;  
    color: #333;  
    font-size: 13px;  
    transition: all 0.3s;  
}  
  
.resource-link:hover {  
    background: #f0f4ff;  
    transform: translateX(3px);  
}  
  
.resource-link span {  
    font-size: 16px;  
} 
  
/* �Ƴ�ͼ�㰴ť */  
.remove-layer-btn {  
    margin-left: auto;  
    padding: 2px 8px;  
    background: #e74c3c;  
    color: white;  
    border: none;  
    border-radius: 3px;  
    cursor: pointer;  
    font-size: 16px;  
    font-weight: bold;  
    transition: background 0.3s;  
}  
  
.remove-layer-btn:hover {  
    background: #c0392b;  
}  
  
.imported-layer-item {
    background: #e8f5e9;
}

/* ========== 树形图层控制面板样式 (QGIS/ArcGIS 风格) ========== */

/* 图层树容器 */
.layer-tree-container {
    margin-bottom: 15px;
}

/* 图层树项目 */
.layer-tree-item {
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background: white;
    overflow: hidden;
    transition: all 0.3s;
}

.layer-tree-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 图层头部 */
.layer-header {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background 0.3s;
}

.layer-header:hover {
    background: #e9ecef;
}

/* 图层复选框 */
.layer-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #2a5298;
}

/* 图层折叠/展开按钮 */
.layer-toggle {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    margin-right: 8px;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.3s;
}

.layer-toggle:hover {
    color: #2a5298;
    transform: scale(1.2);
}

/* 图层名称 */
.layer-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    user-select: none;
}

/* 类别列表容器 */
.layer-categories {
    padding: 5px 10px 10px 10px;
    background: white;
}

/* 类别项目 */
.category-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin: 3px 0;
    border-radius: 4px;
    transition: all 0.3s;
}

.category-item:hover {
    background: #f0f4ff;
}

/* 类别复选框 */
.category-checkbox {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #2a5298;
}

/* 颜色框 */
.color-box {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 8px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 类别标签 */
.category-item label {
    flex: 1;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    user-select: none;
}

.category-item label:hover {
    color: #2a5298;
}

/* ========== 图例面板样式 ========== */

.legend-panel {
    max-height: 400px;
    overflow-y: auto;
    font-size: 13px;
}

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

.legend-layer {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.legend-layer h4 {
    font-size: 14px;
    color: #2a5298;
    margin-bottom: 10px;
    font-weight: 600;
}

.legend-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    gap: 10px;
}

.legend-color {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.legend-label {
    flex: 1;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

/* 图例面板滚动条 */
.legend-panel::-webkit-scrollbar {
    width: 6px;
}

.legend-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.legend-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.legend-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 批量操作按钮 */
.batch-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.batch-btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    font-weight: 500;
}

.batch-btn:hover {
    background: #f0f4ff;
    border-color: #2a5298;
}

.batch-btn.danger {
    color: #e74c3c;
    border-color: #e74c3c;
}

.batch-btn.danger:hover {
    background: #fee;
    border-color: #c0392b;
}

/* 空状态提示 */
.legend-panel:empty::before {
    content: "暂无图例数据";
    display: block;
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .layer-tree-item {
        font-size: 12px;
    }
    
    .category-item {
        padding: 6px 8px;
    }
    
    .legend-panel {
        max-height: 300px;
    }
}

/* ========== 顶部导航栏样式 ========== */

.top-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-item {
    position: relative;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-item span {
    font-size: 16px;
}

/* 下拉菜单 */
.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    min-width: 250px;
    max-width: 400px;
    padding: 15px;
    z-index: 1100;
    animation: dropdownSlide 0.3s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-dropdown.show {
    display: block;
}

.nav-dropdown p {
    color: #666;
    font-size: 13px;
    margin-bottom: 10px;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.dropdown-link:hover {
    background: #f0f4ff;
    transform: translateX(5px);
}

.dropdown-link span {
    font-size: 16px;
}

/* 下拉菜单中的底图按钮 */
.nav-dropdown .basemap-btn {
    width: 100%;
    margin-bottom: 8px;
}

.nav-dropdown .basemap-btn:last-child {
    margin-bottom: 0;
}

/* ========== 可拖动面板样式 ========== */

.draggable-panel {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    max-width: 90%;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    cursor: move;
    user-select: none;
}

.panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.close-panel-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s;
}

.close-panel-btn:hover {
    transform: scale(1.2);
}

.panel-body {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.panel-body p {
    color: #666;
    font-size: 13px;
    margin-bottom: 15px;
}

/* ========== 自定义绘图工具栏样式 ========== */

.custom-draw-toolbar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.toolbar-section h4 {
    color: #2a5298;
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 600;
}

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

.draw-tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 80px;
}

.draw-tool-btn:hover {
    background: #f0f4ff;
    border-color: #2a5298;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.draw-tool-btn.active {
    background: #2a5298;
    border-color: #2a5298;
    color: white;
}

.draw-tool-btn.active .tool-label {
    color: white;
}

.draw-tool-btn.danger {
    border-color: #e74c3c;
}

.draw-tool-btn.danger:hover {
    background: #fee;
    border-color: #c0392b;
}

.tool-icon {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
}

.tool-label {
    font-size: 12px;
    font-weight: 500;
    color: #555;
    text-align: center;
}

.editor-instructions {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

.editor-instructions h4 {
    color: #2a5298;
    font-size: 14px;
    margin-bottom: 10px;
}

.editor-instructions ul {
    list-style: none;
    padding: 0;
}

.editor-instructions li {
    padding: 8px 0;
    font-size: 13px;
    color: #555;
    border-bottom: 1px solid #e0e0e0;
}

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

/* 拖动时的样式 */
.draggable-panel.dragging {
    opacity: 0.8;
    cursor: move;
}

/* ========== 隐藏图例面板样式 ========== */

#legend-panel-container {
    transition: all 0.3s ease;
}

#legend-panel-container.hidden {
    display: none;
}

/* ========== 响应式调整 ========== */

@media (max-width: 768px) {
    .top-nav {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .nav-item {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .nav-dropdown {
        min-width: 200px;
        max-width: 300px;
    }
    
    .draggable-panel {
        width: 90%;
        max-width: 350px;
    }
}

/* ========== 属性表编辑器样式 ========== */

.attribute-editor-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.attribute-editor-section h4 {
    font-size: 14px;
    color: #2a5298;
    margin-bottom: 15px;
    font-weight: 600;
}

.attribute-controls {
    margin-bottom: 15px;
}

.attribute-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 10px;
    background: #f9f9f9;
}

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

.attribute-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    transition: all 0.3s;
    cursor: move;
}

.attribute-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #2a5298;
}

.drag-handle {
    font-size: 18px;
    color: #999;
    cursor: grab;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.attribute-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attribute-info strong {
    font-size: 14px;
    color: #333;
}

.attribute-type {
    font-size: 12px;
    color: #666;
    background: #f0f4ff;
    padding: 2px 8px;
    border-radius: 3px;
    display: inline-block;
    width: fit-content;
}

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

.btn-icon {
    background: none;
    border: 1px solid #e0e0e0;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    color: #666;
}

.btn-icon:hover {
    background: #f0f4ff;
    border-color: #2a5298;
    color: #2a5298;
}

.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon.delete {
    color: #e74c3c;
    border-color: #e74c3c;
}

.btn-icon.delete:hover {
    background: #fee;
    border-color: #c0392b;
}

/* 属性列表滚动条 */
.attribute-list::-webkit-scrollbar {
    width: 6px;
}

.attribute-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.attribute-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.attribute-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========== 编辑模式按钮样式 ========== */

.edit-mode-btn {
    transition: all 0.3s;
}

.edit-mode-btn.active {
    background: #27ae60 !important;
    color: white !important;
    border-color: #27ae60 !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(39, 174, 96, 0);
    }
}
