/* ============================================================
   精衡称重设备官网 — 样式表
   主色：蓝 #2a32e3 / 辅色：活力橙 #fe7809
   ============================================================ */

/* ---------- CSS 变量 ---------- */
:root {
  --color-primary: #2a32e3;
  --color-primary-dark: #181d9e;
  --color-primary-light: #5f65f0;
  --color-accent: #fe7809;
  --color-accent-hover: #d46200;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f7fa;
  --color-bg-dark: #12155a;
  --color-border: #e0e4e8;
  --color-white: #ffffff;
  --font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  --max-width: 1200px;
  --header-height: 70px;
  --transition-speed: 0.3s;
  --radius: 8px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  padding-top: var(--header-height);
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Section 通用 ---------- */
.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  position: relative;
  display: inline-block;
  padding-bottom: 15px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
}

.section-subtitle {
  margin-top: 15px;
  font-size: 1.05rem;
  color: var(--color-text-light);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   导航栏
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: box-shadow var(--transition-speed);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  line-height: 1;
}

.logo-icon img {
  height: 48px;
  width: auto;
  display: block;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 1px;
}

.logo-en {
  font-size: 0.75rem;
  color: var(--color-text-light);
  font-weight: 400;
  display: block;
  line-height: 1;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-menu a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  padding: 6px 0;
  position: relative;
  transition: color var(--transition-speed);
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition-speed);
}

.nav-menu a:hover {
  color: var(--color-accent);
}

.nav-menu a:hover::after {
  width: 100%;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger-bar {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform var(--transition-speed), opacity var(--transition-speed);
}

.nav-toggle.active .hamburger-bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.nav-toggle.active .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .hamburger-bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* ============================================================
   轮播图
   ============================================================ */
.carousel-container {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  background: var(--color-primary-dark);
}

.carousel-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.carousel-slide.active {
  opacity: 1;
}

/* 图片不存在时的回退背景色 */
.carousel-slide {
  background-color: var(--color-primary-dark);
}

.carousel-slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(15, 38, 64, 0.75) 0%, rgba(26, 58, 92, 0.45) 100%);
}

/* 无文字时隐藏深色遮罩 */
.carousel-slide.no-overlay::before {
  display: none;
}

.carousel-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--color-white);
  padding: 0 20px;
  max-width: 800px;
}

.carousel-content h2 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.carousel-content p {
  font-size: 1.2rem;
  opacity: 0.9;
  line-height: 1.8;
}

/* 箭头 */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-white);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-speed);
  backdrop-filter: blur(4px);
}

.carousel-arrow:hover {
  background: rgba(255, 255, 255, 0.3);
}

.carousel-prev {
  left: 20px;
}

.carousel-next {
  right: 20px;
}

/* 指示点 */
.carousel-dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 10px;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.carousel-dot.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: scale(1.15);
}

/* ============================================================
   产品中心
   ============================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.product-card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.product-image {
  height: 220px;
  min-height: 220px;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-size: 0.9rem;
  overflow: hidden;
}

/* 图片加载失败时显示产品名称 */
.product-image.image-fallback::after {
  content: attr(data-label);
  color: #94a3b8;
  font-size: 1.1rem;
  font-weight: 600;
}

.product-image .img-placeholder {
  font-size: 3rem;
  color: var(--color-primary-light);
  opacity: 0.3;
}

.product-info {
  padding: 24px;
}

.product-info h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.product-info > p {
  font-size: 0.92rem;
  color: var(--color-text-light);
  line-height: 1.7;
  margin-bottom: 14px;
}

.product-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-features li {
  font-size: 0.82rem;
  color: var(--color-primary-light);
  background: rgba(26, 58, 92, 0.08);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ============================================================
   行业解决方案
   ============================================================ */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.solution-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  border: 1px solid var(--color-border);
}

.solution-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

/* 有背景图的卡片 */
.solution-card.has-bg {
  position: relative;
  background-size: cover;
  background-position: center;
  color: #fff;
  border-color: transparent;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.solution-card.has-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 38, 64, 0.65);
  border-radius: inherit;
  z-index: 0;
}

.solution-card.has-bg .solution-icon,
.solution-card.has-bg h3,
.solution-card.has-bg p {
  position: relative;
  z-index: 1;
  color: #fff;
}

.solution-icon {
  font-size: 2.8rem;
  margin-bottom: 16px;
  display: block;
}

.solution-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.solution-card p {
  font-size: 0.88rem;
  color: var(--color-text-light);
  line-height: 1.7;
}

/* ============================================================
   关于我们
   ============================================================ */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: start;
}

.about-text p {
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.8;
  margin-bottom: 16px;
  text-indent: 2em;
}

.about-mission {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 30px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.about-mission .mission-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  line-height: 1.7;
}
.about-mission .mission-item + .mission-item {
  margin-top: 12px;
}
.about-mission .mission-icon {
  flex-shrink: 0;
}
.about-mission .mission-item strong {
  color: var(--color-accent);
  flex-shrink: 0;
}

.about-sidebar h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 14px;
}

.values-list {
  list-style: none;
  margin-bottom: 28px;
}

.values-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
  color: var(--color-text);
}

.values-list li strong {
  color: var(--color-accent);
  margin-right: 6px;
}

.honors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.honors-list li {
  font-size: 0.82rem;
  color: var(--color-primary-light);
  background: rgba(26, 58, 92, 0.06);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(26, 58, 92, 0.12);
}

/* ============================================================
   关于我们 — 宣传视频
   ============================================================ */
.about-video {
  margin-bottom: 50px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.about-video video {
  display: block;
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  background: #000;
}

/* ============================================================
   荣誉证书轮播（中间大两边小）
   ============================================================ */
.certificates-section {
  margin-top: 60px;
  text-align: center;
}

.cert-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 30px;
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}
.cert-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--color-accent);
}

.cert-carousel {
  position: relative;
  overflow: hidden;
  padding: 30px 0;
}

/* 左右箭头 */
.cert-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-primary);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: all 0.25s;
}
.cert-arrow:hover {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.cert-prev { left: 0; }
.cert-next { right: 0; }

.cert-track {
  position: relative;
  height: 360px;
}

/* 五层位置映射 — absolute 精确定位 */
.cert-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200px;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translate(-50%, -50%) scale(0.3);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.cert-card.cert-center {
  transform: translate(-50%, -50%) scale(1.05);
  opacity: 1;
  z-index: 5;
  pointer-events: auto;
  visibility: visible;
}

.cert-card.cert-left {
  transform: translate(calc(-50% - 180px), -50%) scale(0.78);
  opacity: 0.7;
  z-index: 3;
  pointer-events: auto;
  visibility: visible;
}

.cert-card.cert-right {
  transform: translate(calc(-50% + 180px), -50%) scale(0.78);
  opacity: 0.7;
  z-index: 3;
  pointer-events: auto;
  visibility: visible;
}

.cert-card.cert-far-left {
  transform: translate(calc(-50% - 320px), -50%) scale(0.55);
  opacity: 0.35;
  z-index: 1;
  visibility: visible;
}

.cert-card.cert-far-right {
  transform: translate(calc(-50% + 320px), -50%) scale(0.55);
  opacity: 0.35;
  z-index: 1;
  visibility: visible;
}

.cert-card.cert-hidden {
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cert-img-wrap {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.cert-name {
  display: block;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--color-text-light);
}

.cert-dots {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.cert-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 0.3s;
}

.cert-dot.active {
  background: var(--color-accent);
}

/* ============================================================
   底部脚栏
   ============================================================ */
#footer {
  background: var(--color-bg-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--color-white);
}

.footer-brand .logo-en {
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.65);
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 18px;
  position: relative;
  padding-bottom: 10px;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--color-accent);
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--transition-speed);
}

.footer-col ul li a:hover {
  color: var(--color-accent);
}

.footer-col .contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.6);
}

.footer-col .contact-item i {
  color: var(--color-accent);
  width: 16px;
  margin-top: 4px;
}

.footer-col .contact-item .icp-link {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-col .contact-item .icp-link:hover {
  color: var(--color-accent);
}

/* 二维码悬浮弹窗 */
.footer-col .contact-item.qr-item {
  position: relative;
  cursor: pointer;
}
.footer-col .contact-item.qr-item .qr-popup {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 150px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  padding: 8px;
  margin-bottom: 10px;
  z-index: 100;
}
.footer-col .contact-item.qr-item:hover .qr-popup {
  display: block;
}

.footer-bottom {
  text-align: center;
  padding: 20px 0;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ============================================================
   回到顶部
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-speed);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--color-accent-hover);
  transform: translateY(-3px);
}

/* ============================================================
   响应式设计
   ============================================================ */

/* 平板：≤1024px */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .solutions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .carousel-container {
    height: 400px;
  }

  .carousel-content h2 {
    font-size: 2.2rem;
  }
}

/* 手机：≤768px */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .section {
    padding: 50px 0;
  }

  .section-title {
    font-size: 1.6rem;
  }

  /* 导航 hamburger */
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    gap: 0;
    padding: 0;
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed);
  }

  .nav-menu.active {
    max-height: 400px;
  }

  .nav-menu a {
    display: block;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    width: 100%;
  }

  .nav-menu a::after {
    display: none;
  }

  /* 轮播 */
  .carousel-container {
    height: 320px;
  }

  .carousel-content h2 {
    font-size: 1.6rem;
  }

  .carousel-content p {
    font-size: 0.95rem;
  }

  .carousel-arrow {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .carousel-prev {
    left: 10px;
  }

  .carousel-next {
    right: 10px;
  }

  /* 产品 / 方案 */
  .product-grid {
    grid-template-columns: 1fr;
  }

  .solutions-grid {
    grid-template-columns: 1fr;
  }

  /* 关于 */
  .about-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  /* 页脚 */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  /* 证书轮播 */
  .cert-card {
    width: 140px;
  }
  .cert-card.cert-center {
    transform: translate(-50%, -50%) scale(1);
  }
  .cert-card.cert-left {
    transform: translate(calc(-50% - 120px), -50%) scale(0.72);
  }
  .cert-card.cert-right {
    transform: translate(calc(-50% + 120px), -50%) scale(0.72);
  }
  .cert-card.cert-far-left {
    transform: translate(calc(-50% - 210px), -50%) scale(0.5);
  }
  .cert-card.cert-far-right {
    transform: translate(calc(-50% + 210px), -50%) scale(0.5);
  }
}

/* 小手机：≤480px */
@media (max-width: 480px) {
  .carousel-container {
    height: 260px;
  }

  .carousel-content h2 {
    font-size: 1.3rem;
  }

  .carousel-content p {
    font-size: 0.85rem;
  }
}

/* 图片加载成功后隐藏占位 */
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

/* ============================================================
   加载状态
   ============================================================ */
.loading-mask {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-light);
}

.loading-mask .spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-mask p {
  font-size: 0.95rem;
}
