/* 自己的补充样式（style.css 为参考站原样式，不要改它，覆盖写在这里） */

/* 小红书风格：鲜红作为品牌点缀，深红用于文字和实色按钮。 */
:root {
  --primary: #ff2442;
  --primary-dark: #d71937;
  --primary-light: #ff4961;
  --action: #e51b3b;
  --action-hover: #cf1533;
  --bg-soft: #f7f7f7;
  --text-main: #222222;
  --text-secondary: #616161;
  --text-muted: #757575;
  --tag-bg: #eeeeee;
  --tag-bg-warm: #fff0f2;
  --quote-bg: #fff5f6;
  --border-light: #eeeeee;
  --bs-card-border-color: #eeeeee;
  --accent-ring: rgba(255, 36, 66, .12);
  --accent-shadow: 0 4px 14px rgba(229, 27, 59, .16);
}

/* 首页首屏：轻量红白品牌区与清晰的服务数据。 */
.hero-section {
  display: grid; grid-template-columns: minmax(0, 1fr) 250px;
  align-items: center; gap: 48px; margin-top: 28px; padding: 36px 44px;
  border: 1px solid #f0e7e9; border-radius: 24px; box-shadow: none;
  background-color: #fff8f9;
  background-image: linear-gradient(90deg, rgba(255,255,255,.16), rgba(255,255,255,.58)), url('/assets/img/hero/xhs-background-v2.webp');
  background-size: cover;
  background-position: center;
}
.hero-section .badge-hot {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; margin-bottom: 16px; font-size: 12px;
  background: #fff0f2; color: var(--primary-dark);
}
.hero-section .hero-title {
  font-size: clamp(30px, 3.1vw, 44px); line-height: 1.35;
  letter-spacing: -1px; margin-bottom: 16px; color: #222;
}
.hero-title > span { color: var(--primary-dark); }
.hero-description { max-width: 620px; font-size: 15px; line-height: 1.85; color: var(--text-secondary); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-actions a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px; border-radius: 999px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background-color .2s ease;
}
.hero-primary { color: #fff; background: var(--action); }
.hero-primary:hover { background: var(--action-hover); }
.hero-secondary { color: #555; background: #fff; border: 1px solid #e7e7e7; }
.hero-secondary:hover { background: #f7f7f7; }
.hero-actions a:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 3px; }
.hero-section .stats-row {
  display: flex; flex-direction: column; gap: 0; margin: 0;
  padding: 8px 20px; border: 1px solid rgba(255,255,255,.9);
  border-radius: 20px; background: rgba(255,255,255,.88);
  box-shadow: 0 8px 28px rgba(155, 29, 52, .08);
  backdrop-filter: blur(8px);
}
.hero-section .stat-item {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; padding: 18px 0; text-align: left;
}
.hero-section .stat-item + .stat-item { border-top: 1px solid #f0e5e8; }
.hero-section .stat-number { font-size: 34px; line-height: 1.25; font-weight: 800; letter-spacing: -.8px; color: var(--primary-dark); }
.hero-section .stat-label { font-size: 13px; font-weight: 600; color: #444; white-space: nowrap; }
@media (max-width: 900px) {
  .hero-section { grid-template-columns: minmax(0, 1fr) 200px; gap: 24px; padding: 30px; }
  .hero-section .stats-row { padding: 8px 20px; }
  .hero-section .stat-item { flex-direction: column; gap: 4px; padding: 14px 0; }
}
@media (max-width: 640px) {
  .hero-section { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px 20px; margin-top: 20px; border-radius: 18px; }
  .hero-section .hero-title { font-size: 29px; letter-spacing: -.7px; }
  .hero-description { font-size: 14px; }
  .hero-actions { gap: 8px; margin-top: 20px; }
  .hero-actions a { padding: 0 16px; font-size: 13px; }
  .hero-section .stats-row { flex-direction: row; justify-content: space-between; gap: 8px; padding: 18px 12px; border: 1px solid #f5dfe4; border-radius: 14px; }
  .hero-section .stat-item { padding: 0; gap: 5px; }
  .hero-section .stat-item + .stat-item { border: 0; }
  .hero-section .stat-number { font-size: clamp(22px, 6.5vw, 27px); }
  .hero-section .stat-label { font-size: 12px; }
}

/* 商品筛选隐藏 */
#products, #features, #process, #faq { scroll-margin-top: 90px; }
.product-card[hidden] { display: none; }
.section-header h2 { display: flex; align-items: center; gap: 10px; line-height: 1.4; }
.section-heading-icon { display: block; flex: none; width: 34px; height: 34px; color: var(--primary-dark); }
.section-header:not(#products) .section-heading-icon { transform: translateY(-3px); }
.section-heading-text { display: block; transform: translateY(2px); }

/* 全站页头：紧凑品牌区、轻胶囊导航和独立移动菜单。 */
.site-header {
  background: rgba(255,255,255,.97); border-bottom: 1px solid #ededed;
  backdrop-filter: blur(14px); z-index: 1200;
}
.site-header .header-inner { position: relative; min-height: 78px; padding: 12px 0; gap: 24px; }
.site-header .logo-area { flex: none; display: flex; align-items: center; gap: 11px; }
.site-header .brand-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; }
.site-header .brand-icon .detail-brand-mark { display: block; width: 100%; height: 100%; border-radius: 12px; }
.brand-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.site-header .brand-text { font-size: 20px; line-height: 1.35; font-weight: 750; letter-spacing: -.5px; white-space: nowrap; transform: none; }
.brand-caption { color: #8a8a8a; font-size: 10px; line-height: 1.5; letter-spacing: 1px; white-space: nowrap; }
.site-header .main-nav { margin-left: auto; }
.site-header .main-nav ul { display: flex; align-items: center; gap: 4px; margin: 0; padding: 5px; border-radius: 999px; background: #f7f7f7; list-style: none; }
.site-header .nav-link {
  display: flex; align-items: center; justify-content: center;
  padding: 9px 16px; border: 0; border-radius: 999px;
  color: #666; font-size: 14px; line-height: 22px; font-weight: 500; white-space: nowrap;
  transition: color .2s ease, background-color .2s ease;
}
.site-header .nav-link:hover { color: var(--primary-dark); background: #fff; }
.site-header .nav-link.is-active { color: var(--primary-dark); background: #fff; font-weight: 650; box-shadow: 0 1px 5px rgba(0,0,0,.04); }
.site-header .header-actions { display: none; }
.site-header .header-divider { display: none; }
.site-header .mobile-toggle { width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 12px; background: #f6f6f6; color: #333; }
.mobile-toggle svg { display: block; width: 23px; height: 23px; }
.mobile-toggle .menu-close, .mobile-toggle[aria-expanded=true] .menu-lines { display: none; }
.mobile-toggle[aria-expanded=true] .menu-close { display: block; }
@media (max-width: 960px) {
  .site-header .header-inner { gap: 16px; }
  .site-header .nav-link { padding: 8px 11px; font-size: 13px; }
}
@media (max-width: 768px) {
  .site-header .header-inner { min-height: 68px; padding: 10px 0; justify-content: space-between; }
  .site-header .logo-area { gap: 9px; }
  .site-header .brand-icon { width: 36px; height: 36px; }
  .site-header .brand-text { font-size: 18px; }
  .brand-caption { font-size: 9px; letter-spacing: .6px; }
  .site-header .header-actions { display: flex; flex: none; }
  .site-header .mobile-toggle { display: flex; }
  .site-header .main-nav { display: none; margin: 0; }
  .site-header .main-nav.open {
    display: block; position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    padding: 7px; border: 1px solid #eee; border-radius: 18px;
    background: #fff; box-shadow: 0 12px 32px rgba(34,34,34,.1);
  }
  .site-header .main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; padding: 0; background: transparent; border-radius: 0; }
  .site-header .nav-link { justify-content: flex-start; padding: 12px 16px; border-radius: 11px; font-size: 14px; }
  .site-header .nav-link.is-active { background: #fff0f2; box-shadow: none; }
}
@media (max-width: 360px) {
  .site-header .brand-text { font-size: 16px; }
  .site-header .brand-icon { width: 32px; height: 32px; }
  .site-header .mobile-toggle { width: 36px; height: 36px; }
}

/* 邮箱校验失败 */
.email-input.error { border-color: var(--primary-dark); box-shadow: 0 0 0 3px var(--accent-ring); }

/* 标题链接继承颜色 */
.product-title a, .ks-product-card-title a { color: inherit; text-decoration: none; }

/* 购买按钮中的文字与图标在两个方向居中。 */
#buyBtn, .ks-product-card-action .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  vertical-align: middle;
}

/* 404 */
.not-found { text-align: center; padding: 100px 0; }
.not-found h1 { font-size: 6rem; font-weight: 800; color: var(--primary); }
.not-found p { color: var(--text-secondary); margin: 8px 0 28px; }
.not-found .btn { flex: none; }

/* 原站购买说明 */
.purchase-handoff { margin-top: 12px; line-height: 1.6; }

/* 邮箱校验提示 */
.validation-toast {
  position: fixed;
  top: 90px;
  left: 50%;
  z-index: 2000;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 14px 22px;
  border: 1px solid var(--primary);
  border-radius: 16px;
  background: var(--tag-bg-warm);
  color: var(--text-main);
  box-shadow: var(--accent-shadow);
  font-size: .95rem;
  font-weight: 500;
  opacity: 0;
  transform: translate(-50%, -10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.validation-toast.visible { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) {
  .validation-toast { transition: none; }
}

/* 购买弹窗：使用原生 dialog 管理焦点、遮罩和 Escape 关闭。 */
.purchase-dialog {
  margin: auto;
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  color: var(--text-main);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  overflow: auto;
  overscroll-behavior: contain;
}
.purchase-dialog::backdrop { background: rgba(30, 30, 42, .6); }
.purchase-dialog-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 22px 28px; border-bottom: 1px solid var(--border-light);
}
.purchase-dialog-header h2 { font-size: 1.4rem; }
.purchase-close {
  flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: var(--tag-bg-warm); color: var(--primary-dark);
  font-size: 1.7rem; cursor: pointer;
}
.purchase-dialog-body { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 24px 28px 28px; }
.purchase-dialog-body > section { min-width: 0; }
.purchase-dialog h3 { font-size: 1.1rem; margin-bottom: 18px; }
.purchase-dialog .order-icon-label { display: flex; align-items: center; gap: 8px; }
.order-icon { display: block; flex: none; width: 22px; height: 22px; color: var(--primary-dark); }
.order-label-text { display: block; transform: translateY(2px); }
.purchase-countdown .order-icon-label { justify-content: center; }
.purchase-countdown .order-icon, .purchase-address .order-icon { width: 17px; height: 17px; }
.purchase-countdown {
  padding: 20px; margin-bottom: 20px; text-align: center;
  background: var(--tag-bg-warm); color: var(--primary-dark); border-radius: 20px;
}
.purchase-countdown p { font-size: .85rem; }
.purchase-countdown strong { display: block; font-size: 2.5rem; margin: 8px 0; font-variant-numeric: tabular-nums; }
.purchase-summary { background: var(--bg-soft); padding: 22px; border-radius: 20px; }
.purchase-product { font-weight: 600; overflow-wrap: anywhere; margin-bottom: 16px; }
.purchase-summary dl > div {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-light);
}
.purchase-summary dt { flex: none; color: var(--text-secondary); font-size: .9rem; }
.purchase-summary dd { margin: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; font-size: .9rem; }
.purchase-summary .purchase-total { color: var(--primary-dark); font-size: 1.3rem; font-weight: 700; }
.purchase-address { padding: 16px; border: 1px solid var(--border-light); border-radius: 16px; }
.purchase-address p { color: var(--text-secondary); font-size: .85rem; margin-bottom: 10px; }
.purchase-address code { display: block; overflow-wrap: anywhere; font-size: .9rem; }
.purchase-copy {
  margin-top: 14px; padding: 9px 16px; border: 0; border-radius: 24px;
  color: var(--white); background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  font-weight: 600; cursor: pointer;
}
.purchase-copy:disabled { opacity: .5; cursor: default; }
.purchase-qr { text-align: center; padding-top: 22px; }
.purchase-qr img { display: block; margin: 0 auto 14px; max-width: 100%; height: auto; }
.purchase-qr img[hidden] { display: none; }
.purchase-qr p { color: var(--text-secondary); font-size: .85rem; margin-top: 8px; }
.purchase-dialog button:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 3px; }
@media (max-width: 640px) {
  .purchase-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 22px; }
  .purchase-dialog-header { padding: 16px 18px; }
  .purchase-dialog-header h2 { font-size: 1.2rem; }
  .purchase-dialog-body { grid-template-columns: 1fr; padding: 18px; gap: 22px; }
  .purchase-summary { padding: 18px; }
}

/* 统一覆盖旧的粉橙渐变与交互颜色。 */
.brand-icon { background: transparent; }
.brand-icon > img { display: block; width: 100%; height: 100%; }
.btn-primary, .ks-product-card-action .btn, .purchase-copy {
  background: var(--action);
  color: var(--white);
}

/* 分类采用内容社区式标签导航。 */
#filterBar {
  display: flex; flex-wrap: nowrap; gap: 24px; overflow-x: auto;
  margin-bottom: 26px; padding: 0 2px;
  border-bottom: 1px solid #e9e9e9;
  scrollbar-width: thin; scrollbar-color: #e3e3e3 transparent;
}
#filterBar .filter-btn {
  position: relative; flex: none; margin: 0; padding: 14px 2px 18px;
  border: 0; border-radius: 0; background: transparent;
  color: #666; font-size: 15px; line-height: 24px; font-weight: 500;
  white-space: nowrap; transition: color .2s ease;
}
#filterBar .filter-btn::after {
  content: ''; position: absolute; left: 50%; bottom: 0;
  width: 26px; height: 4px; border-radius: 4px 4px 0 0;
  background: var(--primary); transform: translateX(-50%) scaleX(0);
  transition: transform .2s ease;
}
#filterBar .filter-btn.active { color: var(--primary-dark); font-weight: 700; }
#filterBar .filter-btn.active::after { transform: translateX(-50%) scaleX(1); }
#filterBar .filter-btn:hover { color: var(--primary-dark); background: transparent; }
#filterBar .filter-btn:focus-visible { outline-offset: -3px; border-radius: 6px; }
@media (max-width: 640px) {
  #filterBar { gap: 20px; margin-bottom: 20px; padding: 0 2px; }
  #filterBar .filter-btn { padding: 10px 2px 14px; font-size: 14px; }
}
.btn-primary, .ks-product-card-action .btn, .purchase-copy { box-shadow: var(--accent-shadow); }
.btn-primary:hover, .ks-product-card-action .btn:hover, .purchase-copy:hover:not(:disabled) {
  background: var(--action-hover);
  box-shadow: 0 6px 18px rgba(229, 27, 59, .2);
}
.badge-hot, .nav-link:hover, .quantity-btn:hover, .tag:hover { color: var(--primary-dark); }
.tag:hover, .quantity-btn:hover { background: var(--tag-bg-warm); }
.total-price { background: var(--tag-bg-warm); }
.product-d-price { background: none; color: var(--primary-dark); }
.email-input:focus, .quantity-selector:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.spec-value.highlight { color: #16805d; }
.filter-btn:focus-visible, .nav-link:focus-visible, .btn:focus-visible,
.quantity-btn:focus-visible, .purchase-copy:focus-visible {
  outline: 2px solid var(--primary-dark);
  outline-offset: 3px;
}

/* 首页笔记式商品卡片。 */
#productsGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 14px; }
#productsGrid .product-card {
  min-width: 0; border: 1px solid #ededed; border-radius: 16px;
  background: #fff; box-shadow: none; cursor: default;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
@media (hover: hover) and (pointer: fine) {
  #productsGrid .product-card:hover {
    transform: translateY(-5px); border-color: #f3bec9;
    box-shadow: 0 12px 28px rgba(117, 30, 49, .1);
  }
  #productsGrid .product-card:hover .note-cover-art { transform: scale(1.045); }
}
#productsGrid .product-card:focus-within { border-color: #f3bec9; box-shadow: 0 0 0 2px rgba(255,36,66,.08); }
.note-cover {
  --cover-bg: #f9e8ec; --cover-ink: #893747;
  position: relative; display: block; overflow: hidden;
  color: var(--cover-ink); background: var(--cover-bg); text-decoration: none;
}
.note-cover-art { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; object-position: center 30%; transition: transform .4s ease; }
.cid-322 .note-cover { --cover-bg: #eeeae5; --cover-ink: #685346; }
.cid-323 .note-cover { --cover-bg: #f6e5e3; --cover-ink: #8f443e; }
.cid-324 .note-cover { --cover-bg: #e8edf2; --cover-ink: #41596c; }
.cid-325 .note-cover { --cover-bg: #eee9f5; --cover-ink: #66537f; }
.cid-326 .note-cover { --cover-bg: #faebdf; --cover-ink: #946039; }
.cid-327 .note-cover { --cover-bg: #e6eeea; --cover-ink: #416756; }
.cid-328 .note-cover { --cover-bg: #f1e9e5; --cover-ink: #795348; }

#productsGrid .product-info { padding: 14px 14px 15px; }
#productsGrid .product-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; height: 52px; margin: 0 0 7px;
  font-size: 17px; line-height: 26px; font-weight: 600;
}

.note-availability { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; font-size: 13px; color: var(--text-secondary); }
#productsGrid .product-stock { font-size: inherit; color: inherit; }
.note-delivery { padding-left: 8px; border-left: 1px solid #dedede; }
#productsGrid .product-meta { gap: 8px; margin: 0; min-height: 32px; }
#productsGrid .product-meta { flex-wrap: nowrap; align-items: center; }



#productsGrid .note-availability { flex-wrap: wrap; font-size: 12px; }
#productsGrid .note-buy { width: auto; min-height: 42px; padding: 0 12px; font-size: 14px; gap: 6px; }
.note-price { display: flex; align-items: baseline; gap: 3px; white-space: nowrap; }
#productsGrid .product-price { font-size: 25px; line-height: 1.2; font-weight: 700; letter-spacing: -.5px; }
.note-price-unit { font-size: 13px; color: var(--text-secondary); }
.note-buy {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: none;
  min-height: 44px; padding: 0 20px; border: 1px solid var(--action);
  border-radius: 999px; color: #fff; background: var(--action);
  box-shadow: var(--accent-shadow);
  font-size: 15px; line-height: 1; font-weight: 700; text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease;
}
.note-buy > span { display: block; line-height: 20px; transform: translateY(3px); }
.note-buy > svg { display: block; flex: none; width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) {
  #productsGrid .product-card, .note-cover-art { transition: none; }
  #productsGrid .product-card:hover, #productsGrid .product-card:hover .note-cover-art { transform: none; }
}
.note-buy:hover { background: var(--action-hover); border-color: var(--action-hover); box-shadow: 0 6px 18px rgba(229, 27, 59, .24); }
.note-buy:focus-visible, .note-cover:focus-visible {
  outline: 2px solid var(--primary-dark); outline-offset: -3px;
}
@media (max-width: 1024px) {
  #productsGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }

}
@media (max-width: 640px) {
  #productsGrid { grid-template-columns: 1fr; gap: 18px; }
  #productsGrid .product-card { border-radius: 12px; }



  #productsGrid .product-info { padding: 16px; }
  #productsGrid .product-title { font-size: 17px; line-height: 26px; height: auto; min-height: 52px; }

  .note-availability { font-size: 13px; gap: 8px; margin-bottom: 14px; }
  .note-delivery { padding-left: 5px; }
  #productsGrid .product-meta { flex-wrap: nowrap; }
  #productsGrid .product-price { font-size: 25px; }
  .note-buy { min-height: 44px; padding: 0 20px; font-size: 15px; }
}
