:root {
  color-scheme: light;
  --ink: #1f221d;
  --muted: #5c5b51; /* 提升对比度：原 #68685f → AA */
  --subtle: #6f6d63; /* 提升对比度：原 #8b897d → AA */
  --paper: #f4efe6;
  --surface: #fffcf4;
  --surface-soft: rgba(255, 252, 244, 0.72);
  --line: rgba(31, 34, 29, 0.12);
  --line-soft: rgba(31, 34, 29, 0.09);
  --green: #23361f;
  --green-2: #30492b;
  --gold: #e9c765;
  --coral: #df6650;
  --blue: #3a7183; /* 提升对比度：原 #4a8192 → AA */
  --shadow: 0 28px 80px rgba(45, 42, 34, 0.12);
  /* chip */
  --chip-bg: rgba(255, 255, 255, 0.66);
  --chip-bg-hover: rgba(255, 255, 255, 0.92);
  --chip-border: rgba(31, 34, 29, 0.12);
  --chip-active-bg: var(--green);
  --chip-active-color: #fff8e9;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-sans:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
    "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei", sans-serif;
  --font-display:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
    "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.68), transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(233, 199, 101, 0.2), transparent 24%),
    linear-gradient(90deg, rgba(31, 34, 29, 0.035) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(180deg, #f8f2e8 0%, #f1efe9 55%, #f6efe6 100%);
}

html::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(0deg, rgba(31, 34, 29, 0.018) 0, rgba(31, 34, 29, 0.018) 1px, transparent 1px, transparent 5px);
  mix-blend-mode: multiply;
}

body {
  margin: 0;
  min-height: 100vh;
}

body.modal-open {
  overflow: hidden;
}

button,
a,
input {
  font: inherit;
}

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

/* —— skip link —— */
.skip-link {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--green);
  color: #fff8e9;
  font-size: 14px;
  font-weight: 700;
  transition: top 180ms var(--ease);
}
.skip-link:focus {
  top: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 18px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 241, 232, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 820;
  letter-spacing: 0;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.product-section {
  padding: 40px 0 74px;
}

/* —— section head：大标题 + 实时计数 —— */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-head p {
  margin: 0 0 6px;
  color: var(--coral);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.section-title {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 820;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.section-count {
  flex: 0 0 auto;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 720;
  white-space: nowrap;
}

/* —— 筛选条 + 搜索框 —— */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

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

.chip-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
  padding-bottom: 2px;
}
.chip-scroll::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 720;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 180ms var(--ease),
    border-color 180ms var(--ease),
    color 180ms var(--ease),
    background-color 180ms var(--ease);
}
.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(35, 54, 31, 0.24);
  background: var(--chip-bg-hover);
  color: var(--green);
}
.chip[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--chip-active-bg);
  color: var(--chip-active-color);
  box-shadow: 0 10px 22px rgba(35, 54, 31, 0.18);
}
.chip-cat[aria-pressed="true"] {
  background: var(--green-2);
}
.chip:focus-visible {
  outline: 2px solid rgba(58, 113, 131, 0.6);
  outline-offset: 2px;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  margin: 12px 0 22px;
  max-width: 420px;
}

.search-icon {
  position: absolute;
  left: 14px;
  display: flex;
  align-items: center;
  color: var(--subtle);
  pointer-events: none;
}
.search-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-input {
  width: 100%;
  min-height: 46px;
  padding: 11px 44px;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  transition:
    border-color 180ms var(--ease),
    background-color 180ms var(--ease),
    box-shadow 180ms var(--ease);
  appearance: none;
}
.search-input::placeholder {
  color: var(--subtle);
}
.search-input:focus {
  outline: none;
  border-color: rgba(58, 113, 131, 0.55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(58, 113, 131, 0.12);
}

.search-clear {
  position: absolute;
  right: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(31, 34, 29, 0.08);
  color: var(--muted);
  cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}
.search-clear:hover {
  background: rgba(31, 34, 29, 0.16);
  color: var(--ink);
}
.search-clear svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

/* —— 卡片网格 —— */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.product-card {
  position: relative;
  display: flex;
  min-height: 486px;
  flex-direction: column;
  padding: 24px 22px 22px;
  overflow: hidden;
  border: 1px solid rgba(31, 34, 29, 0.1);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 251, 240, 0.78)),
    var(--surface);
  box-shadow: 0 18px 54px rgba(45, 42, 34, 0.08);
  animation: rise 620ms var(--ease) both;
  animation-delay: var(--delay);
  transition:
    transform 200ms var(--ease),
    border-color 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.product-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(135deg, rgba(74, 129, 146, 0.11), transparent 36%),
    radial-gradient(circle at 95% 0%, rgba(233, 199, 101, 0.22), transparent 32%);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

.product-card:hover {
  transform: translateY(-5px);
  border-color: rgba(35, 54, 31, 0.22);
  box-shadow: var(--shadow);
}

.product-card:hover::before {
  opacity: 1;
}

.product-card[hidden] {
  display: none;
}

.card-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.card-top,
.tagline,
.summary,
.fit-line,
.chips,
.card-bottom {
  position: relative;
  z-index: 2;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.logo-wrap {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(31, 34, 29, 0.1);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.82);
}

.logo-wrap img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.card-meta {
  min-width: 0;
  flex: 1 1 auto;
}

.card-meta h2 {
  margin: 0 0 5px;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 790;
  line-height: 1.08;
  letter-spacing: 0;
}

.card-meta p {
  margin: 0;
  color: var(--blue);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.tagline {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21.5px;
  font-weight: 780;
  line-height: 1.34;
  text-wrap: balance;
}

.summary {
  margin: 18px 0 0;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.78;
}

.fit-line {
  margin: auto 0 0;
  padding-top: 22px;
  font-family: var(--font-sans);
}

.fit-line span {
  display: block;
  margin-bottom: 5px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 820;
}

.fit-line strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chips span {
  border: 1px solid rgba(31, 34, 29, 0.1);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 12px;
}

.card-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  margin-top: 22px;
  border-top: 1px solid var(--line-soft);
  padding-top: 18px;
}

.primary-link {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--green-2), var(--green));
  color: #fff8e9;
  box-shadow: 0 13px 28px rgba(35, 54, 31, 0.2);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 780;
  transition:
    transform 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.product-card:hover .primary-link {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(35, 54, 31, 0.28);
}

.primary-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 200ms var(--ease);
}

.product-card:hover .primary-link svg {
  transform: translateX(3px);
}

/* —— 空状态 —— */
.empty-state {
  grid-column: 1 / -1;
  margin: 40px 0;
  padding: 48px 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  text-align: center;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
}
.empty-state[hidden] {
  display: none;
}

/* —— footer —— */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 22px 0 34px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
}

.footer-copy {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 12px;
}

.footer-brand {
  color: var(--ink);
  font-weight: 820;
}

.footer-copy span {
  color: var(--subtle);
}

.footer-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.footer-link,
.icon-action,
.support-social a {
  border: 1px solid rgba(31, 34, 29, 0.1);
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  transition:
    transform 180ms var(--ease),
    border-color 180ms var(--ease),
    color 180ms var(--ease),
    background-color 180ms var(--ease);
}

.footer-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 760;
}

.icon-action {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
}

.footer-link:hover,
.icon-action:hover,
.support-social a:hover {
  transform: translateY(-1px);
  border-color: rgba(35, 54, 31, 0.24);
  background: rgba(255, 255, 255, 0.92);
  color: var(--green);
}

.icon-action:focus-visible,
.footer-link:focus-visible,
.support-close:focus-visible,
.support-social a:focus-visible,
.search-clear:focus-visible {
  outline: 2px solid rgba(58, 113, 131, 0.6);
  outline-offset: 3px;
}

.icon-action svg,
.support-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.support-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(31, 34, 29, 0.38);
  backdrop-filter: blur(12px);
}

.support-modal[hidden],
.support-panel[hidden] {
  display: none;
}

.support-dialog {
  position: relative;
  width: min(420px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid rgba(31, 34, 29, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 240, 0.96)),
    var(--surface);
  box-shadow: 0 28px 90px rgba(31, 34, 29, 0.22);
}

.support-dialog:focus {
  outline: none;
}

.support-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(31, 34, 29, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  cursor: pointer;
}

.support-panel {
  display: grid;
  justify-items: center;
  padding: 34px 28px 30px;
  text-align: center;
}

.support-kicker {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.support-panel h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.2;
}

.support-panel p:not(.support-kicker) {
  max-width: 28em;
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.support-qr {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(31, 34, 29, 0.1);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 45px rgba(45, 42, 34, 0.1);
}

.support-qr-wechat {
  width: min(260px, 82vw);
}

.support-qr-reward {
  width: min(300px, 82vw);
  aspect-ratio: 1 / 1;
}

.support-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.support-social a {
  display: inline-flex;
  min-width: 88px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 780;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— 尊重「减少动态效果」系统设置 —— */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .product-card {
    animation: none;
  }
  .product-card:hover,
  .product-card:hover .primary-link,
  .product-card:hover .primary-link svg {
    transform: none;
  }
}

@media (max-width: 980px) {
  .site-header {
    padding-inline: 24px;
  }

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

@media (max-width: 680px) {
  .site-header {
    padding: 14px 16px;
  }

  main,
  .site-footer {
    width: min(100% - 28px, 1180px);
  }

  .product-section {
    padding: 30px 0 60px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
  }

  .section-count {
    align-self: flex-start;
  }

  /* 筛选条堆叠：分组一行，分类横滚一行 */
  .filter-bar {
    gap: 8px;
  }

  .search-form {
    width: 100%;
    max-width: 100%;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .product-card {
    min-height: 0;
    padding: 22px 20px 20px;
  }

  .tagline {
    font-size: 21px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-actions {
    flex-wrap: wrap;
  }

  .support-dialog {
    border-radius: 16px;
  }

  .support-panel {
    padding: 32px 20px 24px;
  }
}
