body {
    font-family: sans-serif;
    background: #f9f9f9;
    margin: 0;
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

h1 {
    text-align: center;
    margin-top: 40px;
}

#course-content {
    padding: 0 2rem;
    min-height: 80vh;
}

.video-section {
    margin: 2rem auto;
    max-width: 600px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px #0001;
    padding: 1.5rem;
}

h2 {
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

/* 當 section.header 為空時，隱藏對應的 h2 */
#course-content h2:empty {
    display: none;
}

video {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 0;
}

#password-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0008;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

#password-modal>div {
    background: #fff;
    padding: 2rem 2.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 16px #0003;
    text-align: center;
    max-width: 60vw;
}

#password-input {
    font-size: 1.1rem;
    padding: 0.5rem;
    width: 100%;
    max-width: 250px;
    box-sizing: border-box
}

#password-error {
    color: red;
    margin-top: 0.5rem;
    display: none;
}

#password-submit,
#password-cancel {
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
}

.password-btn-group {
    display: flex;
    width: 100%;
    gap: 0.8em;
    margin-top: 0.8em;
}

.password-btn-group button {
    flex: 1 1 0;
    width: 100%;
    margin-top: 0;
}

footer {
    text-align: center;
    margin-top: 3em;
    padding: 1.5em 0 0.5em 0;
    /* background: #f3f3f7; */
    /* border-top: 1px solid #e0e0e0; */
    font-size: 0.98em;
    color: #888;
    letter-spacing: 0.02em;
    /* box-shadow: 0 -2px 8px #0001; */
}

footer a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #4a90e2;
}

footer img {
    vertical-align: middle;
    width: 24px;
    height: 24px;
    margin-right: 0.4em;
    filter: grayscale(30%);
    opacity: 0.85;
    transition: filter 0.2s, opacity 0.2s;
}

footer a:hover img {
    filter: none;
    opacity: 1;
}

.image-section {
    margin: 2rem auto;
    max-width: 600px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px #0001;
    padding: 1.5rem;
}

.image-section img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px #0001;
    margin-bottom: 0;
}

.imageset-section {
    margin: 2rem auto;
    max-width: 600px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px #0001;
    padding: 1.5rem;
}

.imageset-section .imageset-carousel .carousel-slide img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px #0001;
    margin-bottom: 0;
}

/* Carousel 樣式整理 */
.imageset-carousel .carousel-images {
    position: relative;
    overflow: hidden;
}

.imageset-carousel .carousel-slides {
    display: flex;
    transition: transform 0.3s ease;
}

.imageset-carousel .carousel-slide {
    position: relative;
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.imageset-carousel .carousel-slide img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px #0001;
    margin-bottom: 0;
}

.imageset-carousel .zoom-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    z-index: 10;
}

.imageset-carousel .zoom-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.imageset-carousel .carousel-btn {
    color: rgb(221, 221, 221);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(221, 221, 221, 0);
    border: 0px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 4rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 40px;
    vertical-align: text-bottom;
}

.imageset-carousel .carousel-btn.carousel-prev {
    left: 0;
    right: auto;
}

.imageset-carousel .carousel-btn.carousel-next {
    right: 0;
    left: auto;
}

.imageset-carousel .carousel-btn:hover {
    color: rgb(102, 102, 102);
}

.imageset-carousel .carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.imageset-carousel .carousel-dot {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: background 0.2s;
}

.imageset-carousel .carousel-dot.active {
    background: #666;
}

/* Navbar 樣式 */
.main-navbar {
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 8px #0001;
    padding: 0.5em 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5em;
}

.navbar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-size: 1.15em;
    letter-spacing: 0.03em;
}

.navbar-logo:hover {
    color: #4a90e2;
}

.navbar-links {
    list-style: none;
    display: flex;
    gap: 1.5em;
    margin: 0;
    padding: 0;
}

.navbar-links li a {
    text-decoration: none;
    color: #555;
    font-size: 1em;
    transition: color 0.2s;
    padding: 0.2em 0.5em;
    border-radius: 4px;
}

.navbar-links li a:hover {
    color: #fff;
    background: #4a90e2;
}

@media (max-width: 600px) {
    .navbar-container {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 0.7em;
    }

    .navbar-links {
        gap: 0.7em;
        font-size: 0.98em;
    }
}

/* Lightbox RWD buttons */
#img-lightbox-modal .lb-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: saturate(160%) blur(2px);
}

/* Default desktop placements (outside popover area) */
#img-lightbox-modal .lb-prev {
    left: -3rem;
    top: 50%;
    transform: translateY(-50%);
}

#img-lightbox-modal .lb-next {
    right: -3rem;
    top: 50%;
    transform: translateY(-50%);
}

/* 觸控裝置：隱藏按鈕（由 JS 在 modal 上加 is-touch 類別） */
#img-lightbox-modal.is-touch .lb-btn {
    display: none;
}

/* 小螢幕（非觸控）內縮按鈕以避免裁切 */
@media (max-width: 768px) {
    #img-lightbox-modal .lb-prev {
        left: 0.5rem;
    }

    #img-lightbox-modal .lb-next {
        right: 0.5rem;
    }
}

/* Extra small phones */
@media (max-width: 380px) {
    #img-lightbox-modal .lb-btn {
        width: 38px;
        height: 38px;
        font-size: 20px;
        border-radius: 8px;
    }
}
