@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;700;900&display=swap');

/* ================ 1. 基礎設定與變數 ================ */
:root {
    --primary-orange: #D43F16;
    --base-font-size: 100%;
    /* 16px */
}


html,
body {
    height: auto;
    /* 將原本的 100% 改為 auto，讓 body 撐開 */
    min-height: 100%;
    /* 確保背景圖依然能覆蓋全螢幕 */
    margin: 0;
    scroll-behavior: smooth;
    /* overflow-x: hidden; 保持原樣 */
}

body {
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
    font-size: var(--base-font-size);
    line-height: 1.6;
    color: #333;
    transition: font-size 0.2s ease-out;
    background-color: #f8f9fa;
    background-image: url(../img/pagebg.png);
    display: flex;
    flex-direction: column;
}

main {
    flex-grow: 1;
    margin-bottom: 20px;
}

/* AA 級基準定義 (由 JS 切換 html class) */
html.font-small {
    --base-font-size: 87.5%;
}

html.font-medium {
    --base-font-size: 100%;
}

html.font-large {
    --base-font-size: 112.5%;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

a:hover {
    color: var(--primary-orange);
}

.decor-href:hover {
    text-decoration: underline;
}

.fs--1 {
    font-size: 0.9rem;
}

.fs--2 {
    font-size: 0.75rem;
}

.btn-orange {
    background-color: var(--primary-orange);
    border-color: var(--primary-orange);
    color: #fff;
}

.btn-orange:hover {
    background-color: #d84a1a;
    color: #fff;
}

.btn-outline-orange {
    background-color: #FFF;
    border-color: var(--primary-orange);
    color: var(--primary-orange);
}

.btn-outline-orange:hover {
    background-color: #d84a1a;
    color: #fff;
}

.btn-gray {
    color: #fff !important;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-gray.active {
    color: #fff;
    background-color: #323b4a;
    border-color: #323b4a;
}

.btn-gray:hover {
    color: #fff;
    background-color: #49515d;
    border-color: #49515d;
}

.bg-orange {
    background-color: var(--primary-orange) !important;
}

.ellipsis {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.multiline-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tripleline-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.fifthline-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

/* 隱藏跳過導覽連結，僅在獲得焦點時顯示 */
.visually-hidden-focusable {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    z-index: 10000;
}

.visually-hidden-focusable:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    width: auto;
    height: auto;
    padding: 12px 24px;
    background-color: var(--primary-orange);
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    clip: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    outline: 3px solid #fff;
}

/* 1. 移除預設的 outline，改用自定義的高對比焦點樣式 */
/* 使用 :focus-visible 可確保只有「鍵盤使用者」會看到框線，滑鼠點擊時不會出現 */
:focus-visible {
    outline: 3px solid #0056b3 !important;
    /* 使用深藍色與背景白色產生高對比 */
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(0, 86, 179, 0.3);
}

/* 2. 針對深色/橘色背景（如跑馬燈或按鈕）的特殊處理 */
.bg-orange :focus-visible,
.btn-orange :focus-visible,
.marquee-box :focus-visible {
    outline-color: #ffffff !important;
    /* 在橘色背景上改用白色框線 */
}

/* 3. 確保 Swiper 與 卡片也有焦點視覺 */
.swiper-slide :focus-visible,
.spot-card:focus-within,
.activity-card :focus-visible {
    outline: 3px solid var(--primary-orange) !important;
}

/* ================ 導覽列與字體控制 ================ */
.top-nav {
    background: #FFF;
    font-size: 0.8rem;
}

.top-nav a::after {
    content: "｜";
    padding-left: 10px;
    color: #D0D0D0;
}

.top-nav a:last-of-type::after {
    content: "";
}

.rwd-top-nav {
    background: #FFF;
    font-size: 0.75rem;
}

.top-nav a:hover,
.rwd-top-nav a:hover,
.navbar-nav a:hover {
    font-weight: bold;
}

@media (min-width: 1320px) {

    .navbar-expand-xxl .navbar-nav .rwd-top-nav {
        display: none;
    }
}

.btn-font {
    background: none;
    border: none;
    color: #666;
    font-family: serif;
    cursor: pointer;
    transition: 0.3s;
}

.btn-font.active {
    color: var(--primary-orange) !important;
    font-weight: 900 !important;
    text-decoration: underline;
}

.btn-small-icon {
    font-size: 0.8rem;
}

.btn-medium-icon {
    font-size: 1.1rem;
}

.btn-large-icon {
    font-size: 1.4rem;
}

.navbar-brand img {
    height: 28px;
}

.dropdown-item:focus,
.dropdown-item:hover {
    color: #c2370d;
    background-color: #ffe6de;
}

.langBtn {
    width: 45px;
    height: 45px;
    border: 1px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    background: #fff;
    transition: all 0.3s;
}

@media (max-width: 1280px) {

    /* 選單本體：維持漂浮 */
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #fff !important;
        z-index: 1060 !important;
        /* 確保高於黑幕 */
        padding: 15px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

    /* 定義一個黑幕遮罩，預設隱藏 */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999 !important;
        /* 介於內容與選單之間 */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

    /* 當 body 有特定 class 時顯示黑幕 */
    body.menu-open .menu-overlay {
        opacity: 1;
        visibility: visible;
    }
}

/* ================ Banner 與 跑馬燈 (一則一則跑+暫停+連結) ================ */
.banner-swiper {
    width: 100%;
    /* 假設您的 Banner 圖片原始比例是 1920x800 (約 2.4:1) */
    /* 使用 aspect-ratio 確保容器永遠跟隨圖片比例縮放，不會有裁切問題 */
    aspect-ratio: 1920 / 800;
    height: auto;
    /* 取消原本的 70vh/86vh 固定高度 */
    position: relative;
    background-color: #f8f9fa;
    /* 預載背景色 */
}

/* 針對行動裝置的調整 */
@media (max-width: 991px) {
    .banner-swiper {
        height: auto;
        /* 如果手機版圖片比例不同，可以在這裡調整比例 */
        aspect-ratio: 16 / 9;
    }
}

/* 針對圖片的處理 */
.banner-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* 核心：保證圖片不被裁切 */
    display: block;
}

.marquee-box {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #E7410F;
    color: #fff;
    z-index: 10;
    padding: 10px 0;
    height: 45px;
    display: flex;
    align-items: center;
}

.marquee-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.speaker {
    position: absolute;
    left: 10%;
    top: -30%;
    transform: translateY(-50%);
    z-index: 12;
    width: 90px;
    padding-right: 5px;
}

.marquee-content-area {
    width: 75%;
    margin: 0 auto;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    cursor: pointer;
}

/* 跑馬燈軌道：內容首尾相連的關鍵 */
.marquee-track {
    display: inline-flex;
    white-space: nowrap;
    will-change: transform;
    animation: marqueeInfinite 30s linear infinite;
    /* 設定一個預設時間 */
}

/* 訊息之間的距離 */
.marquee-item {
    display: inline-block;
    padding-right: 180px;
    /* 這裡控制訊息與訊息之間的距離 */
    color: #ffffff;
    text-decoration: none;
}

.marquee-item:hover {
    text-decoration: underline;
    color: #FFF;
    font-weight: bold;
}

/* 暫停邏輯 */
.marquee-content-area:hover .marquee-track,
.marquee-content-area:focus-within .marquee-track {
    animation-play-state: paused;
}

/* 無縫循環動畫：位移到 -50% 時立刻回到 0% */
@keyframes marqueeInfinite {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* --- Swiper 導覽按鈕自定義樣式 --- */

/* 1. 設定按鈕主體 */
.my-custom-next,
.my-custom-prev {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    /* 修正按鈕本身相對於 Banner 的垂直置中 */
    z-index: 1000;
    cursor: pointer;

    /* 使用 Flexbox 讓內部的 <i> 圖示置中 */
    display: flex;
    align-items: center;
    /* 垂直置中 */
    justify-content: center;
    /* 水平置中 */

    background-color: #ffffff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: #ff5722;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* 移除 <i> 可能帶有的預設邊距或行高干擾 */
.my-custom-next i,
.my-custom-prev i {
    font-size: 1.5rem;
    /* 稍微縮小一點點，視覺比例會更平衡 */
    line-height: 1;
    /* 強制行高為 1，避免字體行高撐開 */
    margin: 0;
    padding: 0;
}

/* 修正 Hover 時的放大效果，需包含原有的 translateY 避免位移 */
.my-custom-next:hover,
.my-custom-prev:hover {
    background-color: #ff5722;
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

/* 4. 調整按鈕在左右兩側的位置 (可選) */
.my-custom-prev {
    left: 20px;
    /* 離左邊距離 */
}

.my-custom-next {
    right: 20px;
    /* 離右邊距離 */
}

/* 5. 當滑動到第一張或最後一張時的「禁用」狀態 */
.swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: auto;
    /* 讓禁用的按鈕也能響應鼠標樣式 */
}

/* 針對行動裝置的調整 */
@media (max-width: 991px) {

    .my-custom-next,
    .my-custom-prev {
        opacity: 0.5;
    }

    .my-custom-next:hover,
    .my-custom-prev:hover {
        opacity: 0.8;
    }
}

/* ================ 熱門景點：橫向展開與模糊效果 ================ */

.spot-container {
    display: flex;
    gap: 15px;
    height: 600px;
    margin-top: 2rem;
    overflow: hidden;
}

.spot-card {
    flex: 1;
    /* 平常平均分配寬度 */
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    transition: all 0.7s cubic-bezier(0.25, 1, 0.5, 1);
    text-decoration: none;
    cursor: pointer;
}

/* 風景背景圖：使用專用 class 避免與插畫衝突 */
.spot-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(4px) brightness(0.8);
    transition: all 0.6s ease;
}

.spot-card:hover {
    flex: 3.5;
}

.spot-card:hover .spot-bg-img {
    filter: blur(0) brightness(1);
    transform: scale(1.05);
}

/* 直式縣市名 */
.spot-title-vertical {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2rem;
    font-weight: 900;
    writing-mode: vertical-rl;
    letter-spacing: 0.5rem;
    text-shadow:
        0px 2px 4px rgba(0, 0, 0, 0.5),
        0px 4px 10px rgba(0, 0, 0, 0.3),
        0px 0px 20px rgba(0, 0, 0, 0.2);
    transition: opacity 0.4s ease;
    z-index: 2;
}

.spot-card:hover .spot-title-vertical {
    opacity: 0;
}

/* 內容展示層 */
.spot-content {
    position: absolute;
    inset: 0;
    padding: 60px 40px;
    /* 控制文字與邊界的距離 */
    background: linear-gradient(to right, rgba(0, 0, 0, 0.6) 0%, transparent 80%);
    opacity: 0;
    transition: opacity 0.5s ease 0.2s;
    z-index: 3;
    display: block;
    /* 取消 flex，改用絕對定位管理子元素 */
}

.spot-card:hover .spot-content {
    opacity: 1;
}

/* 人物插畫：保持右下角，但不遮擋箭頭 */
.spot-illust {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 50%;
    /* 調整高度比例 */
    width: auto;
    object-fit: contain;
    pointer-events: none;
    transform: translateX(50px);
    /* 從右側滑入 */
    transition: all 0.7s ease 0.3s;
    opacity: 0;
    z-index: 4;
}

.spot-card:hover .spot-illust {
    transform: translateX(0);
    opacity: 1;
}

/* 文字區域 */
.spot-text-box {
    color: white;
    text-align: left;
}

.city-name {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    border-bottom: 3px solid white;
    display: inline-block;
    text-shadow:
        1px 1px 2px rgba(0, 0, 0, 0.4),
        0px 4px 12px rgba(0, 0, 0, 0.25);
}

.spot-name {
    font-size: 1.5rem;
    margin-top: 10px;
    text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4);
}

/* 箭頭：固定於左下角 */
.spot-arrow {
    position: absolute;
    bottom: 40px;
    /* 與容器底部的距離，與 padding 一致 */
    left: 40px;
    /* 與容器左側的距離，與 padding 一致 */
    background: white;
    color: var(--primary-orange);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    /* 動畫效果：從更下方浮上來 */
    transform: translateY(50px);
    transition: all 0.5s ease 0.4s;
}

.spot-card:hover .spot-arrow {
    transform: translateY(0);
}

/* ---- 熱門景點 Swiper 包裝 ---- */
.spot-swiper {
    width: 100%;
    overflow: hidden;
}

/* 每個 slide 就是一整頁的 accordion 組 */
.spot-swiper .swiper-slide {
    width: 100%;
    flex-shrink: 0;
}

/* slide 內的 spot-container 維持原本手風琴 flex 佈局 */
.spot-swiper .spot-container {
    margin-top: 0;
}

.spot-pagination {
    padding-top: 1rem;
}

/* 手機：spot-container 改直向堆疊 */
@media (max-width: 991px) {
    .spot-swiper .spot-container {
        height: auto;
        flex-direction: column;
    }

    .spot-swiper .spot-card {
        height: 250px;
        flex: none !important;
    }
}

/* RWD */
@media (max-width: 991px) {
    .spot-container {
        height: auto;
        flex-direction: column;
    }

    .spot-card {
        height: 250px;
        flex: none !important;
    }

    .spot-content {
        padding: 30px 20px;
    }

    .spot-arrow {
        bottom: 20px;
        left: 20px;
        width: 45px;
        height: 45px;
    }

    .city-name {
        font-size: 2rem;
    }

    .spot-illust {
        height: 70%;
    }
}

/* ================ 碳足跡與通用樣式 ================ */
.text-orange {
    color: var(--primary-orange);
}

.bg-light {
    background-color: #f1f3f5 !important;
}

@media (min-width: 768px) {
    .border-md-end {
        border-right: 1px solid #dee2e6 !important;
    }
}

/* ================ 好行路線 ================ */
.custom-outer-nav .nav-link {
    background-color: #FFF;
    border: 1px solid #D4D4D4;
    color: #4A4A4A;
    font-weight: bold;
    width: 180px;
    margin-right: 10px;
    border-radius: var(--bs-border-radius-pill);
}

.custom-outer-nav .nav-link.active,
.custom-outer-nav .show>.nav-link {
    color: #FFF;
    background-color: var(--primary-orange);
}

/* 內層 Tabs */
.custom-inner-nav .nav-link {
    background-color: #ffffff;
    color: #4D4D4D;
    border-radius: 50px;
    padding: 5px 20px;
    margin: 0 5px;
    border: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.custom-inner-nav .nav-link.active {
    background-color: #595757 !important;
    /* 設計圖中的深灰色 */
    color: #ffffff !important;
    font-weight: normal;
}

/* 手機版 RWD 微調：允許橫向捲動避免按鈕擠壓 */
@media (max-width: 768px) {

    .custom-outer-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start !important;
        padding-bottom: 10px;
    }

    .custom-outer-nav .nav-link {
        white-space: nowrap;
        padding: 6px 20px;
    }

    .custom-inner-nav {
        justify-content: center;
    }

    .custom-inner-nav .nav-link {
        border-radius: 5px;
        padding: 5px 3px;
        width: 55px;
    }
}

@media (max-width: 576px) {

    .custom-outer-nav {
        justify-content: center !important;
    }

    .custom-outer-nav .nav-link {
        width: auto;
        font-size: 1rem;
        margin-right: 0px;
        padding: 6px 15px;
    }
}

.swiper.route-swiper {
    width: 100%;
    height: 100%;
    padding-top: 30px;
    padding-bottom: 15px;
}

.route-swiper .swiper-slide {
    opacity: 0.4;
    /* 旁邊卡片的透明度 */
    transition: all 0.4s ease;
}

/* 亮起：Active 及其前一張 (prev)、後一張 (next) */
/* 使用 Swiper 內建類別同時選取這三個元素 */
.route-swiper .swiper-slide-active,
.route-swiper .swiper-slide-prev,
.route-swiper .swiper-slide-next {
    opacity: 1;
}

.route-custom-card {
    border-radius: 20px;
    border: 1px solid transparent;
    overflow: hidden;
    background: transparent;
    transition: all 0.3s ease;
}

.route-custom-card .card-title {
    font-size: 1.4rem;
}

.route-img-wrapper {
    border-radius: 15px;
    overflow: hidden;
}

.route-img-wrapper img {
    height: 220px;
    object-fit: cover;
    display: block;
}

/* 橘色號碼標籤 */
.route-number-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    background-color: #D43F16;
    color: #ffffff;
    padding: 5px 20px;
    font-weight: 900;
    font-size: 1rem;
    border-top-right-radius: 15px;
    /* 右上圓角 */
    box-shadow: 2px -2px 5px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

/* 卡片文字調整 */
.route-custom-card .card-title {
    letter-spacing: 2px;
}

.route-custom-card .card-text {
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* 限制顯示兩行文字 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.route-custom-card:hover {
    border: 1px solid #D43F16 !important;
}

.route-custom-card:hover .card-title {
    text-decoration: underline;
}


/* ================ 最新消息列表樣式 ================ */

/* 容器樣式 */
.news-list-container {
    transition: all 0.3s ease;
}

/* 單筆消息樣式 */
.news-item {
    transition: background-color 0.2s ease;
    outline-offset: -2px;
    /* 強化 AA 級鍵盤導覽焦點視覺 */
}

/* 日期樣式 */
.news-date {
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 1px;
    min-width: 120px;
}

/* 標題樣式 */
.news-title {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #2A2A2A;
    display: block;
    width: 100%;
    text-align: left;
}

/* 移除最後一筆的底線 */
.news-item:last-of-type {
    border-bottom: none !important;
}

.news-item:hover {
    background-color: #fff9f7;
}

.news-list-container a:hover .news-title {
    color: var(--primary-orange);
}

/*  RWD 響應式優化 */
/* --- 手機版 (768px 以下) 關鍵調整 --- */
@media (max-width: 768px) {
    .news-item {
        flex-direction: column;
        /* 改為上下排列 */
        align-items: flex-start !important;
        /* 文字靠左對齊 */
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .news-date {
        margin-bottom: 0.5rem;
        /* 日期與標題間的間距 */
        font-size: 0.85rem;
        opacity: 0.8;
    }

    .news-title {
        white-space: normal;
        /* 允許換行，不再強制單行 */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        /* 最多顯示兩行，超過顯示 ... */
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 0.95rem;
        line-height: 1.4;
    }
}

/* 針對 AA 級大字體模式的額外適配 */
html.font-large .news-title {
    line-height: 1.6;
}

/* 配合 AA 級字體大小切換 */
html.font-large .news-date,
html.font-large .news-title {
    font-size: 1.3rem;
}

html.font-small .news-date,
html.font-small .news-title {
    font-size: 0.9rem;
}

/* ================ 精采好行專屬樣式 ================ */

.video-side-btn {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 2rem;
    min-height: 200px;
    transition: 0.3s ease;
    border: 3px solid transparent;
}

.video-side-btn:hover {
    border: 3px solid var(--primary-orange);
}

.video-side-btn:hover img {
    transform: scale(1.1);
    transition: 0.3s ease;
}

/* ================ 精采好行：影片標題定位 ================ */

.video-container {
    padding-bottom: 30px;
    /* 為下方突出的標題預留空間 */
}

.video-caption-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 5;
}

.video-caption-pill {
    background-color: #ffffff;
    color: #4D4D4D;
    width: 500px;
    padding: 15px 50px;
    border-radius: 50px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    transform: translateY(-10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* RWD 調整 */
@media (max-width: 991px) {
    .video-side-btn {
        min-height: 180px;
        /* 平板手機版稍微縮短 */
    }
}

@media (max-width: 768px) {
    .video-caption-pill {
        padding: 8px 30px;
        font-size: 0.95rem;
        width: 90%;
        /* 手機版寬度拉長避免換行 */
        text-align: center;
        transform: translateY(-10px);
    }

    .video-container {
        padding-bottom: 20px;
    }
}

/* ================ 最新活動與熱門路線 ================ */

.activity-swiper {
    padding-bottom: 50px !important;
}

/* ================ 最新活動卡片 ================ */

.activity-card {
    margin-bottom: 20px;
    background-color: #FFF;
}

.card-top {
    margin-bottom: 80px;
    /* 留給對話框突出的空間 */
}

.activity-bg-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
}

/* Tag 樣式：只有右下角圓角 (依據設計圖) */
.activity-tag {
    position: absolute;
    top: 0;
    left: 0;
    background: #ffb800;
    color: #000;
    font-weight: 900;
    padding: 5px 15px;
    font-size: 0.9rem;
    border-top-left-radius: 15px;
    border-bottom-right-radius: 15px;
    /* 僅右下圓角 */
    z-index: 5;
}

/* 對話框容器 */
.activity-dialog {
    position: absolute;
    bottom: -75px;
    left: 30px;
    right: 30px;
    z-index: 10;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* 橘色標題區 */
.dialog-header {
    background-color: var(--primary-orange);
    color: white;
    padding: 4px 15px;
    border-radius: 8px;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: -10px;
    position: relative;
    z-index: 11;
}

.dialog-date {
    font-size: 0.85rem;
    font-weight: 700;
}

.dialog-title {
    font-size: 0.9rem;
    font-weight: 700;
}

/* 白色內容區：將框線改為橘色 */
.dialog-body {
    background: white;
    padding: 15px;
    border-radius: 12px 12px 12px 12px;
    /* 配合 Header 偏移調整圓角 */
    border: 1px solid var(--primary-orange);
    /* 橘色邊框 */
    margin-top: -1px;
    /* 關鍵：與 Header 稍微重疊，確保橘色邊緣完美連接 */
    position: relative;
    z-index: 10;
}

.dialog-tip {
    position: absolute;
    bottom: -18px;
    /* 調整尖角位置 */
    left: 25px;
    width: 20px;
    height: 20px;
}

/* 底層橘色三角形 (作為邊框) */
.dialog-tip::before {
    content: '';
    position: absolute;
    bottom: 108%;
    left: 6.5%;
    width: 0;
    height: 0;
    border: 1.219em solid transparent;
    border-top-color: var(--primary-orange);
    border-bottom: 0;
    border-left: 0;
    margin-left: -0.609em;
    margin-bottom: -1.219em;
    z-index: 1;
}

/* 上層白色三角形 (遮蓋出內部空間) */

.dialog-tip::after {
    content: '';
    position: absolute;
    /* 關鍵：向上偏移 1~2px (根據邊框粗細調整)，以露出底部的橘色 */
    top: -2px;
    left: 6.5%;
    width: 0;
    height: 0;
    /* 關鍵：尺寸稍微縮小 (例如減去 0.1em 或 1-2px) */
    border: 1.1em solid transparent;
    border-top-color: #ffffff;
    /* 蓋上白色 */
    border-bottom: 0;
    border-left: 0;
    /* 這裡的 margin 需根據縮小的尺寸重新計算中心點 */
    margin-left: -0.55em;
    z-index: 11;
}

.dialog-text {
    font-size: 0.9rem;
    color: #000;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 下方連結清單樣式 */
.activity-links {
    display: flex;
    flex-direction: column;
}

.link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
}

.link-item:first-child {
    margin-top: 10px;
}

/* 連結標題：單行截斷 */
.link-title {
    font-weight: normal;
    color: #000;
    flex: 1;
    margin-right: 10px;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* 超過一行顯示 ... */
}

/* 圖示按鈕 */
.link-icons {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 28px;
    border: 1px solid #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    background: #fff;
    transition: all 0.3s;
}

/* Active 狀態或 Hover 狀態 */
.link-item a:hover {
    background-color: var(--primary-orange);
    border-color: var(--primary-orange);
    color: white;
}


/* 分頁點顏色調整 */
.activity-pagination .swiper-pagination-bullet-active {
    background: var(--primary-orange);
}

/* RWD 調整 */
@media (max-width: 768px) {
    .card-top img {
        height: 200px;
    }

    .dialog-title {
        font-size: 1rem;
    }

    .route-link {
        font-size: 0.9rem;
    }
}

/* ================ Footer ================ */
footer {
    background-color: #E9E9E9;
    padding-bottom: 20px;
}

.footer-top {
    padding: 40px 0;
}

.footer-bottom {
    border-top: 1px solid #ccc;
    padding-top: 30px;
}

.btn-menu {
    background-color: #E9E9E9;
    border: 1px solid #ccc;
    color: #4D4D4D;
}

.btn-menu:hover {
    background-color: #9B9B9B;
    color: #fff;
}

/* ================  Cookie 聲明區塊樣式  ================ */
.cookie-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    /* 使用半透明深色遮罩，符合設計圖質感 */
    background-color: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    z-index: 9999;
    /* 確保在所有元件（包含導覽列與Swiper）最上方 */
    padding: 15px 0;
    backdrop-filter: blur(5px);
    /* 增加磨砂玻璃質感 */
    transition: transform 0.3s ease-in-out;
}

.cookie-text {
    font-size: 0.95rem;
    line-height: 1.5;
    letter-spacing: 0.5px;
    font-weight: 400;
}

/* RWD */
@media (max-width: 767px) {
    .cookie-overlay {
        padding: 20px 10px;
    }

    .cookie-text {
        font-size: 0.85rem;
        text-align: center;
        margin-bottom: 15px;
        /* 手機版文字與按鈕留白 */
    }

    .cookie-overlay .btn-orange {
        font-size: 0.9rem;
    }
}

/* ================ AA 級字體大小連動 ================ */
html.font-large .cookie-text {
    font-size: 1.1rem;
}

html.font-small .cookie-text {
    font-size: 0.85rem;
}

/* RWD 響應式調整 */
@media (min-width: 1320px) {

    /* 隱藏漢堡按鈕 */
    .navbar-expand-xxl .navbar-toggler {
        display: none;
    }

    /* 強制選單顯示並橫向排列 */
    .navbar-expand-xxl .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
        flex-grow: 0;
    }

    /* 移除手機版下拉選單的樣式 */
    .navbar-expand-xxl .navbar-nav {
        flex-direction: row;
    }

    .navbar-expand-xxl .dropdown-menu {
        position: absolute;
    }
}

@media (max-width: 1280px) {
    .navbar-collapse {
        background: #fff;
        padding: 0.8rem;
        border-top: 1px solid #eee;
    }

    .dropdown-menu {
        border: 0;
        background-color: #d84a1a1f;
    }

    #navbarNav .nav-item {
        border-bottom: 1px solid #DDD;
    }

    .speaker {
        left: 15px;
        top: 12%;
        width: 60px;
    }

    .marquee-content-area {
        width: calc(100% - 70px);
        margin-left: 50px;
    }

}

@media (max-width: 576px) {
    .display-4 {
        font-size: 2.5rem;
    }
}

.section-title {
    font-size: 2.2rem;
    color: var(--primary-orange);
    font-weight: bold;
}

.section-text {
    font-size: 0.9rem;
    color: #515151;
}

/* ================  路線選擇  ================ */
.page_body.min-height {
    min-height: 440px;
}

@media screen and (max-width:992px) {
    .page_body.min-height {
        min-height: 100px;
    }
}

.po-menu {
    padding: 0px 80px;
}

@media screen and (max-width:1280px) {
    .po-menu {
        padding: 0px 50px;
    }
}

@media screen and (max-width:576px) {
    .po-menu {
        padding: initial;
    }
}


.po-map {
    position: relative;
}

.po-map .mapbg {
    position: absolute;
    right: 0;
    z-index: -1;
}

#routeTab .nav-link {
    width: auto;
    padding: 5px 15px;
}

#routeTab .nav-link.active,
#routeTab .show>.nav-link {
    color: #FFF;
    background-color: #D24119;
}

.custom-route-accordion .accordion-item {
    border: none;
    margin-bottom: 10px;
}

.custom-route-accordion .accordion-button {
    background-color: #D24119;
    color: #fff;
    border-radius: 8px !important;
    font-weight: bold;
}

.custom-route-accordion .accordion-button:not(.collapsed) {
    box-shadow: none;
    background-color: #D24119;
}

.custom-route-accordion .accordion-button::after {
    filter: brightness(0) invert(1);
    /* 箭頭變白色 */
}

.custom-route-accordion .list-group {
    border-top: 0;
    border-top-right-radius: 0;
    border-top-left-radius: 0;
}

.custom-route-accordion .list-group-item {
    padding: 12px 20px;
    background-color: #fcfcfc;
    border-color: #DFDFDF;
    font-size: 0.95rem;
}

.custom-route-accordion .list-group-item span {
    color: #000;
    font-size: 0.85rem;
    margin-right: 10px;
}

.custom-route-accordion .list-group-item a:hover {
    color: var(--primary-orange);
    text-decoration: underline;
}

/* 地圖互動樣式 */
.map-interactive-wrapper {
    background: radial-gradient(circle, rgba(255, 86, 41, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    padding: 20px;
}

.taiwan-map-img {
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
    transition: 0.3s;
}

.map-floating-label {
    position: absolute;
    background: rgba(255, 86, 41, 0.9);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    pointer-events: none;
    display: none;
    z-index: 100;
}

/* ================ 旅遊指南 路線內頁 ================ */
.nav-pills.style03 {
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
}

.nav-pills.style03 .nav-link {
    border: 0;
    color: #4A4A4A;
    border-radius: 0;
}

.nav-pills.style03 .nav-link.active {
    color: #D24119;
    background-color: #FFF;
    padding: 0.25rem 0.725rem;
    border-bottom: 2px solid #D24119;
    font-weight: bold;
}

/* 確保捲動定位精準，數值根據您的 Header + Nav 總高度設定 */
section[id] {
    scroll-margin-top: 175px;
}

@media (max-width: 991px) {
    section[id] {
        scroll-margin-top: 145px;
        /* 手機版導覽列較矮，微調此數值 */
    }
}

/* 確保橫向滑動導覽列在手機版更順暢 */
.nav-pills.style03 {
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

@media (max-width: 991px) {
    .nav-pills.style03 {
        /* 1. 修正無法滑到最前端的問題：將居中改為靠左對齊 */
        justify-content: flex-start !important;

        /* 2. 確保橫向排列不換行 */
        flex-wrap: nowrap !important;

        /* 3. 增加內距，避免第一個與最後一個連結貼邊 */
        padding-left: 15px;
        padding-right: 15px;

        /* 4. 確保捲動順暢 */
        overflow-x: auto !important;
        display: flex !important;
    }

    .nav-pills.style03 .nav-link {
        /* 避免文字換行擠壓 */
        white-space: nowrap;
    }
}

.objfit-cover {
    object-fit: cover;
}

.box-shadow-cus {
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
}

.s-title.infobox {
    position: relative;
}

.s-title.infobox::after {
    content: '';
    position: absolute;
    background-color: #D43F16;
    display: block;
    height: 4px;
    left: 1%;
    bottom: -8px;
    width: 60px;
    border-radius: 20px;
}

/*路線內頁 手風琴*/
.accordion.style02 .accordion-item {
    margin-bottom: 16px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border: 1px solid #D9D9D9;
}

.accordion.style02 .accordion-button {
    background-color: #FFF;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 500;
}

.accordion.style02 .accordion-button:not(.collapsed) {
    background-color: #D24119;
    border-bottom: 0;
    box-shadow: none;
    font-weight: 900;
    color: #FFF;
    border-radius: 10px;
}

.accordion.style02 .accordion-body {
    color: #424242;
    font-size: 1rem;
    border-radius: 10px;
}

/*購票資訊*/
section#info .card {
    border: 1px solid #FFEEE9;
    background-color: #FFF;
}

/*車票區 路線內頁左邊區塊*/
.ticket-box {
    border-radius: 10px;
    border: 1px solid #EFEFEF;
}

.ticket-box .partA {
    background-color: #00819A;
    padding: 20px 20px;
    border-top-right-radius: 10px;
    border-top-left-radius: 10px;
}

.partA .route-number span {
    border: 1px solid #FFF;
    color: #FFF;
    padding: 4px 12px;
}

.partA .route-name {
    font-size: 2rem;
    font-weight: bold;
    color: #FFF;
    margin-top: 12px;
}

.ticket-box .partB {
    background-image: url(../img/weatherbg-cloudy.jpg);
    background-position: center;
    background-repeat: no-repeat;
}

.partB .weather-content {
    padding: 60px 20px;
    color: #FFF;
    font-size: 1.3rem;
}

.ticket-box .partC {
    background-color: #EFEFEF;
    padding: 20px 20px;
    text-align: center;
}

.partC .stop {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 12px;
}

.partC .payment {
    font-size: 1.2rem;
    font-weight: normal;
}

.ticket-box .partE {
    background-color: #EFEFEF;
    padding: 20px 20px;
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 10px;
    color: #242424;
}

.partE .tag-box .tag {
    font-size: 1rem;
    border: 1px solid #D3D3D3;
    border-radius: 10px;
    padding: 8px 12px;
    background-color: #FFF;
    color: #4A4A4A;
    font-weight: normal;
}

/* ================ 路線內頁 pagination ================ */
.pagination.cus .page-link {
    position: relative;
    display: block;
    padding: 5px 10px;
    font-size: var(--bs-pagination-font-size);
    color: #616161;
    text-decoration: none;
    background-color: #FFF;
    border: 0;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.pagination.cus .active>.page-link,
.pagination.cus .page-link.active {
    background-color: #D24119;
    color: #FFF;
    border-color: #D24119;
}

/* --- 路線內頁左側車票細節優化 --- */

/* 1. 天氣背景遮罩：確保文字在高對比下清晰 */
.ticket-box .partB {
    position: relative;
    background-image: url(../img/weatherbg-cloudy.jpg);
    background-position: center;
    background-size: cover;
    overflow: visible;
    /* 為了讓半圓缺口能溢出顯示 */
}

/* 加上深色遮罩層 */
.ticket-box .partB::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    /* 調整遮罩深淺 */
    z-index: 1;
}

/* 確保內容在遮罩之上 */
.partB .weather-content {
    position: relative;
    z-index: 2;
}

/* 2. 四個半圓缺口設計 (使用偽元素放在 Part B 的上下左右) */
/* 利用 .partB 的容器來產生這兩組缺口 */

/* 上方兩組半圓 (Part A 與 Part B 之間) */
.ticket-box .partB .top-notches::before,
.ticket-box .partB .top-notches::after {
    content: "";
    position: absolute;
    width: 35px;
    height: 35px;
    background-color: #f8f9fa;
    /* 配合頁面背景色 */
    border-radius: 50%;
    top: -15px;
    /* 向上偏移一半 */
    z-index: 10;
}

.ticket-box .partB .top-notches::before {
    left: -20px;
}

.ticket-box .partB .top-notches::after {
    right: -20px;
}

/* 下方兩組半圓 (Part B 與 Part C 之間) */
.ticket-box .partB .bottom-notches::before,
.ticket-box .partB .bottom-notches::after {
    content: "";
    position: absolute;
    width: 35px;
    height: 35px;
    background-color: #f8f9fa;
    /* 配合頁面背景色 */
    border-radius: 50%;
    bottom: -15px;
    /* 向下偏移一半 */
    z-index: 10;
}

.ticket-box .partB .bottom-notches::before {
    left: -20px;
}

.ticket-box .partB .bottom-notches::after {
    right: -20px;
}

#ruleAccordion {
    --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23FFFFFF' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M2 5L8 11L14 5'/%3e%3c/svg%3e");
}

@media (max-width: 576px) {
    .ticket-box .partA {
        padding: 10px 20px;
    }

    .partB .weather-content {
        padding: 30px 20px;
    }

    .partC .stop {
        font-size: 1.5rem;
    }
}

/* 自定義按鈕樣式 */
.custom-card-btn {
    background-color: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    /* 預設輕微陰影 */
    transition: all 0.3s ease-in-out;
    border: 1px solid #eee !important;
}

/* 懸停 (Hover) 時的效果 */
.custom-card-btn:hover {
    transform: translateY(-3px);
    /* 向上微浮 */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    /* 陰影加深 */
    background-color: #FAE9E5 !important;
    /* 淡淡的底色變化 */
    color: #D43F16;
    /* 標題文字變色 */
}

/* 展開狀態的樣式 */
#accordionticket .accordion-button:not(.collapsed) {
    box-shadow: none;
    background-color: #f8f9fa !important;
    transform: translateY(0);
}

/* 讓右側箭頭也有點動感 */
#accordionticket .accordion-button::after {
    transition: transform 0.3s ease;
}

/* 容器：確保游標位置對齊文字 */
.cursor-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    width: 35px;
    height: 35px;
}

/* 游標本體動畫：微傾斜 + 縮放 */
.cursor-img {
    width: 25px;
    /* 根據需求調整大小 */
    height: auto;
    z-index: 2;
    transform-origin: center;
    animation: cursor-click 1.8s infinite ease-in-out;
}

/* 游標後方的呼吸光圈 */
.cursor-wrapper::after {
    content: "";
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: rgba(212, 63, 22, 0.3);
    border-radius: 50%;
    z-index: 1;
    animation: ripple 1.8s infinite ease-out;
}

/* 游標律動動畫 */
@keyframes cursor-click {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    30% {
        transform: rotate(-10deg) scale(1.1);
        /* 往左傾斜並放大 */
    }

    50% {
        transform: rotate(5deg) scale(0.95);
        /* 模擬按下感 */
    }
}

/* 漣漪擴散動畫 */
@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(2.8);
        opacity: 0;
    }
}

/* 當手風琴展開後，可以讓動畫消失 (選配) */
#accordionticket .accordion-button:not(.collapsed) .cursor-img,
#accordionticket .accordion-button:not(.collapsed) .cursor-wrapper::after {
    animation: none;
    opacity: 0.2;
}

/* 預設在桌機版不限制高度 */
.description-content {
    transition: all 0.3s ease;
}

/* 僅在手機版 (小於 768px) 執行截斷 */
@media (max-width: 767.98px) {
    .description-content.collapsed {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        /* 限制三行 */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* 查看更多按鈕的樣式優化 */
#readMoreBtn {
    font-weight: bold;
    text-decoration: none;
    font-size: 0.9rem;
}

#readMoreBtn:focus {
    box-shadow: none;
}

/*手機版 篩選modal*/

.searchPanel-mobile .searchPanel-formItem {
    padding: 12px 0;
    border-bottom: 1px solid #e6e6e6;
}

.searchPanel-mobile .searchPanel-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 0;
}

.searchPanel-mobile .form-radios,
.searchPanel-mobile .form-checkboxes {
    list-style: none;
    padding: 0;
    margin: 0;
}

.searchPanel-mobile .form-input {
    width: 100%;
}

.searchPanel-mobile .categoryCollection {
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 0 5px;
}

.searchPanel-mobile .categoryCollection>li {
    flex: 0 0 33.33%;
}

.searchPanel-mobile .categoryCollection label {
    height: 100%;
}

.searchPanel-mobile .form-datepicker .form-input {
    width: calc(100% - 40px);
}

.searchPanel-mobile .form-datepicker::after {
    vertical-align: middle;
}

.searchPanel-mobile .form-radio,
.searchPanel-mobile .form-checkbox {
    text-align: center;
}

.form-radios,
.form-checkboxes {
    display: flex;
    flex-wrap: wrap;
}

.form-radios .form-radio,
.form-radios .form-checkbox,
.form-checkboxes .form-radio,
.form-checkboxes .form-checkbox {
    display: inline-block;
    padding: 5px;
}

.form-radios .form-radio input[type=radio],
.form-radios .form-radio input[type=checkbox],
.form-radios .form-checkbox input[type=radio],
.form-radios .form-checkbox input[type=checkbox],
.form-checkboxes .form-radio input[type=radio],
.form-checkboxes .form-radio input[type=checkbox],
.form-checkboxes .form-checkbox input[type=radio],
.form-checkboxes .form-checkbox input[type=checkbox] {
    position: absolute;
    opacity: 0;
}

.form-radios .form-radio input[type=radio]:checked+label,
.form-radios .form-radio input[type=checkbox]:checked+label,
.form-radios .form-checkbox input[type=radio]:checked+label,
.form-radios .form-checkbox input[type=checkbox]:checked+label,
.form-checkboxes .form-radio input[type=radio]:checked+label,
.form-checkboxes .form-radio input[type=checkbox]:checked+label,
.form-checkboxes .form-checkbox input[type=radio]:checked+label,
.form-checkboxes .form-checkbox input[type=checkbox]:checked+label {
    color: #db3b00;
    border-color: #db3b00;
}

.form-radios .form-radio input[type=radio]:focus-visible+label,
.form-radios .form-radio input[type=checkbox]:focus-visible+label,
.form-radios .form-checkbox input[type=radio]:focus-visible+label,
.form-radios .form-checkbox input[type=checkbox]:focus-visible+label,
.form-checkboxes .form-radio input[type=radio]:focus-visible+label,
.form-checkboxes .form-radio input[type=checkbox]:focus-visible+label,
.form-checkboxes .form-checkbox input[type=radio]:focus-visible+label,
.form-checkboxes .form-checkbox input[type=checkbox]:focus-visible+label {
    box-shadow: 0 0 0 3px #db3b00;
}

.form-radios .form-radio label,
.form-radios .form-checkbox label,
.form-checkboxes .form-radio label,
.form-checkboxes .form-checkbox label {
    display: block;
    padding: 0 12px;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    cursor: pointer;
}

@media screen and (max-width: 1024px) {

    .form-radios .form-radio,
    .form-radios .form-checkbox,
    .form-checkboxes .form-radio,
    .form-checkboxes .form-checkbox {
        flex: 1 0 33.33%;
    }
}

.form-radios.has-icon .form-radio label::before,
.form-radios.has-icon .form-checkbox label::before,
.form-checkboxes.has-icon .form-radio label::before,
.form-checkboxes.has-icon .form-checkbox label::before {
    content: "";
    display: inline-block;
    margin-right: 3px;
}

/* =================== TABLE手機版  ================== */
@media (max-width: 768px) {

    /* 增加卡片之間的間距與陰影 */
    .table-rwd tbody tr {
        display: block;
        margin-bottom: 20px;
        /* 增加卡片間的分隔 */
        border: 1px solid #e2e2e2;
        /* 加上外框 */
        border-radius: 12px;
        /* 圓角化 */
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        /* 輕微陰影提升質感 */
    }

    /* 修正內距，讓內容不貼邊 */
    .table-rwd td {
        padding: 10px 15px !important;
        border-bottom: 1px inset #f0f0f0;
        /* 項目間的細線 */
    }

    .table-rwd td:last-child {
        border-bottom: none;
        background-color: #fff;
        /* 確保按鈕列背景乾淨 */
    }

    /* 強化 data-th 的標籤視覺 */
    .table-rwd td::before {
        font-weight: bold;
        color: #666;
        display: inline-block;
        min-width: 80px;
        /* 統一標籤寬度對齊 */
    }
}

/*==========  時刻表與票價  =========*/

@media (max-width: 768px) {
    .custom-outer-nav.timeline {
        justify-content: center !important;
    }

    .custom-outer-nav.timeline .nav-link {
        padding: 6px 10px;
        width: 115px;
        margin-right: 0;
    }
}

/*========= 回到最上方 ========*/
.btn-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #D43F16 !important;
    /* 強制使用橘色 */
    color: #ffffff !important;
    border: none;
    border-radius: 50%;
    cursor: pointer;

    /* 提升層級：確保在所有內容、甚至是 Header 之上 */
    z-index: 9998 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0 !important;

    transform: translateY(20px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background-color 0.3s;
    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
}

/* 當 class 有 show 時強制顯示 */
.btn-back-to-top.show {
    opacity: 1 !important;
    transform: translateY(0);
}

.btn-back-to-top:hover {
    background-color: #d84a1a !important;
    opacity: 0.9 !important;
}

/* 無障礙高對比焦點 */
.btn-back-to-top:focus-visible {
    outline: 3px solid #0056b3 !important;
    outline-offset: 4px;
}

/* ================ FAQ 常見問題專用樣式 ================ */

/* 主要問題類別卡片 */
.accordion .card.acc {
    margin-bottom: 16px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

/* 主要問題類別標題 */
.accordion .card.acc .card-header {
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
}

.accordion .card.acc .card-header h4 {
    margin: 0;
}

.accordion .card.acc .card-header a {
    display: block;
    padding: 16px 20px;
    color: #2c2c2c;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.accordion .card.acc .card-header a:hover {
    color: var(--primary-orange);
    background-color: #fef6f4;
}

.accordion .card.acc .card-header a i {
    color: var(--primary-orange);
    font-size: 1.2rem;
    margin-right: 8px;
}

/* 子問題手風琴樣式 */
.acc_child .card.acc {
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
}

.acc_child .card.acc .card-header {
    background-color: #ffffff;
    border-bottom: none;
    padding: 0;
}

.acc_child .card.acc .card-header h5 {
    margin: 0;
}

.acc_child .card.acc .card-header a {
    display: block;
    padding: 14px 18px;
    color: #444;
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.acc_child .card.acc .card-header a:hover {
    color: var(--primary-orange);
    background-color: #fff9f7;
    border-left-color: var(--primary-orange);
}

/* 展開狀態的樣式 */
.acc_child .card.acc .card-header a:not(.collapsed) {
    color: var(--primary-orange);
    font-weight: 600;
    background-color: #fef6f4;
    border-left-color: var(--primary-orange);
}

/* 答案區域樣式 */
.acc_child .card.acc .card-body {
    padding: 16px 18px;
    background-color: #fafafa;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.7;
    border-top: 1px solid #f0f0f0;
}

/* 路線查詢區塊樣式優化 */
.t_select {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.t_select .form-control,
.t_select .form-select {
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.t_select .form-control:focus,
.t_select .form-select:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 0.2rem rgba(212, 63, 22, 0.15);
}

.t_select .search_btn button {
    width: 100%;
    padding: 10px 24px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* 路線查詢結果accordion樣式 */
#accordion_route .card.acc {
    margin-bottom: 12px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

#accordion_route .card.acc .card-header {
    background-color: #ffffff;
    border-bottom: none;
    padding: 0;
}

#accordion_route .card.acc .card-header h4 {
    margin: 0;
}

#accordion_route .card.acc .card-header a {
    display: block;
    padding: 16px 20px;
    color: #2c2c2c;
    font-weight: 500;
    font-size: 1.05rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

#accordion_route .card.acc .card-header a:hover {
    color: var(--primary-orange);
    background-color: #fff9f7;
    border-left-color: var(--primary-orange);
}

#accordion_route .card.acc .card-header a i {
    color: var(--primary-orange);
    margin-right: 8px;
}

#accordion_route .card.acc .card-header a:not(.collapsed) {
    color: var(--primary-orange);
    font-weight: 600;
    background-color: #fef6f4;
    border-left-color: var(--primary-orange);
}

#accordion_route .card.acc .card-body {
    padding: 18px 20px;
    background-color: #fafafa;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.7;
    border-top: 1px solid #f0f0f0;
}

/* 手機版響應式調整 */
@media (max-width: 768px) {
    .accordion .card.acc .card-header a {
        padding: 12px 16px;
        font-size: 1rem;
    }

    .acc_child .card.acc .card-header a {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .acc_child .card.acc .card-body {
        padding: 14px 14px;
        font-size: 0.9rem;
    }

    .t_select {
        padding: 15px;
    }

    #accordion_route .card.acc .card-header a {
        padding: 12px 16px;
        font-size: 1rem;
    }

    #accordion_route .card.acc .card-body {
        padding: 14px 16px;
        font-size: 0.9rem;
    }
}

#backToTop {
    display: flex !important;
    pointer-events: none;
    /* 隱藏時不可點擊 */
}

#backToTop.show {
    pointer-events: auto;
    /* 顯示時恢復點擊 */
}

/* ================ 路線選擇下拉選單樣式 ================ */

/* 下拉選單主容器 */
.trip_select {
    background-color: #fff;
    display: block;
    width: 50vw;
}

.trip_select p {
    color: #4b5054;
    margin-bottom: 0.5rem;
}

.trip_select button {
    display: inline-flex;
    padding: 6px 12px;
    margin-right: 6px;
    margin-bottom: 6px;
}

/* 分隔線 */
.devider {
    border-bottom: 1px solid #f1f1f1;
}

/* 下拉選單按鈕容器 */
.dp_loaction .dp_btn {
    height: 48px;
    color: #707070;
    width: 210px;
    text-align: left;
    padding-left: 18px;
    padding-right: 38px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

@media (max-width: 1280px) {
    .dropdown-toggle::after {
        float: right;
        margin-top: 10px;
        position: absolute;
        right: 8px;
    }
}

.nav-link {
    color: #000;
}