@layer business {
/* ============================================================================
   navibar.css — Function Panel 模式最左图标栏（窄/宽两态 + 长按换位）
   仅在 #app.fp-mode 下显示；desktop 模式隐藏。
   ============================================================================ */

#navibar {
  display: none; /* 默认隐藏，仅 fp 模式显示 */
}

#app.fp-mode #navibar {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: var(--navibar-w, 56px);
  height: 100vh;
  background: rgba(245, 241, 232, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  /* 不加 border-right：分隔线由 #navibar-divider 的 ::after 统一绘制（与 chat 分割线一致，避免双线） */
  padding: 10px 0;
  box-sizing: border-box;
  z-index: 200;
  user-select: none;
}

/* fp 模式下移动端不显示 navibar（移动端走 mobile-tabs 独立轨道） */
@media (max-width: 768px) {
  #app.fp-mode #navibar { display: none; }
}

.navibar-items {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 8px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.navibar-items::-webkit-scrollbar { display: none; }

.navibar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 0 8px;
  border-radius: 10px;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: background 0.12s;
  flex-shrink: 0;
}

.navibar-item:hover  { background: rgba(0, 0, 0, 0.06); }
.navibar-item:active { background: rgba(43, 94, 167, 0.10); }
.navibar-item.is-active { background: rgba(43, 94, 167, 0.12); }

.navibar-item.dragging {
  opacity: 0.25;
}

/* 拖拽 ghost（fixed 跟随鼠标） */
.navibar-item-ghost {
  position: fixed;
  z-index: 9999;
  opacity: 0.85;
  pointer-events: none;
  background: var(--bg-card);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  border-radius: 10px;
}

/* 硬编码 icon 与 desktop 保持一致：彩色方块底（复用 .ic-*）+ 白色图标。
   激活态由 .navibar-item.is-active 行高亮表达（desktop 无激活态，差异仅此一处）。 */
.navibar-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #fff;
  overflow: hidden;
}
.navibar-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* PNG 插件图标铺满，不加人为背景 */
.navibar-icon:has(img) { background: none; }

.navibar-label {
  font-size: 0.78rem;
  color: var(--text-primary, var(--text-main));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}

/* 窄态：item 内容居中，label 不占位（用 display:none 而非 opacity，避免图标被推向左） */
#navibar[data-expanded="false"] .navibar-item { justify-content: center; }
#navibar[data-expanded="false"] .navibar-label { display: none; }
/* 窄态图标居中后，角标改贴居中图标右上角 */
#navibar[data-expanded="false"] .navibar-badge { left: auto; right: 6px; }

/* 宽态：显示 label */
#navibar[data-expanded="true"] .navibar-label {
  opacity: 1;
  pointer-events: auto;
}

/* 窄态：隐藏 label，hover 出 tooltip（用原生 title 属性 + ::after） */
#navibar[data-expanded="false"] .navibar-item:hover::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-main);
  color: var(--bg-card);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

/* navibar 角标（与 dock-badge 同视觉，定位相对 .navibar-item）。
   默认贴宽态图标右上角；窄态图标居中，下面覆写为贴居中图标右上角。 */
.navibar-badge {
  position: absolute;
  top: 4px;
  left: 32px;
  min-width: 16px;
  height: 16px;
  background: var(--color-danger);
  border: 2px solid rgba(255,255,255,0.85);
  border-radius: 8px;
  font-size: 0.58rem;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  font-weight: 700;
  pointer-events: none;
  line-height: 1;
  z-index: 1;
}

/* navibar 宽度分割线（fp 模式：navibar ↔ function-panel，拖动调宽度，与 #fp-divider 同视觉） */
#navibar-divider { display: none; }

#app.fp-mode #navibar-divider {
  display: block;
  width: 5px;
  flex-shrink: 0;
  background: transparent;
  cursor: col-resize;
  position: relative;
  z-index: 400;
  touch-action: none;
}
#app.fp-mode #navibar-divider::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 2px;
  width: 1px;
  background: var(--border-color-default);
  transition: background 0.15s;
}
#app.fp-mode #navibar-divider:hover::after,
#app.fp-mode #navibar-divider.dragging::after {
  background: var(--color-primary);
}

/* fp 模式移动端：navibar 分割线隐藏 */
@media (max-width: 768px) {
  #app.fp-mode #navibar-divider { display: none !important; }
}

}
