

/* =========================
   主容器
=========================*/

.service-hub {
    margin: 0px auto;
    padding: 0 10px;
    font-size: 1.7rem;
    background: #f4f7fb;
    color: #333;
    line-height: 1.6;
    overflow: visible;
}




/* =========================
   功能地圖
=========================*/


.function-map {
    background: #fff;
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,.08);
    overflow: visible;
}

    .function-map h3 {
        margin-bottom: 10px;
    }



.map-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    overflow: visible;
}

.map-column {
    position: relative;
    z-index: 1;
    position: relative;
    border-radius: 16px;
    overflow: visible; /* 很重要 */
}

    .map-column:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0,0,0,.08);
        z-index: 1000;
    }

    /* 一般民眾 */
    .map-column:nth-child(1) {
        background: #EFF6FF;
    }

        .map-column:nth-child(1) h4 {
            background: #2563EB;
        }

        .map-column:nth-child(1) p {
            color: #1E40AF;
        }

    /* 運動專業人員 */
    .map-column:nth-child(2) {
        background: #ECFDF5;
    }

        .map-column:nth-child(2) h4 {
            background: #059669;
        }

        .map-column:nth-child(2) p {
            color: #065F46;
        }

    /* 企業對象 */
    .map-column:nth-child(3) {
        background: #FFF7ED;
    }

        .map-column:nth-child(3) h4 {
            background: #D97706;
        }

        .map-column:nth-child(3) p {
            color: #92400E;
        }

    /* 計畫申請單位 */
    .map-column:nth-child(4) {
        background: #F5F3FF;
    }

        .map-column:nth-child(4) h4 {
            background: #7C3AED;
        }

        .map-column:nth-child(4) p {
            color: #5B21B6;
        }

    /* 統計數據 */
    .map-column:nth-child(5) {
        background: #FEF2F2;
    }

        .map-column:nth-child(5) h4 {
            background: #DC2626;
        }

        .map-column:nth-child(5) p {
            color: #991B1B;
        }

    .map-column h4 {
        margin: 0;
        padding: 15px;
        font-size: 2rem;
        font-weight: 700;
        color: #fff;
    }

    .map-column p {
        padding: 12px 15px;
        margin: 0;
        font-size: 1.5rem;
        border-bottom: 1px solid #e5e7eb;
    }

    .map-column ul {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        border-radius: 0 0 16px 16px;
        box-shadow: 0 10px 30px rgba(0,0,0,.15);
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all .25s ease;
        z-index: 999;
    }


    /* 滑鼠 */
    .map-column:hover ul,
    /* 鍵盤 TAB */
    .map-column:focus-within ul {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* 焦點提示 */
    .map-column:focus-within {
        box-shadow: 0 0 0 3px #FFD700, 0 8px 20px rgba(0,0,0,.12);
        z-index: 1000;
    }

    /* 連結焦點 */
    .map-column a:focus {
        outline: 3px solid #FFD700;
        outline-offset: 2px;
        border-radius: 6px;
    }

    .map-column:hover ul {
        max-height: 500px;
        opacity: 1;
    }

    .map-column ul li {
        padding: 0;
        border-bottom: 1px solid #ddd;
    }

        .map-column ul li:last-child {
            border-bottom: none;
        }

        .map-column ul li a {
            display: block;
            padding: 12px 15px;
            color: #334155;
        }

            .map-column ul li a:hover,
            .map-column ul li a:focus {
                background: #f8fafc;
                color: #2563eb;
            }


@media (min-width: 992px) {

    .map-column {
        position: relative;
    }

        .map-column ul {
            position: absolute;
            top: 100%;
            left: 0;
            width: 100%;
            background: #fff;
            border-radius: 0 0 16px 16px;
            box-shadow: 0 10px 30px rgba(0,0,0,.15);
            opacity: 0;
            visibility: hidden;
            transform: translateY(10px);
            transition: .25s;
            z-index: 9999;
        }

        .map-column:hover ul,
        .map-column:focus-within ul {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .map-column:hover {
            z-index: 1000;
        }
}

@media (max-width:767px) {

    .map-grid {
        grid-template-columns: 1fr;
    }

    .map-column ul {
        position: static;
        display: block;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        margin-top: 10px;
    }
}