/* =========================================================================
   宸贸官网 - 展会案例(/portfolio) 世界地图样式
   作用域: .pf-map-wrap (仅该页 items 视图覆盖模板输出)
   不影响其他页面
   ========================================================================= */

.pf-map-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px 50px;
}

/* ---- 地图舞台 ---- */
.pf-map-stage {
    position: relative;
    width: 100%;
    /* 2:1 比例世界地图 */
    aspect-ratio: 2 / 1;
    background: linear-gradient(135deg, #0a2542 0%, #0d2c4f 40%, #103a63 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 50px rgba(2, 18, 40, 0.45);
    border: 1px solid rgba(45, 106, 166, 0.25);
}

/* 底部光晕 */
.pf-map-glow {
    position: absolute;
    left: 50%;
    bottom: -40%;
    width: 70%;
    height: 80%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(0, 122, 204, 0.28) 0%, rgba(0, 122, 204, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.pf-map-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    -webkit-user-select: none;
    user-select: none;
}

/* ---- 发光圆点 ---- */
.pf-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px; /* 居中到坐标点 */
    z-index: 3;
    cursor: pointer;
    display: block;
    text-decoration: none;
}

.pf-dot-core {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--dot, #34d399);
    box-shadow: 0 0 8px var(--dot, #34d399), 0 0 14px var(--dot, #34d399);
}

.pf-dot-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid var(--dot, #34d399);
    opacity: 0;
    animation: pfPulse 2.4s ease-out infinite;
}

.pf-dot:hover .pf-dot-core,
.pf-dot:focus .pf-dot-core {
    transform: scale(1.35);
    box-shadow: 0 0 12px var(--dot), 0 0 22px var(--dot), 0 0 32px var(--dot);
}

@keyframes pfPulse {
    0%   { transform: scale(0.6); opacity: 0.7; }
    70%  { transform: scale(1.8); opacity: 0; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* ---- 悬停预览 ---- */
.pf-dot-tip {
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: 180px;
    padding: 10px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    text-align: center;
    z-index: 5;
}

.pf-dot-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: #fff;
}

.pf-dot-tip img {
    width: 100%;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.pf-dot-name {
    display: block;
    font-size: 15px;
    font-weight: bold;
    color: #1a1a1a;
    margin-top: 8px;
}

.pf-dot-cat {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 10px;
    font-size: 11px;
    color: var(--dot, #34d399);
    background: #f0f4ff;
    border-radius: 10px;
}

.pf-dot:hover .pf-dot-tip,
.pf-dot:focus .pf-dot-tip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ---- 预览朝向修正(防裁切) ---- */
/* 靠上的点: 预览翻到下方 */
.pf-dot.pf-tip-down .pf-dot-tip {
    bottom: auto;
    top: 130%;
    transform: translateX(-50%) translateY(-8px);
}
.pf-dot.pf-tip-down .pf-dot-tip::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #fff;
}
.pf-dot.pf-tip-down:hover .pf-dot-tip,
.pf-dot.pf-tip-down:focus .pf-dot-tip {
    transform: translateX(-50%) translateY(0);
}

/* 靠右的点: 预览向左偏移, 右缘对齐圆点 */
.pf-dot.pf-tip-left .pf-dot-tip {
    left: auto;
    right: -4px;
    transform: translateX(0) translateY(8px);
}
.pf-dot.pf-tip-left .pf-dot-tip::after {
    left: auto;
    right: 18px;
    transform: none;
}
.pf-dot.pf-tip-left:hover .pf-dot-tip,
.pf-dot.pf-tip-left:focus .pf-dot-tip {
    transform: translateX(0) translateY(0);
}

/* 同时靠上又靠右: 下方 + 左偏 */
.pf-dot.pf-tip-down.pf-tip-left .pf-dot-tip {
    bottom: auto;
    top: 130%;
    transform: translateX(0) translateY(-8px);
}
.pf-dot.pf-tip-down.pf-tip-left:hover .pf-dot-tip,
.pf-dot.pf-tip-down.pf-tip-left:focus .pf-dot-tip {
    transform: translateX(0) translateY(0);
}

/* 图标点(无图时占位) */

/* ---- 图例 ---- */
.pf-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 22px;
}

.pf-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}

.pf-legend-item i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px currentColor;
}

.pf-legend-hint {
    font-size: 12px;
    color: #999;
    border-left: 1px solid #e0e0e0;
    padding-left: 16px;
}

/* ---- 移动端国家胶囊列表(小屏隐藏地图交互,改用列表) ---- */
.pf-country-chips {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 22px;
}

.pf-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e8f0fe;
    border-radius: 10px;
    transition: transform 0.25s, box-shadow 0.25s;
}

.pf-chip:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.1);
}

.pf-chip img {
    width: 56px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.pf-chip-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    flex: 1;
}

.pf-chip-cat {
    font-size: 11px;
    color: var(--c, #34d399);
    background: #f0f4ff;
    border-radius: 8px;
    padding: 2px 8px;
}

/* ---- 响应式 ---- */
@media (max-width: 991px) {
    .pf-map-stage { aspect-ratio: 2 / 1; }
    .pf-dot-tip { width: 150px; }
}

@media (max-width: 767px) {
    /* 小屏: 隐藏地图圆点交互,显示国家列表 */
    .pf-map-stage {
        aspect-ratio: 2.6 / 1;
    }
    .pf-dot { display: none; }
    .pf-country-chips { display: grid; }
    .pf-legend-hint { display: none; }
}

@media (max-width: 480px) {
    .pf-country-chips { grid-template-columns: 1fr; }
    .pf-map-stage { aspect-ratio: 2.8 / 1; }
}
