/* ============================================================
   mobile-adapt.css — 移动端响应式适配补丁
   加载顺序：在 override.css 之后，确保可覆盖既有规则
   ============================================================ */

/* ========================= R1: 导航栏移动端优化 ========================= */

/* --- 1. 遮罩层（backdrop overlay） --- */
.mobile-menu-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 998;          /* 在菜单面板(999)之下，在页面内容之上 */
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.mobile-menu-overlay.is-visible{
  opacity: 1;
  visibility: visible;
}

/* body 滚动锁定 */
body.mobile-menu-open{
  overflow: hidden !important;
}

/* --- 2. 移动端菜单：侧滑面板 --- */
@media (max-width: 768px){

  /* 覆盖 override.css 中的 display:none 逻辑，改为定位+变换实现侧滑 */
  .primary-menu{
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    width: 85vw;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(160deg, #3b82f6 0%, #1e40af 100%);
    box-shadow: -4px 0 24px rgba(0,0,0,.2);
    z-index: 999;
    padding: 20px 20px 24px;
    gap: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
  }
  .primary-menu.is-open{
    transform: translateX(0);
  }

  /* 菜单项样式：白色文字 + 适当间距（用 ID 选择器超越 override.css 的 .navbar.header-color-X 规则） */
  #primary-menu > li{
    border-bottom: none !important;
    margin-bottom: 4px;
  }
  #primary-menu > li > a,
  #primary-menu > li > a:link,
  #primary-menu > li > a:visited{
    display: block !important;
    padding: 10px 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #fff !important;
    background: transparent !important;
    min-height: 36px;
    line-height: 1.4;
  }
  #primary-menu > li > a:hover,
  #primary-menu > li > a:focus,
  #primary-menu > li > a:active{
    color: rgba(255,255,255,.8) !important;
    background: transparent !important;
  }

  /* 隐藏子菜单展开箭头（子菜单始终可见） */
  .primary-menu .submenu-toggle{
    display: none !important;
  }

  /* --- 3. 子菜单：始终展开的 pill 标签布局 --- */
  #primary-menu .sub-menu,
  .navbar .container .primary-menu .sub-menu,
  .primary-menu .sub-menu{
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    max-height: none !important;
    overflow: hidden !important;
    opacity: 1 !important;
    padding: 4px 0 12px 0 !important;
    margin: 0;
    list-style: none;
    /* 覆盖 override.css 的 min-width:max-content */
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    /* 强制去除 style.css 的白色背景和阴影 */
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    position: static !important;
  }
  #primary-menu .sub-menu li,
  .primary-menu .sub-menu li{
    flex: none;
    background: transparent !important;
  }
  #primary-menu .sub-menu li a,
  #primary-menu .sub-menu li a:link,
  #primary-menu .sub-menu li a:visited{
    display: inline-block !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
    color: #fff !important;
    background: transparent !important;
    border: 1px solid rgba(255,255,255,.35) !important;
    border-radius: 20px !important;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: auto !important;
    line-height: 1.4;
    transition: background .2s, border-color .2s;
    box-shadow: none !important;
  }
  #primary-menu .sub-menu li a:hover,
  #primary-menu .sub-menu li a:focus,
  #primary-menu .sub-menu li a:active{
    background: rgba(255,255,255,.15) !important;
    border-color: rgba(255,255,255,.7) !important;
    color: #fff !important;
  }

  /* --- 4. 登录/注册按钮在移动菜单中可见 --- */
  .header-auth-buttons{
    display: none !important;
  }

  /* 移动菜单内的登录按钮组：并排白色 */
  .mobile-auth-buttons{
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.2);
  }
  .mobile-auth-buttons .header-auth-btn{
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 40px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #fff !important;
    background: #fff !important;
    color: #2563eb !important;
  }
  .mobile-auth-buttons .header-auth-btn-secondary{
    background: transparent !important;
    color: #fff !important;
    border-color: rgba(255,255,255,.6) !important;
  }

  /* 面板顶部关闭按钮：白色 */
  .mobile-menu-close{
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.1);
    border: none;
    font-size: 22px;
    color: #fff;
    cursor: pointer;
    border-radius: 8px;
    transition: background .2s;
    z-index: 1;
  }
  .mobile-menu-close:hover,
  .mobile-menu-close:active{
    background: rgba(255,255,255,.2);
    color: #fff;
  }

  /* --- 面板顶部 Logo --- */
  .mobile-menu-logo{
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-right: 44px; /* 给关闭按钮留空间 */
  }
  .mobile-menu-logo img{
    max-height: 36px;
    width: auto;
    filter: brightness(0) invert(1); /* 反色为白 */
  }
  .mobile-menu-logo .mobile-logo-text{
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
  }

  /* --- 5. 汉堡按钮优化 --- */
  .mobile-menu-btn{
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }
}

/* 桌面端：确保移动端专属元素隐藏 */
@media (min-width: 769px){
  .mobile-menu-overlay,
  .mobile-menu-close,
  .mobile-menu-logo,
  .mobile-auth-buttons{
    display: none !important;
  }
}


/* ========================= R2: 内容区+侧栏断点统一 ========================= */
/* 统一到 1024px 断点，覆盖 style.css(1024px)、override.css(992px)、responsive.css(768px) 的冲突 */
@media (max-width: 1024px){
  .content-area{
    flex-direction: column !important;
    flex-wrap: nowrap !important;
  }
  .content-area .main-content{
    max-width: 100% !important;
    width: 100%;
    flex: 1 1 auto;
  }
  .content-area .sidebar{
    flex: 0 0 auto !important;
    max-width: 100% !important;
    width: 100%;
  }
}

/* 小屏下内容区 padding 微调 */
@media (max-width: 768px){
  .content-area .main-content{
    padding: 16px;
  }
  .content-area .sidebar{
    padding: 14px;
  }
}


/* ========================= R3: Hero 区移动端适配 ========================= */
/* 768px 以下转为单列布局 */
@media (max-width: 768px){
  .hero{
    padding: 120px 0 60px;
  }
  .hero .container{
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 24px;
  }
  .hero .hero-content{
    height: auto;
    grid-template-rows: auto auto auto auto;
  }
  .hero .hero-image{
    min-height: 200px;
    max-height: 300px;
  }
  .hero-title{
    font-size: 2rem !important;
  }
  .hero-description{
    font-size: 1rem !important;
  }
  .hero-buttons{
    flex-wrap: wrap;
  }
}

/* 480px 以下进一步压缩 */
@media (max-width: 480px){
  .hero{
    padding: 100px 0 40px;
  }
  .hero-title{
    font-size: 1.75rem !important;
  }
  .hero .hero-image{
    min-height: 160px;
    max-height: 240px;
  }
}

/* Tabs 横向滚动渐变提示 */
.hero .df-hero-tabs{
  position: relative;
}
.hero .df-hero-tabs::after{
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(to left, rgba(30,58,138,.8), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
  border-radius: 0 8px 8px 0;
}
/* 仅在可滚动时显示渐变（JS 添加 .has-overflow 类） */
.hero .df-hero-tabs.has-overflow::after{
  opacity: 1;
}

/* ========================= M11: 口号区(Slogan)移动端适配 ========================= */
@media (max-width: 768px){
  /* 区块整体：限宽 + 防溢出 */
  .slogan{
    overflow: hidden !important;
    max-width: 100vw;
    padding: 36px 0 !important;           /* 缩小上下内边距 */
  }
  /* 全宽背景图层：iOS 不支持 fixed，强制 scroll */
  .slogan .s1-bg{
    background-attachment: scroll !important;
    width: 100% !important;               /* 避免 100vw 含滚动条溢出 */
    left: 0 !important;
    margin-left: 0 !important;
    background-position: center center !important;
  }
  /* 容器：缩小内边距 */
  .slogan > .container{
    padding: 24px 16px !important;
  }
  /* 标题：缩小字号 */
  .slogan .slogan-title{
    font-size: 1.5rem !important;
    line-height: 1.4;
    word-break: break-word;
  }
  /* 描述：缩小字号 */
  .slogan .slogan-desc{
    font-size: .95rem !important;
    line-height: 1.7;
  }
}
@media (max-width: 480px){
  .slogan{
    padding: 28px 0 !important;
  }
  .slogan .slogan-title{
    font-size: 1.25rem !important;
  }
  .slogan .slogan-desc{
    font-size: .875rem !important;
  }
}

/* Products Tabs 移动端优化 */
@media (max-width: 768px){
  .products .tab-buttons{
    flex-direction: row !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .products .tab-button{
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 14px 16px;
    font-size: 14px;
  }
  .products .tab-button.active::after{
    width: 100% !important;
    height: 3px !important;
    top: auto !important;
    left: 0 !important;
    bottom: 0;
  }
  .products .tab-content.active{
    flex-direction: column;
    padding: 20px 16px;
  }
}


/* ========================= R4: 产品详情页移动端 ========================= */
/* product-header：768px 以下单列 */
@media (max-width: 768px){
  /* 页面级溢出保护 */
  .plugin-detail-page{
    overflow-x: hidden !important;
    max-width: 100vw;
  }
  .plugin-detail-page .container{
    max-width: 100% !important;
    padding: 0 12px !important;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .plugin-detail-page .product-header{
    grid-template-columns: 1fr !important;
    gap: 1rem;
    max-width: 100%;
  }
  .plugin-detail-page .product-detail{
    padding: 1rem 0 !important;
  }
  .plugin-detail-page .product-title{
    font-size: 1.35rem;
    word-break: break-word;
  }
  /* 图片/信息卡片：限制宽度 + 减小内边距 */
  .plugin-detail-page .product-image,
  .plugin-detail-page .product-info{
    max-width: 100% !important;
    overflow: hidden;
    box-sizing: border-box;
  }
  .plugin-detail-page .product-image{
    padding: 1rem;
    border-radius: 12px;
  }
  .plugin-detail-page .product-image img{
    max-width: 100% !important;
    height: auto;
  }
  .plugin-detail-page .product-info{
    padding: 1.25rem;
    border-radius: 12px;
  }
  /* 标签行：限制在卡片内 */
  .plugin-detail-page .tags{
    max-width: 100%;
    overflow: hidden;
  }
  /* 统计栏：允许横向滚动但不撑宽页面 */
  .plugin-detail-page .product-stats{
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-bottom: 4px;
  }
  /* 操作按钮：堆叠全宽 */
  .plugin-detail-page .product-actions{
    flex-direction: column;
  }
  .plugin-detail-page .product-actions .btn{
    width: 100%;
    justify-content: center;
  }
  /* 内容区段：减小内边距 */
  .plugin-detail-page .content-section{
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-radius: 10px;
  }
  .plugin-detail-page .section-title{
    font-size: 1.25rem;
  }
  /* 防止正文内容溢出 */
  .plugin-detail-page .entry-content{
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .plugin-detail-page .entry-content img,
  .plugin-detail-page .entry-content table,
  .plugin-detail-page .entry-content iframe{
    max-width: 100% !important;
  }
  /* FAQ 问题文字：允许换行 */
  .plugin-detail-page .faq-question{
    padding: 10px 12px;
    font-size: 14px;
  }
  /* 更新日志条目 */
  .plugin-detail-page .changelog-entry{
    padding: .8rem 1rem;
  }
  .plugin-detail-page .changelog-entry .entry-head{
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;
  }
  /* 评价卡片 */
  .plugin-detail-page .review{
    padding: 1rem;
  }
  .plugin-detail-page .review-header{
    flex-direction: column;
    gap: .5rem;
  }
}

/* 截图网格：小屏下 2 列 → 1 列 */
@media (max-width: 768px){
  .plugin-detail-page .screenshots{
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}
@media (max-width: 480px){
  .plugin-detail-page .screenshots{
    grid-template-columns: 1fr;
  }
}

/* TOC：小屏隐藏固定定位，改为收缩按钮 */
@media (max-width: 768px){
  .pd-toc{
    position: fixed;
    right: 8px;
    bottom: 80px;
    top: auto !important;
    width: 200px;
    max-height: 50vh;
    font-size: 12px;
  }
  .pd-toc .pd-toc-toggle{
    right: 8px;
    top: auto;
    bottom: 80px;
  }
}

/* 特性网格小屏单列 */
@media (max-width: 576px){
  .plugin-detail-page .features-grid{
    grid-template-columns: 1fr;
  }
}

/* 评价卡片小屏单列 */
@media (max-width: 576px){
  .plugin-detail-page .reviews{
    grid-template-columns: 1fr;
  }
}


/* ========================= R5: 工具页移动端适配 ========================= */
/* AI 检测 / 原创度检测：左右布局在 768px 改为上下 */
@media (max-width: 768px){
  .df-og-layout{
    flex-direction: column;
  }
  .df-ai-left,
  .df-ai-right,
  .df-og-left,
  .df-og-right{
    flex: none;
    width: 100%;
  }
  .df-og-left textarea,
  .df-ai-highlight{
    min-height: 200px;
  }
  .df-og-result-wrap{
    min-height: 200px;
  }
  .df-ai-right{
    min-height: auto;
    padding: 16px;
  }
}

/* 工具卡片小屏 padding 缩减 */
@media (max-width: 480px){
  .df-tools-card{
    padding: 14px;
  }
  .df-tools-card h2{
    font-size: 18px;
  }
}

/* 工具索引页网格 */
@media (max-width: 560px){
  .df-tools-grid{
    grid-template-columns: 1fr;
  }
  .df-tgc-top{
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
}

/* 翻译面板：小屏单列 */
@media (max-width: 680px){
  .df-translate-panels{
    grid-template-columns: 1fr;
  }
}


/* ========================= R6: 全局移动端修复 ========================= */

/* --- 表格横向滚动 --- */
.entry-content table,
.df-tools-result table,
.content-section table{
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* --- Container padding 统一 --- */
@media (max-width: 768px){
  .container{
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}
@media (max-width: 480px){
  .container{
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* --- 触控目标最小 44px --- */
@media (max-width: 768px){
  /* 导航链接 */
  .primary-menu a,
  .sub-menu a{
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  /* 按钮 */
  .btn,
  .df-tools-btn,
  .df-q-btn,
  .header-auth-btn,
  button{
    min-height: 44px;
  }
  /* 分页链接 */
  .pagination a,
  .pagination span,
  .page-numbers{
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* --- 移动端页面级溢出保护 --- */
@media (max-width: 768px){
  html, body{
    overflow-x: hidden !important;
    max-width: 100vw;
  }
  .container{
    max-width: 100% !important;
    overflow-x: hidden;
  }
  /* 文章正文：防止任何子元素撑宽页面 */
  .article-content,
  .entry-content,
  .main-content{
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    min-width: 0;
    max-width: 100%;
  }
  /* 文章正文内所有可能溢出的元素 */
  .article-content img,
  .article-content video,
  .article-content iframe,
  .article-content embed,
  .article-content object,
  .article-content table,
  .article-content svg{
    max-width: 100% !important;
    height: auto;
  }
  .article-content table{
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .article-content pre{
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* 长链接/长单词断行 */
  .article-content a{
    word-break: break-all;
  }
}

/* --- 图片防溢出 --- */
img{
  max-width: 100%;
  height: auto;
}
.entry-content img{
  max-width: 100%;
  height: auto;
}

/* --- 代码块防溢出 --- */
pre, code{
  max-width: 100%;
  overflow-x: auto;
  word-break: break-all;
}
.entry-content pre{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}


/* ========================= R7: 页脚 / 产品列表 / 问题反馈 ========================= */

/* 页脚：小屏下列数调整 */
@media (max-width: 768px){
  .footer .footer-content{
    gap: 20px;
  }
  .footer .footer-content > .footer-column{
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* 浮动按钮（返回顶部、客服等）：调整位置避免遮挡内容 */
@media (max-width: 768px){
  .float-buttons,
  .back-to-top,
  #back-to-top{
    bottom: 16px !important;
    right: 12px !important;
  }
}

/* 产品列表卡片：小屏间距与字号 */
@media (max-width: 560px){
  .product-list-grid{
    grid-template-columns: 1fr !important;
  }
  .pl-card .pl-title{
    font-size: 16px;
  }
}

/* 问题反馈页：移动端已有 1024px 断点，补充更小屏的优化 */
@media (max-width: 480px){
  .df-q-detail-title{
    font-size: 22px;
  }
  .df-q-content{
    font-size: 14px;
  }
  .df-q-modal{
    padding: 14px;
    border-radius: 10px;
  }
}

/* 面包屑小屏自动换行 */
@media (max-width: 768px){
  .breadcrumb-bar .breadcrumb{
    font-size: 13px;
    flex-wrap: wrap;
  }
  .breadcrumb-bar{
    padding: 8px 16px;
  }
}

/* 用户中心：小屏下侧栏 Tab 水平滚动 */
@media (max-width: 768px){
  .user-center-page .uc-sidebar{
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0;
  }
  .user-center-page .uc-sidebar a{
    white-space: nowrap;
    padding: 10px 16px;
    flex-shrink: 0;
    min-height: 44px;
  }
  .user-center-page .uc-main{
    padding: 16px 0;
  }
}

/* 登录页移动端优化 */
@media (max-width: 576px){
  .df-login-card{
    margin: 0 12px;
    padding: 24px 16px;
  }
  .df-login-page .df-login-title{
    font-size: 22px;
  }
}

/* 多产品价格详情页：小屏单列 */
@media (max-width: 768px){
  .mp-grid{
    grid-template-columns: 1fr !important;
  }
}

/* ========================= M5: 顶部提示条移动端适配 ========================= */
@media (max-width: 768px){
  /* 改为3列 grid：文本自适应 + CTA按钮 + 关闭按钮，防止溢出 */
  .df-top-notice-wrap{
    grid-template-columns: 1fr auto auto !important;
    column-gap: 8px !important;
    max-width: 100% !important;
    padding: 0 12px;
    box-sizing: border-box;
  }
  .df-top-notice-message{
    min-width: 0;
    overflow: hidden;
  }
  .df-top-notice-text{
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
  }
  .df-top-notice-cta{
    flex: none !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    height: 28px !important;
    line-height: 28px !important;
    white-space: nowrap;
  }
  .df-top-notice-close{
    flex: none;
    padding: 4px 6px !important;
    font-size: 18px !important;
  }
  .df-top-notice .container{
    padding: 0 !important;
  }
}
@media (max-width: 400px){
  /* 极小屏：隐藏 CTA 按钮，只保留文本+关闭 */
  .df-top-notice-wrap{
    grid-template-columns: 1fr auto !important;
  }
  .df-top-notice-cta{
    display: none !important;
  }
}


/* ========================= M6: 文章页导航按钮移动端 ========================= */
@media (max-width: 768px){
  /* 上下篇导航：强制单列堆叠，防止水平溢出 */
  .article-navigation{
    display: flex !important;
    flex-direction: column !important;
    gap: .75rem !important;
    align-items: stretch !important;
  }
  .article-navigation .nav-previous,
  .article-navigation .nav-next{
    flex: none !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .article-navigation .nav-title{
    white-space: normal !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: left !important;
  }
  /* WP 默认 post-navigation 同样处理 */
  .post-navigation .nav-links,
  .navigation.post-navigation .nav-links{
    flex-direction: column !important;
    gap: .75rem !important;
  }
  .post-navigation .nav-previous,
  .post-navigation .nav-next,
  .navigation.post-navigation .nav-previous,
  .navigation.post-navigation .nav-next{
    max-width: 100% !important;
    width: 100% !important;
  }
  .post-navigation .nav-previous a,
  .post-navigation .nav-next a{
    white-space: normal !important;
    text-align: left !important;
  }
}


/* 时间线小屏已有规则，此处确保触控区域足够 */
@media (max-width: 768px){
  .timeline-dot{
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
}


/* ========================= M1: 移动端页脚精简 ========================= */
/* 桌面端：隐藏移动版页脚 */
.footer-bottom-mobile{
  display: none;
}
@media (max-width: 768px){
  /* 隐藏 PC 端页脚内容：widget列、站点地图、友情链接、完整版权 */
  .footer .footer-content{
    display: none !important;
  }
  .footer .footer-sitemap-bar{
    display: none !important;
  }
  .footer .footer-friendlinks{
    display: none !important;
  }
  .footer .footer-bottom-pc{
    display: none !important;
  }
  /* 显示移动端简化版页脚：三行居中 */
  .footer .footer-bottom-mobile{
    display: block !important;
    text-align: center;
    padding: 20px 16px;
    font-size: 13px;
    color: rgba(255,255,255,.6);
    line-height: 1.8;
  }
  .footer .footer-bottom-mobile p{
    margin: 0 0 4px;
  }
  .footer .footer-bottom-mobile p:last-child{
    margin-bottom: 0;
  }
  .footer .footer-bottom-mobile a{
    color: rgba(255,255,255,.5);
    text-decoration: none;
  }
  .footer .footer-bottom-mobile a:hover{
    color: rgba(255,255,255,.8);
  }
}


/* ========================= M2: 汉堡按钮全页面可见 ========================= */
/* 加强选择器权重，确保所有页面（非仅首页）的汉堡按钮可见 */
@media (max-width: 768px){
  .navbar .mobile-menu-btn,
  nav .mobile-menu-btn,
  .mobile-menu-btn{
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
  }
}


/* ========================= M3: 移动端隐藏侧边栏 ========================= */
@media (max-width: 768px){
  .sidebar,
  .sidebar-area,
  aside.sidebar{
    display: none !important;
  }
  /* 主内容占满宽度 */
  .content-area .main-content{
    max-width: 100% !important;
    width: 100% !important;
    flex: 1 1 100% !important;
  }
}


/* ========================= M10: 相关文章移动端适配 ========================= */
@media (max-width: 768px){
  /* 区块整体：约束在视口内 */
  .related-posts{
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden;
    padding: .75rem !important;
  }
  /* 网格：小屏2列，更小屏1列 */
  .related-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .75rem !important;
  }
  /* 卡片 */
  .related-post .card{
    padding: .5rem;
  }
  /* 图片容器：保留比例 */
  .related-image{
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
  }
  /* 修复：确保图片在 aspect-ratio 容器内铺满（覆盖全局 height:auto） */
  .related-image img{
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }
  /* 标题：允许2行 */
  .related-title{
    white-space: normal !important;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px !important;
  }
}
@media (max-width: 480px){
  .related-grid{
    grid-template-columns: 1fr !important;
  }
}

/* ========================= M4: 移动端文章列表精简 ========================= */
@media (max-width: 768px){
  /* 隐藏缩略图 */
  .articles-list .article-image{
    display: none !important;
  }
  /* 文章卡片改为纯文字纵向排列 */
  .articles-list .article-item{
    flex-direction: column;
    gap: .5rem;
    padding: 12px 0;
  }
  /* 标题 */
  .articles-list .article-title{
    font-size: 16px;
    white-space: normal;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
  }
  /* 摘要 */
  .articles-list .article-excerpt{
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
  }
  .articles-list .article-excerpt p{
    margin: 0;
  }
  /* 日期 */
  .articles-list .article-date{
    font-size: 13px;
    color: #9ca3af;
  }
  /* 隐藏标签栏（精简模式不需要） */
  .articles-list .article-tags{
    display: none;
  }
  /* 隐藏作者、分类、评论数等多余 meta（仅保留日期） */
  .articles-list .article-meta{
    display: none;
  }
}
