/* BangBang — 左側邊欄（桌面版）— 參照 smm.baostar.net */
:root{
  --bb-sidebar-w:280px;
  --bb-sidebar-bg:#241e48;
  --bb-sidebar-bg-logo:#050508;
  --bb-sidebar-bg-hover:#34295e;
  --bb-sidebar-bg-active:#3e3268;
  --bb-sidebar-text:#c8c0e6;
  --bb-sidebar-text-dim:#8e85b8;
  --bb-sidebar-title:#8a81b0;
  --bb-sidebar-border:rgba(255,255,255,.06);
  --bb-sidebar-accent:#6c5cff;
}

/* 版面：側邊欄固定，其餘內容推向右側（僅桌面版） */
@media (min-width:1025px){
  html{scrollbar-gutter:stable;}
  body.bb-has-sidebar #wrapper{
    margin-left:var(--bb-sidebar-w);
    width:calc(100% - var(--bb-sidebar-w));
    max-width:none;
  }
  /* Flatsome 頁首位於 wrapper 內 → 自動位於側邊欄右側 */
  body.bb-has-sidebar #header{left:var(--bb-sidebar-w); width:calc(100% - var(--bb-sidebar-w));}
  /* 黏性頁首偏移修正 */
  body.bb-has-sidebar .header-wrapper{max-width:100%;}
}

/* 側邊欄容器 */
.bb-sidebar{
  position:fixed; left:0; top:0; bottom:0;
  width:var(--bb-sidebar-w);
  background:var(--bb-sidebar-bg);
  display:flex; flex-direction:column;
  z-index:999;
  border-right:1px solid var(--bb-sidebar-border);
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
}
@media (max-width:1024px){ .bb-sidebar{display:none;} }

/* Logo 區塊 — 固定、不捲動 */
.bb-sidebar__logo{
  flex:0 0 auto;
  background:var(--bb-sidebar-bg-logo);
  padding:18px 18px 16px;
  display:flex; align-items:center; justify-content:center;
  border-bottom:1px solid rgba(255,255,255,.06);
  min-height:92px;
}
.bb-sidebar__logo a{display:flex; align-items:center; justify-content:center; text-decoration:none; width:100%;}
.bb-sidebar__logo img{max-width:190px; max-height:64px; width:auto; height:auto; object-fit:contain; display:block;}
.bb-sidebar__logo-fallback{
  display:flex; align-items:center; gap:10px; color:#fff; font-weight:800; letter-spacing:.06em; font-size:22px;
}
.bb-sidebar__logo-fallback small{font-weight:700; letter-spacing:.18em; font-size:11px; opacity:.9;}
.bb-sidebar__logo-fallback .bb-logo-mark{
  width:42px; height:42px; border-radius:50%; background:linear-gradient(135deg,#fff 0%, #d0d0d0 100%);
  display:grid; place-items:center; color:#000; font-size:20px; flex:0 0 auto;
}

/* 捲動區 — 垂直捲動選單 */
.bb-sidebar__scroll{
  flex:1 1 auto;
  overflow-y:auto; overflow-x:hidden;
  padding:14px 0 18px;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.14) transparent;
}
.bb-sidebar__scroll::-webkit-scrollbar{width:6px;}
.bb-sidebar__scroll::-webkit-scrollbar-thumb{background:rgba(255,255,255,.14); border-radius:99px;}
.bb-sidebar__scroll::-webkit-scrollbar-track{background:transparent;}

/* 區塊標題（主選單／平台） */
.bb-sidebar__title{
  font-size:11px; font-weight:700; letter-spacing:.14em; text-transform:uppercase;
  color:var(--bb-sidebar-title);
  padding:18px 20px 8px;
  margin:0;
}
.bb-sidebar__title:first-of-type{padding-top:6px;}

/* 選單清單 */
.bb-sidebar__nav ul{list-style:none; margin:0; padding:0;}
.bb-sidebar__nav li{margin:0; padding:0;}
.bb-sidebar__nav a{
  display:flex; align-items:center; gap:12px;
  padding:10px 18px 10px 20px;
  color:var(--bb-sidebar-text);
  text-decoration:none;
  font-size:14px; font-weight:500; line-height:1.35;
  border-left:3px solid transparent;
  transition:background .18s, color .18s, border-color .18s;
  position:relative;
}
.bb-sidebar__nav a:hover{background:var(--bb-sidebar-bg-hover); color:#fff;}
.bb-sidebar__nav li.current-menu-item > a,
.bb-sidebar__nav li.current-menu-ancestor > a{
  background:var(--bb-sidebar-bg-active); color:#fff; border-left-color:var(--bb-sidebar-accent);
}
.bb-sidebar__nav li.menu-item-has-children > a{padding-right:44px;}

/* Icon */
.bb-sidebar__nav .bb-ico{
  width:22px; height:22px; flex:0 0 22px;
  display:grid; place-items:center;
  font-size:14px; line-height:1;
  opacity:.95;
}
.bb-sidebar__nav .bb-ico i{font-size:15px;}
/* 圖片圖示備援 */
.bb-sidebar__nav .bb-ico img{width:18px; height:18px; object-fit:contain; display:block;}

/* Chevron（手風琴箭頭） */
.bb-sidebar__nav .bb-chevron{
  position:absolute; right:12px; top:50%; transform:translateY(-50%);
  width:28px; height:28px; display:grid; place-items:center;
  border-radius:6px; color:var(--bb-sidebar-text-dim);
  transition:transform .22s, background .18s, color .18s;
  font-size:11px;
  border:0; background:transparent; cursor:pointer;
}
.bb-sidebar__nav .bb-chevron:hover{background:rgba(255,255,255,.08); color:#fff;}
.bb-sidebar__nav li.bb-open > a .bb-chevron{transform:translateY(-50%) rotate(180deg); color:#fff;}

/* 由 JS 插入的平台分隔線 */
.bb-sidebar__title--platform{margin-top:6px;}

/* 葉項目的靜態箭頭（同範例圖 — 每列皆有 chevron） */
.bb-sidebar__nav .bb-chevron--static{opacity:.55; pointer-events:none;}
.bb-sidebar__nav li.menu-item-has-children > a .bb-chevron--static{display:none;}

/* 子選單 — 手風琴 */
.bb-sidebar__nav .sub-menu{
  max-height:0; overflow:hidden;
  transition:max-height .28s ease, opacity .2s ease;
  opacity:.0;
  background:transparent;
  border-top:none;
  border-bottom:none;
}
.bb-sidebar__nav li.bb-open > .sub-menu{
  max-height:800px; opacity:1;
}
.bb-sidebar__nav .sub-menu a{
  padding:10px 18px 10px 20px;
  font-size:14px; font-weight:500;
  color:#b8b0d8;
  border-left-color:transparent;
}
.bb-sidebar__nav .sub-menu a:hover{color:#fff; background:rgba(255,255,255,.06);}
.bb-sidebar__nav .sub-menu li.current-menu-item > a{color:#fff; background:rgba(108,92,255,.18);}

/* 輔助切換按鈕：確保點擊整列仍可展開有子項的子選單 */
.bb-sidebar__nav li.menu-item-has-children > a{cursor:pointer;}

/* 側邊欄內小型頁尾（選用） */
.bb-sidebar__foot{
  flex:0 0 auto;
  padding:12px 16px;
  border-top:1px solid var(--bb-sidebar-border);
  color:var(--bb-sidebar-text-dim);
  font-size:11px; text-align:center;
}

/* 避免 Flatsome 燈箱／浮層蓋住側邊欄 */
.mfp-wrap{z-index:10000;}

/* 確保黏性頁首時內容不被遮住 */
@media (min-width:1025px){
  body.bb-has-sidebar.sticky-header #header{position:sticky; top:0;}
}
