/* ============================================================
   立刻手感 — 移除 hover 漸進漸入動畫 + 側欄即時開合（不做 250ms 滑動）
   依 design-rules.md §1：互動回饋一律即時，不靠 ease 緩入。
   ============================================================ */
.book-header h1,
.book-header h1 a,
.dropdown,
.dropdown-menu,
.book a,
.book-summary li a,
.book-summary .summary li a,
.dropdown-menu .buttons .button,
.book-header a,
.book-header .btn,
.book button,
.book .btn,
.book-body,
.book-summary {
  transition: none !important;
  animation: none !important;
}

/* ============================================================
   全站藍色統一為系統藍 #0000ff（包含連結、目錄、搜尋結果等）
   ============================================================ */
.book .markdown-section a,
.book .markdown-section a:link,
.book .markdown-section a:visited,
.book .markdown-section a:hover,
.book .markdown-section a:active,
.book .book-summary ul.summary li.active > a,
.book .book-summary ul.summary li a:hover,
.book #book-search-results .search-results .has-results .search-results-item a,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal a,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal a {
  color: #0000ff !important;
}

.hint-info {
  border-left-color: #0000ff !important;
}

/* 桌面端字體選單（左上 A）：改為純 hover，移入即開、移出即關。 */
@media screen and (min-width: 601px) {
  .book .book-header .font-settings {
    position: fixed !important;
    top: 8px !important;
    left: 12px !important;
    transform: none !important;
    z-index: 120 !important;
  }

  /* 側欄展開時把 A 按鈕移到側欄右側，避免重疊。 */
  .book.with-summary .book-header .font-settings {
    left: 296px !important;
  }

  .book .book-header .font-settings .btn {
    color: #7e888b !important;
  }

  .book .book-header .font-settings .btn:hover,
  .book .book-header .font-settings .btn:focus-visible {
    color: #e04e19 !important;
  }

  .book .book-header .font-settings .dropdown-menu,
  .book .book-header .font-settings .dropdown-menu.open {
    display: none !important;
    z-index: 121 !important;
  }

  .book .book-header .font-settings:hover .dropdown-menu,
  .book .book-header .font-settings:hover .dropdown-menu.open {
    display: block !important;
  }
}

/* ============================================================
   翻頁按鈕 — 小型實體 ◀ / ▶ 圓鈕，收掉整側大熱區
   關鍵：維持 position:absolute（相對內容區 .book-body），這樣按鈕
   會跟著內容區一起被邊欄推開，不會像 fixed 那樣壓在邊欄底下被遮。
   ============================================================ */
.navigation,
.navigation:hover { transition: none !important; }
.navigation {
  position: absolute !important;
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
  height: auto !important;
  display: inline-block !important;
  padding: 4px 6px !important;
  font-size: 20px !important;
  line-height: 1 !important;
  color: #9a9a9a !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  z-index: 5 !important;
}
.navigation.navigation-prev { left: 50% !important; margin-left: -440px !important; right: auto !important; }
.navigation.navigation-next { right: 50% !important; margin-right: -440px !important; left: auto !important; }
.navigation:hover { color: #e04e19 !important; text-decoration: none !important; }
.navigation .fa-angle-left,
.navigation .fa-angle-right { font-size: 20px !important; }
.navigation .fa-angle-left::before  { content: "\25C0"; font-family: -apple-system, "Segoe UI", "PingFang TC", sans-serif; }
.navigation .fa-angle-right::before { content: "\25B6"; font-family: -apple-system, "Segoe UI", "PingFang TC", sans-serif; }

/* ============================================================
   側欄開關 — Ruvia tray 風：移除 ☰，單一小符號貼在邊欄右邊界、垂直置中
   做法：沿用 theme.js 已注入、已接好開合功能的那顆按鈕
   （.btn.js-toolbar-action 內含 <i class="fa fa-align-justify">），
   只用 CSS 把它移到邊欄邊界並換成 ❮ / ❯。不需改 script.js。
   邊欄寬改為 280px：展開時鈕貼 left:280px、收合時回 left:0。
   ============================================================ */
.book-summary {
  width: 280px !important;
}

@media screen and (min-width: 600px) {
  .book.with-summary .book-body {
    left: 280px !important;
    transform: none !important;
  }
}

.book-header .btn:has(.fa-align-justify) {
  position: fixed !important;
  top: 50% !important;
  left: 0 !important;                 /* 收合：貼畫面左緣 */
  transform: translateY(-50%) !important;
  z-index: 50 !important;
  width: auto !important;
  height: auto !important;
  padding: 8px 6px !important;
  line-height: 1 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.book.with-summary .book-header .btn:has(.fa-align-justify) {
  left: 280px !important;             /* 展開：貼邊欄右邊界 */
}
.book-header .fa-align-justify {
  font-size: 16px;
  color: rgba(28, 28, 28, 0.42);
}
.book-header .fa-align-justify::before {
  content: "\276F";                   /* ❯ 收合（可展開） */
  font-family: -apple-system, "Segoe UI", "PingFang TC", sans-serif !important;
  font-weight: 400;
}
.book.with-summary .book-header .fa-align-justify::before {
  content: "\276E";                   /* ❮ 展開（可收合） */
}
.book-header .btn:has(.fa-align-justify):hover .fa-align-justify {
  color: #e04e19;
}

/* 移動端：側欄開合鈕採小圓浮動按鈕，貼近底部左側。 */
@media screen and (max-width: 600px) {
  .book-summary {
    width: calc(100% - 72px) !important;
    /* left handled by theme: closed=-100% (max-width:1240), open=0 (.with-summary) */
  }

  .book.with-summary .book-body {
    transform: translate(calc(100% - 72px), 0) !important;
  }

  .book-header .btn:has(.fa-align-justify),
  .book.with-summary .book-header .btn:has(.fa-align-justify) {
    top: auto !important;
    bottom: 12px !important;
    left: 12px !important;
    transform: none !important;
    z-index: 120 !important;
    opacity: 0.92;
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    background: rgba(0, 0, 0, 0.1) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    backdrop-filter: blur(4px) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .book-header .btn:has(.fa-align-justify) .fa-align-justify {
    font-size: 20px !important;
  }

  /* 翻頁鍵：移動版改為懸浮圓鈕，左右貼邊、垂直置中，與 toggle 同款半透明 + blur */
  .navigation {
    position: fixed !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 38px !important;
    height: 38px !important;
    max-width: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 18px !important;
    color: #555 !important;
    background: rgba(0, 0, 0, 0.1) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    backdrop-filter: blur(4px) !important;
    border: 0 !important;
    border-radius: 999px !important;
    z-index: 120 !important;
    opacity: 0.92;
    float: none !important;
  }
  .navigation.navigation-prev { left: 12px !important; right: auto !important; margin-left: 0 !important; }
  .navigation.navigation-next { right: 12px !important; left: auto !important; margin-right: 0 !important; }
  .navigation:hover,
  .navigation:active { color: #e04e19 !important; background: rgba(0, 0, 0, 0.14) !important; }

  /* A 字體選單：移動版懸浮圓鈕，置右上，與 toggle / 翻頁鍵同款（半透明 + blur） */
  .book .book-header .font-settings,
  .book.with-summary .book-header .font-settings {
    position: fixed !important;
    top: 12px !important;
    left: auto !important;
    right: 12px !important;
    transform: none !important;
    z-index: 120 !important;
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(0, 0, 0, 0.1) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    backdrop-filter: blur(4px) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0.92;
  }
  .book .book-header .font-settings .btn {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    line-height: 1 !important;
    color: #555 !important;
    background: transparent !important;
    border: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
  }
  .book .book-header .font-settings .btn:hover,
  .book .book-header .font-settings .btn:focus-visible {
    color: #e04e19 !important;
    background: transparent !important;
  }
  /* dropdown 從 A 右側對齊向下展開，避免溢出右邊界 */
  .book .book-header .font-settings .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    z-index: 121 !important;
  }

  /* 正文：手機上把 page-inner 邊距收緊，max-width 解開（窄螢幕已是滿版），減少「飄」感 */
  .page-inner {
    max-width: 100% !important;
    padding: 16px 14px 28px !important;
  }
}

/* ============================================================
   GitBook 風 hint / callout 提示框
   ============================================================ */
.hint {
  margin: 1.2em 0;
  padding: 0.6em 1em;
  border-left: 4px solid #bbb;
  border-radius: 3px;
  background: #f5f5f5;
}
.hint > :first-child { margin-top: 0; }
.hint > :last-child  { margin-bottom: 0; }
.hint-info { background: #eef6fb; border-left-color: #4b9fd5; }
.hint-tip,
.hint-success { background: #eef9f0; border-left-color: #4caf50; }
.hint-warning { background: #fff8e6; border-left-color: #f0ad4e; }
.hint-danger { background: #fdecea; border-left-color: #e05252; }
