/* ==========================================
   REROTA 核心視覺引擎 (已鎖死)
   ========================================== */
:root {
    --bg-deep: #2f2444; 
    --bg-primary: #51121A;
    --bg-light: #6B1A24;
    --text-gold: #EBFAD6;
    --text-gold-bright: #F8E4C9;
    --text-gold-dim: rgba(242, 205, 162, 0.7);
    --text-gold-subtle: rgba(242, 205, 162, 0.4);
    --border-gold: rgba(242, 205, 162, 0.08);
    --border-gold-hover: rgba(242, 205, 162, 0.15);
    --glass-bg: rgba(242, 205, 162, 0.02);
    --glass-bg-hover: rgba(242, 205, 162, 0.05);
    --ease-breath: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-primary) 40%, var(--bg-primary) 100%);
    background-attachment: fixed; /* 👑 加上這行，確保網頁滑動時背景不會斷層 */
    color: var(--text-gold);
    line-height: 1.8;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* 1. 背景宇宙動效 */
.star-field { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: hidden; }
.star { position: absolute; width: 2px; height: 2px; background: var(--text-gold); border-radius: 50%; opacity: 0; animation: starTwinkle 4s infinite ease-in-out; }
@keyframes starTwinkle { 0%, 100% { opacity: 0; transform: scale(0.5); } 50% { opacity: 0.6; transform: scale(1); } }

.energy-rays { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; opacity: 0.15; background: radial-gradient(ellipse at 20% 50%, rgba(242, 205, 162, 0.1) 0%, transparent 50%), radial-gradient(ellipse at 80% 50%, rgba(242, 205, 162, 0.08) 0%, transparent 50%); animation: rayBreath 8s infinite ease-in-out; }
@keyframes rayBreath { 0%, 100% { opacity: 0.1; transform: scale(1); } 50% { opacity: 0.2; transform: scale(1.05); } }

.energy-line { position: absolute; height: 1px; background: linear-gradient(90deg, transparent, rgba(242, 205, 162, 0.3), transparent); width: 100%; animation: flowLine 12s infinite linear; }
@keyframes flowLine { 0% { transform: translateX(-100%); opacity: 0; } 50% { opacity: 0.5; } 100% { transform: translateX(100%); opacity: 0; } }

/* 2. 頂級 SaaS 導航欄 */
nav.rerota-navbar { position: fixed; top: 0; left: 0; right: 0; padding: 1.5rem 3rem; display: flex; justify-content: space-between; align-items: center; z-index: 1000; background: linear-gradient(180deg, rgba(47, 36, 68, 0.9) 0%, rgba(47, 36, 68, 0) 100%); backdrop-filter: blur(8px); }
.nav-left .nav-logo {
    display: inline-block;
    width: 130px; /* 你可以隨時在這裡調整 Logo 的大小 */
    height: 40px;
    background-color: var(--text-gold); /* 完美綁定你的奶油淡金色變數 */
    -webkit-mask-image: url('../Rerota Logo.png'); /* 注意這裡的路徑 */
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: left center;
    mask-image: url('../Rerota Logo.png');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: left center;
    animation: logoImagePulse 4s infinite ease-in-out;
}

/* 針對圖片，我們將文字發光 (text-shadow) 改為形狀發光 (drop-shadow) */
@keyframes logoImagePulse {
    0%, 100% { opacity: 0.8; filter: drop-shadow(0 0 8px rgba(242, 205, 162, 0.2)); }
    50% { opacity: 1; filter: drop-shadow(0 0 25px rgba(242, 205, 162, 0.5)); }
}

.nav-center { display: flex; gap: 2.5rem; position: absolute; left: 50%; transform: translateX(-50%); }
.nav-link { font-family: 'Inter', sans-serif; font-size: 0.75rem; font-weight: 400; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-gold-dim); text-decoration: none; transition: color 0.4s var(--ease-out-expo); position: relative; }
.nav-link:hover, .nav-link.active { color: var(--text-gold-bright); }
.nav-link.active::after { content: ''; position: absolute; bottom: -6px; left: 0; width: 100%; height: 1px; background: var(--text-gold-bright); box-shadow: 0 0 8px var(--text-gold-bright); }

.nav-right { display: flex; align-items: center; gap: 1.5rem; }
.icon-btn { background: transparent; border: none; color: var(--text-gold-dim); font-size: 1.2rem; cursor: pointer; transition: transform 0.3s, color 0.3s; }
.icon-btn:hover { color: var(--text-gold-bright); transform: scale(1.1); }

.auth-section { display: flex; align-items: center; }
.login-btn { font-family: 'Inter', sans-serif; font-size: 0.7rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-gold); background: var(--glass-bg); border: 1px solid var(--border-gold-hover); padding: 0.6rem 1.5rem; cursor: pointer; transition: all 0.6s var(--ease-out-expo); }
.login-btn:hover { background: var(--text-gold); color: var(--bg-primary); border-color: var(--text-gold); box-shadow: 0 0 15px rgba(242, 205, 162, 0.2); }
.user-profile { display: flex; align-items: center; gap: 0.8rem; cursor: pointer; padding: 0.3rem 0.8rem; border-radius: 30px; border: 1px solid transparent; transition: all 0.3s; }
.user-profile:hover { border-color: var(--border-gold-hover); background: var(--glass-bg-hover); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--text-gold-subtle); object-fit: cover; }
.user-name { font-family: 'Inter', sans-serif; font-size: 0.8rem; color: var(--text-gold-bright); letter-spacing: 0.05em; }

/* 3. Hero 區塊與全幅原圖排版 */
.hero {
    min-height: 100vh; /* 取消限制，讓圖片自由撐開高度 */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8rem 2rem 4rem;
    position: relative;
    z-index: 10;
}

.hero-logo-container {
    position: relative;
    margin-bottom: 4rem; /* 稍微加大與按鈕的距離，讓畫面有呼吸感 */
}

.hero-logo {
    width: 120px;
    height: 120px;
    animation: logoPulse 4s infinite ease-in-out;
}
/* ==========================================
   Hero 區塊文字排版 (模仿現代 SaaS 指揮中心)
   ========================================== */
.hero-text-wrapper {
    margin-bottom: 3rem; /* 與下方 Try Rerota 按鈕保持優雅的呼吸空間 */
    max-width: 1200px;
    width: 100%;
}

/* 👑 大標題：古典襯線體 */
.hero-headline {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    font-weight: 300;
    color: var(--text-gold);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
@media (max-width: 768px) {
    .hero-headline {
        white-space: normal;
        font-size: 2rem; /* 手機上的適中大小 */
    }
}

/* 👑 大標題漸變高光字 (完美模仿你截圖的重點突顯效果) */
.highlight-text {
    font-weight: 500;
    background: linear-gradient(to right, #F8E4C9, #EBB668);
    -webkit-background-clip: text;
    background-clip: text; /* 👑 加上這行標準語法，消除黃燈 */
    -webkit-text-fill-color: transparent;
    color: transparent;    /* 👑 搭配標準語法的文字透明設定 */
    text-shadow: 0 0 30px rgba(242, 205, 162, 0.2);
}

/* 👑 兩行小字解說：現代無襯線體，確保極致清晰 */
.hero-subtext {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    font-weight: 300;
    color: var(--text-gold-dim);
    line-height: 1.8;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

/* ==========================================
   補回：神聖幾何 Logo 旁邊的閃爍匯聚線
   ========================================== */
.convergence-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--text-gold), transparent);
    opacity: 0.3;
    animation: convergeLine 6s infinite ease-in-out;
}

.convergence-line.left {
    right: 100%;
    top: 46%;
    width: 200px;
    transform-origin: right center;
}

.convergence-line.right {
    left: 100%;
    top: 46%;
    width: 200px;
    transform-origin: left center;
}

@keyframes convergeLine {
    0%, 100% { transform: scaleX(0.5); opacity: 0.2; }
    50% { transform: scaleX(1); opacity: 0.4; }
}

/* 按鈕樣式 (維持你原本的發光設定) */
.cta-button { 
    font-family: 'Inter', sans-serif; 
    font-size: 0.85rem; 
    font-weight: 500; 
    letter-spacing: 0.15em; 
    text-transform: uppercase; 
    color: var(--bg-primary); 
    background: var(--text-gold); 
    border: none; 
    padding: 1.2rem 3.5rem; 
    cursor: pointer; 
    transition: all 0.6s var(--ease-out-expo); 
    animation: ctaPulse 3s infinite ease-in-out; 
}
@keyframes ctaPulse { 
    0%, 100% { box-shadow: 0 0 20px rgba(242, 205, 162, 0.2); } 
    50% { box-shadow: 0 0 40px rgba(242, 205, 162, 0.4); } 
}
.cta-button:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 10px 40px rgba(242, 205, 162, 0.3); 
}

/* 4. 通用區塊排版 (段落容器、發光卡片) */
.section-energy-line { position: absolute; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent 0%, rgba(242, 205, 162, 0.2) 50%, transparent 100%); animation: sectionFlow 8s infinite linear; }
@keyframes sectionFlow { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.standard-section { padding: 8rem 2rem; position: relative; z-index: 10; overflow: hidden; }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-eyebrow { font-family: 'Inter', sans-serif; font-size: 0.65rem; font-weight: 500; letter-spacing: 0.4em; text-transform: uppercase; color: var(--text-gold-subtle); margin-bottom: 1.5rem; }
.section-title { font-family: 'Cormorant Garamond', serif; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 400; letter-spacing: 0.1em; color: var(--text-gold); margin-bottom: 1.5rem; }
.section-body { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; font-weight: 300; color: var(--text-gold-dim); max-width: 700px; margin: 0 auto; line-height: 2; }

/* 網格卡片系統 */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; max-width: 1200px; margin: 4rem auto 0; }
.glass-card { background: var(--glass-bg); border: 1px solid var(--border-gold); padding: 3rem 2rem; transition: all 0.6s var(--ease-out-expo); position: relative; overflow: hidden; }
.glass-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--text-gold), transparent); opacity: 0; transition: opacity 0.6s; }
.glass-card:hover { background: var(--glass-bg-hover); border-color: var(--border-gold-hover); transform: translateY(-5px); }
.glass-card:hover::before { opacity: 0.5; animation: cardLineFlow 3s infinite linear; }
@keyframes cardLineFlow { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.card-icon { width: 50px; height: 50px; margin-bottom: 1.5rem; opacity: 0.7; }
.card-title { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; font-weight: 400; color: var(--text-gold); margin-bottom: 1rem; letter-spacing: 0.05em; }
.card-copy { font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 300; color: var(--text-gold-dim); line-height: 1.9; }

/* 5. 頁尾 */
footer { padding: 4rem 2rem; text-align: center; position: relative; z-index: 10; border-top: 1px solid var(--border-gold); }
.footer-logo { width: 40px; height: 40px; margin: 0 auto 1.5rem; opacity: 0.5; }
.footer-tagline { font-family: 'Cormorant Garamond', serif; font-size: 0.9rem; font-style: italic; color: var(--text-gold-subtle); margin-bottom: 2rem; }
.footer-links { display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; }
.footer-links a { font-family: 'Inter', sans-serif; font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-gold-dim); text-decoration: none; transition: color 0.4s; }
.footer-links a:hover { color: var(--text-gold); }

/* ==========================================
   AI 靈魂陪聊區塊 (Dark/Burgundy Mode)
   ========================================== */
#rerota-chat-container {
    width: 100%;
    max-width: 800px;
    margin-top: 4rem; /* 與上方 Try Rerota 按鈕保持距離 */
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

#rerota-chat-wrapper {
    background: #2f2444; /* 深邃玻璃背板 */
    border: 1px solid var(--border-gold-hover);
    border-radius: 12px;
    padding: 2rem;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 50px rgba(12, 12, 12, 0.3);
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-family: "Cormorant Garamond", "Noto Serif SC", serif;
}

#rerota-chat-history {
    min-height: 250px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-right: 10px;
    scroll-behavior: smooth;
}

#rerota-chat-history::-webkit-scrollbar { width: 4px; }
#rerota-chat-history::-webkit-scrollbar-thumb { background: var(--border-gold-hover); border-radius: 4px; }

.message { line-height: 1.8; font-size: 1.05rem; letter-spacing: 0.05em; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.user-message { align-self: flex-end; color: var(--text-gold); background: #D9AE83(107, 26, 36, 0.3); border-right: 2px solid var(--text-gold-dim); padding: 10px 15px; max-width: 80%; text-align: right; border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 0.9rem;}
.ai-message { 
    align-self: flex-start; 
    color: var(--text-gold-bright); 
    border-left: 2px solid var(--text-gold-dim); 
    padding-left: 15px; 
    max-width: 90%; 
    /* 👑 下面是字體優化的關鍵 */
    font-family: 'Inter', sans-serif; /* 換成跟客戶一樣乾淨的無襯線字體 */
    font-style: normal; /* 取消斜體，讓長篇文章閱讀不費力 */
    font-size: 0.95rem; /* 字體微調，確保清晰度 */
    font-weight: 300; /* 使用較輕的字重，保持高級感 */
    line-height: 1.9; /* 拉開行距，讓文字有呼吸空間 */
    white-space: pre-wrap; /* 👑 核心修復：強制保留 AI 的原生換行與段落間距 */
    word-break: break-word; /* 確保長單字不會撐破聊天框 */
}

.typing-cursor { display: inline-block; width: 2px; height: 16px; background-color: var(--text-gold-bright); animation: blink 1s step-end infinite; margin-left: 4px; vertical-align: middle; }
@keyframes blink { 50% { opacity: 0; } }

#rerota-input-area { display: flex; align-items: center; border-bottom: 1px solid var(--border-gold-hover); padding-bottom: 8px; transition: border-color 0.3s ease; }
#rerota-input-area:focus-within { border-bottom: 1px solid var(--text-gold-bright); }
#rerota-input { flex: 1; border: none; background: transparent; font-size: 1rem; color: var(--text-gold); outline: none; font-family: 'Inter', sans-serif; padding: 10px 5px; }
#rerota-input::placeholder { color: var(--text-gold-subtle); font-style: italic; }
#rerota-input:disabled { cursor: not-allowed; }

#rerota-send { background: transparent; border: none; color: var(--text-gold-dim); font-size: 1.5rem; cursor: pointer; transition: transform 0.2s, color 0.3s; padding: 0 10px; }
#rerota-send:hover { transform: scale(1.2); color: var(--text-gold-bright); }
#rerota-send:disabled { color: var(--text-gold-subtle); cursor: not-allowed; transform: none; }

/* 👑 鎖定遮罩樣式 */
#chat-lock-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #51121A; backdrop-filter: blur(8px); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 2rem; z-index: 20; transition: opacity 0.5s ease; }
#chat-lock-overlay p { font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; color: var(--text-gold); margin-bottom: 1.5rem; }
.chat-unlocked #chat-lock-overlay { opacity: 0; pointer-events: none; }

/* ==========================================
   行動裝置 (Mobile) 專屬響應式修復 (極致融合版)
   ========================================== */

/* 1. 隱藏預設的桌面端選單，加入漢堡按鈕 */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-gold-bright);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1001;
}

@media (max-width: 900px) {
    /* 👑 核心修復 1：恢復高奢漸層退暈，徹底移除死板的純紫色大色塊與底線 */
    nav.rerota-navbar {
        padding: 1.5rem !important;
        background: linear-gradient(180deg, rgba(47, 36, 68, 0.9) 0%, transparent 100%) !important;
        backdrop-filter: blur(4px) !important; /* 降低模糊度，讓它邊界柔和地融入星空 */
        border-bottom: none !important;
        align-items: flex-start !important;
    }

    /* 👑 核心修復 2：滿版優雅淡入的選單 (不再受限於導覽列那一塊) */
    .nav-center {
        display: none !important;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(20, 10, 25, 0.98);
        backdrop-filter: blur(20px);
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        z-index: 999;
    }

    .nav-center.active {
        display: flex !important;
        animation: fadeInMenu 0.4s ease forwards;
    }

    @keyframes fadeInMenu {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    .nav-link {
        font-size: 1.5rem !important;
    }

    .mobile-menu-toggle {
        display: block;
        position: relative;
        z-index: 1002; /* 確保漢堡按鈕在滿版選單之上，隨時可點擊關閉 */
    }

    .nav-right {
        gap: 1rem;
        z-index: 1001;
    }

    /* 👑 核心修復 3：釋放 Logo 空間！往下推並微調大小，展現精緻比例 */
    .hero {
        padding-top: 12rem !important; /* 大幅往下推，徹底避開頂部任何漸層 */
    }

    .hero-logo {
        width: 90px !important; /* 手機端稍微縮小，更顯高奢精緻，不擁擠 */
        height: 90px !important;
    }

    .hero-headline {
        white-space: normal !important; 
        font-size: 2.2rem !important;
    }

    /* 其他頁面也同步增加頂部空間 */
    .standard-section, .dashboard-section, .shop-section, .market-hero, .auth-section, .contact-section, .legal-section {
        padding-top: 8rem !important;
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}
/* ==========================================
           REROTA 全局行銷區塊 (根據品牌白皮書量身打造)
           ========================================== */
        .rerota-marketing-section {
            background: radial-gradient(ellipse at 50% 50%, rgba(81, 18, 26, 0.1) 0%, transparent 60%); 
        }

        .marketing-energy-overlay {
            animation: marketingEnergyBreath 8s infinite var(--ease-breath); 
        }

        @keyframes marketingEnergyBreath {
            0%, 100% { opacity: 0.3; transform: scale(1); }
            50% { opacity: 0.5; transform: scale(1.03); }
        }

        .marketing-card {
            background: rgba(47, 36, 68, 0.3) !important; 
            border-color: rgba(242, 205, 162, 0.08) !important; 
            transition: all 0.6s var(--ease-out-expo); 
            display: flex;
            flex-direction: column;
            align-items: flex-start;
        }

        .marketing-card:hover {
            background: rgba(81, 18, 26, 0.1) !important; 
            border-color: rgba(242, 205, 162, 0.15) !important; 
            transform: translateY(-5px) scale(1.02); 
            box-shadow: 0 20px 50px rgba(0,0,0,0.3); 
        }

        .marketing-icon-wrapper {
            transition: all 0.4s var(--ease-breath); 
        }

        .marketing-card:hover .marketing-icon-wrapper {
            background: rgba(242, 205, 162, 0.1) !important; 
            border-color: rgba(242, 205, 162, 0.2) !important; 
            transform: rotate(-10deg) scale(1.1); 
            color: var(--text-gold-bright) !important; 
        }

        .marketing-cta-wrapper {
            animation: ctaWrapperPulse 3s infinite var(--ease-breath); 
        }

        @keyframes ctaWrapperPulse {
            0%, 100% { text-shadow: 0 0 15px rgba(242, 205, 162, 0.3); }
            50% { text-shadow: 0 0 30px rgba(242, 205, 162, 0.5); }
        }