.menu-container {
    z-index: 4000 !important;
}

header {
    min-height: 70px !important;
    background: rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1001;
    border-bottom: 1px solid rgba(210, 193, 165, 0.3);
}

.category-nav {
    width: auto;
    padding-left: 120px;
    box-sizing: border-box;
}

.main-tabs {
    display: flex;
    justify-content: flex-start;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 60px;
}

.tab-item {
    position: relative;
    color: #5C4033;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    padding: 10px 0;
    transition: all 0.3s ease;
}

.tab-item::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #cec161eb;
    transition: width 0.3s ease;
}

.tab-item:hover {
    color: #a02828;
    transform: translateY(-2px);
}

.tab-item:hover::after {
    width: 100%;
}

.submenu {
    display: none;
    position: absolute;
    top: 90%;
    left: 0;
    background: #fdfaf5;
    border: 1px solid #D2C1A5;
    min-width: 240px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    list-style: none;
    padding: 10px 0;
    z-index: 3000;
    border-radius: 2px;
}

.submenu li {
    padding: 12px 20px;
    color: #5C4033;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.submenu li:hover {
    background-color: #F5F1E6;
    color: #a02828;
    padding-left: 25px;
}

.tab-item.has-submenu:hover .submenu {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#photos-flex-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 95%;
    max-width: 1600px;
    margin: 50px auto;
    gap: 60px;
}

.photos-img-frame {
    flex: 1.5;
    background: #fdfaf5;
    padding: 20px;
    border: 1px solid #D2C1A5;
    box-shadow: 10px 10px 0px #D2C1A5, 20px 20px 40px rgba(0, 0, 0, 0.1);
}

.photos-text-frame {
    position: relative;
    flex: 0.8;
    background: radial-gradient(circle, #FDFBF7 0%, #F5F1E6 100%);
    padding: 45px 40px;
    border: 1px solid #D2C1A5;
    border-radius: 2px;
    min-height: 480px;
    box-shadow: 5px 5px 25px rgba(0, 0, 0, 0.05);
    line-height: 1.8;
    padding-bottom: 80px;
}

.slider-group,
.note-content {
    display: none;
}

.slider-group.active,
.note-content.active {
    display: block;
}

.note-content h2 {
    color: #5C4033;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 10px;
    border-bottom: none !important;
    position: relative;
}

.note-content h3 {
    font-family: "Kaiti", "STKaiti", "標楷體", serif;
    color: #8A7B63;
    font-size: 1.1rem;
    font-weight: 500;
    font-style: italic;
    letter-spacing: 1px;
    margin: 0;
    position: absolute;
    bottom: 30px;
    right: 40px;
    text-align: right;
    line-height: 1.6;
}

.note-content h3+h3 {
    bottom: 10px;
}

.note-content p {
    color: #6B4F31;
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    text-align: justify;
    letter-spacing: 0.5px;
}

.note-content strong {
    color: #a02828;
    font-weight: 700;
}

.inner-line {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, #D2C1A5 0%, rgba(210, 193, 165, 0.3) 80%, transparent 100%);
    margin: 20px 0 30px 0;
}

/* 左右切換按鈕樣式 */
.prev,
.next {
    background: rgba(92, 64, 51, 0.1);
    border: none;
    color: #5C4033;
    font-size: 2rem;
    cursor: pointer;
    padding: 10px;
    transition: background 0.3s;
}

.prev:hover,
.next:hover {
    background: rgba(92, 64, 51, 0.3);
}

/* 活動標籤切換按鈕 */
.activity-tabs {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.tab-btn {
    background-color: #E8DCC4;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    color: #5C4033;
    border: 1px solid #D2C1A5;
}

.tab-btn.active {
    background-color: #FFD700;
    border-color: #B48C00;
}

/* 輪播器左右按鈕 */
.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #1a1a1a;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

/* 輪播器屬性*/
.slider-container {
    display: flex;
    overflow-x: hidden;
    scroll-behavior: smooth;
    width: 100%;
    scroll-snap-type: x mandatory;
}

.item {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.item img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    display: block;
}

/* 左右切換按鈕樣式 */
.prev,
.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    z-index: 10;
    font-size: 18px;
    transition: 0.3s;
}

.prev {
    left: 0;
    border-radius: 0 5px 5px 0;
}

.next {
    right: 0;
    border-radius: 5px 0 0 5px;
}

.prev:hover,
.next:hover {
    background: rgba(243, 156, 18, 0.8);
}

.slider-note {
    text-align: center;
    font-size: 0.9rem;
    margin-top: 10px;
    color: #8a7b63;
}

/* 彈窗背景 */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    cursor: default;
    align-items: center;
    justify-content: center;
}

/* 放大後的圖片樣式 */
.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 3px solid #f0efd3;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    border-radius: 4px;
    animation: zoomIn 0.3s ease;
}

/* Lightbox 左右按鈕 */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 20px 15px;
    cursor: pointer;
    font-size: 30px;
    transition: 0.3s;
    user-select: none;
}

.lightbox-prev {
    left: 20px;
    border-radius: 0 5px 5px 0;
}

.lightbox-next {
    right: 20px;
    border-radius: 5px 0 0 5px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(243, 156, 18, 0.5);
    color: #FFD700;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

@keyframes zoomIn {
    from {
        transform: scale(0.7);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 手機板排版 */
@media (max-width: 768px) {
    header {
        min-height: 100px !important; 
        align-items: flex-end !important; /* 讓分類文字靠底部對齊，漢堡靠頂部 */
        padding-bottom: 8px;
        overflow: visible !important;
    }

    .category-nav {
        padding-left: 0 !important;
        width: 100%;
        display: flex;
        justify-content: center;
        overflow: visible !important;
    }

    .main-tabs {
        cursor: pointer !important;
        padding-left: 40px !important;
        font-size: 1rem !important;
        justify-content: center;
        flex-wrap: nowrap !important;
        padding: 10px 0;
        overflow: visible !important;
        padding: 10px 15px !important;
        justify-content: flex-start !important;
        gap: 12px !important;
    }

    .tab-item {
        cursor: pointer !important; 
        -webkit-user-select: none !important;
        -webkit-tap-highlight-color: transparent !important;
        font-size: 1rem !important;
        font-weight: 700;
        letter-spacing: 1px !important;
        padding: 5px 2px;
        white-space: nowrap;
    }

    .tab-item::after {
        display: none !important;
        content: none !important;
    }

    .submenu {
        position: absolute !important;
        top: 100% !important;
        left: 50% !important;
        animation: fadeInMobile 0.25s ease-out forwards !important;

        max-width: 85vw !important;
        min-width: 150px !important;
        border-radius: 4px !important;
    }

    @keyframes fadeInMobile {
        from {
            opacity: 0;
            transform: translate(-50%, -10px);
        }

        to {
            opacity: 1;
            transform: translate(-50%, 0);
        }
    }

    .submenu li {
        padding: 12px 15px !important;
        font-size: 0.9rem !important;
    }

    .submenu li:last-child {
        border-bottom: none;
    }

    #photos-flex-container {
        flex-direction: column;
        align-items: center;
        gap: 30px;
        margin: 20px auto !important;
    }

    .photos-img-frame,
    .photos-text-frame {
  padding: 30px 20px 60px 20px !important; /* 縮小內距，底部留空間給 h3 */
        min-height: auto !important; /* 讓高度隨內容撐開 */
    }

    .item img {
        height: auto !important;
    }

.note-content h3 {
        position: relative !important; /* 改為相對定位，不再漂浮 */
        bottom: auto !important;
        right: auto !important;
        font-size: 0.9rem !important; /* 提高易讀性，0.6rem 太小了 */
        text-align: right;
        margin-top: 20px !important;
        display: block;
        width: 100%;
    }

    /* 處理多個 h3 (例如署名 + 日期) */
    .note-content h3 + h3 {
        margin-top: 5px !important;
        bottom: auto !important;
    }
}