/* 首页样式 */

#map-container {
    width: 100%;
    height: 100vh;
}

/* 隐藏腾讯地图的缩放控件和方位控件 - 在地图加载前就隐藏 */
#map-container .tmap-control,
#map-container [class*="zoom"],
#map-container [class*="Zoom"],
#map-container [class*="control"],
#map-container [class*="Control"],
#map-container [class*="rotation"],
#map-container [class*="Rotation"],
#map-container [class*="compass"],
#map-container [class*="Compass"],
#map-container [class*="rotate-circle"],
#map-container [class*="RotateCircle"],
#map-container [class*="rotate"],
#map-container [class*="Rotate"],
#map-container button[title*="放大"],
#map-container button[title*="缩小"],
#map-container button[title*="缩放"],
#map-container button[title*="指南针"],
#map-container button[title*="旋转"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.info-panel {
    position: fixed;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    pointer-events: auto;
    border: 1px solid #1890ff;
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    color: #666;
    margin-right: 8px;
}

.info-value {
    color: #333;
    font-weight: 500;
}

.time-range-selector {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 10000;
    pointer-events: auto;
}

.time-range-select {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #1890ff;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
    outline: none;
}

.time-range-select:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.time-range-select:focus {
    border-color: #096dd9;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.action-buttons {
    position: fixed;
    right: 15px;
    bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10000;
    pointer-events: auto;
}

.action-btn {
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    z-index: 10001;
    pointer-events: auto;
}

.action-btn:hover {
    background: #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn svg {
    color: #1890ff;
}

/* 小程序码弹窗样式 */
.miniprogram-modal-content {
    max-width: 400px;
}

.miniprogram-modal-body {
    padding: 24px;
    text-align: center;
}

.miniprogram-qrcode-container {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.miniprogram-qrcode-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.miniprogram-tip {
    color: #666;
    font-size: 14px;
    margin-top: 12px;
}

/* 收藏列表 */
#favorite-list {
    max-height: 400px;
    overflow-y: auto;
}

.favorite-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #e8e8e8;
    cursor: pointer;
    transition: background 0.3s;
}

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

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

.favorite-main {
    flex: 1;
}

.favorite-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.favorite-meta {
    font-size: 12px;
    color: #999;
}

.favorite-delete {
    padding: 4px 12px;
    color: #ff4d4f;
    cursor: pointer;
    font-size: 12px;
}

.favorite-delete:hover {
    color: #ff7875;
}

/* Loading 加载提示 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    pointer-events: auto;
    transition: opacity 0.3s ease-out;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f0f0f0;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

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

/* 自定义地图标签样式 */
.map-custom-label {
    position: absolute;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    z-index: 10;
}

[class*="infowindow"],
[class*="InfoWindow"],
.tmap-infowindow,
div[style*="infowindow"] {
    z-index: 2000 !important;
    width: auto;
    max-width: 260px;
    background: transparent !important; /* 去除上层容器的背景 */
    padding: 0 !important; /* 去除上层容器的padding */
}

/* 针对腾讯地图InfoWindow的直接子容器 */
.custom-infowindow {
    margin: 0; /* 确保没有额外的margin */
}

/* 针对可能存在的InfoWindow包装容器 */
div:has(> .custom-infowindow) {
    padding: 0 !important;
}

/* 更通用的选择器：查找包含custom-infowindow的父元素 */
/* 排除 .custom-infowindow 及其子元素，避免影响自定义样式 */
div[class*="infowindow"] > div:not(.custom-infowindow):not([class*="custom-infowindow"]),
div[class*="InfoWindow"] > div:not(.custom-infowindow):not([class*="custom-infowindow"]) {
    padding: 0 !important;
}

#map-container > div[style*="position: absolute"] {
    z-index: 2000 !important;
    padding: 0 !important; /* 去除可能的padding */
}

/* 自定义信息窗口样式（使用enableCustom时） */
.custom-infowindow {
    min-width: 150px;
    max-width: 300px;
    background-color: #ffffff;
    border-radius: 4px;
    overflow: hidden;
}

.custom-infowindow-title {
    font-weight: bold;
    text-align: left;
    font-size: 14px;
    padding: 5px 12px !important;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
    margin: 0 !important; /* 确保margin不会被重置 */
    box-sizing: border-box; /* 确保padding计算正确 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.infowindow-title-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.infowindow-beacon-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    vertical-align: middle;
    object-fit: contain;
}

.infowindow-title-buttons {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-right: 10px;
}

.infowindow-btn {
    padding: 1px 4px !important;
    font-size: 12px;
    border: 1px solid #1890ff;
    background-color: #fff;
    color: #1890ff;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    pointer-events: auto;
}

.infowindow-btn:active {
    background-color: #096dd9;
    border-color: #096dd9;
}

.custom-infowindow-content {
    padding: 8px 12px !important;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
    overflow-wrap: break-word;
    font-size: 12px;
    line-height: 1.5;
    color: #666;
    text-align: left;
    margin: 0 !important; /* 确保margin不会被重置 */
}
