/* ============================================================
   site.css — 全站統一殼：麵包屑列 + 全站搜尋（樣式對齊波特玩 v7d）
   由 site.js 注入 DOM；本檔只管樣式。顏色一律用 tokens.css 的 var()。
   ============================================================ */

/* ---------- 麵包屑列（每頁頂部，靜態不 sticky，避免與各頁自身頂欄打架） ---------- */
.bg-crumbbar { display: flex; align-items: center; gap: 12px;
  max-width: 1080px; margin: 0 auto; padding: 12px 20px 0; }
.bg-crumb { flex: 1; font-size: 0.82rem; color: var(--muted, #857F76); line-height: 1.6; }
.bg-crumb a { color: var(--link, #746E67); font-weight: 600; text-decoration: none; }
.bg-crumb a:hover { color: var(--green-d, #746E67); text-decoration: underline; }
.bg-crumb .sep { margin: 0 0.5em; color: var(--muted-light, #A8A199); }
.bg-crumb .cur { color: var(--fg, #393632); }

/* ---------- 浮動放大鏡（右下角，捲到哪都能搜） ---------- */
.bg-fab { position: fixed; right: 22px; bottom: 22px; z-index: 290;
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border: 1.5px solid var(--border-d, #CEC8BE); border-radius: 999px;
  background: var(--card, #FCFBF9); color: var(--muted, #857F76); cursor: pointer;
  box-shadow: var(--shadow-md, 0 4px 16px rgba(40,33,20,.10)); transition: all 0.15s; }
.bg-fab:hover { border-color: var(--green, #8F806B); color: var(--green-d, #746E67);
  box-shadow: 0 0 0 4px rgba(143, 128, 107, 0.18); }
.bg-fab svg { width: 20px; height: 20px; }

/* ---------- 搜尋覆蓋層（v7d .search-ov 同款） ---------- */
.bg-searchov { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.42); z-index: 300;
  display: flex; align-items: flex-start; justify-content: center; padding: 9vh 16px 16px; }
.bg-searchov[hidden] { display: none; }
.bg-searchpanel { width: 100%; max-width: 620px; background: var(--card, #FCFBF9);
  border-radius: 14px; overflow: hidden; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.30); }
.bg-searchhead { display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--border, #DEDBD2); }
.bg-searchhead .mag { display: inline-flex; color: var(--muted-light, #A8A199); flex: none; }
.bg-searchhead .mag svg { width: 18px; height: 18px; }
.bg-searchhead input { flex: 1; border: none; outline: none; background: none;
  font: inherit; font-size: 1.02rem; color: var(--fg, #393632); }
.bg-searchhead input::placeholder { color: var(--muted-light, #A8A199); }
.bg-searchhead .esc { flex: none; font-size: 0.72rem; color: var(--muted-light, #A8A199);
  border: 1px solid var(--border-d, #CEC8BE); border-radius: 6px; padding: 2px 7px; }
.bg-searchres { max-height: 62vh; overflow-y: auto; }
.bg-searchres a { display: block; padding: 12px 18px; text-decoration: none;
  color: var(--fg, #393632); border-bottom: 1px solid var(--border, #DEDBD2); }
.bg-searchres a:hover, .bg-searchres a.sel { background: var(--green-bg, #ECEAE5); }
.bg-searchres .r-cat { font-size: 0.76rem; color: var(--muted, #857F76); }
.bg-searchres .r-t { font-weight: 700; line-height: 1.5; }
.bg-searchres .r-sum { font-size: 0.85rem; color: var(--muted, #857F76); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bg-searchres .empty { padding: 26px 18px; text-align: center; color: var(--muted, #857F76); }
.bg-searchres mark { background: var(--green-bg, #ECEAE5); color: var(--green-d, #746E67);
  border-radius: 3px; padding: 0 2px; }

/* ---------- 全站目錄（增補進各頁側欄；沿用頁面自身 side-group 樣式） ---------- */
.bg-side-home { display: block; font-weight: 700; font-size: 0.92rem; text-decoration: none;
  color: var(--green-d, #746E67); padding: 4px 0 10px; }
.bg-side-home:hover { text-decoration: underline; }
.bg-side-sec { border-top: 1px dashed var(--border-d, #CEC8BE); padding-top: 12px; }
.bg-side-sec a.bg-active { font-weight: 700; }

/* 行動版與桌機同位置（header 之下、正文之上），窄螢幕縮小留白 */
@media (max-width: 700px) {
  .bg-crumbbar { padding: 10px 16px 0; }
}

/* 深色模式：站殼元素跟著 tokens 走；沒有 tokens 的頁面給合理深色保底 */
html[data-theme="dark"] .bg-magbtn, html[data-theme="dark"] .bg-fab,
html[data-theme="dark"] .bg-searchpanel { background: var(--card, #1C1B1A); color: var(--muted, #9A938A); }
