/*
 * 自建样式（不改 static/typlog/ 下照搬的 Typlog 原文件）：
 * 静态评论、搜索结果高亮、订阅与微信二维码弹层、无 JS 时的兜底、灯箱与音频的小调整。
 * 颜色尽量沿用 typlog.css / nezu.css 的变量。
 */

/* ---------- 无 JS 兜底（html 上的 .js 由 head 里的内联脚本加上） ---------- */
html:not(.js) .theme-toggle,
html:not(.js) .head_search,
html:not(.js) .info_subscribe,
html:not(.js) .head_menu,
html:not(.js) .js-share[data-type="wx"] {  /* 微信分享只会弹二维码，其他分享按钮构建时已写好网址 */
  display: none !important;
}
@media (max-width: 839px) {
  html:not(.js) .head_links {
    display: flex;
    position: relative;
    top: 0;
    height: auto;
    padding: 0 0 0 12px;
    background: none;
    overflow: visible;
  }
  html:not(.js) .head_links > nav { padding: 0; margin: 0; }
  html:not(.js) .head_links .links { display: flex; }
  html:not(.js) .head_links .links > li { border: 0; margin-right: 12px; }
}
html:not(.js) .head_links .link:hover > ul,
html:not(.js) .head_links .link:focus-within > ul {
  height: auto;
  visibility: visible;
}

/* ---------- 文末订阅链接（替代 Typlog 的邮件订阅表单） ---------- */
.subscribe-feeds {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.subscribe-feeds a {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 4px;
  border: 1px solid rgba(var(--t-rc-primary), .6);
  color: rgb(var(--t-rc-primary));
  text-decoration: none;
  font-size: 15px;
}
.subscribe-feeds a:hover {
  background: rgb(var(--t-rc-primary));
  color: rgb(var(--t-on-primary));
}

/* ---------- 静态评论 ---------- */
.comments { text-align: left; }
.comments_title { font-size: 1.2em; margin: 0 0 1em; }
.comments_list,
.comment_replies {
  list-style: none;
  margin: 0;
  padding: 0;
}
.comment { padding: 14px 0; border-top: 1px solid rgba(127, 127, 127, .18); }
.comment_replies { margin-top: 10px; padding-left: 44px; }
.comment_replies .comment { border-top: 0; padding-bottom: 0; }
.comment_head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.comment_avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.comment_avatar-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--t-rc-primary), .15);
  color: rgb(var(--t-rc-primary));
  font-weight: 600;
}
.comment_author { font-weight: 600; }
.comment-owner .comment_author::after {
  content: "作者";
  margin-left: 6px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 400;
  border-radius: 3px;
  background: rgba(var(--t-rc-primary), .15);
  color: rgb(var(--t-rc-primary));
}
.comment_time { opacity: .6; }
.comment_body { margin-left: 42px; line-height: 1.6; word-break: break-word; }
.comment_body p { margin: .4em 0; }
.comments_closed { margin: 1.2em 0 0; font-size: 14px; opacity: .6; text-align: left; }

/* ---------- 搜索结果（pagefind 用 <mark> 标出命中词） ---------- */
.search_text mark {
  position: relative;
  font-style: normal;
  color: inherit;
  background: linear-gradient(transparent 60%, rgba(var(--t-rc-primary), .35) 60%);
}
.search_empty { padding: 2em 0; opacity: .6; }
.dark-theme .overlay { background: rgba(20, 20, 20, .92); }
.dark-theme .search_input { color: #eee; border-color: #eee; }
.dark-theme .search_input::placeholder { color: #aaa; }
.dark-theme .search_text h3 { color: #eee; }
.dark-theme .search_text p { color: #bbb; }

/* ---------- 订阅弹层：只有 RSS 与阅读器 ---------- */
.tp-subscribe_feed a.rss { background-color: #f26522; }
.tp-subscribe_feed-url input { text-align: center; }
.subscribe-overlay .overlay_wrap,
.wechat-overlay .overlay_wrap { justify-content: center; padding: 20px; }
.dark-theme .tp-subscribe { background: #1d1d1f; border-color: rgba(255, 255, 255, .1); }
.dark-theme .tp-subscribe_social a { color: #eee; }

/* ---------- 微信二维码 ---------- */
.share-qrcode {
  margin: 0 auto;
  padding: 24px;
  width: 260px;
  max-width: 100%;
  background: #fff;
  color: #333;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, .1);
}
.share-qrcode svg { display: block; width: 100%; height: auto; }
.share-qrcode p { margin: 12px 0 0; font-size: 14px; }

/* ---------- 灯箱与音频 ---------- */
.js-zoomable { cursor: zoom-in; }
.block-audio.shk-ready audio { display: none; }

/* 没有 JS 时音频块只剩原生播放器，曲名、歌手在 data 属性里（渲染器只在有值时输出）：
 * 两者都有显示「歌手 · 曲名」，只有一个就只显示它，都没有不显示。 */
html:not(.js) .block-audio[data-title]:not([data-title=""])::before,
html:not(.js) .block-audio[data-artist]:not([data-artist=""])::before {
  display: block;
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.4;
  opacity: .75;
}
html:not(.js) .block-audio[data-title]:not([data-title=""])::before { content: attr(data-title); }
html:not(.js) .block-audio[data-artist]:not([data-artist=""])::before { content: attr(data-artist); }
html:not(.js) .block-audio[data-artist]:not([data-artist=""])[data-title]:not([data-title=""])::before {
  content: attr(data-artist) " · " attr(data-title);
}
