/* 商城页面样式：冰川蓝浅色风格，按 design 目录里的设计稿实现；宽度 768px 以下换成手机排版 */
:root {
  /* 主色：冰川蓝 */
  --primary: #1677ff;
  --primary-hover: #0f66e8;
  --primary-50: #eef5ff;
  --primary-100: #d9e9ff;
  /* 页面底色、卡片、边框 */
  --bg: #f4f8fe;
  --card: #fff;
  --line: #e8eef6;
  --line-2: #dbe4ef;
  --field: #f3f7fc;
  /* 文字：从深到浅 */
  --text: #0f1b2d;
  --text-2: #354257;
  --text-3: #6a7689;
  --text-4: #98a2b3;
  /* 价格红、有货绿、库存少橙 */
  --red: #f5222d;
  --green: #16a34a;
  --orange: #f97316;
  --shadow: 0 6px 24px rgba(24, 82, 160, 0.06);
  --font: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  /* 上下排列，内容少时页脚也贴在窗口最下面 */
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #e3eefc 0, var(--bg) 480px) no-repeat, var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 主体内容撑满剩下的高度，把页脚推到底部 */
body > main {
  flex: 1 0 auto;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
label:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.icon {
  display: block;
  flex: none;
}

[hidden] {
  display: none !important;
}

/* 内容最宽 1352px，两边留 24px */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ========== 按钮 ========== */
.btn-primary,
.btn-outline,
.btn-white {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn-primary {
  border: 0;
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  background: #c8d1dc;
  cursor: not-allowed;
}

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

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

.btn-white {
  border: 1px solid #e1eaf5;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
}

.btn-white:hover {
  color: var(--primary);
}

.btn-lg {
  height: 46px;
  padding: 0 28px;
  border-radius: 10px;
  font-size: 16px;
}

/* ========== 页头 ========== */
.site-header {
  /* 页头一直固定在最上面，页面滚动时也不动 */
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: 10px;
  background: var(--bg);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
  /* 和下面内容对齐：最宽 1352px，窄屏时两边各留 24px */
  max-width: min(1352px, calc(100% - 48px));
  padding: 0 24px 0 26px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  min-width: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-name b {
  font-size: 20px;
  font-weight: 900;
}


.nav {
  display: flex;
  align-items: center;
  gap: 36px;
  margin-left: 14px;
  font-size: 15px;
  font-weight: 500;
}

.nav-link {
  position: relative;
  padding: 8px 0;
  color: var(--text-2);
  white-space: nowrap;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

/* 当前页面下面的小蓝条 */
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}

.header-search {
  flex: 1;
  min-width: 0;
  max-width: 360px;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  background: var(--field);
  color: var(--text-2);
}

.header-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.header-search input::placeholder {
  color: var(--text-4);
}

.header-search:focus-within {
  box-shadow: 0 0 0 2px var(--primary-100);
}

.auth {
  display: flex;
  gap: 12px;
  flex: none;
}

.auth .btn-sm {
  width: 68px;
  padding: 0;
}

/* 已登录：头像图标 + 昵称，点进“我的” */
.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 140px;
  height: 40px;
  padding: 0 14px;
  border-radius: 20px;
  background: var(--primary-50);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}

.user-chip:hover {
  background: var(--primary-100);
  color: var(--primary);
}

.user-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 手机才显示的按钮 */
.m-back {
  display: none;
}

/* ========== 首页横幅 ========== */
.hero {
  position: relative;
  margin-top: 12px;
  height: 250px;
  padding: 44px 56px 0;
  border-radius: 18px;
  overflow: hidden;
  /* 左边是浅色渐变放文字，右边是小熊冰川图 */
  background: linear-gradient(180deg, #e4eefa 0, #f3f8fd 100%);
}

.hero-text {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.hero-title {
  font-size: 40px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 2px;
  color: #0b1424;
}

.hero-br {
  display: none;
}

.hero-sub {
  margin: 10px 0 24px;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 1px;
  color: var(--text-2);
}

.hero-actions {
  display: flex;
  gap: 22px;
}

.hero-actions .btn-lg {
  min-width: 168px;
}

.hero-actions .hero-query {
  min-width: 148px;
}

.hero-bear {
  /* 背景图比横幅大，放大后往上挪，让小熊完整落在横幅右侧 */
  position: absolute;
  top: -130px;
  right: 0;
  width: auto;
  height: 500px;
  max-width: none;
  /* 图片左边渐隐，和左边的浅色底自然衔接 */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20%);
  mask-image: linear-gradient(90deg, transparent 0, #000 20%);
}

/* ========== 分类：小胶囊标签，一行放不下自动换行 ========== */
.cats {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  /* 跳过来时让开顶部固定的页头 */
  scroll-margin-top: 86px;
}

.cat-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px 0 5px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.cat-card:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 选中的分类：蓝色实底白字 */
.cat-card.active {
  border-color: transparent;
  background: linear-gradient(90deg, #1e80ff, #1268f0);
  color: #fff;
}

.cat-icon {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-icon svg {
  width: 14px;
  height: 14px;
}

/* 后台上传的分类图标：铺满整个圆形格子 */
.cat-icon-img {
  overflow: hidden;
  background: #f3f8ff;
}

.cat-icon-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cat-icon-0 { background: #eaf3ff; color: #1677ff; }
.cat-icon-1 { background: #ffeff0; color: #f5414f; }
.cat-icon-2 { background: #fff6e3; color: #f5a524; }
.cat-icon-3 { background: #fff2e5; color: #ff8a1f; }

/* 分类名太长时显示省略号，标签不会被撑得很长 */
.cat-name {
  max-width: 10em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== 区块标题 ========== */
.section {
  margin-top: 20px;
  /* 跳过来时让开顶部固定的页头 */
  scroll-margin-top: 86px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-title {
  /* 搜索词很长时只占一行，多出来的显示省略号 */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  line-height: 28px;
  font-weight: 800;
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}

/* ========== 商品卡片 ========== */
.goods-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

/* 封面贴满卡片顶部，下面是标签、名称、价格和按钮 */
.goods-card {
  display: flex;
  flex-direction: column;
  padding-bottom: 10px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.goods-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(24, 82, 160, 0.12);
}

.goods-cover {
  position: relative;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, #eaf4ff, #cfe3fa);
}

.goods-cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 没有商品图时居中放小熊 Logo */
.cover-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-fallback-logo {
  width: 30%;
  max-width: 56px;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(22, 119, 255, 0.18);
}

.sold-out .goods-cover > img,
.sold-out .cover-fallback,
.detail-cover.sold-out > img,
.detail-cover.sold-out .cover-hero {
  opacity: 0.5;
}

.cover-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 27, 45, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.goods-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 8px 10px 0;
}

/* 发货方式、库存做成小标签 */
.goods-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.goods-tag {
  padding: 0 6px;
  border-radius: 6px;
  background: var(--primary-50);
  color: var(--primary);
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}

.goods-tag.is-auto {
  background: #e9f8ef;
  color: var(--green);
}

.goods-tag.is-warn {
  background: #fff3e8;
  color: var(--orange);
}

/* 名称只占一行，太长显示省略号 */
.goods-name {
  margin-top: 6px;
  font-size: 15px;
  line-height: 22px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goods-price {
  margin: 4px 0 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

/* 价格：红色，¥ 小一点 */
.price {
  color: var(--red);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.goods-price .price {
  font-size: 20px;
  line-height: 1;
}

.yen {
  margin-right: 2px;
  font-size: 0.65em;
}

.price-old {
  font-size: 13px;
  color: var(--text-4);
  white-space: nowrap;
}

.goods-btn {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(90deg, #1e80ff, #1268f0);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.sold-out .goods-btn {
  background: #c8d1dc;
}

/* ========== 服务说明：一条矮横条 ========== */
.services {
  margin-top: 16px;
  padding: 10px 20px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.service {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  min-width: 0;
}

.service:first-child {
  padding-left: 0;
}

.service + .service {
  border-left: 1px solid var(--line);
}

.service-icon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-50);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-icon svg {
  width: 16px;
  height: 16px;
}

.service strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

/* 文字区可以收窄，说明太长时显示省略号 */
.service > div {
  min-width: 0;
}

.service span:not(.service-icon) {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== 空状态 ========== */
.empty {
  margin-top: 16px;
  padding: 48px 24px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}

.empty-bear {
  width: 96px;
  height: 96px;
  border-radius: 24px;
}

.empty-title {
  margin-top: 12px;
  font-size: 18px;
  font-weight: 800;
}

.empty-desc {
  margin: 6px 0 20px;
  font-size: 14px;
  color: var(--text-3);
}

.not-found {
  max-width: 560px;
  margin: 48px auto 0;
}

/* ========== 页脚 ========== */
.site-footer {
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 24px;
  font-size: 13px;
  color: var(--text-3);
}

.brand-sm .brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.brand-sm .brand-name {
  font-size: 14px;
  color: var(--text);
}

.brand-sm .brand-name b {
  font-size: 16px;
}


.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  padding: 0 14px;
  transition: color 0.2s;
}

.footer-links a + a {
  border-left: 1px solid var(--line-2);
}

.footer-links a:hover {
  color: var(--primary);
}

/* 首页页脚：服务说明和品牌栏是两个白色框，中间留一点空隙，一起贴在窗口底部 */
.site-footer-group {
  border-top: 0;
}

.footer-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-group .services {
  margin-top: 0;
}

.footer-group .footer-bar {
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}

/* ========== 手机底部导航、底部下单栏：电脑上不显示 ========== */
.tabbar,
.m-buybar {
  display: none;
}

/* ========== 轻提示 ========== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(15, 27, 45, 0.86);
  color: #fff;
  font-size: 14px;
  text-align: center;
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ========== 商品页 ========== */
.crumbs {
  margin: 18px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-3);
  white-space: nowrap;
}

.crumbs a:hover {
  color: var(--primary);
}

.crumbs .icon {
  color: var(--text-4);
}

.crumbs-current {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    'cover buy'
    'tabs buy';
  gap: 20px;
  align-items: start;
}

.detail-cover {
  grid-area: cover;
  position: relative;
  aspect-ratio: 2.08 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: #dcebfb;
}

.detail-cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 没有商品图时：冰川背景 + 小熊 + 商品名 */
.cover-hero {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 48px;
  background: linear-gradient(180deg, #e4eefa 0, #f3f8fd 100%);
}

.cover-hero-text {
  position: relative;
  z-index: 1;
  max-width: 58%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cover-hero-text strong {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 900;
  color: #0b1424;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cover-hero-text span {
  font-size: 15px;
  color: var(--text-2);
}

.cover-hero-bear {
  /* 和首页横幅同一张背景图，放大后让小熊落在右侧 */
  position: absolute;
  top: -131px;
  right: -70px;
  width: auto;
  height: 600px;
  max-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 30%);
  mask-image: linear-gradient(90deg, transparent 0, #000 30%);
}

/* 右边的购买卡片 */
.buy-card {
  grid-area: buy;
  position: sticky;
  /* 让开顶部固定的页头（高 70px） */
  top: 86px;
  padding: 24px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.buy-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.buy-thumb {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--primary-50);
}

.buy-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.buy-title {
  min-width: 0;
}

.buy-name {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.buy-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-3);
}

.buy-price {
  margin: 18px 0 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.price-xl {
  font-size: 34px;
  line-height: 1;
}

.buy-price .price-old {
  font-size: 15px;
}

.badges {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue { background: var(--primary-50); color: var(--primary); }
.badge-green { background: #e8f7ee; color: var(--green); }
.badge-orange { background: #fff1e6; color: var(--orange); }
.badge-gray { background: #eef1f5; color: var(--text-3); }

.assure {
  list-style: none;
  margin: 16px 0 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.assure li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  min-width: 0;
}

.assure li:first-child {
  padding-left: 0;
}

.assure li + li {
  border-left: 1px solid var(--line);
}

.assure-icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-50);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.assure strong {
  display: block;
  font-size: 14px;
}

.assure small {
  display: block;
  font-size: 12px;
  color: var(--text-3);
}

.buy-form {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.buy-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.buy-label {
  flex: none;
  width: 72px;
  font-size: 14px;
  font-weight: 600;
}

.tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tier {
  min-width: 104px;
  padding: 8px 16px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}

.tier strong {
  display: block;
  font-size: 15px;
}

.tier small {
  font-size: 13px;
  color: var(--text-3);
}

/* 当前数量用到的批发价 */
.tier.active {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary);
}

.stepper {
  flex: none;
  display: inline-flex;
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  overflow: hidden;
}

.stepper button {
  width: 40px;
  border: 0;
  background: #f6f9fc;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}

.stepper button:disabled {
  color: var(--text-4);
  cursor: not-allowed;
}

.stepper input {
  width: 56px;
  border: 0;
  border-left: 1px solid var(--line-2);
  border-right: 1px solid var(--line-2);
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  background: #fff;
}

.stepper input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.buy-hint {
  font-size: 14px;
  color: var(--text-3);
}

.coupon {
  flex: 1;
  display: flex;
  min-width: 0;
}

.coupon input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  color: var(--text);
}

.coupon input::placeholder {
  color: var(--text-4);
}

.coupon input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.coupon button {
  flex: none;
  padding: 0 24px;
  border: 0;
  border-radius: 0 10px 10px 0;
  background: #edf3fa;
  color: var(--text-2);
  font-weight: 600;
  cursor: pointer;
}

.coupon button:hover:not(:disabled) {
  color: var(--primary);
}

.coupon-tip {
  margin: -10px 0 0 88px;
  font-size: 13px;
  color: var(--green);
}

.total-row {
  align-items: baseline;
}

.price-total {
  font-size: 28px;
  line-height: 1;
}

.saved {
  font-size: 14px;
  color: var(--red);
}

.btn-order {
  width: 100%;
  height: 48px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  gap: 10px;
}

.buy-prompt {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f6f9fd;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-3);
}

.buy-prompt .icon {
  margin-top: 2px;
}

.pay-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-4);
  text-align: center;
}

/* 介绍页签：用单选框切换 */
.tabs-card {
  grid-area: tabs;
  padding-bottom: 24px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.tab-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tab-head {
  display: flex;
  gap: 40px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.tab-head label {
  padding: 14px 0 11px;
  border-bottom: 3px solid transparent;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
}

#tab-intro:checked ~ .tab-head label[for='tab-intro'],
#tab-usage:checked ~ .tab-head label[for='tab-usage'],
#tab-faq:checked ~ .tab-head label[for='tab-faq'] {
  border-bottom-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

#tab-intro:focus-visible ~ .tab-head label[for='tab-intro'],
#tab-usage:focus-visible ~ .tab-head label[for='tab-usage'],
#tab-faq:focus-visible ~ .tab-head label[for='tab-faq'] {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.tab-panel {
  display: none;
  padding: 18px 24px 0;
}

#tab-intro:checked ~ .panel-intro,
#tab-usage:checked ~ .panel-usage,
#tab-faq:checked ~ .panel-faq {
  display: block;
}

.panel-title {
  font-size: 17px;
  font-weight: 800;
}

/* 商品介绍是后台填写的富文本 */
.description {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.description > :first-child {
  margin-top: 0;
}

.description > :last-child {
  margin-bottom: 0;
}

.description img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.description a {
  color: var(--primary);
  text-decoration: underline;
}

.howto {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 16px;
  color: var(--text-2);
}

.howto li {
  display: flex;
  align-items: center;
  gap: 14px;
}

.howto-num {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-50);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}

.faq {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f6f9fd;
}

.faq summary {
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.faq p {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-3);
}

/* 购买流程 */
.flow {
  margin-top: 20px;
  padding: 16px 28px;
  border-radius: 16px;
  background: linear-gradient(90deg, #eaf3ff, #f6faff);
  display: flex;
  align-items: center;
  gap: 40px;
}

.flow-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}

.flow-head img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.flow-head h2 {
  font-size: 18px;
  font-weight: 800;
}

.flow-head p {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-3);
}

.flow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.flow-steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* 步骤之间的小箭头 */
.flow-steps li + li::before {
  content: '›';
  margin-right: 4px;
  font-size: 22px;
  line-height: 1;
  color: var(--text-4);
}

.flow-icon {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow-icon em {
  position: absolute;
  top: -4px;
  left: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow-steps strong {
  display: block;
  font-size: 14px;
}

.flow-steps small {
  display: block;
  font-size: 12px;
  color: var(--text-3);
}

/* 相关推荐 */
.related {
  margin-top: 20px;
}

.related-list {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.related-card:hover {
  transform: translateY(-2px);
}

.related-thumb {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--primary-50);
}

.related-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.related-info strong,
.related-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-info strong {
  font-size: 15px;
}

.related-info small {
  font-size: 13px;
  color: var(--text-3);
}

.related-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.related-price .price {
  font-size: 18px;
}

.related-price .price-old {
  font-size: 12px;
}

.related-cart {
  flex: none;
  width: 52px;
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== 窄屏电脑：页头放不下时收起搜索框 ========== */
@media (max-width: 1200px) {
  .nav {
    gap: 24px;
    margin-left: 8px;
  }

  .header-search {
    max-width: 240px;
  }

  .hero-title {
    font-size: 38px;
  }

  .goods-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* 电脑屏幕比较矮时横幅再压低一些，保证第一屏能看到一整排热门商品 */
@media (min-width: 1025px) and (max-height: 760px) {
  .hero {
    height: 210px;
    padding-top: 30px;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-bear {
    top: -110px;
    height: 420px;
  }
}

/* ========== 平板 ========== */
@media (max-width: 1024px) and (min-width: 769px) {
  .header-search {
    display: none;
  }

  .hero {
    padding: 44px 40px 0;
  }

  .hero-title {
    font-size: 34px;
  }

  .hero-sub {
    font-size: 16px;
  }

  /* 平板上小熊缩小一些，按钮也收窄，避免互相压住 */
  .hero-bear {
    top: -80px;
    right: -55px;
    height: 400px;
  }

  .hero-sub-tail {
    display: none;
  }

  .hero-actions {
    gap: 16px;
  }

  .hero-actions .btn-lg {
    min-width: 180px;
  }

  .hero-actions .hero-query {
    min-width: 160px;
  }

  .auth {
    margin-left: auto;
  }

  /* 平板上页头放不下全部内容：缩小间距 */
  .header-bar {
    gap: 16px;
    padding: 0 16px;
  }


  .nav {
    gap: 16px;
    margin-left: 0;
    font-size: 14px;
  }

  .auth {
    gap: 8px;
  }

  .auth .btn-sm {
    width: 64px;
  }

  .goods-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 10px;
  }

  .service:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .detail {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas:
      'cover'
      'buy'
      'tabs';
  }

  .buy-card {
    position: static;
  }

  .flow {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .related-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ========== 手机 ========== */
@media (max-width: 768px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* 给底部导航、底部下单栏留出位置 */
  .page-home {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .page-goods {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  /* 手机页头：不是卡片，左边 Logo，右边搜索框；商品页左边多一个返回按钮 */
  .site-header {
    padding-top: 8px;
  }

  .header-bar {
    max-width: none;
    height: 56px;
    padding: 0 12px;
    gap: 8px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .nav,
  .auth {
    display: none;
  }

  /* 手机：搜索框放在页头里，占满 Logo 右边的空间 */
  .header-search {
    max-width: none;
    height: 38px;
    padding: 0 12px;
    gap: 6px;
  }

  /* 字号不能小于 16px，否则 iPhone 聚焦时会自动放大页面 */
  .header-search input {
    font-size: 16px;
    text-overflow: ellipsis;
  }

  .brand {
    gap: 9px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-name b {
    font-size: 18px;
  }


  .m-back {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 44px;
    height: 44px;
    color: var(--text);
    cursor: pointer;
  }

  /* 有返回按钮时只留 Logo 图标，给搜索框腾地方 */
  .has-back .brand-logo {
    width: 36px;
    height: 36px;
  }

  .has-back .brand-text {
    display: none;
  }

  /* 横幅 */
  .hero {
    margin-top: 8px;
    height: 190px;
    padding: 18px 20px 0;
    border-radius: 14px;
  }

  .hero-text {
    max-width: none;
  }

  .hero-title {
    font-size: 26px;
    line-height: 1.22;
    letter-spacing: 1px;
  }

  .hero-comma {
    display: none;
  }

  .hero-br {
    display: inline;
  }

  /* 手机横幅副标题只占一行，分类太多时末尾显示省略号 */
  .hero-sub {
    margin: 7px 0 14px;
    font-size: 12px;
    letter-spacing: 0;
    color: var(--text);
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-sub-tail {
    display: none;
  }

  .hero-actions .btn-lg {
    min-width: 153px;
    height: 40px;
    padding: 0 18px;
    gap: 8px;
    border-radius: 10px;
    font-size: 15px;
  }

  .hero-query {
    display: none;
  }

  /* 小熊在横幅右边，图片多出来的部分被裁掉 */
  .hero-bear {
    top: -20px;
    right: -38px;
    height: 250px;
  }

  /* 分类标签再小一号 */
  .cats {
    margin-top: 12px;
    gap: 6px;
  }

  .cat-card {
    gap: 5px;
    height: 30px;
    padding: 0 11px 0 4px;
    font-size: 13px;
  }

  .cat-icon {
    width: 22px;
    height: 22px;
  }

  .cat-icon svg {
    width: 13px;
    height: 13px;
  }

  .cat-name {
    max-width: 7em;
  }

  .section {
    margin-top: 18px;
  }

  .section-title {
    font-size: 18px;
    line-height: 26px;
  }

  .more-link {
    gap: 4px;
    font-size: 13px;
  }

  /* 商品两列 */
  .goods-grid {
    margin-top: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .goods-card {
    padding-bottom: 8px;
    border-radius: 10px;
  }

  .goods-card:hover {
    transform: none;
  }

  .cover-fallback-logo {
    max-width: 44px;
    border-radius: 12px;
  }

  .goods-body {
    padding: 8px 8px 0;
  }

  .goods-tags {
    gap: 4px;
  }

  .goods-tag {
    padding: 0 4px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 18px;
  }

  .goods-name {
    margin-top: 4px;
    font-size: 14px;
    line-height: 20px;
  }

  .goods-price {
    margin: 2px 0 6px;
    gap: 6px;
  }

  .goods-price .price {
    font-size: 18px;
  }

  .goods-price .price-old {
    font-size: 12px;
  }

  .goods-btn {
    height: 30px;
    border-radius: 7px;
    font-size: 13px;
  }

  /* 服务：一行四个，只留图标和标题 */
  .services {
    margin-top: 12px;
    padding: 8px 4px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .service {
    justify-content: center;
    gap: 4px;
    padding: 0 2px;
  }

  .service:first-child {
    padding-left: 2px;
  }

  .service-icon {
    width: 22px;
    height: 22px;
  }

  .service-icon svg {
    width: 13px;
    height: 13px;
  }

  .service strong {
    font-size: 12px;
    white-space: nowrap;
  }

  .service span:not(.service-icon) {
    display: none;
  }

  /* 页脚：上下排 */
  .footer-bar {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .footer-links a {
    padding: 0 10px;
  }

  /* 底部导航 */
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff;
    box-shadow: 0 -4px 20px rgba(24, 82, 160, 0.08);
  }

  .tab {
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 12px;
    color: var(--text-3);
  }

  .tab.active {
    color: var(--primary);
  }

  .toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }

  /* 商品页 */
  .crumbs {
    display: none;
  }

  .goods-page {
    padding-top: 8px;
  }

  .detail {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas:
      'cover'
      'buy'
      'tabs';
    gap: 12px;
  }

  .detail-cover {
    aspect-ratio: 2 / 1;
    border-radius: 16px;
  }

  .cover-hero {
    padding: 0 20px;
  }

  .cover-hero-bear {
    top: -48px;
    right: -44px;
    height: 280px;
  }

  .cover-hero-text {
    max-width: 52%;
    gap: 8px;
  }

  .cover-hero-text strong {
    font-size: 20px;
  }

  .cover-hero-text span {
    font-size: 13px;
  }

  .buy-card {
    position: static;
    padding: 16px;
  }

  .buy-thumb {
    width: 56px;
    height: 56px;
    border-radius: 12px;
  }

  .buy-name {
    font-size: 18px;
  }

  .buy-sub {
    margin-top: 2px;
    font-size: 13px;
  }

  .buy-price {
    margin-top: 14px;
    gap: 8px;
  }

  .price-xl {
    font-size: 28px;
  }

  .buy-price .price-old {
    font-size: 13px;
  }

  .badge {
    height: 26px;
    padding: 0 8px;
    font-size: 12px;
  }

  /* 手机设计稿没有这一排保障说明，底部服务区已经写了 */
  .assure {
    display: none;
  }

  /* 手机上数量、优惠码在确认订单页填，这里只留批发价说明 */
  .buy-form {
    margin-top: 14px;
    gap: 14px;
  }

  .buy-form:not(:has(.tiers)) {
    display: none;
  }

  .pc-row,
  .pc-btn,
  .coupon-tip {
    display: none !important;
  }

  .buy-label {
    width: 56px;
    font-size: 14px;
  }

  .tier {
    min-width: 0;
    padding: 6px 12px;
  }

  .tab-head {
    justify-content: space-around;
    gap: 0;
    padding: 0 8px;
  }

  .tab-head label {
    font-size: 15px;
  }

  .tab-panel {
    padding: 16px 16px 0;
  }

  .tabs-card {
    padding-bottom: 16px;
  }

  .panel-title {
    font-size: 16px;
  }

  .description,
  .howto {
    font-size: 14px;
  }

  .flow {
    margin-top: 12px;
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .flow-head img {
    width: 44px;
    height: 44px;
  }

  .flow-head h2 {
    font-size: 16px;
  }

  .flow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }

  .flow-steps li + li::before {
    content: none;
  }

  .flow-icon {
    width: 40px;
    height: 40px;
  }

  .flow-steps strong {
    font-size: 14px;
  }

  .flow-steps small {
    font-size: 12px;
  }

  .related {
    margin-top: 16px;
  }

  .related .section-title {
    font-size: 18px;
  }

  .related-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .related-card {
    padding: 12px;
  }

  /* 底部固定的下单按钮 */
  .m-buybar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: block;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: #fff;
    box-shadow: 0 -4px 20px rgba(24, 82, 160, 0.08);
  }

  .m-buybar .btn-order {
    height: 46px;
    font-size: 16px;
  }
}

/* 系统设置了减少动画时，去掉过渡 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
