/* ========== 教学点地图页面 ========== */

.map-page {
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}
.map-page .main { display: none; }
.map-page .footer { display: none; }

.map-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 筛选栏 */
.map-filter-bar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    position: relative;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    flex-shrink: 0;
}
.filter-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.map-cat-chip {
    flex-shrink: 0;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    background: #fff;
    color: var(--text-light);
    border: 1px solid #ddd;
    transition: all 0.2s;
    user-select: none;
    white-space: nowrap;
}
.map-cat-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.map-cat-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 500;
}

/* 地图容器 */
.map-container {
    flex: 1;
    width: 100%;
    background: #eef0f2;
    position: relative;
}

/* 点位计数徽章 */
.map-count-badge {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 20;
    font-weight: 500;
}
.map-count-badge strong {
    color: var(--primary);
    font-size: 16px;
    margin: 0 2px;
}

/* 点位详情弹窗 */
.site-detail-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
}
.site-detail-popup.show { display: block; }
.popup-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
}
.popup-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow-y: auto;
    animation: popupIn 0.3s ease;
}
@keyframes popupIn {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}
.popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    border: none;
    background: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.popup-close:hover { color: var(--text); }

.popup-site-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    padding-right: 30px;
    line-height: 1.4;
}
.popup-site-cat {
    display: inline-block;
    font-size: 12px;
    padding: 3px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 4px;
    margin-bottom: 16px;
    font-weight: 500;
}
.popup-site-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.popup-info-item {
    display: flex;
    gap: 10px;
    font-size: 14px;
}
.popup-info-label {
    flex-shrink: 0;
    color: var(--text-light);
    width: 60px;
}
.popup-info-value {
    flex: 1;
    color: var(--text);
    line-height: 1.6;
}
.popup-info-value a {
    color: #1a56db;
    text-decoration: none;
}
.popup-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
    font-weight: 500;
}
.popup-nav-btn:hover { background: var(--primary-dark); }
.popup-site-desc {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.8;
    max-height: 200px;
    overflow-y: auto;
}

/* 自定义标记点 — 高德地图用 */
.custom-marker {
    position: relative;
    width: 32px;
    height: 40px;
    cursor: pointer;
    transform: translate(-50%, -100%);
    transition: transform 0.2s;
}
.custom-marker:hover {
    transform: translate(-50%, -100%) scale(1.15);
}
.custom-marker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) rotate(-45deg);
    width: 32px;
    height: 32px;
    background: linear-gradient(180deg, #e74c3c 0%, #c41e2a 100%);
    border-radius: 50% 50% 50% 0;
    box-shadow: 0 2px 8px rgba(196, 30, 42, 0.4);
    transform-origin: center;
}
.custom-marker::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
}
.custom-marker .marker-pulse {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background: rgba(231, 76, 60, 0.4);
    border-radius: 50%;
    animation: markerPulse 2s infinite;
}
@keyframes markerPulse {
    0% { transform: translateX(-50%) scale(1); opacity: 0.6; }
    100% { transform: translateX(-50%) scale(2.5); opacity: 0; }
}

/* 响应式 */
@media (max-width: 700px) {
    .map-filter-bar { padding: 8px 12px; }
    .map-cat-chip { padding: 5px 14px; font-size: 13px; }
    .map-count-badge { top: 12px; left: 12px; padding: 6px 12px; font-size: 12px; }
    
    .popup-panel {
        width: 100%;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        transform: none;
        border-radius: 16px 16px 0 0;
        max-height: 70vh;
        animation: popupUp 0.3s ease;
    }
    @keyframes popupUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
}
