/* Category browsing follows the inbox heading, spacing and surfaces; goods stay in a two-column grid. */
html[data-ds-theme] .category-container[data-v-64370f3f] {
  --cat-line: color-mix(in srgb, var(--ds-muted, #7a808a) 14%, transparent);
  --cat-shadow: 0 5px 18px rgb(20 28 42 / 3%);
  --cat-cart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h2l2 12h12l2-9H6M9 20h.01M18 20h.01'/%3E%3C/svg%3E");
  background: radial-gradient(ellipse 100% 300px at 50% 0, var(--ds-glow, #f9eabd), transparent), var(--ds-bg, #f6f8fb) !important;
  color: var(--ds-text, #20242b);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  -webkit-tap-highlight-color: transparent;
}
html[data-ds-theme] .category-container[data-v-64370f3f] > .header-bg { opacity: 0; }
html[data-ds-theme] .category-container[data-v-64370f3f] .online-container { box-sizing: border-box; width: 100%; max-width: 560px; padding: 0 18px; align-self: center; gap: 0; }

/* Same real title/subtitle structure and decorative icon as the message page. */
.category-container[data-v-64370f3f] .category-page-heading { order: 0; display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 20px; padding: calc(30px + env(safe-area-inset-top, 0px)) 4px 24px; }
.category-container[data-v-64370f3f] .category-heading-copy { min-width: 0; }
.category-container[data-v-64370f3f] .category-page-title { display: block; font-size: 28px; font-weight: 750; letter-spacing: -.8px; line-height: 1.35; }
.category-container[data-v-64370f3f] .category-page-subtitle { display: block; margin-top: 8px; color: var(--ds-muted); font-size: 12px; line-height: 1.6; letter-spacing: .3px; }
.category-container[data-v-64370f3f] .category-heading-icon { display: grid; flex: 0 0 50px; width: 50px; height: 50px; place-items: center; border: 1px solid var(--cat-line); border-radius: 17px; background: var(--ds-glass, rgb(255 255 255 / 62%)); box-shadow: 0 5px 16px rgb(20 28 42 / 3%); }
.category-container[data-v-64370f3f] .category-heading-icon::after {
  content: ''; width: 24px; height: 24px; background: var(--ds-text);
  --category-grid-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='3' y='3' width='7' height='7' rx='2'/%3E%3Crect x='14' y='3' width='7' height='7' rx='2'/%3E%3Crect x='3' y='14' width='7' height='7' rx='2'/%3E%3Crect x='14' y='14' width='7' height='7' rx='2'/%3E%3C/svg%3E");
  -webkit-mask: var(--category-grid-icon) center / contain no-repeat; mask: var(--category-grid-icon) center / contain no-repeat;
}

/* All configured primary category variants remain horizontally browsable. */
html[data-ds-theme] .category-container[data-v-64370f3f] .primary-category-section { order: 1; box-sizing: border-box; flex: 0 0 auto !important; height: auto !important; margin: 0 0 24px; padding: 14px 8px 12px !important; border: 1px solid var(--cat-line) !important; border-radius: 21px; background: var(--ds-surface) !important; box-shadow: 0 8px 24px rgb(20 28 42 / 4%) !important; }
html[data-ds-theme] .category-container[data-v-64370f3f] .primary-category-list { width: max-content; min-width: 100%; align-items: flex-start; padding: 2px 0 !important; }
html[data-ds-category="classic"] .category-container[data-v-64370f3f] .primary-category-item { flex: 0 0 66px; min-width: 66px; margin: 0 3px 0 0; padding: 2px 3px 0; }
html[data-ds-category="classic"] .category-container[data-v-64370f3f] .primary-icon-wrap { box-sizing: border-box; width: 44px; height: 44px; margin-bottom: 7px; padding: 2px; border: 1px solid var(--cat-line); border-radius: 14px; background: var(--ds-bg); }
html[data-ds-category="classic"] .category-container[data-v-64370f3f] .primary-category-item.active .primary-icon-wrap { border-color: var(--ds-accent); background: var(--ds-soft); }
html[data-ds-theme] .category-container[data-v-64370f3f] .primary-icon { border-radius: 10px; }
html[data-ds-theme] .category-container[data-v-64370f3f] .primary-name { max-width: 76px; font-size: 11px; font-weight: 500; line-height: 18px; color: var(--ds-muted) !important; }
html[data-ds-theme] .category-container[data-v-64370f3f] .primary-category-item.active .primary-name { color: var(--ds-text) !important; font-weight: 650; }
html[data-ds-category^="image-"] .category-container[data-v-64370f3f] .primary-category-list { width: 100%; min-width: 100%; }
html[data-ds-category^="image-"] .category-container[data-v-64370f3f] .primary-category-item { flex-shrink: 0; }

/* Recent-conversation style section heading and compact segmented switch. */
.category-container[data-v-64370f3f] .category-section-row { order: 2; display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 14px; }
.category-container[data-v-64370f3f] .category-section-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
.category-container[data-v-64370f3f] .category-section-title { color: var(--ds-text); font-size: 17px; font-weight: 700; white-space: nowrap; line-height: 1.5; }
.category-container[data-v-64370f3f] .category-section-count { padding: 1px 6px; border: 1px solid var(--cat-line); border-radius: 7px; color: var(--ds-muted); font-size: 11px; line-height: 16px; font-variant-numeric: tabular-nums; }
html[data-ds-theme] .category-container[data-v-64370f3f] .view-toggle { box-sizing: border-box; flex: 0 0 152px; width: 152px; height: 38px; margin: 0; padding: 4px; gap: 4px; border: 1px solid var(--cat-line); border-radius: 12px; background: color-mix(in srgb, var(--ds-surface) 65%, transparent) !important; box-shadow: none; }
html[data-ds-theme] .category-container[data-v-64370f3f] .view-toggle-slider { top: 3px; bottom: 3px; left: 3px; width: calc((100% - 10px) / 2); border-radius: 9px; background: var(--ds-text); box-shadow: 0 2px 5px rgb(20 28 42 / 12%); }
html[data-ds-theme] .category-container[data-v-64370f3f] .toggle-btn { height: 28px; color: var(--ds-muted); font-size: 12px; font-weight: 500; letter-spacing: 0; }
html[data-ds-theme] .category-container[data-v-64370f3f] .toggle-btn.active { color: var(--ds-surface); font-weight: 650; }

html[data-ds-theme] .category-container[data-v-64370f3f] .category-main { order: 3; display: flex; flex-direction: column; width: 100%; margin: 0; gap: 12px; min-height: 0; border: 0; }
.category-container[data-v-64370f3f] .category-filter-row { display: flex; flex: 0 0 38px; align-items: center; width: 100%; min-width: 0; gap: 10px; }
html[data-ds-theme] .category-container[data-v-64370f3f] .secondary-category-sidebar { box-sizing: border-box; flex: 1 1 0%; min-width: 0; width: 0; height: 38px; padding: 0; border-radius: 0; }
html[data-ds-theme] .category-container[data-v-64370f3f] .secondary-category-sidebar .uni-scroll-view-content { display: flex; align-items: center; width: max-content; min-width: 100%; height: 38px; gap: 7px; }
html[data-ds-theme] .category-container[data-v-64370f3f] .secondary-category-item { box-sizing: border-box; flex: 0 0 auto; min-height: 34px; height: 34px; margin: 0; padding: 0 12px; border: 1px solid var(--cat-line) !important; border-radius: 11px; background: color-mix(in srgb, var(--ds-surface) 65%, transparent) !important; color: var(--ds-muted) !important; box-shadow: none !important; outline: none; font-size: 12px; line-height: 32px; white-space: nowrap; }
html[data-ds-theme] .category-container[data-v-64370f3f] .secondary-category-item.active { border-color: color-mix(in srgb, var(--ds-accent) 24%, var(--cat-line)) !important; background: var(--ds-soft) !important; color: var(--ds-text) !important; font-weight: 650; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-sort-bar { flex: 0 0 auto; width: auto; max-width: 132px; height: 34px; margin: 0; padding: 0 10px; gap: 5px; border: 1px solid var(--cat-line); border-radius: 11px; background: var(--ds-surface) !important; font-size: 11px; line-height: 32px; box-shadow: none; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-sort-label { color: var(--ds-muted) !important; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-sort-value { color: var(--ds-text) !important; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-sort-arrow { margin-left: 0; color: var(--ds-muted); }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-container { flex: 1 1 0%; height: 0; min-height: 0; min-width: 0; width: 100%; padding: 0; border-radius: 0; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-container .uni-scroll-view-content { box-sizing: border-box; padding-bottom: calc(116px + env(safe-area-inset-bottom, 0px)); }
html[data-ds-theme] .category-container[data-v-64370f3f] .uni-scroll-view { scrollbar-width: none; }
html[data-ds-theme] .category-container[data-v-64370f3f] .uni-scroll-view::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Keep the existing image-above-text product cards and theme gradient. */
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-area { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: none; padding: 0 0 2px; align-items: stretch; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-item { box-sizing: border-box; display: flex; flex-direction: column; align-items: stretch; gap: 0; min-height: 0; padding: 0; border: 1px solid var(--cat-line); border-radius: 20px; background: #fff !important; box-shadow: var(--cat-shadow); transition: transform .18s ease, border-color .18s ease; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-item:active { transform: scale(.99); }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-item .goods-icon-wrap { box-sizing: border-box; flex: 0 0 auto; width: 100%; height: auto; aspect-ratio: 1; align-self: stretch; overflow: hidden; border-radius: 0; background: var(--ds-bg); }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-item .goods-icon { border-radius: 0; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-item .goods-info { display: flex; flex: 1 1 auto; flex-direction: column; gap: 4px; min-width: 0; width: 100%; margin: 0; padding: 11px 11px 10px; color: #20242b !important; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-item .goods-name { max-height: 40px; font-size: 14px; font-weight: 650; line-height: 20px; color: #20242b !important; -webkit-line-clamp: 2; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-item .goods-description { min-height: 17px; max-height: 17px; color: #6b7280 !important; font-size: 11px; line-height: 17px; -webkit-line-clamp: 1; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-card-footer { min-height: 30px; margin-top: auto; padding-top: 3px; gap: 8px; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-item .goods-price { color: #e85916 !important; font-size: 18px; font-weight: 700; letter-spacing: -.4px; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-order-btn { flex: 0 0 30px; width: 30px; height: 30px; border: 0; border-radius: 10px; background: var(--ds-accent) !important; color: var(--ds-on-accent) !important; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-order-btn > * { display: none; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-order-btn::before { content: ''; width: 18px; height: 18px; background: var(--ds-on-accent); -webkit-mask: var(--cat-cart) center / contain no-repeat; mask: var(--cat-cart) center / contain no-repeat; }
html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-container .empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 200px; padding: 24px; border: 1px solid var(--cat-line); border-radius: 20px; background: var(--ds-surface); box-shadow: var(--cat-shadow); }
html[data-ds-theme] .category-container[data-v-64370f3f] .empty-text { color: var(--ds-muted); font-size: 13px; }

html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-area { order: 3; padding: 0; background: transparent !important; }
html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-content { padding: 0 0 calc(116px + env(safe-area-inset-bottom, 0px)); }
html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-list { gap: 11px; counter-reset: category-rank; }
html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-item { min-height: 108px; padding: 14px; border: 1px solid var(--cat-line); border-radius: 20px; background: var(--ds-surface) !important; box-shadow: var(--cat-shadow); counter-increment: category-rank; }
html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-left { position: relative; margin-right: 12px; }
html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-left::after { content: counter(category-rank, decimal-leading-zero); position: absolute; left: -4px; top: -5px; min-width: 20px; padding: 2px 4px; border: 2px solid var(--ds-surface); border-radius: 7px; background: var(--ds-soft); color: var(--ds-text); font: 650 10px/15px Arial, sans-serif; text-align: center; }
html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-item:nth-child(-n+3) .ranking-left::after { background: var(--ds-accent); color: var(--ds-on-accent); }
html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-icon { width: 60px; height: 60px; border: 0; border-radius: 13px; }
html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-center { margin-right: 10px; }
html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-name { display: -webkit-box; max-height: 40px; margin-bottom: 5px; color: var(--ds-text) !important; font-size: 14px; font-weight: 650; line-height: 20px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-sales { margin-bottom: 8px; color: var(--ds-muted) !important; font-size: 11px; }
html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-bar-wrap { height: 4px; background: var(--ds-soft); }
html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-bar { background: var(--ds-accent); }
html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-right { flex: 0 0 70px; width: 70px; gap: 7px; }
html[data-ds-theme] .category-container[data-v-64370f3f] :is(.ranking-btn-order,.ranking-btn-review) { height: 30px; padding: 0 5px; border-radius: 9px; font-size: 11px; }
html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-btn-order { background: var(--ds-text) !important; color: var(--ds-surface) !important; }
html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-btn-review { border-color: var(--cat-line); background: transparent; color: var(--ds-muted); }

html[data-ds-theme] body.pages-category-category .category-sort-popover { padding: 16px; border: 1px solid color-mix(in srgb, var(--ds-muted) 14%, transparent); border-radius: 20px; background: var(--ds-surface); color: var(--ds-text); box-shadow: 0 12px 40px rgb(20 28 42 / 15%); }
html[data-ds-theme] body.pages-category-category .category-sort-popover::before { background: var(--ds-surface); }
html[data-ds-theme] body.pages-category-category .category-sort-title { margin-bottom: 12px; color: var(--ds-text); }
html[data-ds-theme] body.pages-category-category .category-sort-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
html[data-ds-theme] body.pages-category-category .category-sort-popover button { height: 40px; border-radius: 10px; background: var(--ds-bg); color: var(--ds-muted); font-size: 12px; }
html[data-ds-theme] body.pages-category-category .category-sort-popover button.selected { border-color: var(--ds-accent); background: var(--ds-soft); color: var(--ds-text); }
html[data-ds-theme] body.pages-category-category .category-sort-popover .category-sort-confirm { border-color: var(--ds-text); background: var(--ds-text); color: var(--ds-surface); }
html[data-ds-theme] body.pages-category-category .category-sort-actions { border-color: color-mix(in srgb, var(--ds-muted) 14%, transparent); margin-top: 14px; padding-top: 12px; }
html[data-ds-theme] body.pages-category-category .category-sort-actions .category-sort-reset { border-color: color-mix(in srgb, var(--ds-muted) 24%, transparent); }

@media (max-width: 360px) {
  html[data-ds-theme] .category-container[data-v-64370f3f] .online-container { padding-left: 14px; padding-right: 14px; }
  .category-container[data-v-64370f3f] .category-page-heading { padding: calc(26px + env(safe-area-inset-top, 0px)) 4px 22px; }
  .category-container[data-v-64370f3f] .category-page-title { font-size: 26px; }
  .category-container[data-v-64370f3f] .category-page-subtitle { font-size: 11px; }
  .category-container[data-v-64370f3f] .category-heading-icon { width: 44px; height: 44px; flex-basis: 44px; border-radius: 15px; }
  html[data-ds-theme] .category-container[data-v-64370f3f] .view-toggle { width: 140px; flex-basis: 140px; }
  .category-container[data-v-64370f3f] .category-section-title { font-size: 16px; }
  html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-area { gap: 10px; }
  html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-item .goods-info { padding: 9px; }
  html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-item .goods-name { font-size: 13px; }
  html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-item .goods-price { font-size: 16px; }
  html[data-ds-theme] .category-container[data-v-64370f3f] .goods-order-btn { width: 28px; height: 28px; flex-basis: 28px; }
  html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-item { padding: 12px 10px; }
  html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-icon { width: 50px; height: 50px; }
  html[data-ds-theme] .category-container[data-v-64370f3f] .ranking-right { width: 66px; flex-basis: 66px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-ds-theme] .category-container[data-v-64370f3f] .goods-list-item { transition: none; }
}


/* One document scroll; the heading and category rows move with the page. */
body.pages-category-category {
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: auto;
}
body.pages-category-category uni-page-body {
  height: auto !important;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: visible !important;
}
body.pages-category-category .category-container[data-v-64370f3f] {
  height: auto !important;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: visible !important;
}
body.pages-category-category .category-container[data-v-64370f3f] .online-container {
  flex: 0 0 auto;
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: visible !important;
}
.category-container[data-v-64370f3f] .category-browse-header {
  position: relative;
  z-index: 0;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  width: 100%;
  margin-bottom: 12px;
  isolation: isolate;
}
.category-container[data-v-64370f3f] .category-browse-header::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 -18px -8px;
  background: radial-gradient(ellipse 100% 300px at 50% 0, var(--ds-glow, #f9eabd), transparent), var(--ds-bg, #f6f8fb);
  border-bottom: 1px solid var(--cat-line, #20242b14);
  pointer-events: none;
}
.category-container[data-v-64370f3f] .category-browse-header .category-filter-row {
  order: 3;
}
body.pages-category-category .category-container[data-v-64370f3f] .category-main {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  overflow: visible;
}
body.pages-category-category .category-container[data-v-64370f3f] .goods-list-container {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  overflow: visible;
  padding: 0 0 calc(116px + env(safe-area-inset-bottom, 0px));
  touch-action: pan-y;
  overscroll-behavior: auto;
}
body.pages-category-category .category-container[data-v-64370f3f] .ranking-area {
  order: 4;
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  overflow: visible;
}
@media (max-width: 360px) {
  .category-container[data-v-64370f3f] .category-browse-header::before {
    left: -14px;
    right: -14px;
  }
}
