@charset "UTF-8";
/* 由 plans.php 拆出（原內嵌 <style>），修改樣式請改這個檔 */
/* ===================================================================
   飛鴿漫遊 GooRoam - 方案總覽頁面樣式表 (plans.php) - 完整修正版
   =================================================================== */

/* -------------------------------------------------------------------
 * 01. CSS 變數與基礎樣式 (Root & Base)
 * ------------------------------------------------------------------- */
/* --- 2.1 最新公告：垂直輪播（plans.php .ann-ticker；原水平跑馬燈） ---
   一列高 52px 的白卡：左「最新公告」標籤 → 中間一次一則（分類・標題・日期）→ 右側 1/3 與上下切換 → 全部公告。
   切換只動 transform／opacity：新的一則由下方滑入、舊的往上滑出，300ms 強 ease-out；
   換則與暫停邏輯在 plans.php 內嵌 script。減少動態效果時只淡入淡出（且不自動輪播）。 */
.ann-ticker {
    --ann-ease: cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 52px;
    padding: 0.45rem 0.6rem 0.45rem 0.5rem;
    margin-bottom: 3rem;
    background: var(--card-bg, #fff);
    border: 1px solid rgba(147, 197, 253, 0.35);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.07);
}
.ann-ticker__label {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    background: var(--primary-color, #0073e6);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.ann-ticker__label i { font-size: 0.85rem; }

/* 視窗只露一則；各則疊在同一位置，靠 transform／opacity 切換 */
.ann-ticker__viewport {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 2rem;
    overflow: hidden;
}
.ann-ticker__list { list-style: none; margin: 0; padding: 0; height: 100%; }
.ann-ticker__item {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
    transition: transform 300ms var(--ann-ease), opacity 200ms ease;
}
.ann-ticker__item.is-active { opacity: 1; transform: none; pointer-events: auto; }
.ann-ticker__item a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    width: 100%;
    height: 100%;
    color: #1e293b;
    text-decoration: none;
    border-radius: 8px;
}
.ann-ticker__item a:focus-visible { outline: 3px solid rgba(0, 115, 230, 0.35); outline-offset: 2px; }
.ann-ticker__tag {
    flex: 0 0 auto;
    padding: 0.12rem 0.5rem;
    border-radius: 6px;
    background: #eef4ff;
    color: #0062c4;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.ann-ticker__tag.is-important { background: #fff4e0; color: #b45309; }
.ann-ticker__title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
    font-weight: 600;
    transition: color 0.18s ease;
}
.ann-ticker__date {
    flex: 0 0 auto;
    font-size: 0.78rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}
@media (hover: hover) and (pointer: fine) {
    .ann-ticker__item a:hover .ann-ticker__title { color: var(--primary-color, #0073e6); }
}

/* 右側：1/3 與上下切換 */
.ann-ticker__nav { flex: 0 0 auto; display: flex; align-items: center; gap: 0.15rem; }
.ann-ticker__count {
    margin-right: 0.3rem;
    font-size: 0.78rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}
.ann-ticker__count b { color: #334155; font-weight: 700; }
.ann-ticker__btn {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s var(--ann-ease);
}
@media (hover: hover) and (pointer: fine) {
    .ann-ticker__btn:hover { background: #eef4ff; color: #0062c4; }
}
.ann-ticker__btn:active { transform: scale(0.92); }
.ann-ticker__btn:focus-visible { outline: 3px solid rgba(0, 115, 230, 0.35); outline-offset: 1px; }

.ann-ticker__all {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    border-left: 1px solid #e2e8f0;
    margin-left: 0.1rem;
    color: #0062c4;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.ann-ticker__all i { font-size: 0.72rem; transition: transform 0.2s var(--ann-ease); }
@media (hover: hover) and (pointer: fine) {
    .ann-ticker__all:hover i { transform: translateX(3px); }
}

@media (max-width: 768px) {
    .ann-ticker { gap: 0.5rem; margin-bottom: 1.5rem; border-radius: 12px; padding: 0.4rem 0.4rem 0.4rem 0.45rem; }
    .ann-ticker__label { padding: 0.4rem 0.55rem; }
    .ann-ticker__label span { display: none; }          /* 手機只留喇叭圖示，把寬度讓給標題 */
    .ann-ticker__date, .ann-ticker__all, .ann-ticker__count { display: none; }
    .ann-ticker__tag { font-size: 0.68rem; padding: 0.1rem 0.4rem; }
    .ann-ticker__title { font-size: 0.86rem; }
    .ann-ticker__btn { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
    .ann-ticker__item { transform: none; transition: opacity 200ms ease; }   /* 只淡入淡出，不滑動 */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

main {
    flex-grow: 1;
    /* header = padding(0.75rem×2) + logo(45px) + border(1px) ≈ 70px */
    padding-top: calc(1.5rem + 46px);
    padding-bottom: 5rem;
}

.container {
    width: 100%;
    max-width: 1300px;
    margin: auto;
    padding: 0 1.5rem;
}

/* -------------------------------------------------------------------
 * 02. 通用元件 (Global Components)
 * ------------------------------------------------------------------- */
.page-title {
    text-align: center;
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 900;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    text-align: center;
    font-size: clamp(1rem, 3vw, 1.15rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem auto;
}

/* SweetAlert2 的共用外觀已統一移到 assets/css/overlay.css */
/* AI 提示浮層 */
.ai-alert-popup {
    border-top: 4px solid #6366f1 !important;
    border-radius: 16px !important;
    padding-top: 2rem !important;
}
.ai-alert-popup .swal2-icon.swal2-info {
    border-color: #a5b4fc !important;
    color: #6366f1 !important;
}
.ai-alert-popup .swal2-title {
    color: #312e81 !important;
    font-size: 1.1rem !important;
}
.ai-alert-popup .swal2-html-container {
    color: #4b5563 !important;
    font-size: 0.9rem !important;
    line-height: 1.7 !important;
}

.page-header-with-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    flex-wrap: wrap;
}

.page-header-tools {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#price-mode-label {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    background: linear-gradient(135deg, #0073e6, #005bb3);
    color: #fff;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,115,230,.28);
    flex-shrink: 0;
    letter-spacing: 0.01em;
}
/* 經銷商名稱改由全站黏性頂條顯示（includes/dealer_mode_bar.php），
   這顆麵包屑徽章不再出現；.visible 仍由既有 JS 切換，故以 [hidden] 壓住。 */
#price-mode-label.visible {
    display: inline-flex;
}
#price-mode-label[hidden] {
    display: none !important;
}

.lock-icon {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}
.lock-icon:hover {
    transform: scale(1.1);
    color: var(--primary-color);
}
.lock-icon.fa-unlock-alt {
    color: var(--success-color);
}

/* -------------------------------------------------------------------
 * 03. Banner 輪播 (Swiper Banner)
 * ------------------------------------------------------------------- */
.hero-banner-container {
    /* 突破父元素 padding，達到真正全幅（100vw）效果 */
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-bottom: 2.5rem;
}
/* 底部漸層淡出：移至 swiper 內部，確保 pagination dots 自然疊在漸層上 */
.hero-swiper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(
        to bottom,
        rgba(249, 251, 253, 0)    0%,
        rgba(249, 251, 253, 0.04) 20%,
        rgba(249, 251, 253, 0.15) 40%,
        rgba(249, 251, 253, 0.42) 58%,
        rgba(249, 251, 253, 0.74) 76%,
        rgba(249, 251, 253, 0.93) 90%,
        rgba(249, 251, 253, 1)    100%
    );
    pointer-events: none;
    z-index: 5; /* 低於 swiper-pagination 的預設 z-index:10 */
}
.hero-swiper {
    width: 100%;
    height: auto;
    border-radius: 0;   /* 移除圓角，讓圖片邊到邊 */
    overflow: hidden;
    box-shadow: none;   /* 移除卡片陰影 */
    position: relative;
}
.hero-banner-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.hero-banner {
    position: relative;
    width: 100%;
    min-height: 440px;  /* 電腦版加高，視覺更有衝擊力 */
    padding: 4rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}
.hero-banner-link:hover .hero-banner {
    transform: scale(1.03);
}
.hero-banner-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    transition: transform 0.4s ease;
}
.hero-banner-link:hover .hero-banner-content {
    transform: scale(0.98);
}

/* 圖片底才套毛玻璃膠囊，純色模式不需要 */
.hero-banner:not(.color-mode) .hero-banner-content {
    background: rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 20px;
    padding: 1.75rem 2.75rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 900;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);  /* 有膠囊後 shadow 減輕 */
    line-height: 1.2;
    margin-bottom: 1rem;
}
.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 400;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.1) 60%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
    transition: opacity 0.3s ease;
}
.hero-banner.color-mode {
    background-image: linear-gradient(135deg, var(--bg-color-start, #0073e6), var(--bg-color-end, #005bb3)) !important;
}
.hero-banner.color-mode::before {
    opacity: 0;
}
.hero-swiper .swiper-button-prev,
.hero-swiper .swiper-button-next {
    color: #ffffff;
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}
.hero-swiper .swiper-button-prev:hover,
.hero-swiper .swiper-button-next:hover {
    background-color: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}
.hero-swiper .swiper-button-prev::after,
.hero-swiper .swiper-button-next::after {
    font-size: 1.2rem;
    font-weight: 900;
}
/* Pagination：毛玻璃膠囊容器 + dots 設計 */
.hero-swiper .swiper-pagination {
    bottom: 20px !important;
    left: 50% !important;
    width: auto !important;
    transform: translateX(-50%);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 13px;
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 30px;
    z-index: 10;
}
.hero-swiper .swiper-pagination-bullet {
    width: 7px;
    height: 7px;
    background-color: rgba(255, 255, 255, 0.5);
    opacity: 1;
    margin: 0 !important;
    border-radius: 4px;
    transition: all 0.35s ease;
    flex-shrink: 0;
}
.hero-swiper .swiper-pagination-bullet-active {
    background-color: #ffffff;
    width: 22px;
    border-radius: 4px;
}

/* -------------------------------------------------------------------
 * 04. 方案瀏覽器 - 主結構與步驟 (Plan Explorer - Layout & Stepper)
 * ------------------------------------------------------------------- */
.explorer-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}
#explorer-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 120px;
}
.stepper {
    list-style: none;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}
.stepper li {
    padding: 1rem 1.2rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
.stepper li:last-child {
    margin-bottom: 0;
}
.stepper li .step-icon {
    margin-right: 0.85rem;
    width: 28px;
    height: 28px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    transition: var(--transition);
    background: #f1f5f9;
    border-radius: 50%;
    flex-shrink: 0;
    color: #64748b;
}
.stepper li.active {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
    border-left: 3px solid var(--primary-color);
    padding-left: calc(1.2rem - 3px);
}
.stepper li.active .step-icon {
    background: var(--primary-color);
    color: white;
}
.stepper li.completed {
    color: var(--dark-color);
}
.stepper li:not(.disabled):not(.active):hover {
    background-color: var(--light-color);
}
.stepper li.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
.stepper li.completed .step-icon {
    color: #059669;
    background: #d1fae5;
}

/* ══ 電腦版步驟欄：時間軸（≥993px）══
   卡片頂部「購買流程／第 X 步，共 4 步」＋進度條；四個節點用直線串起，已完成的那段轉綠；
   已完成的步驟下方顯示已選內容（.step-value，由 plans.js updateStepper() 填），滑過出現「修改」提示（點了回到該步）。
   平板／手機（≤992px）維持原本的水平步驟列，頂部標題與已選內容隱藏。 */
.stepper-head { display: none; }
.step-text { display: inline; }
.step-value { display: none; }
@media (min-width: 993px) {
    #explorer-sidebar {
        background: var(--card-bg, #fff);
        border: 1px solid rgba(147, 197, 253, 0.35);
        border-radius: 16px;
        box-shadow: 0 4px 18px rgba(59, 130, 246, 0.07);
        padding: 1.15rem 0.85rem 0.85rem;
    }
    .stepper-head { display: block; padding: 0 0.45rem 0.95rem; margin-bottom: 0.5rem; border-bottom: 1px solid #eef2f7; }
    .stepper-head__row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
    .stepper-head__title { font-size: 0.95rem; font-weight: 700; color: #0f172a; }
    .stepper-head__count { font-size: 0.78rem; color: #64748b; font-variant-numeric: tabular-nums; }
    .stepper-head__bar { height: 4px; margin-top: 0.6rem; border-radius: 999px; background: #e8eef6; overflow: hidden; }
    .stepper-head__bar span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, #16a34a, var(--primary-color, #0073e6));
        transform: scaleX(0.25);
        transform-origin: left center;
        transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    }

    /* 外框改由 #explorer-sidebar 提供 */
    .stepper { padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
    .stepper li {
        display: flex;
        align-items: flex-start;
        gap: 0.8rem;
        padding: 0.7rem 0.45rem;
        margin: 0;
        border-radius: 12px;
        border-left: 0;
        color: #94a3b8;
        font-weight: 500;
        transition: background-color 0.18s ease, color 0.18s ease;
    }
    .stepper li.active { border-left: 0; padding-left: 0.45rem; background: #f0f7ff; color: #0f172a; }
    .stepper li.completed { color: #334155; }

    /* 節點之間的連線：從本節點底部畫到下一個節點頂部；已完成轉綠 */
    .stepper li:not(:last-child)::before {
        content: '';
        position: absolute;
        left: calc(0.45rem + 15px);
        top: calc(0.7rem + 32px + 4px);
        bottom: calc(-0.7rem + 4px);
        width: 2px;
        border-radius: 2px;
        background: #e2e8f0;
    }
    .stepper li.completed:not(:last-child)::before { background: #86d9a6; }

    .stepper li .step-icon {
        width: 32px;
        height: 32px;
        margin: 0;
        border: 2px solid #e2e8f0;
        background: #fff;
        color: #94a3b8;
        font-size: 0.85rem;
        transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .stepper li.completed .step-icon { border-color: transparent; background: #dcfce7; color: #15803d; }
    .stepper li.active .step-icon {
        border-color: transparent;
        background: var(--primary-color, #0073e6);
        color: #fff;
        box-shadow: 0 0 0 4px rgba(0, 115, 230, 0.14);
    }

    .step-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; padding-top: 5px; }
    .step-label { font-size: 0.95rem; line-height: 1.35; }
    .stepper li.active .step-label { font-weight: 700; }
    .stepper li.completed .step-label { font-weight: 600; }
    .step-value {
        display: block;
        font-size: 0.8rem;
        font-weight: 500;
        color: #64748b;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .step-value:empty { display: none; }

    /* 已完成步驟可點回去：滑過時淡底＋右側「修改」 */
    .stepper li.completed::after {
        content: '修改';
        align-self: center;
        flex: 0 0 auto;
        padding: 0.12rem 0.45rem;
        border-radius: 6px;
        background: #eef4ff;
        color: #0062c4;
        font-size: 0.72rem;
        font-weight: 700;
        opacity: 0;
        transform: translateX(-4px);
        transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.23, 1, 0.32, 1);
    }
    @media (hover: hover) and (pointer: fine) {
        .stepper li.completed:hover { background: #f8fafc; }
        .stepper li.completed:hover::after { opacity: 1; transform: none; }
    }
    .stepper li.disabled { opacity: 0.6; }
}
@media (prefers-reduced-motion: reduce) {
    .stepper-head__bar span, .stepper li.completed::after { transition: none; }
}

#explorer-content {
    flex-grow: 1;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    min-height: 60vh;
}
.explorer-view {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}
.explorer-view.active {
    display: block;
}
.loading-spinner {
    text-align: center;
    padding: 4rem 0;
    font-size: 1.2rem;
    color: var(--text-muted);
}
/* 錯誤狀態沿用 .loading-spinner 放驚嘆號圖示（不轉） */
.loading-spinner i {
    font-size: 3rem;
    color: var(--primary-color);
    display: block;
    margin-bottom: 1rem;
}
/* 載入動畫：花瓣形變（clip-path shape()）＋緩慢自轉；不支援 shape() 時退回 border-radius 軟形變 */
.loading-spinner .ld-shape {
    width: 60px; aspect-ratio: 1;
    margin: 0 auto 1.1rem;
    background: var(--primary-color, #0073e6);
    border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
    animation: ld-blob 1s infinite alternate ease-in-out, ld-turn 3.2s infinite linear;
}
/* 漸層含 var()，不支援 color-mix() 時不會退回上一條宣告而是整個透明，所以用 @supports 分流 */
@supports (background: color-mix(in srgb, red 50%, white)) {
    .loading-spinner .ld-shape {
        background: linear-gradient(135deg,
            color-mix(in srgb, var(--primary-color, #0073e6) 55%, #fff) 0%,
            var(--primary-color, #0073e6) 50%,
            color-mix(in srgb, var(--primary-color, #0073e6) 70%, #000) 100%);
    }
}
@supports (clip-path: shape(from 0% 0%, line to 100% 100%)) {
    .loading-spinner .ld-shape {
        border-radius: 0;
        animation: ld-morph 1s infinite alternate ease-in-out, ld-turn 3.2s infinite linear;
    }
}
.loading-spinner .ld-text { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: .06em; }
.loading-spinner .ld-text::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: ld-dots 1.2s steps(4, end) infinite; }
@keyframes ld-turn { to { transform: rotate(360deg); } }
@keyframes ld-blob { to { border-radius: 58% 42% 45% 55% / 52% 58% 42% 48%; } }
@keyframes ld-morph {
    0% { clip-path: shape(from 85.0242216976% 60.8470934779%, curve to 80.3178442208% 70.6199870088% with 95.0484433951% 71.6941869559%, curve to 63.3566458721% 84.1460913354% with 65.5872450465% 69.5457870617%, curve to 52.7815116745% 86.5597967068% with 61.1260466978% 98.7463956091%, curve to 31.6312432791% 81.732385964% with 44.4369766511% 74.3731978045%, curve to 23.1506441048% 74.9693338007% with 18.8255099071% 89.0915741234%, curve to 13.7378891512% 55.423546739% with 27.4757783024% 60.8470934779%, curve to 13.7378891512% 44.576453261% with 0% 50%, curve to 23.1506441048% 25.0306661993% with 27.4757783024% 39.1529065221%, curve to 31.6312432791% 18.267614036% with 18.8255099071% 10.9084258766%, curve to 52.7815116745% 13.4402032932% with 44.4369766511% 25.6268021955%, curve to 63.3566458721% 15.8539086646% with 61.1260466978% 1.2536043909%, curve to 80.3178442208% 29.3800129912% with 65.5872450465% 30.4542129383%, curve to 85.0242216976% 39.1529065221% with 95.0484433951% 28.3058130441%, curve to 85.0242216976% 60.8470934779% with 75% 50%); }
    to { clip-path: shape(from 86.2621108488% 55.423546739%, curve to 76.8493558952% 74.9693338007% with 72.5242216976% 60.8470934779%, curve to 68.3687567209% 81.732385964% with 81.1744900929% 89.0915741234%, curve to 47.2184883255% 86.5597967068% with 55.5630233489% 74.3731978045%, curve to 36.6433541279% 84.1460913354% with 38.8739533022% 98.7463956091%, curve to 19.6821557792% 70.6199870088% with 34.4127549535% 69.5457870617%, curve to 14.9757783024% 60.8470934779% with 4.9515566049% 71.6941869559%, curve to 14.9757783024% 39.1529065221% with 25% 50%, curve to 19.6821557792% 29.3800129912% with 4.9515566049% 28.3058130441%, curve to 36.6433541279% 15.8539086646% with 34.4127549535% 30.4542129383%, curve to 47.2184883255% 13.4402032932% with 38.8739533022% 1.2536043909%, curve to 68.3687567209% 18.267614036% with 55.5630233489% 25.6268021955%, curve to 76.8493558952% 25.0306661993% with 81.1744900929% 10.9084258766%, curve to 86.2621108488% 44.576453261% with 72.5242216976% 39.1529065221%, curve to 86.2621108488% 55.423546739% with 100% 50%); }
}
@keyframes ld-dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
@media (prefers-reduced-motion: reduce) {
    .loading-spinner .ld-shape { animation-duration: 2.4s, 8s; }
    .loading-spinner .ld-text::after { animation: none; }
}

.category-title-bar {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--primary-color);
}
.category-title-bar h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}
/* ── 三大分類標頭（每日重置／總流量／吃到飽）專屬樣式 ── */
.category-title-bar.plan-cat {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    padding: 0.95rem 1.35rem;
    border-left: 5px solid var(--cat1);
    border-top: 1px solid color-mix(in srgb, var(--cat1) 18%, transparent);
    border-right: 1px solid color-mix(in srgb, var(--cat1) 18%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--cat1) 18%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--cat1) 12%, #fff) 0%, #fff 60%);
}
/* 右側淡淡的色彩光暈點綴 */
.category-title-bar.plan-cat::after {
    content: "";
    position: absolute;
    right: -40px;
    top: 50%;
    width: 160px;
    height: 160px;
    transform: translateY(-50%);
    background: radial-gradient(circle, color-mix(in srgb, var(--cat1) 14%, transparent) 0%, transparent 70%);
    pointer-events: none;
}
.plan-cat-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--cat1), var(--cat2));
    box-shadow: 0 6px 16px -4px var(--cat1);
}
.plan-cat-text { position: relative; z-index: 1; }
.category-title-bar.plan-cat h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--dark-color);
    line-height: 1.2;
    margin: 0;
}
.plan-cat-sub {
    margin: 0.18rem 0 0;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6b7280;
    letter-spacing: 0.01em;
}
/* 各分類主題色 */
.plan-cat.cat-daily     { --cat1: #2563eb; --cat2: #1e40af; }  /* 藍：每日重置（與粉 #db2777、青綠 #0ea5a4 同一彩度層級） */
.plan-cat.cat-total     { --cat1: #db2777; --cat2: #9d174d; }  /* 玫瑰粉（深一階）：總流量 */
.plan-cat.cat-unlimited { --cat1: #0d9488; --cat2: #115e59; }  /* 青綠：吃到飽（明度與藍 #2563eb、粉 #db2777 對齊） */
.plan-cat.cat-type      { --cat1: #f97316; --cat2: #ea580c; }  /* 橙：網卡類型 */
.plan-cat.cat-day       { --cat1: #ec4899; --cat2: #db2777; }  /* 玫瑰：選擇天數 */

@media (max-width: 480px) {
    .plan-cat-icon { width: 40px; height: 40px; font-size: 1.05rem; border-radius: 12px; }
    .category-title-bar.plan-cat h2 { font-size: 1.15rem; }
    .plan-cat-sub { font-size: 0.76rem; }
}

/* ── 三大分類卡片（方案列表專用：可點展開、含特點說明與「適合誰」） ──
 * 只套在 .plan-cat[data-cat]（每日重置／總流量／吃到飽），
 * 卡別頁、天數頁的 .plan-cat.cat-type / .cat-day 仍維持上面的扁平標頭。 */
#plan-selection-view .plan-cat[data-cat] {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    cursor: pointer;
    user-select: none;
    border: 1px solid color-mix(in srgb, var(--cat1) 22%, transparent);
    border-left-width: 1px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--cat1) 45%, transparent);
    transition: box-shadow .35s cubic-bezier(.22,.61,.36,1), transform .35s cubic-bezier(.22,.61,.36,1),
                border-color .35s ease, border-radius .3s ease;
}
/* 右上角的柔光暈：平常幾乎看不見，滑過時放大浮現 */
/* 光暈畫在卡片自己的範圍內（inset:0 + 圓角），卡片就不需要 overflow:hidden，
 * 右下角按鈕滑過時的陰影才不會被卡片邊緣裁掉 */
#plan-selection-view .plan-cat[data-cat] { overflow: visible; }
#plan-selection-view .plan-cat[data-cat]::after {
    display: block;
    content: "";
    position: absolute;
    inset: 0;
    /* 基底 .category-title-bar.plan-cat::after 有寫死 160px 寬高與 right:-40px/top:50%，
       這裡一定要一起歸零，否則 inset:0 會被寬高蓋掉，變成一塊 160px 的方塊卡在左上角 */
    width: auto;
    height: auto;
    border-radius: inherit;
    /* 光暈用固定尺寸的橢圓，確保在卡片底邊之前就完全淡出；
       之前用 circle 依卡片對角線算半徑，展開時會延伸到卡片底邊被硬切成一條線 */
    background: radial-gradient(360px 200px at 100% 0%, color-mix(in srgb, var(--cat1) 22%, transparent) 0%, transparent 70%);
    opacity: 0;
    transform: scale(.85);
    transform-origin: 100% 0;
    transition: opacity .45s ease, transform .55s cubic-bezier(.22,.61,.36,1);
    pointer-events: none;
    z-index: 0;
}
/* 不用頂部色帶（分類色由圖示、角標、按鈕表現） */
#plan-selection-view .plan-cat[data-cat]::before { display: none; }
#plan-selection-view .plan-cat-group:not(.empty) .plan-cat[data-cat]:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--cat1) 50%, transparent);
    box-shadow: 0 22px 40px -16px color-mix(in srgb, var(--cat1) 60%, transparent),
                0 0 0 1px color-mix(in srgb, var(--cat1) 12%, transparent);
}
#plan-selection-view .plan-cat-group:not(.empty) .plan-cat[data-cat]:hover::after { opacity: 1; transform: scale(1); }
/* 滑過：圖示微傾、標題染上分類色、標頭底色加深 */
#plan-selection-view .plan-cat[data-cat] .plan-cat-icon {
    transition: transform .4s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease;
}
#plan-selection-view .plan-cat-group:not(.empty) .plan-cat[data-cat]:hover .plan-cat-icon {
    transform: rotate(-8deg) scale(1.1);
    box-shadow: 0 10px 22px -6px var(--cat1);
}
#plan-selection-view .plan-cat[data-cat] h2 { transition: color .3s ease; }
#plan-selection-view .plan-cat-group:not(.empty) .plan-cat[data-cat]:hover h2 { color: var(--cat2); }
.plan-cat-head { transition: background .35s ease; }
#plan-selection-view .plan-cat-group:not(.empty) .plan-cat[data-cat]:hover .plan-cat-head {
    background: linear-gradient(135deg, color-mix(in srgb, var(--cat1) 16%, #fff) 0%, #fff 70%);
}
#plan-selection-view .plan-cat[data-cat]:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--cat1) 45%, transparent);
    outline-offset: 2px;
}
/* 展開中的分類：卡片停在原位、底部圓角收掉、與內容區接起來，並帶一圈分類色描邊 */
#plan-selection-view .plan-cat-group:not(.collapsed) .plan-cat[data-cat] {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-width: 0;   /* 不能只設透明：透明邊框仍佔 1px，會在標頭與內容區之間露出一條縫 */
    border-color: color-mix(in srgb, var(--cat1) 40%, transparent);
    transform: none !important;
    box-shadow: none;   /* 陰影交給下方內容區一起畫，標頭底部才不會多一道陰影線 */
}
/* 展開中滑過：hover 規則的權重較高會把陰影與底邊框加回來，這裡再壓一次 */
#plan-selection-view .plan-cat-group:not(.collapsed):not(.empty) .plan-cat[data-cat]:hover {
    box-shadow: none;
    border-bottom-width: 0;
}
#plan-selection-view .plan-cat-group:not(.collapsed) .plan-cat-body {
    border: 1px solid color-mix(in srgb, var(--cat1, #94a3b8) 40%, transparent);
    border-top: 0;
    border-radius: 0 0 18px 18px;
    padding: 1.35rem 1.25rem 1.25rem;
    /* 起始色與標頭底部展開列的結尾色一致（5%），接縫處才不會出現色差線 */
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--cat1, #94a3b8) 5%, #fff) 0, #fff 90px),
        #fff;
    box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--cat1, #94a3b8) 50%, transparent);
}
/* 展開時：內容區由 JS 做高度動畫（見 setPlanCatOpen），卡片再依序淡入 */
.plan-cat-body.animating { overflow: hidden; transition: height .45s cubic-bezier(.22,.61,.36,1), padding .45s cubic-bezier(.22,.61,.36,1), opacity .35s ease; }
.plan-cat-group.opening .plan-cat-body .selection-card {
    animation: planCardIn .5s cubic-bezier(.22,.61,.36,1) both;
}
.plan-cat-group.opening .plan-cat-body .selection-card:nth-child(1)  { animation-delay: .05s; }
.plan-cat-group.opening .plan-cat-body .selection-card:nth-child(2)  { animation-delay: .10s; }
.plan-cat-group.opening .plan-cat-body .selection-card:nth-child(3)  { animation-delay: .15s; }
.plan-cat-group.opening .plan-cat-body .selection-card:nth-child(4)  { animation-delay: .20s; }
.plan-cat-group.opening .plan-cat-body .selection-card:nth-child(5)  { animation-delay: .25s; }
.plan-cat-group.opening .plan-cat-body .selection-card:nth-child(6)  { animation-delay: .30s; }
.plan-cat-group.opening .plan-cat-body .selection-card:nth-child(7)  { animation-delay: .35s; }
.plan-cat-group.opening .plan-cat-body .selection-card:nth-child(8)  { animation-delay: .40s; }
.plan-cat-group.opening .plan-cat-body .selection-card:nth-child(n+9) { animation-delay: .45s; }
@keyframes planCardIn {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
/* 分類色也掛在群組層，展開後的內容區邊框才拿得到 */
#plan-selection-view .plan-cat-group[data-cat="daily"]     { --cat1: #2563eb; --cat2: #1e40af; }
#plan-selection-view .plan-cat-group[data-cat="total"]     { --cat1: #db2777; --cat2: #9d174d; }
#plan-selection-view .plan-cat-group[data-cat="unlimited"] { --cat1: #0d9488; --cat2: #115e59; }

/* 標頭列：圖示＋標題＋角標＋副標 ／ 右側計數＋箭頭 */
.plan-cat-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.25rem 0.9rem;
    border-radius: 17px 17px 0 0;   /* 卡片不再 overflow:hidden，底色自己要跟著圓角（18px 扣 1px 邊框） */
    background: linear-gradient(135deg, color-mix(in srgb, var(--cat1) 10%, #fff) 0%, #fff 65%);
}
#plan-selection-view .plan-cat[data-cat] .plan-cat-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-size: 1.4rem;
}
.plan-cat-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
#plan-selection-view .plan-cat[data-cat] h2 { font-size: 1.35rem; }
.plan-cat-tag {
    padding: 0.14rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: .04em;
    color: #fff;
    background: linear-gradient(135deg, var(--cat1), var(--cat2));
    box-shadow: 0 3px 8px -3px var(--cat1);
    white-space: nowrap;
}
#plan-selection-view .plan-cat[data-cat] .plan-cat-sub {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: #4b5563;
}
.plan-cat-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}
.plan-cat-count {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cat2);
    background: color-mix(in srgb, var(--cat1) 12%, #fff);
    border: 1px solid color-mix(in srgb, var(--cat1) 25%, transparent);
    white-space: nowrap;
}
.plan-cat-count.has-match { color: #166534; background: #dcfce7; border-color: #86efac; }
.plan-cat-count.no-match  { color: #991b1b; background: #fee2e2; border-color: #fca5a5; }
/* 沒有方案的分類：右上角提示膠囊 + 整張卡片灰化、不可展開 */
.plan-cat-empty {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #6b7280;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    white-space: nowrap;
}
#plan-selection-view .plan-cat-group.empty .plan-cat[data-cat] {
    cursor: default;
    opacity: .62;
    filter: grayscale(.35);
    box-shadow: none;
}
#plan-selection-view .plan-cat-group.empty .plan-cat[data-cat]:hover { transform: none; box-shadow: none; }
/* 底部展開列：右下角展開按鈕 */
.plan-cat-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;   /* 左：方案說明、右：展開查看方案 */
    padding: 0.6rem 0.9rem 0.9rem 1.25rem;
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--cat1) 5%, #fff));
    border-radius: 0 0 17px 17px;   /* 同上，收合時底色跟著卡片下方圓角 */
}
.plan-cat-group:not(.collapsed) .plan-cat-foot { border-radius: 0; }   /* 展開時下方接內容區，不要圓角 */
.plan-cat-toggle {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    margin-left: auto;   /* 沒有說明按鈕時自己靠右 */
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.45rem 0.4rem 1.1rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: .02em;
    color: #fff;
    background: linear-gradient(135deg, var(--cat1), var(--cat2));
    box-shadow: 0 8px 18px -6px var(--cat1), inset 0 1px 0 rgba(255,255,255,.25);
    overflow: hidden;
    transition: transform .3s cubic-bezier(.22,.61,.36,1), box-shadow .3s ease, background .3s ease, color .3s ease, border-color .3s ease;
    border: 1.5px solid transparent;
}
/* 按鈕上的掃光：滑過整張卡片時由左掃到右 */
.plan-cat-toggle::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    left: -60%;
    width: 45%;
    background: linear-gradient(105deg, transparent, rgba(255,255,255,.45), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
}
#plan-selection-view .plan-cat-group:not(.empty) .plan-cat[data-cat]:hover .plan-cat-toggle {
    transform: translateX(-3px);
    box-shadow: 0 14px 26px -8px var(--cat1), inset 0 1px 0 rgba(255,255,255,.3);
}
#plan-selection-view .plan-cat-group.collapsed:not(.empty) .plan-cat[data-cat]:hover .plan-cat-toggle::after {
    animation: planCatSheen .9s cubic-bezier(.22,.61,.36,1) forwards;
}
@keyframes planCatSheen {
    to { left: 130%; }
}
.plan-cat-chevron {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--cat2);
    background: #fff;
    font-size: 0.95rem;
    transition: transform .45s cubic-bezier(.34,1.56,.64,1), background .3s ease, color .3s ease;
}
.plan-cat-toggle-open, .plan-cat-toggle-close { position: relative; z-index: 1; }
/* 收合中：箭頭朝下並輕微上下浮動提示可點；滑過時箭頭往下點一下 */
.plan-cat-group.collapsed .plan-cat-chevron i { animation: planCatNudge 1.8s ease-in-out infinite; }
#plan-selection-view .plan-cat-group.collapsed:not(.empty) .plan-cat[data-cat]:hover .plan-cat-chevron {
    transform: translateY(2px) scale(1.08);
}
/* 展開後：按鈕反白成描邊樣式、箭頭翻上並改為實色圓 */
.plan-cat-group:not(.collapsed) .plan-cat-toggle {
    background: #fff;
    color: var(--cat2);
    border-color: color-mix(in srgb, var(--cat1) 45%, transparent);
    box-shadow: 0 4px 12px -6px var(--cat1);
}
.plan-cat-group:not(.collapsed) .plan-cat-chevron {
    transform: rotate(180deg);
    color: #fff;
    background: linear-gradient(135deg, var(--cat1), var(--cat2));
}
#plan-selection-view .plan-cat-group:not(.collapsed) .plan-cat[data-cat]:hover .plan-cat-chevron {
    transform: rotate(180deg) translateY(2px);
}
.plan-cat-toggle-close { display: none; }
.plan-cat-group:not(.collapsed) .plan-cat-toggle-open  { display: none; }
.plan-cat-group:not(.collapsed) .plan-cat-toggle-close { display: inline; }
@keyframes planCatNudge {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(3px); }
}
@media (prefers-reduced-motion: reduce) {
    .plan-cat-group.collapsed .plan-cat-chevron i { animation: none; }
}

/* 說明區：特點清單 */
/* 說明區預設收起：桌機用 grid-template-rows 0fr→1fr 做平滑展開 */
.plan-cat-detail {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .35s cubic-bezier(.22,.61,.36,1);
}
.plan-cat-detail-inner {
    overflow: hidden;
    min-height: 0;
    opacity: 0;
    transition: opacity .25s ease;
}
.plan-cat-detail.open { grid-template-rows: 1fr; }
.plan-cat-detail.open .plan-cat-detail-inner { opacity: 1; transition-delay: .08s; }
/* 觸控裝置：高度過渡會逐格重排版，手機上會卡；改成直接切換 display，只留一段輕量淡入 */
@media (hover: none) {
    .plan-cat-detail { display: none; transition: none; }
    .plan-cat-detail.open { display: block; }
    .plan-cat-detail-inner { opacity: 1; transition: none; }
    .plan-cat-detail.open .plan-cat-detail-inner { animation: planCatFadeIn .18s ease-out; }
}
@media (prefers-reduced-motion: reduce) {
    .plan-cat-detail { transition: none; }
    .plan-cat-detail-inner { transition: none; }
    .plan-cat-detail.open .plan-cat-detail-inner { animation: none; }
}
.plan-cat-detail .plan-cat-points {
    margin: 0 1.25rem;
    padding: 0.9rem 0 1rem;
    border-top: 1px dashed color-mix(in srgb, var(--cat1) 22%, transparent);
}
/* 「方案說明」小按鈕：幽靈膠囊，打開後填上淡淡分類色 */
.plan-cat-info-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.85rem 0.42rem 0.75rem;
    border-radius: 999px;
    border: 1.5px solid color-mix(in srgb, var(--cat1) 28%, transparent);
    background: #fff;
    color: var(--cat2);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
    -webkit-tap-highlight-color: transparent;
}
.plan-cat-info-btn > i:first-child { font-size: 0.95rem; color: var(--cat1); }
.plan-cat-info-arrow { font-size: 0.7rem; opacity: .7; transition: transform .3s ease; }
.plan-cat-info-btn[aria-expanded="true"] {
    background: color-mix(in srgb, var(--cat1) 10%, #fff);
    border-color: color-mix(in srgb, var(--cat1) 45%, transparent);
}
.plan-cat-info-btn[aria-expanded="true"] .plan-cat-info-arrow { transform: rotate(180deg); }
@media (hover: hover) {
    .plan-cat-info-btn:hover {
        background: color-mix(in srgb, var(--cat1) 8%, #fff);
        border-color: color-mix(in srgb, var(--cat1) 45%, transparent);
        box-shadow: 0 4px 12px -6px var(--cat1);
    }
}
.plan-cat-info-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--cat1) 40%, transparent); outline-offset: 2px; }
/* 空分類：說明按鈕仍可用，不要跟著卡片一起灰掉太多 */
#plan-selection-view .plan-cat-group.empty .plan-cat-foot { justify-content: flex-start; }
.plan-cat-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}
.plan-cat-points li {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.86rem;
    line-height: 1.5;
    color: #374151;
}
.plan-cat-points li i {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    color: var(--cat2);
    background: color-mix(in srgb, var(--cat1) 12%, #fff);
    margin-top: 0.05rem;
}
.plan-cat-group.collapsed .plan-cat-body:not(.animating) { display: none; }
.plan-cat-group { margin-bottom: 1.5rem; }
.plan-cat-group.collapsed { margin-bottom: 1rem; }
.plan-cat-group .category-title-bar { margin-bottom: 0; }
/* 單一分類：不折疊也不顯示箭頭 */
#plan-selection-view.single-cat .plan-cat[data-cat] { cursor: default; }
#plan-selection-view.single-cat .plan-cat[data-cat]:hover { transform: none; }
#plan-selection-view.single-cat .plan-cat-toggle { display: none; }   /* 單一分類：只藏展開按鈕，說明按鈕保留 */
@keyframes planCatFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .plan-cat-body.animating { transition: none; }
    .plan-cat-group:not(.collapsed) .plan-cat-body { animation: none; }
    .plan-cat-group.opening .plan-cat-body .selection-card { animation: none; }
    .plan-cat-toggle::after { display: none; }
}
/* ── 觸控裝置（手機／平板）：關掉所有 hover 效果與重動畫 ──
 * 觸控沒有真正的「滑過」，點一下會讓 :hover 黏住，整塊標頭看起來像反白；
 * 加上系統的點擊高亮（tap highlight）就更明顯。這裡一併關掉，
 * 展開／收合只保留輕量的高度動畫，避免卡頓。 */
#plan-selection-view .plan-cat[data-cat] { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
    #plan-selection-view .plan-cat-group:not(.empty) .plan-cat[data-cat]:hover {
        transform: none;
        border-color: color-mix(in srgb, var(--cat1) 22%, transparent);
        box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--cat1) 45%, transparent);
    }
    /* 手機點過後 :hover 會黏住：展開中的標頭不能有陰影，否則按鈕下方會多一條陰影線 */
    #plan-selection-view .plan-cat-group:not(.collapsed):not(.empty) .plan-cat[data-cat]:hover {
        border-color: color-mix(in srgb, var(--cat1) 40%, transparent);
        border-bottom-width: 0;
        box-shadow: none;
    }
    #plan-selection-view .plan-cat[data-cat]::after { display: none; }
    #plan-selection-view .plan-cat-group:not(.empty) .plan-cat[data-cat]:hover .plan-cat-icon { transform: none; box-shadow: 0 6px 16px -4px var(--cat1); }
    #plan-selection-view .plan-cat-group:not(.empty) .plan-cat[data-cat]:hover h2 { color: var(--dark-color); }
    #plan-selection-view .plan-cat-group:not(.empty) .plan-cat[data-cat]:hover .plan-cat-head {
        background: linear-gradient(135deg, color-mix(in srgb, var(--cat1) 10%, #fff) 0%, #fff 65%);
    }
    #plan-selection-view .plan-cat-group:not(.empty) .plan-cat[data-cat]:hover .plan-cat-toggle { transform: none; box-shadow: 0 8px 18px -6px var(--cat1), inset 0 1px 0 rgba(255,255,255,.25); }
    #plan-selection-view .plan-cat-group:not(.collapsed):not(.empty) .plan-cat[data-cat]:hover .plan-cat-toggle { box-shadow: 0 4px 12px -6px var(--cat1); }
    .plan-cat-toggle::after { display: none; }
    #plan-selection-view .plan-cat-group.collapsed:not(.empty) .plan-cat[data-cat]:hover .plan-cat-chevron { transform: none; }
    #plan-selection-view .plan-cat-group:not(.collapsed) .plan-cat[data-cat]:hover .plan-cat-chevron { transform: rotate(180deg); }
    /* 動畫減量：觸控裝置不做高度動畫（JS 端直接略過），內容區只做一段 0.18s 的淡入（純合成層，最省）；
       不做小卡逐張進場、拿掉會重繪的陰影／位移過渡 */
    .plan-cat-group.opening .plan-cat-body .selection-card { animation: none; }
    .plan-cat-group:not(.collapsed) .plan-cat-body { animation: planCatFadeIn .18s ease-out; }
    #plan-selection-view .plan-cat[data-cat] { transition: none; }
    #plan-selection-view .plan-cat-group:not(.collapsed) .plan-cat-body { box-shadow: none; }
    .plan-cat-toggle { transition: none; }
    .plan-cat-chevron { transition: transform .2s ease; }
    #plan-selection-view .plan-cat[data-cat] .plan-cat-icon { transition: none; }
    /* 收合中的小箭頭上下浮動提示保留（純 transform 動畫，不影響效能） */
}
@media (max-width: 480px) {
    .plan-cat-head { padding: 1rem 0.95rem 0.75rem; gap: 0.7rem; }
    #plan-selection-view .plan-cat[data-cat] .plan-cat-icon { width: 44px; height: 44px; font-size: 1.15rem; border-radius: 13px; }
    #plan-selection-view .plan-cat[data-cat] h2 { font-size: 1.15rem; }
    #plan-selection-view .plan-cat[data-cat] .plan-cat-sub { font-size: 0.8rem; }
    .plan-cat-text { flex: 1 1 0; min-width: 0; }
    .plan-cat-right { margin-left: auto; padding-top: 0; }
    .plan-cat-count { font-size: 0.74rem; padding: 0.24rem 0.6rem; }
    /* 手機：按鈕拉滿寬更好按 */
    .plan-cat-foot { padding: 0.5rem 0.95rem 0.9rem; gap: 0.5rem; }
    .plan-cat-info-btn { padding: 0.4rem 0.7rem 0.4rem 0.65rem; font-size: 0.8rem; }
    .plan-cat-info-txt { display: none; }   /* 手機只留問號＋小箭頭，把寬度讓給展開按鈕 */
    .plan-cat-detail .plan-cat-points { margin: 0 0.95rem; padding: 0.75rem 0 0.85rem; }
    /* 文字置中：箭頭絕對定位靠右，文字在整顆按鈕內置中 */
    .plan-cat-toggle { flex: 1; justify-content: center; font-size: 0.9rem; padding-left: 1rem; padding-right: 2.6rem; }
    .plan-cat-toggle .plan-cat-chevron { position: absolute; right: 0.3rem; top: 50%; margin-top: -16px; }
    .plan-cat-chevron { width: 32px; height: 32px; font-size: 0.88rem; }
    .plan-cat-points li { font-size: 0.8rem; }
    #plan-selection-view .plan-cat-group:not(.collapsed) .plan-cat-body { padding: 1rem 0.75rem 0.9rem; }
}

/* ── 返回列表時，上次點進去的方案卡片標色 ── */
#plan-selection-view .selection-card.last-viewed {
    border-color: #f59e0b;
    background: linear-gradient(145deg, #fffbeb 0%, #fff7ed 100%);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .22), 0 8px 25px rgba(245, 158, 11, .12);
}
#plan-selection-view .selection-card.last-viewed::before {
    content: "上次查看";
    position: absolute;
    left: 50%;
    top: -11px;
    transform: translateX(-50%);
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: .04em;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(245, 158, 11, .35);
    z-index: 2;
}
#plan-selection-view .selection-card.last-viewed .name { color: #b45309; }

/* ── 洲別標題（分隔線風格，刻意與三大分類不同調性）── */
.continent-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.35rem;
}
.continent-emoji {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    line-height: 1;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .18);
}
.continent-title h2 {
    flex-shrink: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--dark-color);
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin: 0;
}
/* 向右淡出的漸層細線，補滿整行 */
.continent-title::after {
    content: "";
    flex: 1;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(99, 102, 241, .35), rgba(99, 102, 241, 0));
}
@media (max-width: 480px) {
    .continent-emoji { width: 32px; height: 32px; font-size: 1rem; }
    .continent-title h2 { font-size: 1.02rem; }
}

.category-group {
    margin-bottom: 2.5rem;
}
.category-group:last-child {
    margin-bottom: 0;
}
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}
/* 方案子群組 */
.plan-subgroup {
    margin-bottom: 1.25rem;
}
.plan-subgroup:last-child {
    margin-bottom: 0;
}
.plan-subgroup-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.6rem;
    letter-spacing: 0.03em;
}
.plan-subgroup-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.plan-subgroup-note {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    margin-top: -0.2rem;
    margin-bottom: 0.65rem;
    line-height: 1.5;
    white-space: normal;
    word-break: break-all;
}
.plan-subgroup-note i { font-size: 0.72rem; flex-shrink: 0; }

/* -------------------------------------------------------------------
 * 目的地篩選器
 * ------------------------------------------------------------------- */
.country-filter-box {
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.country-filter-header {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.92rem; font-weight: 600; color: #1d4ed8;
    margin-bottom: 0.75rem; flex-wrap: wrap;
}
.country-filter-hint {
    font-size: 0.78rem; font-weight: 400; color: #6b7280; width: 100%;
}
.country-filter-input-row {
    display: flex; align-items: flex-start; gap: 0.6rem; flex-wrap: wrap;
}
.country-tags-wrap {
    flex: 1; min-width: 0;
    display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
    background: #fff; border: 1px solid #d1d5db; border-radius: 10px;
    padding: 0.4rem 0.6rem; cursor: text;
}
.country-tags-wrap:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.country-tag {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: #3b82f6; color: #fff;
    font-size: 0.82rem; padding: 0.2rem 0.55rem; border-radius: 20px;
}
.country-tag button {
    background: none; border: none; color: rgba(255,255,255,.8);
    cursor: pointer; padding: 0; font-size: 0.9rem; line-height: 1; display: flex;
}
.country-tag button:hover { color: #fff; }
#country-filter-input {
    border: none; outline: none; font-size: 0.9rem;
    min-width: 80px; flex: 1; background: transparent;
}
.btn-filter-add {
    background: #3b82f6; border: none; border-radius: 8px;
    padding: 0.45rem 0.9rem; font-size: 0.84rem; cursor: pointer;
    color: #fff; white-space: nowrap; transition: background .15s;
    display: flex; align-items: center; gap: 0.35rem;
}
.btn-filter-add:hover { background: #2563eb; }
.btn-filter-clear {
    background: #fff; border: 1px solid #d1d5db; border-radius: 8px;
    padding: 0.45rem 0.85rem; font-size: 0.84rem; cursor: pointer;
    color: #6b7280; white-space: nowrap; transition: background .15s;
}
.btn-filter-clear:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.country-filter-autocomplete {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08); margin-top: 0.4rem;
    max-height: 200px; overflow-y: auto;
}
.country-filter-autocomplete .ac-item {
    padding: 0.55rem 1rem; cursor: pointer; font-size: 0.9rem;
    border-bottom: 1px solid #f3f4f6;
}
.country-filter-autocomplete .ac-item:last-child { border-bottom: none; }
.country-filter-autocomplete .ac-item:hover { background: #eff6ff; }
.country-filter-status {
    margin-top: 0.65rem; font-size: 0.84rem; color: #374151;
}
.country-filter-status .cf-match { color: #15803d; font-weight: 600; }
.country-filter-status .cf-no { color: #b91c1c; font-weight: 600; }
/* 篩選結果：方案卡片淡化 */
.plan-card-filtered-out {
    opacity: 0.25;
    filter: grayscale(60%);
    pointer-events: none;
}

/* -------------------------------------------------------------------
 * 05. 方案瀏覽器 - 通用選擇卡片 (Plan Explorer - Selection Card)
 * ------------------------------------------------------------------- */
.selection-card {
    background: linear-gradient(145deg, var(--card-bg) 0%, #f7faff 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: visible;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.selection-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 115, 230, 0.12);
    border-color: rgba(0, 115, 230, 0.5);
}
/* 當卡片內的標籤 tooltip 顯示時，提升整張卡片的 z-index 避免被相鄰卡片遮擋 */
.selection-card:has(.plan-chip:hover),
.selection-card:has(.plan-chip:focus) {
    z-index: 200;
}
.selection-card.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(0, 115, 230, 0.2), 0 8px 25px rgba(0, 115, 230, 0.1);
    transform: translateY(-4px) scale(1.01);
}
.selection-card::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    --check-size: 36px;
    width: var(--check-size);
    height: var(--check-size);
    top: calc(var(--check-size) / -2);
    right: calc(var(--check-size) / -2);
    display: grid;
    place-items: center;
    background: var(--primary-color);
    color: var(--card-bg);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 115, 230, 0.3);
    font-size: 16px;
    transform: scale(0) rotate(-15deg);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 3;
}
.selection-card.selected::after {
    transform: scale(1) rotate(0);
}
.selection-card .icon {
    font-size: 3.2rem;
    margin-bottom: 1rem;
    line-height: 1;
    color: var(--primary-color);
    transition: transform 0.3s ease, color 0.3s ease;
    text-shadow: 2px 2px 10px rgba(0, 115, 230, 0.1);
    min-height: 3.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.selection-card:hover .icon {
    transform: scale(1.1);
}
/* emoji 圖標才旋轉 */
.selection-card:hover .icon .region-icon {
    transform: scale(1.05) rotate(-5deg);
}
.selection-card.selected .icon {
    color: var(--primary-dark);
}

/* 推廣卡片輪播樣式 */
.promo-carousel {
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}

.promo-card {
    background: linear-gradient(145deg, #fff5e6 0%, #fff9f0 100%);
    border-color: #ffa726;
}

.promo-card:hover {
    border-color: #ff9800;
    box-shadow: 0 12px 35px rgba(255, 152, 0, 0.15);
}

/* 純展示推廣卡片（無連結）：不顯示可點手勢 */
.promo-card.promo-static {
    cursor: default;
}

/* 圖示模式推廣卡片在「方案層」：縮小圖示與間距，避免比方案卡片高
   （方案卡片為頂部標籤預留 padding-top:1.6rem，且無大圖示，故此處覆蓋對齊） */
#plan-selection-view .selection-card.promo-card .icon {
    font-size: 2rem;
    min-height: auto;
    margin-bottom: 0.4rem;
}
#plan-selection-view .selection-card.promo-card .name {
    padding-top: 0;
    font-size: 1.05rem;
}
#plan-selection-view .selection-card.promo-card .description {
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

/* 圖片模式推廣卡片：每一層有固定的「最小比例」（2026-11-08 改版）
   - 網卡類型層：1 : 1 正方形   → 建議圖 800 × 800
   - 方案分類層：16 : 10 橫幅   → 建議圖 1200 × 750
   aspect-ratio＋align-self:stretch：卡片高度至少是比例算出來的高度；
   同一列方案卡比較高時（電腦版多欄）會被拉成同高，此時 cover 會裁掉左右少許（約各 5～8%），
   手機單欄獨佔一列時就是剛好的比例、完全不裁。
   後台 admin/plan_promo_cards.php 的預覽框與建議尺寸用同一組比例（REC），改這裡要一起改。 */
#type-selection-view .selection-card.promo-card:has(.promo-card-image) {
    padding: 0;
    aspect-ratio: 1 / 1;
    align-self: stretch;
    width: 100%;           /* 寬度鎖在欄寬：被拉高時不准用比例反推寬度、撐出欄外 */
    min-width: 0;
    min-height: 0;
}
/* 網卡類型層在 577～768px 原本一排擠 4 欄（每欄約 145px），正方形比 eSIM 卡矮，
   被拉高成 145×171 的直長方形、左右被裁。有圖片推廣卡時改成最多 3 欄，維持正方形。 */
@media (min-width: 577px) and (max-width: 768px) {
    #type-selection-view .grid-container:has(.promo-card-image) {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}
#plan-selection-view .selection-card.promo-card:has(.promo-card-image) {
    padding: 0;
    overflow: visible;
    aspect-ratio: 16 / 10;
    align-self: stretch;
    width: 100%;           /* 寬度鎖在欄寬：被拉高時不准用比例反推寬度、撐出欄外 */
    min-width: 0;
    min-height: 0;
}
#plan-selection-view .selection-card.promo-card .promo-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;         /* 撐滿整張卡片，左右/上下超出置中裁切 */
    object-position: center;
    border-radius: 16px;
}

.promo-card .icon {
    color: #ff9800;
}

/* 推廣卡片圖片模式 */
.promo-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    position: absolute;
    top: 0;
    left: 0;
}

.promo-card:has(.promo-card-image) {
    padding: 0;
    overflow: hidden;
    position: relative;
}

/* 圖片「完整顯示」模式（後台 image_fit=contain）：前景不裁切，底層同圖模糊補滿 */
.promo-fit-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 14px;
    pointer-events: none;
}
#plan-selection-view .promo-fit-bg { border-radius: 16px; }
.promo-fit-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(14px) saturate(1.1);
    transform: scale(1.15);
    opacity: .85;
    display: block;
}
.selection-card.promo-card .promo-card-image.is-contain,
#plan-selection-view .selection-card.promo-card .promo-card-image.is-contain {
    object-fit: contain;
    z-index: 1;
}

/* 國旗圖片樣式 - 方案 6：混合風格 */
.flag-icon-single {
    width: 4.2rem;
    height: 3.2rem;
    border-radius: 8px; /* 微圓角 */
    object-fit: cover;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.12),
        0 2px 4px rgba(0, 0, 0, 0.08),
        inset 0 -2px 8px rgba(255, 255, 255, 0.3); /* 內陰影光澤 */
    border: 2px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    position: relative;
}
/* 漸層光澤效果 */
.flag-icon-single::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
    border-radius: 6px 6px 0 0;
    pointer-events: none;
}
.selection-card:hover .flag-icon-single {
    transform: translateY(-6px) scale(1.08);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.18),
        0 6px 12px rgba(0, 0, 0, 0.12),
        inset 0 -2px 12px rgba(255, 255, 255, 0.4);
}

/* 2-3個國家：橫排顯示 */
.flag-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}
.flag-row .flag-icon-small {
    width: 3rem;
    height: 2.25rem; /* 4:3 比例 */
    border-radius: 6px;
    object-fit: cover;
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.12),
        0 1px 3px rgba(0, 0, 0, 0.08),
        inset 0 -1px 6px rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
.flag-row .flag-icon-small::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 35%;
    background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, transparent 100%);
    border-radius: 4px 4px 0 0;
    pointer-events: none;
}

/* 3-9個國家：不規則重疊平鋪（像照片牆）*/
.flag-stack {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 5rem; /* 增加高度以容納更多國旗 */
    position: relative;
    padding: 0;
    width: 5.5rem; /* 確保 badge 定位有參考寬度 */
}
/* 6+個國家：只顯示前4旗 + "+N" badge（用 ::after 不佔 nth-child）*/
.flag-stack.flag-stack-with-more::after {
    content: attr(data-more);
    position: absolute;
    bottom: 0.15rem;
    right: 0rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.1rem 0.38rem;
    border-radius: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
    z-index: 20;
    line-height: 1.5;
    letter-spacing: 0.01em;
    pointer-events: none;
}
.flag-stack .flag-icon-stacked {
    width: 2.4rem;
    height: 1.8rem; /* 4:3 比例 */
    border-radius: 4px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.95);
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.18),
        0 1px 4px rgba(0, 0, 0, 0.12),
        inset 0 -1px 6px rgba(255, 255, 255, 0.3);
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: center center;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* 漸層光澤 */
.flag-stack .flag-icon-stacked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
    border-radius: 2px 2px 0 0;
    pointer-events: none;
}

/* === 不規則平鋪排列（預設狀態）=== */

/* 3個國家：三角形散落排列 */
.flag-stack .flag-icon-stacked:nth-child(1):nth-last-child(3) {
    transform: translate(calc(-50% - 0.1rem), calc(-50% - 0.9rem)) rotate(-5deg);
    z-index: 3;
}
.flag-stack .flag-icon-stacked:nth-child(2):nth-last-child(2) {
    transform: translate(calc(-50% - 1rem), calc(-50% + 0.65rem)) rotate(4deg);
    z-index: 5;
}
.flag-stack .flag-icon-stacked:nth-child(3):nth-last-child(1) {
    transform: translate(calc(-50% + 0.95rem), calc(-50% + 0.7rem)) rotate(-3deg);
    z-index: 4;
}

/* 4個國家：2x2 不規則網格 */
.flag-stack .flag-icon-stacked:nth-child(1):nth-last-child(4) {
    transform: translate(calc(-50% - 1rem), calc(-50% - 0.6rem)) rotate(-6deg);
    z-index: 4;
}
.flag-stack .flag-icon-stacked:nth-child(2):nth-last-child(3) {
    transform: translate(calc(-50% + 0.9rem), calc(-50% - 0.7rem)) rotate(4deg);
    z-index: 5;
}
.flag-stack .flag-icon-stacked:nth-child(3):nth-last-child(2) {
    transform: translate(calc(-50% - 0.95rem), calc(-50% + 0.7rem)) rotate(3deg);
    z-index: 3;
}
.flag-stack .flag-icon-stacked:nth-child(4):nth-last-child(1) {
    transform: translate(calc(-50% + 1.05rem), calc(-50% + 0.65rem)) rotate(-5deg);
    z-index: 6;
}

/* 5個國家：十字形 + 中心 */
.flag-stack .flag-icon-stacked:nth-child(1):nth-last-child(5) {
    transform: translate(calc(-50% - 1.1rem), calc(-50% - 0.75rem)) rotate(-7deg);
    z-index: 4;
}
.flag-stack .flag-icon-stacked:nth-child(2):nth-last-child(4) {
    transform: translate(calc(-50% + 1rem), calc(-50% - 0.8rem)) rotate(5deg);
    z-index: 5;
}
.flag-stack .flag-icon-stacked:nth-child(3):nth-last-child(3) {
    transform: translate(-50%, calc(-50% + 0.1rem)) rotate(-2deg);
    z-index: 7; /* 中心層最高 */
}
.flag-stack .flag-icon-stacked:nth-child(4):nth-last-child(2) {
    transform: translate(calc(-50% - 1.05rem), calc(-50% + 0.8rem)) rotate(6deg);
    z-index: 3;
}
.flag-stack .flag-icon-stacked:nth-child(5):nth-last-child(1) {
    transform: translate(calc(-50% + 0.95rem), calc(-50% + 0.75rem)) rotate(-4deg);
    z-index: 6;
}

/* 6個國家：2x3 不規則網格 */
.flag-stack .flag-icon-stacked:nth-child(1):nth-last-child(6) {
    transform: translate(calc(-50% - 1.05rem), calc(-50% - 1.1rem)) rotate(-6deg);
    z-index: 4;
}
.flag-stack .flag-icon-stacked:nth-child(2):nth-last-child(5) {
    transform: translate(calc(-50% + 0.05rem), calc(-50% - 1.15rem)) rotate(7deg);
    z-index: 5;
}
.flag-stack .flag-icon-stacked:nth-child(3):nth-last-child(4) {
    transform: translate(calc(-50% + 1.1rem), calc(-50% - 1.05rem)) rotate(-4deg);
    z-index: 3;
}
.flag-stack .flag-icon-stacked:nth-child(4):nth-last-child(3) {
    transform: translate(calc(-50% - 1rem), calc(-50% + 0.8rem)) rotate(5deg);
    z-index: 6;
}
.flag-stack .flag-icon-stacked:nth-child(5):nth-last-child(2) {
    transform: translate(calc(-50% + 0.1rem), calc(-50% + 0.85rem)) rotate(-3deg);
    z-index: 2;
}
.flag-stack .flag-icon-stacked:nth-child(6):nth-last-child(1) {
    transform: translate(calc(-50% + 1.05rem), calc(-50% + 0.75rem)) rotate(6deg);
    z-index: 7;
}

/* 7個國家：蜂巢式排列 */
.flag-stack .flag-icon-stacked:nth-child(1):nth-last-child(7) {
    transform: translate(calc(-50% - 1.1rem), calc(-50% - 1.05rem)) rotate(-5deg);
    z-index: 5;
}
.flag-stack .flag-icon-stacked:nth-child(2):nth-last-child(6) {
    transform: translate(-50%, calc(-50% - 1.15rem)) rotate(6deg);
    z-index: 6;
}
.flag-stack .flag-icon-stacked:nth-child(3):nth-last-child(5) {
    transform: translate(calc(-50% + 1.1rem), calc(-50% - 1.1rem)) rotate(-4deg);
    z-index: 4;
}
.flag-stack .flag-icon-stacked:nth-child(4):nth-last-child(4) {
    transform: translate(calc(-50% - 0.9rem), calc(-50% + 0.05rem)) rotate(7deg);
    z-index: 7;
}
.flag-stack .flag-icon-stacked:nth-child(5):nth-last-child(3) {
    transform: translate(calc(-50% + 0.95rem), calc(-50% + 0.1rem)) rotate(-3deg);
    z-index: 3;
}
.flag-stack .flag-icon-stacked:nth-child(6):nth-last-child(2) {
    transform: translate(calc(-50% - 0.55rem), calc(-50% + 0.95rem)) rotate(5deg);
    z-index: 2;
}
.flag-stack .flag-icon-stacked:nth-child(7):nth-last-child(1) {
    transform: translate(calc(-50% + 0.6rem), calc(-50% + 1rem)) rotate(-6deg);
    z-index: 8;
}

/* 8個國家：3×3 網格（去掉中心）*/
.flag-stack .flag-icon-stacked:nth-child(1):nth-last-child(8) {
    transform: translate(calc(-50% - 1.15rem), calc(-50% - 1.1rem)) rotate(-6deg);
    z-index: 5;
}
.flag-stack .flag-icon-stacked:nth-child(2):nth-last-child(7) {
    transform: translate(-50%, calc(-50% - 1.15rem)) rotate(7deg);
    z-index: 6;
}
.flag-stack .flag-icon-stacked:nth-child(3):nth-last-child(6) {
    transform: translate(calc(-50% + 1.15rem), calc(-50% - 1.1rem)) rotate(-4deg);
    z-index: 4;
}
.flag-stack .flag-icon-stacked:nth-child(4):nth-last-child(5) {
    transform: translate(calc(-50% - 1.1rem), calc(-50% + 0.05rem)) rotate(5deg);
    z-index: 7;
}
.flag-stack .flag-icon-stacked:nth-child(5):nth-last-child(4) {
    transform: translate(calc(-50% + 1.1rem), calc(-50% + 0.05rem)) rotate(-5deg);
    z-index: 3;
}
.flag-stack .flag-icon-stacked:nth-child(6):nth-last-child(3) {
    transform: translate(calc(-50% - 1.15rem), calc(-50% + 1rem)) rotate(6deg);
    z-index: 2;
}
.flag-stack .flag-icon-stacked:nth-child(7):nth-last-child(2) {
    transform: translate(-50%, calc(-50% + 1.05rem)) rotate(-3deg);
    z-index: 8;
}
.flag-stack .flag-icon-stacked:nth-child(8):nth-last-child(1) {
    transform: translate(calc(-50% + 1.15rem), calc(-50% + 1rem)) rotate(4deg);
    z-index: 1;
}

/* 9個國家：完整 3×3 網格 */
.flag-stack .flag-icon-stacked:nth-child(1):nth-last-child(9) {
    transform: translate(calc(-50% - 1.15rem), calc(-50% - 1.15rem)) rotate(-6deg);
    z-index: 5;
}
.flag-stack .flag-icon-stacked:nth-child(2):nth-last-child(8) {
    transform: translate(-50%, calc(-50% - 1.2rem)) rotate(7deg);
    z-index: 6;
}
.flag-stack .flag-icon-stacked:nth-child(3):nth-last-child(7) {
    transform: translate(calc(-50% + 1.15rem), calc(-50% - 1.15rem)) rotate(-4deg);
    z-index: 4;
}
.flag-stack .flag-icon-stacked:nth-child(4):nth-last-child(6) {
    transform: translate(calc(-50% - 1.2rem), calc(-50% + 0.05rem)) rotate(5deg);
    z-index: 7;
}
.flag-stack .flag-icon-stacked:nth-child(5):nth-last-child(5) {
    transform: translate(-50%, calc(-50% + 0.05rem)) rotate(-2deg);
    z-index: 9;
}
.flag-stack .flag-icon-stacked:nth-child(6):nth-last-child(4) {
    transform: translate(calc(-50% + 1.2rem), calc(-50% + 0.05rem)) rotate(6deg);
    z-index: 3;
}
.flag-stack .flag-icon-stacked:nth-child(7):nth-last-child(3) {
    transform: translate(calc(-50% - 1.15rem), calc(-50% + 1.1rem)) rotate(-5deg);
    z-index: 2;
}
.flag-stack .flag-icon-stacked:nth-child(8):nth-last-child(2) {
    transform: translate(-50%, calc(-50% + 1.15rem)) rotate(4deg);
    z-index: 8;
}
.flag-stack .flag-icon-stacked:nth-child(9):nth-last-child(1) {
    transform: translate(calc(-50% + 1.15rem), calc(-50% + 1.1rem)) rotate(-3deg);
    z-index: 1;
}

/* === 懸浮時：各自輕微放大並加深陰影 === */

/* 3個國家：三角形懸浮效果 */
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(1):nth-last-child(3) {
    transform: translate(calc(-50% - 0.1rem), calc(-50% - 0.9rem)) rotate(-5deg) scale(1.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 10;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(2):nth-last-child(2) {
    transform: translate(calc(-50% - 1rem), calc(-50% + 0.65rem)) rotate(4deg) scale(1.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 11;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(3):nth-last-child(1) {
    transform: translate(calc(-50% + 0.95rem), calc(-50% + 0.7rem)) rotate(-3deg) scale(1.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 9;
}

/* 4個國家：2x2 懸浮效果 */
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(1):nth-last-child(4) {
    transform: translate(calc(-50% - 1rem), calc(-50% - 0.6rem)) rotate(-6deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 10;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(2):nth-last-child(3) {
    transform: translate(calc(-50% + 0.9rem), calc(-50% - 0.7rem)) rotate(4deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 11;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(3):nth-last-child(2) {
    transform: translate(calc(-50% - 0.95rem), calc(-50% + 0.7rem)) rotate(3deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 9;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(4):nth-last-child(1) {
    transform: translate(calc(-50% + 1.05rem), calc(-50% + 0.65rem)) rotate(-5deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 12;
}

/* 5個國家：十字形懸浮效果 */
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(1):nth-last-child(5) {
    transform: translate(calc(-50% - 1.1rem), calc(-50% - 0.75rem)) rotate(-7deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 10;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(2):nth-last-child(4) {
    transform: translate(calc(-50% + 1rem), calc(-50% - 0.8rem)) rotate(5deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 11;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(3):nth-last-child(3) {
    transform: translate(-50%, calc(-50% + 0.1rem)) rotate(-2deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 13;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(4):nth-last-child(2) {
    transform: translate(calc(-50% - 1.05rem), calc(-50% + 0.8rem)) rotate(6deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 9;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(5):nth-last-child(1) {
    transform: translate(calc(-50% + 0.95rem), calc(-50% + 0.75rem)) rotate(-4deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 12;
}

/* 6個國家：2x3 懸浮效果 */
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(1):nth-last-child(6) {
    transform: translate(calc(-50% - 1.05rem), calc(-50% - 1.1rem)) rotate(-6deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 10;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(2):nth-last-child(5) {
    transform: translate(calc(-50% + 0.05rem), calc(-50% - 1.15rem)) rotate(7deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 11;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(3):nth-last-child(4) {
    transform: translate(calc(-50% + 1.1rem), calc(-50% - 1.05rem)) rotate(-4deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 9;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(4):nth-last-child(3) {
    transform: translate(calc(-50% - 1rem), calc(-50% + 0.8rem)) rotate(5deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 12;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(5):nth-last-child(2) {
    transform: translate(calc(-50% + 0.1rem), calc(-50% + 0.85rem)) rotate(-3deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 8;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(6):nth-last-child(1) {
    transform: translate(calc(-50% + 1.05rem), calc(-50% + 0.75rem)) rotate(6deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 13;
}

/* 7個國家：蜂巢式懸浮效果 */
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(1):nth-last-child(7) {
    transform: translate(calc(-50% - 1.1rem), calc(-50% - 1.05rem)) rotate(-5deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 11;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(2):nth-last-child(6) {
    transform: translate(-50%, calc(-50% - 1.15rem)) rotate(6deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 12;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(3):nth-last-child(5) {
    transform: translate(calc(-50% + 1.1rem), calc(-50% - 1.1rem)) rotate(-4deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 10;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(4):nth-last-child(4) {
    transform: translate(calc(-50% - 0.9rem), calc(-50% + 0.05rem)) rotate(7deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 13;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(5):nth-last-child(3) {
    transform: translate(calc(-50% + 0.95rem), calc(-50% + 0.1rem)) rotate(-3deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 9;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(6):nth-last-child(2) {
    transform: translate(calc(-50% - 0.55rem), calc(-50% + 0.95rem)) rotate(5deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 8;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(7):nth-last-child(1) {
    transform: translate(calc(-50% + 0.6rem), calc(-50% + 1rem)) rotate(-6deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 14;
}

/* 8個國家：3×3 網格（去掉中心）懸浮效果 */
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(1):nth-last-child(8) {
    transform: translate(calc(-50% - 1.15rem), calc(-50% - 1.1rem)) rotate(-6deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 11;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(2):nth-last-child(7) {
    transform: translate(-50%, calc(-50% - 1.15rem)) rotate(7deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 12;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(3):nth-last-child(6) {
    transform: translate(calc(-50% + 1.15rem), calc(-50% - 1.1rem)) rotate(-4deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 10;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(4):nth-last-child(5) {
    transform: translate(calc(-50% - 1.1rem), calc(-50% + 0.05rem)) rotate(5deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 13;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(5):nth-last-child(4) {
    transform: translate(calc(-50% + 1.1rem), calc(-50% + 0.05rem)) rotate(-5deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 9;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(6):nth-last-child(3) {
    transform: translate(calc(-50% - 1.15rem), calc(-50% + 1rem)) rotate(6deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 8;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(7):nth-last-child(2) {
    transform: translate(-50%, calc(-50% + 1.05rem)) rotate(-3deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 14;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(8):nth-last-child(1) {
    transform: translate(calc(-50% + 1.15rem), calc(-50% + 1rem)) rotate(4deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 7;
}

/* 9個國家：完整 3×3 網格懸浮效果 */
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(1):nth-last-child(9) {
    transform: translate(calc(-50% - 1.15rem), calc(-50% - 1.15rem)) rotate(-6deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 11;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(2):nth-last-child(8) {
    transform: translate(-50%, calc(-50% - 1.2rem)) rotate(7deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 12;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(3):nth-last-child(7) {
    transform: translate(calc(-50% + 1.15rem), calc(-50% - 1.15rem)) rotate(-4deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 10;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(4):nth-last-child(6) {
    transform: translate(calc(-50% - 1.2rem), calc(-50% + 0.05rem)) rotate(5deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 13;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(5):nth-last-child(5) {
    transform: translate(-50%, calc(-50% + 0.05rem)) rotate(-2deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 15;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(6):nth-last-child(4) {
    transform: translate(calc(-50% + 1.2rem), calc(-50% + 0.05rem)) rotate(6deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 9;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(7):nth-last-child(3) {
    transform: translate(calc(-50% - 1.15rem), calc(-50% + 1.1rem)) rotate(-5deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 8;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(8):nth-last-child(2) {
    transform: translate(-50%, calc(-50% + 1.15rem)) rotate(4deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 14;
}
.selection-card:hover .flag-stack .flag-icon-stacked:nth-child(9):nth-last-child(1) {
    transform: translate(calc(-50% + 1.15rem), calc(-50% + 1.1rem)) rotate(-3deg) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.18);
    z-index: 7;
}

/* +N 標記已移除，所有國旗都會顯示 */

/* 2國橫排懸浮效果 */
.selection-card:hover .flag-row .flag-icon-small {
    transform: scale(1.1);
}

/* 區域圖標（多地區方案） */
.region-icon {
    font-size: 3.5rem;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
/* 歐洲區域改用代理 EU 旗 img（與各國國旗一致的方正樣式） */
.region-icon .region-flag {
    display: block;
    width: 3rem;
    height: auto;
    border-radius: 6px;
}
/* 添加漸層背景圓形 */
.icon .region-icon::before {
    content: '';
    position: absolute;
    width: 4.5rem;
    height: 4.5rem;
    background: linear-gradient(135deg, rgba(0, 115, 230, 0.1), rgba(0, 115, 230, 0.05));
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
}
.selection-card:hover .region-icon {
    transform: scale(1.15) rotate(-8deg);
}
.selection-card .name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--dark-color);
    transition: color 0.3s ease;
}
.selection-card.selected .name {
    color: var(--primary-dark);
}
.selection-card .count,
.selection-card .description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    transition: color 0.3s ease;
}
.selection-card.selected .count,
.selection-card.selected .description {
    color: var(--primary-color);
    font-weight: 500;
}
.selection-card.disabled {
    opacity: 1;
    background: #f0f2f5;
    cursor: not-allowed;
    filter: grayscale(80%);
}
.selection-card.disabled:hover {
    transform: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    border-color: var(--border-color);
}

#plan-selection-view .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
#day-selection-view .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.day-card .price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-top: 0.5rem;
}
.plan-chip {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .28rem .6rem;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .3px;
    color: #fff;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--chip1), var(--chip2));
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12), inset 0 0 0 1px rgba(255, 255, 255, .15);
    z-index: 2;
    cursor: help;
    transition: transform .2s ease, box-shadow .2s ease;
}
.plan-chip:hover,
.plan-chip:focus-visible {
    transform: translateY(-2px);
    /* 柔光暈隨角標色（native/roaming/mixed）自動變色 */
    box-shadow: 0 10px 24px rgba(0, 0, 0, .16),
                inset 0 0 0 1px rgba(255, 255, 255, .25),
                0 6px 18px -2px color-mix(in srgb, var(--chip1) 60%, transparent);
    outline: none;
}
@media (prefers-reduced-motion: reduce) {
    .plan-chip { transition: box-shadow .2s ease; }
    .plan-chip:hover,
    .plan-chip:focus-visible { transform: none; }
}
/* 靜態玻璃高光：固定的頂部光澤，無循環動畫（取代原本的無限掃光） */
.plan-chip::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, .40) 0%, rgba(255, 255, 255, .12) 42%, rgba(255, 255, 255, 0) 62%);
    pointer-events: none;
}
.plan-chip[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    z-index: 300;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    max-width: 280px;
    white-space: normal;
    background: #0b1a2c;
    color: #fff;
    border-radius: 8px;
    padding: .55rem .7rem;
    font-size: .8rem;
    line-height: 1.45;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.plan-chip[data-tooltip]:hover::before,
.plan-chip[data-tooltip]:focus::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
/* 觸控裝置改用 JS 定位的提示框：偽元素固定以膠囊為中心展開，
   最左（或最右）那一欄的卡片一定會溢出畫面外看不到。 */
@media (hover: none) {
    .plan-chip[data-tooltip]::before { display: none; }
}
.chip-tip {
    position: fixed;
    z-index: 3000;
    display: none;
    background: #0b1a2c;
    color: #fff;
    border-radius: 8px;
    padding: .55rem .7rem;
    font-size: .8rem;
    line-height: 1.45;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
    pointer-events: none;
}
.chip-tip.show { display: block; }
.plan-chip.native { --chip1: #2e74ff; --chip2: #1b57d8; }
.plan-chip.roaming { --chip1: #00b5d8; --chip2: #007ea8; }
.plan-chip.mixed { --chip1: #ffb703; --chip2: #ff8f00; }

/* 原生資源（廠商 isLocalSource=0，小卡上顯示「資源」）：沿用 .plan-chip 的尺寸與造型，維持同一系列。
   配色刻意用低飽和的淺藍灰——它是卡別之外的補充資訊，
   用飽和色會跟原生（藍）／漫遊（青）搶主角。 */
.plan-chip.localsrc { --chip1: #8fa8c8; --chip2: #6b86ab; }
/* 兩枚膠囊並排在左上角。不放右上角——那裡是「比較」按鈕的位置，會被擋住。
   容器負責定位，膠囊本身改回 relative（tooltip 偽元素還要靠它定位）。 */
.chip-stack {
    position: absolute; top: 12px; left: 12px; z-index: 2;
    display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
    max-width: calc(100% - 24px);
}
.chip-stack .plan-chip { position: relative; top: auto; left: auto; right: auto; }
/* chip-badge-row 內回歸 flow，跟其他徽章排在一起 */
.chip-badge-row > .plan-chip.localsrc { position: static; left: auto; right: auto; }

/* 天數卡（選擇使用天數）比方案卡窄很多，絕對定位的膠囊會壓在天數文字上，
   兩枚並排更明顯。這裡讓膠囊回到文件流，置中排在內容上方，卡片自然撐開。 */
.day-card > .chip-stack,
.day-card > .plan-chip {
    position: relative;
    top: auto; left: auto; right: auto;
    justify-content: center;
    max-width: 100%;
    margin: 0;
}
.day-card > .chip-stack { display: flex; }
.day-card > .plan-chip { display: inline-flex; }
/* 膠囊改成佔位後，卡片內三個元素（膠囊／天數／價格）的間距一律由 gap 控制。
   原本各自帶 margin，疊起來會在膠囊與天數之間留下一大段空白。 */
.day-card {
    padding-top: .9rem;
    gap: .45rem;
}
.day-card > .name { margin: 0; }
.day-card .price { margin-top: 0; }
#plan-selection-view .selection-card .name,
#day-selection-view .selection-card .name {
    padding-top: 1.6rem;
}
/* 天數卡的膠囊已改成佔位排版，上面那條為絕對定位膠囊預留的 padding 就成了多餘空白 */
#day-selection-view .day-card > .name { padding-top: 0; }

/* -------------------------------------------------------------------
 * 06. 方案瀏覽器 - 結果頁 (Plan Explorer - Result View)
 * ------------------------------------------------------------------- */
.view-footer,
.action-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    flex-wrap: wrap;
}
/* 統一按鈕基礎樣式 */
.view-footer button,
.action-footer button,
.share-inline button {
    padding: 0.85rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.view-footer button:hover,
.action-footer button:hover,
.share-inline button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.view-footer button:active,
.action-footer button:active,
.share-inline button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 返回按鈕 - Outline 樣式 */
.back-btn {
    background: white;
    border: 2px solid #e5e7eb !important;
    color: #6b7280;
}

.back-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db !important;
    color: #374151;
}

.result-card-makeover {
    max-width: 600px;
    margin: 0 auto;
    animation: fadeIn 0.5s;
}

.result-card-makeover.highlight-flash {
    animation: highlight-animation 1.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.result-card-makeover h2 {
    text-align: center;
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
    color: var(--primary-dark);
    position: relative;
    padding-bottom: 0.75rem;
}

.result-card-makeover h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 2px;
}

/* 統一的資訊卡片標題樣式 */
.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-title i {
    color: var(--primary-color);
    font-size: 1.15em;
}

/* 您的專屬方案 - 基本資訊列表 */
.selection-summary-list {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border: 1px solid rgba(147, 197, 253, 0.3);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.06);
    transition: all 0.3s ease;
    position: relative;
}

/* 微妙的裝飾圓圈 */
.selection-summary-list::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(147, 197, 253, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: gentleFloat 6s ease-in-out infinite;
}

.selection-summary-list::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: gentleFloat 8s ease-in-out infinite reverse;
}

/* 溫和的浮動動畫 */
@keyframes gentleFloat {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 1;
    }
    50% {
        transform: translate(-10px, -10px);
        opacity: 0.7;
    }
}

.selection-summary-list:hover {
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
    border-color: rgba(147, 197, 253, 0.5);
}

.selection-summary-list li {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.selection-summary-list li:last-child {
    border-bottom: none;
}

.selection-summary-list li:hover {
    background-color: rgba(239, 246, 255, 0.5);
    transform: translateX(2px);
}

.selection-summary-list li i {
    color: var(--primary-color);
    width: 24px;
    font-size: 1.1em;
    margin-right: 1rem;
    flex-shrink: 0;
}

.selection-summary-list li .label {
    color: #6b7280;
    margin-right: 0.75rem;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.selection-summary-list li .value {
    font-weight: 600;
    color: var(--dark-color);
    flex: 1;
}

.price-display {
    text-align: center;
    margin-bottom: 2rem;
}
.price-label {
    font-size: 1rem;
    color: var(--text-muted);
}
.price-label-coupon,
.price-label.price-label-distributor {
    color: var(--success-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.coupon-tag {
    background-color: #e9f9f4;
    color: var(--success-color);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    border: 1px solid var(--success-color);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.coupon-tag .fa-tag {
    font-size: 0.9em;
}
.pricing-method-badge {    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);    color: white;    font-size: 0.75rem;    font-weight: 600;    padding: 0.25rem 0.6rem;    border-radius: 12px;    display: inline-flex;    align-items: center;    gap: 0.3rem;    margin-left: 0.5rem;    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);    animation: shimmer 2s infinite;}.pricing-method-badge .fa-robot {    font-size: 0.9em;}@keyframes shimmer {    0%, 100% { opacity: 1; }    50% { opacity: 0.85; }}

.final-price {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1;
}
.original-price {
    font-size: 0.88rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-bottom: 0.1rem;
    line-height: 1.2;
}

.add-to-cart-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}
.quantity-selector {
    display: flex;
    align-items: center;
}
.quantity-selector button {
    background: var(--light-color);
    border: 1px solid var(--border-color);
    font-size: 1rem;
    cursor: pointer;
    height: 48px;
    width: 48px;
    border-radius: 50%;
    transition: background-color 0.2s;
}
.quantity-selector button:hover {
    background-color: #ddd;
}
.quantity-selector input {
    width: 70px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    background: transparent;
}
.add-to-cart-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    width: 100%;
    justify-content: center;
}
.add-to-cart-btn:hover {
    background-color: #1baa80;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(32, 201, 151, 0.4);
}

/* 分享圖片按鈕 - 綠色漸層 */
#share-image-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

#share-image-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

#share-image-btn i {
    font-size: 1.1em;
}

/* 分享連結按鈕 - 藍色漸層 */
#share-link-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white;
}

#share-link-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

#share-link-btn i {
    font-size: 1.1em;
}

/* 按鈕圖標動畫 */
.action-footer button i,
.share-inline button i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-footer button:hover i,
.share-inline button:hover i {
    transform: scale(1.1);
}

.back-btn:hover i {
    transform: translateX(-3px);
}

#share-image-btn:hover i,
#share-link-btn:hover i {
    transform: scale(1.15);
}

/* 按鈕 Focus 狀態 */
.action-footer button:focus,
.share-inline button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.back-btn:focus {
    box-shadow: 0 0 0 3px rgba(229, 231, 235, 0.5) !important;
}

#share-image-btn:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* 按鈕禁用狀態 */
.action-footer button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 響應式調整 - 平板 */
@media (max-width: 768px) and (min-width: 481px) {
    .action-footer {
        gap: 1rem;
    }

    .share-buttons-group {
        width: 100%;
    }

    .share-buttons-group button {
        flex: 1 1 calc(50% - 0.375rem);
        min-width: 150px !important;
    }
}

#share-image { max-width: 100%; border-radius: 8px; border: 1px solid var(--border-color); margin-bottom: 1.5rem; }
.share-qr-box { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin-bottom: 1.25rem; }
.share-qr-box canvas { max-width: 100%; height: auto; padding: 0.7rem; background: #fff; border: 1.5px dashed #b8af99; border-radius: 12px; }
.share-qr-hint { margin: 0; font-size: 0.85rem; color: #6f6a5a; }
/* ── 分享網址框（登機證票券風格）── */
.share-link-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    max-width: 100%;
    background: #fff;
    border: 1.5px dashed #b8af99;
    border-radius: 12px;
    padding: 0.35rem 0.35rem 0.35rem 0.9rem;
    transition: border-color 0.2s;
}
.share-link-wrapper:focus-within { border-color: #f26b3a; }
.share-link-wrapper input {
    flex: 1 1 auto;
    min-width: 0;              /* flex item 預設 min-width:auto，input 會撐破容器 */
    box-sizing: border-box;
    border: none;
    background: transparent;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #122744;
    text-overflow: ellipsis;
}
.share-link-wrapper input:focus { outline: none; }
.copy-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 9px;
    background: linear-gradient(118deg, #f26b3a, #d9531f);
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 8px 18px -8px rgba(242, 107, 58, 0.7);
    transition: transform 0.18s, box-shadow 0.18s, background 0.2s;
}
.copy-btn:hover { transform: translateY(-1px); box-shadow: 0 11px 22px -8px rgba(242, 107, 58, 0.8); }
.copy-btn.is-copied {
    background: linear-gradient(118deg, #1f8a5b, #15704a);
    box-shadow: 0 8px 18px -8px rgba(31, 138, 91, 0.7);
}

@media (max-width: 480px) {
    .share-link-wrapper { padding-left: 0.7rem; }
    .share-link-wrapper input { font-size: 0.9rem; }
    .copy-btn { padding: 0.6rem 0.75rem; font-size: 0.85rem; }
}

/* -------------------------------------------------------------------
 * 07. 方案瀏覽器 - 產品詳情與提示 (Plan Explorer - Details & Notices)
 * ------------------------------------------------------------------- */
/* ── 基本資訊提示條 ── */
.daily-plan-notice {
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border: 1px solid rgba(147, 197, 253, 0.4);
    border-left: 3px solid var(--primary-color);
    padding: 0.85rem 1.2rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.daily-plan-notice::before { display: none; }

.daily-plan-notice i {
    color: var(--primary-color);
    font-size: 1.05em;
    flex-shrink: 0;
    background: rgba(59, 130, 246, 0.08);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* ── 原生卡警告（舊，保留向下相容） ── */
.daily-plan-notice.native-card-warning,
.daily-plan-notice.card-type-tip { display: none !important; }

/* 購買區最上方的導引列（結果頁 .rx-block--buy）：淡藍圓角＋圖示方塊，取代舊的左側粗色條樣式 */
.rx-block--buy > .daily-plan-notice {
    margin-top: 0;                  /* 只設上下：左右交給 .rx-block > * 的 auto 置中（用 margin 簡寫會讓它靠左） */
    margin-bottom: 1.25rem;
    padding: 0.7rem 0.95rem 0.7rem 0.75rem;
    gap: 0.5rem;
    border: 1px solid rgba(147, 197, 253, 0.4);
    border-radius: 12px;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    box-shadow: none;
    color: #0f3a66;
    font-size: 0.93rem;
    font-weight: 600;
    line-height: 1.5;
}
.rx-block--buy > .daily-plan-notice i {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #e0efff;
    color: #0062c4;
    font-size: 0.9rem;
}
/* 導引列後面緊接的選擇區不再另外留大段上距 */
.rx-block--buy > .daily-plan-notice + * { margin-top: 0; }

/* 原生卡整合卡片（.native-combined-card）已移除：
   安裝時機警告與「原生 vs 漫遊」說明整併進產品詳情的「卡片類型」下方，
   見 .card-type-explain。 */

/* 實體卡裝置相容性提示卡 */
.physical-compat-card {
    background: #fffdf6;
    border: 1px solid #fcd34d;
    border-radius: 14px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 3px 12px rgba(217, 119, 6, 0.08);
}
.physical-compat-card .pc-header {
    display: flex; align-items: center; gap: 0.55rem;
    font-weight: 700; color: #92400e; font-size: 1rem; margin-bottom: 0.5rem;
}
.physical-compat-card .pc-intro {
    font-size: 0.9rem; color: #475569; line-height: 1.7; margin-bottom: 0.6rem;
}
.physical-compat-card .pc-sub {
    font-weight: 600; color: #b45309; font-size: 0.88rem; margin: 0.5rem 0 0.4rem;
    display: flex; align-items: center; gap: 0.4rem;
}
.physical-compat-card .pc-list { list-style: none; padding: 0; margin: 0 0 0.4rem; }
.physical-compat-card .pc-list li {
    display: flex; align-items: flex-start; gap: 0.5rem;
    padding: 0.3rem 0; font-size: 0.9rem; color: #334155;
}
.physical-compat-card .pc-list li i { color: #dc2626; margin-top: 0.25rem; flex-shrink: 0; }
.physical-compat-card .pc-note { color: #94a3b8; font-size: 0.85rem; }
.physical-compat-card .pc-more {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.85rem; font-weight: 600; color: var(--primary-color, #1976d2);
    text-decoration: none; margin-top: 0.3rem;
}
.physical-compat-card .pc-more:hover { text-decoration: underline; }

/* ══ 結果頁資訊摺疊區（旅遊資訊／App 使用支援性／實體卡相容性）══
   三塊同一款：底色／細框／陰影與上方「您的專屬方案」摘要（.selection-summary-list）一致，
   左側圖示方塊、標題下一行狀態說明（彩色小圓點），右側箭頭；預設收合。
   外層同時保留舊 class（.app-compatibility-notice／.physical-compat-card），內文沿用原本的子元件樣式，
   這裡把舊的卡片外框（底色、內距、陰影、標題列）歸零，統一由 .rx-panel 負責。 */
.rx-panel,
.rx-panel.app-compatibility-notice,
.rx-panel.physical-compat-card {
    --rx-line: rgba(147, 197, 253, 0.3);                      /* 同 .selection-summary-list 的框線 */
    --rx-tile: rgba(255, 255, 255, 0.75);                     /* 內層小卡：半透明白，疊在淺藍漸層上不發灰 */
    --rx-tile-line: rgba(147, 197, 253, 0.25);
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border: 1px solid var(--rx-line);
    border-radius: 12px;
    padding: 0;
    margin-top: 0;                 /* 只設上下：左右交給外層（結果頁 .rx-block 置中），用 margin 簡寫會把置中蓋掉 */
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.06);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.rx-panel.app-compatibility-notice:hover { box-shadow: 0 2px 8px rgba(59, 130, 246, 0.06); border-color: var(--rx-line); }
.rx-panel[open] { border-color: rgba(147, 197, 253, 0.5); box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1); }

.rx-panel__head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 60px;
    padding: 0.7rem 1rem;
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: background 0.18s ease;
}
.rx-panel__head::-webkit-details-marker { display: none; }
.rx-panel__head::marker { content: ''; }
@media (hover: hover) { .rx-panel__head:hover { background: rgba(224, 242, 254, 0.45); } }
.rx-panel__head:focus-visible { outline: 3px solid rgba(0, 115, 230, 0.35); outline-offset: -3px; border-radius: 14px; }

.rx-panel__ico {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #eef4ff;
    color: #0062c4;
    font-size: 1rem;
}
.rx-panel__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rx-panel__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}
.rx-panel__title .app-src-badge { margin-left: 0; }
.rx-panel__meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.45;
}
.rx-dot { flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: #3b82f6; }
.rx-dot--ok   { background: #16a34a; }
.rx-dot--warn { background: #f59e0b; }
.rx-panel__chev {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 0.85rem;
    transition: transform 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}
.rx-panel[open] .rx-panel__chev { transform: rotate(180deg); }

.rx-panel__body {
    padding: 0.95rem 1rem 1.05rem;
    border-top: 1px solid var(--rx-line);
}
/* 支援的瀏覽器（Chrome 131+）展開／收合有高度過渡；其他瀏覽器直接開關，功能不受影響 */
@supports (interpolate-size: allow-keywords) {
    .rx-panel { interpolate-size: allow-keywords; }
    .rx-panel::details-content {
        height: 0;
        overflow: clip;
        transition: height 0.3s cubic-bezier(0.23, 1, 0.32, 1), content-visibility 0.3s allow-discrete;
    }
    .rx-panel[open]::details-content { height: auto; }
}
@media (prefers-reduced-motion: reduce) {
    .rx-panel__chev { transition: none; }
    .rx-panel::details-content { transition: none; }
}

/* 內文：沿用舊子元件，但卡片外框已由 .rx-panel 提供，去掉重複的底色與邊距 */
.rx-panel.app-compatibility-notice .device-rules { background: var(--rx-tile); border-color: var(--rx-tile-line); }
.rx-panel.app-compatibility-notice .app-notes { border-top-color: var(--rx-line); }
.rx-panel.physical-compat-card .pc-intro { margin-bottom: 0.4rem; }
.rx-panel.physical-compat-card .pc-sub { margin-top: 0.2rem; }

/* 段落（旅遊資訊內的 出發前提醒／當地天氣／國家速覽） */
.rx-sec + .rx-sec { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px dashed var(--rx-line); }
.rx-sec__title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.6rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
}
.rx-sec__title > i { color: #0062c4; width: 1.1em; text-align: center; }
.rx-sec__more {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0062c4;
    text-decoration: none;
    white-space: nowrap;
}
.rx-sec__more i { font-size: 0.75em; margin-left: 2px; }
@media (hover: hover) { .rx-sec__more:hover { text-decoration: underline; } }
.rx-loading { font-size: 0.85rem; color: #94a3b8; }

/* 出發前提醒（後台「旅遊提示管理」；severity → 圖示方塊色） */
.rx-notices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.rx-notice { display: flex; gap: 0.7rem; align-items: flex-start; }
.rx-notice__ico {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    font-size: 0.85rem;
    background: #fff7e6;
    color: #b45309;
}
.rx-notice--info   .rx-notice__ico { background: #eef4ff; color: #0062c4; }
.rx-notice--danger .rx-notice__ico { background: #fef2f2; color: #b91c1c; }
.rx-notice__text { min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 0.86rem; line-height: 1.6; color: #475569; }
.rx-notice__text b { color: #0f172a; font-size: 0.9rem; }

/* 當地天氣 */
.rx-weather__now { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.6rem; }
.rx-weather__now i { color: #f59e0b; font-size: 1.15rem; align-self: center; }
.rx-weather__now b { font-size: 1.5rem; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; }
.rx-weather__now span { font-size: 0.85rem; color: #64748b; }
.rx-weather__days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.4rem; }
.rx-weather__days li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem 0.2rem;
    border-radius: 10px;
    background: var(--rx-tile);
    box-shadow: inset 0 0 0 1px var(--rx-tile-line);
    font-size: 0.78rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}
.rx-weather__days li i { color: #0ea5e9; font-size: 0.95rem; }
.rx-weather__days li b { color: #0f172a; font-size: 0.88rem; }
.rx-weather__days li small { font-size: 0.75rem; }

/* 國家速覽 */
.rx-guide__grid { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
.rx-guide__grid > div { padding: 0.55rem 0.7rem; border-radius: 10px; background: var(--rx-tile); box-shadow: inset 0 0 0 1px var(--rx-tile-line); min-width: 0; }
.rx-guide__grid dt { display: flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; color: #64748b; font-weight: 600; }
.rx-guide__grid dt i { color: #0062c4; width: 1em; text-align: center; font-size: 0.85em; }
.rx-guide__grid dd { margin: 2px 0 0; font-size: 0.88rem; font-weight: 600; color: #0f172a; line-height: 1.45; }
@media (min-width: 640px) { .rx-guide__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 480px) {
    .rx-panel__head { padding: 0.65rem 0.85rem; gap: 0.7rem; }
    .rx-panel__body { padding: 0.85rem 0.85rem 0.95rem; }
}
.product-details-card {
    margin-top: 2rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-details-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.details-header {
    padding: 1.25rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-color);
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.details-body {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.detail-item .label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.35rem;
    display: block;
}
.detail-item .value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-color);
}
.detail-item .value.badge-like {
    display: inline-block;
    padding: 0.3em 0.8em;
    border-radius: 20px;
    font-size: 0.9rem;
}
.detail-item .value.badge-native {
    background-color: #e8f0fe;
    color: #1967d2;
}
.detail-item .value.badge-roaming {
    background-color: #e6f7ff;
    color: #005f87;
}
/* 原生資源（廠商 isLocalSource=0）：與卡別徽章同尺寸，低飽和淺藍灰不搶視覺 */
.detail-item .value.badge-localsrc {
    background-color: #eaf0f7;
    color: #44618a;
    margin-left: .4rem;
}

/* 卡別 × 原生資源 的組合說明：接在「卡片類型」下方，橫跨整列 */
.card-type-explain {
    grid-column: 1 / -1;
    margin-top: -.35rem;
    font-size: .85rem;
    line-height: 1.65;
    color: var(--text-muted);
}
.card-type-explain .cte-now { color: var(--dark-color); }
.card-type-explain .cte-now i { color: var(--primary-color); margin-right: .3rem; }
/* 原生卡的安裝時機警告（由原本獨立的「原生卡重要提醒」卡片整併而來）*/
.card-type-explain .cte-warn {
    margin-top: .55rem;
    padding: .7rem .85rem;
    background: #fff8ed;
    border: 1px solid #fcd9a4;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    color: #7c4a03;
}
.card-type-explain .cte-warn-title {
    display: flex; align-items: center; gap: .4rem;
    font-weight: 700; font-size: .86rem; color: #b45309;
    margin-bottom: .25rem;
}
.card-type-explain .cte-warn-body { font-size: .82rem; line-height: 1.65; }
.card-type-explain .cte-warn-body strong { color: #92400e; }
.card-type-explain .cte-more { margin-top: .45rem; }
.card-type-explain summary {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 600;
    font-size: .82rem;
    width: fit-content;
    padding: .25rem .6rem;
    border: 1px solid rgba(0, 115, 230, .25);
    border-radius: 999px;
    background: #fff;
    transition: background .15s ease, border-color .15s ease;
    list-style: none;
}
.card-type-explain summary::-webkit-details-marker { display: none; }
.card-type-explain summary:hover { background: #eef6ff; border-color: var(--primary-color); }
.card-type-explain details[open] summary { background: #eef6ff; border-color: var(--primary-color); }
/* 展開後的說明面板 */
.card-type-explain .cte-panel {
    margin-top: .55rem;
    padding: .9rem 1rem;
    background: linear-gradient(180deg, #f8fbff 0%, #f4f8fd 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

/* 兩個標籤各自的定義 */
.card-type-explain .cte-defs { display: grid; gap: .55rem; }
.card-type-explain .cte-def {
    display: flex;
    gap: .6rem;
    padding: .65rem .75rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
.card-type-explain .cte-def > i {
    flex-shrink: 0;
    width: 26px; height: 26px;
    display: grid; place-items: center;
    border-radius: 8px;
    background: var(--primary-light, #e8f0fe);
    color: var(--primary-color);
    font-size: .78rem;
}
.card-type-explain .cte-def-body { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.card-type-explain .cte-def-body b { color: var(--dark-color); font-size: .84rem; }
.card-type-explain .cte-def-body span { font-size: .8rem; line-height: 1.6; }
.card-type-explain .cte-def-body span b { font-size: inherit; color: var(--dark-color); }

/* 四種組合對照 */
.card-type-explain .cte-combo-title {
    margin: .85rem 0 .45rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--text-muted);
}
.card-type-explain .cte-combo { display: grid; gap: .4rem; }
.card-type-explain .cte-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(120px, auto) 1fr;
    align-items: center;
    gap: .3rem .7rem;
    padding: .55rem .7rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
@media (max-width: 520px) {
    .card-type-explain .cte-row { grid-template-columns: 1fr; }
}
.card-type-explain .cte-row-tags { display: flex; flex-wrap: wrap; gap: .25rem; }
.card-type-explain .cte-row-desc { font-size: .8rem; line-height: 1.55; }

/* 目前這張卡的組合：整列打亮，右上角掛一枚標記 */
.card-type-explain .cte-row.is-current {
    background: #eef6ff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 115, 230, .10);
}
.card-type-explain .cte-flag {
    position: absolute;
    top: -.55rem; right: .6rem;
    padding: .08rem .45rem;
    border-radius: 999px;
    background: var(--primary-color);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
}

/* 組合裡的迷你標籤：配色比照卡別膠囊，但縮到說明用的尺寸 */
.card-type-explain .cte-mini {
    display: inline-block;
    padding: .1rem .45rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}
.card-type-explain .cte-mini.native  { background: #e8f0fe; color: #1967d2; }
.card-type-explain .cte-mini.roaming { background: #e6f7ff; color: #005f87; }
.card-type-explain .cte-mini.local   { background: #eaf0f7; color: #44618a; }

.roaming-reminder {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f3ff 100%);
    border: 1px solid #c7dff7;
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    margin-top: 0.1rem;
    box-shadow: 0 2px 8px rgba(0, 115, 230, 0.07);
}
.roaming-reminder-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0073e6, #005bb3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 3px 8px rgba(0, 115, 230, 0.3);
}
.roaming-reminder-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.roaming-reminder-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0055aa;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.roaming-reminder-title .fa-circle-info {
    color: #0073e6;
}
.roaming-reminder-text {
    font-size: 0.83rem;
    color: #1e3a5f;
    line-height: 1.6;
}
.roaming-reminder-text strong {
    color: #0055aa;
}

/* --- 全新美化的手風琴 (Accordion) 樣式 (已修正作用域) --- */
.product-details-card .accordion {
    grid-column: 1 / -1; /* 佔滿兩欄 */
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.product-details-card .accordion-item {
    background-color: #fafbfc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    transition: box-shadow 0.2s ease,
                border-color 0.2s ease,
                background-color 0.2s ease;
    overflow: hidden;
}

.product-details-card .accordion-item:last-child {
    margin-bottom: 0;
}

.product-details-card .accordion-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-color: #bfdbfe;
    background-color: #f8fafc;
}

.product-details-card .accordion-header {
    padding: 1rem 1.25rem;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--dark-color);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.product-details-card .accordion-header:hover {
    background-color: rgba(99, 102, 241, 0.04);
}

.product-details-card .accordion-header i {
    color: var(--primary-color);
    transition: transform 0.2s ease;
}

.product-details-card .accordion-header:hover i {
    transform: scale(1.1);
}

.product-details-card .accordion-header::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--text-muted);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
    font-size: 0.9rem;
}

.product-details-card .accordion-header.active {
    color: var(--primary-dark);
    background-color: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--primary-color);
    padding-left: calc(1.25rem - 3px);
}
.product-details-card .accordion-header.active::after {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.product-details-card .accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted);
    padding: 0 1.25rem;
    opacity: 0;
    will-change: max-height, padding, opacity;
}

.product-details-card .accordion-content.visible {
    max-height: 800px;
    opacity: 1;
}
.product-details-card .accordion-content p {
    margin: 0 0 0.75rem 0;
}

.product-details-card .accordion-content p:last-child {
    margin-bottom: 0;
}

.product-details-card .accordion-content ul {
    padding-left: 1.25rem;
    margin: 0 0 0.5rem 0;
}

.product-details-card .accordion-content ul:last-child {
    margin-bottom: 0;
}

.product-details-card .accordion-content ul li {
    margin-bottom: 0.4rem;
}

.product-details-card .accordion-content ul li:last-child {
    margin-bottom: 0;
}

.product-details-card .accordion-content br {
    display: block;
    margin-bottom: 0.5rem;
    content: "";
}

/* ── 國家 / 電信商膠囊（供應商字串解析後的呈現） ── */
.geo-block {
    padding: 0.25rem 0 0.85rem;
}

.geo-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.geo-count b {
    color: var(--primary-dark);
    font-weight: 700;
}

.geo-pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* 多行分組（「🌎歐洲：」之類）的小標 */
.geo-group-label {
    margin: 0.9rem 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.5;
}

.geo-block > .geo-group-label:first-child {
    margin-top: 0;
}

.geo-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dbeafe;
    font-size: 0.82rem;
    line-height: 1.4;
}

.geo-pill-zh {
    color: var(--dark-color);
    font-weight: 600;
}

.geo-pill-en {
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* 一體式雙段膠囊：左段國家、右段該國電信商，包在同一顆膠囊裡表達從屬關係 */
.carrier-geo-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* 每列寬度貼齊內容，不撐滿 */
    gap: 0.5rem;
}

.carrier-geo-row {
    display: inline-flex;
    align-items: stretch;
    max-width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.carrier-geo-row:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.05);
}

.cg-country {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.4rem 0.95rem;
    background: rgba(102, 126, 234, 0.09);
    flex-shrink: 0;
}

.cg-zh {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.35;
    white-space: nowrap;
}

.cg-en {
    font-size: 0.66rem;
    color: var(--text-muted);
    line-height: 1.3;
    white-space: nowrap;
}

.cg-carriers {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 0.4rem;
    padding: 0.4rem 0.95rem;
    border-left: 1px solid #e2e8f0;
    min-width: 0;
}

/* 電信商是附屬資訊：無邊框、淡底、小字，讓國家當視覺主角 */
.carrier-chip {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 5px;
    background: #f1f5f9;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    line-height: 1.5;
}

.carrier-chip.muted {
    background: none;
    padding-left: 0;
    font-weight: 400;
    font-style: italic;
    color: var(--text-muted);
}

/* 該國支援的網路世代（由電信商字串尾端的「-5G/4G」抽出），與電信商區隔開來 */
.carrier-chip-net {
    background: #eff6ff;
    color: #1d4ed8;
    letter-spacing: .02em;
}

/* 電信商後的 PLMN 網路代碼：附屬於該電信商的小字，不另成膠囊 */
.carrier-chip-plmn {
    margin-left: 0.35rem;
    font-size: 0.68rem;
    font-weight: 400;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

/* 沒有國名的殘段（廠商資料開頭就沒帶國家）：不畫左段 */
.carrier-geo-row.no-country .cg-carriers {
    border-left: none;
}

/* 命中前一步「確認方案是否涵蓋您的目的地」所輸入的國家 */
.geo-hit {
    margin-left: 0.5rem;
    color: #047857;
    font-weight: 700;
}

.geo-pill-grid .geo-pill.matched {
    background: #ecfdf5;
    border-color: #6ee7b7;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
}

.geo-pill.matched::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.6rem;
    color: #10b981;
}

.geo-pill.matched .geo-pill-zh {
    color: #047857;
}

.geo-pill.matched .geo-pill-en {
    color: #059669;
}

.carrier-geo-row.matched {
    border-color: #6ee7b7;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.16);
}

.carrier-geo-row.matched .cg-country {
    background: #d1fae5;
}

.carrier-geo-row.matched .cg-carriers {
    border-left-color: #a7f3d0;
}

.carrier-geo-row.matched .cg-zh {
    color: #065f46;
}

.carrier-geo-row.matched .cg-zh::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.62rem;
    color: #10b981;
    margin-right: 0.32rem;
}

.carrier-geo-row.matched .cg-en {
    color: #059669;
}

/* ── 重要注意事項 ── */
.tips-section {
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.08);
    animation: fadeIn 0.4s ease forwards;
}

.tips-section::before { display: none; }

.tips-section h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(90deg, #f59e0b, #f97316);
    margin: 0;
    padding: 0.75rem 1.25rem;
    letter-spacing: 0.02em;
}

.tips-section h3 i {
    font-size: 0.95rem;
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
    box-shadow: none;
    color: #fff;
    opacity: 0.9;
    animation: none;
}

.tips-section .tip-list {
    padding: 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tip-box {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid #fef3c7;
    font-size: 0.875rem;
    line-height: 1.65;
    color: #44403c;
    position: relative;
    overflow: hidden;
    background: none;
    border-left: none;
    border-radius: 0;
    margin-bottom: 0;
}

.tip-box::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f59e0b;
    flex-shrink: 0;
    margin-top: 0.55em;
}

.tip-box:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.app-compatibility-notice {
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border: 1px solid rgba(147, 197, 253, 0.3);
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.app-compatibility-notice::before { display: none; }

.app-compatibility-notice:hover {
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
    border-color: rgba(147, 197, 253, 0.5);
}

.app-compatibility-notice h3 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 0 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(147, 197, 253, 0.3);
}

/* 資料來自供應商逐商品提供的支援清單（非依電信商關鍵字推得的規則） */
.app-src-badge {
    margin-left: auto;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: .02em;
    flex-shrink: 0;
}

.app-compatibility-notice h3 i {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), #0288d1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}

.app-compatibility-notice .device-rules {
    background: rgba(239, 246, 255, 0.6);
    border: 1px solid rgba(147, 197, 253, 0.25);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 0.75rem;
}
.app-compatibility-notice .device-rules:last-of-type {
    margin-bottom: 0;
}
.app-compatibility-notice .device-rules h4 {
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0 0 0.65rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.app-compatibility-notice .device-rules h4 i {
    font-size: 1.1em;
    color: var(--primary-color);
    opacity: 0.8;
}
.app-compatibility-notice .app-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.6rem;
    padding-left: 0;
    list-style: none;
}
.app-compatibility-notice .app-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.86rem;
    color: var(--text-color);
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border: 1px solid rgba(147, 197, 253, 0.4);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
}
.app-compatibility-notice .app-item .fas {
    font-size: 0.95em;
}

.buyer-notice-card {
    background: #fffef0;
    border: 1px solid #fcebbd;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #535353;
}
.buyer-notice-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #c09853;
    margin-top: 0;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.buyer-notice-card h3:not(:first-of-type) {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed #e0d9c3;
}
.buyer-notice-card p { margin: 0 0 0.5rem 0; }
.buyer-notice-card p:last-of-type { margin-bottom: 0; }
.buyer-notice-card strong { color: var(--danger-color); font-weight: 700; }


/* -------------------------------------------------------------------
 * 10. 動畫效果 (Animations & Keyframes)
 * ------------------------------------------------------------------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pulse-icon { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
@keyframes priceFadeIn { 0% { opacity: 0; transform: scale(0.95); } 100% { opacity: 1; transform: scale(1); } }
@keyframes highlight-animation {
    0% { box-shadow: 0 0 0 0 rgba(0, 115, 230, 0.5), 0 4px 15px rgba(0, 0, 0, 0.05); border-color: var(--primary-color); }
    50% { box-shadow: 0 0 0 15px rgba(0, 115, 230, 0), 0 8px 20px rgba(0, 115, 230, 0.15); border-color: var(--primary-color); }
    100% { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); border-color: var(--border-color); }
}
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}


/* -------------------------------------------------------------------
 * 11. 響應式設計 (Responsive Design)
 * ------------------------------------------------------------------- */
@media (max-width: 992px) {
    .container {
        padding: 0 1rem;
    }
    .explorer-wrapper {
        flex-direction: column;
        gap: 1.5rem;
    }
    #explorer-sidebar {
        width: 100%;
        position: static;
    }
    #explorer-content {
        width: 100%;
    }
    .stepper {
        display: flex;
        justify-content: space-around;
        padding: 0.5rem;
    }
    .stepper li {
        flex: 1;
        text-align: center;
        font-size: 0.9rem;
        padding: 0.8rem 0.5rem;
        margin-bottom: 0;
    }
    .stepper li .step-icon {
        display: flex;
        margin: 0 auto 0.5rem auto;
    }
    #explorer-content {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    #explorer-content {
        padding: 1rem;
        border-radius: 12px;
    }
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    #plan-selection-view .grid-container,
    #day-selection-view .grid-container {
        grid-template-columns: 1fr;
    }
    .hero-banner {
        height: 280px;          /* 固定高度，所有 slide 一致 */
        min-height: unset;
        padding: 1.5rem 1rem;
    }
    /* 手機版毛玻璃膠囊縮小 */
    .hero-banner:not(.color-mode) .hero-banner-content {
        padding: 1rem 1.5rem;
        border-radius: 14px;
    }
    .hero-title {
        font-size: clamp(1.3rem, 5.5vw, 2rem);
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }
    .hero-subtitle {
        font-size: clamp(0.82rem, 3vw, 1rem);
    }
    .hero-swiper .swiper-button-prev,
    .hero-swiper .swiper-button-next {
        display: none;
    }
}

@media (max-width: 576px) {
    .page-title {
        font-size: 1.6rem;
    }
    .page-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    .stepper {
        flex-wrap: wrap;
    }
    .stepper li {
        font-size: 0.8rem;
        flex-basis: 50%;
    }
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    #plan-selection-view .grid-container {
        grid-template-columns: 1fr;
    }
    #day-selection-view .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
    .selection-card {
        padding: 1rem 0.5rem;
        min-height: 120px;
    }
    .selection-card .name {
        font-size: 0.9rem;
    }
    .action-footer {
        flex-direction: column;
        gap: 0.75rem;
    }

    .action-footer button {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
    }

    .share-buttons-group {
        width: 100%;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .share-buttons-group button {
        min-width: auto !important;
        flex: 1 1 auto !important;
    }

    .back-btn {
        order: 3;
        background: transparent !important;
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
    }

    .back-btn:hover {
        background: #f9fafb !important;
    }

    /* 響應式優化 - 資訊區塊 */
    .selection-summary-list {
        border-radius: 10px;
    }

    /* 手機版縮小背景圓圈 */
    .selection-summary-list::before {
        width: 80px;
        height: 80px;
        top: -25px;
        right: -25px;
    }

    .selection-summary-list::after {
        width: 70px;
        height: 70px;
        bottom: -20px;
        left: -20px;
    }

    /* 手機版：icon 改浮動、編輯鈕絕對定位右上，讓 label/value（尤其長「說明」）
       能環繞並流回 icon 下方，避免左側 icon 欄整條空白浪費空間 */
    .selection-summary-list li {
        display: block;
        padding: 0.85rem 2.6rem 0.85rem 1rem; /* 右側留給編輯鈕 */
    }

    .selection-summary-list li i {
        float: left;
        width: 20px;
        margin-right: 0.6rem;
        margin-top: 0.15rem;
    }

    .selection-summary-list li .label,
    .selection-summary-list li .value {
        display: inline;
    }

    .selection-summary-list li .value {
        flex: none;
    }

    .selection-summary-list li .summary-edit-btn {
        position: absolute;
        top: 0.55rem;
        right: 0.6rem;
        margin: 0;
    }

    /* 手機版的 li i 會加上 float:left 與 margin，同樣要在按鈕內部關掉，
       否則鉛筆在圓形底色裡一樣不置中 */
    .selection-summary-list li .summary-edit-btn i {
        float: none;
        width: auto;
        margin: 0;
    }

    .selection-summary-list li::after {
        content: '';
        display: block;
        clear: both;
    }

    .selection-summary-list li .label {
        font-size: 0.9rem;
    }

    .app-compatibility-notice,
    .pricing-tier-selection,
    .quantity-confirmation-section.visible {
        padding: 1.25rem;
    }

    /* tips-section 不加外層 padding，靠內部 h3/tip-list 各自控制 */
    .tips-section h3,
    .app-compatibility-notice h3 {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }
    .tips-section .tip-list {
        padding: 0.5rem 0.75rem;
    }
    .tip-box {
        font-size: 0.82rem;
        padding: 0.55rem 0;
        overflow: visible;
        line-height: 1.6;
    }

    .app-compatibility-notice .device-rules {
        padding: 0.85rem;
    }

    .result-card-makeover h2 {
        font-size: 1.5rem;
    }
    .price-display {
        padding: 1rem;
    }
    .final-price {
        font-size: 2rem;
    }
    .selection-card::after {
        --check-size: 30px;
        font-size: 14px;
    }
    #plan-selection-view .selection-card .name,
    #day-selection-view .selection-card .name {
        padding-top: 2rem;
    }
    /* 同上：天數卡的膠囊佔位，不需要再為它留空間 */
    #day-selection-view .day-card > .name { padding-top: 0; }
    .plan-chip {
        top: 8px;
        left: 8px;
        font-size: .72rem;
    }
    .plan-chip[data-tooltip]::before {
        min-width: 180px;
        max-width: 220px;
    }
    .page-header-with-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* -------------------------------------------------------------------
 * 12. 導覽麵包屑 (Breadcrumb) - Redesigned V2.0
 * ------------------------------------------------------------------- */
.breadcrumb-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    margin-top: -1rem;
}

@media (max-width: 768px) {
    .breadcrumb-container {
        margin-bottom: 1.5rem;
    }
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem; /* 換行時的垂直間距 */
    padding: 0; /* 移除垂直內邊距，因為沒有背景色 */
    margin-bottom: 1rem;
    list-style: none;
    background-color: transparent;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

/* 可點擊連結的膠囊樣式 */
.breadcrumb-item a {
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    color: #64748b;
    text-decoration: none;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* 滑鼠懸停時的膠囊效果 */
.breadcrumb-item a:hover {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

/* 目前所在頁面的樣式 - 簡潔優雅 + 動態特效 */
.breadcrumb-item.active {
    color: #3b82f6;
    font-weight: 700;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    background-size: 200% 200%;
    border: 2px solid #3b82f6;
    position: relative;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    animation: activeGlow 3s ease-in-out infinite,
               gentlePulse 2s ease-in-out infinite;
}

/* 添加流動光暈效果 */
.breadcrumb-item.active::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(59, 130, 246, 0.1) 50%,
        transparent 70%
    );
    animation: shimmer 3s linear infinite;
    pointer-events: none;
}

/* 動畫定義 */
@keyframes activeGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4),
                    0 0 20px rgba(59, 130, 246, 0.2),
                    0 2px 8px rgba(59, 130, 246, 0.15);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2),
                    0 0 30px rgba(59, 130, 246, 0.3),
                    0 4px 12px rgba(59, 130, 246, 0.25);
    }
}

@keyframes gentlePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* 分隔符箭頭樣式 - 在每個項目後面（除了最後一個） */
.breadcrumb-item:not(:last-child)::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.65rem;
    color: #cbd5e1;
    margin-left: 0.75rem; /* 只保留左邊 margin，右邊由 gap 控制 */
    opacity: 0.7;
}

/* Active 項目的勾勾圖標 - 帶動畫 */
.breadcrumb-item.active::after {
    content: '\f00c' !important;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    color: #3b82f6;
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
    position: relative;
    z-index: 1;
    animation: checkmarkFadeIn 0.6s ease-out,
               checkmarkBounce 2s ease-in-out 0.6s infinite;
}

/* 勾勾圖標動畫 */
@keyframes checkmarkFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-180deg);
    }
    100% {
        opacity: 0.9;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes checkmarkBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* 手機版響應式調整 */
@media (max-width: 576px) {
    .breadcrumb {
        gap: 0.5rem; /* 手機版縮小間距 */
    }

    .breadcrumb-item {
        font-size: 0.8rem;
    }

    .breadcrumb-item a,
    .breadcrumb-item.active {
        padding: 0.35rem 0.75rem;
        font-size: 0.78rem;
    }

    .breadcrumb-item:not(:last-child)::after {
        margin-left: 0.4rem; /* 只保留左邊 margin */
        font-size: 0.6rem;
    }

    /* 手機版 active 的勾勾圖標樣式調整 */
    .breadcrumb-item.active::after {
        font-size: 0.65rem !important;
        margin-left: 0.4rem !important;
    }

    /* 手機版簡化動畫效果 */
    .breadcrumb-item.active {
        animation: activeGlowMobile 3s ease-in-out infinite;
    }

    /* 手機版輕量化光暈動畫 */
    @keyframes activeGlowMobile {
        0%, 100% {
            box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.3),
                        0 2px 6px rgba(59, 130, 246, 0.12);
        }
        50% {
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15),
                        0 3px 8px rgba(59, 130, 246, 0.18);
        }
    }

    .breadcrumb-item a:hover {
        transform: translateY(-1px);
        box-shadow: 0 3px 8px rgba(59, 130, 246, 0.25);
    }
}

/* --- 【新增】App 支援性參考下方的提醒文字樣式 --- */
/* ── App 使用說明底部備註區 ── */
.app-notes {
    margin-top: 1rem;
    border-top: 1px solid rgba(147, 197, 253, 0.3);
    padding-top: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.app-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #64748b;
}
.app-note i {
    flex-shrink: 0;
    margin-top: 0.15em;
    font-size: 0.85em;
    color: #94a3b8;
}
.app-note-tiktok {
    color: #78350f;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
}
.app-note-tiktok i {
    color: #f59e0b;
}
.app-note-tiktok strong {
    color: #92400e;
    font-weight: 600;
}
/* 回報方案錯誤：與「返回」一致的次要按鈕（白底外框），hover 轉紅表示回報動作。
   尺寸/圓角/陰影/hover 浮起沿用 .action-footer button 基礎樣式。 */
.report-error-btn {
    background: white;
    border: 2px solid #e5e7eb !important;
    color: #6b7280;
}
.report-error-btn:hover {
    background: #fff5f5;
    border-color: var(--danger-color) !important;
    color: var(--danger-color);
}

/* =========================================
   方案比較功能 (Compare Feature)
   ========================================= */
.compare-add-btn {
    /* 移到右下角：左上角是卡別／資源膠囊的位置，擺在右上角會互相擠壓 */
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    padding: 0.22rem 0.6rem 0.22rem 0.5rem;
    border-radius: 20px;
    border: 1.5px solid rgba(99,102,241,0.25);
    background: rgba(255,255,255,0.93);
    backdrop-filter: blur(6px);
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: all .18s ease;
    z-index: 2;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 0 0 0 rgba(99,102,241,0);
}
/* 方案卡（有比較按鈕的那層）底部留出按鈕的高度，避免壓到「N 種天數可選」 */
.selection-card[data-plan] { padding-bottom: 2.75rem; }
.compare-add-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99,102,241,0.32);
}
.compare-add-btn.in-compare {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 10px rgba(99,102,241,0.28);
}
.compare-add-btn.in-compare:hover {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 4px 14px rgba(220,38,38,0.32);
}
.compare-add-btn.maxed {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    border-color: var(--border-color);
    color: var(--text-muted);
    background: rgba(255,255,255,0.7);
}
.compare-detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    color: var(--primary-color);
    background: transparent;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all .2s;
}
.compare-detail-btn:hover { background: var(--primary-color); color: #fff; }
.compare-detail-btn.in-compare { background: var(--primary-color); color: #fff; }
.compare-detail-btn.in-compare:hover { background: #dc2626; border-color: #dc2626; }
/* 底部比較 Bar */
.compare-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 2px solid var(--primary-color);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
    z-index: 9992; /* 高於購物車 FAB (9990)，低於 AI widget (9999) */
    padding: 0.65rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.compare-bar.visible { transform: translateY(0); }
.compare-bar.panel-open { transform: translateY(100%) !important; }
.compare-bar-slots { display: flex; gap: 0.5rem; flex: 1; min-width: 0; overflow: hidden; }
.compare-slot {
    flex: 1;
    max-width: 200px;
    min-height: 48px;
    border: 1.5px dashed var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    position: relative;
    background: var(--bg-secondary);
    gap: 0.4rem;
    min-width: 0;
}
.compare-slot.filled { border-style: solid; border-color: var(--primary-color); background: #eff6ff; color: var(--text-primary); }
.compare-slot-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; font-size: 0.75rem; }
.compare-slot-remove {
    width: 18px; height: 18px; border-radius: 50%;
    border: none; background: #94a3b8; color: #fff;
    cursor: pointer; font-size: 0.55rem; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0; padding: 0;
}
.compare-slot-remove:hover { background: #dc2626; }
.compare-bar-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.compare-start-btn {
    padding: 0.45rem 1.1rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}
.compare-start-btn:hover:not(:disabled) { background: #0062cc; }
.compare-start-btn:disabled { background: #94a3b8; cursor: not-allowed; }
.compare-clear-btn {
    padding: 0.45rem 0.75rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.compare-clear-btn:hover { background: var(--bg-secondary); }
.compare-clear-btn:active { background: #fee2e2; border-color: #fca5a5; color: #dc2626; transform: scale(0.96); }
/* 比較面板 */
.compare-panel-overlay {
    position: fixed; inset: 0;
    z-index: var(--ov-z-panel, 10200);   /* 全站浮層層級表：蓋過頁首、手機底部導覽列與 AI 浮鈕 */
    display: none; /* 預設完全移出渲染，避免 GPU layer 滾動閃爍 */
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
}
/* .show：僅負責 display（在動畫前後保持 flex） */
.compare-panel-overlay.show { display: flex; }
/* .open：負責動畫狀態（backdrop + panel 滑入）*/
.compare-panel-overlay.open { pointer-events: all; }
.compare-panel-backdrop {
    position: absolute; inset: 0;
    background: var(--ov-scrim, rgba(15,23,42,.5));
    opacity: 0;
    transition: opacity .3s;
}
.compare-panel-overlay.open .compare-panel-backdrop { opacity: 1; }
.compare-panel {
    position: relative;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}
.compare-panel-overlay.open .compare-panel { transform: translateY(0); }
.compare-panel-header {
    display: flex; align-items: center;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; gap: 0.75rem;
}
.compare-panel-header h3 { margin: 0; font-size: 1rem; font-weight: 700; flex: 1; }
.compare-panel-close {
    width: 32px; height: 32px; border-radius: 50%;
    border: none; background: var(--bg-secondary);
    color: var(--text-muted); cursor: pointer; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.compare-panel-close:hover { background: #fee2e2; color: #dc2626; }
.compare-panel-body { overflow: auto; flex: 1; padding-bottom: 1.5rem; min-height: 0; }
/* 比較表格 */
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
    vertical-align: middle;
}
.compare-table th:first-child, .compare-table td:first-child {
    font-size: 0.75rem; color: var(--text-muted); font-weight: 600;
    width: 86px; min-width: 86px;
    position: sticky; left: 0; background: #fff; z-index: 2;
    border-right: 1px solid var(--border-color);
}
.compare-col-header { text-align: center; min-width: 140px; }
.compare-col-header .col-plan-name { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); line-height: 1.3; margin-bottom: 0.25rem; }
.compare-col-header .col-remove-btn {
    font-size: 1rem; color: #dc2626; cursor: pointer;
    background: none; border: none; padding: 0;
    display: inline-flex; align-items: center;
    opacity: 0.7; transition: opacity .15s;
}
.compare-col-header .col-remove-btn:hover { opacity: 1; }
.compare-day-stepper { display: flex; align-items: center; gap: 0.3rem; justify-content: center; margin-top: 0.35rem; }
.compare-day-stepper button {
    width: 22px; height: 22px; border-radius: 50%;
    border: 1px solid var(--border-color); background: #fff;
    cursor: pointer; font-size: 0.65rem;
    display: flex; align-items: center; justify-content: center; padding: 0; transition: all .15s;
}
.compare-day-stepper button:hover { border-color: var(--primary-color); color: var(--primary-color); }
.compare-day-stepper input {
    width: 38px; text-align: center;
    border: 1px solid var(--border-color); border-radius: 6px;
    font-size: 0.82rem; padding: 0.1rem 0; font-family: inherit;
}
.compare-cell { text-align: center; font-size: 0.85rem; word-break: break-word; white-space: normal; }
.compare-cell .price-main { font-size: 1rem; font-weight: 700; color: var(--primary-color); }
.compare-cell .price-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }
.compare-cell .badge-native { background: #dcfce7; color: #166534; padding: 0.15rem 0.5rem; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.compare-cell .badge-roaming { background: #dbeafe; color: #1e40af; padding: 0.15rem 0.5rem; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.compare-cell .badge-localsrc { background: #eaf0f7; color: #44618a; padding: 0.15rem 0.5rem; border-radius: 12px; font-size: 0.75rem; font-weight: 600; margin-left: .25rem; }
.compare-row-diff td:not(:first-child) { background: #fef9c3; }
.compare-loading { text-align: center; color: var(--text-muted); font-size: 0.82rem; }
/* 注意事項列 */
.compare-row-wide td:first-child { vertical-align: top; padding-top: 0.85rem; white-space: nowrap; }
.compare-row-wide .compare-cell { vertical-align: top; }
.cmp-tips-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.cmp-tips-list li {
    font-size: 0.78rem;
    line-height: 1.55;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 3px solid #f59e0b;
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    white-space: normal;
    word-break: break-word;
}
/* 業者欄位摺疊（手機版） */
.cmp-carrier-wrap { display: flex; flex-direction: column; gap: 0.45rem; }
.cmp-carrier-text { word-break: break-word; line-height: 1.5; font-size: 0.82rem; }
.cmp-carrier-toggle {
    display: none; /* 電腦版不顯示 */
    align-self: flex-start;
    font-size: 0.72rem;
    color: var(--primary-color);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    cursor: pointer;
    padding: 0.22rem 0.65rem 0.22rem 0.55rem;
    font-family: inherit;
    font-weight: 600;
    gap: 0.3rem;
    align-items: center;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
.cmp-carrier-toggle:hover { background: #dbeafe; border-color: var(--primary-color); }
.cmp-carrier-toggle .cmp-toggle-icon {
    display: inline-block;
    transition: transform .25s;
    font-style: normal;
}
.cmp-carrier-toggle.expanded .cmp-toggle-icon { transform: rotate(180deg); }
@media (max-width: 640px) {
    .cmp-carrier-text.collapsed {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .cmp-carrier-toggle { display: inline-flex; }
}
.compare-col-empty {
    background: var(--bg-secondary);
    border: 1.5px dashed var(--border-color) !important;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400 !important;
    min-width: 140px;
}
.compare-variant-select {
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    background: #fff;
    font-family: inherit;
    max-width: 120px;
}
/* 手機版比較角標 FAB */
.compare-mobile-fab {
    display: none; /* 預設隱藏，JS 控制 */
    position: fixed;
    right: 12px;
    bottom: 245px; /* 在 AI FAB(175px+60px) 之上 */
    z-index: 1010;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
}
.compare-mobile-fab.visible { display: flex; }

/* 觸發按鈕 */
.compare-fab-trigger {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1rem 0.55rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(79,70,229,0.45), 0 2px 6px rgba(0,0,0,0.15);
    white-space: nowrap;
    font-family: inherit;
    letter-spacing: 0.02em;
    transition: transform .15s ease, box-shadow .15s ease;
    position: relative;
}
.compare-fab-trigger:hover {
    box-shadow: 0 8px 24px rgba(79,70,229,0.55), 0 2px 8px rgba(0,0,0,0.18);
    transform: translateY(-1px);
}
.compare-fab-trigger:active { transform: scale(0.94); box-shadow: 0 3px 10px rgba(79,70,229,0.35); }

/* 數字角標 */
.compare-fab-badge {
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    font-size: 0.68rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(239,68,68,0.5);
    border: 1.5px solid rgba(255,255,255,0.6);
    transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
.compare-fab-badge.bump { animation: cmpBadgeBump .3s cubic-bezier(.34,1.56,.64,1); }
@keyframes cmpBadgeBump {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* 展開抽屜 */
.compare-fab-drawer {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(99,102,241,0.12);
    padding: 0;
    width: 240px;
    display: none;
    flex-direction: column;
    transform-origin: bottom right;
    animation: cmpDrawerIn 0.22s cubic-bezier(.34,1.56,.64,1);
    overflow: hidden;
}
.compare-fab-drawer.open { display: flex; }
@keyframes cmpDrawerIn {
    from { opacity: 0; transform: scale(0.88) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* 抽屜頂部標題區 */
.compare-fab-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem 0.5rem;
    background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(79,70,229,0.04) 100%);
    border-bottom: 1px solid rgba(99,102,241,0.1);
}
.compare-fab-drawer-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #4f46e5;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.compare-fab-drawer-title i { font-size: 0.7rem; }

/* 方案列表區 */
.compare-fab-drawer-slots {
    padding: 0.5rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.compare-fab-drawer-slot {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    min-height: 32px;
    border-radius: 8px;
    padding: 0.3rem 0.5rem;
    background: rgba(241,245,249,0.6);
    border: 1px dashed #e2e8f0;
    transition: all .15s;
}
.compare-fab-drawer-slot.filled {
    color: var(--text-primary);
    font-weight: 600;
    background: rgba(238,242,255,0.8);
    border: 1px solid rgba(99,102,241,0.2);
}
.compare-fab-slot-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #e2e8f0;
    flex-shrink: 0;
    transition: background .15s;
}
.compare-fab-drawer-slot.filled .compare-fab-slot-dot { background: #6366f1; }
.compare-fab-drawer-slot-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.76rem; }
.compare-fab-drawer-remove {
    width: 20px; height: 20px; border-radius: 50%;
    border: none; background: #fee2e2; color: #ef4444;
    cursor: pointer; font-size: 0.6rem;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0;
    transition: background .15s, transform .1s;
}
.compare-fab-drawer-remove:hover { background: #ef4444; color: #fff; transform: scale(1.15); }

/* 操作按鈕區 */
.compare-fab-drawer-actions {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem 0.7rem;
    border-top: 1px solid rgba(99,102,241,0.08);
    background: rgba(249,250,251,0.6);
}
.compare-fab-start {
    flex: 1;
    padding: 0.5rem 0.6rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.02em;
    box-shadow: 0 3px 10px rgba(79,70,229,0.3);
    transition: opacity .15s, transform .1s;
}
.compare-fab-start:hover { opacity: 0.92; transform: translateY(-1px); }
.compare-fab-start:active { transform: scale(0.96); }
.compare-fab-start:disabled {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
    transform: none;
}
.compare-fab-clear {
    padding: 0.5rem 0.7rem;
    background: transparent;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.78rem;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}
.compare-fab-clear:hover { border-color: #ef4444; color: #ef4444; background: #fff1f2; }
@media (min-width: 641px) {
    .compare-mobile-fab { display: none !important; }
}
@media (max-width: 640px) {
    .compare-bar { display: none !important; }
    .compare-mobile-fab { display: none; /* 由 JS 控制 visible class */ }
    .compare-panel { max-height: 88vh; border-radius: 16px 16px 0 0; }
    .compare-table th:first-child, .compare-table td:first-child { width: 68px; min-width: 68px; font-size: 0.7rem; }
    .compare-col-header { min-width: 110px; }
}

/* =========================================
   AI 懸浮對話框與氣泡提示樣式 (Integrate V3.1)
   ========================================= */

/* 1. 懸浮按鈕 (FAB) */
.ai-fab-btn {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 60px;
    height: 60px;
    /* 藍色系純色（不用漸層），與首頁的浮動購物車鈕同一套配色 */
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    border: 1px solid #1d4ed8;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
    font-size: 1.75rem;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, bottom 0.3s ease;
}

.ai-fab-btn:hover {
    transform: scale(1.1);
    background: #1d4ed8;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.36);
}

.ai-fab-btn.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* 回到頂部／到底部按鈕（到底部只在手機版顯示） */
#plans-back-top,
#plans-back-bottom {
    position: fixed;
    bottom: 30px;
    right: 25px;
    /* 尺寸與字級對齊首頁的置頂鈕（.fab-btn 是 3.5rem / 1.25rem），
       否則同一顆箭頭在兩頁看起來一大一小、粗細也不同 */
    width: 3.5rem;
    height: 3.5rem;
    /* 藍色系純色。回到頂部是輔助操作，比照首頁的置頂鈕降一階：
       淺藍底＋藍字，不跟旁邊的 AI 主鈕搶視覺 */
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 50%;
    border: 1px solid #bfdbfe;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.16);
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, bottom 0.3s ease;
}
/* 比較列顯示時，右下角浮動按鈕整組上移，避免互相遮擋（保持原本間距） */
body.cmp-bar-active #plans-back-top { bottom: 90px; }
body.cmp-bar-active .ai-fab-btn { bottom: 160px; }
/* 電腦／平板：置頂、AI 已收進右下角快捷 Dock（includes/cart_widget.php .cw-dock），比較列出現時整條上移 */
body.cmp-bar-active .cw-dock { bottom: 90px; }
/* 比較面板開啟時，隱藏右下角浮鈕（避免蓋住面板） */
body.cmp-panel-open #plans-back-top,
body.cmp-panel-open #plans-back-bottom,
body.cmp-panel-open .ai-fab-btn,
body.cmp-panel-open .cw-dock {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden;
}
#plans-back-top.show,
#plans-back-bottom.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#plans-back-top:hover,
#plans-back-bottom:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.22);
    transform: translateY(-2px);
}
#plans-back-bottom { display: none; }
@media (max-width: 600px) {
    /* 手機版：置頂＋置底兩顆疊在底部 bar（.cw-bar-wrap，bottom 20px）上方，
       高度控制在比較角標 FAB（bottom 245px）以下，三者不重疊 */
    #plans-back-top,
    #plans-back-bottom {
        display: flex;
        right: 12px;
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.05rem;
    }
    #plans-back-bottom { bottom: calc(92px + env(safe-area-inset-bottom)); }
    #plans-back-top    { bottom: calc(92px + 2.75rem + 10px + env(safe-area-inset-bottom)); }
}

@media (max-width: 600px) {
    /* 手機版改用底部 bar，隱藏圓形 FAB */
    .ai-fab-btn { display: none !important; }

    /* Tooltip：定位在底部 bar 上方，由 JS 動態對齊旅遊萬事通按鈕 */
    #ai-fab-tooltip {
        bottom: calc(68px + env(safe-area-inset-bottom));
        left: var(--mobile-tooltip-left, 1rem);
        right: auto;
        font-size: 0.82rem;
        padding: 8px 14px;
        transform: translateY(-6px) scale(0.95);
        white-space: normal;
        max-width: 240px;
    }
    #ai-fab-tooltip.show {
        transform: translateY(0) scale(1);
    }
    /* 箭頭改朝下，水平位置由 JS 動態設定 */
    #ai-fab-tooltip::after {
        top: auto;
        bottom: -6px;
        right: auto;
        left: var(--mobile-tooltip-arrow, 1.5rem);
        transform: none;
        border-width: 8px 6px 0 6px;
        border-color: #ffffff transparent transparent transparent;
        filter: drop-shadow(0 2px 1px rgba(0,0,0,0.05));
    }
}

/* 2. AI 呼喚氣泡提示 (Tooltip) - 位置修正版 */
.ai-fab-tooltip {
    position: fixed;
    /* --- 電腦版氣泡位置修正 (垂直置中) --- */
    /* 算法：按鈕bottom(100) + 按鈕高(60)/2 - 氣泡高(約44)/2 */
    bottom: 108px;
    right: 95px;  /* 按鈕right(25) + 按鈕寬(60) + 間距(10) */
    /* ---------------------------------- */
    background-color: #ffffff;
    color: #334155;
    padding: 10px 16px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    /* 初始狀態向左偏移一點，製造滑入效果 */
    transform: translateX(10px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    border: 1px solid #f1f5f9;
}

/* 電腦版：氣泡的小箭頭 (指向右方) */
.ai-fab-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    border-width: 6px 0 6px 8px;
    border-style: solid;
    border-color: transparent transparent transparent #ffffff;
    filter: drop-shadow(2px 0 1px rgba(0,0,0,0.05));
}

/* 顯示狀態 (通用) */
.ai-fab-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

/* 3. 聊天視窗容器 (Widget) */
.ai-widget-container {
    position: fixed;
    bottom: 100px; /* 對齊按鈕 */
    right: 25px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid #e2e8f0;
}
.ai-widget-container.active {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

/* 4. 視窗頭部 */
.ai-widget-header {
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.ai-widget-title {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ai-widget-close {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}
.ai-widget-close:hover { color: white; }

/* 5. 聊天內容區 */
.ai-gated-area {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.ai-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    overflow: hidden;
    position: relative;
}
.ai-history {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    scroll-behavior: smooth;
}
.ai-message {
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    max-width: 88%;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}
.ai-message.user {
    background: #3b82f6;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 2px;
}
.ai-message.ai {
    background: #f1f5f9;
    color: #334155;
    margin-right: auto;
    border-bottom-left-radius: 2px;
    border: 1px solid #cbd5e1;
    box-shadow: none;
    position: relative;
}
.ai-message.ai::before {
    content: ''; position: absolute; z-index: 0; top: -50px; left: -50px;
    right: -50px; bottom: -50px;
    background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.08), transparent 50%),
                radial-gradient(circle at 80% 85%, rgba(34, 197, 94, 0.06), transparent 45%);
    filter: blur(40px);
}
.ai-input-area {
    padding: 0.8rem;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.ai-input-field {
    flex: 1;
    min-width: 0; /* 讓輸入框可正常壓縮，避免送出鈕被擠出右邊被切掉 */
    border: 1px solid #e2e8f0;
    background-color: #f8fafc; /* ★ 新增：淺灰背景，讓輸入框顯現出來 */
    color: #0f172a;           /* ★ 新增：深色文字，確保對比度 */
    border-radius: 20px;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;     /* 改為 all，讓背景色切換也有動畫 */
}

/* 聚焦時變回純白，增加層次感 */
.ai-input-field:focus {
    background-color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.ai-send-btn, .ai-tool-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.ai-send-btn:hover { background: #2563eb; }
.ai-tool-btn { background: #f1f5f9; color: #64748b; }
.ai-tool-btn:hover { background: #e2e8f0; color: #334155; }
.ai-tool-btn.hidden { display: none !important; }

/* 載入動畫 */
.ai-typing span {
    display: inline-block; width: 5px; height: 5px;
    background: #94a3b8; border-radius: 50%;
    margin: 0 2px; animation: typing 1.4s infinite ease-in-out both;
}
.ai-typing span:nth-child(1){ animation-delay: -0.32s; }
.ai-typing span:nth-child(2){ animation-delay: -0.16s; }
@keyframes typing { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* 新增：AI 免責聲明文字 */
.ai-disclaimer {
    font-size: 0.7rem;
    color: #94a3b8; /* 淺灰色 */
    text-align: center;
    padding: 4px 12px 8px; /* 上 左右 下 */
    background: #fff;
    line-height: 1.4;
}

/* Markdown 樣式微調 */
.ai-message p { margin: 0 0 0.5em; }
.ai-message ul { padding-left: 1.2em; margin-bottom: 0.5em; }
.ai-message a { color: inherit; text-decoration: underline; }

/* 6. 手機版 RWD 修正 */
@media (max-width: 576px) {
    .ai-widget-container {
        bottom: 0; right: 0; width: 100%;
        height: 100dvh; /* Dynamic Viewport Height */
        max-height: 100%; border-radius: 0;
        z-index: 10000; /* 蓋過所有東西 */
    }

    /* 全螢幕模式下，輸入列加上左右安全區間距，避免送出鈕貼到曲面螢幕邊緣 */
    .ai-input-area {
        padding-left: calc(0.8rem + env(safe-area-inset-left));
        padding-right: calc(0.8rem + env(safe-area-inset-right));
    }
    
    /* 手機版按鈕位置微調 */
    .ai-fab-btn { 
        bottom: 90px; 
        right: 20px; 
    }

    /* 手機版氣泡：改為顯示在按鈕「正上方」 */
    .ai-fab-tooltip {
        /* 水平對齊按鈕右側 */
        right: 20px; 
        /* 垂直位置：按鈕bottom(90) + 按鈕高(60) + 間距(12) */
        bottom: 162px; 
        
        /* 手機版動畫改為由下往上浮出 */
        transform: translateY(10px) scale(0.95);
    }
    
    .ai-fab-tooltip.show {
        transform: translateY(0) scale(1);
    }

    /* 手機版箭頭：改為指向「下方」且對齊按鈕中心 */
    .ai-fab-tooltip::after {
        top: 100%;      /* 移到氣泡底部 */
        right: 22px;    /* (按鈕寬60 / 2) - (箭頭寬12 / 2) ≈ 22px 從右邊算起 */
        transform: none;
        border-width: 8px 6px 0 6px; /* 繪製向下三角形 */
        border-color: #ffffff transparent transparent transparent;
        filter: drop-shadow(0 2px 1px rgba(0,0,0,0.05));
    }
}

/* =========================================
   AI 推薦產品列表與卡片美化 (V6.0)
   ========================================= */

/* 1. 列表容器 (橫向捲動區) */
.ai-product-list {
    display: flex;
    gap: 16px; /* 卡片間距 */
    overflow-x: auto;
    padding: 10px 4px 25px 4px; /* 下方預留空間給陰影與捲軸 */
    scroll-behavior: smooth;
    /* 讓滑動有吸附感 (像 App 一樣) */
    scroll-snap-type: x mandatory; 
    -webkit-overflow-scrolling: touch;
}

/* 2. 產品卡片本體 */
.ai-product-card {
    text-decoration: none;
    min-width: 220px;
    max-width: 220px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    
    /* 陰影與過渡效果 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    flex-shrink: 0;
    scroll-snap-align: start; /* 滑動對齊 */
    position: relative;
    overflow: hidden;
}

/* 卡片懸浮互動 */
.ai-product-card:hover {
    transform: translateY(-5px); /* 上浮 */
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: var(--primary); /* 邊框變色 */
}

/* 3. 卡片內部元素 */
.ai-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ai-card-tag {
    background: #eff6ff;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 99px;
    letter-spacing: 0.5px;
}

.ai-card-sub {
    font-size: 0.75rem;
    color: #94a3b8;
}

.ai-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.5;
    margin-bottom: 12px;
    height: 3em; /* 固定兩行高度 */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ai-card-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ef4444; /* 價格強調色 */
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 4. 「查看更多」卡片 */
.ai-product-card.more {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    color: #64748b;
}
.ai-product-card.more:hover {
    background: #fff;
    border-color: var(--primary);
    color: var(--primary);
}
.ai-more-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
    transition: transform 0.3s ease;
}
.ai-product-card.more:hover .ai-more-icon {
    transform: translateX(5px);
}

/* 5. 美化橫向捲軸 (Scrollbar) */
.ai-product-list::-webkit-scrollbar {
    height: 8px; /* 捲軸高度 */
}

.ai-product-list::-webkit-scrollbar-track {
    background: #f1f5f9; 
    border-radius: 4px;
}

.ai-product-list::-webkit-scrollbar-thumb {
    background-color: #cbd5e1; /* 捲軸本體顏色 */
    border-radius: 4px;
    border: 2px solid #f1f5f9; /* 創造懸浮感 */
}

.ai-product-list::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8; /* 懸停時變深 */
}

/* --- AI Chat Markdown 樣式補充 (plans.php) --- */
.ai-message h1, .ai-message h2, .ai-message h3 { 
    font-size: 1.1em; 
    font-weight: 700; 
    margin: 0.5em 0 0.3em; 
    color: #1e293b; 
}
.ai-message ul, .ai-message ol { 
    margin: 0.5em 0; 
    padding-left: 1.5em; 
}
.ai-message li { 
    margin-bottom: 0.3em; 
}
.ai-message p { 
    margin-bottom: 0.6em; 
}
.ai-message p:last-child { 
    margin-bottom: 0; 
}
.ai-message strong { 
    font-weight: 700; 
    color: #0f172a; 
}
.ai-message blockquote {
    border-left: 3px solid #cbd5e1;
    padding-left: 10px;
    color: #64748b;
    font-style: italic;
    margin: 0.5em 0;
}
.ai-message code {
    background: #f1f5f9;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

/* -------------------------------------------------------------------
 * 價格階梯選擇區塊樣式 (Pricing Tier Selection)
 * ------------------------------------------------------------------- */
.pricing-tier-selection {
    margin: 2rem 0;
    padding: 1.75rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border-radius: 16px;
    border: 1px solid rgba(147, 197, 253, 0.3);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.08);
}

/* 標題列 - 與 qty-section-header 同風格 */
.pricing-tier-section-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(147, 197, 253, 0.3);
}
.pricing-tier-section-header .tier-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #1565c0, #0288d1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.85rem; flex-shrink: 0;
}
.pricing-tier-section-header .tier-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark-color);
}
.pricing-tier-section-header .tier-subtitle {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.pricing-tier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 0.75rem;
}

.pricing-tier-card {
    background: linear-gradient(160deg, #f8fbff 0%, #ffffff 100%);
    border: 1.5px solid rgba(147, 197, 253, 0.35);
    border-radius: 16px;
    padding: 1.1rem 0.9rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

/* 推薦卡：品牌藍→天藍的漸層細框（padding-box 底色＋border-box 漸層）＋淡藍浮起陰影，取代原本的橘框與頂部橘色細條 */
.pricing-tier-card.recommended {
    border-color: transparent;
    background:
        linear-gradient(160deg, #f5faff 0%, #ffffff 100%) padding-box,
        linear-gradient(135deg, #0073e6 0%, #38bdf8 100%) border-box;
    box-shadow: 0 10px 24px -14px rgba(0, 115, 230, 0.55);
}

.pricing-tier-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(21, 101, 192, 0.15);
    border-color: var(--primary-color);
}

.pricing-tier-card.recommended:hover {
    border-color: transparent;
    box-shadow: 0 12px 26px -12px rgba(0, 115, 230, 0.55);
}

.pricing-tier-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(160deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 6px 24px rgba(21, 101, 192, 0.2);
}
/* ══ 天數卡片「指標追蹤發光邊框」══
   改寫自 CodePen「Colored, Glowing Edges」by simeydotme（MIT），配色改品牌藍系、適合白底。
   ::after：邊框上的藍系漸層（只留邊框一圈，再用朝滑鼠方向的圓錐遮罩切出亮的那一側）
   .tier-glow：外圍光暈（同樣朝滑鼠方向）
   亮度隨 --tg-d（靠近邊緣程度，plans.js setupTierGlow 設定）增加；滑鼠離開淡出。觸控裝置不觸發。 */
.pricing-tier-card {
    --tg-a: 45deg;
    --tg-d: 0;
    overflow: visible;                 /* 讓光暈畫到卡片外 */
    isolation: isolate;
}
.pricing-tier-card::after,
.tier-glow {
    position: absolute;
    border-radius: inherit;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
}
.pricing-tier-card::after {
    content: '';
    inset: -1.5px;
    z-index: 1;
    border: 1.5px solid transparent;
    background:
        radial-gradient(at 80% 55%, hsl(199 100% 58%) 0, transparent 55%) border-box,
        radial-gradient(at 15% 15%, hsl(216 100% 58%) 0, transparent 55%) border-box,
        radial-gradient(at 50% 100%, hsl(172 75% 50%) 0, transparent 55%) border-box,
        radial-gradient(at 90% 5%, hsl(190 100% 62%) 0, transparent 55%) border-box,
        linear-gradient(hsl(207 100% 62%) 0 0) border-box;
    -webkit-mask:
        conic-gradient(from var(--tg-a) at center, #000 25%, transparent 40%, transparent 60%, #000 75%) border-box,
        linear-gradient(#000 0 0) padding-box,
        linear-gradient(#000 0 0) border-box;
    -webkit-mask-composite: source-in, xor;
            mask:
        conic-gradient(from var(--tg-a) at center, #000 25%, transparent 40%, transparent 60%, #000 75%) border-box intersect,
        linear-gradient(#000 0 0) padding-box exclude,
        linear-gradient(#000 0 0) border-box;
    opacity: calc((var(--tg-d) - 35) / 65);
}
.tier-glow {
    inset: -18px;
    z-index: 0;
    -webkit-mask-image: conic-gradient(from var(--tg-a) at center, #000 2.5%, transparent 12%, transparent 88%, #000 97.5%);
            mask-image: conic-gradient(from var(--tg-a) at center, #000 2.5%, transparent 12%, transparent 88%, #000 97.5%);
    opacity: calc((var(--tg-d) - 30) / 70);
}
.tier-glow::before {
    content: '';
    position: absolute;
    inset: 18px;
    border-radius: inherit;
    box-shadow:
        inset 0 0 0 1px hsl(205 100% 60% / 0.9),
        inset 0 0 6px 0 hsl(205 100% 60% / 0.35),
        inset 0 0 18px 0 hsl(205 100% 60% / 0.18),
        0 0 2px 0 hsl(205 100% 60% / 0.7),
        0 0 8px 0 hsl(205 100% 60% / 0.45),
        0 0 18px 2px hsl(205 100% 60% / 0.25);
}
/* 滑鼠不在卡片上：光淡出（較慢，收得比較柔） */
.pricing-tier-card:not(:hover)::after,
.pricing-tier-card:not(:hover) > .tier-glow { opacity: 0; transition: opacity 0.6s ease; }
/* 內容要蓋在光暈之上 */
.pricing-tier-card > :not(.tier-glow) { position: relative; z-index: 2; }
.pricing-tier-card > .tier-savings,
.pricing-tier-card > .tier-recommend-tag { position: absolute; z-index: 3; }
@media (hover: none), (prefers-reduced-motion: reduce) {
    .pricing-tier-card::after, .tier-glow { display: none; }
}

/* ── 同一效果套用到「選擇目的地」國家卡、「選擇類型」卡、「挑選方案」小卡片 ──
   這張卡的 ::before（上次查看標籤）與 ::after（選中打勾）已有用途，改用兩個 span：.gx-edge 邊框亮光、.gx-halo 外圍光暈。
   卡片 isolation 建立疊放層，兩個 span 用 z-index:-1 → 畫在卡片底色之上、所有內容（標籤、比較鈕、名稱）之下，不必動內容的定位。 */
#plan-selection-view .selection-card[data-plan],
.selection-card[data-country],
.selection-card[data-type] { --tg-a: 45deg; --tg-d: 0; isolation: isolate; }
.selection-card.disabled > .gx-edge,
.selection-card.disabled > .gx-halo { display: none; }   /* 不可選的類型卡不發光，免得看起來能點 */
.gx-edge,
.gx-halo {
    position: absolute;
    border-radius: inherit;
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.25s ease-out;
}
.gx-edge {
    inset: -1px;
    border: 1.5px solid transparent;
    background:
        radial-gradient(at 80% 55%, hsl(199 100% 58%) 0, transparent 55%) border-box,
        radial-gradient(at 15% 15%, hsl(216 100% 58%) 0, transparent 55%) border-box,
        radial-gradient(at 50% 100%, hsl(172 75% 50%) 0, transparent 55%) border-box,
        radial-gradient(at 90% 5%, hsl(190 100% 62%) 0, transparent 55%) border-box,
        linear-gradient(hsl(207 100% 62%) 0 0) border-box;
    -webkit-mask:
        conic-gradient(from var(--tg-a) at center, #000 25%, transparent 40%, transparent 60%, #000 75%) border-box,
        linear-gradient(#000 0 0) padding-box,
        linear-gradient(#000 0 0) border-box;
    -webkit-mask-composite: source-in, xor;
            mask:
        conic-gradient(from var(--tg-a) at center, #000 25%, transparent 40%, transparent 60%, #000 75%) border-box intersect,
        linear-gradient(#000 0 0) padding-box exclude,
        linear-gradient(#000 0 0) border-box;
    opacity: calc((var(--tg-d) - 35) / 65);
}
.gx-halo {
    inset: -18px;
    -webkit-mask-image: conic-gradient(from var(--tg-a) at center, #000 2.5%, transparent 12%, transparent 88%, #000 97.5%);
            mask-image: conic-gradient(from var(--tg-a) at center, #000 2.5%, transparent 12%, transparent 88%, #000 97.5%);
    opacity: calc((var(--tg-d) - 30) / 70);
}
.gx-halo::before {
    content: '';
    position: absolute;
    inset: 18px;
    border-radius: inherit;
    box-shadow:
        inset 0 0 0 1px hsl(205 100% 60% / 0.9),
        inset 0 0 6px 0 hsl(205 100% 60% / 0.35),
        inset 0 0 18px 0 hsl(205 100% 60% / 0.18),
        0 0 2px 0 hsl(205 100% 60% / 0.7),
        0 0 8px 0 hsl(205 100% 60% / 0.45),
        0 0 18px 2px hsl(205 100% 60% / 0.25);
}
.selection-card:not(:hover) > .gx-edge,
.selection-card:not(:hover) > .gx-halo { opacity: 0; transition: opacity 0.6s ease; }
@media (hover: none), (prefers-reduced-motion: reduce) {
    .gx-edge, .gx-halo { display: none; }
}

/* 推薦卡被選中：保留漸層框，底色換成選中的淡藍 */
.pricing-tier-card.recommended.selected {
    border-color: transparent;
    background:
        linear-gradient(160deg, #eff6ff 0%, #dbeafe 100%) padding-box,
        linear-gradient(135deg, #0073e6 0%, #38bdf8 100%) border-box;
}

/* 推薦小 pill 標籤（卡片內） */
/* 「推薦」徽章：懸掛在卡片左上角、跨在邊框上（同方案卡「上次查看」的作法），
   不佔卡片內容的行高，推薦卡內容才會跟其他卡片對齊 */
.tier-recommend-tag {
    position: absolute;
    top: -11px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--primary-color, #0073e6);
    color: #fff;
    border: 2px solid #fff;          /* 白邊把徽章從卡片框線上「切」出來 */
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.4;
    padding: 0.12rem 0.6rem 0.12rem 0.5rem;
    border-radius: 999px;
    margin: 0;
    letter-spacing: 0.06em;
    white-space: nowrap;
    box-shadow: 0 4px 10px -4px rgba(0, 115, 230, 0.7);
    pointer-events: none;
}
.tier-recommend-tag i { font-size: 0.62rem; color: #fde68a; }   /* 星星留一點暖色點綴 */

/* 每日均價小標 */
.tier-per-day-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.2rem;
}

/* 每日均價主數字 */
.tier-per-day-price {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1.1;
    margin-bottom: 0.7rem;
}

/* 分隔線 */
.tier-divider {
    width: 100%;
    height: 1px;
    background: #e8ecf0;
    margin-bottom: 0.65rem;
}

/* 天數 pill */
.tier-days-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.6rem;
}
.tier-days-pill i { font-size: 0.72rem; color: var(--primary-color); }
.pricing-tier-card.selected .tier-days-pill {
    background: rgba(21, 101, 192, 0.12);
    color: var(--primary-color);
}

/* 總價範圍（小字） */
.tier-total-price {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.3;
}

/* 原價刪除線 */
.tier-original-price {
    font-size: 0.72rem;
    color: #9ca3af;
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    margin-bottom: 0.15rem;
}

/* 折扣後總價 */
.tier-discount-price {
    font-size: 0.8rem;
    font-weight: 700;
    color: #16a34a;
}

/* 省X% - 右上角標籤 */
.tier-savings {
    position: absolute;
    top: -1.5px;
    right: -1.5px;
    background: linear-gradient(135deg, #22c55e, #15803d);
    color: white;
    padding: 0.18rem 0.5rem;
    border-radius: 0 16px 0 10px;      /* 對齊卡片外圓角（卡片已不裁切溢出，讓發光能畫到外面） */
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.5;
    pointer-events: none;
}

/* -------------------------------------------------------------------
 * 增強版數量確認區樣式 (Enhanced Quantity Confirmation)
 * ------------------------------------------------------------------- */
.quantity-confirmation-section {
    margin: 2rem 0;
    padding: 0;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border-radius: 16px;
    border: 1px solid rgba(147, 197, 253, 0.3);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.08);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

.quantity-confirmation-section.visible {
    opacity: 1;
    max-height: 1000px;
    padding: 1.75rem;
}

/* 標題列 */
.qty-section-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(147, 197, 253, 0.3);
}
.qty-section-header .qty-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #1565c0, #0288d1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.qty-section-header .qty-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* 數量選擇列 */
.quantity-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1.5rem;
}
.quantity-label-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* Stepper pill 軌道 */
.quantity-stepper {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border: 1.5px solid rgba(147, 197, 253, 0.5);
    border-radius: 999px;
    padding: 5px;
    gap: 0;
}

.enhanced-quantity-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.enhanced-quantity-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.06);
    box-shadow: 0 4px 14px rgba(21, 101, 192, 0.35);
}

.enhanced-quantity-btn:active {
    transform: scale(0.94);
}

.enhanced-quantity-input {
    width: 90px;
    height: 50px;
    text-align: center;
    font-size: 1.65rem;
    font-weight: 800;
    border: none;
    background: transparent;
    color: var(--dark-color);
    outline: none;
    -moz-appearance: textfield;
}
.enhanced-quantity-input::-webkit-inner-spin-button,
.enhanced-quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.live-price-feedback {
    background: linear-gradient(135deg, #0d1b4b 0%, #1565c0 60%, #0288d1 100%);
    padding: 1.75rem 1.75rem 1.5rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(13, 71, 161, 0.35);
    text-align: center;
}
.live-price-feedback::before {
    content: '';
    position: absolute;
    top: -55px; right: -55px;
    width: 190px; height: 190px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    pointer-events: none;
}
.live-price-feedback::after {
    content: '';
    position: absolute;
    bottom: -45px; left: -35px;
    width: 150px; height: 150px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}
/* 智能定價角落記號 */
.smart-pricing-badge {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.62rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #e0f2fe;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.smart-pricing-badge i { font-size: 0.72rem; color: inherit; }
/* 流量重置說明：時區對照 */
.reset-policy-text { line-height: 1.7; padding-top: 0.25rem; }
.reset-tz-compare {
    margin-top: 0.9rem;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    border-top: 1px dashed var(--border-color, #e2e8f0);
}
.reset-tz-caption {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.55rem;
}
.reset-tz-caption i { color: #0ea5e9; }
.reset-tz-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.reset-tz-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.78rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid transparent;
}
.reset-tz-chip i { font-size: 0.75rem; }
.reset-tz-chip.slow { background: #fffbeb; color: #b45309; border-color: rgba(245,158,11,0.35); }
.reset-tz-chip.fast { background: #eff6ff; color: #1d4ed8; border-color: rgba(59,130,246,0.35); }
.reset-tz-chip.same { background: #f1f5f9; color: #475569; border-color: rgba(100,116,139,0.3); }
.reset-tz-chip b { font-weight: 800; }
.reset-tz-plain {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.7rem;
    padding: 0.6rem 0.8rem;
    background: #f0f9ff;
    border: 1px solid rgba(14,165,233,0.2);
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.65;
    color: #0c4a6e;
}
.reset-tz-plain i { color: #f59e0b; margin-top: 0.15rem; flex-shrink: 0; }
.reset-tz-plain b { color: #0369a1; font-weight: 700; }
.price-card-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 0.4rem;
}
.live-total-price {
    font-size: 3.2rem;
    font-weight: 900;
    color: #ffffff;
    text-align: center;
    margin-bottom: 0;
    line-height: 1;
    letter-spacing: -1px;
    text-shadow: 0 2px 16px rgba(0,0,0,0.2);
    position: relative;
}
.price-card-divider {
    height: 1px;
    background: rgba(255,255,255,0.16);
    margin: 1rem 0 0.9rem;
    position: relative;
}
.live-per-day-price {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.38rem 1rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255,255,255,0.92);
    backdrop-filter: blur(4px);
    position: relative;
}
.live-savings {
    margin-top: 0.85rem;
    text-align: center;
    font-size: 0.85rem;
    color: #ffd740;
    font-weight: 700;
    position: relative;
}

.enhanced-add-to-cart-btn {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    border: none;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
    animation: cartGlow 2.5s ease-in-out infinite;
}
@keyframes cartGlow {
    0%, 100% { box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3); }
    50%       { box-shadow: 0 4px 28px rgba(34, 197, 94, 0.6), 0 0 0 6px rgba(34, 197, 94, 0.08); }
}

.enhanced-add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.4);
}

.enhanced-add-to-cart-btn:active {
    transform: translateY(0);
}

/* -------------------------------------------------------------------
 * 可摺疊區塊樣式 (Collapsible Sections)
 * ------------------------------------------------------------------- */
.collapsible-section {
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: white;
}

.collapsible-header {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--light-color);
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    transition: var(--transition);
    text-align: left;
}

.collapsible-header:hover {
    background: #e9ecef;
}

.collapsible-header i:first-child {
    margin-right: 0.75rem;
    color: var(--primary-color);
}

.toggle-icon {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.collapsible-header[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-content.visible {
    max-height: 3000px;
    padding: 1.5rem;
}

/* -------------------------------------------------------------------
 * 電信訊號比較區塊 (Carrier Signal Comparison)
 * ------------------------------------------------------------------- */
.carrier-compare-section,
.pd-card {
    --cs-blue: #0062c4;
    --cs-line: rgba(147, 197, 253, 0.35);
    border-color: var(--cs-line);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.06);
}
.carrier-compare-section:hover,
.pd-card:hover { box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1); }

/* 標題列：同結果頁摺疊區的語言（淡藍圖示方塊＋標題＋一行副標） */
.carrier-compare-section .cs-head,
.pd-card .cs-head {
    padding: 1rem 1.25rem;
    gap: 0.8rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border-bottom: 1px solid var(--cs-line);
}
.cs-head__ico {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #eef4ff;
    color: var(--cs-blue);
    font-size: 1rem;
}
.cs-head__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cs-head__title { font-size: 1.05rem; font-weight: 700; color: #0f172a; line-height: 1.3; }
.cs-head__sub { font-size: 0.8rem; font-weight: 500; color: #64748b; }
/* 摺疊（<details>，預設 open；電信訊號參考與產品詳情共用）：summary 去掉瀏覽器預設三角形，右側箭頭；收合時標題列下緣不留線 */
.carrier-compare-section > summary,
.pd-card > summary { list-style: none; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.carrier-compare-section > summary::-webkit-details-marker,
.pd-card > summary::-webkit-details-marker { display: none; }
.carrier-compare-section > summary::marker,
.pd-card > summary::marker { content: ''; }
.carrier-compare-section > summary:focus-visible,
.pd-card > summary:focus-visible { outline: 3px solid rgba(0, 115, 230, 0.35); outline-offset: -3px; }
.carrier-compare-section:not([open]) > .cs-head,
.pd-card:not([open]) > .cs-head { border-bottom-color: transparent; }
.cs-head__chev {
    flex: 0 0 auto;
    margin-left: auto;
    color: #94a3b8;
    font-size: 0.85rem;
    transition: transform 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}
.carrier-compare-section[open] .cs-head__chev,
.pd-card[open] > summary .cs-head__chev { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) {
    .carrier-compare-section > summary:hover .cs-head__chev,
    .pd-card > summary:hover .cs-head__chev { color: #0062c4; }
}
.carrier-header-hint + .cs-head__chev { margin-left: 0; }
.carrier-header-hint {
    margin-left: auto;
    flex: 0 0 auto;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

#carrier-content { padding: 1.25rem; }

.carrier-loading {
    text-align: center;
    padding: 1rem 0;
    color: #94a3b8;
    font-size: 0.875rem;
}

/* 國家切換膠囊 */
.carrier-tab-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px dashed var(--cs-line);
}
.carrier-tab-wrap.scrollable {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.6rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.carrier-tab-btn {
    padding: 0.38rem 0.9rem;
    border: 1px solid #dbe5f1;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
@media (hover: hover) and (pointer: fine) {
    .carrier-tab-btn:hover { border-color: #93c5fd; color: var(--cs-blue); }
}
.carrier-tab-btn.active { background: var(--primary-color, #0073e6); border-color: var(--primary-color, #0073e6); color: #fff; }
.carrier-tab-btn:focus-visible { outline: 3px solid rgba(0, 115, 230, 0.35); outline-offset: 2px; }
.carrier-tab-search-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #64748b;
}
.carrier-tab-search-btn.active { background: #eef4ff; border-color: #93c5fd; color: var(--cs-blue); }

.carrier-inline-search { margin-bottom: 1rem; animation: fadeSlideDown 0.18s cubic-bezier(0.23, 1, 0.32, 1) both; }
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

/* 搜尋國家 */
.carrier-search-wrap { position: relative; margin-bottom: 1rem; }
.carrier-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    border: 1px solid #dbe5f1;
    border-radius: 12px;
    background: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.carrier-search-input:focus { border-color: var(--primary-color, #0073e6); box-shadow: 0 0 0 3px rgba(0, 115, 230, 0.12); }
.carrier-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}
.carrier-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dbe5f1;
    border-radius: 12px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 200;
    display: none;
    padding: 0.3rem;
    box-shadow: 0 12px 28px -12px rgba(15, 23, 42, 0.25);
}
.carrier-search-dropdown.visible { display: block; }
.carrier-search-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.carrier-search-option:hover { background: #f0f7ff; color: var(--cs-blue); }

/* 電信卡片：每家一張 */
.carrier-cards-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.carrier-card {
    padding: 1rem 1.05rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
}
.carrier-card.is-top { border-color: #93c5fd; background: linear-gradient(135deg, #f5faff 0%, #ffffff 70%); }
.carrier-card-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem 0.55rem;
    margin-bottom: 0.85rem;
}
.carrier-name { font-size: 1.02rem; font-weight: 700; color: #0f172a; }
.cs-top {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    background: #fff4e0;
    color: #b45309;
    font-size: 0.72rem;
    font-weight: 700;
}
.cs-top i { font-size: 0.7rem; }
.carrier-net-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.carrier-net-tag {
    padding: 0.12rem 0.5rem;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.carrier-net-tag.is-5g { background: #0062c4; color: #fff; }
.carrier-net-tag.is-4g { background: #e0efff; color: #0062c4; }
.cs-avg {
    margin-left: auto;
    font-size: 0.78rem;
    color: #64748b;
    white-space: nowrap;
}
.cs-avg b { font-size: 1.05rem; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; }

/* 四項指標：2×2，每項一列「圖示＋名稱 … 訊號格 分數」 */
.carrier-scores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem 1.1rem; }
.cs-metric {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    border-radius: 10px;
    background: #f8fafc;
}
.cs-metric__label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.84rem; font-weight: 600; color: #475569; }
.cs-metric__label i { color: var(--cs-blue); font-size: 0.8rem; width: 1em; text-align: center; }
.cs-metric__val { font-size: 0.9rem; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; min-width: 2.1em; text-align: right; }
.cs-metric__val small { font-size: 0.68rem; font-weight: 600; color: #94a3b8; }

/* 訊號格：5 根由矮到高的直條（同手機訊號圖示），亮的根數＝分數 */
.cs-sig { margin-left: auto; display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; }
.cs-sig i { width: 5px; border-radius: 1.5px; background: #dbe5f1; }
.cs-sig i:nth-child(1) { height: 32%; }
.cs-sig i:nth-child(2) { height: 49%; }
.cs-sig i:nth-child(3) { height: 66%; }
.cs-sig i:nth-child(4) { height: 83%; }
.cs-sig i:nth-child(5) { height: 100%; }
.cs-sig i.on {
    background: var(--primary-color, #0073e6);
    transform-origin: bottom center;
    animation: csSigIn 380ms cubic-bezier(0.23, 1, 0.32, 1) both;
    animation-delay: calc(var(--n, 1) * 45ms);      /* 由矮到高依序長出 */
}
@keyframes csSigIn {
    from { transform: scaleY(0.15); opacity: 0.35; }
    to   { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .cs-sig i.on { animation: none; }
    .cs-head__chev { transition: none; }
}

.carrier-summary {
    position: relative;
    margin-top: 0.9rem;
    padding: 0.7rem 0.85rem 0.7rem 2.1rem;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.84rem;
    line-height: 1.65;
}
.carrier-summary > i { position: absolute; left: 0.8rem; top: 0.85rem; color: #93c5fd; font-size: 0.8rem; }

.carrier-no-data {
    text-align: center;
    padding: 1rem 0;
    color: #94a3b8;
    font-size: 0.875rem;
}

/* ══ 產品詳情（.pd-card）══
   標題列與摺疊沿用 .cs-head（同電信訊號參考）；內文改單欄：卡片類型 → 說明 → 上網小提醒 → 展開項目清單。
   展開項目由頁面共用的點擊處理切換 .accordion-header.active／.accordion-content.visible（class 名稱不可改）。 */
.pd-card .details-body { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.25rem; }
.pd-card .detail-item { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.pd-card .detail-item .label { display: inline; margin: 0 0.25rem 0 0; font-size: 0.85rem; font-weight: 600; color: #64748b; }
.pd-card .detail-item .value.badge-like { padding: 0.22em 0.75em; font-size: 0.84rem; }
.pd-card .card-type-explain { margin-top: -0.35rem; }

/* 上網小提醒：圖示改成與其他區塊一致的淡藍方塊 */
.pd-card .roaming-reminder {
    margin: 0;
    padding: 0.8rem 0.95rem;
    gap: 0.8rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border: 1px solid var(--cs-line);
    border-radius: 12px;
    box-shadow: none;
}
.pd-card .roaming-reminder-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eef4ff;
    color: var(--cs-blue);
    box-shadow: none;
    font-size: 0.95rem;
}

/* 展開項目：原生 <details class="pd-acc">（plans.js accordionShell），整組是一張白卡、項目間細分隔線。
   標題列：圖示方塊 → 標題 → 右側內容預覽（收合時看得到重點，展開後隱藏）→ 箭頭。
   內容：白底、左側對齊標題文字；支援的瀏覽器有高度過渡（同 .rx-panel）。 */
details.pd-card .accordion {
    margin: 0.2rem 0 0;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}
.pd-acc + .pd-acc { border-top: 1px solid #eef2f7; }
.pd-acc__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 56px;
    padding: 0.6rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.18s ease;
}
.pd-acc__head::-webkit-details-marker { display: none; }
.pd-acc__head::marker { content: ''; }
.pd-acc__head:focus-visible { outline: 3px solid rgba(0, 115, 230, 0.35); outline-offset: -3px; }
@media (hover: hover) and (pointer: fine) {
    .pd-acc__head:hover { background: #f8fbff; }
}
.pd-acc__ico {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #eef4ff;
    color: var(--cs-blue, #0062c4);
    font-size: 0.85rem;
    transition: background-color 0.18s ease, color 0.18s ease;
}
.pd-acc__title { flex: 0 0 auto; font-size: 0.95rem; font-weight: 600; color: #1e293b; }
.pd-acc__peek {
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
    font-size: 0.85rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pd-acc__chev { flex: 0 0 auto; color: #94a3b8; font-size: 0.8rem; transition: transform 0.25s cubic-bezier(0.23, 1, 0.32, 1), color 0.18s ease; }
.pd-acc[open] > .pd-acc__head .pd-acc__ico { background: var(--primary-color, #0073e6); color: #fff; }
.pd-acc[open] > .pd-acc__head .pd-acc__peek { visibility: hidden; }
.pd-acc[open] > .pd-acc__head .pd-acc__chev { transform: rotate(180deg); color: var(--cs-blue, #0062c4); }
.pd-acc__body {
    padding: 0.2rem 1rem 1rem calc(1rem + 32px + 0.75rem);   /* 內容框左緣對齊標題文字 */
    font-size: 0.9rem;
    line-height: 1.75;
    color: #475569;
}
/* 展開內容框：淡藍底圓角，讓展開的內容自成一塊（框內小元件用白底） */
.pd-acc__well {
    padding: 0.85rem 0.95rem;
    border: 1px solid #e1ebf7;
    border-radius: 12px;
    background: linear-gradient(135deg, #f3f8ff 0%, #f8fbff 100%);
}
/* 內容框已經有內距：國家／電信商清單（.geo-block，舊版展開樣式留的底部內距）與最後一個元素的下外距歸零，
   否則框底會多出一塊空白（詳細覆蓋國家／主要合作電信商） */
.pd-acc__well .geo-block { padding: 0; }
.pd-acc__well > :last-child,
.pd-acc__well .geo-block > :last-child { margin-bottom: 0; }
@supports (interpolate-size: allow-keywords) {
    .pd-acc { interpolate-size: allow-keywords; }
    .pd-acc::details-content {
        height: 0;
        overflow: clip;
        transition: height 0.3s cubic-bezier(0.23, 1, 0.32, 1), content-visibility 0.3s allow-discrete;
    }
    .pd-acc[open]::details-content { height: auto; }
}

/* 展開內容的元件（renderCarrierSimple／renderNetworkPills／renderApnRows；其餘純文字 .pd-plain） */
.pd-plain {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.8;
}
.pd-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pd-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid #dbe6f4;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 700;
}
.pd-chip i { color: var(--cs-blue, #0062c4); font-size: 0.85rem; }
.pd-net {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.95rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.pd-net.is-5g { background: #0062c4; color: #fff; }
.pd-net.is-4g { background: #e0efff; color: #0062c4; }

.pd-kv { display: grid; gap: 0.45rem; }
.pd-kv__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.55rem 0.55rem 0.9rem;
    border: 1px solid #dbe6f4;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.pd-kv__k { flex: 0 0 5.2em; font-size: 0.8rem; font-weight: 700; color: #64748b; }
.pd-kv__v {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    background: none;
    padding: 0;
}
.pd-copy {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.7rem;
    border: 1px solid #c9dcf5;
    border-radius: 8px;
    background: #f5f9ff;
    color: var(--cs-blue, #0062c4);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s cubic-bezier(0.23, 1, 0.32, 1);
}
@media (hover: hover) and (pointer: fine) {
    .pd-copy:hover { background: #e6f0ff; border-color: #93c5fd; }
}
.pd-copy:active { transform: scale(0.95); }
.pd-copy:focus-visible { outline: 3px solid rgba(0, 115, 230, 0.35); outline-offset: 2px; }
.pd-copy.is-done { background: #ecfdf3; border-color: #86efac; color: #15803d; }

/* 網路類型說明 */
.pd-netbox__top { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.55rem; }
.pd-netbox__k { font-size: 0.85rem; font-weight: 700; color: #64748b; }
.pd-netbox__gen { font-size: 1.3rem; font-weight: 800; line-height: 1; color: var(--cs-blue, #0062c4); letter-spacing: 0.02em; }   /* 不加底框，直接用大號藍字 */
.pd-netbox__list { list-style: none; margin: 0 0 0.55rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
.pd-netbox__list li { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; font-weight: 600; color: #1e293b; }
.pd-netbox__list i { color: #16a34a; font-size: 0.9rem; }
.pd-netbox__hint {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin: 0;
    padding-top: 0.55rem;
    border-top: 1px dashed #d6e3f3;
    font-size: 0.82rem;
    line-height: 1.6;
    color: #64748b;
}
.pd-netbox__hint i { color: #93c5fd; margin-top: 0.3em; font-size: 0.8rem; }
.pd-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.65rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cs-blue, #0062c4);
    text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
    .pd-link:hover { text-decoration: underline; }
}
@media (max-width: 576px) {
    .pd-card .details-body { padding: 1rem 0.85rem; }
    .pd-acc__head { padding: 0.55rem 0.8rem; gap: 0.6rem; }
    .pd-acc__title { font-size: 0.92rem; }
    .pd-acc__peek { font-size: 0.8rem; }
    .pd-acc__body { padding: 0.15rem 0.8rem 0.9rem; }
    .pd-acc__well { padding: 0.75rem 0.8rem; }       /* 手機寬度不足，內容不再縮排對齊標題 */
    /* APN 設定列：名稱獨立一行，值與複製鈕在下一行，長網址不會被硬斷 */
    .pd-kv__row { flex-wrap: wrap; row-gap: 0.25rem; padding: 0.55rem 0.6rem 0.6rem 0.8rem; }
    .pd-kv__k { flex: 1 0 100%; font-size: 0.75rem; }
    .pd-kv__v { overflow-wrap: break-word; }
}
@media (prefers-reduced-motion: reduce) {
    .pd-acc__chev, .pd-acc__head, .pd-acc__ico { transition: none; }
    .pd-acc::details-content { transition: none; }
}
@media (max-width: 576px) {
    .carrier-compare-section .cs-head,
    .pd-card .cs-head { padding: 0.85rem 0.95rem; }
    .cs-head__sub { display: none; }
    #carrier-content { padding: 1rem 0.85rem; }
    .carrier-card { padding: 0.9rem 0.85rem; }
    .carrier-scores { gap: 0.45rem 0.5rem; }
    .cs-metric { gap: 0.45rem; padding: 0.45rem 0.55rem; }
}

/* -------------------------------------------------------------------
 * 響應式設計 (Responsive Design)
 * ------------------------------------------------------------------- */
@media (max-width: 576px) {
    .pricing-tier-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .enhanced-quantity-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .enhanced-quantity-input {
        width: 64px;
        height: 44px;
        font-size: 1.3rem;
    }

    .live-price-feedback {
        padding: 1.25rem 1rem 1rem;
        border-radius: 14px;
        margin-bottom: 1rem;
    }

    .fs-result-hint {
        margin-bottom: 1rem;
        padding: .6rem .75rem;
        font-size: .85rem;
    }

    .live-total-price {
        font-size: 2.2rem;
        letter-spacing: -0.5px;
    }

    .live-per-day-price {
        font-size: 0.82rem;
        padding: 0.3rem 0.75rem;
    }

    .enhanced-add-to-cart-btn {
        padding: 0.9rem 1rem;
        font-size: 1.05rem;
    }

    .quantity-confirmation-section.visible {
        padding: 1.25rem 1rem;
    }

    .qty-section-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .qty-section-header .qty-title {
        font-size: 0.95rem;
    }

    .quantity-row {
        margin-bottom: 1rem;
    }

    .quantity-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .quantity-controls label {
        text-align: center;
    }

    /* 國家篩選器手機版 */
    .country-filter-input-row {
        gap: 0.4rem;
    }

    .btn-filter-add,
    .btn-filter-clear {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }

    /* 結果卡片手機版 */
    .result-card-makeover {
        padding: 0.5rem 0;
    }

    .product-details-card {
        border-radius: 10px;
        margin-top: 1.25rem;
    }

    .details-body {
        padding: 1rem;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .product-details-card .accordion {
        padding-top: 1rem;
        margin-top: 0.75rem;
    }

    .product-details-card .accordion-header {
        padding: 0.85rem 1rem;
        font-size: 0.9rem;
    }

    .product-details-card .accordion-content > div {
        padding: 0.75rem 1rem;
        font-size: 0.88rem;
        line-height: 1.65;
    }

    .geo-pill {
        padding: 0.28rem 0.6rem;
        font-size: 0.78rem;
    }

    .cg-country,
    .cg-carriers {
        padding: 0.35rem 0.7rem;
    }

    .cg-zh {
        font-size: 0.8rem;
    }

    /* 窄螢幕：國名允許斷行，長名稱不會把電信商擠到看不見 */
    .cg-zh,
    .cg-en {
        white-space: normal;
    }

    .carrier-chip {
        font-size: 0.72rem;
    }

    /* 注意事項和 App 相容性區塊 */
    .daily-plan-notice {
        padding: 0.85rem 1rem;
        font-size: 0.88rem;
    }
}
    #reading-progress{position:fixed;top:0;left:0;height:4px;width:0;background:linear-gradient(90deg,#1d4ed8 0%,#3b82f6 55%,#93c5fd 85%,rgba(147,197,253,0) 100%);z-index:3000;transition:width .1s linear}

/* ── 方案列表：三大分類上方的「流量試算」導引（assets/js/plans.js 產生 .data-calc-link）──
 * 用琥珀色與三大分類（藍／玫瑰／青綠）區隔，看得出不是第四種方案；圓角與陰影沿用分類卡語彙。
 * （原本用紫色，跟每日重置的藍色太接近） */
.data-calc-link {
    --dcl1: #d97706;
    --dcl2: #b45309;
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--dcl1) 22%, transparent);
    background:
        radial-gradient(320px 160px at 100% 0%, color-mix(in srgb, var(--dcl1) 14%, transparent) 0%, transparent 70%),
        linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
    box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--dcl1) 55%, transparent);
    transition: transform .3s cubic-bezier(.22,.61,.36,1), box-shadow .3s ease, border-color .3s ease;
}
/* 滑過時一道斜向光澤掃過 */
.data-calc-link::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    left: -60%;
    width: 40%;
    background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,.65) 50%, transparent 100%);
    transform: skewX(-18deg);
    transition: left .7s ease;
    pointer-events: none;
}
.data-calc-link:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--dcl1) 40%, transparent);
    box-shadow: 0 14px 28px -12px color-mix(in srgb, var(--dcl1) 60%, transparent);
}
.data-calc-link:hover::after { left: 120%; }
.data-calc-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--dcl1) 45%, transparent); outline-offset: 2px; }

.dcl-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--dcl1), var(--dcl2));
    box-shadow: 0 6px 16px -4px var(--dcl1);
}
.dcl-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dcl-title { font-size: 1.02rem; font-weight: 800; color: #78350f; line-height: 1.35; }
.dcl-sub { font-size: .8rem; color: #6b7280; line-height: 1.5; }
.dcl-cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--dcl1), var(--dcl2));
    box-shadow: 0 6px 14px -6px var(--dcl1);
    white-space: nowrap;
}
.dcl-cta i { font-size: .8rem; transition: transform .25s ease; }
.data-calc-link:hover .dcl-cta i { transform: translateX(3px); }

@media (max-width: 560px) {
    .data-calc-link { flex-wrap: wrap; padding: 14px; gap: 12px; }
    .dcl-icon { width: 40px; height: 40px; font-size: 1.05rem; border-radius: 12px; }
    .dcl-text { flex-basis: calc(100% - 56px); }
    .dcl-cta { width: 100%; justify-content: center; padding: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .data-calc-link, .data-calc-link::after, .dcl-cta i { transition: none; }
}

/* ══ 手機版：選天數／張數 → 加入購物車 區塊扁平化 ══
   原本在手機上是 頁面留白 → 方案內容白卡(#explorer-content) → 這區自己的淺藍卡 → 深藍總金額卡，
   四層各有框線與內距，內容被擠得很窄。手機上把「選擇使用期間」與「確認天數／數量」兩段的外框拿掉，
   直接放在白卡裡、用標題列分隔線區分段落；只留真正要突出的：天數選項卡、總金額卡、加入購物車按鈕。
   放在檔案最後，蓋過前面散落的舊手機規則（含 ≤768px 的 padding:1.25rem）。電腦版不受影響。 */
@media (max-width: 576px) {
    .pricing-tier-selection,
    .quantity-confirmation-section,
    .quantity-confirmation-section.visible {
        background: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding-left: 0;
        padding-right: 0;
    }
    .pricing-tier-selection { margin: 1.5rem 0; padding-top: 0; padding-bottom: 0; }
    .quantity-confirmation-section { margin: 1.5rem 0; }
    .quantity-confirmation-section.visible {
        padding-top: 0;
        padding-bottom: 0.5rem;
        /* 展開動畫要靠 overflow 裁切；展開後讓總金額卡陰影與購物車按鈕光暈畫得出去（左右已無內距，否則會被切掉） */
        overflow: clip;
        overflow-clip-margin: 1.5rem;
    }
    .pricing-tier-section-header,
    .qty-section-header {
        margin-bottom: 0.9rem;
        padding-bottom: 0.7rem;
    }
    .pricing-tier-section-header .tier-subtitle { font-size: 0.75rem; }
    .pricing-tier-grid { gap: 0.55rem; }
    .pricing-tier-card { padding: 0.9rem 0.7rem 0.85rem; }
    .live-price-feedback {
        padding: 1.3rem 1.1rem 1.1rem;
        box-shadow: 0 10px 24px -12px rgba(13, 71, 161, 0.5);
    }
}

/* ══ 結果頁分三個大區塊 ══
   ① 方案摘要＋資訊摺疊區＋注意事項 ② 選天數／數量 → 加入購物車 → 分享 ③ 產品詳情 → 電信訊號 → 購買須知 → 返回
   結果頁時外層白卡（#explorer-content）改透明，三塊各自是一張卡；卡片外觀沿用原本外層白卡（底色／框線／陰影／圓角）。
   內容仍維持最寬 600px 置中（同原本 .result-card-makeover），只是外框拉到整欄寬。
   #explorer-content.is-result 由 plans.js switchView() 切換。 */
#explorer-content.is-result {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    min-height: 0;
}
#explorer-content.is-result .result-card-makeover { max-width: none; }
.rx-block {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--border-radius, 12px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 2.25rem 2.5rem;
}
.rx-block + .rx-block { margin-top: 1.25rem; }
.rx-block > * { max-width: 600px; margin-left: auto; margin-right: auto; }
.rx-block > :first-child { margin-top: 0; }
.rx-block > :last-child { margin-bottom: 0; }
@media (max-width: 992px) {
    .rx-block { padding: 1.5rem; }
}
@media (max-width: 576px) {
    .rx-block { padding: 1.15rem 1rem; border-radius: 12px; }
    .rx-block + .rx-block { margin-top: 0.9rem; }
}
