/* ============================================================
   字体：与主站「琢器」统一
   ------------------------------------------------------------
   主站字体栈 = 'Open Sans'（西文）+ 'Noto Sans SC Web'（中文）。
   拾光原为 Massively 模板自带的 Merriweather（衬线正文）+
   Source Sans Pro（无衬线标题），与主站观感不一致，故统一为同款：
     · 西文 / 数字 / 符号 → Open Sans（Google Fonts 分片，自托管，
       与主站同样经 ../fonts/open-sans.css 引入）；
     · 中文 → Noto Sans SC（思源黑体，子集化 GB2312 + ASCII）。
   字体家族名的替换已在 main.css 的 12 处字体栈中完成（把
   "Merriweather" / "Source Sans Pro" 换为主站同款栈），故本文件
   无需再写单独的字体栈声明。
   授权：Noto Sans SC — SIL Open Font License 1.1（见
   ../fonts/OFL-NotoSansSC.txt）；Open Sans — Apache License 2.0。
   ============================================================ */

/* 西文 Open Sans（与主站「琢器」同款，Google Fonts 分片自托管）——
   引入方式与主站 main.css 一致；@import 必须位于所有规则之前 */
@import url("../fonts/open-sans.css");

@font-face {
  font-family: 'Noto Sans SC Web';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/noto-sans-sc-300.woff2') format('woff2');
}

@font-face {
  font-family: 'Noto Sans SC Web';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/noto-sans-sc-700.woff2') format('woff2');
}

/* ============================================================
   版权区：保留作者名的原始大小写
   ------------------------------------------------------------
   模板 main.css 为呈现"全大写"的版式风格，给 #copyright 施加了
   text-transform: uppercase，这会把作者名 DovisLiu 渲染成
   DOVISLIU，丢失应有的驼峰大小写。
   作者名 / 版权署名必须区分大小写，故在此关闭该转换。
   （只关 text-transform，模板的字重、字距、颜色等一律不动）
   ============================================================ */
#copyright,
#copyright a,
#copyright li,
#copyright span {
  text-transform: none;
}

/* ============================================================
   管理页（/Dovis，隐藏入口）专用微调 —— 不触碰前台任何样式
   ------------------------------------------------------------
   模板 main.css 里 `input, select, textarea { appearance: none }`
   会把「文件选择框」的原生外观移除，导致图集选图控件显示异常。
   这里只恢复文件选择框的观感（复选框交回模板的 label 自定义样式）。
   ============================================================ */
input[type="file"].adm {
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  border: solid 1px #dbdbdb;
  background: #ffffff;
  color: #555;
  font-family: "Open Sans", "Noto Sans SC Web", sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 0;
  outline: 0;
}

  input[type="file"].adm:hover {
    border-color: #d4d4d4;
  }

/* ============================================================
   首页卡片：标题（居中）→ 图片(左) + 正文预览(右) → 日期·分类（居中）
   ------------------------------------------------------------
   尺寸按线上实测反推（#main 1056px = 72rem 时：网格卡内容宽 489.9px、
   大卡内容宽 941.6px；正文行高 WEB 端取 2 = 29.3px，手机端保持 1.75）：
     · 图片框固定 3:4，其「高度 = 正文行数 × 行高」，两列自然等高，
       图文比例平衡（改前实测：大卡图 527px 对正文 104px，严重失衡）。
     · 网格卡：图 40%（≈196×261）对正文 9 行（264px）；大卡：正文区收窄到
       40rem 居中，图 37.5%（≈220×293）对正文 10 行（293px）。
     · 图片等比 contain 完整显示（横竖都不裁切），留白透明、无占位底色。
   ============================================================ */
#main .post.featured,
#main .posts article {
  display: block;
  text-align: center;
}

/* 标题行：居中，限 2 行等高，保证双列卡片对齐 */
.card-head { margin: 0 0 1rem 0; text-align: center; }
#main .posts article .card-head h2,
#main .post.featured .card-head h2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
  margin: 0;
}

/* 图文区：左图右文，垂直居中（内容短的卡片正文即居中，不留空洞） */
#main .post.featured .card-body,
#main .posts article .card-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.4rem;
}
/* 大卡正文区收窄居中：卡片很宽，若拉满会让正文列过宽、图片显小 */
#main .post.featured .card-body { max-width: 40rem; margin: 0 auto; }

/* 图片框：竖向 3:4，高度由宽度推出，与右侧正文等高 */
#main .posts article .card-media,
#main .post.featured .card-media {
  flex: 0 0 31.5%;
  aspect-ratio: 3 / 4;
  height: auto;
  margin: 0;
  overflow: hidden;
  background: transparent;
}
#main .post.featured .card-media { flex: 0 0 30%; }
#main .posts article .card-media img,
#main .post.featured .card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: transparent;
}

/* 正文预览（右）：整块可点进详情；WEB 端行高 2（模板 2.375 过散、1.75 偏密） */
#main .post.featured .card-text,
#main .posts article .card-text {
  flex: 1 1 auto;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  text-align: left;
}
#main .post.featured .card-text p,
#main .posts article .card-text p {
  margin: 0;
  line-height: 2;
  text-align: left;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 行数 = 图片高度 ÷ 行高（行高 29.3px：7 行 ≈ 205px，对齐 31.5% 图框的 206px） */
#main .posts article .card-text p { -webkit-line-clamp: 7; }
#main .post.featured .card-text p { -webkit-line-clamp: 8; }
#main .posts article .card-text:hover p,
#main .post.featured .card-text:hover p { color: #18bfef; }

/* 日期 · 分类：卡片最下方居中；分类可点进入分类页 */
#main .posts article > .date,
#main .post.featured > .date {
  display: block;
  margin: 1rem 0 0;
  color: #888;
  font-size: 0.85em;
  letter-spacing: 0.05em;
  text-align: center;
}
#main .date .cat-link { color: inherit; border-bottom: dotted 1px; }
#main .date .cat-link:hover { color: #18bfef !important; border-bottom-color: transparent; }

/* 窄视口下 #main 变窄 → 图框随之变矮，正文行数同步下调保持等高 */
@media (max-width: 1020px) {
  #main .posts article .card-text p { -webkit-line-clamp: 6; }
}
@media (max-width: 900px) {
  #main .posts article .card-text p { -webkit-line-clamp: 5; }
}
@media (max-width: 736px) {
  #main .post.featured .card-body,
  #main .posts article .card-body { flex-direction: column; gap: 0.9em; align-items: stretch; }
  /* 选择器带 .image 提高权重：文件后段还有 `#main > .posts > article .image{max-width:none}`，
     同权重时后者胜出会把图片放开到整行（手机端图过高） */
  #main .post.featured .card-media.image,
  #main .posts article .card-media.image { flex: 0 0 auto; width: 100%; max-width: 16rem; margin: 0 auto; }
  /* 手机端行距不加宽：恢复 1.75 */
  #main .post.featured .card-text p,
  #main .posts article .card-text p { line-height: 1.75; }
  #main .post.featured .card-text p { -webkit-line-clamp: 7; }
}

/* ============================================================
   详情页：参照公众号「图片消息」版式（左图右文两栏）
   ------------------------------------------------------------
   比例/节奏最初量自刘先生给的公众号截图（1103×779，见
   _ab/wxmsg_probe.py 的像素分析），2026-09-18 与 09-20 两轮微调后：
     · 左栏图片宽 = 内容宽的 43%（3:4 竖图）
     · 中间留白        = 内容宽的 13%
     · 右栏文字        = 内容宽的 44%（约 22 汉字 / 行）
     · 标题与正文同字号、仅加粗、左对齐
     · 行距 = 1.5×字号；段距 = 1.15 行盒
     · 首图下方其余图片做成方形小缩略图，在左栏下居中、带序号角标
     · 左栏（图 + 缩略图 + 返回按钮）sticky 钉住；右栏互动栏 sticky 钉在视口底边

   拾光内容宽 = #main 1056 − .post 左右 padding 114.4 = 941.6px。
   正文基准字号按"右栏 = 20 字/行"反推得 ≈19px = 1.3rem（首页卡片仍 14.67px）。
   改字号只需改下面这一处；栏宽/留白比例是 grid 的 fr 与 %。
   ============================================================ */
#main > .post.post-detail {
  display: grid;
  /* 2026-09-20 刘先生"文字区可再宽一点"：留白 16%→13%、右栏 40.3%→44%。
     左栏同步从 43.7% 收到 43%（图片只窄约 6.6px），换正文每行多排约 2 个字。 */
  grid-template-columns: 43fr 44fr;       /* 左栏 43% / 右栏 44% */
  column-gap: 13%;                        /* 中间留白 13% */
  row-gap: 2.6rem;
  align-items: start;
  font-size: 1.3rem;                      /* 正文基准 19px */
  line-height: 1.5;                       /* 2026-09-20：1.75 → 1.5，行距收紧 */
}
#main > .post.post-detail > .post-left { grid-column: 1; min-width: 0; }
#main > .post.post-detail > .post-right { grid-column: 2; min-width: 0; }
/* 互动栏 / 评论 / 返回按钮等：占满整行（网格里必须显式跨列，否则会落进单列） */
#main > .post.post-detail > *:not(.post-left):not(.post-right) { grid-column: 1 / -1; }

/* 没有配图的时光（本站 18 篇里有 4 篇无图）：左栏整个不渲染（无图可放），
   退回单栏居中；「返回全部时光」没有"图片区"可挂，改由右栏正文之后渲染。 */
#main > .post.post-detail.no-media { display: flex; flex-direction: column; }
#main > .post.post-detail.no-media > .post-right { order: 1; width: 100%; max-width: 40rem; margin: 0 auto; }
#main > .post.post-detail.no-media .post-foot { margin-top: 1.4rem; }

/* ---- 左栏：图片轮播（大图 + 缩略图条）+ 互动栏 ----
   公众号「图片消息」里点缩略图切换大图；此处用 .is-on 标出当前项，由 shareScript 切换。
   刘先生 2026-09-18 的五点反馈中，2/3/4 都落在这一块。 ---- */

/* 大图区：一次只显示当前那张，居中放置。
   ⚠️ align-items 必须保持 stretch（默认）：让 .post-slide 的高度 = 大图区高度，
   里面的 img 才能靠 max-height:100% 被"限高缩放"。写成 align-items:center 时，
   slide 会退化成内容高度（= 图片原始高），max-height:100% 就失去参照 → 图片直接溢出容器。 */
#main > .post.post-detail .post-media {
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}
#main > .post.post-detail .post-slide {
  display: none;
  border-bottom: 0;   /* 模板 #main a { border-bottom: dotted 1px } 会在大图下方画一条虚线 */
}
#main > .post.post-detail .post-slide.is-on {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
#main > .post.post-detail .post-slide img {
  display: block;
  width: 100%;
  height: 100%;
  /* 用 object-fit 而不是 max-width/max-height：
     大图区高度为 auto 时，"百分比 max-height"的解析依赖链很脆，
     会出现图片按整栏宽铺开、下半截被 overflow 裁掉的情况。
     contain 则无论容器多高多矮都等比完整显示、居中，永不裁切。 */
  object-fit: contain;
}

/* 缩略图条：全部图片平铺、当前项高亮（截图里是带一圈色框的那张），右下角带序号 */
#main > .post.post-detail .post-thumbs {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;   /* 截图中缩略图条在左栏下方居中 */
  gap: 0.9rem;
  flex: 0 0 auto;
}
#main > .post.post-detail .post-thumbs li { margin: 0; }
#main > .post.post-detail .post-thumb {
  appearance: none; -webkit-appearance: none;
  background: none; border: 0; padding: 0; margin: 0;
  /* 同 .post-foot：模板给 <button> 的 inset 深色描边也要清掉（缩略图是 button） */
  box-shadow: none;
  font: inherit; cursor: pointer;
  position: relative;
  display: block;
  width: 4.4rem;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}
#main > .post.post-detail .post-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
#main > .post.post-detail .post-thumb:hover { opacity: 0.85; }
#main > .post.post-detail .post-thumb.is-on {
  opacity: 1;
  box-shadow: 0 0 0 2px #18bfef;   /* 当前图：accent 细边框（对应截图里那圈色框） */
}
/* 右下角序号（截图里是 "1" "2" 角标），用文字阴影代替色块，保持轻量 */
#main > .post.post-detail .post-thumb .n {
  position: absolute; right: 0.3rem; bottom: 0.25rem;
  font-size: 0.55rem; line-height: 1; letter-spacing: 0;
  color: #fff;
  text-shadow: 0 0 0.28rem rgba(0, 0, 0, 0.85), 0 0 0.1rem rgba(0, 0, 0, 0.9);
}

/* ---- 互动栏（刘先生 2026-09-20 调整）----
   ① 去掉「推荐」，「写留言」改成「评论」→ 只剩 赞 / 分享 / 评论；
   ② 位置从"左栏图片下方"挪到"文字区（右栏）下方"；
   ③ 但要求"固定在页面上、不随文字内容滚动" → 用 position: sticky; bottom: 0
      钉在视口底边，正文从它后面滚过去，滚到文章末尾它再自然落回原位。
      （不用 position: fixed：fixed 要自己算左右偏移去对齐右栏，窄视口下必错。） */
#main > .post.post-detail .post-foot {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 1.6rem;
}
#main > .post.post-detail .post-foot .who {
  display: flex; align-items: center; gap: 0.45rem;
  min-width: 0;
  border-bottom: 0; text-decoration: none;
}
#main > .post.post-detail .post-foot .avatar {
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: #18bfef; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.76rem; line-height: 1; font-weight: 700;
  flex: 0 0 auto;
}
#main > .post.post-detail .post-foot .who-name {
  font-size: 0.82rem; color: #333;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#main > .post.post-detail .post-foot .act {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: flex-start; gap: 1.05rem;
}
#main > .post.post-detail .post-foot .act li { margin: 0; }
#main > .post.post-detail .post-foot .act button,
#main > .post.post-detail .post-foot .act a {
  appearance: none; -webkit-appearance: none;
  background: none; border: 0; padding: 0; margin: 0;
  /* ⚠️ 刘先生第 2 点"多余的框"根因就在这行下面那条注释所指的模板规则：
     模板 main.css:2206-2210 给所有 <button> 加了
       box-shadow: inset 0 0 0 2px #212931  （深色，看起来就是一个黑框）
     <a> 不吃这条规则 —— 所以同一排图标里"只有按钮有框、链接没有"
     （探针实测 FOOT_BTN：button bd=0px/none 但 sh=rgb(33,41,49) 0 0 0 2px inset；a 无 sh）。
     border:0 挡不住 box-shadow，必须显式清掉。 */
  box-shadow: none;
  font: inherit;   /* ⚠️ 模板 reset 不含 button，漏掉这句按钮会走浏览器默认字体 */
  color: #8a8a8a;
  cursor: pointer;
  text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 0.16rem;
  line-height: 1;
  transition: color 0.15s ease;
}
#main > .post.post-detail .post-foot .act .ico { display: flex; }
#main > .post.post-detail .post-foot .act .ico svg { width: 1.5rem; height: 1.5rem; display: block; }
#main > .post.post-detail .post-foot .act .txt { font-size: 0.7rem; letter-spacing: 0.02em; }
#main > .post.post-detail .post-foot .act .txt em { font-style: normal; }
#main > .post.post-detail .post-foot .act button:hover,
#main > .post.post-detail .post-foot .act a:hover { color: #18bfef; }
#main > .post.post-detail .post-foot .act #likeBtn.on { color: #18bfef; }
#main > .post.post-detail .post-foot .act #likeBtn.on .ico svg { fill: currentColor; }
/* 键盘可达性：去掉默认黑框不等于去掉焦点提示，用 accent 描边补回来
   （只匹配 :focus-visible，鼠标点击不会出现描边） */
#main > .post.post-detail .post-foot .act button:focus-visible,
#main > .post.post-detail .post-foot .act a:focus-visible,
#main > .post.post-detail .post-thumb:focus-visible {
  outline: 2px solid #18bfef;
  outline-offset: 2px;
}

/* ---- 桌面端：整栏 sticky —— 滚动时图片与互动栏钉住不动，只有右侧文字在翻（刘先生第 4 点）---- */
@media screen and (min-width: 981px) {
  #main > .post.post-detail > .post-left {
    position: sticky;
    top: 1rem;
    /* 只留 2rem 余量：让图片在常见视口下能"按左栏宽铺满"（贴近截图观感），
       而不是被提前压得很小。只有视口确实太矮时 max-height 才介入，
       由 img 的 object-fit:contain 等比缩小、完整显示。
       ⚠️ sticky 元素一旦高于视口，它的下半部分就永远看不到了，所以这个上限必须存在。 */
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
  }
  #main > .post.post-detail .post-media { flex: 1 1 auto; min-height: 0; }

  /* 互动栏钉在视口底边（右栏内 sticky，见上方 .post-foot 段的说明）。
     sticky 生效前提：祖先链没有 overflow != visible 的新滚动容器 —— 前面已用
     body:has(.post-detail) #wrapper { overflow: clip } 解决（探针 STICKY_BLOCKERS 可复核）。
     白底 + 一条极淡的分隔线：正文从它后面滚过时不会显得"文字被莫名截断"。 */
  #main > .post.post-detail > .post-right > .post-foot {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: #ffffff;
    padding: 0.55rem 0 0.5rem;
    border-top: solid 1px rgba(0, 0, 0, 0.07);
    margin-top: 2.2rem;
  }
}

/* ---- 右栏：日期·分类 → 标题（加粗左对齐，不再是居中大字）---- */
#main > .post.post-detail > .post-right > header.major { margin: 0 0 1.7rem; text-align: left; }
#main > .post.post-detail > .post-right header.major > .date {
  display: block;
  /* ⚠️ 模板 main.css（约 2915 行）有一条
       header > .date { display: block; font-size: 0.8rem; height: 1; ... }
     —— `height: 1` 漏了单位，本环境把它解析成 1px，于是日期元素只有 1px 高、
     文字溢出并与下方标题重叠（探针量到 height=1px 才发现，属模板遗留问题）。
     按"不改 main.css"的约定，在这里显式改回 auto。 */
  height: auto;
  line-height: 1.6;
  margin: 0 0 0.8rem;
  text-align: left;
  color: #999;
  font-size: 0.72em;
  letter-spacing: 0.05em;
}
/* 模板给 header.major > .date 加了左右装饰横线（:before/:after），截图里没有，去掉 */
#main > .post.post-detail > .post-right header.major > .date:before,
#main > .post.post-detail > .post-right header.major > .date:after { display: none; }
#main > .post.post-detail > .post-right header.major > h2 {
  text-align: left;
  font-size: 1.2em;      /* 略大于正文（截图是等号，这里给标题一点层级） */
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}

/* ---- 正文：左对齐，段间空一整行（= 一个行盒高，等同公众号的 \n\n 分段）---- */
#main > .post.post-detail .post-body { max-width: none; margin: 0; }
#main > .post.post-detail .post-body p {
  /* 2026-09-20 刘先生"文字的间距可小一点"：段距 1.62em→1.15em、行距 1.62→1.5。
     段距不再等于一整行盒，正文更紧凑、同样字数排得更短。 */
  margin: 0 0 1.15em;
  line-height: 1.5;
  text-align: left;
}
#main > .post.post-detail .post-body > :last-child { margin-bottom: 0; }
#main > .post.post-detail .post-body h2,
#main > .post.post-detail .post-body h3,
#main > .post.post-detail .post-body h4,
#main > .post.post-detail .post-body h5 {
  text-align: left;
  letter-spacing: 0;
  text-transform: none;
  margin: 1.6em 0 0.7em;
}
#main > .post.post-detail .post-body ul,
#main > .post.post-detail .post-body ol { text-align: left; }
#main > .post.post-detail .post-body blockquote {
  text-align: left;
  margin: 1.2em 0;
  padding-left: 1em;
  border-left: solid 3px #e0e0e0;
  color: #666;
}
#main > .post.post-detail .post-body img { max-width: 100%; height: auto; }

/* ---- 窄视口：两栏会挤到每行 13~15 字，故 ≤980 改单栏堆叠（图在上、文在下），
        字号同步降到 1.15rem（≤736 再降到 1.09rem = 16px）---- */
@media screen and (max-width: 980px) {
  #main > .post.post-detail { display: block; font-size: 1.15rem; }
  #main > .post.post-detail .post-left { clear: both; }
  #main > .post.post-detail .post-media,
  #main > .post.post-detail .post-thumbs,
  #main > .post.post-detail .post-foot { max-width: 22rem; margin-left: auto; margin-right: auto; }
  #main > .post.post-detail .post-right { margin-top: 2rem; }
}
@media screen and (max-width: 736px) {
  #main > .post.post-detail { font-size: 1.09rem; }
  #main > .post.post-detail .post-media,
  #main > .post.post-detail .post-thumbs,
  #main > .post.post-detail .post-foot { max-width: 18rem; }
  #main > .post.post-detail .post-right { margin-top: 1.6rem; }
}

/* ============================================================
   详情页互动区（2026-09-20 改版）
   ------------------------------------------------------------
   · 赞 / 分享 / 评论 三个图标栏 = .post-foot（见上方同组规则）；
   · 评论列表与表单改成弹窗（原生 <dialog>.showModal()），默认不可见（刘先生第 4 点）；
   · 操作提示 .share-toast 浮在底部，不占布局。
   ============================================================ */

/* 弹窗内的提示文字（提交中 / 提交失败…）仍在文档流里 */
.share-hint { color: #888; min-height: 1em; margin: 0.4rem 0 0; }

/* 操作提示 toast（已点赞 / 已取消赞 / 链接已复制…）
   必须脱离文档流：互动栏是 sticky 在视口底边的，提示文字若还留在栏内，
   一出现就会把栏顶高、正文跟着跳。 */
.share-toast {
  position: fixed;
  left: 50%;
  bottom: 6rem;
  z-index: 60;
  margin: 0;
  padding: 0.45rem 1rem;
  background: rgba(33, 41, 49, 0.92);
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 0.6rem);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.share-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* 「返回全部时光」：有图时挂在左栏图片/缩略图条下方（随左栏一起 sticky 钉住） */
#main > .post.post-detail .post-back {
  flex: 0 0 auto;
  margin: 1.1rem 0 0;
}

/* ---- 评论弹窗 ----
   用原生 <dialog>：showModal() 后进入 top layer，既不会被 #wrapper 的 overflow:clip 裁切，
   也自带 Esc 关闭与焦点约束，省掉手写遮罩 + 焦点陷阱。
   「点遮罩关闭」由 shareScript 判断 e.target === dialog 实现。 */
.comment-dialog {
  position: fixed;
  /* ⚠️ 不要用 inset:0 + margin:auto 居中：实测（探针 DIALOG_TEST）弹窗被贴在
     视口左上角（left=0 top=0）—— 因为这里高度是 max-height 决定的 auto 高度，
     四个方向的 auto 外边距分不出余量。改用 top/left:50% + translate 百分比的经典写法，
     百分比基于元素自身尺寸，任何高度下都精确居中。 */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(34rem, calc(100vw - 2rem));
  max-height: min(80vh, 42rem);
  padding: 0;
  border: 0;
  background: #ffffff;
  color: #212931;
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.comment-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.comment-dialog .cd-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-bottom: solid 1px #ececec;
}
.comment-dialog .cd-title { font-size: 0.95rem; font-weight: 700; letter-spacing: 0; }
.comment-dialog .cd-close {
  appearance: none; -webkit-appearance: none;
  background: none; border: 0;
  box-shadow: none;                  /* 同上：清掉模板给 <button> 的 inset 深色描边 */
  padding: 0; margin: 0;
  font: inherit; font-size: 1.35rem; line-height: 1;
  color: #8a8a8a; cursor: pointer;
}
.comment-dialog .cd-close:hover { color: #18bfef; }
.comment-dialog .cd-close:focus-visible { outline: 2px solid #18bfef; outline-offset: 2px; }
.comment-dialog .cd-body {
  max-height: calc(min(80vh, 42rem) - 3.2rem);
  overflow: auto;
  padding: 0.7rem 1.1rem 1.1rem;
  text-align: left;
}
/* 弹窗内的表单沿用模板的 .fields / .field / .actions，只把字号收一档 */
.comment-dialog .cd-body input[type="text"],
.comment-dialog .cd-body textarea { font-size: 0.9rem; }
.comment-dialog .cd-body .actions { margin-bottom: 0; }
.comment-dialog .comment-item:first-child { border-top: 0; }

/* ---- 详情页顶部留白收紧 ----
   模板 main.css:3496 的 #header 是硬编码 `height: 20rem; padding-bottom: 8rem`
   （20rem ≈ 293px，纯 rem 不随视口变）—— 一屏里被它吃掉三分之一，正文几乎看不到几行。
   参照公众号把详情页的这块压到 13rem（≈191px）。⚠️ 只减 padding 是没用的，
   总高由 height 决定（border-box），必须两个一起改。
   :has() 限定只作用于详情页，首页 / 分类页保持模板原样。 */
body:has(.post-detail) #header {
  /* ⚠️ 只压 height 会让 logo 压到 #nav 上：#nav 是贴在 header 底部的一条 4rem 高的深色导航条，
     logo（高 72.3px）的底边必须留在 nav 上沿之上 —— 探针实测 height:13rem / padding-bottom:3rem 时
     两者重叠 14.7px（logo_vs_nav_overlap=14.7）。故 padding-bottom 必须 ≥ nav 高度 4rem + 间隙。 */
  height: 14rem;
  padding-bottom: 5.5rem;
}

/* ---- sticky 的拦路虎：模板给 #wrapper 设了 overflow: hidden ----
   只要祖先链上有 overflow != visible，position: sticky 就不再相对视口，
   而是相对那个"滚动容器"——而 #wrapper 高度 = 内容高、自己永远不滚，
   于是左栏表现得和普通元素一样被滚走（探针实测 left_moved = 600 = 滚动距离）。
   换成 overflow: clip：裁切效果一样，但不新建滚动容器，sticky 恢复。
   （Chrome 90+ / Firefox 81+ / Safari 16+ 支持） */
body:has(.post-detail) #wrapper { overflow: clip; }
/* 评论相关样式：列表项 .comment-item / 空态 .comment-empty 见上方 .comment-dialog 段；
   .comment-admin / .tag-* 归管理后台的评论审核列表使用 */
.comment-item { border-top: 1px solid #eee; padding: 0.8rem 0; }
.comment-item .meta { color: #999; font-size: 0.85em; }
.comment-item .body { margin: 0.3rem 0 0; white-space: pre-wrap; }
.comment-empty { color: #888; }

/* ============================================================
   右上角社交图标：与主站（琢器）同步（2026-10-16）
   ------------------------------------------------------------
   拾光用 Massively 模板：ul.icons li a.icon:before 是圆形字形（border-radius:100%），
   模板默认无填色、hover 只把字形染成 accent。这里做与主站一致的：
   默认灰圆(#8a8a8a) + 深灰字形(#2E2E2E)；hover 上浮 5px + 品牌色填充 + 白字。
   品牌色映射：GitHub #181717 / 微信 #07C160 / RSS #EE802F（RSS 标准橙）/ 邮件 #EA4335。
   模板 #nav ul.icons li a.icon:hover:before{color:#18bfef} 会被下方 .fa-x 更高优先级盖掉。
   ============================================================ */
#nav ul.icons li a.icon {
  display: inline-block;
  transition: transform .2s ease-in-out;
}
#nav ul.icons li a.icon:hover {
  transform: translateY(-5px);
}
#nav ul.icons li a.icon:before {
  background-color: #8a8a8a;
  color: #2E2E2E;
  transition: background-color .2s ease-in-out, color .2s ease-in-out, box-shadow .2s ease-in-out;
}
#nav ul.icons li a.icon.fa-github:hover:before   { background-color: #181717; color: #fff; }
#nav ul.icons li a.icon.fa-weixin:hover:before   { background-color: #07C160; color: #fff; }
#nav ul.icons li a.icon.fa-rss:hover:before      { background-color: #EE802F; color: #fff; }
#nav ul.icons li a.icon.fa-envelope:hover:before { background-color: #EA4335; color: #fff; }
.comment-admin { border-top: 1px solid #eee; padding: 0.8rem 0; }
.comment-admin .meta { color: #999; font-size: 0.85em; }
.comment-admin .body { margin: 0.3rem 0 0; white-space: pre-wrap; }
.tag-pending { color: #c0392b; }
.tag-approved { color: #27ae60; }

/* ============================================================
   整体紧凑化（覆盖模板的大留白）
   ------------------------------------------------------------
   模板 main.css 桌面留白极大： #main > .post { padding: 8rem 8rem 6rem }
   #main > .posts > * { padding: 4rem } —— 观感松散。此处统一收紧，
   只改留白与超大标题字号，不动配色 / 字体 / 圆角 / 阴影等模板风格。
   ============================================================ */
#main > * { padding: 2.6rem 2.6rem 1.2rem 2.6rem; }
/* featured 大卡内边距 = 容器留白(2.6) + 网格卡内边距(1.3)，保证与网格卡片内容左右对齐
   （模板原本 8rem 与 4+4rem 也是对齐的，此处沿用同一比例关系） */
#main > .post { padding: 3.9rem 3.9rem 2.5rem 3.9rem; }
#main > .posts { margin: 0; }
#main > .posts > * { padding: 1.3rem 1.3rem; }
#main > footer { padding: 1.4rem 2.6rem; }
/* 详情页大标题：模板 4rem 过大，收紧到 2.6rem；日期负边距归零避免外溢 */
#main > .post header.major > h1,
#main > .post header.major h2 { font-size: 2.6rem; margin: 0 0 1.2rem 0; }
#main > .post header.major > .date { margin-top: 0; }

@media screen and (max-width: 980px) {
  #main > .posts > * { padding: 1.1rem 1.1rem; }
  #main > .post { padding: 3.7rem 3.7rem 2.3rem 3.7rem; }
}
@media screen and (max-width: 736px) {
  #main > * { padding: 1.5rem 1.1rem 0.6rem 1.1rem; }
  #main > .posts > * { padding: 1rem 1rem; }
  #main > .post { padding: 2.5rem 2.1rem 1.6rem 2.1rem; }
  #main > .post header.major > h1,
  #main > .post header.major h2 { font-size: 2rem; margin: 0 0 1rem 0; }
  #main > .posts > article .image { max-width: none; }
}

/* ============================================================
   后台：列表式管理（全部时光）+ 分类管理
   ============================================================ */
ul.adm-list { list-style: none; padding: 0; margin: 0; }
ul.adm-list li.adm-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem 1rem;
  padding: 0.85rem 0; border-top: 1px solid #eee;
}
ul.adm-list li.adm-row:first-child { border-top: 0; }
.adm-row .adm-meta { color: #999; font-size: 0.82em; min-width: 13em; flex: 0 0 auto; }
.adm-row .adm-title {
  font-weight: 700; color: #222; text-decoration: none;
  flex: 1 1 14em; min-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.adm-row .adm-title:hover { color: #18bfef; }
.adm-row .adm-acts { display: flex; gap: 0.4rem; }
.adm-row .adm-acts .button { margin: 0; padding: 0.3rem 0.9rem; font-size: 0.82rem; }

ul.cat-list { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.cat-list li {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.55rem 0; border-top: 1px solid #eee;
}
ul.cat-list li:first-child { border-top: 0; }
.cat-list .cat-name { flex: 1 1 8em; font-weight: 600; }
.cat-list .button { margin: 0; padding: 0.25rem 0.7rem; font-size: 0.8rem; }
.cat-add { display: flex; gap: 0.6rem; margin-bottom: 1rem; }
.cat-add input { flex: 1; }

