/* ============================================================
   Feedforward 3DGS Survey — stylesheet
   Aesthetic: academic, calm, content-first.
   Modeled on the 3dgs-large-scale survey site.
   ============================================================ */

:root {
  --bg:        #fbf9f4;
  --bg-soft:   #f3efe5;
  --bg-card:   #ffffff;
  --ink:       #1f2024;
  --ink-soft:  #4a4d57;
  --ink-faint: #8a8d97;
  --line:      #e5e0d3;
  --accent:    #b6552e;   /* burnt orange */
  --accent-soft:#ecd5c8;
  --accent2:   #2a6f6b;   /* teal */
  --accent3:   #c08a2c;   /* mustard */
  --code-bg:   #1d1f24;
  --code-ink:  #e4e2db;
  --math-bg:   #f6f1e3;
  --shadow:    0 1px 2px rgba(0,0,0,.04), 0 6px 18px rgba(0,0,0,.04);
  --radius:    8px;
  --maxw:      820px;
  --font-body: "Charter","Iowan Old Style","Source Serif Pro","Noto Serif SC",ui-serif,Georgia,serif;
  --font-ui:   "Inter","Helvetica Neue","Noto Sans SC",ui-sans-serif,system-ui,sans-serif;
  --font-mono: "JetBrains Mono","Fira Code",ui-monospace,Menlo,monospace;

  /* Era colors — keep semantic, tuned to harmonize with the warm palette */
  --era-0: #6b7280;
  --era-1: #2563eb;
  --era-2: #7c3aed;
  --era-3: #2a6f6b;
  --era-4: #b6552e;
  --era-5: #b91c1c;
  --era-6: #0e7490;
  --era-7: #be185d;
  --era-8: #4338ca;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ----- Top breadcrumb --------------------------------------- */
.site-breadcrumb {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 0.5em;
  padding: 0.5em 1.25em;
  font: 500 13px/1.4 var(--font-ui);
  color: #4a463c;
  background: rgba(251, 249, 244, 0.85);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.site-breadcrumb a {
  color: #4a463c; text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: border-color 0.15s ease;
}
.site-breadcrumb a:hover { border-bottom-color: currentColor; }
.site-breadcrumb .sep { opacity: 0.4; margin: 0 0.15em; }
.site-breadcrumb .here { color: #1a1a1a; font-weight: 600; }

/* ----- Layout ------------------------------------------------ */
.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  max-width: 1220px;
  margin: 0 auto;
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 28px 22px 40px;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
  font-family: var(--font-ui);
  font-size: 14px;
}
.sidebar h1 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -.01em;
}
.sidebar .subtitle {
  color: var(--ink-faint);
  font-size: 12px;
  margin-bottom: 18px;
  line-height: 1.4;
}
.toc { list-style: none; padding: 0; margin: 14px 0 0; }
.toc > li { margin: 0; }
.toc a {
  display: block;
  padding: 5px 8px;
  border-radius: 4px;
  color: var(--ink-soft);
  text-decoration: none;
  line-height: 1.35;
}
.toc a:hover { background: var(--accent-soft); color: var(--ink); }
.toc a.active { color: var(--accent); font-weight: 600; }
.toc .group {
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--ink-faint);
  padding: 14px 8px 4px;
  font-weight: 600;
}
.toc .nested { padding-left: 12px; font-size: 13px; }
.toc .era-dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  margin-right: 8px; vertical-align: middle;
}

main {
  padding: 56px 64px 120px 56px;
  max-width: 100%;
}
.col {
  max-width: var(--maxw);
  margin: 0;
}

/* ----- Typographic primitives -------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-ui); letter-spacing: -.012em; }
h1 { font-size: 44px; line-height: 1.05; margin: 0 0 8px; font-weight: 800; }
h2 {
  font-size: 28px;
  line-height: 1.2;
  margin: 64px 0 12px;
  font-weight: 700;
  border-top: 1px solid var(--line);
  padding-top: 36px;
}
h2 .num {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 500;
  margin-right: 12px;
  font-size: 18px;
  vertical-align: 4px;
}
h3 { font-size: 22px; margin: 38px 0 8px; font-weight: 700; }
h4 { font-size: 16px; margin: 22px 0 6px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }
p { margin: 0 0 14px; }
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
a:hover { border-bottom-color: var(--accent); }
strong { color: var(--ink); font-weight: 700; }
em { font-style: italic; color: var(--ink-soft); }
hr { border: 0; height: 1px; background: var(--line); margin: 36px 0; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin: 4px 0; }

/* ----- Hero -------------------------------------------------- */
.hero {
  margin: 0 0 48px;
  padding: 18px 0 24px;
}
.hero .kicker {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 14px;
}
.hero .lede {
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 720px;
  margin: 18px 0 10px;
}
.hero .meta {
  font-family: var(--font-ui);
  color: var(--ink-faint);
  font-size: 13px;
  margin-top: 18px;
}
.hero .meta span { margin-right: 14px; }

/* ----- Chapter intro (italic lede after each h2) ------------ */
.chapter-intro {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-soft);
  border-left: 3px solid var(--line);
  padding: 4px 0 4px 16px;
  margin: 0 0 28px;
}

/* ----- Paper cards ------------------------------------------ */
.paper {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--era-0);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 22px 0 28px;
  box-shadow: var(--shadow);
}
.paper.era-1 { border-left-color: var(--era-1); }
.paper.era-2 { border-left-color: var(--era-2); }
.paper.era-3 { border-left-color: var(--era-3); }
.paper.era-4 { border-left-color: var(--era-4); }
.paper.era-5 { border-left-color: var(--era-5); }
.paper.era-6 { border-left-color: var(--era-6); }
.paper.era-7 { border-left-color: var(--era-7); }
.paper.era-8 { border-left-color: var(--era-8); }

.paper-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  font-family: var(--font-ui);
}
.paper-head .alias {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.paper-head .full {
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 400;
}
.paper-meta {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
.paper-meta .tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-right: 6px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .02em;
}
.paper-meta .tag.teal  { background: #d6e8e6; color: var(--accent2); }
.paper-meta .tag.mustard { background: #f3e2bf; color: #8a6512; }
.paper-meta a {
  color: var(--ink-soft);
  border-bottom: none;
  margin-right: 12px;
}
.paper-meta a:hover { color: var(--accent); }

/* The one-sentence "key idea" — replaces .pitch from old version */
.paper .pitch {
  font-style: italic;
  color: var(--ink-soft);
  margin: 4px 0 14px;
  padding-left: 12px;
  border-left: 3px solid var(--accent-soft);
  font-size: 16.5px;
}
.paper .pitch::before {
  content: "一句话核心 · ";
  font-family: var(--font-ui);
  font-style: normal;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}

/* Definition-list style structured rows */
.paper-rows {
  margin: 12px 0;
  font-family: var(--font-ui);
  font-size: 14.5px;
}
.paper-rows .row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.paper-rows .row:last-child { border-bottom: none; }
.paper-rows .label {
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-top: 2px;
}
.paper-rows .val { color: var(--ink); }
.paper-rows .val p { margin: 0 0 6px 0; }
.paper-rows .val p:last-child { margin-bottom: 0; }

/* "Takeaway for beginners" — last block of each card */
.paper .takeaway {
  margin-top: 14px;
  padding: 10px 14px;
  background: #f0f6f5;
  border-left: 3px solid var(--accent2);
  border-radius: 0 4px 4px 0;
  font-size: 14.5px;
  color: var(--ink);
  font-family: var(--font-ui);
}
.paper .takeaway::before {
  content: "给入门者的一句话 · ";
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent2);
  display: block;
  margin-bottom: 4px;
}

/* Optional highlight for centerpiece papers (VGGT, StreamVGGT, π³) */
.paper.featured {
  border-left-width: 6px;
  background: linear-gradient(to right, #fdf6ee 0%, var(--bg-card) 30%);
}

/* ----- Callouts --------------------------------------------- */
.callout {
  background: var(--math-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 22px 0;
  border-left: 4px solid var(--accent3);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
}
.callout-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent3);
  margin-bottom: 8px;
}
.callout.intuition { border-left-color: var(--accent2); background: #eef5f4; }
.callout.intuition .callout-title { color: var(--accent2); }
.callout.warn { border-left-color: var(--accent); background: #fbeee6; }
.callout.warn .callout-title { color: var(--accent); }

/* Inline "analogy" pattern — same as .callout.intuition but with auto label */
.analogy {
  background: #eef5f4;
  border-left: 4px solid var(--accent2);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 20px 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}
.analogy::before {
  content: "类比";
  display: block;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent2);
  margin-bottom: 6px;
}

/* ----- Code ------------------------------------------------- */
code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-soft);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent);
}
pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 18px 22px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 18px 0;
}
pre code { background: transparent; color: inherit; padding: 0; font-size: inherit; }

/* ----- Tables ----------------------------------------------- */
.tbl {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-family: var(--font-ui);
  font-size: 14px;
}
.tbl th, .tbl td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.tbl th {
  background: var(--bg-soft);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tbl tr:hover td { background: #fffaf2; }

/* ----- Timeline (visual chronology) ------------------------- */
.timeline {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 22px 0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  box-shadow: var(--shadow);
}
.timeline-row {
  display: grid;
  grid-template-columns: 80px 14px 1fr;
  gap: 8px 12px;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}
.timeline-row:last-child { border-bottom: none; }
.timeline-row .date { color: var(--ink-faint); }
.timeline-row .dot { width: 8px; height: 8px; border-radius: 50%; align-self: center; }
.timeline-row .name { font-family: var(--font-ui); color: var(--ink); }
.timeline-row .venue { color: var(--ink-faint); font-size: 12px; margin-left: 6px; }

/* ----- Family-tree / SVG figure container ------------------ */
.lineage, .figure {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin: 26px 0;
  font-family: var(--font-ui);
  box-shadow: var(--shadow);
  text-align: center;
}
.lineage svg, .figure svg { width: 100%; height: auto; display: block; max-width: 100%; }
.figure .caption, .lineage .caption {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 14px;
  text-align: center;
}

/* ----- Glossary ---------------------------------------------- */
.glossary dt {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  margin-top: 18px;
}
.glossary dd {
  margin-left: 0;
  margin-top: 4px;
  font-size: 16px;
  color: var(--ink-soft);
}

/* ----- References list -------------------------------------- */
.refs {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.65;
}
.refs h4 {
  margin-top: 26px;
  margin-bottom: 8px;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
}
.refs ol { padding-left: 26px; }
.refs li { margin-bottom: 4px; color: var(--ink-soft); }
.refs li strong { color: var(--ink); }

/* ----- Footer ------------------------------------------------ */
footer {
  margin-top: 80px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
}
footer a { color: var(--ink-soft); border-bottom: 1px dotted var(--line); }

/* ----- Responsive ------------------------------------------- */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: relative; height: auto; border-right: none;
    border-bottom: 1px solid var(--line); padding: 18px 22px;
  }
  main { padding: 32px 22px 80px; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  h1 { font-size: 32px; }
  h2 { font-size: 22px; margin-top: 44px; }
  .paper { padding: 16px 18px; }
  .paper-rows .row { grid-template-columns: 1fr; gap: 4px; }
  .paper-rows .label { font-size: 11px; }
}

section { scroll-margin-top: 30px; }
