@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;600;700&display=swap');

/* 🌟 核心：啟動平滑捲動，並預留頂部目錄的高度，避免跳轉時被目錄擋住標題 */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; 
}

:root {
  --bg-color: #FAFAFA;
  --text-main: #333333;
  --text-light: #666666;
  --accent-color: #2C3E50;
  --tip-bg: #F0F4F8;
  --tag-bg: #EAEAEA;
}

body {
  margin: 0; padding: 0;
  background-color: var(--bg-color);
  font-family: 'Noto Sans TC', sans-serif;
  color: var(--text-main);
  line-height: 1.8;
  font-size: 18px;
 /* overflow-x: hidden;  防止橫向滾動條破壞版面 */
}

/* ==========================================
   全新進階功能區塊 (進度條、動畫、導覽)
========================================== */

/* 1. 頂部閱讀進度條 */
.progress-container {
  width: 100%; height: 4px; background: transparent;
  position: fixed; top: 0; left: 0; z-index: 9999;
}
.progress-bar {
  height: 4px; background: var(--accent-color); width: 0%;
  border-top-right-radius: 2px; border-bottom-right-radius: 2px;
}

/* 2. 極簡導覽目錄 (修復手機版超出版面問題) */
.toc-nav {
  position: sticky; top: 0; z-index: 900;
  background: rgba(250, 250, 250, 0.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; gap: 15px;
  padding: 8px 20px; 
  border-bottom: 1px solid #EAEAEA;/*高度調整*/
  flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; justify-content: flex-start;

  /* 🌟 手機版橫向滑動設定 */
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; 
  justify-content: flex-start; /* 讓內容靠左開始，確保滑動順暢 */
}
.toc-nav::-webkit-scrollbar { display: none; }
.toc-nav a {
  text-decoration: none; color: var(--text-light);
  font-size: 0.95rem; font-weight: 600; padding: 4px 18px;
  border-radius: 20px; border: 1px solid transparent; 
  transition: all 0.3s ease; white-space: nowrap; /* 確保按鈕文字不折行 */
}
.toc-nav a:hover, .toc-nav a:active {
  background: #F4EFEB; color: var(--accent-color); border-color: var(--accent-color);
}
@media (min-width: 768px) {
  .toc-nav { justify-content: center; } /* 電腦版維持置中 */
}

/* ==========================================
   3. 沉浸式微動畫 (高階骨牌錯落版 Staggered Animation)
========================================== */

/* A. 拔除外層容器的動畫，將初始隱藏狀態「下放」給裡面的三個核心元素 */
.fade-in-up .spot-header,
.fade-in-up .image-secondary,
.fade-in-up .text-primary,
.trip-tip.fade-in-up { /* 兼容 Day蛙 的獨立提示區塊 */
  opacity: 0;
  transform: translateY(20px);
  filter: blur(3px); /* 保持電影感的失焦效果 */
  
  /* 設定統一的浮現速度與絲滑曲線 */
  transition: 
    opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), 
    transform 1.2s cubic-bezier(0.22, 1, 0.36, 1),
    filter 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    
  will-change: opacity, transform, filter;
}

/* B. 當 JS 判定外層進入畫面並加上 .visible 後，子元素依序解除隱藏 */

/* 第一棒：標題 (最先出現，0秒延遲) */
.fade-in-up.visible .spot-header {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition-delay: 0s; 
}

/* 第二棒：圖片 (延遲 0.2 秒出現，創造錯落感) */
.fade-in-up.visible .image-secondary {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition-delay: 0.2s; 
}

/* 第三棒：文字內文 (延遲 0.4 秒出現，等待讀者看完圖片) */
.fade-in-up.visible .text-primary {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition-delay: 0.4s; 
}

/* Day蛙 提示區塊的獨立動畫 (跟隨在段落之後出現) */
.trip-tip.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition-delay: 0.2s; 
}

/* ==========================================
   原有排版與佈局 (Hero, 文章, 側邊欄)
========================================== */

.hero-header {
  position: relative; width: 100%; height: 65vh; min-height: 450px;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  text-align: center; margin-bottom: 0;
}
.hero-header::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%); z-index: 1;
}
.hero-content { position: relative; z-index: 2; max-width: 900px; padding: 0 20px; }
.hero-content h1 {
  color: #FFFFFF; font-size: 2.8rem; font-weight: 700; letter-spacing: 2px;
  margin-bottom: 20px; line-height: 1.3;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 4px 15px rgba(0,0,0,0.5), 0 0 40px rgba(0,0,0,0.5);    
}
.hero-content .subtitle {
  color: #F8F8F8; font-size: 1.25rem; font-weight: 400; letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7); 
}
@media (max-width: 768px) {
  .hero-content h1 { font-size: 2rem; }
  .hero-content .subtitle { font-size: 1.05rem; }
  .hero-header { height: 50vh; min-height: 350px; }
}

.content-wrapper { position: relative; width: 100%; padding-top: 50px; }
.magazine-article { max-width: 1000px; margin: 0 auto; padding: 0 20px 40px 20px; }

.spot-section { margin-bottom: 40px; }
.spot-header h2 {
  font-size: 1.6em; border-left: 5px solid var(--accent-color);
  padding-left: 15px; margin-bottom: 15px;
}
.tags { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 25px; }
.tags span {
  display: inline-block; background-color: #F4EFEB; color: #7A6251; 
  font-size: 0.85rem; font-weight: 600; padding: 6px 16px; border-radius: 6px; 
  border: 1px solid rgba(122, 98, 81, 0.15); letter-spacing: 0.5px;
  transition: all 0.3s ease; cursor: default;
}
.tags span:hover {
  background-color: #7A6251; color: #FFFFFF;            
  transform: translateY(-2px); box-shadow: 0 4px 10px rgba(122, 98, 81, 0.2);
}

.spot-content { display: flex; flex-direction: column; gap: 30px; }
.text-primary p { margin-bottom: 1.5em; text-align: justify; }

.image-gallery { display: flex; flex-direction: column; gap: 15px; }
.image-secondary img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.image-secondary figcaption { margin-top: 10px; font-size: 0.85em; color: var(--text-light); text-align: center; }

@media (min-width: 768px) {
  .spot-content { flex-direction: row; align-items: flex-start; }
  .spot-content.reverse { flex-direction: row-reverse; }
  .text-primary { flex: 6; }
  /* 這裡的 top: 100px 是為了避開導覽列 */
  .image-secondary { flex: 4; position: sticky; top: 100px; } 
}

/* Day蛙 專屬 Tip 樣式 */
.trip-tip { background-color: var(--tip-bg); padding: 25px; border-radius: 8px; margin: 20px 0 50px 0; border-left: 4px solid var(--accent-color); }
.tip-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.mascot-avatar {
  width: 70px; height: 70px; border-radius: 50%; object-fit: cover; 
  border: 2px solid var(--accent-color); background-color: #fff; padding: 2px;
}
.tip-title { color: var(--accent-color); font-weight: 700; font-size: 1.1rem; letter-spacing: 1px; }
.trip-tip p { margin: 0; font-size: 0.95em; }
.section-divider { border: 0; height: 1px; background-image: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0.1), rgba(0,0,0,0)); margin: 60px 0; }

/* ==========================================
   手機/平板版推薦區塊
========================================== */
.tour-section { max-width: 1000px; margin: 60px auto 40px auto; padding: 0 20px; }
.desktop-only-title { display: none; } 

.carousel-wrapper { position: relative; display: flex; align-items: center; }
.carousel-track { 
  display: flex; overflow-x: auto; scroll-behavior: smooth; gap: 20px; 
  padding: 15px 5px; flex: 1; scrollbar-width: none; 
}
.carousel-track::-webkit-scrollbar { display: none; }

.tour-card { 
  min-width: 250px; flex: 0 0 calc(50% - 10px); 
  background: #fff; border-radius: 12px; border: 1px solid #F0F0F0; 
  box-shadow: 0 4px 15px rgba(0,0,0,0.02); text-align: left; 
  transition: transform 0.3s ease, box-shadow 0.3s ease; 
  display: flex; flex-direction: column; overflow: hidden; 
}
.tour-card:hover { transform: translateY(-4px); box-shadow: 0 10px 25px rgba(0,0,0,0.06); }

.tour-photo { width: 100%; height: 160px; overflow: hidden; }
.tour-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.tour-card:hover .tour-photo img { transform: scale(1.05); }

.tour-info { padding: 20px; }
.tour-card h5 { font-size: 1.1rem; margin: 0 0 10px 0; color: var(--text-main); line-height: 1.4; } 
.tour-card p { font-size: 0.85rem; color: var(--text-light); margin-bottom: 15px; line-height: 1.6; }
.price { color: var(--text-main); font-weight: 700; font-size: 1.05rem; margin-bottom: 15px; }

.btn-sleek { 
  display: block; text-align: center; background: transparent; color: var(--accent-color); 
  text-decoration: none; padding: 8px 20px; border: 1px solid var(--accent-color); 
  border-radius: 30px; font-size: 0.9rem; font-weight: 600; transition: all 0.3s ease; 
}
.btn-sleek:hover { background: var(--accent-color); color: #fff; }

.nav-btn { 
  background: #fff; border: 1px solid #EAEAEA; color: var(--text-light);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; 
  font-size: 1rem; display: flex; align-items: center; justify-content: center; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.03); z-index: 10; flex-shrink: 0; transition: all 0.2s ease;
}
.nav-btn:hover { border-color: var(--accent-color); color: var(--accent-color); }

@media (max-width: 768px) {
  .tour-card { flex: 0 0 calc(85% - 10px); }
}

/* ==========================================
   電螢大螢幕毛玻璃懸浮 (維持完美設計)
========================================== */
@media (min-width: 1440px) {
  .content-wrapper { display: flex; justify-content: center; }
  .magazine-article { width: 1000px; flex-shrink: 0; }
  .tour-section {
    position: absolute; top: 0; right: 0; height: 100%;
    width: calc((100vw - 1000px) / 2); min-width: 300px; margin: 0; padding: 0;
  }
  .carousel-wrapper {
    position: sticky; top: 15vh; width: 280px; margin: 0 auto;
    background: rgba(255, 255, 255, 0.45); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 16px;
    padding: 25px 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  }
  .desktop-only-title {
    display: block; font-size: 1.2rem; text-align: center; color: var(--accent-color);
    margin: 0 0 15px 0; border-bottom: 2px solid rgba(44, 62, 80, 0.2);
    padding-bottom: 10px; font-weight: 700;
  }
  .carousel-track { flex-direction: column; gap: 15px; max-height: 65vh; overflow-y: auto; padding: 5px; }
  .nav-btn { display: none; }
  .tour-card {
    flex: 0 0 auto; width: 100%; margin: 0;
    background: rgba(255, 255, 255, 0.8); box-shadow: none; border: 1px solid rgba(255, 255, 255, 1);
  }
  .tour-card:hover { background: #ffffff; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
}

/* ==========================================
   全新質感設計：手機版防漏接「雜誌書籤」按鈕
========================================== */
.mobile-cta {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: none; /* 預設隱藏，只在小螢幕打開 */
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.btn-mobile-elegant {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  
  /* 🌟 極致美學：輕透白底毛玻璃 */
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(12px);
  
  color: var(--text-main); /* 使用深灰/大地色系文字 */
  padding: 12px 26px;
  border-radius: 40px; 
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06); /* 極柔和的陰影 */
  border: 1px solid rgba(0, 0, 0, 0.2); /* 若有似無的邊框 */
  text-decoration: none;
  letter-spacing: 1px;
  white-space: nowrap; 
}

.cta-icon {
  color: #B58A60; /* 用一點點香檳金/大地色點綴，增加高級感 */
  font-size: 1.1rem;
}

/* 偵測向下滾動或到達底部時，按鈕往下沉躲起來 */
.mobile-cta.hide {
  transform: translate(-50%, 80px); /* 往下沉 */
  opacity: 0;
  pointer-events: none;
}

/* 僅在寬度小於 991px (平板與手機) 顯示 */
@media (max-width: 991px) {
  .mobile-cta {
    display: block;
  }
}/* ==========================================
   🌟 新增：麵包屑導覽 (Breadcrumbs)
========================================== */
.breadcrumb-nav {
  max-width: 1000px; /* 和文章主體保持一樣的寬度，完美對齊 */
  margin: 0 auto;
  padding: 20px 20px 5px 20px; 
}

.breadcrumb-nav ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap; /* 手機版如果太長會自動換行 */
  align-items: center;
  gap: 8px;
}

.breadcrumb-nav li {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

/* 麵包屑之間的小箭頭分隔符號 */
.breadcrumb-nav li:not(:last-child)::after {
  content: "❯"; 
  font-size: 0.65rem;
  margin-left: 8px;
  color: #D3CFC6; /* 極淡的燕麥灰，不搶視覺 */
}

.breadcrumb-nav a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.3s ease;
}

/* 滑鼠游標停留在連結上時的顏色變化 */
.breadcrumb-nav a:hover {
  color: var(--accent-color); /* 變成深色主色 */
  text-decoration: underline;
  text-underline-offset: 4px; /* 讓底線離文字遠一點，比較有質感 */
}

/* 目前所在位置的文字顏色 (不加連結) */
.breadcrumb-nav li[aria-current="page"] {
  color: #B58A60; /* 用一點點香檳金標示現在位置 */
  font-weight: 600;
}

/* 手機版微調 */
@media (max-width: 768px) {
  .breadcrumb-nav {
    padding: 15px 20px 5px 20px;
  }
  .breadcrumb-nav li {
    font-size: 0.8rem;
  }
}
/* ==========================================
   📱 手機版全域字級調降 (適用於所有主題，強制覆寫不跑版)
========================================== */
@media (max-width: 768px) {
    /* 1. 基礎內文與段落 (從 18px 降至 16px) */
    body { font-size: 16px !important; }
    .text-primary p { font-size: 0.95rem !important; line-height: 1.7 !important; }
    
    /* 2. 文章區塊大標題 */
    .spot-header h2 { font-size: 1.4rem !important; margin-bottom: 12px !important; }
    
    /* 3. 標籤與圖片說明 (縮小以顯精緻) */
    .tags span { font-size: 0.75rem !important; padding: 4px 10px !important; }
    .image-secondary figcaption { font-size: 0.8rem !important; margin-top: 10px !important; }
    
    /* 4. 達人帶路 / 提示區塊 */
    .tip-title { font-size: 1rem !important; }
    .trip-tip p { font-size: 0.9rem !important; }
    
    /* 5. 推薦行程卡片 (整體視覺微縮) */
    .tour-card h5 { font-size: 1.05rem !important; margin-bottom: 8px !important; }
    .tour-card p { font-size: 0.8rem !important; margin-bottom: 10px !important; line-height: 1.5 !important; }
    .price { font-size: 1.05rem !important; margin-bottom: 12px !important; }
    .btn-sleek { font-size: 0.85rem !important; padding: 8px 16px !important; }
    
    /* 6. 底部懸浮按鈕與頂部麵包屑 */
    .btn-mobile-elegant { font-size: 0.9rem !important; padding: 10px 24px !important; }
    .breadcrumb-nav li { font-size: 0.8rem !important; }
}
