/* 正文：英文 Roboto，中文霞鹜文楷 Medium */
body {
  font-family: 'Roboto', 'LXGW WenKai Medium', sans-serif;
}

/* 站名：悠哉 Regular，不加粗，拉开字距 */
#site-title,
#site-name,
#nav .site-title,
#nav .site-name {
  font-family: 'Roboto', 'Yozai Medium', sans-serif;
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* 文章标题/各级标题：悠哉 Regular，不加粗 */
h1, h2, h3, h4, h5, h6,
.post-title,
.recent-post-item .post-title {
  font-family: 'Roboto', 'Yozai Medium', sans-serif;
  font-weight: 600;
  color: #d1d6de;
}

/* 导航菜单项：用正文楷体，保证清晰 */
#nav .site-page,
#nav .menu-item {
  font-family: 'Roboto', 'LXGW WenKai Medium', sans-serif;
  font-weight: 400;
}

html, body {
  background-color: #121212 !important;
}

/* ===== 背景毛玻璃层 ===== */
body {
  background: transparent !important;
}

body::before {
  content: '';
  position: fixed;
  inset: -30px;
  z-index: -2;
  background-image: linear-gradient(var(--bg-overlay, rgba(0,0,0,0.6)), var(--bg-overlay, rgba(0,0,0,0.6))), var(--bg-url, none);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  filter: blur(3px);
  pointer-events: none;
}

/* ===== 卡片背景 ===== */

/* 首页：卡片列表 */
#recent-posts > .recent-post-item {
  background: rgba(30, 32, 38, 0.5) !important;
}

/* 文章页 / 独立页 / 归档页：只给内容卡片本身（不透明度 0.7） */
#pjax-content > #post,
#pjax-content > #page,
#pjax-content > #archive,
#pjax-content > #tag,
#pjax-content > #category {
  background: rgba(40, 42, 48, 0.7) !important;
  padding: 2rem 2.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* 侧栏卡片 */
#aside-content .card-widget {
  background: rgba(30, 32, 38, 0.5) !important;
}

@media screen and (max-width: 768px) {
  #pjax-content > #post,
  #pjax-content > #page,
  #pjax-content > #archive {
    padding: 1.2rem 1rem;
  }
}

/* 文字提亮，暗背景上不发灰 */
body, #article-container {
  color: #b6bcc6;
}

/*===== 头像：关旋转 + 放大 ===== */
#aside-content .card-info img,
#aside-content .avatar-img,
.author-info__pic img,
.avatar-img {
  width: 200px !important;
  height: 200px !important;
  min-width: 200px !important;
  object-fit: cover;
  border-radius: 7px !important;
  animation: none !important;
  transition: none !important;
  transform: none !important;
}

/* 直接改主题变量：从源头生效，不用跟选择器抢 */
[data-theme="dark"] {
  --card-bg: rgba(40, 42, 48, 0.7);
  --card-bg-none: rgba(40, 42, 48, 0.7);
}

/* #pjax-content 仅作结构包裹，不贡献任何视觉 */
#pjax-content {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0;
  margin: 0;
}

/* 文字提亮 */
#article-container,
#article-container p,
#recent-posts .recent-post-item .content {
  color: #b6bcc6;
}

/* 顶部导航栏半透明 */
#nav,
#nav.fixed {
  background: rgba(30, 32, 38, 0.3) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* 下拉子菜单也一起透明，否则会突兀 */
#nav .sub-menu {
  background: rgba(30, 32, 38, 0.3) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#nav .site-page,
#nav .site-title {
  color: #b6bcc6 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* 布局切换渐变（保留，主题自己管显示/隐藏） */
#aside-content,
#content-inner,
#recent-posts,
.layout > .post {
  transition: width .7s ease, max-width .7s ease, margin .7s ease,
              opacity .7s ease, transform .5s ease;
}

/* ===== 入场动画：整体一起，由下而上 ===== */
@keyframes pgFadeUp {
  from {
    opacity: 0;
    transform: translateY(150px) scale(.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes asideFade {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* 正文：暂停，等遮罩消失（.pg-ready）再播 */
#pjax-content {
  animation: pgFadeUp 1.15s cubic-bezier(.32,.72,.35,1) both;
  animation-play-state: paused;
}
.pg-ready #pjax-content {
  animation-play-state: running;
}

/* 侧栏：随正文一起淡入（不位移） */
#aside-content {
  animation: asideFade 1s cubic-bezier(.32,.72,.35,1) both;
  animation-play-state: paused;
}
.pg-ready #aside-content {
  animation-play-state: running;
}

/* 顶栏/页脚：不参与入场动画，但保留主题原生的收缩过渡 */
#nav, #nav *, #page-header, #footer, #footer * {
  animation: none !important;
}

/* 侧栏标签卡片关掉（配置不生效时这条兜底） */
#aside-content .card-tags,
#aside-content .card-widget[class*="tag"] {
  display: none !important;
}

/* 关闭目录：隐藏 sticky 区第一个非"最近文章"的卡片 */
#aside-content .sticky_layout > .card-widget:first-child:not(.card-recent-post) {
  display: none !important;
}

/* ===== 加载遮罩 ===== */
#pg-loading {
  position: fixed; inset: 0; z-index: 9999;
  background: #16181d;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s ease;
}
#pg-loading.hide { opacity: 0; pointer-events: none; }

.pg-loading-inner { text-align: center; color: #b6bcc6; }

.pg-loading-avatar {
  width: 110px; height: 110px; border-radius: 50%;
  object-fit: cover; display: block; margin: 0 auto 1rem;
  animation: pgPulse 1.6s ease-in-out infinite;
}
@keyframes pgPulse {
  0%,100% { transform: scale(1); opacity: .88; }
  50%     { transform: scale(1.06); opacity: 1; }
}

.pg-loading-text { margin: 0 0 1.2rem; font-size: .95rem; letter-spacing: .08em; }

.pg-loading-bar {
  width: 140px; height: 3px; margin: 0 auto;
  border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden;
}
.pg-loading-bar i {
  display: block; height: 100%; width: 40%; border-radius: 3px;
  background: #7fb3d5; animation: pgSlide 1.1s ease-in-out infinite;
}
@keyframes pgSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}


/* ===== footer 吸底：内容少时也贴在底部 ===== */
#body-wrap { min-height: calc(100vh - 200px); }


/* ===== 底栏：深灰半透明 ===== */
#footer {
  background: rgba(30, 32, 38, 0.5) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #b6bcc6;
  transition: opacity .15s ease;      /* 配合切页时短暂隐藏 */
}

/* 底栏文字提亮 */
#footer,
#footer a,
#footer .footer-separator,
#footer #footer-wrap,
#footer #footer-custom {
  color: #b6bcc6 !important;
}

#footer a:hover {
  color: #7fb3d5 !important;
}

[data-theme="dark"] {
  --footer-bg: rgba(30, 32, 38, 0.5);
}



/* ===== 加载进度条：加粗 + 光晕 + 柔和淡入淡出 ===== */

/* 关键：别让 pace 用 display:none 瞬间消失，改成可过渡的 opacity */
.pace {
  pointer-events: none;
}
.pace-inactive {
  display: block !important;
  opacity: 0 !important;
}

.pace,
.pace-active,
.pace-running {
  opacity: 1;
  transition: opacity .25s ease !important;
}

.pace .pace-progress {
  height: 3px !important;
  z-index: 2000 !important;
  background: rgba(23, 130, 202, 0.85) !important;
  box-shadow:
    0 0 8px 2px rgba(23, 130, 202, 0.5),
    0 0 3px 1px rgba(23, 130, 202, 0.6) !important;
  /* 推进过程也平滑 */
  transition: transform .3s ease-out, opacity .35s ease !important;
}

/* 走到 100% 后停留 0.25s 再淡出，避免"冲到底就消失" */
.pace-inactive .pace-progress {
  opacity: 0 !important;
  transition: transform .3s ease-out, opacity .4s ease .25s !important;
}

/* 光晕拖尾 */
.pace .pace-progress::after {
  top: 0 !important;
  right: 0 !important;
  width: 50px !important;
  height: 100% !important;
  background: linear-gradient(
    to right,
    rgba(127, 179, 213, 0) 0%,
    rgba(127, 179, 213, .5) 55%,
    rgba(255, 255, 255, .95) 100%
  ) !important;
  box-shadow: 0 0 5px 2px rgba(23, 130, 202, 0.5) !important;
  border-radius: 0 !important;
}