/* UI v2：基于 design-tokens.json 的新 UI 覆盖层
 * 目标：在不影响 legacy UI 的前提下，让 v2 优先使用 tokens（clr/* typ/* grd/*）
 */

/* v2：把主题通用变量映射到 tokens（只在 ui-v2 生效，便于随时切回 legacy） */
body.ui-v2 {
  /* 基础色板映射（按需逐步补全） */
  --color-bg: var(--clr-surface-canvas, #F6F4F1);
  --color-bg-alt: var(--clr-surface-inactive-fill);
  --color-fg: var(--clr-text-primary);
  --color-muted: var(--clr-text-inactive-on-btn);
  font-family: var(--typ-title-font-family), ui-sans-serif, system-ui, sans-serif;
  color: var(--clr-text-primary);
  background: var(--clr-surface-canvas, #F6F4F1);
  --color-border: var(--clr-surface-navbar-stroke);

  /* 品牌主色：来自 Figma tokens */
  --color-primary: var(--clr-brand-primary);

  /* 目前 tokens 里未提供 dark/hover 版本：先用主色兜底（避免写死） */
  --color-primary-dark: var(--clr-brand-primary);

  /* 强调色：用设计里已有的高亮橙（nav-btn-highlight） */
  --color-accent: var(--clr-surface-nav-btn-highlight);
  --color-accent-light: var(--clr-accent-label-separate-highlight);

  /* 危险提示：用 notifier-fill */
  --color-danger: var(--clr-accent-notifier-fill);
  --color-danger-dark: var(--clr-accent-notifier-stroke);

  /* Sticky-Tabs 背景：吸顶前后统一使用同一个底色（浮层在 body 下，变量必须全局可继承） */
  --rs-tabs-bar-bg: var(--clr-surface-base);
  /* 吸顶态：允许轻微透明（不要写死 rgba，仍然基于 token 计算） */
  /* 更透明：提高“透”感，但仍保留一点底色稳定性 */
  --rs-tabs-bar-bg-sticky: color-mix(in srgb, var(--rs-tabs-bar-bg) 86%, transparent);
}

/* v2 可视化标记：方便肉眼确认是否已切到 UI v2（后续确认无误可删除） */
body.ui-v2::before {
  content: none;
  display: none;
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 9999;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--clr-surface-overlay-dim);
  color: var(--clr-text-light-on-color);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.2px;
  pointer-events: none;
}

/* 调试：只要 Home v2 容器存在就显示，避免依赖 body 的 home class */
body.ui-v2 .rs-home-v2::after {
  content: none;
  display: none;
  position: fixed;
  left: 12px;
  top: 44px;
  z-index: 9999;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--clr-surface-overlay-dim);
  color: var(--clr-text-light-on-color);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.2px;
  pointer-events: none;
}

/* v2：可选——先隐藏旧的风格切换器，避免与 tokens 主色冲突（后续你若要保留再打开） */
body.ui-v2 #theme-switcher {
  display: none;
}

/* 文字色以 token 为准，不再在页面里把 primary 混回近黑 */

/* 主页：避免底部回弹导致出现“内容与 Nav 之间的空白缝隙” */
body.ui-v2,
html body.ui-v2,
body.ui-v2 .rs-home-v2 {
  overscroll-behavior: none;
  scroll-behavior: auto;
}

/* 页顶竖滑交给脚本：写在用户实际按住的层上，浏览器才不会把下拉收走 */
html.rs-pull-armed .rs-home-v2,
html.rs-pull-armed .rs-viewport,
html.rs-pull-armed .rs-layer-a-hero {
  touch-action: pan-x;
}

/* ========== Cart UI v2（参考你提供的 Cart 截图）========== */
body.ui-v2.woocommerce-cart {
  --rs-bottom-nav-h: 86px;
  --rs-cart-gap: 8px;
}

body.ui-v2.woocommerce-cart {
  --rs-cart-bottom-bar-h: 88px;
}

body.ui-v2.woocommerce-cart .site-main {
  padding-top: 0;
  /* 末尾留白直接对齐到与 Add more 上方同一个 gap */
  padding-bottom: var(--rs-cart-gap, 8px);
}

/* Cart：隐藏站点顶部栏，避免遮挡顶部 Nav */
body.ui-v2.woocommerce-cart .site-header {
  display: none;
}

body.ui-v2.woocommerce-cart .woocommerce-notices-wrapper {
  margin: 0 12px 8px;
  padding: 0;
}

body.ui-v2.woocommerce-cart .woocommerce-notices-wrapper:empty {
  display: none;
}

/* mock 空购物车时隐藏 Woo 默认空提示，避免占位留白 */
body.ui-v2.woocommerce-cart .woocommerce-notices-wrapper .cart-empty,
body.ui-v2.woocommerce-cart .woocommerce-notices-wrapper .return-to-shop {
  display: none !important;
  margin: 0 !important;
}

/* Cart v2 自定义了底部结算栏：隐藏 Woo 默认 collaterals，避免出现额外大留白 */
body.ui-v2.woocommerce-cart .cart-collaterals,
body.ui-v2.woocommerce-cart .cross-sells,
body.ui-v2.woocommerce-cart .cart_totals {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.ui-v2.woocommerce-cart .entry-title,
body.ui-v2.woocommerce-cart .rs-page-title {
  display: none;
}

body.ui-v2.woocommerce-cart .woocommerce-message,
body.ui-v2.woocommerce-cart .woocommerce-info,
body.ui-v2.woocommerce-cart .woocommerce-error {
  margin: 0 !important;
  padding: 10px 12px;
}

/* main.css 的 section 上下各 64px。购物车、订单、Profile 的标题栏下面不要这截空白。 */
body.ui-v2.woocommerce-cart .rs-cart-v2 section,
body.ui-v2.rs-orders-screen .rs-cart-v2 section,
body.ui-v2.rs-profile-screen .rs-cart-v2 section,
body.ui-v2.rs-sales-screen .rs-cart-v2 section {
  margin: 0 !important;
}

/* Debug: 确认 Cart v2 样式已加载 */
body.ui-v2.woocommerce-cart::after {
  content: "";
}

body.ui-v2 .rs-cart-v2 {
  max-width: 375px;
  margin: 0 auto;
  padding: 0 0 8px;
}

body.ui-v2 .rs-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}

body.ui-v2 .rs-topbar--center {
  justify-content: center;
}

body.ui-v2 .rs-cart-topbar {
  height: 48px;
  padding: 0 16px;
  margin: 0;
  background: var(--clr-surface-base);
  color: var(--color-fg);
  border-radius: 0;
}

body.ui-v2 .rs-topbar-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  flex: 1;
}

body.ui-v2 .rs-topbar-spacer {
  width: 40px;
}

body.ui-v2 .rs-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--clr-surface-btn-grey-fill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--color-fg);
}

body.ui-v2 .rs-page-title {
  margin: 10px 0 16px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

body.ui-v2 .rs-cart-view {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.ui-v2 .rs-cart-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 12px;
  background: var(--clr-surface-base);
}

body.ui-v2 .rs-cart-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 96px;
  padding: 6px 0;
  background: transparent;
  border: 0;
}

body.ui-v2 .rs-cart-summary-text {
  padding: 10px;
}

body.ui-v2 .rs-cart-summary-title {
  font-size: 20px;
  font-weight: 700;
}

body.ui-v2 .rs-cart-summary-subtitle {
  margin-top: 4px;
  font-size: 16px;
  color: var(--clr-text-inactive-on-btn);
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

body.ui-v2 .rs-cart-summary-count {
  font-size: var(--typ-cart-num-font-size);
  font-weight: var(--typ-cart-num-font-weight);
  color: var(--color-fg);
}

body.ui-v2 .rs-cart-summary-label {
  font-size: var(--typ-cart-info-font-size);
  font-weight: var(--typ-cart-info-font-weight);
}

body.ui-v2 .rs-cart-clear {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background: var(--clr-surface-btn-grey-fill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--color-fg);
  font-size: 18px;
}

body.ui-v2 .rs-cart-clear--disabled {
  opacity: 0.45;
}

body.ui-v2 .rs-cart-empty {
  padding: 28px 20px;
  border-radius: 18px;
  background: var(--clr-surface-btn-grey-fill);
  text-align: center;
  display: grid;
  gap: 10px;
  place-items: center;
}

body.ui-v2 .rs-cart-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--clr-surface-base);
  display: grid;
  place-items: center;
  font-size: 22px;
}

body.ui-v2 .rs-cart-empty-title {
  font-size: 18px;
  font-weight: 700;
}

body.ui-v2 .rs-cart-empty-subtitle {
  font-size: 12px;
  color: var(--clr-text-inactive-on-btn);
}

body.ui-v2 .rs-cart-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  background: transparent;
}

body.ui-v2 .rs-cart-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  background: transparent;
}

body.ui-v2 .rs-cart-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  min-height: 95px;
}

/* Cart 强制对齐 Figma 组件尺寸 */
body.ui-v2.woocommerce-cart .rs-cart-v2 {
  width: 100% !important;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.ui-v2.woocommerce-cart .rs-cart-topbar {
  margin: 0 !important;
}

body.ui-v2.woocommerce-cart .rs-cart-v2 {
  width: 100% !important;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.ui-v2.woocommerce-cart .rs-cart-list {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  padding: var(--rs-cart-gap, 8px) 12px !important;
  gap: 4px !important;
}

body.ui-v2.woocommerce-cart .rs-cart-view {
  gap: 0 !important;
}

body.ui-v2.woocommerce-cart .rs-cart-summary {
  min-height: 0 !important;
  padding: 0 !important;
}

body.ui-v2.woocommerce-cart .rs-cart-summary-text {
  padding: 0 !important;
}

body.ui-v2.woocommerce-cart .site-main {
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.ui-v2.woocommerce-cart {
  margin: 0 !important;
  padding: 0 !important;
  /* 列表白底一直铺到结算条，避免 Add more items 下面露出画布色断层 */
  background: var(--clr-surface-base) !important;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.ui-v2.woocommerce-cart .site-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  background: var(--clr-surface-base);
}

body.ui-v2.woocommerce-cart .rs-cart-v2,
body.ui-v2.woocommerce-cart .rs-cart-form,
body.ui-v2.woocommerce-cart .rs-cart-view {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  background: var(--clr-surface-base);
}

body.ui-v2 .site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

body.ui-v2 .site-footer .rs-footer-slogan {
  margin: 0;
  font-size: var(--typ-list-item-detail-font-size);
  font-weight: var(--typ-list-item-detail-font-weight);
  line-height: 1.3;
  letter-spacing: 0.04em;
  color: var(--clr-text-inactive-on-btn);
}

body.ui-v2.woocommerce-cart .site-footer {
  margin-top: 0;
  background: var(--clr-surface-base);
  border-top: 0;
  /* 店名落在结算条正上方，白底继续铺进固定底栏后面 */
  padding: 8px 16px calc(var(--rs-bottom-nav-h, 86px) + var(--rs-cart-bottom-bar-h, 88px) + 20px);
}

body.ui-v2.woocommerce-cart .container,
body.ui-v2.woocommerce-cart .site-content,
body.ui-v2.woocommerce-cart .woocommerce,
body.ui-v2.woocommerce-cart .woocommerce-cart-form {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}

/* Cart：复用 Catalog List 的布局与对齐 */
/* Cart：复用 Catalog List 的 AddQty 组件规则（不做页面补丁） */

/* Cart：让列表间距完全继承 Catalog List */
body.ui-v2.woocommerce-cart .rs-cart-items.rs-catalog-list {
  margin-top: var(--rs-cart-gap, 8px) !important;
  padding: 0 !important;
}

body.ui-v2.woocommerce-cart .rs-catalog-actions .rs-addqty-add,
body.ui-v2.woocommerce-cart .rs-catalog-actions .rs-addqty-ctrl {
  background: var(--clr-surface-base) !important;
  border: 1px solid var(--clr-surface-btn-light-stroke) !important;
  box-shadow: none !important;
}

body.ui-v2.woocommerce-cart .rs-catalog-actions .rs-addqty-ctrl {
  overflow: visible !important;
  gap: 10px !important;
  padding: 0 10px !important;
}

body.ui-v2.woocommerce-cart .rs-catalog-actions .rs-addqty-inc {
  display: inline-flex !important;
  min-width: 20px !important;
}

/* Cart 列表复用 rs-catalog 组件样式 */

body.ui-v2 .rs-cart-qty-input-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

body.ui-v2:not(.woocommerce-cart) .rs-cart-item .rs-addqty {
  position: static;
  right: auto;
  bottom: auto;
  max-width: none;
}

body.ui-v2:not(.woocommerce-cart) .rs-cart-item .rs-addqty {
  --rs-promo-addqty-add-size: 32px;
  --rs-promo-addqty-q-size: 32px;
  --rs-promo-addqty-pill-w: 100px;
  --rs-promo-addqty-btn-w: 20px;
}

body.ui-v2:not(.woocommerce-cart) .rs-cart-item .rs-addqty-ctrl {
  padding: 0 10px;
  gap: 10px;
}

/* Cart 使用 Catalog List 的 AddQty 样式 */

body.ui-v2:not(.woocommerce-cart) .rs-cart-item .rs-addqty-num {
  font-size: 14px;
  font-weight: 400;
}

body.ui-v2:not(.woocommerce-cart) .rs-cart-item .rs-addqty-add svg {
  width: 20px;
  height: 20px;
}

body.ui-v2:not(.woocommerce-cart) .rs-cart-item .rs-addqty-dec svg,
body.ui-v2:not(.woocommerce-cart) .rs-cart-item .rs-addqty-inc svg {
  width: 18px;
  height: 18px;
}

body.ui-v2:not(.woocommerce-cart) .rs-cart-item[data-rs-qty="0"] .rs-addqty-ctrl { display: none; }
body.ui-v2:not(.woocommerce-cart) .rs-cart-item:not([data-rs-qty="0"]) .rs-addqty-add { display: none; }
body.ui-v2:not(.woocommerce-cart) .rs-cart-item[data-rs-qty="1"] .rs-addqty-ico-minus { display: none; }
body.ui-v2:not(.woocommerce-cart) .rs-cart-item:not([data-rs-qty="1"]) .rs-addqty-ico-trash { display: none; }

body.ui-v2:not(.woocommerce-cart) .rs-cart-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.ui-v2:not(.woocommerce-cart) .rs-cart-name {
  flex: 1;
  max-width: 170px;
}

body.ui-v2 .rs-cart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
}

body.ui-v2 .rs-cart-thumb {
  width: 64px;
  height: 64px;
  border-radius: 0;
  overflow: hidden;
  background: var(--color-bg-alt);
}

body.ui-v2 .rs-cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.ui-v2 .rs-cart-name {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

body.ui-v2 .rs-cart-name a {
  color: inherit;
  text-decoration: none;
}

body.ui-v2 .rs-cart-meta {
  margin-top: 6px;
  color: var(--clr-text-inactive-on-btn);
  font-size: 12px;
}

body.ui-v2 .rs-cart-desc {
  line-height: 1.35;
}

body.ui-v2 .rs-cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.ui-v2 .rs-cart-price-row {
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

body.ui-v2.woocommerce-cart .rs-qty {
  background: var(--clr-surface-base);
  box-shadow: none;
}

body.ui-v2.woocommerce-cart .rs-qty-btn {
  background: transparent !important;
  color: var(--color-fg);
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

body.ui-v2 .rs-remove {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--clr-surface-btn-grey-fill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--color-fg);
}

body.ui-v2 .rs-cart-price {
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

body.ui-v2 .rs-cart-price-current {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}

body.ui-v2 .rs-cart-price-old {
  font-size: 12px;
  color: var(--clr-text-inactive-on-btn);
  text-decoration: line-through;
  font-weight: 400;
}

body.ui-v2 .rs-cart-badge {
  font-size: var(--typ-label-discount-font-size);
  font-weight: var(--typ-label-discount-font-weight);
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--clr-surface-btn-light-fill);
  color: var(--color-fg);
}

body.ui-v2 .rs-cart-separator {
  height: 1px;
  width: 100%;
  background: var(--clr-surface-navbar-stroke);
}

body.ui-v2 .rs-qty {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100px;
  height: 32px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--clr-surface-base);
  box-sizing: border-box;
}

body.ui-v2 .rs-qty-btn {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-fg);
}

body.ui-v2 .rs-qty-input input.qty {
  width: 25px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 400;
  padding: 0;
  box-shadow: none;
}

/* 移除数字输入的小箭头 */
body.ui-v2 .rs-qty-input input.qty::-webkit-outer-spin-button,
body.ui-v2 .rs-qty-input input.qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
body.ui-v2 .rs-qty-input input.qty {
  appearance: textfield;
  -moz-appearance: textfield;
}

body.ui-v2 .rs-cart-actions-row {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

body.ui-v2 .rs-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--clr-surface-btn-grey-fill);
  color: var(--color-fg);
  text-decoration: none;
  font-weight: 600;
}

body.ui-v2 .rs-cart-add-more {
  align-self: center;
  width: 156px;
  height: 29px;
  padding: 9px 19px;
  font-size: var(--typ-btn-middle-font-size);
  font-weight: var(--typ-btn-middle-font-weight);
  background: var(--clr-surface-btn-grey-fill);
  color: var(--color-fg);
  box-sizing: border-box;
  margin-top: 6px;
}

body.ui-v2.woocommerce-cart .rs-cart-add-more {
  margin-top: var(--rs-cart-gap, 8px) !important;
  margin-bottom: var(--rs-cart-gap, 8px) !important;
}

/* Update cart 按钮保留但弱化（主要给无 JS 场景） */
body.ui-v2 .rs-update-cart {
  display: none;
}

body.ui-v2 .rs-cart-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--rs-bottom-nav-h, 86px) + var(--rs-safe-bottom, 0px));
  z-index: 50;
  background: var(--clr-surface-base);
  border-top: 1px solid var(--clr-surface-navbar-stroke);
  padding: 14px 20px;
  height: var(--rs-cart-bottom-bar-h, 100px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
}

body.ui-v2 .rs-cart-bottom-bar .rs-cart-total-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
}

body.ui-v2 .rs-cart-bottom-bar .rs-cart-total {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

body.ui-v2 .rs-cart-total-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

body.ui-v2 .rs-cart-total-current {
  font-size: var(--typ-price-now-lg-font-size);
  line-height: 1;
  font-weight: var(--typ-price-now-lg-font-weight);
  letter-spacing: -0.02em;
  color: var(--clr-text-primary);
  white-space: nowrap;
  flex: 0 0 auto;
}

body.ui-v2 .rs-cart-total-old {
  font-size: var(--typ-nav-bar-title-font-size);
  line-height: 1;
  font-weight: var(--typ-nav-bar-title-font-weight);
  color: var(--clr-text-inactive-on-btn);
  text-decoration: line-through;
  flex: 0 0 auto;
  white-space: nowrap;
}

body.ui-v2 .rs-cart-total-saving {
  font-size: var(--typ-time-font-size);
  line-height: 1;
  color: var(--clr-text-discount);
  font-weight: var(--typ-time-font-weight);
  flex: 0 0 auto;
  white-space: nowrap;
}

body.ui-v2 .rs-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 187px;
  height: 42px;
  padding: 9px 19px;
  border-radius: var(--ctl-btn-radius);
  background: var(--clr-brand-primary);
  color: var(--clr-text-light-on-color);
  text-decoration: none;
  font-weight: var(--typ-btn-large-font-weight);
  font-size: var(--typ-btn-large-font-size);
  min-width: auto;
  box-sizing: border-box;
}

/* ========== Home UI v2（移动端优先，按 Figma 逐步对齐）========== */

/* 首页交互参数（你要对齐 Figma/真实 App 时，优先改这里） */
:root {
  /* 顶部安全区（刘海屏）：JS 需要读到该值用于吸顶与滚动 offset 计算 */
  --rs-safe-top: env(safe-area-inset-top, 0px);
  /* 底部安全区（避免与底部导航重叠） */
  --rs-safe-bottom: env(safe-area-inset-bottom, 0px);
  /* 底部导航高度：用于控制内容区与 Nav 的间距 */
  --rs-bottom-nav-h: 64px;
  --rs-bottom-nav-pad-y: 4px;
  --rs-bottom-nav-item-h: 48px;
  --rs-bottom-nav-item-radius: 18px;
  /* Hero 初始高度（建议按 Figma 的 Layer-A-Hero 高度设置） */
  /* 说明：默认用“接近移动端屏幕比例”的高度；你可按 Figma 实测值再微调 */
  --rs-hero-h: clamp(320px, 46vh, 480px);
  /* 下拉最大拉伸量（像素）：拉到顶时 Hero 刚好“展示到原图”的关键参数之一 */
  --rs-hero-max-pull: 120px;
  /* 下拉最大放大倍数（图片 scale）：你选了 B，这个参数最关键 */
  --rs-hero-max-scale: 1.16;
  /* Tabs 吸顶距离：后续对齐你给的关键帧（0/8/16px） */
  --rs-sticky-top: 0px;
  /* Viewport 与 Hero 的重叠量（Figma 里两者会重叠，避免下拉穿帮） */
  /* 默认按波浪高度做重叠（全局默认值；Home 会用 Figma 实测值覆盖） */
  --rs-viewport-overlap: var(--rs-wave-h);
  /* 顶部波浪 clip 的高度（像素） */
  --rs-wave-h: 46px;
}

/* FIGMA_SYNC_HOME_START */
body.ui-v2 .rs-home-v2 {
  /* 自动同步：Figma(02 Screens / Home / Mobile)，clip id=80:157 */
  --rs-hero-h: 320px;
  --rs-viewport-overlap: 172px;
  --rs-wave-h: 46px;
  /* 底部导航高度：用于预留内容区域 */
  --rs-bottom-nav-h: 86px;
  /* 首页：不使用 safe-bottom，避免底部出现额外留白 */
  --rs-safe-bottom: 0px;
  /* Info-Header：Figma y(info) - y(clip) */
  --rs-layer-b-top: 51px;
  /* Promo-Banner：尺寸与内边距（从绝对坐标推导） */
  --rs-promo-mt: 6px;
  --rs-promo-h: 59px;
  --rs-promo-radius: 16px;
  --rs-promo-pad-t: 2px;
  --rs-promo-pad-r: 35px;
  --rs-promo-pad-b: 2px;
  --rs-promo-pad-l: 23px;
  --rs-promo-gap: 31px;
  --rs-promo-icon: 55px;
  --rs-promo-text-gap: 3px;
  --rs-promo-title-lh: 16.94px;
  --rs-promo-desc-lh: 14.52px;
}
/* FIGMA_SYNC_HOME_END */

/* 手动微调：用于不同设备/浏览器渲染差异的 1~2 次校准（不参与 Figma 自动同步） */
body.ui-v2 .rs-home-v2 {
  --rs-layer-b-nudge: 0px;
  /* Promo-Banner 手动微调：用于浏览器字体渲染/小数像素带来的 1~2px 校准（不参与 Figma 自动同步） */
  --rs-promo-nudge: 2px;
  /* Sticky-Tabs 手动微调：默认与 Promo 顶部间距保持一致，确保上下节奏统一 */
  --rs-tabs-mt: calc(var(--rs-promo-mt, 6px) + var(--rs-promo-nudge, 0px));
  /* 大 section 统一间距（Tabs→第一个区块、区块之间） */
  --rs-section-gap: 12px;
  /* Logo 轻微下移 */
  --rs-logo-nudge-y: 6px;
}

/* 隐私政策、数据删除说明：普通页面，留出阅读边距 */
body.ui-v2.page .site-main {
  padding: 32px 0 64px;
}
body.ui-v2.page .entry-content h2 {
  margin: 28px 0 8px;
  font-size: 18px;
}
body.ui-v2.page .entry-content p,
body.ui-v2.page .entry-content li {
  font-size: 16px;
  line-height: 1.5;
}

/* v2 首页尽量贴近“App 页面”：隐藏站点顶部导航（仅首页） */
body.ui-v2.home .site-header {
  display: none;
}

/* 首页主体：让页面从顶部开始渲染 */
body.ui-v2.home .site-main {
  padding: 0;
}

body.ui-v2 .rs-home-v2 {
  background: var(--color-bg);
  min-height: 100vh;
  /* 覆盖 main.css 的全局 section margin，避免首页顶部出现留白 */
  margin: 0;
  /* Hero 采用 fixed 底层后，需要给内容预留顶部空间 */
  padding-top: var(--rs-hero-h);
}

/* 二级页（Product List / Mobile）：打开时隐藏首页主层，保留底部导航 */
body.ui-v2 .rs-home-subpage {
  display: none;
}

body.ui-v2 .rs-home-v2.is-subpage-open {
  padding-top: 0;
  min-height: auto;
  background: var(--clr-surface-base);
}

body.ui-v2 .rs-home-v2.is-subpage-open .rs-layer-a-hero,
body.ui-v2 .rs-home-v2.is-subpage-open .rs-viewport {
  display: none;
}

body.ui-v2 .rs-home-v2.is-subpage-open .rs-sticky-tabs-wrap {
  display: none !important;
}

body.ui-v2.rs-subpage-open .rs-sticky-tabs-float {
  display: none !important;
  pointer-events: none !important;
}

body.ui-v2 .rs-home-v2.is-subpage-open .rs-home-subpage {
  display: block;
  min-height: calc(100vh - var(--rs-bottom-nav-h, 86px) - var(--rs-safe-bottom, 0px));
  background: var(--clr-surface-base);
  padding: 0 16px calc(var(--rs-bottom-nav-h, 86px) + var(--rs-safe-bottom, 0px));
  box-sizing: border-box;
}

body.ui-v2 .rs-subpage-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-surface-base);
}

body.ui-v2 .rs-subpage-title {
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  color: var(--clr-text-primary);
}

body.ui-v2 .rs-subpage-back {
  position: absolute;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 2px solid var(--clr-text-icon-default);
  background: transparent;
  color: var(--clr-text-icon-default);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

body.ui-v2 .rs-cart-v2 > .rs-subpage-topbar {
  margin: 0 16px;
}

body.ui-v2 .rs-subpage-content {
  margin-top: 10px;
}

/* 二级页做纯列表：隐藏列表标题区块（如 Rice Powls） */
body.ui-v2 .rs-home-v2.is-subpage-open .rs-subpage-content .rs-sec-catalog-hd {
  display: none;
}

/* Hero（封面图层）
 * 关键点：Hero 是底层背景图，不随 Viewport 移动；下拉时 Hero 会“向下扩展”填满露出的区域
 */
body.ui-v2 .rs-home-v2 .rs-layer-a-hero {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--rs-hero-h) + var(--rs-hero-reveal, 0px));
  z-index: 0;
}

body.ui-v2 .rs-home-v2 .rs-home-cover {
  position: relative;
  height: 100%;
  background: var(--color-bg-alt);
  overflow: hidden;
}

/* 头图轮播层：下拉时只放大这一层，按钮不受影响。食物放在画面上半部，所以对齐顶部 */
body.ui-v2 .rs-home-v2 .rs-hero-slides {
  position: absolute;
  inset: 0;
  transform-origin: center top;
  transform: scale(var(--rs-hero-scale, 1));
  will-change: transform;
}

body.ui-v2 .rs-home-v2 .rs-hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 700ms ease;
}

body.ui-v2 .rs-home-v2 .rs-hero-slide.is-on {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  body.ui-v2 .rs-home-v2 .rs-hero-slide {
    transition: none;
  }
}

/* Hero 渐变遮罩：优先使用 tokens 的渐变（若不存在则 fallback） */
body.ui-v2 .rs-home-v2 .rs-home-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grd-hero-wave);
  pointer-events: none;
}

body.ui-v2 .rs-home-v2 .rs-home-cover-actions {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* Hero 顶部“更多”按钮（Figma：Layer-A-Hero-Options 48x48 + shadow 0/4/16 @ 15%） */
body.ui-v2 .rs-hero-menu {
  position: absolute;
  top: calc(var(--rs-hero-opt-top, 22px) + env(safe-area-inset-top, 0px));
  right: var(--rs-hero-opt-right, 22px);
  z-index: 3;
  pointer-events: none;
}

body.ui-v2 .rs-hero-menu.is-open,
body.ui-v2 .rs-hero-menu .rs-hero-opt-btn,
body.ui-v2 .rs-hero-menu-panel {
  pointer-events: auto;
}

body.ui-v2 .rs-hero-menu-panel {
  position: absolute;
  top: 56px;
  right: 0;
  min-width: 168px;
  padding: 6px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(42, 38, 35, 0.16);
}

body.ui-v2 .rs-hero-menu-panel[hidden] {
  display: none;
}

body.ui-v2 .rs-hero-menu-item {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #2A2623;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

body.ui-v2 .rs-home-v2 .rs-hero-opt-btn {
  position: relative;
  width: var(--rs-hero-opt-size, 48px);
  height: var(--rs-hero-opt-size, 48px);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--clr-surface-btn-light-fill);
  color: var(--clr-text-icon-default);
  box-shadow: 0 4px 16px var(--clr-shadow-hero-opt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}

body.ui-v2 .rs-home-v2 .rs-hero-opt-btn:active {
  transform: translateY(1px);
}

body.ui-v2 .rs-home-v2 .rs-hero-opt-btn svg {
  width: 32px; /* Figma：图标实例 32x32，居中放在 48x48 圆内 */
  height: 32px;
  display: block;
}

body.ui-v2 .rs-home-v2 a.rs-hero-opt-btn {
  text-decoration: none;
  overflow: hidden;
  padding: 0;
}

body.ui-v2 .rs-hero-account {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  object-fit: cover;
  flex: 0 0 auto;
}

body.ui-v2 span.rs-hero-account {
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--clr-brand-primary) var(--ctl-brand-tint), var(--clr-surface-base));
  color: var(--clr-brand-primary);
  font-size: 16px;
  font-weight: 700;
}

body.ui-v2 .rs-home-cover-actions-right {
  display: inline-flex;
  gap: 10px;
}

/* Logo：Figma（80:195）64x64，圆角16，白底，shadow 0/4/4@25%，位置 x=14,y=122（相对内容区） */
body.ui-v2 .rs-home-v2 .rs-home-logo {
  position: absolute;
  /* 重要：与内容左侧节奏一致（避免向左溢出导致“贴边”观感） */
  left: calc(var(--rs-logo-left, 14px) + var(--rs-logo-nudge-x, 0px));
  /* Figma：logo y=122；Viewport 顶部 y=148（=320-172）；同时本容器有 padding-top=14
   * 122 - (148 + 14) = -40
   */
  top: calc(var(--rs-logo-top, -40px) + var(--rs-logo-nudge-y, 0px));
  z-index: 5;
  width: var(--rs-logo-box, 64px);
  height: var(--rs-logo-box, 64px);
  border-radius: var(--rs-logo-radius, 16px);
  background: var(--clr-surface-btn-light-fill);
  border: 0;
  box-shadow: 0 4px 4px var(--clr-shadow-logo);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

body.ui-v2 .rs-home-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Layer-B-Content 顶部节奏：按 Figma 坐标锁定 Info-Header 的纵向位置
 * Figma：clip 起点 y=148；Info-Header y=199 → 间距 51px
 * 我们的 Viewport 使用 padding-top，需在这里抵消，保证卡片最终位置不偏下/偏上
 */
body.ui-v2 .rs-home-v2 .rs-layer-b-content {
  position: relative;
  padding-top: calc(var(--rs-layer-b-top, 51px) + var(--rs-layer-b-nudge, 0px) - var(--rs-viewport-pad-top, 14px));
}

/* Viewport：内容层覆盖在 Hero 之上 */
body.ui-v2 .rs-home-v2 .rs-viewport {
  position: relative;
  z-index: 1;
  margin-top: calc(-1 * var(--rs-viewport-overlap, 28px));
  --rs-viewport-pad-top: 14px;
  --rs-viewport-pad-x: 16px;
  /* Figma：Viewport 本体无圆角；白色来自 clip 向量（fill=98:280，纯白） */
  background: transparent;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  padding: var(--rs-viewport-pad-top) var(--rs-viewport-pad-x) var(--rs-safe-bottom, 0px);
  box-shadow: none;
  transform: translate3d(0, var(--rs-viewport-ty, 0px), 0);
  will-change: transform;
}

/* 首页：内容允许贴近底部导航，避免底部缝隙 */
body.ui-v2.home .rs-home-v2 .rs-home-content {
  padding-bottom: calc(var(--rs-bottom-nav-h, 86px) + var(--rs-safe-bottom, 0px));
  margin-bottom: 0;
  background: var(--clr-surface-base);
}

body.ui-v2.home .rs-home-v2 .rs-home-content section.rs-home-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* 首页：最后一个区块不做额外负间距，避免被 Nav 遮挡 */
body.ui-v2.home .rs-home-v2 .rs-home-content section.rs-home-section:last-child .rs-catalog-list {
  margin-bottom: 0;
}

/* 顶部不规则 clip：只裁“背景白色层”，不要裁到压在上面的 logo/内容（与 Figma 一致） */
body.ui-v2 .rs-home-v2 .rs-viewport::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  /* 让最底层背景与 list content 同色，避免底部接缝“穿帮” */
  background: var(--clr-surface-base);
  /* 顶部不规则 clip：裁剪对象是背景白色层，Hero 会从背后露出 */
  -webkit-mask-image: url("../img/viewport-wave.svg"), linear-gradient(var(--clr-surface-base), var(--clr-surface-base));
  mask-image: url("../img/viewport-wave.svg"), linear-gradient(var(--clr-surface-base), var(--clr-surface-base));
  -webkit-mask-repeat: no-repeat, no-repeat;
  mask-repeat: no-repeat, no-repeat;
  -webkit-mask-position: top center, bottom center;
  mask-position: top center, bottom center;
  /* 第一层仅控制顶部波浪高度；第二层填满剩余区域，避免整体高度拉伸导致波浪变形 */
  -webkit-mask-size: 100% var(--rs-wave-h, 46px), 100% calc(100% - var(--rs-wave-h, 46px));
  mask-size: 100% var(--rs-wave-h, 46px), 100% calc(100% - var(--rs-wave-h, 46px));
  pointer-events: none;
}

/* 保证 Viewport 内容层在背景层之上
 * 注意：不要对所有子节点强制 position: relative，
 * 否则会覆盖 logo 的 position:absolute，导致 Info-Header 整块被“顶下去”。
 */
body.ui-v2 .rs-home-v2 .rs-layer-b-content,
body.ui-v2 .rs-home-v2 .rs-home-content {
  position: relative;
  z-index: 1;
}

/* 信息卡（Info-Header） */
body.ui-v2 .rs-home-card {
  background: var(--color-bg);
  border-radius: 22px;
  border: 1px solid var(--clr-surface-btn-grey-stroke);
  box-shadow: 0 10px 24px var(--clr-shadow-float);
  padding: 18px 18px 16px;
  margin-top: 4px;
}

/* Info-Header：按 Figma（80:181）对齐（卡片 343x169 / r=24 / stroke=clr-surface-infobar-stroke / shadow=clr-shadow-card） */
body.ui-v2 .rs-info-header.rs-home-card {
  /* 服务按钮底色：来自 tokens（tokens.css 自动生成），避免写死色值 */
  --rs-service-bg-google: var(--clr-brand-partner-googlemap);
  --rs-service-bg-save: var(--clr-brand-partner-saveme);
  background: var(--clr-surface-base);
  border-radius: 24px;
  border: 1px solid var(--clr-surface-infobar-stroke);
  box-shadow: 0 12px 32px var(--clr-shadow-card);
  padding: 10px 16px;
  margin-top: 0;
}

body.ui-v2 .rs-home-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.2px;
  font-weight: 700;
  color: var(--color-fg);
}

/* 店名用品牌绿 token，和白底 N 标同一套，不写死色值 */
body.ui-v2 .rs-info-header .rs-home-title {
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.2px;
  font-weight: 700;
  color: var(--clr-text-promotion-accent);
}

body.ui-v2 .rs-info-header .rs-home-slogan {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--clr-text-catalog);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ui-v2 .rs-hero-menu-item.is-on {
  color: var(--clr-text-promotion-accent);
}

body.ui-v2 .rs-home-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--clr-text-catalog);
}

body.ui-v2 .rs-home-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

/* 营业时间是次级信息，用 catalog 色，避免和店名抢 */
body.ui-v2 .rs-info-header .rs-home-meta {
  margin-top: 6px;
  color: var(--clr-text-catalog);
}

body.ui-v2 .rs-info-header .rs-home-meta-item {
  font-size: 12px;
  font-weight: 700;
}

body.ui-v2 .rs-meta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text-icon-default);
  flex: 0 0 auto;
}

body.ui-v2 .rs-meta-icon svg {
  display: block;
}

body.ui-v2 .rs-times {
  font-weight: 600;
}

body.ui-v2 .rs-shop-place {
  font-weight: 600;
}

body.ui-v2 .rs-shop-place::before {
  content: "·";
  margin-right: 6px;
}

body.ui-v2 .rs-home-services {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

/* 服务按钮：保留当前“图标 + 文字”布局，但采用 Figma 的底色（80:187/189/191/193） */
body.ui-v2 .rs-info-header .rs-home-services {
  margin-top: 12px; /* Figma 内部 itemSpacing=12 */
}

body.ui-v2 .rs-service-item {
  text-decoration: none;
  color: var(--color-fg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 16px;
  background: var(--color-bg-alt);
}

body.ui-v2 .rs-info-header .rs-service-item {
  color: var(--clr-text-light-on-color);
  background: var(--rs-service-bg, var(--color-bg-alt));
  /* 固定高度，避免 Chrome 把标签折行后把按钮拉高 */
  height: 70px;
  min-height: 70px;
  padding: 8px 4px;
  gap: 4px;
  overflow: hidden;
  box-sizing: border-box;
  container-type: inline-size;
}

body.ui-v2 .rs-info-header .rs-service-item[data-rs-service="uber"] { --rs-service-bg: var(--clr-brand-partner-ubereat); }
body.ui-v2 .rs-info-header .rs-service-item[data-rs-service="glovo"] { --rs-service-bg: var(--clr-brand-partner-glovo); }
body.ui-v2 .rs-info-header .rs-service-item[data-rs-service="google"] { --rs-service-bg: var(--rs-service-bg-google); }
body.ui-v2 .rs-info-header .rs-service-item[data-rs-service="save"] { --rs-service-bg: var(--rs-service-bg-save); }

body.ui-v2 .rs-save-hint {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--rs-bottom-nav-h, 86px) + 12px);
  z-index: 80;
  margin: 0 auto;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--clr-text-primary);
  color: var(--clr-text-light-on-color);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
}
body.ui-v2 .rs-save-hint.is-on {
  opacity: 1;
}

body.ui-v2 .rs-service-ico {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--clr-surface-btn-grey-fill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

body.ui-v2 .rs-info-header .rs-service-ico {
  background: var(--clr-surface-light-on-color-22);
  color: var(--clr-text-light-on-color);
  font-weight: 800;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
}

body.ui-v2 .rs-service-text {
  font-size: 12px;
  color: var(--clr-text-catalog);
}

body.ui-v2 .rs-info-header .rs-service-text {
  color: var(--clr-text-light-on-color-96);
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
  max-width: 100%;
  /* 窄按钮里「Uber Eats」保持一行，字号落在 10–12 的字阶里 */
  font-size: clamp(var(--typ-notify-num-font-size, 10px), 22cqw, var(--typ-list-item-detail-font-size, 12px));
}

/* 促销条（Promo-Banner） */
body.ui-v2 .rs-home-promo {
  margin-top: calc(var(--rs-promo-mt, 6px) + var(--rs-promo-nudge, 0px)); /* Figma 同步 + 手动微调 */
  width: 100%;
  height: var(--rs-promo-h, 59px); /* Figma 同步 */
  border-radius: var(--rs-promo-radius, 16px); /* Figma 同步 */
  padding: var(--rs-promo-pad-t, 2px) var(--rs-promo-pad-r, 35px) var(--rs-promo-pad-b, 2px) var(--rs-promo-pad-l, 23px); /* Figma 同步 */
  background: var(--clr-surface-promotion-fill);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--rs-promo-gap, 31px); /* Figma 同步 */
}

body.ui-v2 .rs-home-promo-icon {
  width: var(--rs-promo-icon, 55px);
  height: var(--rs-promo-icon, 55px);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.ui-v2 .rs-home-promo-icon-img {
  width: var(--rs-promo-icon, 55px);
  height: var(--rs-promo-icon, 55px);
  display: block;
}

body.ui-v2 .rs-home-promo-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--rs-promo-text-gap, 3px); /* Figma 同步 */
}

body.ui-v2 .rs-home-promo-title {
  font-family: var(--typ-promotion-title-font-family);
  font-weight: var(--typ-promotion-title-font-weight);
  font-size: var(--typ-promotion-title-font-size);
  line-height: var(--rs-promo-title-lh, 16.94px); /* Figma 同步 */
  color: var(--clr-text-promotion-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ui-v2 .rs-home-promo-desc {
  font-family: var(--typ-promotion-info-font-family);
  font-weight: var(--typ-promotion-info-font-weight);
  font-size: var(--typ-promotion-info-font-size);
  line-height: var(--rs-promo-desc-lh, 14.52px); /* Figma 同步 */
  color: var(--clr-text-promotion-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ui-v2 .rs-home-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 0 2px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

/* Tabs 外层间距：放在 wrap 上，避免吸顶前后（clone/fixed）margin 差异导致“跳一下” */
body.ui-v2 .rs-sticky-tabs-wrap {
  margin-top: var(--rs-tabs-mt, 14px);
}

body.ui-v2 .rs-home-tabs::-webkit-scrollbar {
  display: none;
}

body.ui-v2 .rs-tab {
  flex: 0 0 auto;
  scroll-snap-align: start;
  border: 0;
  background: var(--clr-surface-btn-grey-fill);
  color: var(--clr-text-catalog);
  border-radius: 999px;
  /* 胶囊更“像 label”：进一步降低高度感（更扁） */
  padding: 8px 14px;
  font-size: 13px;
  /* 未高亮时不加粗（避免吸顶态看起来“全都很重”） */
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

body.ui-v2 .rs-tab.is-active {
  background: var(--color-primary);
  color: var(--clr-text-light-on-color);
  /* 高亮：半加粗 */
  font-weight: 600;
}

/* 吸顶浮层：强制高亮样式与原位一致（避免 clone 状态下被其它规则覆盖） */
body.ui-v2 .rs-sticky-tabs-float .rs-tab.is-active {
  background: var(--color-primary);
  color: var(--clr-text-light-on-color);
  font-weight: 600;
}

/* Tabs 吸顶：用“占位 + fixed”实现，避免 transform/浏览器差异导致 sticky 失效 */
body.ui-v2 .rs-sticky-tabs-placeholder {
  height: 0;
}

body.ui-v2 .rs-sticky-tabs {
  position: relative;
  z-index: 30;
  background: transparent;
}

/* Tabs 条底色（吸顶前）：与吸顶浮层使用同一背景变量 */
body.ui-v2 .rs-sticky-tabs-wrap {
  background: var(--rs-tabs-bar-bg, var(--rs-viewport-bg, var(--clr-surface-base)));
}

/* 吸顶时：原位 Tabs 只做占位（不可见、不接收交互），避免文档流重排导致内容“跳没了” */
body.ui-v2 .rs-tabs-ghost {
  visibility: hidden;
  pointer-events: none;
}

/* 吸顶浮层：吸顶时 JS 会把 .rs-sticky-tabs 挪到 body 下，避免被 Viewport 的 mask/transform 裁剪 */
body.ui-v2 .rs-sticky-tabs-float {
  position: fixed;
  left: 0;
  right: 0;
  /* 吸顶后背景需要与吸顶前一致：覆盖到屏幕顶部，避免 safe-area 区域露出 Hero 背景 */
  top: 0;
  z-index: 999;
  /* 吸顶态轻微透明：能看到一点下方内容，但整体仍保持一致 */
  background: var(--rs-tabs-bar-bg-sticky, var(--rs-tabs-bar-bg, var(--clr-surface-base)));
  /* 吸顶前后保持一致：先不加阴影，避免产生“颜色变深”的错觉 */
  box-shadow: none;
  /* 与 Viewport 左右 padding 对齐 */
  padding: calc(var(--rs-sticky-top) + var(--rs-safe-top)) 16px 0;
  display: none;
}

body.ui-v2 .rs-sticky-tabs-float.is-visible {
  display: block;
}

/* 吸顶后不再需要单独处理 margin-top：间距已统一放到 wrap */

body.ui-v2 .rs-home-content {
  /* 大区块统一节奏：Tabs → 第一个区块标题、以及各区块之间使用同一间距 */
  margin-top: var(--rs-section-gap, 16px);
}

/* Home v2：避免 main.css 的全局 section margin 参与计算导致吸顶瞬间“跳一下” */
body.ui-v2 .rs-home-v2 .rs-home-content section.rs-home-section {
  margin: 0;
}

body.ui-v2 .rs-home-v2 .rs-home-content section.rs-home-section + section.rs-home-section {
  margin-top: var(--rs-section-gap, 16px);
}

body.ui-v2 .rs-home-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-fg);
  margin-bottom: 10px;
}

/* ========== Promotions Section（横向滚动列表 + AddQty）========== */
body.ui-v2 .rs-sec-promotions {
  width: 100%;
}

body.ui-v2 .rs-sec-promotions-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.ui-v2 .rs-sec-promotions-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.2px;
  color: var(--clr-text-primary);
}

body.ui-v2 .rs-sec-promotions-more {
  /* 与标题同一行视觉中心对齐 */
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--clr-surface-btn-light-stroke);
  background: var(--clr-surface-base);
  color: var(--clr-text-icon-default);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex: 0 0 auto;
}

/* ========== Packages Section（横向滚动列表，缩略图长方形）========== */
body.ui-v2 .rs-sec-packages {
  width: 100%;
}

body.ui-v2 .rs-sec-packages-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.ui-v2 .rs-sec-packages-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.2px;
  color: var(--clr-text-primary);
}

body.ui-v2 .rs-sec-packages-more {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--clr-surface-btn-light-stroke);
  background: var(--clr-surface-base);
  color: var(--clr-text-icon-default);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex: 0 0 auto;
}

/* ========== Catalog List Section（竖向列表）========== */
body.ui-v2 .rs-sec-catalog-list {
  width: 100%;
}

body.ui-v2 .rs-sec-catalog-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.ui-v2 .rs-sec-catalog-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.2px;
  color: var(--clr-text-primary);
}

body.ui-v2 .rs-catalog-list {
  /* 竖向列表：与 Section 统一节奏，只在内部控制分隔线 */
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
  --rs-catalog-thumb: clamp(72px, 20vw, 88px);
  --rs-catalog-gap: 12px;
  --rs-catalog-add-size: 32px;
  --rs-promo-addqty-add-size: var(--rs-catalog-add-size);
  --rs-promo-addqty-q-size: var(--rs-catalog-add-size);
  --rs-promo-addqty-pill-w: 96px;
}

body.ui-v2 .rs-catalog-item {
  padding: 0;
}

body.ui-v2 .rs-catalog-item + .rs-catalog-item {
  border-top: 1px solid var(--clr-surface-navbar-stroke);
}

body.ui-v2 .rs-catalog-card {
  position: relative;
  display: grid;
  grid-template-columns: var(--rs-catalog-thumb) 1fr;
  column-gap: var(--rs-catalog-gap);
  row-gap: 8px;
  align-items: start;
  min-height: 0;
  padding: 16px 16px 16px 0;
}

body.ui-v2 .rs-catalog-thumb {
  position: relative;
  grid-row: 1 / 3;
  width: var(--rs-catalog-thumb);
  height: var(--rs-catalog-thumb);
  border-radius: 18px;
  overflow: hidden;
  background: var(--clr-surface-inactive-fill);
  border: 1px solid var(--clr-surface-image-stroke);
}

body.ui-v2 .rs-catalog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body.ui-v2 .rs-catalog-info {
  min-width: 0;
  grid-column: 2;
  grid-row: 1 / 3;
  padding-right: 124px;
}

body.ui-v2 .rs-catalog-name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  color: color-mix(in srgb, var(--clr-text-primary) 80%, var(--clr-text-catalog));
}

body.ui-v2 .rs-catalog-prices {
  position: absolute;
  top: 16px;
  right: 0;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 10px;
  line-height: 1.1;
  white-space: nowrap;
}

body.ui-v2 .rs-catalog-desc {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--clr-text-catalog);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

body.ui-v2 .rs-catalog-note {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--clr-text-primary);
}

/* Catalog List：缩略图角标更紧凑（覆盖所有 Catalog List 区块） */
body.ui-v2 .rs-sec-catalog-list .rs-promo-badge {
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.2;
}

body.ui-v2 .rs-catalog-actions {
  display: flex;
  align-items: center;
  position: absolute;
  right: 0;
  bottom: 12px;
  min-width: var(--rs-promo-addqty-pill-w, 96px);
  justify-content: flex-end;
}

body.ui-v2 .rs-catalog-addqty {
  position: static;
  right: auto;
  bottom: auto;
  max-width: none;
}

/* Catalog List：覆盖通用 AddQty 的绝对定位，避免被挤出可视区 */
body.ui-v2 .rs-catalog-actions .rs-addqty {
  position: static;
  right: auto;
  bottom: auto;
  max-width: none;
}

/* 0 个：显示 Add；>0：显示 Quantity */
body.ui-v2 .rs-catalog-item[data-rs-qty="0"] .rs-addqty-ctrl { display: none; }
body.ui-v2 .rs-catalog-item:not([data-rs-qty="0"]) .rs-addqty-add { display: none; }

/* qty=1：Catalog List 左键显示 Trash；qty>1：显示 Minus（与 Promotions 规则一致） */
body.ui-v2 .rs-catalog-item[data-rs-qty="1"] .rs-addqty-ico-minus { display: none; }
body.ui-v2 .rs-catalog-item:not([data-rs-qty="1"]) .rs-addqty-ico-trash { display: none; }

body.ui-v2 .rs-packages-scroll {
  margin-top: 10px;
  display: flex;
  /* 与 Promotions 横滑列表保持一致（间距/左右边距/滚动对齐/卡片内边距节奏） */
  /* 重要：不要拉伸子项高度；Packages 的 More 是“仅缩略图块”，不能被拉成整卡高度 */
  align-items: flex-start;
  --rs-promos-gap: 12px;
  /* Packages 变体：卡片宽度/缩略图比例独立配置（仍复用同一套组件） */
  --rs-pkg-card-w: clamp(160px, calc((100% - 12px) / 2.2), 240px);
  /* Packages 也需要卡片高度推导：用于 More 的“缩略图 + meta 留白”统一尺寸 */
  --rs-promo-thumb-h: calc(var(--rs-pkg-card-w) / 2);
  --rs-promo-name-mt: 10px;
  --rs-promo-name-lh: 14px;
  --rs-promo-prices-mt: 8px;
  --rs-promo-prices-lh: 16px;
  --rs-promo-meta-h: calc(var(--rs-promo-name-mt) + var(--rs-promo-name-lh) + var(--rs-promo-prices-mt) + var(--rs-promo-prices-lh));
  --rs-promo-card-h: calc(var(--rs-promo-thumb-h) + var(--rs-promo-meta-h));
  --rs-promo-card-pad: 0px;
  --rs-promo-radius: 16px;
  gap: var(--rs-promos-gap);
  overflow-x: auto;
  /* 只保留顶部轻微 padding：底部空白由 section gap 统一控制 */
  padding: 4px 2px 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-padding-left: 2px;
  scroll-padding-right: 2px;
}

body.ui-v2 .rs-packages-scroll::-webkit-scrollbar {
  display: none;
}

/* Packages 卡片：比 Promotions 更“横向”，便于表达套餐/组合 */
body.ui-v2 .rs-pkg-card {
  width: var(--rs-pkg-card-w);
}

/* 长方形缩略图：宽度更“拉长” */
body.ui-v2 .rs-promo-thumb.rs-pkg-thumb {
  height: auto;
  aspect-ratio: 2 / 1;
}

/* Packages 的 More：尺寸与套餐缩略图一致 */
body.ui-v2 .rs-sec-packages .rs-promo-thumb.rs-promo-more-thumb {
  height: auto;
  aspect-ratio: 2 / 1;
}

/* Packages 的 More：已统一为 .rs-promo-card.rs-promo-more-card（缩略图 + meta 留白），不再单独控制按钮尺寸 */

body.ui-v2 .rs-promos-scroll {
  margin-top: 10px;
  display: flex;
  /* 重要：不要拉伸子项高度；More 需要严格等于缩略图块高度 */
  align-items: flex-start;
  /* 目标：密集横滑列表（先按 3.5 个可见来做） */
  --rs-promos-gap: 12px;
  /* 用容器宽度动态推导：避免不同屏宽/缩放下变成 4.5 个或更多 */
  --rs-promos-visible: 3.5;
  --rs-promo-card-w: clamp(86px, calc((100% - (var(--rs-promos-gap) * 3)) / var(--rs-promos-visible)), 140px);
  --rs-promo-card-pad: 0px;
  --rs-promo-thumb-h: var(--rs-promo-card-w);
  --rs-promo-radius: 16px;
  /* AddQty：Add 圆按钮与 Quantity 数量条分开尺寸，避免密集模式溢出 */
  --rs-promo-addqty-add-size: 28px;
  /* 需求：Quantity 的 +/- 按钮直径与 Add 圆按钮一致 */
  --rs-promo-addqty-q-size: var(--rs-promo-addqty-add-size);
  /* 密集模式下 pill 会变窄：左右按钮“高度”保持一致，但宽度可收敛，避免越界 */
  --rs-promo-addqty-btn-w: min(22px, calc(var(--rs-promo-addqty-q-size) - 6px));
  /* 数量条宽度要自适应：密集模式卡片更窄时，避免越界 */
  /* 稍微放宽：让胶囊在 Promotions 里更对称（仍会受 max-width 限制，不越界） */
  --rs-promo-addqty-pill-w: min(92px, calc(var(--rs-promo-thumb-h) - 6px));
  /* 统一卡片高度：用“缩略图 + 固定文字区”推导，避免 More 过长 */
  --rs-promo-name-mt: 10px;
  --rs-promo-name-lh: 14px;
  --rs-promo-prices-mt: 8px;
  --rs-promo-prices-lh: 16px;
  --rs-promo-meta-h: calc(var(--rs-promo-name-mt) + var(--rs-promo-name-lh) + var(--rs-promo-prices-mt) + var(--rs-promo-prices-lh));
  --rs-promo-card-h: calc(var(--rs-promo-thumb-h) + var(--rs-promo-meta-h));
  gap: var(--rs-promos-gap);
  overflow-x: auto;
  /* 只保留顶部轻微 padding：底部空白由 section gap 统一控制 */
  padding: 4px 2px 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-padding-left: 2px;
  scroll-padding-right: 2px;
}

body.ui-v2 .rs-promos-scroll::-webkit-scrollbar {
  display: none;
}

body.ui-v2 .rs-promo-card {
  flex: 0 0 auto;
  width: var(--rs-promo-card-w, 274px);
  background: var(--clr-surface-base);
  border-radius: var(--rs-promo-radius, 18px);
  padding: var(--rs-promo-card-pad, 14px);
  scroll-snap-align: start;
  height: var(--rs-promo-card-h);
}

/* 横滑末尾 More：作为“查看更多”的入口（不带 AddQty） */
body.ui-v2 .rs-promo-more-card {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border: 0;
  /* More 视觉上只显示缩略图块：卡片底色保持透明，避免出现大块白底 */
  background: transparent;
  padding: 0;
  text-align: left;
}

/* More 不再需要 meta spacer：视觉对齐图二（只显示缩略图块） */

/* More：Promotions 需要与“缩略图块”同高（蓝框=红框），Packages 继续走 2:1 变体 */
body.ui-v2 .rs-promos-scroll .rs-promo-more-card {
  width: var(--rs-promo-card-w, 274px);
  height: var(--rs-promo-thumb-h);
}

body.ui-v2 .rs-promos-scroll .rs-promo-more-card .rs-promo-thumb.rs-promo-more-thumb {
  /* Promotions 的 More 必须是正方形缩略图块：宽高严格一致（对齐左侧红色缩略图） */
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
}

/* More 缩略图：复用 .rs-promo-thumb 的形状/描边，背景换为浅品牌色 */
body.ui-v2 .rs-promo-thumb.rs-promo-more-thumb {
  background: var(--clr-surface-btn-grey-fill);
  /* 为白色文案提供足够对比度：tint 稍微加深，但仍保持柔和 */
  background: color-mix(in srgb, var(--clr-brand-primary) 18%, var(--clr-surface-base));
  display: flex;
  align-items: center;
  justify-content: center;
}

body.ui-v2 .rs-promo-more-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--clr-text-primary);
  white-space: nowrap;
}

body.ui-v2 .rs-promo-more-ico {
  /* 与商品卡右下角 “+” 按钮同尺寸 */
  width: var(--rs-promo-addqty-size, 28px);
  height: var(--rs-promo-addqty-size, 28px);
  border-radius: 999px;
  border: 1px solid var(--clr-surface-btn-light-stroke);
  background: var(--clr-surface-base);
  color: var(--clr-text-icon-default);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.ui-v2 .rs-promo-more-txt {
  font-size: 14px;
  font-weight: 800;
  /* 与 Sticky-Tabs 高亮态文字一致 */
  color: var(--clr-text-light-on-color);
}

body.ui-v2 .rs-promo-thumb {
  position: relative;
  width: 100%;
  height: var(--rs-promo-thumb-h, 190px);
  border-radius: var(--rs-promo-radius, 22px);
  overflow: hidden;
  background: var(--clr-surface-inactive-fill);
  border: 1px solid var(--clr-surface-image-stroke);
}

body.ui-v2 .rs-promo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body.ui-v2 .rs-promo-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  border-radius: 999px;
  background: var(--clr-surface-discount-fill);
  border: 1px solid var(--clr-surface-discount-stroke);
  color: var(--clr-text-primary);
  max-width: calc(100% - 16px);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

body.ui-v2 .rs-promo-card .rs-addqty {
  position: absolute;
  right: 6px;
  bottom: 6px;
  max-width: calc(100% - 12px);
}

/* Catalog/List（Home + Cart）统一右侧对齐基准：不使用绝对定位 */
body.ui-v2 .rs-catalog-actions .rs-addqty {
  position: static !important;
  right: auto !important;
  bottom: auto !important;
  max-width: none !important;
}

/* AddQty 组件：统一重置按钮基础样式（避免全局按钮污染） */
body.ui-v2 .rs-addqty button {
  margin: 0;
  font: inherit;
  line-height: 1;
  appearance: none;
}

/* Add 状态：圆形 +（32x32，白底 + 浅描边） */
body.ui-v2 .rs-addqty button.rs-addqty-add {
  width: var(--rs-promo-addqty-add-size, 28px) !important;
  height: var(--rs-promo-addqty-add-size, 28px) !important;
  min-width: var(--rs-promo-addqty-add-size, 28px) !important;
  min-height: var(--rs-promo-addqty-add-size, 28px) !important;
  box-sizing: border-box !important;
  flex: 0 0 auto !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid var(--clr-surface-btn-light-stroke) !important;
  background: var(--clr-surface-base) !important;
  box-shadow: none !important;
  color: var(--clr-text-icon-default) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

body.ui-v2 .rs-addqty-add svg {
  display: block;
}

/* Quantity 状态：100x32 pill */
body.ui-v2 .rs-addqty-ctrl {
  width: min(var(--rs-promo-addqty-pill-w, 92px), 100%);
  height: var(--rs-promo-addqty-q-size, 28px);
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid var(--clr-surface-btn-light-stroke);
  background: var(--clr-surface-base);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  box-sizing: border-box;
  overflow: visible;
  min-width: var(--rs-promo-addqty-pill-w, 92px);
}

/* 窄促销卡：选中数量后白底要盖住垃圾桶、数字和加号，不能被缩略图裁短 */
body.ui-v2 .rs-promos-scroll .rs-promo-card:not([data-rs-qty="0"]) .rs-addqty {
  left: 6px;
  right: 6px;
  width: auto;
  max-width: none;
}

body.ui-v2 .rs-promos-scroll .rs-promo-card .rs-addqty-ctrl {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0 6px;
  gap: 0;
  justify-content: space-between;
  overflow: hidden;
}

body.ui-v2 .rs-addqty button.rs-addqty-dec,
body.ui-v2 .rs-addqty button.rs-addqty-inc {
  width: var(--rs-promo-addqty-btn-w, 22px);
  height: var(--rs-promo-addqty-q-size, 28px);
  min-height: var(--rs-promo-addqty-q-size, 28px);
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--clr-text-icon-default) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-width: var(--rs-promo-addqty-btn-w, 22px);
  padding: 0 !important;
  flex: 0 0 auto !important;
}

body.ui-v2 .rs-addqty-num {
  min-width: 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--clr-text-primary);
}

body.ui-v2 .rs-addqty-add svg {
  width: 16px;
  height: 16px;
}

body.ui-v2 .rs-addqty-dec svg,
body.ui-v2 .rs-addqty-inc svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* 保持对称：+ / - 不做额外位移与加粗，避免视觉重心偏移 */

/* AddQty 组件统一状态规则：所有页面共享（避免分叉） */
body.ui-v2 [data-rs-qty="0"] .rs-addqty-ctrl { display: none !important; }
body.ui-v2 [data-rs-qty]:not([data-rs-qty="0"]) .rs-addqty-add { display: none !important; }
body.ui-v2 [data-rs-qty="1"] .rs-addqty-ico-minus { display: none !important; }
body.ui-v2 [data-rs-qty]:not([data-rs-qty="1"]) .rs-addqty-ico-trash { display: none !important; }

body.ui-v2 .rs-promo-name {
  margin-top: var(--rs-promo-name-mt, 12px);
  font-size: 12px;
  font-weight: 700;
  line-height: var(--rs-promo-name-lh, 14px);
  color: color-mix(in srgb, var(--clr-text-primary) 80%, var(--clr-text-catalog));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.ui-v2 .rs-promo-prices {
  margin-top: var(--rs-promo-prices-mt, 8px);
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: var(--rs-promo-prices-lh, 16px);
  white-space: nowrap;
}

body.ui-v2 .rs-promo-price {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--clr-text-primary);
  white-space: nowrap;
}

body.ui-v2 .rs-promo-price-old {
  font-size: 11px;
  font-weight: 700;
  color: var(--clr-text-inactive-on-btn);
  text-decoration: line-through;
  white-space: nowrap;
}

/* 调试/假数据：简单菜品列表（仅用于视觉与交互对齐，不走 WooCommerce） */
body.ui-v2.ui-mock .rs-mock-products {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.ui-v2.ui-mock .rs-mock-product {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: var(--clr-surface-inactive-fill);
}

body.ui-v2.ui-mock .rs-mock-thumb {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--clr-surface-inactive-stroke);
}

body.ui-v2.ui-mock .rs-mock-name {
  font-weight: 700;
  color: var(--color-fg);
}

body.ui-v2.ui-mock .rs-mock-price {
  margin-top: 2px;
  font-size: 13px;
  color: var(--clr-text-inactive-on-btn);
}

body.ui-v2.ui-mock .rs-mock-add {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--color-primary);
  color: var(--clr-text-light-on-color);
  font-weight: 800;
  cursor: pointer;
}

/* 底部导航尺寸跟首页同一套。首页把高度写在首页容器上，页脚里的导航吃不到。 */
body.ui-v2 {
  --rs-bottom-nav-h: 86px;
  --rs-safe-bottom: 0px;
}

/* ========== Bottom Nav UI v2（仅首页展示）========== */
body.ui-v2 .rs-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--clr-surface-base-96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--clr-surface-navbar-stroke);
  height: var(--rs-bottom-nav-h, 86px);
  padding: var(--rs-bottom-nav-pad-y, 10px) 12px calc(var(--rs-bottom-nav-pad-y, 10px) + var(--rs-safe-bottom, 0px));
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}


/* 兜底：确保 Layer-C-Nav 不被其它规则隐藏 */
body.ui-v2 .rs-bottom-nav {
  display: grid !important;
}

/* 首页：隐藏主题默认页脚，避免把 Nav 推出可视区 */
body.ui-v2.home .site-footer {
  display: none;
}

/* 各页底部导航与首页同一套：白底、无分割线 */
body.ui-v2 .rs-bottom-nav {
  background: var(--clr-surface-base);
  border-top: 0;
  backdrop-filter: none;
  box-shadow: none;
}

/* Nav 向上覆盖一小段，遮住可能出现的缝隙 */
body.ui-v2 .rs-bottom-nav::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 8px;
  background: var(--clr-surface-base);
}

/* 首页：统一底层背景色，避免接缝露出 */
body.ui-v2,
body.ui-v2.home,
body.ui-v2 .rs-home-v2 {
  background: var(--clr-surface-canvas, #F6F4F1);
}

body.ui-v2 .rs-bottom-nav-item {
  position: relative;
  text-decoration: none;
  color: var(--clr-text-inactive-on-btn);
  display: grid;
  place-items: center;
  gap: 6px;
  height: var(--rs-bottom-nav-item-h, 52px);
  padding: 6px 10px;
  border-radius: var(--rs-bottom-nav-item-radius, 18px);
  background: transparent;
}

body.ui-v2 .rs-bottom-nav-item.is-active,
body.ui-v2 .rs-bottom-nav-item[data-state="on"] {
  background: transparent;
  color: var(--color-fg);
}

body.ui-v2 .rs-bottom-nav-item[data-state="off"] {
  background: transparent;
  color: var(--clr-text-inactive-on-btn);
}

body.ui-v2 .rs-bottom-nav-item:focus-visible {
  outline: 2px solid var(--clr-surface-nav-btn-highlight);
  outline-offset: 2px;
}

body.ui-v2 .rs-bottom-nav-ico {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

body.ui-v2 .rs-bottom-nav-ico svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* 底部导航：仅图标下的“焦点小圆底” */
body.ui-v2 .rs-bottom-nav-item.is-active .rs-bottom-nav-ico::before,
body.ui-v2 .rs-bottom-nav-item[data-state="on"] .rs-bottom-nav-ico::before {
  content: "";
  position: absolute;
  inset: -18%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--clr-brand-primary) 8%, var(--clr-surface-base));
  z-index: -1;
}

body.ui-v2 .rs-notifier {
  position: absolute;
  top: 8px;
  right: 18px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--clr-accent-notifier-fill);
  color: var(--clr-text-light-on-color);
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 6px 14px var(--clr-shadow-notifier);
}

/* 底部导航：红点通知 */
body.ui-v2 .rs-notifier--dot {
  min-width: 8px;
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 999px;
  top: 10px;
  right: 20px;
  box-shadow: none;
}

/* 底部导航：省略号通知 */
body.ui-v2 .rs-notifier--ellipsis {
  min-width: 14px;
  height: 18px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

body.ui-v2 .rs-notifier--ellipsis .rs-ellipsis-dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  display: inline-block;
}

/* Orders / Checkout：和购物车同一套白底、顶栏、底栏。不出现结算条。 */
body.ui-v2.rs-orders-screen,
body.ui-v2.woocommerce-checkout {
  --rs-bottom-nav-h: 86px;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--clr-surface-base) !important;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.ui-v2.rs-orders-screen .site-header,
body.ui-v2.woocommerce-checkout .site-header,
body.ui-v2.rs-orders-screen .entry-title,
body.ui-v2.woocommerce-checkout .entry-header,
body.ui-v2.woocommerce-checkout .entry-title {
  display: none;
}

body.ui-v2.rs-orders-screen .site-main,
body.ui-v2.woocommerce-checkout .site-main,
body.ui-v2.rs-orders-screen .rs-cart-v2,
body.ui-v2.rs-orders-screen .rs-cart-view,
body.ui-v2.woocommerce-checkout .rs-checkout-v2 {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--clr-surface-base);
  box-sizing: border-box;
}

body.ui-v2.rs-orders-screen .container,
body.ui-v2.woocommerce-checkout .container,
body.ui-v2.woocommerce-checkout .woocommerce,
body.ui-v2.woocommerce-checkout form.checkout {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 0 calc(var(--rs-bottom-nav-h, 86px) + 24px) !important;
  box-sizing: border-box;
}

body.ui-v2.woocommerce-checkout .woocommerce-form-login-toggle,
body.ui-v2.woocommerce-checkout .woocommerce-form-login,
body.ui-v2.woocommerce-checkout .woocommerce-form-coupon-toggle,
body.ui-v2.woocommerce-checkout .woocommerce-additional-fields {
  display: none !important;
}

body.ui-v2.rs-orders-screen .rs-cart-list {
  padding-top: 0;
}

body.ui-v2.rs-orders-screen .rs-cart-list,
body.ui-v2.woocommerce-checkout .rs-checkout-note,
body.ui-v2.woocommerce-checkout #customer_details,
body.ui-v2.woocommerce-checkout #order_review_heading,
body.ui-v2.woocommerce-checkout #order_review {
  padding-left: 12px;
  padding-right: 12px;
  box-sizing: border-box;
}

body.ui-v2.rs-orders-screen .site-footer,
body.ui-v2.woocommerce-checkout .site-footer {
  display: block;
  margin-top: 0;
  background: var(--clr-surface-base);
  border-top: 0;
  padding: 8px 16px calc(var(--rs-bottom-nav-h, 86px) + 20px);
}

body.ui-v2 .rs-order-card {
  background: var(--clr-surface-base);
  border-bottom: 1px solid var(--clr-surface-navbar-stroke);
  padding: 12px 4px 8px;
}

body.ui-v2 .rs-order-fold > summary {
  display: block;
  list-style: none;
  cursor: pointer;
}

body.ui-v2 .rs-order-fold > summary::-webkit-details-marker,
body.ui-v2 .rs-order-fold > summary::marker {
  display: none;
  content: "";
}

body.ui-v2 .rs-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

body.ui-v2 .rs-order-summary-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}

body.ui-v2 .rs-order-summary-foot .rs-order-pickup {
  flex: 1 1 auto;
  margin: 6px 0 0;
}

body.ui-v2 .rs-order-sum {
  flex: 0 0 auto;
  margin-top: 6px;
  font-size: 16px;
  font-weight: 700;
}

body.ui-v2 .rs-order-chevron {
  width: 8px;
  height: 8px;
  margin-top: 8px;
  flex: 0 0 auto;
  border-right: 2px solid var(--clr-text-inactive-on-btn);
  border-bottom: 2px solid var(--clr-text-inactive-on-btn);
  transform: rotate(45deg);
}

body.ui-v2 .rs-order-fold[open] .rs-order-chevron {
  margin-top: 12px;
  transform: rotate(-135deg);
}

body.ui-v2 .rs-order-number {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

body.ui-v2 .rs-order-when,
body.ui-v2 .rs-order-pickup,
body.ui-v2 .rs-checkout-note {
  margin: 4px 0 0;
  color: var(--clr-text-inactive-on-btn);
  font-size: 13px;
  line-height: 1.4;
}

body.ui-v2 .rs-order-status {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--clr-brand-primary) 14%, var(--clr-surface-base));
  color: var(--clr-brand-primary);
  font-size: 13px;
  font-weight: 700;
}

body.ui-v2 .rs-order-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 4px 4px;
  font-size: 16px;
  font-weight: 700;
}

body.ui-v2.rs-orders-screen .rs-catalog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.ui-v2 .rs-checkout-hidden,
body.ui-v2.woocommerce-checkout .woocommerce-form-coupon-toggle,
body.ui-v2.woocommerce-checkout #order_review_heading {
  display: none !important;
}

body.ui-v2.woocommerce-checkout .rs-checkout-note {
  margin: 0;
  padding-top: 8px;
  padding-bottom: 8px;
}

body.ui-v2.woocommerce-checkout .rs-checkout-coupon {
  margin: 4px 12px 12px;
}

body.ui-v2.woocommerce-checkout .rs-checkout-coupon-label {
  margin: 0 0 8px;
  color: var(--clr-text-primary);
  font-family: var(--typ-promotion-title-font-family);
  font-size: var(--typ-promotion-title-font-size);
  font-weight: var(--typ-promotion-title-font-weight);
}

body.ui-v2.woocommerce-checkout .rs-coupon-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

body.ui-v2.woocommerce-checkout .rs-coupon-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--clr-surface-navbar-stroke);
  border-radius: var(--ctl-field-radius);
  background: var(--clr-surface-base);
  color: var(--clr-text-primary);
  text-align: left;
}

body.ui-v2.woocommerce-checkout .rs-coupon-pick-label {
  font-family: var(--typ-label-discount-font-family);
  font-size: var(--typ-label-discount-font-size);
  font-weight: var(--typ-label-discount-font-weight);
  color: var(--clr-brand-primary);
}

body.ui-v2.woocommerce-checkout .rs-coupon-pick-code {
  font-family: var(--typ-list-item-detail-font-family);
  font-size: var(--typ-list-item-detail-font-size);
  font-weight: var(--typ-list-item-detail-font-weight);
  color: var(--clr-text-inactive-on-btn);
  word-break: break-all;
}

body.ui-v2.woocommerce-checkout #rs-checkout-coupon {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
}

body.ui-v2.woocommerce-checkout #rs-checkout-coupon p {
  margin: 0;
}

body.ui-v2.woocommerce-checkout #rs-checkout-coupon .rs-coupon-field {
  flex: 1 1 auto;
  min-width: 0;
}

body.ui-v2.woocommerce-checkout #rs-checkout-coupon input.input-text {
  width: 100%;
  height: var(--ctl-field-height);
  padding: 0 12px;
  border: 1px solid var(--clr-surface-navbar-stroke);
  border-radius: var(--ctl-field-radius);
  background: var(--clr-surface-base);
  box-sizing: border-box;
  color: var(--clr-text-primary);
  font-size: var(--typ-cart-info-font-size);
}

body.ui-v2.woocommerce-checkout #rs-checkout-coupon .button {
  height: var(--ctl-btn-height);
  padding: 0 18px;
  border: 0;
  border-radius: var(--ctl-btn-radius);
  background: var(--clr-brand-primary);
  color: var(--clr-text-light-on-color);
  font-family: var(--typ-btn-middle-font-family);
  font-size: var(--typ-btn-middle-font-size);
  font-weight: var(--typ-btn-middle-font-weight);
  white-space: nowrap;
}

body.ui-v2.woocommerce-checkout .rs-coupon-notice {
  margin: 6px 0 0;
  color: var(--clr-accent-red);
  font-size: var(--typ-list-item-detail-font-size);
  line-height: 1.4;
}

body.ui-v2.woocommerce-checkout .woocommerce-message,
body.ui-v2.woocommerce-checkout .woocommerce-info,
body.ui-v2.woocommerce-checkout .woocommerce-error {
  margin: 8px 12px;
  padding: 10px 12px;
  list-style: none;
  border-radius: var(--ctl-field-radius);
  background: color-mix(in srgb, var(--clr-brand-primary) 12%, var(--clr-surface-base));
  color: var(--clr-text-primary);
  font-size: var(--typ-list-item-detail-font-size);
}

body.ui-v2.woocommerce-checkout .woocommerce-error {
  background: color-mix(in srgb, var(--clr-accent-red) 12%, var(--clr-surface-base));
}

body.ui-v2.woocommerce-checkout .cart-discount .woocommerce-remove-coupon {
  margin-left: 8px;
  color: var(--clr-text-discount);
  font-size: var(--typ-list-item-detail-font-size);
}

body.ui-v2.woocommerce-checkout .form-row {
  margin: 0 0 10px;
  padding: 0;
}

body.ui-v2.woocommerce-checkout .form-row label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
}

body.ui-v2.woocommerce-checkout .form-row input.input-text {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--clr-surface-navbar-stroke);
  border-radius: 12px;
  background: var(--clr-surface-base);
  box-sizing: border-box;
  font-size: 16px;
}

body.ui-v2.woocommerce-checkout .woocommerce-checkout-review-order-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

body.ui-v2.woocommerce-checkout .woocommerce-checkout-review-order-table th,
body.ui-v2.woocommerce-checkout .woocommerce-checkout-review-order-table td {
  padding: 8px 0;
  text-align: left;
  border-bottom: 1px solid var(--clr-surface-navbar-stroke);
}

body.ui-v2.woocommerce-checkout .woocommerce-checkout-review-order-table .product-total,
body.ui-v2.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot td {
  text-align: right;
}

body.ui-v2.woocommerce-checkout #payment {
  background: transparent;
  border-radius: 0;
}

body.ui-v2.woocommerce-checkout #payment div.payment_box {
  background: transparent;
  color: var(--clr-text-inactive-on-btn);
  padding: 0 0 12px;
  margin: 0;
  font-size: 14px;
}

body.ui-v2.woocommerce-checkout #payment div.payment_box::before {
  display: none;
}

body.ui-v2.woocommerce-checkout #payment ul.payment_methods {
  list-style: none;
  margin: 8px 0;
  padding: 0;
  border: 0;
}

body.ui-v2.woocommerce-checkout #place_order {
  width: 100%;
  height: 48px;
  margin: 8px 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--clr-brand-primary);
  color: var(--clr-text-light-on-color);
  font-size: 16px;
  font-weight: 700;
}

/* Profile：和 Orders 同一套白底顶栏，表单沿用结账输入框。 */
body.ui-v2.rs-profile-screen {
  --rs-bottom-nav-h: 86px;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--clr-surface-base) !important;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.ui-v2.rs-profile-screen .site-header,
body.ui-v2.home.rs-profile-screen .site-header {
  display: none;
}

body.ui-v2.rs-profile-screen .site-main,
body.ui-v2.rs-profile-screen .rs-profile-v2,
body.ui-v2.rs-profile-screen .rs-cart-view {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--clr-surface-base);
  box-sizing: border-box;
}

body.ui-v2.rs-profile-screen .site-footer,
body.ui-v2.home.rs-profile-screen .site-footer {
  display: block;
  margin-top: 0;
  background: var(--clr-surface-base);
  border-top: 0;
  padding: 8px 16px calc(var(--rs-bottom-nav-h, 86px) + 20px);
}

body.ui-v2 .rs-profile-body {
  padding: 12px 16px 8px;
}

body.ui-v2 .rs-profile-lead,
body.ui-v2 .rs-profile-line,
body.ui-v2 .rs-account-hint {
  margin: 0 0 12px;
  color: var(--clr-text-inactive-on-btn);
  font-size: var(--typ-list-item-detail-font-size);
  font-weight: var(--typ-list-item-detail-font-weight);
  line-height: 1.4;
}

body.ui-v2 .rs-profile-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border-radius: var(--ctl-btn-radius);
  background: color-mix(in srgb, var(--clr-text-inactive-on-btn) var(--ctl-brand-tint), var(--clr-surface-base));
}

body.ui-v2 .rs-profile-switch button {
  height: 36px;
  border: 0;
  border-radius: var(--ctl-btn-radius);
  background: transparent;
  color: var(--clr-text-inactive-on-btn);
  font-size: var(--typ-btn-middle-font-size);
  font-weight: var(--typ-btn-middle-font-weight);
}

body.ui-v2 .rs-profile-auth[data-panel="login"] .rs-profile-switch [data-rs-auth="login"],
body.ui-v2 .rs-profile-auth[data-panel="register"] .rs-profile-switch [data-rs-auth="register"] {
  background: var(--clr-surface-base);
  color: var(--clr-brand-primary);
}

body.ui-v2 .rs-profile-auth .rs-profile-panel {
  display: none;
}

body.ui-v2 .rs-profile-auth[data-panel="login"] .rs-profile-panel--login,
body.ui-v2 .rs-profile-auth[data-panel="register"] .rs-profile-panel--register,
body.ui-v2 .rs-profile-auth[data-panel="forgot"] .rs-profile-panel--forgot,
body.ui-v2 .rs-profile-auth[data-panel="reset"] .rs-profile-panel--reset {
  display: block;
}

body.ui-v2 .rs-profile-auth[data-panel="forgot"] .rs-profile-switch,
body.ui-v2 .rs-profile-auth[data-panel="reset"] .rs-profile-switch {
  display: none;
}

body.ui-v2 .rs-profile-forgot {
  display: inline-block;
  margin: 0 0 12px;
  color: var(--clr-text-inactive-on-btn);
  font-size: var(--typ-list-item-detail-font-size);
  font-weight: var(--typ-list-item-detail-font-weight);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

body.ui-v2 .rs-profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0 8px;
}

body.ui-v2 .rs-profile-stat {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 92px;
  margin: 0;
  padding: 16px 14px 14px;
  border-radius: var(--ctl-field-radius);
  background: color-mix(in srgb, var(--clr-brand-primary) var(--ctl-brand-tint), var(--clr-surface-base));
}

body.ui-v2 .rs-profile-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  white-space: nowrap;
}

body.ui-v2 .rs-profile-figure {
  color: var(--clr-text-primary);
  font-family: var(--typ-price-now-lg-font-family);
  font-size: var(--typ-price-now-lg-font-size);
  font-weight: var(--typ-price-now-lg-font-weight);
  line-height: 1;
  letter-spacing: -0.03em;
}

body.ui-v2 .rs-profile-unit {
  color: var(--clr-text-primary);
  font-family: var(--typ-btn-middle-font-family);
  font-size: var(--typ-btn-middle-font-size);
  font-weight: var(--typ-btn-middle-font-weight);
  line-height: 1;
}

body.ui-v2 .rs-profile-label {
  color: var(--clr-text-inactive-on-btn);
  font-family: var(--typ-list-item-detail-font-family);
  font-size: var(--typ-list-item-detail-font-size);
  font-weight: var(--typ-list-item-detail-font-weight);
  line-height: 1.2;
}

body.ui-v2 .rs-profile-kicker {
  margin: 22px 0 10px;
  color: var(--clr-text-primary);
  font-family: var(--typ-promotion-title-font-family);
  font-size: var(--typ-promotion-title-font-size);
  font-weight: var(--typ-promotion-title-font-weight);
  line-height: 1.2;
}

body.ui-v2 .rs-profile-id {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0 4px;
}

body.ui-v2 .rs-profile-avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
}

body.ui-v2 .rs-profile-avatar--letter {
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--clr-brand-primary) var(--ctl-brand-tint), var(--clr-surface-base));
  color: var(--clr-brand-primary);
  font-weight: 700;
  font-size: 18px;
}

body.ui-v2 .rs-profile-id .rs-profile-name {
  margin: 0 0 4px;
  font-family: var(--typ-title-font-family);
  font-size: var(--typ-title-font-size);
  font-weight: var(--typ-title-font-weight);
  line-height: 1.15;
}

body.ui-v2 .rs-profile-id .rs-profile-line {
  margin: 0;
  color: var(--clr-text-inactive-on-btn);
  font-family: var(--typ-list-item-detail-font-family);
  font-size: var(--typ-list-item-detail-font-size);
  font-weight: var(--typ-list-item-detail-font-weight);
  line-height: 1.4;
}

body.ui-v2 .rs-profile-ticket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  padding: 16px;
  border: 1px solid var(--clr-surface-navbar-stroke);
  border-radius: var(--ctl-field-radius);
  background: var(--clr-surface-base);
}

body.ui-v2 .rs-profile-ticket-off {
  color: var(--clr-brand-primary);
  font-size: var(--typ-title-font-size);
  font-weight: var(--typ-title-font-weight);
  line-height: 1.1;
}

body.ui-v2 .rs-profile-ticket-note {
  margin-top: 4px;
  color: var(--clr-text-inactive-on-btn);
  font-family: var(--typ-list-item-detail-font-family);
  font-size: var(--typ-list-item-detail-font-size);
  font-weight: var(--typ-list-item-detail-font-weight);
}

body.ui-v2 .rs-profile-ticket-code {
  flex: 0 0 auto;
  color: var(--clr-text-primary);
  font-family: var(--typ-btn-middle-font-family);
  font-size: var(--typ-btn-middle-font-size);
  font-weight: var(--typ-btn-middle-font-weight);
}

body.ui-v2 .rs-profile-pass,
body.ui-v2 .rs-order-pass {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 0 0 12px;
  padding: 12px;
  border-radius: var(--ctl-field-radius);
  background: var(--clr-surface-base);
}

body.ui-v2 .rs-profile-qr,
body.ui-v2 .rs-order-qr {
  width: 180px;
  height: 180px;
}

body.ui-v2 .rs-profile-pass-code,
body.ui-v2 .rs-order-pass-code {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

body.ui-v2 .rs-order-pass-label,
body.ui-v2 .rs-order-pass-done,
body.ui-v2 .rs-profile-pass-code + p {
  margin: 0;
}

body.ui-v2 .rs-profile-pass-btn {
  border: 0;
  background: transparent;
  color: var(--clr-brand-primary);
  font: inherit;
  font-weight: 700;
}
  letter-spacing: 0.02em;
}

body.ui-v2 .rs-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  margin-top: 18px;
  border-top: 1px solid var(--clr-surface-navbar-stroke);
  color: inherit;
  font-size: var(--typ-nav-bar-title-font-size);
  font-weight: var(--typ-nav-bar-title-font-weight);
  text-decoration: none;
}

body.ui-v2 .rs-profile-row small {
  display: block;
  margin-top: 2px;
  color: var(--clr-text-inactive-on-btn);
  font-size: var(--typ-promotion-info-font-size);
  font-weight: var(--typ-promotion-info-font-weight);
}

body.ui-v2 .rs-profile-chevron {
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--clr-text-inactive-on-btn);
  border-right: 2px solid var(--clr-text-inactive-on-btn);
  transform: rotate(45deg);
}

body.ui-v2.woocommerce-cart .rs-account-hint,
body.ui-v2.woocommerce-checkout .rs-account-hint {
  margin: 8px 12px;
}

body.ui-v2 .rs-account-hint a,
body.ui-v2 .rs-profile-link {
  color: var(--clr-brand-primary);
  font-weight: var(--typ-promotion-title-font-weight);
  text-decoration: none;
}

body.ui-v2 .rs-profile-heading,
body.ui-v2 .rs-profile-name {
  margin: 16px 0 8px;
  font-size: var(--typ-cart-num-font-size);
  font-weight: var(--typ-cart-num-font-weight);
}

body.ui-v2 .rs-phone-fields {
  display: flex;
  gap: 8px;
  align-items: center;
}

body.ui-v2 .rs-phone-code {
  flex: 0 0 auto;
  width: auto;
  max-width: 62%;
  height: var(--ctl-field-height);
  padding: 0 32px 0 12px;
  border: 1px solid var(--clr-surface-navbar-stroke);
  border-radius: var(--ctl-field-radius);
  background-color: var(--clr-surface-base);
  /* 系统箭头会画到圆角外面，改成框内自己的箭头 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%232A2623' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  box-sizing: border-box;
  color: #2A2623;
  font-size: 14px;
  line-height: var(--ctl-field-height);
  appearance: none;
  -webkit-appearance: none;
}

body.ui-v2 .rs-phone-number {
  flex: 1 1 auto;
  min-width: 0;
}

body.ui-v2 .rs-phone-hint {
  margin: 6px 0 0;
  color: var(--clr-text-catalog);
  font-size: 12px;
  line-height: 1.4;
}

body.ui-v2.woocommerce-checkout .rs-phone-code {
  height: 44px;
  border-radius: 12px;
}

body.ui-v2 .rs-profile-form .form-row {
  margin: 0 0 10px;
}

body.ui-v2 .rs-profile-form label {
  display: block;
  margin-bottom: 4px;
  font-size: var(--typ-btn-middle-font-size);
  font-weight: var(--typ-btn-middle-font-weight);
}

body.ui-v2 .rs-profile-form input.input-text {
  width: 100%;
  height: var(--ctl-field-height);
  padding: 0 12px;
  border: 1px solid var(--clr-surface-navbar-stroke);
  border-radius: var(--ctl-field-radius);
  background: var(--clr-surface-base);
  box-sizing: border-box;
  font-size: var(--typ-cart-info-font-size);
  font-weight: var(--typ-cart-info-font-weight);
}

body.ui-v2 .rs-wa-group {
  margin: 16px 0 8px;
  padding: 14px;
  border: 1px solid var(--clr-surface-navbar-stroke);
  border-radius: 16px;
  background: var(--clr-surface-base);
}

body.ui-v2 .rs-wa-group-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

body.ui-v2 .rs-wa-group-line {
  margin: 4px 0 12px;
  color: var(--clr-text-catalog);
  font-size: 13px;
  line-height: 1.4;
}

body.ui-v2 .rs-wa-group-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--ctl-btn-height);
  border: 1px solid #E6E1D8;
  border-radius: var(--ctl-btn-radius);
  background: #fff;
  color: #2A2623;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

body.ui-v2 .rs-wa-group-share {
  margin-top: 8px;
}

body.ui-v2 .rs-share {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(42, 38, 35, 0.4);
}

body.ui-v2 .rs-share[hidden] {
  display: none;
}

body.ui-v2 .rs-share-card {
  position: relative;
  width: min(100%, 360px);
  max-height: calc(100dvh - 32px);
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  overflow: auto;
}

body.ui-v2 .rs-share-photo {
  width: 100%;
  height: 128px;
  object-fit: cover;
  border-radius: 12px;
}

body.ui-v2 .rs-share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

body.ui-v2 .rs-share-copyblock {
  flex: 1;
  min-width: 0;
}

body.ui-v2 .rs-share-name,
body.ui-v2 .rs-share-slogan,
body.ui-v2 .rs-share-line {
  margin: 0;
}

body.ui-v2 .rs-share-slogan,
body.ui-v2 .rs-share-line {
  margin-top: 4px;
}

body.ui-v2 .rs-share-name {
  color: var(--clr-brand-primary);
  font-size: 16px;
  font-weight: 700;
}

body.ui-v2 .rs-share-slogan {
  font-size: 13px;
  font-weight: 700;
}

body.ui-v2 .rs-share-line {
  color: var(--clr-text-catalog);
  font-size: 13px;
}

body.ui-v2 .rs-share-copy {
  display: block;
  max-width: 100%;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6B6560;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: underline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

body.ui-v2 .rs-share-save,
body.ui-v2 .rs-share-send {
  width: 100%;
  min-height: var(--ctl-btn-height);
  margin-top: 12px;
  border-radius: var(--ctl-btn-radius);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

body.ui-v2 .rs-share-save {
  margin-top: 8px;
}

body.ui-v2 .rs-share-qr {
  display: block;
  width: 104px;
  height: 104px;
  margin: 0;
  flex: none;
}

body.ui-v2 .rs-share-qr[hidden],
body.ui-v2 .rs-share-line[hidden],
body.ui-v2 .rs-share-photo[hidden] {
  display: none;
}

body.ui-v2 .rs-share-send {
  border: 0;
  background: var(--clr-brand-primary);
  color: #fff;
}

body.ui-v2 .rs-share-save {
  border: 1px solid #E6E1D8;
  background: #fff;
  color: #2A2623;
}

body.ui-v2 .rs-share-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #2A2623;
  font-size: 22px;
  line-height: 32px;
  cursor: pointer;
}

body.ui-v2 .rs-wa-group-qr {
  display: none;
  width: 148px;
  height: 148px;
  margin: 12px auto 0;
}

@media (min-width: 768px) {
  body.ui-v2 .rs-wa-group-qr {
    display: block;
  }
}

body.ui-v2 .rs-profile-submit {
  width: 100%;
  height: var(--ctl-btn-height);
  margin: 4px 0 8px;
  border: 0;
  border-radius: var(--ctl-btn-radius);
  background: var(--clr-brand-primary);
  color: var(--clr-text-light-on-color);
  font-size: var(--typ-nav-bar-title-font-size);
  font-weight: var(--typ-nav-bar-title-font-weight);
}

body.ui-v2 .rs-profile-msg {
  margin: 0 0 12px;
  font-size: var(--typ-btn-middle-font-size);
  font-weight: var(--typ-btn-middle-font-weight);
}

body.ui-v2 .rs-profile-msg--error {
  color: var(--clr-accent-red);
}

body.ui-v2 .rs-profile-coupon {
  margin: 8px 0;
  font-size: var(--typ-promotion-title-font-size);
  font-weight: var(--typ-promotion-title-font-weight);
}

body.ui-v2 .rs-profile-link {
  display: inline-block;
  margin-right: 16px;
}

body.ui-v2 .rs-profile-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 16px;
  color: var(--clr-text-inactive-on-btn);
  font-size: var(--typ-label-discount-font-size);
  font-weight: var(--typ-label-discount-font-weight);
}

body.ui-v2 .rs-profile-or::before,
body.ui-v2 .rs-profile-or::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--clr-surface-navbar-stroke);
}

body.ui-v2 .rs-profile-social {
  margin: 0;
}

body.ui-v2 .rs-profile-social div.nsl-container,
body.ui-v2 .rs-profile-social div.nsl-container .nsl-container-buttons,
body.ui-v2 .rs-profile-social div.nsl-container .nsl-container-buttons a {
  width: 100%;
  max-width: none;
}

body.ui-v2 .rs-profile-social div.nsl-container.nsl-container-block .nsl-container-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  grid-template-columns: none;
}

body.ui-v2 .rs-profile-social div.nsl-container .nsl-button-google,
body.ui-v2 .rs-profile-social div.nsl-container .nsl-button-facebook {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: var(--ctl-btn-height);
  padding: 0 16px;
  box-sizing: border-box;
  border-radius: var(--ctl-btn-radius);
  box-shadow: none;
  border: 1px solid var(--clr-surface-navbar-stroke);
  background: var(--clr-surface-base);
  color: var(--clr-text-primary);
}

body.ui-v2 .rs-profile-social div.nsl-container .nsl-button-google .nsl-button-svg-container,
body.ui-v2 .rs-profile-social div.nsl-container .nsl-button-facebook .nsl-button-svg-container {
  padding: 0;
}

body.ui-v2 .rs-profile-social div.nsl-container .nsl-button-google .nsl-button-label-container,
body.ui-v2 .rs-profile-social div.nsl-container .nsl-button-facebook .nsl-button-label-container {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  font-size: var(--typ-nav-bar-title-font-size);
  font-weight: var(--typ-nav-bar-title-font-weight);
  letter-spacing: 0;
  text-align: left;
  color: var(--clr-text-primary);
}

body.ui-v2 .rs-profile-social div.nsl-container .nsl-button-google .nsl-button-label-container b,
body.ui-v2 .rs-profile-social div.nsl-container .nsl-button-facebook .nsl-button-label-container b {
  font-weight: inherit;
}

body.ui-v2 .rs-profile-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--ctl-btn-height);
  margin: 12px 0 4px;
  border: 1px solid #E6E1D8;
  border-radius: var(--ctl-btn-radius);
  background: #fff;
  color: #2A2623;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

/* 二级/三级页面统一使用红色 back 按键（Cart/列表/单品） */
body.ui-v2 .rs-topbar .rs-back-btn {
  background: var(--clr-accent-red);
  color: var(--clr-text-light-on-color);
}

/* 店员工作台：独立页面，不使用点餐底栏。模块导航留给以后的分析。 */
body.rs-sales-screen {
  margin: 0 !important;
  padding: 0 !important;
  background: var(--clr-surface-base) !important;
  color: var(--clr-text-primary);
  min-height: 100vh;
}

body.rs-sales-screen .site-header,
body.rs-sales-screen .site-footer,
body.rs-sales-screen .rs-bottom-nav,
body.rs-sales-screen .entry-title {
  display: none !important;
}

body.rs-sales-screen .rs-desk {
  min-height: 100vh;
  background: var(--clr-surface-base);
}

body.rs-sales-screen .rs-desk-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 12px 32px;
  border-bottom: 1px solid var(--clr-surface-navbar-stroke);
  background: var(--clr-surface-base);
  position: sticky;
  top: 0;
  z-index: 3;
}

body.rs-sales-screen .rs-desk-brand {
  font-family: var(--typ-title-font-family);
  font-size: var(--typ-title-font-size);
  font-weight: var(--typ-title-font-weight);
}

body.rs-sales-screen .rs-desk-user {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--clr-text-inactive-on-btn);
  font-family: var(--typ-btn-middle-font-family);
  font-size: var(--typ-btn-middle-font-size);
  font-weight: var(--typ-btn-middle-font-weight);
}

body.rs-sales-screen .rs-desk-user a,
body.rs-sales-screen .rs-desk-shop {
  color: var(--clr-brand-primary);
  font-weight: var(--typ-promotion-title-font-weight);
  text-decoration: none;
}

body.rs-sales-screen .rs-desk-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

body.rs-sales-screen .rs-desk-span {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

body.rs-sales-screen .rs-desk-span a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--ctl-btn-radius);
  color: var(--clr-text-inactive-on-btn);
  font-family: var(--typ-nav-bar-title-font-family);
  font-size: var(--typ-nav-bar-title-font-size);
  font-weight: var(--typ-nav-bar-title-font-weight);
  text-decoration: none;
}

body.rs-sales-screen .rs-desk-span a.is-current {
  background: color-mix(in srgb, var(--clr-brand-primary) var(--ctl-brand-tint), var(--clr-surface-base));
  color: var(--clr-brand-primary);
}

body.rs-sales-screen .rs-desk-main {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 8px 24px 48px;
  box-sizing: border-box;
}

body.rs-sales-screen .rs-desk-workspace {
  display: block;
  padding: 8px 20px 48px;
  box-sizing: border-box;
}

body.rs-sales-screen .rs-desk-board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

body.rs-sales-screen .rs-desk-board-head h1 {
  margin: 8px 0;
  font-family: var(--typ-title-font-family);
  font-size: var(--typ-title-font-size);
  font-weight: var(--typ-title-font-weight);
}

body.rs-sales-screen .rs-desk-board-head p,
body.rs-sales-screen .rs-desk-report-dates {
  margin: 0;
  color: var(--clr-text-inactive-on-btn);
  font-family: var(--typ-list-item-detail-font-family);
  font-size: var(--typ-list-item-detail-font-size);
}

body.rs-sales-screen .rs-desk-report {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--clr-surface-navbar-stroke);
  border-radius: var(--ctl-field-radius);
}

body.rs-sales-screen .rs-desk-report h2,
body.rs-sales-screen .rs-desk-report h3 {
  margin: 20px 0 8px;
  font-family: var(--typ-title-font-family);
  font-size: var(--typ-title-font-size);
  font-weight: var(--typ-title-font-weight);
}

body.rs-sales-screen .rs-desk-report h2 {
  margin-top: 0;
}

body.rs-sales-screen .rs-desk-report h3 {
  font-size: var(--typ-promotion-title-font-size);
}

body.rs-sales-screen .rs-desk-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin: 16px 0;
}

body.rs-sales-screen .rs-desk-stats dt {
  color: var(--clr-text-inactive-on-btn);
  font-family: var(--typ-list-item-detail-font-family);
  font-size: var(--typ-list-item-detail-font-size);
}

body.rs-sales-screen .rs-desk-stats dd {
  margin: 2px 0 0;
  color: var(--clr-text-primary);
  font-family: var(--typ-price-now-font-family);
  font-size: var(--typ-price-now-font-size);
  font-weight: var(--typ-price-now-font-weight);
}

body.rs-sales-screen .rs-desk-dishes {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--typ-btn-middle-font-family);
  font-size: var(--typ-btn-middle-font-size);
}

body.rs-sales-screen .rs-desk-dishes th,
body.rs-sales-screen .rs-desk-dishes td {
  padding: 8px 0;
  border-bottom: 1px solid var(--clr-surface-navbar-stroke);
  text-align: left;
}

body.rs-sales-screen .rs-desk-dishes th:nth-child(n + 2),
body.rs-sales-screen .rs-desk-dishes td:nth-child(n + 2) {
  text-align: right;
}

@media (min-width: 1100px) {
  body.rs-sales-screen .rs-desk-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 32px;
    align-items: start;
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px 32px 64px;
  }

  body.rs-sales-screen .rs-desk-report {
    margin-top: 8px;
    position: sticky;
    top: 96px;
  }
}

@media (max-width: 800px) {
  body.rs-sales-screen .rs-desk-top {
    grid-template-columns: 1fr auto;
    height: auto;
  }

  body.rs-sales-screen .rs-desk-nav {
    grid-column: 1 / -1;
    align-items: flex-start;
  }

  body.rs-sales-screen .rs-desk-span {
    justify-content: flex-start;
  }
}

body.rs-sales-screen .rs-desk-gate {
  padding-top: 48px;
}

body.rs-sales-screen .rs-desk-gate h1,
body.rs-sales-screen .rs-desk-kicker {
  margin: 28px 0 12px;
  color: var(--clr-text-primary);
  font-family: var(--typ-title-font-family);
  font-size: var(--typ-title-font-size);
  font-weight: var(--typ-title-font-weight);
  line-height: 1.2;
}

body.rs-sales-screen .rs-desk-gate h1 {
  margin-top: 0;
}

body.rs-sales-screen .rs-desk-error {
  margin: 0 0 12px;
  color: var(--clr-accent-red);
  font-family: var(--typ-btn-middle-font-family);
  font-size: var(--typ-btn-middle-font-size);
  font-weight: var(--typ-btn-middle-font-weight);
}

body.rs-sales-screen .rs-desk-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
}

body.rs-sales-screen .rs-desk-login label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--typ-btn-middle-font-family);
  font-size: var(--typ-btn-middle-font-size);
  font-weight: var(--typ-btn-middle-font-weight);
}

body.rs-sales-screen .rs-desk-login input {
  width: 100%;
  height: var(--ctl-field-height);
  padding: 0 12px;
  box-sizing: border-box;
  border: 1px solid var(--clr-surface-navbar-stroke);
  border-radius: var(--ctl-field-radius);
  background: var(--clr-surface-base);
  color: var(--clr-text-primary);
  font-family: var(--typ-cart-info-font-family);
  font-size: var(--typ-cart-info-font-size);
}

body.rs-sales-screen .rs-sales-card {
  margin: 0 0 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--clr-surface-navbar-stroke);
}

body.rs-sales-screen .rs-sales-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

body.rs-sales-screen .rs-sales-items {
  margin-top: 12px;
}

body.rs-sales-screen .rs-sales-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 10px;
}

body.rs-sales-screen .rs-sales-thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: var(--ctl-field-radius);
  background: color-mix(in srgb, var(--clr-brand-primary) var(--ctl-brand-tint), var(--clr-surface-base));
}

body.rs-sales-screen .rs-sales-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.rs-sales-screen .rs-sales-item-body {
  flex: 1 1 auto;
  min-width: 0;
}

body.rs-sales-screen .rs-sales-item-name {
  color: var(--clr-text-primary);
  font-family: var(--typ-promotion-title-font-family);
  font-size: var(--typ-promotion-title-font-size);
  font-weight: var(--typ-promotion-title-font-weight);
  line-height: 1.3;
}

body.rs-sales-screen .rs-sales-item-note,
body.rs-sales-screen .rs-sales-empty {
  margin: 2px 0 0;
  color: var(--clr-text-inactive-on-btn);
  font-family: var(--typ-list-item-detail-font-family);
  font-size: var(--typ-list-item-detail-font-size);
  font-weight: var(--typ-list-item-detail-font-weight);
  line-height: 1.4;
}

body.rs-sales-screen .rs-sales-item-qty {
  margin-top: 4px;
  color: var(--clr-text-primary);
  font-family: var(--typ-btn-middle-font-family);
  font-size: var(--typ-btn-middle-font-size);
  font-weight: var(--typ-btn-middle-font-weight);
}

body.rs-sales-screen .rs-sales-item-price {
  flex: 0 0 auto;
  color: var(--clr-text-primary);
  font-family: var(--typ-price-now-font-family);
  font-size: var(--typ-price-now-font-size);
  font-weight: var(--typ-price-now-font-weight);
  white-space: nowrap;
}

body.rs-sales-screen .rs-sales-totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  margin-top: 12px;
  color: var(--clr-text-primary);
  font-family: var(--typ-cart-info-font-family);
  font-size: var(--typ-cart-info-font-size);
  font-weight: var(--typ-cart-info-font-weight);
}

body.rs-sales-screen .rs-sales-totals b {
  font-family: var(--typ-cart-num-font-family);
  font-size: var(--typ-cart-num-font-size);
  font-weight: var(--typ-cart-num-font-weight);
}

body.rs-sales-screen .rs-sales-done {
  margin: 12px 0 0;
  color: var(--clr-brand-primary);
  font-family: var(--typ-btn-middle-font-family);
  font-size: var(--typ-btn-middle-font-size);
  font-weight: var(--typ-btn-middle-font-weight);
}

body.rs-sales-screen .rs-desk-login button,
body.rs-sales-screen .rs-sales-fulfill,
body.rs-sales-screen .rs-sales-export button,
body.rs-sales-screen .rs-redeem-go,
body.rs-sales-screen .rs-redeem-look,
body.rs-sales-screen .rs-redeem-commit {
  width: 100%;
  height: var(--ctl-btn-height);
  margin-top: 12px;
  border: 0;
  border-radius: var(--ctl-btn-radius);
  background: var(--clr-brand-primary);
  color: var(--clr-text-light-on-color);
  font-family: var(--typ-nav-bar-title-font-family);
  font-size: var(--typ-nav-bar-title-font-size);
  font-weight: var(--typ-nav-bar-title-font-weight);
}

body.rs-sales-screen .rs-sales-export button[value="show"],
body.rs-sales-screen .rs-sales-export button[value="export_items"],
body.rs-sales-screen .rs-redeem-look {
  background: var(--clr-surface-base);
  color: var(--clr-text-primary);
  border: 1px solid var(--clr-surface-navbar-stroke);
}

body.rs-sales-screen .rs-sales-export {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

body.rs-sales-screen .rs-sales-export label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--clr-text-primary);
  font-family: var(--typ-btn-middle-font-family);
  font-size: var(--typ-btn-middle-font-size);
  font-weight: var(--typ-btn-middle-font-weight);
}

/* 入口单独盖在缩略图上。图片留在文档流里，横滑卡的高度才不会塌掉。 */
body.ui-v2 a.rs-detail-hit {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
}

body.ui-v2 .rs-promo-badge {
  pointer-events: none;
}

body.ui-v2 .rs-promo-thumb .rs-addqty,
body.ui-v2 .rs-promo-badge,
body.ui-v2 .rs-catalog-thumb .rs-promo-badge {
  z-index: 1;
}

body.ui-v2 a.rs-promo-name,
body.ui-v2 a.rs-catalog-name {
  display: block;
  text-decoration: none;
}

body.ui-v2.single-product .site-header,
body.ui-v2.single-product .site-footer {
  display: none;
}

body.ui-v2.single-product .site-main {
  padding: 0;
  background: var(--clr-surface-base);
}

body.ui-v2 .rs-detail {
  box-sizing: border-box;
  min-height: 100vh;
  padding: 0 16px calc(var(--rs-bottom-nav-h, 86px) + 24px);
  background: var(--clr-surface-base);
}

body.ui-v2 .rs-detail > .rs-subpage-topbar {
  margin: 0 -16px;
  padding: 0 16px;
}

body.ui-v2 .rs-detail > .rs-subpage-topbar .rs-subpage-back {
  left: 16px;
}

body.ui-v2 .rs-detail > .rs-subpage-topbar .rs-subpage-title {
  max-width: calc(100% - 88px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

body.ui-v2 .rs-detail-photo {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #F6F4F1;
}

body.ui-v2 .rs-detail-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  background: #fff;
}

body.ui-v2 .rs-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

body.ui-v2 .rs-detail-name {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  color: var(--clr-text-primary);
}

body.ui-v2 .rs-detail-badge {
  position: static;
  flex: none;
}

body.ui-v2 .rs-detail-desc,
body.ui-v2 .rs-detail-note {
  margin: 8px 0 0;
  color: var(--clr-text-catalog);
  font-size: 14px;
  line-height: 1.4;
}

body.ui-v2 .rs-detail-buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

body.ui-v2 .rs-detail-actions {
  display: flex;
  align-items: center;
  flex: none;
}

body.ui-v2 .rs-detail-actions .rs-addqty {
  position: static;
}

body.ui-v2 .rs-detail-prices {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

body.ui-v2 .rs-detail-spec {
  margin: 20px 0 0;
}

body.ui-v2 .rs-detail-spec div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--clr-surface-navbar-stroke);
}

body.ui-v2 .rs-detail-spec dt {
  margin: 0;
  color: var(--clr-text-catalog);
  font-size: 13px;
  font-weight: 600;
}

body.ui-v2 .rs-detail-spec dd {
  margin: 0;
  color: var(--clr-text-primary);
  font-size: 14px;
  line-height: 1.4;
}

body.ui-v2 .rs-detail-spec a {
  color: inherit;
}

body.ui-v2 .rs-detail-related {
  margin-top: 24px;
}

body.ui-v2 .rs-detail-related h2 {
  margin: 0;
  font-size: 18px;
  color: var(--clr-text-primary);
}

body.rs-sales-screen .rs-sales-export input[type="date"] {
  width: 100%;
  height: var(--ctl-field-height);
  padding: 0 12px;
  box-sizing: border-box;
  border: 1px solid var(--clr-surface-navbar-stroke);
  border-radius: var(--ctl-field-radius);
  background: var(--clr-surface-base);
  color: var(--clr-text-primary);
  font-family: var(--typ-cart-info-font-family);
  font-size: var(--typ-cart-info-font-size);
}


/* 回顶：底栏正上方、横向居中。右侧是加购，不放那边。 */
body.ui-v2 .rs-to-top {
  position: fixed;
  left: 50%;
  bottom: calc(var(--rs-bottom-nav-h, 86px) + 10px);
  z-index: 55;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--clr-surface-navbar-stroke);
  border-radius: 999px;
  background: var(--clr-surface-base);
  color: var(--clr-text-primary);
  box-shadow: 0 6px 16px rgba(42, 38, 35, 0.12);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.ui-v2 .rs-to-top[hidden] {
  display: none !important;
}

/* 底部导航：由模板决定显示范围，不在 CSS 里强制隐藏 */
body.ui-v2:not(.home) .rs-bottom-nav {
  display: grid;
}
