@import url('/lib/matrix-ui.css');

/* Home page — layout & page-specific only */

body {
  padding-bottom: calc(var(--mx-tabbar-h) + env(safe-area-inset-bottom, 0px));
}

body.home-page {
  background: var(--mx-bg);
}

.home-shell {
  max-width: var(--mx-content-max);
  margin: 0 auto;
}

/* ── Hero (solid brand, no gradient) ── */
.home-hero {
  background: var(--mx-brand);
  padding-bottom: 12px;
}

.home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--reits-space-2);
  padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px;
}

.home-top-actions {
  display: flex;
  align-items: center;
  gap: var(--reits-space-2);
  flex-shrink: 0;
}

.home-city-btn {
  display: flex;
  align-items: center;
  gap: var(--reits-space-2);
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  cursor: pointer;
  min-width: 0;
  color: var(--mx-brand-ink);
}

.home-city-icon {
  display: flex;
  width: 18px;
  height: 18px;
}

.home-city {
  display: block;
  font-size: 17px;
  font-weight: 600;
}

.home-sub {
  display: block;
  font-size: 11px;
  opacity: 0.65;
}

.home-member-link,
.home-merchant-link {
  font-size: 12px;
  font-weight: 600;
  padding: var(--reits-space-2) var(--reits-space-3);
  border-radius: var(--mx-radius-pill);
  background: rgba(255, 255, 255, 0.75);
  color: var(--mx-brand-ink);
  white-space: nowrap;
}

.home-member-link.is-logged-in {
  background: rgba(255, 255, 255, 0.9);
}

.home-member-link {
  display: inline-flex;
  align-items: center;
  gap: var(--reits-space-1);
}

.home-member-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
}

.home-member-icon svg {
  width: 16px;
  height: 16px;
}

.home-brand {
  display: none;
}

.home-desktop-nav {
  display: none;
}

.home-hero-inner {
  width: 100%;
}

.home-search {
  padding: 0 var(--reits-space-page-x) 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: var(--reits-space-2);
  min-height: 36px;
  padding: 0 var(--reits-space-3);
  background: var(--mx-surface);
  border-radius: var(--mx-radius-pill);
  box-shadow: var(--mx-shadow-md);
}

.search-icon {
  display: flex;
  width: 18px;
  height: 18px;
  color: var(--mx-text-3);
}

.search-box input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
}

.search-hot-row {
  display: flex;
  gap: var(--reits-space-2);
  overflow-x: auto;
  padding: var(--reits-space-3) var(--reits-space-page-x) 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.search-hot-row::-webkit-scrollbar {
  display: none;
}

.search-hot-row.is-hidden {
  display: none;
}

.search-hot-chip {
  flex-shrink: 0;
  padding: var(--reits-space-2) var(--reits-space-3);
  border: 0;
  border-radius: var(--mx-radius-pill);
  background: rgba(255, 255, 255, 0.78);
  color: var(--mx-text-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  box-shadow: var(--mx-shadow-sm);
}

.search-hot-chip:active {
  transform: scale(0.98);
}

.search-box input {
  font-size: 15px;
}

.search-clear {
  border: 0;
  background: var(--mx-bg);
  color: var(--mx-text-3);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
}

.search-clear.is-hidden { display: none; }

/* ── Categories (美团金刚区: 白底卡片 · 圆底色板 · 2 行左右滑) ── */
.home-categories {
  padding: var(--reits-space-2) var(--reits-space-3) 4px;
  background: transparent;
}

.category-pager {
  display: grid;
  gap: var(--reits-space-3);
  padding: var(--reits-space-3) 10px 12px;
  background: var(--mx-surface);
  border-radius: var(--mx-radius-lg);
  box-shadow: var(--mx-shadow-sm);
}

.category-scroller {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-scroller::-webkit-scrollbar {
  display: none;
}

.category-page {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  grid-template-columns: repeat(var(--cat-cols, 5), minmax(0, 1fr));
  grid-auto-rows: minmax(0, auto);
  row-gap: var(--reits-space-3);
  column-gap: var(--reits-space-1);
  align-content: start;
}

.category-item {
  display: grid;
  justify-items: center;
  gap: var(--reits-space-2);
  padding: 2px 0 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}

.category-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255, 255, 255, 0.9), transparent 55%),
    var(--cat-tint, #fff4d6);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.04);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  color: #3a3a3a;
}

.category-icon svg {
  width: 22px;
  height: 22px;
}

.category-item.is-more .category-icon {
  background: #f3f4f6;
  color: #555;
}

.category-item.is-active .category-icon {
  box-shadow:
    0 0 0 2px var(--mx-brand),
    0 4px 10px rgba(255, 195, 0, 0.28);
  transform: translateY(-1px);
  color: var(--mx-brand-ink);
}

.category-item:active .category-icon {
  transform: scale(0.94);
}

.category-label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--mx-text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  letter-spacing: 0.01em;
}

.category-item.is-active .category-label {
  color: var(--mx-brand-ink);
  font-weight: 600;
}

.category-item.is-empty {
  display: none;
}

.category-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-height: 6px;
}

.category-dots.is-hidden {
  display: none;
}

.category-dot {
  width: 5px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d8d8d8;
  cursor: pointer;
  transition: width 0.16s ease, background 0.16s ease;
}

.category-dot.is-active {
  width: 12px;
  background: #c4c4c4;
}

/* ── Banners ── */
.home-banners {
  padding: 8px 16px;
  background: var(--mx-bg);
}

.home-banners.is-hidden { display: none; }

.banner-track {
  display: flex;
  gap: var(--reits-space-2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.banner-track::-webkit-scrollbar { display: none; }

.banner-card {
  flex: 0 0 72%;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: 1fr 56px;
  gap: var(--reits-space-2);
  align-items: center;
  min-height: 64px;
  padding: var(--reits-space-3) var(--reits-space-3);
  border-radius: var(--mx-radius-md);
  background: var(--mx-surface);
  border: 0.5px solid var(--mx-border);
  box-shadow: var(--mx-shadow-sm);
  color: inherit;
}

.banner-card strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.banner-card small {
  display: block;
  margin-top: var(--reits-space-1);
  font-size: 11px;
  color: var(--mx-text-3);
}

.banner-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--mx-radius-sm);
  background-color: #eee;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.lazy-bg:not(.lazy-bg--loaded) {
  background-color: #eee;
}

.banner-dots {
  display: flex;
  justify-content: center;
  gap: var(--reits-space-2);
  padding: 8px 0 2px;
}

.banner-dots.is-hidden {
  display: none;
}

.banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  transition: width 0.2s ease, background 0.2s ease;
}

.banner-dot.is-active {
  width: 16px;
  border-radius: 3px;
  background: var(--mx-brand, #ffc300);
}

@media (max-width: 767px) {
  .banner-card {
    flex: 0 0 calc(100% - 4px);
  }
}

.ad-badge {
  display: inline-block;
  margin-bottom: 4px;
  padding: var(--reits-space-1) var(--reits-space-2);
  border-radius: 3px;
  background: var(--mx-price-soft);
  color: var(--mx-price);
  font-size: 10px;
  font-weight: 700;
}

/* ── Shop strip (compact nearby shops) ── */
.home-shop-strip {
  padding: 4px 16px 8px;
  background: var(--mx-bg);
}

.home-shop-strip.is-hidden {
  display: none;
}

.section-head--compact {
  margin-bottom: 8px;
}

.section-head--compact h2 {
  font-size: 15px;
}

.section-hint {
  font-size: 12px;
  color: var(--mx-text-3);
}

.shop-strip {
  display: flex;
  gap: var(--reits-space-3);
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.shop-strip::-webkit-scrollbar {
  display: none;
}

.shop-strip-item {
  flex: 0 0 64px;
  display: grid;
  justify-items: center;
  gap: var(--reits-space-1);
  text-align: center;
}

.shop-strip-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--mx-radius-md);
  background-color: #eee;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: var(--mx-shadow-sm);
}

.shop-strip-name {
  display: block;
  width: 64px;
  font-size: 11px;
  color: var(--mx-text);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-strip-meta {
  font-size: 10px;
  color: var(--mx-text-3);
}

/* ── Deal grid (Meituan-style main feed) ── */
.deal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--reits-space-2);
}

.deal-list {
  display: grid;
  gap: var(--reits-space-2);
}

.deal-card {
  display: block;
  background: var(--mx-surface);
  border-radius: var(--mx-radius-md);
  overflow: hidden;
  box-shadow: var(--mx-shadow-sm);
}

.deal-card-hit {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.12s ease;
}

.deal-card-hit:active {
  transform: scale(0.985);
}

.deal-shop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--reits-space-2);
  padding: 0 var(--reits-space-3) 10px;
  min-height: 28px;
}

.deal-shop-link {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--mx-text-3);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-shop-link:hover {
  color: var(--mx-text-2);
}

.deal-shop-row .score {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--mx-price);
  font-weight: 600;
}

.deal-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--reits-space-2);
  padding-bottom: 10px;
}

.deal-toolbar.is-hidden {
  display: none;
}

.deal-toolbar-group {
  display: flex;
  gap: var(--reits-space-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.deal-toolbar-group::-webkit-scrollbar {
  display: none;
}

.deal-sort-row {
  display: flex;
  gap: var(--reits-space-2);
  overflow-x: auto;
  padding: 0;
  scrollbar-width: none;
}

.deal-sort-row.is-hidden {
  display: none;
}

.deal-sort-row::-webkit-scrollbar {
  display: none;
}

.deal-sort-chip {
  flex-shrink: 0;
  border: 0;
  padding: var(--reits-space-2) var(--reits-space-3);
  border-radius: var(--mx-radius-pill);
  background: var(--mx-surface);
  color: var(--mx-text-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  box-shadow: var(--mx-shadow-sm);
}

.deal-sort-chip.is-active {
  background: var(--mx-brand-soft);
  color: var(--mx-brand-ink);
  font-weight: 600;
}

.deal-filter-chip {
  flex-shrink: 0;
  border: 0;
  padding: var(--reits-space-2) var(--reits-space-3);
  border-radius: var(--mx-radius-pill);
  background: var(--mx-surface);
  color: var(--mx-text-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  box-shadow: var(--mx-shadow-sm);
}

.deal-filter-chip.is-active {
  background: #fff7e6;
  color: var(--mx-brand-ink);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 195, 0, 0.45);
}

.home-main-feed.is-category .deal-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--mx-bg);
  padding-top: 4px;
  margin-bottom: 2px;
  box-shadow: 0 6px 12px -8px rgba(0, 0, 0, 0.12);
}

.deal-thumb {
  position: relative;
  aspect-ratio: 1;
  background-color: #eee;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.deal-ad,
.deal-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

.deal-badge {
  background: var(--mx-price);
  color: #fff;
}

.deal-body {
  padding: var(--reits-space-2) var(--reits-space-3) 10px;
}

.deal-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 4px;
  min-height: 2.7em;
}

.deal-shop-line {
  font-size: 11px;
  color: var(--mx-text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
}

.deal-shop-line .score {
  color: var(--mx-price);
  font-weight: 600;
}

.deal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--reits-space-1);
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--mx-text-3);
}

.deal-meta .score {
  color: var(--mx-price);
  font-weight: 600;
}

.deal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--reits-space-2);
}

.deal-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--mx-price);
  line-height: 1;
}

.deal-cta {
  flex-shrink: 0;
  padding: var(--reits-space-1) var(--reits-space-3);
  border-radius: var(--mx-radius-pill);
  background: var(--mx-brand);
  color: var(--mx-brand-ink);
  font-size: 11px;
  font-weight: 700;
}

.deal-card--row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--reits-space-3);
  padding: 10px;
}

.deal-card--row .deal-card-hit {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--reits-space-3);
  grid-column: 1 / -1;
}

.deal-card--row .deal-shop-row {
  grid-column: 1 / -1;
  padding: 0 0 2px;
}

.deal-card--row .deal-thumb {
  width: 96px;
  height: 96px;
  aspect-ratio: auto;
  border-radius: var(--mx-radius-sm);
}

.deal-card--row .deal-body {
  padding: 0;
  min-width: 0;
}

.deal-card--row .deal-title {
  min-height: auto;
  -webkit-line-clamp: 2;
}

.deal-card--compact {
  display: block;
  padding: 8px;
}

.deal-card--compact .deal-card-hit {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--reits-space-2);
}

.deal-card--compact .deal-thumb {
  width: 56px;
  height: 56px;
  aspect-ratio: auto;
  border-radius: var(--mx-radius-sm);
}

.deal-card--compact .deal-body {
  padding: 0;
  min-width: 0;
}

.deal-card--compact .deal-title {
  font-size: 12px;
  min-height: auto;
  -webkit-line-clamp: 2;
}

.deal-card--compact .deal-shop-line {
  margin-bottom: 4px;
}

.deal-card--compact .deal-price {
  font-size: 14px;
}

/* ── Sections ── */
.home-section {
  padding: var(--reits-space-3) 16px;
  background: var(--mx-bg);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--reits-space-2);
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.section-head p {
  margin: 0;
  font-size: 12px;
  color: var(--mx-text-3);
  text-align: right;
}

.shop-list {
  display: grid;
  gap: var(--reits-space-2);
}

.shop-list.compact .shop-card {
  grid-template-columns: 72px 1fr;
}

.shop-list.compact .shop-cover {
  width: 72px;
  height: 72px;
}

.shop-tagline {
  margin: var(--reits-space-1) 0 0;
  font-size: 13px;
  color: var(--mx-text-2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── City sheet ── */
.city-sheet {
  position: fixed;
  inset: auto 16px calc(var(--mx-tabbar-h) + 12px + env(safe-area-inset-bottom, 0px)) 16px;
  max-width: 688px;
  margin: 0 auto;
  background: var(--mx-surface);
  border-radius: var(--mx-radius-lg);
  box-shadow: var(--mx-shadow-md);
  padding: 8px;
  z-index: 45;
}

.city-sheet.is-hidden { display: none; }

.city-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--reits-space-3);
  border: 0;
  background: transparent;
  padding: var(--reits-space-3) 14px;
  border-radius: var(--mx-radius-md);
  font: inherit;
  cursor: pointer;
}

.city-option:hover,
.city-option.is-active {
  background: var(--mx-brand-soft);
}

.city-option small { color: var(--mx-text-3); }

/* ── Skeleton ── */
.home-skeleton {
  padding: 0 0 16px;
  background: transparent;
}

.home-skeleton.is-hidden { display: none; }

.home-skeleton .skel-cats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--reits-space-2) 6px;
  margin-bottom: 16px;
}

.home-skeleton .skel-cats span {
  height: 72px;
  border-radius: var(--mx-radius-md);
}

.home-skeleton .skel-cards {
  display: grid;
  gap: var(--reits-space-3);
}

.home-skeleton .skel-deals {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-skeleton .skel-deal {
  height: 180px;
  border-radius: var(--mx-radius-md);
}

.home-skeleton .skel-card {
  height: 112px;
  border-radius: var(--mx-radius-md);
}

@media (min-width: 721px) {
  .home-skeleton {
    grid-column: 1 / -1;
  }

  .home-skeleton .skel-cats {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: var(--reits-space-3) 8px;
  }

  .home-skeleton .skel-cats span {
    height: 80px;
  }

  .home-skeleton .skel-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--reits-space-3);
  }
}

@media (min-width: 768px) {
  .home-skeleton .skel-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── Fallback ── */
.home-fallback {
  max-width: 400px;
  margin: var(--reits-space-12) auto;
  padding: 0 var(--reits-space-5);
  text-align: center;
}

.home-fallback.is-hidden { display: none; }

.shop-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 8px 4px 0;
  padding: 10px 18px;
  border-radius: var(--mx-radius-pill);
  font-weight: 600;
  font-size: 14px;
  background: var(--mx-surface);
  border: 0.5px solid var(--mx-border);
}

.shop-action.primary {
  background: var(--mx-brand);
  border-color: var(--mx-brand-press);
  color: var(--mx-brand-ink);
}

.empty-state {
  padding: var(--reits-space-6) 16px;
  text-align: center;
  color: var(--mx-text-3);
  background: var(--mx-surface);
  border-radius: var(--mx-radius-md);
  font-size: 14px;
}

/* ── Layout grid ── */
.home-layout {
  display: block;
}

.home-aside {
  display: block;
}

.home-aside[hidden] {
  display: none !important;
}

.home-aside.is-member-feed {
  border: 1px solid var(--mx-brand-soft);
  background: linear-gradient(180deg, #fffdf5 0%, var(--mx-surface) 100%);
}

@media (min-width: 768px) {
  .home-aside.is-member-feed:not([hidden]) {
    box-shadow: var(--mx-shadow-sm);
  }
}

.aside-list .shop-card.compact {
  grid-template-columns: 64px 1fr;
}

/* ── Desktop ── */
@media (min-width: 721px) {
  .home-shell {
    max-width: var(--mx-wide-max);
    margin: 0 auto;
    padding: 0 var(--reits-space-6) 32px;
  }

  .home-hero-inner {
    max-width: var(--mx-wide-max);
    margin: 0 auto;
    padding: 0 var(--reits-space-6) 16px;
  }

  .search-box {
    min-height: 44px;
  }

  .category-page {
    row-gap: var(--reits-space-3);
    column-gap: var(--reits-space-1);
  }

  .category-icon {
    width: 52px;
    height: 52px;
  }

  .category-icon svg {
    width: 24px;
    height: 24px;
  }

  .category-label {
    font-size: 12px;
  }

  .category-pager {
    padding: var(--reits-space-card) 12px 14px;
  }

  .banner-track {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--reits-space-3);
    overflow: visible;
    scroll-snap-type: none;
  }

  .banner-card {
    flex: unset;
    min-height: 96px;
    grid-template-columns: 1fr 88px;
  }

  .banner-thumb {
    width: 88px;
    height: 72px;
  }

  .shop-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--reits-space-3);
  }

  .home-section,
  .home-categories,
  .home-banners,
  .home-shop-strip {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (min-width: 768px) {
  body.home-page.mx-has-tabbar {
    padding-bottom: 0;
  }

  .home-tabbar {
    display: none !important;
  }

  .home-hero {
    width: 100%;
    margin: 0;
    max-width: none;
    border-radius: 0;
    padding-bottom: 20px;
  }

  .home-hero-inner {
    max-width: var(--mx-wide-max);
    margin: 0 auto;
    padding: 0 var(--reits-space-6) 20px;
  }

  .home-hero-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--reits-space-5);
    padding: calc(12px + env(safe-area-inset-top, 0px)) 0 12px;
  }

  .home-brand {
    display: inline-flex;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--mx-brand-ink);
    letter-spacing: -0.02em;
    white-space: nowrap;
  }

  .home-desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--reits-space-1);
  }

  .home-top {
    justify-content: flex-end;
    padding: 0;
  }

  .home-city-btn {
    padding: var(--reits-space-2) var(--reits-space-3);
    border-radius: var(--mx-radius-pill);
    background: rgba(255, 255, 255, 0.72);
  }

  .home-search {
    padding: 0;
    max-width: 720px;
    margin: 0 auto;
  }

  .search-hot-row {
    padding-left: 0;
    padding-right: 0;
  }

  .search-box {
    min-height: 48px;
    padding: 0 var(--reits-space-5);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  }

  .search-box input {
    font-size: 16px;
  }

  .home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--reits-space-5);
    align-items: start;
    padding-top: 8px;
  }

  .home-layout.home-layout--with-aside {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: var(--reits-space-6);
  }

  .home-categories {
    grid-column: 1 / -1;
    padding-top: 20px;
  }

  .home-banners,
  .home-shop-strip,
  #searchSection,
  .home-main-feed {
    grid-column: 1;
  }

  .home-layout.home-layout--with-aside .home-banners,
  .home-layout.home-layout--with-aside .home-shop-strip,
  .home-layout.home-layout--with-aside #searchSection,
  .home-layout.home-layout--with-aside .home-main-feed {
    grid-column: 1;
  }

  .home-aside:not([hidden]) {
    grid-column: 2;
    grid-row: 2 / span 6;
    position: sticky;
    top: 16px;
    padding: var(--reits-space-card);
    background: var(--mx-surface);
    border-radius: var(--mx-radius-lg);
    border: 0.5px solid var(--mx-border);
    box-shadow: var(--mx-shadow-sm);
  }

  .home-aside .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--reits-space-1);
    margin-bottom: var(--reits-space-3);
  }

  .home-aside .section-head p {
    text-align: left;
  }

  .home-main-feed {
    grid-column: 1;
  }

  /* Keep Meituan-style 1-row horizontal shop strip on desktop (no multi-row sprawl). */
  .shop-strip {
    display: flex;
    gap: var(--reits-space-4);
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .shop-strip-item {
    flex: 0 0 72px;
    display: grid;
    justify-items: center;
    gap: var(--reits-space-1);
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    text-align: center;
  }

  .shop-strip-thumb {
    width: 64px;
    height: 64px;
    max-height: none;
    aspect-ratio: auto;
  }

  .shop-strip-name {
    width: 72px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    display: block;
    -webkit-line-clamp: unset;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .shop-strip-meta {
    font-size: 10px;
    color: var(--mx-text-3);
    font-weight: 500;
  }

  .banner-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .banner-dots {
    display: none !important;
  }

  .deal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--reits-space-3);
  }

  /* Shorter thumbs so title + price stay in first viewport (Meituan-style) */
  .home-main-feed .deal-thumb {
    aspect-ratio: 4 / 3;
  }

  .home-main-feed .deal-body {
    padding: var(--reits-space-3) var(--reits-space-3) 2px;
  }

  .home-main-feed .deal-title {
    font-size: 14px;
    line-height: 1.3;
  }

  .shop-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--reits-space-3);
  }

  .aside-list {
    display: grid;
    gap: var(--reits-space-3);
  }

  .city-sheet {
    inset: auto auto auto 50%;
    transform: translateX(-50%);
    bottom: auto;
    top: calc(var(--mx-site-nav-h, 56px) + 120px);
    max-width: 360px;
    width: calc(100% - 48px);
  }
}

@media (min-width: 1280px) {
  .deal-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--reits-space-4);
  }

  .home-layout.home-layout--with-aside .deal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-skeleton .skel-cats {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
}
