/* =========================================================
   赛思保官网 · 共享样式
   所有页面引用：assets/css/site.css
   ========================================================= */
:root {
  --primary: #1a5fd0;
  --primary-dark: #0d3f96;
  --primary-light: #e8f0fe;
  --accent: #f5a623;
  --text: #333;
  --text-light: #666;
  --bg-light: #f7f9fc;
  --white: #ffffff;
  --header-h: 84px;
  --gutter: 20px;
  /* 全站 banner（首页 .hero 与二级页 .page-hero）统一高度与上下内边距 */
  --hero-h: 440px;
  --hero-pad: 56px;
  /* ===== 全站统一字号体系 =====
     5 个页面共用同一套令牌，同级元素字号完全一致 */
  --fs-hero: clamp(28px, 4.6vw, 40px);      /* 页面 banner 主标题 */
  --fs-title: clamp(23px, 3.2vw, 30px);     /* 区块大标题（sec-head h2 等） */
  --fs-subtitle: clamp(19px, 2.4vw, 24px);  /* 区块内子标题 / 强调性说明 */
  --fs-heading: 18px;                       /* 卡片标题 */
  --fs-lead: clamp(15px, 2vw, 18px);        /* banner 副标题 / 居中引导语 */
  --fs-body: 16px;                          /* 正文段落 */
  --fs-text: 15px;                          /* 卡片描述 / 次级正文 */
  --fs-note: 14px;                          /* 辅助说明 */
  --fs-small: 13px;                         /* 小字 / 图注 / 版权 */
  --fs-tiny: 12px;                          /* 徽标 / 二维码说明 */
  --fs-num: clamp(26px, 3.6vw, 38px);       /* 数据看板大数字 */
}
/* banner 统一高度：平板 / 手机逐级下调 */
@media (max-width: 1024px) { :root { --hero-h: 400px; --hero-pad: 52px; } }
@media (max-width: 768px)  { :root { --hero-h: 340px; --hero-pad: 44px; --fs-num: 24px; } }
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  /* 全站唯一字体族定义，其余元素全部继承，不再单独声明 */
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", sans-serif;
  font-size: var(--fs-body);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* 表单类元素默认不继承字体，这里强制继承，避免出现系统默认字体 */
button, input, select, textarea { font: inherit; color: inherit; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
/* 图片渐进加载：默认淡入（无 JS 环境下 html.js 不生效，不会留白）
   动态插入的图片（如地图瓦片）不参与，直接显示 */
html.js img:not(.leaflet-tile) { opacity: 0; transition: opacity .45s ease; }
html.js img.is-loaded { opacity: 1; }
@media (prefers-reduced-motion: reduce) { html.js img { transition: none; } }
/* 图片未就绪时，图框显示流动微光占位（慢网下不是"白块"而是载入态） */
.pic:has(img:not(.is-loaded)), .thumb:has(img:not(.is-loaded)), .poster:has(img:not(.is-loaded)) {
  background: linear-gradient(100deg, #eaf1f9 20%, #f8fbff 40%, #eaf1f9 60%);
  background-size: 220% 100%;
  animation: imgShimmer 1.4s linear 9;
}
@keyframes imgShimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) {
  .pic:has(img:not(.is-loaded)), .thumb:has(img:not(.is-loaded)), .poster:has(img:not(.is-loaded)) { animation: none; }
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
section[id], div[id] { scroll-margin-top: calc(var(--header-h) + 10px); }

/* ===== 顶部导航 ===== */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  padding-top: env(safe-area-inset-top);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.logo {
  display: flex; align-items: center; gap: 12px;
  font-size: var(--fs-subtitle); font-weight: 700; color: var(--primary-dark);
  flex-shrink: 0;
}
.logo img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
.nav-links { display: flex; align-items: center; gap: 36px; font-size: var(--fs-text); }
.nav-links a { color: var(--text); transition: color .2s; white-space: nowrap; }
.nav-links a:hover { color: var(--primary); }
.nav-links a.active { color: var(--primary); font-weight: 600; }
.nav-cta {
  background: var(--primary); color: #fff !important;
  padding: 11px 26px; border-radius: 24px; font-size: var(--fs-text);
  transition: background .2s;
}
.nav-cta:hover { background: var(--primary-dark); }

/* 汉堡按钮 */
.nav-toggle {
  display: none;
  width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  margin-right: -8px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px; border-radius: 2px;
  background: var(--primary-dark); transition: transform .3s, opacity .3s;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端下拉菜单 */
.mobile-menu {
  display: none;
  position: fixed; left: 0; right: 0; top: calc(var(--header-h) + env(safe-area-inset-top));
  background: #fff; z-index: 99;
  box-shadow: 0 12px 28px rgba(13,63,150,.14);
  max-height: 0; overflow: hidden;
  transition: max-height .32s ease;
}
.mobile-menu.open { max-height: 80vh; overflow-y: auto; }
.mobile-menu a {
  display: block; padding: 15px var(--gutter); font-size: var(--fs-body);
  border-bottom: 1px solid #f0f3f8; color: var(--text);
}
.mobile-menu a:active { background: var(--primary-light); }
.mobile-menu a.nav-cta {
  margin: 16px var(--gutter) 22px; text-align: center;
  border-radius: 24px; border-bottom: 0; padding: 13px;
}
.menu-mask { display: none; position: fixed; inset: 0; z-index: 98; background: rgba(10,25,50,.35); }
.menu-mask.open { display: block; }

/* ===== 通用 section ===== */
section { padding: 78px 0; }
.sec-head { text-align: center; margin-bottom: 50px; }
.sec-head h2 {
  font-size: var(--fs-title); color: var(--primary-dark);
  display: inline-block; position: relative; padding-bottom: 14px;
}
.sec-head h2::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 52px; height: 4px; border-radius: 2px; background: var(--accent);
}
.sec-head p { color: var(--text-light); margin-top: 12px; font-size: var(--fs-text); }

/* ===== 按钮 ===== */
.btn {
  display: inline-block; padding: 12px 34px; border-radius: 26px;
  font-size: var(--fs-text); transition: transform .2s, box-shadow .2s; text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(245,166,35,.4); }
.btn-ghost { border: 1.5px solid rgba(255,255,255,.7); color: #fff; }

/* ===== 二级页面 Banner ===== */
/* 各页 banner 底图（路径相对于本 CSS 文件：assets/css/ → ../images/hero/） */
body.p-hero-lvxing   .page-hero { --hero-img: url('../images/hero/hero-lvxing.webp'); }
body.p-hero-hangkong .page-hero { --hero-img: url('../images/hero/hero-hangkong.webp'); }
body.p-hero-baozhang .page-hero { --hero-img: url('../images/hero/hero-baozhang.webp'); }
body.p-hero-guanyu   .page-hero { --hero-img: url('../images/hero/hero-guanyu.webp'); }

.page-hero {
  margin-top: calc(var(--header-h) + env(safe-area-inset-top));
  background:
    linear-gradient(100deg, rgba(7,32,80,.94) 0%, rgba(10,48,120,.85) 42%, rgba(13,63,150,.55) 70%, rgba(26,95,208,.22) 100%),
    var(--hero-img, none) center right / cover no-repeat,
    linear-gradient(120deg, #0d3f96 0%, #1a5fd0 55%, #3d85e8 100%);
  color: #fff; padding: var(--hero-pad) 0;
  position: relative; overflow: hidden;
  /* 所有页面 banner 等高，内容垂直居中 */
  min-height: var(--hero-h);
  display: flex; align-items: center;
}
.page-hero > .container, .hero > .container { width: 100%; }
.page-hero h1 {
  font-size: var(--fs-hero); letter-spacing: 1px;
  margin-bottom: 14px; line-height: 1.35; position: relative; z-index: 1;
}
.page-hero .lead {
  font-size: var(--fs-lead); opacity: .92; margin-bottom: 24px;
  max-width: 780px; position: relative; z-index: 1;
  text-wrap: pretty;
}
.page-hero ul { list-style: none; position: relative; z-index: 1; }
.page-hero ul li {
  padding-left: 26px; position: relative; margin-bottom: 8px;
  font-size: var(--fs-text); opacity: .9;
}
.page-hero ul li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-weight: 700;
}

/* ===== 合作保司（多页共用） ===== */
.partner-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.partner-logo {
  background: var(--white); border-radius: 12px; height: 110px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #eef2f8;
  box-shadow: 0 2px 10px rgba(13,63,150,.05);
  transition: transform .2s, box-shadow .2s;
  padding: 14px;
}
.partner-logo:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(13,63,150,.12); }
.partner-logo img { max-height: 70px; max-width: 100%; width: auto; object-fit: contain; }

/* ===== 资质证书（多页共用） ===== */
.cert-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.cert-item {
  background: var(--white); border-radius: 12px; overflow: hidden; cursor: zoom-in;
  box-shadow: 0 2px 12px rgba(13,63,150,.06);
  transition: transform .25s, box-shadow .25s;
}
.cert-item:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(13,63,150,.13); }
.cert-item .thumb {
  aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
  background: #fff; padding: 8px;
}
.cert-item .thumb img { max-height: 100%; width: auto; object-fit: contain; }
.cert-item .cap {
  text-align: center; font-size: var(--fs-small); color: var(--text-light);
  padding: 10px 6px 12px; border-top: 1px solid #f0f3f8;
}

/* ===== 页脚 ===== */
footer {
  background: #0a2350; color: #b9c8e2;
  padding: 48px 0 26px; font-size: var(--fs-note);
  padding-bottom: calc(26px + env(safe-area-inset-bottom));
}
.footer-grid {
  display: grid; grid-template-columns: .78fr 1.2fr 1.62fr; gap: 32px;
  padding-bottom: 34px; border-bottom: 1px solid rgba(255,255,255,.12);
}
footer h4 { color: #fff; font-size: var(--fs-body); margin-bottom: 16px; }
footer li { list-style: none; margin-bottom: 10px; }
footer a:hover { color: #fff; }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact img { width: 20px; height: 20px; flex-shrink: 0; margin-top: 3px; }
.footer-contact a { color: #dce8ff; text-decoration: none; border-bottom: 1px dashed rgba(220,232,255,.35); }
.footer-contact a:hover { color: #fff; border-bottom-color: #fff; }

/* ===== 页脚 · 嵌入式地图 ===== */
.footer-map-col { display: flex; flex-direction: column; min-width: 0; }
.footer-map-col h4 { margin-bottom: 10px; }
.footer-map-addr { font-size: var(--fs-small); color: #b9c8e2; margin-bottom: 14px; }
.footer-map {
  position: relative; z-index: 0;
  flex: 1 1 auto; min-height: 250px;
  border-radius: 12px; overflow: hidden;
  background: #e9eff8; border: 1px solid rgba(255,255,255,.14);
}
.footer-map .leaflet-container { background: #e9eff8; font-family: inherit; }
.map-pin { background: none; border: none; }
.map-pin svg { display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.leaflet-popup-content-wrapper { border-radius: 10px; box-shadow: 0 6px 22px rgba(10,35,80,.22); }
.leaflet-popup-content { margin: 12px 14px; line-height: 1.6; }
.map-pop { font-size: var(--fs-small); color: #22406f; }
.map-pop strong { display: block; font-size: var(--fs-note); color: #0d3f96; margin-bottom: 4px; }
.map-pop p { margin: 0 0 9px; color: #4a6484; font-size: var(--fs-tiny); }
.map-pop-nav {
  display: inline-block; background: #0d3f96; color: #fff !important;
  padding: 6px 13px; border-radius: 999px; font-size: var(--fs-tiny); font-weight: 600;
}
.map-pop-nav:hover { background: #1a5fd0; }
.leaflet-control-zoom a { color: #0d3f96 !important; }
.footer-qr { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-qr .qr { text-align: center; }
.footer-qr .qr img {
  width: 98px; height: 98px; border-radius: 8px;
  background: #fff; padding: 5px; margin: 0 auto;
}
.footer-qr .qr p { font-size: var(--fs-tiny); margin-top: 6px; }
.copyright { text-align: center; padding-top: 22px; font-size: var(--fs-small); color: #7d90b5; line-height: 2; }
.copyright img { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; margin-right: 3px; }

/* ===== 图片灯箱 ===== */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(10,25,50,.86);
  align-items: center; justify-content: center; cursor: zoom-out;
  padding: 16px;
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: 92vw; max-height: 82vh; width: auto; border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.lightbox .close-hint {
  position: absolute; bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.75); font-size: var(--fs-small);
}

/* ===== 移动端底部快捷操作栏 ===== */
.mobile-bar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid #e8edf5;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 14px rgba(13,63,150,.08);
}
.mobile-bar .bar-inner { display: flex; gap: 8px; }
.mobile-bar a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; padding: 7px 0; border-radius: 10px;
  font-size: var(--fs-tiny); color: var(--primary-dark);
}
.mobile-bar a:active { background: var(--primary-light); }
.mobile-bar a.highlight {
  background: var(--primary); color: #fff; flex: 1.6;
  flex-direction: row; gap: 6px; font-size: var(--fs-note); font-weight: 600;
  border-radius: 22px; box-shadow: 0 4px 14px rgba(26,95,208,.35);
}
.mobile-bar .ico { font-size: 17px; line-height: 1; }

/* =========================================================
   平板 / 小笔记本（≤1024px）
   ========================================================= */
@media (max-width: 1024px) {
  :root { --gutter: 18px; }
  .nav-links { gap: 22px; font-size: var(--fs-note); }
  .cert-grid { grid-template-columns: repeat(3, 1fr); }
  .partner-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1.35fr; row-gap: 30px; }
  .footer-grid > div:last-child { grid-column: 1 / -1; }
  .footer-map { min-height: 280px; }
  .footer-qr { justify-content: flex-start; }
}

/* =========================================================
   移动端（≤768px）
   ========================================================= */
@media (max-width: 768px) {
  :root { --header-h: 64px; --gutter: 16px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .mobile-menu { display: block; }
  .logo { gap: 10px; }
  .logo img { width: 42px; height: 42px; border-radius: 9px; }

  .page-hero {
    background:
      linear-gradient(100deg, rgba(7,32,80,.96) 0%, rgba(10,48,120,.9) 55%, rgba(13,63,150,.6) 100%),
      var(--hero-img, none) 72% center / cover no-repeat,
      linear-gradient(120deg, #0d3f96 0%, #1a5fd0 55%, #3d85e8 100%);
  }
  .page-hero ul li { font-size: var(--fs-note); }

  section { padding: 46px 0; }
  .sec-head { margin-bottom: 30px; }
  .sec-head h2 { padding-bottom: 11px; }
  .sec-head h2::after { width: 42px; height: 3px; }

  .cert-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cert-item .cap { font-size: var(--fs-tiny); padding: 8px 5px 10px; }
  .partner-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .partner-logo { height: 88px; padding: 12px; }
  .partner-logo img { max-height: 54px; }

  .footer-grid { grid-template-columns: 1fr; gap: 26px; padding-bottom: 26px; }
  .footer-grid > div:last-child { grid-column: auto; }
  .footer-qr { justify-content: center; }
  .footer-map-addr { font-size: var(--fs-tiny); margin-bottom: 10px; }
  .footer-map { min-height: 230px; border-radius: 10px; }
  footer h4 { margin-bottom: 12px; font-size: var(--fs-text); }
  footer { padding-top: 36px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

  .mobile-bar { display: block; }
  .lightbox img { max-width: 94vw; max-height: 76vh; }
}

/* =========================================================
   小屏手机（≤400px）
   ========================================================= */
@media (max-width: 400px) {
  .partner-logo { height: 76px; }
  .partner-logo img { max-height: 44px; }
  .footer-qr .qr img { width: 88px; height: 88px; }
}

/* ===== 触屏 / 横屏 / 减弱动效 ===== */
@media (hover: none) {
  .cert-item:hover, .partner-logo:hover, .btn:hover { transform: none; }
  .btn:active { opacity: .85; }
}
@media (max-width: 900px) and (orientation: landscape) {
  :root { --hero-h: 300px; --hero-pad: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
