/* 首页趣/爬双窗口 + 极简发现大卡 + 发布两步 */

.page--home-dual,
.page--moments {
  padding-bottom: calc(var(--nav-height, 4rem) + var(--safe-bottom, 0px));
}

.page-content--home-dual,
.page-content--moments {
  padding-top: 0;
}

/* —— 顶栏 —— */
.home-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: calc(0.35rem + env(safe-area-inset-top, 0px)) var(--margin-mobile) 0.5rem;
  background: var(--surface-container-lowest, #fff);
  position: sticky;
  top: 0;
  z-index: 30;
}

.home-top-bar__icon {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
}

.home-top-bar__icon:active {
  background: var(--surface-container-low);
}

.home-top-bar__segment {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.home-top-bar__seg-btn {
  border: none;
  background: transparent;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.35rem 0.15rem;
  cursor: pointer;
  position: relative;
}

.home-top-bar__seg-btn.active {
  color: var(--text-primary, #1a1c1d);
  font-weight: 800;
}

.home-top-bar__seg-btn.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 1.25rem;
  height: 0.1875rem;
  border-radius: 999px;
  background: var(--brand-primary);
}

.home-top-bar__title {
  font-size: 1.0625rem;
  font-weight: 800;
  margin: 0;
  flex: 1;
  text-align: center;
}

.home-top-bar__spacer {
  flex: 1;
}

/* —— 趣页二级 Tab —— */
.home-sub-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem var(--margin-mobile) 0.65rem;
  overflow-x: auto;
  background: #fff;
  position: sticky;
  top: calc(2.75rem + env(safe-area-inset-top, 0px));
  z-index: 20;
}

.home-sub-tabs__btn {
  flex-shrink: 0;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}

.home-sub-tabs__btn.active {
  color: var(--text-primary);
  font-weight: 800;
}

.home-qu-panel__body {
  padding: 0 var(--margin-mobile) 1rem;
}

/* —— 发现瀑布大卡（小红书式） —— */
.discover-masonry {
  column-count: 2;
  column-gap: 0.375rem;
}

.discover-card {
  break-inside: avoid;
  margin-bottom: 0.375rem;
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
}

.discover-card__cover {
  position: relative;
  width: 100%;
  background: var(--surface-container-low);
  overflow: hidden;
}

.discover-card__cover img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.discover-card__placeholder {
  width: 100%;
  min-height: 140px;
  background: linear-gradient(145deg, #f0f0f2, #e4e4e8);
}

.discover-card__play {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
  font-size: 1.375rem;
  color: rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}

.discover-card__title {
  margin: 0.375rem 0.5rem 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.discover-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem 0.5rem;
  font-size: 0.6875rem;
  color: #999;
}

.discover-card__author {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discover-card__stat {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  flex-shrink: 0;
}

.discover-card__stat-icon {
  font-size: 0.75rem;
  color: #bbb;
}

/* —— 话题列表 —— */
.home-topic-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.home-topic-header__back {
  border: none;
  background: transparent;
  padding: 0.25rem;
  display: flex;
  color: var(--text-secondary);
}

.home-topic-header__name {
  font-size: 0.9375rem;
  font-weight: 700;
}

.home-topic-list__row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.85rem 0;
  border: none;
  border-bottom: 1px solid var(--divider);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.home-topic-list__hash {
  color: var(--brand-primary);
  font-weight: 700;
}

.home-topic-list__name {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 600;
}

.home-topic-list__count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.home-topic-list__chev {
  font-size: 1.125rem;
  color: var(--text-muted);
}

/* —— 爬窗 —— */
.home-pa-panel {
  padding-bottom: 1rem;
}

.home-pa-mode {
  position: relative;
  padding: 0.35rem var(--margin-mobile) 0.5rem;
  background: #fff;
  z-index: 18;
}

.home-pa-mode__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  border: none;
  background: transparent;
  font-size: 0.9375rem;
  font-weight: 700;
  padding: 0.25rem 0;
  cursor: pointer;
}

.home-pa-mode__chev--open {
  transform: rotate(180deg);
}

.home-pa-mode__backdrop {
  position: fixed;
  inset: 0;
  z-index: 17;
  background: transparent;
}

.home-pa-mode__sheet {
  position: absolute;
  left: var(--margin-mobile);
  top: 100%;
  z-index: 19;
  min-width: 8rem;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(26, 28, 29, 0.12);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
}

.home-pa-mode__item {
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  cursor: pointer;
}

.home-pa-mode__item.active,
.home-pa-mode__item:hover {
  background: var(--brand-soft-bg);
  color: var(--brand-primary);
}

.home-pa-panel__categories {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 0.25rem var(--margin-mobile) 0.75rem;
  overflow-x: auto;
}

.home-pa-panel__cat {
  flex: 1;
  min-width: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  border: none;
  background: transparent;
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

.home-pa-panel__feed {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0 var(--margin-mobile);
}

.home-pa-panel__sentinel {
  height: 1px;
}

.home-pa-panel__loadmore {
  text-align: center;
  font-size: 0.75rem;
  padding: 0.5rem 0;
}

/* —— 商品大卡 —— */
.commerce-feed-card {
  background: #fff;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(26, 28, 29, 0.06);
}

.commerce-feed-card__cover {
  width: 100%;
  background: var(--surface-container-low);
}

.commerce-feed-card__img {
  width: 100%;
  object-fit: cover;
}

.commerce-feed-card__body {
  padding: 0.75rem 0.85rem 0.85rem;
}

.commerce-feed-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.commerce-feed-card__meta {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.commerce-feed-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.commerce-feed-card__price {
  color: var(--price-color);
  font-weight: 800;
  font-size: 1.0625rem;
}

.commerce-feed-card__seller {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* —— 发布两步浮层 —— */
.bottom-nav {
  position: relative;
}

.publish-chooser {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-height, 4rem) + var(--safe-bottom, 0px) + 0.35rem);
  z-index: 120;
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: rgba(26, 28, 29, 0.88);
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
}

.publish-chooser__pill {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.publish-chooser__pill:active {
  background: rgba(255, 255, 255, 0.22);
}

.publish-chooser__arrow {
  display: none;
}

.publish-pop-enter-active,
.publish-pop-leave-active {
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.publish-pop-enter-from,
.publish-pop-leave-to {
  opacity: 0;
  transform: translateX(-50%) translateY(6px);
}

.home-pa-sheet-enter-active,
.home-pa-sheet-leave-active {
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.home-pa-sheet-enter-from,
.home-pa-sheet-leave-to {
  opacity: 0;
  transform: translateY(-4px);
}

.page-content--moments {
  padding: 0;
}

.nav-item--publish.active {
  color: var(--brand-primary);
}

/* —— Onboarding —— */
.onboarding-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.onboarding-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.onboarding-sheet__panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 1rem 1rem 0 0;
  padding: 1.25rem var(--margin-mobile) calc(1.25rem + env(safe-area-inset-bottom, 0px));
}

.onboarding-sheet__skip {
  position: absolute;
  top: 1rem;
  right: var(--margin-mobile);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.onboarding-sheet__title {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 800;
}

.onboarding-sheet__sub {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
}

.onboarding-sheet__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.onboarding-sheet__chip {
  border: 1px solid var(--border-light);
  background: #fff;
  border-radius: var(--radius-full);
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  cursor: pointer;
}

.onboarding-sheet__chip.active {
  border-color: var(--brand-primary);
  background: var(--brand-soft-bg);
  color: var(--brand-primary);
  font-weight: 600;
}

.onboarding-sheet__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.onboarding-sheet__row {
  border: 1px solid var(--border-light);
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.9375rem;
  cursor: pointer;
}

.onboarding-sheet__row.active {
  border-color: var(--brand-primary);
  background: var(--brand-soft-bg);
  color: var(--brand-primary);
  font-weight: 700;
}

.onboarding-sheet__next {
  width: 100%;
}

.home-qu-loadmore {
  text-align: center;
  padding: 0.75rem 0 0.25rem;
}
