* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    height: 100%;
    font-family: 'Helvetica Neue', Arial, 'LiHei Pro', '微軟正黑體', sans-serif;
    overflow: hidden; /* 防止側邊欄滑出時產生滾動條 */
}

/* 地圖全螢幕 */
#map {
    width: 100%;
    height: 100%;
    z-index: 1; /* 層級低於側邊欄 */
}

/* 60% 側邊欄設計 */
#sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background-color: #fcfbf7; /* 帶點大地色調的米白背景 */
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1000; /* 確保蓋在地圖上方 */
    padding: 40px;
    overflow-y: auto;
    
    /* 動畫核心：預設推到畫面右側外 */
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 側邊欄開啟狀態的 Class */
#sidebar.active {
    transform: translateX(0);
}

/* 側邊欄內部排版 */
#close-btn {
    background: none;
    border: 1px solid #ccc;
    padding: 8px 12px;
    cursor: pointer;
    float: right;
    border-radius: 4px;
}

#close-btn:hover {
    background: #eee;
}

h2 { margin-top: 10px; color: #2c3e50; }
h3 { margin-top: 25px; color: #4b6b50; border-bottom: 2px solid #e0e0e0; padding-bottom: 5px; }
p { line-height: 1.6; color: #555; margin-top: 10px; }
.tag { display: inline-block; background: #e8f5e9; color: #2e7d32; padding: 4px 8px; border-radius: 12px; font-size: 0.9em; }
.meta-info { font-size: 0.9em; color: #888; margin-top: 30px; }


/* ==========================================
   左側導覽選單設計 (Nav Sidebar)
========================================== */

/* 導覽列按鈕 (浮動於左上角) */
/* 導覽列按鈕 (浮動於左上角) */
#menu-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 9999; /* 從 1000 改為 9999，突破地圖的限制 */
    background-color: white;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 20px;
    color: #333; /* 確保文字是深色 */
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#menu-btn:hover {
    background-color: #f4f4f4;
}

/* 左側導覽選單主體 */
#nav-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px; /* 寬度設窄一點，不遮擋地圖 */
    height: 100%;
    background-color: #fcfbf7;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    z-index: 1001; /* 必須高於漢堡按鈕 */
    padding: 30px;
    overflow-y: auto;
    
    /* 動畫核心：預設推到畫面左側外 (負數) */
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 開啟狀態 */
#nav-sidebar.active {
    transform: translateX(0);
}

/* 選單內的關閉按鈕 */
#nav-close-btn {
    background: none;
    border: 1px solid #ccc;
    padding: 8px 12px;
    cursor: pointer;
    float: right;
    border-radius: 4px;
}

#nav-close-btn:hover {
    background: #eee;
}

/* 內容區塊卡片化設計 */
.nav-content h2 {
    margin-top: 10px;
    margin-bottom: 30px;
    color: #2c3e50;
}

.nav-section {
    margin-bottom: 25px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.nav-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: none; /* 覆蓋原有 h3 設定 */
    color: #4b6b50;
}

.nav-section p {
    font-size: 0.95em;
    margin-top: 5px;
}



/* ==========================================
   客製化地圖標記 (放大版)
========================================== */
.custom-herb-icon {
    background: none;
    border: none;
}

.marker-pin {
    width: 48px;  /* 從 36px 放大至 48px */
    height: 48px; /* 從 36px 放大至 48px */
    background-color: #4b6b50;
    color: white;
    border: 3px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px; /* emoji 也跟著放大 */
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}

.marker-pin:hover {
    transform: scale(1.15) translateY(-5px);
    background-color: #5c8563;
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

/* ==========================================
   台灣縣市中文名稱標籤 (Tooltips)
========================================== */
.county-label {
    background: transparent;
    border: none;
    box-shadow: none;
    font-weight: bold;
    color: #2c3e50;
    /* 加上白色光暈文字陰影，確保在各種底圖上都清晰可見 */
    text-shadow: 2px 2px 3px white, -2px -2px 3px white, 2px -2px 3px white, -2px 2px 3px white;
    font-size: 15px;
    pointer-events: none; /* 確保文字不會阻擋滑鼠點擊行政區 */
    transition: opacity 0.4s ease; /* 隱藏時的平滑淡出動畫 */
}

/* 當點擊行政區後，地圖容器會被加上 hide-labels 類別，此時將透明度歸零 */
#map.hide-labels .county-label {
    opacity: 0 !important;
}