/* ============================================================
   东莞卡尔文自动设备有限公司 — 共享样式
   ============================================================ */

:root {
  --brand-blue: #0B4F9E;
  --brand-blue-dark: #073A75;
  --brand-blue-light: #E8F1FB;
  --brand-accent: #FF6B1A;
  --text-dark: #1A1F2B;
  --text-gray: #5A6473;
  --border: #E3E8EF;
}

html { scroll-behavior: smooth; }

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text-dark);
  line-height: 1.75;
  background: #fff;
}

/* —— 通用容器 —— */
.container-x {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}
.container-x > * { min-width: 0; }

/* —— 导航栏 —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-link {
  position: relative;
  padding: 6px 0;
  color: var(--text-dark);
  font-weight: 500;
  transition: color .2s;
}
.nav-link:hover { color: var(--brand-blue); }
.nav-link.active { color: var(--brand-blue); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 3px;
  background: var(--brand-blue);
}

/* —— 按钮 —— */
.btn-primary {
  display: inline-block;
  padding: 13px 32px;
  background: var(--brand-blue);
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  transition: all .22s;
}
.btn-primary:hover {
  background: var(--brand-blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(11, 79, 158, .25);
}

.btn-outline {
  display: inline-block;
  padding: 13px 32px;
  border: 2px solid var(--brand-blue);
  color: var(--brand-blue);
  border-radius: 6px;
  font-weight: 600;
  transition: all .22s;
}
.btn-outline:hover {
  background: var(--brand-blue);
  color: #fff;
}

/* —— 区块标题 —— */
.section-tag {
  display: inline-block;
  color: var(--brand-blue);
  font-weight: 700;
  letter-spacing: .12em;
  font-size: 13px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
}
@media (max-width: 768px) { .section-title { font-size: 26px; } }

.section-sub {
  color: var(--text-gray);
  font-size: 16px;
  max-width: 720px;
}

/* —— 卡片 —— */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  transition: all .25s;
}
.card:hover {
  border-color: var(--brand-blue);
  box-shadow: 0 10px 34px rgba(11, 79, 158, .10);
  transform: translateY(-4px);
}

/* —— 页头 banner —— */
.page-hero {
  background: linear-gradient(135deg, var(--brand-blue-dark), var(--brand-blue) 60%, #1670CC);
  color: #fff;
  padding: 72px 0 64px;
}
.page-hero h1 { font-size: 38px; font-weight: 800; margin-bottom: 14px; }
@media (max-width: 768px) { .page-hero h1 { font-size: 28px; } }

/* —— 页脚 —— */
.site-footer {
  background: #0E1520;
  color: #9BA6B5;
  padding: 56px 0 28px;
  font-size: 14.5px;
}
.site-footer h4 {
  color: #fff;
  font-weight: 700;
  margin-bottom: 16px;
  font-size: 15px;
}
.site-footer a { color: #9BA6B5; transition: color .2s; }
.site-footer a:hover { color: #fff; }

/* ============================================================
   首页 · 首屏产品轮播（动态 UI）
   ============================================================ */
.hero-slider {
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* ---------- 首屏搜索 ---------- */
.hero-search-box {
  display: flex;
  align-items: center;
  position: relative;
  background: rgba(255, 255, 255, .96);
  border-radius: 12px;
  padding: 5px 5px 5px 46px;
  box-shadow: 0 10px 30px rgba(3, 20, 45, .25);
  transition: box-shadow .25s, transform .25s;
}
.hero-search-box:focus-within {
  box-shadow: 0 14px 38px rgba(3, 20, 45, .38), 0 0 0 3px rgba(255, 179, 122, .55);
  transform: translateY(-1px);
}
.hero-search-icon {
  position: absolute;
  left: 16px;
  width: 19px; height: 19px;
  color: #8A94A6;
  pointer-events: none;
}
.hero-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15.5px;
  color: #1A1F2B;
  padding: 12px 6px;
  font-family: inherit;
}
.hero-search-input::placeholder { color: #9AA3B2; }
.hero-search-input::-webkit-search-cancel-button { display: none; }
.hero-search-btn {
  flex-shrink: 0;
  background: #FF6B1A;
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 11px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
  font-family: inherit;
}
.hero-search-btn:hover { background: #E85D0E; }

.hero-hot-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.hero-hot-label { font-size: 13px; color: rgba(255, 255, 255, .65); }
.hero-hot-tag {
  font-size: 13px;
  color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .25);
  padding: 3.5px 13px;
  border-radius: 20px;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.hero-hot-tag:hover {
  background: #FF6B1A;
  border-color: #FF6B1A;
  color: #fff;
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .hero-search-box { padding-left: 42px; }
  .hero-search-input { font-size: 14.5px; }
  .hero-search-btn { padding: 10px 18px; font-size: 14px; }
}

.hero-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.hero-track {
  display: flex;
  width: 100%;
  transition: transform .55s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}

.hero-slide {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 16px 18px;
  color: #fff;
}
.hero-slide .hs-link {
  color: inherit;
  text-decoration: none;
  display: block;
}
.hero-slide img {
  width: 100%;
  height: 178px;
  object-fit: contain;
  background: rgba(255, 255, 255, .96);
  border-radius: 10px;
  padding: 8px;
  transition: transform .4s cubic-bezier(.34, 1.4, .64, 1);
}
.hero-slide:hover img { transform: scale(1.05); }

/* 产品文字：可单独点击，悬停变橙 + 下划线 */
.hero-slide .hs-name {
  margin-top: 14px;
  font-size: 15.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.5;
  transition: color .22s;
  cursor: pointer;
}
.hero-slide .hs-name:hover {
  color: #FFB37A;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.hero-slide .hs-meta {
  margin-top: 6px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .65);
  letter-spacing: .04em;
}
.hero-slide .hs-cta {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #FFB37A;
  opacity: 0;
  transform: translateY(6px);
  transition: all .3s;
  cursor: pointer;
}
.hero-slide .hs-cta:hover { text-decoration: underline; text-underline-offset: 3px; }
.hero-slide:hover .hs-cta { opacity: 1; transform: translateY(0); }

/* 左右箭头 */
.hero-arrow {
  position: absolute;
  top: 44%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .22s;
  z-index: 3;
  padding-bottom: 3px;
}
.hero-arrow:hover { background: rgba(255, 255, 255, .34); }
.hero-arrow-prev { left: 6px; }
.hero-arrow-next { right: 6px; }

/* 圆点 */
.hero-dots .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .32);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all .28s;
}
.hero-dots .dot.active {
  width: 22px;
  border-radius: 4px;
  background: #FFB37A;
}

/* ============================================================
   首页 · 产品中心卡片动效
   ============================================================ */
.product-card {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

/* 图片区渐变遮罩 + 缩放 */
.product-card .card-img {
  transition: transform .5s cubic-bezier(.34, 1.25, .64, 1);
}
.product-card:hover .card-img { transform: scale(1.08); }

/* 卡片浮起（覆盖 .card:hover 的默认值，更强） */
.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 44px rgba(11, 79, 158, .16);
  border-color: var(--brand-blue);
}

/* 左上角"查看详情"角标 */
.product-card::after {
  content: "查看详情 →";
  position: absolute;
  top: 14px; right: 14px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--brand-blue);
  padding: 5px 12px;
  border-radius: 20px;
  opacity: 0;
  transform: translateY(-8px);
  transition: all .3s;
  pointer-events: none;
  z-index: 2;
}
.product-card:hover::after { opacity: 1; transform: translateY(0); }

/* CTA 卡（蓝色那张）不要角标 */
.product-card-cta::after { display: none; }
.product-card-cta:hover {
  box-shadow: 0 18px 44px rgba(11, 79, 158, .34);
  transform: translateY(-8px);
}

/* 滚动淡入：默认可见，仅在 JS 就绪时（html.js-ready）才做初始隐藏 */
html.js-ready .product-card {
  opacity: 0;
  transform: translateY(22px);
}
html.js-ready .product-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.product-card {
  transition: opacity .6s ease, transform .6s ease,
              box-shadow .25s ease, border-color .25s ease;
}

/* 鼠标悬停时暂停位移过渡冲突：悬停优先级更高 */
.product-card:hover {
  transform: translateY(-8px) !important;
}

/* 键盘无障碍 */
.product-card:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 3px;
}

/* 深色底(CTA卡)里正文可读性 */
.product-card-cta { text-decoration: none; }

@media (max-width: 768px) {
  .hero-slide img { height: 150px; }
  .hero-arrow { width: 30px; height: 30px; font-size: 18px; }
}
