/* ══════════════════════════════════════════════════════════════════════
   文件：assets/css/site.css
   用途：Pawtronic 智能宠物用品导购站 · 全站共享样式

   视觉语言：参照 apple.com.cn/store（研究见 apple-cn-store-设计研究.md）
   令牌标注：[已验证] 多来源交叉核对 / [待核对] 单来源 / [冲突] 来源矛盾

   设计纪律（改这个文件前先读）：
   1. 只有一个强调色。不要引入第二个品牌色。
   2. 正文 17px，字重阶梯 300/400/600/700，没有 500。
   3. 阴影只有一个，且只给"落在台面上的产品图"。卡片、按钮、文字一律无阴影。
   4. 区块通栏、不圆角，靠表面色切换做分隔。
   5. 金额一律整数「分」，仅在展示层除 100。
   ══════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   1. 设计令牌
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* 表面 */
  --canvas:      #ffffff;   /* [已验证] */
  --parchment:   #f5f5f7;   /* [已验证] */
  --pearl:       #fafafc;   /* [待核对] */
  --ink:         #1d1d1f;   /* [已验证] */
  --hairline:    #e0e0e0;   /* [待核对] */
  --separator:   #d2d2d7;   /* [待核对] */
  --muted:       #6e6e73;   /* [待核对] 仅限次要文案，对比度 4.86:1 */

  /* 交互色 —— 单一强调色系统 */
  --link:        #0066cc;   /* [已验证] 文字链接 */
  --action:      #0071e3;   /* [冲突] 主按钮填充 / 焦点环 */
  --action-hover:#0077ed;
  --link-dark:   #2997ff;   /* [待核对] 深色底上的链接 */
  --on-action:   #ffffff;

  /* 字体：SF Pro 为 Apple 专有字体，不分发，走系统字体 */
  --font-text: "SF Pro Text", system-ui, -apple-system, "Inter",
               "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "SF Pro Display", system-ui, -apple-system, "Inter",
               "PingFang SC", "Microsoft YaHei", sans-serif;

  /* 间距（基准 8px） */
  --s-xs: 8px;  --s-sm: 12px; --s-md: 17px;
  --s-lg: 24px; --s-xl: 32px; --s-xxl: 48px; --s-section: 80px;

  /* 圆角 */
  --r-none: 0; --r-sm: 8px; --r-md: 11px; --r-lg: 18px; --r-pill: 9999px;

  /* 全站唯一投影，只给产品图 */
  --shadow-product: drop-shadow(3px 5px 30px rgba(0, 0, 0, 0.22));

  --z-nav: 100;
  --z-menu: 200;
}

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

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

body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;            /* 注意：17px 不是 16px */
  font-weight: 400;
  line-height: 1.47;
  letter-spacing: -0.374px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; }
h1 { font-size: 56px; line-height: 1.07; letter-spacing: -0.28px; }
h2 { font-size: 40px; line-height: 1.10; letter-spacing: 0; }
h3 { font-size: 21px; line-height: 1.19; letter-spacing: 0.231px; }

p { margin: 0; }
img { max-width: 100%; display: block; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 焦点环只做 outline，不要在这里改 border-radius——那会改写元素自身圆角 */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 3px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--canvas); color: var(--ink);
  padding: 12px 20px; z-index: 999;
}
.skip-link:focus { left: 0; }

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

.wrap { max-width: 1068px; margin: 0 auto; padding-inline: var(--s-lg); }
.wrap--wide { max-width: 1280px; }

/* ═══════════════════════════════════════════════════════════════
   3. 全局导航（44px 黑色通栏 + 全宽二级面板）
   ═══════════════════════════════════════════════════════════════ */
.globalnav {
  position: relative;
  background: #000;                 /* 全站唯一使用纯黑的地方 */
  color: #fff;
  height: 44px;
  z-index: var(--z-menu);
}
.globalnav__inner {
  max-width: 1068px; margin: 0 auto; padding-inline: var(--s-lg);
  height: 44px;
  display: flex; align-items: center; gap: var(--s-md);
}
.globalnav__brand {
  color: #fff; font-size: 14px; font-weight: 600; letter-spacing: 0.02em;
  white-space: nowrap;
}
.globalnav__brand:hover { text-decoration: none; opacity: .8; }

.globalnav__nav { display: flex; gap: var(--s-xs); }
.navitem { position: relative; }
.navitem__link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 10px;
  color: rgba(255,255,255,.86); font-size: 12px; letter-spacing: -0.12px;
}
.navitem__link:hover { color: #fff; text-decoration: none; }
.navitem__link[aria-expanded="true"]::after { transform: rotate(180deg); }
.navitem__link[aria-expanded]::after {
  content: ""; width: 0; height: 0;
  border-left: 3.5px solid transparent; border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform .2s ease;
}

.globalnav__right { margin-left: auto; display: flex; align-items: center; gap: var(--s-xs); }
.globalnav__auth {
  color: rgba(255,255,255,.86); font-size: 12px;
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px;
  white-space: nowrap;
}
.globalnav__auth:hover { color: #fff; text-decoration: none; }

/* 语言开关（由 i18n.js 注入，见 assets/js/i18n.js） */
.langswitch {
  display: inline-flex; align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--r-pill); padding: 1px; margin-right: 4px;
}
.langswitch button {
  min-width: 36px; min-height: 26px; padding: 0 8px;
  border: 0; background: transparent; cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0;
  border-radius: var(--r-pill);
  transition: background-color .2s ease-out, color .2s ease-out;
}
.langswitch button:hover { color: #fff; }
.langswitch button[aria-pressed="true"] { background: #fff; color: #000; }
/* 键盘可达性：焦点环在深色导航上必须可见 */
.langswitch button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

/* 全宽二级面板：白底 + 细线，不用投影（遵守"只有一个阴影"的纪律） */
.megapanel {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
}
.megapanel[hidden] { display: none; }
.megapanel__inner {
  max-width: 1068px; margin: 0 auto; padding: var(--s-xl) var(--s-lg) var(--s-xl);
  display: grid; gap: var(--s-xl);
  grid-template-columns: 2fr 1fr;
}
.megapanel h4 {
  font-size: 12px; font-weight: 600; color: var(--muted);
  letter-spacing: -0.12px; margin-bottom: var(--s-sm);
}
.megapanel ul { list-style: none; margin: 0; padding: 0; }
.megapanel__grid {
  display: grid; gap: 2px var(--s-lg);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.megapanel a {
  display: block; padding: 7px 0; font-size: 14px;
  color: var(--ink); letter-spacing: -0.224px;
}
.megapanel a:hover { color: var(--link); text-decoration: none; }

/* 二级导航：吸附 + 磨砂玻璃 */
.localnav {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: rgba(245, 245, 247, 0.8);   /* --parchment 的 80% */
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.localnav__inner {
  max-width: 1068px; margin: 0 auto; padding-inline: var(--s-lg);
  min-height: 52px;
  display: flex; align-items: center; gap: var(--s-lg); flex-wrap: wrap;
}
.localnav__title { font-size: 21px; font-weight: 600; letter-spacing: 0.231px; }
.localnav__links { display: flex; gap: var(--s-md); flex-wrap: wrap; }
.localnav__links a { font-size: 14px; letter-spacing: -0.224px; }
.localnav__right { margin-left: auto; display: flex; align-items: center; gap: var(--s-sm); }

/* ═══════════════════════════════════════════════════════════════
   4. 币种切换 / 购物袋
   ═══════════════════════════════════════════════════════════════ */
.currency {
  display: inline-flex; background: var(--canvas);
  border: 1px solid var(--separator); border-radius: var(--r-pill); padding: 2px;
}
.currency button {
  min-height: 32px; min-width: 56px;
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 14px; font-weight: 600; letter-spacing: 0;
  border-radius: var(--r-pill); cursor: pointer;
  transition: background-color .2s ease-out, color .2s ease-out;
}
.currency button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.bagbtn {
  position: relative;
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: 0; cursor: pointer;
  color: #fff; font: inherit; font-size: 14px; padding: 0 10px;
  border-radius: var(--r-pill);
}
.bagbtn:hover { background: rgba(255,255,255,.12); }
.bagbtn__count {
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: var(--r-pill); background: var(--action); color: #fff;
  font-size: 12px; font-weight: 600; line-height: 20px; text-align: center;
}
.bagbtn__count[hidden] { display: none; }
.bagbtn.is-pulse { animation: pulse .4s ease-out; }
@keyframes pulse {
  0% { transform: scale(1); } 45% { transform: scale(1.12); } 100% { transform: scale(1); }
}
/* 二级导航里的购物袋是深色文字 */
.localnav .bagbtn { color: var(--ink); }
.localnav .bagbtn:hover { background: rgba(0,0,0,.05); }

/* ═══════════════════════════════════════════════════════════════
   5. 区块骨架：通栏、不圆角、靠表面色切换做分隔
   ═══════════════════════════════════════════════════════════════ */
.section { padding-block: var(--s-section); border-radius: var(--r-none); }

/* 「被压下去」的滚动联动由 site.js 驱动（见 initSectionReveal）。
   缩放锚点必须在顶部：从下往上缩才像被推进去，从中心缩会变成两面同时退。 */
#main > .section,
#main > .carousel { transform-origin: top center; }
.section--parchment { background: var(--parchment); }
.section--light     { background: var(--canvas); }
.section--tight     { padding-block: var(--s-xxl); }

.section__head { margin-bottom: var(--s-xxl); }

/* ── 大标题飞入 ──
   注意方向：默认状态必须**完全可见**。.reveal-ready 只由 JS 添加，
   所以脚本加载失败时标题照常显示，不会被永久藏起来。
   已经在首屏的标题由 JS 打上 .reveal-instant，豁免过渡，避免闪一下。 */
.reveal-ready .section__head > * {
  opacity: 0;
  transform: translateY(30px);
}
.reveal-ready .section__head.is-in > * {
  opacity: 1;
  transform: none;
  transition: opacity .72s cubic-bezier(.16, 1, .3, 1),
              transform .72s cubic-bezier(.16, 1, .3, 1);
}
/* 副标题晚 120ms 出发，读起来有先后 */
.reveal-ready .section__head.is-in > *:nth-child(2) { transition-delay: .12s; }
/* 首屏内的标题直接落位，不做动画 */
.reveal-ready .section__head.is-in.reveal-instant > * { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal-ready .section__head > * { opacity: 1; transform: none; transition: none; }
}
.section__head h2 { max-width: 20ch; }
.section__head p {
  margin-top: var(--s-md); font-size: 21px; line-height: 1.4;
  color: var(--muted); max-width: 46ch;
}
.section__head--center { text-align: center; }
.section__head--center h2, .section__head--center p { margin-inline: auto; }

/* ═══════════════════════════════════════════════════════════════
   6. 首页轮播（4 张自动切换大海报）
   ═══════════════════════════════════════════════════════════════ */
.carousel { position: relative; background: var(--parchment); }

/* grid 叠放：容器高度 = 最高的一张，避免切换时页面跳动 */
.carousel__viewport { display: grid; }
.slide {
  grid-area: 1 / 1;
  opacity: 0; visibility: hidden;
  transition: opacity .55s ease, visibility .55s;
}
.slide.is-active { opacity: 1; visibility: visible; }
.slide__inner {
  max-width: 1068px; margin: 0 auto; padding: 72px var(--s-lg) 96px;
  display: grid; gap: var(--s-xl); align-items: center;
  grid-template-columns: 1fr 1fr;
}
.slide__eyebrow {
  display: inline-block; margin-bottom: var(--s-md);
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
/* 一个页面只能有一个 h1（页面标题，通常是 sr-only），
   所以轮播每张的标题用 h2 + .slide__title，视觉上按 hero 处理 */
.slide__body h1, .slide__title { font-size: 48px; line-height: 1.08; letter-spacing: -0.28px; }
.slide__body p {
  margin-top: var(--s-md); font-size: 21px; line-height: 1.45;
  color: var(--muted); max-width: 34ch;
}
.slide__cta { margin-top: var(--s-xl); display: flex; gap: var(--s-sm); flex-wrap: wrap; }
.slide__art { display: flex; align-items: center; justify-content: center; }
.slide__art svg { width: 100%; max-width: 340px; height: auto; }

/* 轮播控制条 */
.carousel__bar {
  position: absolute; left: 0; right: 0; bottom: 24px;
  display: flex; align-items: center; justify-content: center; gap: var(--s-md);
}
.dots { display: flex; gap: 4px; align-items: center; }

/* 圆点用 24×44 的按钮 + 居中的 ::after 画出来。
   不要用「小按钮 + 大 ::before」的写法——相邻圆点的伪元素会互相覆盖，
   导致点第 2 个圆点可能命中第 3 个。这里按钮本身互不重叠。 */
.dots button {
  position: relative;
  width: 24px; height: 44px; padding: 0;
  border: 0; background: transparent; cursor: pointer;
}
.dots button::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 9px; height: 9px; border-radius: var(--r-pill);
  background: var(--separator);
  transition: background-color .2s ease-out, width .2s ease-out;
}
.dots button[aria-selected="true"]::after { background: var(--ink); width: 22px; }

.carousel__toggle {
  width: 44px; height: 44px; border: 0; cursor: pointer;
  border-radius: var(--r-pill);
  background: rgba(210, 210, 215, 0.6);   /* --separator 的 ~60% */
  color: var(--ink); font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.carousel__toggle:hover { background: rgba(210, 210, 215, 0.9); }

/* ═══════════════════════════════════════════════════════════════
   7. 按钮：胶囊形状本身就是"可点击"的信号
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 11px 22px;
  border-radius: var(--r-pill);
  font-family: var(--font-text); font-size: 17px; font-weight: 400;
  line-height: 1; letter-spacing: 0;
  cursor: pointer; border: 1px solid transparent;
  transition: transform .2s ease-out, background-color .2s ease-out, color .2s ease-out;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.95); }
.btn--primary { background: var(--action); color: var(--on-action); }
.btn--primary:hover { background: var(--action-hover); }
.btn--ghost { background: transparent; color: var(--link); border-color: var(--link); }
.btn--ghost:hover { background: rgba(0, 102, 204, .06); }
.btn--quiet { background: var(--canvas); color: var(--ink); border-color: var(--separator); }
.btn--quiet:hover { background: var(--parchment); }
.btn--small { min-height: 36px; padding: 8px 16px; font-size: 14px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .42; cursor: not-allowed; }

.textlink { font-size: 17px; }
.textlink::after { content: " ›"; }

/* ═══════════════════════════════════════════════════════════════
   8. 横向滚动轨道（纯 CSS scroll-snap）
   ═══════════════════════════════════════════════════════════════ */
.railwrap { position: relative; }
.rail {
  list-style: none; margin: 0;
  padding: 12px 0 12px;   /* 左右必须为 0，让首卡与容器左边缘对齐。
                             上下 12px 是为了容纳悬浮放大后的溢出：
                             overflow-x:auto 会让 overflow-y 也变成 auto，
                             上下留白不够时，放大出来的部分会被裁掉或触发滚动条 */
  display: flex; gap: var(--s-lg);
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: 0 0 auto; scroll-snap-align: start; }
.rail[data-rail="chip"] > * { flex-basis: 200px; }
.rail[data-rail="card"] > * { flex-basis: 320px; }

.railnav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: var(--r-pill); border: 0; cursor: pointer;
  background: rgba(210, 210, 215, 0.72);
  backdrop-filter: blur(6px);
  color: var(--ink); font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.railnav:hover { background: rgba(210, 210, 215, 0.95); }
.railnav[data-dir="prev"] { left: -14px; }
.railnav[data-dir="next"] { right: -14px; }
.railnav:disabled { opacity: .32; cursor: default; }

/* 品类芯片 */
.chip {
  width: 100%; min-height: 108px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: var(--s-lg);
  color: var(--ink); text-align: center;
}
.chip:hover { text-decoration: none; border-color: var(--separator); }
.chip span { font-size: 14px; font-weight: 600; letter-spacing: -0.224px; }
.chip svg { width: 34px; height: 34px; }

/* ═══════════════════════════════════════════════════════════════
   9. 卡片
   ═══════════════════════════════════════════════════════════════ */
.card-product {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--s-lg);
  display: flex; flex-direction: column;
  position: relative;
  box-shadow: none;
}

/* ── 悬浮微放大 ──
   三个必须处理的细节，少一个就出问题：
   1. 只在真正有悬停能力的设备上生效。触屏上 :hover 会在点按后「粘住」，
      卡片一直保持放大状态，看起来像卡死了。
   2. 放大后要抬到相邻卡片之上（z-index），否则会被后一个卡片盖住一半。
   3. 不加阴影 —— 这套设计纪律是「卡片永远无阴影」，用缩放表达浮起就够了。
   用 1.02 而不是 1.05：22px 的放大在密集网格里已经能察觉，再大就显得跳。 */
@media (hover: hover) and (pointer: fine) {
  .card-product,
  .card-feature,
  .chip {
    transition: transform .22s cubic-bezier(.4, 0, .6, 1);
  }
  .card-product:hover,
  .card-feature:hover,
  .chip:hover {
    transform: scale(1.02);
    z-index: 2;
  }
  /* 按下时再稍微大一点，给点击一个明确的反馈 */
  .chip:active,
  .card-product:active,
  .card-feature:active {
    transform: scale(1.03);
  }
}
.card-product__figure {
  margin: 0 0 var(--s-lg);
  display: flex; align-items: center; justify-content: center;
  min-height: 132px;
  position: relative;          /* 实拍图叠放在插画之上 */
}
.card-product__figure svg { width: 100%; max-width: 200px; height: auto; }

/* ── 产品图位 ──
   实拍图绝对定位叠在插画之上：图片没加载出来时不显示破图图标，
   插画作为兜底继续占位，空间由插画撑开（img 上同时写了 width/height 防 CLS）。
   把照片放进 images/products/<商品 data-id>.jpg 就会自动生效。 */
.card-product__img,
.card-feature__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .25s ease-out;
  background: var(--canvas);
  border-radius: var(--r-sm);
}
.card-product__img.is-loaded,
.card-feature__img.is-loaded { opacity: 1; }
.card-product__figure img { width: 100%; height: 132px; object-fit: contain; }

.badge {
  display: inline-block; align-self: flex-start;
  background: var(--pearl); border: 1px solid var(--hairline);
  color: var(--ink);
  font-size: 12px; font-weight: 600; letter-spacing: -0.12px;
  padding: 3px 10px; border-radius: var(--r-md);
  margin-bottom: var(--s-sm);
}
.badge--ship {
  background: transparent; border-color: var(--separator); color: var(--muted);
  font-weight: 400;
}
.badge--soft { background: transparent; border-color: var(--separator); color: var(--muted); font-weight: 400; }

.card-product h3 { margin-bottom: 6px; }
.card-product__tag {
  color: var(--muted); font-size: 14px; line-height: 1.43;
  letter-spacing: -0.224px; margin-bottom: var(--s-md);
  flex: 1 1 auto;
}
.card-product__price { font-size: 17px; font-weight: 600; letter-spacing: -0.374px; }
.card-product__foot {
  margin-top: var(--s-md);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-sm);
}

.quick-add {
  width: 44px; height: 44px; flex: 0 0 auto;
  border-radius: var(--r-pill); border: 1px solid var(--separator);
  background: var(--canvas); color: var(--ink);
  font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease-out, background-color .2s ease-out;
}
.quick-add:hover { background: var(--parchment); }
.quick-add:active { transform: scale(0.95); }

.grid-products {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--s-lg);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* 大卡（新品区） */
.card-feature { width: 100%; display: flex; flex-direction: column; position: relative; }
.card-feature__media {
  flex: 0 0 auto;
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: var(--s-xl);
  display: flex; align-items: center; justify-content: center;
  min-height: 240px;
  position: relative;          /* 实拍图叠放基准 */
}
.card-feature__media svg { width: 100%; max-width: 240px; height: auto; }
.card-feature__media img { width: 100%; max-width: 240px; height: 176px; object-fit: contain; }
/* 卡片等高时让卖点文字吸收多余高度，价格与按钮贴底对齐 */
.card-feature__body {
  padding-top: var(--s-lg);
  display: flex; flex-direction: column; flex: 1 1 auto;
}
.card-feature__body h3 { font-size: 28px; font-weight: 600; letter-spacing: 0; margin-bottom: 6px; }
.card-feature__body p { color: var(--muted); font-size: 17px; margin-bottom: var(--s-md); flex: 1 1 auto; }
.card-feature__body .card-feature__price {
  color: var(--ink); flex: 0 0 auto;
  font-size: 21px; font-weight: 600; letter-spacing: 0.231px; margin-bottom: var(--s-md);
}
.card-feature__body .btn { align-self: flex-start; flex: 0 0 auto; }

/* 服务 / 卖点卡 */
.card-utility {
  list-style: none;
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: var(--s-lg);
  display: flex; flex-direction: column; gap: var(--s-sm);
  min-height: 100%;
}
.card-utility h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.374px; }
.card-utility p {
  color: var(--muted); font-size: 14px; line-height: 1.5;
  letter-spacing: -0.224px; flex: 1 1 auto;
}
.card-utility svg { width: 30px; height: 30px; }

.grid-services {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--s-lg);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-services--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-services--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ═══════════════════════════════════════════════════════════════
   10. 插画（内联 SVG 通过 class 继承令牌）
   ═══════════════════════════════════════════════════════════════ */
.ill { filter: var(--shadow-product); }   /* 全站唯一的投影 */
.ill-base { fill: var(--canvas); stroke: var(--separator); stroke-width: 1.5; }
.ill-soft { fill: var(--parchment); stroke: var(--separator); stroke-width: 1.5; }
.ill-mid  { fill: var(--separator); }
.ill-dark { fill: var(--ink); }
.ill-line { fill: none; stroke: var(--separator); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ill-accent { fill: var(--action); }
.ill-ground { fill: var(--separator); opacity: .5; }
.ill-icon { width: 30px; height: 30px; }
.ill-icon--sm { width: 22px; height: 22px; }

/* ═══════════════════════════════════════════════════════════════
   11. 子页面：面包屑与页头
   ═══════════════════════════════════════════════════════════════ */
.breadcrumb {
  max-width: 1068px; margin: 0 auto; padding: var(--s-md) var(--s-lg) 0;
  font-size: 12px; color: var(--muted); letter-spacing: -0.12px;
}
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--separator); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--ink); }

.pagehead {
  max-width: 1068px; margin: 0 auto;
  padding: var(--s-xl) var(--s-lg) var(--s-md);
}
.pagehead h1 { font-size: 48px; line-height: 1.08; letter-spacing: -0.28px; }
.pagehead p { margin-top: var(--s-md); font-size: 21px; line-height: 1.45; color: var(--muted); max-width: 46ch; }

/* ═══════════════════════════════════════════════════════════════
   12. 表单（登录 / 注册 / 发布）
   ═══════════════════════════════════════════════════════════════ */
.formcard {
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: var(--s-xl);
}
.field { margin-bottom: var(--s-lg); }
.field label {
  display: block; font-size: 14px; font-weight: 600;
  letter-spacing: -0.224px; margin-bottom: 6px;
}
.field .hint { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.input, .textarea, .select {
  width: 100%; min-height: 44px; padding: 11px 14px;
  border: 1px solid var(--separator); border-radius: var(--r-sm);
  font-family: var(--font-text); font-size: 17px; color: var(--ink);
  background: var(--canvas); letter-spacing: -0.374px;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--action); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: #c0392b; }

.formrow { display: grid; gap: var(--s-md); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-note { font-size: 12px; line-height: 1.5; color: var(--muted); }
.form-error {
  display: block; margin-top: 6px; font-size: 12px; color: #c0392b;
}
.form-error[hidden] { display: none; }

.notice {
  border: 1px solid var(--hairline); background: var(--parchment);
  border-radius: var(--r-md); padding: 14px 18px;
  font-size: 14px; line-height: 1.55; color: var(--ink);
}
.notice strong { font-weight: 600; }
.notice--accent { border-left: 3px solid var(--action); }

/* 登录 / 注册切换 */
.tabs {
  display: inline-flex; background: var(--parchment);
  border-radius: var(--r-pill); padding: 3px; margin-bottom: var(--s-xl);
}
.tabs button {
  min-height: 38px; padding: 0 20px; border: 0; background: transparent;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--muted);
  border-radius: var(--r-pill); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--canvas); color: var(--ink); }
.tabpanel[hidden] { display: none; }

/* ═══════════════════════════════════════════════════════════════
   13. 宠物社区（用户发布）
   ═══════════════════════════════════════════════════════════════ */
.postgrid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--s-lg);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.post-card {
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column;
}
.post-card__media {
  aspect-ratio: 4 / 3; background: var(--parchment);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__media svg { width: 72px; height: 72px; }
.post-card__body { padding: var(--s-lg); display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; }
.post-card__name { font-size: 17px; font-weight: 600; letter-spacing: -0.374px; }
.post-card__meta { font-size: 12px; color: var(--muted); }
.post-card__caption { font-size: 14px; line-height: 1.5; color: var(--ink); flex: 1 1 auto; }
.post-card__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-sm); margin-top: var(--s-sm); }

.empty {
  border: 1px dashed var(--separator); border-radius: var(--r-lg);
  padding: var(--s-xxl) var(--s-lg); text-align: center; color: var(--muted);
}

/* ═══════════════════════════════════════════════════════════════
   14. 文章排版
   ═══════════════════════════════════════════════════════════════ */
.article { max-width: 680px; margin: 0 auto; padding: 0 var(--s-lg) var(--s-section); }
.article__meta { font-size: 14px; color: var(--muted); margin-bottom: var(--s-lg); }
.article h2 { font-size: 28px; line-height: 1.25; margin: 40px 0 12px; }
.article h3 { font-size: 21px; margin: 28px 0 10px; }
.article p { margin-bottom: 18px; line-height: 1.72; }
.article ul, .article ol { margin: 0 0 18px; padding-left: 22px; }
.article li { margin-bottom: 8px; line-height: 1.72; }
.article__notice {
  background: var(--parchment); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 14px 18px; margin-bottom: var(--s-xl);
  font-size: 14px; line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════════════
   15. 页脚（全站留白最大，唯独这里密到极限）
   ═══════════════════════════════════════════════════════════════ */
.footer {
  background: var(--canvas);
  border-top: 1px solid var(--hairline);
  padding-block: 48px 64px;
  font-size: 12px; line-height: 1.5; color: var(--muted);
  letter-spacing: -0.12px;
}
.footer__notes { padding-bottom: var(--s-lg); border-bottom: 1px solid var(--hairline); }
.footer__notes ol { margin: 0; padding-left: 18px; }
.footer__notes li { margin-bottom: 10px; max-width: 90ch; }

.footer__dirs {
  display: grid; gap: var(--s-lg); padding-block: var(--s-xl);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--hairline);
}
.footer__col h4 {
  margin: 0 0 var(--s-sm); font-size: 12px; font-weight: 600;
  color: var(--ink); letter-spacing: -0.12px;
}
.footer__col ul { list-style: none; margin: 0; padding: 0; }
.footer__col li { margin-bottom: 9px; }
.footer__col a { color: var(--muted); }
.footer__col a:hover { color: var(--ink); }

.footer__legal { padding-top: var(--s-lg); display: flex; flex-wrap: wrap; gap: var(--s-md) var(--s-lg); }
.footer__legal a { color: var(--muted); }
.footer__compliance { padding-top: var(--s-sm); display: flex; flex-wrap: wrap; gap: var(--s-md); }
.footer__demo {
  margin-top: var(--s-md); padding: 10px 14px;
  background: var(--parchment); border: 1px solid var(--hairline);
  border-radius: var(--r-md); color: var(--ink); max-width: 90ch;
}

/* ═══════════════════════════════════════════════════════════════
   16. 清单弹层
   ═══════════════════════════════════════════════════════════════ */
dialog.bag {
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 0; width: min(520px, calc(100vw - 32px));
  background: var(--canvas); color: var(--ink);
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
}
dialog.bag::backdrop { background: rgba(0,0,0,.42); }
.bag__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-lg); border-bottom: 1px solid var(--hairline);
}
.bag__head h2 { font-size: 21px; letter-spacing: 0.231px; }
.bag__close {
  width: 44px; height: 44px; border: 0; background: transparent;
  border-radius: var(--r-pill); cursor: pointer; font-size: 20px; color: var(--ink);
}
.bag__close:hover { background: var(--parchment); }
.bag__body { padding: var(--s-lg); max-height: 46vh; overflow-y: auto; }
.bag__empty { color: var(--muted); }
.bag__line {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-md); padding-block: 10px;
  border-bottom: 1px solid var(--hairline);
}
.bag__line:last-child { border-bottom: 0; }
.bag__line span:first-child { flex: 1 1 auto; }
.bag__line .qty { color: var(--muted); font-size: 14px; }
.bag__foot { padding: var(--s-lg); border-top: 1px solid var(--hairline); }
.bag__total {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 21px; font-weight: 600; letter-spacing: 0.231px;
  margin-bottom: var(--s-sm);
}
.bag__hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin-bottom: var(--s-md); }
.bag__actions { display: flex; gap: var(--s-sm); flex-wrap: wrap; }
.lineitem__remove {
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 12px; cursor: pointer; padding: 4px 6px;
  border-radius: var(--r-sm);
}
.lineitem__remove:hover { color: var(--ink); background: var(--parchment); }

/* ═══════════════════════════════════════════════════════════════
   17. 响应式（断点取自 apple.com.cn 实测值：1068 / 833 / 734）
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1068px) {
  .grid-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-services--four { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .postgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 48px; }
  .slide__body h1, .slide__title { font-size: 40px; }
  .pagehead h1 { font-size: 40px; }
}
@media (max-width: 833px) {
  .grid-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-services, .grid-services--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__dirs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .globalnav__nav { display: none; }          /* 桌面导航收起，移动端用页面内导航 */
  .megapanel { display: none !important; }
  .railnav[data-dir="prev"] { left: -6px; }
  .railnav[data-dir="next"] { right: -6px; }
  .section { padding-block: 64px; }
  h2 { font-size: 34px; }
  .slide__inner { grid-template-columns: 1fr; padding: 48px var(--s-lg) 88px; }
  .slide__art { order: -1; }
  .slide__art svg { max-width: 240px; }
  .megapanel__inner { grid-template-columns: 1fr; }
}
@media (max-width: 734px) {
  .grid-products { grid-template-columns: 1fr; }
  .grid-services, .grid-services--four { grid-template-columns: 1fr; }
  .postgrid { grid-template-columns: 1fr; }
  .formrow { grid-template-columns: 1fr; }
  h1 { font-size: 34px; }
  .slide__body h1, .slide__title { font-size: 34px; }
  .pagehead h1 { font-size: 34px; }
  .pagehead p { font-size: 17px; }
  .rail[data-rail="card"] > * { flex-basis: 78vw; }
  .railnav { display: none; }
  .section { padding-block: 48px; }
  .section__head { margin-bottom: var(--s-xl); }
  .section__head p { font-size: 17px; }
  .carousel__bar { bottom: 16px; }
}

/* 尊重系统"减少动态效果"设置 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  /* 只掐掉过渡时长还不够——缩放本身仍会瞬间跳一下。
     这里直接把变换也取消，让动效敏感的用户完全看不到位移。 */
  .card-product:hover,
  .card-feature:hover,
  .chip:hover,
  .chip:active,
  .card-product:active,
  .card-feature:active { transform: none !important; }
}

/* 打印：去掉装饰，保留内容 */
@media print {
  .globalnav, .localnav, .carousel__bar, .footer__legal, dialog { display: none !important; }
  .slide { position: static; opacity: 1; visibility: visible; }
}


/* ═══════════════════════════════════════════════════════════════
   18. 商品详情页
   ═══════════════════════════════════════════════════════════════ */
.product-hero {
  display: grid; gap: var(--s-xl);
  grid-template-columns: 1fr 1fr; align-items: center;
}
.product-hero__figure {
  margin: 0; min-height: 300px;
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: var(--s-xl);
}
.product-hero__figure svg { max-width: 300px; }
.product-hero__title { font-size: 40px; line-height: 1.1; margin: 12px 0 8px; }
.product-hero__tag { font-size: 21px; line-height: 1.4; color: var(--muted); margin-bottom: var(--s-lg); }
.product-hero__price { font-size: 28px; font-weight: 600; letter-spacing: 0; margin-bottom: var(--s-lg); }
.product-hero__cta { display: flex; gap: var(--s-sm); flex-wrap: wrap; }

.h2-sm { font-size: 28px; line-height: 1.2; letter-spacing: -0.28px; }
.h3-sm { font-size: 17px; font-weight: 600; letter-spacing: -0.374px; margin-bottom: 6px; }
.body-lg { font-size: 21px; line-height: 1.5; color: var(--ink); }

.plainlist { list-style: none; margin: 0; padding: 0; }
.plainlist li {
  font-size: 14px; line-height: 1.5; color: var(--muted);
  padding-left: 18px; position: relative; margin-bottom: 8px;
}
.plainlist li::before {
  content: ""; position: absolute; left: 4px; top: 8px;
  width: 5px; height: 5px; border-radius: var(--r-pill); background: var(--separator);
}

.spectable {
  width: 100%; border-collapse: collapse; margin-top: 24px;
  font-size: 14px; letter-spacing: -0.224px;
}
.spectable th, .spectable td {
  text-align: left; padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}
.spectable th { font-weight: 600; width: 40%; color: var(--ink); }
.spectable td { color: var(--muted); }

/* 商品卡标题链接：去掉默认蓝色下划线，保持卡片观感 */
.card-product h3 a, .card-feature__body h3 a { color: var(--ink); }
.card-product h3 a:hover, .card-feature__body h3 a:hover { color: var(--link); text-decoration: none; }

@media (max-width: 833px) {
  .product-hero { grid-template-columns: 1fr; }
  .product-hero__title { font-size: 34px; }
  .product-hero__figure { min-height: 220px; }
}