:root {
  color-scheme: light;
  --bg: #fbfbf8;
  --panel: #ffffff;
  --text: #151515;
  --muted: #6f6f67;
  --line: #e7e5dc;
  --strong-line: #d6d2c4;
  --accent: #0f766e;
  --accent-dark: #114f48;
  --ink: #24211d;
  --shadow: 0 18px 45px rgba(26, 24, 21, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px),
    radial-gradient(circle at 10% 0%, rgba(15, 118, 110, 0.08), transparent 28rem),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto, auto;
  color: var(--text);
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
}

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

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 12px;
  border: 1px solid rgba(214, 210, 196, 0.86);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 30px rgba(26, 24, 21, 0.06);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  background: var(--ink);
  color: white;
  font-weight: 800;
}

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

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

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f8f4;
}

.search-wrap svg {
  width: 18px;
  color: var(--muted);
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.stats {
  min-width: 116px;
  text-align: right;
  font-weight: 700;
}

.intro {
  display: grid;
  gap: 14px;
  max-width: 790px;
  padding: 74px 0 30px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

.intro p:last-child {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 22px;
}

.category-tabs button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
}

.category-tabs button.is-active,
.category-tabs button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

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

.program-card {
  display: flex;
  min-height: 292px;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.program-card:hover,
.program-card:focus-visible {
  border-color: var(--strong-line);
  box-shadow: var(--shadow);
  outline: 0;
  transform: translateY(-3px);
}

.card-head,
.meta-row,
.card-actions,
.detail-title-row,
.detail-actions {
  display: flex;
  align-items: center;
}

.card-head {
  justify-content: space-between;
}

.card-head img,
.detail-title-row img {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f5ee;
  padding: 8px;
}

.card-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.program-card h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.program-card p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-list span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8f8f4;
  color: #4f4c45;
  font-size: 12px;
  font-weight: 700;
}

.meta-row {
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.meta-row span {
  color: var(--accent-dark);
  font-weight: 800;
}

.card-actions,
.detail-actions {
  gap: 8px;
}

.card-actions a,
.detail-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 82px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-size: 13px;
  font-weight: 800;
}

.card-actions a:last-child,
.detail-actions a:last-child {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.empty-state {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--strong-line);
  border-radius: 8px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
  font-size: 20px;
}

.back-link {
  display: inline-flex;
  margin: 42px 0 18px;
  color: var(--muted);
  font-weight: 800;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1.1fr);
  gap: 24px;
  align-items: stretch;
}

.detail-copy,
.detail-panels section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.detail-copy {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px;
}

.detail-title-row {
  gap: 14px;
}

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

.detail-copy p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.screenshot {
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.detail-panels {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 16px;
  margin-top: 16px;
}

.detail-panels section {
  padding: 24px;
}

.detail-panels h2 {
  margin: 0 0 16px;
  font-size: 19px;
}

.feature-list,
.changelog {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f8f4;
}

.changelog li {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.changelog li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.changelog strong {
  margin-right: 10px;
}

.changelog time {
  color: var(--muted);
  font-size: 13px;
}

.changelog p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 900px) {
  .topbar,
  .detail-hero,
  .detail-panels {
    grid-template-columns: 1fr;
  }

  .brand,
  .stats {
    min-width: 0;
  }

  .stats {
    text-align: left;
  }

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

@media (max-width: 620px) {
  .site-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 10px;
  }

  .topbar {
    top: 8px;
  }

  .intro {
    padding-top: 48px;
  }

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

  .detail-copy,
  .detail-panels section {
    padding: 18px;
  }
}
