:root {
  color-scheme: light dark;
  --background: light-dark(#fbfaf6, #161814);
  --surface: light-dark(#fffdf8, #1e211b);
  --surface-muted: light-dark(#f2efe7, #242720);
  --text: light-dark(#2f312b, #f1efe6);
  --muted: light-dark(#6f6e65, #b9b6aa);
  --border: light-dark(#d8d0c2, #3c4037);
  --accent: light-dark(#315c49, #9bc8ad);
  --accent-surface: light-dark(#d8e4dd, #284238);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
}

.brand {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.section-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.section-tab {
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.section-tab.is-active {
  background: var(--accent-surface);
  color: var(--text);
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(260px, 0.58fr);
  gap: 28px;
  padding: 28px;
}

.main-copy h1 {
  max-width: 12em;
  margin: 0 0 12px;
  font-family: "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.08;
}

.main-copy p {
  max-width: 62ch;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.tools-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  margin: 18px 0;
}

.searchbox {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.tags,
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.article-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.post-card,
.side-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.post-card {
  padding: 15px;
}

.post-title {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.post-title:hover {
  color: var(--accent);
}

.post-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.post-summary {
  margin: 10px 0 12px;
}

.side-panel {
  align-self: start;
  padding: 16px;
}

.side-panel h2 {
  margin: 0 0 12px;
  font-size: 15px;
  letter-spacing: 0;
}

.graph-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.graph-node {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding: 9px 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.graph-node.is-hot {
  border-color: var(--accent);
  color: var(--text);
}

.graph-node.is-warm {
  color: var(--accent);
}

.comments-slot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 15px 16px;
  }

  .section-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .page-grid {
    grid-template-columns: 1fr;
    padding: 18px 16px;
  }

  .tools-row {
    grid-template-columns: 1fr;
  }
}
