@charset "UTF-8";
/* aio.niu.edu.tw 導覽列樣式（自 導覽列-1150805.html 內嵌 <style> 抽出，內容未改）
   上傳位置：.../var/file/75/1075/img/1306/aio-nav.css
   注意：本檔與 aio-nav.js、導覽列 HTML 三者須同時更新 */

/* ===== 核心設定：使用 ai- 開頭的 Class 以避免衝突 ===== */

  /* 重置這區塊內的樣式 */
  .ai-wrapper {
    font-family: Arial, sans-serif;
    line-height: 1.5;
    width: 100%;
    background: #fff;
  }

  .ai-wrapper * { box-sizing: border-box; }
  .ai-wrapper ul { list-style: none; padding: 0; margin: 0; }
  .ai-wrapper a { text-decoration: none; color: inherit; }

  /* 去除 Button 預設樣式 */
  .ai-menu-btn {
    background: none; border: none; font: inherit; cursor: pointer; padding: 0;
  }


  /* ===== Topbar (無障礙色 #313F48) ===== */
  .ai-topbar {
    background-color: #313F48;
    color: white;
    padding: 10px 20px;
    display: flex; justify-content: flex-end; align-items: center; gap: 20px;
    font-size: 1.4rem; position: relative; z-index: 2001;
  }
  .ai-topbar a { color: white; transition: opacity 0.2s; }
  .ai-topbar a:hover { opacity: 0.8; text-decoration: underline; }

  /* 翻譯按鈕 */
  .ai-translate-btn {
    background: transparent; border: 1px solid rgba(255,255,255,0.5);
    color: white; padding: 2px 8px; cursor: pointer;
    font-size: 1.2rem; border-radius: 4px;
  }
  #ai_translate_gadget {
    display: none; position: absolute; top: 45px; right: 20px; z-index: 9999;
    background: white; border: 1px solid #ccc; padding: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  }

  /* ===== Navbar Container (無障礙色 #F5F5FA) ===== */
  .ai-navbar-container {
    display: flex; align-items: center; justify-content: space-between;
    padding: 5px 20px;
    background-color: #F5F5FA;
    border-bottom: 1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease; position: relative; z-index: 1000;
  }

  /* Sticky Menu */
  .ai-navbar-container.fixed-menu {
    position: fixed; top: 0; left: 0; right: 0; z-index: 999;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
  }
  @keyframes slideDown {
    from { transform: translateY(-100%); } to { transform: translateY(0); }
  }

  /* ===== Logo (高度固定) ===== */
  .ai-logo { display: flex; align-items: center; gap: 15px; margin-left: 10px; }
  .ai-logo img { height: 50px; width: auto; display: block; }

  /* ===== 手機漢堡按鈕 ===== */
  .ai-menu-toggle {
    display: none; background: white; border: 1px solid #ccc;
    padding: 8px 12px; font-size: 1rem; cursor: pointer;
    border-radius: 4px; color: #333;
  }

  /* ===== 電腦版選單 ===== */
  .ai-navbar { display: flex; justify-content: flex-end; margin-right: 20px; }
  .ai-navbar > ul { display: flex; gap: 10px; align-items: center; }
  .ai-navbar > ul > li { position: relative; height: 100%; }

  .ai-navbar > ul > li > a,
  .ai-navbar > ul > li > .ai-menu-btn {
    color: #333333; padding: 15px 15px; display: block;
    font-size: 1.6rem; font-weight: 500; white-space: nowrap;
    width: 100%; text-align: left;
  }

  .ai-navbar > ul > li:hover > a,
  .ai-navbar > ul > li:hover > .ai-menu-btn {
    color: #000; background-color: #e9e9e9;
  }

  /* ===== 下拉選單 ===== */
  .ai-submenu {
    display: none; position: absolute; top: 100%; left: 0;
    background: white; min-width: 180px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); z-index: 1001;
    border-top: 3px solid #313F48;
  }

/* 確保滑鼠移入子選單時，選單不會消失 */
.ai-has-submenu:hover .ai-submenu {
  /* 修正 1150805：移除強制宣告與 :focus-within。
     :focus-within 掛在 li 上，而 li 同時含按鈕與子選單，焦點在按鈕上即強制展開，
     使 JS 的 display:none 永遠被壓過 -> Esc 關不掉選單，且 aria-expanded 與實際狀態不一致。
     桌機顯示改由 [aria-expanded="true"] 規則負責，JS 只維護 aria-expanded。 */
  display: block;
}

  @media (min-width: 901px) {
    .ai-has-submenu:hover .ai-submenu,
    .ai-menu-btn[aria-expanded="true"] + .ai-submenu {
   display: block;}
  }
  .ai-submenu li a {
    display: block; padding: 10px 20px; color: #333; font-size: 1.5rem;
    border-bottom: 1px solid #eee;
  }
  .ai-submenu li:last-child a { border-bottom: none; }
  .ai-submenu li a:hover { background-color: #efefef; color: #313F48; }

  /* ===== RWD 手機版 ===== */
  @media (max-width: 900px) {
    .ai-menu-toggle { display: block; }
    .ai-navbar-container { padding: 10px; }
    .ai-navbar {
      display: none; position: absolute; top: 100%; left: 0; width: 100%;
      background: white; box-shadow: 0 5px 10px rgba(0,0,0,0.1); margin-right: 0;
    }
    .ai-navbar.open { display: block; }
    .ai-navbar > ul { flex-direction: column; align-items: stretch; gap: 0; }
    .ai-navbar > ul > li { border-bottom: 1px solid #ddd; }
    .ai-navbar > ul > li > a, .ai-navbar > ul > li > .ai-menu-btn { padding: 12px 20px; }

    .ai-submenu {
      position: static; box-shadow: none; border-top: none;
      background-color: #f9f9f9; display: none;
    }
    .ai-submenu.show { display: block; }
    .ai-submenu li a { padding-left: 40px; font-size: 1.4rem; }

    .ai-logo { margin-left: 0; gap: 5px; }
    .ai-logo img { height: 35px; }

    .ai-has-submenu > .ai-menu-btn::after {
        content: '+'; float: right; font-weight: bold;
    }
  }
