/* ============================================================
   移动端竖屏适配 (butterfly 4.10.0)
   只作用于 max-width:768px，桌面端完全不受影响
   1) 顶部大图压矮：横图裁切大幅减少
   2) 标题/元信息收紧 + 渐变遮罩：白字在浅色插画上也清晰
   3) 首页卡片封面改宽比：不再把人物放大裁成一条
   4) 正文图片响应式 + 圆角
   ============================================================ */

@media screen and (max-width: 768px) {

  /* ---------- 1. 顶部大图 ---------- */

  /* 首页：原来是 100vh（整屏高），竖屏下横图被放到只剩局部 */
  #page-header.full_page {
    height: 62vh !important;
    min-height: 360px;
    background-attachment: scroll !important;
    background-position: center center !important;
  }
  #page-header.full_page #site-info {
    top: 42% !important;
  }

  /* 文章页：360px -> 200px（宽高比 1.95:1，接近插画本身比例） */
  #page-header.post-bg {
    height: 200px !important;
  }
  #page-header.post-bg #post-info {
    bottom: 12px !important;
    padding: 0 16px !important;
  }

  /* 归档 / 标签 / 分类等内页：280px -> 180px */
  #page-header.not-home-page {
    height: 180px !important;
  }
  #page-header.not-home-page #page-site-info {
    top: 100px !important;
  }

  /* ---------- 2. 标题区渐变遮罩 + 字号收紧 ---------- */

  #page-header.post-bg::after,
  #page-header.not-home-page::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 72%;
    background: linear-gradient(to top, rgba(0, 0, 0, .68) 0%, rgba(0, 0, 0, .28) 55%, rgba(0, 0, 0, 0) 100%);
    content: '';
    pointer-events: none;
  }
  #page-header.post-bg #post-info,
  #page-header.not-home-page #page-site-info {
    z-index: 2;
  }

  #post-info .post-title {
    margin-bottom: 5px !important;
    font-size: 1.38em !important;
    line-height: 1.34 !important;
    -webkit-line-clamp: 2;
  }
  #post-info #post-meta {
    font-size: 76% !important;
    line-height: 1.55 !important;
  }
  #post-info #post-meta .post-meta-separator {
    margin: 0 3px !important;
  }
  #post-info #post-meta .post-meta-icon {
    margin-right: 2px !important;
  }
  /* 阅读量那一行在竖屏下会挤到第二行，去掉，保证元信息只有一行 */
  #post-info #post-meta .meta-secondline {
    display: none !important;
  }
  /* 页标题（归档/标签/分类）同理收紧 */
  #page-header #page-site-info .page-title {
    font-size: 1.5em !important;
    line-height: 1.3 !important;
  }

  /* ---------- 3. 首页卡片封面 ---------- */

  /* 230px -> 170px：宽高比从 1.65:1 变 2.24:1，横图不再被放大裁切 */
  #recent-posts > .recent-post-item .post_cover {
    height: 170px !important;
  }
  #recent-posts > .recent-post-item .recent-post-info {
    padding: 18px 16px 24px !important;
  }
  #recent-posts > .recent-post-item .recent-post-info > .article-title {
    font-size: 1.28em !important;
    -webkit-line-clamp: 2;
  }

  /* ---------- 4. 正文图片 ---------- */

  #article-container img,
  #article-container video {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 6px;
  }
  /* 表格横向可滚，避免撑破版面 */
  #article-container table {
    display: table;
  }
  #article-container .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ---------- 5. 其他小收紧 ---------- */

  /* 侧栏卡片 / 页脚留白 */
  #footer {
    padding-top: 18px;
  }
  #rightside > div > button,
  #rightside > a > button {
    width: 34px;
    height: 34px;
    line-height: 34px;
  }
}
