/* ==========================================================================
   红豆心意店 · 统一纸品书局设计系统 (Washi Editorial Design System)
   和纸底色 × 松烟深墨 × 印泥朱砂 × 极细书页框线
   ========================================================================== */

:root {
  color-scheme: light;

  /* Paper & Surface */
  --hd-paper: #f4efe6;
  --hd-paper-2: #fcf9f2;
  --hd-paper-tint: #ece5d7;
  --hd-paper-deep: #e3d9c8;

  /* Ink */
  --hd-ink: #231d18;
  --hd-ink-soft: #61574d;
  --hd-ink-faint: #877c70;

  /* Seal & Accents (matched to hand-drawn brand-logo.png) */
  --hd-shu: #a6362b;
  --hd-shu-deep: #82251c;
  --hd-shu-wash: rgba(166, 54, 43, 0.065);
  --hd-pine: #355847;
  --hd-pine-wash: rgba(53, 88, 71, 0.085);
  --hd-brass: #96774f;
  --hd-focus: #2b635e;

  /* Hairlines & Shadows */
  --hd-line: rgba(35, 29, 24, 0.13);
  --hd-line-strong: rgba(35, 29, 24, 0.25);
  --hd-shadow-soft: 0 18px 42px -28px rgba(42, 31, 20, 0.26);
  --hd-shadow-card: 0 10px 26px -20px rgba(42, 31, 20, 0.22);

  /* Typography */
  --hd-serif: "Stationery Kai", "Stationery Kai Extra", "Songti SC", "STSong", "Noto Serif CJK SC", "Kaiti SC", serif;
  --hd-song: "Songti SC", "STSong", "Noto Serif CJK SC", "Hiragino Mincho ProN", Georgia, serif;
  --hd-sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --hd-num: "Didot", "Bodoni 72", "Baskerville", Georgia, serif;

  /* Geometry */
  --hd-radius: 3px;
  --hd-ease: cubic-bezier(0.22, 0.68, 0.24, 1);
  --hd-container: min(calc(100% - clamp(32px, 8vw, 120px)), 1200px);
}

/* Harmonized Masthead (shared across storefront, virtual, select, postcards, cards) */
.hd-mast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px clamp(16px, 3vw, 40px);
  min-height: 82px;
  border-bottom: 1px solid var(--hd-line);
}

.hd-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.hd-brand img {
  display: block;
  width: auto;
  height: 42px;
  transition: opacity 0.22s var(--hd-ease);
}

.hd-brand:hover img {
  opacity: 0.84;
}

.hd-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: clamp(16px, 2.4vw, 34px);
}

.hd-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 0;
  color: var(--hd-ink-soft);
  font: 400 13.5px/1 var(--hd-sans);
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.22s var(--hd-ease);
}

.hd-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9px;
  height: 1px;
  background: var(--hd-shu);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--hd-ease);
}

.hd-nav-link:hover,
.hd-nav-link[aria-current="page"] {
  color: var(--hd-ink);
}

.hd-nav-link:hover::after,
.hd-nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.hd-nav-link.is-featured {
  color: var(--hd-shu-deep);
  font-weight: 500;
}

.hd-mast-side {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hd-mast-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--hd-line);
  border-radius: 999px;
  background: rgba(252, 249, 242, 0.72);
  color: var(--hd-ink-soft);
  font: 400 11.5px/1 var(--hd-sans);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.hd-mast-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--hd-shu);
  opacity: 0.85;
}

/* Shared editorial buttons */
.hd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--hd-line-strong);
  border-radius: var(--hd-radius);
  background: var(--hd-paper-2);
  color: var(--hd-ink);
  font: 500 14px/1 var(--hd-sans);
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.22s var(--hd-ease), border-color 0.22s var(--hd-ease), color 0.22s var(--hd-ease), transform 0.16s var(--hd-ease);
}

.hd-btn:hover {
  border-color: var(--hd-ink);
  background: #fffdf8;
}

.hd-btn:active {
  transform: translateY(1px);
}

.hd-btn-primary {
  border-color: var(--hd-shu);
  background: var(--hd-shu);
  color: #fdf8ef;
}

.hd-btn-primary:hover {
  border-color: var(--hd-shu-deep);
  background: var(--hd-shu-deep);
  color: #fdf8ef;
}

.hd-btn-ink {
  border-color: var(--hd-ink);
  background: var(--hd-ink);
  color: #fbf7ee;
}

.hd-btn-ink:hover {
  border-color: var(--hd-shu-deep);
  background: var(--hd-shu-deep);
  color: #fbf7ee;
}

.hd-btn-quiet {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid var(--hd-line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--hd-ink-soft);
  font: 400 13.5px/1.2 var(--hd-sans);
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s var(--hd-ease), border-color 0.2s var(--hd-ease);
}

.hd-btn-quiet:hover {
  color: var(--hd-shu-deep);
  border-color: var(--hd-shu);
}

/* Editorial Chapter Index */
.hd-chapter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--hd-shu);
  font: 400 12px/1 var(--hd-sans);
  letter-spacing: 0.16em;
}

.hd-chapter b {
  font: 400 13px/1 var(--hd-num);
  letter-spacing: 0.08em;
  color: var(--hd-shu-deep);
}

.hd-chapter i {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: rgba(166, 54, 43, 0.36);
}

/* Shared Footer */
.hd-foot {
  margin-top: clamp(52px, 7vw, 96px);
  padding: clamp(32px, 4.5vw, 52px) 0 40px;
  border-top: 1px solid var(--hd-line-strong);
}

.hd-foot-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
  flex-wrap: wrap;
}

.hd-foot-brand img {
  display: block;
  width: auto;
  height: 36px;
}

.hd-foot-note {
  margin: 10px 0 0;
  color: var(--hd-ink-soft);
  font-size: 13px;
  line-height: 1.75;
  max-width: 34em;
}

.hd-foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.hd-foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--hd-ink-soft);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: color 0.2s var(--hd-ease);
}

.hd-foot-nav a:hover {
  color: var(--hd-shu-deep);
}

.hd-foot-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--hd-line);
  color: var(--hd-ink-faint);
  font-size: 12px;
  letter-spacing: 0.06em;
}

@media (max-width: 960px) {
  .hd-mast {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 70px;
  }
  .hd-mast-side {
    display: none;
  }
  .hd-nav {
    justify-self: end;
    min-width: 0;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 100%;
  }
  .hd-nav::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 640px) {
  .hd-mast {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-block: 10px 4px;
    gap: 2px;
  }
  .hd-brand img {
    height: 32px;
  }
  .hd-nav {
    justify-self: stretch;
    justify-content: flex-start;
    gap: 14px;
    padding-bottom: 2px;
  }
  .hd-nav-link {
    min-height: 38px;
    font-size: 13px;
    letter-spacing: 0.04em;
  }
  .hd-nav-link::after {
    bottom: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hd-brand img,
  .hd-nav-link,
  .hd-nav-link::after,
  .hd-btn,
  .hd-btn-quiet {
    transition: none;
  }
}
