.portal-auth {
  position: relative;
}

.portal-auth__trigger,
.portal-auth__login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0;
}

.portal-auth__avatar,
.portal-auth__avatar-fallback {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: 0 0 22px;
}

.portal-auth__avatar {
  display: block;
  object-fit: cover;
  background: #f2f4f5;
}

.portal-auth__avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #edf6f1;
  color: #057a49;
}

.portal-auth__name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-auth__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1100;
  width: 236px;
  padding: 6px;
  border: 1px solid #e6ebe9;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.14);
  color: #26332d;
}

.portal-auth__menu[hidden] {
  display: none;
}

.portal-auth__identity {
  padding: 8px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid #f0f2f1;
}

.portal-auth__identity strong,
.portal-auth__identity span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-auth__identity strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #1f2a24;
}

.portal-auth__identity span {
  margin-top: 3px;
  font-size: 12px;
  color: #8a978f;
}

/* 菜单项：会员中心 / 退出登录 —— 图标 + 文案，样式完全统一。
   这里做防御性重置，屏蔽站点旧主题给 <a>/<button> 加的下划线、竖线分隔符等装饰。 */
.portal-auth__menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #39483f !important;
  font-size: 13px;
  font-family: inherit;
  line-height: 1;
  letter-spacing: 0;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

.portal-auth__menu-item::before,
.portal-auth__menu-item::after {
  content: none !important;
  display: none !important;
}

.portal-auth__menu-item > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-auth__menu-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: #9aa8a0;
}

.portal-auth__menu-item:hover,
.portal-auth__menu-item:focus-visible {
  background: #f0f7f3;
  color: #057a49 !important;
  outline: none;
}

.portal-auth__menu-item:hover .portal-auth__menu-icon,
.portal-auth__menu-item:focus-visible .portal-auth__menu-icon {
  color: #057a49;
}

/* 退出登录与上方分组，前面留一条细分隔线 */
.portal-auth__menu form {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #f0f2f1;
}

.portal-auth--desktop .portal-auth__trigger,
.portal-auth--desktop .portal-auth__login {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1;
  color: #e5e7e6;
  font-family: inherit;
}

.portal-auth--desktop {
  margin-left: 14px;
}

.e-module-202208180950 .top-nav-height .con .pull-right a.portal-auth__login::after {
  display: none;
}

.portal-auth--desktop .portal-auth__trigger::after {
  width: 6px;
  height: 6px;
  margin-left: 2px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  content: "";
  transform: translateY(-2px) rotate(45deg);
}

.portal-auth--desktop .portal-auth__trigger:hover,
.portal-auth--desktop .portal-auth__trigger:focus-visible,
.portal-auth--desktop .portal-auth__login:hover,
.portal-auth--desktop .portal-auth__login:focus-visible {
  color: #fff;
}

.portal-auth--desktop .portal-auth__avatar,
.portal-auth--desktop .portal-auth__avatar-fallback {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.portal-auth--desktop .portal-auth__avatar-fallback {
  font-size: 12px;
}

.portal-auth--desktop .portal-auth__menu {
  top: 36px;
}

@media (min-width: 1201px) {
  .e-module-202208180950 .top-nav-height {
    height: 32px;
    background-color: #151817;
  }

  .e-module-202208180950 .top-nav-height .con {
    height: 100%;
  }

  .e-module-202208180950 .top-nav-height .con .pull-right {
    margin-right: 0;
  }
}

.portal-auth--mobile {
  display: none;
  flex: 0 0 auto;
  margin-left: 6px;
}

.portal-auth--mobile .portal-auth__trigger,
.portal-auth--mobile .portal-auth__login {
  width: 38px;
  height: 44px;
  justify-content: center;
  padding: 0;
  color: #333;
}

.portal-auth--mobile .portal-auth__trigger > .iconfont,
.portal-auth--mobile .portal-auth__login > .iconfont {
  font-size: 21px;
}

.portal-auth--mobile .portal-auth__avatar,
.portal-auth--mobile .portal-auth__avatar-fallback {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
}

@media (max-width: 1200px) {
  .portal-auth--mobile {
    display: block;
  }
}

@media (max-width: 600px) {
  .e-module-202209210900 .header-new .gbl-header-phone-wrap {
    display: none;
  }
}

/* 站内消息未读红点（页头） */
.portal-auth__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}
.portal-auth__dot[hidden] { display: none; }
/* 桌面：跟在用户名右侧（trigger 是 inline-flex，gap 已给间距） */
/* 移动：trigger 是固定 38×44 图标按钮，改为头像右上角小角标 */
.portal-auth--mobile .portal-auth__dot {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  font-size: 10px;
  border: 1px solid #fff;
}

@media (max-width: 480px) {
  .portal-auth--mobile {
    margin-left: 2px;
  }

  .portal-auth--mobile .portal-auth__trigger,
  .portal-auth--mobile .portal-auth__login {
    width: 34px;
  }

  .portal-auth__menu {
    position: fixed;
    top: 62px;
    right: 8px;
    width: min(220px, calc(100vw - 16px));
  }
}
