/* ============================================================
   Megatex Blanket — 首页样式
   依据 PSD 精确尺寸：hero 454px / 统计带 / 8产品卡 / 伙伴滚动
   / 流程带(浅) / OEM三卡(371x370) / 询盘表单
   ============================================================ */

/* ---------- 1. Hero ---------- */
.hero {
  position: relative;
  min-height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* 无后台轮播图时的兜底背景 */
  background: url("../images/hero-bg.webp") center / cover no-repeat;
}
.hero-slides {
  position: absolute; inset: 0;
}
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero-slide.active { opacity: 1; }
.hero-slide img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
}
/* PSD 遮罩 #414141 渐变，保证白字可读 */
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(65,65,65,.30) 0%, rgba(65,65,65,.42) 55%, rgba(65,65,65,.58) 100%);
}
.hero-inner {
  position: relative; z-index: 1;
  text-align: center; padding: 96px 24px;
}
.hero-title {
  color: #fff;
  font-size: clamp(28px, 3.4vw, 48px);
  line-height: 1.25;
  letter-spacing: 3px;
  text-shadow: 0 2px 18px rgba(0,0,0,.25);
  animation: heroIn .8s ease both;
}
@keyframes heroIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* 磨砂玻璃按钮（PSD: rgba(255,255,255,.51) 白字） */
.hero-actions {
  margin-top: 44px;
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  animation: heroIn .8s .15s ease both;
}
.btn-hero {
  min-width: 178px; padding: 14px 32px;
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(255,255,255,.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 999px;
  color: #fff; font-weight: 600; font-size: 15px; letter-spacing: .5px;
  transition: background .2s, transform .2s;
}
.btn-hero:hover { background: rgba(255,255,255,.62); color: #fff; transform: translateY(-2px); }

/* ---------- 2. 统计 + 认证 ---------- */
.stats { padding: 58px 0 34px; }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 24px; text-align: center;
}
.stat img { width: auto; height: 62px; margin: 0 auto 14px; }
.stat-title { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.5; }

.stats-divider {
  height: 2px; border-radius: 2px; background: var(--ink);
  max-width: 1395px; margin: 36px auto 0;
}
.stats-tags {
  display: flex; justify-content: space-around; flex-wrap: wrap; gap: 12px;
  margin: 22px 0 30px;
  font-size: 15px; font-weight: 600; color: var(--ink);
}

.cert-list {
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: 48px; margin-bottom: 34px;
}
.cert-list img {
  width: auto;
  opacity: .72;
  transition: filter .25s, opacity .25s, transform .25s;
}
.cert-list li:hover img { filter: none; opacity: 1; transform: translateY(-2px); }

/* ---------- 3. 产品分类 ---------- */
.products { background: var(--surface); }
.prod-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 30px 28px;
}
.prod-card a { display: block; }
.prod-card .ph {
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 1 / 1; background: var(--bg);
}
.prod-card .ph img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .45s ease;
}
.prod-card:hover .ph img { transform: scale(1.06); }
.prod-card h3 {
  font-size: 16px; margin: 16px 0 8px; text-align: center;
  transition: color .2s;
}
.prod-card:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.prod-card p {
  font-size: 13px; color: #555; line-height: 1.55; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 4. 合作伙伴 marquee ---------- */
.partners { padding-bottom: 56px; background-color: #fff;}
.partners .section-head { margin-bottom: 30px; }
.marquee {
  overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex; width: max-content;
}
/* JS 确认单组宽度 ≥ 视口后才启动动画（数据少时先克隆补齐，避免"半截滚动"） */
.marquee.ready .marquee-track { animation: marquee 60s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group {
  display: flex; align-items: center; gap: 56px; padding-right: 56px;
}
.marquee-group img {
  width: auto; opacity: .7;
  transition: opacity .25s;
}
.marquee-group img:hover { opacity: 1; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 5. 合作流程（浅色带） ---------- */
.process { background: var(--bg); padding: 64px 0; }
.process-flow {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 0; max-width: 980px; margin: 0 auto;
}
.process-flow li {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  text-align: center; position: relative;
}
.process-flow li + li::before {
  content: ""; position: absolute; left: calc(-50% + 56px); right: calc(50% + 56px);
  top: 44px; height: 2px; border-radius: 2px; background: var(--ink);
}
.process-flow img { height: 72px; width: auto; margin-bottom: 20px; }
.process-flow span {
  font-size: 14px; font-weight: 700; letter-spacing: 2px; color: var(--ink);
}

/* ---------- 6. OEM/实力区块（3 等宽卡片：照片背景 + 深色遮罩 + 白字） ---------- */
.oem { background: var(--surface); }
.oem-grid {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.oem-card {
  position: relative; overflow: hidden;
  border-radius: 14px;
  background: var(--bg);
  aspect-ratio: 1 / 1;
}
.oem-card > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform .5s ease;
}
.oem-card:hover > img { transform: scale(1.04); }
/* 底部深色渐变遮罩：保证白字在任意照片上可读 */
.oem-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(31,29,25,.18) 0%, rgba(31,29,25,.65) 100%);
  pointer-events: none;
}
.oem-body {
  position: absolute; left: 0; right: 0; top: 50%; z-index: 1;
  transform: translateY(-50%);
  padding: 0 24px; color: #fff;
}
.oem-body h3 {
  color: #fff; font-size: 28px; line-height: 1.15; font-weight: 700;
  letter-spacing: .2px; text-shadow: 0 1px 12px rgba(0,0,0,.3);
}
.oem-body p {
  font-size: 13px; color: rgba(255,255,255,.85); line-height: 1.55;
  margin-top: 12px;
  text-shadow: 0 1px 8px rgba(0,0,0,.3);
}
.oem-body a {
  display: inline-block; margin-top: 16px;
  color: #fff; font-size: 13px; font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,.6); padding-bottom: 2px;
  text-shadow: 0 1px 8px rgba(0,0,0,.3);
}
.oem-body a:hover { border-bottom-color: #fff; }

/* ---------- 响应式（OEM） ---------- */
@media (max-width: 900px) {
  .oem-grid { grid-template-columns: 1fr; gap: 16px; }
  .oem-card { aspect-ratio: 16 / 9; }
  .oem-body { padding: 0 20px; }
  .oem-body h3 { font-size: 22px; }
}
@media (max-width: 640px) {
  .oem-body h3 { font-size: 18px; }
  .oem-body p { font-size: 12px; }
}

/* ---------- 7. 询盘 CTA + 表单 ---------- */
.inquiry { background: var(--surface); }
.inquiry-title {
  font-size: clamp(22px, 2.2vw, 30px); text-align: center; line-height: 1.5;
}
.inquiry-btn { display: table; margin: 28px auto 40px; }
.inquiry-form {
  display: grid; grid-template-columns: 1fr 1fr 2fr 1fr;
  gap: 18px; align-items: end;
}
.field label {
  display: block; font-size: 13px; font-weight: 600; color: var(--ink);
  margin-bottom: 8px;
}
.field input {
  width: 100%; height: 46px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  font: inherit; outline: none; background: #fff;
  transition: border-color .2s;
}
.field input:focus { border-color: var(--ink); }
.captcha-inline { display: flex; gap: 10px; align-items: center; }
.captcha-inline input { flex: 1; min-width: 0; }
.captcha-inline img { border-radius: 6px; cursor: pointer; flex-shrink: 0; height: 44px; }
.form-submit { grid-column: 4; display: flex; justify-content: flex-end; padding-bottom: 2px; }
.form-submit button {
  background: none; border: none; padding: 0;
  color: var(--ink); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: opacity .2s;
  white-space: nowrap;
}
.form-submit button:hover { opacity: .6; }

/* ---------- 滚动入场动画 ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .prod-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 992px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
  .inquiry-form { grid-template-columns: 1fr 1fr; }
  .field-wide { grid-column: 1 / -1; }
  .form-submit { grid-column: 1 / -1; justify-content: flex-end; }
  .process-flow { flex-wrap: wrap; gap: 28px 12px; }
  .process-flow li { flex: 1 1 30%; }
  .process-flow li + li::before { display: none; }
}
@media (max-width: 640px) {
  .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
  .prod-card p { font-size: 12px; }
  .cert-list { gap: 18px; }
  .cert-list img { height: 40px; }
  .inquiry-form { grid-template-columns: 1fr; }
  .hero-actions .btn-hero { min-width: 150px; }
}

/* 减少动效偏好（marquee 动画仅 .ready 时启动，JS 在此偏好下不添加 ready） */
@media (prefers-reduced-motion: reduce) {
  .hero-title, .hero-actions { animation: none; }
  .marquee-track { flex-wrap: wrap; width: auto; justify-content: center; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
