/* ============================================
   自定义样式（精简版）
   深色背景沿用 AnZhiYu 主题原生的 universe 星空粒子特效，
   这里只做：提亮星空 + 调亮底色 + 缩小首页大图。
   注意：不设 body 背景，避免盖住星空 canvas。
   ============================================ */

/* 首页大图：从满屏 100vh 缩小到 45vh，让分类卡片和文章更快出现 */
#page-header.full_page {
  height: 45vh !important;
  min-height: 320px;
}

#page-header.full_page #site-info {
  top: 50%;
}

/* ---------- 提亮星空 ---------- */
/* 星空 canvas 加亮度滤镜，星点更明显 */
[data-theme="dark"] #universe {
  filter: brightness(1.7);
}

/* 底色深蓝灰：比死黑亮一点，但保留足够对比让星点显出来 */
[data-theme="dark"] {
  --global-bg: #141b38;
  --anzhiyu-background: #141b38;
}

/* ===== 自定义卡片（后台可视化编辑） ===== */
.author-content-item.custom-card{display:flex;flex-direction:column;justify-content:center;min-height:120px;background-color:var(--anzhiyu-card-bg);transition:transform .2s}
.author-content-item.custom-card:hover{transform:translateY(-3px)}
.custom-card .card-content{width:100%}
.custom-card-icon{font-size:26px;margin-bottom:6px;line-height:1}
.custom-card .custom-card-body{margin-top:8px;font-size:14px;line-height:1.7;opacity:.9}
.custom-card .custom-card-body p{margin:4px 0}
@media(max-width:768px){.author-content.custom-cards-row .custom-card{width:100%!important}}

/* 写作页样式卡片用到的排版预设（深色模式靠继承，不写死颜色） */
.q-lead{font-size:1.16em;line-height:1.8;font-weight:500;margin:1.5em 0;padding-left:14px;border-left:3px solid #425AEF;opacity:.95}
.figcap{font-size:.85em;opacity:.6;text-align:center;margin:.3em 0 1.4em;line-height:1.7}
.txt-center{text-align:center}

/* 主题默认给 strong 上了 lighttext 色，加粗会连带变色；这里让它只加粗 */
b, strong { color: inherit; }

/* ============================================
   顶部只留一颗心，不显示站点名文字（全站：手机 + 电脑）
   心形按钮样式来自 Uiverse.io「chilly-moth-52」(LilaRest, MIT)，
   尺寸与配色按导航栏适配：浅色用原版淡粉，深色用柔和玫红 + 暗底
   ============================================ */
/* 九宫格快捷菜单保留（左上角原样），只把站点名文字换成心形 */
#blog_name #site-name .title { display: none !important; }
#blog_name #site-name > i { display: none !important; }
#blog_name #site-name { padding: 0 !important; height: auto; overflow: visible; }
/* hover 时不要额外的白色背景框，只让心形自己动 */
#blog_name #site-name:hover { background: none !important; box-shadow: none !important; }

#site-name .site-heart {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 3px solid #ffe2e2;
  border-radius: 50%;
  background-color: #e8e8e8;
  box-shadow: rgba(10, 37, 64, 0.35) 0 -2px 6px 0 inset;
  transition: transform 400ms cubic-bezier(.68, -0.55, .27, 2.5), border-color 400ms ease-in-out, background-color 400ms ease-in-out;
  cursor: pointer;
}
#site-name .site-heart svg {
  width: 17px;
  height: 17px;
  fill: #ff6e6e;
  transition: transform 300ms;
}
/* 触摸/点击时心跳一下 */
#site-name:active .site-heart { background-color: #eee; transform: scale(1.05); animation: heart-moving-borders 3s infinite; }
#site-name:active .site-heart svg { animation: heart-beating 1.2s infinite; }
@media (hover: hover) {
  #site-name:hover .site-heart { background-color: #eee; transform: scale(1.05); animation: heart-moving-borders 3s infinite; }
  #site-name:hover .site-heart svg { animation: heart-beating 1.2s infinite; }
}

/* 深色模式：暗蓝底 + 柔和玫红，和站点深底协调 */
[data-theme="dark"] #site-name .site-heart {
  background-color: #232a3d;
  border-color: rgba(255, 138, 138, 0.32);
  box-shadow: rgba(0, 0, 0, 0.45) 0 -2px 8px 0 inset;
}
[data-theme="dark"] #site-name:active .site-heart { background-color: #2b3147; }
[data-theme="dark"] #site-name .site-heart svg { fill: #ff8a8a; }
@media (hover: hover) {
  [data-theme="dark"] #site-name:hover .site-heart { background-color: #2b3147; }
}

@keyframes heart-moving-borders {
  0% { border-color: #fce4e4; }
  50% { border-color: #ffd8d8; }
  90% { border-color: #fce4e4; }
}
@keyframes heart-beating {
  0% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
  60% { transform: scale(1); }
  100% { transform: scale(1); }
}

/* ============================================
   左上角「应用」菜单：Uiverse「afraid-fox-80」药丸按钮
   按导航高度缩小适配；浅色沿用原版粉白，深色配暗蓝底 + 珊瑚心
   ============================================ */
#nav #blog_name .back-home-button.app-pill {
  width: auto;
  height: 34px;
  padding: 0 12px 0 9px !important;
  gap: 5px;
  border: 3px solid #ffe2e2;
  border-radius: 17px;
  background-color: #e8e8e8 !important;
  color: #867c7c !important;
  box-shadow: rgba(10, 37, 64, 0.35) 0 -2px 6px 0 inset;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .5px;
  margin-right: 8px;
  transition: transform 400ms cubic-bezier(.68, -0.55, .27, 2.5), border-color 400ms ease-in-out, background-color 400ms ease-in-out;
}
#nav #blog_name .back-home-button.app-pill .app-pill-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: #ff6e6e;
  transition: transform 300ms;
}
#nav #blog_name .back-home-button.app-pill .app-pill-text {
  white-space: nowrap;
}
#nav #blog_name .back-home-button.app-pill:hover {
  background-color: #eee !important;
  color: #867c7c !important;
  transform: scale(1.05);
  animation: heart-moving-borders 3s infinite;
}
#nav #blog_name .back-home-button.app-pill:hover .app-pill-icon {
  animation: heart-beating 1.2s infinite;
}

/* 深色模式：暗蓝底 + 柔和珊瑚心 + 半透明粉边 */
[data-theme="dark"] #nav #blog_name .back-home-button.app-pill {
  background-color: #232a3d !important;
  border-color: rgba(255, 138, 138, 0.32);
  color: #f0dede !important;
  box-shadow: rgba(0, 0, 0, 0.45) 0 -2px 8px 0 inset;
}
[data-theme="dark"] #nav #blog_name .back-home-button.app-pill:hover {
  background-color: #2b3147 !important;
  color: #f0dede !important;
}
[data-theme="dark"] #nav #blog_name .back-home-button.app-pill .app-pill-icon {
  fill: #ff8a8a;
}

/* ============================================
   文章详情页不显示首页那种满天星（仅首页保留）
   用 :has 让 pjax 切换页面后也立即生效
   ============================================ */
body:has(#post-info) #universe { display: none !important; }

/* ============================================
   首页窄屏（≤1200）：左侧只留「生活 / 随笔」两张，
   右侧固定只显示最新文章卡（两张，手机一张），不横滑、不裁切。

   尺寸基准：文章卡固定 164px 高（主题写死），
   所以左侧两张卡 = 78 + 8 + 78 = 164，上下边缘与文章卡齐平。
   宽度用 clamp 跟着屏宽走，比例稳定在 2.5:1 左右，最耐看。
   ============================================ */
@media screen and (max-width: 1200px) {
  /* 外层不横向滚动，多出来的卡片直接不出现 */
  #home_top .swiper_container_card {
    overflow: hidden !important;
  }

  /* 左侧两张小卡：宽度随屏自适应，高度锁死与文章卡一致 */
  #home_top .categoryGroup {
    /* 父级是纵向 flex，flex-basis 会顶掉 height，所以这里用 auto */
    flex: 0 0 auto;
    width: clamp(112px, 24vw, 200px) !important;
    height: 164px !important;
    min-width: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
  }
  #home_top .categoryGroup .categoryItem {
    position: relative;
    display: block !important;
    flex: 1 1 0;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0;
    margin: 0 !important;
  }
  /* 第三个板块「记录」在窄屏彻底不显示 */
  #home_top .categoryGroup .categoryItem:nth-child(3) { display: none !important; }

  /* 卡片内：文字垂直居中，下划线固定在文字下方 8px 左右 */
  #home_top a.categoryButton {
    display: flex !important;
    align-items: center;
    height: 100%;
    line-height: 1 !important;
    padding-left: 18px;
  }
  #home_top .categoryButtonText {
    padding-left: 0 !important;
    line-height: 1.1;
    font-size: clamp(1rem, 1.75vw, 1.15rem);
  }
  #home_top a.categoryButton:after {
    top: auto !important;
    bottom: 21px !important;
    left: 18px !important;
    width: 1rem !important;
    height: 2px !important;
  }
  /* 右侧装饰图标：随卡片一起缩放，别糊满整张卡 */
  #home_top a.categoryButton svg,
  #home_top a.categoryButton i {
    font-size: clamp(1.9rem, 4.2vw, 2.6rem);
    width: 70px;
    right: 0;
    top: 50%;
    margin-top: -1.3rem;
  }

  /* 右侧文章卡：只留前两张（最新），平分剩余宽度 */
  #home_top .topGroup {
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
    flex-wrap: nowrap !important;
    overflow: hidden;
  }
  #home_top .topGroup .recent-post-item { display: none !important; }
  #home_top .topGroup .recent-post-item:nth-child(1),
  #home_top .topGroup .recent-post-item:nth-child(2) {
    display: flex !important;
    flex: 1 1 0;
    width: auto !important;
    min-width: 0 !important;
    /* 与左侧小卡的竖向间隙统一成 8px，横竖间距才一致 */
    margin-left: 8px !important;
  }
}

/* 小屏（481–600）：小卡略窄，文章卡标题字号缩小 */
@media screen and (max-width: 600px) {
  #home_top .topGroup .recent-post-item .recent-post-info .article-title { font-size: .9rem !important; }
}

/* 手机（≤480）：右侧只剩一张文章卡，左边「生活 / 随笔」跟着放大，
   宽度按屏宽 34% 走（比窄屏更宽，标签更醒目） */
@media screen and (max-width: 480px) {
  #home_top .categoryGroup {
    flex: 0 0 auto;
    width: clamp(128px, 34vw, 168px) !important;
  }
  #home_top .categoryButtonText { font-size: 1.08rem; }
  #home_top a.categoryButton { padding-left: 16px; }
  #home_top a.categoryButton:after { left: 16px !important; }
  #home_top .topGroup .recent-post-item:nth-child(2) { display: none !important; }
  #home_top .topGroup .recent-post-item:nth-child(1) { flex: 1 1 auto; }
}

/* ============================================================
   深色 · 文章卡片（预览版）
   结构：标题 + 分类胶囊 + 最新/未读 → 标签与时间 → 大封面
   ============================================================ */
[data-theme="dark"] #recent-posts > .recent-post-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  height: auto !important;
  padding: 20px 22px 22px !important;
  gap: 0 !important;
  background: rgba(255, 255, 255, .045) !important;
  border: 1px solid rgba(255, 255, 255, .09) !important;
  border-radius: 20px !important;
  box-shadow: none !important;
  transform: none !important;
  animation: none !important;
  will-change: auto !important;
  overflow: hidden;
  transition: border-color .25s, background .25s !important;
}
[data-theme="dark"] #recent-posts > .recent-post-item:hover {
  border-color: rgba(255, 255, 255, .14) !important;
  background: rgba(255, 255, 255, .04) !important;
}
/* 文字区放最上面 */
[data-theme="dark"] #recent-posts > .recent-post-item > .recent-post-info {
  order: 1;
  height: auto !important;   /* 主题给文字区写死 174px，卡片改版后要放开 */
  min-height: 0 !important;  /* 主题还有 min-height:174px，会撑出空档 */
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}
/* 第一行：标题 → 分类胶囊 → 最新 / 未读 */
[data-theme="dark"] #recent-posts > .recent-post-item .recent-post-info-top {
  margin: 0 !important;
  padding: 0 !important;
  /* 标题独占一行，胶囊/最新/未读落到第二行：两张卡统一成右侧那种排法 */
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 10px !important;
}
[data-theme="dark"] #recent-posts > .recent-post-item .article-title {
  order: 1;
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: 100%;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
  font-size: clamp(17px, 1.28vw, 21px) !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  letter-spacing: .2px;
  color: #eae8f2 !important;
}
[data-theme="dark"] #recent-posts > .recent-post-item .article-title:hover { color: #fff !important; }
[data-theme="dark"] #recent-posts > .recent-post-item .recent-post-info-top-tips {
  order: 2;
  margin: 0 !important;
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  padding: 0 !important;
}
/* 分类胶囊 */
[data-theme="dark"] #recent-posts > .recent-post-item .article-categories-original {
  display: inline-flex;
  align-items: center;
  padding: 3px 15px;
  border-radius: 999px;
  font-size: 14px;
  color: #b492ff !important;
  background: rgba(140, 96, 255, .14);
  border: 1px solid rgba(150, 110, 255, .45);
}
/* 最新 / 未读：灰字、无底色 */
[data-theme="dark"] #recent-posts > .recent-post-item .newPost,
[data-theme="dark"] #recent-posts > .recent-post-item .unvisited-post {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0;
  background: none !important;
  color: #6b6b7a !important;
  font-size: 13px !important;
}
/* 第二行：标签在左、时间在右 */
[data-theme="dark"] #recent-posts > .recent-post-item .article-meta-wrap {
  position: static !important;   /* 主题把它绝对定位到卡片底部，这里拉回文档流 */
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0 0 !important;
  padding: 0 !important;
  font-size: 13px !important;
  color: #6d6d7d !important;
}
[data-theme="dark"] #recent-posts > .recent-post-item .article-meta-wrap .article-meta { margin: 0 !important; }
[data-theme="dark"] #recent-posts > .recent-post-item .article-meta-wrap .article-meta.tags { order: 1 !important; }
[data-theme="dark"] #recent-posts > .recent-post-item .article-meta-wrap .post-meta-date { order: 2 !important; margin: 0 !important; }
[data-theme="dark"] #recent-posts > .recent-post-item .article-meta__tags { color: #6d6d7d !important; }
/* 时间只留「23 小时前」这类文字，去掉图标和「发表于」标签 */
[data-theme="dark"] #recent-posts > .recent-post-item .post-meta-date .anzhiyufont,
[data-theme="dark"] #recent-posts > .recent-post-item .post-meta-date .article-meta-label,
[data-theme="dark"] #recent-posts > .recent-post-item .post-meta-date .article-meta-separator,
[data-theme="dark"] #recent-posts > .recent-post-item .post-meta-date .time_hidden {
  display: none !important;
}
/* 封面：整宽、圆角、放文字下面 */
[data-theme="dark"] #recent-posts > .recent-post-item > .post_cover {
  order: 2;
  position: relative;
  width: 100% !important;
  height: auto !important;
  margin: 16px 0 0 !important;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  -webkit-mask-image: none !important;
  mask-image: none !important;
}
[data-theme="dark"] #recent-posts > .recent-post-item > .post_cover > a {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}
[data-theme="dark"] #recent-posts > .recent-post-item > .post_cover img.post_bg {
  position: static !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 14px !important;
  filter: none !important;
  box-shadow: none !important;
  transform: none !important;
}
/* 简介先不显示，整张卡只留标题/标签/封面 */
[data-theme="dark"] #recent-posts > .recent-post-item .content { display: none !important; }
/* 桌面端保持主题的两栏网格（一行两个），窄屏才单栏整宽 */
@media screen and (min-width: 1201px) {
  [data-theme="dark"] #recent-posts > .recent-post-item {
    width: calc(50% - 8px) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 16px !important;
  }
}
@media screen and (max-width: 1200px) {
  [data-theme="dark"] #recent-posts > .recent-post-item {
    width: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}
/* 手机端：留出边距、缩小内距、封面限高，别一张卡占满整屏 */
@media screen and (max-width: 768px) {
  [data-theme="dark"] #recent-posts > .recent-post-item {
    margin-left: 16px !important;
    margin-right: 16px !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    padding: 15px 15px 16px !important;
    border-radius: 16px !important;
  }
  [data-theme="dark"] #recent-posts > .recent-post-item:not(:first-child) {
    margin-top: 14px !important;
  }
  [data-theme="dark"] #recent-posts > .recent-post-item .recent-post-info-top {
    gap: 8px !important;
  }
  [data-theme="dark"] #recent-posts > .recent-post-item .article-title {
    font-size: clamp(16px, 4.2vw, 20px) !important;
    line-height: 1.4 !important;
  }
  [data-theme="dark"] #recent-posts > .recent-post-item .article-categories-original {
    font-size: 12px;
    padding: 2px 11px;
  }
  [data-theme="dark"] #recent-posts > .recent-post-item .article-meta-wrap {
    margin-top: 9px !important;
    font-size: 12px !important;
  }
  [data-theme="dark"] #recent-posts > .recent-post-item > .post_cover {
    margin-top: 12px !important;
    aspect-ratio: 16 / 10;
    max-height: 210px;
    border-radius: 11px;
  }
  [data-theme="dark"] #recent-posts > .recent-post-item > .post_cover img.post_bg {
    border-radius: 11px !important;
  }
}

/* ============================================================
   首页右卡（今日推荐 / todayCard）：AI × Crypto 环形 logo 动效
   ============================================================ */
#todayCard.gh-ring-on {
  background: transparent !important;
}
#todayCard.gh-ring-on > canvas.gh-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}
/* 原封面图让位给动画 */
#todayCard.gh-ring-on > .todayCard-cover {
  opacity: 0 !important;
  visibility: hidden !important;
}
/* 文字与按钮浮在动画之上 */
#todayCard.gh-ring-on > .todayCard-info,
#todayCard.gh-ring-on > .banner-button-group {
  z-index: 3;
}
/* 底部压暗，保证「欢迎光临／我的博客」在动效上可读 */
#todayCard.gh-ring-on::after {
  box-shadow: 0 -70px 100px -24px rgba(0, 0, 0, 0.6) inset !important;
}
/* 浅色：画布是白底，文字与按钮必须转深色，否则白字压白底看不见 */
[data-theme="light"] #todayCard.gh-ring-on .todayCard-title,
[data-theme="light"] #todayCard.gh-ring-on .todayCard-tips {
  color: #14141a !important;
}
[data-theme="light"] #todayCard.gh-ring-on .banner-button {
  color: #14141a !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] #todayCard.gh-ring-on::after {
  /* 浅色卡的画布自带由白到冷灰的渐变，不再叠白色压暗，否则底部会发灰 */
  box-shadow: none !important;
}

/* ============================================================
   左卡（生活明朗）：WWDC24 hello 动效
   深色走 Lottie（透明矢量）／浅色走透明 WebP（780px，抠自 1344px 原图），挂载见 js/hello-anim.js
   ============================================================ */
[data-theme="dark"] #random-banner.hello-on,
[data-theme="light"] #random-banner.hello-on {
  background-image: none !important;
  background-size: auto !important;
}
[data-theme="dark"] #random-banner.hello-on {
  background-color: #08080c !important;
}
[data-theme="light"] #random-banner.hello-on {
  background-color: #ffffff !important;
}
/* 动效卡上不再需要压暗遮罩，否则 hello 会发灰 */
#random-banner.hello-on::before {
  background: none !important;
}
/* 水平位置由 js/hello-anim.js 的 place() 计算（文字右边界与卡片右边界之间居中），
   这里的 right 只是 JS 未生效时的兜底值 */
#random-banner .hello-anim {
  position: absolute;
  top: 50%;
  right: 4%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}
/* Lottie 画布是 500×500 的正方形，字只占中间一条，所以按宽度算尺寸、上下留白透明溢出 */
[data-theme="dark"] #random-banner .hello-anim {
  width: 60%;
  aspect-ratio: 1 / 1;
}
/* 白底动图已抠成透明，字约占宽度 84.6%，与深色 Lottie 的视觉大小对齐 */
[data-theme="light"] #random-banner .hello-anim {
  width: 68%;
  right: 0.5%;
}
#random-banner .hello-anim svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
#random-banner .hello-anim img {
  width: 100%;
  height: auto;
  display: block;
}
/* 文案压在动效之上 */
#random-banner .banners-title {
  position: relative;
  z-index: 2;
}
#random-banner.hello-on #random-hover {
  z-index: 3;
}

/* 浅色：白底卡上文字要转深色，否则白字压白底看不见 */
[data-theme="light"] #random-banner .banners-title-big {
  color: #17171d !important;
  text-shadow: none !important;
}
[data-theme="light"] #random-banner .banners-title-small {
  color: #8b8b94 !important;
  text-shadow: none !important;
}

/* 生日随笔配图：竖图收窄、横图铺满 */
.bd-figure {
  margin: 1.6rem 0;
  text-align: center;
}
.bd-figure img {
  display: block;
  margin: 0 auto !important;
  border-radius: 14px;
  height: auto;
}
.bd-portrait img {
  width: min(100%, 360px);
}
.bd-wide img {
  width: 100%;
}
.bd-cap {
  text-align: center;
  font-size: 0.86rem;
  opacity: 0.62;
  margin: -0.9rem 0 1.8rem;
}
