﻿html, body {
    font-family: 微軟正黑體,PingFang TC, sans-serif;
    height: 100%;
    margin: 0;
    padding: 0;
}

p {
    font-size:large;
}

form {
    display: flex;
    flex-direction: column;
}

main.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.body-content {
    flex-grow: 1;
    padding-top: 0.5rem; /* 預留一些空間 */
    padding-bottom: 3rem; /* 預留一些空間 */
}

.main {
    flex: 1 0 auto;
    background-color: #fff !important; /* 主內容區白底 */
    min-height: 74vh;
}

.navbar {
    background-color: #f7f7f7;
    position: fixed; /* 頁首固定頂端 */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1010;
    flex-wrap: nowrap;
}

/* 主選單 */
.main-nav {
    display: flex;
    background-color: #5EBD87;
    border-bottom: 2px solid #383838;
    position: fixed; /* 頁首固定頂端 */
    top: 85px;
    left: 0;
    width: 100%;
    z-index: 1020;
}

main.main {
    padding-top: 60px; /* 根據 navbar + main-nav 的總高度 */
}

@media (min-width: 992px) {
    main.main {
        padding-top: 150px; /* 根據 navbar + main-nav 的總高度 */
    }
}

.main-nav > .nav-item {
    height: 100%;
    position: relative;
}

.main-nav .nav-link {
    height: 100%;
    display: flex;
    align-items: center;
    color: #222;
    font-weight: 500;
    padding: 1rem 1.25rem;
    white-space: nowrap;
}

    .main-nav .nav-link:hover {
        background-color: #D3ECBB;
    }

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #D3ECBB;
    min-width: 220px;
    z-index: 1000;
    border: 2px solid #D3ECBB;
    border-radius: 0;
    padding: 0.5rem 0.5rem;
}

.dropdown:hover > .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.5rem 0.5rem;
    color: #000;
    text-decoration: none;
    position: relative;
    font-size: 1rem;
    line-height: 1.5;
}

    /* 次層展開子選單樣式 */
    .dropdown-menu a:hover {
        background: #D3ECBB;
        color: #555 !important;
    }

    .dropdown-menu a::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0.5rem;
        width: 0;
        height: 1px;
        background-color: #2b6c2f;
        transition: width 0.3s ease;
        pointer-events: none;
    }

    .dropdown-menu a:hover::after {
        width: 91%;
        /* 滑入時滑出整條線 */
        color: #000;
    }

.dropdown-submenu {
    position: relative;
}

    .dropdown-submenu .dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: -10px;
        margin-left: 0px;
    }

    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
    }

/* 主選單 hover 底部延伸背景 */
.nav-item:hover {
    background-color: #D3ECBB;
}

/* 側欄選單 */
#mobileMenu {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: #fff;
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    overflow-y: auto;
    /* ✅ 讓內容可以捲動 */
    max-height: 100vh;
    /* ✅ 避免超出畫面 */
}

    #mobileMenu.active {
        transform: translateX(0);
    }

    #mobileMenu .main-menu a {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid #eee;
        text-decoration: none;
        color: #333;
        font-weight: 500;
    }

#menuOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1040;
    display: none;
}

    #menuOverlay.active {
        display: block;
    }

.main-menu .submenu {
    display: none;
    padding-left: 1rem;
    margin-top: 0.25rem;
}

    .main-menu .submenu a {
        display: block;
        padding: 0.5rem 0;
        border-bottom: 1px solid #eee;
        color: #777;
        font-size: 0.95rem;
    }

.main-menu .submenu {
    display: none;
}

    .main-menu .submenu.open {
        display: block;
    }

.dropdown-menu a:hover,
.dropdown-menu a:focus,
.dropdown-menu a:active {
    background-color: #D3ECBB;
    color: #888;
    outline: none;
    box-shadow: none;
}

@media (max-width: 767.98px) {
    .navbar-brand img {
        height: 45px !important;
        /* 手機版高度 */
    }
}

@media (min-width: 768px) {
    .navbar-brand img {
        height: 60px !important;
        /* 平板以上維持原尺寸 */
    }
}

/* 手機版選單 hover 灰色背景 */
@media (max-width: 991.98px) {
    #mobileMenu .main-menu a:hover {
        background-color: #f0f0f0;
    }

    #mobileMenu .main-menu a:focus,
    #mobileMenu .main-menu a:active {
        outline: 2px dotted #5EBD87;
        outline-offset: 2px;
        background-color: #e6ffe6;
    }
}

#backToTop {
    display: none; /* 預設隱藏 */
    position: fixed;
    bottom: 15px;
    right: 13px;
    z-index: 999;
    background-color: #ffffff;
    color: black;
    font-size: 35px;
    text-align: center;
    line-height: 50px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: opacity 0.3s;
    cursor: pointer;
}

    #backToTop:hover {
        background-color: #44454B;
        color: #A0DB6D;
        text-decoration: none;
    }

footer {
    flex-shrink: 0;
    background-color: #000;
    color: #fff;
    padding-top: 1rem; /* 黑色區域大小 */
    padding-bottom: 1rem; /* 底部黑色區域大小 */
}

/* 平板以下 (<1200px) */
@media (max-width: 1199.98px) {
    footer {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

@media (max-width: 991.98px) {
    .body-content {
        padding-top: 2.5rem; /* 預留一些空間 */
    }
}

/* 手機以下 (<768px) */
@media (max-width: 767.98px) {
    footer {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .body-content {
        padding-top: 1.5rem; /* 預留一些空間 */
    }
}

.footer-divider {
    border: none;
    border-top: 2px solid #ffffff;
    width: 100%;
    max-width: 90%;
    margin: 0rem auto;
    display: block;
}

.footer-text {
    font-size: calc(14 / 16 * 100%); /* 約 87.5% = 14px */
    color: #B1BFC9;
}

.footer-line {
    width: 100%;
    max-width: 1140px;
    margin: 0rem auto;
    border-top: 0.5px solid #464646;
}

/* 取消主內容區所有 a 的底線 */
.body-content a {
    text-decoration: none !important;
    background: #ffffff00;
    color: #000
}
    /* 如果滑鼠移過變化 */
    .body-content a:hover,
    .body-content a:focus {
        color: #307350 !important;
        background: #ffffff00;
    }


.footer-info-wrapper {
    display: flex;
    justify-content: space-around; /* 整體置中 */
    align-items: stretch; /* 所有區塊等高 */
    gap: 1rem; /* 區塊之間的間距 */
    flex-wrap: wrap; /* 手機可斷行 */
    margin-bottom: 0.5rem;
}

.footer-info-box {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 1rem 1.5rem;
    white-space: nowrap; /* ❗不換行 */
    overflow-x: auto; /* ❗超出時可水平捲動（避免被切） */
    text-align: left; /* ❗文字靠左 */
}

.content-box {
    padding: 1rem 1.5rem;
    border: 1px solid #ddd; /* 可移除：用來檢查效果 */
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* ✅ 內容靠上對齊 */
    width: 100%;
}

.breadcrumb-bar {
    font-size: 14px;
    color: #001;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.breadcrumb-bar .separator {
    margin: 0 4px;
    color: #999;
}

eadcrumb-bar a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-bar a:hover {
    color: #107bb5;
    text-decoration: none;
}

.menu-logo {
    height: 90px;
}

@media (max-width: 768px) {
    .menu-logo {
        max-height: 30px; /* 手機版再縮小一點 */
    }
}

.f-size-2rem {
    font-size: 2rem;
}

.f-size-18 {
    font-size: 18px;
}

#mobileMenu .submenu {
    display: none;
}

#mobileMenu .submenu.open {
    display: block;
}

.tw-heading-2 {
    font-family: "微軟正黑體","PingFang TC",sans-serif;
    color: #001;
}

.section-title-green {
    color: #fff;
    background: linear-gradient(to right, #5EBD87, #FFFFFF);
    font-family: "微軟正黑體","PingFang TC",sans-serif;
    padding: .25rem .25rem; /* 自己抓 */
    margin-top: 1.25rem;
    margin-bottom: .75rem;
}

.ml59px {
    margin-left: 59px;
}

@media (max-width: 768px) {
    .ml59px {
        margin-left: 0px;
    }
}

.w-644px {
    width: 644px;
}

.c-337A55 {
    color: #337A55 !important;
}

.c-808080 {
    color: #808080 !important;
}

.c-F56117 {
    color: #F56117 !important;
}

@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }
}