/**
 * 统一头部导航（对齐个人中心）
 * 左：返回；中：标题；右：原有操作 + 语言 + 消息
 * 排除：dragon_*、index、center（自有顶栏）
 */
:root{
  --cy-topbar-bg:#0a1020;
  --cy-topbar-h:.56rem;
  --cy-topbar-fs:.17rem;
  --cy-topbar-text:#e8efff;
}

#wrap,
#miner-lang-switch{
  display:none !important;
}

body.has-cy-topbar .page-hd{
  height:0 !important;
  min-height:0 !important;
  padding:0 !important;
  margin:0 !important;
  overflow:visible !important;
  background:transparent !important;
  border:0 !important;
}

body.has-cy-topbar .page,
body.has-cy-topbar .page.my,
body.has-cy-topbar .page.page-bg{
  padding-top:calc(var(--cy-topbar-h) + env(safe-area-inset-top, 0px)) !important;
}

body.has-cy-topbar .header:not(.trans-header):not(.cy-header){
  position:fixed !important;
  left:0; right:0; top:0;
  z-index:900;
  display:flex !important;
  align-items:center;
  justify-content:space-between;
  height:auto !important;
  min-height:var(--cy-topbar-h);
  padding:.06rem .14rem !important;
  padding-top:calc(.06rem + env(safe-area-inset-top, 0px)) !important;
  box-sizing:border-box;
  background:var(--cy-topbar-bg) !important;
  background-image:none !important;
  border:0 !important;
  border-bottom:0 !important;
  box-shadow:none !important;
  color:var(--cy-topbar-text) !important;
}

body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .header-left,
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .header-right{
  position:relative !important;
  width:auto !important;
  min-width:1.2rem;
  flex:0 0 auto;
  display:flex;
  align-items:center;
  box-sizing:border-box;
  padding:0 !important;
}
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .header-left{
  justify-content:flex-start;
}
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .header-right{
  justify-content:flex-end;
  gap:.1rem;
  right:auto !important;
  text-align:right;
  font-size:var(--cy-topbar-fs) !important;
}
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .header-right > a:not(.cy-icon-btn){
  color:var(--cy-topbar-text) !important;
  font-size:var(--cy-topbar-fs) !important;
  font-weight:500;
  text-decoration:none;
  white-space:nowrap;
}

body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .header-title{
  flex:1;
  text-align:center;
  color:var(--cy-topbar-text) !important;
  font-size:var(--cy-topbar-fs) !important;
  font-weight:600;
  letter-spacing:.02em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  line-height:1.2;
}
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .header-title a{
  color:rgba(232,239,255,.55) !important;
  font-size:var(--cy-topbar-fs) !important;
  font-weight:500;
  text-decoration:none;
  margin:0 .08rem;
}
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .header-title a.action,
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .header-title .action{
  color:#fff !important;
  font-weight:700;
}

/* 返回：左箭头 + 文字 */
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .left-arrow,
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .cy-back{
  position:relative !important;
  left:auto !important;
  top:auto !important;
  margin:0 !important;
  width:auto !important;
  height:.4rem !important;
  display:inline-flex !important;
  align-items:center;
  gap:.04rem;
  padding:0 .04rem 0 0;
  color:var(--cy-topbar-text) !important;
  font-size:var(--cy-topbar-fs) !important;
  font-weight:500;
  text-decoration:none;
  background:transparent !important;
  border:0 !important;
  -webkit-tap-highlight-color:transparent;
}
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .left-arrow:before{
  content:"" !important;
  position:static !important;
  display:inline-block;
  width:.12rem; height:.12rem;
  border:0 !important;
  border-left:.02rem solid #e8efff !important;
  border-bottom:.02rem solid #e8efff !important;
  transform:rotate(45deg);
  top:auto !important;
  left:auto !important;
  margin-right:.02rem;
}
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .left-arrow:after{
  content:"返回";
  color:var(--cy-topbar-text);
  font-size:var(--cy-topbar-fs);
  font-weight:500;
  line-height:1;
}

/* 语言 / 消息：无外框（仅普通 .header 顶栏；勿覆盖首页 .cy-header） */
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .cy-lang-wrap,
body.has-cy-topbar .page-hd .cy-lang-wrap{
  position:relative;
  display:inline-flex;
  align-items:center;
  height:.4rem;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .cy-lang-select,
body.has-cy-topbar .page-hd .cy-lang-select{
  appearance:none; -webkit-appearance:none;
  height:.4rem;
  width:.72rem;
  min-width:.72rem;
  max-width:.72rem;
  padding:0 .18rem 0 0;
  border:0 !important;
  outline:0;
  background:transparent !important;
  color:var(--cy-topbar-text) !important;
  font-size:var(--cy-topbar-fs) !important;
  font-weight:500;
  line-height:.4rem;
  cursor:pointer;
}
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .cy-lang-select option,
body.has-cy-topbar .page-hd .cy-lang-select option{ color:#111; background:#fff; }
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .cy-lang-wrap::after,
body.has-cy-topbar .page-hd .cy-lang-wrap::after{
  content:"";
  position:absolute; right:0; top:50%;
  width:0; height:0;
  border-left:.045rem solid transparent;
  border-right:.045rem solid transparent;
  border-top:.055rem solid rgba(232,239,255,.85);
  transform:translateY(-35%);
  pointer-events:none;
}
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .cy-icon-btn,
body.has-cy-topbar .page-hd .cy-icon-btn{
  width:.36rem; height:.36rem;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  text-decoration:none;
  padding:0;
}
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .cy-icon-btn svg,
body.has-cy-topbar .page-hd .cy-icon-btn svg{
  width:.22rem; height:.22rem; display:block;
}
body.has-cy-topbar .header:not(.trans-header):not(.cy-header) .cy-icon-btn:active,
body.has-cy-topbar .page-hd .cy-icon-btn:active{ opacity:.75; }

/* 排行榜 / 交易顶栏：同样挂语言 + 消息（不套 has-cy-topbar，避免破坏自有布局） */
.rank-top-actions,
.trans-header .header-right{
  display:inline-flex !important;
  align-items:center;
  justify-content:flex-end;
  gap:.1rem;
  min-width:1.2rem;
}
.rank-top-actions .cy-lang-wrap,
.trans-header .cy-lang-wrap{
  position:relative;
  display:inline-flex;
  align-items:center;
  height:.4rem;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}
.rank-top-actions .cy-lang-select,
.trans-header .cy-lang-select{
  appearance:none; -webkit-appearance:none;
  height:.4rem;
  width:.72rem;
  min-width:.72rem;
  max-width:.72rem;
  padding:0 .18rem 0 0;
  border:0 !important;
  outline:0;
  background:transparent !important;
  color:#e8efff !important;
  font-size:.17rem !important;
  font-weight:500;
  line-height:.4rem;
  cursor:pointer;
}
.rank-top-actions .cy-lang-wrap::after,
.trans-header .cy-lang-wrap::after{
  content:"";
  position:absolute; right:0; top:50%;
  width:0; height:0;
  border-left:.045rem solid transparent;
  border-right:.045rem solid transparent;
  border-top:.055rem solid rgba(232,239,255,.85);
  transform:translateY(-35%);
  pointer-events:none;
}
.rank-top-actions .cy-icon-btn,
.trans-header .cy-icon-btn{
  width:.36rem; height:.36rem;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  text-decoration:none;
  padding:0;
}
.rank-top-actions .cy-icon-btn svg,
.trans-header .cy-icon-btn svg{
  width:.22rem; height:.22rem; display:block;
}
