@charset "UTF-8";
/* CSS Document */
/* 基礎重設與排版 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: sans-serif; }

/* 1. 全域顏色基本設定（白底黑字） */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  font-family: 'Noto Serif TC', serif;
font-weight:600;	
  background-color: rgba(255, 255, 255, 0.8);  /* 白底80%半透明 */
	backdrop-filter: blur(10px);
  color: #333c49;            /* 黑字 */
  border-bottom: 1px solid #e0e0e0;

  /* 💡 核心固定最上方語法 */
  position: fixed;   /* 絕對固定在螢幕上，不隨捲軸滾動 */
  top: 0;            /* 貼緊螢幕最上方 */
  left: 0;           /* 貼緊螢幕最左方 */
  width: 100%;       /* 寬度填滿整個螢幕 */
  z-index: 1000;     /* 設定高圖層順序，確保導覽列不會被下方的網頁內容（如圖片）遮擋 */
}

/* 提取通用的 Logo 圖片設定（免去各媒體查詢內重複撰寫） */
.logo-img {
  width: 100%;
  height: auto;
  display: block;
}

/* 導覽連結通用樣式 */
.nav-links {
  list-style: none;
}
.nav-links a, .submenu-label {
  color: #333c49; /* 文字黑色 */
  text-decoration: none;
  display: block;
  cursor: pointer;
  font-size: 1rem; /* 設定母選單預設字體大小 */
}

/* 第二層子選單專屬字體設定（字體變小、顏色變深灰） */
.sub-menu a {
  font-size: 0.85rem !important; /* 字體比母選單縮小，!important 確保不被覆蓋 */
  color: #555555 !important;     /* 字體顏色改成深灰色 */
}

/* 滑過時底色變淺灰，文字保持原色 */
.nav-links a:hover, .submenu-label:hover {
  background-color: #f0f0f0; /* 淺灰色 */
  color: #333c49;
}

/* 【新增】子選單項目滑過時，底色變淺灰，但文字依然保持深灰色 */
.sub-menu a:hover {
  background-color: #e0e0e0; /* 稍微深一點點的灰，增加層次感 */
  color: #555555 !important;
}

/* 隱藏所有控制用的 checkbox */
.menu-checkbox, .submenu-checkbox { display: none; }
.hamburger { display: none; cursor: pointer; }


/* ==========================================================================
   2. 響應式尺寸分流
   ========================================================================== */

/* 【 電腦模式 】 */
@media only screen and (min-width: 961px) {
  .nav-links { display: flex; align-items: center; }
  .nav-links a, .submenu-label { padding: 1rem 1.5rem; }

  /* 電腦版 Logo 空間限制語法 */
  .logo-container {
    max-width: 300px;
    width: 100%;
    display: flex;
    align-items: center;
  }	
  
  /* 電腦版第二層下拉選單懸浮定位 */
  .has-submenu { position: relative; }
  .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 160px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    list-style: none;
    z-index: 999;
  }
  .sub-menu a { padding: 0.8rem 1rem; }
  
  /* 電腦版：滑過自動顯示第二層選單 */
  .has-submenu:hover .sub-menu { display: block; }
}

/* 【 iPad 模式 】 */
@media only screen and (min-width: 767px) and (max-width: 960px) {
  /* iPad 版 Logo 空間限制語法 */
  .logo-container {
    max-width: 200px;
    width: 100%;
    display: flex;
    align-items: center;
  }	

  /* 行為與電腦版基本一致，不變成漢堡選單，僅微調間距 */
  .nav-links { display: flex; align-items: center; }
  .nav-links a, .submenu-label { padding: 1rem 1rem; }
  
  .has-submenu { position: relative; }
  .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 160px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    list-style: none;
    z-index: 999;
  }
  .sub-menu a { padding: 0.8rem 1rem; }
  .has-submenu:hover .sub-menu { display: block; }
}

/* 【 手機模式 】（只有此模式會變成折疊式漢堡選單） */
@media only screen and (min-width: 0px) and (max-width: 766px){
  
  /* 手機版 Logo 空間限制語法 */
  .logo-container {
    max-width: 200px;
    width: 100%;
    display: flex;
    align-items: center;
  }
  
  /* 顯示黑色漢堡按鈕 */
  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .hamburger span {
    width: 25px;
    height: 3px;
    background-color: #333c49;
  }

  /* 手機版主導覽列樣式變更 */
  .nav-links {
    display: none; /* 預設隱藏 */
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 999;
  }

  /* 4. 手機模式下，導覽列項目間加上 1pt 黑色水平線 */
  .nav-links li {
    border-bottom: 1pt solid #333c49; 
  }
  .nav-links a, .submenu-label {
    padding: 1.2rem 0;
  }

  /* 手機版選單的文字與箭頭置中排版 */
  .submenu-label {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
  }
  .arrow {
    display: inline-block;
    transition: transform 0.3s ease;
  }

  /* 第二層子選單在手機版預設隱藏 */
  .sub-menu {
    display: none;
    background-color: #f9f9f9; /* 子選單底色稍微深一點點做區隔 */
    list-style: none;
  }
  /* 子選單內部的項目，上方多加一條線與父項區隔 */
  .sub-menu li {
    border-bottom: none;
    border-top: 1pt solid #333c49; 
  }
  /* 修正手機版子選單內的間距，讓排版更緊湊精緻 */
  .sub-menu a {
    padding: 1rem 0;
  }

  /* 關鍵純 CSS 語法控制展開 */
  /* 當主漢堡勾選時：顯示第一層主選單 */
  .menu-checkbox:checked ~ .nav-links {
    display: flex;
  }

  /* 當子選單項目被點擊勾選時：顯示第二層子選單 */
  .submenu-checkbox:checked ~ .sub-menu {
    display: block;
  }

  /* 當子選單被勾選時，將箭頭順時針旋轉 180 度 */
  .submenu-checkbox:checked ~ .submenu-label .arrow {
    transform: rotate(180deg);
  }
}

