/* 自定义样式 - 墨与星辰 (性能优化版) */

/* 为整个页面添加背景 - 已移除猫的图片 */
html, body {
  min-height: 100vh !important;
  background-color: #ffffff !important;
}

/* 首页背景 */
.VPHome {
  background-color: #ffffff !important;
}

/* 内容区域 - 恢复正常布局（仅首页） */
.VPHome .VPContent {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border-radius: 12px !important;
  margin: 20px !important;
  padding: 20px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
}

/* 深色模式下的背景（仅首页） */
.dark .VPHome .VPContent {
  background-color: rgba(0, 0, 0, 0.7) !important;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1) !important;
}

/* 博客页面的内容区域（不使用首页样式） */
.VPDoc .VPContent {
  background-color: transparent !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* 首页Hero区域样式 - 恢复正常布局 */
.VPHero {
  background: rgba(255, 255, 255, 0.25) !important;
  border-radius: 20px !important;
  padding: 3rem !important;
  margin: 3rem !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
}

/* 深色模式下的Hero区域 */
.dark .VPHero {
  background: rgba(0, 0, 0, 0.5) !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1) !important;
}

/* 导航栏样式 - 添加背景色 */
.VPNav {
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  z-index: 100 !important;
}

.dark .VPNav {
  background-color: rgba(18, 18, 18, 0.9) !important;
  border-bottom-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* 导航栏内容区域对齐 - 统一所有页面 */
.VPNavBar {
  padding: 0 !important;
}

.VPNavBar .content {
  padding-left: 3rem !important;
  padding-right: 3rem !important;
  max-width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1rem !important;
}

/* 统一所有页面的导航栏标题样式 */
.VPNavBar .title {
  flex-shrink: 0 !important;
  margin-right: auto !important;
  white-space: nowrap !important;
  display: flex !important;
  align-items: center !important;
  overflow: visible !important;
  min-width: 0 !important;
}

/* 在导航栏标题后添加那句话 */
.VPNavBar .VPNavBarTitle {
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  overflow: visible !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  position: relative !important;
}

/* 悬停高亮效果 */
.VPNavBar .VPNavBarTitle:hover {
  color: var(--vp-c-brand-1, #3b82f6) !important;
}

.VPNavBar .VPNavBarTitle:hover::after {
  color: var(--vp-c-brand-1, #3b82f6) !important;
  opacity: 0.9 !important;
}

.VPNavBar .VPNavBarTitle::after {
  content: '信代码能筑巴别塔，也信文字可渡忘川河。';
  margin-left: -8em;
  font-size: 1rem;
  color: rgba(0, 0, 0, 0.65);
  font-weight: 400;
  font-style: italic;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline !important;
  transition: all 0.3s ease !important;
}

/* 信息卡片样式 */
.nav-title-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  min-width: 320px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.nav-title-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dark .nav-title-tooltip {
  background: rgba(18, 18, 18, 0.98);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.nav-title-tooltip-header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dark .nav-title-tooltip-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.nav-title-tooltip-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--vp-c-text-1);
}

.nav-title-tooltip-subtitle {
  font-size: 0.875rem;
  color: var(--vp-c-text-2);
  font-style: italic;
}

.nav-title-tooltip-content {
  margin-bottom: 1rem;
}

.nav-title-tooltip-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--vp-c-text-2);
  transition: color 0.2s ease;
}

.nav-title-tooltip-item:hover {
  color: var(--vp-c-brand-1);
}

.nav-title-tooltip-item-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.nav-title-tooltip-footer {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.dark .nav-title-tooltip-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.nav-title-tooltip-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 8px;
  text-decoration: none;
  color: var(--vp-c-brand-1);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.nav-title-tooltip-link:hover {
  background: rgba(59, 130, 246, 0.15);
  transform: translateY(-1px);
}

/* 确保导航栏内容区域不会换行 */
.VPNavBar .content {
  overflow: visible !important;
  flex-wrap: nowrap !important;
}

.dark .VPNavBar .VPNavBarTitle::after {
  color: rgba(255, 255, 255, 0.7);
}

/* 统一所有页面的内容区域样式 */
.VPNavBar .content-body {
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  margin-left: auto !important;
  flex-shrink: 0 !important;
}

/* 统一搜索框位置（所有页面） */
.VPNavBar .VPNavBarSearch {
  order: 1 !important;
  flex-shrink: 0 !important;
}

/* 统一菜单位置（所有页面） */
.VPNavBar .VPNavBarMenu {
  order: 0 !important;
  flex-shrink: 0 !important;
}

/* 统一主题切换位置（所有页面） */
.VPNavBar .VPNavBarAppearance {
  order: 2 !important;
  flex-shrink: 0 !important;
}

/* 统一社交链接位置（所有页面） */
.VPNavBar .VPNavBarSocialLinks {
  order: 3 !important;
  flex-shrink: 0 !important;
}

/* 侧边栏样式 - 恢复简洁样式 */
.VPSidebar {
  background-color: rgba(255, 255, 255, 0.95) !important;
  border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
  position: sticky !important;
  top: 64px !important;
  height: calc(100vh - 64px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  flex-shrink: 0 !important;
  padding-top: 0 !important;
}

.dark .VPSidebar {
  background-color: rgba(0, 0, 0, 0.85) !important;
  border-right-color: rgba(255, 255, 255, 0.1) !important;
}

/* 首页隐藏侧边栏 */
.VPHome .VPSidebar {
  display: none !important;
}

/* 第一个侧边栏组添加装饰头部 */
.VPSidebar > .sidebar-group:first-child {
  position: relative !important;
  padding-top: 100px !important;
}

.VPSidebar > .sidebar-group:first-child::before {
  content: '📚 快速导航' !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 80px !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  color: white !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  letter-spacing: 0.5px !important;
}

/* 深色模式下第一个侧边栏组装饰 */
.dark .VPSidebar > .sidebar-group:first-child::before {
  background: linear-gradient(135deg, #4c1d95 0%, #6b21a8 100%) !important;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05) !important;
}

/* 侧边栏组 */
.VPSidebar .sidebar-group {
  margin-bottom: 0.5rem !important;
}

/* 侧边栏分组标题（文件夹） */
.VPSidebar .sidebar-group-title {
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  padding: 0.5rem 0.75rem !important;
  margin: 0.25rem 0 !important;
  color: #64748b !important;
}

.dark .VPSidebar .sidebar-group-title {
  color: #94a3b8 !important;
}

/* 侧边栏项（文件链接） */
.VPSidebar .sidebar-item {
  padding: 0.5rem 0.75rem !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
  margin: 0.125rem 0 !important;
  color: #64748b !important;
  font-size: 0.875rem !important;
}

.VPSidebar .sidebar-item:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
  color: #1e293b !important;
}

.dark .VPSidebar .sidebar-item {
  color: #94a3b8 !important;
}

.dark .VPSidebar .sidebar-item:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
}

.VPSidebar .sidebar-item.active {
  background-color: rgba(59, 130, 246, 0.1) !important;
  color: #3b82f6 !important;
  font-weight: 600 !important;
}

.dark .VPSidebar .sidebar-item.active {
  background-color: rgba(59, 130, 246, 0.2) !important;
  color: #60a5fa !important;
}

/* 博客页面布局修复 - 语雀/飞书风格 */
.VPDoc.has-sidebar {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
  position: relative !important;
}

.VPDoc.has-sidebar .container {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 0 !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  position: relative !important;
  z-index: 1 !important;
}

/* 侧边栏固定宽度和定位 */
.VPDoc.has-sidebar .VPSidebar {
  flex-shrink: 0 !important;
  width: 260px !important;
  max-width: 260px !important;
  min-width: 260px !important;
  margin: 0 !important;
  padding: 1rem 0 !important;
}

/* 内容区域自适应 - 恢复简洁样式 */
.VPDoc.has-sidebar .VPContent {
  flex: 1 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 2rem 3rem !important;
  background-color: transparent !important;
  overflow: visible !important;
}

/* 确保文档内容区域正确显示 */
.VPDoc.has-sidebar .VPContent .content {
  max-width: 100% !important;
  padding: 0 !important;
}

.VPDoc.has-sidebar .VPContent .content .vp-doc {
  padding: 0 !important;
}

/* 文档头部样式统一 */
.VPDoc .container .content .vp-doc h1 {
  margin-top: 0 !important;
  margin-bottom: 1.5rem !important;
  padding-bottom: 1rem !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.dark .VPDoc .container .content .vp-doc h1 {
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}


/* 功能卡片样式 - 左侧显示 */
.VPFeature {
  background: rgba(255, 255, 255, 0.9) !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.dark .VPFeature {
  background: rgba(0, 0, 0, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1) !important;
}

/* 隐藏红框区域的元素 */
.VPFeature:nth-child(4),
.VPFeature:nth-child(5),
.VPFeature:nth-child(6) {
  display: none !important;
}

/* 首页工具导航区域对齐Hero宽度 */
.VPHome .container {
  max-width: 100% !important;
  padding: 0 3rem !important;
}
