:root {
  color-scheme: light;
  --paper: #f3f5f0;
  --white: #fff;
  --ink: #182720;
  --muted: #516159;
  --accent: #235640;
  --line: #dce3da;
  --tint: #e7efe5;
  --hero: #14251e;
  --lime: #d5f397;
  --radius: 1.1rem;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: .22em; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid #4a8052; outline-offset: 4px; }
.shell { width: min(100% - 2.5rem, 74rem); min-width: 0; margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--line); background: var(--white); }
.topbar {
  min-height: 4.5rem;
  display: grid;
  grid-template-columns: auto 1fr minmax(12rem, 22rem);
  align-items: center;
  gap: clamp(1rem, 3vw, 2.75rem);
  padding-block: .65rem;
}
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); font-weight: 800; text-decoration: none; }
.brand-name { min-width: 0; }
.mark {
  position: relative;
  flex: 0 0 2.2rem;
  height: 2.2rem;
  border-radius: .65rem;
  background: var(--accent);
  color: var(--lime);
}
.mark::before, .mark::after { content: ""; position: absolute; }
.mark::before { inset: .65rem .55rem .58rem; border: 1.5px solid currentColor; border-radius: .17rem; }
.mark::after { inset: .9rem .57rem auto; border-top: 1.5px solid currentColor; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: .9rem; text-decoration: none; }
.site-nav a:hover { color: var(--accent); text-decoration: underline; }
.search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  gap: .15rem;
  padding: .2rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--paper);
}
.search input {
  min-width: 0;
  width: 100%;
  padding: .45rem .55rem;
  color: var(--ink);
  border: 0;
  border-radius: .45rem;
  background: transparent;
  font-size: 1rem;
}
.search button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-height: 44px;
  padding: .55rem .9rem;
  color: var(--white);
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: .55rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.search button { white-space: nowrap; font-size: .875rem; }
.search button:hover, .button:hover { background: #174330; }
main { flex: 1; padding-bottom: 4rem; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 48% minmax(0, 1fr);
  isolation: isolate;
  min-height: 22rem;
  margin-top: clamp(1rem, 3vw, 2.25rem);
  border-radius: clamp(.85rem, 2vw, 1.65rem);
  overflow: hidden;
  color: var(--white);
  background: var(--hero);
}
.hero-copy {
  align-self: center;
  z-index: 1;
  min-width: 0;
  padding: clamp(1.6rem, 5.5vw, 4.5rem);
  padding-inline-end: 0;
}
h1 { margin: 0; font-size: clamp(1.9rem, 4.5vw, 3.25rem); line-height: 1.24; font-weight: 800; }
.hero h1 { font-size: clamp(2.2rem, 5.3vw, 4.25rem); line-height: 1.1; }
.hero p { max-width: 26rem; margin: 1rem 0 1.5rem; color: #d1e0d1; line-height: 1.7; }
.hero .hero-button { color: #192917; background: var(--lime); }
.hero .hero-button:hover { background: #e5fbbd; }
.hero .hero-button:focus-visible { outline-color: var(--lime); }
.hero-visual { position: relative; min-width: 0; }
.hero-visual img { display: block; position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: 62% 53%; }
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--hero), transparent 30%);
}
.page-intro { padding-block: clamp(2rem, 6vw, 4.5rem) 1.2rem; }
.page-intro p { margin: .7rem 0 0; color: var(--muted); line-height: 1.7; }
.catalog { margin-top: 1.2rem; scroll-margin-top: 1rem; }
.hero + .catalog { margin-top: clamp(1.6rem, 4vw, 3.4rem); }
.catalog-heading { margin: 0 0 .85rem; font-size: clamp(1.3rem, 2.7vw, 1.85rem); line-height: 1.25; }
.categories { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.categories a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  padding: .35rem .85rem;
  color: var(--accent);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2rem;
  font-size: .875rem;
  text-decoration: none;
}
.categories a:hover { background: var(--tint); }
.categories a[aria-current] { border-color: var(--accent); background: var(--accent); color: var(--white); font-weight: 700; }

.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 .2rem .65rem #18332408;
}
.card:hover, .card:focus-within { border-color: #8ca48e; }
.metadata { display: flex; flex-wrap: wrap; gap: .4rem .85rem; align-items: center; color: var(--muted); font-size: .825rem; }
.metadata time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.card .metadata { justify-content: space-between; }
.category-label {
  position: relative;
  z-index: 1;
  padding: .22rem .58rem;
  border-radius: .35rem;
  color: var(--accent);
  background: var(--tint);
  font-weight: 700;
  text-decoration: none;
}
.category-label:hover { text-decoration: underline; }
.card-title { margin: .8rem 0 .45rem; font-size: 1.15rem; line-height: 1.45; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-title a:hover { color: var(--accent); text-decoration: underline; }
.card p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 0 0 .9rem;
  color: var(--muted);
  font-size: .93rem;
  line-height: 1.7;
}
.card-action {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  margin-top: auto;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-size: .875rem;
  font-weight: 700;
}
.empty { margin: 0; padding: 1.5rem; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--white); color: var(--muted); }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 1rem; padding-top: 2rem; }
.pagination a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: .9rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--white);
  text-decoration: none;
}
.pagination a:hover { background: var(--tint); }

.crumbs { display: flex; flex-wrap: wrap; gap: .35rem .65rem; margin: 1.45rem 0 .9rem; color: var(--muted); font-size: .875rem; }
.crumbs a { min-width: 0; }
.reading { min-width: 0; }
.article-heading {
  padding: clamp(1.25rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--tint);
}
.article-heading h1 { max-width: 23em; }
.article-heading p { max-width: 55rem; margin: .85rem 0 0; color: var(--muted); line-height: 1.7; }
.article-heading .metadata { margin-top: 1rem; }
.article-layout { display: grid; gap: 1rem; align-items: start; margin-top: 1rem; }
.article-content, .downloads, .related {
  min-width: 0;
  padding: clamp(1.1rem, 2.7vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.article-body { max-width: 49rem; font-size: 1rem; line-height: 1.95; }
.article-body p { margin: 0 0 1em; white-space: pre-wrap; }
.article-body p:last-child { margin-bottom: 0; }
.tags { margin: 1.3rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.tags a { background: var(--paper); }
.article-jump {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  margin-top: .65rem;
  font-weight: 700;
}
.downloads { scroll-margin-top: 1rem; }
.downloads h2, .related h2 { margin: 0 0 .8rem; font-size: 1.2rem; }
#downloads-heading { scroll-margin-top: 1.5rem; }
.download {
  display: grid;
  gap: .75rem;
  min-width: 0;
  padding: .9rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: .65rem;
}
.download + .download { margin-top: .65rem; }
.download small, .extraction-code { display: block; margin-top: .3rem; color: var(--muted); }
.download code { color: var(--ink); font-size: 1rem; font-weight: 700; }
.downloads p { margin-bottom: 0; color: var(--muted); }
.related { margin-top: 1rem; }
.related ul { display: grid; grid-template-columns: minmax(0, 1fr); list-style: none; gap: .5rem 1rem; margin: 0; padding: 0; }
.related a { display: flex; align-items: center; min-height: 44px; }
.site-footer { border-top: 1px solid var(--line); padding: 1.1rem 0; background: var(--white); font-size: .875rem; }
.site-footer .shell { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem 1rem; }
.site-footer a { color: var(--muted); }

@media (min-width: 39rem) {
  .cards, .related ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 58rem) {
  .article-layout { grid-template-columns: minmax(0, 1fr) minmax(17rem, 30%); }
}
@media (min-width: 65rem) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 39rem) {
  .shell { width: calc(100% - 1.5rem); }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .8rem; }
  .site-nav { justify-self: end; }
  .search { grid-column: 1 / -1; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero-copy { padding: 1.4rem 1.15rem 1rem; }
  .hero p { margin-block: .65rem .85rem; }
  .hero-visual { min-height: clamp(7.5rem, 34vw, 12rem); }
  .hero-visual img { object-position: 60% 55%; }
  .hero-visual::after { background: linear-gradient(180deg, var(--hero), transparent 42%); }
  main { padding-bottom: 2.5rem; }
}
