/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    background-color: #f0f0f0;
}

/* 地图容器 */
#map-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e0e0e0;
}

#map-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 图钉容器 */
#pins-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 图钉样式 */
.map-pin {
    position: absolute;
    width: 32px;
    height: 32px;
    cursor: pointer;
    pointer-events: all;
    transform: translate(-50%, -100%);
    transition: transform 0.2s ease;
    animation: breathe 2s ease-in-out infinite; /* 添加呼吸动画，不停放大缩小 */
}

.map-pin:hover {
    transform: translate(-50%, -100%) scale(1.2);
    animation: none; /* hover 时暂停动画 */
}

.map-pin svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* 呼吸动画：轻微放大缩小 */
@keyframes breathe {
    0% {
        transform: translate(-50%, -100%) scale(1);
    }
    50% {
        transform: translate(-50%, -100%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -100%) scale(1);
    }
}

/* 全景覆盖层 */
#panorama-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#panorama-overlay.hidden {
    display: none;
}

/* 全景容器 */
#panorama-container {
    position: relative;
    width: 90%;
    height: 80%;
    max-width: 1200px;
    max-height: 800px;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 全景或平面照片容器 */
#panorama {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* 防止内容溢出 */
}

/* 平面照片样式 */
#panorama .flat-image {
    max-width: 100%; /* 限制图像不超过容器宽度 */
    max-height: 100%; /* 限制图像不超过容器高度 */
    object-fit: contain; /* 保持比例，完整显示 */
    object-position: center; /* 居中对齐 */
    border-radius: 8px; /* 美化 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 阴影 */
}

/* 关闭按钮 */
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: white;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    #panorama-container {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }
    
    .close-btn {
        top: 10px;
        right: 10px;
    }
    
    .map-pin {
        width: 24px;
        height: 24px;
    }
}

/* 加载提示 */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}