:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --panel: #ffffff;
  --text: #202320;
  --muted: #68706a;
  --line: #d9ded8;
  --accent: #0d6b57;
  --accent-strong: #094b3f;
  --tag-bg: #edf4f1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 max(24px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgb(247 247 244 / 92%);
  backdrop-filter: blur(12px);
}

.brand {
  font-weight: 750;
  color: var(--accent-strong);
}

.nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.nav a:hover,
.article-row h2 a:hover {
  color: var(--accent);
}

main {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 72px;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: 0;
}

.page-head p {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

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

.stats div {
  min-width: 84px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.stats dt {
  color: var(--muted);
  font-size: 12px;
}

.stats dd {
  margin: 2px 0 0;
  font-size: 24px;
  font-weight: 760;
}

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

.article-browser {
  scroll-margin-top: 84px;
}

.article-row {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.article-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.content-type {
  border: 1px solid #b9d3ca;
  border-radius: 999px;
  background: #f2f8f5;
  color: var(--accent-strong);
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
}

.article-row h2 {
  margin: 8px 0 8px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.article-title-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
}

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

.article-row p {
  margin: 0;
  color: #3f4641;
}

.article-row__reason {
  margin-top: 10px !important;
  color: var(--muted) !important;
  font-size: 14px;
}

.article-row__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags a,
.tags span,
.tag-cloud a {
  border: 1px solid #cfddd7;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--accent-strong);
}

.tags a,
.tags span {
  padding: 4px 9px;
  font-size: 12px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
}

.pagination button {
  min-width: 76px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.pagination button:hover:not(:disabled) {
  border-color: #9fc4b7;
  color: var(--accent);
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.detail {
  max-width: 820px;
  margin: 0 auto;
}

.detail__header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.detail h1 {
  margin: 10px 0 14px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

.lead {
  color: #3f4641;
  font-size: 18px;
}

.detail__actions {
  margin: 20px 0;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-weight: 650;
}

.note {
  margin: 24px 0;
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  background: #eef5f1;
}

.note h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.note p {
  margin: 0;
}

.prose {
  margin-top: 32px;
  font-size: 17px;
}

.prose h1,
.prose h2,
.prose h3 {
  margin-top: 1.7em;
  line-height: 1.25;
  letter-spacing: 0;
}

.prose pre {
  overflow: auto;
  padding: 16px;
  border-radius: 8px;
  background: #1f2421;
  color: #f5f7f4;
}

.prose code {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.prose :not(pre) > code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #e7ece8;
}

.prose img {
  max-width: 100%;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tag-cloud a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
}

.tag-cloud strong {
  color: var(--muted);
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.source-grid a {
  display: block;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.source-grid a:hover {
  border-color: #9fc4b7;
  color: var(--accent);
}

.source-grid h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.source-grid p {
  margin: 0;
  color: var(--muted);
}

.search-panel {
  display: grid;
  gap: 18px;
}

.search-box {
  display: grid;
  gap: 8px;
  max-width: 720px;
  color: var(--muted);
  font-size: 14px;
}

.search-box input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.search-box input:focus {
  border-color: var(--accent);
  outline: 3px solid rgb(13 107 87 / 16%);
}

.search-status {
  color: var(--muted);
  font-size: 14px;
}

.search-results {
  display: grid;
  gap: 12px;
}

.search-result {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.search-result h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
}

.search-result h2 a:hover {
  color: var(--accent);
}

.search-result p {
  margin: 0;
  color: #3f4641;
}

.search-result mark {
  border-radius: 3px;
  background: #d8f0a6;
  color: inherit;
}

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

  main {
    width: min(100vw - 24px, 1120px);
    padding-top: 28px;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .article-row {
    padding: 18px;
  }

  .article-row__footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
