/* 全局变量和基础样式 */
:root {
  --glass: #ffffff;
  --muted: #6b7280;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: #f8fafc;
  color: #0f172a;
  scroll-behavior: smooth;
}

/* 导航栏和 Hero 部分的样式 */

.hero-gradient {
  background: linear-gradient(90deg, #0ea5e9 0%, #3b82f6 50%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge {
  background: #eef2ff;
  color: #065fcb;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
}

/* 卡片样式 */

.card {
  background: var(--glass);
  border: 1px solid #eef2f7;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

/* 代码和动画样式 */

pre {
  background: #0b1220;
  color: #e6f0ff;
  padding: 16px;
  border-radius: 8px;
  overflow: auto;
}

.animate-slide-in {
  animation: slide-in 0.8s ease-out;
}

@keyframes slide-in {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 表格样式 (最终修正) ===== */
table {
  /* 确保边框合并，消除边框间距 */
  border-collapse: collapse;
  /* 移除表格整体的外边框 */
  border: none;
}

table th,
table td {
  /* 内部单元格边框 */
  border: 1px solid #e5e7eb;
  padding: 12px;
  text-align: left;
}

table thead th {
  /* 表头背景和颜色 */
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
}

table tbody tr:hover {
  background: #f1f5f9;
}

.scroll-x {
  overflow-x: auto;
}

/* 自定义 Swiper 箭头样式 */
.swiper-button-next,
.swiper-button-prev {
  color: #3b82f6; /* 蓝色，更贴合品牌色 */
  width: 2rem;
  height: 2rem;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  background-color: #3b82f6;
  color: white;
}

.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 1.25rem;
  font-weight: bold;
}

/* ===== 移动端适配增强 ===== */

/* 让卡片与容器在小屏幕上有更紧凑的间距 */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  header .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* 针对 Tailwind CSS 默认的 padding 进行覆盖，使其更紧凑 */
  section {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  .card {
    padding: 18px;
  }

  h1 {
    font-size: 1.875rem; /* text-3xl */
    line-height: 1.3;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.125rem;
  }

  /* 让 hero 部分改为单列 */
  /* 使用更强的选择器覆盖 Tailwind 的 lg:grid-cols-2 */
  .grid.lg\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  /* Swiper 图片保持等比缩放 */
  .swiper-container img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  /* 按钮垂直堆叠 */
  .mt-8.flex.flex-col.sm\:flex-row {
    flex-direction: column !important;
  }

  /* 表格横向滚动提示 */
  .scroll-x::after {
    content: "← 左右滑动查看 →";
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 6px;
  }

  /* 页脚栅格改为单列 */
  footer .grid {
    grid-template-columns: 1fr !important;
  }

  footer .flex {
    justify-content: flex-start;
  }

  /* 调整微信二维码弹出在视口内显示 */
  footer .group:hover .group-hover\:opacity-100 {
    left: 50%;
    transform: translateX(-50%);
  }

  /* 优化导航栏：隐藏原桌面菜单，添加汉堡按钮 */
  nav.md\:flex {
    display: none !important;
  }

  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    color: #0f172a;
    background: white;
  }

  .mobile-nav {
    display: none;
    flex-direction: column;
    background: white;
    border-top: 1px solid #e5e7eb;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 50;
  }

  .mobile-nav a {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
  }

  .mobile-nav.active {
    display: flex;
  }
}

/* 小屏幕 Swiper 箭头更小更靠内 */
@media (max-width: 640px) {
  .swiper-button-next,
  .swiper-button-prev {
    width: 1.75rem;
    height: 1.75rem;
  }

  .swiper-button-next::after,
  .swiper-button-prev::after {
    font-size: 1rem;
  }
}