/* RabbitTravel Core Layout v1.0 */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

#fm-container {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #fff;
}

/* ===== 地图容器 ===== */
#fm-map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#fm-map.map-in {
    opacity: 1;
}

/* ===== 入场动画层 ===== */
#fm-intro {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    z-index: 100;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

#fm-intro.vanish {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#fm-globe-canvas {
    display: block;
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
}

.fm-intro-ui {
    position: absolute;
    bottom: 60px;
    width: 100%;
    text-align: center;
    font-size: 10px;
    color: #333;
    letter-spacing: 2px;
    animation: fmBlink 2s infinite;
}

@keyframes fmBlink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* ===== 标题 ===== */
.fm-header {
    position: absolute;
    top: 25px;
    left: 30px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.fm-header.show {
    opacity: 1;
}

.fm-title {
    font-size: 26px;
    font-weight: 800;
    color: #333;
    letter-spacing: 1px;
}

/* ===== 模式切换 ===== */
.fm-switch {
    position: absolute;
    top: 25px;
    right: 30px;
    z-index: 10;
    background: #fff;
    border-radius: 20px;
    padding: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.fm-switch.show {
    opacity: 1;
}

.fm-btn {
    padding: 6px 20px;
    border-radius: 18px;
    font-size: 13px;
    cursor: pointer;
    color: #888;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-weight: 600;
    user-select: none;
}

.fm-btn:hover {
    color: #555;
}

.fm-btn.active {
    background: #333;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

/* ===== 图例 ===== */
.fm-legend {
    position: absolute;
    bottom: 35px;
    right: 30px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.fm-legend-row {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
    background: rgba(255,255,255,0.95);
    padding: 5px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.fm-ldot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.fm-ldot.on {
    background: #00c0a6;
}

.fm-ldot.off {
    background: #f6f8f9;
    border: 1px solid #ddd;
}

/* ===== 底部类型图例（当前/游记/去过/想去） ===== */
.fm-type-legend {
    position: absolute;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 9px 22px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #eee;
    border-radius: 999px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
    user-select: none;
}

.fm-type-legend.show {
    opacity: 1;
}

.fm-type-item {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.fm-type-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

/* ===== 页脚 ===== */
.fm-footer {
    position: absolute;
    bottom: 12px;
    right: 15px;
    z-index: 10;
    font-size: 10px;
    color: #ddd;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.fm-footer.show {
    opacity: 1;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .fm-header {
        top: 15px;
        left: 15px;
    }

    .fm-title {
        font-size: 20px;
    }

    .fm-switch {
        top: 15px;
        right: 15px;
        padding: 2px;
    }

    .fm-btn {
        padding: 4px 12px;
        font-size: 12px;
    }

    .fm-legend {
        bottom: 25px;
        right: 10px;
        transform: scale(0.85);
        transform-origin: bottom right;
    }

    .fm-type-legend {
        bottom: 28px;
        gap: 14px;
        padding: 7px 16px;
    }

    .fm-type-item {
        font-size: 12px;
    }

    .fm-type-dot {
        width: 8px;
        height: 8px;
        margin-right: 6px;
    }

    .fm-footer {
        bottom: 8px;
        right: 12px;
        font-size: 9px;
        opacity: 0.8;
    }
}
