/* ==========================================================================
   首页：站点数据条 + 主标题 + 热门 / 作者优选（xz 2026-11-05）
   所有类名带 xz- 前缀，只在首页模板与封面模板里输出，
   其它页面不会命中，因此不会影响分类页 / 文章页 / 归档页的既有样式。
   ========================================================================== */

/* ---------- 封面内数据条 ---------- */
.xz-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(500px, 66vw);
  margin: 22px auto 0;
  padding: 11px 0;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 14px;
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  box-shadow: 0 4px 16px rgba(20, 30, 40, .05);
}

.xz-hero-stats > div {
  position: relative;
  text-align: center;
}

.xz-hero-stats > div + div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 24px;
  background: rgba(0, 0, 0, .055);
}

.xz-hero-stats b {
  display: block;
  font-family: "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 600;
  color: #474d54;
  line-height: 1.3;
  letter-spacing: .3px;
}

.xz-hero-stats span {
  font-size: 10.5px;
  color: #848b92;
  letter-spacing: .5px;
}

/* ---------- 站点主标题 ---------- */
.xz-site-head {
  position: relative;
  margin: 46px 0 42px;
  padding-bottom: 22px;
}

/* 主题给所有 h1~h6 加了一条 height:80px + margin-top:-80px 的锚点偏移伪元素，
   作用是在锚点跳转时多留 80px 缓冲。放在正文里无感，但站点标题是内容区第一个
   元素，会被这条规则整块拉进封面 80px——这就是标题"顶住封面"的直接原因。 */
.xz-site-title::before {
  content: none;
}

.xz-site-title {
  margin: 0;
  padding: 0;
  font-family: "Noto Serif SC", "Source Han Serif SC", serif;
  font-size: 23px;
  font-weight: 600;
  color: #3f464d;
  line-height: 1.6;
  letter-spacing: .5px;
}

/* 标题下方一条短横线：给这行字一个落点，避免孤零零地悬在封面下面 */
.xz-site-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44px;
  height: 3px;
  border-radius: 2px;
  background: var(--theme-skin-matching, #505050);
  opacity: .55;
}

/* ---------- 分区标题 ---------- */
.xz-sec {
  margin: 0 0 44px;
}

.xz-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 16px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(0, 0, 0, .055);
}

.xz-sec-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #464c53;
}

.xz-sec-head h2 i {
  font-size: 14px;
  opacity: .42;
}

.xz-sec-head .xz-sec-sub {
  font-size: 12px;
  color: #a5acb2;
  letter-spacing: .3px;
}

.xz-latest-head {
  margin: 0 0 18px;
}

/* ---------- 热门文章：两列带序号 ---------- */
.xz-hot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.xz-hot-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .84);
  border-radius: 12px;
  box-shadow: 0 1px 22px -8px #e2e5e8;
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease;
}

.xz-hot-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px -10px #d5d9de;
}

.xz-rank {
  flex: 0 0 32px;
  font-family: "Noto Serif SC", serif;
  font-size: 25px;
  font-weight: 600;
  color: rgba(70, 76, 83, .19);
  text-align: center;
  line-height: 1;
}

.xz-hot-cover {
  flex: 0 0 84px;
  width: 84px;
  height: 60px;
  border-radius: 8px;
  background-color: #eceef0;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .045);
}

.xz-hot-body {
  flex: 1;
  min-width: 0;
}

.xz-hot-body h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 7px;
  font-size: 14px;
  font-weight: 500;
  color: #4b5157;
  line-height: 1.5;
}

.xz-hot-meta {
  font-size: 11.5px;
  color: #9ba2a8;
  letter-spacing: .2px;
}

/* ---------- 作者优选：三列大图 ---------- */
.xz-picks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.xz-pick {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(255, 255, 255, .86);
  border-radius: 13px;
  box-shadow: 0 1px 22px -8px #e2e5e8;
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease;
}

.xz-pick:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px -12px #d3d8de;
}

.xz-pick-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: #eceef0;
  background-size: cover;
  background-position: center;
}

.xz-pick-tag {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 9px;
  font-size: 10.5px;
  letter-spacing: .6px;
  color: #fff;
  background: rgba(20, 25, 30, .45);
  border-radius: 20px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.xz-pick-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 13px 15px 16px;
}

.xz-pick h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 7px;
  font-size: 15px;
  font-weight: 500;
  color: #464c53;
  line-height: 1.55;
}

.xz-pick p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  margin-top: auto;
  font-size: 12px;
  line-height: 1.75;
  color: #9299a0;
}

/* ---------- 最新文章：票根摘要列加宽 ----------
   原来封面 80% / 摘要 18.5%，860px 容器里摘要正文只有 152px，每行约 9 个汉字。
   改成 68.5% / 28% 后每行约 14 个汉字，可读性明显好转。
   限定 #main 直接子级，避免影响分类页那套 .xz-cat-scope 布局。 */
@media (min-width: 768px) {
  #main > article.post-list-thumb .post-thumb {
    width: 68.5%;
  }

  #main > article.post-list-thumb .post-excerpt {
    width: 28%;
    left: 70%;
    top: 7%;
    max-height: 86%;
  }

  #main > article.post-list-thumb .post-excerpt p {
    font-size: 14px;
    line-height: 24px;
  }

  #main > article.post-list-thumb:nth-child(2n) .post-excerpt {
    left: 2%;
  }

  #main > article.post-list-thumb:nth-child(2n) .post-title {
    left: 33.5%;
  }

  #main > article.post-list-thumb:nth-child(2n) .post-date {
    left: 32.8%;
  }

  #main > article.post-list-thumb .post-title {
    max-width: 62%;
  }

  /* 右上角那排元信息（作者/分类/字数/热度/评论）原来的 right:21.5% 是按「封面 80%」
     算的，封面收到 68.5% 后它的右端会越过封面边界、压到右侧摘要上。
     这里按新封面宽度重新贴回封面右上角。注意必须给图右的偶数卡片单独一条：
     上面那条带 #main 的选择器特异性更高，会把原主题的 nth-child(2n){right:1.3%} 顶掉，
     不补的话偶数卡片的 meta 会跑到左边摘要上。 */
  #main > article.post-list-thumb .post-meta {
    right: 33%;
    max-width: 62%;
  }

  #main > article.post-list-thumb:nth-child(2n) .post-meta {
    right: 1.5%;
    max-width: 62%;
  }
}

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  /* 封面欢迎语：原来 nowrap + ellipsis，390 宽下只剩「这里是专…」，允许两行完整显示 */
  .header-info {
    white-space: normal !important;
    max-width: 88% !important;
  }

  .header-info p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal !important;
    text-overflow: clip !important;
    font-size: 14px;
    line-height: 1.7;
  }

  /* 数据条：窄屏压成一行小字，用极淡底 + 小字号退到签名下面当脚注，
     不再抢欢迎语的视线；白底可保证在明暗两种封面图上都读得清。 */
  .xz-hero-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 14px;
    row-gap: 2px;
    width: auto;
    max-width: 92vw;
    margin: 18px auto 0;
    padding: 6px 14px;
    background: rgba(255, 255, 255, .42);
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 20px;
    box-shadow: none;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  .xz-hero-stats > div {
    display: flex;
    align-items: baseline;
    gap: 3px;
    text-align: left;
  }

  .xz-hero-stats > div + div::before {
    display: none;
  }

  .xz-hero-stats b {
    display: inline;
    font-size: 12px;
    font-weight: 600;
    color: #41474d;
    line-height: 1.2;
    letter-spacing: 0;
  }

  .xz-hero-stats span {
    font-size: 10px;
    color: #6b7278;
    letter-spacing: 0;
  }

  .xz-site-head {
    margin: 34px 0 28px;
    padding-bottom: 18px;
  }

  .xz-site-title {
    font-size: 19px;
    line-height: 1.6;
  }

  .xz-sec {
    margin-bottom: 32px;
  }

  .xz-hot {
    grid-template-columns: 1fr;
  }

  .xz-picks {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .xz-pick {
    flex-direction: row;
  }

  .xz-pick-cover {
    flex: 0 0 108px;
    width: 108px;
    aspect-ratio: auto;
  }

  .xz-pick-tag {
    display: none;
  }

  .xz-pick-body {
    padding: 10px 12px;
  }

  .xz-pick h3 {
    margin-bottom: 5px;
    font-size: 13.5px;
    line-height: 1.5;
  }

  .xz-pick p {
    font-size: 11.5px;
    line-height: 1.6;
  }
}

/* ---------- 暗色模式 ---------- */
body.dark .xz-hero-stats {
  background: rgba(40, 42, 45, .7);
  border-color: rgba(255, 255, 255, .1);
}

body.dark .xz-hero-stats b {
  color: #e6e8ea;
}

body.dark .xz-hero-stats span {
  color: #9aa1a7;
}

body.dark .xz-site-title,
body.dark .xz-sec-head h2,
body.dark .xz-hot-body h3,
body.dark .xz-pick h3 {
  color: #dcdfe2;
}

body.dark .xz-sec-head {
  border-bottom-color: rgba(255, 255, 255, .08);
}

body.dark .xz-hot-item,
body.dark .xz-pick {
  background: rgba(40, 42, 45, .82);
  box-shadow: 0 1px 22px -8px rgba(0, 0, 0, .5);
}

body.dark .xz-hot-cover,
body.dark .xz-pick-cover {
  background-color: #2b2d30;
}

body.dark .xz-hot-meta,
body.dark .xz-pick p,
body.dark .xz-sec-head .xz-sec-sub {
  color: #8b9298;
}

/* ==========================================================================
   手机端：只做两处确定性的收敛，不动卡片的定位结构
   --------------------------------------------------------------------------
   整块改流式会和主题的 content-visibility + lazy 组合冲突（封面图从不请求、
   整块发黑），代价大于收益，已回滚。这里保留的改动都不涉及布局定位：
   1) 卡片右上那排元信息原是竖排 4 行、96px 高，盖住封面近四成，还会与左侧
      日期条互相挤压 —— 手机端直接不显示，日期/标题/摘要已足够判断是否点击；
   2) 分区标题行允许换行，副标题不再被挤成竖排。
   ========================================================================== */
@media (max-width: 767px) {
  /* 卡片高度 300 → 340：元信息移走后多出的空间给摘要，原来只能显示 1.5 行 */
  #main > article.post-list-thumb {
    height: 340px;
  }

  /* 元信息不占了，标题浮层可以放宽，长标题少折一行 */
  #main > article.post-list-thumb .post-title {
    max-width: 86%;
  }

  #main > article.post-list-thumb .post-meta {
    display: none;
  }

  .xz-sec-head {
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  .xz-sec-head h2 {
    flex: 1 1 auto;
    min-width: 0;
  }

  .xz-sec-head .xz-sec-sub {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}
