* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft JhengHei", sans-serif;
}

body {
    background-color: #64ad91;
    padding: 20px 10px;
    text-decoration: none;
}

.tab-container {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* 輪播區塊 RWD */
.carousel-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 35%; /* 保持響應式比例 */
    min-height: 180px;
    overflow: hidden;
    background-color: #000;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-prev, .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 10px 14px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    transition: background 0.3s;
}

.carousel-prev:hover, .carousel-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: #ffffff;
    width: 20px;
    border-radius: 4px;
}

/* ===== RWD 頁籤與下拉選單設計 ===== */
.tab-nav-wrapper {
    background-color: #ffffff;
    border-bottom: 2px solid #e9ecef;
}

/* 桌面端頁籤列表 (預設顯示) */
.tab-header {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.tab-header::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1 0 auto;
    padding: 14px 18px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    text-align: center;
}

.tab-btn:hover {
    color: #ab0606;
    background-color: #e9ecef;
}

.tab-btn.active {
    color: #0d6efd;
    background-color: #ffffff;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #0d6efd;
}

/* 行動端下拉選單 (預設隱藏) */
.tab-select-mobile {
    display: none;
    width: calc(100% - 24px);
    margin: 12px auto;
    padding: 0px 14px;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: #ffffff;
    outline: none;
}

/* 內容容器與 RWD 通用樣式 */
.tab-content-wrapper {
    padding: 20px;
}

.tab-panel {
    line-height: 1.6;
    color: #333333;
    animation: fadeIn 0.3s ease;
}

.tab-panel h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #a50000;
}

.tab-panel h3 {
    font-size: 1.1rem;
    margin: 10px 0;
}

.select-container {
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

select {
    height: 38px;
    padding: 0 12px;
    font-size: 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: #fff;
    max-width: 100%;
    outline: none;
}

.content-box {
    display: none;
    padding: 18px;
    margin-top: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fdfdfd;
}

/* RWD 圖片與影片自適應 */
.responsive-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 10px auto;
}

.responsive-iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 比例 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    margin: 12px 0;
    background: #f0f0f0;
}

.responsive-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.bottom {
    text-align: center;
    padding: 20px 15px;
    font-size: 0.85rem;
    color: #555;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RWD 切換斷點：768px 以下改為下拉選單 ===== */
@media (max-width: 768px) {
    .tab-header {
        display: none; /* 隱藏桌面頁籤 */
    }

    .tab-select-mobile {
        display: block; /* 顯示手機下拉選單 */
    }
}

@media (max-width: 576px) {
    body {
        padding: 5px;
    }

    .tab-content-wrapper {
        padding: 12px;
    }

    .content-box {
        padding: 12px;
    }
}
