/* ==========================================================================
   themes/magazine/assets/css/style.css — 杂志主题 v1.0.0
   风格：衬线标题 + 报头墨线 + 索引式列表 + 大图作品墙；暖白纸底 / 朱砂红点缀。
   断点：1024（平板）/ 768（手机）。
   契约：本文件必须自带 —— ① [hidden] 兜底（C7）；② .share 系列（由核心 inc/share.php 输出）；
        ③ .subscribe 系列（订阅说明页）。
   ========================================================================== */
:root{
  --brand:#b03a2e;
  --brand-soft:#f7ecea;
  --ink:#16181d;
  --sub:#6b7280;
  --line:#e7e3dc;
  --paper:#fbf9f5;
  --bg:#ffffff;
  --radius:4px;
  --serif:Georgia,"Noto Serif SC","Source Han Serif SC","Songti SC",STSong,"SimSun",serif;
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
}
*{ box-sizing:border-box; }
/* ⚠️ 必须保留：HTML 的 hidden 属性靠 UA 样式表生效，作者样式一旦给该元素写了 display 就会整体盖掉它
   （C7：2026-09-18 实测过微信二维码"未点击就显示"）。 */
[hidden]{ display:none !important; }

html{ scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:var(--sans); font-size:16px; line-height:1.8;
  -webkit-font-smoothing:antialiased;
}
a{ color:var(--brand); text-decoration:none; }
a:hover{ text-decoration:underline; }
img{ max-width:100%; display:block; }
.container{ width:100%; max-width:1120px; margin:0 auto; padding:0 20px; }
.muted{ color:var(--sub); }
.empty{ color:var(--sub); }
.center{ text-align:center; }

/* ---------- 报头 ---------- */
.press-bar{ height:3px; background:var(--ink); }
.site-header{
  border-bottom:1px solid var(--ink); background:rgba(255,255,255,.94);
  backdrop-filter:saturate(180%) blur(8px);
  position:sticky; top:0; z-index:20;
}
.header-inner{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; min-height:74px; padding:16px 20px 13px; }
.brand-wrap{ min-width:0; display:flex; flex-direction:column; justify-content:center; }
.brand{
  font-family:var(--serif); font-size:29px; font-weight:700; line-height:1.15;
  letter-spacing:2px; color:var(--ink);
}
.brand:hover{ text-decoration:none; color:var(--brand); }
.brand-sub{
  margin:7px 0 0; color:var(--sub); font-size:12.5px; line-height:1.4; letter-spacing:.6px;
  max-width:560px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.site-nav{ display:flex; gap:4px; flex:0 0 auto; padding-bottom:2px; }
.site-nav a{ color:var(--sub); padding:7px 11px; font-size:14px; letter-spacing:.6px; border-radius:2px; }
.site-nav a:hover{ color:var(--brand); background:var(--paper); text-decoration:none; }
.nav-toggle{
  display:none; border:1px solid var(--line); background:#fff; color:var(--ink);
  border-radius:var(--radius); width:42px; height:38px; font-size:17px; cursor:pointer; flex:0 0 auto;
}

.site-main{ padding:38px 20px 72px; }

/* ---------- 区块标题 ---------- */
.block{ margin:46px 0; }
.block:first-child{ margin-top:6px; }
.block-head{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  border-bottom:2px solid var(--ink); padding-bottom:9px; margin-bottom:22px;
}
.eyebrow{
  font-size:12.5px; font-weight:700; letter-spacing:3px; text-transform:uppercase;
  margin:0; color:var(--ink); line-height:1.4;
}
.eyebrow::before{
  content:""; display:inline-block; width:22px; height:2px; background:var(--brand);
  margin-right:11px; vertical-align:middle;
}
.block-head .more{ font-size:13px; letter-spacing:.6px; flex:0 0 auto; }
.kicker{
  font-size:12px; letter-spacing:1.8px; color:var(--brand); text-transform:uppercase;
  margin:0 0 12px; font-weight:600;
}
.kicker-sep{ color:#c9c4bb; margin:0 7px; }

/* ---------- 头条 ---------- */
.lead{ margin:0 0 6px; }
/* 置顶可能是多篇 ⇒ 头条块纵向堆叠。每个 .lead-link 自带下边框，这里补纵向间距，
   免得两块内容贴着那条 1px 分隔线。 */
.lead + .lead{ margin-top:22px; }
.lead-link{ display:block; color:inherit; padding-bottom:24px; border-bottom:1px solid var(--line); }
.lead-link:hover{ text-decoration:none; }
.lead-title{ font-family:var(--serif); font-size:34px; line-height:1.34; margin:0 0 12px; transition:color .18s; }
.lead-link:hover .lead-title{ color:var(--brand); }
.lead-excerpt{ color:var(--sub); font-size:15.5px; line-height:1.85; margin:0 0 16px; max-width:780px; }
.lead-more{ font-size:13px; letter-spacing:1.4px; color:var(--brand); border-bottom:1px solid var(--brand); padding-bottom:3px; }

/* ---------- 索引列表 ---------- */
.index-list{ list-style:none; margin:0; padding:0; }
.index-row{ border-bottom:1px solid var(--line); }
.index-row a{ display:flex; align-items:baseline; gap:20px; padding:17px 6px; color:inherit; transition:background .16s, padding .16s; }
.index-row a:hover{ background:var(--paper); text-decoration:none; padding-left:12px; padding-right:12px; }
.index-date{ flex:0 0 96px; font-family:var(--serif); font-size:13px; letter-spacing:.8px; color:var(--sub); }
.index-body{ flex:1; min-width:0; display:flex; flex-direction:column; gap:4px; }
.index-title{ font-family:var(--serif); font-size:19px; font-weight:700; line-height:1.5; color:var(--ink); transition:color .16s; }
.index-row a:hover .index-title{ color:var(--brand); }
.index-excerpt{
  color:var(--sub); font-size:13.5px; line-height:1.6;
  display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden;
}
.index-arrow{ flex:0 0 auto; color:var(--brand); font-size:15px; opacity:0; transform:translateX(-8px); transition:opacity .18s, transform .18s; }
.index-row a:hover .index-arrow{ opacity:1; transform:none; }
.mark-pin{
  display:inline-block; margin-left:9px; vertical-align:middle;
  font-family:var(--sans); font-size:10.5px; font-weight:600; letter-spacing:1.2px;
  color:var(--brand); border:1px solid var(--brand); border-radius:2px; padding:1px 6px;
}

/* 次级区块（作品区 / 友链）：标题线收细，视觉层级低于主栏目 */
.zone .block-head, .friends .block-head{ border-bottom-width:1px; border-bottom-color:var(--line); }

/* ---------- 作品墙 ---------- */
.zone-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:22px; }
.zone-grid-lg{ grid-template-columns:repeat(2,1fr); gap:30px; }
.zone-grid-lg .zone-cover{ aspect-ratio:3/2; }
.zone-item{ display:block; color:inherit; }
.zone-item:hover{ text-decoration:none; }
.zone-cover{
  aspect-ratio:4/3; overflow:hidden; background:var(--paper); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center;
}
.zone-cover img{ width:100%; height:100%; object-fit:cover; transition:transform .55s ease; }
.zone-item:hover .zone-cover img{ transform:scale(1.045); }
.zone-placeholder{ color:var(--sub); font-size:13px; padding:12px; text-align:center; }
.zone-title{ font-family:var(--serif); font-size:16px; font-weight:600; margin:12px 0 0; line-height:1.5; transition:color .16s; }
.zone-item:hover .zone-title{ color:var(--brand); }

/* ---------- 友链 ---------- */
.friend-line{ list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:6px 0; align-items:center; }
.friend-line li{ display:flex; align-items:center; }
.friend-line li + li::before{ content:"·"; color:#c9c4bb; margin:0 14px 0 2px; }
.friend-line a{ font-size:14px; color:var(--sub); letter-spacing:.4px; }
.friend-line a:hover{ color:var(--brand); }

/* ---------- 文章页 ---------- */
.article{ max-width:700px; margin:0 auto; }
.article-head{ border-bottom:1px solid var(--line); padding-bottom:20px; margin-bottom:30px; }
.article-title{ font-family:var(--serif); font-size:36px; line-height:1.3; margin:0; letter-spacing:.5px; }
.article-body{ font-size:17px; line-height:2.05; text-indent:2em; word-break:break-word; }
/* 正文插图（核心 post_body_html 输出；v1.0.12 起**相邻**插图由核心包进 .article-body .post-imgs）。
   v1.0.14 起改为「横向卡片 · 左右翻页」（仿小红书），不再换行、不再等高伸缩。三条规则：
     ① 卡片一律 4:3，图在卡内 object-fit:contain —— **不裁不切**，截图与长图一个像素都不丢；
     ② 一屏露 78%（手机）/ 44%（电脑），右侧常留半张，暗示还能往右翻；
     ③ 单图 data-n="1" 不进画廊，恢复「不裁、居中、限高」的老样子。
   ⚠️ 老 app（无 .post-imgs 包裹）下，第一条 img.post-img 基线仍然生效，不会变丑。
   ⚠️ 翻页手感靠 scroll-snap（纯 CSS，没有 JS 也能滑）；圆点与计数由 assets/js/main.js 插入，
      没有 JS 时只是少个指示器，卡片照样能翻。 */
.article-body img.post-img{ margin:1.7em auto; border-radius:2px; }
.article-body .post-imgs{
  display:flex; align-items:center; justify-content:flex-start;
  gap:8px; margin:1.7em 0; padding:2px 0 4px; text-indent:0;
  max-width:100%; overflow-x:auto; overflow-y:hidden;
  scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.article-body .post-imgs::-webkit-scrollbar{ display:none; }
.article-body .post-imgs img.post-img{
  flex:0 0 auto; width:78%; max-width:78%; height:auto; margin:0;
  aspect-ratio:4 / 3; object-fit:contain;
  background:rgba(0,0,0,.045); border-radius:var(--radius,10px);
  scroll-snap-align:center;
}
.article-body .post-imgs[data-n="1"]{ justify-content:center; overflow:visible; scroll-snap-type:none; }
.article-body .post-imgs[data-n="1"] img.post-img{
  width:auto; max-width:min(100%,520px); height:auto; max-height:60vh;
  aspect-ratio:auto; background:transparent; border-radius:2px;
}
@media (min-width:769px){
  .article-body .post-imgs img.post-img{ width:44%; max-width:44%; }
}
@media (max-width:768px){
  .article-body .post-imgs[data-n="1"] img.post-img{ max-height:56vh; }
}
/* 圆点 + 计数：由 main.js 插到 .post-imgs 后面，纯装饰（aria-hidden） */
.post-dots{ display:flex; align-items:center; justify-content:center; gap:6px; text-indent:0; margin:-1.1em 0 1.7em; }
.post-dots i{ display:block; width:6px; height:6px; border-radius:50%; background:rgba(0,0,0,.18); transition:width .18s ease, background .18s ease; }
.post-dots i.on{ width:16px; border-radius:3px; background:var(--brand); box-shadow:0 0 0 1px rgba(0,0,0,.14); }
.post-dots span{ margin-left:6px; font-size:11px; letter-spacing:.5px; color:inherit; opacity:.55; font-variant-numeric:tabular-nums; }
.linked-work{ max-width:700px; margin:34px auto 0; padding:16px 22px; background:var(--paper); border-left:3px solid var(--brand); }
.lw-label{ display:inline-block; font-size:12px; font-weight:700; letter-spacing:1.6px; color:var(--brand); margin-right:12px; }

/* ---------- 分页 / 按钮 / 404 ---------- */
.pager{ display:flex; align-items:center; justify-content:space-between; margin-top:26px; font-size:14px; }
.pager-now{ color:var(--sub); letter-spacing:1px; }
.btn{
  display:inline-block; background:var(--ink); color:#fff; padding:11px 24px;
  border-radius:var(--radius); font-size:15px; letter-spacing:1.2px;
}
.btn:hover{ background:var(--brand); color:#fff; text-decoration:none; }
.code-404{ font-family:var(--serif); font-size:78px; line-height:1; margin:0 0 8px; color:var(--brand); }
.page-title{ font-family:var(--serif); font-size:26px; margin:0 0 10px; }

/* ---------- 页脚 ---------- */
.site-footer{ border-top:2px solid var(--ink); background:var(--paper); padding:28px 20px; margin-top:56px; }
.site-footer .container{ text-align:center; }
.copyright{ color:var(--sub); font-size:13.5px; margin:0 0 8px; letter-spacing:.5px; }
/* 备案合并同一行：分隔符只在双非空时输出（模板负责）；white-space:nowrap 防窄屏从号中间折断 */
.beian{ margin:0; font-size:13px; line-height:1.9; }
.beian a{ color:#9a958c; white-space:nowrap; }
.beian a:hover{ color:var(--brand); }
.beian-sep{ color:#c9c4bb; margin:0 9px; font-size:13px; }
/* 兼容旧类名：其他主题/历史模板可能仍输出 .icp */
.icp{ margin:0; font-size:13px; }
.icp a{ color:#9a958c; white-space:nowrap; }
.icp a:hover{ color:var(--brand); }

/* ---------- 订阅说明页 ---------- */
.subscribe{ max-width:700px; margin:0 auto; }
.sub-title{ font-family:var(--serif); font-size:32px; line-height:1.35; margin:0 0 12px; }
.sub-lead{ color:var(--sub); font-size:16px; line-height:1.85; margin:0 0 22px; }
.sub-copy{ display:flex; gap:10px; margin:0 0 18px; }
.sub-input{
  flex:1; min-width:0; padding:12px 14px; border:1px solid var(--line); border-radius:var(--radius);
  background:var(--paper); color:var(--ink); font-size:15px; font-family:var(--sans);
}
.sub-btn{
  flex:0 0 auto; padding:12px 26px; border:0; border-radius:var(--radius); background:var(--ink);
  color:#fff; font-size:15px; font-family:var(--sans); letter-spacing:1.2px; cursor:pointer; transition:background .16s;
}
.sub-btn:hover{ background:var(--brand); }
.sub-note{
  color:var(--sub); font-size:13.5px; line-height:1.85; margin:0 0 26px; padding:13px 16px;
  background:var(--paper); border-left:3px solid var(--brand);
}
.sub-fallback{ color:var(--sub); font-size:13px; line-height:1.85; margin:0; padding-top:18px; border-top:1px solid var(--line); word-break:break-all; }

/* ---------- 分享条（核心 inc/share.php 输出，主题只负责呈现） ---------- */
.share{ max-width:700px; margin:40px auto 0; padding-top:22px; border-top:1px solid var(--line); }
.share-label{ display:block; font-size:12px; letter-spacing:2px; color:var(--sub); margin-bottom:12px; text-transform:uppercase; }
.share-btns{ display:flex; flex-wrap:wrap; gap:10px; }
.share-btn{
  display:inline-flex; align-items:center; gap:8px; padding:8px 15px;
  border:1px solid var(--line); background:#fff; color:var(--sub); border-radius:var(--radius);
  font-size:13.5px; font-family:var(--sans); cursor:pointer; transition:all .16s;
}
.share-btn:hover{ border-color:var(--brand); color:var(--brand); text-decoration:none; }
.share-ico{
  width:20px; height:20px; border-radius:2px; background:var(--brand-soft); color:var(--brand);
  font-size:11px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto;
}
/* 风格 A：纯文字链 */
.share-style-1 .share-btns{ gap:18px; }
.share-style-1 .share-btn{ border:0; background:none; padding:2px 0; border-radius:0; }
.share-style-1 .share-ico{ display:none; }
/* 风格 C：悬浮侧栏 */
.share-style-3{ position:relative; }
.share-style-3 .share-label{ display:none; }
.share-style-3 .share-btns{ position:fixed; left:14px; top:50%; transform:translateY(-50%); flex-direction:column; gap:8px; z-index:15; }
.share-style-3 .share-btn{ flex-direction:column; gap:2px; width:54px; padding:8px 4px; border-radius:var(--radius); font-size:11px; }
.share-style-3 .share-ico{ width:24px; height:24px; }
/* 微信二维码层（PC，默认 hidden，点击后才加载图） */
.share-qr{ margin-top:16px; padding:15px; border:1px solid var(--line); border-radius:var(--radius); display:inline-block; text-align:center; background:#fff; }
.share-qr img{ width:180px; height:180px; }
.share-qr p{ margin:9px 0 0; color:var(--sub); font-size:12.5px; }
.share-toast{
  position:fixed; left:50%; bottom:32px; transform:translateX(-50%);
  background:var(--ink); color:#fff; padding:10px 20px; border-radius:var(--radius);
  font-size:14px; z-index:99; opacity:0; transition:opacity .2s;
}

/* ===== 平板 768–1024 ===== */
@media (max-width:1024px){
  .zone-grid{ grid-template-columns:repeat(2,1fr); }
  .zone-grid-lg{ grid-template-columns:repeat(2,1fr); gap:22px; }
  .brand{ font-size:26px; }
  .brand-sub{ max-width:400px; }
  .lead-title{ font-size:30px; }
  .article-title{ font-size:31px; }
}

/* ===== 手机 <768 ===== */
@media (max-width:768px){
  .container{ padding:0 16px; }
  .nav-toggle{ display:block; }
  /* top:100% —— 跟随顶栏实际高度（站名 + 副标题两行时不再错位） */
  .site-nav{
    display:none; position:absolute; left:0; right:0; top:100%;
    background:#fff; border-bottom:1px solid var(--ink);
    flex-direction:column; padding:8px 12px 14px; gap:2px;
  }
  .site-nav.open{ display:flex; }
  .site-nav a{ padding:11px 12px; }
  .header-inner{ min-height:60px; padding:12px 16px 10px; align-items:center; }
  .brand{ font-size:21px; letter-spacing:1.2px; }
  .brand-sub{ font-size:12px; max-width:66vw; margin-top:4px; }
  .site-main{ padding:26px 16px 56px; }
  .block{ margin:34px 0; }
  .eyebrow{ letter-spacing:2px; }
  .lead-title{ font-size:24px; }
  .lead-excerpt{ font-size:14.5px; }
  .index-row a{ gap:12px; padding:15px 2px; }
  .index-date{ flex:0 0 74px; font-size:12px; letter-spacing:.4px; }
  .index-title{ font-size:16.5px; }
  .index-excerpt{ display:none; }
  .index-arrow{ display:none; }
  .zone-grid, .zone-grid-lg{ grid-template-columns:1fr 1fr; gap:14px; }
  .zone-title{ font-size:14.5px; margin-top:9px; }
  .article-title{ font-size:25px; }
  .article-body{ font-size:16px; line-height:1.95; }
  .code-404{ font-size:60px; }
  .sub-title{ font-size:25px; }
  .sub-copy{ gap:8px; }
  .sub-btn{ padding:12px 18px; }
  .share-style-3 .share-btns{ position:static; transform:none; flex-direction:row; flex-wrap:wrap; }
  .share-style-3 .share-btn{ width:auto; flex-direction:row; font-size:13.5px; }
}

/* ===== 正文插图：点开看大图（v1.0.12 / #43）=====
   只作用于核心 post_group_images() 产出的 .post-imgs 组；点击后整屏查看，
   同一条日志里的插图可左右翻看。所有节点由 assets/js/main.js 在首次点击时创建，
   不改正文 DOM 结构、不引用任何外链资源（避免多一次请求与 C12 缓存键问题）。 */
.article-body .post-imgs img.post-img{ cursor:zoom-in; }
.article-body .post-imgs img.post-img:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; }

.post-viewer{
  position:fixed; inset:0; z-index:9990; box-sizing:border-box;
  display:flex; align-items:center; justify-content:center;
  padding:24px; background:rgba(10,10,12,.92);
}
.post-viewer[hidden]{ display:none !important; }
.post-viewer-img{
  max-width:88vw; max-height:86vh; width:auto; height:auto;
  border:0; background:transparent; box-shadow:0 10px 44px rgba(0,0,0,.55);
}
.post-viewer-x,
.post-viewer-nav{
  position:absolute; z-index:1; display:flex; align-items:center; justify-content:center;
  padding:0; border:0; color:#fff; font:inherit; line-height:1;
  background:rgba(255,255,255,.16); cursor:pointer;
  -webkit-appearance:none; appearance:none;
}
.post-viewer-x{ top:14px; right:14px; width:40px; height:40px; border-radius:50%; font-size:24px; }
.post-viewer-nav{ top:50%; transform:translateY(-50%); width:44px; height:64px; border-radius:12px; font-size:30px; }
.post-viewer-prev{ left:12px; }
.post-viewer-next{ right:12px; }
.post-viewer-x:hover,
.post-viewer-x:focus-visible,
.post-viewer-nav:hover,
.post-viewer-nav:focus-visible{ background:rgba(255,255,255,.32); }
.post-viewer-x[hidden],
.post-viewer-nav[hidden],
.post-viewer-cap[hidden]{ display:none !important; }
.post-viewer-cap{
  position:absolute; left:0; right:0; bottom:18px; margin:0;
  text-align:center; color:rgba(255,255,255,.85); font-size:13px; letter-spacing:.08em;
}
@media (max-width:768px){
  .post-viewer{ padding:12px; }
  .post-viewer-img{ max-width:96vw; max-height:82vh; }
  .post-viewer-x{ top:10px; right:10px; width:36px; height:36px; font-size:20px; }
  /* 手机上把翻页按钮移到屏幕下缘、分列张数两侧，避免压在大图上（左右滑同样能翻） */
  .post-viewer-nav{ top:auto; bottom:12px; transform:none; width:44px; height:44px; border-radius:50%; font-size:22px; }
  .post-viewer-prev{ left:14px; }
  .post-viewer-next{ right:14px; }
  .post-viewer-cap{ bottom:24px; }
}
