/* ============================================================
 * 全局样式：品牌变量、排版、导航、页脚、AI 客服窗口、动画
 * 依赖：Bootstrap 5.3（本地自托管）已通过 bootstrap.min.css 引入
 * ============================================================ */

:root {
  /* 品牌色 */
  --brand: #1677ff;
  --brand-dark: #0a4bbf;
  --brand-light: #e8f1ff;
  --brand-2: #0b6e6e;
  --ink: #1f2733;
  --ink-2: #5b6776;
  --line: #e6ebf2;
  --bg-soft: #f5f8ff;
  --radius: 14px;
  --shadow-sm: 0 2px 8px rgba(20, 50, 110, 0.06);
  --shadow-md: 0 10px 30px rgba(20, 50, 110, 0.10);
  --maxw: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- 线性图标（.ico 包裹内联 SVG，随 currentColor 变色） ---------- */
/* 基础：.ico 是个 1em 方块，内部 svg 撑满，颜色继承父级文字色。 */
.ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1em; height: 1em;
}
.ico svg { width: 100%; height: 100%; display: block; }

/* 卡片图标容器里的 svg（.icon / .pc-icon / .sol-icon），统一 28px 品牌色描边。 */
.icon svg, .pc-icon svg, .sol-icon svg { width: 28px; height: 28px; }

/* 右侧悬浮栏图标：卡片为白底，图标用品牌色（与原 emoji 一致，保证可见）。 */
.side-rail .ico { width: 20px; height: 20px; color: var(--brand); }

/* 客服浮窗图标：品牌渐变底，图标白色。 */
.chat-fab .ico { width: 26px; height: 26px; color: #fff; }

/* 页脚联系方式图标：品牌色。 */
.footer-col p .ico, .footer-col p svg {
  width: 16px; height: 16px; color: var(--brand);
  vertical-align: -3px; margin-right: 4px;
}

/* 导航 / 移动菜单电话图标：继承父级文字色（白字或未滚动时的品牌色）。 */
.nav-phone .ico, .nav-phone svg,
.mobile-menu .ico, .mobile-menu svg {
  width: 16px; height: 16px; color: inherit; vertical-align: -3px;
}

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

.section { padding: 84px 0; }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 {
  font-size: 32px; font-weight: 800; margin: 0 0 10px;
}
.section-title p { color: var(--ink-2); margin: 0; }

/* ---------- 视觉装饰层（UI 改进）：section 标题图标锚点 ---------- */
.section-title .sec-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin: 0 auto 16px;
  border-radius: 16px; background: var(--brand-light); color: var(--brand);
  box-shadow: 0 8px 20px rgba(22,119,255,.12);
}
.section-title .sec-icon svg { width: 30px; height: 30px; display: block; }

/* ---------- 按钮 ---------- */
.btn-brand {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: none;
  padding: 12px 26px; border-radius: 999px; font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  cursor: pointer;
}
.btn-brand:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.5);
  padding: 11px 24px; border-radius: 999px; font-weight: 600; cursor: pointer;
  transition: background .15s ease;
}
.btn-ghost:hover { background: rgba(255,255,255,.22); color: #fff; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1030;
  transition: background .25s ease, box-shadow .25s ease;
  background: linear-gradient(135deg, rgba(10,75,191,.92), rgba(22,119,255,.92));
}
.site-header.scrolled {
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-sm);
  backdrop-filter: saturate(180%) blur(8px);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: #fff; flex: 0 0 auto; }
.site-header.scrolled .brand { color: var(--ink); }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.nav-menu { display: flex; align-items: center; justify-content: center; gap: 20px; flex: 1 1 auto; list-style: none; margin: 0; padding: 0; }
.nav-menu > li { position: relative; }
.nav-menu a { color: #fff; font-weight: 500; position: relative; padding: 6px 0; white-space: nowrap; display: inline-flex; align-items: center; }
.site-header.scrolled .nav-menu a { color: var(--ink); }
.nav-menu a::after {
  content: ''; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px;
  background: var(--brand); transition: width .2s ease;
}
.nav-menu a:hover::after, .nav-menu a.active::after { width: 100%; }
/* --- 导航二级菜单 --- */
/* 箭头：与文字基线对齐，line-height 继承父级，避免带子菜单项与普通项高度不一致 */
.nav-menu .nav-arrow { font-size: 16px; margin-left: 4px; opacity: .7; line-height: 1; transition: transform .2s; }
.nav-dropdown:hover > a > .nav-arrow { transform: rotate(180deg); }
.nav-submenu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  list-style: none; margin: 0; padding: 14px 0 8px; min-width: 160px;
  background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 100;
  /* 默认隐藏：用 visibility + opacity 替代 display:none，支持过渡动画 */
  visibility: hidden; opacity: 0;
  transition: visibility 0s .2s, opacity .15s ease;
}
/* 顶部透明桥接区：填充一级菜单与二级菜单之间的间隙，鼠标经过时不会触发 mouseout */
.nav-submenu::before {
  content: ''; position: absolute; top: -16px; left: -8px; right: -8px; height: 16px;
}
/* 底部三角箭头（视觉装饰，位于桥接区下方） */
.nav-submenu::after {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-bottom-color: #fff;
}
.nav-submenu li { margin: 0; }
.nav-submenu a {
  display: block; padding: 8px 18px; color: var(--ink) !important; font-weight: 400; font-size: 14px;
  white-space: nowrap; transition: background .15s;
}
.nav-submenu a::after { display: none !important; }
.nav-submenu a:hover { background: var(--brand-light); color: var(--brand) !important; }
/* hover 显示：平滑渐显 + 取消延迟关闭 */
.nav-dropdown:hover > .nav-submenu {
  visibility: visible; opacity: 1;
  transition: visibility 0s 0s, opacity .15s ease;
}
/* 移动端二级菜单缩进 */
.mobile-menu .mobile-sub { padding-left: 24px; font-size: 14px; opacity: .8; }
.nav-cta { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; margin-left: auto; }
.nav-phone { color: #fff; font-weight: 700; white-space: nowrap; }
.site-header.scrolled .nav-phone { color: var(--brand); }
.site-header.scrolled .nav-cta .btn-ghost { color: var(--brand); border-color: var(--brand); background: transparent; }
.site-header.scrolled .nav-cta .btn-ghost:hover { background: var(--brand); color: #fff; }
.nav-toggle {
  display: none; background: none; border: none; width: 42px; height: 42px;
  align-items: center; justify-content: center; cursor: pointer;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; position: relative; }
.site-header.scrolled .nav-toggle span { background: var(--ink); }
.nav-toggle span::before, .nav-toggle span::after {
  content: ''; position: absolute; left: 0; width: 24px; height: 2px; background: inherit;
}
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }
.mobile-menu {
  display: none; background: #fff; border-top: 1px solid var(--line);
  padding: 12px 20px; box-shadow: var(--shadow-md);
}
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: 12px 4px; color: var(--ink); border-bottom: 1px solid var(--line); font-weight: 500; }

/* ---------- 页脚 M8 ---------- */
.site-footer { background: #0e1726; color: #c4cdda; padding: 56px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 18px; margin-bottom: 14px; }
.footer-brand img { width: 36px; height: 36px; border-radius: 9px; }
.footer-col h4 { color: #fff; font-size: 15px; margin: 0 0 14px; }
.footer-col a, .footer-col p { color: #c4cdda; font-size: 14px; margin: 0 0 10px; display: block; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08); margin-top: 36px; padding-top: 18px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: #8a97a8;
}
.footer-beian {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
}
.footer-bottom .footer-icp,
.footer-bottom .footer-police {
  color: #8a97a8;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer-bottom .footer-icp:hover,
.footer-bottom .footer-icp:active,
.footer-bottom .footer-police:hover,
.footer-bottom .footer-police:active {
  color: #c4cdda;
  text-decoration: underline;
}
.footer-bottom .footer-police-icon {
  width: 16px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

/* ---------- 悬浮获客入口（右侧） ---------- */
.side-rail {
  position: fixed; right: 18px; bottom: 96px; z-index: 1020;
  display: flex; flex-direction: column; gap: 12px;
}
.side-rail a {
  width: 46px; height: 46px; border-radius: 12px; background: #fff; color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  box-shadow: var(--shadow-md); transition: transform .15s ease;
}
.side-rail a:hover { transform: translateY(-2px); }

/* ---------- AI 客服窗口 ---------- */
.chat-widget { position: fixed; right: 22px; bottom: 22px; z-index: 1040; font-size: 14px; }
.chat-fab {
  width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff;
  font-size: 26px; box-shadow: var(--shadow-md); position: relative;
  display: flex; align-items: center; justify-content: center;
  animation: fab-breath 2.4s ease-in-out infinite;
}
@keyframes fab-breath {
  0%,100% { box-shadow: 0 0 0 0 rgba(22,119,255,.45); }
  50% { box-shadow: 0 0 0 12px rgba(22,119,255,0); }
}
.chat-panel {
  position: absolute; right: 0; bottom: 74px; width: 380px; height: 520px;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right;
  transition: opacity .2s ease, transform .2s ease; opacity: 0; transform: scale(.96) translateY(8px); pointer-events: none;
}
.chat-widget.open .chat-panel { opacity: 1; transform: none; pointer-events: auto; }
.chat-widget.open .chat-fab { display: none; }
.chat-header {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff;
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
}
.chat-header .title { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.chat-header .status { width: 8px; height: 8px; border-radius: 50%; background: #38e08a; display: inline-block; }
.chat-close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; line-height: 1; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; background: var(--bg-soft); }
.chat-msg { display: flex; gap: 8px; margin-bottom: 14px; align-items: flex-start; }
.chat-msg .avatar {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px; display: flex;
  align-items: center; justify-content: center; font-size: 16px; color: #fff;
}
.chat-msg.ai .avatar { background: var(--brand); }
.chat-msg.user { flex-direction: row-reverse; }
.chat-msg.user .avatar { background: #94a3b8; }
/* 气泡头像内的线性图标（.ico 包裹，继承白色文字色） */
.chat-msg .avatar .ico { width: 18px; height: 18px; color: #fff; }
.chat-bubble {
  max-width: 78%; padding: 10px 13px; border-radius: 12px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.chat-msg.ai .chat-bubble { background: #fff; border: 1px solid var(--line); border-top-left-radius: 2px; }
.chat-msg.user .chat-bubble { background: var(--brand); color: #fff; border-top-right-radius: 2px; }
.chat-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.chat-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #b6c2d2; animation: blink 1.2s infinite both;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }
.chat-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 4px; border-top: 1px solid var(--line); }
.chat-quick button {
  background: var(--brand-light); color: var(--brand-dark); border: 1px solid #d4e3ff;
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; transition: background .15s ease;
}
.chat-quick button:hover { background: #d4e3ff; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-input input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none;
  font-size: 14px;
}
.chat-input input:focus { border-color: var(--brand); }
.chat-input button {
  background: var(--brand); color: #fff; border: none; border-radius: 10px; padding: 0 18px;
  font-weight: 600; cursor: pointer;
}
.chat-input button:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- 滚动显现动画（渐进增强：仅 JS 可用时隐藏，无 JS / 爬虫默认可见） ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 滚动切入效果变体 ---------- */
/* 从左侧滑入 */
.js .reveal.reveal-left { transform: translateX(-40px); }
.js .reveal.reveal-left.is-visible { opacity: 1; transform: none; }

/* 从右侧滑入 */
.js .reveal.reveal-right { transform: translateX(40px); }
.js .reveal.reveal-right.is-visible { opacity: 1; transform: none; }

/* 缩放淡入 */
.js .reveal.reveal-scale { transform: scale(0.92); }
.js .reveal.reveal-scale.is-visible { opacity: 1; transform: none; }

/* 交错延迟（stagger）— 由 main.js 自动添加 .stagger-N 类 */
.js .reveal.stagger-1 { transition-delay: .1s; }
.js .reveal.stagger-2 { transition-delay: .2s; }
.js .reveal.stagger-3 { transition-delay: .3s; }
.js .reveal.stagger-4 { transition-delay: .4s; }
.js .reveal.stagger-5 { transition-delay: .5s; }
.js .reveal.stagger-6 { transition-delay: .6s; }

/* section 标题统一使用缩放切入 */
.js .section-title.reveal { transform: scale(0.92) translateY(16px); }
.js .section-title.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 通用卡片 ---------- */
.card-soft {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
}
.card-soft:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
/* 卡片作为链接时去除下划线、继承颜色 */
a.card-soft { text-decoration: none; color: inherit; display: block; }

/* ---------- 响应式 ---------- */
@media (max-width: 991px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .nav-menu, .nav-cta .nav-phone { display: none; }
  .nav-toggle { display: flex; }
  .brand span { display: none; }
  .section { padding: 56px 0; }
  .section-title h2 { font-size: 26px; }
  .footer-grid { grid-template-columns: 1fr; }
  /* AI 客服移动端全屏底部弹出 */
  .chat-widget { right: 0; bottom: 0; left: 0; }
  .chat-panel {
    position: fixed; right: 0; left: 0; bottom: 0; top: 0; width: auto; height: auto;
    border-radius: 0; transform: translateY(100%); transition: transform .25s ease; opacity: 1;
  }
  .chat-widget.open .chat-panel { transform: none; }
  .side-rail { bottom: 84px; }
}

/* ============================================================
 * 视觉装饰层（UI 改进）：subhero 装饰 + 企业实力背景纹理
 * - 各子页 .subhero 渐变条统一叠加右侧抽象业务图形（内联 SVG，无新二进制资产）+ 光斑，
 *   弱化纯渐变观感；标题文字始终位于装饰之上（z-index）。
 * - .stats 段叠加点阵纹理，增强层次。
 * ============================================================ */
.subhero { position: relative; overflow: hidden; }
.subhero .container-x { position: relative; z-index: 1; }
.subhero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 88% 18%, rgba(255,255,255,.20), transparent 42%),
    radial-gradient(circle at 8% 92%, rgba(255,255,255,.12), transparent 40%);
}
.subhero::after {
  content: ''; position: absolute; top: 50%; right: 3%; transform: translateY(-50%);
  width: 320px; height: 240px; max-width: 36%; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='320'%20height='240'%20viewBox='0%200%20320%20240'%3E%3Cg%20fill='none'%20stroke='%23ffffff'%20stroke-opacity='0.5'%20stroke-width='2'%3E%3Crect%20x='30'%20y='36'%20width='118'%20height='78'%20rx='12'/%3E%3Crect%20x='184'%20y='86'%20width='104'%20height='66'%20rx='12'/%3E%3Crect%20x='64'%20y='146'%20width='136'%20height='62'%20rx='12'/%3E%3Cpath%20d='M89%20114%20L184%20118'/%3E%3Cpath%20d='M148%2075%20L132%20146'/%3E%3C/g%3E%3Cg%20fill='%23ffffff'%20fill-opacity='0.6'%3E%3Ccircle%20cx='30'%20cy='36'%20r='5'/%3E%3Ccircle%20cx='288'%20cy='86'%20r='5'/%3E%3Ccircle%20cx='64'%20cy='208'%20r='5'/%3E%3C/g%3E%3C/svg%3E");
  background-size: contain; background-repeat: no-repeat; background-position: center right;
}

/* 企业实力（.stats）背景纹理点缀 */
.stats { position: relative; overflow: hidden; }
.stats .container-x { position: relative; z-index: 1; }
.stats::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .14;
  background-image: radial-gradient(rgba(255,255,255,.7) 1.4px, transparent 1.5px);
  background-size: 22px 22px;
}

@media (max-width: 767px) {
  /* 移动端子页 subhero 装饰图形隐藏，避免与文字拥挤 */
  .subhero::after { display: none; }
}

/* 联系方式页 subhero 内 lead 文字去除背景 */
.subhero .lead.subhero-lead { background: none; color: inherit; }
