:root {
  color-scheme: light;
  --bg: #f4efe8;
  --bg-2: #ece5dc;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: #fffaf4;
  --text: #19202a;
  --muted: #66707c;
  --line: rgba(25, 32, 42, 0.1);
  --accent: #6b4d3f;
  --accent-2: #c46c45;
  --shadow: 0 20px 60px rgba(62, 45, 34, 0.12);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --content-width: min(1180px, calc(100vw - 32px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(196, 108, 69, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(107, 77, 63, 0.12), transparent 26%),
    linear-gradient(180deg, #f8f3ed 0%, var(--bg) 35%, #f7f3ee 100%);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.2) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 42%, transparent 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  width: var(--content-width);
  margin: 18px auto 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.7);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-family: "Castoro", serif;
  font-size: 1.35rem;
}

.brand-copy strong {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.brand-copy small {
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 20px;
  color: var(--muted);
}

.nav a:hover,
.nav a:focus-visible,
.footer a:hover,
.footer a:focus-visible {
  color: var(--accent);
}

.nav-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-cta {
  padding: 12px 18px;
  background: var(--text);
  color: #fff;
}

.nav-cta:hover,
.button:hover {
  transform: translateY(-1px);
}

main {
  width: var(--content-width);
  margin: 30px auto 64px;
}

.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 24px;
  padding: 28px 0 20px;
}

.hero-copy h1,
.section-heading h2,
.content-main h3,
.project-grid h3,
.notes-grid h3,
.timeline h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Noto Serif SC", serif;
  letter-spacing: 0.01em;
}

.eyebrow,
.kicker {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.7rem, 5vw, 5.2rem);
  line-height: 0.98;
  max-width: 12ch;
}

.lead {
  margin: 22px 0 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  min-width: 140px;
  padding: 13px 18px;
  border: 1px solid transparent;
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 18px 35px rgba(107, 77, 63, 0.24);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 0;
}

.metrics div,
.glass-card,
.content-card,
.editor-card,
.surface {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.metrics div {
  padding: 18px;
  border-radius: var(--radius-lg);
}

.metrics dt {
  font-size: 2rem;
  font-weight: 800;
}

.metrics dd {
  margin: 4px 0 0;
  color: var(--muted);
}

.hero-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.glass-card,
.content-card,
.editor-card,
.surface {
  border-radius: var(--radius-xl);
}

.spotlight {
  padding: 26px;
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.92), rgba(255, 250, 244, 0.74)),
    radial-gradient(circle at top right, rgba(196, 108, 69, 0.14), transparent 38%);
}

.spotlight h2,
.section-heading h2,
.editor-card label,
.content-sidebar h3 {
  margin: 0;
}

.spotlight p {
  color: var(--muted);
  line-height: 1.7;
}

.tags,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tags span,
.pill,
.filter-chip,
.side-link {
  border-radius: 999px;
  border: 1px solid rgba(25, 32, 42, 0.1);
}

.tags span,
.pill,
.filter-chip {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.mini-list {
  padding: 10px;
}

.mini-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 18px;
}

.mini-item + .mini-item {
  border-top: 1px solid var(--line);
}

.mini-item strong {
  font-size: 1rem;
}

.mini-item span {
  color: var(--muted);
}

.surface {
  margin-top: 22px;
  padding: 26px;
}

.section-heading,
.section-title-row,
.card-top,
.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading {
  margin-bottom: 16px;
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section-heading h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
}

.search-wrap {
  min-width: min(420px, 100%);
  flex: 0 1 420px;
}

.search-wrap input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  outline: none;
}

.search-wrap input {
  padding: 14px 16px;
}

.search-wrap input:focus,
textarea:focus {
  border-color: rgba(107, 77, 63, 0.3);
  box-shadow: 0 0 0 4px rgba(196, 108, 69, 0.12);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.filter-chip,
.side-link {
  cursor: pointer;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.filter-chip {
  padding: 10px 14px;
}

.filter-chip.active,
.side-link.active {
  color: #fff;
  background: var(--text);
  border-color: transparent;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.8fr);
  gap: 18px;
}

.section-title-row {
  margin-bottom: 16px;
}

.section-title-row h3 {
  margin: 0;
  font-size: 1.25rem;
}

.card-list {
  display: grid;
  gap: 14px;
}

.content-card {
  padding: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.content-card:hover {
  transform: translateY(-2px);
  border-color: rgba(196, 108, 69, 0.25);
}

.content-card.active {
  border-color: rgba(196, 108, 69, 0.42);
  box-shadow: 0 18px 46px rgba(196, 108, 69, 0.14);
}

.content-card h3 {
  margin: 14px 0 10px;
  font-size: 1.4rem;
}

.content-card .summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.pill.type {
  background: rgba(107, 77, 63, 0.08);
}

.pill.date {
  color: var(--muted);
}

.feature-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.9;
}

.side-panel {
  padding: 20px;
}

.side-links {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.side-link {
  width: 100%;
  padding: 12px 14px;
  text-align: left;
}

.project-grid,
.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-card,
.note-card,
.timeline-item {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.project-card h3,
.note-card h3,
.timeline-item h3 {
  margin: 10px 0 8px;
  font-size: 1.15rem;
}

.project-card p,
.note-card p,
.timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.project-card .status,
.note-card .status,
.timeline-item .status {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.timeline-item time {
  font-weight: 800;
  color: var(--accent);
}

.editor-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.manage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.manage-card {
  padding: 20px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.manage-card h3 {
  margin: 0 0 16px;
  font-size: 1.2rem;
}

.manage-card label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.manage-card input,
.manage-card textarea {
  margin-top: 8px;
}

.editor-card {
  padding: 16px;
}

.editor-card label {
  display: block;
  margin-bottom: 12px;
  font-weight: 700;
}

textarea {
  min-height: 480px;
  padding: 18px;
  resize: vertical;
  line-height: 1.8;
}

.markdown-preview {
  min-height: 480px;
  padding: 2px 4px;
  line-height: 1.9;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Noto Serif SC", serif;
  margin: 1.1em 0 0.5em;
}

.markdown-preview p,
.markdown-preview li {
  color: var(--text);
}

.markdown-preview p {
  margin: 0 0 1em;
}

.markdown-preview code {
  padding: 0.16rem 0.38rem;
  border-radius: 8px;
  background: rgba(25, 32, 42, 0.07);
}

.markdown-preview pre {
  overflow: auto;
  padding: 16px;
  border-radius: 16px;
  background: #17202a;
  color: #f7f2ea;
}

.markdown-preview blockquote {
  margin: 1em 0;
  padding: 14px 18px;
  border-left: 4px solid var(--accent-2);
  background: rgba(196, 108, 69, 0.08);
  color: var(--muted);
}

.markdown-preview img {
  max-width: 100%;
  border-radius: 18px;
}

.footer {
  width: var(--content-width);
  margin: 0 auto 30px;
  padding: 16px 4px 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.footer strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
}

.detail-page {
  width: min(900px, calc(100vw - 32px));
  margin: 28px auto 64px;
}

.detail-back {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--muted);
}

.detail-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 250, 244, 0.82);
  box-shadow: var(--shadow);
}

.detail-card h1 {
  margin: 0 0 16px;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Noto Serif SC", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.detail-meta,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.detail-summary {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.8;
}

.detail-content {
  margin-top: 20px;
}

@media (max-width: 1080px) {
  .hero,
  .content-grid,
  .editor-layout,
  .project-grid,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .search-wrap {
    min-width: 0;
    width: 100%;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .topbar {
    border-radius: 24px;
    margin-top: 10px;
    padding: 14px;
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.95rem;
  }

  main,
  .topbar,
  .footer {
    width: min(100vw - 20px, 1180px);
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .surface {
    padding: 20px;
  }
}

@media (max-width: 560px) {
  .hero-copy h1 {
    max-width: 100%;
    font-size: clamp(2.2rem, 12vw, 3.2rem);
  }

  .lead {
    font-size: 1rem;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-cta {
    width: 100%;
  }

  .section-heading,
  .card-top,
  .meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-card {
    padding: 20px;
  }
}
