/* ==========================================================================
   Palette: Earthy Calm (優化版) - User Provided CSS
   ========================================================================== */
:root {
    /* 1. 基礎色 (Base Colors) */
    --color-bg-body: #fbf7f2;         /* 奶油白背景 */
    --color-bg-card: #ffffff;         /* 卡片背景 */
    --color-bg-secondary: #faf7f2;    /* 略深/暖的背景 (用於區塊分隔) */
    --color-border-soft: #efe6d8;     /* 柔和邊框 */
    --color-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);

    /* 2. 文字色 (Text Colors) */
    --color-text-primary: #3a3a3a;    
    --color-text-secondary: #6b6b6b;  
    --color-text-muted: #a09a93;      /* 靜音/提示文字 */
    --color-text-link-hover: #1e70bf; 

    /* 3. 主題色 (Accent Colors) */
    --color-accent-main: #d6b98c;     /* 奶茶金 */
    --color-accent-main-dark: #c3a36f;
    --color-accent-main-text: #a4855d;

    /* 4. 輔助色 (Utility Colors) */
    --color-utility-blue: #cfdde6;    
    --color-utility-green: #d9e5d8;   
}

/* ==========================================================================
   A. 全域樣式 (Global Styles)
   ========================================================================== */
body {
    background-color: var(--color-bg-body);
    color: var(--color-text-primary);
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
}

/* 捲軸優化 */
.custom-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px; /* Added height for horizontal scroll */
}
.custom-scroll::-webkit-scrollbar-track {
    background: var(--color-bg-body);
}
.custom-scroll::-webkit-scrollbar-thumb {
    background: var(--color-border-soft);
    border-radius: 3px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ==========================================================================
   B. 元件樣式 (Components)
   ========================================================================== */

/* 活躍標籤 */
.tab-active {
    border-bottom: 3px solid var(--color-accent-main-dark) !important;
    color: var(--color-accent-main-text) !important; 
    font-weight: 600;
    padding-bottom: 0.5rem;
}

/* 卡片懸停 */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--color-shadow);
    border: 1px solid var(--color-border-soft); /* Ensure border uses var */
}
.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* 景點連結 */
.attraction-link {
    transition: color 0.2s ease;
}
.attraction-link:hover {
    color: var(--color-accent-main-text);
    text-decoration: underline;
}

/* 天氣卡片 */
.weather-card {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border-soft);
    border-radius: 0.5rem;
    padding: 0.75rem 0.5rem;
    text-align: center;
}
.weather-icon { font-size: 1.6rem; margin-bottom: 0.25rem; }
.weather-date { font-size: 0.75rem; color: var(--color-text-muted); }
.weather-temp { font-size: 1rem; font-weight: 600; }

/* 圖表容器 */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    height: 320px;
}

/* ==========================================================================
   C. 動畫 (Animations)
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ==========================================================================
   D. 響應式優化 (Mobile UX Optimizations)
   ========================================================================== */
@media (max-width: 768px) {
    /* 標題縮小 */
    h1 { font-size: 1.8rem !important; }

    /* 導航列改為橫向滑動 - Matching User CSS Selector */
    nav ul {
        display: flex;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
        gap: 1rem;
        padding-bottom: 0.5rem;
        list-style: none;
        padding-left: 0;
        margin-bottom: 0;
    }
    nav ul li { flex-shrink: 0; }
    
    /* Remove scrollbar for cleaner look on mobile if desired, or keep custom-scroll */
    nav ul::-webkit-scrollbar { display: none; } 

    /* 圖表高度調整 */
    .chart-container { height: 280px; }
}

/* 置頂按鈕樣式 */
.scroll-to-top-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 50;
    background-color: transparent;
    color: #4f46e5;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    border: 2px solid #a5b4fc;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Helper utility to force Tailwind to use CSS vars */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.bg-body { background-color: var(--color-bg-body); }
.bg-card { background-color: var(--color-bg-card); }
.border-soft { border-color: var(--color-border-soft); }
