/*
 * 与 H5 index 对齐的 rem 体系（同 Taro pxtransform）：
 *   html.fontSize = clamp(10, 40 * min(宽,高) / 750, 40)   （由页面内联脚本设置）
 *   设计稿 px → rem = px / 40
 *   例：750 设计宽 = 18.75rem；375 屏根字号 20px → 版心 375px
 * PC（≥751px）锁定 html 32px，版心固定 750px（与 app.less 一致）。
 */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #292929;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}

::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  -webkit-appearance: none;
}
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

a { color: inherit; text-decoration: none; }
button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
img { display: block; max-width: 100%; }

.index-ssr-body {
  width: 100%;
  height: 100%;
}

#rmjk-h5-root {
  width: 100%;
  height: 100%;
}

[data-home-view] {
  height: 100%;
}

.page-container.home-page-index {
  width: 18.75rem;
  height: 100vh;
  max-height: 100vh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: #fff;
}

body[data-rmjk-tab]:not([data-rmjk-tab="index"])[data-rmjk-taro="ready"] #container {
  display: block;
}
body[data-rmjk-tab="index"] #container,
body[data-rmjk-taro="loading"] #container {
  display: none;
}
body[data-rmjk-tab] #container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 750px);
  height: 100vh;
  z-index: 10;
}
body[data-rmjk-tab] #container taro-tabbar {
  display: none;
}
body[data-rmjk-tab] #container .taro-tabbar__panel {
  height: 100%;
}
body[data-rmjk-tab]:not([data-rmjk-tab="index"]) #rmjk-h5-root {
  position: relative;
  z-index: 20;
  pointer-events: none;
}
body[data-rmjk-tab]:not([data-rmjk-tab="index"]) .page-container.home-page-index {
  background: transparent;
  box-shadow: none;
}
body[data-rmjk-tab]:not([data-rmjk-tab="index"]) .index-bottom-tabbar,
body[data-rmjk-tab]:not([data-rmjk-tab="index"]) .client-tab-page {
  pointer-events: auto;
}
body[data-rmjk-shell="page"] .index-bottom-tabbar {
  display: none;
}

/* —— 顶部固定区（设计稿 209） —— */
.home-top-insert-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5.225rem;
  z-index: 999;
  background: #fff;
}

.home-top-search-bar {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  margin-top: 1rem;
  height: 1.8rem;
  width: 100%;
}

.home-top-insert-icon {
  width: 5.2rem;
  height: 1.4rem;
  margin-left: 1rem;
  object-fit: contain;
}

.home-top-search-container {
  width: 11.175rem;
  height: 1.8rem;
  display: flex;
  align-items: center;
  background: #FDF4F0;
  border-radius: 0.9rem;
  overflow: hidden;
  margin-left: 0.5rem;
}

.home-top-search-icon {
  width: 1rem;
  height: 1rem;
  margin-left: 0.45rem;
}

.home-top-search-text {
  font-weight: 300;
  font-size: 0.7rem;
  color: #97999F;
  line-height: 0.7rem;
  margin-left: 0.375rem;
}

.home-top-tab-bar-container {
  width: 100%;
  height: 2.425rem;
  margin-top: 2.8rem;
}

.tb-navTabBox { width: 100%; color: #333; }
.longTab { width: 100%; }
.tab-bar-scroll {
  white-space: nowrap;
  overflow-x: auto;
  position: relative;
}
.tab-bar-scroll-container {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  background: #fff;
  min-width: 100%;
}
.padding-view {
  padding-left: 0.5rem;
  width: 0;
  height: 100%;
  flex: 0 0 auto;
  display: inline-block;
}
.longItem {
  height: 2.425rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  line-height: 2.425rem;
  font-weight: 400;
  color: #333641;
  padding: 0 0.475rem;
  flex: 0 0 auto;
}
.longItem.click {
  color: #333641;
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 2.125rem;
}

/* —— 列表区 —— */
.home-list-container {
  position: relative;
  z-index: 20;
  width: 100%;
  margin-top: 5.225rem;
  height: calc(100% - 5.225rem - 50px - env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  white-space: nowrap;
}
.home-list-container-web {
  height: calc(100% - 5.225rem - 50px - env(safe-area-inset-bottom, 0px));
}
.home-list-page-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: flex-start;
  min-width: 18.75rem;
}
.home-list-page-view {
  width: 18.75rem;
  height: 100%;
  display: none;
  white-space: normal;
}
.home-list-page-view.is-active { display: block; }
.home-list-page-scroll {
  width: 18.75rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.home-list-pull-indicator,
.home-list-load-more {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8b8b8b;
  font-size: 0.65rem;
}
.home-list-load-more { min-height: 2rem; }

.home-banner-container {
  position: relative;
  width: 18.75rem;
  height: 8.45rem;
  background: #fff;
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
  z-index: 30;
  flex-shrink: 0;
}
.bv-banner-container {
  width: 17.225rem;
  height: 7.75rem;
  margin: 0 auto;
  padding: 0.35rem 0.825rem 0 0.725rem;
  position: relative;
  box-sizing: content-box;
}
.bv-swiper-box {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 0.2rem;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.banner-slide {
  display: none;
  width: 100%;
  height: 100%;
}
.banner-slide.is-active { display: block; }
.banner-image-container {
  position: relative;
  width: 100%;
  height: 100%;
}
.bv-swiper-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
}
.bv-ad-label {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  padding: 0.1rem 0.25rem;
  border-radius: 0.1rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.5rem;
}
.bv-indicator-dots {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: absolute;
  left: 0;
  bottom: 1rem;
  z-index: 10;
}
.bv-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: #fff;
}
.bv-active {
  width: 1.25rem;
  height: 0.4rem;
  border-radius: 0.5rem;
  background: #fff;
  transition: width 0.3s;
}

.home-web-collection-container {
  width: 100%;
  height: 8.6rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 0.175rem;
  padding-bottom: 0.1rem;
  background: transparent;
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}
.home-web-collection-item {
  width: 8.55rem;
  height: 3.9rem;
  margin-top: 0.2rem;
  overflow: hidden;
  border-radius: 0.2rem;
}
.home-web-collection-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-cell-container {
  width: 100%;
  height: 5rem;
  position: relative;
  display: block;
}
.title-label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  word-break: break-all;
  position: absolute;
  top: 0.5rem;
  left: 1rem;
  width: 10.75rem;
  height: 2.55rem;
  max-height: 2.55rem;
  font-size: 0.8rem;
  color: #292929;
  line-height: 1.275rem;
  font-weight: 400;
}
.none-image-title { width: 16.55rem !important; }
.article-icon {
  position: absolute;
  width: 5.35rem;
  height: 4.05rem;
  left: 12.575rem;
  top: 0.5rem;
  overflow: hidden;
  border-radius: 0.1rem;
  object-fit: cover;
}
.desc-label {
  position: absolute;
  left: 1rem;
  top: 3.725rem;
  width: 10.75rem;
  height: 0.55rem;
  color: #8b8b8b;
  font-size: 0.55rem;
  line-height: 0.55rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.article-ad-label {
  display: inline-block;
  height: 0.55rem;
  margin-right: 0.3rem;
  padding: 0 0.125rem;
  border: 1px solid #e96842;
  border-radius: 0.075rem;
  color: #e96842;
  font-size: 0.45rem;
  line-height: 0.5rem;
  vertical-align: top;
}
.desc-right { margin-left: 1.075rem; }
.article-cell-bottom-line-container {
  width: 100%;
  padding: 0 1rem;
  position: absolute;
  bottom: 0;
}
.article-cell-bottom-line {
  width: 100%;
  background: #eeeeee;
  height: 1.5px;
}

.large-image-article-cell {
  display: block;
  position: relative;
  width: 100%;
  padding: 0.6rem 0.725rem 0;
  background: #fff;
}
.large-image-article-cover {
  width: 17.3rem;
  height: 8.975rem;
  object-fit: cover;
  border-radius: 0.1rem;
}
.large-image-article-ad-label {
  position: absolute;
  right: 1.075rem;
  bottom: 0.975rem;
  padding: 0.1rem 0.25rem;
  border-radius: 0.1rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.5rem;
}
.large-image-article-divider {
  width: 100%;
  height: 1.5px;
  margin-top: 0.6rem;
  background: #eee;
}

.topic-cell-container {
  display: block;
  width: 100%;
}
.topic-cell-content-box {
  margin: 0.625rem 0.725rem 0.5rem;
  aspect-ratio: 2 / 1;
  overflow: hidden;
}
.image-box {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.topic-cell-bottom-line-container {
  width: 100%;
  padding: 0 1rem;
}
.topic-cell-bottom-line {
  width: 100%;
  background: #eeeeee;
  height: 1.5px;
}

.feed-ad-cell { display: block; width: 100%; }
.feed-ad-image-container {
  position: relative;
  margin: 0.6rem 0.725rem 0;
}
.feed-ad-image {
  width: 100%;
  height: 7rem;
  object-fit: cover;
  border-radius: 0.2rem;
}
.feed-ad-label {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  padding: 0.1rem 0.25rem;
  border-radius: 0.1rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.5rem;
}
.feed-ad-divider {
  margin: 0.6rem 1rem 0;
  height: 1.5px;
  background: #eee;
}

.home-list-empty {
  margin: 2rem 0;
  text-align: center;
  color: #8b8b8b;
  font-size: 0.7rem;
}
.list-bottom-tabbar-insert {
  height: max(0.8rem, 16px);
  width: 18.75rem;
  flex-shrink: 0;
}

/* —— 底部 tabbar（weui 物理 px，与 Taro H5 一致） —— */
.taro-tabbar.index-bottom-tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 101;
  display: flex;
  width: 100%;
  height: 50px;
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  box-sizing: content-box;
}
.index-bottom-tab.weui-tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 5px;
  min-width: 0;
}
.weui-tabbar__icon.index-bottom-tab-icon {
  display: block;
  width: 27px;
  height: 27px;
  margin: 0 auto;
}
.weui-tabbar__icon.index-bottom-tab-icon img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}
.weui-tabbar__label.index-bottom-tab-label {
  margin: 0;
  padding: 0;
  font-size: 10px;
  line-height: 1.8;
  text-align: center;
  color: #8B8B8B;
}
.index-bottom-tab.is-active .weui-tabbar__label,
.index-bottom-tab.weui-bar__item_on .weui-tabbar__label {
  color: #E36228;
}

.client-tab-page {
  height: calc(100% - 50px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  padding: 0.8rem 0.8rem calc(0.8rem + 16px);
  background: #fff;
}
.client-tab-page h1 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}
.client-tab-list {
  display: flex;
  flex-direction: column;
}
.client-tab-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3.5rem;
  border-bottom: 1px solid #eee;
  font-size: 0.75rem;
}
.client-tab-item img {
  width: 4.8rem;
  height: 3.2rem;
  object-fit: cover;
  flex-shrink: 0;
}

@media (min-width: 751px) {
  html {
    font-size: 32px !important;
  }

  body {
    background: #e8eaed;
  }

  .page-container.home-page-index {
    width: 750px !important;
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.12);
  }

  .home-top-insert-view {
    width: 750px !important;
    height: 132px !important;
  }

  .home-top-search-bar {
    top: 24px !important;
    height: 44px !important;
    margin-top: 0 !important;
    justify-content: center !important;
  }

  .home-top-insert-icon {
    width: 144px !important;
    height: 39px !important;
    margin-left: 0 !important;
  }

  .home-top-search-container {
    width: 400px !important;
    height: 44px !important;
    margin-left: 16px !important;
    border-radius: 22px !important;
  }

  .home-top-search-icon {
    width: 24px !important;
    height: 24px !important;
    margin-left: 14px !important;
  }

  .home-top-search-text {
    margin-left: 10px !important;
    font-size: 16px !important;
    line-height: 20px !important;
  }

  .home-top-tab-bar-container {
    width: 100% !important;
    height: 60px !important;
    margin-top: 72px !important;
  }

  .padding-view {
    padding-left: 24px !important;
  }

  .longItem {
    height: 60px !important;
    padding: 0 18px !important;
    font-size: 20px !important;
    line-height: 60px !important;
  }

  .longItem.click {
    font-size: 26px !important;
    line-height: 60px !important;
  }

  .home-list-container,
  .home-list-container-web {
    width: 750px !important;
    margin-top: 132px !important;
    height: calc(100% - 132px - 50px - env(safe-area-inset-bottom, 0px)) !important;
  }

  .home-list-page-container {
    min-width: 750px !important;
  }

  .home-list-page-view,
  .home-list-page-scroll,
  .list-bottom-tabbar-insert {
    width: 750px !important;
  }

  .home-banner-container {
    width: 750px !important;
    height: 338px !important;
  }

  .bv-banner-container {
    width: 690px !important;
    height: 310px !important;
    padding: 0 30px !important;
    box-sizing: content-box !important;
  }

  .home-web-collection-container {
    height: 344px !important;
    column-gap: 7px !important;
  }

  .home-web-collection-item {
    width: 342px !important;
    height: 156px !important;
  }

  .article-cell-container {
    height: 150px !important;
  }

  .article-cell-container .title-label {
    top: 16px !important;
    left: 30px !important;
    width: 470px !important;
    height: 60px !important;
    max-height: 60px !important;
    font-size: 20px !important;
    line-height: 30px !important;
  }

  .article-cell-container .none-image-title {
    width: 690px !important;
  }

  .article-cell-container .article-icon {
    top: 15px !important;
    left: 540px !important;
    width: 180px !important;
    height: 120px !important;
  }

  .article-cell-container .desc-label {
    top: 112px !important;
    left: 30px !important;
    width: 470px !important;
    height: 18px !important;
    font-size: 14px !important;
    line-height: 18px !important;
  }

  .article-cell-container .article-ad-label {
    height: 18px !important;
    margin-right: 8px !important;
    padding: 0 4px !important;
    font-size: 11px !important;
    line-height: 16px !important;
  }

  .article-cell-bottom-line-container {
    padding-right: 30px !important;
    padding-left: 30px !important;
  }

  .large-image-article-cell {
    padding-right: 30px !important;
    padding-left: 30px !important;
  }

  .large-image-article-cover {
    width: 690px !important;
    height: 358px !important;
  }
}
