/* --- 1. 基礎設定與變數 --- */
:root {
    --accent-color: #00a8e8;
    --text-color: #2c3e50;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --linktree-gradient: linear-gradient(135deg, #1de31a 0%, #1e3932 100%);
}

html { 
    scroll-behavior: smooth; 
    height: -webkit-fill-available;
}

/* 核心背景層：解決手機固定背景問題 */
.fixed-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: -webkit-fill-available;
    background-image: url('../main-visual.webP'); 
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: -1; /* 放在內容下方 */
    will-change: transform;
}

body {
    font-family: 'Zen Maru Gothic', 'Noto Sans TC', sans-serif;
    margin: 0; padding: 0;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #e3f2fd; /* 底色 */
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
}

/* --- 2. 佈局組件 --- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

section {
    scroll-margin-top: 100px; 
    padding: 60px 0;
}

header {
    background-color: rgba(227, 242, 253, 0.7);
    padding: 4rem 1rem;
    text-align: center;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

h1 { 
    margin: 0; font-weight: 700; letter-spacing: 3px; 
    color: var(--accent-color); font-size: 2.8rem;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-top: 10px;
}

/* --- 3. 導覽列  --- */
nav {
    display: flex;
    justify-content: center; /* 水平置中 */
    align-items: center;     /* 垂直置中 */
    background-color: rgba(255, 255, 255, 0.95);
    position: sticky;
    top: 0;
    z-index: 9999;
    height: 60px; /* 固定高度防止跳動 */
    padding: 0 10px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav a,
.info-dropdown,
.lang-dropdown {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
}

nav a:hover,
.info-btn:hover,
.lang-btn:hover {
    color: var(--accent-color);
}

/* --- 4. 語言選單下拉框 --- */
.info-dropdown,
.lang-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.info-btn,
.lang-btn {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    height: 100%;
}

.info-content,
.lang-content {
    display: none;
    position: absolute;
    top: 60px; 
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    min-width: 140px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-radius: 0 0 12px 12px;
    border: 1px solid #eee;
    z-index: 10001;
    overflow: hidden;
}

/* 懸停顯示邏輯 (共通) */
.info-dropdown:hover .info-content,
.lang-dropdown:hover .lang-content {
    display: block;
}

.info-content a,
.lang-content a {
    color: var(--text-color) !important;
    padding: 12px 16px;
    display: block;
    width: 100%;
    height: auto;
    line-height: 1.4;
    margin: 0;
    text-align: center;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent; /* 移除 IG 點擊藍色高亮 */
}

/* 語言選單：淡藍色背景 */
.lang-content a:hover,
.lang-content a:active {
    background-color: #f0f7ff;
    color: var(--accent-color) !important;
}

/* 相關連結：藍色漸變色 */
.info-content a:hover,
.info-content a:active {
    background: linear-gradient(45deg, #00a8e8 0%, #0077b6 100%) !important;
    color: #ffffff !important;
}

/* --- 5. 內容卡片 --- */
.info-card {
    background: var(--glass-bg);
    padding: 2.5rem;
    border-radius: 24px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.section-title {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 8px 25px;
    border-radius: 50px;
    margin-bottom: 30px;
    font-size: 1.4rem;
}

/* --- 6. SNS 按鈕  --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.news-link {
    text-align: center;
    padding: 12px;
    border-radius: 15px;
    text-decoration: none;
    background: #ffffff; /* 初始為白色 */
    color: var(--text-color); /* 初始文字顏色 */
    font-weight: 700;
    transition: all 0.3s ease;
    border: 1.5px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Active & Hover 通用效果：文字變白、產生陰影與上移 */
.news-link:hover,
.news-link:active {
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-color: transparent;
}

/* 各平台專屬 Hover 漸變色 */
.news-link.ig:hover,
.news-link.ig:active {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
}

.news-link.threads:hover,
.news-link.threads:active {
    background: #000000 !important;
}

.news-link.tiktok:hover,
.news-link.tiktok:active {
    background: linear-gradient(45deg, #69C9D0 0%, #EE1D52 100%) !important;
    background-color: #010101 !important;
}

.news-link.twitter:hover,
.news-link.twitter:active {
    background: #1DA1F2 !important;
}

.news-link.youtube:hover,
.news-link.youtube:active {
    background: linear-gradient(45deg, #FF0000 0%, #FF4D4D 50%, #CC0000 100%) !important;
}

/* --- 7. 加入我們與按鈕 --- */
.contact-btn.linktree {
    background: var(--linktree-gradient);
    color: white !important;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 10px 20px rgba(29, 227, 26, 0.3);
}

/* --- 8. MV 播放器 --- */
#randomMV {
    background: var(--glass-bg);
    padding: 20px;
    border-radius: 24px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: 18px;
    overflow: hidden;
}

.video-thumb {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
}

/* --- 9. 行動裝置與相容性整合優化 --- */

/* 針對所有觸控裝置的優化 (解決 IG/Safari 底部遮擋) */
@supports (-webkit-touch-callout: none) {
    body { 
        min-height: -webkit-fill-available; 
    }
}

/* 針對手機版 */
@supports (-webkit-touch-callout: none) {
    body, .fixed-background { 
        min-height: -webkit-fill-available; 
    }
}

@media (max-width: 768px) {
    nav { 
        height: 50px;
        padding: 0 5px;
    }

    nav a, 
    .info-dropdown, 
    .lang-dropdown {
        margin: 0 5px;
        font-size: 0.8rem;
        height: 50px;
    }

    .info-btn, .lang-btn { font-size: 0.8rem; }
    .info-content, .lang-content { top: 50px; }

    h1 { font-size: 2rem; }
    .info-card { padding: 1.5rem 15px; }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
