/* ============================================
   手机导航主页 - 完整样式 v5
   修复：顶部遮挡、隐藏Kadence原生header
   ★ 最新发布改为4列卡片网格（同强化管理期风格）
   ============================================ */

/* ====== 基础重置 ====== */
.mh-app {
  --mh-primary: #28544d;
  --mh-primary-hover: #1f3f3a;
  --mh-bg: #F5F7F7;
  --mh-card: #FFFFFF;
  --mh-border: #E6ECEA;
  --mh-text: #111827;
  --mh-text2: #374151;
  --mh-text-light: #F9FAFB;
  --mh-radius: 12px;
  --mh-radius-sm: 8px;
  --mh-shadow: 0 2px 8px rgba(0,0,0,0.06);
  --mh-shadow-lg: 0 4px 20px rgba(0,0,0,0.1);

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--mh-bg);
  color: var(--mh-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-top: 56px;
}

.mh-app * {
  box-sizing: border-box;
}

/* ====== 下拉刷新指示器 ====== */
.mh-pull-indicator {
  text-align: center;
  padding: 12px;
  color: #9CA3AF;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ====== 顶部品牌栏 ====== */
.mh-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--mh-primary);
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(40,84,77,0.2);
}

.mh-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  max-width: 1280px;
  width: 89%;
  margin: 0 auto;
  padding: 0 15px;
}

@media (max-width: 768px) {
  .mh-topbar-inner {
    width: 100%;
    max-width: 100%;
    padding: 0 16px;
    justify-content: flex-start;
  }
}

.mh-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mh-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.mh-site-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--mh-text-light);
  letter-spacing: 0.5px;
}

/* ====== 公告横幅 ====== */
.mh-announcement {
  background: var(--mh-card);
  border-bottom: 1px solid var(--mh-border);
}

.mh-announce-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  max-width: 1280px;
  width: 89%;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .mh-announce-inner {
    width: 100%;
    padding: 10px 16px;
  }
}

.mh-announce-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.mh-announce-scroll {
  flex: 1;
  overflow: hidden;
  height: 22px;
  position: relative;
}

.mh-announce-item {
  position: absolute;
  width: 100%;
  font-size: 13px;
  color: var(--mh-text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 22px;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.5s ease;
}

.mh-announce-item.active {
  opacity: 1;
  transform: translateY(0);
}

.mh-announce-item a {
  color: var(--mh-text2);
  text-decoration: none;
}

.mh-announce-item a:hover {
  color: var(--mh-primary);
}

/* ====== 轮播横幅 ====== */
.mh-banner {
  position: relative;
  max-width: 1280px;
  width: 89%;
  margin: 12px auto;
  overflow: hidden;
  border-radius: var(--mh-radius);
}

@media (max-width: 768px) {
  .mh-banner {
    width: calc(100% - 32px);
    margin: 12px 16px;
  }
}

.mh-banner-track {
  display: flex;
  transition: transform 0.4s ease;
}

.mh-banner-slide {
  min-width: 100%;
  border-radius: var(--mh-radius);
  overflow: hidden;
  position: relative;
}

.mh-banner-slide a {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border-radius: var(--mh-radius);
  background: #e8e8e8;
}

.mh-banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: var(--mh-radius);
}

.mh-banner-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.mh-banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mh-border);
  transition: all 0.3s;
  cursor: pointer;
}

.mh-banner-dot.active {
  width: 18px;
  border-radius: 3px;
  background: var(--mh-primary);
}

/* ====== 核心导航宫格 ====== */
.mh-nav-grid {
  max-width: 1280px;
  width: 89%;
  margin: 16px auto;
}

@media (max-width: 768px) {
  .mh-nav-grid {
    width: calc(100% - 32px);
    margin: 16px 16px;
  }
}

.mh-nav-grid-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--mh-card);
  border-radius: var(--mh-radius);
  padding: 16px 8px;
  box-shadow: var(--mh-shadow);
}

.mh-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  text-decoration: none;
  color: var(--mh-text);
  border-radius: var(--mh-radius-sm);
  transition: all 0.2s;
  cursor: pointer;
}

.mh-nav-item:hover,
.mh-nav-item:active {
  background: var(--mh-bg);
  transform: scale(0.96);
}

.mh-nav-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mh-nav-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--mh-text2);
  text-align: center;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 导航图标颜色 */
.mh-nav-icon.bg1 { background: linear-gradient(135deg, #28544d, #3a7a6f); }
.mh-nav-icon.bg2 { background: linear-gradient(135deg, #1D4ED8, #3B82F6); }
.mh-nav-icon.bg3 { background: linear-gradient(135deg, #B45309, #F59E0B); }
.mh-nav-icon.bg4 { background: linear-gradient(135deg, #7C3AED, #A78BFA); }
.mh-nav-icon.bg5 { background: linear-gradient(135deg, #B91C1C, #EF4444); }
.mh-nav-icon.bg6 { background: linear-gradient(135deg, #047857, #10B981); }
.mh-nav-icon.bg7 { background: linear-gradient(135deg, #1E40AF, #60A5FA); }
.mh-nav-icon.bg8 { background: linear-gradient(135deg, #92400E, #D97706); }
.mh-nav-icon.bg9 { background: linear-gradient(135deg, #6D28D9, #8B5CF6); }
.mh-nav-icon.bg10 { background: linear-gradient(135deg, #9D174D, #EC4899); }
.mh-nav-icon.bg11 { background: linear-gradient(135deg, #065F46, #34D399); }
.mh-nav-icon.bg12 { background: linear-gradient(135deg, #1E3A5F, #3B82F6); }

/* ====== 通用区块 ====== */
.mh-section {
  max-width: 1280px;
  width: 89%;
  margin: 20px auto;
}

@media (max-width: 768px) {
  .mh-section {
    width: 100%;
    padding: 0 16px;
  }
}

.mh-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.mh-section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--mh-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mh-title-icon {
  font-size: 18px;
}

/* ====== 加载文字 ====== */
.mh-loading-text,
.mh-empty-text {
  text-align: center;
  padding: 30px 20px;
  color: #9CA3AF;
  font-size: 14px;
}

/* ====== 热门推荐 ====== */
.mh-hot-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.mh-hot-list::-webkit-scrollbar {
  display: none;
}

.mh-hot-card {
  flex-shrink: 0;
  width: 200px;
  background: var(--mh-card);
  border-radius: var(--mh-radius);
  overflow: hidden;
  box-shadow: var(--mh-shadow);
  text-decoration: none;
  color: var(--mh-text);
  transition: transform 0.2s, box-shadow 0.2s;
}

.mh-hot-card:hover,
.mh-hot-card:active {
  transform: translateY(-2px);
  box-shadow: var(--mh-shadow-lg);
}

.mh-hot-card-img-wrap {
  width: 100%;
  height: 120px;
  overflow: hidden;
  background: var(--mh-bg);
}

.mh-hot-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.mh-hot-card-body {
  padding: 10px 12px;
}

.mh-hot-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 6px;
}

.mh-hot-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #9CA3AF;
}

.mh-hot-card-views {
  display: flex;
  align-items: center;
  gap: 2px;
}

.mh-sticky-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  background: #FEF3C7;
  color: #B45309;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 4px;
}

/* ====== 最新发布 - 4列卡片网格（同强化管理期风格）====== */
.mh-latest-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ====== 最新发布卡片（同强化管理期qh-card风格）====== */
.mh-card {
  background: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  border: 1px solid #E6ECEA;
}

.mh-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 封面图区域 */
.mh-card-thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #f0f0f0;
  overflow: hidden;
}

.mh-card-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.mh-card:hover .mh-card-thumb img {
  transform: scale(1.08);
}

.mh-card-thumb-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #28544d 0%, #3a7d5e 100%);
  color: #fff;
  font-size: 36px;
}

/* 视频播放按钮 */
.mh-card .mh-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.mh-card .mh-play-btn::after {
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent #fff;
  margin-left: 3px;
}

.mh-card:hover .mh-play-btn {
  background: rgba(40, 84, 77, 0.85);
  transform: translate(-50%, -50%) scale(1.1);
}

/* 音频播放按钮 */
.mh-card .mh-audio-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 22px;
  color: #fff;
  line-height: 1;
}

.mh-card:hover .mh-audio-btn {
  background: rgba(142, 68, 173, 0.85);
  transform: translate(-50%, -50%) scale(1.1);
}

/* 时长标签 */
.mh-card .mh-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

/* 类型标签 */
.mh-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.mh-type-badge.video {
  background: #B91C1C;
}

.mh-type-badge.image {
  background: #1D4ED8;
}

.mh-type-badge.audio {
  background: #8e44ad;
}

.mh-type-badge.article {
  background: #95a5a6;
}

/* 卡片内容区域 */
.mh-card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mh-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mh-card-excerpt {
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* ====== ACF字段自动显示样式 ====== */
.mh-acf-fields {
  margin: 6px 0 10px;
  padding: 8px 0;
  border-top: 1px dashed #E6ECEA;
}

.mh-acf-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 1.6;
}

.mh-acf-label {
  color: #374151;
  font-weight: 600;
  white-space: nowrap;
  margin-right: 6px;
  flex-shrink: 0;
}

.mh-acf-value {
  color: #111827;
  flex: 1;
  word-break: break-all;
}

.mh-acf-tag {
  display: inline-block;
  background: #eef6f4;
  color: #28544d;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  margin: 1px 3px 1px 0;
  border: 1px solid #c8ddd9;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.mh-acf-tag:hover {
  background: #28544d;
  color: #fff;
  border-color: #28544d;
}

.mh-acf-link {
  color: #28544d;
  text-decoration: underline;
  word-break: break-all;
}

.mh-acf-link:hover {
  color: #1f3f3a;
}

/* media_link 播放/资源按钮 */
.mh-media-btn-wrap {
  margin: 6px 0 2px;
}

.mh-media-btn {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 16px;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.mh-media-btn-video {
  background: #B91C1C;
  color: #fff;
}

.mh-media-btn-video:hover {
  background: #991b1b;
  color: #fff;
}

.mh-media-btn-audio {
  background: #8e44ad;
  color: #fff;
}

.mh-media-btn-audio:hover {
  background: #732d91;
  color: #fff;
}

.mh-media-btn-link {
  background: #eef6f4;
  color: #28544d;
  border: 1px solid #c8ddd9;
}

.mh-media-btn-link:hover {
  background: #d5ebe6;
  color: #1f3f3a;
}

/* 卡片底部元信息 */
.mh-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #374151;
  padding-top: 10px;
  border-top: 1px solid #E6ECEA;
}

.mh-card-views {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mh-card-views svg {
  width: 14px;
  height: 14px;
  fill: #374151;
}

/* ====== 加载更多 ====== */
.mh-load-more-wrap {
  text-align: center;
  padding: 16px 0;
}

.mh-load-btn {
  padding: 10px 32px;
  background: var(--mh-card);
  color: var(--mh-primary);
  border: 1.5px solid var(--mh-primary);
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.mh-load-btn:hover,
.mh-load-btn:active {
  background: var(--mh-primary);
  color: var(--mh-text-light);
}

.mh-no-more {
  text-align: center;
  padding: 20px;
  color: #D1D5DB;
  font-size: 13px;
}

/* ====== 无图片占位 ====== */
.mh-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #E6ECEA, #D1D5DB);
  color: #9CA3AF;
  font-size: 28px;
}

/* ====== 加载动画 ====== */
.mh-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--mh-border);
  border-top-color: var(--mh-primary);
  border-radius: 50%;
  animation: mh-spin 0.8s linear infinite;
}

@keyframes mh-spin {
  to { transform: rotate(360deg); }
}

/* ====== 底部占位 ====== */
.mh-bottom-spacer {
  height: 70px;
}

/* ====== 底部固定导航栏 ====== */
.mh-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--mh-card);
  border-top: 1px solid var(--mh-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mh-bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: #9CA3AF;
  font-size: 10px;
  font-weight: 500;
  transition: color 0.2s;
  padding: 4px 12px;
}

.mh-bnav-item.active {
  color: var(--mh-primary);
}

.mh-bnav-item:hover,
.mh-bnav-item:active {
  color: var(--mh-primary);
}

/* ====== 回到顶部 ====== */
.mh-back-top {
  position: fixed;
  right: 16px;
  bottom: 80px;
  width: 40px;
  height: 40px;
  background: var(--mh-card);
  border: 1px solid var(--mh-border);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--mh-text2);
  cursor: pointer;
  box-shadow: var(--mh-shadow-lg);
  transition: all 0.3s;
  z-index: 999;
}

.mh-back-top:hover {
  background: var(--mh-primary);
  color: #fff;
  border-color: var(--mh-primary);
}

/* ====== 分类弹窗 ====== */
.mh-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.mh-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mh-cat-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 70vh;
  background: var(--mh-card);
  border-radius: 16px 16px 0 0;
  z-index: 1600;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mh-cat-panel.open {
  transform: translateY(0);
}

.mh-cat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--mh-border);
  position: sticky;
  top: 0;
  background: var(--mh-card);
}

.mh-cat-panel-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.mh-cat-panel-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #9CA3AF;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.mh-cat-panel-body {
  padding: 16px 20px 32px;
}

.mh-cat-group {
  margin-bottom: 20px;
}

.mh-cat-group-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--mh-text);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--mh-primary);
  display: inline-block;
}

.mh-cat-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mh-cat-group-items a {
  padding: 6px 14px;
  background: var(--mh-bg);
  color: var(--mh-text2);
  border-radius: 20px;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid var(--mh-border);
  transition: all 0.2s;
}

.mh-cat-group-items a:hover,
.mh-cat-group-items a:active {
  background: var(--mh-primary);
  color: #fff;
  border-color: var(--mh-primary);
}

/* ====== 响应式 - 最新发布4列网格 ====== */
@media (max-width: 768px) {
  .mh-latest-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .mh-hot-card {
    width: 200px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .mh-latest-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .mh-hot-card {
    width: 220px;
  }
}

@media (min-width: 1025px) {
  .mh-latest-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }

  .mh-nav-grid-inner {
    grid-template-columns: repeat(8, 1fr);
  }

  .mh-bottom-nav {
    display: none;
  }

  .mh-bottom-spacer {
    height: 20px;
  }

  .mh-back-top {
    bottom: 40px;
  }

  .mh-hot-card {
    width: 220px;
  }
}