.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 比例 */
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 主要容器樣式 (維持不變) */
.tabs-container-4 {
    max-width: 1000px;
    margin: 30px auto;
    overflow: hidden;
}

.tabs-container-4 img {
    border: 1px #aaaaaa solid;
    /* height: 540px; */
}

/* Tab 按鈕群組的樣式 (維持 Flexbox，以便於 RWD 調整) */
.tab-buttons-4 {
    display: flex;
    /* 讓按鈕預設並排 */
}

/* 單個 Tab 按鈕的樣式 */
.tab-button-4 {
    background-color: inherit;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    transition: background-color 0.3s;
    font-size: 18px;
    flex-grow: 1;
    /* 讓按鈕平均分配寬度 */
    /* 新增：確保文字不會溢出 */
    text-align: center;
    white-space: nowrap;
    color: #7d5bcb;
    margin: 8px;
    background-color: #FFFFFF;
    border-radius: 20px 0 20px 20px;
}

/* 滑鼠懸停時的按鈕樣式 */
.tab-button-4:hover {
    background-color: #30266e;
    color: #FFFFFF;
}

/* 被選中/激活 (active) 的按鈕樣式 */
.tab-button-4.active-4 {
    background-color: #7d5bcb;
    color: #FFFFFF;
    font-weight: bold;
}

/* Tab 內容容器的樣式 */
.tab-content-container-4 {
    padding: 20px;
}

/* 單個 Tab 內容的樣式 - 預設隱藏 */
.tab-content-4 {
    display: none;
}

/* 激活 (active) 的內容樣式 - 顯示 */
.tab-content-4.active-content-4 {
    display: block;
    animation: fadein 0.5s;
}

/* 淡入動畫效果 */
@keyframes fadein {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ==================================== */
/* 📱 RWD 響應式設計：媒體查詢 */
/* ==================================== */

/* 當螢幕寬度小於或等於 600px 時 (適用於大多數手機) */
@media screen and (max-width: 600px) {

    /* 1. 調整按鈕群組：從水平 Flex 變成垂直堆疊 */
    .tab-buttons-4 {
        flex-direction: column;
        /* 將主軸方向改為垂直 */
    }

    /* 2. 調整單個按鈕：移除底部邊線並使用完整的寬度 */
    .tab-button-4 {
        display: block;
        /* 確保佔滿一行 */
        width: 97%;
        border-bottom: 1px solid #5733dc;
        /* 在垂直堆疊時，底部需要邊線來區分按鈕 */
        padding: 10px 15px;
        /* 稍微縮小垂直間距 */
        font-size: 16px;
        /* 稍微縮小字體 */
    }

    /* 3. 修正被選中按鈕的樣式：因為現在是垂直堆疊，邊線要在左側或底側 */
    .tab-button-4.active-4 {
        border-bottom: 1px solid #007bff;
        /* 保持底線樣式 */
        background-color: #06c2df;
        /* 在手機上使用更明顯的背景色 */
    }

    /* 4. 內容邊距調整：在手機上減少主容器和內容的邊距 */
    .tabs-container-4 {
        margin: 0;
        /* 在小螢幕上佔滿寬度 */
        border-radius: 0;
    }

    .tab-content-container-4 {
        padding: 15px;
    }
}

/* ==================================== */
/* 🆕 新增：導航按鈕樣式 */
/* ==================================== */
.gallery-nav-button-5 {
    cursor: pointer;
    position: absolute;
    top: 50%;
    /* 垂直置中 */
    transform: translateY(-50%);
    width: auto;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: background-color 0.4s ease;
    border-radius: 0 3px 3px 0;
    /* 預設為左側按鈕的圓角 */
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    user-select: none;
    /* 防止文字被選中 */
    z-index: 5;
    opacity: 0.9;
}

/* 導航按鈕懸停時效果 */
.gallery-nav-button-5:hover {
    background-color: rgba(0, 0, 0, 0.8);
    opacity: 1;
}

/* 定位前一張按鈕 */
.prev-button-5 {
    left: 0;
    border-radius: 0 8px 8px 0;
}

/* 定位後一張按鈕 */
.next-button-5 {
    right: 0;
    border-radius: 8px 0 0 8px;
    /* 修正圓角 */
}


/* 圖片切換動畫 Class (維持不變) */
.responsive-image-5.fade-in-5 {
    animation: fadeInAnimation-5 0.5s forwards;
}

@keyframes fadeInAnimation-5 {
    from {
        opacity: 0.2;
    }

    to {
        opacity: 1;
    }
}

/* ==================================== */
/* 📱 RWD 響應式設計：媒體查詢 */
/* ==================================== */

/* 當螢幕寬度小於或等於 768px 時 */
@media screen and (max-width: 768px) {

    .gallery-container-5 {
        margin: 10px auto;
        padding: 0 10px;
    }

    /* 導航按鈕在小螢幕上縮小 */
    .gallery-nav-button-5 {
        font-size: 16px;
        padding: 12px;
    }
}

/* 當螢幕寬度小於或等於 480px 時 */
@media screen and (max-width: 480px) {

    .gallery-container-5 {
        padding: 0 5px;
    }

    .image-counter-5 {
        font-size: 12px;
        padding: 3px 8px;
        bottom: 5px;
        right: 5px;
    }

    /* 導航按鈕在極小螢幕上更進一步縮小 */
    .gallery-nav-button-5 {
        font-size: 14px;
        padding: 8px;
    }
}






/*
    Tabs Widget — CodePen Reference
    All CSS variables have fallback values so this works standalone.
*/


/* ========================================= */
/* [Widget] Tabs — Core                      */
/* ========================================= */

/* Scrollbar hidden */
[data-widget="tabs"] .tabs-controls::-webkit-scrollbar {
    height: 0;
}

[data-widget="tabs"] .tabs-controls::-webkit-scrollbar-track,
[data-widget="tabs"] .tabs-controls::-webkit-scrollbar-thumb {
    display: none;
}

/* Controls wrapper */
[data-widget="tabs"] .tabs-controls {
    margin-bottom: var(--gap-500, 24px);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--gap-500, 16px);
    overflow-x: auto;
    scrollbar-width: none;
    /* Firefox */
}

/* Individual control button */
[data-widget="tabs"] .tabs-control {
    width: auto;
    position: relative;
    padding-block: var(--gap-200, 8px);
    font-family: var(--ff-heading, sans-serif);
    font-size: var(--fs-300, 13px);
    color: var(--color-text, #7d5bcb);
    text-transform: uppercase;
    cursor: pointer;
    flex-shrink: 0;
    background: none;
    border: none;
    outline: none;
}

/* Underline indicator (default) */
[data-widget="tabs"] .tabs-control[aria-selected]::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background-color: var(--color-accent, #7d5bcb);
    transition: var(--trans, all 250ms ease-in-out);
}

/* Active state */
[data-widget="tabs"] .tabs-control[aria-selected="true"] {
    color: var(--color-heading, #7d5bcb);
}

[data-widget="tabs"] .tabs-control[aria-selected="true"]::before {
    height: 2px;
}

/* Panel visibility */
[data-widget="tabs"] .tabs-panel[aria-selected="false"] {
    display: none;
}

[data-widget="tabs"] .tabs-panel[aria-selected="true"] {
    display: flex;
}

/* Description text */
[data-widget="tabs"] .tabs-panel .item__description {
    color: var(--color-text, #7d5bcb);
}

/* Desktop: allow buttons to shrink */
@media (min-width: 1025px) {
    [data-widget="tabs"] .tabs-control {
        flex-shrink: 1;
    }
}

/* ========================================= */
/* [Widget] Tabs — Fancy Indicator           */
/* ========================================= */

/* Controls wrapper with pill background */
[data-widget="tabs"] [data-type="fancy"].tabs-controls {
    width: auto;
    position: relative;
    display: inline-flex;
    gap: 0;
    background-color: var(--color-background-alt, #F3F4F8);
    border-radius: var(--br-elements, 32px);
    isolation: isolate;
}

/* Sliding indicator (pseudo-element driven by JS vars) */
[data-widget="tabs"] [data-type="fancy"].tabs-controls::before {
    content: "";
    position: absolute;
    top: 0;
    left: var(--active-button-offset, 0px);
    width: var(--active-button-width, 0px);
    height: 100%;
    background-color: var(--color-accent, #7d5bcb);
    border-radius: var(--br-elements, 32px);
    transition: var(--trans, all 250ms ease-in-out);
    transition-duration: var(--trans-duration-500, 375ms);
    z-index: -1;
}

/* Fancy control buttons */
[data-widget="tabs"] [data-type="fancy"].tabs-controls .tabs-control {
    padding-inline: var(--gap-700, 40px);
    height: var(--height-form-items, 56px);
    font-family: var(--ff-heading-500, sans-serif);
    font-size: var(--fs-h4, 14px);
    color: var(--color-text-accent, #7d5bcb);
    transition-delay: calc(var(--trans-duration-500, 375ms) / 2);
}

[data-widget="tabs"] [data-type="fancy"].tabs-controls .tabs-control[aria-selected="true"] {
    color: var(--color-heading-white, #FFFFFF);
}

/* Remove default underline on fancy controls */
[data-widget="tabs"] [data-type="fancy"].tabs-controls .tabs-control::before {
    content: unset;
}

.tabs-panels {
    padding: 2em;
    background-color: #f9f4ee;
    border-radius: 20px 0 20px 20px;
    box-shadow: #faf3ed 2px 3px 4px;

}

.tabs-panels img {
    border-radius: 10px;
}

.tab-pic {
    padding: 0 2em 1em 2em;
    text-align: center;
}

.tab-con {
    padding: 1em 2em;
}