﻿:root {
    --primary: #ff6a3e;
    --primaryLight: #ffba43;
    --secondary: #ffba43;
    --secondaryLight: #ffba43;
    --headerColor: #1a1a1a;
    --medical-textWhite: #fafbfc;
    --topperFontSize: clamp(0.8125rem, 1.6vw, 1rem);
    --headerFontSize: clamp(1.9375rem, 3.9vw, 3.0625rem);
    --bodyFontSize: 1rem;
    --sectionPadding: clamp(2.75rem, 7.82vw, 5.25rem) 1rem;
    /* 專業醫療配色：深青色系 */

    --medical-primary-dark: #004d40; /* 深色互動態 */
    --medical-text: #2c3e50; /* 主要文字 */
    --medical-text-light: #546e7a; /* 次要文字 */
    --medical-border: #cfd8dc; /* 邊框 */
    /* 品牌主色調 (專業深青色 Teal) */
    --medical-primary-hover: #004d40; /* Hover 狀態 */
    /* 中醫風格色盤 */
    --medical-primary: #2d5a27; /* 墨綠：草藥意象 */
    --medical-accent: #f4f1ea; /* 米白：宣紙/漢方色 */
    --medical-highlight: #a63d40; /* 硃砂紅：傳統印章色，用於通知 */
    --medical-primary-dark: #1e3d1a;
    /* 輔助色 */
    /* 文字系統 (Slate Grey) */
    --text-main: #1e293b; /* 標題黑 */
    --text-muted: #94a3b8; /* 輔助灰 */
    /* 背景色 */
    /*--bg-body: #f8fafc;*/
    /*--bg-body: #f1f5f9;*/ /* 淺灰背景，減少眼睛疲勞 */
    --bg-body: #fcfcf8;
    --bg-white: #ffffff;
    /* 邊框與圓角 */
    --border-color: #e2e8f0;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    /* 現代化陰影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --text-main: #1e293b;
    --text-sub: #64748b;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans TC', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    transition: all 0.2s;
}

/* 限制最大寬度的容器 (取代 Bootstrap container-fluid) */
.container-limit {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* header / footer 簡單樣式 */
.site-header {
    background-color: rgba(255, 255, 255, 0.85); /* 半透明 */
    backdrop-filter: blur(12px); /* 毛玻璃 */
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow-sm);
}

    .site-header .site-header-inner {
        max-width: 80rem;
        margin: 0 auto;
        padding: 0.5rem 1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--headerColor);
}

    .site-logo .logo-icon {
        font-size: 2.5rem;
    }

    .site-logo .logo-text {
        font-size: 2.5rem;
    }

.site-nav a {
    margin-left: 1rem;
    text-decoration: none;
    font-size: 1.5rem;
    color: var(--medical-text);
}

    .site-nav a:hover {
        color: var(--primary);
    }

/* --- Logo 區域優化 --- */
/* =========================================
   Logo 區域專業化設計
   ========================================= */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px; /* 元件間距 */
}

/* 1. 圖片優化 */
.brand-img {
    height: 46px; /* 固定高度，讓圖片成為視覺錨點 */
    width: auto;
    object-fit: contain;
    /* 如果圖片邊緣太銳利，可以加一點點濾鏡讓它柔和 (選用) */
    /* filter: contrast(0.95); */
}

/* 2. 垂直分隔線 (提升質感的關鍵) */
.brand-divider {
    display: block;
    width: 1px;
    height: 32px; /* 比圖片稍微矮一點 */
    background-color: #e2e8f0; /* 淺灰色，不要太搶眼 */
    margin: 0 4px; /* 額外左右留白 */
}

/* 3. 文字排版優化 */
.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1; /* 緊湊行距 */
}

    .brand-text .main {
        font-size: 1.35rem; /* 主標題加大 */
        font-weight: 800; /* 極粗體，展現份量感 */
        color: #1e293b; /* 深灰黑 (Slate-800)，比純黑更有質感 */
        letter-spacing: 2px; /* 增加字距，顯得大氣 */
    }

    .brand-text .sub {
        font-size: 0.85rem; /* 副標題縮小 */
        color: #64748b; /* 次要灰 (Slate-500) */
        font-weight: 500;
        letter-spacing: 0.5px;
        margin-top: 2px;
    }

/* --- 手機版微調 --- */
@media (max-width: 768px) {
    .brand-img {
        height: 38px; /* 手機版圖片縮小 */
    }

    .brand-divider {
        height: 24px;
    }

    .brand-text .main {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }

    .brand-text .sub {
        font-size: 0.75rem;
    }
}

.navbar {
    padding: 0.25rem 0;
}

/* 導覽連結 */
.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--text-sub);
    padding: 0.6rem 1rem !important;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: all 0.2s;
}

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.show {
        color: var(--medical-primary);
        background-color: var(--medical-accent);
    }

main {
    /* 預留空間給 fixed header，若 header 高度改變需調整 */
    min-height: calc(100vh - 160px);
    /* padding-bottom: 3rem; */
}

.site-footer {
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
}

.site-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-link {
    color: var(--text-sub);
    transition: color 0.2s;
}

    .footer-link:hover {
        color: var(--medical-primary);
    }

/* ===== Responsive Visibility Utilities ===== */

/* Default: Desktop */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block !important;
}

/* Mobile Breakpoint (match your existing breakpoints, e.g., 768px or 1024px) */
@media (max-width: 1024px) {
    .mobile-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }
}

.divider {
    margin: 0 10px;
    color: var(--border-color);
}

/* 通用文字 */
.cs-topper {
    font-size: var(--topperFontSize);
    line-height: 1.2em;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
    display: block;
}

.cs-title {
    font-size: var(--headerFontSize);
    font-weight: 900;
    line-height: 1.2em;
    max-width: 43.75rem;
    margin: 0 0 1rem 0;
    color: var(--headerColor);
}

.cs-text {
    font-size: var(--bodyFontSize);
    line-height: 1.5em;
    max-width: 40.625rem;
    margin: 0;
    color: var(--medical-text);
}

/* --- 2. 電腦 (Desktop): 寬度 1024px 以上 --- */
@media (min-width: 1024px) {
    #tming {
        /* 電腦版給予更大器的垂直留白 */
        /* 上下約 80px (5rem) */
        padding: 1rem 1rem !important;
    }

        #tming .cs-container {
            /* 這是電腦版留白的關鍵：限制內容總寬度 */
            max-width: 1200px;
            margin: 0 auto; /* 左右自動留白 */
            /* 啟用 Flex 讓左邊文字、右邊掛號卡並排 */
            display: flex;
            align-items: flex-start; /* 改為頂部對齊，避免文字少時卡片被拉長 */
            justify-content: space-between;
            gap: 6rem; /* 拉大左文、右圖中間的間距，增加高級感 */
        }

        /* 左側文字區塊 */
        #tming .cs-content {
            width: 40%; /* 文字佔 40% */
            padding-top: 2rem; /* 讓文字稍微往下移，視覺上跟右邊卡片標題對齊 */
            text-align: left;
        }

        #tming .cs-title {
            font-size: 3rem; /* 加大標題字體 */
            margin-bottom: 1.5rem;
        }

        #tming .cs-text {
            font-size: 1.1rem; /* 加大內文 */
            opacity: 0.8;
        }
}

/* --- 1. 平板 (Tablet): 寬度 577px ~ 1023px --- */
@media (min-width: 601px) {
    #tming {
        padding: 1rem 2rem !important;
        min-height: 80vh;
        display: flex;
        align-items: center;
    }
}

@media (max-width: 600px) {
    #tming {
        padding: 1rem 0.5rem !important;
        min-height: auto;
    }
}

@media (min-width: 64rem) {

    #tming .cs-container {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 4rem;
        max-width: 80rem;
        margin: 0 auto;
    }

    #tming .cs-content {
        width: 40%;
        margin-bottom: 0;
        text-align: left;
        align-items: flex-start;
    }
}

@media only screen and (min-width: 0rem) {
    #tming {
        overflow: hidden;
        position: relative;
        z-index: 1;
    }

        #tming .cs-container {
            width: 100%;
            max-width: 80rem;
            margin: auto;
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
            z-index: 1;
        }

        #tming .cs-content {
            text-align: center;
            width: 100%;
            margin-bottom: clamp(2.5rem, 5vw, 3.25rem);
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
            z-index: 1;
        }

        #tming .cs-flex {
            flex: none;
        }

        #tming .cs-title {
            font-size: clamp(2.438rem, 5vw, 3.813rem);
        }

        #tming .cs-text {
            margin-bottom: 1.25rem;
        }

        #tming .cs-button-group {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            justify-content: center;
        }

        #tming .cs-button-solid,
        #tming .cs-button-ghost {
            font-size: 1rem;
            font-weight: 700;
            line-height: clamp(2.875rem, 5.5vw, 3.5rem);
            min-width: 9.375rem;
            padding: 0 clamp(2rem, 4vw, 3rem);
            text-decoration: none;
            text-align: center;
            border: none;
            cursor: pointer;
        }

        #tming .cs-button-solid {
            background-color: var(--primary);
            color: var(--medical-textWhite);
            transition: background-color 0.3s, color 0.3s;
            border-radius: 999px;
        }

            #tming .cs-button-solid:hover {
                background-color: #000;
                color: #fff;
            }

        #tming .cs-button-ghost {
            background-color: #fff;
            border-radius: 999px;
            border: 1px solid #ddd;
            color: var(--headerColor);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.35rem;
        }

        #tming .cs-picture {
            width: 100%;
            height: clamp(17.5rem, 58.6vw, 31.875rem);
            margin-bottom: clamp(1rem, 2vw, 1.25rem);
            position: relative;
            display: block;
        }

            #tming .cs-picture img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                border-radius: 2.5rem;
                position: absolute;
            }

        #tming .cs-card-group {
            width: 100%;
            margin: 0;
            padding: 0;
            display: grid;
            justify-content: center;
            grid-template-columns: repeat(12, 1fr);
            gap: clamp(1rem, 2vw, 1.25rem);
        }

        #tming .cs-item {
            list-style: none;
            text-align: center;
            width: 100%;
            padding: clamp(1.5rem, 3vw, 2rem);
            background-color: #F7F7F7;
            border-radius: 1.25rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            grid-column: span 12;
            position: relative;
            transition: border-color 0.3s;
            border: 1px solid transparent;
        }

            #tming .cs-item:hover {
                border-color: var(--primary);
            }

        #tming .cs-icon-picture {
            margin-bottom: 1.25rem;
        }

        #tming .cs-icon {
            width: 2.5rem;
            height: auto;
            display: block;
            transition: transform 0.5s;
        }

        #tming .cs-h3 {
            font-size: 1.25rem;
            margin: 0 0 0.75rem 0;
            color: var(--headerColor);
        }

        #tming .cs-item-text {
            font-size: clamp(0.875rem, 1.5vw, 1rem);
            margin: 0;
            color: var(--medical-text);
        }
}

@media only screen and (min-width: 48rem) {
    #tming .cs-text {
        font-size: 1.25rem;
    }

    #tming .cs-item {
        text-align: left;
        align-items: flex-start;
        grid-column: span 6;
    }
}

@media only screen and (min-width: 64rem) {
    #tming .cs-content {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 3rem;
        text-align: left;
    }

    #tming .cs-flex {
        width: 50%;
    }

    #tming .cs-item {
        grid-column: span 3;
    }
}


/* 漢堡按鈕（桌機隱藏、手機顯示）*/
.nav-toggle {
    display: none;
    font-size: 1.6rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--headerColor);
}

/* 手機版（max-width: 768px）*/
@media (max-width: 768px) {

    /* 漢堡按鈕：手機才顯示 */
    .nav-toggle {
        display: block;
    }

    /* 導覽列：預設隱藏 */
    .site-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #eee;
    }

        /* 導覽列展開後增加 padding */
        .site-nav.open {
            display: flex;
        }

        .site-nav a {
            padding: 0.5rem 0;
            margin-left: 0; /* 移除桌機版的 margin-left */
        }

    .site-header-inner {
        flex-wrap: wrap; /* 讓 nav 能換行跑到下面 */
    }
}
/* 整個 dropdown 面板寬度 */
.booking-menu {
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 10px !important;
    animation: menuSlideIn 0.2s ease-out;
}

@keyframes menuSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.booking-menu-inner {
    display: flex;
    min-height: 320px;
    max-height: 380px;
}

/* 左側：縣市選單 */
.booking-menu-left {
    width: 110px;
    background-color: #f1f5f9; /* 淺灰背景區隔 */
    border-right: 1px solid var(--border-color);
    padding: 12px 0;
    overflow-y: auto;
}

.booking-area-title {
    padding: 4px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
}
.county-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-sub);
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

    .county-btn:hover,
    .county-btn.active {
        background-color: #fff;
        color: var(--medical-primary);
        border-left-color: var(--medical-primary);
        box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    }
/* 右側：診所列表 */
.booking-menu-right {
    flex: 1;
    min-width: 260px;
    background-color: #fff;
    overflow-y: auto; /* 確保內容過長可捲動 */
    position: relative; /* 讓 placeholder 絕對定位居中 */
    padding: 0; /* 移除 padding，由內部元素控制 */
}

.booking-clinic-title {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.95rem;
}

.booking-clinic-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-sub);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

    .booking-clinic-link:hover {
        background-color: var(--medical-accent);
        color: var(--medical-primary);
        transform: translateX(4px); /* 微互動 */
    }

.clinic-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    z-index: 1;
    font-size: 0.9rem;
}

/* 診所群組 (預設隱藏) */
.clinic-group {
    display: none; /* 關鍵：預設不顯示 */
    animation: fadeIn 0.2s ease-out;
}

    /* 診所群組 (顯示狀態) */
    .clinic-group.active {
        display: block; /* 關鍵：加上 active 後顯示 */
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 固定在頂端的縣市標題 */
.booking-clinic-title {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95); /* 毛玻璃背景 */
    backdrop-filter: blur(5px);
    padding: 12px 16px;
    font-weight: 700;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    z-index: 5;
}

/* 診所列表內容 */
.clinic-list-body {
    padding: 8px;
}

/* 診所連結優化 */
.booking-clinic-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--text-sub);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: all 0.2s;
}

    .booking-clinic-link:hover {
        background-color: var(--medical-accent);
        color: var(--medical-primary);
        padding-left: 20px; /* Hover 時向右縮排 */
    }

    .booking-clinic-link .bullet {
        margin-right: 8px;
        color: var(--text-muted);
        font-size: 1.2em;
        line-height: 1;
    }

    .booking-clinic-link:hover .bullet {
        color: var(--medical-primary);
    }

.navbar-collapse {
    width: 100%;
}

/* ===========================
   醫療院所風格錯誤畫面樣式
   =========================== */

.error-medical-card {
    border-radius: 18px;
    background: #ffffff;
    padding: 2.5rem 2rem;
    border: 1px solid #e5ecf2;
}

.error-medical-inner {
    color: #25324a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

.error-medical-icon-wrap {
    position: relative;
    display: inline-block;
}

/* 外圈背景圓形 + 呼吸動畫 */
.error-medical-icon-circle {
    width: 84px;
    height: 84px;
    border-radius: 999px;
    background: #e9f4ff;
    border: 1px solid #c8ddf5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: medical-pulse 2.4s ease-out infinite;
}

/* 中間十字標誌（醫療感） */
.error-medical-cross {
    font-size: 40px;
    font-weight: 600;
    color: #1f6fb2;
    display: inline-block;
    transform: translateY(-2px);
}

/* 右下角 loading spinner */
.error-medical-spinner {
    position: absolute;
    right: -8px;
    bottom: -8px;
    width: 28px;
    height: 28px;
    color: #1f6fb2;
}

/* 標題 / 文字 */
.error-medical-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #243447;
}

.error-medical-text {
    color: #5f6b7a;
    font-size: 0.98rem;
    line-height: 1.7;
}

.error-medical-subtext {
    color: #7c8693;
    font-size: 0.9rem;
    line-height: 1.7;
}

.error-medical-footnote {
    font-size: 0.85rem;
    color: #9aa3b3;
}

/* 呼吸式漸層陰影動畫 */
@keyframes medical-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 125, 190, 0.35);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 0 14px rgba(46, 125, 190, 0.0);
        transform: scale(1.04);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 125, 190, 0.0);
        transform: scale(1);
    }
}

/* RWD 微調：小螢幕縮小 padding */
@media (max-width: 576px) {
    .error-medical-card {
        padding: 2rem 1.5rem;
    }
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* 讓「選擇號碼」區塊有上限高度，超過就內部捲動 */
.slot-grid {
    max-height: 360px; /* ✅ 你要的上限（桌機） */
    overflow-y: auto;
    padding-right: 6px; /* 預留 scrollbar 空間，避免擠到卡片 */
    overscroll-behavior: contain; /* ✅ 捲動不會帶動整頁 */
}

/* 手機高度更小一點 */
@media (max-width: 640px) {
    .slot-grid {
        max-height: 260px;
    }
}

/* 美化 scrollbar（可選） */
.slot-grid::-webkit-scrollbar {
    width: 10px;
}

.slot-grid::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.15);
    border-radius: 8px;
}

.slot-grid::-webkit-scrollbar-track {
    background: transparent;
}

.error-box {
    border: 1px solid #f3c6c6;
    background: #fff5f5;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.error-title {
    font-weight: 600;
    color: #b91c1c;
    margin-bottom: 6px;
}

.error-msg {
    font-size: 14px;
    color: #7f1d1d;
    margin-bottom: 12px;
}

/* ===========================
   Slot Full (額滿) - 溫馨診所提示
   =========================== */
.error-box.full-box {
    border: 1px solid rgba(0, 121, 107, 0.25); /* medical-primary */
    background: var(--medical-accent); /* 淺青色底 */
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}

    .error-box.full-box .error-title {
        color: var(--medical-primary-dark); /* 深青 */
        margin-bottom: 6px;
    }

    .error-box.full-box .error-msg {
        color: var(--medical-text-light); /* 次要文字 */
        margin-bottom: 12px;
        line-height: 1.6;
    }

    /* 額滿提示的按鈕更「柔和」一點 */
    .error-box.full-box .btn-secondary {
        background: #fff;
        border: 1px solid rgba(0, 121, 107, 0.25);
        color: var(--medical-primary-dark);
    }

        .error-box.full-box .btn-secondary:hover:not(:disabled) {
            background: rgba(0, 121, 107, 0.06);
            border-color: rgba(0, 121, 107, 0.35);
        }

.id-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.id-label {
    flex: 0 0 auto;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 10px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    white-space: nowrap;
}

.id-input {
    flex: 1 1 auto;
    min-width: 0;
}

/* 卡片內的 Icon (Emoji) */
.card-icon {
    font-size: 2rem;
    background: #f5f5f5;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

/* 文字區域 */
.card-content {
    flex: 1;
    text-align: left;
}

    .card-content h3 {
        margin: 0 0 4px 0;
        font-size: 1.25rem;
        font-weight: 700;
        color: #333;
    }

    .card-content .subtitle {
        font-size: 0.875rem;
        color: #888;
        display: block;
    }

/* 右上角打勾圖示 (純 CSS 繪製，選中才出現) */
.check-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .check-icon::after {
        content: '';
        width: 12px;
        height: 12px;
        background: var(--primary);
        border-radius: 50%;
        transform: scale(0); /* 預設隱藏 */
        transition: transform 0.2s;
    }


/* --- Footer 按鈕 --- */
.footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(255, 106, 62, 0.3);
}

    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(255, 106, 62, 0.4);
    }

.btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

    .btn-secondary:hover:not(:disabled) {
        background: #e5e7eb;
    }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- 標題區 --- */
.header-row h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--medical-primary-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-row .subtitle {
    font-size: 0.85rem;
    color: var(--medical-text-light);
    margin-top: 4px;
}

.header-query-btn {
    font-size: 0.9rem;
    color: var(--medical-primary);
    text-decoration: none;
    border: 1px solid var(--medical-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

    .header-query-btn:hover {
        background: var(--medical-primary);
        color: #fff;
    }

.link-btn {
    background: none;
    border: 0;
    padding: 0;
    color: var(--medical-primary);
    cursor: pointer;
    text-decoration: underline;
    font: inherit;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: none; /* 預設關閉 */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px; /* 小螢幕留邊 */
    /* ✅ 不要讓 overlay 接收滾動 */
    overscroll-behavior: contain;
    pointer-events: auto;
}

    .modal-overlay.is-open {
        display: flex;
    }

/* 對話框：做成「上 header / 中 body 可捲 / 下 footer 固定」 */
.modal-dialog {
    width: min(920px, 100%);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px); /* ✅ 限高，讓 body 才有捲動空間 */
    pointer-events: auto;
}

/* header / footer 固定高度，不要被捲走 */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #e8edf3;
    flex: 0 0 auto;
}

.modal-title {
    color: var(--medical-primary);
    font-weight: 700;
}

.modal-close {
    border: 0;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 10px;
}

    .modal-close:hover {
        background: rgba(0,0,0,.06);
    }

.modal-body {
    padding: 16px;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto; /* ✅ 吃掉剩餘高度 */
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #e8edf3;
    background: #fff;
    flex: 0 0 auto;
}

/* 打開 modal 時，避免背景頁面跟著滾 */
body.modal-open {
    overflow: hidden;
}

.btn-outline-secondary {
    border: 1px silver solid !important;
}

/* =========================================
   5. 手機版 RWD 優化 (Mobile Menu Fix)
   ========================================= */
/* =========================================
   5. 手機/平板 RWD 整合優化 (Mobile/Tablet Menu)
   ========================================= */
@media (max-width: 991.98px) {

    /* --- 1. Navbar 容器與連結優化 --- */

    /* 展開的選單容器：絕對定位，不推擠下方內容 */
    .navbar-collapse {
        background: #fff;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 0;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
        max-height: 85vh; /* 限制高度 */
        overflow-y: auto; /* 超出可捲動 */
        border-radius: 0 0 16px 16px;
        z-index: 1050;
    }

    /* 強制 Flex 子項目滿版 (解決點擊範圍太小問題) */
    .navbar-nav {
        align-items: stretch !important;
        width: 100%;
        padding-top: 0;
    }

    .nav-item {
        width: 100%;
        text-align: left;
    }

        /* 一般連結 (查詢/交通)：加大點擊區塊，增加分隔線 */
        .nav-item:not(.booking-dropdown) .nav-link {
            display: block;
            width: 100%;
            padding: 14px 20px !important;
            border-bottom: 1px solid #f1f5f9;
            color: var(--text-main);
            font-weight: 500;
        }

    /* 診所選單按鈕 (Dropdown Toggle) */
    .nav-link.dropdown-toggle {
        display: block;
        width: 100%;
        padding: 14px 20px !important;
        text-align: left;
        font-weight: 600;
        background-color: #fff;
        color: var(--medical-primary); /* 強調色 */
    }

    /* 診所介紹的容器：移除分隔線，因為展開後內容很多 */
    .nav-item.booking-dropdown {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    /* --- 2. 診所選單 (Mega Menu) 結構重組 --- */

    /* 選單外框：移除陰影，寬度滿版 */
    .booking-menu {
        display: block;
        position: static;
        box-shadow: none;
        border: none;
        margin-top: 0 !important;
        margin-bottom: 0;
        width: 100%;
        border-top: 1px solid #eee;
    }

    /* 內部排版：改為垂直堆疊 (Vertical Stack) - 關鍵修正 */
    .booking-menu-inner {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: auto;
        max-height: none;
    }

    /* --- 3. 左側控制區 (區域 Tabs + 縣市列表) --- */

    .booking-menu-left {
        width: 100%;
        height: auto;
        max-height: none; /* 由內容撐開 */
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 0;
        background-color: #fff;
        display: block;
    }

    /* 頂部區域分頁 (Horizontal Scroll Tabs) */
    .mobile-area-tabs {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        background: #f8fafc;
        padding: 0 12px;
        border-bottom: 1px solid #e2e8f0;
        -webkit-overflow-scrolling: touch;
        gap: 8px; /* Tab 間距 */
    }
        /* 隱藏 Scrollbar */
        .mobile-area-tabs::-webkit-scrollbar {
            display: none;
        }

    .area-tab-btn {
        background: transparent;
        border: none;
        padding: 10px 35px; /* 增加高度 */
        font-size: 0.95rem;
        color: #64748b;
        font-weight: 500;
        position: relative;
        cursor: pointer;
        flex: 0 0 auto; /* 防止被壓縮 */
    }

        /* Active Tab */
        .area-tab-btn.active {
            color: var(--medical-primary);
            font-weight: 700;
        }

            .area-tab-btn.active::after {
                content: '';
                position: absolute;
                bottom: -1px;
                left: 0;
                right: 0;
                height: 3px; /* 粗一點 */
                background-color: var(--medical-primary);
            }

    /* 縣市列表容器 */
    .county-list-container {
        padding: 12px 16px;
        background-color: #fff;
        max-height: 180px; /* 限制高度，太多時可捲動 */
        overflow-y: auto;
    }

    /* 縣市 Grid 排版 (3欄) */
    .county-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 10px;
    }

    /* 縣市按鈕 (大方塊) */
    .county-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 10px 4px;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        font-size: 0.9rem;
        color: #334155;
        transition: all 0.2s;
        border-left: 1px solid #e2e8f0; /* 覆蓋 */
    }

        .county-btn.active {
            background-color: var(--medical-primary);
            color: #fff;
            border-color: var(--medical-primary);
            box-shadow: 0 4px 6px rgba(0, 121, 107, 0.2);
        }

    .icon-arrow {
        display: none;
    }

    /* --- 4. 右側診所列表區 --- */

    .booking-menu-right {
        width: 100%;
        height: auto;
        max-height: 250px; /* 限制高度 */
        overflow-y: auto;
        padding: 0;
        background-color: #fff;
        border-top: 8px solid #f1f5f9; /* 粗分隔線區隔上下 */
        -webkit-overflow-scrolling: touch;
    }

    /* 標題 (Sticky) */
    .booking-clinic-title {
        position: sticky;
        top: 0;
        z-index: 10;
        background: rgba(255,255,255,0.98);
        padding: 10px 20px;
        border-bottom: 1px solid #eee;
        color: var(--medical-primary-dark);
        margin-bottom: 0;
    }

    /* 連結 */
    .booking-clinic-link {
        padding: 10px 20px;
        border-bottom: 1px solid #f8fafc;
        font-size: 1rem;
    }

    /* --- 5. Footer --- */
    .site-footer {
        padding: 2rem 0;
    }

    .site-footer-inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-col {
        width: 100%;
        justify-content: center;
    }
}

/* 針對平板 (直向) 的特別優化 */
@media (min-width: 576px) and (max-width: 991.98px) {
    .booking-menu-right {
        max-height: 300px; /* 診所列表拉高，利用平板空間 */
    }
}

/* =========================================
   電腦版 (Desktop) 強制顯示修正
   ========================================= */
@media (min-width: 992px) {
    /* 強制顯示所有區域群組，防止被手機版 JS 隱藏 */
    .area-group {
        display: block !important;
    }

    /* 隱藏手機版的 Tabs */
    .mobile-area-tabs {
        display: none !important;
    }

    /* 恢復原本的區域標題顯示 */
    .booking-area-title {
        display: block !important;
    }
}

/* =========================================
   SweetAlert2 Toast 位置微調
   ========================================= */
div.swal2-container.swal2-bottom-end {
    bottom: 80px !important; /* 往上推 80px (可自行調整數值) */
    right: 20px !important; /* 距離右側 20px */
}

/* 如果有手機版樣式，也可以分開設定 */
@media (max-width: 768px) {
    div.swal2-container.swal2-bottom-end {
        bottom: 100px !important; /* 手機版通常下方有導覽列，推高一點 */
        right: 0 !important; /* 手機版通常置中或貼邊 */
        justify-content: center; /* 內容置中 */
    }
}


/* =========================================
   🌍 語言切換浮動按鈕 (Modern Lang Switcher)
   ========================================= */

.lang-fab-wrapper {
    position: fixed;
    bottom: 30px;
    right: 24px;
    z-index: 99999;
    width: 50px;
    height: 50px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden; /* 重要：限制內部元素不溢出 */
}

    .lang-fab-wrapper:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 121, 107, 0.25); /* 配合您的主色系 */
        border-color: #00796b; /* var(--medical-primary) */
    }

/* --- 視覺層：圖示 --- */
.lang-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; /* 讓點擊穿透，直接點到下方的 select */
    color: #5f6368;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-fab-wrapper:hover .lang-icon {
    color: #00796b; /* var(--medical-primary) */
}

/* --- 功能層：Google 翻譯元件優化 --- */

/* 1. 容器設定：填滿按鈕 */
#google_translate_element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2; /* 確保在 icon 之上 */
    opacity: 0; /* 完全透明，但仍然可以被點擊 */
}

/* 2. Google 產生的 Select 選單：強制放大填滿 */
.goog-te-combo {
    position: absolute !important; /* 強制脫離 Google 原本的排版流 */
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important; /* 清除 Google 預設邊距 */
    padding: 0 !important;
    cursor: pointer !important;
    /* 放大處理：確保觸控面積大於按鈕本身，防呆 */
    transform: scale(1.5);
    transform-origin: center center;
    opacity: 0; /* 雖然父層有 opacity，但雙重保險 */
    z-index: 10;
    display: block !important; /* 確保不被隱藏 */
}

.goog-te-gadget {
    color: transparent !important;
    width: 100% !important;
    height: 100% !important;
    position: relative;
}

/* 隱藏滑鼠指到翻譯文字時的 tooltip */
#goog-gt-tt, .goog-tooltip, .goog-tooltip:hover {
    display: none !important;
    visibility: hidden !important;
}

.alert {
    background-color: #cff4fcad;
}

/* 隱藏 reCAPTCHA 懸浮標章 */
.grecaptcha-badge {
    visibility: hidden;
}

/* =========================================
   reCAPTCHA 優化整合 (RWD 穩定版)
   ========================================= */

/* 1. 隱藏 Google 原生右下角懸浮標章 */
.grecaptcha-badge {
    visibility: hidden;
}

/* 2. 宣告文字容器 (獨立頁尾) */
.recaptcha-footer {
    width: 100%;
    margin-top: 12px; /* 與上方輸入框保持距離 */
    font-size: 0.7rem; /* 縮小字體 (約 11px~12px) */
    color: #cbd5e1; /* 預設極淡灰 (Slate-300)，不搶視覺 */
    line-height: 1.4;
    text-align: right; /* 電腦版：靠右對齊 (視覺上對齊按鈕) */
    /* RWD 安全設定 */
    white-space: normal; /* 允許換行 */
    word-wrap: break-word;
    transition: color 0.3s;
}

/* 滑鼠移到整個表單區域時，稍微加深文字顏色，方便閱讀 */
.query-toolbar:hover .recaptcha-footer {
    color: #94a3b8; /* Slate-400 */
}
.shell:hover .recaptcha-footer {
    color: #94a3b8; /* Slate-400 */
}
.modal-body:hover .recaptcha-footer {
    color: #94a3b8; /* Slate-400 */
}

/* 連結樣式 */
.recaptcha-footer a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
    padding-bottom: 1px;
}

    .recaptcha-footer a:hover {
        color: var(--medical-primary);
        border-bottom-style: solid;
    }

/* =========================================
   RWD 手機版適配
   ========================================= */
@media (max-width: 768px) {
    .recaptcha-footer {
        text-align: center; /* 手機版：置中對齊比較美觀 */
        margin-top: 16px; /* 手機版按鈕很大，距離拉開一點 */
        padding: 0 10px; /* 左右留白，防止文字貼邊 */
        font-size: 0.75rem; /* 手機上字體稍微大一點點好讀 */
    }
}

* 1. 禁用狀態的連結 */
.navbar-nav .nav-link.nav-disabled {
    color: #94a3b8 !important; /* 使用淡灰色 (Slate-400) */
    cursor: not-allowed !important; /* 滑鼠移過去顯示禁止符號 */
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.8;
}

/* 禁用狀態下移除 hover 背景色 */
.navbar-nav .nav-link.nav-disabled:hover {
    background-color: transparent !important;
    color: #94a3b8 !important;
}

/* 2. 施工圖示 */
.icon-construction {
    font-size: 1.1rem;
    filter: grayscale(0.5); /* 降低彩度，讓它不要太搶眼 */
}

/* 3. 「建置中」小標籤 (Badge) */
.badge-construction {
    font-size: 0.7rem;
    font-weight: normal;
    background-color: #f1f5f9; /* 極淡灰底 */
    border: 1px solid #e2e8f0; /* 淺灰框 */
    color: #64748b; /* 深灰字 */
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    line-height: 1.4;
}

/* 手機版微調 (RWD) */
@media (max-width: 991.98px) {
    .nav-link.nav-disabled {
        justify-content: flex-start; /* 手機版靠左對齊 */
        width: 100%;
        border-bottom: 1px solid #f1f5f9; /* 保持跟其他選項一樣的分隔線 */
        padding: 14px 20px !important; /* 確保跟其他選單高度一致 */
    }
}

/* =========================================
   Construction Button (建置中實體按鈕)
   ========================================= */

.construction-btn {
    /* 1. 實體按鈕外觀：讓範圍明確 */
    display: flex;
    align-items: center;
    justify-content: space-between; /* 文字靠左，標籤靠右 */
    gap: 12px;
    padding: 8px 16px; /* 內距撐開範圍 */
    margin: 4px 0 4px 10px; /* 與左邊選項保持距離 */

    background-color: #f3f4f6; /* 淺灰底 (Disabled 樣式) */
    border: 1px solid #e5e7eb; /* 淺灰框 */
    border-radius: 50px; /* 圓角膠囊狀 */

    color: #9ca3af; /* 深灰文字 (看起來像失效) */
    font-size: 0.9rem;
    font-weight: 500;
    cursor: not-allowed; /* 禁止游標 */
    user-select: none; /* 禁止選取文字 */
    transition: all 0.2s;
}

    /* 2. 左側內容 (圖示+文字) */
    .construction-btn .c-content {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .construction-btn .c-icon {
        font-size: 1rem;
        filter: grayscale(1); /* 讓圖示變黑白 */
        opacity: 0.6;
    }

    /* 3. 右側標籤 (建置中) */
    .construction-btn .c-badge {
        font-size: 0.75rem;
        background-color: #e5e7eb; /* 比按鈕底色稍深 */
        color: #6b7280;
        padding: 2px 8px;
        border-radius: 12px;
        white-space: nowrap;
    }

/* --- RWD 手機版調整 --- */
@media (max-width: 991.98px) {
    .construction-btn {
        margin: 10px 16px; /* 手機版縮排 */
        width: calc(100% - 32px); /* 滿版減去邊距 */
        justify-content: center; /* 內容置中 */
        padding: 10px 16px; /* 增加高度好按(雖然不能按) */
    }

        /* 手機版讓標籤跟文字有點距離 */
        .construction-btn .c-badge {
            margin-left: auto; /* 強制標籤靠最右邊 */
        }
}

.navbar > .container-fluid {
    padding: 0 10px;
}

/* === 強制提高 SweetAlert2 Toast 的層級 === */
div.swal2-container {
    z-index: 100000 !important; /* 確保高於所有 Modal (9999) 和 Loading (10000) */
}

/* =========================================
   Modern TCM Privacy Modal - 精緻極簡版
   ========================================= */

/* 1. Modal 容器：半透明磨砂與懸浮感 */
#privacyModal .modal-dialog {
    background-color: #fff !important;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

/* 2. Modal 標題欄：極簡線條排版 */
#privacyModal .modal-header {
    background-color: #fff;
    padding: 24px 32px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#privacyModal .modal-title {
    font-family: -apple-system, sans-serif; /* 換回現代字體提升可讀性 */
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--medical-primary);
    display: flex;
    align-items: center;
    letter-spacing: 1px;
}

    /* 移除 before 印章，改用側邊現代飾條 */
    #privacyModal .modal-title::before {
        content: "";
        width: 3px;
        height: 18px;
        background: var(--medical-highlight);
        border-radius: 2px;
        margin-right: 12px;
    }

/* 3. 內容區域：呼吸感與現代網格 */
#privacyModal .modal-body {
    padding: 32px 40px;
    background-color: #fdfdfb; /* 極淡的暖色，維持舒適度 */
    max-height: 60vh;
}

/* 章節標題：極簡無襯線風格 */
#privacyModal h2 {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 16px;
    padding-left: 0;
    border: none;
    display: flex;
    align-items: center;
}

/* 列表設計：移除傳統符號，改用優雅小圓點 */
#privacyModal ul {
    list-style: none;
    padding-left: 0;
}

#privacyModal li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #475569; /* Slate 600 */
    border-bottom: none; /* 移除吵雜的底線 */
    padding-bottom: 0;
}

/* 4. Modal 頁腳：通透且無邊界感 */
#privacyModal .modal-footer {
    background-color: #fff;
    border-top: 1px solid #f1f5f9;
    padding: 20px 32px;
    justify-content: center; /* 按鈕置中 */
}

/* 同意按鈕：膠囊型高質感按鈕 */
#privacyModal #acceptPrivacyBtn {
    background: var(--medical-primary) !important; /* 換回主色墨綠，硃砂紅留給細節 */
    border: none !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 48px;
    border-radius: 50px; /* 膠囊狀 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.15);
}

    #privacyModal #acceptPrivacyBtn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(45, 90, 39, 0.25);
        filter: brightness(1.1);
    }

/* 5. 關閉按鈕：灰色圓環 */
#privacyModal .modal-close {
    background-color: #f1f5f9;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

    #privacyModal .modal-close:hover {
        background-color: #fee2e2;
        color: #ef4444;
    }

/* 優化 Footer 避免被翻譯按鈕遮擋 */
.site-footer-inner {
    /* 增加右側內距，確保文字不會排到 FAB 底下 */
    padding-right: 85px;
}

@media (max-width: 768px) {
    .site-footer-inner {
        /* 手機版文字通常置中，確保底部有足夠空間留給 FAB */
        padding-right: 1rem;
        padding-bottom: 80px;
    }
}

/* =========================================
   🌍 語言切換浮動按鈕 (通用直覺版)
   ========================================= */

.lang-fab-wrapper {
    position: fixed;
    bottom: 30px;
    right: 24px;
    z-index: 99999;
    width: auto;
    min-width: 54px; /* 剛好容納圖示 */
    height: 54px;
    padding: 0 15px;
    background-color: var(--bg-white);
    border-radius: 27px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: flex-start; /* 確保內容從左開始排 */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    border: 1.5px solid var(--medical-primary); /* 使用主色墨綠邊框增加識別度 */
    overflow: hidden;
}

.lang-content {
    display: flex;
    align-items: center;
    pointer-events: none;
    width: 100%;
}

/* 移除所有 absolute 定位，確保不會重疊 */
.lang-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--medical-primary);
    flex-shrink: 0; /* 禁止圖示縮小 */
    width: 24px;
    position: relative; /* 確保不是 absolute */
    left: auto;
    top: auto;
    transform: none;
}

.lang-text {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--medical-primary);
    margin-left: 0; /* 預設無間距 */
}

/* --- Hover 展開邏輯 --- */
.lang-fab-wrapper:hover {
    padding: 0 20px;
    background-color: var(--medical-accent); /* 展開時變為漢方米色 */
}

    .lang-fab-wrapper:hover .lang-text {
        max-width: 140px; /* 寬度給足，容納多語 */
        opacity: 1;
        margin-left: 12px; /* 展開後拉開圖示與文字的距離 */
    }

/* --- 下方資訊遮擋修正 --- */
.site-footer-inner {
    padding-right: 90px; /* 增加右側內距，禮讓按鈕 */
}

@media (max-width: 768px) {
    .site-footer-inner {
        padding-right: 1rem;
        padding-bottom: 90px; /* 手機版底部墊高，防止遮擋最後一行資訊 */
    }
}

/* 保持 1.2s 的俐落節奏 */
@keyframes langHint {
    0% {
        padding: 0 15px;
    }

    25% {
        padding: 0 20px;
    }

    75% {
        padding: 0 20px;
    }

    100% {
        padding: 0 15px;
    }
}

@keyframes textHint {
    0% {
        max-width: 0;
        opacity: 0;
        margin-left: 0;
    }

    25% {
        max-width: 140px;
        opacity: 1;
        margin-left: 12px;
    }

    75% {
        max-width: 140px;
        opacity: 1;
        margin-left: 12px;
    }

    100% {
        max-width: 0;
        opacity: 0;
        margin-left: 0;
    }
}

.lang-fab-wrapper.is-hinting {
    /* 確保動畫過程中，若使用者突然滑入，動畫能被 Hover 狀態自然接管 */
    pointer-events: auto;
    animation: langHint 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

    .lang-fab-wrapper.is-hinting .lang-text {
        animation: textHint 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

/* 強制確保 Hover 狀態永遠具有最高優先權 */
.lang-fab-wrapper:hover {
    animation: none !important; /* 一旦 Hover，取消所有動畫 */
    padding: 0 20px !important;
}

    .lang-fab-wrapper:hover .lang-text {
        animation: none !important;
        max-width: 140px !important;
        opacity: 1 !important;
        margin-left: 12px !important;
    }