/* 基础重置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Microsoft YaHei", sans-serif;
  color: #333;
  line-height: 1.7;
  background: #fff;
}

a {
  color: inherit;
}

/* 顶部导航栏 */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 86px;
  padding: 0.8rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

/* Logo 图片和公司名称 */
header .logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

header .logo img {
  display: block;
  width: auto;
  height: 54px;
  object-fit: contain;
}

header .logo span {
  color: #222;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

/* 桌面端导航水平居中 */
header nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav a {
  margin: 0;
  padding: 0.35rem 0;
  color: #333;
  font-size: 1rem;
  text-decoration: none;
}

nav a:hover,
nav a.active {
  color: #c62828;
  border-bottom: 2px solid #c62828;
}

/* 首页横幅 */
.hero {
  padding: 6rem 2rem;
  color: #fff;
  text-align: center;
  background: linear-gradient(135deg, #1f1f1f 0%, #3a3a3a 100%);
}

.hero h1 {
  margin-bottom: 1rem;
  font-size: 2.4rem;
  letter-spacing: 2px;
}

.hero p {
  color: #ddd;
  font-size: 1.1rem;
}

.btn {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.75rem 2.4rem;
  color: #fff;
  background: #c62828;
  border-radius: 4px;
  font-size: 1rem;
  text-decoration: none;
}

.btn:hover {
  background: #a71e1e;
}

/* 内容分区 */
section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-title {
  margin-bottom: 2.5rem;
  text-align: center;
}

.section-title h2 {
  display: inline-block;
  padding-bottom: 0.4rem;
  border-bottom: 3px solid #c62828;
  font-size: 1.7rem;
}

.section-title p {
  margin-top: 0.6rem;
  color: #888;
  font-size: 0.95rem;
}

.alt {
  max-width: none;
  background: #f7f7f7;
}

.alt > * {
  max-width: 1140px;
  margin-right: auto;
  margin-left: auto;
}

/* 产品卡片网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.card {
  position: relative;
  padding: 1.2rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  text-align: center;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

.card::before {
  position: absolute;
  right: 50%;
  bottom: -1px;
  left: 50%;
  height: 3px;
  border-radius: 0 0 8px 8px;
  background: #1e6fd9;
  content: "";
  transition: left 0.3s ease, right 0.3s ease;
}

.card img {
  width: 100%;
  height: 180px;
  margin-bottom: 0.8rem;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.card h3 {
  margin-bottom: 0.3rem;
  font-size: 1.05rem;
}

.card p {
  color: #666;
  font-size: 0.9rem;
}

/* 仅在支持鼠标的设备上启用产品卡片悬停效果 */
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    z-index: 5;
    border-color: #1e6fd9;
    background: rgba(30, 111, 217, 0.04);
    box-shadow: 0 8px 20px rgba(30, 111, 217, 0.18);
    transform: translateY(-4px);
    cursor: pointer;
  }

  .card:hover::before {
    right: -1px;
    left: -1px;
  }

  .card:hover img {
    transform: scale(1.08);
  }

  .grid.pumps .card:hover {
    transform: translateY(-4px) scale(1.04);
  }

  .card.wide:hover {
    transform: translateY(-4px);
  }
}

/* 隔膜真空泵：桌面端五列 */
.grid.pumps {
  grid-template-columns: repeat(5, 1fr);
}

.grid.pumps .card img {
  height: 150px;
}

.grid.pumps .card h3 {
  font-size: 0.95rem;
}

/* 仪器玻璃 */
.grid.glass {
  grid-template-columns: repeat(2, 1fr);
}

.card.wide {
  grid-column: 1 / -1;
}

.feature {
  display: flex;
  align-items: center;
  gap: 2rem;
  text-align: left;
}

.feature img {
  width: 50%;
  height: auto;
  max-height: 320px;
  margin-bottom: 0;
  object-fit: contain;
}

.feature div {
  flex: 1;
}

.feature h3 {
  margin-bottom: 0.6rem;
  font-size: 1.3rem;
}

/* 产品列表 */
ul.list {
  margin-top: 1.5rem;
  line-height: 2.1;
  list-style: none;
}

ul.list li::before {
  color: #c62828;
  font-size: 0.7rem;
  content: "■ ";
}

/* 联系页面通用样式 */
.contact-wrap {
  display: grid;
  max-width: 960px;
  margin: 0 auto;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.info-box {
  padding: 2rem;
  border-radius: 8px;
  background: #f7f7f7;
  font-size: 1.05rem;
}

.info-box p {
  margin-bottom: 1.2rem;
}

.info-box strong {
  display: inline-block;
  width: 4.5em;
  color: #c62828;
}

/* 联系信息里的公司 Logo，缩小到与文字同高 */
.info-box .company-name {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.info-box .company-name img {
  display: block;
  width: auto !important;
  height: 1em !important;
  max-width: 4em;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  vertical-align: middle;
}

/* 二维码区域 */
.qr-box {
  text-align: center;
}

.qr-box img {
  width: 100%;
  max-width: 360px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.qr-box p {
  margin-top: 0.8rem;
  color: #666;
}

/* 页脚 */
footer {
  padding: 1.5rem;
  color: #aaa;
  background: #222;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer {
  margin-top: 100px;
}

/* 联系页面横幅图片 */
.banner-img {
  display: block;
  width: 100%;
  max-width: 1200px;
  height: auto;
  margin: 0 auto 2.5rem;
}

/* 电脑端右下角悬浮联系卡片 */
.float-contact {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9;
  width: 170px;
  padding: 1.2rem 1rem 1rem;
  border: 1px solid #e5e7eb;
  border-top: 3px solid #c62828;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  text-align: center;
  transform-origin: right bottom;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* 悬停时卡片放大、阴影加强 */
.float-contact:hover {
  box-shadow: 0 10px 28px rgba(198, 40, 40, 0.25);
  transform: scale(1.06);
}

/* 悬停时“联系我们”标题变成红底白字 */
.float-contact:hover .float-title {
  padding: 0.3rem 0;
  border-radius: 4px;
  color: #fff;
  background: #c62828;
}

/* 按下时轻微缩小，提供点击反馈 */
.float-contact:active {
  transform: scale(0.97);
  transition-duration: 0.08s;
}

.float-contact img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
}

.float-contact .float-title {
  margin-top: 0.8rem;
  color: #c62828;
  font-size: 1rem;
  font-weight: bold;
  line-height: 1.4;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.float-contact .float-desc {
  margin-top: 0.2rem;
  color: #888;
  font-size: 0.8rem;
  line-height: 1.4;
}

.float-close {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: #999;
  font-size: 18px;
  line-height: 22px;
  cursor: pointer;
}

.float-close:hover {
  color: #c62828;
}

/* 二维码点击放大 */
.qr-zoom {
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

.qr-zoom:hover {
  opacity: 0.85;
}

.qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  cursor: zoom-out;
}

.qr-overlay.show {
  display: flex;
}

.qr-overlay img {
  width: min(80vmin, 480px);
  height: auto;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
}

/* 手机端底部联系按钮：默认隐藏 */
.mobile-contact {
  display: none;
}

/* 1279px 及以下隐藏悬浮卡片，显示底部按钮 */
@media (max-width: 1279px) {
  .float-contact {
    display: none;
  }

  .mobile-contact {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    z-index: 8;
    display: block;
    padding: 0.9rem 0;
    border-radius: 8px;
    color: #fff;
    background: #c62828;
    box-shadow: 0 6px 16px rgba(198, 40, 40, 0.35);
    text-align: center;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: bold;
  }

  .mobile-contact:active {
    background: #a71e1e;
  }

  footer {
    padding-bottom: 5rem;
  }
}

/* 1000px 及以下：泵产品改为三列 */
@media (max-width: 1000px) {
  .grid.pumps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 手机端布局 */
@media (max-width: 720px) {
  header {
    flex-direction: column;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem;
  }

  header .logo {
    justify-content: center;
  }

  header .logo img {
    height: 42px;
  }

  header .logo span {
    font-size: 1.3rem;
  }

  header nav {
    position: static;
    left: auto;
    transform: none;
    gap: 1.5rem;
  }

  .hero {
    padding: 3.5rem 1.2rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  section {
    padding: 2.5rem 1rem;
  }

  .grid.pumps {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid.pumps .card:last-child {
    grid-column: 1 / -1;
  }

  .grid.glass {
    grid-template-columns: 1fr;
  }

  .feature {
    flex-direction: column;
    text-align: center;
  }

  .feature img {
    width: 100%;
  }

  .contact-wrap {
    grid-template-columns: 1fr;
  }

  .site-footer {
    margin-top: 60px;
  }
}

/* 手机屏幕下适当缩小顶部公司名称 */
@media (max-width: 720px) {
  header .brand span {
    font-size: 1.2rem;
  }
}

/* 联系页面左右两栏等高，左侧信息垂直居中 */
.contact-wrap {
  align-items: stretch;
}

.contact-wrap .info-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 避免最后一行多出底部间距 */
.contact-wrap .info-box p:last-child {
  margin-bottom: 0;
}