/* 移动端专用规则：触摸目标尺寸、系列目录折叠、暗色图片柔化等 */

/* 链接与按钮在窄屏统一最小触摸尺寸，避免误点（iOS 推荐 44px） */
@media (max-width: 640px) {
  .post-meta a,
  .post-tags a,
  .tag-cloud a,
  .related-posts a,
  .post-list h2 a {
    min-height: 36px;
  }
  .pagination .pager a,
  .pagination .pager span,
  .post-nav a {
    min-height: 44px;
    line-height: 1.4;
  }
}

/* 窄屏（< 1024px）将系列左栏折叠为文章顶部的抽屉。
   非 book 系列也保留入口，方便手机用户跳章节。 */
@media (max-width: 1024px) {
  .post-layout.has-series > .series-sidebar {
    grid-column: 1;
    position: static;
    max-height: none;
    border-right: 0;
    padding-right: 0;
    margin-bottom: 16px;
    max-width: none;
    justify-self: stretch;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0;
    overflow: hidden;
  }
  .post-layout.has-series > .series-sidebar > .series-sidebar-title {
    margin: 0;
    padding: 10px 14px;
    background: var(--code-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
  }
  .post-layout.has-series > .series-sidebar > .series-sidebar-title::before {
    content: "▸";
    font-family: var(--font-mono);
    color: var(--fg-muted);
    transition: transform 150ms ease;
  }
  .post-layout.has-series > .series-sidebar.is-open > .series-sidebar-title::before {
    transform: rotate(90deg);
  }
  .post-layout.has-series > .series-sidebar > .series-sidebar-list {
    display: none;
    padding: 8px 14px 12px;
    max-height: 50vh;
    overflow-y: auto;
  }
  .post-layout.has-series > .series-sidebar.is-open > .series-sidebar-list {
    display: block;
  }
}

/* 暗色模式下对图片做轻微降亮，避免在深色页面里刺眼 */
@media (prefers-color-scheme: dark) {
  html[data-theme="dark"] .prose img {
    filter: brightness(0.92);
  }
}
html[data-theme="dark"] .prose img { filter: brightness(0.92); }

/* 代码块在移动端启用流畅惯性滚动 */
.prose pre { -webkit-overflow-scrolling: touch; }
