/* ==========================================================================
   LOLLY TALK MASTER STYLESHEET - WHITE & NIGHT MODE (CLOUD SHARE R2)
   ========================================================================== */

/* --- 1. 基礎顏色變數 (預設白天) --- */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --card-bg: #f9f9f9;
    --nav-bg: #ffffff;
    --tab-border: #f8bbd0;
    --footer-bg: #fdfdfd;
}

body {
    font-family: 'Huninn', 'Noto Sans TC', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #FFFDF5;
    color: #333333;
    -webkit-font-smoothing: antialiased;
}

#lolly-talk-page-wrapper {
    max-width: 2500px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    background-color: #fdeff4;
    background-image:
        radial-gradient(at 0% 0%, hsla(333, 100%, 96%, 0.8) 0px, transparent 50%),
        radial-gradient(at 98% 99%, hsla(246, 100%, 94%, 0.8) 0px, transparent 50%),
        radial-gradient(at 50% 50%, hsla(0, 0%, 100%, 0.5) 0px, transparent 40%);
    background-attachment: fixed;
    color: #4a4a4a;
}

.lolly-talk-container {
    margin: auto;
    padding: 2px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-top: 15px;
}
.lolly-talk-container img { width: 100%; display: block; border-radius: 8px; height: auto; }

/* 導航欄基礎樣式 */
.final-nav-container {
    padding: 10px 20px;
    margin: 15px auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 35px;
    position: sticky;
    top: 10px;
    z-index: 900 !important;
    max-width: 95%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.nav-toggle-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #d147a3;
    padding: 5px;
    transition: transform 0.3s ease;
}

#mobile-current-tab {
    font-weight: bold; 
    color: #d147a3; 
    font-family: 'Huninn'; 
    font-size: 18px;
    display: none;
}

.final-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 5px;
}
.final-nav-links::-webkit-scrollbar { display: none; }

.final-tab-link {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    border-radius: 50px;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.final-tab-link:hover { color: #d147a3; background-color: #FFF0F5; }
.final-tab-link.active {
    background-color: #d147a3;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(209, 71, 163, 0.25);
}

/* 核心組件排版 */
.homepage-section-title, .styled-header {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 40px auto 25px auto !important;
    padding: 10px 35px !important;
    width: fit-content !important;
    min-width: 180px;
    border-radius: 50px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    font-family: 'Huninn', sans-serif !important;
    font-size: 1.3rem !important;
    font-weight: 800 !important;
    color: #d147a3 !important;
    text-align: center !important;
    letter-spacing: 1px !important;
}

#homepage { display: grid; gap: 30px; grid-template-columns: 1fr; }
@media (min-width: 768px) {
    #homepage { grid-template-columns: 1fr 1fr; }
    .main-layout-grid {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 2fr 1.2fr;
        gap: 30px;
    }
}

.post-carousel {
    position: relative; border: 1px solid #ddd; border-radius: 16px; overflow: hidden; background-color: #f8f9fa; height: 615px; box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.carousel-item { transition: opacity 0.4s ease-in-out; }
.carousel-item.fading-out { opacity: 0; }
.carousel-image { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 1px solid #ddd; }
.carousel-title { padding: 20px; text-align: center; }
.carousel-title-link { text-decoration: none; display: block; }
.post-title { font-size: 22px; font-weight: bold; color: #d147a3; display: block; margin-bottom: 8px; }
.carousel-nav { position: absolute; top: 40%; transform: translateY(-50%); width: 100%; display: flex; justify-content: space-between; padding: 0 15px; box-sizing: border-box; z-index: 10; pointer-events: none;}
.carousel-button { pointer-events: auto; background: rgba(255, 255, 255, 0.9); border: none; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; font-size: 20px; color: #333; box-shadow: 0 2px 5px rgba(0,0,0,0.15); transition: 0.2s; }

.right-column { background: #ffffff; border: 1px solid #EFEBE9; border-radius: 20px; padding: 25px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); box-sizing: border-box; }
.events-list { background-color: #fff; border: 1px solid #eee; border-radius: 12px; padding: 15px 25px; height: auto; max-height: 500px; overflow-y: auto; }
.event-item { position: relative; display: flex; padding: 25px 0 25px 85px; border-bottom: 1px solid #f0f0f0; }
.event-item:last-child { border-bottom: none; }
.event-date { position: absolute; left: 0; top: 25px; flex-shrink: 0; width: 65px; background: #fff; border: 1px solid #e0e0e0; border-radius: 12px; text-align: center; }
.event-date .month { font-size: 11px; padding: 4px 0; color: white; text-transform: uppercase; background: linear-gradient(45deg, #f06292, #ba68c8); border-radius: 11px 11px 0 0; }
.event-date .day { font-size: 26px; padding: 8px 0; line-height: 1; color: #c44a88; font-weight: bold; }
.event-details { width: 100%; }
.event-details h4 { font-weight: bold; font-size: 16px; margin: 0 0 15px 0; color: #333; line-height: 1.4; }
.meta-line { display: flex; align-items: center; gap: 10px; margin: 0 0 10px 0; font-size: 13px; color: #555; }
.meta-line svg { fill: #d147a3; width: 16px; text-align: center; }
.quick-link-button { display: inline-flex; justify-content: center; align-items: center; background: linear-gradient(45deg, #f06292, #ba68c8); color: #ffffff !important; padding: 8px 25px; border-radius: 50px; font-weight: bold; font-size: 13px; text-decoration: none; box-shadow: 0 4px 10px rgba(209, 71, 163, 0.2); }

.debut-counter-container { background: linear-gradient(135deg, #FFF9E6 0%, #FFF3CD 100%); border: 1px solid #FFEBAA; padding: 20px; border-radius: 16px; text-align: center; font-weight: 700; color: #856404; font-size: 1.2rem; margin: 30px 0; grid-column: 1 / -1; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
#lolly-talk-debut-counter { color: #d81b60; font-size: 2.2rem; margin: 0 8px; vertical-align: -4px; font-weight: 900; }

.dual-carousel-layout { display: grid; grid-template-columns: 1fr; gap: 25px; margin-bottom: 35px; }
@media (min-width: 768px) { .dual-carousel-layout { grid-template-columns: 1fr 1fr; } }
.dual-carousel-layout .column { background: #ffffff; border: 1px solid #EFEBE9; border-radius: 20px; padding: 25px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); box-sizing: border-box; }

#main-thumbnail-display { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
#thumbnail-playlist { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; }
.album-main-view { width: 100%; aspect-ratio: 1/1; background: #f5f5f5; border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.album-filmstrip-wrapper { display: flex; align-items: center; gap: 8px; }
.album-filmstrip { display: flex; gap: 8px; overflow-x: auto; flex-grow: 1; scrollbar-width: none; }
.filmstrip-scroll-btn { background: #f0f0f0; border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.support-events-list { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.support-event-item { position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); }
.support-event-thumbnail { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.support-event-details { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; padding: 20px; box-sizing: border-box; color: #fff; background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 20%, transparent 80%); display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; }
.support-status { position: absolute; top: 15px; right: 15px; z-index: 3; padding: 4px 12px; font-size: 11px; font-weight: 700; border-radius: 50px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.status-ended { background-color: #6c757d; color: #fff; }
.support-event-item h4 { font-size: 1.3rem; line-height: 1.4; color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7); margin: 0; }
.support-event-item .meta-line { opacity: 0; max-height: 0; overflow: hidden; transform: translateY(10px); transition: all 0.4s ease; font-size: 0.85rem; color: rgba(255, 255, 255, 0.85); gap: 8px; margin-top: 0; display: flex; align-items: center; }
.support-event-item:hover .support-event-thumbnail { transform: scale(1.05); }
.support-event-item:hover .support-event-details { background: rgba(0, 0, 0, 0.7); justify-content: center; align-items: center; text-align: center; }
.support-event-item:hover h4 { font-size: 1.2rem; margin-bottom: 10px; text-align: center; }
.support-event-item:hover .meta-line { opacity: 1; max-height: 5em; transform: translateY(0); margin-top: 4px; justify-content: center; }
.support-event-item .meta-line svg { fill: rgba(255, 255, 255, 0.85); width: 14px; height: 14px; }

.site-footer { text-align: center; padding: 50px 20px 30px 20px; border-top: 1px solid #e0e0e0; margin-top: 40px; }
#language-toggle-btn { display: inline-block; text-decoration: none; background: linear-gradient(45deg, #f06292, #ba68c8); color: white; font-family: 'Huninn', sans-serif; font-size: 1rem; font-weight: 700; padding: 12px 25px; border-radius: 50px; }
.page-view-counter { text-align: center; margin: 40px 15px 10px; font-size: 14px; color: #888; }
#page-view-count { font-weight: bold; color: #d81b60; font-size: 16px; }

/* ==========================================================================
   NIGHT MODE MASTER STYLES OVERRIDES
   ========================================================================== */
body.night-mode { background-color: #121212 !important; color: #e4e6eb !important; }
body.night-mode #lolly-talk-page-wrapper { background-color: #121212 !important; background-image: none !important; }
body.night-mode .lolly-talk-container { background: #121212 !important; box-shadow: none !important; }
body.night-mode .final-nav-container, body.night-mode .final-nav-links { background-color: #1a1a1a !important; border-color: #333 !important; }
body.night-mode .final-tab-link { color: #ff80ab !important; }
body.night-mode .final-tab-link:hover { background: #333 !important; }
body.night-mode .homepage-section-title, body.night-mode .styled-header { background: #1a1a1a !important; color: #ff80ab !important; border-color: #333 !important; }
body.night-mode .post-carousel { background-color: #1a1a1a !important; border-color: #333 !important; }
body.night-mode .carousel-title { background-color: #1a1a1a !important; }
body.night-mode .carousel-nav button { background: rgba(255,255,255,0.1) !important; color: #fff !important; }
body.night-mode .right-column, body.night-mode .events-list, body.night-mode .event-item { background: #1a1a1a !important; border-color: #333 !important; }
body.night-mode .event-date { background: #ff80ab !important; color: #121212 !important; border-color: #ff80ab !important; }
body.night-mode .event-date .month { background: linear-gradient(45deg, #d81b60, #8e24aa) !important; }
body.night-mode .event-date .day { color: #121212 !important; }
body.night-mode .event-details h4 { color: #fff !important; }
body.night-mode .meta-line span { color: #aaa !important; }
body.night-mode .meta-line svg { fill: #ff80ab !important; }
body.night-mode .debut-counter-container { background: #1a1a1a !important; border-color: #333 !important; color: #ff80ab !important; }

/* ==========================================================================
   LOLLY TALK 智慧置頂與標題隱藏修正 (Cloudflare R2)
   ========================================================================== */

/* 1. 強效隱藏原生網頁大標題：彻底解決截圖上方露出 lollytalk 字樣的問題 */
h1.post-title, 
.post-title, 
.entry-title, 
.post h1,
#lolly-talk-page-wrapper h1:first-of-type {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 2. 桌機版智慧雙層置頂：完美卡在全站主導航列下方 */
@media (min-width: 769px) {
    .final-nav-container {
        position: sticky !important;
        top: 90px !important; /* 預設吸附在主選單 (90px) 下方 */
        z-index: 3500 !important;
        transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    /* 當全站導航列因向下滾動縮小獲得 .scrolled 時，自動將應援選單上提至 60px */
    body:has(#ksb-navbar.scrolled) .final-nav-container {
        top: 60px !important;
    }
}

/* 3. 手機版最頂端強效置頂：Banner 滑走後選單完美卡在頂端 */
@media (max-width: 768px) {
    .final-nav-container {
        position: sticky !important;
        top: 0 !important; /* 手機版直接鎖定在最頂端 0px */
        z-index: 9999 !important;
    }
    .tab-content {
        padding-top: 20px !important;
    }
}


/* ==========================================================================
   📱 終極行動端選單美化 (Mobile Nav Dropdown Glow-up)
   ========================================================================== */
   @media (max-width: 768px) {
    /* 1. 選單外殼升級：加入精緻微霧透光（磨砂玻璃）與粉色系陰影 */
    .final-nav-links {
        background: rgba(255, 255, 255, 0.96) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        backdrop-filter: blur(12px) !important; /* 現代感毛玻璃特效 */
        box-shadow: 0 15px 35px rgba(209, 71, 163, 0.12) !important; /* 帶有波板糖應援粉的沉穩陰影 */
        border: 1px solid rgba(252, 228, 236, 0.7) !important;
        border-radius: 22px !important; /* 更圓潤舒適的邊角 */
        padding: 12px 10px !important;
        margin: 0 !important;
    }

    /* 2. 導航選項升級：強制 Flexbox 軸線完美置中、拓寬點擊區域 */
    .final-tab-link {
        display: flex !important;
        align-items: center !important; /* 確保 Emoji 與文字絕對水平置中 */
        gap: 12px !important; /* 賦予 Emoji 與文字間舒適的呼吸空間 */
        padding: 12px 16px !important;
        color: #444444 !important;
        font-size: 15px !important;
        font-weight: 500 !important;
        font-family: 'Huninn', 'Noto Sans TC', sans-serif !important;
        border-bottom: none !important; /* 移除死板的下底線 */
        border-radius: 12px !important; /* 讓選項內嵌膠囊化 */
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        text-decoration: none !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    /* 3. 核心逆襲：重塑點擊狀態（Active）。告別傳統方塊，改用精緻「左側應援光條」與漸層 */
    .final-tab-link.active {
        background: linear-gradient(90deg, rgba(209, 71, 163, 0.08) 0%, rgba(255,255,255,0) 100%) !important; /* 柔和粉紅向右淡出漸層 */
        color: #d147a3 !important; /* Lolly Talk 招牌應援粉紅 */
        font-weight: 700 !important;
        padding-left: 20px !important; /* 當前頁面產生微妙的微向右推動，極具靈動感 */
        box-shadow: inset 4px 0 0 #d147a3 !important; /* 精緻的左側亮點應援指示線 */
    }

    /* 4. 滑過或微點擊的反饋補強 */
    .final-tab-link:hover, .final-tab-link:active {
        background-color: rgba(209, 71, 163, 0.04) !important;
        color: #d147a3 !important;
    }
}


/* ==========================================================================
   FANCAM LIGHTBOX MODAL STYLES (For playing YouTube videos in a popup)
   ========================================================================== */
   .lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-overlay.hidden {
    display: none !important;
}
.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
    backdrop-filter: blur(5px);
}
.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    z-index: 2;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
#close-lightbox {
    position: absolute;
    top: -45px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 35px;
    cursor: pointer;
    transition: 0.2s;
}
#close-lightbox:hover {
    color: #ff80ab;
    transform: scale(1.1);
}

/* ==========================================================================
           🍔 漢堡選單 Overlay 磁磚化 (Grid 2-Columns)
           ========================================================================== */
           @media (max-width: 768px) {
            /* 1. 外殼容器：改為 Grid 網格佈局 */
            html body #lolly-talk-page-wrapper .final-nav-links {
                position: absolute !important;
                top: 100% !important;
                left: 15px !important;
                right: 15px !important;
                display: none !important; /* 預設隱藏，點擊漢堡才顯示 */
                
                /* 🔥 關鍵：啟用 2 欄網格 */
                grid-template-columns: repeat(2, 1fr) !important;
                gap: 12px !important;
                padding: 15px !important;
                
                /* 外觀設定 */
                background: #ffffff !important;
                border-radius: 20px !important;
                box-shadow: 0 10px 40px rgba(0,0,0,0.12) !important;
                max-height: 75vh !important;
                overflow-y: auto !important;
                -webkit-overflow-scrolling: touch !important;
                z-index: 999999 !important;
            }
            
            /* 點擊展開時，將顯示模式切換為 grid */
            html body #lolly-talk-page-wrapper .final-nav-links.active {
                display: grid !important; 
            }

            /* 2. 磁磚本體：完美還原截圖的顏色與上下排列 */
            html body #lolly-talk-page-wrapper .final-nav-links .final-tab-link {
                display: flex !important;
                flex-direction: column !important; /* 圖上字下 */
                align-items: center !important;
                justify-content: center !important;
                
                /* 截圖中的奶油白底色與深棕色字 */
                background-color: #f7f5f0 !important; 
                color: #5c4d47 !important; 
                
                padding: 20px 10px !important;
                border-radius: 16px !important;
                text-decoration: none !important;
                gap: 8px !important;
                border: none !important;
                box-shadow: none !important;
                transition: transform 0.2s ease !important;
            }

            /* 磁磚的 Icon 設定 */
            html body #lolly-talk-page-wrapper .final-nav-links .final-tab-link i {
                font-size: 26px !important;
                color: #5c4d47 !important; /* 深咖啡色 Icon */
            }

            /* 磁磚的文字設定 */
            html body #lolly-talk-page-wrapper .final-nav-links .final-tab-link span {
                font-size: 13px !important;
                font-weight: 700 !important;
                text-align: center !important;
            }

            /* 磁磚點擊反饋 */
            html body #lolly-talk-page-wrapper .final-nav-links .final-tab-link:active {
                transform: scale(0.96) !important;
            }

            /* 🔥 3. 當前頁面高亮 (Active 狀態)：換成 Lolly Talk 粉紅底白字 */
            html body #lolly-talk-page-wrapper .final-nav-links .final-tab-link.lt-current-tab {
                background-color: #d147a3 !important; 
                color: #ffffff !important;
            }
            html body #lolly-talk-page-wrapper .final-nav-links .final-tab-link.lt-current-tab i {
                color: #ffffff !important;
            }
        }