#marquee-bar {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2.5em 0 2em 0;
}

#marquee-card {
    width: 90vw;
    max-width: 900px;
    border-radius: 18px 18px 12px 12px;
    background: #fff1f6;
    box-shadow: 0 4px 20px #0001;
    padding: 1.1em 1em;
    border-bottom: 3px solid #ef9bb2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

#marquee-text-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow: hidden;
    position: relative;
    min-height: 4.2em;
}

#marquee-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: 1.2em;
    font-weight: 600;
    color: #999;
    letter-spacing: 0.15em;
    padding: 1.2em 0;
}


.spinner {
    display: inline-block;
    width: 1.3em;
    height: 1.3em;
    border: 3px solid #b6bbc7;
    border-top: 3px solid #267d41;
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    margin-right: 0.5em;
    vertical-align: middle;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    vertical-align: middle;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: #555;
}

/* 跑馬燈動畫區 */
.marquee-loop {
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-size: clamp(1.1em, 2.8vw, 2em);
    font-weight: 700;
    color: #222;
    padding-right: 3em;
    will-change: transform;
    opacity: 0;
    transition: opacity 0.15s;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
}

.marquee-loop.marquee-show {
    opacity: 1;
}

@media (max-width: 600px) {
    #marquee-card {
        padding: 0.6em 0.2em;
        border-radius: 11px 11px 7px 7px;
    }

    .marquee-loop {
        font-size: clamp(1em, 4vw, 1.3em);
        padding-right: 1.8em;
    }

    #marquee-text-wrap {
        min-height: 1.4em;
    }
}




/* 卡片輪播區 */

#site-carousel {
    width: 100vw;
    overflow: hidden;
    margin: 2em 0 0 0;
    padding: 0;
    background: none;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    z-index: 1;
    display: flex;
    justify-content: center;
}

.carousel-track {
    display: flex;
    align-items: center;
    width: max-content;
    will-change: transform;
    transition: none;
    pointer-events: auto;
}

.carousel-card {
    width: 320px;
    /* 16:9 寬高 */
    aspect-ratio: 16/9;
    min-width: 320px;
    max-width: 320px;
    margin: 0 18px;
    background: #1e2532;
    border-radius: 1.3em;
    box-shadow: 0 4px 16px #0002;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 2.5px solid #eee0;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
}

.carousel-card:hover {
    box-shadow: 0 8px 24px #e6b16733;
    border: 2.5px solid #e6b167cc;
    transform: scale(1.045);
}

.carousel-img-wrap {
    flex: 1 1 auto;
    width: 100%;
    position: relative;
    background: #222;
    aspect-ratio: 16/9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-title {
    flex: 0 0 auto;
    background: rgba(10, 15, 25, 0.82);
    color: #ffd968;
    font-weight: bold;
    font-size: 1.25em;
    text-align: center;
    letter-spacing: 0.03em;
    padding: 0.65em 0.2em 0.45em 0.2em;
    border-radius: 0 0 1.2em 1.2em;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    position: absolute;
    left: 0;
    bottom: 0;
}

@media (max-width: 700px) {

    .carousel-card,
    .carousel-img-wrap {
        width: 82vw;
        min-width: 82vw;
        max-width: 82vw;
    }

    .carousel-title {
        font-size: 1.08em;
    }
}



/* 跑馬燈顏色 */

#marquee-card {
    transition: background 0.3s, border-bottom 0.3s;
}

/* 厭世（綠色系） */
#marquee-card.theme-dark {
    background: #1d3a34 !important;
    border-bottom: 3px solid #4caf50 !important;
}

#marquee-card.theme-dark .marquee-loop {
    color: #e7ffe5 !important;
}

/* 心靈雞湯（黃色系） */
#marquee-card.theme-soup {
    background: #fff5d3 !important;
    border-bottom: 3px solid #ffc107 !important;
}

#marquee-card.theme-soup .marquee-loop {
    color: #ffc34c !important;
}

/* 愛情（粉紅系） */
#marquee-card.theme-love {
    background: #ffe3ed !important;
    border-bottom: 3px solid #e879a7 !important;
}

#marquee-card.theme-love .marquee-loop {
    color: #ba1856 !important;
}