/* ============================================================
   发卡网前台样式 · v4
   架构来源：bzck.cc/products 的 DOM 骨架（居中标题 + 左侧分类栏
            + 4 列网格 + 移动端底部 Tab 导航）
   视觉来源：emshop v1.3.15 default 模板（#4e6ef2 蓝紫 + #fa5252 价格）
   ============================================================ */

* { box-sizing: border-box; }

:root {
  /* —— 主色 —— */
  --primary:        #4e6ef2;
  --primary-hover:  #3d5bd9;
  --primary-light:  #f0f3ff;
  --primary-soft:   rgba(78, 110, 242, .1);

  --price:          #f5365c;
  --price-deep:     #c9264b;
  --orange:         #f0842e;
  --green:          #0e9f6e;
  --purple:         #7c3aed;

  /* —— 文字：整体加深提高对比 —— */
  --ink:            #1a1a25;   /* 标题/正文主色，比原 #333 深 */
  --ink-strong:     #12121c;
  --ink-title:      #1a1a25;
  --ink-2:          #4a5265;   /* 次要文字 */
  --ink-3:          #6b7280;   /* 描述文字，原 #909399 加深 */
  --ink-4:          #8b95a7;   /* 弱化文字，原 #adb5bd 加深 */
  --ink-5:          #a8b1c1;

  /* —— 线条：加深让边界清楚 —— */
  --line:           #e2e6ef;   /* 原 #ebeef5 加深 */
  --line-2:         #d8dde8;
  --line-3:         #cbd2e0;
  --line-blue:      #dde3f5;

  /* —— 背景：拉开与白卡的差距 —— */
  --bg:             #eef1f7;   /* 原 #f8f9fa，加深成浅灰蓝 */
  --bg-alt:         #f2f4f9;
  --card:           #ffffff;
  --footer-bg:      #1a2432;

  --r-xs: 4px;
  --r-sm: 6px;
  --r:    8px;
  --r-lg: 10px;
  --r-xl: 16px;

  /* 卡片阴影加深，让卡片从背景浮起来 */
  --sh-card:   0 1px 2px rgba(26, 36, 50, .06), 0 2px 8px rgba(26, 36, 50, .04);
  --sh-hover:  0 4px 12px rgba(26, 36, 50, .10), 0 12px 28px rgba(26, 36, 50, .08);
  --sh-brand:  0 2px 8px rgba(78, 110, 242, .28);
  --sh-brand2: 0 4px 14px rgba(78, 110, 242, .38);
  --sh-header: 0 2px 12px rgba(26, 36, 50, .08);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-hover); }

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================================
   顶栏：毛玻璃吸顶
   ============================================================ */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  transition: box-shadow .3s ease, border-color .3s ease;
}

.site-header.scrolled {
  box-shadow: var(--sh-header);
  border-bottom-color: transparent;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 20px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.site-logo-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--r);
  background: linear-gradient(135deg, #4e6ef2, #2b7de9);
  box-shadow: var(--sh-brand);
  flex-shrink: 0;
}

.site-logo-text {
  font-size: 19px;
  font-weight: 700;
  background: linear-gradient(135deg, #4e6ef2 0%, #2b7de9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: .5px;
  white-space: nowrap;
}

/* 顶栏公告栏（Logo 右侧） */
.header-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 18px;
  padding: 6px 14px 6px 11px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef2ff 0%, #f6f2ff 100%);
  border: 1px solid var(--line-blue);
  min-width: 0;
  max-width: 480px;
  flex: 0 1 auto;
  overflow: hidden;
}

.header-notice-icon {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  flex-shrink: 0;
}

.header-notice-text {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  line-height: 1.5;
}

/* 主菜单 */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
}

.nav-menu a {
  padding: 8px 16px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background .2s, color .2s;
}

.nav-menu a:hover { background: var(--bg-alt); color: var(--ink); }

.nav-menu a.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* 右侧操作 */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r);
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
  font-family: inherit;
}

.nav-btn:hover {
  background: var(--bg-alt);
  color: var(--primary);
}

.nav-btn--outline {
  border-color: var(--line-2);
  background: #fff;
}

.nav-btn--outline:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ============================================================
   页面主体
   ============================================================ */

main.page-main {
  padding-top: 76px;
  padding-bottom: 48px;
  min-height: 100vh;
}

/* 居中标题区（bzck 的做法） */
.page-hero {
  text-align: center;
  margin: 48px 0 40px;
}

.page-hero h1 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--ink-title);
  margin: 0 0 12px;
  line-height: 1.2;
}

.page-hero p {
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: 28px;
  font-size: 16px;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}

/* ============================================================
   两栏布局：左侧分类 + 右侧商品
   ============================================================ */

.layout {
  display: flex;
  flex-direction: row;
  gap: 28px;
  align-items: flex-start;
}

/* ---------------- 侧栏 ---------------- */

.sidebar {
  flex: 0 0 248px;
  position: sticky;
  top: 88px;
}

.sidebar-inner {
  background: var(--card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 20px;
  box-shadow: var(--sh-card);
}

/* 搜索 */
.sidebar-search {
  margin-bottom: 22px;
}

.sidebar-search label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--ink-4);
  margin-bottom: 8px;
}

.sidebar-search input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg-alt);
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.sidebar-search input:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(78, 110, 242, .1);
}

/* 分类标题（带渐变竖条） */
.sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-strong);
  margin: 0 0 16px;
}

.sidebar-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, #4e6ef2, #7c93f8);
  flex-shrink: 0;
}

/* 分类列表 */
.cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 13px;
  border-radius: var(--r);
  border: 1px solid transparent;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .25s;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.cat-item:hover {
  background: var(--bg-alt);
  color: var(--ink);
}

.cat-item.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--sh-brand);
}

.cat-item .count {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: var(--r);
  background: rgba(0, 0, 0, .06);
  line-height: 16px;
  flex-shrink: 0;
}

.cat-item.active .count {
  background: rgba(255, 255, 255, .25);
}

/* ---------------- 顶部筛选栏 ---------------- */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all .2s;
}

.filter-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--sh-brand);
}

.filter-tab .count {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: var(--r);
  background: rgba(0, 0, 0, .06);
  line-height: 16px;
  flex-shrink: 0;
}

.filter-tab.active .count {
  background: rgba(255, 255, 255, .25);
}

.filter-search {
  flex: 0 0 240px;
  min-width: 180px;
}

.filter-search input {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}

.filter-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(78, 110, 242, .1);
}

/* ---------------- 商品网格：4 列 ---------------- */

.goods-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

/* ============================================================
   商品卡
   ============================================================ */

.goods-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-card);
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
  animation: cardIn .4s ease both;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a.goods-card:hover,
a.goods-card:focus,
a.goods-card:active {
  color: inherit;
  text-decoration: none;
}

a.goods-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(78, 110, 242, .35), var(--sh-hover);
}

/* 缺货卡是 div，不可点 */
div.goods-card { cursor: default; }

.goods-card:hover {
  box-shadow: var(--sh-hover);
  transform: translateY(-3px);
  border-color: #dfe4f5;
}

div.goods-card:hover {
  transform: none;
  box-shadow: var(--sh-card);
  border-color: var(--line);
}

.goods-card:nth-child(1) { animation-delay: .02s; }
.goods-card:nth-child(2) { animation-delay: .05s; }
.goods-card:nth-child(3) { animation-delay: .08s; }
.goods-card:nth-child(4) { animation-delay: .11s; }
.goods-card:nth-child(5) { animation-delay: .14s; }
.goods-card:nth-child(6) { animation-delay: .17s; }
.goods-card:nth-child(7) { animation-delay: .20s; }
.goods-card:nth-child(8) { animation-delay: .23s; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 封面区：16:9 */
.goods-img {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #f4f6ff 0%, #eef1fd 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

/* 封面右下角的柔光装饰，避免大片空白 */
.goods-img::before {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  pointer-events: none;
}

.goods-img::after {
  content: "";
  width: 42px;
  height: 42px;
  border-radius: var(--r-lg);
  background: var(--primary);
  opacity: .16;
  transition: opacity .3s, transform .3s;
}

.goods-card:hover .goods-img::after {
  opacity: .26;
  transform: scale(1.08);
}

/* 真实封面图 */
.goods-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

/* 有图 / 有首字时隐藏占位方块 */
.goods-img:has(img)::after,
.goods-img:has(.goods-img-letter)::after { display: none; }

/* 无封面时的首字：按商品 id 的渐变色深调，保证在各种底色上都清楚 */
.goods-img-letter {
  font-size: 52px;
  font-weight: 800;
  color: rgba(60, 72, 110, .55);
  letter-spacing: -2px;
  user-select: none;
  transition: transform .35s ease, color .35s ease;
  text-shadow: 0 1px 2px rgba(255, 255, 255, .6);
}

.goods-card:hover .goods-img-letter {
  transform: scale(1.1);
  color: rgba(50, 62, 100, .72);
}

.goods-card:hover .goods-img img { transform: scale(1.05); }

/* 内容区 */
.goods-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* 分类小字 */
.goods-cat {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-4);
  margin-bottom: 6px;
}

/* 标题 */
.goods-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
  letter-spacing: -.1px;
  margin-bottom: 9px;
  min-height: 21.8px;
  max-height: 43.5px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
  word-break: break-all;
  transition: color .2s;
}

.goods-card:hover .goods-title { color: var(--primary); }

/* 标签行 */
.goods-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 9px;
  min-height: 20px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  line-height: 1.7;
  white-space: nowrap;
}

.chip--guest   { background: #fef3e2; color: #b45309; border: 1px solid #fbd9a5; }
.chip--auto    { background: #e8edff; color: #3a5bd9; border: 1px solid #c3cfff; }
.chip--stock   { background: #dcf5e9; color: #08795a; border: 1px solid #a7e5cb; }
.chip--bare    { background: #ffe8e8; color: #c9264b; border: 1px solid #ffc2c2; }
.chip--hot     { background: #f5365c; color: #fff; border: 1px solid #f5365c; }

/* 描述 */
.goods-desc {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.6;
  margin-bottom: 11px;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* 底部价格行 */
.goods-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.goods-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  flex: 1;
  flex-wrap: nowrap;
  overflow: hidden;
}

.goods-price .label {
  font-size: 11px;
  color: var(--ink-4);
  white-space: nowrap;
  flex-shrink: 0;
}

.goods-price .amount {
  font-size: 19px;
  font-weight: 800;
  color: var(--price);
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.goods-price .unit {
  font-size: 11px;
  color: var(--ink-4);
  white-space: nowrap;
  flex-shrink: 0;
}

.goods-price .orig {
  font-size: 11px;
  color: var(--ink-4);
  text-decoration: line-through;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* 价格行内的库存数字 */
.goods-stock {
  font-size: 11px;
  color: var(--ink-4);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

.goods-stock.low {
  color: var(--orange);
  font-weight: 600;
}

.goods-stock.out {
  color: var(--price);
  font-weight: 600;
}

/* 右下角指示按钮：纯视觉元素，整张卡片才是点击区域 */
.buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink-2);
  flex-shrink: 0;
  transition: all .2s;
}

/* 悬停卡片时按钮跟随高亮，提示"这里可以点" */
a.goods-card:hover .buy-btn {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--sh-brand);
}

.buy-btn.disabled {
  background: var(--bg-alt);
  border-color: var(--line);
  color: var(--ink-5);
  cursor: not-allowed;
}

div.goods-card:hover .buy-btn.disabled {
  background: var(--bg-alt);
  border-color: var(--line);
  color: var(--ink-5);
  box-shadow: none;
}

/* 售罄 */
.goods-card.is-soldout .goods-img::after { opacity: .08; }
.goods-card.is-soldout .goods-title,
.goods-card.is-soldout .goods-desc { color: var(--ink-4); }
.goods-card.is-soldout .goods-price .amount { color: var(--ink-4); }

.soldout-stamp {
  position: absolute;
  top: 0; left: 0; right: 0;
  aspect-ratio: 16 / 9;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 249, 250, .6);
  pointer-events: none;
}

.soldout-stamp span {
  padding: 6px 15px;
  border: 2px solid rgba(148, 163, 184, .9);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .94);
  color: rgba(100, 116, 139, .96);
  font-size: 13px;
  font-weight: 600;
  transform: rotate(-8deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

/* ============================================================
   按钮
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--r);
  border: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all .2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--sh-brand);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
  box-shadow: var(--sh-brand2);
  transform: translateY(-1px);
}

.btn-outline {
  background: #fff;
  border: 1px solid var(--line-3);
  color: var(--ink-2);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-lg { padding: 12px 32px; font-size: 15px; }
.btn-sm { padding: 5px 13px; font-size: 12px; }
.btn-block { display: flex; width: 100%; }

.btn:disabled,
.btn.disabled {
  background: var(--line-3);
  color: var(--ink-4);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   通用面板 / 表单 / 表格
   ============================================================ */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--sh-card);
}

/* 站点公告条 */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line-blue);
  border-radius: var(--r-lg);
  padding: 12px 18px 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.75;
  box-shadow: var(--sh-card);
  position: relative;
  overflow: hidden;
}

.notice::before {
  content: "";
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  background: linear-gradient(180deg, #4e6ef2, #7c93f8);
  flex-shrink: 0;
}

.panel h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-title);
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.panel h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-title);
  margin: 20px 0 10px;
}

label {
  display: block;
  margin: 13px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 13px;
  border: 1px solid var(--line-3);
  border-radius: var(--r);
  font-size: 13px;
  font-family: inherit;
  font-weight: 400;
  color: var(--ink);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(78, 110, 242, .1);
}

textarea { min-height: 90px; resize: vertical; }

.tbl {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.tbl th, .tbl td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.tbl th {
  background: var(--bg-alt);
  width: 130px;
  font-weight: 600;
  color: var(--ink-2);
}

.cardline {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 15px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 8px 0;
  letter-spacing: .3px;
}

.qrimg {
  display: block;
  margin: 18px auto;
  max-width: 220px;
  width: 100%;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

/* 面包屑 */
.breadcrumb {
  padding: 16px 0 8px;
  font-size: 13px;
  color: var(--ink-5);
}

.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 6px; color: var(--line-3); font-size: 11px; }

/* 工具类 */
.muted { color: var(--ink-2); }
.small { font-size: 12px; }
.ok    { color: var(--green); font-weight: 600; }
.warn  { color: var(--orange); font-weight: 600; }
.err   { color: var(--price-deep); font-weight: 600; }

/* ============================================================
   页脚
   ============================================================ */

.site-footer {
  background: var(--footer-bg);
  color: rgba(255, 255, 255, .55);
  padding: 40px 0 24px;
  margin-top: 56px;
  font-size: 13px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 32px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--r);
  background: linear-gradient(135deg, #4e6ef2, #2b7de9);
  flex-shrink: 0;
}

.footer-brand h3 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
  color: rgba(255, 255, 255, .5);
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 14px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: rgba(255, 255, 255, .55);
  font-size: 13px;
  transition: color .2s;
}

.footer-col a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .4);
  flex-wrap: wrap;
}

.footer-bottom a { color: rgba(255, 255, 255, .45); }
.footer-bottom a:hover { color: #fff; }

/* ============================================================
   移动端底部导航（bzck 的做法）
   ============================================================ */

.mobile-tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-tabbar-inner {
  display: flex;
  align-items: stretch;
  height: 56px;
}

.mobile-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10.5px;
  color: var(--ink-4);
  transition: color .2s;
  text-decoration: none;
}

.mobile-tab svg { width: 20px; height: 20px; }

.mobile-tab.active { color: var(--primary); font-weight: 600; }

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1200px) {
  .goods-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 960px) {
  .nav-menu { display: none; }
  .goods-grid { grid-template-columns: repeat(3, 1fr); }
  .filter-search { flex: 1 1 100%; order: 2; }
  .filter-bar { gap: 12px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }

  /* 导航隐藏后，公告栏补位并放开宽度 */
  .header-notice {
    flex: 1 1 auto;
    max-width: none;
    margin-left: 14px;
  }
}

@media (max-width: 768px) {
  .filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-search { display: none; }
  .goods-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

@media (max-width: 640px) {
  .container { padding: 0 12px; }
  .site-header .container { height: 56px; }
  .site-logo-text { font-size: 16px; }
  .site-logo-mark { width: 26px; height: 26px; }

  /* 手机端顶栏空间不足，隐藏公告栏，改由页面内公告承载信息 */
  .header-notice { display: none; }

  main.page-main {
    padding-top: 76px;
    padding-bottom: 76px;  /* 给底部 tabbar 留位 */
  }

  .goods-body { padding: 10px 11px 12px; }
  .goods-title { font-size: 13px; height: 38px; }
  .goods-price .amount { font-size: 15px; }
  .goods-desc { display: none; }
  .goods-foot { padding-top: 8px; }

  /* 手机端价格行精简：只留金额，去掉「价格」二字、CNY 单位与划线原价 */
  .goods-price .label,
  .goods-price .unit,
  .goods-price .orig { display: none; }

  .goods-tags {
    gap: 4px;
    margin-bottom: 7px;
    flex-wrap: nowrap;
    overflow: hidden;
    min-height: 18px;
  }
  .chip {
    font-size: 10px;
    padding: 1px 5px;
    flex-shrink: 0;
  }

  .mobile-tabbar { display: block; }

  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; }
  .site-footer { padding-bottom: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
