/* --- Global Style Overhaul --- */
:root {
    --bg-dark-blue: #000000;
    --text-primary: #EAEAEA;
    --text-secondary: #a0aec0;
    --accent-pink: #FFB7C5;
    --accent-purple: #C3AED6;
    --font-heading: 'Exo 2', sans-serif;
    --font-body: 'Noto Sans SC', sans-serif;
    /* [MODIFIED] New chat variables */
    --chat-answer-bg: #2a2f4d;
    --chat-question-bg: #4a436a;
    --chat-border: rgba(195, 174, 214, 0.2);
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-dark-blue);
    margin: 0;
    overflow-x: hidden;
    position: relative; 
}

/* --- Canvas 背景样式 --- */
#interactive-grid-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}


/* --- Layout & Structure --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 1rem;
    z-index: 50;
    background-color: rgba(10, 15, 30, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
nav {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
section {
    padding: 8rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#home {
    justify-content: center;
    align-items: flex-start;
    padding-left: 6rem;
    padding-top: 1rem;
}
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

/* --- Animation Keyframes --- */
@keyframes breathing-glow {
    0%, 100% {
        text-shadow: 0 0 8px rgba(234, 234, 234, 0.2), 0 0 20px var(--accent-purple);
    }
    50% {
        text-shadow: 0 0 12px rgba(234, 234, 234, 0.3), 0 0 30px var(--accent-purple);
    }
}

/* --- Typography & Effects --- */
.logo {
    font-family: var(--font-heading);
    font-size: 1.875rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    text-shadow: 0 0 8px rgba(234, 234, 234, 0.2), 0 0 20px var(--accent-purple);
}
.gradient-text {
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-purple), #a7d8de);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: breathing-glow 4s ease-in-out infinite;
}
.hero-heading, .section-heading {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    color: white;
    line-height: 1.2;
    text-shadow: 0 0 8px rgba(234, 234, 234, 0.2), 0 0 20px var(--accent-purple);
}
.hero-subheading, .section-subheading {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-top: -2rem;
}

/* --- Components --- */
.nav-links {
    display: flex;
    gap: 2.5rem;
    font-size: 1.125rem;
}
.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}
.nav-link:hover {
    color: white;
    text-shadow: 0 0 10px var(--accent-pink);
}

/* --- Call to Action Button (Consolidated) --- */
.button-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--accent-pink);
    color: var(--text-primary);
    background: rgba(255, 183, 197, 0.1);
    border-radius: 9999px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(.4,2,.6,1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}
.button-cta:hover {
    color: white;
    background-color: rgba(255, 183, 197, 0.2);
    box-shadow: 0 0 20px var(--accent-pink);
    transform: translateY(-2px);
}
.button-cta-text {
    transition: transform 0.3s ease;
}
.button-cta-arrow {
    display: inline-block;
    margin-left: 0.5em;
    opacity: 0;
    width: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}
.button-cta:hover .button-cta-arrow {
    opacity: 1;
    width: 1.5em; 
    transform: translateX(0);
}
.button-cta.large {
    margin-top: 2.5rem;
    padding: 1rem 2rem;
    font-size: 1.25rem;
}

/* --- Particle Canvas --- */
#particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    cursor: crosshair;
}
.hero-content {
    position: relative;
    z-index: 2;
}

/* --- Scrolling Gallery (Re-styled like karot.jiejoe.com) --- */
.scroller-wrapper { width: 100%; display: flex; flex-direction: column; gap: 2rem; }
@keyframes scroll-ltr { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes scroll-rtl { 0% { transform: translateX(-50%); } 100% { transform: translateX(0); } }
.scroller { 
    width: 100%; 
    overflow: hidden; 
    -webkit-mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent); 
    mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent); 
}
.scroller-inner { 
    display: flex; 
    flex-wrap: nowrap; 
    width: max-content; 
    animation-duration: 60s; 
    animation-timing-function: linear; 
    animation-iteration-count: infinite; 
}
.scroller-ltr .scroller-inner { animation-name: scroll-ltr; }
.scroller-rtl .scroller-inner { animation-name: scroll-rtl; }
.scroller:hover .scroller-inner { animation-play-state: paused; }

.scroller-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    margin: 0 1rem;
    flex-shrink: 0;
    transition: all 0.4s ease;
}
.scroller-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}
.scroller-img {
    height: 220px;
    width: 380px;
    object-fit: cover;
    border-radius: 0.75rem;
    transition: all 0.4s ease;
}
.scroller-item:hover .scroller-img {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 15px var(--accent-pink);
}


/* --- [UPDATED] FAQ Section Styles --- */
.chat-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.chat-turn {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.chat-bubble {
    max-width: 80%;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--chat-border);
    position: relative;
}
.chat-bubble p, .chat-bubble h3 {
    margin: 0;
}
/* Question bubble (User, on the right) */
.chat-bubble.question {
    background-color: var(--chat-question-bg);
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.chat-bubble.question:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(74, 67, 106, 0.5);
}
.chat-bubble.question h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}
/* Answer bubble (Bot, on the left) */
.chat-bubble.answer {
    background-color: var(--chat-answer-bg);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    /* --- Hidden by default --- */
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    margin-top: 0;
    overflow: hidden;
    transform: translateX(-20px);
    transition: all 0.5s ease-in-out;
}
.chat-bubble.answer p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}
/* --- Active state to show the answer --- */
.chat-turn.active .chat-bubble.answer {
    opacity: 1;
    max-height: 500px; /* Large enough to not clip content */
    padding: 1rem 1.5rem;
    border-width: 1px;
    transform: translateX(0);
    margin-top: 0.75rem; /* [FIX] Add margin-top only when visible to create space */
}


/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    header { padding: 1rem 1.5rem; }
    .logo { position: static; font-size: 1.6rem; }
    nav .button-cta { position: relative; right: 1.9rem; }
    #home { 
        padding-left: 2rem; 
        padding-top: 4rem; 
        justify-content: flex-start; 
        align-items: center; 
        text-align: center; 
        overflow: visible;
    }
    .hero-subheading { margin-left: auto; margin-right: auto; margin-top: 2rem; }
    .nav-links { display: none; }
    .scroller-img { height: 150px; width: 260px; }
    
    /* [MODIFIED] Chat Responsive */
    .chat-bubble { max-width: 90%; }
    .chat-bubble.question h3 { font-size: 1.1rem; }
    .chat-bubble.answer p { font-size: 1rem; }
}

/* --- Companion Section --- */
#companion {
    position: relative;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    background-color: var(--bg-dark-blue);
}
#companion-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}
.companion-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
#companion .section-subheading {
    margin-top: 1rem;
    margin-bottom: 1.5rem; /* 上移按钮 */
    text-shadow: 0 0 15px rgba(0,0,0,0.7);
}
#companion .section-heading {
    text-shadow: 0 0 15px rgba(0,0,0,0.7), 0 0 20px var(--accent-purple);
}

/*
=====================================
=== 篝火页脚样式 (全新版本) ===
=====================================
*/
.campfire-scene {
    position: relative;
    height: 600px; /* 您可以根据图片调整此高度 */
    background-image: url('p01.png'); /* 初始的暗场景图 */
    background-size: cover;
    background-position: center bottom;
    overflow: hidden;
}

/* 整个场景在黑暗状态下都可以点击 */
.campfire-scene.dark {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="orange" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.5 10c-1.7 0-3.2.8-4.2 2-1 1.2-1.8 2.8-1.8 4.5 0 1.7.8 3.2 2 4.2s2.8 1.8 4.5 1.8 3.2-.8 4.2-2c1-1.2 1.8-2.8 1.8-4.5 0-1.7-.8-3.2-2-4.2s-2.8-1.8-4.5-1.8zM14.5 10V3M12 5h5"/></svg>') 16 0, auto;
}

/* 黑色蒙版 */
.campfire-scene.dark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    transition: opacity 2s ease-in-out;
    z-index: 5;
    opacity: 1;
}

/* 探照灯光圈效果 */
.campfire-scene .spotlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(circle 200px at 50% 50%, transparent 10%, rgba(0,0,0,0.98) 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

/* 鼠标悬停在黑暗场景时，显示探照灯 */
.campfire-scene.dark:hover .spotlight {
    opacity: 1;
}

/* 点亮后的GIF场景图层 */
.campfire-lit-scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 确保GIF填满整个容器 */
    object-position: center bottom;
    opacity: 0; /* 初始时完全透明 */
    transition: opacity 2s ease-in-out;
    z-index: 20; /* 确保它在最上层 */
    pointer-events: none; /* 点亮后不再响应点击 */
}


/* --- 点亮后的状态 --- */
/* 隐藏黑暗蒙版 */
.campfire-scene.lit-up::before {
    opacity: 0;
}

/* 强制隐藏探照灯 */
.campfire-scene.lit-up .spotlight {
    opacity: 0 !important;
}

/* 显示点亮后的GIF场景 */
.campfire-scene.lit-up .campfire-lit-scene {
    opacity: 1;
}

/* 恢复默认鼠标指针 */
.campfire-scene.lit-up {
    cursor: default;
}
