/* 智赛精密装备官网首页样式 — 色板源自 Logo：主色 #1625A2 / 深色区 #101C7A */

:root {
  --primary: #1625A2;
  --primary-dark: #101C7A;
  --primary-light: #E9EBF9;
  --ink: #14181F;
  --text: #3A4354;
  --text-sub: #5B6472;
  --line: #E6EAF1;
  --bg-soft: #F5F7FA;
  --footer-text: #B9BFF2;
  --footer-dim: #8F96D9;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 72px; }  /* 锚点定位预留悬浮导航高度 */
body {
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-block; border-radius: 6px; font-weight: 600; transition: all .2s; text-align: center; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #1F31C4; }
.btn-outline { border: 1px solid var(--primary); color: var(--primary); background: #fff; }
.btn-outline:hover { background: var(--primary-light); }
.btn-lg { padding: 14px 32px; font-size: 15px; }

/* ---------- 导航 ---------- */
.navbar { background: #fff; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 0 var(--line); }
.navbar .container { max-width: 1360px; }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo { height: 48px; width: auto; object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: 10px; }
.nav-links > a { position: relative; font-size: 17px; color: var(--text); white-space: nowrap; padding: 6px 12px; border-radius: 4px; }
.nav-links > a:hover { background: var(--primary); color: #fff; font-weight: 600; }
.nav-links > a.active { color: var(--ink); font-weight: 600; }
/* 业务项 + 下拉菜单 */
.nav-item { position: relative; }
.nav-item > a { position: relative; font-size: 17px; color: var(--text); white-space: nowrap; padding: 20px 12px; }
.nav-item > a:hover { background: var(--primary); color: #fff; font-weight: 600; }
.nav-item .dropdown {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(8px);
  min-width: 200px; background: #fff; border-top: 3px solid var(--primary);
  border-radius: 0 0 8px 8px; box-shadow: 0 14px 30px rgba(13,26,51,.14);
  padding: 8px 0; opacity: 0; visibility: hidden; transition: all .22s ease; z-index: 90;
}
.nav-item:hover .dropdown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-item .dropdown a { display: block; padding: 10px 18px; font-size: 15px; color: var(--text); white-space: nowrap; text-align: center; }
.site-toast { position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%) translateY(12px); z-index: 999; background: rgba(17,17,17,.88); color: #fff; font-size: 14px; padding: 10px 22px; border-radius: 22px; opacity: 0; pointer-events: none; transition: all .25s ease; white-space: nowrap; }
.site-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.nav-item .dropdown a:hover { background: var(--primary); color: #fff; font-weight: 600; }
.nav-cta { padding: 10px 22px; font-size: 14px; flex-shrink: 0; }
.nav-toggle { display: none; background: none; border: none; width: 36px; height: 36px; flex-direction: column; justify-content: center; gap: 5px; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, #FFFFFF 0%, #E8EBFA 100%); }
.hero-inner { display: flex; align-items: center; gap: 60px; padding-top: 38px; padding-bottom: 46px; }
.hero-copy { flex: 1 1 0; min-width: 0; }
.hero-title { font-size: 52px; line-height: 1.3; font-weight: 800; letter-spacing: 1px; color: var(--primary); }
.hero-title .t2 { font-size: .68em; letter-spacing: 0; white-space: nowrap; color: var(--ink); }
.hero-copy .hero-title { transition: opacity .28s ease, transform .28s ease; }
.hero-copy.is-fading .hero-title { opacity: 0; transform: translateY(8px); }
.hero-actions { margin-top: 32px; display: flex; gap: 16px; }

/* 轮播 */
.hero-carousel {
  position: relative; width: 560px; height: 440px; flex-shrink: 0;
  border-radius: 16px; overflow: visible; background: transparent;
}
.carousel-slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  background-repeat: no-repeat; /* contain letterbox 时禁止平铺，否则窄容器两侧露出重复图 */
  border-radius: 16px;
  opacity: 0; transition: opacity .15s ease;
  pointer-events: none; /* 叠层帧不拦截点击，仅激活帧响应（点击打开放大查看） */
}
.carousel-slide.is-active { opacity: 1; pointer-events: auto; }
.slide-caption { position: absolute; left: 0; right: 0; bottom: -9px; z-index: 2; color: #1625A2; text-align: center; }
.slide-title { font-size: 17px; font-weight: 600; }
.slide-sub { margin-top: 6px; font-size: 12px; color: #C9CDF2; }

.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(22,37,162,.35);
  background: rgba(255,255,255,.85); color: #1625A2; font-size: 22px; line-height: 1;
}
.carousel-arrow:hover { background: #1625A2; color: #fff; border-color: #1625A2; }
.carousel-arrow.prev { left: 16px; }
.carousel-arrow.next { right: 16px; }

/* ---------- 关于智赛 ---------- */
.about { background: #fff; padding: 38px 0 46px; }
.about-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 60px; align-items: center; }
/* 标题在网格外，图片可与左侧正文垂直居中 */
.about .section-title { margin-bottom: 8px; }
.about-lead { margin-top: 0; font-size: 15px; line-height: 1.8; color: var(--text-sub); font-weight: 400; text-indent: 2em; }
.about-desc { margin-top: 0; font-size: 15px; line-height: 1.8; color: var(--text-sub); text-indent: 2em; }
.about-desc strong { font-weight: 700; }
.about-blue { color: var(--primary); }
.about-img { aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--bg-soft); box-shadow: 0 16px 40px rgba(13, 26, 51, .12); }
.about-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- 产品板块 ---------- */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; }
.section-title { font-size: 28px; font-weight: 700; }
.product-tabs { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.product-tab {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 18px; color: var(--text); padding: 8px 18px; border-radius: 4px;
  border-bottom: 2px solid transparent; transition: color .2s, background-color .2s, border-color .2s;
}
.product-tab:hover { background: var(--primary); color: #fff; font-weight: 600; border-bottom-color: transparent; }
.product-tab.is-active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.product-tab.is-active:hover { background: var(--primary); color: #fff; }

/* ---------- 轮播通用：一屏四张，左右箭头循环 ---------- */
.car-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid #C9D0E0;
  background: #fff; color: var(--ink); font-size: 26px; line-height: 1;
  cursor: pointer; transition: all .2s; padding-bottom: 4px;
}
.car-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.car-viewport { overflow: hidden; }
.car-wrap { position: relative; margin-top: 10px; }
.car-btn.side { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; box-shadow: 0 4px 14px rgba(13, 26, 51, .12); }
.car-btn.side.prev { left: -22px; }
.car-btn.side.next { right: -22px; }
.car-track { display: flex; gap: 24px; transition: transform .5s ease; }

/* ---------- 解决方案与产品：一屏四张循环轮播 ---------- */
.products { background: var(--bg-soft); padding: 38px 0 46px; }
.product-card {
  margin: 0; width: calc((100% - 72px) / 4); flex-shrink: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 8px 20px rgba(13, 26, 51, .06); transition: transform .25s, box-shadow .25s, background-color .25s;
  display: flex; flex-direction: column;
}
.product-card:hover {
  transform: translateY(-8px);
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 37, 162, .18), 0 18px 36px rgba(13, 26, 51, .16);
}
.product-card:hover .card-title { color: var(--primary); }
.product-card:hover .card-img img { transform: scale(1.05); }
.product-card:hover .card-link { font-weight: 700; }
.card-img { aspect-ratio: 800 / 510; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card-body { padding: 5px 16px 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; align-items: center; text-align: center; }
.card-title { font-size: 17px; font-weight: 600; line-height: 1.4; }
.card-desc { font-size: 13px; line-height: 1.7; color: var(--text-sub); flex: 1; }
.card-link {
  font-size: 13px; color: #111; align-self: flex-end; margin-top: auto; /* 锚定卡底，标题行数不同按钮也对齐 */
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 13px; border: 1px solid var(--line); border-radius: 999px;
  transition: color .2s, border-color .2s, background-color .2s;
}
.card-link .arr { display: inline-block; transition: transform .2s ease; }
.product-card:hover .card-link { color: var(--primary); border-color: rgba(22, 37, 162, .45); background: #fff; }
.card-link:hover .arr { transform: translateX(3px); }

/* ---------- 产品详情弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 200; background: rgba(13, 26, 51, .55);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-mask[hidden] { display: none; }
.modal-box {
  position: relative; width: min(660px, 100%); max-height: 86vh; overflow: auto;
  background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(13, 26, 51, .3);
  animation: modalIn .22s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 22px; line-height: 1;
  box-shadow: 0 2px 8px rgba(13, 26, 51, .15);
}
.modal-close:hover { background: var(--primary); color: #fff; }
.modal-img { aspect-ratio: 800 / 510; }
.modal-img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 16px 16px 0 0; }
.modal-body { padding: 20px 28px 26px; }
.modal-title { font-size: 20px; font-weight: 700; color: var(--primary); }
.modal-cat { margin-top: 2px; font-size: 13px; color: var(--text-sub); }
.modal-params { margin-top: 14px; }
.param-row {
  display: flex; justify-content: space-between; gap: 24px;
  padding: 9px 2px; border-bottom: 1px dashed var(--line); font-size: 14px;
}
.param-row .k { color: var(--text-sub); flex-shrink: 0; }
.param-row .v { color: var(--ink); text-align: right; }
.modal-empty {
  margin-top: 14px; padding: 14px 16px; border-radius: 10px;
  background: var(--bg-soft); font-size: 14px; color: var(--text-sub); line-height: 1.7;
}
.modal-actions { margin-top: 20px; }
.products-empty { display: flex; justify-content: center; align-items: center; min-height: 180px; color: var(--text-sub); font-size: 15px; letter-spacing: 2px; }
.products-empty[hidden] { display: none; }

/* 导航下拉子项点击后对应卡片高亮 */
.product-card.is-highlight {
  animation: cardPulse 2.4s ease;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 37, 162, .18), 0 8px 20px rgba(13, 26, 51, .1);
}
@keyframes cardPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(22, 37, 162, .18), 0 8px 20px rgba(13, 26, 51, .1); }
  30%      { box-shadow: 0 0 0 6px rgba(22, 37, 162, .28), 0 10px 26px rgba(13, 26, 51, .14); }
}

/* ---------- 荣誉资质：一屏四张循环轮播 ---------- */
.honors { background: #fff; padding: 38px 0 46px; }
.honor-card {
  margin: 0; width: calc((100% - 72px) / 4); flex-shrink: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  transition: transform .25s, box-shadow .25s, background-color .25s;
}
.honor-card:hover {
  transform: translateY(-8px);
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 37, 162, .18), 0 18px 36px rgba(13, 26, 51, .16);
}
.honor-card:hover .honor-name { color: var(--primary); }
.honor-card:hover .honor-img img { transform: scale(1.05); }
.honor-img { aspect-ratio: 3 / 4; overflow: hidden; background: var(--bg-soft); }
.honor-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.honor-name { padding: 9px 16px; font-size: 17px; font-weight: 700; color: var(--ink); text-align: center; line-height: 1.4; }

/* ---------- 页脚 ---------- */
.footer { background: var(--primary-dark); color: #fff; }
.footer-main { display: flex; gap: 24px; padding-top: 28px; padding-bottom: 20px; flex-wrap: wrap; }
.footer-brand { max-width: 272px; }
.footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.footer-logo-chip { width: 32px; height: 32px; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.footer-logo-chip img { width: 22px; height: 20px; object-fit: contain; }
.footer-brand-name { font-size: 17px; font-weight: 700; white-space: nowrap; }
.footer-line { font-size: 13px; line-height: 1.55; color: var(--footer-text); }
.footer-addr { white-space: nowrap; }
.footer-line .addr2 { display: inline-block; }
.contact-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 8px; }
.contact-row .footer-line { margin: 0; }
.contact-icon { width: 22px; height: 22px; flex-shrink: 0; margin-top: 4px; color: #C9CDF2; transition: color .2s; }
.contact-row:hover .contact-icon { color: #fff; }
.footer-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.footer-col h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; white-space: nowrap; }
.footer-col a { font-size: 13px; line-height: 1.45; color: var(--footer-text); max-width: 170px; }
.footer-col a:hover { color: #fff; font-weight: 700; }
.footer-divider { height: 1px; background: rgba(255, 255, 255, .14); }
.footer-copy { text-align: center; font-size: 12px; color: var(--footer-dim); padding: 10px 0; }
.beian-link { color: var(--footer-dim); text-decoration: none; }
.beian-link:hover { color: #fff; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .hero-title { font-size: 42px; }
  .hero-carousel { width: 46%; height: auto; aspect-ratio: 1120 / 880; }
  /* 主图透明留白在窄屏下收窄：contain显示+垂直36%分配（顶部留白约为原来的1/2），内容不裁切 */
  .carousel-slide { background-size: contain; background-position: center 36%; }
}
@media (max-width: 1024px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; flex-direction: column; align-items: flex-start;
    padding: 16px 24px; gap: 4px; box-shadow: 0 12px 24px rgba(13,26,51,.12);
    max-height: 70vh; overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-links > a { padding: 10px 0; margin: 0; font-size: 17px; }
  .nav-item { width: 100%; }
  .nav-item > a { display: block; padding: 10px 0; margin: 0; font-size: 17px; }
  .nav-item .dropdown {
    position: static; transform: none; opacity: 1; visibility: visible;
    box-shadow: none; border-top: none; border-left: 3px solid var(--primary);
    border-radius: 0 0 0 8px; margin: 0 0 6px 6px; padding: 2px 0; display: none;
  }
  .nav-item.open .dropdown { display: block; }
  .nav-cta { display: none; }
  /* 手机/竖屏平板：布局间距减半 + 用裁掉透明区的手机版主图，消除画布自带留白 */
  .hero-inner { flex-direction: column; align-items: stretch; padding-top: 56px; padding-bottom: 44px; gap: 32px; }
  .hero-carousel { width: 100%; height: auto; aspect-ratio: 1112 / 671; }
  .carousel-slide.s1 { background-image: url('../images/hero-1-m.png?v=11') !important; }
  /* 角标移到主图下方：裁切版主图无透明垫底区，压在图内会遮挡画面 */
  .slide-caption { bottom: -27px; }
  .product-card { width: calc((100% - 24px) / 2); }
  .honor-card { width: calc((100% - 24px) / 2); }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-img { order: -1; }
  .footer-main { gap: 40px; }
}
@media (max-width: 640px) {
  /* 标题随屏宽缩放保证窄屏单行显示；副标题不折行（字号已联动缩小） */
  .hero-title { font-size: min(8vw, 32px); }
  .section-title { font-size: 20px; }
  .car-btn { width: 38px; height: 38px; font-size: 22px; }
  .product-card, .honor-card { width: 100%; }
  .hero-title .t2 { white-space: nowrap; }
  .about-lead { font-size: 16px; }
}

/* ---------- 图片全屏查看器（点击放大/双指缩放） ---------- */
.img-viewer { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; background: rgba(10,12,20,.93); touch-action: none; }
.img-viewer.open { display: flex; }
/* hero主图（透明PNG）放大查看时改白底，关闭按钮同步换成深色 */
.img-viewer.iv-light { background: #fff; }
.img-viewer.iv-light .iv-close { background: rgba(0,0,0,.08); color: #333; }
.img-viewer img { max-width: 100%; max-height: 100%; transform-origin: center center; will-change: transform; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.img-viewer .iv-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 2; width: 40px; height: 40px; border: none; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }

/* ===== 喜报弹窗（国家级专精特新“小巨人”，2026-10） ===== */
.xibao-mask[hidden] { display: none; }
.xibao-mask { position: fixed; inset: 0; z-index: 9999; background: rgba(10, 12, 30, .66);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; transition: opacity .25s ease; }
.xibao-mask.show { opacity: 1; }
.xibao-dialog { position: relative; width: min(92vw, 1000px); border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.45); transform: translateY(26px) scale(.96);
  transition: transform .28s cubic-bezier(.22,1,.36,1); }
.xibao-mask.show .xibao-dialog { transform: translateY(0) scale(1); }
.xibao-dialog img { display: block; width: 100%; height: auto; }
.xibao-close { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px;
  border: none; border-radius: 50%; background: rgba(255,255,255,.92); color: #A61B29;
  font-size: 24px; line-height: 36px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.25);
  transition: background .15s ease, transform .15s ease; }
.xibao-close:hover { background: #fff; transform: scale(1.08); }
@media (max-width: 640px) {
  .xibao-dialog { width: min(94vw, 420px); }
  .xibao-close { width: 32px; height: 32px; font-size: 20px; line-height: 30px; top: 8px; right: 8px; }
}
