:root {
  --bg: #f1e8da;
  --surface: rgba(250, 244, 235, 0.84);
  --ink: #161310;
  --ink-soft: #5f574d;
  --line: rgba(34, 28, 22, 0.12);
  --line-strong: rgba(34, 28, 22, 0.2);
  --gold: #987848;
  --gold-soft: rgba(168, 132, 78, 0.16);
  --red: #9d3425;
  --red-soft: rgba(139, 49, 40, 0.12);
  --navy: #23303a;
  --shadow: 0 24px 60px rgba(24, 23, 20, 0.1);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --content-width: 1180px;
  --heading-font: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --body-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(157, 52, 37, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(35, 48, 58, 0.08), transparent 26%),
    linear-gradient(180deg, #f7efe3 0%, var(--bg) 40%, #f5ede1 100%);
  color: var(--ink);
  font-family: var(--body-font);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.28), rgba(255,255,255,0.28)),
    repeating-linear-gradient(90deg, transparent 0, transparent 72px, rgba(34,28,22,0.03) 72px, rgba(34,28,22,0.03) 73px),
    repeating-linear-gradient(0deg, transparent 0, transparent 72px, rgba(34,28,22,0.03) 72px, rgba(34,28,22,0.03) 73px);
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), transparent 92%);
  z-index: -2;
}

.background-glow {
  position: fixed;
  width: 36rem; height: 36rem;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.55;
  pointer-events: none;
  z-index: -1;
}
.background-glow-left { top: -12rem; left: -10rem; background: rgba(168,132,78,0.2); }
.background-glow-right { top: 24rem; right: -14rem; background: rgba(39,54,68,0.12); }

a { color: inherit; text-decoration: none; }
p, ul, ol, h1, h2, h3 { margin: 0; }

/* ── Layout ── */
.site-header, .section, .site-footer {
  width: min(calc(100% - 2.4rem), var(--content-width));
  margin: 0 auto;
}

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 0;
  background: rgba(247,239,227,0.72);
  border-bottom: 1px solid rgba(34,28,22,0.08);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 0.85rem; }
.brand-mark {
  width: 2.5rem; height: 2.5rem;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--red), #5a1815);
  color: #fff7f0;
  font-family: var(--heading-font);
  font-size: 1.15rem;
  box-shadow: var(--shadow);
}
.brand-copy { display: grid; gap: 0.12rem; }
.brand-copy strong { font-size: 0.98rem; letter-spacing: 0.04em; }
.brand-copy small { color: var(--ink-soft); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; }

.site-nav {
  display: inline-flex; align-items: center; gap: 1.2rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(251,247,240,0.72);
}
.site-nav a { color: var(--ink-soft); font-size: 0.92rem; transition: color 180ms; }
.site-nav a:hover { color: var(--ink); }

/* ── Buttons ── */
.button, .button-secondary {
  cursor: pointer; font: inherit; border: none;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.95rem 1.4rem;
  border-radius: 999px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.button {
  background: linear-gradient(135deg, var(--red), #6b221b);
  color: #fff9f2;
  box-shadow: 0 16px 35px rgba(107,34,27,0.22);
}
.button:hover { transform: translateY(-2px); }

/* ── Sections ── */
.section { padding: 4.8rem 0; }

/* ── Hero (centered) ── */
.hero-centered {
  text-align: center;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  padding-top: 6rem;
  padding-bottom: 3rem;
}
.hero-centered h1 {
  font-family: var(--heading-font);
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.hero-lede {
  margin-top: 1.3rem;
  color: var(--ink-soft);
  font-size: 1.06rem;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 0.9rem;
  justify-content: center;
  margin-top: 2rem;
}
.hero-tags {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  justify-content: center;
  list-style: none; padding: 0;
  margin-top: 2rem;
}
.hero-tags li {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.58);
  color: var(--navy);
  border: 1px solid rgba(39,54,68,0.1);
  font-size: 0.88rem;
}

.eyebrow {
  margin-bottom: 1rem;
  color: var(--red);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

/* ── Section headings ── */
.section-heading { max-width: 52rem; }
.section-heading h2 {
  font-family: var(--heading-font);
  font-size: clamp(2rem, 3vw, 3.3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.section-heading p:last-child { margin-top: 1rem; color: var(--ink-soft); max-width: 64ch; }

/* ── Library toolbar ── */
.library-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.8rem;
  margin-top: 1.8rem;
}
.library-filter {
  cursor: pointer; font: inherit; border: none;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.62);
  color: var(--ink-soft);
  transition: all 180ms;
}
.library-filter.is-active {
  border-color: rgba(139,49,40,0.35);
  background: var(--red-soft);
  color: var(--red);
}

/* ── Library grid ── */
.library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
  margin-top: 1.5rem;
}

.library-card {
  display: flex;
  flex-direction: column;
  padding: 1.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.library-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 70px rgba(24,23,20,0.14);
}
.library-card.is-hidden { display: none; }

.library-card h3 {
  margin-top: 0.8rem;
  font-size: 1.22rem;
  font-family: var(--heading-font);
}
.library-card p {
  margin-top: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.card-meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
  flex: 1;
  align-items: flex-end;
}
.card-meta span {
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(39,54,68,0.06);
  color: var(--ink-soft);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.tier-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.tier-free {
  background: rgba(39,54,68,0.08);
  color: var(--navy);
}
.tier-paid {
  background: var(--red-soft);
  color: var(--red);
}

/* ── Card CTA ── */
.card-cta {
  cursor: pointer;
  font: inherit;
  margin-top: 1.2rem;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  border: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: transform 180ms, box-shadow 180ms;
  text-align: center;
}
.card-cta:hover { transform: translateY(-1px); }

.card-cta-free {
  background: rgba(39,54,68,0.08);
  color: var(--navy);
  border: 1px solid rgba(39,54,68,0.12);
}
.card-cta-paid {
  background: linear-gradient(135deg, var(--red), #6b221b);
  color: #fff9f2;
  box-shadow: 0 8px 20px rgba(107,34,27,0.18);
}

/* ── Steps ── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem;
  margin-top: 2rem;
}
.step-card {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  text-align: center;
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 2.6rem; height: 2.6rem;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-weight: 700;
  font-size: 1.1rem;
}
.step-card h3 {
  margin-top: 0.8rem;
  font-family: var(--heading-font);
  font-size: 1.2rem;
}
.step-card p {
  margin-top: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ── Contact (centered) ── */
.contact-centered {
  text-align: center;
  max-width: 62rem;
  margin: 0 auto;
}
.contact-centered h2 {
  font-family: var(--heading-font);
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  line-height: 1.2;
}
.contact-centered .hero-lede {
  font-size: 1rem;
}
.contact-channels {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  text-align: left;
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
}
.contact-card-wechat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}
.wechat-qr-img {
  width: 200px;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.wechat-note {
  color: var(--ink-soft);
  font-size: 0.88rem;
  text-align: center;
}
.contact-info-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.5rem 1.8rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.contact-panel-title {
  font-family: var(--heading-font);
  font-size: 1.1rem;
  color: var(--ink) !important;
  font-weight: 600;
}
.contact-info-panel p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}
.contact-info-panel strong {
  color: var(--ink);
}
.contact-hint {
  margin-top: 0.3rem;
  font-size: 0.88rem !important;
  color: var(--gold) !important;
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 2rem 0 3.5rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ── Modal ── */
.resource-modal {
  width: min(92vw, 30rem);
  padding: 0; border: none;
  border-radius: var(--radius-lg);
  background: transparent;
}
.resource-modal::backdrop {
  background: rgba(20,16,12,0.38);
  backdrop-filter: blur(5px);
}
.modal-shell {
  position: relative;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fbf7f0;
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 2.3rem; height: 2.3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  color: var(--ink-soft);
  font-size: 1.2rem;
  cursor: pointer;
}
.modal-shell h2 {
  margin-top: 0.6rem;
  font-family: var(--heading-font);
  font-size: 1.6rem;
  line-height: 1.2;
}
.modal-shell p {
  margin-top: 0.7rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.modal-price-line {
  margin-top: 0.9rem;
  color: var(--red);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.modal-payments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}
.modal-payment-card {
  margin: 0;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.7);
  text-align: center;
}
.modal-payment-card figcaption {
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 600;
}
.modal-payment-card img {
  width: 100%;
  max-width: 180px;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid rgba(34,28,22,0.08);
  background: #ffffff;
}
.modal-payment-primary {
  border-color: rgba(139,49,40,0.18);
}
.modal-download {
  margin-top: 1rem;
}
.modal-download .button {
  width: 100%;
}
.modal-paid-gate {
  margin-top: 1.2rem;
  text-align: center;
}
.modal-paid-gate .button {
  width: 100%;
  background: var(--gold);
  box-shadow: 0 8px 20px rgba(152,120,72,0.2);
}
.modal-download-area {
  margin-top: 1.2rem;
  padding: 1.2rem;
  border-radius: var(--radius-md);
  background: rgba(139,49,40,0.06);
  border: 1px solid rgba(139,49,40,0.15);
  text-align: center;
}
.modal-unlock-msg {
  color: var(--red) !important;
  font-weight: 600;
  margin-top: 0 !important;
  margin-bottom: 0.8rem;
}
.modal-download-btn {
  width: 100%;
}
.modal-delivery {
  margin-top: 1.2rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius-md);
  background: rgba(168,132,78,0.06);
  border: 1px solid rgba(168,132,78,0.15);
}
.modal-delivery-title {
  font-weight: 600;
  color: var(--ink) !important;
  margin-top: 0 !important;
  font-size: 0.95rem;
}
.modal-delivery ol {
  margin: 0.6rem 0 0;
  padding-left: 1.3rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.7;
}
.modal-wechat-qr {
  display: block;
  width: 140px;
  margin: 1rem auto 0;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.modal-contact-meta {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.modal-contact-meta strong {
  color: var(--ink);
}
.modal-actions { margin-top: 1.6rem; }

/* ── Scroll reveal ── */
.reveal { opacity: 1; transform: none; }
.motion-ready .reveal {
  opacity: 0; transform: translateY(28px);
  transition: transform 600ms cubic-bezier(0.2,1,0.2,1), opacity 500ms ease;
}
.motion-ready .reveal.is-visible {
  opacity: 1; transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 1080px) {
  .site-nav { display: none; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .site-header, .section, .site-footer {
    width: min(calc(100% - 1.2rem), var(--content-width));
  }
  .section { padding: 3.6rem 0; }
  .hero-centered { padding-top: 4rem; }
  .hero-centered h1 br { display: none; }
  .library-grid, .steps-grid { grid-template-columns: 1fr; }
  .modal-payments { grid-template-columns: 1fr; }
  .contact-channels { grid-template-columns: 1fr; }
  .contact-card-wechat { order: -1; }
  .hero-actions { flex-direction: column; align-items: stretch; }
}
