/* =========================================
   1. 基礎覆寫與全站背景
   ========================================= */
.md-main__inner { margin: 0; padding: 0; max-width: 100%; }
.md-content { max-width: 100%; }
body { 
    font-family: 'Palatino Linotype', 'Times New Roman', serif; 
    color: #d1d5db; 
    overflow-x: hidden; scroll-behavior: smooth; 
    background-color: #0f1115;
    background-image: linear-gradient(rgba(12, 14, 18, 0.85), rgba(12, 14, 18, 0.85)), url('../images/banner-night.png');
    background-size: cover; background-attachment: fixed; background-position: center;
}

/* 🚫 防止圖片被拖曳到桌面或新分頁 (防盜圖) */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    user-select: none;
}

/* =========================================
   2. 導覽列
   ========================================= */
#mainNav { position: fixed; top: 0; width: 100%; background: rgba(15, 17, 21, 0.95); backdrop-filter: blur(5px); padding: 15px 0; text-align: center; z-index: 1000; border-bottom: 1px solid #2a2d35; opacity: 0; pointer-events: none; transform: translateY(-20px); transition: opacity 0.6s ease, transform 0.6s ease; }
#mainNav.scrolled { opacity: 1; pointer-events: auto; transform: translateY(0); }
#mainNav a { color: #a3a8b4; text-decoration: none; margin: 0 20px; font-size: 16px; letter-spacing: 2px; transition: color 0.3s; cursor: pointer; }
#mainNav a:hover { color: #d4af37; }

/* =========================================
   3. 區塊共用與動畫設定
   ========================================= */
section { position: relative; overflow: hidden; }
section:not(#home) { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 80px 20px 40px; box-sizing: border-box; }
.container { max-width: 900px; width: 100%; }
h2 { font-size: 32px; color: #d4af37; border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 30px; }

.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-io { opacity: 0; transform: translateY(30px); transition: opacity 1s ease-in-out, transform 1s ease-out; }
.fade-io.visible { opacity: 1; transform: translateY(0); }

/* =========================================
   4. 首頁橫幅與文字
   ========================================= */
#home { 
    height: 100vh; width: 100vw; display: flex; align-items: center; justify-content: flex-start; position: relative; overflow: hidden;
    background-image: 
        linear-gradient(to right, rgba(15, 17, 21, 0.95) 0%, rgba(15, 17, 21, 0.4) 50%, transparent 100%),
        url('../images/hero-bg.jpg'); 
    background-size: cover; background-position: center; background-attachment: fixed;
}
.hero-text { position: relative; z-index: 10; text-align: left; padding-left: 10%; max-width: 50%; transition: opacity 0.1s; }
.hero-text h1 { font-size: 96px; letter-spacing: 12px; color: #e5e7eb; margin: 0 0 10px; text-shadow: 0 10px 30px rgba(0,0,0,0.8); }
.hero-text p { color: #d4af37; font-size: 28px; margin: 0; font-weight: bold; text-shadow: 0 5px 15px rgba(0,0,0,0.8); }

/* 首頁妮塔滑動進退場 */
#hero-nita { 
    position: absolute; bottom: 0; z-index: 5; right: 5%; 
    width: 45vw; min-height: 85vh; display: flex; align-items: flex-end; justify-content: center; 
    transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.8s ease-out; 
    transform: translateX(20vw); opacity: 0; 
}
#hero-nita.visible { transform: translateX(0); opacity: 1; }

/* =========================================
   5. 背景交錯立繪與光暈保護
   ========================================= */
.bg-nita { position: absolute; bottom: 0; width: 33.33vw; height: 85vh; z-index: 1; display: flex; align-items: flex-end; justify-content: center; }
.left-nita { left: 0; transform: translateX(-10%); }
.right-nita { right: 0; transform: translateX(10%); }
.bg-nita img { filter: drop-shadow(0 0 25px rgba(0, 0, 0, 0.9)); }

.cursor-glow { position: fixed; top: 0; left: 0; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, transparent 50%); pointer-events: none; transform: translate(-50%, -50%); z-index: 9999; transition: opacity 0.3s; opacity: 0; }

/* =========================================
   6. 妮塔設定區與毛玻璃
   ========================================= */
.profile-content { background: rgba(20, 22, 28, 0.85); backdrop-filter: blur(12px); padding: 40px; border-radius: 12px; line-height: 1.8; border-left: 4px solid #4a5568; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.social-links { margin-top: 30px; padding-top: 20px; border-top: 1px dashed #333; display: flex; gap: 15px; flex-wrap: wrap; }
.social-btn { display: inline-block; padding: 8px 16px; border-radius: 20px; font-size: 14px; text-decoration: none; letter-spacing: 1px; transition: all 0.3s ease; background: #1a1d24; color: #a0aec0; border: 1px solid #2a2d35; }
.social-btn:hover { transform: translateY(-2px); background: #2a2d35; color: #fff; border-color: #4a5568; }

/* =========================================
   7. 畫廊瀑布流 (自動滿版)
   ========================================= */
.gallery { column-width: 280px; column-gap: 25px; width: 100%; }
.gallery-card { background-color: rgba(26, 29, 36, 0.9); backdrop-filter: blur(8px); border-radius: 8px; overflow: hidden; cursor: pointer; position: relative; transition: transform 0.3s, box-shadow 0.3s; break-inside: avoid; margin-bottom: 25px; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.gallery-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.8); }
.card-img-container { width: 100%; position: relative; background-color: #2a2d35; height: auto; }
.gallery-img { width: 100%; height: auto; display: block; transition: transform 0.4s ease; }
.gallery-card:hover .gallery-img { transform: scale(1.03); }
.gallery-card::after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06)); background-size: 100% 4px, 3px 100%; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.gallery-card:hover::after { opacity: 1; }
.card-title { padding: 15px; font-weight: bold; color: #e2e8f0; text-align: center; }

/* =========================================
   8. 彈出視窗與彩蛋
   ========================================= */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); z-index: 2000; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s; }
.modal-overlay.active { display: flex; opacity: 1; }
.modal-content { background: #181a20; width: 90%; max-width: 800px; border-radius: 12px; overflow: hidden; display: flex; flex-wrap: wrap; position: relative; }
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 24px; color: #a0aec0; cursor: pointer; background: none; border: none; z-index: 30; }
.modal-img { flex: 1 1 300px; min-height: 300px; background: #2d3748; display: flex; align-items: center; justify-content: center; position: relative; }
.modal-text { flex: 1 1 300px; padding: 30px; line-height: 1.7; }
.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, 0.6); color: white; border: none; font-size: 20px; padding: 15px 10px; cursor: pointer; z-index: 20; transition: 0.3s; }
.prev-btn { left: 0; border-radius: 0 6px 6px 0; } .next-btn { right: 0; border-radius: 6px 0 0 6px; }

.companion { position: fixed; bottom: 30px; right: 30px; z-index: 1000; display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: opacity 0.5s ease-in-out; }
.emoji-icon { font-size: 24px; background: #1a1d24; border: 1px solid #333; border-radius: 50%; width: 45px; height: 45px; display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.5); transition: transform 0.3s, background 0.3s; }
.speech-bubble { background: #2d3748; color: #e2e8f0; padding: 10px 15px; border-radius: 8px; margin-bottom: 10px; font-size: 14px; opacity: 0; transform: translateY(10px); transition: 0.3s; pointer-events: none; max-width: 200px; text-align: center; border: 1px solid #4a5568; }
.companion.active .speech-bubble { opacity: 1; transform: translateY(0); }

/* RWD */
@media (max-width: 768px) {
    .hero-text { padding-left: 5%; max-width: 90%; text-align: left; }
    .hero-text h1 { font-size: 60px; }
    .hero-text p { font-size: 20px; }
    #hero-nita { width: 80vw; right: 0; }

    section:not(#home) { display: flex; flex-direction: column; justify-content: flex-start; padding: 80px 15px 40px; }
    .bg-nita { position: relative; width: 100%; height: 350px; opacity: 1 !important; z-index: 1; margin-bottom: -40px; }
    .bg-nita img { object-position: bottom center; }

    #about .right-nita { display: none; }
    #about .left-nita { transform: translateX(0); }
    #gallery .right-nita { transform: translateX(0); }

    .container { z-index: 10; position: relative; width: 100%; }
    .profile-content { padding: 25px 20px; backdrop-filter: blur(8px); }
    .gallery { column-width: 100%; column-gap: 15px; }
    .gallery-card { margin-bottom: 15px; }
}