/* memefern 样式（T4 像素复刻批）：严格按 doc/design/2026-11-08/design-tokens.json。
   琥珀暖纸感体系：米色底 / 深棕墨 / 单橙强调；Inter 自托管 variable woff2（家族同源自托管口径）。
   红线：禁紫罗兰色值；禁第三方字体/资源外链；装饰琥珀 #E59A2F 不作小字文本色。 */

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* color tokens */
  --bg: #FBF6EE;
  --bg-deep: #F5EBDD;
  --card: #FFFFFF;
  --line: #EAE0D2;
  --ink: #2A211B;
  --ink-soft: #6B5D50;
  --ink-mute: #7A6C5D;
  --amber: #E59A2F;
  --amber-deep: #8F5A0C;
  --amber-tint: #FBF0DC;
  --amber-soft: #F4DDB4;
  --coral: #D96A3B;
  --coral-deep: #9C451F;
  --coral-tint: #FAE7DE;
  --dark: #2B201B;
  --dark-card: #3A2B21;
  --cream: #F5EDE3;

  /* shadow tokens */
  --shadow-card: 0 12px 32px rgba(42, 33, 27, 0.10);
  --shadow-card-sm: 0 8px 20px rgba(42, 33, 27, 0.08);
  --shadow-row: 0 4px 14px rgba(42, 33, 27, 0.06);

  /* radius tokens */
  --radius-card: 16px;
  --radius-row: 12px;
  --radius-badge: 12px;
  --radius-chip: 2px;

  --maxw: 1152px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 21px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
/* 氛围光斑（tokens.glowAmbient：右上琥珀 / 左下珊瑚，纯装饰） */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(640px 480px at 88% -8%, rgba(229, 154, 47, 0.15), rgba(229, 154, 47, 0)),
    radial-gradient(560px 420px at -6% 104%, rgba(217, 106, 59, 0.10), rgba(217, 106, 59, 0));
}

a { color: var(--amber-deep); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

h1, h2, h3 { margin: 0; color: var(--ink); }
p { margin: 0; }

.kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--amber-deep);
}

/* ---------- 头尾壳 ---------- */
.site-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; max-width: var(--maxw); margin: 0 auto;
  padding: 20px 32px;
  border-bottom: 1px solid var(--line);
}
.site-brand { display: flex; align-items: baseline; }
.site-logo { font-weight: 800; font-size: 20px; text-decoration: none; color: var(--ink); letter-spacing: -0.2px; }
.site-logo::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); margin-left: 6px; }
.site-tagline { font-size: 13px; color: var(--ink-mute); margin-left: 10px; }
.site-nav { display: flex; gap: 28px; }
.site-nav a { text-decoration: none; font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.site-nav a:hover { color: var(--ink); }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.site-footer {
  margin-top: 96px;
  background: var(--dark);
  color: var(--cream);
}
.site-footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 36px 32px 40px; }
.site-footer .site-logo { color: var(--cream); }
.site-footer-top { display: flex; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; gap: 24px; }
.site-footer nav a { color: var(--cream); opacity: 0.82; text-decoration: none; font-size: 13px; }
.site-footer nav a:hover { opacity: 1; }
.site-footer-rule { border: 0; border-top: 1px solid var(--dark-card); margin: 24px 0 16px; }
.colophon { margin: 0; font-size: 12px; color: var(--cream); opacity: 0.62; }

/* ---------- 首页 ---------- */
.hero { text-align: center; padding: 76px 0 64px; max-width: 720px; margin: 0 auto; }
.hero h1 {
  font-size: 46px;
  line-height: 54px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin: 18px 0 20px;
}
.hero h1 .accent { color: var(--amber-deep); font-style: italic; }
.hero-sub { font-size: 16px; line-height: 26px; color: var(--ink-soft); max-width: 620px; margin: 0 auto; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section-head h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.3px; }
.section-note { font-size: 13px; color: var(--ink-mute); }

.meme-wall { margin-top: 8px; }
.meme-wall-grid {
  list-style: none; margin: 28px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.meme-card a {
  display: flex; flex-direction: column;
  height: 100%;
  padding: 22px;
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.meme-card a::before {
  content: '';
  display: block;
  width: 36px; height: 4px;
  border-radius: var(--radius-chip);
  background: var(--amber);
  margin-bottom: 16px;
}
.meme-card a:hover { box-shadow: 0 16px 40px rgba(42, 33, 27, 0.14); transform: translateY(-2px); }
.meme-card-name { display: block; font-size: 18px; font-weight: 600; color: var(--ink); line-height: 24px; }
.meme-card-blurb { display: block; font-size: 14px; line-height: 21px; color: var(--ink-soft); margin-top: 8px; }
.meme-card-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.aka-pill {
  display: inline-block;
  height: 24px; line-height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-badge);
  background: var(--amber-tint);
  color: var(--amber-deep);
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.meme-card-since { font-size: 12px; color: var(--ink-mute); white-space: nowrap; }

/* ---------- 词条页 ---------- */
.breadcrumb { font-size: 13px; color: var(--ink-mute); padding: 20px 0 0; }
.breadcrumb a { color: var(--ink-mute); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { margin: 0 8px; color: var(--line); }
.breadcrumb .current { font-weight: 600; color: var(--ink); }

/* 头区（H1+首段证据块）全宽，下方两栏：左内容右 sticky 速览卡。
   不能把 lede 放进 grid 与 aside 同 row——aside 高度会撑开首行造成 471px 空白峡谷 */
.entry-lede { min-width: 0; }
.entry-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 0 56px;
  align-items: start;
  padding-bottom: 32px;
}
.entry-main { min-width: 0; }
.entry-header h1 { font-size: 44px; font-weight: 800; letter-spacing: -0.8px; margin: 20px 0 18px; }
.evidence-lede { font-size: 17px; line-height: 28px; color: var(--ink); max-width: 44rem; }
.evidence-lede a { color: var(--amber-deep); }
.entry-byline { font-size: 12.5px; color: var(--ink-mute); margin-top: 14px; }

/* 右栏：sticky 速览卡 + 锚点目录（修正指令 #3） */
.entry-aside { min-width: 0; align-self: stretch; /* sticky 需要包含块=整行高度 */ }
.aside-stack { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 20px; }

.quick-info {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.quick-info::before {
  content: '';
  display: block;
  width: 36px; height: 4px;
  border-radius: var(--radius-chip);
  background: var(--amber);
  margin-bottom: 14px;
}
.quick-info .kicker { display: block; margin-bottom: 6px; }
.quick-info dl { margin: 0; }
.quick-info .qi-row {
  display: grid; grid-template-columns: 108px 1fr; gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.quick-info .qi-row:first-of-type { border-top: 0; }
.quick-info dt {
  font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--ink-mute);
  padding-top: 2px;
}
.quick-info dd { margin: 0; font-size: 13.5px; font-weight: 500; color: var(--ink); line-height: 20px; }
.quick-info dd a { color: var(--amber-deep); }

.toc-card {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card-sm);
  padding: 20px 24px;
}
.toc-card .kicker { display: block; margin-bottom: 10px; }
.toc-card ul { list-style: none; margin: 0; padding: 0; }
.toc-card li { margin: 8px 0; }
.toc-card a { font-size: 13.5px; color: var(--ink-soft); text-decoration: none; }
.toc-card a:hover { color: var(--amber-deep); }

/* 词条区块统一节奏 */
.meme-entry .entry-section { margin-top: 72px; }
.meme-entry .entry-section > .kicker { display: block; margin-bottom: 10px; }
.meme-entry .entry-section > h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.3px; }
.meme-entry .section-intro { font-size: 14px; line-height: 22px; color: var(--ink-soft); margin-top: 12px; }

/* 认领区 Names */
.name-rows { list-style: none; margin: 20px 0 0; padding: 0; }
.name-row { margin: 18px 0; }
.name-row h3 { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; }
.badge {
  display: inline-block;
  height: 24px; line-height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-badge);
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  white-space: nowrap;
}
.badge-umbrella { background: var(--amber); color: var(--ink); }
.badge-instance { background: var(--amber-tint); color: var(--amber-deep); }
.name-row .name-desc { font-size: 13.5px; line-height: 21px; color: var(--ink-soft); margin-top: 6px; }
.name-row .aka-basis { font-style: normal; }

/* 用法区 Usage：2×2 白卡 + coralTint 警示卡 */
.usage-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  list-style: none; margin: 20px 0 0; padding: 0;
}
.usage-card {
  background: var(--card);
  border-radius: var(--radius-row);
  box-shadow: var(--shadow-card-sm);
  padding: 20px 22px;
}
.usage-card h3 { font-size: 13.5px; font-weight: 600; }
.usage-card p { font-size: 13px; line-height: 20px; color: var(--ink-soft); margin-top: 8px; }
.usage-caution {
  background: var(--coral-tint);
  border-left: 4px solid var(--coral);
  border-radius: var(--radius-row);
  padding: 20px 22px;
  box-shadow: none;
}
.usage-caution h3 { color: var(--coral-deep); }
.usage-caution p { color: var(--ink); }

/* 出处区 Origin & timeline */
.timeline { list-style: none; margin: 20px 0 0; padding: 0; }
.timeline li {
  display: grid; grid-template-columns: 96px 1fr; gap: 20px;
  margin: 18px 0;
}
.timeline .t-year { font-size: 14px; font-weight: 700; color: var(--amber-deep); }
.timeline .t-text { font-size: 14px; line-height: 22px; color: var(--ink-soft); }
.source-block { margin-top: 28px; }
.source-block .kicker { display: block; margin-bottom: 10px; }
.source-links { list-style: none; margin: 0; padding: 0; }
.source-links li { margin: 10px 0; }
.source-links a { font-size: 13px; color: var(--amber-deep); }

/* 模板区 Templates：主 CTA + 链接卡行 + 脚注 */
.template-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 20px;
  padding: 18px 24px;
  border-radius: var(--radius-row);
  background: var(--amber);
  color: var(--ink);
  font-size: 14px; font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-row);
}
.template-cta:hover { color: var(--ink); background: var(--amber-soft); }
.template-cta .ext { font-weight: 400; }
.template-list { list-style: none; margin: 14px 0 0; padding: 0; }
.template-list li { margin: 12px 0; }
.template-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px;
  background: var(--card);
  border-radius: var(--radius-row);
  box-shadow: var(--shadow-row);
  text-decoration: none;
}
.template-list a:hover { box-shadow: var(--shadow-card-sm); }
.template-list .t-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.template-list .t-sub { display: block; font-size: 12px; color: var(--ink-mute); margin-top: 2px; font-weight: 400; }
.template-list .t-arrow { color: var(--ink-mute); font-size: 15px; }
.template-note { font-size: 12px; color: var(--ink-mute); margin-top: 16px; }
.template-note li { margin: 10px 0; }

/* FAQ：白卡平铺行（52–56 高），无嵌套卡 */
.faq-list { margin: 20px 0 0; padding: 0; }
.faq-item {
  background: var(--card);
  border-radius: var(--radius-row);
  box-shadow: var(--shadow-row);
  margin: 12px 0;
  padding: 0;
}
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  list-style: none; cursor: pointer;
  padding: 17px 22px;
  font-size: 15px; font-weight: 600; color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .chev { color: var(--ink-mute); font-size: 17px; line-height: 1; }
.faq-item[open] summary .chev { transform: rotate(90deg); }
.faq-item .faq-a { padding: 0 22px 18px; font-size: 14px; line-height: 22px; color: var(--ink-soft); }

/* Related：4 列卡 */
.related-grid {
  list-style: none; margin: 20px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.related-card a {
  display: flex; flex-direction: column; height: 100%;
  padding: 18px;
  background: var(--card);
  border-radius: var(--radius-row);
  box-shadow: var(--shadow-row);
  text-decoration: none;
}
.related-card a:hover { box-shadow: var(--shadow-card-sm); }
.related-card-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.related-card-blurb { font-size: 12.5px; line-height: 19px; color: var(--ink-soft); margin-top: 6px; }
.related-card-meta { font-size: 11.5px; color: var(--ink-mute); margin-top: auto; padding-top: 12px; }

/* 静态页（about/privacy） */
.page-static { max-width: 46rem; padding: 40px 0; }
.page-static h1 { font-size: 36px; font-weight: 800; margin-bottom: 20px; }
.page-static h2 { font-size: 22px; font-weight: 700; margin-top: 32px; }
.page-static p { margin: 12px 0; color: var(--ink-soft); font-size: 15px; line-height: 24px; }
.author-sameas { font-size: 13px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .meme-wall-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .entry-body { grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; }
}

@media (max-width: 760px) {
  .site-header { padding: 16px 20px; }
  .site-tagline { display: none; } /* 稿：mobile 头部去 tagline */
  .site-nav { gap: 18px; }
  main { padding: 0 20px; }
  .hero { padding: 52px 0 44px; }
  .hero h1 { font-size: 32px; line-height: 40px; letter-spacing: -0.5px; }
  .hero-sub { font-size: 15px; line-height: 24px; }
  .section-head h2 { font-size: 22px; }
  .meme-wall-grid { grid-template-columns: 1fr; gap: 16px; }
  .entry-body {
    grid-template-columns: 1fr;
    gap: 0;
  }
  /* mobile：速览卡紧随首段、整宽（稿序）——DOM 里 aside 在 main 后，用 order 提前 */
  .entry-aside { order: -1; margin-top: 28px; }
  .aside-stack { position: static; }
  .meme-entry .entry-section { margin-top: 56px; }
  .meme-entry .entry-section > h2 { font-size: 22px; }
  .usage-grid { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 72px 1fr; gap: 14px; }
  .quick-info .qi-row { grid-template-columns: 96px 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .site-footer-inner { padding: 28px 20px 32px; }
  .site-footer-top { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 420px) {
  .related-grid { grid-template-columns: 1fr; }
}
