/* ============================================================
   brand.css —— 品牌标识 + 全站动态背景层 + 联系方式细节
   （在 base.css / layout.css / home.css / pages.css 之后加载）
   ============================================================ */

/* ---------- 1. 全站动态背景（70% 透明度） ----------
   固定于视口，铺满全屏，随页面滚动保持不动；
   70% 透明度使其仅作为氛围底纹，不影响正文可读性。
   z-index:0 位于所有内容之下；页面主体背景已改为半透明，
   因此内页同样能看到动态背景。

   ⚠ 性能：固定层在滚动中会持续重绘，这里给它独立的合成层
   （transform + will-change），避免每帧重新栅格化视频。 */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  /* 兜底底色：视频未加载时呈现淡蓝灰，不出现白闪 */
  background: #dfe8f2;
  pointer-events: none;
  /* 提升为独立合成层，滚动时不再逐帧重绘 */
  transform: translateZ(0);
  will-change: transform;
}
.site-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 需求：70% 透明背景 —— 30% 不透明度 */
  opacity: 0.3;
  filter: saturate(1.25) contrast(1.06);
  /* 提示合成器该元素为纯视频层，可跳过主线程重绘 */
  transform: translateZ(0);
}
/* body 自身白底会遮住固定背景，改为透明让 .site-bg 透出 */
body {
  background-color: transparent;
}

/* 深色区域上的遮罩：改为「上浅下深」的渐变，让动态背景在页头透出。
   之前是rgba(10,18,32,0.72) 平铺 + 区块底色 0.82，两层叠加后约 94% 不透明，
   等于把背景完全挡死。现大幅降低整体不透明度。 */
.site-header ~ main .hero,
.hero { background-color: transparent; }

.hero::after,
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  /* 上半部更透（让背景纹理清晰可见），
     下半部稍实（标题与描述文字所在处，保证对比度） */
  background: linear-gradient(
    180deg,
    rgba(8, 16, 30, 0.34) 0%,
    rgba(8, 16, 30, 0.52) 55%,
    rgba(8, 16, 30, 0.72) 100%
  );
  pointer-events: none;
  z-index: -1;
}
/* 页头整体额外压一层，保证导航栏（LOGO / 菜单项）在背景上清晰可读 */
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--header-h, 72px);
  background: linear-gradient(
    180deg,
    rgba(6, 12, 24, 0.72) 0%,
    rgba(6, 12, 24, 0.34) 70%,
    transparent 100%
  );
  pointer-events: none;
  z-index: -1;
}

/* ---------- 1.4 全站透出策略（性能优化版） ----------
   ⚠ 性能教训：初版给每个区块都加了 backdrop-filter: blur()，
   实测首页同时有 6 块「全屏级」毛玻璃（1407×786 等），
   每帧都要对整个视口做模糊运算，叠加 2 个视频解码 → 滚动严重掉帧。
   现改为：
   1) **彻底移除 backdrop-filter**（含 -webkit-前缀，共 16 处）；
   2) 改用「半透明底色 + 背景层自身降饱和」达到同样的通透观感，
      模糊本就是装饰性的，去掉后视觉几乎无差别但性能提升一个量级；
   3) 深色区块同样只保留半透明底色。 */
.trust-band,
.section--light,
.page-section,
.page-section.alt-bg,
.demo-section,
.home-cta,
.section,
.hold-form,
.sample-panel {
  background-color: rgba(255, 255, 255, 0.42) !important;
}
/* 浅灰区块略深一点，保持原有层次区分 */
.section--light,
.page-section.alt-bg { background-color: rgba(244, 247, 251, 0.46) !important; }

/* 卡片与内容容器：接近不透明，保证正文可读性 */
.card,
.step-card,
.agent-card,
.solution-card,
.case-card,
.value-card,
.algo-item,
.product-card,
.case-item,
.form-card,
.contact-card,
.demo-card,
.arch-layer,
.panel,
.upload-panel,
.result-panel,
.model-chip,
.hold-card,
.showcase-card {
  background-color: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* 深色区块内的卡片（如平台能力 5 步卡）需用深色不透明底，否则文字被背景冲淡 */
.step-card,
.pipeline .step-card,
.section--ink .card {
  background-color: rgba(22, 35, 59, 0.96) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
/* pipeline 区块加深，保证深色区标题（白色）的对比度 */
/* 深色区块内的段落/标签提亮，防止背景光效透出压低对比度 */

/* 页面主体抬升到背景之上（注意：不能给 .site-header 加 position，
   否则会覆盖其原有的 fixed 定位；它自带 z-index:100，无需处理） */
body > main,
body > footer,
body > .mobile-drawer { position: relative; z-index: 2; }

/* 深色区块底色改为半透明，让动态背景透出。
   必须带 !important —— 上面的浅色规则同样带 !important 且选择器更宽，
   若不带则会被白底压掉，深色区变成"白底白字"。
   不使用 backdrop-filter（性能考虑，见 1.4 说明）。
   ⚠ 不透明度要克制：叠加 ::after 遮罩后需保证白色标题仍有足够对比度。 */
.hero,
.page-hero,
.section--ink,
.pipeline,
.site-footer,
.cta-band {
  background-color: rgba(10, 18, 32, 0.46) !important;
}
/* pipeline 进一步加深，保证白色标题对比度（内容较密集，需更实的底） */
.pipeline { background-color: rgba(11, 20, 36, 0.82) !important; }
.site-footer { background-color: rgba(10, 18, 32, 0.88) !important; }
.cta-band { background-color: rgba(10, 18, 32, 0.62) !important; }
.pipeline .sec-title { color: #eaf1fc; }
.pipeline .sec-desc { color: var(--ink-text-2); }
/* 深色区块内的段落/标签提亮，防止背景光效透出压低对比度 */
.pipeline .sec-eyebrow { color: var(--brand-bright); }
.pipeline .hint { color: var(--ink-text-2); }
.pipeline .hint b { color: var(--brand-bright); }

/* ---------- 1.5 全局兜底 ----------
   main 内部直接子级若仍是完全不透明底，统一降为半透明白，
   兜住未列举到的区块类名（如后续新增页面）。 */
main > section:not([class*="hero"]):not([class*="cta"]),
main > section > .container > .page-section {
  background-color: transparent;
}

/* ---------- 2. 品牌标识（LOGO 图片版） ----------
   公司 LOGO 为「图形标 + 华楷煜科技 + HUAKAIYU」竖向锁定组合，
   在导航中放大展示（宽度 164px），比原图形标更醒目。 */
.brand {
  gap: 14px;
}
/* 导航中的 LOGO：横版锁定组合（图形标 + 华楷煜科技 / HUAKAIYU）
   高度 46px —— 相比原 34px 占位图形标明显放大，品牌识别更充分 */
.brand-logo {
  flex: none;
  width: auto;
  height: 46px;
  max-width: none;
  object-fit: contain;
  object-position: left center;
}
.site-footer .brand-logo { height: 58px; }

/* 导航滚动后转白底：LOGO 需换回深色文字版 */
.site-header .brand-logo { content: url("../img/logo-h-light@2x.png"); }
.site-header.scrolled .brand-logo,
.site-header.solid .brand-logo { content: url("../img/logo-h-dark@2x.png"); }

.brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand .brand-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: inherit;
}
.brand .brand-sub {
  margin-top: 1px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--brand-bright);
  transition: color 0.3s ease;
}
.site-header.scrolled .brand .brand-sub,
.site-header.solid .brand .brand-sub { color: var(--brand-deep); }
.site-footer .brand .brand-sub { color: var(--brand-bright); }

/* 原 SVG 换色规则已失效（改用图片），保留无害的兼容样式 */
.site-header.scrolled .brand svg,
.site-header.solid .brand svg { display: none; }

/* 页脚 LOGO 下方说明文字与 LOGO 之间的间距 */
.site-footer .brand { margin-bottom: 20px; }
.site-footer .footer-desc { max-width: 360px; }

/* ---------- 3. 联系方式细节 ---------- */
.footer-contact .k {
  width: 32px;
  font-size: 13px;
}
.footer-contact a { color: #eaf1fc; }
.footer-contact a:hover { color: var(--brand-bright); }
.footer-contact .f-note {
  font-size: 12px;
  color: var(--ink-text-3);
}
.contact-info a { color: var(--text-1); font-weight: 600; }
.contact-info a:hover { color: var(--brand-deep); }
.ci-note {
  display: inline-block;
  margin-left: 10px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-deep);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
}

/* ---------- 4. 移动端：背景更淡，避免干扰阅读 ---------- */
@media (max-width: 768px) {
  .site-bg-video { opacity: 0.22; }
  .brand-logo { height: 38px; }
  .site-footer .brand-logo { height: 48px; }
}
/* 极窄屏：LOGO 适度缩小，保证导航项有足够空间 */
@media (max-width: 400px) {
  .brand-logo { height: 33px; }
}

/* ---------- 4.1 横向溢出兜底 ----------
   固定背景层与浮动卡片可能撑出视口宽度，这里统一兜住，
   避免移动端出现横向滚动条（文字被裁切）。 */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}
.site-bg { max-width: 100vw; }
/* Hero 浮动卡片超出画框时改为向内收，避免撑宽页面 */
@media (max-width: 1180px) {
  .float-card--a { left: 0; }
  .float-card--b { right: 0; }
}

/* ---------- 5. 无障碍：减少动态效果时暂停背景视频 ---------- */
@media (prefers-reduced-motion: reduce) {
  .site-bg { display: none; }
  .hero, .page-hero, .section--ink, .pipeline, .site-footer, .cta-band {
    background-color: var(--ink);
  }
}

/* 打印时隐藏背景 */
@media print {
  .site-bg { display: none; }
}