/* =========================
   Shared Header & Footer
   全站统一头尾（优化+冲突修复版）
   说明：
   1) 保留原视觉效果
   2) 修复伪元素冲突 / 双导航冲突 / 变量兜底
   3) 增加低兼容与动效降级
========================= */

/* =============================
   Global Tokens
============================= */
:root {
  /* 容器兜底：防止 --container 未定义导致宽度异常 */
  --container-fallback: min(1200px, 92vw);

  /* Top rail */
  --conn-top-rail-height: 68px;
  --conn-top-rail-max-width: 1200px;
  --conn-top-rail-side-padding: 20px;

  /* Nav color */
  --conn-nav-text: #5b6b7a;
  --conn-nav-text-hover: #334155;
  --conn-nav-text-active: var(--text-dark, #111827);
  --conn-nav-hover-bg: rgba(51, 65, 85, 0.08);
  --conn-nav-focus: rgba(59, 130, 246, 0.45);

  /* Misc */
  --conn-radius-sm: 8px;
  --conn-trans-fast: 0.2s ease;
  --conn-trans-pop: 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 统一容器宽度（带兜底） */
.site-nav,
.site-hero-inner,
.footer-inner {
  width: var(--container, var(--container-fallback));
}

/* =============================
   Header Strategy (冲突修复)
   - 你目前有两套导航：
     A) .site-nav（Hero 内绝对定位）
     B) .conn-top-rail（全局 fixed）
   - 建议在 body 上加互斥类，避免双导航同屏
============================= */
body.use-top-rail .site-nav { display: none; }
body.use-hero-nav .conn-top-rail { display: none; }

/* 给页面内容留出 fixed 顶栏空间（仅 top-rail 方案） */
body.conn-has-top-rail {
  padding-top: var(--conn-top-rail-height);
}

/* =========================
   Shared Header (非首页 Hero)
========================= */
.site-hero {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

/* 左侧偏白，不影响正文阅读 */
.site-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.97) 0%,
    rgba(255, 255, 255, 0.92) 42%,
    rgba(255, 255, 255, 0.55) 70%,
    rgba(255, 255, 255, 0) 100%
  );
}

/* Hero 内旧导航（保留兼容） */
.site-nav {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  padding: 22px 0;
  display: flex;
  align-items: center;
  z-index: 10;
}

.site-nav img {
  height: 68px;
  width: auto;
}

/* Hero 文字内容 */
.site-hero-inner {
  margin: 0 auto;
  position: relative;
  z-index: 3;
  padding: 120px 0 50px;
}

/* 使用 fixed top-rail 时，避免头部留白叠加过大 */
body.use-top-rail .site-hero-inner {
  padding-top: 96px;
}

.site-hero-title {
  max-width: 760px;
}
.site-hero-title h1 {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  letter-spacing: -1px;
  margin-bottom: 8px;
}
.site-hero-title p {
  color: #5b6b7a;
  max-width: 46ch;
}

/* =============================
   Common Layout - Fixed Top Rail
============================= */
.conn-top-rail {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--conn-top-rail-height);
  z-index: 9999;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(16, 24, 40, 0.06);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
}

/* backdrop-filter 不支持时兜底 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .conn-top-rail {
    background: rgba(255, 255, 255, 0.98);
  }
}

.conn-top-rail-inner {
  max-width: var(--conn-top-rail-max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--conn-top-rail-side-padding);
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Brand */
.conn-brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}
.conn-brand img {
  height: 58px;
  width: auto;
  display: block;
}

/* Nav 容器 */
.conn-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--conn-nav-text);
  white-space: nowrap;
}

/* Nav 链接 */
.conn-nav a {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  padding: 6px 10px;
  border-radius: var(--conn-radius-sm);
  transition:
    color var(--conn-trans-fast),
    background-color var(--conn-trans-fast),
    transform var(--conn-trans-pop);
}
.conn-nav a:hover {
  color: var(--conn-nav-text-hover);
  background-color: var(--conn-nav-hover-bg);
  transform: scale(1.06);
}

/* 说明：
   原来 font-weight: 800 会有轻微宽度跳动。
   这里保留 700，并加下划线增强激活态，减少布局抖动。 */
.conn-nav a.is-active {
  font-weight: 700;
  color: var(--conn-nav-text-active);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

.conn-nav a:focus-visible {
  outline: 2px solid var(--conn-nav-focus);
  outline-offset: 2px;
}

/* 内页 Hero 兼容 */
.site-hero.legal-hero {
  position: relative;
}

/* 冲突修复：
   原代码 .site-hero.legal-hero::before 会覆盖 .site-hero::before
   改为 ::after 避免遮罩层冲突 */
.site-hero.legal-hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;   /* inset-inline 兼容写法 */
  right: 0;
  height: 1px;
  background: transparent;
  z-index: 2;
}

/* =============================
   Silk Visual Layer
============================= */
.silk-canvas {
  position: absolute;
  top: -16%;
  width: 62%;
  height: 136%;
  z-index: 1;
  filter: blur(88px);
  pointer-events: none;
}
.silk-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    135deg,
    var(--conn-cyan) 0%,
    #00d4ff 24%,
    var(--conn-blue) 54%,
    var(--conn-indigo) 78%,
    #79d4ff 100%
  );
  background-size: 50% 50%;
  transform-origin: center;
}
.silk-left {
  left: -14%;
  transform: skewY(10deg) scaleX(-1);
  opacity: 0.07;
}
.silk-left::before {
  animation: silkMoveLeft 16s ease-in-out infinite alternate;
}
.silk-right {
  right: -12%;
  transform: skewY(-12deg);
  opacity: 0.62;
}
.silk-right::before {
  animation: silkMoveRight 16s ease-in-out infinite alternate;
}

@keyframes silkMoveRight {
  from { transform: translate(0, 0) rotate(0deg); }
  to   { transform: translate(-16%, -10%) rotate(8deg); }
}
@keyframes silkMoveLeft {
  from { transform: translate(0, 0) rotate(0deg); }
  to   { transform: translate(14%, -10%) rotate(-7deg); }
}

/* =========================
   Footer
========================= */
footer.site-footer {
  background: var(--bg-footer);
  border-top: 1px solid var(--line);
  padding: 52px 0 30px;
}

.footer-inner {
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
  grid-template-rows: auto auto;
  column-gap: clamp(40px, 6vw, 96px);
  row-gap: 14px;
  align-items: start;
  margin-bottom: 28px;
}
.footer-about-title    { grid-column: 1; grid-row: 1; }
.footer-services-title { grid-column: 2; grid-row: 1; }
.footer-about-body     { grid-column: 1; grid-row: 2; }
.footer-services-body  { grid-column: 2; grid-row: 2; }

.footer-title {
  margin: 0;
  color: var(--text-dark);
  font-size: 0.9rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1.35;
  display: flex;
  align-items: baseline;
}

.footer-about-body p,
.footer-services li {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.78;
  letter-spacing: 0.04em;
}
.footer-about-body p { max-width: 40em; }

.footer-services {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 28px;
  row-gap: 10px;
}
.footer-services li::before {
  content: "•";
  color: var(--conn-blue);
  margin-right: 8px;
  font-weight: 700;
  line-height: 1;
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* 版权 / 法律 / 技术栈 */
  align-items: center;
  gap: 16px;
}

.copyright {
  color: var(--text-muted);
  font-size: 0.85rem;
  justify-self: start;
}

.footer-legal {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-legal a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--conn-trans-fast), opacity var(--conn-trans-fast);
}
.footer-legal a:hover { color: var(--text-main); }
.footer-legal .sep { color: #b8c4d2; }

.tech-stack {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}
.tech-divider {
  width: 1px;
  height: 12px;
  background: var(--line);
}
.tech-stack strong {
  color: var(--text-main);
  letter-spacing: normal;
}

/* =========================
   Responsive
========================= */
@media (max-width: 900px) {
  .conn-nav {
    gap: 12px;
    font-size: 0.86rem;
    /* 防止 nowrap 在小屏溢出 */
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .conn-brand img { height: 30px; }
  .site-nav img { height: 46px; }
  .site-hero-inner { padding: 104px 0 42px; }
  body.use-top-rail .site-hero-inner { padding-top: 88px; }

  .footer-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    row-gap: 14px;
  }
  .footer-about-title    { grid-column: 1; grid-row: 1; }
  .footer-about-body     { grid-column: 1; grid-row: 2; }
  .footer-services-title { grid-column: 1; grid-row: 3; }
  .footer-services-body  { grid-column: 1; grid-row: 4; }

  .footer-services { grid-template-columns: 1fr; row-gap: 8px; }

  .footer-bottom {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .footer-legal,
  .tech-stack { justify-self: start; }
}

/* =========================
   Reduced Motion
========================= */
@media (prefers-reduced-motion: reduce) {
  .silk-canvas::before { animation: none !important; }

  .conn-nav a {
    transition: none;
  }
  .conn-nav a:hover {
    transform: none;
  }
}










/* 主内容区域（按你项目实际类名） */
/* 主内容区域（按你项目实际类名） */
/* 主内容区域（按你项目实际类名） */
/* 主内容区域（按你项目实际类名） */
/* 主内容区域（按你项目实际类名） */
/* 主内容区域（按你项目实际类名） */

html, body {
  height: 100%;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* 主内容区域（按你项目实际类名） */
main,
.site-main,
.page-main {
  flex: 1 0 auto;
}

footer.site-footer {
  margin-top: auto;
  flex-shrink: 0;
}