/* ==========================================================================
   NORTHWIND Storefront — Global Stylesheet
   设计取向：海外 DTC 服饰品牌的通用语言——大留白、克制配色、衬线标题、
   稳定的纵向节奏。所有间距走 4px 栅格，所有颜色走变量，方便整体换肤。
   ========================================================================== */

/* --- 1. Tokens ----------------------------------------------------------- */

:root {
  --ink:        #171717;
  --ink-2:      #3C3C3C;
  --muted:      #767676;
  --muted-2:    #9A9A9A;

  --line:       #E4E4E2;
  --line-2:     #CFCECC;

  --bg:         #FFFFFF;
  --bg-soft:    #F7F7F6;
  --bg-soft-2:  #F0F0EF;

  --accent:     #2E2E2C;
  --accent-2:   #171716;
  --accent-bg:  #F2F2F1;

  --success:    #2F6B4F;
  --success-bg: #E9F2EC;
  --danger:     #B23A2E;
  --danger-bg:  #FBEEEC;

  /* 字体 = 设备默认：system-ui 优先，老内核回退到各平台系统字体 */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-sans);

  --radius:     2px;
  --radius-lg:  6px;

  --header-h:   68px;
  --gap:        24px;

  --shadow-sm:  0 1px 2px rgba(23, 23, 22, .06);
  --shadow-md:  0 8px 28px rgba(23, 23, 22, .12);
}

/* --- 2. Reset ------------------------------------------------------------ */

*, *::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: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.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;
}

/* --- 3. Layout ----------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}

.wrap--narrow { max-width: 880px; }
.wrap--xs     { max-width: 640px; }

.section      { padding: 72px 0; }
.section--tight { padding: 44px 0; }
.section--soft  { background: var(--bg-soft); }

.grid-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 40px 24px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}
.split > * { min-width: 0; }   /* 防 grid 项内容（如固定宽主图）撑破列 */

.stack   { display: grid; gap: 16px; }
.stack-s { display: grid; gap: 8px; }
.row     { display: flex; align-items: center; gap: 12px; }
.row-b   { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spacer  { flex: 1; }

/* --- 4. Typography ------------------------------------------------------- */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.01em;
}

.h1 { font-size: 40px; font-size: clamp(30px, 4.4vw, 52px); }
.h2 { font-size: 30px; font-size: clamp(24px, 2.8vw, 34px); }
.h3 { font-size: 20px; font-size: clamp(19px, 1.8vw, 23px); }

.eyebrow {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede   { font-size: 17px; color: var(--ink-2); line-height: 1.65; }
.muted  { color: var(--muted); }
.small  { font-size: 13px; }
.tiny   { font-size: 12px; }

.prose { max-width: 72ch; }
.prose p { margin-bottom: 16px; color: var(--ink-2); }
.prose h2 { font-size: 20px; margin: 32px 0 12px; }
.prose h3 { font-size: 17px; margin: 24px 0 8px; }
.prose ul { list-style: disc; padding-left: 20px; margin-bottom: 16px; }
.prose li { margin-bottom: 6px; color: var(--ink-2); }

/* --- 5. Buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  letter-spacing: .02em;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}
.btn--ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

.btn--accent { background: var(--accent); border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-2); border-color: var(--accent-2); }

.btn--block { width: 100%; }
.btn--sm    { padding: 9px 16px; font-size: 13px; }

.link {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.link:hover { color: var(--accent); }

/* --- 6. Forms ------------------------------------------------------------ */

.field { display: grid; gap: 6px; }

.label {
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: .01em;
}

.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-size: 15px;
  transition: border-color .15s ease;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.textarea { min-height: 120px; resize: vertical; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' fill='none' stroke='%23767676' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.field-error .input,
.field-error .select,
.field-error .textarea { border-color: var(--danger); }

.err-msg { font-size: 12px; color: var(--danger); }

.checkline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--ink-2);
}
.checkline input { margin-top: 3px; accent-color: var(--accent); }

/* --- 7. Header ----------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.announce {
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  letter-spacing: .06em;
  text-align: center;
  padding: 8px 16px;
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header-h);
}

.brand {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: .18em;
  white-space: nowrap;
}

/* 后台可配 LOGO 图（路径/外链/上传）：固定高度，宽随比例 */
.brand-logo {
  height: 30px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}

/* 导航占剩余空间，允许收缩；空间不足时压缩词间距而不是折行错位 */
.nav { display: flex; gap: 26px; flex: 1 1 auto; min-width: 0; justify-content: center; }
.nav a {
  font-size: 14px;
  color: var(--ink-2);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
  white-space: nowrap;           /* 单链接禁止内部折行 */
}
.nav a:hover, .nav a.is-active { color: var(--ink); border-color: var(--ink); }

.header-tools { display: flex; align-items: stretch; gap: 18px; margin-left: auto; flex: 0 1 auto; min-width: 0; align-self: stretch; }
/* 工具栏整体拉伸到工具栏高度（供会员中心面板定位），搜索/语言自身保持居中 */
.header-tools .search,
.header-tools .lang-switch { align-self: center; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 6px;
  font-size: 14px;
  color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); }

.cart-count {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  line-height: 19px;
  text-align: center;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line-2);
  padding: 4px 0;
  min-width: 170px;
}
.search input {
  border: 0;
  background: none;
  padding: 0;
  font-size: 14px;
  width: 100%;
}
.search input:focus { outline: none; }

.nav-toggle { display: none; background: none; border: 0; padding: 8px; }

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  padding: 12px 0 20px;
}
.mobile-nav.is-open { display: block; }
.mobile-nav a { display: block; padding: 10px 0; font-size: 15px; }
/* 移动端搜索（顶栏搜索框 ≤1024px 隐藏，入口放在菜单顶部） */
.mobile-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg-soft);
}
.mobile-search svg { flex: none; color: var(--muted); }
.mobile-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}

/* --- 7b. 顶栏会员中心（右侧单一入口 + 悬停下拉，参考站交互） --------------- */

.acct-menu {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.acct-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--ink-2);
  padding: 8px 2px;
}
.acct-btn:hover { color: var(--ink); }

.acct-panel {
  position: absolute;
  top: 100%;
  right: -8px;
  z-index: 70;
  min-width: 232px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  /* 淡出：opacity/transform 过渡，visibility 延迟到动画结束 */
  transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
.acct-menu:hover .acct-panel,
.acct-menu:focus-within .acct-panel,
.acct-menu.is-open .acct-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .22s ease, transform .22s ease;
}

.acct-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  background: none;
  border: 0;
  text-align: left;
  border-radius: var(--radius);
}
.acct-item svg { color: var(--ink-2); flex: 0 0 auto; }
.acct-item:hover { background: var(--bg-soft); }
.acct-item:hover svg { color: var(--accent); }
.acct-item[hidden] { display: none; }
.acct-item strong { font-weight: 600; }
.acct-item .cart-count { margin-left: auto; }

/* --- 8. Product card ----------------------------------------------------- */

.card { display: block; }

.card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-soft);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .6, .2, 1);
}

.card:hover .card-media img { transform: scale(1.04); }

.card-body { padding: 14px 0 0; display: grid; gap: 5px; }
.card-title { font-size: 15px; }
.card-meta  { font-size: 13px; color: var(--muted); }

.price { font-size: 15px; font-variant-numeric: tabular-nums; }
.price--lg { font-size: 22px; }
.price s { color: var(--muted-2); margin-left: 8px; font-size: .9em; }

.tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  letter-spacing: .08em;
  padding: 4px 9px;
  text-transform: uppercase;
}
.tag--accent { background: var(--accent); }
.tag--out    { background: var(--muted); }

/* --- 9. Product detail --------------------------------------------------- */

.gallery {
  display: grid;
  gap: 12px;
  justify-items: start;
  /* 列宽锁定为容器宽：防止缩略图条（固定 450px）在窄屏把隐式列撑破，
     导致主图 max-width:100% 跟着超宽、整页横向溢出（真机 375px 复现） */
  grid-template-columns: minmax(0, 1fr);
}

/* 主图框固定 450×600（3:4），上传图 contain 自适应居中；点击弹大图 */
.gallery-main {
  position: relative;
  width: 500px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  overflow: hidden;
  cursor: zoom-in;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
/* 无 src 的主图隐藏（全站隐藏默认图时留白），JS 换上图后显示 */
.gallery-main img:not([src]) { visibility: hidden; }
.gallery-main img[data-main-img] { opacity: 0; }
.gallery-main img[data-main-img].has-src { opacity: 1; transition: opacity .14s ease; }
/* 商品卡 / 购物车行：无图占位 */
.card-media .media-ph, .cart-item-media .media-ph {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: var(--bg-soft);
}

/* 主图大图灯箱 */
.lightbox {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 200;
  background: rgba(20, 20, 19, .82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility 0s linear .22s;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .22s ease;
}
.lightbox img {
  max-width: 92vw; max-width: min(92vw, 750px);
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.lightbox-close:hover { background: #fff; }

/* 灯箱左右切换箭头 + 序号（仅多图时显示） */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: .85;
  transition: background .15s ease, opacity .22s ease;
}
.lightbox:hover .lightbox-nav,
.lightbox-nav:focus-visible { opacity: 1; }
.lightbox-nav:hover { background: rgba(255, 255, 255, .32); }
.lightbox.has-multi .lightbox-nav { display: flex; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .9);
  font-size: 12.5px;
  letter-spacing: .08em;
  background: rgba(20, 20, 19, .45);
  border-radius: 999px;
  padding: 3px 14px;
  display: none;
  pointer-events: none;
}
.lightbox.has-multi .lightbox-counter { display: block; }

/* 主图两侧切换按钮（悬停浮现） */
.gal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s ease, background .2s ease;
  z-index: 2;
}
.gal-arrow--prev { left: 12px; }
.gal-arrow--next { right: 12px; }
.gal-arrow[hidden] { display: none; }   /* 画廊 ≤1 张图时隐藏箭头 */
.gallery-main:hover .gal-arrow,
.gal-arrow:focus-visible { opacity: 1; }
.gal-arrow:hover { background: #FFFFFF; }

.gallery-thumbs {
  display: flex;
  width: 100%;
  max-width: 450px;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.gallery-thumbs::-webkit-scrollbar { height: 4px; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 2px; }
.gallery-thumbs button {
  flex: 0 0 96px;
  aspect-ratio: 1 / 1;
  scroll-snap-align: start;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  overflow: hidden;
}
.gallery-thumbs button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-thumbs button.is-active { border-color: var(--ink); }
.gallery-thumbs button.is-active { border-color: var(--ink); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

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

.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  padding: 0;
  position: relative;
  background-size: cover;
}
.swatch.is-active { box-shadow: 0 0 0 2px var(--ink); border-color: transparent; }
.swatch.is-disabled { opacity: .35; cursor: not-allowed; }

.sizes { display: flex; gap: 8px; flex-wrap: wrap; }

.size-opt {
  min-width: 54px;
  padding: 11px 12px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 14px;
  text-align: center;
  position: relative;
}
.size-opt:hover:not(.is-disabled) { border-color: var(--ink); }
.size-opt.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.size-opt.is-disabled { color: var(--muted-2); cursor: not-allowed; }
.size-opt.is-disabled::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(to top right,
    transparent calc(50% - 1px), var(--line-2) 50%,
    transparent calc(50% + 1px));
}

.accordion { border-top: 1px solid var(--line); }
.accordion-item { border-bottom: 1px solid var(--line); }
.accordion-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  background: none;
  border: 0;
  text-align: left;
  font-size: 15px;
}
.accordion-body { display: none; padding: 0 0 18px; color: var(--ink-2); font-size: 14px; }
.accordion-item.is-open .accordion-body { display: block; }
.accordion-head .plus { font-size: 18px; color: var(--muted); line-height: 1; }

.stars { color: var(--accent); letter-spacing: 2px; font-size: 14px; }

.review { border-bottom: 1px solid var(--line); padding: 18px 0; }
.review:last-child { border-bottom: 0; }

/* --- 10. Filters --------------------------------------------------------- */

.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.chip {
  padding: 8px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg);
  font-size: 13px;
}
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 0 28px;
}

/* --- 11. Cart ------------------------------------------------------------ */

.cart-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item-media {
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  overflow: hidden;
}
.cart-item-media img { width: 100%; height: 100%; object-fit: cover; }

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
}
.qty button {
  width: 34px;
  height: 34px;
  background: none;
  border: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--ink-2);
}
.qty button:hover { background: var(--bg-soft); }
.qty span {
  min-width: 34px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.summary {
  background: var(--bg-soft);
  padding: 28px;
  border-radius: var(--radius-lg);
  position: sticky;
  top: calc(var(--header-h) + 20px);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  font-size: 14px;
}
.summary-row--total {
  border-top: 1px solid var(--line-2);
  margin-top: 10px;
  padding-top: 14px;
  font-size: 17px;
}

.coupon { display: flex; gap: 8px; }
.coupon .input { flex: 1; }

.notice {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--bg-soft-2);
  color: var(--ink-2);
}
.notice--success { background: var(--success-bg); color: var(--success); }
.notice--danger  { background: var(--danger-bg);  color: var(--danger); }

/* --- 12. Checkout -------------------------------------------------------- */

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 64px;
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-grid .span-2 { grid-column: 1 / -1; }

.pay-method {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  margin-bottom: 12px;
}
.pay-method.is-active { border-color: var(--ink); }
.pay-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 16px;
  background: none;
  border: 0;
  text-align: left;
}
.pay-head input { accent-color: var(--accent); }
.pay-body {
  display: none;
  padding: 4px 16px 18px 40px;
  border-top: 1px solid var(--line);
}
.pay-method.is-active .pay-body { display: block; }

.trust-list { display: grid; gap: 10px; font-size: 13px; color: var(--ink-2); }
.trust-list li { display: flex; gap: 9px; align-items: flex-start; }
.trust-list li::before {
  content: "";
  width: 5px; height: 5px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* --- 13. Editorial blocks ------------------------------------------------ */

/* --- 全屏滑动轮播 Hero ---------------------------------------------------- */

.hero-slider {
  position: relative;
  height: 750px;
  overflow: hidden;
  background: var(--bg-soft-2);
}
.hero-track { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.hero-slide {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .7s ease, visibility .7s;
}
.hero-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.hero-img {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Ken Burns 缓推：非激活态放大 1.06，激活后用 animation（而非 transition）
     缓慢缩回 1——animation 在每次 is-active 挂上时都会重放，首屏也有运镜 */
  transform: scale(1.06);
  will-change: transform;
}
.hero-slide.is-active .hero-img { animation: heroZoom 6.5s ease-out forwards; }
@keyframes heroZoom {
  from { transform: scale(1.06); }
  to { transform: scale(1); }
}
/* 文案统一锚定画面垂直居中：三个幻灯片同一位置 */
.hero-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  color: var(--ink);
}
/* 轮播文案支持换行：词条里的换行符（后台词典编辑 / Excel 多行单元格）照实渲染 */
.hero-content .eyebrow,
.hero-content .display,
.hero-content .lede { white-space: pre-line; }
.hero-content .display { color: var(--ink); margin: 0; }
.hero-content .lede { color: rgba(26, 26, 25, .78); max-width: 540px; margin: 0; }
.eyebrow--light { color: rgba(26, 26, 25, .62); }
.hero-content .row { margin-top: 10px; }
/* 文案入场动效 */
.hero-slide .hero-content > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
}
.hero-slide.is-active .hero-content > * { opacity: 1; transform: translateY(0); }
.hero-slide.is-active .hero-content > *:nth-child(2) { transition-delay: .08s; }
.hero-slide.is-active .hero-content > *:nth-child(3) { transition-delay: .16s; }
.hero-slide.is-active .hero-content > *:nth-child(4) { transition-delay: .24s; }

/* 主按钮：浅色图上用深墨底白字，保持强对比 */
.btn--hero { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.btn--hero:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn--hero-ghost {
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(26, 26, 25, .45);
  color: var(--ink);
}
.btn--hero-ghost:hover { background: #FFFFFF; border-color: var(--ink); }

/* 左右箭头 */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .16);
  color: #FFFFFF;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  opacity: .8;
  transition: opacity .2s ease, background .2s ease;
}
.hero-arrow:hover { opacity: 1; background: rgba(255, 255, 255, .3); }
.hero-arrow:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; opacity: 1; }
.hero-arrow--prev { left: 20px; }
.hero-arrow--next { right: 20px; }

/* 圆点指示器 */
.hero-dots {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 10px;
}
.hero-dot {
  width: 26px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, .4);
  cursor: pointer;
  transition: background .25s ease, width .25s ease;
}
.hero-dot.is-active { background: #FFFFFF; width: 42px; }
.hero-dot:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 3px; }

/* 轮播切换动画（淡入淡出 + Ken Burns + 文案上浮）刻意不受「减少动效」影响：
   站主明确要求保留切换动画；淡入淡出属温和动效，不影响内容可读性。 */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.tile {
  padding: 34px 28px;
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
}
.tile h3 { font-size: 17px; margin-bottom: 8px; }

/* 首页分类卡独立背景（后台商店信息按品类上传）：cover 铺满、不加遮罩、文字保持原色 */
.tile.has-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
}
.value h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 8px;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  padding: 24px 0;
}
.breadcrumb a:hover { color: var(--ink); }

.page-head { padding: 20px 0 14px; }

.empty {
  text-align: center;
  padding: 80px 0;
  display: grid;
  gap: 16px;
  justify-items: center;
}

/* --- 14. Footer ---------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: #C6C6C4;
  padding: 64px 0 32px;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(140px, 1fr));
  gap: 40px;
}
.footer-grid h4 {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 16px;
  font-weight: 500;
}
.footer-grid a { font-size: 14px; color: #C6C6C4; }
.footer-grid a:hover { color: #fff; }
.footer-grid li { margin-bottom: 9px; }
.footer-brand {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: .18em;
  color: #fff;
  margin-bottom: 14px;
}

.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}

.social { display: flex; gap: 10px; margin-top: 18px; }
.social a {
  width: 34px; height: 34px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
}
.social a:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* --- 15. Floating widgets ------------------------------------------------ */

/* 保险：hidden 属性优先于任何板块级 display 规则（页面板块设置靠它裁剪） */
[hidden] { display: none !important; }

.fab-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  display: grid;
  gap: 10px;
  justify-items: end;}

/* 位置约束切换（首页轮播约束 / Cookie 条避让）时平滑移动 */
@media (prefers-reduced-motion: no-preference) {
  .fab-stack { transition: bottom .25s ease; }
}

.fab {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  position: relative;
}
.fab:hover { background: var(--bg-soft); }
.fab--wa { background: #25D366; border-color: #25D366; color: #fff; }
.fab--wa:hover { background: #1EBE57; }

.fab-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
}

.chat-panel {
  width: 340px;
  max-height: 480px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.chat-panel.is-open { display: flex; }

.chat-head {
  background: var(--ink);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.chat-head strong { font-weight: 500; font-size: 15px; }
.chat-head .tiny { color: #B8B8B6; }
.chat-close { background: none; border: 0; color: #fff; font-size: 20px; line-height: 1; padding: 0 2px; }

.chat-body {
  padding: 16px;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  background: var(--bg-soft);
  flex: 1;
}

.bubble {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.bubble--bot {
  background: var(--bg);
  border: 1px solid var(--line);
  border-bottom-left-radius: 3px;
}
.bubble--me {
  background: var(--accent);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 3px;
}

.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-quick button {
  border: 1px solid var(--line-2);
  background: var(--bg);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
}
.chat-quick button:hover { border-color: var(--ink); }

.chat-foot { padding: 12px; border-top: 1px solid var(--line); display: grid; gap: 10px; }

.cookie-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 80;
  background: var(--ink);
  color: #D6D6D4;
  padding: 16px 0;
  display: none;
}
.cookie-bar.is-open { display: block; }
.cookie-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.cookie-inner p { font-size: 13px; flex: 1; min-width: 240px; }
.cookie-actions { display: flex; gap: 10px; }

.btn--light {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
  padding: 10px 20px;
  font-size: 13px;
}
.btn--light:hover { background: var(--bg-soft-2); border-color: var(--bg-soft-2); }
.btn--outline-light {
  background: transparent;
  border-color: rgba(255, 255, 255, .4);
  color: #fff;
  padding: 10px 20px;
  font-size: 13px;
}
.btn--outline-light:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }

/* --- 16. Toast ----------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(14px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- 17. Responsive ------------------------------------------------------ */

@media (max-width: 1024px) {
  .split, .checkout-layout, .hero-grid { gap: 40px; }
  .nav, .search { display: none; }
  .nav-toggle { display: block; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .split, .checkout-layout, .hero-grid { grid-template-columns: minmax(0, 1fr); }
  /* 移动端主图：跟随屏宽 1:1 等比缩放 */
  .gallery-main { width: 100%; height: auto; aspect-ratio: 1 / 1; }
  /* 灯箱小屏内边距收紧 */
  .lightbox { padding: 16px; }
  /* 移动端顶栏压缩：品牌缩小、语言选择器收窄、会员按钮只留图标，
     防止顶栏总宽超出屏幕（会员中心竖排/溢出的根因） */
  .brand { font-size: 16px; letter-spacing: .12em; }
  .lang-select { width: 68px; padding: 7px 22px 7px 8px; }
  .acct-btn { padding: 8px; }
  .acct-btn span { display: none; }
  .no-flexgap .header-bar > * { margin-left: 12px; }
  .no-flexgap .header-tools > * { margin-left: 10px; }
  /* hero 轮播在移动端保持全屏，无额外内边距 */
  /* 移动端轮播高度：跟随屏幕高度自适应（桌面保持 750px 固定），
     避免 750px 固定高在窄屏把宽幅图裁得只剩中间一条 */
  .hero-slider { height: 72vh; min-height: 440px; }
  .hero-arrow { width: 38px; height: 38px; }
  .hero-arrow--prev { left: 10px; }
  .hero-arrow--next { right: 10px; }
  .hero-content .display { font-size: 34px; }
  .hero-content .lede { font-size: 15px; }
  .section { padding: 52px 0; }
  .summary { position: static; }
  .wrap { padding: 0 20px; }
}

@media (max-width: 640px) {
  .grid-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
  /* 灯箱移动端：箭头保持 44px 触控标准、贴边，序号下移 */
  .lightbox-nav { width: 44px; height: 44px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-counter { bottom: 14px; }
  .lightbox-close { top: 10px; right: 12px; }
  /* 首页价值主张三项：手机改三列紧凑小字，弱化视觉权重（非重点内容） */
  .values { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .value h3 { font-size: 13px; margin-bottom: 4px; }
  .value p { font-size: 11px; line-height: 1.5; margin: 0; }
  .card-title, .card-meta, .price { font-size: 14px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .cart-item { grid-template-columns: 80px minmax(0, 1fr); gap: 14px; }
  .cart-item-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; }
  .fab { width: 44px; height: 44px; }
  .fab-stack { right: 14px; bottom: 14px; }
  .chat-panel {
    width: calc(100vw - 28px);
    max-height: 62vh;
  }
  .cookie-inner { gap: 12px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .section { padding: 40px 0; }
  .gallery-thumbs { gap: 8px; }
  .gallery-thumbs button { flex-basis: 88px; }
}

/* 结算页上必须让客服按钮让位，避免遮挡主 CTA（规格书 6.12 要求） */
@media (max-width: 640px) {
  body.is-checkout .fab-stack { bottom: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  /* 白名单：轮播切换动画按站主要求保留（淡入淡出+Ken Burns 属温和动效） */
  .hero-slide { transition: opacity .7s ease, visibility .7s !important; }
  .hero-slide .hero-img { animation: heroZoom 6.5s ease-out forwards !important; }
  .hero-slide .hero-content > * { transition: opacity .55s ease, transform .55s ease !important; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   多语种切换器（components.js 注入于 header-tools）
   ========================================================================== */
.lang-switch { position: relative; flex: 0 1 auto; min-width: 0; }

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 7px 26px 7px 10px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2376736C' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  max-width: 130px;
  text-overflow: ellipsis;   /* 视口较窄时语言名截断显示，不撑破工具栏 */
}

.lang-select:hover { border-color: var(--ink); }
.lang-select:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* 商品页 SKU 换图：主图淡出/淡入过渡（app.js swapMain 控制） */
.gallery-main img { transition: opacity 0.14s ease; }
.gallery-main img.is-fading { opacity: 0; }

/* 型号/包装选择器与库存提示 */
.sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.size-opt { min-width: 64px; }

/* ==========================================================================
   Bambu 式购买面板：配送区域 / 订单摘要 / 支付徽标 / 吸底购买栏
   ========================================================================== */

/* 配送区域下拉 */
.region-select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg)
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23767676' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.region-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* 订单摘要框 */
.order-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--bg-soft);
}
.order-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 5px 0;
  font-size: 14px;
  color: var(--ink-2);
}
.order-row--total {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

/* --- 主图促销图层（后台「促销活动」配置 data.js PROMO）-------------------- */
.promo-badge {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  font-weight: 600;
  white-space: nowrap;
}
.promo-badge.p-tr { top: 14px; right: 14px; }
.promo-badge.p-tl { top: 14px; left: 14px; }
.promo-badge.p-br { bottom: 14px; right: 14px; }
.promo-badge.p-bl { bottom: 14px; left: 14px; }
.promo-badge.st-pill { background: var(--pbc); color: #fff; padding: 5px 13px; border-radius: 999px; font-size: 13px; }
.promo-badge.st-outline { background: #fff; color: var(--pbc); border: 1.5px solid var(--pbc); padding: 4px 12px; border-radius: 6px; font-size: 13px; }
.promo-badge.st-circle {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--pbc); color: #fff;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 12px; line-height: 1.3; padding: 6px; white-space: normal;
}
.promo-badge.st-flag { background: var(--pbc); color: #fff; font-size: 13px; }
.promo-badge.st-flag.p-tr, .promo-badge.st-flag.p-tl { padding: 7px 12px 16px; clip-path: polygon(0 0,100% 0,100% 100%,50% 76%,0 100%); }
.promo-badge.st-flag.p-br, .promo-badge.st-flag.p-bl { padding: 16px 12px 7px; clip-path: polygon(0 0,50% 24%,100% 0,100% 100%,0 100%); }
.promo-badge.st-ribbon { width: 150px; text-align: center; padding: 5px 0; background: var(--pbc); color: #fff; font-size: 13px; }
.promo-badge.st-ribbon.p-tr { top: 17px; right: -38px; transform: rotate(45deg); }
.promo-badge.st-ribbon.p-tl { top: 17px; left: -38px; transform: rotate(-45deg); }
.promo-badge.st-ribbon.p-br { bottom: 17px; right: -38px; transform: rotate(-45deg); }
.promo-badge.st-ribbon.p-bl { bottom: 17px; left: -38px; transform: rotate(45deg); }
.promo-badge.st-img { max-width: 96px; height: auto; }

/* 角标大小（后台「促销标大小」；主图上生效，商品卡维持小号体系） */
.promo-badge.sz-s { font-size: 11px; }
.promo-badge.sz-s.st-pill { padding: 3px 9px; }
.promo-badge.sz-s.st-outline { padding: 2px 8px; }
.promo-badge.sz-s.st-circle { width: 46px; height: 46px; font-size: 10px; padding: 4px; }
.promo-badge.sz-s.st-flag { font-size: 11px; }
.promo-badge.sz-s.st-flag.p-tr, .promo-badge.sz-s.st-flag.p-tl { padding: 5px 8px 11px; }
.promo-badge.sz-s.st-flag.p-br, .promo-badge.sz-s.st-flag.p-bl { padding: 11px 8px 5px; }
.promo-badge.sz-s.st-ribbon { width: 112px; font-size: 11px; padding: 4px 0; }
.promo-badge.sz-s.st-ribbon.p-tr, .promo-badge.sz-s.st-ribbon.p-tl { top: 12px; right: -28px; }
.promo-badge.sz-s.st-ribbon.p-tl { left: -28px; right: auto; }
.promo-badge.sz-s.st-ribbon.p-br, .promo-badge.sz-s.st-ribbon.p-bl { bottom: 12px; right: -28px; }
.promo-badge.sz-s.st-ribbon.p-bl { left: -28px; right: auto; }
.promo-badge.sz-s.st-img { max-width: 72px; }

.promo-badge.sz-m { font-size: 13px; }   /* 默认 = 现有尺寸 */

.promo-badge.sz-l { font-size: 16px; }
.promo-badge.sz-l.st-pill { padding: 7px 18px; }
.promo-badge.sz-l.st-outline { padding: 6px 16px; border-width: 2px; }
.promo-badge.sz-l.st-circle { width: 84px; height: 84px; font-size: 14px; padding: 8px; }
.promo-badge.sz-l.st-flag { font-size: 16px; }
.promo-badge.sz-l.st-flag.p-tr, .promo-badge.sz-l.st-flag.p-tl { padding: 9px 16px 21px; }
.promo-badge.sz-l.st-flag.p-br, .promo-badge.sz-l.st-flag.p-bl { padding: 21px 16px 9px; }
.promo-badge.sz-l.st-ribbon { width: 190px; font-size: 15px; padding: 7px 0; }
.promo-badge.sz-l.st-ribbon.p-tr, .promo-badge.sz-l.st-ribbon.p-tl { top: 22px; right: -48px; }
.promo-badge.sz-l.st-ribbon.p-tl { left: -48px; right: auto; }
.promo-badge.sz-l.st-ribbon.p-br, .promo-badge.sz-l.st-ribbon.p-bl { bottom: 22px; right: -48px; }
.promo-badge.sz-l.st-ribbon.p-bl { left: -48px; right: auto; }
.promo-badge.sz-l.st-img { max-width: 140px; }

/* 商品卡小号体系继续生效（覆盖 sz-* 的主图字号） */
.promo-badge.on-card { font-size: 11px; }
.promo-badge.on-card { font-size: 11px; }
.promo-badge.on-card.st-pill { padding: 3px 9px; }
.promo-badge.on-card.st-outline { padding: 2px 8px; }
.promo-badge.on-card.st-circle { width: 44px; height: 44px; font-size: 10px; padding: 4px; }
.promo-badge.on-card.st-flag { font-size: 11px; }
.promo-badge.on-card.st-flag.p-tr, .promo-badge.on-card.st-flag.p-tl { padding: 5px 8px 11px; }
.promo-badge.on-card.st-flag.p-br, .promo-badge.on-card.st-flag.p-bl { padding: 11px 8px 5px; }
.promo-badge.on-card.st-ribbon { width: 110px; font-size: 11px; padding: 4px 0; }
.promo-badge.on-card.st-ribbon.p-tr { top: 11px; right: -28px; }
.promo-badge.on-card.st-ribbon.p-tl { top: 11px; left: -28px; }
.promo-badge.on-card.st-ribbon.p-br { bottom: 11px; right: -28px; }
.promo-badge.on-card.st-ribbon.p-bl { bottom: 11px; left: -28px; }
.promo-badge.on-card.st-img { max-width: 64px; }
.promo-count {
  position: absolute; z-index: 3; pointer-events: none;
  background: #1e1e1e; color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 999px;
}
.promo-count.c-bl { left: 12px; bottom: 12px; }
.promo-count.c-br { right: 12px; bottom: 12px; }
.promo-count.c-tl { left: 12px; top: 12px; }
.promo-count.c-tr { right: 12px; top: 12px; }

/* 倒计时大小：三档字号与促销标 sz-s/m/l 完全一致（11/13/16px） */
.promo-count.cs-s { font-size: 11px; padding: 2px 8px; }
.promo-count.cs-m { font-size: 13px; padding: 4px 11px; }   /* 默认 */
.promo-count.cs-l { font-size: 16px; padding: 6px 15px; }

/* --- 会员账户 / 登录注册 / 积分 ------------------------------------------- */
.acct-points {
  background: var(--accent-bg); color: var(--ink); border-radius: 999px;
  padding: 1px 8px; font-size: 11px;
}
.auth-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.auth-tab {
  border: 1px solid var(--line-2); background: transparent; border-radius: 999px;
  padding: 8px 18px; font: inherit; cursor: pointer; color: var(--muted);
}
.auth-tab.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.auth-card { max-width: 460px; padding: 24px; }
.auth-form { display: grid; gap: 14px; }
.form-err { color: #c0392b; font-size: 13px; margin: 0; min-height: 0; }
.member-grid { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .member-grid { grid-template-columns: 1fr; } }
.member-side { padding: 22px; text-align: center; }
.member-avatar {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto;
  background: var(--accent-bg); color: var(--ink);
  display: grid; place-items: center; font-size: 24px; font-weight: 600;
}
.points-big { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.points-big .points-num { font-size: 34px; font-weight: 600; }
.points-big .points-label { color: var(--muted); }
.points-box {
  border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 14px; margin-top: 14px; background: var(--bg-soft);
}
.points-box-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }

/* 支付方式徽标（SVG 图标） */
.pay-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pay-badge {
  display: inline-block;
  width: 38px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
}

/* 商品页固定信息块（规格与适配 / 配送与退货，始终展开） */
.fixed-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.fixed-info-head {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
}
.fixed-info-body { color: var(--ink-2); font-size: 14.5px; line-height: 1.65; }
@media (max-width: 760px) {
  .fixed-info { grid-template-columns: 1fr; gap: 20px; }
}

/* 商品详情图文区（后台图文排版内容） */
.pdp-detail { max-width: 860px; }
/* 详情图通栏无缝：统一宽度、块级去基线缝、纵向零间距（切片长图按序拼接） */
.pdp-detail img { display: block; width: 100%; height: auto; margin: 0; border-radius: 0; box-shadow: none; }
.pdp-detail h2 { font-size: 22px; margin: 26px 0 10px; }
.pdp-detail h3 { font-size: 17px; margin: 20px 0 8px; }
.pdp-detail p { margin: 0 0 12px; line-height: 1.75; color: var(--ink-2); }
.pdp-detail ul, .pdp-detail ol { margin: 0 0 12px; padding-left: 22px; line-height: 1.75; color: var(--ink-2); }
.pdp-detail hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.pdp-detail table { border-collapse: collapse; margin: 14px 0; }
.pdp-detail td, .pdp-detail th { border: 1px solid var(--line); padding: 8px 12px; font-size: 14px; }

/* 吸底购买栏：始终固定在视口底部，body.has-buybar 预留空间 */
body.has-buybar { padding-bottom: 118px; }
.buybar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: var(--bg);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(23, 23, 22, .07);
}
.buybar-in {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.buybar-price {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.buybar-price .price { margin: 0; }
.buybar-price .tiny { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buybar-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}
.buybar-btn { white-space: nowrap; }

@media (max-width: 640px) {
  body.has-buybar { padding-bottom: 66px; }
  body.has-buybar .cookie-bar.is-open { bottom: 66px; }
  .buybar-in { gap: 10px; }
  .buybar-btn { padding: 10px 14px; font-size: 13px; }
  .buybar-price .tiny { display: none; }
}

/* 商品页吸底栏让位：客服悬浮球与 Toast 上移，不压住购买按钮 */
body.has-buybar .fab-stack { bottom: 88px; }
body.has-buybar .toast { bottom: 96px; }

/* 返回顶部悬浮球：滚动超过约 0.8 屏后淡入，位于 WhatsApp / 客服按钮上方 */
.fab--top {
  background: var(--ink, #232323);
  color: var(--bg, #fff);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.fab--top.is-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.fab--top:hover { background: var(--accent, #444); }
.fab--top:focus-visible { outline: 2px solid var(--accent, #444); outline-offset: 2px; }

/* 商品页有吸底购买栏时，整个悬浮球组已上移，返回顶部随之让位（复用 .fab-stack 规则） */


/* --- 兼容层：flex gap 兜底（.no-flexgap 由 components.js 检测注入）--- */
/* 工具区必须保持靠右：恢复被 > * margin 覆盖的 auto 推手 */
.no-flexgap .header-bar > .header-tools { margin-left: auto; }
.no-flexgap .row > * + * { margin-left: 12px; }
.no-flexgap .row-b > * + * { margin-left: 12px; }
.no-flexgap .checkline > * + * { margin-left: 10px; }
.no-flexgap .header-bar > * { margin-left: 28px; }
.no-flexgap .nav > * + * { margin-left: 26px; }
.no-flexgap .header-tools > * { margin-left: 18px; }
.no-flexgap .search > * + * { margin-left: 8px; }
.no-flexgap .acct-item > * + * { margin-left: 10px; }
.no-flexgap .swatches > * + * { margin-left: 10px; }
.no-flexgap .sizes > * + * { margin-left: 8px; }
.no-flexgap .accordion-head > * + * { margin-left: 16px; }
.no-flexgap .filters > * + * { margin-left: 12px; }
.no-flexgap .filter-bar > * + * { margin-left: 16px; }
.no-flexgap .summary-row > * + * { margin-left: 16px; }
.no-flexgap .coupon > * + * { margin-left: 8px; }
.no-flexgap .pay-head > * + * { margin-left: 12px; }
.no-flexgap .trust-list li > * + * { margin-left: 9px; }
.no-flexgap .hero-content > * + * { margin-top: 16px; }
.no-flexgap .hero-dots > * + * { margin-left: 10px; }
.no-flexgap .breadcrumb > * + * { margin-left: 8px; }
.no-flexgap .footer-bottom > * + * { margin-left: 16px; }
.no-flexgap .social > * + * { margin-left: 10px; }
.no-flexgap .chat-head > * + * { margin-left: 12px; }
.no-flexgap .chat-quick > * + * { margin-left: 6px; }
.no-flexgap .cookie-inner > * + * { margin-left: 20px; }
.no-flexgap .cookie-actions > * + * { margin-left: 10px; }
.no-flexgap .sizes > * + * { margin-left: 8px; }
.no-flexgap .order-row > * + * { margin-left: 12px; }
.no-flexgap .auth-tabs > * + * { margin-left: 8px; }
.no-flexgap .points-big > * + * { margin-left: 6px; }
.no-flexgap .points-box-head > * + * { margin-left: 10px; }
.no-flexgap .pay-row > * + * { margin-left: 6px; }
.no-flexgap .buybar-in > * + * { margin-left: 16px; }
.no-flexgap .buybar-actions > * + * { margin-left: 10px; }

/* --- 兼容层：aspect-ratio 兜底（老内核图片区高度塌陷）--- */
@supports not (aspect-ratio: 1 / 1) {
  .card-media { height: 0; padding-top: 100%; }
  .card-media img, .card-media .media-ph { position: absolute; top: 0; left: 0; }
  .gallery-thumbs button { height: 0; padding-top: 100%; position: relative; }
  .gallery-thumbs button img { position: absolute; top: 0; left: 0; }
  .gallery-main { height: 0; padding-top: 100%; }
  .gallery-main img { position: absolute; top: 0; left: 0; }
}

/* ===================== 会员中心仪表盘（2026-09-27 改版） ===================== */
.mb-hero { padding: 20px 22px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.mb-hero .member-avatar { width: 56px; height: 56px; font-size: 20px; margin: 0; flex: 0 0 auto; }
.mb-hero-main { flex: 1 1 220px; min-width: 0; }
.mb-hello { margin: 0; font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mb-tier-badge { font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 99px; background: var(--ink); color: #fff; letter-spacing: 0.02em; }
.mb-hero-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.mb-hero-logout { flex: 0 0 auto; }
.mb-tier-bar { margin-top: 12px; }
.mb-tier-track { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.mb-tier-fill { height: 100%; border-radius: 99px; background: var(--ink); }
.mb-tier-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); margin-top: 5px; flex-wrap: wrap; }
.mb-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.mb-stat { background: var(--paper-2, #F6F5F1); border-radius: 12px; padding: 14px 16px; }
.mb-stat .k { font-size: 12px; color: var(--muted); margin: 0; }
.mb-stat .v { font-size: 22px; font-weight: 600; margin: 3px 0 0; }
.mb-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); margin-top: 22px; overflow-x: auto; }
.mb-tab { appearance: none; background: none; border: 0; padding: 10px 16px; font: inherit; font-size: 14px;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.mb-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.mb-panel { margin-top: 16px; }
.mb-panel[hidden] { display: none; }
/* 订单卡片 */
.mb-order { border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.mb-order-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; }
.mb-order-no { font-weight: 500; }
.mb-chip { font-size: 11px; padding: 2px 10px; border-radius: 99px; background: var(--line-2, #E8E6DF); }
.mb-chip.processing { background: var(--warning-bg, #F7EEDD); color: #8A5A0B; }
.mb-chip.shipped { background: #E6F1FB; color: #185FA5; }
.mb-chip.delivered { background: var(--success-bg); color: var(--success); }
.mb-order-head .amt { margin-left: auto; font-weight: 600; }
.mb-order-meta { font-size: 12px; color: var(--muted); margin: 3px 0 0; }
.mb-order-detail { border-top: 1px dashed var(--line-2); margin-top: 10px; padding-top: 10px; display: none; }
.mb-order.open .mb-order-detail { display: block; }
.mb-order-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 3px 0; }
.mb-order-line .muted { color: var(--muted); }
.mb-copy-btn { appearance: none; background: none; border: 1px solid var(--line-2); border-radius: 8px; font-size: 11px; padding: 2px 8px; cursor: pointer; color: var(--muted); }
.mb-copy-btn:hover { border-color: var(--ink); color: var(--ink); }
/* 通用表格（修错位：固定布局 + colgroup） */
.mb-tbl { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.mb-tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 9px 10px; background: var(--paper-2, #F6F5F1); }
.mb-tbl th:first-child { padding-left: 16px; }
.mb-tbl th:last-child { padding-right: 16px; text-align: right; }
.mb-tbl td { padding: 9px 10px; border-top: 1px solid var(--line-2); overflow-wrap: anywhere; }
.mb-tbl td:first-child { padding-left: 16px; }
.mb-tbl td:last-child { padding-right: 16px; text-align: right; }
.mb-tbl .num { text-align: right; }
.mb-up { color: var(--success); font-weight: 500; }
.mb-down { color: var(--danger); font-weight: 500; }
/* 兑券 / 邀请 */
.mb-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.mb-box { border: 1px solid var(--line-2); border-radius: 12px; padding: 16px; }
.mb-box h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.mb-box .desc { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.mb-redeem-row { display: flex; gap: 8px; align-items: center; }
.mb-redeem-row input { max-width: 140px; }
.mb-coupon { display: flex; align-items: center; gap: 10px; border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.mb-coupon .code { font-family: var(--font-mono, monospace); font-weight: 500; }
.mb-coupon.used { opacity: 0.45; }
.mb-coupon .val { margin-left: auto; font-weight: 600; }
.mb-invite-code { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.mb-invite-code code { font-size: 16px; font-weight: 600; letter-spacing: 0.06em; background: var(--paper-2, #F6F5F1); border-radius: 8px; padding: 6px 12px; }
/* 地址簿 */
.mb-addr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mb-addr { border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; position: relative; }
.mb-addr.default { border-color: var(--ink); border-width: 1.5px; }
.mb-addr .def-chip { position: absolute; top: 12px; right: 12px; font-size: 11px; background: var(--ink); color: #fff; padding: 2px 8px; border-radius: 99px; }
.mb-addr p { margin: 2px 0; font-size: 13px; }
.mb-addr .name { font-weight: 500; }
.mb-addr .ops { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.mb-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.mb-form .full { grid-column: 1 / -1; }
.mb-form label { font-size: 12px; color: var(--muted); display: block; margin: 0 0 4px; }
.mb-msg { font-size: 13px; margin: 8px 0 0; }
.mb-msg.ok { color: var(--success); }
.mb-msg.err { color: var(--danger); }
/* 账号设置 */
.mb-acct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mb-acct-grid .mb-box label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.mb-acct-grid .mb-box input { width: 100%; }
.no-flexgap .mb-hero, .no-flexgap .mb-order-head, .no-flexgap .mb-redeem-row,
.no-flexgap .mb-invite-code, .no-flexgap .mb-coupon, .no-flexgap .mb-addr .ops { display: flex; }
.no-flexgap .mb-hero > * + *, .no-flexgap .mb-order-head > * + *, .no-flexgap .mb-redeem-row > * + *,
.no-flexgap .mb-invite-code > * + *, .no-flexgap .mb-coupon > * + *, .no-flexgap .mb-addr .ops > * + * { margin-left: 8px; }
/* 移动端 */
@media (max-width: 900px) {
  .mb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mb-mini-grid, .mb-addr-grid, .mb-acct-grid, .mb-form { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .mb-stat .v { font-size: 18px; }
  .mb-tbl thead { display: none; }
  .mb-tbl, .mb-tbl tbody, .mb-tbl tr, .mb-tbl td { display: block; width: 100%; }
  .mb-tbl tr { border-top: 1px solid var(--line-2); padding: 8px 0; }
  .mb-tbl td { border: 0; padding: 3px 16px; text-align: right; }
  .mb-tbl td:first-child { padding-left: 16px; }
  .mb-tbl td::before { content: attr(data-l); float: left; color: var(--muted); font-size: 12px; }
  .mb-hero { padding: 16px; }
}

/* 顶栏按钮文字不换行（长语言词条防挤压重叠） */
.acct-btn { white-space: nowrap; }

/* 会员中心：内容区与页脚留出呼吸空间（空状态不再贴页脚） */
#main { min-height: 58vh; padding-bottom: 56px; }

/* ==========================================================================
   Knocket 在线客服（腾讯云 IM）接入后，隐藏自建聊天气泡入口，避免双悬浮窗重叠。
   保留 WhatsApp 与返回顶部悬浮球。如需恢复自建聊天，删除下面这条规则即可。
   ========================================================================== */
.fab[data-chat-open] { display: none !important; }

/* ==========================================================================
   WhatsApp 入口暂时下线（2026-10-14）：恢复入口 = 删除下面 .fab--wa 这条规则。
   Knocket 悬浮窗用 SDK 官方定位变量落到原 WhatsApp 槽位（栈内上层按钮），
   桌面端：右 22 / 底 82（chat 50 + gap 10 + stack 22）；移动端 ≤640px：右 14 / 底 68。
   ========================================================================== */
.fab--wa { display: none !important; }

:root {
  --contact-widget-right: 22px;
  --contact-widget-bottom: 82px;
}
@media (max-width: 640px) {
  :root {
    --contact-widget-right: 14px;
    --contact-widget-bottom: 68px;
  }
}

/* ==========================================================================
   导航自适应加固（2026-10-14）：长语言（如俄语）在中窄桌面下压缩导航字号与
   词间距；溢出兜底改为裁剪而非压到右侧工具区造成重叠。
   ========================================================================== */
@media (min-width: 1025px) {
  .nav { gap: 14px; }
  .nav a { font-size: 14px; }
  .header-bar { gap: 10px; }
  .header-tools { gap: 6px; }
}
.nav { overflow: hidden; }

/* 俄语导航更长：≤1279px 提前收进汉堡菜单（i18n 切语言时在 <html> 打 data-lang 标记），
   ≥1280px 恢复横向导航。其他语言维持 1024px 断点不变。 */
@media (max-width: 1279px) {
  html[data-lang="ru"] .nav,
  html[data-lang="ru"] .search { display: none; }
  html[data-lang="ru"] .nav-toggle { display: block; }
}
@media (max-width: 1199px) {
  html[data-lang="en"] .nav,
  html[data-lang="en"] .search,
  html[data-lang="ms"] .nav,
  html[data-lang="ms"] .search { display: none; }
  html[data-lang="en"] .nav-toggle,
  html[data-lang="ms"] .nav-toggle { display: block; }
}
@media (max-width: 1099px) {
  html[data-lang="zh"] .nav,
  html[data-lang="zh"] .search,
  html[data-lang="zh-TW"] .nav,
  html[data-lang="zh-TW"] .search { display: none; }
  html[data-lang="zh"] .nav-toggle,
  html[data-lang="zh-TW"] .nav-toggle { display: block; }
}

/* 注意：不要对 #contact-widget-auto 加 :empty 隐藏——Knocket 的 UI 全部渲染在
   Shadow DOM 里，宿主光照 DOM 恒为空，:empty 规则会永久隐藏气泡（2026-10-14 事故）。 */

/* ==========================================================================
   商品视频（2026-10-15）：主图区 <video> 播放器 + 缩略图视频项
   ========================================================================== */
.gallery-main .main-video {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  z-index: 1;
}
.gallery-thumbs button video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;   /* 点击交给缩略图按钮切换，不触发原生控件 */
}
/* Knocket 宿主不占面积：悬浮窗为 fixed 自绘（不依赖宿主盒子），
   宿主盒子归零防止其覆盖右下角页面元素（如返回顶部按钮） */
#contact-widget-auto { width: 0 !important; height: 0 !important; }
/* Knocket 悬浮窗跟随页面场景：栈被吸底购买栏/结算栏上移时同步上移，
   避免与返回顶部按钮重叠（栈 bottom 88/74 + 球 50 + 间距 10） */
body.has-buybar { --contact-widget-bottom: 148px; }
body.is-checkout { --contact-widget-bottom: 134px; }
