/* 暇田数字化中枢 · 统一顶部导航条
   由 nginx sub_filter 注入到各系统页面，不在任何业务代码里引用。
   改这个文件后刷新页面即生效（无需重启服务）。 */

#xtnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 10px;
  background: linear-gradient(90deg, #0b1220 0%, #111c33 55%, #16233d 100%);
  color: #e5e7eb;
  font: 13px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .07), 0 2px 12px rgba(0, 0, 0, .22);
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  box-sizing: border-box;
  max-width: 100vw;
  -webkit-overflow-scrolling: touch;
}
#xtnav::-webkit-scrollbar { height: 0; display: none; }

#xtnav a {
  color: #c7d2e0;
  text-decoration: none;
  border-radius: 7px;
  flex: 0 0 auto;
  transition: background .15s, color .15s;
}

/* 返回上一层：永远放在最左，任何屏幕都看得见 */
#xtnav .xtnav-back {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  margin-right: 8px;
}
#xtnav .xtnav-back:hover { background: rgba(255, 255, 255, .24); }

#xtnav .xtnav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 2px;
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
}
#xtnav .xtnav-brand:hover { background: rgba(255, 255, 255, .08); }

/* 公司 logo（橙色图标）：图片自带白边，放大 130% 裁掉，只留圆角方块 */
#xtnav .xtnav-logo {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  flex: 0 0 auto;
  box-shadow: 0 2px 8px -3px rgba(249, 115, 22, .9);
}
#xtnav .xtnav-logo img {
  position: absolute;
  left: -15%;
  top: -15%;
  width: 130%;
  height: 130%;
  display: block;
}

#xtnav .xtnav-div {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, .14);
  margin: 0 8px;
  flex: 0 0 auto;
}

#xtnav .xtnav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}
#xtnav .xtnav-links a {
  padding: 7px 11px;
  font-size: 13px;
}
/* 手机短名：桌面显示全称，窄屏显示两字短名（见文末 @media） */
#xtnav .xtnav-t-short { display: none; }
#xtnav .xtnav-links a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
#xtnav .xtnav-links a.on {
  background: rgba(249, 115, 22, .28);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(251, 146, 60, .55);
}

/* ---- 由 nav.js 插进各系统自带标题栏的 logo（不进业务代码） ---- */
.xtnav-inline-logo {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
  flex: 0 0 auto;
  box-shadow: 0 3px 10px -5px rgba(226, 96, 11, .85);
}
.xtnav-inline-logo img {
  position: absolute;
  left: -15%;
  top: -15%;
  width: 130%;
  height: 130%;
  display: block;
}
.xtnav-login-logo {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px -12px rgba(226, 96, 11, .9);
}
.xtnav-login-logo img {
  position: absolute;
  left: -15%;
  top: -15%;
  width: 130%;
  height: 130%;
  display: block;
}
.xtnav-head-logo {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 10px;
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .7);
}
.xtnav-head-logo img {
  position: absolute;
  left: -15%;
  top: -15%;
  width: 130%;
  height: 130%;
  display: block;
}

#xtnav .xtnav-sp { flex: 1 1 auto; min-width: 10px; }

#xtnav .xtnav-cur {
  flex: 0 0 auto;
  font-size: 12px;
  color: #93a3b8;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
}

/* 顶栏占位：body 用 border-box，页面自己的 min-height:100vh 不会多出滚屏 */
body.xtnav-in {
  padding-top: 48px;
  box-sizing: border-box;
  min-height: 100vh;
}

/* 成本台账登录框按 100vh 居中，减掉导航条高度，避免出现滚动条 */
body.xtnav-in .login-wrap { height: calc(100vh - var(--xtnav-h, 48px)); }

/* 各系统自带的吸顶栏下移，避免被导航条压住（已知的几个；其余由脚本兜底） */
body.xtnav-in .topbar,
body.xtnav-in .qbar,
body.xtnav-in > header,
body.xtnav-in header.xtnav-shift,
body.xtnav-in nav.tabs { top: var(--xtnav-h, 48px) !important; }

@media (max-width: 640px) {
  #xtnav { height: 46px; padding: 0 5px; gap: 0; }
  body.xtnav-in { padding-top: 46px; }
  #xtnav .xtnav-name,
  #xtnav .xtnav-cur,
  #xtnav .xtnav-t-full { display: none; }
  #xtnav .xtnav-t-short { display: inline; }
  #xtnav .xtnav-links { gap: 0; }
  #xtnav .xtnav-links a { padding: 7px 5px; font-size: 12.5px; }
  #xtnav .xtnav-div { margin: 0 5px; }
  #xtnav .xtnav-back { width: 26px; height: 26px; margin-right: 5px; font-size: 14px; }
  #xtnav .xtnav-brand { padding: 4px 6px 4px 2px; }
  #xtnav .xtnav-logo { width: 24px; height: 24px; }
  #xtnav .xtnav-sp { min-width: 4px; }
}

/* 打印文档时不要导航条 */
@media print {
  #xtnav { display: none !important; }
  body.xtnav-in { padding-top: 0 !important; }
}
