/* ===== [1/7] frontend.css ===== */
/*
 * 前台定制样式（零侵入旁路：由 search-gateway 网关注入，不修改官方任何文件/镜像）。
 * 删除 nginx 里的 sub_filter 注入即完全恢复官方原样，官方升级不受影响。
 *
 * 作用：禁用前台深色/浅色（黑白）主题切换。
 *   - :has() 在现代浏览器首屏即隐藏切换按钮，避免闪现；
 *   - 不支持 :has() 的旧浏览器由 frontend.js 兜底隐藏。
 */

/* 1) 隐藏主题切换按钮（太阳 lucide-sun / 月亮 lucide-moon），无论它出现在顶部还是“更多”菜单里 */
button:has(svg.lucide-sun),
button:has(svg.lucide-moon),
[role="button"]:has(svg.lucide-sun),
[role="button"]:has(svg.lucide-moon) {
  display: none !important;
}

/* 1b) 隐藏简/繁/英语言切换按钮（地球 lucide-languages）；语言菜单由它触发，按钮隐藏后无法打开 */
button:has(svg.lucide-languages),
[role="button"]:has(svg.lucide-languages) {
  display: none !important;
}

/* 2) 锁定浅色：原生控件/滚动条按浅色呈现（页面配色由 frontend.js 在首绘前去 dark class 保证） */
html {
  color-scheme: light !important;
}

/* 2b) 防止弹层(Select / Popover 等)打开、组件库锁定 body 滚动时主内容区左右平移：
   静态 overflow / scrollbar-gutter 会与组件库(reka-ui)自带的 padding 补偿相互叠加或被其测量忽略，
   故改由 /__custom/scroll-guard.js 动态补偿右侧滚动条占位(自适应经典/overlay 滚动条)。
   此处不再写静态规则。零侵入、不影响升级。 */

/* 3) 禁用独立“商品中心”入口：隐藏所有指向商品中心列表页的链接
   （顶部导航“商品中心/商品”、移动端底部导航“商品”、页脚“商品中心”、Banner 中“查看全部商品”链接等）。
   仅精确匹配列表路径；商品详情 /products/<slug> 不是该值，不受影响。
   纯 CSS 按 href 命中，官方 Vue 重新渲染/路由切换后依然生效；网关 302 与 home.js 点击拦截再作兜底。 */
a[href="/products"],
a[href="/products/"],
a[href^="/products?"] {
  display: none !important;
}
/* 页脚“商品中心”通常包在 <li> 里：连空列表项一起隐藏，避免留空行 */
footer li:has(> a[href="/products"]),
footer li:has(> a[href="/products/"]) {
  display: none !important;
}

/* 4) 顶部导航容器与首页主内容(.hn-wrap, max-width:80rem)同宽；官方 px-4=1rem 与
   .hn-wrap 的 padding:0 1rem 一致，使左上角 logo 与下方分类栏严格左对齐。
   仅覆盖最大宽度，零侵入（删除本条即恢复官方 1536px 容器），不影响官方升级。
   限定 nav.fixed.top-0，避免误伤移动端底部导航(bottom-0)。 */
nav.fixed.top-0 > .container {
  max-width: 80rem;
}

/* 5) 全站内容容器与首页(.hn-wrap, 80rem)统一宽度：官方 .container 在宽屏(≥1536px，2xl)下
   为 1536px，比首页/导航的 1280px 宽，导致详情、购物车、个人中心等页面正文左右超出。
   这里在 ≥1536px 时把 .container 压到 80rem，全站左右边界一致；<1536px 时官方本就≤1280，无需处理。
   纯 CSS、零侵入，删除本条即恢复官方宽度，不影响升级。 */
@media (min-width: 1536px) {
  .container {
    max-width: 80rem;
  }
}

/* 6) 价格单位“元”：用系统中文字体、相对数字缩小、减轻字重，避免与数字同字体同字号显得笨重。
   em 相对各价格元素自身字号（卡片小字/详情大字都协调），颜色跟随价格。 */
.pux-unit {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 0.52em;
  font-weight: 500;
  color: inherit;
  margin-left: 0.28em;
  letter-spacing: 0;
  vertical-align: baseline;
}

/* ===== [2/7] vision-search.css ===== */
/*
 * 以图搜图前台注入（零侵入旁路：search-gateway 注入，不修改官方文件/镜像；删除注入即恢复）。
 * 所有类名以 vs- 前缀隔离，颜色复用官方 shadcn CSS 变量，浅色锁定下自动呈现白底风格。
 */

/* 搜索框旁的相机按钮：与搜索框(高约 36px)对齐 */
.vs-cam {
  flex: 0 0 auto;
  height: 36px;
  width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius, 0.5rem) - 2px);
  background: var(--background);
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.vs-cam:hover {
  background: var(--muted);
  color: var(--foreground);
  border-color: var(--ring);
}
.vs-cam.vs-drag {
  border-color: var(--ring);
  background: var(--muted);
}
.vs-cam svg {
  width: 18px;
  height: 18px;
}

/* 结果浮层 */
#vs-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px;
  overflow-y: auto;
}
#vs-overlay.vs-open {
  display: flex;
}
.vs-panel {
  width: 100%;
  max-width: 1000px;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius, 0.5rem) + 6px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.vs-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--background);
  z-index: 1;
}
.vs-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.vs-head .vs-sub {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 2px;
}
.vs-spacer {
  flex: 1;
}
.vs-query {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex: 0 0 auto;
  background: var(--muted);
}
.vs-again,
.vs-close {
  height: 32px;
  padding: 0 14px;
  border-radius: calc(var(--radius, 0.5rem) - 2px);
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
}
.vs-again:hover {
  background: var(--muted);
}
.vs-close {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}
.vs-body {
  padding: 16px;
}

/* 加载 / 空 / 错误 */
.vs-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 44px 16px;
  color: var(--muted-foreground);
  font-size: 14px;
  text-align: center;
}
.vs-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: vs-spin 0.8s linear infinite;
}
@keyframes vs-spin {
  to {
    transform: rotate(360deg);
  }
}

/* 结果网格 */
.vs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) {
  .vs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 900px) {
  .vs-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.vs-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius, 0.6rem);
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.1s;
}
.vs-card:hover {
  border-color: var(--ring);
}
.vs-thumb {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.vs-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vs-noimg {
  color: var(--muted-foreground);
  font-size: 12px;
}
.vs-info {
  padding: 8px 10px 10px;
}
.vs-title {
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.vs-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
}
.vs-price {
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}
.vs-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.vs-b-exact {
  background: #e6f6ec;
  color: #157f3b;
  border: 1px solid #b7e4c7;
}
.vs-b-hash {
  background: #e7f1fd;
  color: #1d5bb8;
  border: 1px solid #c2dcfb;
}
.vs-b-sem {
  background: #f1ecfd;
  color: #6d3fd0;
  border: 1px solid #ddcffb;
}
.vs-score {
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

/* ===== [3/7] home.css ===== */
/* ============================================================
   home.css —— 首页“niub 风”零侵入皮肤 v3（仅作用于前台首页 #hn-shop）
   高保真还原 niub 浅色版：官方圆角 Banner（不改，本就同款）+
   左侧分类卡（蓝色竖条 / 实心蓝激活 / 圆形箭头）+
   右侧搜索框 + 按分类分组的商品卡片流（商品坚持卡片式）。
   注：该皮肤不暴露 --primary 等 CSS 变量，颜色按 niub 浅色实测值硬编码。
   ============================================================ */

.hn-shop {
  --hn-primary: #0071e3;
  --hn-primary-fg: #ffffff;
  --hn-card: #ffffff;
  --hn-border: rgba(0, 0, 0, 0.12);
  --hn-fg: #1d1d1f;
  --hn-muted: #6e6e73;
  --hn-muted-bg: #efeff1;
  --hn-primary-10: rgba(0, 113, 227, 0.10);
  --hn-ring: rgba(0, 113, 227, 0.18);
  position: relative; z-index: 10; padding: 5.5rem 0 3rem;
  color: var(--hn-fg);
}
.hn-wrap { max-width: 80rem; margin: 0 auto; padding: 0 1rem; }
/* 栅格：左分类卡纵向跨行，右上 Banner，右下搜索+商品（分类卡到 Banner 左边） */
.hn-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  column-gap: 1.4rem; row-gap: 1.3rem;
  /* 第一行：分类卡 | Banner（等高）；第二行：商品区跨满整行（宽度=分类+Banner 总宽） */
  grid-template-areas: "side hero" "main main";
}
.hn-side { grid-area: side; width: 15rem; align-self: stretch; display: flex; position: relative; }
.hn-hero { grid-area: hero; min-width: 0; align-self: stretch; margin: 0; padding: 0 !important; border-bottom: 0 !important; display: flex; flex-direction: column; }
/* Banner 卡拉伸填满整格，与左侧分类卡严格等高；去掉官方 container 重复的左右内边距以与搜索框对齐 */
.hn-hero > .container { flex: 1 1 auto; min-height: 0; display: flex; padding-left: 0; padding-right: 0; }
.hn-hero > .container > .rounded-2xl { flex: 1 1 auto; min-height: 0; width: 100%; height: auto; overflow: hidden; }
/* 不改容器大小：Banner 图整张完整适配容器、不溢出（图与容器比例不一致时留白） */
.hn-hero .rounded-2xl img { object-fit: cover !important; }
/* 浅色图自带文字：隐藏官方黑色遮罩，让图保持明亮 */
.hn-hero [class*="bg-black/50"] { display: none !important; }
/* 隐藏官方默认文字层（visibility 保留占位，不影响容器高度与分类栏等高）*/
.hn-hero div[class*="min-h-[200px]"] { visibility: hidden; }
/* 第二套 hero 变体的默认文字层（badge/标题/副标题），图内已含文字，class 全前台唯一 */
div[class="space-y-3 sm:space-y-4"] { display: none !important; }
.hn-main { grid-area: main; grid-column: 1 / -1; min-width: 0; align-self: start; }

/* ---------- 左侧分类卡 ---------- */
.hn-sidecard {
  position: static;
  flex: 1 1 auto; min-height: 0; box-sizing: border-box; height: 100%;
  display: flex; flex-direction: column;
  background: var(--hn-card);
  border: 1px solid var(--hn-border);
  border-radius: 16px;
  padding: .65rem;
}
.hn-sidehead { display: flex; align-items: center; gap: .5rem; padding: .45rem .55rem .55rem; }
.hn-bar { width: 4px; height: 18px; border-radius: 999px; background: var(--hn-primary); flex: none; }
.hn-sidehead .hn-side-title { font-size: 16px; font-weight: 600; color: var(--hn-fg); margin: 0; }

.hn-cats { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; }
.hn-cats::-webkit-scrollbar { width: 6px; }
.hn-cats::-webkit-scrollbar-thumb { background: var(--hn-border); border-radius: 999px; }
.hn-cat {
  display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
  border: 0; background: transparent; cursor: pointer;
  padding: .5rem .7rem; border-radius: 12px; min-height: 41px;
  font-size: 14px; line-height: 1.2; color: var(--hn-fg);
  transition: background .15s ease, color .15s ease;
}
.hn-cat:hover { background: var(--hn-muted-bg); }
.hn-catname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hn-ico {
  flex: none; width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  background: var(--hn-primary-10); color: var(--hn-primary);
}
.hn-arrow {
  flex: none; width: 28px; height: 28px; border-radius: 999px;
  border: 1px solid var(--hn-border); display: inline-flex; align-items: center; justify-content: center;
  color: var(--hn-muted); background: transparent;
  transition: border-color .15s ease, color .15s ease;
}
.hn-arrow svg { width: 13px; height: 13px; }
.hn-cat:hover .hn-arrow { border-color: var(--hn-primary); color: var(--hn-primary); }

/* 激活态：实心主题蓝、白字（niub 侧栏特征） */
.hn-cat.active { background: var(--hn-primary); color: var(--hn-primary-fg); }
.hn-cat.active:hover { background: var(--hn-primary); }
.hn-cat.active .hn-ico { background: rgba(255, 255, 255, .2); color: #fff; }
.hn-cat.active .hn-arrow { border-color: rgba(255, 255, 255, .45); color: #fff; }

/* ---------- 悬停弹出的“下一级分类”面板（贴分类卡右缘、顶部对齐；按内容完整展开，仅当超出视口高度时才内部滚动） ---------- */
.hn-flyout {
  position: absolute; top: 0; left: calc(100% + 12px); z-index: 60;
  min-width: 224px; max-width: 268px; max-height: calc(100vh - 7rem); box-sizing: border-box;
  overflow-y: auto; padding: .5rem;
  background: var(--hn-card); border: 1px solid var(--hn-border); border-radius: 16px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .16);
  display: none;  /* 即时显隐，不依赖淡入过渡，避免动画被暂停时浮层永远不可见 */
}
.hn-flyout.open { display: block; }
.hn-flyout::-webkit-scrollbar { width: 6px; }
.hn-flyout::-webkit-scrollbar-thumb { background: var(--hn-border); border-radius: 999px; }
.hn-fly-title {
  display: flex; align-items: center; gap: .45rem;
  font-size: 13px; font-weight: 600; color: var(--hn-muted);
  padding: .35rem .55rem .45rem;
}
.hn-fly-title::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--hn-primary); }
.hn-fly-item {
  display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left;
  border: 0; background: transparent; cursor: pointer;
  font-size: 13.5px; color: var(--hn-fg); padding: .5rem .55rem; border-radius: 10px;
}
.hn-fly-item:hover { background: var(--hn-primary-10); color: var(--hn-primary); }
.hn-fly-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hn-fly-all {
  display: block; margin-top: .2rem; padding: .5rem .55rem;
  font-size: 12.5px; color: var(--hn-primary); border-radius: 10px; text-decoration: none;
}
.hn-fly-all:hover { background: var(--hn-primary-10); }
@media (max-width: 1023px) { .hn-flyout { display: none !important; } }
/* 这些元素由 <a> 改为 <button>：去除按钮 UA 默认边框/背景/字体，沿用原文字/胶囊样式 */
button.hn-groupmore,
button.hn-fly-all { border: 0; background: transparent; cursor: pointer; font: inherit; }
button.hn-groupmore { padding: 0; }
button.hn-fly-all { width: 100%; text-align: left; }
button.hn-more { font: inherit; cursor: pointer; }
button.hn-more:disabled { opacity: .6; cursor: default; }
/* Banner 中指向商品中心的按钮型 CTA（无 href、Vue 客户端跳转），由 home.js 识别后加此类隐藏 */
.hn-cta-off { display: none !important; }

/* ---------- 右侧主区 ---------- */
.hn-main { flex: 1 1 auto; min-width: 0; }

/* 搜索框 */
.hn-search { position: relative; margin-bottom: 1.3rem; }
.hn-searchicon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--hn-muted); display: inline-flex; pointer-events: none; }
.hn-searchicon svg { width: 18px; height: 18px; }
.hn-searchinput {
  width: 100%; height: 48px; border-radius: 12px;
  border: 1px solid var(--hn-border); background: var(--hn-card);
  padding: 0 1rem 0 2.6rem; font-size: 14px; color: var(--hn-fg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.hn-searchinput::placeholder { color: var(--hn-muted); }
.hn-searchinput:focus { outline: none; border-color: var(--hn-primary); box-shadow: 0 0 0 3px var(--hn-ring); }

/* 以图搜图相机按钮（vision-search.js 注入到 .hn-search 内）：固定在首页搜索框右侧，niub 配色 */
.hn-search .vs-cam {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--hn-border); border-radius: 10px;
  background: var(--hn-card); color: var(--hn-muted); cursor: pointer; padding: 0;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.hn-search .vs-cam:hover { background: var(--hn-muted-bg); color: var(--hn-primary); border-color: var(--hn-primary); }
.hn-search .vs-cam svg { width: 19px; height: 19px; }
.hn-search .vs-cam.vs-drag { border-color: var(--hn-primary); background: var(--hn-muted-bg); }
.hn-search:has(.vs-cam) .hn-searchinput { padding-right: 3.2rem; }

/* 分组标题 */
.hn-group { margin-bottom: 1.9rem; }
.hn-grouphead { display: flex; align-items: center; gap: .55rem; margin: 0 0 .85rem; }
.hn-grouphead .hn-gname { font-size: 16px; font-weight: 600; color: var(--hn-fg); }
.hn-grouphead .hn-gcount { font-size: 13px; color: var(--hn-muted); }
.hn-grouphead .hn-spacer { flex: 1 1 auto; }
.hn-groupmore { font-size: 13px; color: var(--hn-primary); text-decoration: none; white-space: nowrap; }
.hn-groupmore:hover { text-decoration: underline; }
.hn-ico-sm { width: 24px; height: 24px; border-radius: 7px; font-size: 11px; }

/* 分组内商品：每组 5 件，等分排满并随容器宽度自适应（宽屏一行 5 个，平板 3 个、手机 2 个自动折行） */
.hn-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .9rem; }
.hn-row a.hn-card { width: 100%; min-width: 0; }
@media (max-width: 1023px) { .hn-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; } }
@media (max-width: 560px) { .hn-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 网格视图（单分类 / 搜索结果） */
.hn-viewhead { display: flex; align-items: center; gap: .7rem; margin: .1rem 0 1rem; flex-wrap: wrap; }
.hn-viewhead .hn-vtitle { font-size: 17px; font-weight: 600; color: var(--hn-fg); }
.hn-viewhead .hn-vcount { font-size: 13px; color: var(--hn-muted); }
.hn-viewhead .hn-spacer { flex: 1 1 auto; }
.hn-vback {
  border: 1px solid var(--hn-border); background: var(--hn-card); color: var(--hn-fg);
  font-size: 13px; border-radius: 999px; padding: .4rem .9rem; cursor: pointer;
}
.hn-vback:hover { border-color: var(--hn-primary); color: var(--hn-primary); }
.hn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 768px) { .hn-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; } }
@media (min-width: 1024px) { .hn-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { .hn-grid { grid-template-columns: repeat(5, 1fr); } }

a.hn-card { text-decoration: none; color: inherit; display: flex; }
.hn-msg { grid-column: 1 / -1; text-align: center; color: var(--hn-muted); padding: 3rem 1rem; font-size: .9rem; }
.hn-morewrap { display: flex; justify-content: center; margin-top: 1.6rem; }
.hn-more {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--hn-border); background: var(--hn-card); color: var(--hn-fg);
  padding: .6rem 1.5rem; border-radius: 999px; font-size: .875rem; cursor: pointer;
  text-decoration: none; transition: border-color .15s ease, color .15s ease;
}
.hn-more:hover { border-color: var(--hn-primary); color: var(--hn-primary); }

/* ---------- 移动端：单列，Banner 最上、分类条其次、搜索商品在下 ---------- */
@media (max-width: 1023px) {
  .hn-layout { grid-template-columns: minmax(0, 1fr); column-gap: 0; row-gap: 1rem; grid-template-areas: "hero" "side" "main"; }
  .hn-side { width: auto; align-self: start; display: block; }
  .hn-main { grid-column: 1 / -1; }
  .hn-shop { padding-top: 4.5rem; }
  .hn-sidecard { position: static; height: auto; flex: none; overflow: visible; padding: .45rem; }
  .hn-sidehead { display: none; }
  .hn-cats { flex-direction: row; overflow: visible; overflow-x: auto; padding-bottom: .2rem; -webkit-overflow-scrolling: touch; }
  .hn-cat { flex: 0 0 auto; width: auto; min-height: 36px; }
  .hn-cat .hn-arrow { display: none; }
}

/* ---------- 首屏加载骨架（数据返回前占位，避免官方区块闪现） ---------- */
@keyframes hnPulse { 0%, 100% { opacity: 1; } 50% { opacity: .38; } }
.hn-cats .hn-sk-chip {
  display: block; height: 41px; margin: 2px 0; border-radius: 12px;
  background: #ececf0; animation: hnPulse 1.25s ease-in-out infinite;
}
.hn-sk-group { margin-bottom: 1.9rem; }
.hn-sk-gtitle { height: 18px; width: 190px; border-radius: 6px; background: #ececf0; animation: hnPulse 1.25s ease-in-out infinite; margin: 0 0 .85rem; }
.hn-sk-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .9rem; }
.hn-sk-card { width: 100%; height: 252px; border-radius: 16px; background: #efeff2; animation: hnPulse 1.25s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .hn-sk-chip, .hn-sk-gtitle, .hn-sk-card { animation: none; }
}
@media (max-width: 1023px) {
  .hn-cats .hn-sk-chip { display: inline-block; width: 92px; height: 36px; margin: 0 .4rem 0 0; }
  .hn-sk-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
  .hn-sk-card { height: 212px; }
}
@media (max-width: 560px) {
  .hn-sk-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 排序条（综合/销量/最新/价格） ---------- */
.hn-sortbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.hn-sort {
  font-size: 12px; line-height: 1; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--hn-border); background: var(--hn-card); color: var(--hn-muted);
  cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.hn-sort:hover { color: var(--hn-primary); border-color: var(--hn-primary); }
.hn-sort.active { background: var(--hn-primary); border-color: var(--hn-primary); color: var(--hn-primary-fg); }
@media (max-width: 560px) {
  .hn-sortbar { gap: 5px; }
  .hn-sort { font-size: 11px; padding: 5px 10px; }
}

/* ===== [4/7] orders-enhance.css ===== */
/* 标准商品区块（订单列表大卡片，append 到卡片末尾） */
.oe-goods {
  margin-top: 10px;
  border-top: 1px dashed var(--border, #e5e7eb);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.oe-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.oe-img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
}
.oe-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.oe-img-empty { font-size: 12px; color: #9ca3af; }
.oe-info { min-width: 0; flex: 1; }
.oe-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground, #111827);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.oe-name-link {
  color: var(--primary, #2563eb);
  text-decoration: none;
  cursor: pointer;
}
.oe-name-link:hover {
  text-decoration: underline;
}
.oe-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}
.oe-spec, .oe-qty {
  font-size: 12px;
  color: var(--muted-foreground, #6b7280);
}
.oe-qty { font-variant-numeric: tabular-nums; }

/* 概览卡片：商品与金额同一行 */
.oe-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  min-width: 0;
}
.oe-goods--inline {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  gap: 7px;
}
.oe-goods--inline .oe-img {
  width: 40px;
  height: 40px;
  border-radius: 9px;
}
.oe-amount {
  flex: 0 0 auto;
  margin: 0 !important;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .oe-img { width: 40px; height: 40px; border-radius: 9px; }
  .oe-goods--inline .oe-img { width: 38px; height: 38px; }
  .oe-name { font-size: 13px; }
}

/* 隐藏订单详情里把交付 payload（取货码）原文直接显示的盒子：下载统一走“下载”
   按钮。靠 whitespace-pre-wrap 精准区分，不影响 space-y-1 的多行正常交付内容，
   也不影响带 max-h/max-h-* 的 truncated 盒子。 */
.mt-3.whitespace-pre-wrap.break-all.overflow-hidden,
.mt-4.whitespace-pre-wrap.break-all.overflow-hidden {
  display: none !important;
}

/* ===== [5/7] product-ux.css ===== */
/*
 * 商品详情 · 单 SKU 体验优化样式（零侵入旁路，配合 product-ux.js；删除即恢复官方）。
 * 前台锁定浅色，颜色直接用浅色值，不依赖暗色变量。
 */

/* 被判定为冗余的区块：单 SKU 规格区、数量区、价格“价格”标签、面包屑中间项 */
.pux-hide {
  display: none !important;
}

/* 购买区信任提示 */
.pux-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 13px;
  line-height: 1.45;
  color: #2f6fcc;
  background: rgba(0, 113, 227, 0.07);
  border: 1px solid rgba(0, 113, 227, 0.16);
  border-radius: 12px;
  padding: 0.6rem 0.85rem;
  text-align: center;
}

/* 详情页主图外层容器：收缩包裹图片、居中，不再固定占满整列宽度 */
.bg-secondary .group.relative {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* 主图：解除固定 4:3 比例，按原图比例自适应；限高 70vh、限宽 100%，整张居中完整显示。
   限定在画廊容器 .bg-secondary 内、且主图同时含 aspect-[4/3] 与 shadow-lg，
   不影响相关商品缩略图、底部小缩略图。 */
.bg-secondary img[class*="aspect-[4/3]"][class*="shadow-lg"] {
  aspect-ratio: auto !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 70vh !important;
  object-fit: contain !important;
  background-color: #ffffff;
  padding: 14px;
  margin: 0 auto;
  display: block;
}

/* ===== [6/7] wallet-channel.css ===== */
/* wallet-channel.css — 钱包充值固定微信：隐藏整个“支付渠道”选择列并重排表单。
 * 标记 class wc-hide-channel 由 wallet-channel.js 加到充值 form。 */

/* 渠道列是充值 form 的第 2 个直接子 div（金额1 / 渠道2 / 备注3 / 按钮4） */
form.wc-hide-channel > div:nth-child(2) {
  display: none !important;
}

/* 桌面端：官方为 4 列 [1fr 1fr 2fr auto]，隐藏渠道后重排为 3 列（金额/备注/按钮） */
@media (min-width: 768px) {
  form.wc-hide-channel {
    grid-template-columns: 1fr 2fr auto !important;
  }
}
/* 移动端官方为单列堆叠，渠道列隐藏后其余项正常堆叠，无需额外处理。 */

/* ===== [7/7] pay-icons.css ===== */
.pay-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  flex: 0 0 auto;
}
.pay-ico svg { width: 20px; height: 20px; display: block; }
[data-pay-icon-btn] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
