/* 全站账户入口：头像、下拉功能菜单、桌面悬停提示 */
.ha-wrap{position:relative;display:inline-flex;align-items:center;flex:0 0 auto}
.ha-wrap .head-account{
  gap:8px;height:36px;padding:0 10px 0 4px;border-radius:999px;
  font-size:14.5px;font-weight:600;justify-content:flex-start;
}
.ha-avatar,.ha-menu-avatar{
  display:grid;place-items:center;flex:0 0 auto;border-radius:50%;
  color:#fff;font-weight:750;letter-spacing:0;
  background:linear-gradient(145deg,#221f5c,#3d3997);
  box-shadow:0 0 0 1px rgba(46,43,122,.12);
}
.ha-avatar{width:28px;height:28px;font-size:13px}
.ha-menu-avatar{width:44px;height:44px;font-size:18px}
.ha-wrap .head-account.is-on{background:#f6f5fc;border-color:#e3e0f4;color:#2e2b7a}
.ha-wrap .head-account.is-on:hover,.ha-wrap.is-open .head-account{
  background:#fff;border-color:rgba(240,122,32,.55);color:#c86413;
  box-shadow:0 6px 18px rgba(34,31,92,.09);
}
body .zy-site-header .head-account .ha-txt-short{display:none!important}
.ha-caret{display:inline-flex;align-items:center;justify-content:center;color:#857fb4;transition:transform .18s ease}
.ha-wrap.is-open .ha-caret,.ha-wrap:hover .ha-caret{transform:rotate(180deg)}

.ha-menu{
  position:absolute;top:calc(100% + 10px);right:0;z-index:130;
  width:320px;padding:9px;border:1px solid #e6edf2;border-radius:16px;
  background:#fff;box-shadow:0 22px 56px rgba(18,32,44,.18),0 4px 14px rgba(18,32,44,.06);
  opacity:0;visibility:hidden;transform:translateY(-6px);
  transition:opacity .18s ease,transform .18s ease,visibility .18s ease;
}
.ha-menu:before{
  content:"";position:absolute;right:23px;top:-6px;width:11px;height:11px;
  border-left:1px solid #e6edf2;border-top:1px solid #e6edf2;background:#fff;
  transform:rotate(45deg);
}
.ha-wrap:hover .ha-menu,.ha-wrap:focus-within .ha-menu,.ha-wrap.is-open .ha-menu{
  opacity:1;visibility:visible;transform:translateY(0);
}
.ha-menu-user{
  display:flex;align-items:center;gap:11px;padding:11px 11px 13px;
  border-bottom:1px solid #edf2f6;margin-bottom:6px;
}
.ha-menu-id{min-width:0;flex:1;line-height:1.35}
.ha-menu-id b{display:block;color:#12202c;font-size:16px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ha-menu-id small{display:block;color:#64748b;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:3px}
.ha-online{
  flex:0 0 auto;padding:3px 8px;border-radius:999px;background:#e9f7f4;color:#0b7c6b;
  font-size:12px;font-weight:650;
}
.ha-menu-list{display:flex;flex-direction:column;gap:2px}
.ha-menu-link{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:11px 12px;border-radius:9px;color:#334155;text-decoration:none;
  transition:background .15s ease,color .15s ease;
}
.ha-menu-link span{min-width:0}
.ha-menu-link b{display:block;font-size:15.5px;font-weight:600;line-height:1.4;color:#24384a}
.ha-menu-link small{display:block;font-size:13px;line-height:1.4;color:#718191;margin-top:2px}
.ha-menu-link i{font-style:normal;color:#b1bcc6;font-size:19px;line-height:1}
.ha-menu-link:hover{background:#f4f4fb;color:#2e2b7a}
.ha-menu-link:hover b{color:#2e2b7a}
.ha-menu-foot{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  border-top:1px solid #edf2f6;margin-top:7px;padding:10px 11px 4px;
}
.ha-logout{font-size:14px;font-weight:600;color:#b42318;text-decoration:none}
.ha-logout:hover{text-decoration:underline}
.ha-menu-foot>span{font-size:12px;color:#8b99a6}

/* 手机和平板：显示“我的”，保留头像，点按展开 */
@media (max-width:1199px){
  body .zy-site-header .head-account .ha-txt-full{display:none!important}
  body .zy-site-header .head-account .ha-txt-short{display:inline!important}
  body .zy-site-header .head-account{
    width:auto!important;min-width:64px!important;height:34px!important;
    padding:0 9px 0 4px!important;gap:5px!important;border-radius:999px!important;
    justify-content:flex-start!important;
  }
  .ha-avatar{width:25px;height:25px;font-size:11px}
  .ha-caret{display:none}
  .ha-menu{right:-2px;width:min(320px,calc(100vw - 24px))}
}

@media (max-width:600px){
  .ha-menu{
    position:fixed;left:12px;right:12px;top:70px;width:auto;
    max-height:calc(100vh - 84px);overflow:auto;
  }
  .ha-menu:before{display:none}
}

@media (max-width:359px){
  body .zy-site-header .head-account{padding-right:7px!important;min-width:58px!important}
  .ha-menu{left:8px;right:8px}
}

/* 触屏设备只认点按展开，避免 :hover 粘住导致第二次点按关不掉 */
@media (hover:none){
  .ha-wrap:hover .ha-menu{opacity:0;visibility:hidden;transform:translateY(-6px)}
  .ha-wrap.is-open .ha-menu{opacity:1!important;visibility:visible!important;transform:translateY(0)!important}
}
