/* =====================================================
   Dock 风格导航栏 - 左侧竖向悬浮图标栏
   ===================================================== */

/* 左侧 Dock 导航栏容器 */
.subnav {
  position: fixed !important;
  left: 12px !important;
  top: calc(var(--topbar-h) + 20px) !important;
  width: 72px !important;
  max-height: calc(100vh - var(--topbar-h) - 100px) !important;
  padding: 12px 0 !important;
  background: rgba(255, 255, 255, 0.75) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-radius: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
  z-index: 9 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* 隐藏状态 */
.subnav.hidden {
  display: none !important;
}

/* 折叠状态（响应式） */
.subnav.collapsed {
  width: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: hidden !important;
}

/* Dock 内部容器 */
.subnav-inner {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 0 !important;
}

/* 隐藏分组标题 */
.subnav-group-title {
  display: none !important;
}

/* 分组容器 */
.subnav-group {
  display: none !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 !important;
  width: 100% !important;
}

/* 活跃的分组显示 */
.subnav-group.active {
  display: flex !important;
}

/* 相邻分组之间的分隔线 */
.subnav-group + .subnav-group::before {
  content: "" !important;
  display: block !important;
  width: 40px !important;
  height: 1px !important;
  background: rgba(0, 0, 0, 0.08) !important;
  margin: 4px 0 !important;
}

/* Dock 图标项 */
.sub-item {
  width: 52px !important;
  height: 52px !important;
  padding: 0 !important;
  border-radius: 14px !important;
  border: 1px solid rgba(59, 130, 246, 0.12) !important;
  background: rgba(59, 130, 246, 0.1) !important;
  cursor: pointer !important;
  font-weight: 400 !important;
  color: rgba(59, 130, 246, 0.9) !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: column !important;
  gap: 0 !important;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  transform-origin: center !important;
  overflow: hidden !important;
  font-size: 24px !important;
  line-height: 1 !important;
}

/* Hover 放大动画 */
.sub-item:hover {
  transform: scale(1.2) !important;
  background: rgba(59, 130, 246, 0.2) !important;
  border-color: rgba(59, 130, 246, 0.25) !important;
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.15) !important;
}

/* 活跃状态 */
.sub-item.active {
  background: rgba(59, 130, 246, 0.25) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
  color: rgba(37, 99, 235, 1) !important;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2) !important;
}

.sub-item.active:hover {
  transform: scale(1.25) !important;
  box-shadow: 0 14px 32px rgba(59, 130, 246, 0.25) !important;
}

/* 图标 */
.sub-item .sub-icon {
  width: 100% !important;
  height: 100% !important;
  font-size: 24px !important;
  line-height: 52px !important;
  text-align: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

/* 文字信息 */
.sub-item .sub-text {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Hover 时显示完整信息提示 */
.sub-item::after {
  content: attr(data-label) !important;
  position: absolute !important;
  left: 100% !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin-left: 12px !important;
  padding: 6px 12px !important;
  background: rgba(15, 23, 42, 0.9) !important;
  color: white !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  opacity: 0 !important;
  transition: opacity 0.2s ease !important;
  z-index: 10 !important;
}

.sub-item:hover::after {
  opacity: 1 !important;
}

/* 页面特定的活跃色 */
.subnav[data-page="archive"] .sub-item.active {
  background: rgba(109, 40, 217, 0.25) !important;
  border-color: rgba(109, 40, 217, 0.35) !important;
  color: rgba(109, 40, 217, 1) !important;
  box-shadow: 0 8px 20px rgba(109, 40, 217, 0.2) !important;
}

.subnav[data-page="archive"] .sub-item:hover {
  background: rgba(109, 40, 217, 0.2) !important;
  border-color: rgba(109, 40, 217, 0.25) !important;
  box-shadow: 0 12px 24px rgba(109, 40, 217, 0.15) !important;
}

.subnav[data-page="chat"] .sub-item.active {
  background: rgba(67, 56, 202, 0.25) !important;
  border-color: rgba(67, 56, 202, 0.35) !important;
  color: rgba(67, 56, 202, 1) !important;
  box-shadow: 0 8px 20px rgba(67, 56, 202, 0.2) !important;
}

.subnav[data-page="chat"] .sub-item:hover {
  background: rgba(67, 56, 202, 0.2) !important;
  border-color: rgba(67, 56, 202, 0.25) !important;
  box-shadow: 0 12px 24px rgba(67, 56, 202, 0.15) !important;
}

/* 移除原有的伪元素样式 */
.sub-item::before {
  display: none !important;
}

/* 滚动条优化 */
.subnav::-webkit-scrollbar {
  width: 4px !important;
}

.subnav::-webkit-scrollbar-track {
  background: transparent !important;
}

.subnav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2) !important;
  border-radius: 2px !important;
}

.subnav::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3) !important;
}

/* 响应式 - 平板装置 */
@media (max-width: 768px) {
  .subnav {
    left: 8px !important;
    top: calc(var(--topbar-h) + 16px) !important;
    width: 64px !important;
  }

  .sub-item {
    width: 48px !important;
    height: 48px !important;
    font-size: 20px !important;
  }

  .sub-item .sub-icon {
    line-height: 48px !important;
    font-size: 20px !important;
  }
}

/* 响应式 - 手机装置 */
@media (max-width: 480px) {
  .subnav {
    left: 6px !important;
    top: calc(var(--topbar-h) + 12px) !important;
    width: 56px !important;
    max-height: calc(100vh - var(--topbar-h) - 120px) !important;
  }

  .sub-item {
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
    font-size: 18px !important;
  }

  .sub-item .sub-icon {
    line-height: 44px !important;
    font-size: 18px !important;
  }

  .sub-item::after {
    display: none !important;
  }
}
