/* TungstenCloud 2.1.8 — targeted header and home-page corrections.
 * This file is loaded in <head> after the shell CSS so its rules are stable. */

/* Keep the desktop sidebar rail continuous on tall pages. */
@media (min-width: 901px) {
  html[theme="tungstencloud"] .template > .el-container,
  html[theme="tungstencloud"] .product > .el-container {
    background: linear-gradient(90deg, var(--color-menu-bg) 0 228px, transparent 228px) !important;
  }
}

/* Desktop top bar: every interactive item uses the same box and baseline. */
@media (min-width: 901px) {
  html[theme="tungstencloud"] .el-header {
    height: 72px !important;
    min-height: 72px !important;
    padding: 0 24px !important;
  }

  html[theme="tungstencloud"] .el-header .header-left,
  html[theme="tungstencloud"] .el-header .header-right {
    height: 72px !important;
    min-height: 72px !important;
    display: flex !important;
    align-items: center !important;
  }

  html[theme="tungstencloud"] .el-header .header-right {
    gap: 8px !important;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
  }

  html[theme="tungstencloud"] .el-header .header-right > .header-right-item,
  html[theme="tungstencloud"] .el-header .header-right > .car-item,
  html[theme="tungstencloud"] .el-header .header-right > .hg-24 {
    width: 46px !important;
    min-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
  }

  html[theme="tungstencloud"] .el-header .header-right > .language-item {
    width: 58px !important;
    min-width: 58px !important;
  }

  html[theme="tungstencloud"] .el-header .header-right > .account-item {
    width: 60px !important;
    min-width: 60px !important;
  }

  html[theme="tungstencloud"] .el-header .header-right .el-popover__reference-wrapper,
  html[theme="tungstencloud"] .el-header .header-right .el-dropdown,
  html[theme="tungstencloud"] .el-header .header-right .el-badge {
    width: 46px !important;
    height: 46px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
  }

  html[theme="tungstencloud"] .el-header .header-right .right-item,
  html[theme="tungstencloud"] .el-header .header-right .el-dropdown-country,
  html[theme="tungstencloud"] .el-header .header-right .el-dropdown-header {
    width: 46px !important;
    min-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 12px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
  }

  html[theme="tungstencloud"] .el-header .header-right .right-item > img,
  html[theme="tungstencloud"] .el-header .header-right .right-item .el-badge img {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    object-fit: contain !important;
    margin: 0 !important;
  }

  html[theme="tungstencloud"] .el-header .header-right .el-dropdown-country > img {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    flex: 0 0 26px !important;
    object-fit: cover !important;
    margin: 0 !important;
    border-radius: 6px !important;
  }

  html[theme="tungstencloud"] .el-header .header-right .el-dropdown-header {
    width: 58px !important;
    min-width: 58px !important;
    padding: 0 4px !important;
  }

  html[theme="tungstencloud"] .el-header .header-right .language-item .el-dropdown,
  html[theme="tungstencloud"] .el-header .header-right .language-item .el-dropdown-country {
    width: 58px !important;
    min-width: 58px !important;
  }

  html[theme="tungstencloud"] .el-header .header-right .account-item .el-dropdown,
  html[theme="tungstencloud"] .el-header .header-right .account-item .el-dropdown-header {
    width: 60px !important;
    min-width: 60px !important;
  }

  html[theme="tungstencloud"] .el-header .header-right .el-dropdown-header .head-box {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 16px !important;
    line-height: 36px !important;
    border-radius: 11px !important;
  }

  html[theme="tungstencloud"] .el-header .header-right .right-icon {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1 !important;
  }

  html[theme="tungstencloud"] .el-header .header-right .el-badge__content.is-fixed {
    top: 4px !important;
    right: 3px !important;
    transform: translateY(-45%) translateX(55%) scale(.92) !important;
  }
}

/* The banner previously displayed a static “service operational” badge. The
 * markup is removed in 2.1.8; this fallback hides cached markup as well. */
html[theme="tungstencloud"][data-tc-page="home"] .tc-home-status,
html[theme="tungstencloud"][data-tc-page="home"] .tc-overview-status,
html[theme="tungstencloud"][data-tc-page="home"] .tc-live-status {
  display: none !important;
}

html[theme="tungstencloud"][data-tc-page="home"] .tc-overview-head {
  justify-content: flex-start !important;
}

/* Referral heading and reward action: no absolute positioning, no negative
 * offsets, and no overlap at browser zoom levels. */
html[theme="tungstencloud"][data-tc-page="home"] .recommend-box-open .recommend-top {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(88px, 108px) !important;
  align-items: start !important;
  gap: 12px !important;
}

html[theme="tungstencloud"][data-tc-page="home"] .recommend-box-open .recommend-top .left {
  min-width: 0 !important;
  padding-top: 0 !important;
}

html[theme="tungstencloud"][data-tc-page="home"] .recommend-box-open .recommend-top .left .row1 {
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
}

html[theme="tungstencloud"][data-tc-page="home"] .recommend-box-open .recommend-top .left .row1 .title-text {
  min-width: 0 !important;
  margin: 0 !important;
  font-size: 18px !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
}

html[theme="tungstencloud"][data-tc-page="home"] .recommend-box-open .recommend-top .left .row1 .reword {
  min-width: 0 !important;
  min-height: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 3px 8px 3px 5px !important;
  border: 0 !important;
  border-radius: 7px !important;
  color: #fff !important;
  background: linear-gradient(180deg, #f65352 0%, #ea6b6b 100%) !important;
  font: inherit !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}

html[theme="tungstencloud"][data-tc-page="home"] .recommend-box-open .recommend-top .left .row1 .reword img {
  position: static !important;
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
  margin: 0 !important;
  object-fit: contain !important;
}

html[theme="tungstencloud"][data-tc-page="home"] .recommend-box-open .recommend-top .right {
  width: 100% !important;
  max-width: 108px !important;
  height: auto !important;
  max-height: 108px !important;
  object-fit: contain !important;
  align-self: start !important;
  justify-self: end !important;
}

@media (min-width: 901px) and (max-width: 1380px) {
  html[theme="tungstencloud"][data-tc-page="home"] .recommend-box-open .recommend-top {
    grid-template-columns: minmax(0, 1fr) 84px !important;
  }

  html[theme="tungstencloud"][data-tc-page="home"] .recommend-box-open .recommend-top .left .row1 {
    grid-template-columns: 1fr !important;
    justify-items: start !important;
  }

  html[theme="tungstencloud"][data-tc-page="home"] .recommend-box-open .recommend-top .right {
    max-width: 84px !important;
    max-height: 90px !important;
  }
}

@media (max-width: 900px) {
  html[theme="tungstencloud"] .template > .el-container,
  html[theme="tungstencloud"] .product > .el-container {
    background: transparent !important;
  }
}

/* Authenticated console: guest action must never be shown. */
html[theme="tungstencloud"] .el-header .header-right .un-login { display: none !important; }
