/* 首页样式 */

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

/* 只隐藏缩放控件，保留天地图 logo / 版权 */
#map-container .tdt-control-zoom {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* 天地图 logo / 版权固定左下角 */
#map-container .tdt-control-copyright,
#map-container .tdt-control-logo {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    left: 2px !important;
    bottom: 2px !important;
    right: auto !important;
    top: auto !important;
    z-index: 1000 !important;
}

/* 缩放动画期间勿隐藏自定义覆盖物所在 pane */
#map-container .tdt-overlay-pane,
#map-container .tdt-marker-pane,
#map-container .leaflet-overlay-pane,
#map-container .leaflet-marker-pane {
    visibility: visible !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;
    padding: 4px;
    box-sizing: border-box;
    background: #fff;
    color: #1890ff;
    border: 1px solid #1890ff;
    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-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
}

.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;
}

.tdt-rotating-marker {
    line-height: 0;
    user-select: none;
}

.tdt-rotating-marker img {
    -webkit-user-drag: none;
    user-select: none;
}

/* ========== 天地图 InfoWindow ========== */
/* 外层透明，避免双层半透明底 */
.tdt-infowindow {
    z-index: 2000 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
}

/* 内容区：不透明白底 */
.tdt-infowindow-content-wrapper {
    background: #ffffff !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18) !important;
    border-radius: 4px !important;
    padding: 0 !important;
    overflow: visible !important;
}

.tdt-infowindow-content {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    width: auto !important;
    max-width: 270px;
}

/* 关闭按钮 */
.tdt-infowindow-close-button {
    z-index: 2 !important;
    top: 4px !important;
    right: 4px !important;
    width: 20px !important;
    height: 20px !important;
    line-height: 18px !important;
    font-size: 16px !important;
    color: #666 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* 倒三角容器：居中对准窗口底部 */
.tdt-infowindow-tip-container {
    width: 40px !important;
    height: 20px !important;
    margin: 0 auto !important;
    position: relative !important;
    overflow: visible !important;
    background: transparent !important;
    pointer-events: none;
}

/* 倒三角：白底菱形，与内容区衔接 */
.tdt-infowindow-tip {
    background: #ffffff !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
    width: 12px !important;
    height: 12px !important;
    padding: 0 !important;
    margin: -6px auto 0 !important;
    border: none !important;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.12) !important;
    -webkit-transform: rotate(45deg) !important;
    transform: rotate(45deg) !important;
}

/* 自定义内容 */
.custom-infowindow {
    margin: 0;
    min-width: 270px;
    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: 0;
}

.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不会被重置 */
}

.infowindow-comment-text {
    color: #0a7100;
}
