/* ============================================================
   镇江和韵电子科技有限公司 - 官网首页样式
   简约商务风格 / Bootstrap 5 + CSS3
   ============================================================ */

/* SECTION: variables */
:root {
  --brand: #1565c0;
  --brand-dark: #0d47a1;
  --brand-deep: #0a2e5c;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e9f0;
  --bg-light: #f5f7fa;
  --bg-dark: #0f1b2d;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(15, 27, 45, .08);
  --shadow-lg: 0 16px 40px rgba(15, 27, 45, .16);
  --nav-h: 72px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 8px); }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  overflow-x: hidden;
}

img { max-width: 100%; }
a { text-decoration: none; }

/* SECTION: scroll-progress */
#scrollProgress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--brand), #42a5f5);
  z-index: 1090; transition: width .1s linear;
}

/* SECTION: topbar */
.topbar {
  background: var(--brand-deep); color: rgba(255,255,255,.85);
  font-size: 13px; padding: 7px 0;
}
.topbar a { color: rgba(255,255,255,.85); }
.topbar a:hover { color: #fff; }
.topbar .bi { color: #64b5f6; margin-right: 5px; }

/* SECTION: navbar */
.navbar {
  height: var(--nav-h);
  background: #fff;
  transition: box-shadow .3s ease;
  z-index: 1080;
}
.navbar.scrolled { box-shadow: 0 4px 18px rgba(15,27,45,.1); }
.navbar-brand img { height: 60px; width: auto; }
.navbar .nav-link {
  color: var(--ink); font-size: 16px; font-weight: 500;
  margin: 0 6px; padding: 8px 14px !important;
  position: relative; transition: color .25s;
}
.navbar .nav-link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2px; background: var(--brand); border-radius: 2px;
  transform: scaleX(0); transition: transform .25s ease;
}
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--brand); }
.navbar .nav-link:hover::after, .navbar .nav-link.active::after { transform: scaleX(1); }
.nav-cta {
  background: var(--brand); color: #fff !important; border-radius: 6px;
  padding: 9px 20px !important; margin-left: 10px;
}
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--brand-dark); }

/* SECTION: hero-carousel */
.hero .carousel-item {
  height: min(86vh, 720px);
  min-height: 520px;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.12);
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(8,25,50,.82) 0%, rgba(8,25,50,.55) 45%, rgba(8,25,50,.18) 100%);
}
/* 背景与文字分离进场：背景缓慢推近淡入 */
.carousel-item.active .hero-bg { animation: heroBgIn 6.5s ease-out forwards; }
@keyframes heroBgIn {
  from { opacity: 0; transform: scale(1.12); }
  20%  { opacity: 1; }
  to   { opacity: 1; transform: scale(1); }
}
/* 文字元素错落淡入上浮 */
.hero .anim { opacity: 0; }
.carousel-item.active .anim {
  animation: fadeUp .9s cubic-bezier(.22,.61,.36,1) both;
  animation-delay: var(--d, 0s);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* 主体产品卡片侧向滑入 + 悬浮 */
.hero-visual .anim-visual { opacity: 0; }
.carousel-item.active .anim-visual {
  animation: slideLeft 1s cubic-bezier(.22,.61,.36,1) .45s both,
             floatY 5s ease-in-out 1.6s infinite;
}
@keyframes slideLeft {
  from { opacity: 0; transform: translateX(70px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes floatY {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-14px); }
}
.hero-tag {
  display: inline-block; color: #90caf9; font-size: 15px; letter-spacing: 4px;
  border-left: 3px solid var(--brand); padding-left: 12px; margin-bottom: 18px;
}
.hero-title {
  color: #fff; font-size: clamp(30px, 4.6vw, 56px); font-weight: 700;
  letter-spacing: 2px; line-height: 1.2; margin-bottom: 16px;
  text-shadow: 0 4px 20px rgba(0,0,0,.35);
}
.hero-sub {
  color: #ffd54f; font-size: clamp(17px, 2vw, 24px); font-weight: 600;
  letter-spacing: 3px; margin-bottom: 18px;
}
.hero-desc {
  color: rgba(255,255,255,.85); font-size: 16px; line-height: 1.9;
  max-width: 560px; margin-bottom: 30px;
}
.hero-btns .btn { margin-right: 14px; padding: 11px 30px; font-size: 16px; border-radius: 6px; }
.btn-hero { background: var(--brand); border: 1px solid var(--brand); color: #fff; }
.btn-hero:hover { background: var(--brand-dark); color: #fff; transform: translateY(-2px); }
.btn-hero-line { border: 1px solid rgba(255,255,255,.7); color: #fff; background: transparent; }
.btn-hero-line:hover { background: rgba(255,255,255,.14); color: #fff; }
.hero-card {
  background: rgba(255,255,255,.96); border-radius: 14px; padding: 26px;
  box-shadow: var(--shadow-lg); text-align: center;
}
.hero-card img { width: 100%; height: 260px; object-fit: contain; }
.hero-card .cap { color: var(--muted); font-size: 14px; margin-top: 12px; letter-spacing: 2px; }
.hero .carousel-indicators [data-bs-target] {
  width: 34px; height: 4px; border-radius: 2px; border: 0;
  background: rgba(255,255,255,.45); opacity: 1;
}
.hero .carousel-indicators .active { background: #ffd54f; }
.hero .carousel-control-prev, .hero .carousel-control-next { width: 6%; opacity: 0; transition: opacity .3s; }
.hero:hover .carousel-control-prev, .hero:hover .carousel-control-next { opacity: .8; }

/* SECTION: section-head */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-light); }
.section-head { text-align: center; margin-bottom: 52px; }
.section-head .en {
  color: var(--brand); font-size: 14px; letter-spacing: 5px;
  text-transform: uppercase; font-weight: 600;
}
.section-head h2 {
  font-size: clamp(26px, 3vw, 36px); font-weight: 700; color: var(--ink);
  margin: 10px 0 14px; letter-spacing: 2px;
}
.section-head .divider {
  width: 56px; height: 3px; background: var(--brand);
  margin: 0 auto 16px; border-radius: 2px; position: relative;
}
.section-head .divider::before, .section-head .divider::after {
  content: ""; position: absolute; top: 0; height: 3px; border-radius: 2px;
  background: #bbdefb; width: 18px;
}
.section-head .divider::before { left: -26px; }
.section-head .divider::after { right: -26px; }
.section-head p { color: var(--muted); max-width: 680px; margin: 0 auto; }

/* SECTION: reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* SECTION: products */
.filter-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 40px; }
.filter-btn {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 30px; padding: 8px 24px; font-size: 15px;
  transition: all .25s ease; cursor: pointer;
}
.filter-btn:hover { color: var(--brand); border-color: var(--brand); }
.filter-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(21,101,192,.3); }
.p-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); height: 100%; display: flex; flex-direction: column;
  transition: transform .3s ease, box-shadow .3s ease;
}
.p-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.p-card .p-img { position: relative; overflow: hidden; background: #fff; aspect-ratio: 4 / 3; }
.p-card .p-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.p-card:hover .p-img img { transform: scale(1.07); }
.p-card .p-tag {
  position: absolute; top: 12px; left: 12px;
  background: rgba(13,71,161,.88); color: #fff; font-size: 12px;
  padding: 3px 12px; border-radius: 3px; letter-spacing: 1px;
}
.p-card .p-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.p-card .p-name { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.p-card .p-link {
  margin-top: auto; color: var(--brand); font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
}
.p-card .p-link .bi { transition: transform .25s; }
.p-card:hover .p-link .bi { transform: translateX(4px); }
.p-card.hide { display: none; }
.p-more { text-align: center; margin-top: 44px; }
.btn-brand { background: var(--brand); color: #fff; border-radius: 6px; padding: 11px 36px; }
.btn-brand:hover { background: var(--brand-dark); color: #fff; }
.btn-line { border: 1px solid var(--brand); color: var(--brand); border-radius: 6px; padding: 11px 36px; background: transparent; }
.btn-line:hover { background: var(--brand); color: #fff; }

/* SECTION: stats */
.stats-band { background: linear-gradient(120deg, var(--brand-deep), var(--brand)); padding: 52px 0; }
.stat-item { text-align: center; color: #fff; }
.stat-item .num { font-size: clamp(30px, 3.6vw, 44px); font-weight: 700; letter-spacing: 1px; }
.stat-item .num small { font-size: .5em; font-weight: 600; margin-left: 2px; }
.stat-item .label { color: rgba(255,255,255,.8); font-size: 15px; margin-top: 6px; letter-spacing: 2px; }

/* SECTION: about */
.about-text p { color: var(--muted); line-height: 2; margin-bottom: 16px; text-align: justify; }
.about-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: #e3f2fd; color: var(--brand-dark); font-size: 14px;
  border-radius: 30px; padding: 7px 18px; margin: 0 8px 10px 0;
}
.adv-card {
  background: #fff; border-radius: var(--radius); padding: 30px 24px;
  box-shadow: var(--shadow); height: 100%; text-align: center;
  border-top: 3px solid transparent; transition: all .3s ease;
}
.adv-card:hover { transform: translateY(-6px); border-top-color: var(--brand); box-shadow: var(--shadow-lg); }
.adv-card .icon {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%;
  background: #e3f2fd; color: var(--brand); font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  transition: all .3s ease;
}
.adv-card:hover .icon { background: var(--brand); color: #fff; }
.adv-card h5 { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.adv-card p { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 0; }
.factory-card { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.factory-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .6s ease; }
.factory-card:hover img { transform: scale(1.08); }
.factory-card .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(10,46,92,.85));
  color: #fff; padding: 34px 18px 14px; font-size: 16px; letter-spacing: 3px;
  display: flex; align-items: center; gap: 8px;
}

/* SECTION: honor */
.cert-card {
  background: #fff; border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); cursor: zoom-in; height: 100%;
  transition: transform .3s ease, box-shadow .3s ease;
}
.cert-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.cert-card .cert-img {
  background: var(--bg-light); border-radius: 6px; padding: 14px;
  display: flex; align-items: center; justify-content: center; height: 250px;
}
.cert-card .cert-img img { max-height: 100%; max-width: 100%; object-fit: contain; }
.cert-card .cap { text-align: center; padding-top: 14px; font-size: 16px; font-weight: 600; color: var(--ink); }
.cert-card .cap .bi { color: var(--brand); margin-right: 6px; }

/* SECTION: news */
.news-feature {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 34px; height: 100%; display: flex; flex-direction: column;
  border-left: 4px solid var(--brand);
}
.news-feature .date { color: var(--brand); font-size: 14px; letter-spacing: 1px; margin-bottom: 12px; }
.news-feature h4 { font-size: 21px; font-weight: 700; color: var(--ink); margin-bottom: 14px; line-height: 1.5; }
.news-feature p { color: var(--muted); line-height: 2; margin-bottom: 20px; }
.news-feature .more { margin-top: auto; }
.news-list { list-style: none; padding: 0; margin: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.news-list li a {
  display: flex; align-items: center; gap: 14px; padding: 17px 24px;
  border-bottom: 1px dashed var(--line); color: var(--ink); font-size: 15px;
  transition: all .25s ease;
}
.news-list li:last-child a { border-bottom: 0; }
.news-list li a:hover { background: #f0f7ff; color: var(--brand); padding-left: 30px; }
.news-list .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex: 0 0 auto; }
.news-list .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-list .d { color: var(--muted); font-size: 13px; flex: 0 0 auto; }
.tech-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px; height: 100%; transition: transform .3s ease;
}
.tech-card:hover { transform: translateY(-6px); }
.tech-card .head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tech-card .head .bi { font-size: 26px; color: var(--brand); }
.tech-card h5 { font-size: 17px; font-weight: 600; margin: 0; }
.tech-card p { color: var(--muted); font-size: 14px; line-height: 1.9; margin: 0; }

/* SECTION: faq */
.accordion-item { border: 1px solid var(--line); border-radius: var(--radius) !important; margin-bottom: 14px; overflow: hidden; }
.accordion-button {
  font-size: 16px; font-weight: 600; color: var(--ink); padding: 18px 24px; background: #fff;
}
.accordion-button:not(.collapsed) { color: var(--brand); background: #f0f7ff; box-shadow: none; }
.accordion-button:focus { box-shadow: none; border-color: var(--line); }
.accordion-body { color: var(--muted); line-height: 2; font-size: 15px; padding: 20px 24px; }

/* SECTION: footer */
.footer { background: var(--bg-dark); color: rgba(255,255,255,.72); padding-top: 64px; font-size: 14px; }
.footer h5 { color: #fff; font-size: 17px; margin-bottom: 22px; letter-spacing: 2px; position: relative; padding-bottom: 12px; }
.footer h5::after { content: ""; position: absolute; left: 0; bottom: 0; width: 32px; height: 2px; background: var(--brand); }
.footer p { line-height: 2; }
.footer a { color: rgba(255,255,255,.72); transition: color .25s; }
.footer a:hover { color: #64b5f6; }
.footer .f-links li { margin-bottom: 10px; }
.footer .f-links .bi { color: var(--brand); margin-right: 8px; font-size: 12px; }
.footer .contact-line { display: flex; gap: 10px; margin-bottom: 12px; line-height: 1.7; }
.footer .contact-line .bi { color: #64b5f6; flex: 0 0 auto; margin-top: 3px; }
.footer .contact-line strong { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 48px; padding: 20px 0; font-size: 13px; text-align: center; color: rgba(255,255,255,.5); }

/* SECTION: side-widgets */
.side-bar {
  position: fixed; right: 18px; bottom: 120px; z-index: 1050;
  display: flex; flex-direction: column; gap: 10px;
}
.side-bar .side-item {
  width: 48px; height: 48px; border-radius: 8px; background: #fff;
  box-shadow: var(--shadow); color: var(--brand); font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: all .25s ease; cursor: pointer;
}
.side-bar .side-item:hover { background: var(--brand); color: #fff; }
.side-bar .tip {
  position: absolute; right: 58px; top: 50%; transform: translateY(-50%) translateX(8px);
  background: var(--brand-deep); color: #fff; font-size: 13px;
  padding: 7px 14px; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: all .25s ease;
}
.side-bar .side-item:hover .tip { opacity: 1; transform: translateY(-50%) translateX(0); }
#backTop { opacity: 0; pointer-events: none; }
#backTop.show { opacity: 1; pointer-events: auto; }

/* SECTION: lightbox-modal */
.modal-cert .modal-content { background: transparent; border: 0; }
.modal-cert .modal-body { text-align: center; padding: 10px; }
.modal-cert .modal-body img { max-height: 78vh; border-radius: 6px; background: #fff; padding: 12px; }
.modal-cert .modal-title { color: #fff; font-size: 16px; letter-spacing: 2px; }
.modal-cert .btn-close { filter: invert(1); position: absolute; top: -2px; right: 0; }

/* SECTION: responsive */
@media (max-width: 991.98px) {
  .navbar { height: auto; padding: 12px 0; }
  .navbar-collapse { background: #fff; border-radius: 8px; padding: 10px 16px; margin-top: 10px; box-shadow: var(--shadow); }
  .hero .carousel-item { height: 62vh; min-height: 460px; }
  .hero-visual { margin-top: 30px; }
  .hero-card img { height: 180px; }
  .section { padding: 64px 0; }
  .topbar .d-none-wrap { display: none; }
}
@media (max-width: 575.98px) {
  .hero-title { letter-spacing: 1px; }
  .hero-btns .btn { margin-bottom: 10px; padding: 10px 24px; }
  .side-bar { right: 10px; bottom: 90px; }
}
