#section-header {
  padding-top: 115px;
  padding-bottom: 30px;
  display: flex;
  justify-content: center;
  text-align: center;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.title-zh {
  margin: 0;
  font-size: 20px; /* Estimated */
  font-weight: 700;
  color: #000000;
}

.title-en {
  margin: 0;
  font-size: 16px; /* Estimated */
  font-weight: 400;
  color: #000000;
}

/* CSS for section section:LanguageList */
#section-language-list {
  display: flex;
  justify-content: center;
  padding-bottom: 40px;
}

.language-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 329px; /* From Union width */
}

.lang-item {
  position: relative;
  width: 329px;
  height: 77px;
  cursor: pointer;
}

/* Background Construction */
.item-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Union Style */
  background-color: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 38.5px; /* Half height for pill shape approximation of Union */
  box-sizing: border-box;
  overflow: hidden; /* To clip children */
}

.bg-ellipse {
  position: absolute;
  left: 0;
  top: 0;
  width: 76.88px;
  height: 76.88px;
  z-index: 1;
}

.bg-rect {
  position: absolute;
  left: 36px;
  top: 11px;
  width: 292.59px;
  height: 56.66px;
  background-color: #d9d9d9;
  border-radius: 28.33px;
  z-index: 0;
  display: none; /* Hiding based on visual analysis - usually the button is white, the gray rect might be a specific state or shadow, but style_6 is white bg. */
}

/* Flag Construction */
.item-flag {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 56.6px;
  height: 56.6px;
  border-radius: 50%;
  box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  z-index: 10;
}

.flag-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.flag-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Text Label */
.lang-label {
  position: absolute;
  left: 89px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: 700;
  color: #000000;
  z-index: 5;
  white-space: nowrap;
}

/* CSS for section section:Footer */
#section-footer {
  margin-top: auto; /* Push to bottom */
  width: 100%;
  background-color: #f5f5f5;
  padding: 20px 0;
  min-height: 116px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  width: 100%;
  max-width: 360px; /* Constrain content width */
  padding: 0 20px;
  gap: 15px;
}

.footer-icons {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.icon-chat {
  position: absolute;
  top: 0;
  right: 0;
  width: 26px;
  height: 26px;
}

.chat-bubble {
  position: relative;
  width: 100%;
  height: 100%;
}

.chat-bubble img {
  width: 100%;
  height: 100%;
}

.question-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #d9d9d9;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
}

.icon-help {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 42px;
  height: 43px;
}

.footer-text {
  font-size: 10px;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}


/* ================================================================
   1. 全域初始化與背景設定 (手機版為預設)
   ================================================================ */
body {
    background: var(--qs-bg-img-main);
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    font-family: var(--font-primary);
}

.body-content {
    margin: 0 !important;
    padding: 0 !important;
}

footer.footer {
    display: none !important;
}

.qs-original-controls {
    display: none !important;
    visibility: hidden !important;
}

/* 核心 RWD 包裹容器 */
.qs-page-wrapper {
    display: flex;
    flex-direction: column;
    width: 100vw;
    min-height: 100vh;
    /* 修正部分手機瀏覽器因網址列伸縮導致 100vh 計算不準的漏洞 */
    height: -webkit-fill-available;
    overflow: hidden; /* 關鍵：強制禁止最外層出現上下捲軸 */
}

/* ================================================================
   手機版語系modal
   ================================================================ */
.qs-lang-modal {
    /*    background: var(--homepage-mobile-gradient) !important;*/
    background: var(--qs-bg-img-main);
}

/* 當使用者選完語系後，透過 JS 加上這個類別來隱藏此 Modal */
.qs-lang-modal.is-hidden {
    display: none !important;
}

/* 2. 主副標題樣式 */
.qs-lang-modal__title {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.qs-lang-modal__subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin: 0 0 2.5rem 0;
    font-weight: 400;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* 3. 語系按鈕清單容器 */
.qs-lang-modal__list {
    width: 100%;
    max-width: 440px;
    /* 關鍵彈性設定 */
    flex: 1; /* 自動吃掉除標題和底部之外的所有剩餘高度 */
    overflow-y: auto; /* 核心：如果按鈕真的塞不下，只允許按鈕區域內部上下滾動 */

    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* 稍微縮小按鈕與按鈕之間的間距（原 1rem 改為 12px） */
    padding: 0.5rem 0; /* 給內部留一點點滾動緩衝 */
    /* 隱藏滾動條（選用，讓視覺更乾淨） */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ================================================================
   2. 手機版控制與元件樣式 (Base Styles)
   ================================================================ */
.d-none-mobile {
    display: none !important;
}

/* 左欄/上方區塊 */
.qs-sidebar {
    width: 100%;
    padding: 20px 0 10px 0;
    text-align: center;
}

.qs-logo-mobile {
    display: block;    
}

    .qs-logo-mobile img {
        height: 44px;
        width: auto;
    }

.qs-desktop-visual {
    display: none;
}
/* 手機版隱藏左側大插圖 */

/* 右欄/下方區塊 */
.qs-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 20px 30px 20px;
    position: relative;
    /*min-width:350px;*/
}

/* 語系選單在手機版的定位（置於主卡片右上方外側） */
.qs-lang-wrapper {
    align-self: flex-end;
    margin-bottom: 10px;
}

/* 手機版卡片：白色高質感圓角卡片 */
.qs-main-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    /*padding: 30px 24px;*/
    box-sizing: border-box;
}

.qs-card-body {
    padding: 30px 24px;
}

.qs-desktop-only {
    display: none;
}
/* 隱藏桌面版專屬元件 */

/* 系統大標題 */
.qs-page-title {
    text-align: center;
    color: var(--default-page-system-title);
    font-size: 1.2rem;
    font-weight: 700;
    /*    margin-bottom: 20px;*/
    letter-spacing: 1px;
}

/* 內文、法律聲明與列表 */
.qs-notice-legal {    
    line-height: 1.6;
    margin-bottom: 12px;
}



.qs-notice-list {    
    line-height: 1.6;
    padding-left: 20px;
    margin: 0 0 24px 0;
    color: #444;
}

    .qs-notice-list li {
        margin-bottom: 10px;
    }



/* 驗證碼區塊 */
.qs-captcha-label {
    font-size: 16px;
    color: #333;    
    font-weight: 500;
}

.qs-captcha-row {    
    display: flex;
    align-items: center;
    justify-content: left;
    gap: 12px;
    margin:10px 0;
}

.qs-captcha-input {
    width: 100px;
    height: 40px;
    border: 1.5px solid #cccccc;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    outline: none;
/*    transition: all 0.2s;*/
    letter-spacing: 2px;
    font-weight: bold;
}

    .qs-captcha-input:focus {
        border-color: var(--color-primary);
        box-shadow: var(--focus-ring-shadow);
    }

.qs-captcha-img {
    height: 40px;
    border-radius: 6px;
    border: 1px solid #ddd;
    cursor: pointer;
}

.qs-captcha-refresh {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 1.2rem;
}

/* 下一步按鈕 */
.qs-btn-next {
    /*    display: block;*/
    min-width: 240px;
    min-height: 43px;
    padding: 4px 8px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 4px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--color-primary-light);
}

/* 底部備註 */
.qs-footer-note {
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    text-align: center;
}

/* 1. 語系頁面整體容器 */
.qs-lang-select-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 3.125rem 1.5rem 2rem 1.5rem; /* 上方保留空間給瀏海與狀態列 */
    box-sizing: border-box;
    /* 引用 variables.css 中設定的手機首頁專屬漸層 */
    background: var(--homepage-mobile-gradient) !important;
}



.qs-capsule-btn {
    padding: .5rem .5rem;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);     
    cursor: pointer;
}

/* 透過外層容器控制按鈕與按鈕之間的間距 */
.qs-lang-modal__list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

    /* 膠囊按鈕點擊時的動態回饋 */
    .qs-capsule-btn:active {
        transform: scale(0.98);
    }

/* 5. 國旗圖示完美圓形化 */
.qs-capsule-btn__flag-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    margin-right: 1.25rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .qs-capsule-btn__flag-wrap img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* 確保國旗滿版切圓不留白 */

    }

.qs-capsule-btn[data-lang="zh-TW"] .qs-capsule-btn__flag-wrap img,
.qs-capsule-btn[data-lang="en-US"] .qs-capsule-btn__flag-wrap img {
    object-position: left center; /* 讓圖片靠左居中裁切，保留左側的圖案 */
}

/* 6. 按鈕內語系文字 */
.qs-capsule-btn__text {
    font-family: var(--font-primary);
    font-size: 20px;
    color: #5D5D5D;
    font-weight: 400;
}

/* 獨立元件：膠囊按鈕 */
.qs-capsule-btn {
    /*display: flex;
    align-items: center;
    width: 100%;
    padding: 0.4rem 0.5rem;*/ /* 稍微縮減按鈕上下高度 */
    /*background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    box-sizing: border-box;
    flex-shrink: 0;*/ /* 確保按鈕自己絕對不會被 flex 壓縮變形 */
}

/* 國旗縮小一點點（原 56px 改為 46px），爭取更多垂直空間 */
.qs-capsule-btn__flag-wrap {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 1rem;
    flex-shrink: 0;
}


/* 語系頁底部：鎖定在最下方 */
.qs-lang-modal__footer {
    margin-top: auto; /* 確保一定貼在最底部 */
    padding-top: 1rem;
    width: 100%;
    display: flex;
    justify-content: center;
    flex-shrink: 0; /* 確保底部求助欄絕對不會被壓縮 */
}

/* 7. 手機版底部現場求助提示區 */
.qs-lang-modal__footer {
    margin-top: auto; /* 核心技巧：利用 Flex 彈性將求助資訊推至最底部 */
    
    
    gap: 1rem; /* 圖示與右側文字的水平間距 */
    width: 100%;
    max-width: 440px;
    text-align: left; /* 關鍵：文字改為靠左對齊，符合左圖右文的閱讀習慣 */
    color: rgba(255, 255, 255, 0.9);
    padding: 0 10px; /* 防止極小螢幕時貼邊 */
}

.qs-help-bar {
    display: flex;
    width:100%;
    align-items: center;
    justify-content: center; /* 讓內容居中 */
    gap: 15px; /* 圖示與文字的間距 */
}

.qs-help-bar__icon-box {
    flex: 0 0 20%;
    display: flex;
    justify-content: center;
    height: auto;    
    color: white;
}


.qs-help-bar__text-box {
    flex: 0 0 80%;
    font-size: 10px;
    font-weight: 400;
    line-height: 0.8rem;
    letter-spacing: 2px;
}

.qs-help-bar__text-box p {
    margin: 0 0 0 0;
}

.qs-card-header {
    display: flex;
    height:76px;
    justify-content: center;
    background-color: var(--color-primary);
    padding: 16px 8px;
    border-radius: 24px 24px 0px 0px;
    border-bottom: 5px solid var(--color-accent);
}


.qs-notice-legal, .qs-notice-list, .qs-captcha-label {
    font-size: 0.8rem;
    font-weight:700;
}

.qs-modal-help-text {
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: 2px;
    min-width: 0;
    font-weight: 400;
}


/* ================================================================
   3. 桌面版 RWD 樣式切換 (螢幕寬度 >= 992px)
   ================================================================ */
@media (min-width: 992px) {
    .qs-captcha-row {
        width: 70%;
        justify-content:center;
    }
    .qs-notice-legal, .qs-notice-list, .qs-captcha-label {
        font-size: 1rem;
    }


    /* 桌面版核心控制：直接把手機專屬的語系遮罩徹底抹除，完全不顯示 */
/*    .qs-lang-modal {
        display: none !important;
    }*/

    /* 桌面版核心控制：強制讓主內容表單直接顯示，不受手機版初始隱藏的影響 */
    .qs-main-content {
        display: flex !important; /* 恢復你桌面版原本的左右雙欄 Flex 佈局 */
        width: 58%; /* 右欄佔 58% 寬度 */
        background: #ffffff;
        justify-content: center;
/*        padding: 60px 10%;        */
    }

/*    .qs-card-header {
        display:none;
    }*/

    .qs-captcha {
        width:100%;
        display: flex;     
        align-items: center;  
        justify-content:space-between;
    }

    .qs-captcha-input {
        flex: 1; 
        min-width: 0;
    }

    .qs-card-body {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0px 0px;
    }

    /* 核心控制：桌面版直接把手機專屬的語系選擇頁「徹底抹除」 */
    .qs-lang-select-page {
        display: none !important;
    }

    /* 桌面版恢復原先的左右雙欄與表單區顯示 */
    .d-none-mobile {
        display: flex !important;
    }

    body {
        background: #ffffff !important; /* 桌面版底色改為純白 */
    }

    .qs-page-wrapper {
        flex-direction: row; /* 切換為左右雙欄 */
        min-height: 100vh;
        overflow: hidden;
    }

    /* 【左側藍綠色漸層側邊欄】 */
    .qs-sidebar {
        width: 42%; /* 左欄佔 42% 寬度 */
        /*background: linear-gradient(180deg, #52b79a 0%, #4a75a0 100%);*/
        background: var(--qs-bg-img-main);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 40px;
        box-sizing: border-box;
    }

    .qs-logo-mobile {
        display: none;
    }
    /* 隱藏手機版 Logo */

    /* 顯示桌面版左側視覺 */
    .qs-desktop-visual {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: white;
        max-width: 460px;
    }

    .qs-desktop-help-icon {        
        width: 50%;
        height: auto;        
        color: white;
        margin-bottom: 3.125rem;
    }

    .qs-help-text {        
        text-align: left;
        line-height: 1;
    }

        .qs-help-text p {
            font-size: 14px;
            margin: 0 0 6px 0;            
            font-weight: 700;
        }



    /* 語系選單固定於右上方 */
    .qs-lang-wrapper {
        position: absolute !important;
        top: 20px;
        right: 30px;
        margin-bottom: 0;
    }

    .qs-lang-btn {
        background: rgba(255, 255, 255, 0.2);
        border: 1.5px solid var(--color-primary);
        backdrop-filter: blur(10px);
        color: var(--color-primary);
    }


        .qs-lang-btn svg {
            stroke: var(--color-primary) !important;
        }

    /* 桌面版卡片：移除外層陰影與白底，直接融入右側版面 */
    .qs-main-card {
        max-width: 520px;
        background: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
    }

    .qs-desktop-only {
        display: block;
    }
    /* 顯示桌面版 CDC Logo */

    .qs-page-title {
        text-align: center;
        font-size: 2rem;
        font-weight: 700;
/*        margin-bottom: 28px;*/
        color: #5D5D5D;

    }

    .qs-btn-next {
        max-width: 300px; /* 桌面版按鈕不需要滿版，寬度適中即可 */
    }

    /* 備註改至右下角固定 */
    .qs-footer-note {
        position: absolute;
        bottom: 30px;
        right: 50px;
        color: #777777;
        margin-top: 0;
    }
}