/* =========================================
   全局設定 (Global Variables)
   維持高質感暗色美學與冷暖平衡
   ========================================= */
:root {
    --primary-gold: #e6c280;
    --bg-dark: #000000;
    --bg-panel: #151515;
    --text-light: #f5f5f5;
    --text-muted: #888888;
}

body {
    margin: 0;
    font-family: 'Noto Sans TC', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
}

/* =========================================
   1. AR 掃描頁面 (index.html) 專屬樣式
   ========================================= */
body.ar-page {
    overflow: hidden; /* 鎖定畫面，防止 AR 亂滑 */
}

/* 🎬 載入畫面 (Splash Screen) */
#splashScreen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, #1a1a1a 0%, #000000 100%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 1000; transition: opacity 1s ease;
}
#splashScreen.fade-out { opacity: 0; pointer-events: none; }
#splashScreen h1 { font-size: 2.2rem; color: var(--primary-gold); margin-bottom: 0.5rem; letter-spacing: 4px; text-shadow: 0 0 10px rgba(230,194,128,0.5); }
#splashScreen p { font-size: 1rem; color: #b3b3b3; max-width: 80%; text-align: center; line-height: 1.6; margin-top: 0; }

#startBtn {
    margin-top: 30px; padding: 12px 30px; background: transparent;
    border: 1px solid var(--primary-gold); color: var(--primary-gold); font-size: 1.1rem;
    cursor: pointer; letter-spacing: 2px; transition: all 0.3s ease;
}
#startBtn:hover { background: var(--primary-gold); color: var(--bg-dark); }

/* 💎 AR 畫面 UI 浮層 */
.ar-ui-overlay {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    width: 85%; max-width: 350px; padding: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(230, 194, 128, 0.3);
    border-radius: 8px; text-align: center;
    z-index: 100; pointer-events: none; display: none;
}
.ar-ui-overlay.show { display: block; }
.ui-title { font-size: 1.25rem; color: var(--primary-gold); margin-bottom: 5px; font-weight: bold; }
.ui-subtitle { font-size: 0.9rem; color: #b3b3b3; margin-bottom: 10px; }
.ui-passphrase { font-size: 1.1rem; color: var(--primary-gold); font-weight: bold; letter-spacing: 2px; text-shadow: 0 0 8px rgba(230,194,128,0.8); }

#lineHint { position: fixed; top: 0; left: 0; width: 100%; padding: 8px; background: rgba(230,194,128,0.9); color: #000; font-size: 0.8rem; text-align: center; z-index: 500; }

/* =========================================
   2. 旅人手札 (passport.html) 專屬樣式
   ========================================= */
body.passport-page {
    padding: 20px;
    text-align: center;
    background-color: #0c0c0c;
    overflow-y: auto; /* 允許手札頁面往下滑動 */
}

.passport-page h1 { color: var(--primary-gold); letter-spacing: 3px; font-weight: 300; margin-bottom: 5px; }
.passport-page > p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 30px; letter-spacing: 1px; }

/* 信物集章區塊 */
.relic-grid { display: flex; justify-content: center; gap: 20px; margin-bottom: 40px; }
.relic-item { width: 100px; text-align: center; }
.relic-icon { 
    width: 80px; height: 80px; background-color: #1a1a1a; border-radius: 50%; 
    margin: 0 auto 10px; display: flex; align-items: center; justify-content: center;
    border: 1px solid #333; font-size: 2rem; color: #555;
    transition: all 0.5s ease; filter: grayscale(100%); opacity: 0.5;
}
.relic-name { font-size: 0.85rem; color: #555; }
.relic-item.unlocked .relic-icon { 
    border-color: var(--primary-gold); background-color: rgba(230,194,128,0.1); 
    filter: grayscale(0%); opacity: 1; color: var(--primary-gold); box-shadow: 0 0 15px rgba(230,194,128,0.3);
}
.relic-item.unlocked .relic-name { color: var(--primary-gold); }

/* 創作編輯區塊 */
.creator-section { background: var(--bg-panel); padding: 20px; border-radius: 12px; border: 1px solid #2a2a2a; margin-bottom: 40px; }
.camera-btn { 
    background: var(--primary-gold); color: #000; padding: 12px 24px; border: none; 
    border-radius: 6px; font-size: 1rem; font-weight: bold; cursor: pointer; letter-spacing: 1px;
    display: inline-block; margin-bottom: 15px; width: 80%; box-sizing: border-box;
}
.creator-section input[type="file"] { display: none; }

/* 📸 上傳預覽區塊的多圖排版 (等比例完整顯示) */
.photo-gallery {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; text-align: left;
}
.photo-gallery img { 
    max-width: 100%; height: auto; max-height: 120px; 
    border-radius: 6px; border: 1px solid #333; 
}

.diary-input {
    width: 90%; background: #0c0c0c; border: 1px solid #333; color: #fff;
    padding: 12px; border-radius: 8px; font-size: 0.95rem; resize: vertical;
    min-height: 80px; margin-bottom: 15px; font-family: inherit; box-sizing: border-box;
}
.diary-input:focus { outline: none; border-color: var(--primary-gold); }

.save-btn {
    background: transparent; border: 1px solid var(--primary-gold); color: var(--primary-gold);
    padding: 10px 20px; border-radius: 6px; cursor: pointer; letter-spacing: 1px; transition: 0.3s;
}
.save-btn:hover { background: var(--primary-gold); color: #000; }

/* 歷史日記牆 */
.timeline-section { text-align: left; }
.timeline-title { color: var(--primary-gold); font-weight: 300; border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 20px; }
.diary-card {
    background: #1a1a1a; border-radius: 10px; overflow: hidden; margin-bottom: 20px;
    border: 1px solid #2a2a2a; box-shadow: 0 4px 10px rgba(0,0,0,0.5); padding: 15px;
}

/* 📸 歷史日記牆的多圖排版 (等比例完整顯示) */
.diary-card-gallery { 
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; 
}
.diary-card-gallery img { 
    max-width: 100%; height: auto; max-height: 300px; /* 限制最高高度，避免直式照片佔滿螢幕 */
    border-radius: 6px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.3); /* 加上微小陰影增加質感 */
}

.diary-date { font-size: 0.75rem; color: #888; margin-bottom: 8px; }
.diary-text { font-size: 0.95rem; color: #ddd; line-height: 1.5; white-space: pre-wrap; margin:0;}

/* =========================================
   3. 隱藏式導覽選單 (Hidden Menu)
   ========================================= */
/* 右上角漢堡按鈕 */
.menu-toggle-btn {
    position: fixed; top: 20px; right: 20px;
    width: 45px; height: 45px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--primary-gold); border-radius: 50%;
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px;
    cursor: pointer; z-index: 2000; /* 確保在最上層 */
    transition: all 0.3s ease; backdrop-filter: blur(5px);
}
.menu-toggle-btn span {
    width: 22px; height: 2px; background-color: var(--primary-gold); transition: 0.3s;
}
.menu-toggle-btn:hover { background: var(--primary-gold); }
.menu-toggle-btn:hover span { background-color: var(--bg-dark); }

/* 側邊滑出面板 */
.hidden-menu-panel {
    position: fixed; top: 0; right: -100%; /* 預設隱藏在畫面右側外 */
    width: 250px; height: 100%;
    background: rgba(12, 12, 12, 0.95);
    border-left: 1px solid #333; z-index: 1999;
    display: flex; flex-direction: column; padding-top: 80px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* 電影感滑順動態 */
    box-shadow: -5px 0 20px rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
}
.hidden-menu-panel.open { right: 0; /* 滑入畫面 */ }

/* 選單內的連結按鈕 */
.menu-link {
    color: var(--text-light); text-decoration: none; font-size: 1.1rem;
    padding: 20px 30px; letter-spacing: 2px; border-bottom: 1px solid #222;
    transition: all 0.3s; display: block;
}
.menu-link:hover {
    color: var(--primary-gold); background: rgba(230, 194, 128, 0.1);
    padding-left: 40px; /* 懸停時的細微位移效果 */
}