/* ==========================================================================
   海锝智能 · 公共头部 / 底部组件样式（hd-components）
   --------------------------------------------------------------------------
   说明：
   1. 由 assets/inc/header.js 与 assets/inc/footer.js 动态写入的公共组件样式，
      供所有页面共用（index.html / cases.html / 后续新增页面）。
   2. 页面 <head> 中需先定义 CSS 变量（--hd-primary / --hd-accent 等，
      若缺失本文件提供回退值），再引入本文件：
         <link rel="stylesheet" href="assets/css/hd-components.css">
   3. 依赖 Bootstrap 5.3 基础样式与 Bootstrap Icons（页面自行引入）。
   ========================================================================== */

/* 固定顶栏锚点滚动留白（避免 #hash 被导航遮挡） */
:root {
  --hd-nav-scroll-padding: 112px;
  --hd-ink: #2a3a4d;
  --hd-muted: #5f7080;
  --hd-green: #16a34a;
  --hd-green-light: #dcfce7;
  --hd-primary: #22d3ee;
  --hd-accent: #8b5cf6;
  --hd-line: rgba(44, 96, 66, .16)
}

@media (max-width: 991.98px) {
  :root {
    --hd-nav-scroll-padding: 92px
  }
}

html {
  scroll-padding-top: var(--hd-nav-scroll-padding)
}

[id] {
  scroll-margin-top: var(--hd-nav-scroll-padding)
}

/* ---------------- 顶部导航 .hd-navbar ---------------- */
.hd-navbar {
  background: rgba(5, 10, 24, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(34, 197, 94, .12);
  transition: background .4s, box-shadow .4s;
  min-height: 90px
}

/* 移动端导航加高 */
@media (max-width: 991.98px) {
  .hd-navbar {
    min-height: 72px
  }
}

.hd-navbar.scrolled {
  background: rgba(5, 10, 24, .92);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .45)
}

.hd-navbar .navbar-brand {
  padding: .2rem 0
}

.hd-navbar .hd-logo-img {
  height: 50px;
  width: auto;
  display: block
}

@media (max-width: 991.98px) {
  .hd-navbar .hd-logo-img {
    height: 50px
  }
}

.hd-navbar .nav-link {
  color: #cbd5e1 !important;
  font-size: 1.1rem;
  font-weight: 600;
  padding: .6rem .9rem !important;
  position: relative;
  transition: color .3s
}

.hd-navbar .nav-link::after {
  content: "";
  position: absolute;
  left: .9rem;
  right: .9rem;
  bottom: .25rem;
  height: 2px;
  background: linear-gradient(90deg, var(--hd-primary, #22c55e), var(--hd-accent, #16a34a));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s
}

.hd-navbar .nav-link:hover::after,
.hd-navbar .nav-link.active::after {
  transform: scaleX(1)
}

.hd-navbar .nav-link:hover,
.hd-navbar .nav-link.active {
  color: #4ade80 !important
}

/* ---------------- 英文状态：导航字号小一号，避免长文案折行 ---------------- */
/* 触发条件：index.html 切换 EN 时会把 <html lang> 置为 en；
   未开启语言切换的页面恒为 zh-CN，不会命中以下规则。 */
html[lang="en"] .hd-navbar .nav-link {
  font-size: .88rem;
  white-space: nowrap;
  padding: .6rem .5rem !important
}

html[lang="en"] .hd-navbar .nav-link::after {
  left: .5rem;
  right: .5rem
}

/* 桌面中等宽度（992~1399px）右侧工具区仍在流内，可用空间更窄，再收一档 */
@media (min-width: 992px) and (max-width: 1399.98px) {
  html[lang="en"] .hd-navbar .nav-link {
    font-size: .8rem
  }
}

/* 移动端折叠菜单为纵向排列，空间充裕，字号适当放大保证可读性 */
@media (max-width: 991.98px) {
  html[lang="en"] .hd-navbar .nav-link {
    font-size: .95rem
  }
}

html[lang="en"] .hd-navbar .dropdown-item {
  font-size: .9rem
}

.hd-navbar .dropdown-menu {
  border: 1px solid rgba(34, 197, 94, .18);
  border-radius: 0 0 .5rem .5rem;
  background: rgba(10, 18, 38, .97);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45)
}

/* 大屏：鼠标移入即显示子菜单（替代点击展开），点击菜单项直接跳转 */
@media (min-width: 992px) {
  .hd-navbar .nav-item.dropdown:hover>.dropdown-menu {
    display: block;
    margin-top: 0
  }
}

/* 小屏：折叠菜单展开时子菜单直接平铺显示，保证移动端可见 */
@media (max-width: 991.98px) {
  .hd-navbar .dropdown-menu {
    display: block;
    position: static;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent
  }
}

.hd-navbar .dropdown-item {
  color: #cbd5e1;
  transition: background .25s, color .25s, padding-left .25s
}

.hd-navbar .dropdown-item:hover {
  background: rgba(34, 197, 94, .08);
  color: #4ade80;
  padding-left: 1.6rem
}

.hd-navbar .navbar-toggler {
  border-color: rgba(34, 197, 94, .35)
}

.hd-navbar .navbar-toggler:focus {
  box-shadow: 0 0 0 .2rem rgba(34, 197, 94, .25)
}

/* ---------------- 顶部导航右侧工具区（语言切换 & 400 热线） ---------------- */
.hd-nav-tools {
  flex: 0 0 auto
}

/* PC 端：工具区脱离 container 限制，固定到页面最右侧 */
@media (min-width: 1200px) {
  .hd-navbar .hd-nav-tools {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30
  }

  /* 为最右侧工具区预留空间，避免导航菜单与其重叠 */
  .hd-navbar .navbar-nav {
    margin-right: 17rem
  }
}

/* ---------------- 顶部语言切换 & 400 热线 ---------------- */
.hd-lang {
  display: inline-flex;
  border: 1px solid rgba(34, 197, 94, .35);
  border-radius: 2rem;
  overflow: hidden;
  flex: 0 0 auto
}

.hd-lang button {
  background: transparent;
  border: 0;
  color: #cbd5e1;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
  padding: .3rem .8rem;
  transition: background .3s, color .3s
}

.hd-lang button:hover {
  color: #4ade80
}

.hd-lang button.active {
  background: linear-gradient(90deg, #15803d, #22c55e);
  color: #02121a
}

/* 切换语言时只单独显示当前语言对应的按钮（点击即切换） */
.hd-lang button:not(.active) {
  display: none
}

.hd-hotline {
  display: inline-flex;
  align-items: center;
  color: #4ade80;
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
  white-space: nowrap;
  padding: .32rem .85rem;
  border: 1px solid rgba(34, 197, 94, .35);
  border-radius: 2rem;
  background: rgba(34, 197, 94, .07);
  transition: color .3s, border-color .3s, box-shadow .3s
}

.hd-hotline i {
  animation: hd-ring 2.6s ease-in-out infinite
}

@keyframes hd-ring {

  0%,
  100% {
    transform: rotate(0)
  }

  6% {
    transform: rotate(-14deg)
  }

  12% {
    transform: rotate(12deg)
  }

  18% {
    transform: rotate(-8deg)
  }

  24% {
    transform: rotate(0)
  }
}

.hd-hotline:hover {
  color: #fff;
  border-color: rgba(34, 197, 94, .8);
  box-shadow: 0 0 18px rgba(34, 197, 94, .35)
}

/* ---------------- 页脚 .hd-footer ---------------- */
.hd-footer {
  background: #04070f;
  color: #94a3b8;
  border-top: 1px solid rgba(34, 197, 94, .12)
}

.hd-footer a {
  color: #94a3b8;
  text-decoration: none;
  transition: color .3s, padding-left .3s
}

.hd-footer a:hover {
  color: #4ade80;
  padding-left: .3rem
}

.hd-footer h6 {
  color: #e6f1ff;
  font-weight: 600
}

.hd-footer address {
  font-style: normal;
  line-height: 1.9
}

.hd-footer .hd-footer-ic {
  color: #4ade80
}

.hd-footer .hd-legal-trigger:hover {
  padding-left: 0
}

/* ---------------- 区块眉标 .data-tag（NEWS / PRODUCT MATRIX 等） ---------------- */
@keyframes hd-pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1)
  }

  50% {
    opacity: .7;
    transform: scale(1.18)
  }
}

.hd-section {
  position: relative;
  padding: 1.8rem 0 6rem;
  margin-top: 8rem
}

.hd-section .sec-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2.4rem
}

.hd-section h2 {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 800;
  color: var(--hd-ink);
  margin-top: .9rem
}

.hd-section h2 .bar {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-right: .7rem;
  background: #4ade80;
  transform: rotate(45deg) scale(.9);
  border-radius: 4px;
  box-shadow: 0 0 14px #4ade80;
  animation: hd-bar-pulse 2.4s ease-in-out infinite
}

@keyframes hd-bar-pulse {

  0%,
  100% {
    box-shadow: 0 0 10px var(--hd-primary)
  }

  50% {
    box-shadow: 0 0 24px var(--hd-accent)
  }
}

.hd-section .sec-desc {
  color: var(--hd-muted);
  max-width: 820px;
  margin: 0 auto
}

.data-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  margin: 0 auto;
  font-family: 'Courier New', monospace;
  font-size: .72rem;
  color: #4ade80;
  background: rgba(34, 211, 238, .08);
  border: 1px solid rgba(34, 197, 94, .5);
  border-radius: 4px;
  padding: .15rem .5rem;
  letter-spacing: .05em
}

.data-tag .pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0;
  flex-shrink: 0;
  border-radius: 50%;
  vertical-align: middle;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, .85);
  animation: hd-pulse-dot 1.5s ease-in-out infinite
}

/* ---------------- 隐私政策 / 法律声明弹窗 ---------------- */
body.hd-legal-modal-open {
  overflow: hidden
}

.hd-legal-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease
}

.hd-legal-modal.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto
}

.hd-legal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 14, .72);
  backdrop-filter: blur(4px)
}

.hd-legal-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(85vh, 820px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #0c1220 0%, #070b14 100%);
  border: 1px solid rgba(34, 197, 94, .22);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .55);
  color: #cbd5e1
}

.hd-legal-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(34, 197, 94, .12)
}

.hd-legal-modal-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #e6f1ff;
  line-height: 1.4
}

.hd-legal-modal-close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1;
  padding: .25rem;
  cursor: pointer;
  border-radius: 6px;
  transition: color .2s, background .2s
}

.hd-legal-modal-close:hover {
  color: #4ade80;
  background: rgba(34, 197, 94, .1)
}

.hd-legal-modal-body {
  padding: 1rem 1.5rem 1.5rem;
  overflow-y: auto;
  font-size: .875rem;
  line-height: 1.75
}

.hd-legal-modal-meta {
  margin: 0 0 1rem;
  font-size: .8125rem;
  color: #64748b
}

.hd-legal-modal-body section {
  margin-bottom: 1.15rem
}

.hd-legal-modal-body h3 {
  font-size: .9375rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 .5rem
}

.hd-legal-modal-body p {
  margin: 0 0 .65rem
}

.hd-legal-modal-body ul {
  margin: 0;
  padding-left: 1.25rem
}

.hd-legal-modal-body a {
  color: #4ade80;
  text-decoration: underline;
  text-underline-offset: 2px
}

.hd-legal-modal-body a:hover {
  color: #86efac
}

/* ---------------- 新闻/案例详情 · CMS 富文本移动端自适应 ---------------- */
.hd-detail-layout {
  min-width: 0
}

.hd-detail-layout > * {
  min-width: 0;
  max-width: 100%
}

.hd-article {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word
}

.hd-article pre,
.hd-article code {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word
}

.hd-article img,
.hd-article video,
.hd-article embed,
.hd-article object {
  max-width: 100% !important;
  height: auto !important;
  box-sizing: border-box
}

.hd-article iframe {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0
}

.hd-article table {
  width: 100% !important;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse
}

.hd-article td,
.hd-article th {
  word-break: break-word;
  overflow-wrap: anywhere
}

.hd-article-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0
}

.hd-article-table-wrap table {
  margin: 0
}

.hd-article p,
.hd-article div,
.hd-article section {
  max-width: 100%
}

/* 父容器写死像素宽时，子图靠 max-width 收敛；勿对 img 强制 width:auto，否则会覆盖编辑器的 50%/25% */
.hd-article [style*="width"] img {
  max-width: 100% !important;
  height: auto !important
}

@media (max-width: 575.98px) {
  .hd-article blockquote {
    padding: 1rem 1.1rem
  }

  .hd-article-nav a {
    max-width: 100%;
    white-space: normal;
    justify-content: center;
    text-align: center
  }
}

/* ---------------- 小屏适配 ---------------- */
@media (max-width: 575.98px) {
  .hd-navbar .navbar-brand {
    font-size: 1rem
  }

  .hd-navbar .hd-logo-img {
    height: 50px
  }

  /* 窄屏时导航右侧工具区只保留图标电话，避免挤压 */
  .hd-nav-tools .hd-hotline-text {
    display: none
  }

  .hd-nav-tools .hd-hotline {
    padding: .32rem .55rem
  }
}