/* ===== 移动端响应式修复 v4 ===== */

/* --- 全局溢出防护 --- */
@media (max-width: 768px) {
  html, body, #root {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  .min-w-\[700px\],
  .min-w-\[800px\],
  .min-w-\[200px\],
  .min-w-\[150px\] {
    min-width: 100% !important;
  }
  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
  }
}

/* --- 轮播图 Hero 修复 --- */
@media (max-width: 768px) {
  .h-\[400px\] {
    height: 340px !important;
  }
  .h-\[500px\] {
    height: 380px !important;
  }
  /* 轮播内容 padding */
  .h-\[400px\] .p-8,
  .h-\[500px\] .p-8,
  .min-h-\[400px\] .p-8,
  .min-h-\[500px\] .p-8 {
    padding: 1rem 1.25rem !important;
  }
}

/* --- "最近更新" 横条修复 --- */
@media (max-width: 768px) {
  /* 最近更新栏整体：缩小字号，紧凑排列 */
  .shadow-sm.border.border-gray-100 .flex.items-center {
    font-size: 0.8rem !important;
    gap: 0.375rem !important;
    flex-wrap: nowrap !important;
  }
  /* 闪电图标 + "最近更新：" 不断行 */
  .shadow-sm.border.border-gray-100 .flex.items-center .font-semibold {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  .shadow-sm.border.border-gray-100 .flex.items-center .text-blue-600 {
    white-space: nowrap !important;
    font-size: 0.75rem !important;
  }
}

/* --- 标题字号 --- */
@media (max-width: 768px) {
  .text-4xl {
    font-size: 1.5rem !important;
    line-height: 2rem !important;
  }
  .text-3xl {
    font-size: 1.25rem !important;
    line-height: 1.75rem !important;
  }
  .text-2xl {
    font-size: 1.125rem !important;
    line-height: 1.5rem !important;
  }
}

/* --- 布局与间距 --- */
@media (max-width: 768px) {
  .lg\:pl-64,
  .lg\:pl-16 {
    padding-left: 0 !important;
  }
  .px-10 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  .py-16 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  .py-24 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }
  .p-8 {
    padding: 0.875rem !important;
  }
  .p-6 {
    padding: 0.75rem !important;
  }
  .gap-6 {
    gap: 0.75rem !important;
  }
  .gap-8 {
    gap: 1rem !important;
  }
  .max-w-7xl,
  .max-w-6xl,
  .max-w-4xl,
  .max-w-3xl {
    max-width: 100% !important;
  }
}

/* --- Grid 布局：保持 2 列 --- */
@media (max-width: 768px) {
  .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .md\:grid-cols-3,
  .md\:grid-cols-4,
  .md\:grid-cols-5,
  .md\:grid-cols-6,
  .lg\:grid-cols-3,
  .lg\:grid-cols-4,
  .lg\:grid-cols-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* --- "平台数据" 统计区域：强制 2 列 --- */
@media (max-width: 768px) {
  .gradient-bg .grid,
  .gradient-bg .space-y-4,
  .bg-gradient-to-br .grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
  }
  .gradient-bg .space-y-4 > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
  .gradient-bg {
    padding: 1.25rem 0.75rem !important;
  }
}

/* --- 卡片样式 --- */
@media (max-width: 768px) {
  .rounded-2xl {
    border-radius: 0.75rem !important;
  }
  .rounded-3xl {
    border-radius: 1rem !important;
  }
  .shadow-xl {
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08) !important;
  }
  .shadow-2xl {
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.1) !important;
  }
}

/* --- 内容导航树缩进 --- */
@media (max-width: 768px) {
  .ms-10, .ms-11, .ms-12 {
    margin-inline-start: 1.5rem !important;
  }
  .ms-8, .ms-9 {
    margin-inline-start: 1rem !important;
  }
  .ms-6, .ms-7 {
    margin-inline-start: 0.75rem !important;
  }
}

/* --- Footer --- */
@media (max-width: 768px) {
  footer {
    margin-top: 2rem !important;
  }
  footer .text-sm {
    font-size: 0.75rem !important;
  }
  footer .gap-4 {
    gap: 0.5rem !important;
  }
}

/* --- 固定宽度自适应 --- */
@media (max-width: 768px) {
  .w-64, .w-56 {
    width: 100% !important;
  }
}
