/* ===========================================
 * 状态栏安全间距：只对导航内部这一层加间距，不改动.header外层容器本身的高度/层级，
 * 避免破坏按钮点击响应（之前直接在.header上加padding导致按钮失效）
 * =========================================== */
.navbar-header {
    padding-top: max(env(safe-area-inset-top), 0px);
}
.headroom {
    transition: transform 0.2s ease, top 0.2s ease;
}
/* 顶部：用top位移 */
.header.headroom--unpinned {
    top: -125px !important;
}

.header.headroom--pinned {
    top: 0px;
}
/* 底部：用transform位移 */
.footer-tabbar.headroom--unpinned {
    transform: translateY(100%) !important;
}
.footer-tabbar.headroom--pinned {
    transform: translateY(0) !important;
}

/* 导航栏隐藏时，让占位块（撑出导航栏高度的空白区域）跟着收缩为0，避免滑到底部时露出空白 */
.footer-tabbar-placeholder {
    transition: height 0.2s ease;
}
.footer-tabbar.headroom--unpinned ~ .footer-tabbar-placeholder {
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    overflow: hidden !important;
}

/* 底部导航收缩后，会露出手机底部安全区域（比如iPhone Home指示条那一小条），
   给html/body也设成深色背景，避免露出默认的白色空隙 */
html, body {
    background-color: #1a1a1a;
}

/* 如果导航栏显示靠下高度过高，取消下面这条注释，再适当调整数值 */
/* .header { top: -18px !important; } */
/* ===========================================
 * 隐藏指定元素
 * 注意：.relative 这条因为是全站通用的定位工具类，风险太高，暂未采纳，
 * 需要你确认具体想隐藏的元素后再加回来
 * =========================================== */
.article-avatar {
    display: none !important;
}
.line-form-line {
    display: none !important;
}
.post-metas {
    display: none !important;
}
.meta-right {
    display: none !important;
}
.tag-posts {
    display: none !important;
}
.tag-view {
    display: none !important;
}
.tag-like {
    display: none !important;
}
/* 原写法 ".em09 opacity5 mt6" 缺少点号，已修正为三个class连写 */
.em09.opacity5.mt6 {
    display: none !important;
}
/* 豁免：用户中心统计项（评论/收藏等）的名称文字，不受上面全局隐藏影响 */
.user-statistics-item .em09.opacity5.mt6 {
    display: block !important;
}
/* 仅在纯文字列表中隐藏副标题 */
ul.no-thumb li.icon-circle {
    display: none !important;
}
/* ===========================================
 * "最近浏览"小工具 sticky 固定
 * =========================================== */
.widget_recently_viewed_posts {
    position: sticky;
    top: 80px; /* 根据实际导航高度调整 */
    z-index: 10;
}
.widget_recently_viewed_posts ul {
    margin: 0;
    padding-left: 1em;
    list-style: disc;
}
/* ===========================================
 * 列表缩略图覆盖
 * =========================================== */
.item-thumbnail .thumbnail-wrapper {
    position: relative !important;
    display: inline-block !important;
    width: 100% !important;
}
.item-thumbnail .thumbnail-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 99 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.item-thumbnail .thumbnail-overlay img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
/* ===========================================
 * 卡片缩略图覆盖
 * =========================================== */
.thumbnail-wrapper {
    position: relative !important;
    display: inline-block !important;
    width: 100% !important;
}
.thumbnail-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 99 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important; /* 原来漏了开头的 j，已修正 */
}
.thumbnail-overlay img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}
/* ===========================================
 * 侧边悬浮工具按钮：滚动透明效果
 * =========================================== */
.float-right.square.position-bottom {
    transition: opacity 0.3s ease-in-out;
}
.float-btn-transparent {
    opacity: 0.1 !important;
}
.float-btn-transparent:hover {
    opacity: 0.7 !important;
}
/* ===========================================
 * 横向滑动卡片：PC端4张/手机端2张，右侧露出下一张边沿
 * =========================================== */
.widget-main-post .swiper-container.swiper-scroll .posts-item.card {
    width: calc(24% - 10px) !important;
}
@media (max-width: 991px) {
    .widget-main-post .swiper-container.swiper-scroll .posts-item.card {
        width: calc(48% - 10px) !important;
        margin: 5px !important;
    }
}

/* PWA全屏模式：侧滑菜单顶部补状态栏间距（原padding上10px，改为10+54） */
@media (display-mode: standalone) {
    .mobile-navbar {
        padding-top: 64px !important;
    }
}

/* 头像弹窗统计标签：图标+文字，浅色黑、深色白 */
.author-tag .but,
.author-tag .but .icon,
.author-tag .but i {
    color: rgba(0, 0, 0, 0.7) !important;   /* 浅色模式：深色字 */
    fill: currentColor !important;
}
body.dark-theme .author-tag .but,
body.dark-theme .author-tag .but .icon,
body.dark-theme .author-tag .but i {
    color: rgba(255, 255, 255, 0.7) !important;   /* 深色模式：白字 */
}

/* 头像弹窗统计标签：加宽按钮 */
.author-tag .but {
    padding-left: 1.2em !important;
    padding-right: 1.2em !important;
}

/* 底部栏返回上一页按钮：圆形，直径与底部栏高度一致 */
.footer-tabbar .tabbar-back-btn {
    flex-shrink: 0;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 0 10px;
    color: inherit;
    background: rgba(128,128,128,.15);
    transition: background .2s;
}
.footer-tabbar .tabbar-back-btn:hover {
    background: var(--muted-color);
    color: var(--theme-color);
}
/* ===========================================
 * 文章底部板块隐藏：手机端隐藏4个，PC端隐藏前3个（不占位）
 * =========================================== */

/* 手机端（≤767px）：4个全隐藏 */
@media (max-width: 767px) {
    .article .separator.muted-3-color,
    .article .theme-box.article-tags,
    .article .box-body.muted-3-color.em09,
    .article .post-actions {
        display: none !important;
    }
}

/* PC端（≥768px）：只隐藏前3个，post-actions保留 */
@media (min-width: 768px) {
    .article .separator.muted-3-color,
    .article .theme-box.article-tags,
    .article .box-body.muted-3-color.em09 {
        display: none !important;
    }
}

/* 修改用户头像未圆形 */
.author-header .avatar-img .avatar {
    border-radius: 70px !important;
}

/* 底部页脚二维码向右移动20px */
@media (max-width: 767px) {
    .footer .footer-miniimg {
        transform: translateX(20px);
    }
}

/* 登录/注册按钮：胶囊形描边、淡灰背景，颜色跟随主题（同评论收藏标签） */
.user-info .signin-loader,
.user-info .signup-loader {
    background: rgba(128, 128, 128, 0.12) !important;
    border: 0.35px solid var(--main-color) !important;
    color: var(--main-color) !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    opacity: 0.8 !important;
}
.user-info .signin-loader:hover,
.user-info .signup-loader:hover {
    background: rgba(128, 128, 128, 0.2) !important;
    opacity: 1 !important;
}

/* 文章正文里的分栏区块，收窄下间距 */
.wp-posts-content .wp-block-columns {
	margin-bottom: 10px !important;
	margin-block-end: 10px !important;
}
@media (max-width: 768px) {
	.wp-posts-content .wp-block-columns {
		gap: 12px !important;
		row-gap: 12px !important;
		margin-bottom: 8px !important;
		margin-block-end: 8px !important;
	}
	/* 堆叠后每一栏自己也可能带间距 */
	.wp-posts-content .wp-block-columns > .wp-block-column {
		margin-bottom: 0 !important;
	}
}

/* 隐藏提示文字 */
.wp-block-zibllblock-hide-content .hidden-box.show > .hidden-text {
  display: none !important;
}

/* 清掉盒子自身的虚线框和内外边距 */
.wp-block-zibllblock-hide-content .hidden-box.show {
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   正文超链接：与主题色拉开对比度  (v8)
   放置位置：zibllchild/style.css 末尾，或 主题设置 → 自定义代码 → 自定义 CSS

   深色钩子：html.dark（已在本站控制台确认，非 data-theme 属性）

   命中范围：只作用于「文本容器的直接子链接」。
   Zibll 的 minicard / posts-mini 等区块渲染在 .wp-posts-content 内部，
   其链接父级是 h2.item-heading、div.posts-mini-con 等结构标签，
   用 `:is(p,li,...) > a` 天然排除，不依赖主题类名，主题更新后不会失效。

   深色模式行为：
   常态  = 亮色文字 + 下划线，无背景
   hover = 文字颜色不变，只浮出一层淡灰背景，背景不会盖住任何文字
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. 配色变量
   -------------------------------------------------------------------------- */
:root {
  --zc-link: #2470e2;
  --zc-link-hover: #246cd8;
  --zc-link-line: rgba(31, 95, 191, 0.35);
  --zc-link-bg: rgba(31, 95, 191, 0.08);
}

html.dark {
  /* 亮度梯度：#8ab4f8 → #a8c7fa → #c6dbfd → #e8f1ff(当前)
     调亮度时 --zc-link 与 --zc-link-hover 必须一起改，两者保持同值 */
  --zc-link: #e8f1ff;
  --zc-link-hover: #e8f1ff;                       /* 同值 = hover 不变色 */
  --zc-link-line: rgba(232, 241, 255, 0.45);
  --zc-link-bg: transparent;                      /* 常态无背景 */
  --zc-link-bg-hover: rgba(255, 255, 255, 0.10);  /* hover 才浮出的淡灰 */
}

/* --------------------------------------------------------------------------
   1. 基础样式
   权重 (0,3,2)，高于主题的 .wp-posts-content a:not([class]) (0,2,1)
   -------------------------------------------------------------------------- */
.wp-posts-content :is(p, li, blockquote, dd, td, th, figcaption) > a:not([class]),
.comment-content  :is(p, li, blockquote, dd) > a:not([class]),
.msg-content      :is(p, li, blockquote, dd) > a:not([class]),
.private-content  :is(p, li, blockquote, dd) > a:not([class]),
.entry-content    :is(p, li, blockquote, dd) > a:not([class]) {
  color: var(--zc-link);
  text-decoration: underline;
  text-decoration-color: var(--zc-link-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-skip-ink: auto;
  border-radius: 3px;
  transition: color 0.2s, text-decoration-color 0.2s, background-color 0.2s;
}

/* 保险丝：万一主题组件内部出现 <p><a>，往这个 :is() 里补类名即可 */
.wp-posts-content :is(.posts-mini, .posts-item, .ajax-item, .item-heading,
                      .zib-widget, .swiper-slide, .theme-box) a {
  color: inherit;
  text-decoration: none;
  background: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

/* --------------------------------------------------------------------------
   2. hover 态（浅色模式）
   -------------------------------------------------------------------------- */
.wp-posts-content :is(p, li, blockquote, dd, td, th, figcaption) > a:not([class]):hover,
.comment-content  :is(p, li, blockquote, dd) > a:not([class]):hover,
.msg-content      :is(p, li, blockquote, dd) > a:not([class]):hover,
.private-content  :is(p, li, blockquote, dd) > a:not([class]):hover,
.entry-content    :is(p, li, blockquote, dd) > a:not([class]):hover {
  color: var(--zc-link-hover);
  text-decoration-color: currentColor;
  background-color: var(--zc-link-bg);
  box-shadow: 0 0 0 2px var(--zc-link-bg);
}

/* --------------------------------------------------------------------------
   3. 深色模式 · 常态
   预留左右内边距、用等量负外边距抵消，保证 hover 出现背景时文字零位移。
   纵向 padding 必须为 0：行内元素的上下 padding 不参与行高计算，
   但背景仍绘制在 padding 盒上，会溢出并盖住相邻行的文字。
   想要上下留白请改父级 line-height（见文末）。
   权重 (0,3,3)，稳压第 1、2 节。
   -------------------------------------------------------------------------- */
html.dark .wp-posts-content :is(p, li, blockquote, dd, td, th, figcaption) > a:not([class]),
html.dark .comment-content  :is(p, li, blockquote, dd) > a:not([class]),
html.dark .msg-content      :is(p, li, blockquote, dd) > a:not([class]),
html.dark .private-content  :is(p, li, blockquote, dd) > a:not([class]),
html.dark .entry-content    :is(p, li, blockquote, dd) > a:not([class]) {
  background-color: var(--zc-link-bg);   /* transparent */
  padding: 0 0.28em;
  margin: 0 -0.28em;                     /* 抵消 padding，布局零位移 */
  border-radius: 4px;
  -webkit-box-decoration-break: clone;   /* 跨行折断时两段都带完整圆角 */
  box-decoration-break: clone;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   4. 深色模式 · hover
   只改背景。color 与 text-decoration-color 锁回常态值，
   覆盖掉第 2 节浅色 hover 规则里的变色行为。
   -------------------------------------------------------------------------- */
html.dark .wp-posts-content :is(p, li, blockquote, dd, td, th, figcaption) > a:not([class]):hover,
html.dark .comment-content  :is(p, li, blockquote, dd) > a:not([class]):hover,
html.dark .msg-content      :is(p, li, blockquote, dd) > a:not([class]):hover,
html.dark .private-content  :is(p, li, blockquote, dd) > a:not([class]):hover,
html.dark .entry-content    :is(p, li, blockquote, dd) > a:not([class]):hover {
  background-color: var(--zc-link-bg-hover);
  color: var(--zc-link);
  text-decoration-color: var(--zc-link-line);
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   5. 例外：包住图片的链接不加背景和下划线
   -------------------------------------------------------------------------- */
.wp-posts-content :is(p, li, figcaption) > a:not([class]):has(img),
.entry-content    :is(p, li, figcaption) > a:not([class]):has(img),
html.dark .wp-posts-content :is(p, li, figcaption) > a:not([class]):has(img),
html.dark .entry-content    :is(p, li, figcaption) > a:not([class]):has(img) {
  text-decoration: none;
  background: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

/* --------------------------------------------------------------------------
   6. 键盘可访问性
   -------------------------------------------------------------------------- */
.wp-posts-content :is(p, li, blockquote, dd) > a:not([class]):focus-visible,
.comment-content  :is(p, li, blockquote, dd) > a:not([class]):focus-visible,
.entry-content    :is(p, li, blockquote, dd) > a:not([class]):focus-visible {
  outline: 2px solid var(--zc-link);
  outline-offset: 2px;
  text-decoration: none;
}

/* ==========================================================================
   微调速查（改 html.dark 里的变量即可）

   字不够亮      → --zc-link 与 --zc-link-hover 一起改，两者必须同值
   hover 灰太淡  → --zc-link-bg-hover 提到 .14
   hover 灰太重  → 降到 .07
   灰块左右太窄  → 第 3 节 padding 与 margin 同步改，如 0.4em / -0.4em
   灰块上下太窄  → 别加纵向 padding，改 .wp-posts-content p { line-height: 1.9; }
   ========================================================================== */