/* 统一前台视觉层：所有面向用户的页面共用背景与容器规则。 */
:root {
  --front-ink: #1f2329;
  --front-muted: #7a8089;
  --front-line: #e5e8ec;
  --front-bg: #f4f5f7;
  --front-paper: #ffffff;
  --front-pink: #e84f70;
  --front-blue: #3978d5;
  --front-green: #299568;
  --front-radius: 18px;
  --front-shadow: 0 8px 24px rgba(29, 34, 41, .055);
  --front-page-bg: #f5f6f7;
}

body.home-page,
body.buyer-page,
body.user-subpage,
body.tool-page,
body.utility-page,
body.public-shop-page,
body.product-detail-page {
  min-width: 0;
  background: #f5f6f7 !important;
  background-image: none !important;
  color: var(--front-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

body.home-page > .fixed-bg-pattern,
body.buyer-page > .fixed-bg-pattern,
body.user-subpage > .fixed-bg-pattern,
body.tool-page > .fixed-bg-pattern,
body.utility-page > .fixed-bg-pattern,
body.public-shop-page > .fixed-bg-pattern,
body.product-detail-page > .fixed-bg-pattern {
  display: none !important;
}

body.front-frame-page > .front-app-frame.home-page .fixed-bg-pattern,
body.front-frame-page > .front-app-frame.buyer-page .fixed-bg-pattern,
body.front-frame-page > .front-app-frame.user-subpage .fixed-bg-pattern,
body.front-frame-page > .front-app-frame.tool-page .fixed-bg-pattern,
body.front-frame-page > .front-app-frame.utility-page .fixed-bg-pattern,
body.front-frame-page > .front-app-frame.public-shop-page .fixed-bg-pattern,
body.front-frame-page > .front-app-frame.product-detail-page .fixed-bg-pattern {
  display: none !important;
}

/* One fixed backdrop keeps storefront pages visually connected while their content scrolls. */
body.front-frame-page > .front-app-frame.home-page,
body.front-frame-page > .front-app-frame.buyer-page,
body.front-frame-page > .front-app-frame.user-subpage,
body.front-frame-page > .front-app-frame.tool-page,
body.front-frame-page > .front-app-frame.utility-page,
body.front-frame-page > .front-app-frame.public-shop-page,
body.front-frame-page > .front-app-frame.product-detail-page {
  background: #f5f6f7 !important;
  background-image: none !important;
}

body.front-frame-page > .front-app-frame.home-page > .front-app-content,
body.front-frame-page > .front-app-frame.buyer-page > .front-app-content,
body.front-frame-page > .front-app-frame.user-subpage > .front-app-content,
body.front-frame-page > .front-app-frame.tool-page > .front-app-content,
body.front-frame-page > .front-app-frame.utility-page > .front-app-content,
body.front-frame-page > .front-app-frame.public-shop-page > .front-app-content,
body.front-frame-page > .front-app-frame.product-detail-page > .front-app-content {
  background: #f5f6f7 !important;
  background-image: none !important;
}

body.front-frame-page > .front-app-frame.user-subpage .user-page-shell {
  background: transparent !important;
}

body.front-frame-page > .front-app-frame.user-subpage,
body.front-frame-page > .front-app-frame.user-subpage > .front-app-content,
body.front-frame-page > .front-app-frame.user-subpage .front-page-layer,
body.front-frame-page > .front-app-frame.user-subpage .user-page-shell {
  background-color: transparent !important;
}

body.front-frame-page > .front-app-frame.home-page .fixed-bg-pattern,
body.front-frame-page > .front-app-frame.buyer-page .fixed-bg-pattern,
body.front-frame-page > .front-app-frame.user-subpage .fixed-bg-pattern,
body.front-frame-page > .front-app-frame.tool-page .fixed-bg-pattern,
body.front-frame-page > .front-app-frame.utility-page .fixed-bg-pattern,
body.front-frame-page > .front-app-frame.public-shop-page .fixed-bg-pattern,
body.front-frame-page > .front-app-frame.product-detail-page .fixed-bg-pattern {
  display: none !important;
  background: none !important;
  background-image: none !important;
}

/* Theme preview */
body.home-page .product-home {
  width: min(1180px, calc(100% - 48px));
  padding: 30px 0 116px;
}

body.home-page .home-title {
  gap: 7px;
  padding: 12px 0 24px;
}

body.home-page .home-title h1 {
  color: var(--front-ink);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 850;
}

body.home-page .home-title p {
  color: var(--front-muted);
  font-size: 13px;
}

body.home-page .toolbar {
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
}

body.home-page .search-action {
  max-width: 620px;
}

body.home-page .search-action .input,
body.home-page .search-action .btn {
  min-height: 46px;
}

body.home-page .search-action .input {
  border-color: var(--front-line);
  border-radius: 13px 0 0 13px;
  background: var(--front-paper);
}

body.home-page .search-action .btn {
  border-color: var(--front-ink);
  border-radius: 0 13px 13px 0;
  background: var(--front-ink);
}

body.home-page .sort-row {
  justify-content: flex-end;
  min-width: 280px;
  padding: 4px;
  border: 1px solid var(--front-line);
  background: #eceef1;
}

body.home-page .sort-row .pill {
  min-height: 36px;
  border-radius: 999px;
  color: var(--front-muted);
  font-size: 12px;
  font-weight: 750;
}

body.home-page .sort-row .pill.active,
body.home-page .category-row .pill.active {
  border-color: var(--front-ink);
  background: var(--front-ink);
  color: #fff;
}

body.home-page .category-row {
  gap: 7px;
  margin-top: 8px;
}

body.home-page .category-row .pill {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--front-line);
  border-radius: 999px;
  background: var(--front-paper);
  color: var(--front-muted);
  font-size: 12px;
}

body.home-page .catalog-filter-chips button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--front-line);
  border-radius: 999px;
  background: var(--front-paper);
  color: var(--front-muted);
  font-size: 12px;
  font-weight: 650;
}

body.home-page .catalog-filter-chips button.active {
  border-color: var(--front-ink);
  background: var(--front-ink);
  color: #fff;
}

body.home-page .products-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

body.home-page .product-card {
  overflow: hidden;
  border: 1px solid var(--front-line);
  border-radius: var(--front-radius);
  background: var(--front-paper);
  box-shadow: var(--front-shadow);
}

body.home-page .product-card:hover {
  border-color: #d5d9de;
  box-shadow: 0 12px 28px rgba(29, 34, 41, .09);
}

body.home-page .product-media {
  background: #eceff2;
}

body.home-page .product-media img {
  object-fit: cover;
}

body.home-page .product-id {
  right: 10px;
  bottom: 10px;
  min-height: 24px;
  border-color: rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .9);
  color: var(--front-muted);
  font-size: 11px;
}

body.home-page .product-merchant-name {
  top: 10px;
  bottom: auto;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.home-page .product-body {
  gap: 8px;
  padding: 12px 13px 13px;
}

body.home-page .product-title {
  min-height: 38px;
  color: var(--front-ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

/* 首页商品标题悬停下划线 */
body.home-page #productsGrid .product-title-text {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  background: linear-gradient(to right, #ec695c, #61c454) no-repeat right bottom;
  background-size: 0 2px;
  transition: background-size 1300ms ease;
}

body.home-page #productsGrid .product-card:hover .product-title-text {
  background-position-x: left;
  background-size: 100% 5px;
}

body.home-page .card-bottom-line {
  min-height: 22px;
  color: var(--front-muted);
  font-size: 11px;
}

body.home-page .card-bottom-line .heat {
  color: var(--front-muted);
}

body.home-page .card-bottom-line svg {
  width: 14px;
  height: 14px;
}

body.home-page .product-empty {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed #d8dce1;
  border-radius: var(--front-radius);
  background: rgba(255, 255, 255, .65);
  color: var(--front-muted);
}

body.home-page .public-bottom-nav,
body.buyer-page:not(.buyer-auth-active) .public-bottom-nav {
  width: min(356px, calc(100% - 28px));
  min-height: 56px;
  padding: 4px;
  border: 1px solid rgba(31, 35, 41, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 28px rgba(29, 34, 41, .13);
}

body.home-page .public-bottom-nav a,
body.buyer-page:not(.buyer-auth-active) .public-bottom-nav a {
  min-height: 46px;
  border-radius: 999px;
  color: #8a9098;
  font-size: 11px;
}

body.home-page .public-bottom-nav a.active,
body.buyer-page:not(.buyer-auth-active) .public-bottom-nav a.active {
  background: var(--front-ink);
  color: #fff;
}

body.home-page .public-bottom-nav svg,
body.buyer-page:not(.buyer-auth-active) .public-bottom-nav svg {
  width: 19px;
  height: 19px;
}

body.home-page .product-preview-card {
  width: min(660px, calc(100% - 28px));
  overflow: hidden;
  border: 1px solid var(--front-line);
  border-radius: 22px;
  background: var(--front-paper);
  box-shadow: 0 20px 60px rgba(29, 34, 41, .16);
}

body.home-page .preview-image-box {
  width: min(520px, 100%);
  aspect-ratio: 1;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--front-line);
  border-radius: 16px;
  background: #eceff2;
}

body.home-page .preview-image-box .preview-img {
  border: 0;
  border-radius: inherit;
  object-fit: cover;
}

body.home-page .preview-image-box .zoom-btn {
  right: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(31, 35, 41, .1);
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: var(--front-ink);
  box-shadow: 0 6px 16px rgba(29, 34, 41, .12);
}

body.home-page .thumb-row {
  gap: 8px;
  margin-top: 12px;
  padding-bottom: 2px;
}

body.home-page .thumb-row img {
  flex-basis: 58px;
  width: 58px;
  height: 58px;
  border-radius: 11px;
  border-color: var(--front-line);
}

body.home-page .preview-actions {
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--front-line);
  background: #fbfbfc;
}

body.home-page .preview-actions .btn {
  min-height: 42px;
  border-radius: 999px;
  font-size: 12px;
}

/* Buyer center and its independent subpages */
body.buyer-page:not(.buyer-auth-active) .buyer-shell,
body.user-subpage .user-page-shell {
  width: min(1040px, calc(100% - 48px));
  margin-inline: auto;
}

body.buyer-page:not(.buyer-auth-active) .buyer-shell {
  padding-top: 22px;
  padding-bottom: 126px;
}

body.buyer-page:not(.buyer-auth-active) .buyer-app {
  gap: 14px;
}

body.buyer-page:not(.buyer-auth-active) .user-profile-band,
body.buyer-page:not(.buyer-auth-active) .user-commerce-grid,
body.buyer-page:not(.buyer-auth-active) .user-section-band {
  border: 1px solid var(--front-line);
  border-radius: 20px;
  background: var(--front-paper);
  box-shadow: var(--front-shadow);
}

body.buyer-page:not(.buyer-auth-active) .user-profile-band {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px 24px;
  padding: 22px;
}

body.buyer-page:not(.buyer-auth-active) .user-profile-main {
  min-width: 0;
}

body.buyer-page:not(.buyer-auth-active) .user-wallet-row {
  grid-column: 2;
  min-width: 260px;
  padding-top: 0;
  border-top: 0;
}

body.buyer-page:not(.buyer-auth-active) .user-commerce-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 14px 10px;
}

body.buyer-page:not(.buyer-auth-active) .user-commerce-grid a,
body.buyer-page:not(.buyer-auth-active) .user-order-grid a,
body.buyer-page:not(.buyer-auth-active) .user-service-grid > a,
body.buyer-page:not(.buyer-auth-active) .user-service-grid > button {
  border-radius: 14px;
  transition: background .18s ease, transform .18s ease;
}

body.buyer-page:not(.buyer-auth-active) .user-commerce-grid a:hover,
body.buyer-page:not(.buyer-auth-active) .user-order-grid a:hover,
body.buyer-page:not(.buyer-auth-active) .user-service-grid > a:hover,
body.buyer-page:not(.buyer-auth-active) .user-service-grid > button:hover {
  background: #f7f8f9;
}

body.buyer-page:not(.buyer-auth-active) .user-section-band {
  padding: 18px 20px;
}

body.buyer-page:not(.buyer-auth-active) .user-order-grid {
  gap: 4px;
}

body.buyer-page:not(.buyer-auth-active) .user-service-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body.buyer-page:not(.buyer-auth-active) .user-service-grid > a,
body.buyer-page:not(.buyer-auth-active) .user-service-grid > button {
  min-height: 88px;
  border: 1px solid var(--front-line);
  background: #fafbfc;
}

body.user-subpage .user-page-shell {
  min-height: 100vh;
  padding-bottom: 42px;
}

body.user-subpage .user-page-topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  min-height: 56px;
  margin: 12px 0 14px;
  overflow: hidden;
  border: 1px solid var(--front-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--front-shadow);
  backdrop-filter: blur(16px);
}

body.user-subpage .user-page-topbar h1 {
  color: var(--front-ink);
  font-size: 16px;
  font-weight: 850;
}

body.user-subpage .user-page-topbar a,
body.user-subpage .user-page-topbar button {
  border-radius: 50%;
  color: var(--front-ink);
}

body.user-subpage .user-page-topbar a:hover,
body.user-subpage .user-page-topbar button:hover {
  background: #f1f3f5;
  color: var(--front-pink);
}

body.user-subpage .user-list-content {
  padding: 0 0 24px;
}

body.user-subpage .user-product-card,
body.user-subpage .user-cart-item,
body.user-subpage .user-follow-card,
body.user-subpage .user-order-card,
body.user-subpage .user-price-item,
body.user-subpage .user-code-item,
body.user-subpage .user-stat-item,
body.user-subpage .user-empty-state,
body.user-subpage .user-form-section,
body.user-subpage .user-profile-preview,
body.user-subpage .user-wallet-summary-card,
body.user-subpage .user-invite-card,
body.user-subpage .user-denied,
body.user-subpage .user-recommend-section,
body.user-subpage .user-order-tabs,
body.user-subpage .user-wallet-tabs,
body.user-subpage .user-code-tabs {
  border: 1px solid var(--front-line);
  border-radius: var(--front-radius);
  background: var(--front-paper);
  box-shadow: var(--front-shadow);
}

body.user-subpage .user-form-section,
body.user-subpage .user-profile-preview,
body.user-subpage .user-wallet-summary-card,
body.user-subpage .user-invite-card,
body.user-subpage .user-denied,
body.user-subpage .user-recommend-section {
  margin: 0 0 14px;
}

body.user-subpage .user-order-tabs,
body.user-subpage .user-wallet-tabs,
body.user-subpage .user-code-tabs {
  margin: 0 0 14px;
  overflow: hidden;
}

/* 订单状态胶囊：六项固定均分，窄屏也保持单行完整显示。 */
body.user-subpage .user-order-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  padding: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #f4f5f7;
}

body.user-subpage #userOrderTabs {
  border-radius: 999px;
}

body.user-subpage .user-order-tabs button {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 4px;
  color: #858a93;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

body.user-subpage .user-order-tabs button:hover {
  color: #343941;
  background: #fff;
}

body.user-subpage .user-order-tabs button:active {
  transform: scale(.96);
}

body.user-subpage .user-order-tabs button.active {
  color: #fff;
  background: #25282d;
  box-shadow: 0 3px 8px rgba(37, 40, 45, .16);
}

body.user-subpage .user-order-tabs button.active::after {
  display: none;
}

body.user-subpage .user-order-tabs button,
body.user-subpage .user-wallet-tabs button,
body.user-subpage .user-code-tabs button {
  min-height: 42px;
  border-radius: 999px;
}

body.user-subpage .user-order-tabs button.active,
body.user-subpage .user-wallet-tabs button.active,
body.user-subpage .user-code-tabs button.active {
  background: var(--front-ink);
  color: #fff;
}

body.user-subpage .user-order-list,
body.user-subpage .user-wallet-log-list {
  padding: 0;
}

body.user-subpage .user-product-grid,
body.user-subpage .user-cart-list,
body.user-subpage .user-follow-list {
  gap: 12px;
}

body.user-subpage .user-product-card,
body.user-subpage .user-cart-item,
body.user-subpage .user-follow-card,
body.user-subpage .user-order-card,
body.user-subpage .user-wallet-log {
  box-shadow: 0 5px 18px rgba(29, 34, 41, .045);
}

body.user-subpage .user-form-grid .input,
body.user-subpage .user-form-grid .textarea,
body.user-subpage .user-form-grid .select,
body.user-subpage .user-code-search input,
body.user-subpage .user-page-search input {
  border-color: var(--front-line);
  border-radius: 13px;
  background: #fafbfc;
}

body.user-subpage .user-form-submit,
body.user-subpage .user-code-search button,
body.user-subpage .user-page-search button {
  min-height: 42px;
  border-radius: 999px;
  background: var(--front-ink);
}

body.user-subpage .user-product-meta strong,
body.user-subpage .user-order-head strong,
body.user-subpage .user-cart-bottom strong,
body.user-subpage .user-cart-checkout-summary strong,
body.user-subpage .user-wallet-log aside b.income {
  color: var(--front-pink);
}

/* Keep authentication in the same visual language as the signed-in center. */
body.buyer-auth-active {
  background: var(--front-bg) !important;
  color: var(--front-ink);
}

body.buyer-auth-active .buyer-shell {
  width: min(520px, calc(100% - 40px));
  margin: 22px auto;
  overflow: hidden;
  border: 1px solid var(--front-line);
  border-radius: 24px;
  background: var(--front-paper);
  box-shadow: 0 16px 44px rgba(29, 34, 41, .1);
}

body.buyer-auth-active .buyer-auth-shell {
  min-height: calc(100vh - 44px);
  background: var(--front-paper);
}

body.buyer-auth-active .buyer-auth-shell::before {
  display: none;
}

body.buyer-auth-active .buyer-auth-heading h1,
body.buyer-auth-active .buyer-auth-brand {
  color: var(--front-ink);
}

body.buyer-auth-active .buyer-auth-heading p,
body.buyer-auth-active .buyer-auth-links,
body.buyer-auth-active .buyer-auth-switch,
body.buyer-auth-active .buyer-auth-divider {
  color: var(--front-muted);
}

body.buyer-auth-active .buyer-auth-field input {
  border-color: var(--front-line);
  border-radius: 14px;
  background: #fafbfc;
  color: var(--front-ink);
}

body.buyer-auth-active .buyer-auth-field input:focus {
  border-color: #aeb4bc;
  box-shadow: 0 0 0 3px rgba(31, 35, 41, .08);
}

body.buyer-auth-active .buyer-auth-submit {
  border-radius: 999px;
  background: var(--front-ink);
  box-shadow: 0 10px 22px rgba(29, 34, 41, .14);
}

body.buyer-auth-active .buyer-auth-links button,
body.buyer-auth-active .buyer-auth-switch button {
  color: var(--front-pink);
}

body.buyer-auth-active .buyer-auth-secondary {
  border-color: var(--front-line);
  border-radius: 999px;
  color: var(--front-ink);
}

body.front-frame-page > .front-app-frame.home-page .public-bottom-nav,
body.front-frame-page > .front-app-frame.buyer-page .public-bottom-nav {
  width: 356px;
  max-width: calc(100% - 28px);
}

/* The frame stays full width on desktop; only the content keeps a readable max width. */
@media (min-width: 700px) {
  body.front-frame-page > .front-app-frame.home-page,
  body.front-frame-page > .front-app-frame.buyer-page,
  body.front-frame-page > .front-app-frame.user-subpage {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.front-frame-page > .front-app-frame.home-page > .front-app-content,
  body.front-frame-page > .front-app-frame.buyer-page > .front-app-content,
  body.front-frame-page > .front-app-frame.user-subpage > .front-app-content {
    min-height: 100vh;
    border-radius: 0;
  }
}

@media (min-width: 1100px) {
  body.user-subpage .user-page-shell {
    width: min(960px, calc(100% - 96px));
  }
}

@media (max-width: 900px) {
  body.home-page .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.buyer-page:not(.buyer-auth-active) .user-profile-band {
    grid-template-columns: 1fr;
  }

  body.buyer-page:not(.buyer-auth-active) .user-wallet-row {
    grid-column: 1;
    min-width: 0;
    padding-top: 14px;
    border-top: 1px solid var(--front-line);
  }
}

@media (max-width: 699px) {
  :root {
    --front-page-bg: #f5f6f7;
  }

  body.home-page .product-home {
    width: calc(100% - 24px);
    padding-top: 18px;
  }

  body.home-page .toolbar {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  body.home-page .search-action {
    max-width: none;
  }

  body.home-page .sort-row {
    min-width: 0;
    width: 100%;
  }

  body.home-page .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
  }

  body.home-page .product-body {
    padding: 9px 9px 10px;
  }

  body.home-page .product-title {
    min-height: 34px;
    font-size: 12px;
  }

  body.home-page .card-bottom-line {
    font-size: 10px;
  }

  body.home-page .product-preview-card {
    width: calc(100% - 24px);
    border-radius: 18px;
  }

  body.home-page .preview-image-box {
    width: 100%;
  }

  body.home-page .preview-actions {
    overflow-x: auto;
    justify-content: flex-start;
  }

  body.home-page .preview-actions .btn {
    flex: 0 0 auto;
  }

  body.buyer-page:not(.buyer-auth-active) .buyer-shell,
  body.user-subpage .user-page-shell {
    width: calc(100% - 20px);
  }

  body.buyer-page:not(.buyer-auth-active) .buyer-shell {
    padding-top: 10px;
    padding-bottom: 100px;
  }

  body.buyer-page:not(.buyer-auth-active) .user-profile-band,
  body.buyer-page:not(.buyer-auth-active) .user-commerce-grid,
  body.buyer-page:not(.buyer-auth-active) .user-section-band {
    border-radius: 16px;
  }

  body.buyer-page:not(.buyer-auth-active) .user-profile-band {
    gap: 12px;
    padding: 16px 14px 14px;
  }

  body.buyer-page:not(.buyer-auth-active) .user-section-band {
    padding: 14px;
  }

  body.buyer-page:not(.buyer-auth-active) .user-service-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.buyer-page:not(.buyer-auth-active) .user-service-grid > a,
  body.buyer-page:not(.buyer-auth-active) .user-service-grid > button {
    min-height: 76px;
  }

  body.user-subpage .user-page-topbar {
    top: 8px;
    min-height: 50px;
    margin: 8px 0 12px;
  }

  body.user-subpage .user-page-shell {
    padding-bottom: 28px;
  }

  body.user-subpage .user-page-topbar h1 {
    font-size: 15px;
  }

  body.user-subpage .user-list-content {
    padding-bottom: 18px;
  }

  body.user-subpage .user-product-card,
  body.user-subpage .user-cart-item,
  body.user-subpage .user-follow-card,
  body.user-subpage .user-order-card,
  body.user-subpage .user-price-item,
  body.user-subpage .user-code-item,
  body.user-subpage .user-empty-state,
  body.user-subpage .user-form-section,
  body.user-subpage .user-profile-preview,
  body.user-subpage .user-wallet-summary-card,
  body.user-subpage .user-invite-card,
  body.user-subpage .user-denied,
  body.user-subpage .user-recommend-section,
  body.user-subpage .user-wallet-tabs,
  body.user-subpage .user-code-tabs {
    border-radius: 16px;
  }

  body.buyer-auth-active .buyer-shell {
    width: calc(100% - 24px);
    margin: 12px auto;
    border-radius: 20px;
  }

  body.buyer-auth-active .buyer-auth-shell {
    min-height: calc(100vh - 24px);
  }
}

/* Followed stores keep the shop identity and product previews readable on wide screens. */
body.user-subpage[data-user-collection="follows"] .user-follow-card {
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
}

body.user-subpage[data-user-collection="follows"] .user-follow-head {
  gap: 16px;
}

body.user-subpage[data-user-collection="follows"] .user-follow-profile > img {
  width: 60px;
  height: 60px;
  flex-basis: 60px;
}

body.user-subpage[data-user-collection="follows"] .user-follow-copy {
  gap: 6px;
}

body.user-subpage[data-user-collection="follows"] .user-follow-copy strong {
  font-size: 16px;
}

body.user-subpage[data-user-collection="follows"] .user-follow-copy span {
  font-size: 13px;
}

body.user-subpage[data-user-collection="follows"] .user-follow-actions {
  gap: 8px;
}

body.user-subpage[data-user-collection="follows"] .user-follow-enter,
body.user-subpage[data-user-collection="follows"] .user-follow-card button {
  min-width: 68px;
  height: 34px;
}

body.user-subpage[data-user-collection="follows"] .user-follow-products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  overflow: visible;
}

body.user-subpage[data-user-collection="follows"] .user-follow-products a {
  grid-template-rows: minmax(118px, 1fr) auto;
  width: 100%;
  min-width: 0;
  aspect-ratio: 4 / 3;
  border: 1px solid #e8ebef;
  border-radius: 12px;
}

body.user-subpage[data-user-collection="follows"] .user-follow-products img {
  width: 100%;
  height: 100%;
  min-height: 0;
}

body.user-subpage[data-user-collection="follows"] .user-follow-products strong {
  padding: 7px 9px 8px;
  font-size: 12px;
}

@media (max-width: 699px) {
  body.front-frame-page > .front-app-frame.home-page .fixed-bg-pattern,
  body.front-frame-page > .front-app-frame.buyer-page .fixed-bg-pattern,
  body.front-frame-page > .front-app-frame.user-subpage .fixed-bg-pattern,
  body.front-frame-page > .front-app-frame.tool-page .fixed-bg-pattern,
  body.front-frame-page > .front-app-frame.utility-page .fixed-bg-pattern,
  body.front-frame-page > .front-app-frame.public-shop-page .fixed-bg-pattern,
  body.front-frame-page > .front-app-frame.product-detail-page .fixed-bg-pattern {
    display: none !important;
    background: none !important;
    background-image: none !important;
  }

  body.user-subpage[data-user-collection="follows"] .user-follow-card {
    gap: 12px;
    padding: 13px;
    border-radius: 16px;
  }

  body.user-subpage[data-user-collection="follows"] .user-follow-profile > img {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
  }

  body.user-subpage[data-user-collection="follows"] .user-follow-copy strong {
    font-size: 14px;
  }

  body.user-subpage[data-user-collection="follows"] .user-follow-copy span {
    font-size: 12px;
  }

  body.user-subpage[data-user-collection="follows"] .user-follow-enter,
  body.user-subpage[data-user-collection="follows"] .user-follow-card button {
    min-width: 54px;
    height: 30px;
    padding-inline: 8px;
    font-size: 11px;
  }

  body.user-subpage[data-user-collection="follows"] .user-follow-products {
    gap: 8px;
  }

  body.user-subpage[data-user-collection="follows"] .user-follow-products a {
    grid-template-rows: minmax(72px, 1fr) auto;
    border-radius: 10px;
  }

  body.user-subpage[data-user-collection="follows"] .user-follow-products strong {
    padding: 5px 6px 6px;
    font-size: 10px;
  }
}

/* Followed shops use a compact, shop-first row instead of product previews. */
body.user-subpage[data-user-collection="follows"] .user-follow-list {
  gap: 10px;
}

body.user-subpage[data-user-collection="follows"] .user-follow-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid #edf0f3;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(28, 32, 38, .04);
}

body.user-subpage[data-user-collection="follows"] .user-follow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.user-subpage[data-user-collection="follows"] .user-follow-profile {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

body.user-subpage[data-user-collection="follows"] .user-follow-profile > img {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border: 1px solid #f0f1f3;
  border-radius: 50%;
  object-fit: cover;
}

body.user-subpage[data-user-collection="follows"] .user-follow-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

body.user-subpage[data-user-collection="follows"] .user-follow-copy strong {
  overflow: hidden;
  color: #252a31;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.user-subpage[data-user-collection="follows"] .user-follow-copy span {
  overflow: hidden;
  color: #8b929d;
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.user-subpage[data-user-collection="follows"] .user-follow-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

body.user-subpage[data-user-collection="follows"] .user-follow-card button,
body.user-subpage[data-user-collection="follows"] .user-follow-enter {
  display: inline-flex;
  height: 34px;
  min-width: 58px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

body.user-subpage[data-user-collection="follows"] .user-follow-card button {
  border: 1px solid #ffdbe2;
  background: #fff8fa;
  color: #ef5e7a;
}

body.user-subpage[data-user-collection="follows"] .user-follow-enter {
  border: 1px solid #242c36;
  background: #242c36;
  color: #fff;
}

body.user-subpage[data-user-collection="follows"] .user-follow-products,
body.user-subpage[data-user-collection="follows"] .user-follow-empty {
  display: none !important;
}

@media (max-width: 380px) {
  body.user-subpage[data-user-collection="follows"] .user-follow-card {
    padding: 12px;
  }

  body.user-subpage[data-user-collection="follows"] .user-follow-profile > img {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  body.user-subpage[data-user-collection="follows"] .user-follow-actions {
    gap: 6px;
  }

  body.user-subpage[data-user-collection="follows"] .user-follow-card button,
  body.user-subpage[data-user-collection="follows"] .user-follow-enter {
    min-width: 52px;
    height: 32px;
    padding-inline: 8px;
    font-size: 11px;
  }
}

/* Collection pages use a normal header so cards never pass underneath it while scrolling. */
body.front-frame-page > .front-app-frame.user-subpage .user-page-topbar {
  position: relative;
  top: auto;
  z-index: 2;
}

body.front-frame-page > .front-app-frame.user-subpage[data-user-collection="cart"] .user-page-shell {
  padding-bottom: calc(94px + env(safe-area-inset-bottom));
}

/* Keep the restored card snapshot visible while the page position settles. */
body.home-page.preview-restoring .product-home {
  visibility: visible;
}

/* The buyer entry reuses the storefront frame instead of adding a second desktop card. */
body.front-frame-page.buyer-auth-active > .front-app-frame.buyer-page .buyer-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.front-frame-page.buyer-auth-active > .front-app-frame.buyer-page .buyer-auth-shell {
  grid-template-rows: minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  border-radius: 0;
}

body.front-frame-page.buyer-auth-active > .front-app-frame.buyer-page .buyer-auth-topbar {
  display: none;
}

/* followed-store-title-20260810 */
body.user-subpage[data-user-collection="follows"] .user-follow-copy {
  display: flex;
  align-items: center;
  min-height: 52px;
  gap: 0;
}

body.user-subpage[data-user-collection="follows"] .user-follow-copy strong {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.user-subpage[data-user-collection="follows"] .user-follow-copy span {
  display: none;
}

body.user-subpage[data-user-collection="follows"] .user-follow-store-icon {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  object-fit: contain;
}

@media (max-width: 699px) {
  body.user-subpage[data-user-collection="follows"] .user-follow-copy {
    min-height: 50px;
  }

  body.user-subpage[data-user-collection="follows"] .user-follow-store-icon {
    width: 15px;
    height: 15px;
    flex-basis: 15px;
  }
}

/* 随便看看固定在右侧竖向贴边，并保留红色呼吸灯。 */
body.home-page .random-theme-float,
body.front-frame-page > .front-app-frame.home-page .random-theme-float {
  top: 40vh !important;
  left: auto !important;
  right: 0 !important;
  position: fixed !important;
  z-index: 2147483001 !important;
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  width: 30px !important;
  min-width: 30px !important;
  min-height: 70px !important;
  height: 70px !important;
  padding: 8px 5px !important;
  border: 1px solid #ddd !important;
  border-right: 0 !important;
  border-radius: 8px 0 0 8px !important;
  background: #fff !important;
  color: #111 !important;
  box-shadow: -1px 2px 6px rgba(0, 0, 0, .14) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
  letter-spacing: 1px !important;
  writing-mode: vertical-rl !important;
  text-orientation: mixed !important;
  transform: translateY(-50%) !important;
  transition: width .25s ease, background .25s ease, box-shadow .25s ease !important;
}

body.home-page .random-theme-float:hover,
body.home-page .random-theme-float:active {
  width: 35px !important;
  background: #f5f5f5 !important;
  box-shadow: -1px 3px 10px rgba(0, 0, 0, .18) !important;
}

body.home-page .random-theme-float span {
  display: block;
  line-height: 1.45 !important;
}

body.home-page .random-theme-float::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff3b45;
  box-shadow: 0 0 0 0 rgba(255, 59, 69, .52);
  pointer-events: none;
  animation: randomThemeBreath 1.8s ease-out infinite;
}

@keyframes randomThemeBreath {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 69, .52); }
  70% { box-shadow: 0 0 0 7px rgba(255, 59, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 69, 0); }
}

@media (prefers-reduced-motion: reduce) {
  body.home-page .random-theme-float::before {
    animation: none;
  }
}

/* 首页商品标题关闭下划线效果。 */
body.home-page #productsGrid .product-title.centered {
  display: grid;
  place-items: center;
  text-align: center;
}

body.home-page #productsGrid .product-title-lines {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  text-wrap: balance;
  text-align: center;
}

body.home-page #productsGrid .product-title-text {
  display: inline;
  max-width: none;
  overflow-wrap: anywhere;
  line-height: inherit;
  background: none !important;
  background-size: 0 !important;
}

body.home-page #productsGrid .product-title-line {
  position: relative;
  display: inline-block;
  max-width: 100%;
  padding-bottom: 0;
  line-height: inherit;
}

body.home-page #productsGrid .product-title-line::after {
  display: none !important;
}

body.home-page #productsGrid .product-card:hover .product-title-line::after {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  body.home-page #productsGrid .product-title-line::after {
    transition: none;
  }
}
