/* 优尔品牌 · 全站统一页头组件
   两套状态：首屏透明底白字 / 滚动玻璃白底深字，切换统一 0.6s 平滑过渡
   红圈来源：statics/rsit/css/all.css 77-117 行；电话为静态号码
   命名空间 ub-，与站内原有页头样式隔离。 */

:root{
  --ub-red:#E01E24;
  --ub-ink:#181818;
  --ub-ease:cubic-bezier(.4,0,.2,1);
}
.ub-head,.ub-head *,.ub-menu,.ub-menu *{box-sizing:border-box;}

/* 首屏只留一层很轻的顶部渐变，避免大块深色阴影；滚动进入白底后淡出 */
.ub-shade{
  position:fixed;left:0;top:0;width:100vw;height:120px;
  background:linear-gradient(180deg,rgba(0,0,0,.30) 0%,rgba(0,0,0,.16) 55%,rgba(0,0,0,0) 100%);
  pointer-events:none;z-index:9997;opacity:0;
  transition:opacity .6s var(--ub-ease);
}
body.ub-light-hero .ub-shade{opacity:1;}
body.ub-scrolled .ub-shade{opacity:0;}

.ub-head{
  /* 固定 100vw：各页滚动条宽度不同，避免切页时整排导航左右移动 */
  position:fixed;left:0;top:0;right:auto;width:100vw;z-index:9998;
  display:flex;align-items:center;justify-content:space-between;
  /* 尺寸恒定：首屏与滚动后同一套，不再放大/缩小，避免整排字“呼吸” */
  padding:15px 9.375vw;font-size:0;
  font-family:'PingFang SC','Microsoft YaHei',"Helvetica Neue",Helvetica,Arial,sans-serif;
  /* 1203：不再过渡 backdrop-filter（动画模糊每帧重算，滚动时最贵），
     改为即时生效；只过渡底色与位移 */
  transition:transform .45s var(--ub-ease),
             background-color .35s var(--ub-ease);
}
.ub-head.up{transform:translateY(-101%);}
/* 滚动后只换底：白玻璃 + 模糊，尺寸与字号不动 */
.ub-head.bg{
  /* 1203b：去掉 backdrop-filter。页头一旦带模糊，盖在视频上会强制整块视频重绘，
     首屏视频在滚动越过 80px 后会整体变暗；改用接近实白的不透明底，观感几乎一致 */
  background-color:rgba(255,255,255,.94);
  box-shadow:0 1px 0 rgba(15,15,20,.06);
}

/* 首屏白字可读性靠文字阴影，不靠大面积深色遮罩 */
.ub-head:not(.bg) .ub-brand{filter:drop-shadow(0 1px 8px rgba(0,0,0,.55));}
.ub-head:not(.bg) .ub-nav a,
.ub-head:not(.bg) .ub-slogan,
.ub-head:not(.bg) .ub-tel{text-shadow:0 1px 10px rgba(0,0,0,.65);}

/* 左侧 logo 与标语 */
.ub-brand{display:inline-flex;align-items:center;text-decoration:none;flex:0 0 auto;}
.ub-logo-wrap{position:relative;display:block;height:40px;}
.ub-logo{display:block;height:40px;width:auto;transition:opacity .6s var(--ub-ease);}
.ub-logo-dark{position:absolute;left:0;top:0;opacity:0;}
.ub-head.bg .ub-logo-white{opacity:0;}
.ub-head.bg .ub-logo-dark{opacity:1;}
.ub-slogan{
  display:inline-block;font-size:18px;line-height:1;color:#fff;
  white-space:nowrap;transition:color .6s var(--ub-ease);
}
.ub-slogan::before{
  /* 用 px 而非 rem：各页根字号不同，rem 会改变品牌区宽度并推动导航 */
  content:"";display:inline-block;width:1px;height:24px;
  background:rgba(255,255,255,.2);vertical-align:middle;margin:0 40px;
  transition:background-color .6s var(--ub-ease);
}
.ub-head.bg .ub-slogan{color:rgba(0,0,0,.5);}
.ub-head.bg .ub-slogan::before{background:#ccc;}

/* 7 项主导航与红圈：当前页常驻 + 悬停出现 */
.ub-nav{flex:1 1 auto;display:flex;justify-content:flex-end;}
.ub-nav ul{display:flex;align-items:center;margin:0;padding:0;list-style:none;}
.ub-nav li{
  position:relative;display:flex;align-items:center;margin:0 0 0 2vw;list-style:none;
}
.ub-nav li::before{
  content:"";display:block;position:absolute;left:-12px;top:50%;
  width:44px;height:44px;border:2px solid var(--ub-red);border-radius:50%;
  transform:translateY(-50%) scale(0,0);opacity:0;
  transition:ease .5s;z-index:0;pointer-events:none;
}
.ub-nav li:hover::before,
.ub-nav li.ub-current::before{transform:translateY(-50%) scale(1,1);opacity:.5;}
.ub-nav a{
  position:relative;z-index:1;display:block;
  font-size:16px;line-height:1.2;color:#fff;text-decoration:none;
  white-space:nowrap;
  transition:color .3s var(--ub-ease);
}
.ub-head.bg .ub-nav a{color:rgba(0,0,0,.5);}
.ub-head .ub-nav li:hover a,
.ub-head .ub-nav li.ub-current a{color:var(--ub-red);}

/* 静态电话号码：号码完全静止，滚动后随白底转为深色 */
.ub-tel{
  display:inline-flex;align-items:center;flex:0 0 auto;margin-left:2vw;
  font-size:16px;line-height:1;color:#fff;text-decoration:none;white-space:nowrap;
  font-family:Arial,Helvetica,sans-serif;
  transition:color .6s var(--ub-ease);
}
.ub-head.bg .ub-tel{color:var(--ub-ink);}
.ub-tel-digits{display:inline-flex;align-items:center;line-height:1;font-variant-numeric:tabular-nums;}
.ub-tel-digits i{display:inline-flex;align-items:center;font-style:normal;font-size:1em;line-height:1;}

/* 移动端汉堡与全屏菜单 */
.ub-burger{
  display:none;position:relative;width:44px;height:44px;flex:0 0 auto;
  background:none;border:0;cursor:pointer;padding:0;
}
.ub-burger span{
  display:block;position:absolute;left:10px;width:24px;height:2px;background:#fff;
  transition:transform .35s ease,opacity .35s ease,background-color .6s var(--ub-ease);
}
.ub-burger span:nth-child(1){top:15px}
.ub-burger span:nth-child(2){top:21px}
.ub-burger span:nth-child(3){top:27px}
.ub-head.bg .ub-burger span{background:var(--ub-ink);}
.ub-burger.open span:nth-child(1){transform:translateY(6px) rotate(45deg)}
.ub-burger.open span:nth-child(2){opacity:0}
.ub-burger.open span:nth-child(3){transform:translateY(-6px) rotate(-45deg)}
.ub-menu{
  position:fixed;inset:0;z-index:9996;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  background:rgba(17,17,17,.97);
  opacity:0;visibility:hidden;
  transition:opacity .4s ease,visibility .4s ease;
}
.ub-menu.open{opacity:1;visibility:visible;}
.ub-menu ul{list-style:none;margin:0;padding:0;text-align:center;}
.ub-menu li{margin:14px 0;list-style:none;}
.ub-menu a{color:#fff;font-size:26px;text-decoration:none;transition:color .3s ease;}
.ub-menu li.ub-current a,.ub-menu a:hover{color:var(--ub-red);}
.ub-menu-tel{margin-top:30px;color:#fff;font-size:18px;text-align:center;}
body.ub-menu-open{overflow:hidden;}

@media (max-width:1024px){
  .ub-head{padding:10px 5vw;}
  .ub-head.bg{padding:10px 5vw;}
  .ub-logo,.ub-logo-wrap{height:32px;}
  .ub-slogan{display:none;}
  .ub-nav,.ub-tel{display:none;}
  .ub-burger{display:block;}
}
@media (prefers-reduced-motion:reduce){
  .ub-head,.ub-head *,.ub-shade,.ub-menu{transition:none;}
}

/* ============================================================
   全站滚动性能（1202）
   老站 statics/rsit/css/all.css 内有 227 条 transition:all，以及多条
   transition:width 1.8s / 3s。滚动时鼠标停在页面上，滚过的元素反复
   进入/离开 hover，width 这类布局属性一旦进入过渡，浏览器每帧都要
   重排整页：实测 3 秒滚动 165 次 Layout / 206 次 RecalcStyle。
   修法：ub-head.js 在滚动期间给 <html> 打 .ub-scrolling，把过渡属性
   限制在绘制/合成类（颜色、透明度、transform、阴影），布局属性不再
   参与过渡；滚动停止 180ms 后自动恢复，静止时的 hover / 入场动效不变。
   A/B：Layout 165→5，RecalcStyle 206→56，Task 0.363s→0.113s。
   ============================================================ */
html.ub-scrolling *,
html.ub-scrolling *::before,
html.ub-scrolling *::after{
  transition-property:color,background-color,border-color,opacity,transform,box-shadow,filter!important;
}
/* 页头是 fixed 定位、不参与文档流，保留它原有的过渡定义。
   否则上面的属性列表会与页头原有的 duration 列表错位，
   滚动时白底与 logo 深浅的过渡状态会变，实测顶部 100px 出现可见色差。 */
html.ub-scrolling .ub-head{
  transition:transform .45s var(--ub-ease),background-color .35s var(--ub-ease)!important;
}
html.ub-scrolling .ub-head *,
html.ub-scrolling .ub-shade,
html.ub-scrolling .ub-menu,
html.ub-scrolling .ub-menu *{
  transition:color .6s var(--ub-ease),opacity .6s var(--ub-ease),
             background-color .6s var(--ub-ease),transform .45s var(--ub-ease)!important;
}

/* 老站电话数字用 font-size 跑 telno 无限动画（每页 13 个节点），
   每次关键帧改字号都会触发全文档样式重算。停掉该装饰动画，号码保持静态字号。 */
[class*="btmTelI"],[class*="navTelI"]{animation:none!important;}
