/* 地图页全屏 - 仅在 map.css 加载时生效（离开地图页后 link 变回 preload，规则不再生效） */
html, body {
    height: 100%;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

#map {
    height: 100vh;
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}
    
    .info-window-content {
        padding: 16px;
        width: auto;
        min-width: 260px;
        max-width: 340px;
        max-height: 430px;
        overflow-y: auto;
        overflow-x: hidden;
        background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
        border-radius: 12px;
        border: 1px solid rgba(17, 24, 39, 0.08);
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
        display: flex;
        flex-direction: column;
        pointer-events: auto;
        box-sizing: border-box;
        margin: 0 !important;
    }
    
    .info-window-header {
        font-size: 15px;
        font-weight: 800;
        color: #111827;
        margin-bottom: 12px;
        padding-bottom: 12px;
        line-height: 1.35;
        letter-spacing: 0;
        border-bottom: 1px solid #eef2f7;
        overflow-wrap: anywhere;
    }
    
    .info-window-time {
        margin-bottom: 0;
    }

    .info-window-time span {
        color: inherit;
        font-size: inherit;
        font-weight: inherit;
    }

    .info-window-time strong {
        font-weight: 400;
    }
    
    .info-window-description {
        color: #364153;
        margin-bottom: 14px;
        line-height: 1.65;
        font-size: 12px;
        flex-grow: 1;
        overflow-y: auto;
        padding: 10px 11px 10px 12px;
        background: #ffffff;
        border-left: 3px solid #8fb7ff;
        border-radius: 0 8px 8px 0;
        overflow-wrap: anywhere;
        white-space: pre-wrap;
    }
    
    .info-window-media-container {
        display: flex;
		flex-direction: column;
        gap: 12px;
        margin-top: 4px;
    }

    .info-window-content::-webkit-scrollbar,
    .info-window-description::-webkit-scrollbar {
        width: 6px;
    }

    .info-window-content::-webkit-scrollbar-thumb,
    .info-window-description::-webkit-scrollbar-thumb {
        background: #d3dbe8;
        border-radius: 999px;
    }
    
    .info-window-images {
        flex: 1;
    }
    
    .info-window-videos {
        flex: 1;
    }
    
    .info-window-media {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 固定3列 */
        gap: 4px;
        margin-bottom: 5px;
    }
    
    .media-item {
        border-radius: 4px;
        overflow: hidden;
        cursor: pointer;
        transition: all 0.2s ease;
        aspect-ratio: 1/1;
        object-fit: cover;
        pointer-events: auto;
        position: relative;
        background-color: #f5f5f5;
        border: 1px solid #e0e0e0;
    }
    
    .media-item:hover {
        transform: scale(1.05);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        z-index: 1;
        border-color: #00d2ff;
    }
    
    .media-item img, .media-item video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* 优化弹窗中小视频的控件样式 - 只保留最基础播放功能 */
    .info-window-media .media-item video {
        pointer-events: auto;
        cursor: pointer;
    }
    
    /* 隐藏所有视频控件 */
    video.popup-video::-webkit-media-controls-panel,
    video.popup-video::-webkit-media-controls-play-button,
    video.popup-video::-webkit-media-controls-mute-button,
    video.popup-video::-webkit-media-controls-volume-slider,
    video.popup-video::-webkit-media-controls-fullscreen-button,
    video.popup-video::-webkit-media-controls-toggle-closed-captions-button,
    video.popup-video::-webkit-media-controls-timeline,
    video.popup-video::-webkit-media-controls-current-time-display,
    video.popup-video::-webkit-media-controls-time-remaining-display,
    video.popup-video::-webkit-media-controls-overflow-button,
    video.popup-video::-webkit-media-controls-download-button,
    video.popup-video::-webkit-media-controls-cast-button,
    video.popup-video::-webkit-media-controls-wireless-playback-button,
    video.popup-video::-webkit-media-controls-picture-in-picture-button,
    video.popup-video::-webkit-media-controls-enclosure {
        display: none !important;
    }
    
    /* 视频容器相对定位（排除实况图） */
    .info-window-media .media-item:has(video.popup-video) {
        position: relative;
    }
    
    /* 自定义播放按钮覆盖层（仅针对视频，排除实况图） */
    .info-window-media .media-item:has(video.popup-video)::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 40px;
        height: 40px;
        background-color: rgba(0, 0, 0, 0.6);
        border-radius: 50%;
        pointer-events: none;
        z-index: 10;
        transition: opacity 0.3s ease;
    }
    
    /* 播放按钮三角形图标（仅针对视频，排除实况图） */
    .info-window-media .media-item:has(video.popup-video)::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 0;
        height: 0;
        border-style: solid;
        border-width: 8px 0 8px 14px;
        border-color: transparent transparent transparent white;
        pointer-events: none;
        z-index: 11;
        transition: opacity 0.3s ease;
    }
    
    /* 视频播放时隐藏按钮（仅针对视频，排除实况图） */
    .info-window-media .media-item:has(video.popup-video).playing::after,
    .info-window-media .media-item:has(video.popup-video).playing::before {
        opacity: 0;
    }
    
    /* 确保华为地图InfoWindow容器可以接收事件 */
    .hw-info-window {
        pointer-events: auto !important;
    }
    
    /* 强制控制华为地图InfoWindow外层容器样式，避免双层效果 */
    div[class*="info-window"],
    div[id*="info-window"],
    .amap-info-window,
    .hw-info-window-content,
    .hw-info-window > div,
    [class*="InfoWindow"] > div,
    [id*="InfoWindow"] > div {
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        min-width: auto !important;
        max-width: none !important;
        width: auto !important;
    }
    
    /* 实况图样式 */
    .live-photo-wrapper {
        position: relative;
        width: 100%;
        height: 100%;
        cursor: pointer;
        display: block; /* 确保是块级元素 */
    }
    
    .live-photo-container {
        position: relative;
        width: 100%;
        height: 100%;
        overflow: hidden;
        pointer-events: auto; /* 确保容器可以接收事件 */
    }
    
    .live-photo-container img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        position: relative;
        z-index: 1;
        pointer-events: none; /* 图片不拦截事件，让事件穿透到wrapper */
    }
    
    .live-photo-container video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: 2;
        pointer-events: none; /* 视频不拦截事件 */
    }
    
    .live-photo-container.playing video {
        opacity: 1;
    }
    
    .live-badge {
        position: absolute;
        top: 3px;
        left: 3px;
        background-color: rgba(0, 0, 0, 0.6);
        color: white;
        padding: 2px 4px;
        border-radius: 6px;
        font-size: 6px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 2px;
        pointer-events: none;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: 10;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
        letter-spacing: 0.5px;
    }
    
    .live-badge .icon {
        width: 6px;
        height: 6px;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .live-badge .icon span {
        position: absolute;
        border: 1px solid white;
        border-radius: 50%;
        opacity: 0;
        top: 50%;
        left: 50%;
    }
    
    .live-badge .icon span:nth-child(1) {
        width: 2px;
        height: 2px;
        opacity: 1;
        margin-top: -1px;
        margin-left: -1px;
        animation: pulse1 2s ease-in-out infinite;
    }
    
    .live-badge .icon span:nth-child(2) {
        width: 4px;
        height: 4px;
        margin-top: -2px;
        margin-left: -2px;
        animation: pulse2 2s ease-in-out infinite;
    }
    
    .live-badge .icon span:nth-child(3) {
        width: 6px;
        height: 6px;
        margin-top: -3px;
        margin-left: -3px;
        animation: pulse3 2s ease-in-out infinite;
    }
    
    @keyframes pulse1 {
        0%, 100% {
            transform: scale(1);
            opacity: 1;
        }
        50% {
            transform: scale(0.85);
            opacity: 0.6;
        }
    }
    
    @keyframes pulse2 {
        0%, 100% {
            transform: scale(1);
            opacity: 0.6;
        }
        50% {
            transform: scale(1.15);
            opacity: 0.3;
        }
    }
    
    @keyframes pulse3 {
        0%, 100% {
            transform: scale(1);
            opacity: 0.3;
        }
        50% {
            transform: scale(1.2);
            opacity: 0.1;
        }
    }
    
    .live-photo-wrapper.playing .live-badge {
        background-color: rgba(0, 0, 0, 0.7);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    .info-window-videos .media-item,
    .info-window-videos .media-item video {
        pointer-events: auto;
    }

    .info-window-videos .media-item video::-webkit-media-controls {
        pointer-events: auto;
        height: 24px !important;
    }

    .info-window-videos .media-item video::-moz-media-controls {
        pointer-events: auto;
        height: 24px !important;
    }

    .info-window-videos .media-item::after {
        content: '🔍';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 16px;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        z-index: 2;
        background-color: rgba(0, 0, 0, 0.5);
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .info-window-videos .media-item:hover::after {
        opacity: 1;
    }

    .hw-info-window {
        pointer-events: auto !important;
    }

    .hw-info-window-content {
        display: none !important;
    }

    .hw-info-window-container {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .enlarged-image {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10000;
        background-color: rgba(0, 0, 0, 0.95);
        display: none;
        justify-content: center;
        align-items: center;
        width: 100vw;
        height: 100vh;
    }
    
    /* 关闭按钮 */
    .close-btn {
        position: absolute;
        top: 20px;
        right: 30px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.5);
        color: white;
        font-size: 28px;
        line-height: 36px;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        z-index: 10001;
        padding: 0;
    }
    
    .close-btn:hover {
        background-color: rgba(255, 255, 255, 0.3);
        border-color: white;
        transform: rotate(90deg);
    }
    
    /* 导航按钮 */
    .nav-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.15);
        border: 2px solid rgba(255, 255, 255, 0.4);
        color: white;
        font-size: 32px;
        line-height: 46px;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        z-index: 10001;
        padding: 0;
    }
    
    .nav-btn:hover {
        background-color: rgba(255, 255, 255, 0.3);
        border-color: white;
        transform: translateY(-50%) scale(1.1);
    }
    
    .prev-btn {
        left: 30px;
    }
    
    .next-btn {
        right: 30px;
    }
    
    /* 图片计数器 */
    .image-counter {
        position: absolute;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);
        background-color: rgba(0, 0, 0, 0.6);
        color: white;
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 14px;
        font-weight: 500;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: 10001;
    }
    
    /* 媒体查看器容器 */
    .media-viewer {
        position: relative;
        max-width: 90vw;
        max-height: 90vh;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .media-viewer img,
    .media-viewer video {
        max-width: 90vw;
        max-height: 90vh;
        object-fit: contain;
        border-radius: 8px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    }
    
    /* 实况图容器 */
    #livephoto-container {
        position: relative;
        display: none;
    }
    
    #livephoto-container img {
        max-width: 90vw;
        max-height: 90vh;
        object-fit: contain;
        border-radius: 8px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    }
    
    #livephoto-video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        opacity: 0;
        transition: opacity 0.3s ease;
        border-radius: 8px;
    }
    
    /* 放大后的实况徽章 */
    .enlarged-live-badge {
        position: absolute;
        top: 15px;
        left: 15px;
        background-color: rgba(0, 0, 0, 0.6);
        color: white;
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 6px;
        pointer-events: none;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: 10;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        letter-spacing: 0.5px;
    }
    
    .enlarged-live-badge .icon {
        display: flex;
        gap: 2px;
        align-items: center;
    }
    
    .enlarged-live-badge .icon span {
        width: 3px;
        height: 10px;
        background-color: white;
        border-radius: 2px;
        animation: iconBounce 1.5s ease-in-out infinite;
    }
    
    .enlarged-live-badge .icon span:nth-child(1) {
        animation-delay: 0s;
    }
    
    .enlarged-live-badge .icon span:nth-child(2) {
        animation-delay: 0.2s;
    }
    
    .enlarged-live-badge .icon span:nth-child(3) {
        animation-delay: 0.4s;
    }
    
    @keyframes iconBounce {
        0%, 100% {
            transform: scaleY(1);
        }
        50% {
            transform: scaleY(0.6);
        }
    }
    
    .marker-point {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        cursor: pointer;
        background-color: #fffffe;
        border: 2px solid white;
        position: relative;
        z-index: 100;
        box-shadow: 0 1.5px 4px rgba(0, 0, 0, 0.25);
    }
    
    .marker-point img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }
    
    .triangle-down {
        width: 0;
        height: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 9px solid #fffffe;
        position: absolute;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 99;
    }
    
    .loading-indicator {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 10px 20px;
        border-radius: 5px;
        z-index: 1000;
    }
    
    /* 轨迹控制面板优化 - 抽屉式 */
    .controls-container {
      position: absolute;
      bottom: 20px;
      right: 20px;
      background: rgba(255, 255, 255, 0.95);
      border-radius: 12px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
      z-index: 100;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      /* 默认折叠状态：只保留标题栏高度 */
      width: 48px; 
      height: 48px;
      padding: 0;
    }
    
    /* 展开状态 */
    .controls-container.expanded {
      width: 220px;
      height: auto;
      padding: 18px;
      min-height: 200px;
    }
    
    .controls-container:hover {
      box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    }
    
    /* 抽屉触发按钮（齿轮图标） */
    .controls-toggle-btn {
      width: 48px;
      height: 48px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 24px;
      color: #333;
      transition: transform 0.3s ease;
      flex-shrink: 0;
      user-select: none;
    }
    
    .controls-container.expanded .controls-toggle-btn {
      transform: rotate(90deg);
      color: #00d2ff;
    }
    
    /* 控制项内容区域 */
    .controls-content {
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.2s ease, visibility 0.2s ease;
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-top: 10px;
    }
    
    .controls-container.expanded .controls-content {
      opacity: 1;
      visibility: visible;
    }
    
    .control-group {
      transition: all 0.2s ease;
    }
    
    .control-label {
      display: flex;
      align-items: center;
      margin-bottom: 0;
      cursor: pointer;
      padding: 6px 10px;
      border-radius: 6px;
      transition: background-color 0.2s ease;
      font-size: 14px;
      color: #333;
      user-select: none;
    }
    
    .control-label:hover {
      background-color: rgba(0, 210, 255, 0.1);
    }
    
    .control-label input[type="checkbox"] {
      margin-right: 10px;
      width: 18px;
      height: 18px;
      cursor: pointer;
      accent-color: #00d2ff;
    }
    
    .admin-link {
      display: inline-block;
      margin-top: 12px;
      padding: 8px 16px;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
      text-decoration: none;
      border-radius: 6px;
      font-size: 14px;
      font-weight: 500;
      transition: all 0.3s ease;
      box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
      width: 100%;
      text-align: center;
      box-sizing: border-box;
    }
    
    .admin-link:hover {
      background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
      box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
      transform: translateY(-1px);
    }
    
    .info-window-location-info {
        margin-bottom: 14px;
        padding: 0;
        background-color: transparent;
        border: none;
        border-radius: 0;
        display: grid;
        gap: 9px;
    }

    .info-window-location-info div {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 0;
        padding: 8px 10px;
        background: #f7f9fc;
        border: 1px solid #edf1f7;
        border-radius: 9px;
        font-size: 12px;
        color: #3f4b5f;
        line-height: 1.5;
        min-width: 0;
    }
    
    .info-window-location-info div:last-child {
        margin-bottom: 0;
    }
    
    .info-window-location-info strong {
        color: #667085;
        font-weight: 700;
        font-size: 11px;
        padding: 2px 7px;
        background: #eef2f7;
        border-radius: 999px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .info-window-location-info span {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .info-window-section {
        margin-bottom: 8px;
    }

    .info-window-section-title {
        margin: 10px 0 7px 0;
        color: #667085;
        font-size: 11px;
        font-weight: 700;
        padding: 0;
        background-color: transparent;
        border: none;
        display: block;
        line-height: 1.2;
    }
    
    .country-flag {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .flag-icon {
        width: 13px;
        height: 9px;
        object-fit: contain;
        vertical-align: middle;
        flex-shrink: 0;
    }
    
    /* 添加遮罩层样式 */
    .map-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: transparent;
        z-index: 999;
        display: none;
        pointer-events: none; /* 默认不拦截任何鼠标事件，允许地图正常交互 */
    }
