/* ============================================================
 * 子站响应式样式 responsive.css
 * 移动优先：手机(<768px) → 平板(768~1024px) → 电脑(>1024px)
 * 与 base.html 内联样式互补，不破坏既有视觉
 * ============================================================ */

/* ---- 全局自适应字号（rem/clamp）---- */
html {
  /* 1rem 在手机 16px，平板以上随视口放大 */
  font-size: clamp(15px, 4vw, 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-size: 1rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ---- 图片响应式 ---- */
img,
picture,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---- 容器自适应内边距 ---- */
.container {
  padding-left: 16px;
  padding-right: 16px;
}

/* ---- 头部 + 汉堡菜单（移动折叠）---- */
.header .container {
  position: relative;
  flex-wrap: wrap;
  gap: 12px;
}

.logo {
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  flex: 1 1 auto;
  min-width: 0;
}

/* 汉堡按钮：默认隐藏，手机端显示 */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  background: #1a73e8;
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  align-self: center;
  -webkit-appearance: none;
  appearance: none;
}

.nav-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* 导航触屏目标 ≥44px */
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 1rem;
}

/* ============================================================
 * 手机端：单列、汉堡菜单折叠
 * ============================================================ */
@media (max-width: 767.98px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* 导航默认折叠 */
  .nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
    order: 3;
    margin-top: 4px;
    background: #fff;
    border-top: 1px solid #e8e8e8;
  }

  /* 展开时显示 */
  .nav.is-open {
    display: flex;
  }

  .nav a {
    display: block;
    width: 100%;
    padding: 12px 8px;
    border-bottom: 1px solid #f0f0f0;
    min-height: 44px;
    line-height: 1.6;
  }

  .banner {
    padding: 32px 0;
  }
  .banner h1 {
    font-size: clamp(1.25rem, 5vw, 1.6rem);
    margin-bottom: 8px;
  }
  .banner p {
    font-size: 0.95rem;
  }

  .section {
    padding: 24px 0;
  }
  .section-title {
    font-size: clamp(1.15rem, 4vw, 1.4rem);
    margin-bottom: 16px;
  }

  /* 卡片单列 */
  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .card img {
    height: 160px;
  }

  /* 文章/产品详情内边距收缩 */
  .article-content {
    padding: 18px;
  }
  .article-content h1 {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
    margin-bottom: 12px;
  }
  .article-content h2 {
    font-size: 1.15rem;
    margin: 18px 0 10px;
  }

  /* 联系卡片 */
  .contact-card {
    padding: 22px;
    max-width: 100%;
  }
  .phone-display {
    font-size: clamp(1.5rem, 6vw, 1.8rem);
  }
  .btn-call {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 12px;
    text-align: center;
  }

  .footer {
    padding: 24px 0 12px;
  }
  .footer-info {
    flex-direction: column;
    gap: 12px;
  }

  /* 表格响应式：横向滚动或重排 */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.95rem;
  }

  /* 表单响应式 */
  form {
    width: 100%;
  }
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="search"],
  input[type="url"],
  input[type="number"],
  input[type="password"],
  textarea,
  select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
  }
  button,
  input[type="submit"],
  .btn,
  .btn-call {
    min-height: 44px;
    font-size: 1rem;
  }

  /* 分页触摸区 */
  .pagination a,
  .pagination span,
  a[class*="page"] {
    min-width: 44px;
    min-height: 44px;
    padding: 10px 14px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* 面包屑 */
  .breadcrumb {
    padding: 8px 0;
    font-size: 0.85rem;
    word-break: break-all;
  }
}

/* ============================================================
 * 平板：768~1024px 双列
 * ============================================================ */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
  .banner h1 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
  }
  .section-title {
    font-size: 1.4rem;
  }
  .nav a {
    padding: 8px 14px;
  }
  .footer-info {
    flex-wrap: wrap;
  }
}

/* ============================================================
 * 电脑：>1024px 多列/原始布局
 * ============================================================ */
@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }
  .banner h1 {
    font-size: 2rem;
  }
  .section-title {
    font-size: 1.5rem;
  }
}

/* ---- 减少动画偏好 ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- 打印优化 ---- */
@media print {
  .nav,
  .nav-toggle,
  .banner,
  .btn-call {
    display: none !important;
  }
  body {
    color: #000;
    background: #fff;
  }
}
