/* ============================================================
   宁波博誉科技有限公司 — 全站公共样式（科技感设计体系）
   ============================================================ */
:root {
  --brand-primary: #2563eb;
  --brand-cyan: #06b6d4;
  --brand-purple: #7c3aed;
  --brand-dark: #0a1628;
  --brand-dark-2: #0f2547;
  --brand-light: #f4f8fd;
  --grad-main: linear-gradient(120deg, #2563eb, #06b6d4);
  --grad-hero: linear-gradient(135deg, #0a1628 0%, #0f2547 50%, #123a6b 100%);
}

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

::selection { background: rgba(37, 99, 235, .2); }

/* ---------- 文字渐变 ---------- */
.text-gradient {
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- 导航（玻璃拟态 + 磁吸指示条 + 滚动压实） ---------- */
.navbar {
  background: rgba(255, 255, 255, .82) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(15, 37, 71, .06), 0 8px 30px rgba(15, 37, 71, .06);
  padding-top: .9rem;
  padding-bottom: .9rem;
  transition: padding .3s ease, box-shadow .3s ease, background .3s ease;
}
body.nav-scrolled .navbar {
  padding-top: .45rem;
  padding-bottom: .45rem;
  background: rgba(255, 255, 255, .92) !important;
  box-shadow: 0 1px 0 rgba(15, 37, 71, .06), 0 10px 34px rgba(15, 37, 71, .16);
}
.navbar-brand { font-weight: 800; font-size: 1.2rem; letter-spacing: .02em; }
.navbar-brand img { transition: transform .3s ease; }
body.nav-scrolled .navbar-brand img { transform: scale(.88); }
.navbar-nav { position: relative; }
.navbar-nav .nav-link {
  font-weight: 500;
  position: relative;
  margin: 0 2px;
  transition: color .25s, transform .25s;
}
.navbar-nav .nav-link:hover {
  color: var(--brand-primary);
  transform: translateY(-1px);
}
.navbar-nav .nav-link.active {
  font-weight: 700;
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* 磁吸跟随指示条（位置由 js/navbar-fx.js 驱动） */
#navIndicator {
  position: absolute;
  left: 0; bottom: 0;
  width: 40px; height: 3px;
  border-radius: 3px;
  background: var(--grad-main);
  box-shadow: 0 0 10px rgba(37, 99, 235, .65);
  opacity: 0;
  transition:
    transform .35s cubic-bezier(.34, 1.3, .64, 1),
    width .35s cubic-bezier(.34, 1.3, .64, 1),
    opacity .25s;
  pointer-events: none;
}
/* 移动端折叠菜单降级：隐藏指示条，仅保留 hover 变色 */
@media (max-width: 991.98px) {
  #navIndicator { display: none; }
  .navbar-nav .nav-link:hover { transform: none; }
}

/* ---------- Banner 轮播 ---------- */
.carousel-item {
  height: 520px;
  background: var(--brand-dark);
}
.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) brightness(.85);
}
.carousel-item::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 22, 40, .55) 0%, rgba(10, 22, 40, .15) 45%, rgba(10, 22, 40, .65) 100%);
}
.carousel-caption { bottom: 7rem; }
.carousel-caption h2 {
  font-weight: 800;
  letter-spacing: .03em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .45);
}
.carousel-caption p { opacity: .85; }
.carousel-indicators [data-bs-target] {
  width: 28px; height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .5);
}
.carousel-indicators .active { background: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--grad-hero);
  color: #fff;
  padding: 100px 0;
  overflow: hidden;
}
/* 网格纹理 */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(96, 165, 250, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, .07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
/* 发光光斑 */
.hero::after {
  content: "";
  position: absolute;
  width: 560px; height: 560px;
  right: -160px; top: -220px;
  background: radial-gradient(circle, rgba(6, 182, 212, .22), transparent 65%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 2; }
.hero h1 {
  letter-spacing: .02em;
  background: linear-gradient(120deg, #60a5fa, #22d3ee, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .lead { color: rgba(226, 238, 253, .8); }
.hero .btn-light {
  background: linear-gradient(120deg, #2563eb, #06b6d4);
  border: none;
  box-shadow: 0 10px 30px rgba(37, 99, 235, .4);
}
.hero .btn-light:hover { filter: brightness(1.1); }

/* ---------- 区块通用 ---------- */
.section { padding: 90px 0; }
.section-title { text-align: center; margin-bottom: 56px; }
.section-title h2 {
  font-weight: 800;
  letter-spacing: .02em;
  margin-bottom: 14px;
}
.section-title h2 span { color: transparent; }
.section-title p { color: #64748b; }
.section-title::after {
  content: "";
  display: block;
  width: 56px; height: 4px;
  margin: 18px auto 0;
  border-radius: 4px;
  background: var(--grad-main);
}

/* ---------- 产品卡片 ---------- */
.product-card {
  position: relative;
  border-radius: 14px;
  transition: transform .3s, box-shadow .3s;
  height: 100%;
  overflow: hidden;
}
.product-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-main);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s;
}
.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(37, 99, 235, .16);
}
.product-card:hover::before { transform: scaleX(1); }
.product-card .card-body { padding: 28px 24px; }
.product-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px; height: 58px;
  font-size: 1.6rem;
  color: var(--brand-primary);
  background: linear-gradient(135deg, rgba(37, 99, 235, .1), rgba(6, 182, 212, .12));
  border-radius: 14px;
  transition: .3s;
}
.product-card:hover .product-icon {
  color: #fff;
  background: var(--grad-main);
  box-shadow: 0 8px 20px rgba(37, 99, 235, .35);
}
.product-icon-img {
  display: block;
  width: 58px; height: 58px;
  border-radius: 14px;
  transition: .3s;
}
.product-card:hover .product-icon-img {
  box-shadow: 0 8px 20px rgba(37, 99, 235, .35);
  transform: translateY(-2px);
}
.product-card h5 { font-weight: 700; }
.product-card p { font-size: .92rem; }

/* ---------- 服务区 ---------- */
.service-item {
  text-align: center;
  padding: 30px 18px;
  border-radius: 14px;
  transition: .3s;
}
.service-item:hover { background: #fff; box-shadow: 0 14px 34px rgba(15, 37, 71, .08); }
.service-item i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  font-size: 1.7rem;
  color: var(--brand-cyan);
  background: linear-gradient(135deg, rgba(37, 99, 235, .1), rgba(6, 182, 212, .14));
  border-radius: 50%;
}

/* ---------- 关于我们 数字卡 ---------- */
.about-stat {
  border: 1px solid #e6eefb;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  transition: .3s;
}
.about-stat:hover {
  border-color: transparent;
  box-shadow: 0 14px 34px rgba(37, 99, 235, .14);
}
.about-stat .display-6 {
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- 留言 ---------- */
.contact-section {
  position: relative;
  background:
    radial-gradient(circle at 10% 20%, rgba(37, 99, 235, .07), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, .07), transparent 40%),
    var(--brand-light);
}
.contact-section form {
  border-radius: 16px !important;
  border: 1px solid rgba(37, 99, 235, .08);
}
.form-control:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
#contactForm .btn-primary {
  background: var(--grad-main);
  border: none;
  box-shadow: 0 10px 26px rgba(37, 99, 235, .35);
}

/* ---------- 页脚 ---------- */
footer {
  position: relative;
  background: var(--brand-dark);
  color: rgba(255, 255, 255, .72);
}
footer h5, footer h6 { color: #fff; font-weight: 700; }
footer a { color: rgba(255, 255, 255, .72); text-decoration: none; transition: color .2s; }
footer a:hover { color: #22d3ee; }

/* ---------- 底部版权条 ---------- */
.footer-copyright {
  margin-top: 44px;
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: .82rem;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .5);
}
.footer-copyright i { color: rgba(255, 255, 255, .38); margin-right: 4px; }
.footer-copyright a {
  color: rgba(255, 255, 255, .5);
  text-decoration: none;
  transition: color .2s;
}
.footer-copyright a:hover { color: #22d3ee; }
.footer-copyright .divider {
  display: inline-block;
  width: 1px; height: 12px;
  margin: 0 12px;
  background: rgba(255, 255, 255, .18);
  vertical-align: -1px;
}
/* 简单版页脚（子页面）：压缩与内容的间距 */
footer.footer-simple { padding-top: 26px; }
footer.footer-simple .footer-copyright { margin-top: 0; }

/* ---------- 图片查看弹层（lightbox） ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(10, 22, 40, .85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 94vw;
  max-height: 86vh;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
  animation: lbIn .25s ease;
}
@keyframes lbIn {
  from { opacity: 0; transform: scale(.95); }
}
.lightbox-close {
  position: absolute;
  top: 18px; right: 24px;
  width: 42px; height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, .26);
  transform: rotate(90deg);
}
.lightbox-caption {
  position: absolute;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* ---------- 子页面占位 ---------- */
.page-placeholder {
  min-height: 62vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 90px 16px;
  background:
    radial-gradient(circle at 20% 30%, rgba(37, 99, 235, .06), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(6, 182, 212, .06), transparent 45%);
}
.page-placeholder .display-6 { font-weight: 800; }
.page-placeholder .product-icon { width: 76px; height: 76px; font-size: 2.1rem; }

/* ---------- 顶部滚动进度条 ---------- */
#scrollProgress {
  position: fixed;
  top: 0; left: 0;
  width: 0;
  height: 3px;
  background: var(--grad-main);
  box-shadow: 0 0 12px rgba(37, 99, 235, .8);
  z-index: 2000;
  pointer-events: none;
}

/* ---------- 滚动动效（多方向渐入 + 错峰） ---------- */
@media (prefers-reduced-motion: no-preference) {
  .fade-up, .fade-left, .fade-right, .zoom-in {
    opacity: 0;
    transition:
      opacity .8s cubic-bezier(.22, .61, .36, 1),
      transform .8s cubic-bezier(.22, .61, .36, 1);
    transition-delay: var(--d, 0s);
    will-change: opacity, transform;
  }
  .fade-up { transform: translateY(36px); }
  .fade-left { transform: translateX(-42px); }
  .fade-right { transform: translateX(42px); }
  .zoom-in { transform: scale(.9); }
  .fade-up.visible,
  .fade-left.visible,
  .fade-right.visible,
  .zoom-in.visible {
    opacity: 1;
    transform: none;
  }

  /* 区块标题逐层揭示 */
  .section-title h2,
  .section-title p {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .7s ease, transform .7s ease;
  }
  .section-title p { transition-delay: .12s; }
  .section-title::after {
    transform: scaleX(0);
    transition: transform .6s cubic-bezier(.22, .61, .36, 1) .3s;
  }
  .section-title.visible h2,
  .section-title.visible p {
    opacity: 1;
    transform: none;
  }
  .section-title.visible::after { transform: scaleX(1); }
}

/* ---- 回到顶部按钮 ---- */
#backTop {
  position: fixed;
  right: 24px;
  bottom: 30px;
  z-index: 1080;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
}
#backTop.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#backTop:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(37, 99, 235, .45);
}
@media (prefers-reduced-motion: reduce) {
  #backTop { transition: none; }
}
