/**
 * Travel Map Frontend Styles
 * 前端地图样式
 */

/* 全局链接样式 - 强制不显示下划线 */
.travel-map-container a,
.travel-map-container a:link,
.travel-map-container a:visited,
.travel-map-container a:hover,
.travel-map-container a:active {
    text-decoration: none !important;
}

/* 深色模式适配 */
html.dark .travel-map-container {
    background: #1f2937;
    color: #f3f4f6;
}

html.dark .travel-map-filters {
    background: #374151;
    border-bottom-color: #4b5563;
}

html.dark .travel-map-embedded-filters {
    background: rgba(55, 65, 81, 0.95);
    border-color: rgba(75, 85, 99, 0.3);
}

html.dark .travel-map-filter-tab {
    background: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

html.dark .travel-map-filter-tab:hover {
    background: #4b5563;
    border-color: #6b7280;
    color: #f3f4f6;
}

html.dark .travel-map-control-btn {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

html.dark .travel-map-control-btn:hover {
    background: #4b5563;
}

html.dark .travel-map-control-btn svg {
    color: #f3f4f6;
}

html.dark .travel-map-loading {
    background: #1f2937;
    color: #f3f4f6;
}

html.dark .travel-map-loading-text {
    color: #d1d5db;
}

html.dark .travel-map-error {
    background: #7f1d1d;
    border-color: #dc2626;
    color: #fecaca;
}

html.dark .travel-map-error-details {
    background: #991b1b;
    border-color: #dc2626;
}

html.dark .travel-map-popup {
    background: rgba(31, 41, 55, 0.8);
}

html.dark .travel-map-popup-content {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

html.dark .travel-map-popup-close {
    background: #4b5563;
    color: #f3f4f6;
}

html.dark .travel-map-popup-close:hover {
    background: #6b7280;
}

/* auto模式 - 跟随系统主题 */
html.auto .travel-map-container {
    background: #f5f5f5;
    color: #374151;
}

@media (prefers-color-scheme: dark) {
    html.auto .travel-map-container {
        background: #1f2937;
        color: #f3f4f6;
    }
    
    html.auto .travel-map-filters {
        background: #374151;
        border-bottom-color: #4b5563;
    }
    
    html.auto .travel-map-embedded-filters {
        background: rgba(55, 65, 81, 0.95);
        border-color: rgba(75, 85, 99, 0.3);
    }
    
    html.auto .travel-map-filter-tab {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    html.auto .travel-map-filter-tab:hover {
        background: #4b5563;
        border-color: #6b7280;
        color: #f3f4f6;
    }
    
    html.auto .travel-map-control-btn {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    
    html.auto .travel-map-control-btn:hover {
        background: #4b5563;
    }
    
    html.auto .travel-map-control-btn svg {
        color: #f3f4f6;
    }
    
    html.auto .travel-map-loading {
        background: #1f2937;
        color: #f3f4f6;
    }
    
    html.auto .travel-map-loading-text {
        color: #d1d5db;
    }
    
    html.auto .travel-map-error {
        background: #7f1d1d;
        border-color: #dc2626;
        color: #fecaca;
    }
    
    html.auto .travel-map-error-details {
        background: #991b1b;
        border-color: #dc2626;
    }
    
    html.auto .travel-map-popup {
        background: rgba(31, 41, 55, 0.8);
    }
    
    html.auto .travel-map-popup-content {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    
    html.auto .travel-map-popup-close {
        background: #4b5563;
        color: #f3f4f6;
    }
    
    html.auto .travel-map-popup-close:hover {
        background: #6b7280;
    }
}

/* 地图容器样式 */
.travel-map-container {
    width: 100%;
    height: var(--travel-map-height, 500px);
    --travel-map-control-size: 40px;
    --travel-map-control-icon: 20px;
    position: relative;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    /* 强化防护机制 - 防止主题图片浏览器 */
    isolation: isolate;
    contain: layout style;
    pointer-events: auto;
    z-index: 1;
}

/* 强化防护机制 - 防止主题图片浏览器 */
.travel-map-container * {
    /* 防止主题脚本识别图片元素 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.travel-map-container .travel-map-wrapper,
.travel-map-container .travel-map {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.travel-map-container.travel-map-no-tabs .travel-map {
    border-radius: 8px;
}

.travel-map-accessibility {
    position: absolute;
    left: -9999px;
}

.travel-map-container img {
    pointer-events: none !important;
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    /* 移除可能被主题识别的属性 */
    cursor: default !important;
}

/* 特别防护弹窗内的图片 */
.travel-map-custom-popup img {
    pointer-events: none !important;
    user-select: none !important;
    cursor: default !important;
    /* 防止主题图片浏览器脚本识别 */
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* 确保弹窗元素不被主题脚本影响 */
.travel-map-custom-popup {
    isolation: isolate !important;
    contain: layout style !important;
    pointer-events: auto !important;
    z-index: 9999 !important;
}

/* 标记点样式优化（合并重复的过渡效果） */
.travel-marker-with-image,
.travel-marker-default {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-radius 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 桌面端鼠标悬停放大效果 - 仅在非触摸设备上生效 */
@media (hover: hover) and (pointer: fine) {
    .travel-marker-with-image:hover {
        transform: scale(3.0);
        box-shadow: 0 12px 35px rgba(0,0,0,0.6) !important;
        border-radius: 5px !important;
        border-width: 0.3px !important;
        z-index: 1000;
    }
    
    .travel-marker-default:hover {
        transform: scale(2.0);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
        border-radius: 4px !important;
        z-index: 1000;
    }
}

/* 悬停预览样式 */
.travel-map-hover-preview {
    position: fixed;
    z-index: 9999;
    opacity: 0;
    /* 移除初始 transform，改为纯 opacity 动画 */
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.travel-map-hover-preview.show {
    opacity: 1;
}

.hover-preview-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow: hidden;
    width: 120px;
}

.hover-preview-content img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.hover-preview-title {
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    text-align: center;
    background: white;
}

/* 重新设计的弹窗样式（参考图风格） */
.travel-map-enhanced-popup {
    position: absolute;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 200px;
    max-width: 240px;
    z-index: 10001;
    /* 移除初始 transform，改为使用 opacity 实现动画 */
    opacity: 0;
    transition: opacity 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    pointer-events: auto;
    isolation: isolate;
    contain: layout style;
    /* 移除 overflow: hidden 以显示箭头 */
}

/* 顶部特色图片 */
.travel-map-enhanced-popup .popup-header-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.travel-map-enhanced-popup .popup-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 地点头部信息 */
.travel-map-enhanced-popup .popup-location-header {
    padding: 8px 12px 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.travel-map-enhanced-popup .location-flag {
    font-size: 14px;
    flex-shrink: 0;
}

.travel-map-enhanced-popup .location-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.1;
}

/* 文章列表 */
.travel-map-enhanced-popup .popup-articles-list {
    padding: 0 12px 12px 12px;
    max-height: 150px;
    overflow-y: auto;
}

.travel-map-enhanced-popup .popup-article-item {
    padding: 4px 0;
    cursor: pointer;
    transition: color 0.2s ease;
    font-size: 12px;
    color: #333;
    line-height: 1.2;
    border-bottom: 1px solid #f0f0f0;
}

.travel-map-enhanced-popup .popup-article-item:last-child {
    border-bottom: none;
}

.travel-map-enhanced-popup .popup-article-item:hover {
    color: #007cba;
}

/* 关闭按钮 */
.travel-map-enhanced-popup .travel-map-popup-close {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255,255,255,0.9);
    color: #666;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10002;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.travel-map-enhanced-popup .travel-map-popup-close:hover {
    background: rgba(255,255,255,1);
    color: #333;
}



.travel-map-enhanced-popup.show {
    opacity: 1;
}

/* 深色模式适配 */
html.dark .travel-map-enhanced-popup {
    background: #2d3748;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

html.dark .travel-map-enhanced-popup .popup-location-header {
    color: #f7fafc;
}

html.dark .travel-map-enhanced-popup .location-name {
    color: #f7fafc;
}

html.dark .travel-map-enhanced-popup .popup-article-item {
    color: #e2e8f0;
    border-bottom-color: #4a5568;
}

html.dark .travel-map-enhanced-popup .popup-article-item:hover {
    color: #63b3ed;
}

html.dark .travel-map-enhanced-popup .travel-map-popup-close {
    background: rgba(45, 55, 72, 0.9);
    color: #e2e8f0;
}

html.dark .travel-map-enhanced-popup .travel-map-popup-close:hover {
    background: rgba(45, 55, 72, 1);
    color: #f7fafc;
}



/* 浅色模式和auto模式默认样式（合并重复规则） */
html.light .travel-map-enhanced-popup,
html.auto .travel-map-enhanced-popup {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

html.light .travel-map-enhanced-popup .popup-location-header,
html.auto .travel-map-enhanced-popup .popup-location-header,
html.light .travel-map-enhanced-popup .location-name,
html.auto .travel-map-enhanced-popup .location-name {
    color: #333;
}

html.light .travel-map-enhanced-popup .popup-article-item,
html.auto .travel-map-enhanced-popup .popup-article-item {
    color: #333;
    border-bottom-color: #f0f0f0;
}

html.light .travel-map-enhanced-popup .popup-article-item:hover,
html.auto .travel-map-enhanced-popup .popup-article-item:hover {
    color: #007cba;
}

html.light .travel-map-enhanced-popup .travel-map-popup-close,
html.auto .travel-map-enhanced-popup .travel-map-popup-close {
    background: rgba(255,255,255,0.9);
    color: #666;
}

html.light .travel-map-enhanced-popup .travel-map-popup-close:hover,
html.auto .travel-map-enhanced-popup .travel-map-popup-close:hover {
    background: rgba(255,255,255,1);
    color: #333;
}



@media (prefers-color-scheme: dark) {
    html.auto .travel-map-enhanced-popup {
        background: #2d3748;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    }
    
    html.auto .travel-map-enhanced-popup .popup-location-header {
        color: #f7fafc;
    }
    
    html.auto .travel-map-enhanced-popup .location-name {
        color: #f7fafc;
    }
    
    html.auto .travel-map-enhanced-popup .popup-article-item {
        color: #e2e8f0;
        border-bottom-color: #4a5568;
    }
    
    html.auto .travel-map-enhanced-popup .popup-article-item:hover {
        color: #63b3ed;
    }
    
    html.auto .travel-map-enhanced-popup .travel-map-popup-close {
        background: rgba(45, 55, 72, 0.9);
        color: #e2e8f0;
    }
    
    html.auto .travel-map-enhanced-popup .travel-map-popup-close:hover {
        background: rgba(45, 55, 72, 1);
        color: #f7fafc;
    }
    

}

.travel-map-custom-popup * {
    /* 重置所有子元素的样式，防止主题干扰 */
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    text-decoration: none;
    list-style: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
}

.travel-map-custom-popup img {
    /* 特别防止图片被主题的图片浏览器捕获 */
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    cursor: default !important;
}

.travel-map-custom-popup.show {
    opacity: 1;
}

.travel-map-custom-popup .travel-map-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.9);
    color: #666;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10002;
    line-height: 1;
}

.travel-map-custom-popup .travel-map-popup-close:hover {
    background: #f0f0f0;
    border-color: #ccc;
    color: #333;
}

.travel-map-custom-popup .popup-location {
    padding: 6px 10px 4px 10px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fafafa;
    border-radius: 8px 8px 0 0;
}

.travel-map-custom-popup .location-flag {
    font-size: 12px;
    flex-shrink: 0;
}

.travel-map-custom-popup .location-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.1;
}

.travel-map-custom-popup .popup-articles {
    padding: 4px 8px 6px 8px;
    max-height: 120px;
    overflow-y: auto;
}

.travel-map-custom-popup .popup-article {
    padding: 2px 4px;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.15s ease;
    margin-bottom: 2px;
    border: none;
}

.travel-map-custom-popup .popup-article:hover {
    background: #f0f0f0;
}

.travel-map-custom-popup .popup-article .article-title {
    font-size: 11px;
    font-weight: 500;
    color: #222;
    margin: 0;
    line-height: 1.1;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.travel-map-custom-popup .popup-article .article-date {
    font-size: 9px;
    color: #999;
    margin: 0;
    margin-top: 1px;
}

/* 简洁弹窗信息样式 */
.travel-map-custom-popup .popup-article-info {
    padding: 0;
}

.travel-map-custom-popup .info-text {
    font-size: 10px;
    color: #666;
    line-height: 1.2;
    margin: 0;
}

/* 新增的信息项样式 */
.travel-map-custom-popup .info-item {
    font-size: 10px;
    color: #666;
    line-height: 1.3;
    margin: 0 0 3px 0;
    padding: 2px 0;
}

.travel-map-custom-popup .info-item:last-child {
    margin-bottom: 0;
}

.travel-map-custom-popup .info-item.wish-reason {
    color: #1e40af;
    font-weight: 500;
}

.travel-map-custom-popup .info-item.description {
    color: #374151;
}

/* 筛选标签栏 */
.travel-map-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 8px;
}

/* 嵌入式筛选标签 - 浮动在地图上方 */
.travel-map-embedded-filters {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001; /* 确保在地图之上 */
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); /* Safari 兼容 */
    padding: 8px 12px;
    border-radius: 20px;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: auto; /* 确保可以点击 */
    visibility: visible; /* 确保可见 */
    opacity: 1; /* 确保不透明 */
    min-width: 200px; /* 最小宽度 */
}

.travel-map-filter-tab {
    padding: 6px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    line-height: 1;
}

.travel-map-filter-tab:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.travel-map-filter-tab.active {
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.travel-map-filter-tab.active.all {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.travel-map-filter-tab.active.visited {
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
}

.travel-map-filter-tab.active.want_to_go {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.travel-map-filter-tab.active.planned {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* 地图主体 */
.travel-map-wrapper {
    position: relative;
    width: 100%;
    min-height: 400px;
    height: inherit; /* 继承父容器的高度设置 */
    overflow: hidden; /* 防止子元素溢出 */
    border-radius: 8px; /* 与容器一致的圆角 */
}

.travel-map {
    width: 100%;
    height: 100%; /* 继承包装器的高度 */
    min-height: 400px;
    position: relative;
    background: #f5f5f5;
    border-radius: 8px; /* 与容器一致的圆角 */
}

/* 确保地图容器能够正确继承短代码设置的高度 */
.travel-map-container {
    /* 移除固定高度，让短代码的内联样式生效 */
}

/* 响应式高度调整 - 只在移动端进行限制 */
@media (max-width: 768px) {
    .travel-map-container {
        /* 移动端使用竖型显示，高度大于宽度 */
        aspect-ratio: 1 / 1.3 !important; /* 高宽比 1:1.3 */
        width: 100% !important;
        max-height: none !important; /* 移除最大高度限制 */
        min-height: 400px; /* 最小高度保证 */
    }
    
    .travel-map-wrapper {
        height: 100%;
        max-height: none;
        min-height: 400px;
    }
    
    .travel-map {
        height: 100%;
        max-height: none;
        min-height: 400px;
    }
}

@media (max-width: 480px) {
    .travel-map-container {
        /* 小屏幕使用更大的高宽比 */
        aspect-ratio: 1 / 1.5 !important; /* 高宽比 1:1.5 */
        width: 100% !important;
        max-height: none !important;
        min-height: 350px; /* 最小高度保证 */
    }
    
    .travel-map-wrapper {
        height: 100%;
        max-height: none;
        min-height: 350px;
    }
    
    .travel-map {
        height: 100%;
        max-height: none;
        min-height: 350px;
    }
}

/* 地图控制按钮 */
.travel-map-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.travel-map-control-btn {
    width: var(--travel-map-control-size);
    height: var(--travel-map-control-size);
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0;
    font-size: 0;
    line-height: 0;
    -webkit-appearance: none;
    appearance: none;
}

.travel-map-control-btn:hover {
    background: #f9fafb;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.travel-map-control-btn svg {
    width: var(--travel-map-control-icon);
    height: var(--travel-map-control-icon);
    min-width: var(--travel-map-control-icon);
    min-height: var(--travel-map-control-icon);
    display: block;
    flex: 0 0 auto;
    color: #374151;
}

/* 加载状态 */
.travel-map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
}

.travel-map-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: travel-map-spin 1s linear infinite;
}

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

.travel-map-loading-text {
    margin-top: 12px;
    color: #6b7280;
    font-size: 14px;
}

/* 错误状态 */
.travel-map-error {
    padding: 40px 24px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    border: 1px solid #fecaca;
}

.travel-map-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.travel-map-error-message {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #dc2626;
}

.travel-map-error-details {
    background: #fff;
    padding: 16px;
    border-radius: 6px;
    margin-top: 16px;
    text-align: left;
    border: 1px solid #fecaca;
}

.travel-map-error-details p {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #991b1b;
}

.travel-map-error-details ul {
    margin: 8px 0 16px 20px;
    color: #7f1d1d;
}

.travel-map-error-details li {
    margin-bottom: 4px;
}

.travel-map-retry-btn {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.travel-map-retry-btn:hover {
    background: #b91c1c;
}

/* 简洁弹窗样式（用于计划和想去状态） */
.travel-map-simple-popup {
    position: absolute;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    padding: 12px 16px;
    min-width: 180px;
    max-width: 250px;
    z-index: 1000;
    /* 移除初始 transform，改为使用 opacity 实现动画 */
    opacity: 0;
    transition: opacity 0.2s ease;
    /* CSS 隔离保护策略 */
    isolation: isolate;
    contain: layout style;
}

.travel-map-simple-popup.show {
    opacity: 1;
}

.travel-map-simple-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #fff;
}

/* 当简洁弹窗在标记点下方时 */
.travel-map-simple-popup.popup-below::after {
    top: -6px;
    border-top: none;
    border-bottom: 6px solid #fff;
}

.travel-map-simple-popup-close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.travel-map-simple-popup-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #6b7280;
}

.travel-map-simple-popup-content {
    padding-right: 20px;
}

.travel-map-simple-popup-place {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 3px;
    line-height: 1.3;
}

.travel-map-simple-popup-info {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.travel-map-simple-popup-info .info-item {
    margin-bottom: 3px;
}

.travel-map-simple-popup-info .info-item:last-child {
    margin-bottom: 0;
}

/* 简洁弹窗的主题模式适配 */
/* 深色模式 */
html.dark .travel-map-simple-popup {
    background: #374151;
    border-color: #4b5563;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html.dark .travel-map-simple-popup::after {
    border-top-color: #374151;
}

html.dark .travel-map-simple-popup.popup-below::after {
    border-bottom-color: #374151;
}

html.dark .travel-map-simple-popup-close {
    color: #d1d5db;
}

html.dark .travel-map-simple-popup-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f3f4f6;
}

html.dark .travel-map-simple-popup-place {
    color: #f3f4f6;
}

html.dark .travel-map-simple-popup-info {
    color: #d1d5db;
}

/* 浅色模式和auto模式默认样式（合并重复规则） */
html.light .travel-map-simple-popup,
html.auto .travel-map-simple-popup {
    background: #fff;
    border-color: #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

html.light .travel-map-simple-popup::after,
html.auto .travel-map-simple-popup::after {
    border-top-color: #fff;
}

html.light .travel-map-simple-popup.popup-below::after,
html.auto .travel-map-simple-popup.popup-below::after {
    border-bottom-color: #fff;
}

html.light .travel-map-simple-popup-close,
html.auto .travel-map-simple-popup-close {
    color: #9ca3af;
}

html.light .travel-map-simple-popup-close:hover,
html.auto .travel-map-simple-popup-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #6b7280;
}

html.light .travel-map-simple-popup-place,
html.auto .travel-map-simple-popup-place {
    color: #1f2937;
}

html.light .travel-map-simple-popup-info,
html.auto .travel-map-simple-popup-info {
    color: #6b7280;
}

@media (prefers-color-scheme: dark) {
    html.auto .travel-map-simple-popup {
        background: #374151;
        border-color: #4b5563;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    html.auto .travel-map-simple-popup::after {
        border-top-color: #374151;
    }
    
    html.auto .travel-map-simple-popup.popup-below::after {
        border-bottom-color: #374151;
    }
    
    html.auto .travel-map-simple-popup-close {
        color: #d1d5db;
    }
    
    html.auto .travel-map-simple-popup-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #f3f4f6;
    }
    
    html.auto .travel-map-simple-popup-place {
        color: #f3f4f6;
    }
    
    html.auto .travel-map-simple-popup-info {
        color: #d1d5db;
    }
}

/* 自定义弹窗的主题模式适配 */
/* 深色模式 */
html.dark .travel-map-custom-popup {
    background: #374151 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html.dark .travel-map-custom-popup::after {
    border-top-color: #374151 !important;
}

html.dark .travel-map-custom-popup.popup-below::after {
    border-bottom-color: #374151 !important;
}

html.dark .travel-map-custom-popup .travel-map-popup-close {
    background: rgba(55, 65, 81, 0.9) !important;
    color: #e2e8f0 !important;
    border-color: #4b5563 !important;
}

html.dark .travel-map-custom-popup .travel-map-popup-close:hover {
    background: #4b5563 !important;
    border-color: #6b7280 !important;
    color: #f3f4f6 !important;
}

html.dark .travel-map-custom-popup .popup-location {
    background: #4b5563 !important;
    border-bottom-color: #6b7280 !important;
}

html.dark .travel-map-custom-popup .location-name {
    color: #f3f4f6 !important;
}

html.dark .travel-map-custom-popup .popup-article {
    color: #e2e8f0 !important;
}

html.dark .travel-map-custom-popup .popup-article:hover {
    background: #4b5563 !important;
}

html.dark .travel-map-custom-popup .popup-article .article-title {
    color: #e2e8f0 !important;
}

html.dark .travel-map-custom-popup .popup-article .article-date {
    color: #9ca3af !important;
}

html.dark .travel-map-custom-popup .info-text {
    color: #d1d5db !important;
}

/* 深色模式下的信息项样式 */
html.dark .travel-map-custom-popup .info-item {
    color: #d1d5db !important;
}

html.dark .travel-map-custom-popup .info-item.wish-reason {
    color: #60a5fa !important;
}

html.dark .travel-map-custom-popup .info-item.description {
    color: #e5e7eb !important;
}

/* 浅色模式和auto模式默认样式（合并重复规则） */
html.light .travel-map-custom-popup,
html.auto .travel-map-custom-popup {
    background: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

html.light .travel-map-custom-popup::after,
html.auto .travel-map-custom-popup::after {
    border-top-color: #ffffff !important;
}

html.light .travel-map-custom-popup.popup-below::after,
html.auto .travel-map-custom-popup.popup-below::after {
    border-bottom-color: #ffffff !important;
}

html.light .travel-map-custom-popup .travel-map-popup-close,
html.auto .travel-map-custom-popup .travel-map-popup-close {
    background: rgba(255,255,255,0.9) !important;
    color: #666 !important;
    border-color: #ddd !important;
}

html.light .travel-map-custom-popup .travel-map-popup-close:hover,
html.auto .travel-map-custom-popup .travel-map-popup-close:hover {
    background: #f0f0f0 !important;
    border-color: #ccc !important;
    color: #333 !important;
}

html.light .travel-map-custom-popup .popup-location,
html.auto .travel-map-custom-popup .popup-location {
    background: #fafafa !important;
    border-bottom-color: #e8e8e8 !important;
}

html.light .travel-map-custom-popup .location-name,
html.auto .travel-map-custom-popup .location-name,
html.light .travel-map-custom-popup .popup-article,
html.auto .travel-map-custom-popup .popup-article {
    color: #333 !important;
}

html.light .travel-map-custom-popup .popup-article:hover,
html.auto .travel-map-custom-popup .popup-article:hover {
    background: #f0f0f0 !important;
}

html.light .travel-map-custom-popup .popup-article .article-title,
html.auto .travel-map-custom-popup .popup-article .article-title {
    color: #222 !important;
}

html.light .travel-map-custom-popup .popup-article .article-date,
html.auto .travel-map-custom-popup .popup-article .article-date {
    color: #999 !important;
}

html.light .travel-map-custom-popup .info-text,
html.auto .travel-map-custom-popup .info-text,
html.light .travel-map-custom-popup .info-item,
html.auto .travel-map-custom-popup .info-item {
    color: #666 !important;
}

html.light .travel-map-custom-popup .info-item.wish-reason,
html.auto .travel-map-custom-popup .info-item.wish-reason {
    color: #1e40af !important;
}

html.light .travel-map-custom-popup .info-item.description,
html.auto .travel-map-custom-popup .info-item.description {
    color: #374151 !important;
}

@media (prefers-color-scheme: dark) {
    html.auto .travel-map-custom-popup {
        background: #374151 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    html.auto .travel-map-custom-popup::after {
        border-top-color: #374151 !important;
    }
    
    html.auto .travel-map-custom-popup.popup-below::after {
        border-bottom-color: #374151 !important;
    }
    
    html.auto .travel-map-custom-popup .travel-map-popup-close {
        background: rgba(55, 65, 81, 0.9) !important;
        color: #e2e8f0 !important;
        border-color: #4b5563 !important;
    }
    
    html.auto .travel-map-custom-popup .travel-map-popup-close:hover {
        background: #4b5563 !important;
        border-color: #6b7280 !important;
        color: #f3f4f6 !important;
    }
    
    html.auto .travel-map-custom-popup .popup-location {
        background: #4b5563 !important;
        border-bottom-color: #6b7280 !important;
    }
    
    html.auto .travel-map-custom-popup .location-name {
        color: #f3f4f6 !important;
    }
    
    html.auto .travel-map-custom-popup .popup-article {
        color: #e2e8f0 !important;
    }
    
    html.auto .travel-map-custom-popup .popup-article:hover {
        background: #4b5563 !important;
    }
    
    html.auto .travel-map-custom-popup .popup-article .article-title {
        color: #e2e8f0 !important;
    }
    
    html.auto .travel-map-custom-popup .popup-article .article-date {
        color: #9ca3af !important;
    }
    
    html.auto .travel-map-custom-popup .info-text {
        color: #d1d5db !important;
    }
    
    /* auto模式深色下的信息项样式 */
    html.auto .travel-map-custom-popup .info-item {
        color: #d1d5db !important;
    }
    
    html.auto .travel-map-custom-popup .info-item.wish-reason {
        color: #60a5fa !important;
    }
    
    html.auto .travel-map-custom-popup .info-item.description {
        color: #e5e7eb !important;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .travel-map-container {
        --travel-map-control-size: 36px;
        --travel-map-control-icon: 18px;
    }

    .travel-map-filters {
        padding: 8px 12px;
        gap: 6px;
    }
    
    .travel-map-embedded-filters {
        top: 8px;
        padding: 6px 10px;
        gap: 4px;
        border-radius: 16px;
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100% - 120px); /* 留出空间给右侧控制按钮 */
        right: auto;
    }
    
    .travel-map-filter-tab {
        padding: 5px 10px;
        font-size: 11px;
        min-height: 24px;
        border-radius: 16px;
    }
    
    .travel-map-controls {
        top: 8px;
        right: 8px;
    }
    
    .travel-map-control-btn {
        width: var(--travel-map-control-size);
        height: var(--travel-map-control-size);
    }
    
    .travel-map-control-btn svg {
        width: var(--travel-map-control-icon);
        height: var(--travel-map-control-icon);
    }
    
    .travel-map-popup-content {
        width: 95%;
        max-width: 340px;
    }
    
    .travel-map-popup-image {
        height: 150px;
    }
    
    .travel-map-simple-popup {
        min-width: 250px;
        max-width: 280px;
        padding: 12px;
    }
    
    .travel-map-error {
        padding: 24px 16px;
    }
    
    .travel-map-error-icon {
        font-size: 36px;
    }
}

/* iOS Safari 图标尺寸修正 */
@supports (-webkit-touch-callout: none) {
    .travel-map-container {
        --travel-map-control-icon: 20px;
    }
}

@media (max-width: 480px) {
    .travel-map-filters {
        padding: 6px 8px;
        gap: 4px;
    }
    
    .travel-map-embedded-filters {
        top: 6px;
        padding: 4px 8px;
        gap: 3px;
        border-radius: 14px;
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100% - 100px); /* 留出空间给右侧控制按钮 */
        right: auto;
    }
    
    .travel-map-filter-tab {
        padding: 4px 8px;
        font-size: 10px;
        min-height: 20px;
        border-radius: 12px;
    }
    
    .travel-map-error {
        padding: 16px 12px;
        font-size: 13px;
    }
    
    .travel-map-error-message {
        font-size: 14px;
    }
    
    .travel-map-error-icon {
        font-size: 28px;
        margin-bottom: 12px;
    }
}

/* 统一的弹窗箭头样式 - 最高优先级 */
.travel-map-enhanced-popup::after,
.travel-map-custom-popup::after {
    content: '' !important;
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    margin-left: -6px !important; /* 箭头宽度的一半 */
    width: 0 !important;
    height: 0 !important;
    border-left: 6px solid transparent !important; /* 缩小箭头宽度 */
    border-right: 6px solid transparent !important;
    border-top: 6px solid #ffffff !important; /* 缩小箭头高度 */
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15)) !important; /* 减小阴影偏移 */
    z-index: 10002 !important;
}

.travel-map-enhanced-popup.popup-below::after,
.travel-map-custom-popup.popup-below::after {
    top: -6px !important; /* 调整为箭头高度 */
    border-top: none !important;
    border-bottom: 6px solid #ffffff !important;
}

/* 深色模式箭头颜色 */
html.dark .travel-map-enhanced-popup::after,
html.dark .travel-map-custom-popup::after {
    border-top-color: #2d3748 !important;
}

html.dark .travel-map-enhanced-popup.popup-below::after,
html.dark .travel-map-custom-popup.popup-below::after {
    border-bottom-color: #2d3748 !important;
}

/* ========================================
   移动端响应式弹窗样式
   ======================================== */

/* 平板和移动设备（宽度 ≤ 768px） */
@media (max-width: 768px) {
    /* 增强型弹窗 - 移动端缩小 */
    .travel-map-enhanced-popup {
        min-width: 160px !important;
        max-width: 200px !important;
    }
    
    .travel-map-enhanced-popup .popup-header-image {
        height: 100px !important;
    }
    
    .travel-map-enhanced-popup .popup-location-header {
        padding: 6px 10px 4px 10px !important;
    }
    
    .travel-map-enhanced-popup .location-flag {
        font-size: 13px !important;
    }
    
    .travel-map-enhanced-popup .location-name {
        font-size: 13px !important;
    }
    
    .travel-map-enhanced-popup .popup-articles-list {
        padding: 0 10px 10px 10px !important;
        max-height: 120px !important;
    }
    
    .travel-map-enhanced-popup .popup-article-item {
        font-size: 11px !important;
        padding: 3px 0 !important;
    }
    
    .travel-map-enhanced-popup .travel-map-popup-close {
        width: 18px !important;
        height: 18px !important;
        font-size: 11px !important;
        top: 5px !important;
        right: 5px !important;
    }
    
    /* 自定义弹窗 - 移动端缩小 */
    .travel-map-custom-popup {
        min-width: 160px !important;
        max-width: 200px !important;
    }
    
    .travel-map-custom-popup .popup-location {
        padding: 5px 8px 3px 8px !important;
    }
    
    .travel-map-custom-popup .location-flag {
        font-size: 11px !important;
    }
    
    .travel-map-custom-popup .location-name {
        font-size: 11px !important;
    }
    
    .travel-map-custom-popup .popup-articles {
        padding: 3px 6px 5px 6px !important;
        max-height: 100px !important;
    }
    
    .travel-map-custom-popup .popup-article {
        padding: 2px 3px !important;
    }
    
    .travel-map-custom-popup .popup-article .article-title {
        font-size: 10px !important;
    }
    
    .travel-map-custom-popup .popup-article .article-date {
        font-size: 8px !important;
    }
    
    .travel-map-custom-popup .info-item {
        font-size: 9px !important;
    }
    
    .travel-map-custom-popup .travel-map-popup-close {
        width: 18px !important;
        height: 18px !important;
        font-size: 11px !important;
        top: 5px !important;
        right: 5px !important;
    }
    
    /* 简洁弹窗 - 移动端缩小 */
    .travel-map-simple-popup {
        min-width: 150px !important;
        max-width: 190px !important;
        padding: 10px 12px !important;
    }
    
    .travel-map-simple-popup-place {
        font-size: 12px !important;
    }
    
    .travel-map-simple-popup-info {
        font-size: 11px !important;
    }
    
    .travel-map-simple-popup-close {
        width: 16px !important;
        height: 16px !important;
        font-size: 13px !important;
        top: 3px !important;
        right: 3px !important;
    }
    
    /* 悬停预览 - 移动端缩小 */
    .hover-preview-content {
        width: 100px !important;
    }
    
    .hover-preview-content img {
        height: 70px !important;
    }
    
    .hover-preview-title {
        font-size: 11px !important;
        padding: 6px 8px !important;
    }
}

/* 小屏手机（宽度 ≤ 480px） */
@media (max-width: 480px) {
    /* 增强型弹窗 - 进一步缩小 */
    .travel-map-enhanced-popup {
        min-width: 140px !important;
        max-width: 180px !important;
    }
    
    .travel-map-enhanced-popup .popup-header-image {
        height: 80px !important;
    }
    
    .travel-map-enhanced-popup .location-name {
        font-size: 12px !important;
    }
    
    .travel-map-enhanced-popup .popup-article-item {
        font-size: 10px !important;
    }
    
    /* 自定义弹窗 - 进一步缩小 */
    .travel-map-custom-popup {
        min-width: 140px !important;
        max-width: 180px !important;
    }
    
    .travel-map-custom-popup .location-name {
        font-size: 10px !important;
    }
    
    .travel-map-custom-popup .popup-article .article-title {
        font-size: 9px !important;
    }
    
    .travel-map-custom-popup .info-item {
        font-size: 8px !important;
    }
    
    /* 简洁弹窗 - 进一步缩小 */
    .travel-map-simple-popup {
        min-width: 130px !important;
        max-width: 170px !important;
        padding: 8px 10px !important;
    }
    
    .travel-map-simple-popup-place {
        font-size: 11px !important;
    }
    
    .travel-map-simple-popup-info {
        font-size: 10px !important;
    }
}
