:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --ink: #17211f;
  --muted: #61716d;
  --line: #dce5e1;
  --green: #0f8b62;
  --green-2: #e2f5ee;
  --blue: #245ea8;
  --amber: #a66405;
  --amber-2: #fff0d6;
  --shadow: 0 16px 40px rgba(23, 33, 31, 0.09);
  --radius: 8px;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
}

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(220, 229, 225, 0.88);
  background: rgba(245, 247, 246, 0.92);
  backdrop-filter: blur(14px);
}

.topbar,
main,
.site-footer {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.nav a {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.nav a:hover,
.nav a.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.hero-shell {
  padding: 54px 0 42px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  max-width: 980px;
}

.eyebrow {
  display: inline-flex;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin: 10px 0 16px;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.03;
}

.hero-copy p,
.section-head p {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
}

.search-panel {
  width: 100%;
  margin-top: 28px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.search-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 10px;
}

.field {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}

.field:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 139, 98, 0.12);
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.quick-stats div {
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.quick-stats b,
.quick-stats span {
  display: block;
}

.quick-stats b {
  font-size: 26px;
  line-height: 1.1;
}

.quick-stats span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.band {
  padding: 54px 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  margin-bottom: 22px;
}

.section-head.split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-head h2 {
  margin: 8px 0 8px;
  font-size: 32px;
  line-height: 1.15;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

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

.resource-card,
.source-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.resource-card {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.resource-card:hover,
.source-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-top,
.tag-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.card-top {
  justify-content: space-between;
  margin-bottom: 14px;
}

.type-pill,
.tag-row span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--green-2);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.source {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.resource-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.22;
}

.resource-card p {
  min-height: 76px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.tag-row {
  margin-bottom: 12px;
}

.tag-row span:nth-child(2) {
  background: var(--amber-2);
  color: var(--amber);
}

.install-line {
  margin-top: auto;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}

code {
  display: block;
  color: #263330;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.card-actions {
  margin-top: 12px;
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.btn.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.btn.ghost {
  color: var(--muted);
}

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

.source-card {
  min-height: 96px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.source-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.source-card strong,
.source-card small {
  display: block;
}

.source-card small {
  margin-top: 4px;
  color: var(--muted);
}

.site-footer {
  padding: 28px 0 44px;
  color: var(--muted);
  font-size: 13px;
}

.ad-rail {
  position: fixed;
  top: 92px;
  z-index: 10;
  width: 160px;
  min-height: 600px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(24, 33, 31, 0.08);
}

.ad-rail img {
  width: 160px;
  height: 600px;
  object-fit: cover;
}

.ad-rail.left {
  left: max(12px, calc((100vw - 1500px) / 2));
}

.ad-rail.right {
  right: max(12px, calc((100vw - 1500px) / 2));
}

.mobile-ad {
  display: none;
}

[hidden] {
  display: none !important;
}

@media (min-width: 1000px) {
  :root {
    --rail-content-width: min(1160px, calc(100vw - 380px));
  }

  .topbar,
  main,
  .site-footer {
    width: var(--rail-content-width);
  }

  .ad-rail {
    display: block;
  }

  .ad-rail.left {
    left: max(12px, calc(50% - var(--rail-content-width) / 2 - 180px));
  }

  .ad-rail.right {
    right: max(12px, calc(50% - var(--rail-content-width) / 2 - 180px));
  }
}

@media (max-width: 999px) {
  .ad-rail {
    display: none;
  }

  .mobile-ad {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    min-height: 50px;
    border-bottom: 1px solid var(--line);
    background: #fff;
  }

  .mobile-ad img {
    width: min(320px, 100%);
    height: auto;
  }
}

@media (max-width: 1080px) {
  .resource-grid,
  .compact-grid,
  .source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
  }

  .topbar,
  main,
  .site-footer {
    width: calc(100% - 22px);
  }

  .topbar {
    min-height: auto;
    padding: 12px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .brand {
    min-width: 0;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  h1 {
    font-size: 34px;
  }

  .hero-copy p,
  .section-head p {
    font-size: 16px;
  }

  .search-row,
  .quick-stats,
  .resource-grid,
  .compact-grid,
  .source-grid {
    grid-template-columns: 1fr;
  }

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

  .resource-card {
    min-height: auto;
  }
}
