/* ==========================================================================
   玄机集 · 道教用品市场页
   仿 Etsy /market/ 页面结构的样式表
   设计令牌 → 基础重置 → 布局 → 组件 → 响应式
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计令牌
   -------------------------------------------------------------------------- */
:root {
  /* 品牌色：Etsy 橙为灵感，改为更贴合国风的朱砂橘 */
  --brand: #d64b1f;
  --brand-dark: #b03a13;
  --brand-soft: #fdf1ec;

  /* 中性色 */
  --ink: #1f1d1a;
  --ink-2: #4a453e;
  --ink-3: #7a736a;
  --line: #e3ded6;
  --line-2: #d3ccc1;
  --surface: #ffffff;
  --surface-2: #faf8f5;
  --surface-3: #f2eee8;

  /* 功能色 */
  --star: #e8a33d;
  --ok: #2e7d5b;

  /* 排版 */
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;

  /* 尺寸 */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(31, 29, 26, .06), 0 1px 6px rgba(31, 29, 26, .04);
  --shadow-md: 0 4px 12px rgba(31, 29, 26, .09), 0 2px 4px rgba(31, 29, 26, .05);
  --shadow-lg: 0 16px 44px rgba(31, 29, 26, .16);
  --header-h: 132px;

  --ease: cubic-bezier(.2, .7, .3, 1);
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure, fieldset, legend, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
legend { padding: 0; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }

/* 统一的键盘焦点样式：只在键盘操作时出现，且清晰可见 */
:focus-visible {
  outline: 2.5px solid var(--brand);
  outline-offset: 2px;
  border-radius: 3px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: var(--radius-sm);
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 12px; }

/* --------------------------------------------------------------------------
   3. 顶部公告条
   -------------------------------------------------------------------------- */
.announce {
  background: var(--ink);
  color: #f4f1ec;
  text-align: center;
  padding: 8px 16px;
  font-size: 12.5px;
  letter-spacing: .03em;
}
.announce p { opacity: .92; }

/* --------------------------------------------------------------------------
   4. 导航
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Logo */
.logo {
  display: flex; align-items: center; gap: 9px;
  flex-shrink: 0;
}
.logo-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--brand);
  color: #fff;
  border-radius: 9px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  padding-bottom: 2px;
}
.logo-text {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .06em;
}

/* 搜索 */
.search {
  flex: 1 1 auto;
  max-width: 720px;
  display: flex;
  position: relative;
}
.search input {
  width: 100%;
  height: 44px;
  padding: 0 52px 0 18px;
  background: var(--surface-2);
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-pill);
  font-size: 14.5px;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.search input::placeholder { color: var(--ink-3); }
.search input:hover { border-color: var(--ink-3); }
.search input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--ink);
}
.search-btn {
  position: absolute; right: 5px; top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  transition: background .16s var(--ease);
}
.search-btn:hover { background: var(--brand-dark); }
.search-btn svg { width: 18px; height: 18px; }

/* 右侧操作 */
.header-actions {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.icon-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  transition: background .15s var(--ease), color .15s var(--ease);
  position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-label { font-size: 11px; letter-spacing: .02em; }

.cart-badge {
  position: absolute; top: 3px; right: 5px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  font-size: 10.5px; font-weight: 700;
  border-radius: var(--radius-pill);
  border: 2px solid var(--surface);
}

.menu-toggle { display: none; }
.menu-toggle svg { width: 24px; height: 24px; }

/* 二级导航 */
.sub-nav {
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.sub-nav-list {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sub-nav-list::-webkit-scrollbar { display: none; }
.sub-nav-list a {
  display: block;
  padding: 12px 15px;
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: nowrap;
  border-bottom: 2.5px solid transparent;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.sub-nav-list a:hover { color: var(--ink); }
.sub-nav-list a.is-active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--brand);
}

/* --------------------------------------------------------------------------
   5. 面包屑
   -------------------------------------------------------------------------- */
.breadcrumb {
  max-width: 1500px;
  margin: 0 auto;
  padding: 16px 24px 0;
}
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumb li { font-size: 12.5px; color: var(--ink-3); }
.breadcrumb li + li::before {
  content: "/"; margin-right: 6px; color: var(--line-2);
}
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--ink-2); }

/* --------------------------------------------------------------------------
   6. Hero 横幅
   -------------------------------------------------------------------------- */
.hero {
  max-width: 1500px;
  margin: 16px auto 0;
  padding: 0 24px;
}
.hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(115deg, #2b2723 0%, #3d352c 46%, #554534 100%);
  color: #f6f2ec;
  display: grid;
  grid-template-columns: 1fr 340px;
  align-items: center;
  min-height: 232px;
}
.hero-bg {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 78% 50%, rgba(214, 75, 31, .38), transparent 52%),
    radial-gradient(circle at 12% 8%, rgba(255, 214, 170, .14), transparent 46%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  padding: 38px 44px;
  max-width: 100%;
  min-width: 0;
}
.hero-eyebrow {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #e9a97f;
  margin-bottom: 12px;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: .05em;
  margin-bottom: 14px;
}
.hero-desc {
  font-size: 14.5px;
  line-height: 1.75;
  color: rgba(246, 242, 236, .82);
  max-width: 520px;
  overflow-wrap: break-word;
}
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 26px;
  margin-top: 22px;
  font-size: 12.5px;
  color: rgba(246, 242, 236, .66);
}
.hero-stats strong {
  display: block;
  font-size: 20px;
  color: #fff;
  font-family: var(--font-serif);
  letter-spacing: .02em;
}
.hero-art {
  position: relative;
  align-self: stretch;
  min-height: 232px;
}
.hero-art img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: .9;
  mask-image: linear-gradient(90deg, transparent, #000 32%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 32%);
}

/* --------------------------------------------------------------------------
   7. 主体布局
   -------------------------------------------------------------------------- */
.market-layout {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 24px 56px;
  display: grid;
  grid-template-columns: 244px 1fr;
  gap: 30px;
  align-items: start;
  min-width: 0;
}
/* 网格子项默认为 min-content，会让长内容撑破布局，显式归零 */
.market-layout > * { min-width: 0; }
.results { min-width: 0; }

/* --------------------------------------------------------------------------
   8. 筛选栏
   -------------------------------------------------------------------------- */
.filters {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  max-height: calc(100dvh - var(--header-h) - 24px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
}
.filters::-webkit-scrollbar { width: 6px; }
.filters::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 3px;
}

.filters-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--ink);
}
.filters-head h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
}
.link-btn {
  font-size: 12.5px;
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s var(--ease);
}
.link-btn:hover { color: var(--brand); }

.filter-group {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.filter-group legend {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 11px;
  color: var(--ink);
}

.filter-options { display: flex; flex-direction: column; gap: 3px; }

/* 复选框 / 单选行 */
.check {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 7px;
  margin-left: -7px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .14s var(--ease);
}
.check:hover { background: var(--surface-3); }
.check input {
  appearance: none;
  width: 17px; height: 17px;
  flex-shrink: 0;
  border: 1.5px solid var(--line-2);
  border-radius: 4px;
  background: var(--surface);
  display: grid; place-items: center;
  transition: border-color .14s var(--ease), background .14s var(--ease);
}
.check input[type="radio"] { border-radius: 50%; }
.check input:checked {
  background: var(--brand);
  border-color: var(--brand);
}
.check input:checked::after {
  content: "";
  width: 9px; height: 5px;
  border: 2px solid #fff;
  border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}
.check input[type="radio"]:checked::after {
  width: 7px; height: 7px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  transform: none;
}
.check em {
  margin-left: auto;
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-3);
}
.check .stars { color: var(--star); font-size: 12px; letter-spacing: 1px; }

/* 价格输入 */
.price-inputs {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.price-inputs input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: border-color .15s var(--ease);
}
.price-inputs input:focus { outline: none; border-color: var(--ink); }
.price-inputs input::placeholder { color: var(--ink-3); }
.price-inputs .dash { color: var(--ink-3); flex-shrink: 0; }

/* --------------------------------------------------------------------------
   9. 结果区工具条
   -------------------------------------------------------------------------- */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.results-count { font-size: 13.5px; color: var(--ink-3); }
.results-count strong { color: var(--ink); font-size: 15px; }

.results-tools {
  display: flex; align-items: center; gap: 12px;
  margin-left: auto;
}
.filter-open-btn { display: none; }

.sort-label { font-size: 13px; color: var(--ink-3); }
.sort-select {
  height: 38px;
  padding: 0 34px 0 13px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%234a453e' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  background-size: 16px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  appearance: none;
  cursor: pointer;
  transition: border-color .15s var(--ease);
}
.sort-select:hover { border-color: var(--ink-3); }
.sort-select:focus { outline: none; border-color: var(--ink); }

.view-toggle {
  display: flex; gap: 2px;
  padding: 3px;
  background: var(--surface-3);
  border-radius: var(--radius-sm);
}
.view-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 5px;
  color: var(--ink-3);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.view-btn svg { width: 17px; height: 17px; }
.view-btn:hover { color: var(--ink); }
.view-btn.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* 已选条件标签 */
.active-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 18px;
}
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 8px 5px 13px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid rgba(214, 75, 31, .26);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
}
.chip button {
  width: 17px; height: 17px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--brand-dark);
  transition: background .14s var(--ease);
}
.chip button:hover { background: rgba(214, 75, 31, .16); }
.chip button svg { width: 11px; height: 11px; }

/* --------------------------------------------------------------------------
   10. 商品网格
   -------------------------------------------------------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 22px 18px;
  /* 防止网格子项因内容撑破容器 */
  min-width: 0;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--radius);
  transition: transform .2s var(--ease);
}
.card:hover { transform: translateY(-3px); }

.card-media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-3);
  aspect-ratio: 4 / 3.4;
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* 裁掉右下角的生成水印 */
  transform: scale(1.14);
  transform-origin: center top;
  transition: transform .45s var(--ease);
}
.card:hover .card-media img { transform: scale(1.2); }

/* 角标 */
.card-badges {
  position: absolute; top: 9px; left: 9px;
  display: flex; flex-direction: column; gap: 5px;
  align-items: flex-start;
}
.badge {
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.badge.badge-hot { background: var(--brand); color: #fff; }
.badge.badge-custom { background: var(--ok); color: #fff; }
.badge.badge-new { background: var(--ink); color: #fff; }

/* 收藏按钮 */
.card-wish {
  position: absolute; top: 8px; right: 8px;
  width: 33px; height: 33px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .94);
  border-radius: 50%;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: scale(.86);
  transition: opacity .2s var(--ease), transform .2s var(--ease), color .15s var(--ease);
}
.card:hover .card-wish,
.card-wish:focus-visible { opacity: 1; transform: scale(1); }
.card-wish:hover { color: var(--brand); }
.card-wish.is-on { opacity: 1; transform: scale(1); color: var(--brand); }
.card-wish.is-on svg { fill: currentColor; }
.card-wish svg { width: 17px; height: 17px; }

/* 快速查看浮层 */
.card-quick {
  position: absolute; left: 9px; right: 9px; bottom: 9px;
  padding: 9px;
  background: rgba(31, 29, 26, .9);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  backdrop-filter: blur(2px);
}
.card:hover .card-quick { opacity: 1; transform: translateY(0); }

/* 卡片文本区 */
.card-body { padding: 11px 2px 0; min-width: 0; }

.card-shop {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.card-title {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
  margin-bottom: 6px;
}
.card-title a { transition: color .15s var(--ease); }
.card-title a::after { content: ""; position: absolute; inset: 0; } /* 整卡可点击 */
.card:hover .card-title a { color: var(--brand); }

.card-meta {
  display: flex; align-items: center; gap: 5px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 5px;
  min-width: 0;
}
.card-meta > span { white-space: nowrap; }
.card-stars { color: var(--star); letter-spacing: .5px; font-size: 11.5px; }
.card-reviews::before { content: "("; }
.card-reviews::after { content: ")"; }

.card-price-row {
  display: flex; align-items: baseline; gap: 7px;
  flex-wrap: wrap;
}
.card-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .01em;
}
.card-compare {
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: line-through;
}
.card-save {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ok);
}
.card-ship {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex; align-items: center; gap: 4px;
  flex-wrap: wrap;
  line-height: 1.5;
}
.card-ship svg { flex-shrink: 0; }
.card-ship.is-free { color: var(--ok); font-weight: 600; }

/* 加入购物车按钮 */
.card-add {
  position: relative; z-index: 2;
  margin-top: 10px;
  width: 100%;
  height: 36px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s var(--ease), transform .2s var(--ease),
              background .16s var(--ease), color .16s var(--ease);
}
.card:hover .card-add,
.card-add:focus-visible { opacity: 1; transform: translateY(0); }
.card-add:hover { background: var(--ink); color: #fff; }
.card-add:active { transform: scale(.98); }

/* ---- 列表视图 ---- */
.product-grid.is-list { grid-template-columns: 1fr; gap: 14px; }
.product-grid.is-list .card {
  flex-direction: row;
  gap: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transform: none;
}
.product-grid.is-list .card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-md);
  transform: none;
}
.product-grid.is-list .card-media {
  width: 200px;
  flex-shrink: 0;
  aspect-ratio: 4 / 3;
}
.product-grid.is-list .card-body {
  flex: 1;
  padding: 2px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.product-grid.is-list .card-title { -webkit-line-clamp: 1; min-height: auto; font-size: 16px; }
.product-grid.is-list .card-add { width: 200px; opacity: 1; transform: none; margin-top: 12px; }
.product-grid.is-list .card-quick { display: none; }
.product-grid.is-list .card-price { font-size: 19px; }

/* --------------------------------------------------------------------------
   11. 空状态
   -------------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 72px 24px;
}
.empty-icon {
  font-size: 46px;
  color: var(--line-2);
  line-height: 1;
  margin-bottom: 14px;
}
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--ink-3); font-size: 13.5px; margin-bottom: 20px; }

/* --------------------------------------------------------------------------
   12. 按钮通用
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  transition: background .16s var(--ease), color .16s var(--ease),
              border-color .16s var(--ease);
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--brand); }
.btn-outline {
  border: 1.5px solid var(--ink);
  color: var(--ink);
  background: var(--surface);
}
.btn-outline:hover { background: var(--ink); color: #fff; }

/* --------------------------------------------------------------------------
   13. 相关专题
   -------------------------------------------------------------------------- */
.related {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 24px 56px;
}
.related h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: .05em;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--ink);
}
.related-list {
  display: flex; flex-wrap: wrap; gap: 9px;
}
.related-list a {
  display: block;
  padding: 9px 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  color: var(--ink-2);
  transition: all .16s var(--ease);
}
.related-list a:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

/* --------------------------------------------------------------------------
   14. 页脚
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
}
.footer-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 48px 24px 36px;
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 32px;
}
.footer-brand .logo-mark { margin-bottom: 12px; }
.footer-brand-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.footer-brand-desc {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.7;
  max-width: 290px;
}
.footer-col h3 {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .05em;
  margin-bottom: 13px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col a {
  font-size: 13px;
  color: var(--ink-3);
  transition: color .15s var(--ease);
}
.footer-col a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 18px 24px;
  text-align: center;
}
.footer-bottom p { font-size: 12px; color: var(--ink-3); }

/* --------------------------------------------------------------------------
   15. 详情弹窗
   -------------------------------------------------------------------------- */
.modal, .drawer { position: fixed; inset: 0; z-index: 300; }
.modal[hidden], .drawer[hidden] { display: none; }

.modal-backdrop, .drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(31, 29, 26, .52);
  backdrop-filter: blur(2px);
  animation: fade .2s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.modal-panel {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(880px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  animation: rise .24s var(--ease);
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .92);
  border-radius: 50%;
  color: var(--ink-2);
  z-index: 2;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.modal-close:hover { background: var(--surface-3); color: var(--ink); }
.modal-close svg { width: 18px; height: 18px; }

.qv-body { display: grid; grid-template-columns: 1fr 1fr; }
.qv-media { background: var(--surface-3); }
.qv-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }
.qv-info { padding: 34px 32px; }
.qv-shop { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.qv-info h2 {
  font-size: 21px;
  line-height: 1.35;
  font-weight: 600;
  margin-bottom: 12px;
  padding-right: 30px;
}
.qv-rating {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-3);
  margin-bottom: 16px;
}
.qv-price {
  font-size: 27px;
  font-weight: 700;
  margin-bottom: 4px;
}
.qv-save { font-size: 13px; color: var(--ok); font-weight: 600; margin-bottom: 16px; }
.qv-desc {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-2);
  margin-bottom: 18px;
}
.qv-specs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  font-size: 13px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.qv-specs dt { color: var(--ink-3); }
.qv-specs dd { margin: 0; color: var(--ink); }
.qv-actions { display: flex; gap: 10px; }
.qv-actions .btn { flex: 1; }

/* --------------------------------------------------------------------------
   16. 购物车抽屉
   -------------------------------------------------------------------------- */
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(400px, 100%);
  display: flex; flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: slideIn .26s var(--ease);
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 17px; letter-spacing: .04em; }
.drawer-head .modal-close { position: static; background: none; }
.drawer-head .modal-close:hover { background: var(--surface-3); }

.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }

.cart-item {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item img {
  width: 68px; height: 68px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info h4 {
  font-size: 13.5px; font-weight: 500; line-height: 1.4;
  margin-bottom: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cart-item-price { font-size: 14px; font-weight: 700; }
.cart-item-remove {
  margin-left: auto;
  align-self: flex-start;
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cart-item-remove:hover { color: var(--brand); }

.cart-empty { text-align: center; padding: 56px 20px; color: var(--ink-3); }
.cart-empty p:first-child { font-size: 34px; margin-bottom: 10px; }

.drawer-foot {
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.cart-total {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 6px;
  font-size: 14px;
}
.cart-total strong { font-size: 21px; }
.cart-note { font-size: 12px; color: var(--ink-3); margin-bottom: 14px; }
.drawer-foot .btn { width: 100%; }

/* --------------------------------------------------------------------------
   17. 轻提示
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%; bottom: 30px;
  transform: translateX(-50%) translateY(14px);
  z-index: 400;
  padding: 12px 22px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  pointer-events: none;
}
.toast[hidden] { display: none; }
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --------------------------------------------------------------------------
   18. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr 260px; }
  .hero h1 { font-size: 36px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 1000px) {
  :root { --header-h: 124px; }
  .hero-art { display: none; }
  .hero { grid-template-columns: 1fr; }
  .market-layout { grid-template-columns: 200px 1fr; gap: 22px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); gap: 20px 14px; }
}

@media (max-width: 820px) {
  :root { --header-h: 120px; }

  .header-inner { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .menu-toggle { display: flex; }
  .icon-label { display: none; }

  .logo-text { display: none; }

  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .search input { height: 42px; }

  /* 二级导航变下拉抽屉 */
  .sub-nav {
    position: fixed;
    inset: 0 auto 0 0;
    width: 254px;
    z-index: 120;
    background: var(--surface);
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateX(-102%);
    transition: transform .26s var(--ease);
    padding-top: 16px;
  }
  .sub-nav.is-open { transform: translateX(0); }
  .sub-nav-list {
    flex-direction: column;
    padding: 0 12px;
    gap: 2px;
  }
  .sub-nav-list a {
    padding: 12px 14px;
    border-bottom: 0;
    border-left: 3px solid transparent;
    border-radius: var(--radius-sm);
  }
  .sub-nav-list a.is-active {
    border-left-color: var(--brand);
    background: var(--brand-soft);
  }

  .breadcrumb { padding: 14px 16px 0; }

  .hero {
    margin: 14px 16px 0;
    min-height: auto;
    width: auto;
  }
  .hero-content { padding: 28px 22px; }
  .hero h1 { font-size: 30px; }
  .hero-desc { font-size: 13.5px; max-width: none; }
  .hero-stats { gap: 20px; }

  .market-layout {
    grid-template-columns: 1fr;
    padding: 18px 16px 44px;
    gap: 0;
  }

  /* 筛选栏变左侧抽屉 */
  .filters {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 130;
    width: min(310px, 88%);
    max-height: none;
    padding: 20px 18px 32px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateX(-102%);
    transition: transform .26s var(--ease);
    overflow-y: auto;
  }
  .filters.is-open { transform: translateX(0); }
  .filter-open-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 15px;
    border: 1.5px solid var(--line-2);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    transition: border-color .15s var(--ease);
  }
  .filter-open-btn:hover { border-color: var(--ink); }
  .filter-open-btn svg { width: 16px; height: 16px; }

  .results-bar { gap: 10px; }
  .results-tools { flex-wrap: wrap; gap: 8px; width: 100%; }
  .sort-label { display: none; }
  .sort-select { flex: 1; min-width: 130px; }

  .product-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 18px 12px; }
  .card-title { font-size: 13px; }
  .card-price { font-size: 15px; }
  .card-add { opacity: 1; transform: none; }

  .product-grid.is-list .card { flex-direction: column; }
  .product-grid.is-list .card-media { width: 100%; }
  .product-grid.is-list .card-add { width: 100%; }

  .footer-inner { grid-template-columns: 1fr; gap: 26px; padding: 36px 16px 28px; }
  .related { padding: 0 16px 44px; }

  .qv-body { grid-template-columns: 1fr; }
  .qv-media img { aspect-ratio: 16 / 11; }
  .qv-info { padding: 24px 20px; }
  .modal-panel { width: calc(100% - 24px); }
}

@media (max-width: 520px) {
  .hero h1 { font-size: 26px; }
  .hero-stats strong { font-size: 17px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 10px; }
  .card-body { padding-top: 9px; }
  .card-title { min-height: 2.8em; }
  .announce p { font-size: 11.5px; }
}

/* 遮罩：抽屉/侧栏打开时 */
.scrim {
  position: fixed; inset: 0;
  z-index: 125;
  background: rgba(31, 29, 26, .45);
  animation: fade .2s var(--ease);
}

/* --------------------------------------------------------------------------
   19. 无障碍与动效偏好
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header, .filters, .card-add, .card-wish, .card-quick, .toast { display: none !important; }
}
