/* 手機版選單 - 僅在手機螢幕顯示 */
@media screen and (max-width: 768px) {
  
  /* 手機版選單容器 - 一開始透明 */
  .mobile-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 16px;
    border-bottom: none;
    background: transparent;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60px;
    z-index: 1200;
    box-sizing: border-box;
    transition: all 0.3s ease;
  }

  /* 選單打開時的 header 樣式 */
  .mobile-header.menu-open {
    background: white;
    border-bottom: 1px solid #ccc;
    justify-content: space-between;
    height: 70px;
    padding: 15px 16px;
  }

  /* Logo 區域 - 一開始隱藏 */
  .mobile-logo-section {
    display: none;
    align-items: center;
    flex: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  /* 選單打開時顯示 Logo */
  .mobile-header.menu-open .mobile-logo-section {
    display: flex;
    opacity: 1;
  }

  .mobile-logo {
    height: 60px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    margin-right: 8px;
  }
  
  .mobile-logo-section a {
    display: flex;
    align-items: center;
    text-decoration: none;
  }

  .mobile-title {
    font-size: 16px;
    color: #4b0082;
    font-weight: 600;
    font-family: 'Noto Sans TC', sans-serif;
  }

  /* 漢堡選單按鈕 - 始終在右邊 */
  .mobile-menu-close {
    font-size: 28px;
    color: white;
    cursor: pointer;
    user-select: none;
    padding: 5px 10px;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-left: auto;
    margin-top: 12px;
  }

  /* 選單打開時的按鈕樣式 */
  .mobile-header.menu-open .mobile-menu-close {
    color: #4b0082;
    text-shadow: none;
    margin-left: 0;
  }

  .mobile-menu-close:active {
    transform: scale(0.9);
  }

  /* 手機版選單 */
  .mobile-menu {
    display: none;
    padding: 20px 16px;
    background: white;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1150;
    max-height: calc(100vh - 70px);
  }

  .mobile-menu.show {
    display: block;
  }

  /* 選單列表 */
  .mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  /* 選單項目 */
  .mobile-menu li {
    margin-bottom: 10px;
  }

  /* 主選單連結 */
  .mobile-nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ada1c2;
    color: #fff;
    text-decoration: none;
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-family: 'Noto Sans TC', sans-serif;
  }

  .mobile-nav-link:active {
    background-color: #444;
  }

  /* 箭頭樣式 */
  .mobile-arrow {
    font-size: 14px;
    margin-left: 8px;
    transition: transform 0.2s;
    display: inline-block;
  }

  .mobile-has-submenu.active .mobile-arrow {
    transform: rotate(180deg);
  }

  /* 子選單 */
  .mobile-submenu {
    display: none;
    margin-top: 4px;
    border-left: 2px solid #e5e5e5;
    list-style: none;
    padding: 0;
    margin-left: 0;
  }

  .mobile-has-submenu.active .mobile-submenu {
    display: block;
  }

  /* 子選單項目 */
  .mobile-submenu li {
    margin: 0;
  }

  .mobile-submenu-link {
    background-color: #fff;
    color: #333;
    padding: 8px 12px 8px 20px;
    border-radius: 0;
    border-bottom: 1px solid #eee;
    display: block;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
    font-family: 'Noto Sans TC', sans-serif;
  }

  .mobile-submenu-link:active {
    background-color: #d8c6e5;
  }

  /* 子選單最後一個項目 */
  .mobile-submenu li:last-child .mobile-submenu-link {
    border-bottom: none;
  }
}

/* 手機版隱藏桌機版漢堡選單 */
@media screen and (max-width: 768px) {
  .navbar .hamburger-container,
  .navbar .hamburger {
    display: none !important;
  }
}

/* 桌機版隱藏手機選單 */
@media screen and (min-width: 769px) {
  .mobile-header,
  .mobile-menu {
    display: none !important;
  }
}
