/* 移动端响应式优化 */

/* 文章页面移动端优化 */
@media (max-width: 768px) {
  /* 文章标题字体大小调整 */
  .article-title {
    font-size: 1.6em !important;
    line-height: 1.3 !important;
  }

  /* 文章内容字体大小调整 */
  .article-md-preview {
    font-size: 1em !important;
    line-height: 1.8 !important;
    padding: 1em 0.8em !important;
  }

  /* 文章页面容器调整 */
  .article-page {
    padding: 1.5em 1em 1.2em !important;
    border-radius: 1em !important;
  }

  .article-page-bg {
    padding: 1em 0.5em 1.5em !important;
  }

  /* 文章摘要调整 */
  .article-summary {
    font-size: 1em !important;
    padding: 0.7em 1em !important;
  }

  /* 返回首页按钮调整 */
  .go-home-btn {
    font-size: 0.95em !important;
    padding: 0.35em 1.2em 0.35em 0.8em !important;
  }

  /* 文章元信息调整 */
  .article-meta-inline {
    font-size: 0.9em !important;
    gap: 0.8em !important;
  }

  .article-tag {
    font-size: 0.85em !important;
    padding: 0.15em 0.7em !important;
  }

  /* 评论区调整 */
  .comment-section {
    margin-top: 20px !important;
    padding-top: 15px !important;
  }

  .comment-item,
  .reply-item {
    padding: 10px !important;
  }

  /* 相关文章网格调整 */
  .related-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .related-item {
    padding: 12px !important;
  }

  .related-item h4 {
    font-size: 15px !important;
  }

  .related-item p {
    font-size: 13px !important;
  }
}

@media (max-width: 480px) {
  /* 超小屏幕进一步优化 */
  .article-title {
    font-size: 1.4em !important;
  }

  .article-md-preview {
    font-size: 0.95em !important;
  }

  .article-page {
    padding: 1.2em 0.8em 1em !important;
  }

  .go-home-btn {
    font-size: 0.9em !important;
    padding: 0.3em 1em 0.3em 0.7em !important;
  }
}

/* 文章列表页面移动端优化 */
@media (max-width: 768px) {
  /* 文章卡片调整 */
  .article-card.article-card-rightimg {
    flex-direction: column !important;
    height: auto !important;
    min-height: auto !important;
  }

  .card-imgbox {
    width: 100% !important;
    min-width: auto !important;
    height: 180px !important;
    border-left: none !important;
    border-bottom: 1px solid #ecedf3 !important;
  }

  .card-body {
    padding: 1em 1.2em !important;
  }

  .card-title {
    font-size: 1.1em !important;
  }

  .card-abstract {
    font-size: 0.95em !important;
    -webkit-line-clamp: 3 !important;
  }

  /* 搜索栏调整 */
  .search-bar {
    flex-direction: column !important;
    gap: 0.6em !important;
  }

  .subcategory-select {
    width: 100% !important;
  }

  /* 分类侧边栏调整 */
  .with-tree-sidebar {
    flex-direction: column !important;
    padding: 0 1em !important;
  }

  .category-sidebar {
    width: 100% !important;
    margin-right: 0 !important;
    margin-bottom: 1em !important;
    height: auto !important;
    max-height: 200px !important;
    overflow-y: auto !important;
  }

  .article-list-bg {
    padding-right: 0 !important;
  }

  .article-list-card {
    padding: 1.5em 1em !important;
    margin: 1.5em 0 !important;
  }
}

/* 导航栏移动端优化 */
@media (max-width: 768px) {
  .header {
    padding: 0.4rem 0.8rem !important;
  }

  .container {
    gap: 0.5rem !important;
  }

  .logo {
    font-size: 1rem !important;
  }

  .sub-title {
    font-size: 0.85rem !important;
  }

  .nav {
    gap: 0.5rem !important;
  }

  .nav-link {
    font-size: 0.9rem !important;
    padding: 0.2rem 0.5rem !important;
  }

  .actions {
    gap: 0.4rem !important;
  }

  .logout-btn {
    font-size: 0.85rem !important;
    padding: 0.3rem 0.8rem !important;
  }

  .health-pill {
    font-size: 0.75rem !important;
    padding: 0.2rem 0.5rem !important;
  }
}

@media (max-width: 480px) {
  .nav {
    font-size: 0.85rem !important;
  }

  .nav-link {
    font-size: 0.85rem !important;
  }
}

/* 图片自适应优化 */
@media (max-width: 768px) {
  .article-md-preview img,
  .article-md-preview img[src],
  .md-editor-preview img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 1em auto !important;
    border-radius: 0.5em !important;
  }

  /* 代码块优化 */
  .article-md-preview pre,
  .article-md-preview code,
  .md-editor-preview pre,
  .md-editor-preview code {
    font-size: 0.9em !important;
    overflow-x: auto !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
  }

  /* 表格优化 */
  .article-md-preview table,
  .md-editor-preview table {
    font-size: 0.9em !important;
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* 页脚移动端优化 */
@media (max-width: 768px) {
  .footer {
    padding: 1em 1em 1.2em !important;
    font-size: 0.9em !important;
  }

  .subscribe {
    flex-direction: column !important;
    gap: 0.5em !important;
  }

  .subscribe input {
    min-width: 100% !important;
    font-size: 14px !important;
  }

  .subscribe button {
    width: 100% !important;
  }
}

/* 交互按钮移动端优化 */
@media (max-width: 768px) {
  .engagement-bar {
    gap: 8px !important;
  }

  .action-btn {
    padding: 6px 12px !important;
    font-size: 0.9em !important;
  }

  .count {
    font-size: 0.9em !important;
  }
}

/* 骨架屏移动端优化 */
@media (max-width: 768px) {
  .skeleton-title {
    height: 2em !important;
    width: 70% !important;
  }

  .skeleton-paragraph {
    height: 1em !important;
  }
}
