/* 全局样式 */
html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100%;
    touch-action: none;
}

/* 地图容器样式 */
#map {
    position: relative;
    height: 100%;
    width: 100%;
}

/* 按钮样式 */
.button {
    padding: 8px 15px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 5px;
    touch-action: manipulation;
}
.button:hover {
    background: #45a049;
}

/* 错误消息样式 */
#error-message {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4444;
    color: white;
    padding: 10px;
    border-radius: 4px;
    display: none;
    z-index: 1000;
    max-width: 90%;
    text-align: center;
}

/* 自定义移动端友好的对话框 */
.custom-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.custom-dialog.visible {
    opacity: 1;
    pointer-events: auto;
}
.dialog-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}
.dialog-header {
    padding: 16px;
    background: #f7f7f7;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    font-size: 16px;
}
.dialog-body {
    padding: 16px;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}
.dialog-footer {
    display: flex;
    border-top: 1px solid #eee;
}
.dialog-button {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}
.dialog-button:hover {
    background: #f5f5f5;
}
.dialog-button.primary {
    color: #1976d2;
}
.dialog-button.danger {
    color: #f44336;
}
.dialog-button + .dialog-button {
    border-left: 1px solid #eee;
}

/* 上报位置模式指示器 */
.reporting-mode-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px 16px;
    border-radius: 50px;
    font-size: 14px;
    display: none;
    z-index: 2000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(25, 118, 210, 0); }
    100% { box-shadow: 0 0 0 0 rgba(25, 118, 210, 0); }
}

/* 筛选面板样式 */
.filter-panel {
    position: absolute;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    width: 250px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left center;
    transform: scaleX(0) rotateY(-90deg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    backface-visibility: hidden;
    max-height: 80vh;
    overflow-y: auto;
}
.filter-panel.visible {
    opacity: 1;
    transform: scaleX(1) rotateY(0deg);
    visibility: visible;
    pointer-events: auto;
}
.filter-panel.collapsed {
    width: 40px;
    height: 40px;
    padding: 0;
    overflow: hidden;
}
.filter-panel.collapsed .filter-content {
    display: none;
}
.toggle-button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 30px;
    height: 30px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}
.toggle-button:hover {
    background: #45a049;
}
.filter-content {
    margin-top: 10px;
}
.filter-group {
    margin-bottom: 15px;
}
.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}
.filter-group select,
.filter-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}
.filter-group select {
    height: 36px;
}
.filter-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}
.filter-button {
    padding: 8px 15px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.filter-button:hover {
    background: #45a049;
}
.filter-button.reset {
    background: #f44336;
}
.filter-button.reset:hover {
    background: #d32f2f;
}

/* 标记详情面板样式 */
#marker-detail-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: 70vh;
    max-height: 80vh;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    z-index: 2000;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    display: none;
}
#marker-detail-panel.visible {
    transform: translateY(0);
}
#marker-detail-panel::before {
    content: '';
    display: block;
    width: 40px;
    height: 5px;
    background: #ddd;
    border-radius: 3px;
    margin: 10px auto 8px auto;
}
#marker-detail-content {
    padding: 12px 16px;
}

/* 搜索栏样式 */
#search-bar {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2001;
    display: flex;
    flex-direction: row;
    align-items: center;
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    width: calc(100% - 40px);
    max-width: 600px;
    gap: 0;
}
#search-input {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
    background: #fff;
    margin-right: 8px;
}
#search-btn {
    padding: 10px 22px;
    font-size: 16px;
    border: none;
    background: #1976d2;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 8px;
    transition: background 0.2s;
}
#search-btn:hover {
    background: #145ea8;
}
#toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    border-left: 1px solid #eee;
    padding-left: 8px;
    margin-left: 0;
    height: 100%;
}
.icon-btn, .icon-btn:focus {
    background: #f5f7fa;
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    min-width: 44px;
    min-height: 44px;
    font-size: 13px;
    box-sizing: border-box;
    transition: background 0.2s;
    margin: 0 2px;
    padding: 7px 0;
}
.icon-btn i {
    font-size: 18px;
    margin-bottom: 2px;
    color: #1976d2;
}
.icon-btn div {
    font-size: 11px;
    color: #1976d2;
}
.icon-btn:hover {
    background: #e3eaf6;
}

/* 桌面端样式 */
@media screen and (min-width: 769px) {
    #marker-detail-panel {
        position: absolute !important;
        top: 10px !important;
        left: 10px !important;
        right: auto !important;
        bottom: auto !important;
        width: 280px !important;
        height: auto !important;
        min-height: 300px !important;
        max-height: 80vh !important;
        border-radius: 0 8px 8px 0 !important;
        box-shadow: 2px 0 8px rgba(0,0,0,0.15) !important;
        background: #fff !important;
        z-index: 2000 !important;
        overflow-y: auto !important;
        display: none;
        transform: none !important;
    }
    
    /* 确保桌面端的搜索建议框与移动端保持一致 */
    #search-suggest {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 2002 !important;
    }
}

/* 移动端样式 */
@media screen and (max-width: 768px) {
    #marker-detail-panel {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        height: 70vh !important;
        max-height: 80vh !important;
        background: #fff !important;
        border-radius: 16px 16px 0 0 !important;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.18) !important;
        transform: translateY(100%) !important;
        transition: transform 0.3s cubic-bezier(.4,0,.2,1) !important;
        overflow-y: auto !important;
        z-index: 2000 !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        display: none;
    }
    #marker-detail-panel.visible {
        transform: translateY(0) !important;
    }
    #search-bar {
        position: fixed;
        top: 8px;
        left: 0;
        right: 0;
        transform: none;
        margin: 0 auto;
        width: 96vw;
        max-width: 100vw;
        min-width: 0;
        padding: 8px 8px;
        border-radius: 14px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        z-index: 2001;
    }
    #search-input {
        font-size: 15px;
        padding: 8px 12px;
        border-radius: 10px;
        margin: 0;
        flex: 1;
        min-width: 0;
        box-sizing: border-box;
        height: 40px;
    }
    #search-btn {
        padding: 0;
        min-width: 40px;
        height: 40px;
        width: 40px;
        font-size: 0;
        border-radius: 10px;
        margin: 0;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    #search-btn::before {
        content: '\f002'; /* Font Awesome 搜索图标 */
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 16px;
    }
    #toolbar {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        gap: 6px;
        background: none;
        box-shadow: none;
        height: auto;
        width: auto;
        flex: 0 0 auto;
    }
    .icon-btn {
        margin: 0;
        padding: 0;
        border-radius: 10px;
        background: #f5f7fa;
        font-size: 0;
        min-width: 40px;
        width: 40px;
        height: 40px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    .icon-btn i {
        font-size: 18px;
        margin-bottom: 0;
        color: #1976d2;
    }
    .icon-btn div {
        display: none;
    }
    #search-suggest {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 12px !important;
        z-index: 2002 !important;
        display: none;
        /* 修改最大高度，限制显示约5个条目 */
        max-height: 270px !important;
        overflow-y: auto !important;
        box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
        margin-top: 8px !important;
        padding: 8px 0 !important;
    }
    
    /* 美化滚动条 */
    #search-suggest::-webkit-scrollbar {
        width: 8px !important;
    }
    
    #search-suggest::-webkit-scrollbar-track {
        background: #f1f1f1 !important;
        border-radius: 4px !important;
    }
    
    #search-suggest::-webkit-scrollbar-thumb {
        background: #c1c1c1 !important;
        border-radius: 4px !important;
    }
    
    #search-suggest::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8 !important;
    }
    
    .suggest-item {
        padding: 10px 16px !important;
        cursor: pointer !important;
        border-bottom: 1px solid #f0f0f0 !important;
        display: flex !important;
        align-items: center !important;
        transition: background-color 0.2s ease !important;
        /* 固定每个条目的高度 */
        height: 24px !important;
        line-height: 24px !important;
    }
    
    .suggest-item:hover {
        background-color: #f5f5f5 !important;
    }
    
    .suggest-item:last-child {
        border-bottom: none !important;
    }
    
    .suggest-item::before {
        content: '\f3c5' !important;
        font-family: 'Font Awesome 5 Free' !important;
        font-weight: 900 !important;
        color: #1976d2 !important;
        margin-right: 10px !important;
        font-size: 14px !important;
    }
    
    .suggest-item-text {
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 14px;
        color: #333;
        font-weight: 500;
        line-height: 1.4;
    }
    
    .suggest-item-region {
        color: #999;
        font-size: 12px;
        margin-left: 8px;
        padding: 2px 8px;
        background: #f0f0f0;
        border-radius: 10px;
    }
    .filter-panel {
        top: 56px !important;
        left: 50% !important;
        transform: translateX(-50%) scaleY(0.8);
        margin-top: 0 !important;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.35s cubic-bezier(.4,0,.2,1), transform 0.35s cubic-bezier(.4,0,.2,1);
    }
    .filter-panel.visible {
        opacity: 1;
        transform: translateX(-50%) scaleY(1);
        pointer-events: auto;
    }
    /* 小屏幕手机样式 */
    @media screen and (max-width: 480px) {
        #marker-detail-panel {
            height: 40vh;
            border-radius: 12px 12px 0 0;
        }
        #marker-detail-panel.visible {
            transform: translateY(0);
        }
    }
    .close-btn {
        display: none;
    }
    .panel-header {
        justify-content: center;
        padding: 8px 18px;
        border-bottom: none;
    }
    .drag-handle {
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10;
        width: 100%;
        height: 40px;
        background-color: #fff;
        display: flex;
        justify-content: center;
        align-items: center;
        padding-top: 8px;
    }
    .drag-handle::before {
        content: '';
        display: block;
        width: 40px;
        height: 5px;
        background: #ddd;
        border-radius: 3px;
        cursor: grab;
    }
    .drag-handle.dragging::before {
        cursor: grabbing;
    }
    #marker-detail-panel::before {
        display: none;
    }
    /* 隐藏搜索按钮 */
    #search-btn {
        display: none !important;
    }
    
    /* 修改搜索框样式，使其占据更多空间 */
    #search-input {
        margin-right: 0;
        width: 100%;
    }
    
    /* 修改搜索栏内部布局 */
    #search-bar {
        justify-content: space-between;
        gap: 10px;
    }
}

/* 添加面板头部样式 */
.panel-header {
    padding: 18px 18px 0 18px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.panel-header span {
    font-weight: bold;
    font-size: 18px;
}
.close-btn {
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

/* 面板内容样式 */
#marker-detail-content {
    padding: 12px 16px;
}
.section {
    margin-bottom: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 16px;
}
.section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.section-header {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    padding: 0 16px;
}
.section-content {
    padding: 0 16px;
}
.detail-row {
    display: flex;
    margin-bottom: 12px;
    line-height: 1.5;
}
.detail-row:last-child {
    margin-bottom: 0;
}
.detail-label {
    width: 100px;
    color: #666;
    font-size: 14px;
    flex-shrink: 0;
}
.detail-value {
    flex: 1;
    color: #333;
    font-size: 14px;
    word-break: break-all;
}

/* 添加搜索下拉框样式 */
.search-select-container {
    position: relative;
    width: 100%;
}

.search-select-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.search-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1001;
    display: none;
}

.search-select-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

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

.search-select-item:hover {
    background: #f5f5f5;
}

.search-select-item.selected {
    background: #e6f7ff;
}

.search-select-no-results {
    padding: 10px;
    color: #999;
    font-style: italic;
    text-align: center;
}

/* 添加加载遮罩层样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    color: #1976d2;
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 禁用地图交互时的样式 */
#map.disabled {
    pointer-events: none;
    opacity: 0.7;
} 

/* 动态Logo样式 */
.dynamic-marker {
    width: 32px;
    height: 32px;
    position: relative;
    transform-origin: center bottom;
    animation: bounce 1s infinite alternate;
}

.dynamic-marker img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes bounce {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-5px);
    }
}

/* 脉冲效果 */
.pulse-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.3);
    animation: pulse 1.5s infinite;
    pointer-events: none;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
} 