:root {
    --overlay-bg: rgba(128, 128, 128, 0.5);
    --active-color: #2CB6AF;
    --active-background-color: rgba(51, 51, 51, 0.5);/*#105998;*/
}
/* 輪播容器高度限制 */
.custom-carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #000;
}

.carousel-item img {
    width: 100%;
    height: auto;
    max-height: 80vh; /* 避免 PC 版圖片過長 */
    object-fit: cover;
    display: block;
}

/* 播放/暫停按鈕 */
.carousel-play-pause {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    background: var(--overlay-bg);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.carousel-play-pause:hover, .carousel-play-pause:focus {
    background: var(--active-background-color);
    outline: 2px solid var(--active-color);
}

/* 左右導航按鈕 */
.nav-ctrl {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    background: var(--overlay-bg);
    border: none;
    color: white;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s;
}
.nav-ctrl:hover, .nav-ctrl:focus {
    background: var(--active-background-color);
    outline: 2px solid var(--active-color);
}
.nav-prev { left: 0; border-radius: 0 5px 5px 0; }
.nav-next { right: 0; border-radius: 5px 0 0 5px; }

/* 名稱控制區塊 (PC 版) */
.name-control-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 70%, transparent 100%);
    display: flex;
    align-items: flex-end; /* 靠下對齊 */
    justify-content: center;
    z-index: 5;
    padding-bottom: 20px;
}

.name-tabs-container {
    display: flex;
    align-items: center;
    width: 90%;
    max-width: 1000px;
    gap: 15px;
}

.name-item {
    flex: 1;
    background: rgba(255,255,255,0.15);
    color: white;
    text-align: left;
    
    padding: 0.5rem 0.375rem;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s;
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.125rem;
    text-wrap: wrap;
}

.name-item.active {
    background: var(--active-color);
    border-color: var(--active-color);
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.5);
    font-weight: bold;
}

.name-item:hover, .name-item:focus {
    background: rgba(255,255,255,0.3);
    color: #fff;
    outline: none;
    border-color: #fff;
}

.tab-nav {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}
.tab-nav:hover:not(:disabled) {
    background: var(--active-color);
}
.tab-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 響應式調整 (行動裝置) */
@media (max-width: 768px) {
    .carousel-item img {
        max-height: 50vh;
    }

    .name-control-wrapper {
        position: relative;
        height: auto;
        background: #1a1a1a;
        padding: 15px 0;
        margin-top: 0;
        display: block; /* 改為區塊顯示 */
    }
    
    .name-tabs-container {
        width: 95%;
        margin: 0 auto;
    }

    .name-item {
        padding: 0.5rem 0.375rem;
        line-height: 1.0rem;
        font-size: 0.9rem;
        text-wrap: wrap;
    }
}
