/* =============================================================================
 * 公用框架样式 · 版头 / 版尾 / 回到顶部（与首页共享，子页面复用）
 * 依赖：tokens.css（令牌）/ base.css（重置+字体）/ layout.css（版式原语 band / nav-inner / sr-only）
 * 说明：本文件仅含「版头 + 版尾 + 回到顶部」三块的样式（含响应式），
 *      由 index.html 及各子页面统一引用，避免两套样式分叉维护。
 * ========================================================================== */

/* ---------------------------------------------------------------------------
 * 1. 版头（白底通栏 · 左右 60 · 高 91）
 * ------------------------------------------------------------------------ */
/* 吸顶：滚动时固定顶部；sticky 仍是定位包含块，移动端展开菜单 top:100% 仍正确挂在下方 */
.site-nav { position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 12px rgba(0, 0, 0, .08); }

.nav-logo { display: block; }
.nav-logo img { display: block; height: clamp(24px, 2.08vw, 40px); width: auto; }  /* 实测 237×37 */

/* gap 回调加大：上一版 8~44 → 现 16~78（1920 顶宽约 +34，落在 20~40 区间）；中段随视口收窄，nowrap 兜底不换行 */
/* 纵向撑满版头（align-self:stretch）：一级项 hover 区覆盖整条版头，
   二级面板 top:100% 才能紧贴版头下边缘，鼠标从上滑到下无空隙 */
.nav-menu { justify-self: center; align-self: stretch; display: flex; align-items: stretch; gap: clamp(16px, 3.6vw, 78px); }
.nav-item { position: relative; display: flex; align-items: center; }

/* 一级项：白底版头 → 深色字；高度撑满版头，点击/hover 区最大化；nowrap 保证文字绝不换行 */
.nav-menu .nav-item > a {
  position: relative;
  display: inline-flex; align-items: center; height: 100%;
  padding: 0 8px;
  font-size: var(--fs-base); line-height: 1.2; color: var(--c-ink);
  white-space: nowrap;
  transition: color .2s ease;
}
/* hover 指示改为黑色下划线 */
.nav-menu .nav-item > a::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 22%;
  height: 3px; background: #000;
  transform: scaleX(0); transform-origin: left center;
  transition: transform .26s cubic-bezier(.22, .61, .36, 1);
}
.nav-menu .nav-item:hover > a::after,
.nav-menu .nav-item:focus-within > a::after,
.nav-menu .nav-item.is-open > a::after { transform: scaleX(1); }

/* 二级下拉：黑底；默认隐藏，hover / 键盘聚焦时自上方轻推入；左对齐父级 */
.nav-sub {
  position: absolute; top: 100%; left: 8px;
  display: flex; flex-direction: column;
  min-width: 232px;
  padding: 16px 20px;
  background: var(--c-ink);
  box-shadow: 0 20px 44px rgba(0, 0, 0, .16);
  opacity: 0; visibility: hidden; translate: 0 -10px;
  transition: opacity .22s ease, translate .22s ease, visibility .22s ease;
}
.nav-item--has-sub:hover > .nav-sub,
.nav-item--has-sub:focus-within > .nav-sub,
.nav-item--has-sub.is-open > .nav-sub { opacity: 1; visibility: visible; translate: 0 0; }

.nav-sub a {
  display: block; padding: 7px 0;
  font-size: var(--fs-sm); font-weight: 400; line-height: 1.4;
  color: #fff; white-space: nowrap;
  transition: color .18s ease, translate .18s ease;
}
.nav-sub a:hover { color: #777; }

.nav-tools { display: flex; align-items: center; gap: clamp(12px, 1.77vw, 34px); }

.nav-search {
  display: flex; align-items: center; gap: clamp(6px, .5vw, 10px);
  width: var(--nav-search-w); height: var(--nav-search-h);      /* 实测 182×42 */
  padding-inline: clamp(10px, .94vw, 18px);
  background: var(--c-ink); border-radius: 999px;
}
.nav-search svg { width: clamp(12px, .88vw, 17px); height: auto; color: #fff; flex: none; }
.nav-search input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  font-size: var(--fs-sm); color: #fff;
}
.nav-search input::placeholder { color: rgba(255, 255, 255, .55); }
.nav-search-submit { display: flex; align-items: center; justify-content: center; align-self: stretch; flex: none; color: #fff; cursor: pointer; }
.nav-search-submit:focus-visible { outline: 2px solid var(--c-accent-cyan); outline-offset: 3px; }

/* 小屏搜索图标按钮：默认隐藏，≤768 才显示（替代内联搜索框，避免挤压 LOGO） */
.nav-search-toggle {
  display: none; width: 32px; height: 32px; color: var(--c-ink);
  align-items: center; justify-content: center; cursor: pointer;
}
.nav-search-toggle svg { width: 22px; height: 22px; }
/* .nav-search-toggle:hover { color: var(--c-accent-cyan); } */

/* 小屏搜索面板：默认隐藏，展开时在导航下方出现整条搜索框（白底 + 黑色胶囊，随版头配色） */
.nav-search-panel {
  display: none; background: var(--c-paper); padding: 12px var(--gutter-nav);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 8px 16px rgba(0, 0, 0, .06);
}
.nav-search-panel .nav-search { width: 100%; max-width: 560px; margin: 0 auto; }

.lang { display: flex; align-items: baseline; gap: clamp(4px, .42vw, 8px); font-size: var(--fs-base); }
.lang__item { color: var(--c-ink); padding: 0; transition: color .2s ease; }
.lang__item.is-active { color: var(--c-accent-green); }   /* 设计稿 CN 为荧光绿 */
.lang__sep { color: #909090; }                            /* 分隔斜杠实测 #909090 */

/* 点击触发区保持 32×32；图标视觉缩到 20，居中显示 */
.nav-burger { display: none; width: 32px; height: 32px; color: var(--c-ink); align-items: center; justify-content: center; }
.nav-burger svg { width: 24px; height: 24px; }
/* 汉堡→X：三条线用 transform 合成，中点对齐 viewBox 中心 (12,12) 旋转 */
.nav-burger__icon { width: 24px; height: 24px; }
.nav-burger__bar {
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  transform-box: view-box;
  transform-origin: 50% 50%;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), opacity .2s ease;
}
/* 顺序不能反：先 translate 把线移到中心、再绕中心 rotate，两笔才能正交于同一点；
   写成 rotate() translateY() 时 CSS 先转后移，会把中点甩到右/下，X 就歪了 */
.nav-burger.is-open .nav-burger__bar--top { transform: rotate(45deg) translateY(6px); }
.nav-burger.is-open .nav-burger__bar--mid { opacity: 0; }
.nav-burger.is-open .nav-burger__bar--bot { transform: rotate(-45deg) translateY(-6px); }

/* ---------------------------------------------------------------------------
 * 2. 版尾（黑底通栏 · 内容 1560 居中 · 底栏通栏 60 留白）
 * ------------------------------------------------------------------------ */
.site-foot { padding-top: clamp(40px, 4.1vw, 79px); }
.footer-inner { display: grid; grid-template-columns: 30.8% 1fr; align-items: start; }
.footer-logo img { display: block; height: clamp(24px, 2.08vw, 40px); width: auto; }

.footer-cols { display: grid; grid-template-columns: repeat(5, 1fr); }    /* 实测 5 列，列宽 ≈216 */
.footer-col__head {
  display: inline-block; padding-bottom: clamp(8px, .94vw, 18px);
  font-size: var(--fs-lead); color: #fff;              /* 一级标题统一白色 */
  border-bottom: 3px solid #fff;                        /* 默认白；各列用 border-bottom-color 覆盖 */
}
/* 各列下划线保留原配色：青 / 绿 / 橙 / 青 / 白 */
.footer-col--sol  .footer-col__head { border-bottom-color: var(--c-accent-cyan); }
.footer-col--about .footer-col__head { border-bottom-color: var(--c-accent-green); }
.footer-col--mail .footer-col__head { border-bottom-color: var(--c-brand); }
.footer-col--news .footer-col__head { border-bottom-color: var(--c-accent-cyan); }
.footer-col--join .footer-col__head { border-bottom-color: #fff; }
.footer-col ul { margin: clamp(18px, 2.2vw, 42px) 0 0; padding: 0; list-style: none; }
.footer-col li + li { margin-top: clamp(12px, 1.5vw, 29px); }   /* 实测行距 46 */
.footer-col a { font-size: var(--fs-base); color: rgba(255, 255, 255, .88); transition: color .2s ease; }
.footer-col a:hover { color: #fff; }
/* 链接 hover 颜色对齐各列一级标题的下划线色 */
.footer-col--sol  a:hover { color: var(--c-accent-cyan); }
.footer-col--about a:hover { color: var(--c-accent-green); }
.footer-col--mail a:hover { color: var(--c-brand); }
.footer-col--news a:hover { color: var(--c-accent-cyan); }
.footer-col--join a:hover { color: #fff; }

/* 底栏：社交图标组水平居中（grid 1fr auto 1fr 的中间列），版权/政策紧随其右；回到顶部绝对定位靠右 */
.footer-bar {
  position: relative; margin-top: clamp(38px, 9.4vw, 181px);
  padding: clamp(18px, 1.6vw, 30px) var(--gutter-nav);
  display: flex; justify-content: center; align-items: center;
}
.footer-social { grid-column: 2; justify-self: center; display: flex; align-items: center; gap: clamp(10px, 1.15vw, 20px); padding: 0; margin: 0; list-style: none; }
.footer-social img { display: block; width: clamp(20px, 1.56vw, 30px); height: auto; opacity: .9; transition: opacity .2s ease; }
.footer-social a:hover img { opacity: 1; }
.footer-legal { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 46px); font-size: var(--fs-sm); color: #585858; }
.footer-legal a { color: #585858; transition: color .2s ease; }
.footer-legal a:hover { color: #fff; }
/* 回到顶部：固定在视口右下，默认隐藏，滚动超过阈值后由 JS 加 .is-visible 显示 */
.to-top {
  position: fixed; z-index: 50;
  right: var(--gutter-nav);
  bottom: clamp(24px, 4vw, 48px);
  width: clamp(40px, 3.5vw, 56px); height: clamp(40px, 3.5vw, 56px);
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: var(--c-ink); color: var(--c-paper); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s ease, visibility .25s ease, transform .25s ease, background-color .2s ease, color .2s ease;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--c-paper); color: var(--c-ink); }
.to-top .i-arrow-up { width: 46%; height: 46%; }

/* ---------------------------------------------------------------------------
 * 3. 响应式（版头 / 版尾 / 回到顶部）
 * ------------------------------------------------------------------------ */
@media (max-width: 1024px) {
  .nav-menu { display: none; }
  /* 小屏展开：白底满屏（left/right:0 相对全宽 .site-nav），项铺满整行、点击区最大化，分隔用细线 */
  .nav-menu.is-open {
    display: flex; flex-direction: column; align-items: stretch;
    gap: 0;
    position: absolute; left: 0; right: 0; top: 100%;
    width: 100%;
    padding: 0;
    background: var(--c-paper);
    box-shadow: 0 12px 20px rgba(0, 0, 0, .08);
    /* 二级全部展开后菜单会变高：超出屏幕部分可滚动，避免撑破视口 */
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav-menu.is-open .nav-item { display: flex; align-items: center; flex-wrap: wrap; position: relative; }
  .nav-menu.is-open .nav-item > a {
    flex: 1;
    display: flex; align-items: center;
    width: 100%; height: auto;
    padding: 14px var(--gutter-nav);
    border-bottom: 1px solid var(--c-border);
  }
  .nav-menu.is-open .nav-item:last-child > a { border-bottom: 0; }
  /* 折叠态没有 hover，绿下划线无意义，隐藏避免误显示 */
  .nav-menu.is-open .nav-item > a::after { display: none; }
  .nav-menu.is-open .nav-item > a:hover { background: rgba(0, 0, 0, .04); }
  /* 二级：折叠菜单里改为静态展开的白底块，二级项缩进一级 */
  .nav-menu.is-open .nav-sub {
    position: static; width: 100%; min-width: 0;
    padding: 6px 0 8px;
    background: var(--c-paper);
    opacity: 1; visibility: visible; translate: none;
    box-shadow: none;
    display: none;
    flex-basis: 100%;
  }
  .nav-menu.is-open .nav-item--has-sub.is-open > .nav-sub {
    display: flex;
  }
  .nav-menu.is-open .nav-sub a {
    padding: 11px var(--gutter-nav) 11px calc(var(--gutter-nav) + 20px);
    font-weight: 400;
    border-bottom: 1px solid var(--c-border);
    color: var(--c-ink);
  }
  .nav-menu.is-open .nav-sub a:last-child { border-bottom: 0; }
  .nav-menu.is-open .nav-sub a:hover { translate: none; color: #00e5e5; }
  /* 父级 a 右侧 + 号按钮 */
  .nav-menu.is-open .nav-item--has-sub > a {
    flex: 1;
  }
  .nav-sub-toggle {
    display: none;
  }
  .nav-menu.is-open .nav-sub-toggle {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--c-ink);
    cursor: pointer;
    flex-shrink: 0;
  }
  .nav-sub-toggle svg {
    width: 20px;
    height: 20px;
  }
  .nav-sub-toggle .icon-minus {
    display: none;
  }
  .nav-menu.is-open .nav-item--has-sub.is-open .nav-sub-toggle .icon-plus {
    display: none;
  }
  .nav-menu.is-open .nav-item--has-sub.is-open .nav-sub-toggle .icon-minus {
    display: block;
  }
  .nav-burger { display: flex; }
  .nav-inner { grid-template-columns: auto 1fr auto; }
  .nav-tools { justify-self: end; }
}

/* ≤768：仅保留版头搜索面板 + 版尾两列网格等共用规则；
   Hero 等首页专属响应式仍留在 home.css 的 @media(max-width:768px) 中 */
@media (max-width: 768px) {
  /* 小屏：内联搜索框收成图标，点击在导航下方展开整条搜索面板；避免多项挤压 LOGO 变形 */
  .nav-tools .nav-search { display: none; }
  .nav-search-toggle { display: flex; }
  .site-nav.is-search-open .nav-search-panel { display: block; }
  .footer-inner { grid-template-columns: 1fr; gap: clamp(32px, 6vw, 48px); }
  .footer-cols { grid-template-columns: repeat(2, 1fr); gap: clamp(24px, 5vw, 36px); }
  /* 手机两列页脚：“关于我们”现为5项，减小左列上提幅度，避免相邻菜单重叠。 */
  .footer-col--mail { margin-top: -48px; }
  .footer-col--join { margin-top: -24px; }
  .footer-bar { grid-template-columns: 1fr; justify-items: center; row-gap: clamp(12px, 3vw, 20px); padding-bottom: clamp(48px, 12vw, 64px); }
  .footer-social { grid-column: 1; }
  .footer-legal { grid-column: 1; justify-self: center; }
}
