/* orcai-nav.css  v4
   把「隐藏 + 排序」从 JS 下沉到 CSS。

   根治的问题：JS 靠 display:none 逐行隐藏，Vue 切路由会重建 DOM 节点，
   新节点在下一次轮询(900ms)前是可见的 —— 表现就是「点任何一个功能就全部展开」。
   CSS 规则对新建节点立即生效，没有这个窗口。

   已从编译产物核实（别再猜）：
   - 侧栏无 ul/li，行是 Fragment 直出，a.sidebar-link / button.sidebar-link
     是 div.sidebar-section 的直接子元素 -> order 可生效，:has(li) 是空转。
   - .sidebar-section 原本只有 margin-bottom，不是 flex，必须补 flex 才能排序。
   - 顶部 logo 在 .sidebar-header（另一个容器），作用域锁 .sidebar-nav 天然避开。
   - 兑换 = /redeem（nav.redeem）；/purchase=购买订阅 被 featureFlag 关掉未渲染。
   - 自定义项的 href 是 /custom/{id}，不是目标 URL。

   v3 -> v4：一律改精确匹配 [href="..."]，不再用 $= 结尾匹配。
   原因：管理端导航与用户端共用同一个 nav.sidebar-nav，
   $="/subscriptions" 会连 /admin/subscriptions 一起挡掉，
   $="/dashboard" 也会命中 /admin/dashboard 的排序。 */

/* ── 1. 隐藏：并入「文档」的五条 + 兑换 + 我的订阅 + 个人资料 ────── */
.sidebar-nav a[href="/custom/docs-ccswitch"],
.sidebar-nav a[href="/custom/docs-claude"],
.sidebar-nav a[href="/custom/docs-codex"],
.sidebar-nav a[href="/custom/docs-gemini"],
.sidebar-nav a[href="/custom/ccswitch"],
.sidebar-nav a[href="/custom/orcai-studio"],
.sidebar-nav a[href="/subscriptions"],
.sidebar-nav a[href="/profile"] {
  display: none !important;
}

/* ── 2. 排序：仪表盘 → 充值/订阅 → 其余 ──────────────────────────── */
.sidebar-nav .sidebar-section {
  display: flex;
  flex-direction: column;
}
.sidebar-nav .sidebar-section > .sidebar-section-title { order: -10; }

.sidebar-nav .sidebar-section > a[href="/dashboard"] { order: -3; }

.sidebar-nav .sidebar-section > a[href="/custom/migrated_purchase_subscription"],
.sidebar-nav .sidebar-section > a[href="/topup"],
.sidebar-nav .sidebar-section > a[href="/purchase"] { order: -2; }

/* ── 3. 充值/订阅 高亮（描边式，深浅色都不糊） ───────────────────── */
.sidebar-nav a[href="/custom/migrated_purchase_subscription"],
.sidebar-nav a[href="/topup"] {
  box-shadow: inset 0 0 0 1.5px rgba(13, 148, 136, .55);
  border-radius: .75rem;
  font-weight: 600;
}

/* ── 4. 脚本兜底注入的图标占位 ───────────────────────────────────── */
.orcai-ico {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}
.orcai-ico svg { width: 100%; height: 100%; }

/* ── 5. 顶部 logo 强制 OrcAI ─────────────────────────────────────────
   二进制升级会把内嵌 /logo.svg 还原成 Sub2API 的交错 S；site_logo 未落 DB。
   这里在 sub_filter 注入的 CSS 层兜死，升级不丢。资产走 nginx /custom/ alias。 */
.sidebar-logo {
  background-image: url("/custom/logo.png") !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
}
.sidebar-logo > img,
.sidebar-logo > svg { opacity: 0 !important; }
