/* ==========================================================================
   启赋 KEYFOR · 全站共用外壳样式
   覆盖范围：页头、主导航、移动端抽屉菜单、语言切换按钮、站内搜索
   引入位置：每个页面 </head> 之前，必须位于页面自身 <style> 之后（否则会被覆盖）
   约定：选择器统一带 header.site-shell 前缀，以保证稳定压过各页内联样式
   ========================================================================== */

/* 防横向溢出：移动端页面被撑宽会导致固定页头失效、需要左右滑动才能看到按钮 */
html,body{max-width:100%;overflow-x:hidden}
body.nav-open{overflow:hidden}

/* 双语显隐：全站统一（部分页面自带同样规则，重复无害）。
   新增页面只要用 <span class="zh">/<span class="en"> 成对书写，即自动支持语言切换。
   ⛔ 必须带 !important：本文件下方 `header.site-shell .brand .bt span{display:block}`
     等规则的特异性(0,3,2)高于 `body:not(.lang-en) .en`(0,2,1)，
     不加 !important 会被覆盖 —— 曾导致页头品牌副标题中英两行同时显示。 */
body.lang-en .zh{display:none !important}
body:not(.lang-en) .en{display:none !important}

/* ------------------------------ 页头 ------------------------------ */
header.site-shell{
  position:fixed;top:0;left:0;right:0;z-index:100;
  width:100%;max-width:100vw;
  background:#1B3A5F;
  border-bottom:1px solid rgba(23,139,140,.35);
  /* 必须显式关掉页面里的 backdrop-filter：非 none 的 backdrop-filter/filter/transform
     会让该元素成为 fixed 子元素的包含块，抽屉菜单会被压成 header 的高度而无法铺满屏幕 */
  -webkit-backdrop-filter:none;backdrop-filter:none;
}
header.site-shell .wrap{padding:0 24px}
header.site-shell .nav{
  display:flex;align-items:center;flex-wrap:nowrap;gap:10px;
  height:70px;min-width:0;
}
header.site-shell .brand{
  display:flex;align-items:center;gap:10px;
  flex:0 1 auto;min-width:0;color:#fff;text-decoration:none;
}
header.site-shell .brand .logo{
  width:38px;height:38px;flex:0 0 38px;background:#178B8C;border-radius:3px;
  display:flex;align-items:center;justify-content:center;
  color:#fff;font-weight:800;font-size:14px;letter-spacing:1px;
  box-shadow:0 2px 8px rgba(23,139,140,.25);
}
header.site-shell .brand .bt{line-height:1.3;min-width:0}
header.site-shell .brand .bt b{font-size:17px;letter-spacing:1.5px;white-space:nowrap}
header.site-shell .brand .bt span{display:block;font-size:10px;color:#bcd6e6;letter-spacing:.4px;white-space:nowrap}
header.site-shell .brand .bt span.en{font-size:9px;letter-spacing:.55px}

/* 主导航（桌面） */
header.site-shell nav.menu{
  display:flex;align-items:center;gap:16px;flex-wrap:nowrap;
  margin-left:auto;margin-right:14px;
}
header.site-shell nav.menu a{
  color:#dce6f0;font-size:15px;letter-spacing:.5px;white-space:nowrap;
  padding:6px 0;text-decoration:none;transition:color .2s;
}
header.site-shell nav.menu a:hover{color:#178B8C}

/* 右侧操作区 */
header.site-shell .header-actions{
  display:flex;align-items:center;gap:10px;
  flex:0 0 auto;margin-left:14px;
}
header.site-shell .lang-btn{
  border:1px solid #178B8C;color:#178B8C;background:transparent;
  padding:6px 13px;font-size:13px;letter-spacing:1px;line-height:1.2;
  font-family:inherit;cursor:pointer;white-space:nowrap;
  flex:0 0 auto;transition:.2s;
}
header.site-shell .lang-btn:hover{background:#178B8C;color:#fff}
header.site-shell .hamburger{
  display:none;background:none;border:none;color:#fff;font-size:22px;line-height:1;
  cursor:pointer;padding:6px 4px;flex:0 0 auto;
}
header.site-shell .search-toggle{
  display:none;background:none;border:none;color:#fff;
  cursor:pointer;padding:6px 4px;flex:0 0 auto;line-height:0;
}

/* --------------------------- 站内搜索 --------------------------- */
header.site-shell .site-search{
  position:relative;display:flex;align-items:center;
  flex:0 1 auto;min-width:0;margin:0;
}
header.site-shell .site-search-input{
  width:170px;height:36px;border:1px solid rgba(23,139,140,.55);
  background:rgba(255,255,255,.08);color:#fff;border-radius:20px;
  padding:0 32px 0 16px;font-size:13px;font-family:inherit;outline:none;
  transition:width .2s,border-color .2s,background .2s;
}
header.site-shell .site-search-input::placeholder{color:#bcd6e6}
header.site-shell .site-search-input:focus{border-color:#178B8C;background:rgba(255,255,255,.16);width:210px}
header.site-shell .site-search-clear{
  position:absolute;right:10px;color:#bcd6e6;background:none;border:none;
  font-size:18px;line-height:1;cursor:pointer;
}
header.site-shell .search-results{
  position:fixed;top:70px;right:24px;width:min(440px,92vw);
  max-height:72vh;overflow-y:auto;background:#fff;
  box-shadow:0 16px 44px rgba(27,58,95,.22);border:1px solid #E6E2D8;
  border-radius:8px;z-index:200;padding:8px;
}
header.site-shell .search-results[hidden]{display:none}
header.site-shell .search-item{
  display:block;padding:12px 14px;border-bottom:1px solid #E6E2D8;color:#23303a;
}
header.site-shell .search-item:hover{background:#EEF4F3}
header.site-shell .search-item-title{font-size:15px;color:#1B3A5F;font-weight:600;line-height:1.45;margin-bottom:4px}
header.site-shell .search-item-meta{font-size:12px;color:#5f6b78;margin-bottom:4px}
header.site-shell .search-item-snippet{
  font-size:13px;color:#5f6b78;line-height:1.6;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
header.site-shell .search-empty,
header.site-shell .search-foot{padding:14px;text-align:center;color:#5f6b78;font-size:13px}

/* ------------------- 移动端抽屉菜单与遮罩 ------------------- */
.nav-backdrop{
  position:fixed;top:0;right:0;bottom:0;left:0;
  background:rgba(10,22,36,.45);z-index:98;
  opacity:0;visibility:hidden;transition:opacity .25s,visibility .25s;
}
.nav-backdrop.show{opacity:1;visibility:visible}

/* ============================ 响应式 ============================ */
@media (max-width:1080px){
  /* 页头内容不换行、不溢出；导航收进抽屉 */
  header.site-shell .nav{gap:8px}
  header.site-shell nav.menu{
    position:fixed;top:70px;right:0;bottom:0;left:auto;
    width:min(320px,84vw);
    height:auto;margin:0;padding:8px 0 24px;
    flex-direction:column;align-items:stretch;gap:0;
    background:#1B3A5F;
    box-shadow:-14px 0 34px rgba(10,22,36,.35);
    overflow-y:auto;-webkit-overflow-scrolling:touch;
    transform:translateX(105%);opacity:0;visibility:hidden;
    transition:transform .28s ease,opacity .22s ease,visibility .28s;
    z-index:99;
  }
  header.site-shell nav.menu.open{transform:translateX(0);opacity:1;visibility:visible}
  header.site-shell nav.menu a{
    display:block;width:100%;padding:15px 24px;font-size:16px;
    border-bottom:1px solid rgba(255,255,255,.08);
  }
  header.site-shell nav.menu a:hover{background:rgba(23,139,140,.18)}
  header.site-shell .hamburger{display:block}
  header.site-shell .header-actions{margin-left:auto}
  header.site-shell .search-results{right:12px;left:12px;width:auto}
}

@media (max-width:760px){
  header.site-shell .wrap{padding:0 16px}
  header.site-shell .brand .bt span{display:none}
  header.site-shell .brand .bt b{font-size:15px;letter-spacing:1px}

  /* 搜索收成图标，点开后在页头下方展开一行 */
  header.site-shell .search-toggle{display:inline-flex}
  header.site-shell .site-search{
    position:absolute;top:70px;left:0;right:0;
    display:none;flex:none;padding:10px 16px;
    background:#1B3A5F;border-bottom:1px solid rgba(23,139,140,.35);
    box-shadow:0 10px 22px rgba(10,22,36,.18);
  }
  header.site-shell.search-open .site-search{display:flex}
  header.site-shell .site-search-input{width:100%;height:38px}
  header.site-shell .site-search-input:focus{width:100%}
  header.site-shell.search-open .search-results{top:130px}
  header.site-shell .lang-btn{padding:5px 10px;font-size:12px}
}

@media (max-width:380px){
  header.site-shell .brand .bt{display:none}
}
