/* ===== Header v2（site-header / top-nav / 用户菜单） ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  /* 自包含字体：各页面 body 字体不同，
     不锁定会导致用户名/导航文字基线随页面变化而垂直跳动 */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica", "Arial", sans-serif;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .25s, border-color .25s, box-shadow .25s, backdrop-filter .25s;
}
.site-header.scrolled {
  background: rgba(255,255,255,.3); backdrop-filter: blur(12px);
  border-color: transparent; box-shadow: none;
}
/* 导航条全宽自适应，左右 padding 80px（覆盖 .container 的 max-width 居中） */
.header-inner {
  position: relative;
  display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr); align-items: center; gap: 32px; height: 64px;
  max-width: none; width: 100%; padding: 0 80px;
}
.logo { grid-column: 1; justify-self: start; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 20px; line-height: 1; }
.logo-img { height: 26px; width: auto; display: block; }
.logo-text { font-size: 18px; font-weight: 800; color: var(--color-text-primary); line-height: 1; }
.logo-mark { color: var(--blue); font-size: 16px; }
.top-nav {
  display: flex; align-items: center; height: 30px;
  grid-column: 2; justify-self: center;
}
.header-inner .btn-sm { margin-left: 0; }
.header-auth-btn { grid-column: 3; justify-self: end; margin-left: 0; }
.header-actions{grid-column:3;justify-self:end;display:flex;align-items:center;gap:10px;margin-left:0}
.header-invite.btn-ghost {
  --error: #B24C34;
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 13px; border-radius: var(--r); font-size: 13px; font-weight: 600;
  color: var(--text2); background: var(--surface); border: 1.5px solid var(--border);
  cursor: pointer; transition: all var(--ease);
}
.header-action-icon{width:15px;height:15px;display:block;flex:0 0 15px}
.header-invite.btn-ghost:hover {
  color: var(--primary); background: var(--primary-light); border-color: var(--primary);
}
/* flex 容器：让 inline-flex 的 pill 脱离行盒布局，否则行盒 strut 高度
   随各页面 body 的 font-size/line-height 变化，pill 垂直位置会跨页面抖动 */
.header-user { position: relative; display: flex; align-items: center; }
.header-user::after{content:"";position:absolute;left:0;right:0;top:100%;height:14px}
.header-user__pill {
  height: 36px; border: 1px solid transparent; background: transparent;
  border-radius: 8px; padding: 0; display: inline-flex; align-items: center; gap: 8px;
  color: #1A1A1A; font-family: inherit; font-size: 14px; line-height: 22px; font-weight: 400; cursor: pointer;
  box-shadow: none; transition: color .15s ease;
}
.header-user__pill i { font-size: 10px; color: #1A1A1A; transition: color .15s ease; }
.header-user__avatar {
  width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background:#F4F4F3; color: #fff; font-size: 12px; font-weight: 900; flex-shrink: 0; overflow:hidden;
  border: 0; transition: transform .16s ease;
}
.header-user:hover .header-user__avatar,.header-user:focus-within .header-user__avatar{transform:scale(1.04)}
.header-user__avatar img{width:100%;height:100%;display:block;object-fit:contain}
.header-user__avatar--lg { width: 40px; height: 40px; font-size: 16px; }
.header-user__name { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-user__menu {
  display:none; position: absolute; right: 0; top: calc(100% + 12px); width: 280px; max-width:calc(100vw - 32px); padding: 8px;
  border: 1px solid #E9EBEF; border-radius: 12px; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.08);
  transform: translateY(-4px); overflow:hidden; z-index:320;
}
.header-user:hover .header-user__menu,.header-user:focus-within .header-user__menu{display:block;transform:translateY(0)}
.header-user__card { display: flex; align-items: center; gap: 11px; padding: 10px 10px 12px; width:100%; border:0; border-radius:10px; background:transparent; color:inherit; font-family:inherit; text-align:left; cursor:pointer; }
.header-user__card:hover,.header-user__card:focus-visible{background:#F4F5F7;outline:none}
.header-user__identity{flex:1;min-width:0}
.header-user__card strong { display: block; font-size: 15px; color: #1A1A1A; line-height:20px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.header-user__identity>span { display: block; margin-top: 1px; font-size: 12.5px; line-height:18px; color: #A5A5A5; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.header-user__card .header-user__card-go{margin-left:auto;display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;color:#525252;font-size:12.5px;font-weight:600}
.header-user__card .header-user__card-go i{font-size:9px}
.header-user__points {
  margin: 4px 0 8px; padding: 12px 16px; border-radius: 8px; background: #F3F7FE;
  display: flex; align-items: center; justify-content: space-between; color: #A5A5A5; font-size: 12px; font-weight: 400;
}
.header-user__points span { display: block; line-height: 1.2; }
.header-user__points strong { display:block; margin-top: 0; color: #1A1A1A; font-family: "D-DIN", DIN, "DIN Alternate", Arial, sans-serif; font-size: 24px; line-height:32px; font-weight:700; }
.header-user__recharge {
  height: 32px; padding:0 16px; border: 0; border-radius: 8px; background: linear-gradient(251deg,#1B72FF 8.04%,#796DFF 105.28%); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: inherit; font-size: 14px; line-height:22px; font-weight: 400;
  cursor: pointer; margin:0; box-shadow: none; transition:filter .15s ease;
}
.header-user__recharge:hover{filter:brightness(.96)}
.header-user__links{display:flex;flex-direction:column;gap:4px;width:100%}
.header-user__menu a,.header-user__menu button[role="menuitem"]:not(.header-user__card) {
  width: 100%; height: 40px; padding: 10px 16px; border: 0; border-radius: 8px; background: transparent; color: #1A1A1A;
  display: flex; align-items: center; gap: 8px; font-family: inherit; font-size: 14px; line-height:20px; font-weight: 400; cursor: pointer; text-align: left;
}
.header-user__menu a:hover,.header-user__menu button[role="menuitem"]:not(.header-user__card):hover { background: #F4F5F7; color: #1A1A1A; }
.header-user__menu a>img,.header-user__menu button[role="menuitem"]:not(.header-user__card)>img { width: 20px; height:20px; display:block; object-fit:contain; flex-shrink:0; }
.header-user__divider{height:1px;background:#F0F2F5;margin:4px 0}
#headerLogoutBtn{color:#F5492F}
#headerLogoutBtn:hover{background:#FFF1EE;color:#F5492F}
.top-nav a {
  --nav-badge-space: 0px;
  position: relative; display: inline-flex; align-items: center;
  color: #525252; font-size: 16px; font-weight: 400;
  height: 30px; line-height: 24px; padding-right: var(--nav-badge-space); padding-bottom: 6px; box-sizing: border-box; transition: color .15s;
}
.top-nav a:hover { color: var(--color-brand); }
.top-nav a + a { margin-left: 30px; }
.top-nav a[data-nav="saas"] + a { margin-left: 14px; }
.top-nav a[data-nav="saas"] { --nav-badge-space: 30px; }
.website .top-nav > a[data-nav="saas"] { --nav-badge-space: 0px; padding-right: 0; }
.top-nav__badge {
  position: absolute; top: -4px; right: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 12.35px; border-radius: 6.5px 0 6.5px 0;
  background: linear-gradient(90deg, #FF3834, #FF5143 51%, #FF6F53); color: #fff;
  font-size: 7.8px; font-weight: 500; line-height: 1.2; white-space: nowrap;
}
.website .top-nav > a[data-nav="saas"] .top-nav__badge { top: 4px; right: -28px; }
.website .top-nav > a[data-nav="saas"] + .web-nav-tools { margin-left: 16px; }
/* 下划线：默认隐藏（缩成中点），hover/选中时按文字宽度展开，排除角标预留空间。 */
.top-nav a::after {
  content: ""; position: absolute; left: 0; right: var(--nav-badge-space); bottom: 0;
  height: 2px; border-radius: 2px; background: var(--color-brand);
  transform: scaleX(0); transform-origin: center;
  transition: transform .2s ease;
}
.top-nav a:hover::after { transform: scaleX(1); }
/* 选中态：蓝色加粗文本 + icon 同步变蓝 + 下划线常驻 */
.top-nav a.is-active { color: var(--color-brand); font-weight: 600; }
.top-nav a.is-active::after { transform: scaleX(1); }

/* 内页模式：header 白底常驻并占位（首页 hero 顶到视口顶部则不加此类） */
body.gm-solid-header { padding-top: 64px; }
body.gm-solid-header .site-header {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-line);
}

@media (max-width: 900px) {
  .top-nav { display: none; }
  .header-inner { grid-template-columns: auto 1fr; padding: 0 24px; }
  .header-actions,.header-auth-btn { grid-column: 2; }
}

@media (max-width: 1200px) {
  .header-actions .header-invite .bg-label { display: none; }
  .header-actions .header-invite { height: 32px; padding: 0 10px; }
}

/* 顶栏铃铛（官网 32px 按钮体系；原重复定义在 common/notifications.css，与 saas/open 共用的 main.css 冲突，迁回本文件） */
.notify-bell{position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:var(--r);background:var(--surface);border:1.5px solid var(--border);color:var(--text2);font-size:15px;cursor:pointer;transition:all var(--ease)}
.notify-bell>.header-action-icon,.notify-bell>.ficon{width:15px;height:15px;font-size:15px;line-height:15px}
.notify-bell:hover{border-color:var(--primary);color:var(--primary);background:var(--primary-light)}
.notify-bell:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.notify-bell[aria-expanded="true"]{border-color:var(--primary);color:var(--primary);background:var(--primary-light)}
