/* ====== 全局基础 ====== */
html, body { margin:0; padding:0; }
body {
  font-family: Arial, sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

h1, h2, h3 {
  margin: 20px 0 10px;
  font-weight: bold;
  color: #2c3e50;
}

p { margin: 0 0 15px; font-size: 15px; }

/* ====== 顶部容器（导航样式放在 nav.css） ====== */
header{
  background: transparent;     /* 渐变背景已放在 .nav-bar */
  padding: 0;
  display: block;
}

/* ====== 轮播图 (首页用) ====== */
/* 轮播容器 */
section.carousel{ padding:0; }
.carousel{
  position:relative;
  width:100%;
  overflow:hidden;             /* 关键：裁掉溢出 */
  aspect-ratio:16/9;
  background:#000;
}

/* 轨道 */
.slider{
  display:flex;
  gap:0;                       /* 关键：不要缝隙 */
  transition:transform .6s ease-in-out;
  will-change:transform;
  transform:translate3d(0,0,0);/* 降低子像素误差 */
}

/* 每屏 */
.slide{
  flex:0 0 calc(100% + 2px);
  margin-right: -2px;
  overflow: hidden;
  min-width:100%;
  box-sizing:border-box;
}

/* 图片填充 */
.slide img{
  width:100%;
  height:100%;                 /* 必须 100% */
  display:block;
  object-fit:cover;
  object-position:center;
}

/* 切换按钮建议绝对定位，避免挤出缝隙 */
.nav-btn{ position:absolute; top:50%; transform:translateY(-50%); z-index:2; }
.prev { left: 10px; }
.next { right: 10px; }

/* 指示点 */
.dots{
  position:absolute; bottom:10px; left:50%;
  transform:translateX(-50%);
  display:flex; gap:8px;
}
.dot{ width:12px; height:12px; border-radius:50%; background:#bbb; border:none; cursor:pointer; }
.dot.active{ background:#333; }

/* 手机：轮播全宽；桌面：居中并限制最大宽 */
@media (min-width: 992px){
  section.carousel{
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 8px;
  }
}

/* ====== 首页 Hero 区域 ====== */
.hero{ background:#ecf0f1; padding:60px 20px; }
.hero h1{ font-size:28px; margin-bottom:10px; }
.hero p{ font-size:16px; }

/* ====== About 页面 ====== */
.about{ background:#fff; }
.about p{ max-width:900px; margin:auto; font-size:15px; }

/* ====== Products 页面 ====== */
.products{ background:#f9f9f9; }
.product-card{
  background:#fff;
  border:1px solid #ddd;
  padding:20px;
  margin:15px;
  display:inline-block;
  vertical-align:top;
  width:280px;
  box-shadow:0 2px 5px rgba(0,0,0,0.1);
}
.product-card img{
  width:100%; height:180px; object-fit:cover; margin-bottom:10px;
}
.product-card h3{ font-size:18px; margin:10px 0; }
.product-card p{ font-size:14px; color:#555; }

/* ====== Contact 页面 ====== */
.contact{ background:#fff; }
.contact-info{
  max-width:700px; margin:auto; text-align:left;
  font-size:15px; line-height:1.8;
}
.contact-info a{ color:#2c3e50; text-decoration:none; }
.contact-info a:hover{ text-decoration:underline; }

/* ====== 页脚 ====== */
footer{
  background:#2c3e50;
  color:#fff;
  text-align:center;
  padding:20px;
  font-size:14px;
}
/* ---- 全局：杜绝横向溢出（手机优先） ---- */
html, body { overflow-x: hidden; }

/* 一些元素默认按内容撑宽，统一收口 */
*, *::before, *::after { box-sizing: border-box; }
img, video { max-width: 100%; height: auto; display: block; }

/* 顶栏容器绝不超过屏幕 */
.nav-bar, .nav-inner { width: 100% !important; }

/* 轮播相关，避免子像素/负外边距导致溢出 */

/* 下拉菜单的阴影与定位不参与页面宽度计算 */
.has-dropdown .dropdown{
  position: absolute;
  right: 0; left: auto;       /* 避免两侧同时定位撑宽 */
  max-width: 92vw;            /* 兜底：再大也不超过视口 */
  overflow: visible;
}

/* LOGO 放大但不撑宽，且允许溢出显示，不参与页面宽度 */
.brand{
  overflow: visible !important;
}
.brand img{
  max-width: 100%;
  height: auto;
  transform: none;            /* 如果用了 transform:scale 导致被裁，可以先关掉 */
}
/* ===== 生产线通栏大图 ===== */
.line-hero {
  max-width: 1200px;
  margin: 0 auto 20px;
  padding: 0 16px;
}
.line-hero.fullbleed {
  max-width: none;
  padding: 0;
}
.line-hero img {
  width: 100%;
  display: block;
  object-fit: cover;
  /* 如果想更“横向海报感”，解除下一行注释并设置一个比例 */
  /* aspect-ratio: 21 / 9; */
}

/* ===== 生产线说明 ===== */
.line-info {
  max-width: 1200px;
  margin: 0 auto 24px;
  padding: 0 16px;
  text-align: left;
}
.line-info h2 { margin: 8px 0 10px; }
.line-info p { margin: 0 0 8px; }
.line-info .specs {
  margin: 8px 0 0;
  padding-left: 20px;
}

/* ===== 成品卡片栅格（与单机设备统一） ===== */
.products.products--grid {
  max-width: 1200px;
  margin: 28px auto 60px;
  padding: 0 16px;
}
.products.products--grid > h3 {
  margin: 0 0 16px;
}
.products.products--grid .cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.product-card {
  background: #fff;
  border: 1px solid #e6e8eb;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,.10);
}
.product-card .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f6f7fb;
}
.product-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-card .body {
  padding: 14px 16px 16px;
}
.product-card .body h3 {
  margin: 0 0 6px;
  font-size: 18px;
}
.product-card .body p {
  margin: 0;
  color: #586174;
  font-size: 14px;
  line-height: 1.6;
}

/* 响应式：平板两列，手机一列 */
@media (max-width: 992px){
  .products.products--grid .cards { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 600px){
  .products.products--grid .cards { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 768px){
  .slide img {
    display:block;
    width:100%;
    height:100%;
    object-fit:cover;
    backface-visibility:hidden;
    -webkit-backface-visibility:hidden;
    transform:translateZ(0);   /* 强制 GPU 重绘 */
  }
}