/* 财神国际 — 全局主题（非首页补丁，轻量） */

html {
  --skin__text_primary: #E3E3E3 !important;
  --skin__alt_text_primary: #E3E3E3 !important;
  --skin__home_bg: #1a1a1a !important;
  --skin__bg_1: #1a1a1a !important;
  --skin__bg_2: #262626 !important;
}

/* 启动图：图一 */
.skeleton-screen-main,
.skeleton-custom {
  background: #1a1a1a url(/siteadmin/upload/img/splash-caishen.png) center center / cover no-repeat !important;
}

.skeleton-custom img,
.skeleton-screen-main img,
#skeleton-custom-original-mobile,
#skeleton-custom-original-desktop {
  display: none !important;
}

/* 搜索页 */
body.cs-search-page .lobby-base-header:not(#cs-search-back-bar),
body.cs-search-page [class*="base-header"]:not(#cs-search-back-bar) {
  display: none !important;
}

#cs-search-back-bar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--lobby__max-width, 100%);
  height: 0.94rem;
  display: flex;
  align-items: center;
  padding: 0 0.2rem;
  background: #1a1a1a;
  z-index: 90;
  color: #e3e3e3;
}

.cs-search-back-btn {
  border: none;
  background: transparent;
  width: 0.6rem;
  height: 0.6rem;
  padding: 0;
}

.cs-search-back-icon {
  display: block;
  width: 0.24rem;
  height: 0.24rem;
  border-left: 2px solid #d1ae52;
  border-bottom: 2px solid #d1ae52;
  transform: rotate(45deg);
  margin-left: 0.12rem;
}

.cs-search-back-title {
  font-size: 0.32rem;
  margin-left: 0.08rem;
}

[class*="login-register"] input,
[class*="loginRegister"] input,
.ui-input__input,
.ui-input input {
  background: #2a2a2a !important;
  color: #e3e3e3 !important;
}

/* 全局底栏：隐藏展开层/重复层，只保留一层图标+中文 */
footer.layout-footer {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1002 !important;
  pointer-events: auto !important;
}

footer.layout-footer [class*="_tabbar-bg"],
footer.layout-footer [class*="_expand-tabar"],
footer.layout-footer [class*="_expand-wrapper"],
footer.layout-footer [class*="_tabbar-toggle"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* 保留原生底栏图标+文字，仅隐藏展开重复层（勿再用 ::before/::after 叠中文，否则会双行） */
footer.layout-footer .ui-tabbar .ui-tabbar-item {
  display: flex !important;
  flex: 1 1 0 !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 0 !important;
  min-width: 0 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative !important;
}

footer.layout-footer .ui-tabbar .ui-tabbar-item::before,
footer.layout-footer .ui-tabbar .ui-tabbar-item::after {
  content: none !important;
  display: none !important;
}

/* 统一底栏图标尺寸（防止优惠页恢复可见性后图标撑大） */
footer.layout-footer .ui-tabbar {
  height: var(--tabbar-height, 1.24rem) !important;
  align-items: center !important;
}

footer.layout-footer .ui-tabbar .ui-tabbar-item [class*="_itemContent"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
}

/* 原生底栏默认 flex-end 会把图标+文字贴底，改为在底栏内垂直居中 */
footer.layout-footer .ui-tabbar .ui-tabbar-item [class*="_itemContent"] > [class*="_item_"] {
  justify-content: center !important;
  height: 100% !important;
  padding-bottom: 0 !important;
}

footer.layout-footer .ui-tabbar .ui-tabbar-item img,
footer.layout-footer .ui-tabbar .ui-tabbar-item [class*="_itemImg"],
footer.layout-footer .ui-tabbar .ui-tabbar-item .cs-tab-fallback-icon {
  width: 0.5rem !important;
  height: 0.5rem !important;
  max-width: 0.5rem !important;
  max-height: 0.5rem !important;
  min-width: 0 !important;
  min-height: 0 !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
  margin-bottom: 0.04rem !important;
}

/* 与首页登录/注册按钮同字号 0.24rem */
footer.layout-footer .ui-tabbar .ui-tabbar-item [class*="_text"] {
  font-size: 0.24rem !important;
  line-height: 1.2 !important;
  height: auto !important;
  max-height: 0.3rem !important;
  margin-top: 0 !important;
  overflow: hidden !important;
  -webkit-line-clamp: 1 !important;
}

footer.layout-footer .ui-tabbar .ui-tabbar-item:nth-child(4) [class*="_assembly_"],
footer.layout-footer .ui-tabbar .ui-tabbar-item:nth-child(4) svg {
  display: none !important;
}

footer.layout-footer .ui-tabbar .ui-tabbar-item:nth-child(4) .cs-tab-fallback-icon {
  display: block !important;
  visibility: visible !important;
}

/* 底栏：按 Vue 原生 _active_ 文字类控制图标，禁止 JS 清 display */
footer.layout-footer .ui-tabbar {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: space-around !important;
  width: 100% !important;
  overflow: hidden !important;
  transition: none !important;
  transform: none !important;
}

footer.layout-footer .ui-tabbar .ui-tabbar-item {
  text-align: center !important;
  overflow: hidden !important;
  transition: none !important;
  transform: none !important;
}

footer.layout-footer .ui-tabbar .ui-tabbar-item [class*="_itemContent"] > [class*="_item_"],
footer.layout-footer .ui-tabbar .ui-tabbar-item [class*="_item_"] {
  align-items: center !important;
  width: 100% !important;
}

footer.layout-footer .ui-tabbar .ui-tabbar-item .ui-badge__wrapper {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 0.5rem !important;
  min-width: 0.5rem !important;
  max-width: 0.5rem !important;
  min-height: 0.5rem !important;
  line-height: 0 !important;
  position: relative !important;
  margin: 0 auto 0.04rem !important;
}

footer.layout-footer .ui-tabbar .ui-tabbar-item img,
footer.layout-footer .ui-tabbar .ui-tabbar-item [class*="_itemImg"],
footer.layout-footer .ui-tabbar .ui-tabbar-item [class*="_specialImg"] {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 激活态：文字带 _active_（Vue 原生，非 ui-tabbar-item--active） */
footer.layout-footer .ui-tabbar-item:has([class*="_text"][class*="_active_"]) img[class*="_itemImg"]:not([class*="_itemActiveImg"]),
footer.layout-footer .ui-tabbar-item:has([class*="_text"][class*="_active_"]) i[class*="_itemImg"]:not([class*="_itemActiveImg"]):not([class*="_itemCoreImg"]) {
  display: none !important;
}

footer.layout-footer .ui-tabbar-item:not(:has([class*="_text"][class*="_active_"])) img[class*="_itemActiveImg"],
footer.layout-footer .ui-tabbar-item:not(:has([class*="_text"][class*="_active_"])) i[class*="_itemActiveImg"] {
  display: none !important;
}

/* 存款：两个普通 _itemImg 重复时只留第一个 */
footer.layout-footer .ui-tabbar-item .ui-badge__wrapper > img[class*="_itemImg"]:not([class*="_itemActiveImg"]) ~ img[class*="_itemImg"]:not([class*="_itemActiveImg"]) {
  display: none !important;
}

/* assembly 字体图标叠放 */
footer.layout-footer .ui-tabbar .ui-tabbar-item [class*="_assembly_"] {
  position: relative !important;
  display: block !important;
  width: 0.5rem !important;
  height: 0.5rem !important;
  line-height: 0 !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  margin: 0 auto 0.04rem !important;
}

footer.layout-footer .ui-tabbar .ui-tabbar-item [class*="_assembly_"] [class*="_itemOutsideImg"],
footer.layout-footer .ui-tabbar .ui-tabbar-item [class*="_assembly_"] [class*="_itemCoreImg"] {
  position: absolute !important;
  top: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 0.5rem !important;
  height: 0.5rem !important;
  font-size: 0.48rem !important;
  line-height: 0.5rem !important;
  margin: 0 !important;
}

footer.layout-footer .ui-tabbar-item:has([class*="_text"][class*="_active_"]) [class*="_assembly_"] [class*="_itemOutsideImg"] {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

footer.layout-footer .ui-tabbar-item:not(:has([class*="_text"][class*="_active_"])) [class*="_assembly_"] [class*="_itemCoreImg"] {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

footer.layout-footer .ui-tabbar .ui-tabbar-item [class*="_text"] {
  text-align: center !important;
  width: 100% !important;
}

/* 存款跳转中：解除首页 overlay 对 #app 的遮挡，避免黑屏 */
body.cs-deposit-navigating #app,
html[data-cs-route="deposit"] #app,
body.cs-deposit-navigating #app [class*="main-recharge"],
html[data-cs-route="deposit"] #app [class*="main-recharge"] {
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 优惠/存款等页面：彻底隐藏自定义首页层，避免挡住点击 */
body.cs-promo-active #cs-home-root,
body.cs-promo-ready #cs-home-root,
#cs-home-root[data-cs-suppressed="1"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: -1 !important;
  opacity: 0 !important;
}

/* 存款页必须恢复 #app 可交互（优惠层可能残留 pointer-events:none） */
body.cs-deposit #app,
html[data-cs-route="deposit"] #app {
  pointer-events: auto !important;
  visibility: visible !important;
}

/* 子游戏页：全部/热门/最近/收藏 固定横排（刷新时 chunk CSS 未就绪会竖排） */
[class*="scene-switcher"] {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  overflow-x: auto !important;
  width: 100% !important;
  min-height: 0.55rem !important;
}

[class*="scene-switcher"][class*="is-has-side-tabs"] {
  justify-content: flex-start !important;
}

[class*="scene-switcher"] .ui-tabs__wrap,
[class*="scene-switcher"] .ui-tabs__nav,
[class*="scene-switcher"] .lobby-scroll,
[class*="scene-switcher"] .lobby-scroll > div {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  width: auto !important;
  max-width: 100% !important;
  min-height: 0 !important;
}

[class*="scene-switcher"] .ui-tabs__nav--left {
  flex-direction: row !important;
}

[class*="scene-switcher"] .ui-tab,
[class*="scene-switcher"] [class*="_button_"] {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1.4rem !important;
  min-width: 1.4rem !important;
  height: 0.55rem !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

[class*="scene-switcher"] .ui-tab + .ui-tab,
[class*="scene-switcher"] [class*="_button_"] + [class*="_button_"] {
  margin-left: 0.2rem !important;
}

[dir="rtl"] [class*="scene-switcher"] .ui-tab + .ui-tab,
[dir="rtl"] [class*="scene-switcher"] [class*="_button_"] + [class*="_button_"] {
  margin-left: 0 !important;
  margin-right: 0.2rem !important;
}
