/* =========================================================
   AshPetals API Docs — white glass theme over wallpaper
   参考 mcsmanager anime-vitality 手法（变量覆盖+半透明玻璃）
   白色系，不搞粉色。壁纸: /wallpaper.webp (cover/fixed)
   ========================================================= */

/* ---------- 主色（清爽蓝，与 logo 一致，非粉） ---------- */
:root {
  --vp-c-brand-1: #3d6bff;
  --vp-c-brand-2: #2f56d6;
  --vp-c-brand-3: #274bbd;
  --vp-c-brand-soft: rgba(61, 107, 255, 0.12);
  --lgd-glass: rgba(255, 255, 255, 0.78);
  --lgd-glass-strong: rgba(255, 255, 255, 0.88);
  --lgd-glass-nav: rgba(255, 255, 255, 0.72);
  --lgd-glass-side: rgba(255, 255, 255, 0.62);
  --lgd-glass-dark: rgba(15, 17, 24, 0.78);
  --lgd-glass-dark-strong: rgba(15, 17, 24, 0.88);
  --lgd-glass-dark-side: rgba(15, 17, 24, 0.66);
}

/* ---------- 全页壁纸背景 ---------- */
html,
body {
  background-color: #eef1f7 !important;
  background-image: url('/wallpaper.webp');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* ---------- 顶部导航玻璃 ---------- */
.VPNavBar {
  background: var(--lgd-glass-nav) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}
.VPNavBar .content,
.VPNavBar.has-sidebar .content {
  background: transparent !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.VPNavBarTitle .title {
  color: #1d2538;
}

/* ---------- 侧边栏玻璃 ---------- */
.VPSidebar {
  background: var(--lgd-glass-side) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border-right: 1px solid rgba(15, 23, 42, 0.06);
}

/* ---------- 正文玻璃卡片（直接子选择器，避免误伤 aside 内部的 .content） ---------- */
.VPDoc .container > .content {
  background: var(--lgd-glass) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border-radius: 16px;
  box-shadow: 0 10px 36px rgba(15, 23, 42, 0.1);
  padding: 20px 28px;
}
.VPDocAside {
  background: transparent !important;
}
.aside-content {
  background: var(--lgd-glass) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}
.aside-content .VPDocAsideOutline .outline-title {
  color: #1d2538;
}

/* ---------- 页脚透明 ---------- */
.VPFooter {
  background: transparent !important;
}
.VPFooter .footer {
  color: rgba(29, 37, 56, 0.75);
}

/* ---------- 移动端全屏菜单玻璃 ---------- */
.VPNavScreen {
  background: var(--lgd-glass-strong) !important;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

/* ---------- 表格 / 代码块在玻璃上的对比度 ---------- */
.vp-doc table {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  overflow: hidden;
}
.vp-doc tr:nth-child(2n) {
  background: rgba(61, 107, 255, 0.045);
}

/* ---------- 暗色模式：半透明深灰玻璃 ---------- */
.dark html,
.dark body {
  background-color: #0d1017 !important;
}
.dark .VPNavBar {
  background: var(--lgd-glass-dark) !important;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
.dark .VPNavBarTitle .title {
  color: #e6e9f0;
}
.dark .VPSidebar {
  background: var(--lgd-glass-dark-side) !important;
  border-right-color: rgba(255, 255, 255, 0.05);
}
.dark .VPDoc .container > .content {
  background: var(--lgd-glass-dark) !important;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.35);
}
.dark .aside-content {
  background: var(--lgd-glass-dark) !important;
}
.dark .aside-content .VPDocAsideOutline .outline-title {
  color: #e6e9f0;
}
.dark .VPNavScreen {
  background: var(--lgd-glass-dark-strong) !important;
}
.dark .VPFooter .footer {
  color: rgba(230, 233, 240, 0.6);
}
.dark .vp-doc table {
  background: rgba(255, 255, 255, 0.04);
}

/* =========================================================
   布局增强 2026-08-08: 搜索居中 / 侧边栏滚动条隐藏+收起 / 全站柔和动效
   ========================================================= */

/* ---------- 搜索居中（桌面端 grid 三列: 菜单 | 搜索 | 右侧按钮） ---------- */
@media (min-width: 960px) {
  .VPNavBar .content-body {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: var(--vp-nav-height);
  }
  .VPNavBar .menu {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }
  .VPNavBar .search {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
  }
  .VPNavBar .translations,
  .VPNavBar .appearance,
  .VPNavBar .social-links,
  .VPNavBar .extra {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
}

/* ---------- 侧边栏: 隐藏滚动条 + 收起过渡 ---------- */
.VPSidebar {
  scrollbar-width: none;
  -ms-overflow-style: none;
  transition: transform 0.3s ease;
}
.VPSidebar::-webkit-scrollbar {
  display: none;
}
.VPContent,
.VPLocalNav,
.VPNavBar.has-sidebar .content {
  transition: padding-left 0.3s ease;
}

/* 收起状态: 侧边栏移出 + 正文/导航 padding 直接覆盖（变量保持 272px 不动） */
@media (min-width: 960px) {
  body.lgd-sidebar-collapsed .VPSidebar {
    transform: translateX(-100%);
  }
  body.lgd-sidebar-collapsed .VPContent {
    padding-left: 32px !important;
  }
  body.lgd-sidebar-collapsed .VPLocalNav {
    padding-left: 0 !important;
  }
  body.lgd-sidebar-collapsed .VPNavBar.has-sidebar .title {
    position: static;
    width: auto;
    padding: 0 16px 0 32px;
  }
  body.lgd-sidebar-collapsed .VPNavBar.has-sidebar .content {
    padding-left: 0;
  }
  /* 覆盖 VitePress scoped transition（特异性不足的部分用 !important 补） */
  body .VPSidebar {
    transition: transform 0.3s ease !important;
  }
}

/* ---------- 侧边栏收起切换按钮（已移除，改用左缘 auto-show） ---------- */
@media (max-width: 959px) {
  .lgd-sidebar-toggle {
    display: none !important;
  }
}

/* ---------- 全站柔和动效 ---------- */
html {
  scroll-behavior: smooth;
}

@keyframes lgd-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.VPDoc .container > .content {
  animation: lgd-fade-in 0.45s ease both;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.VPDoc .container > .content:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
}

a,
button {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.vp-doc a {
  text-decoration-color: transparent;
  transition: text-decoration-color 0.25s ease, color 0.2s ease;
}
.vp-doc a:hover {
  text-decoration-color: currentColor;
}
.VPSidebar a,
.VPSidebar button {
  transition: color 0.2s ease, background-color 0.2s ease;
}
.vp-doc table tr {
  transition: background-color 0.2s ease;
}
.vp-doc table tr:hover {
  background-color: rgba(61, 107, 255, 0.07) !important;
}
.dark .vp-doc table tr:hover {
  background-color: rgba(61, 107, 255, 0.12) !important;
}
.VPNavBarSearch button,
.VPNavBarAppearance button {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.VPNavBarSearch button:hover,
.VPNavBarAppearance button:hover {
  transform: translateY(-1px);
}
.vp-doc div[class*='language-'] {
  transition: box-shadow 0.3s ease;
}
.vp-doc div[class*='language-']:hover {
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
}
.dark .VPDoc .container > .content:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
::selection {
  background: rgba(61, 107, 255, 0.18);
}

/* =========================================================
   增强 2026-08-08b: 顶栏纯色 / 侧边栏左缘自动弹出 / 搜索展开动画
   ========================================================= */

/* ---------- 顶栏纯色（去掉玻璃透壁纸，logo 下方 curtain 同步纯色） ---------- */
.VPNavBar {
  background: #ffffff !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.dark .VPNavBar {
  background: #16181d !important;
}
.VPSidebar .curtain {
  background-color: #ffffff !important;
}
.dark .VPSidebar .curtain {
  background-color: #16181d !important;
}

/* ---------- 收起态: 鼠标靠近左缘自动弹出 ---------- */
.lgd-sidebar-hover-zone {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 14px;
  z-index: 59;
  cursor: pointer;
}
body:not(.lgd-sidebar-collapsed) .lgd-sidebar-hover-zone {
  display: none;
}
body.lgd-sidebar-collapsed.lgd-sidebar-hover-open .VPSidebar {
  transform: translateX(0);
  box-shadow: 0 0 44px rgba(15, 23, 42, 0.2);
}

/* ---------- 搜索动画（苹果 Spotlight 风格: 缩放淡入 + 弹性曲线 + 退出反向） ---------- */
.VPLocalSearchBox .backdrop {
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  backdrop-filter: blur(12px) saturate(1.15);
  transition: opacity 0.26s ease;
  background: rgba(15, 23, 42, 0.32) !important;
}
.dark .VPLocalSearchBox .backdrop {
  background: rgba(8, 10, 16, 0.6) !important;
}
.VPLocalSearchBox .shell {
  animation: lgd-search-pop 0.34s cubic-bezier(0.32, 0.72, 0, 1);
  transform-origin: 50% 0;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}
@keyframes lgd-search-pop {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
/* 关闭动画: closing 类由 search-anim.js 在销毁前添加 */
.VPLocalSearchBox.closing .backdrop {
  opacity: 0;
  transition: opacity 0.26s ease;
}
.VPLocalSearchBox.closing .shell {
  opacity: 0;
  transform: translateY(-10px) scale(0.97);
  transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
}

/* ---------- 正文居中: 无右侧大纲页面, 卡片在正文区内水平居中 ---------- */
.VPDoc:not(.has-aside) .content-container {
  margin-left: auto;
  margin-right: auto;
}

/* ---------- 布局微调 2026-08-08c ---------- */
/* 移动端正文卡片 padding 收紧，避免窄屏挤压 */
@media (max-width: 640px) {
  .VPDoc .container > .content {
    padding: 14px 16px !important;
    border-radius: 12px;
  }
}
/* 弹出中的侧边栏（auto-show）链接 hover 反馈 */
body.lgd-sidebar-collapsed.lgd-sidebar-hover-open .VPSidebar .VPLink:hover {
  background-color: rgba(61, 107, 255, 0.08);
}

/* ---------- has-aside 页面: 收起态右侧大纲彻底隐藏(任何视口), 卡片居中; 大纲仅在固定展开时显示 ---------- */
@media (min-width: 960px) {
  body.lgd-sidebar-collapsed .VPDoc.has-aside .aside {
    display: none !important;
  }
  body.lgd-sidebar-collapsed .VPDoc.has-aside .container > .content {
    flex: 1 1 auto;
  }
  body.lgd-sidebar-collapsed .VPDoc.has-aside .content-container {
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---------- 全屏侧边栏收窄（VitePress 1440 规则默认拉到 ~512px 太宽） ---------- */
@media (min-width: 1440px) {
  :root {
    --vp-sidebar-width: 300px;
  }
  .VPSidebar {
    width: 300px !important;
    padding-left: 32px !important;
  }
  .VPNavBar.has-sidebar .title {
    width: 300px;
    padding-left: 32px;
  }
}

/* =========================================================
   2026-08-08n: 文字 logo + 动态拉伸平滑过渡
   ========================================================= */

/* ---------- 文字 logo（渐变字标） ---------- */
.VPNavBarTitle .title {
  font-weight: 650;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #3d6bff 0%, #7c5cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.dark .VPNavBarTitle .title {
  background: linear-gradient(120deg, #7fa0ff 0%, #b39dff 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ---------- 动态拉伸平滑（断点切换不瞬跳） ---------- */
.VPSidebar {
  transition: transform 0.3s ease, width 0.3s ease;
}
.VPNavBar.has-sidebar .title {
  transition: width 0.3s ease, padding-left 0.3s ease;
}
.VPDoc .container > .content {
  transition: padding 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.VPDoc .content-container {
  transition: margin-left 0.3s ease, margin-right 0.3s ease;
}
/* aside 用 塌缩+淡出 代替 display:none（display 不可过渡） */
body.lgd-sidebar-collapsed .VPDoc.has-aside .aside {
  display: block !important;
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: width 0.3s ease, opacity 0.3s ease;
}

/* =========================================================
   2026-08-12 fable5: 响应式 / 表格 / 对比度 / 减少“营销感”干扰
   ========================================================= */

/* 手机：fixed 壁纸常导致重绘卡顿与错位，改为 scroll */
@media (max-width: 959px) {
  html,
  body {
    background-attachment: scroll !important;
  }
}

/* 正文卡片：保留毛玻璃（对齐主站 glass 感），文档页不做 hover 上浮 */
.VPDoc .container > .content {
  /* 比纯白更透，blur 负责可读；主站同类 blur 16px + 半透明 */
  background: rgba(255, 255, 255, 0.72) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.25) !important;
  backdrop-filter: blur(18px) saturate(1.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 10px 36px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.dark .VPDoc .container > .content {
  background: rgba(15, 17, 24, 0.72) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.2) !important;
  backdrop-filter: blur(18px) saturate(1.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.VPDoc .container > .content:hover {
  transform: none;
  /* 悬停略加深玻璃，不位移 */
  background: rgba(255, 255, 255, 0.78) !important;
  box-shadow:
    0 12px 40px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.dark .VPDoc .container > .content:hover {
  background: rgba(15, 17, 24, 0.78) !important;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* 右侧大纲卡片同样毛玻璃 */
.aside-content {
  background: rgba(255, 255, 255, 0.62) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.2) !important;
  backdrop-filter: blur(14px) saturate(1.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.dark .aside-content {
  background: rgba(15, 17, 24, 0.66) !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* =========================================================
   2026-08-12 fable5: 右侧「本页定位器」
   默认收起 = 窄轨 + 缩略文字（可点跳转）
   悬停/焦点/键盘 = 展开完整毛玻璃目录浮卡
   对标 Claude / Grok / ChatGPT 长上下文定位条
   ========================================================= */
@media (min-width: 1280px) {
  /* 布局占位变窄，正文更宽；展开时浮卡盖在内容上 */
  .VPDoc.has-aside .aside {
    width: 52px !important;
    max-width: 52px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    z-index: 24;
  }

  .VPDoc.has-aside .aside-container {
    position: sticky !important;
    top: max(88px, calc(50vh - min(28vh, 240px))) !important;
    width: 52px !important;
    max-height: min(56vh, 480px) !important;
    height: auto !important;
    padding-top: 0 !important;
    margin: 0 !important;
    transition:
      width 0.32s cubic-bezier(0.32, 0.72, 0, 1),
      max-height 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .VPDoc.has-aside .aside-content {
    width: 52px !important;
    max-height: min(56vh, 480px) !important;
    min-height: 120px;
    overflow: hidden !important;
    border-radius: 14px !important;
    padding: 10px 6px !important;
    box-shadow:
      0 10px 28px rgba(15, 23, 42, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition:
      width 0.32s cubic-bezier(0.32, 0.72, 0, 1),
      padding 0.28s ease,
      max-height 0.32s cubic-bezier(0.32, 0.72, 0, 1),
      box-shadow 0.28s ease,
      background-color 0.28s ease;
  }

  /* 收起：标题缩成竖排小字 */
  .VPDoc.has-aside .VPDocAsideOutline .outline-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.18em;
    font-size: 11px !important;
    line-height: 1.2 !important;
    margin: 0 auto 8px !important;
    opacity: 0.75;
    white-space: nowrap;
    transition: opacity 0.2s ease, letter-spacing 0.2s ease;
  }

  /* 收起：链接只露缩略（约 3 字 + …） */
  .VPDoc.has-aside .VPDocOutlineItem .outline-link {
    display: block !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    padding: 5px 0 !important;
    max-width: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    opacity: 0.72;
    transition:
      opacity 0.2s ease,
      color 0.2s ease,
      max-width 0.32s cubic-bezier(0.32, 0.72, 0, 1),
      font-size 0.28s ease,
      padding 0.28s ease;
  }

  .VPDoc.has-aside .VPDocOutlineItem .outline-link:hover {
    opacity: 1;
  }

  /* 嵌套层级在收起态压平，避免缩略乱 */
  .VPDoc.has-aside .VPDocOutlineItem .VPDocOutlineItem {
    padding-left: 0 !important;
  }

  /* 展开态（悬停 / 焦点 / pin） */
  body.lgd-outline-open .VPDoc.has-aside .aside-container,
  body.lgd-outline-pin .VPDoc.has-aside .aside-container {
    width: 220px !important;
    max-height: min(62vh, 520px) !important;
  }
  body.lgd-outline-open .VPDoc.has-aside .aside-content,
  body.lgd-outline-pin .VPDoc.has-aside .aside-content {
    width: 220px !important;
    max-height: min(62vh, 520px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 12px 12px 14px !important;
    box-shadow:
      0 16px 48px rgba(15, 23, 42, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.55);
  }
  body.lgd-outline-open .VPDoc.has-aside .VPDocAsideOutline .outline-title,
  body.lgd-outline-pin .VPDoc.has-aside .VPDocAsideOutline .outline-title {
    writing-mode: horizontal-tb;
    letter-spacing: 0.01em;
    font-size: 12px !important;
    margin-bottom: 8px !important;
    opacity: 0.9;
    text-align: left;
  }
  body.lgd-outline-open .VPDoc.has-aside .VPDocOutlineItem .outline-link,
  body.lgd-outline-pin .VPDoc.has-aside .VPDocOutlineItem .outline-link {
    max-width: none;
    text-align: left;
    font-size: 12.5px !important;
    line-height: 1.45 !important;
    padding: 4px 0 !important;
    opacity: 0.92;
    white-space: normal;
  }
  body.lgd-outline-open .VPDoc.has-aside .VPDocOutlineItem .VPDocOutlineItem,
  body.lgd-outline-pin .VPDoc.has-aside .VPDocOutlineItem .VPDocOutlineItem {
    padding-left: 12px !important;
  }

  /* pin 指示：标题前小点 */
  body.lgd-outline-pin .VPDoc.has-aside .VPDocAsideOutline .outline-title::before {
    content: '● ';
    color: #3d6bff;
    font-size: 10px;
  }

  .VPDoc.has-aside .aside-content::-webkit-scrollbar {
    width: 4px;
  }
  .VPDoc.has-aside .aside-content::-webkit-scrollbar-thumb {
    background: rgba(29, 37, 56, 0.2);
    border-radius: 4px;
  }
  .dark .VPDoc.has-aside .aside-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
  }

  @supports (height: 100dvh) {
    .VPDoc.has-aside .aside-container {
      top: max(88px, calc(50dvh - min(28dvh, 240px))) !important;
      max-height: min(56dvh, 480px) !important;
    }
    .VPDoc.has-aside .aside-content {
      max-height: min(56dvh, 480px) !important;
    }
    body.lgd-outline-open .VPDoc.has-aside .aside-container,
    body.lgd-outline-pin .VPDoc.has-aside .aside-container,
    body.lgd-outline-open .VPDoc.has-aside .aside-content,
    body.lgd-outline-pin .VPDoc.has-aside .aside-content {
      max-height: min(62dvh, 520px) !important;
    }
  }
}

@media (min-width: 1600px) {
  body.lgd-outline-open .VPDoc.has-aside .aside-container,
  body.lgd-outline-pin .VPDoc.has-aside .aside-container,
  body.lgd-outline-open .VPDoc.has-aside .aside-content,
  body.lgd-outline-pin .VPDoc.has-aside .aside-content {
    width: 240px !important;
  }
}

/* =========================================================
   2026-08-12 fable5: 全站动态过渡（克制、可用优先）
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  /* 正文卡片入场 stagger 感：标题 → 段 → 表 */
  .vp-doc > div > :where(h1, h2, h3, p, ul, ol, table, pre, blockquote) {
    animation: lgd-rise 0.42s cubic-bezier(0.32, 0.72, 0, 1) both;
  }
  .vp-doc > div > h1 { animation-delay: 0.02s; }
  .vp-doc > div > h2 { animation-delay: 0.05s; }
  .vp-doc > div > :nth-child(n + 3) { animation-delay: 0.08s; }

  @keyframes lgd-rise {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  /* 侧栏链接 / 顶栏 / 分页 */
  .VPSidebar .item,
  .VPNavBarMenuLink,
  .VPDocFooter .pager-link {
    transition:
      color 0.2s ease,
      background-color 0.2s ease,
      transform 0.22s cubic-bezier(0.32, 0.72, 0, 1),
      opacity 0.2s ease,
      box-shadow 0.22s ease;
  }
  .VPDocFooter .pager-link:hover {
    transform: translateY(-1px);
  }

  /* 表格行 / 代码块 */
  .vp-doc tbody tr {
    transition: background-color 0.18s ease, transform 0.18s ease;
  }
  .vp-doc div[class*='language-'] {
    transition: box-shadow 0.28s ease, transform 0.28s ease;
  }

  /* 主题切换：背景与玻璃柔和过渡 */
  body,
  .VPDoc .container > .content,
  .aside-content,
  .VPSidebar,
  .VPNavBar {
    transition:
      background-color 0.35s ease,
      color 0.25s ease,
      border-color 0.25s ease,
      box-shadow 0.3s ease;
  }

  /* 左侧 auto-show 侧栏：更顺滑 */
  body.lgd-sidebar-collapsed .VPSidebar {
    transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1) !important;
  }
  body.lgd-sidebar-collapsed.lgd-sidebar-hover-open .VPSidebar {
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vp-doc > div > :where(h1, h2, h3, p, ul, ol, table, pre, blockquote) {
    animation: none !important;
  }
  .VPDoc.has-aside .aside-container,
  .VPDoc.has-aside .aside-content,
  .VPDoc.has-aside .VPDocOutlineItem .outline-link {
    transition: none !important;
  }
}

/* 表格在玻璃上：半透明底，仍可透出一点壁纸 */
.vp-doc table {
  background: rgba(255, 255, 255, 0.55) !important;
}
.dark .vp-doc table {
  background: rgba(255, 255, 255, 0.04) !important;
}

/* 不支持 backdrop-filter 时退回更不透明，避免糊字 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .VPDoc .container > .content {
    background: rgba(255, 255, 255, 0.94) !important;
  }
  .dark .VPDoc .container > .content {
    background: rgba(18, 20, 28, 0.94) !important;
  }
}

/* 中等宽度（非全屏桌面）：避免侧栏+大纲双挤正文 */
@media (min-width: 960px) and (max-width: 1279px) {
  .VPDoc.has-aside .aside {
    display: none !important;
  }
  .VPDoc.has-aside .content-container {
    margin-left: auto;
    margin-right: auto;
  }
  .VPDoc .container > .content {
    padding: 18px 22px;
  }
}

/* 表格：横向滚动 + 表头对比 + URL 断行 + 行悬停 */
.vp-doc .table-wrapper,
.vp-doc div[class*='language-'],
.vp-doc table {
  max-width: 100%;
}
.vp-doc table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
}
.dark .vp-doc table {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
.vp-doc th,
.vp-doc td {
  padding: 10px 12px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.dark .vp-doc th,
.dark .vp-doc td {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
.vp-doc thead th {
  background: rgba(29, 37, 56, 0.06);
  color: #121826;
  font-weight: 650;
  white-space: nowrap;
}
.dark .vp-doc thead th {
  background: rgba(255, 255, 255, 0.06);
  color: #eef1f7;
}
.vp-doc tbody tr:last-child td {
  border-bottom: none;
}
.vp-doc tbody tr:hover {
  background-color: rgba(61, 107, 255, 0.07) !important;
}
.vp-doc td code {
  word-break: break-all;
  white-space: normal;
}

/* 代码块：移动端少 padding，避免横向撑破 */
.vp-doc div[class*='language-'] {
  margin: 14px 0 !important;
  border-radius: 10px;
}
@media (max-width: 640px) {
  .VPDoc .container > .content {
    padding: 12px 12px !important;
    border-radius: 10px;
    margin: 0 4px;
  }
  .vp-doc div[class*='language-'] {
    margin-left: -4px !important;
    margin-right: -4px !important;
    border-radius: 8px;
  }
  .vp-doc th,
  .vp-doc td {
    padding: 8px 10px !important;
    font-size: 0.92em;
  }
  /* 顶栏搜索在极窄屏不占过多 */
  .VPNavBarSearch .DocSearch-Button-Placeholder {
    display: none;
  }
}

/* 本页目录（outline）中文标签已由 config 设置；样式统一 */
.VPDocAsideOutline .outline-title {
  font-weight: 650;
  letter-spacing: 0.01em;
}

/* 页脚/分页器：窄屏堆叠更稳 */
.VPDocFooter .prev-next {
  gap: 12px;
}
@media (max-width: 640px) {
  .VPDocFooter .prev-next {
    flex-direction: column;
  }
  .VPDocFooter .pager-link {
    width: 100%;
  }
}

/* 顶栏 sticky 已由 VitePress 提供；确保 z-index 压过玻璃卡片 */
.VPNav {
  z-index: 40;
}

/* 链接：表格内 URL 不要撑破 */
.vp-doc a {
  overflow-wrap: anywhere;
}

/* 减少壁纸在超宽屏“空边”突兀：加一层极淡遮罩提升正文可读 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(238, 241, 247, 0.35) 0%,
    rgba(238, 241, 247, 0.15) 40%,
    rgba(238, 241, 247, 0.4) 100%
  );
}
.dark body::before {
  background: linear-gradient(
    180deg,
    rgba(8, 10, 16, 0.45) 0%,
    rgba(8, 10, 16, 0.25) 45%,
    rgba(8, 10, 16, 0.55) 100%
  );
}
