/* ============================================================
   喵喵妙算 · Knowledge / Content layer stylesheet  (v2 — refined)
   Drop-in replacement for the old /content.css. Shared by the
   /knowledge/ index, the article pages and /faq/. Tokens are
   inlined so this file stays self-contained for the static SEO
   pages (no build step / no JS bundle required).

   Polished to match the marketing homepage: warm background wash,
   logo-tile header with a CTA, article cards that lift on hover,
   editorial serif headings, branded callouts and an end-of-page
   conversion panel.
   ============================================================ */

@import url('/fonts.css');

:root {
  --bg: #F7F6F4;
  --card: #FFFFFF;
  --line: #E1E6EE;
  --title: #1A1F27;
  --text: #536070;
  --muted: #8490A3;
  --brand: #E9DCC8;
  --brand-gradient: linear-gradient(100deg, #F4ECDC 0%, #E6D5B8 50%, #D2BC95 100%);
  --brand-ink: #1A1F27;
  --brand-deep: #9A6A43;
  --positive: #19B978;
  --negative: #FF5B70;

  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-2xl: 28px;
  --radius-pill: 999px;
  --shadow-sm: 0 18px 50px rgba(34, 33, 28, 0.05);
  --shadow-md: 0 24px 64px rgba(34, 33, 28, 0.08);
  --ease-out: cubic-bezier(0.2, 0.8, 0.25, 1);

  --content-max: 760px;
  --shell-max: 1100px;

  --font-sans: 'Noto Sans SC', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Noto Serif SC', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Warm page wash + a faint logo watermark bleeding off the top-right,
   exactly like the homepage background treatment. */
body {
  position: relative;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% -10%, rgba(241, 235, 226, 0.55) 0%, rgba(247, 246, 244, 0) 48%);
  background-repeat: no-repeat;
}

/* ====================== Header ====================== */

.site-header,
.content-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 246, 244, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner,
.content-header-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Backward-compatible plain text wordmark (old markup). */
.content-logo {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--title);
  text-decoration: none;
}
.content-logo:hover { opacity: 0.8; }

/* Enhanced logo lockup: black tile + name + Latin caption. */
.content-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.content-brand__tile,
.content-brand-logo {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #000;
  display: grid;
  place-content: center;
  overflow: hidden;
}
.content-brand__tile img,
.content-brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.content-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.content-brand__name,
.content-brand-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--title);
}
.content-brand__sub,
.content-brand-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.2;
}

/* Header CTA pill (matches homepage primary button). */
.content-cta {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  background: #F4ECDC;
  color: var(--brand-ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: none;
  transition: transform 0.18s var(--ease-out), opacity 0.18s var(--ease-out);
}
.content-cta::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1px;
  border-radius: inherit;
  background: var(--brand-gradient);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}
.content-cta:hover { transform: translateY(-1px); opacity: 0.92; }
.content-cta--ghost {
  background: var(--card);
  color: var(--title);
  border: 1px solid var(--line);
  box-shadow: none;
}
.content-cta--ghost::before { display: none; }
.content-cta--ghost:hover { border-color: var(--brand); transform: translateY(-1px); opacity: 1; }

.content-header-nav,
.content-nav { display: flex; align-items: center; gap: 12px; }
.content-nav a:not(.content-cta) {
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.content-nav a:not(.content-cta):hover { color: var(--title); opacity: 1; }

/* ====================== Layout shell ====================== */

.content-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px 8px;
}
.content-wrap--wide { max-width: var(--shell-max); }

/* ====================== Breadcrumb ====================== */

nav[aria-label="breadcrumb"] { padding: 24px 0 0; }
body > nav[aria-label="breadcrumb"],
body > header + nav[aria-label="breadcrumb"] {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
.content-wrap nav[aria-label="breadcrumb"] { padding-left: 0; padding-right: 0; }

nav[aria-label="breadcrumb"] ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8125rem;
  color: var(--muted);
}
nav[aria-label="breadcrumb"] ol li + li::before {
  content: '›';
  margin-right: 0.3rem;
  color: var(--muted);
  opacity: 0.6;
}
nav[aria-label="breadcrumb"] a { color: var(--muted); text-decoration: none; }
nav[aria-label="breadcrumb"] a:hover { color: var(--title); }

/* ====================== Index hero ====================== */

.kb-hero {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 48px 24px 8px;
  text-align: center;
}
.kb-hero__eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}
.kb-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--title);
  margin: 16px 0 0;
  text-wrap: balance;
}
.kb-hero p {
  max-width: 540px;
  margin: 18px auto 0;
  font-size: 16px;
  line-height: 1.9;
  color: var(--text);
}

/* ====================== Article-card grid ====================== */

.kb-grid {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 36px 24px 8px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.kb-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.kb-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand); }

.kb-card__tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 12px;
}
.kb-card__title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--title);
}
.kb-card__desc {
  font-size: 14px;
  line-height: 1.85;
  color: var(--text);
  flex: 1;
}
.kb-card__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-deep);
}
.kb-card__more::after {
  content: '→';
  transition: transform 0.2s var(--ease-out);
}
.kb-card:hover .kb-card__more::after { transform: translateX(3px); }

/* ====================== Article main ====================== */

.kb-index-main {
  max-width: none;
  margin: 0;
  padding: 0 0 56px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.kb-index-main nav[aria-label="breadcrumb"] {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 24px 24px 0;
}

main {
  margin-top: 14px;
  margin-bottom: 0;
}
/* The article body sits on a clean white surface card. */
body[data-content-schema="Article"] main,
body[data-content-schema="WebPage"] main,
.content-wrap main {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  padding: 48px 56px;
  box-shadow: var(--shadow-sm);
}
body > main,
body > nav + main,
body > header ~ main {
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
}

/* Article lead: the first paragraph after H1 reads larger & calmer. */
main > article > p:first-of-type {
  font-size: 17px;
  line-height: 1.95;
  color: var(--text);
}

/* ====================== Headings ====================== */

h1 {
  font-family: var(--font-serif);
  font-size: clamp(26px, 4vw, 32px);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--title);
  line-height: 1.35;
  margin: 0 0 12px;
  text-wrap: balance;
}

/* Eyebrow / meta line right under the article H1 (optional markup). */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.article-meta .article-meta__tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 12px;
}

h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--title);
  line-height: 1.45;
  margin: 40px 0 14px;
  padding-left: 16px;
  position: relative;
}
/* A small brand tick before each H2. */
h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 4px;
  border-radius: 999px;
  background: var(--brand);
}

h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--title);
  margin: 26px 0 8px;
}

/* ====================== Body text ====================== */

p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

main a, .faq-answer a {
  color: var(--brand-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(154, 106, 67, 0.3);
  transition: border-color 0.18s var(--ease-out);
}
main a:hover { border-bottom-color: var(--brand-deep); opacity: 1; }

ul, ol { margin: 0 0 16px; padding-left: 1.4rem; }
li { margin-bottom: 0.5rem; line-height: 1.85; }
li::marker { color: var(--brand-deep); }
strong { font-weight: 600; color: var(--title); }

/* Blockquote → a sand-tinted callout card (no bare left-border). */
blockquote {
  margin: 24px 0;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(233, 220, 200, 0.42) 0%, rgba(247, 244, 238, 0.6) 100%);
  border: 1px solid rgba(233, 220, 200, 0.7);
  border-radius: var(--radius-lg);
  color: var(--title);
  font-family: var(--font-serif);
  text-align: center;
  font-size: 17px;
  letter-spacing: 0.04em;
}
blockquote p:last-child { margin-bottom: 0; }

/* ====================== End-of-article CTA panel ====================== */

.kb-cta {
  margin-top: 40px;
  padding: 32px;
  border-radius: var(--radius-2xl);
  background: linear-gradient(135deg, rgba(244, 238, 227, 0.95) 0%, rgba(255, 255, 255, 0.96) 100%);
  border: 1px solid rgba(233, 220, 200, 0.8);
  text-align: center;
}
.kb-cta h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  margin: 0;
  color: var(--title);
}
.kb-cta p {
  max-width: 460px;
  margin: 12px auto 0;
  font-size: 14px;
  line-height: 1.85;
  color: var(--text);
}
.kb-cta .content-cta { margin-top: 24px; height: 48px; padding: 0 28px; font-size: 16px; }

/* ====================== Related articles ====================== */

.kb-related,
.related-articles {
  max-width: var(--content-max);
  margin: 32px auto 0;
  padding: 0 24px;
}
.kb-related__head,
.related-articles h2 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  padding-left: 0;
  font-family: var(--font-sans);
}
.related-articles h2::before { display: none; }
.kb-related__grid,
.related-articles ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.related-articles li { margin: 0; }
.kb-related__grid a,
.related-articles li a {
  display: block;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--title);
  transition: border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.kb-related__grid a:hover,
.related-articles li a:hover { border-color: var(--brand); transform: translateY(-2px); opacity: 1; }

/* ====================== FAQ ====================== */

.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  background: var(--card);
}
.faq-item h2 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--title);
  margin: 0 0 10px;
  padding-left: 0;
}
.faq-item h2::before { display: none; }
.faq-answer { color: var(--text); }
.faq-answer p:last-child { margin-bottom: 0; }

/* ====================== Legacy family-index list ====================== */
/* Old markup (a flat <ul> of links) still gets upgraded into cards. */
section[data-content-template="familyIndexSkeleton"] ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
section[data-content-template="familyIndexSkeleton"] li { margin: 0; }
section[data-content-template="familyIndexSkeleton"] li a {
  display: block;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--title);
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
section[data-content-template="familyIndexSkeleton"] li a:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  opacity: 1;
}

/* ====================== Footer ====================== */

.site-footer,
.content-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  margin-top: 56px;
}
.site-footer__inner,
.content-footer-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 48px 24px;
}
.content-footer-brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.content-footer-wordmark {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--title);
}
.content-footer-social {
  display: inline-flex;
  gap: 8px;
}
.content-footer-social a {
  display: inline-grid;
  place-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--card);
  transition: transform 0.18s var(--ease-out), border-color 0.18s var(--ease-out), background 0.18s var(--ease-out);
}
.content-footer-social a:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  background: var(--brand);
  opacity: 1;
}
.content-footer-social img {
  width: 17px;
  height: 17px;
  opacity: 0.7;
}
.content-footer-subtitle {
  max-width: 42rem;
  margin: 16px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.9;
}
.content-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  margin-top: 32px;
}
.content-footer-link-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.content-footer-link-group a {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--card);
  padding: 6px 12px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  transition: border-color 0.18s var(--ease-out), color 0.18s var(--ease-out);
}
.content-footer-link-group a:hover {
  border-color: var(--brand);
  color: var(--title);
  opacity: 1;
}
.content-footer-copy {
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* ====================== Responsive ====================== */

@media (max-width: 760px) {
  .kb-grid,
  section[data-content-template="familyIndexSkeleton"] ul,
  .kb-related__grid,
  .related-articles ul { grid-template-columns: 1fr; }
  body[data-content-schema="Article"] main,
  .content-wrap main { padding: 28px 22px; }
  .kb-hero { padding-top: 32px; }
  .content-header-nav .content-cta--ghost { display: none; }
  .content-header-inner { padding: 10px 16px; }
  .content-nav-link { display: none; }
  .content-footer-inner { padding: 40px 16px; }
  .content-footer-links { gap: 12px 24px; }
}
