/* ============================================================
   Taoify 店铺前台 · 统一设计系统 v1（清爽现代 · 大留白）
   ------------------------------------------------------------
   背景：
     三套官方模板（Default / Viewfirst / Viewpc）原先都建立在买来的
     Pixio 主题之上（pixio.css 539KB），各自的样式散在 142 个 html 文件里，
     想统一改视觉几乎不可能。

   做法：
     这一份是"覆盖层"，加载在每页 </head> 之前（即最后一个 stylesheet），
     靠设计 token + 精准覆盖既有类名（dz-* / btn / container / 工具类）
     把三套模板拉到同一套视觉语言上。
     不改任何 Mustache 变量、表单、JS —— 只改观感与响应式。

   断点约定：
     移动优先。992px 是唯一断点（与 vp-show-mobile / vp-show-pc 一致）。
     < 992px  : 手机 / 平板竖屏  —— 底部 tabbar、商品 2 列
     >= 992px : 桌面 / 平板横屏  —— 隐藏 tabbar、商品 4 列、容器居中 1200

   注意：本文件必须保持在最后一处加载，否则会被 pixio.css 覆盖。
   ============================================================ */

/* ---------- 1. 设计 token ---------- */
:root {
  /* 颜色：以白与近黑打底，只留一个橙红做价格与促销 */
  --tf-bg: #ffffff;
  --tf-surface: #f6f7f9;
  --tf-surface-2: #eef0f4;
  --tf-card: #ffffff;

  --tf-ink: #111318;
  --tf-ink-2: #5b6270;
  --tf-ink-3: #9ba2af;
  --tf-ink-inv: #ffffff;

  --tf-line: #edeff3;
  --tf-line-2: #e2e5eb;

  --tf-cta: #111318;
  --tf-cta-hover: #262a33;
  --tf-accent: #ff4d1c;
  --tf-accent-soft: #fff1ec;
  --tf-ok: #12a150;
  --tf-ok-soft: #eaf7ef;
  --tf-warn: #b7791f;
  --tf-warn-soft: #fdf6e7;
  --tf-danger: #d93025;
  --tf-danger-soft: #fdedeb;

  /* 圆角：大留白配大圆角，但不超过 22px 免得发飘 */
  --tf-r-xs: 6px;
  --tf-r-sm: 10px;
  --tf-r: 16px;
  --tf-r-lg: 22px;
  --tf-r-pill: 999px;

  /* 阴影：只做极轻的两级，靠留白和细线分层不靠投影 */
  --tf-sh-1: 0 1px 2px rgba(17, 19, 24, 0.04);
  --tf-sh-2: 0 2px 10px rgba(17, 19, 24, 0.06);
  --tf-sh-3: 0 14px 36px rgba(17, 19, 24, 0.10);

  /* 间距节奏：4 的倍数 */
  --tf-s1: 4px;
  --tf-s2: 8px;
  --tf-s3: 12px;
  --tf-s4: 16px;
  --tf-s5: 20px;
  --tf-s6: 24px;
  --tf-s7: 32px;
  --tf-s8: 40px;

  --tf-maxw: 1200px;
  --tf-gutter: 16px;
  --tf-tap: 44px;

  /* 店主可在后台覆盖主色：改这一个变量即可 */
  --tf-brand: #111318;
}

/* ---------- 2. 基础重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--tf-bg);
  color: var(--tf-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

a:active {
  opacity: 0.72;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--tf-s3);
  color: var(--tf-ink);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

h1 { font-size: 26px; }
h2 { font-size: 22px; }
h3 { font-size: 19px; }
h4 { font-size: 17px; }
h5 { font-size: 16px; }
h6 { font-size: 15px; }

p { margin: 0 0 var(--tf-s3); color: var(--tf-ink-2); }

/* 键盘可达性：只在键盘聚焦时给环，鼠标点击不出环 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--tf-ink);
  outline-offset: 2px;
  border-radius: var(--tf-r-xs);
}

::selection {
  background: var(--tf-ink);
  color: var(--tf-ink-inv);
}

/* 细滚动条，桌面端更干净 */
@media (min-width: 992px) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb {
    background: var(--tf-line-2);
    border-radius: var(--tf-r-pill);
    border: 3px solid transparent;
    background-clip: content-box;
  }
  ::-webkit-scrollbar-thumb:hover { background: #cfd4dd; background-clip: content-box; }
  ::-webkit-scrollbar-track { background: transparent; }
}

/* ---------- 3. 布局容器 ---------- */
.container {
  width: 100%;
  max-width: var(--tf-maxw);
  margin-inline: auto;
  padding-inline: var(--tf-gutter);
}

.page-content {
  background: var(--tf-bg);
}

@media (min-width: 992px) {
  :root { --tf-gutter: 24px; }
  .container { padding-inline: var(--tf-gutter); }
}

/* 移动端给底部 tabbar 留出空间，避免最后一行被遮住 */
@media (max-width: 991.98px) {
  body.tf-has-tabbar {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- 4. 顶部栏 ----------
   重要：pixio 用 .header.header-fixed{position:fixed}（两个类，特异性 0,2,0）
   配合 .page-content.space-top{margin-top:var(--headheight)} 做补偿，
   --headheight 由 pixio 给（手机 60 / 桌面 78）。
   所以这里绝不改高度、也不自己造补偿值 —— 只重绘外观。
   想改高度就只改 --headheight，一处生效。 */
.header,
.header.header-fixed {
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--tf-line);
  box-shadow: none;
}

.header .header-content,
.header .header-inner {
  display: flex;
  align-items: center;
  gap: var(--tf-s3);
  padding-inline: var(--tf-gutter);
  /* 高度交给 --headheight，别写死 */
  min-height: var(--headheight, 60px);
  /* 和正文栅格同宽同起点，否则桌面端 logo 会和商品列错位 */
  max-width: var(--tf-maxw);
  margin-inline: auto;
  width: 100%;
}

/* 顶栏里的 Logo 控制在合理范围，避免超宽挤压搜索 */
.header .header-logo img,
.header .logo {
  max-height: 32px;
  width: auto;
}

@media (min-width: 992px) {
  .header .header-logo img,
  .header .logo { max-height: 38px; }
}

/* 搜索框 */
.search-input,
.header input[type="text"],
.header input[type="search"] {
  height: var(--tf-tap);
  padding: 0 var(--tf-s4);
  border: 1px solid var(--tf-line-2);
  border-radius: var(--tf-r-pill);
  background: var(--tf-surface);
  color: var(--tf-ink);
  font-size: 14px;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.search-input:focus,
.header input[type="text"]:focus,
.header input[type="search"]:focus {
  background: var(--tf-bg);
  border-color: var(--tf-ink);
  outline: none;
}

/* ---------- 5. 商品卡片 ---------- */
.dz-card {
  background: var(--tf-card);
  border-radius: var(--tf-r);
  overflow: hidden;
  border: 1px solid var(--tf-line);
  box-shadow: none;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.22s ease, border-color 0.22s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dz-media {
  position: relative;
  overflow: hidden;
  background: var(--tf-surface);
  border-radius: 0;
}

/* 固定比例只作用于商品卡里的图，不能挂在全局 .dz-media 上 ——
   banner 里也用 .dz-media.home-media，会被压成正方形。 */
.dz-card .dz-media {
  aspect-ratio: 1 / 1;
}

.dz-media > a,
.dz-media a {
  display: block;
  height: 100%;
}

.dz-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.dz-content {
  padding: var(--tf-s3) var(--tf-s3) var(--tf-s4);
  display: flex;
  flex-direction: column;
  gap: var(--tf-s1);
  flex: 1;
}

.dz-content .title,
.dz-card .title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--tf-ink);
  /* 两行截断：长标题不再把卡片撑高 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.dz-meta {
  list-style: none;
  margin: auto 0 0;
  padding: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--tf-s2);
}

.dz-price {
  color: var(--tf-accent);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  /* 数字等宽，价格列表纵向对齐 */
  font-variant-numeric: tabular-nums;
}

/* 划线原价 */
.dz-price del,
.dz-price .line-through,
.dz-meta .old-price {
  color: var(--tf-ink-3);
  font-size: 12px;
  font-weight: 400;
  margin-left: 6px;
}

/* 桌面端：悬停才升起，触屏端不触发以免"粘住" */
@media (hover: hover) and (pointer: fine) {
  .dz-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--tf-sh-3);
    border-color: transparent;
  }
  .dz-card:hover .dz-media img {
    transform: scale(1.045);
  }
}

/* ---------- 6. 网格：手机上 2 列，桌面自动 4 列 ---------- */
.row.g-3 > [class*="col-6"],
.row > .col-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

@media (min-width: 992px) {
  /* 模板里商品位写死 col-6（两列），桌面端会变成巨大的两列。
     这里统一拉到四列；已经有 col-md-* / col-lg-* 的由 Bootstrap 规则优先。 */
  .row.g-3 > .col-6:not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]),
  .row > .col-6:not([class*="col-md-"]):not([class*="col-lg-"]):not([class*="col-xl-"]) {
    flex: 0 0 25%;
    max-width: 25%;
  }
  .row.g-3 {
    --bs-gutter-x: 20px;
    --bs-gutter-y: 20px;
    margin-top: -10px;
  }
}

/* ---------- 7. 分类标签 ---------- */
.category-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 var(--tf-s4);
  border: 1px solid var(--tf-line-2);
  border-radius: var(--tf-r-pill);
  background: var(--tf-bg);
  color: var(--tf-ink-2);
  font-size: 13px;
  white-space: nowrap;
  transition: all 0.18s ease;
}

@media (hover: hover) and (pointer: fine) {
  .category-tag:hover {
    border-color: var(--tf-ink);
    color: var(--tf-ink);
    background: var(--tf-surface);
  }
}

.category-tag.tag-lg {
  font-size: 14px;
  min-height: 38px;
  padding: 0 var(--tf-s5);
}

/* ---------- 8. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--tf-s2);
  min-height: var(--tf-tap);
  padding: 0 var(--tf-s5);
  border-radius: var(--tf-r-pill);
  border: 1px solid var(--tf-line-2);
  background: var(--tf-bg);
  color: var(--tf-ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.18s ease, border-color 0.18s ease,
    color 0.18s ease, box-shadow 0.18s ease;
  /* 去掉移动端点击时的默认灰块 */
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.975);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--tf-cta);
  border-color: var(--tf-cta);
  color: var(--tf-ink-inv);
  box-shadow: var(--tf-sh-1);
}

.btn-primary:active { background: var(--tf-cta-hover); }

.btn-outline {
  background: transparent;
  border-color: var(--tf-ink);
  color: var(--tf-ink);
}

.btn-accent {
  background: var(--tf-accent);
  border-color: var(--tf-accent);
  color: #fff;
}

.btn-sm {
  min-height: 36px;
  padding: 0 var(--tf-s4);
  font-size: 13px;
}

.btn-block { width: 100%; }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--tf-surface); }
  .btn-primary:hover { background: var(--tf-cta-hover); }
  .btn-outline:hover { background: var(--tf-surface); }
  .btn-accent:hover { filter: brightness(0.94); }
}

/* 商品详情页底部的操作条：吸底 + 安全区 */
.dz-detail-footer,
.goods-detail-footer {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--tf-line);
  padding: var(--tf-s3) var(--tf-s4) calc(var(--tf-s3) + env(safe-area-inset-bottom, 0px));
  z-index: 800;
}

/* ---------- 9. 表单 ---------- */
input[type="text"],
input[type="search"],
input[type="tel"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  min-height: var(--tf-tap);
  padding: 10px var(--tf-s4);
  border: 1px solid var(--tf-line-2);
  border-radius: var(--tf-r-sm);
  background: var(--tf-bg);
  color: var(--tf-ink);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

textarea { min-height: 96px; resize: vertical; line-height: 1.55; }

input::placeholder,
textarea::placeholder { color: var(--tf-ink-3); }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--tf-ink);
  box-shadow: 0 0 0 3px rgba(17, 19, 24, 0.06);
  outline: none;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--tf-surface);
  color: var(--tf-ink-3);
  cursor: not-allowed;
}

label {
  display: block;
  font-size: 13px;
  color: var(--tf-ink-2);
  margin-bottom: 6px;
}

/* ---------- 10. 分隔与卡片容器 ---------- */
.tf-section {
  padding-block: var(--tf-s7);
}

@media (min-width: 992px) {
  .tf-section { padding-block: var(--tf-s8); }
}

.tf-section + .tf-section {
  border-top: 1px solid var(--tf-line);
}

/* 区块标题：左标题 + 右"查看全部"，比原来只有 h5 更有指引 */
.tf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--tf-s3);
  margin-bottom: var(--tf-s4);
}

.tf-head .tf-head__t {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.tf-head .tf-head__more {
  font-size: 13px;
  color: var(--tf-ink-3);
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .tf-head .tf-head__more:hover { color: var(--tf-ink); }
}

/* 细分割线 */
.tf-hr {
  height: 1px;
  background: var(--tf-line);
  border: 0;
  margin: var(--tf-s5) 0;
}

/* ---------- 11. 状态：空 / 加载 / 提示 ---------- */
.tf-empty {
  padding: var(--tf-s8) var(--tf-s4);
  text-align: center;
  color: var(--tf-ink-3);
}

.tf-empty__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--tf-s3);
  border-radius: 50%;
  background: var(--tf-surface);
  border: 1px solid var(--tf-line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tf-ink-3);
  font-size: 22px;
}

.tf-empty__t { font-size: 15px; color: var(--tf-ink-2); margin-bottom: 4px; }
.tf-empty__d { font-size: 13px; color: var(--tf-ink-3); margin-bottom: var(--tf-s4); }

/* 骨架屏：加载时先占位，避免白屏跳动 */
.tf-skel {
  background: linear-gradient(90deg, var(--tf-surface) 25%, var(--tf-surface-2) 37%, var(--tf-surface) 63%);
  background-size: 400% 100%;
  animation: tf-shimmer 1.4s ease infinite;
  border-radius: var(--tf-r-sm);
}

@keyframes tf-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.tf-skel--media { aspect-ratio: 1 / 1; border-radius: var(--tf-r); }
.tf-skel--line { height: 12px; margin-top: 10px; }
.tf-skel--line.is-short { width: 60%; }

.tf-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--tf-r-pill);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.tf-badge--accent { background: var(--tf-accent-soft); color: var(--tf-accent); }
.tf-badge--ok { background: var(--tf-ok-soft); color: var(--tf-ok); }
.tf-badge--warn { background: var(--tf-warn-soft); color: var(--tf-warn); }
.tf-badge--muted { background: var(--tf-surface); color: var(--tf-ink-3); }

/* ---------- 12. 底部 tabbar（备用）
   仅用于本身没有底部菜单的模板。Default / Viewfirst 自带
   .menubar-area，那条路走下面 12b，别再插一个 tf-tabbar 造成两条菜单。 ---------- */
.tf-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 950;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--tf-line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tf-tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 56px;
  color: var(--tf-ink-3);
  font-size: 11px;
  line-height: 1;
  position: relative;
}

.tf-tabbar__item.is-active {
  color: var(--tf-ink);
  font-weight: 500;
}

.tf-tabbar__item.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 18px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--tf-ink);
}

.tf-tabbar__item .tf-tabbar__ico {
  font-size: 19px;
  line-height: 1;
}

/* 桌面端隐藏 tabbar（顶部导航已足够） */
@media (min-width: 992px) {
  .tf-tabbar { display: none; }
  body.tf-has-tabbar { padding-bottom: 0; }
}

/* ---------- 12a. 首页 banner ----------
   模板结构：.dz-banner > .swiper > .swiper-slide > .inner-banner > .left-content / .right-content
   .right-content 里那个 h2.dz-text 是竖排「New」标签，pixio 给了 rotate(-90deg)，
   但没给父级定位上下文 —— 数据不全会飘出去压住下面的商品卡。
   这里补 position:relative + overflow:hidden 把它关回 banner 里。 */
.dz-banner {
  position: relative;
  border-radius: var(--tf-r);
  overflow: hidden;
  background: var(--tf-surface);
}

.dz-banner .inner-banner {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 180px;
  overflow: hidden;
}

.dz-banner .left-content {
  position: relative;
  z-index: 2;
  padding: var(--tf-s5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--tf-s2);
  max-width: 62%;
}

.dz-banner .right-content {
  position: relative;
  overflow: hidden;
  z-index: 1;
  /* pixio 把这层写成 width:140px（给旧版的固定小图用的），
     在弹性布局里必须用 flex 比例 + !important 才能拿到半屏。 */
  flex: 0 0 50%;
  width: 50% !important;
  min-width: 0;
}

@media (min-width: 992px) {
  .dz-banner .right-content { flex: 0 0 46%; width: 46% !important; }
}

/* 图片必须填满右半区：pixio 把 .dz-media.home-media 锁成 140px 宽，
   还有一条 .home-media img{max-width:140px}，两条都要破。
   高度直接给定值而不是 100%：父级是 auto 高度，100% 会退回按图片原始比例撑开，
   banner 会被顶成正方形。 */
.dz-banner .dz-media,
.dz-banner .dz-media.home-media {
  width: 100% !important;
  height: 200px !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
}

@media (min-width: 992px) {
  .dz-banner .dz-media,
  .dz-banner .dz-media.home-media {
    height: 300px !important;
  }
}

.dz-banner .right-content img {
  width: 100% !important;
  height: 100% !important;
  /* 关键：pixio 有 .home-media img{max-width:140px}，
     光设 width:100% 压不住 max-width，图还是 140px 一条。 */
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  display: block;
  border-radius: 0 !important;
}

/* 竖排「New」装饰字：pixio 原本是 40px + rotate(-90) 的巨型竖排字，
   锚点挂在 .right-content 上（宽 55% 的图片区），实际会溢出到 banner 边界被裁掉一半。
   它是模板里的硬编码文字、不承载商品数据，在"清爽现代"的版式里只会抢视觉，
   所以直接隐藏。若某个店主坚持要这个角标，把下面改成 display:block 并自行调位置即可。
   必须 !important：pixio 用 .dz-banner .right-content .dz-text 级选择器定了字号与 transform。 */
.dz-banner .dz-text {
  display: none !important;
}

@media (min-width: 992px) {
  .dz-banner .inner-banner { min-height: 300px; }
  .dz-banner .left-content { padding: var(--tf-s7); max-width: 50%; }
}

/* ---------- 12b. 底部菜单（模板自带 .menubar-area.footer-fixed）----------
   Default / Viewfirst 的 footer_custom.html 里已有一套底部菜单，
   数据为空时是个空白块。这里统一成设计系统的样子，不再另加一套 tabbar。
   注意：footer_custom 内部有一段 <style>定义 .nav-link，它出现在 body 里、
   加载顺序比本文件靠后，所以必须用 .menubar-nav .nav-link 两个类压过去。 */
.menubar-area.footer-fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 950;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--tf-line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.menubar-area .toolbar-inner.menubar-nav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  max-width: var(--tf-maxw);
  margin-inline: auto;
  gap: 0;
}

.menubar-nav .nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 56px;
  color: var(--tf-ink-3);
  font-size: 11px;
  line-height: 1;
  text-decoration: none;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.menubar-nav .nav-link i,
.menubar-nav .nav-link svg,
.menubar-nav .nav-link .icon {
  font-size: 19px;
  line-height: 1;
}

.menubar-nav .nav-link.active,
.menubar-nav .nav-link.is-active,
.menubar-nav .nav-link:hover {
  color: var(--tf-ink);
}

.menubar-nav .nav-link.active::before,
.menubar-nav .nav-link.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 18px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--tf-ink);
}

/* 有底部菜单时给正文留出高度，避免最后一行被挡 */
@media (max-width: 991.98px) {
  body:has(.menubar-area) .page-content {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  .menubar-area { display: block; }
}

@media (min-width: 992px) {
  /* 桌面端底部菜单隐藏；店主若想要也可以在这里改成 display:grid */
  .menubar-area.footer-fixed { display: none; }
}

/* ---------- 13. 价格 / 数字排版 ---------- */
.tf-price {
  color: var(--tf-accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.tf-price--lg { font-size: 26px; }
.tf-price--sm { font-size: 14px; }

/* ---------- 14. 工具类修补 ---------- */
/* 原模板里大量 color-font-dark-*，统一收到三档文字色 */
.color-font-dark-1 { color: var(--tf-ink) !important; }
.color-font-dark-2 { color: var(--tf-ink-2) !important; }
.color-font-dark-3 { color: var(--tf-ink-3) !important; }
.color-white-background { background: var(--tf-bg) !important; }
.bg-white { background: var(--tf-bg) !important; }

.rounded-xl { border-radius: var(--tf-r) !important; }
.shadow { box-shadow: var(--tf-sh-2) !important; }

/* 图片圆角统一，避免各页面 8/12/20 混用 */
.dz-media img.rounded,
.dz-media img.rounded-xl { border-radius: 0 !important; }

/* 长英文/数字不撑破容器 */
.title, .dz-content, .dz-meta { min-width: 0; }
.title { overflow-wrap: anywhere; }

/* ---------- 15. 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .dz-card:hover { transform: none; }
  .dz-card:hover .dz-media img { transform: none; }
}

/* ---------- 16. 打印 ---------- */
@media print {
  .header-fixed, .tf-tabbar, .dz-detail-footer, .goods-detail-footer { display: none !important; }
  body { background: #fff; }
  .dz-card { break-inside: avoid; border-color: #ccc; }
}
