:root {
  --background-100: #ffffff;
  --background-200: #fafafa;
  --gray-100: #f2f2f2;
  --gray-200: #ebebeb;
  --gray-300: #e6e6e6;
  --gray-400: #eaeaea;
  --gray-500: #c9c9c9;
  --gray-700: #8f8f8f;
  --gray-900: #4d4d4d;
  --gray-1000: #171717;
  --gray-alpha-100: #0000000d;
  --gray-alpha-200: #00000015;
  --gray-alpha-400: #00000014;
  --blue-100: #f0f7ff;
  --blue-700: #006bff;
  --blue-800: #0059ec;
  --amber-100: #fff6de;
  --amber-900: #aa4d00;
  --green-100: #ecfdec;
  --green-800: #279141;
  --red-100: #ffeeef;
  --red-800: #ea001d;
  --radius-sm: 6px;
  --radius-md: 12px;
  --shadow-card: 0 2px 2px rgba(0, 0, 0, 0.04);
  --shadow-popover:
    0 1px 1px rgba(0, 0, 0, 0.02), 0 4px 8px -4px rgba(0, 0, 0, 0.04),
    0 16px 24px -8px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background-100);
}

body {
  color: var(--gray-1000);
  font-family: "Geist Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
  margin: 0;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
.repo-card:focus-visible {
  box-shadow: 0 0 0 2px var(--background-100), 0 0 0 4px var(--blue-700);
  outline: none;
}

.site-header {
  align-items: center;
  background: color-mix(in srgb, var(--background-100) 92%, transparent);
  border-bottom: 1px solid var(--gray-alpha-200);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand,
.header-meta {
  align-items: center;
  display: flex;
  gap: 10px;
}

.brand {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--gray-1000);
  border-radius: var(--radius-sm);
  color: var(--background-100);
  display: inline-flex;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  height: 28px;
  justify-content: center;
  line-height: 16px;
  width: 28px;
}

.header-meta {
  color: var(--gray-900);
  font-size: 13px;
  line-height: 18px;
}

.header-meta a {
  border: 1px solid var(--gray-alpha-400);
  border-radius: var(--radius-sm);
  height: 32px;
  line-height: 30px;
  padding: 0 10px;
  text-decoration: none;
}

.header-meta a:hover {
  background: var(--gray-alpha-100);
}

.page-shell {
  margin: 0 auto;
  max-width: 1400px;
  padding: 40px 32px 64px;
}

.hero {
  align-items: end;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 520px);
  padding: 24px 0 40px;
}

.eyebrow,
.section-kicker {
  color: var(--gray-900);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  margin: 0 0 12px;
}

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

h1 {
  font-size: 48px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 56px;
  max-width: 760px;
}

.lede {
  color: var(--gray-900);
  font-size: 16px;
  line-height: 24px;
  margin-top: 16px;
  max-width: 640px;
}

.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
  background: var(--background-100);
  border: 1px solid var(--gray-alpha-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  min-height: 112px;
  padding: 20px;
}

.metric-card span {
  display: block;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 28px;
  font-weight: 600;
  line-height: 32px;
}

.metric-card small {
  color: var(--gray-900);
  display: block;
  font-size: 13px;
  line-height: 18px;
  margin-top: 8px;
}

.toolbar {
  align-items: end;
  background: var(--background-100);
  border: 1px solid var(--gray-alpha-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(280px, 1fr) 170px 160px auto;
  padding: 16px;
}

label {
  color: var(--gray-900);
  display: grid;
  font-size: 12px;
  gap: 8px;
  line-height: 16px;
}

.search-box {
  display: grid;
  gap: 8px;
}

input,
select {
  background: var(--background-100);
  border: 1px solid var(--gray-alpha-400);
  border-radius: var(--radius-sm);
  color: var(--gray-1000);
  font-size: 14px;
  height: 40px;
  line-height: 20px;
  padding: 0 12px;
  width: 100%;
}

input::placeholder {
  color: var(--gray-700);
}

button {
  border: 1px solid var(--gray-alpha-400);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  height: 40px;
  line-height: 20px;
  padding: 0 12px;
}

#resetButton {
  background: var(--gray-1000);
  color: var(--background-100);
}

#resetButton:hover {
  background: var(--gray-900);
}

.year-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
}

.year-tab {
  background: var(--background-100);
  color: var(--gray-1000);
}

.year-tab:hover {
  background: var(--gray-alpha-100);
}

.year-tab.active {
  background: var(--gray-1000);
  border-color: var(--gray-1000);
  color: var(--background-100);
}

.workspace {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 400px;
}

.project-panel,
.detail-panel {
  background: var(--background-100);
  border: 1px solid var(--gray-alpha-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.project-panel {
  padding: 24px;
}

.section-head {
  align-items: end;
  border-bottom: 1px solid var(--gray-alpha-200);
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 20px;
}

.section-head h2 {
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
}

.hint {
  color: var(--gray-900);
  font-size: 13px;
  line-height: 18px;
}

.repo-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.repo-card {
  background: var(--background-100);
  border: 1px solid var(--gray-alpha-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: grid;
  gap: 14px;
  min-height: 214px;
  padding: 18px;
}

.repo-card:hover,
.repo-card.selected {
  border-color: var(--gray-alpha-600, #0000003d);
  box-shadow: var(--shadow-popover);
}

.repo-card.selected {
  outline: 1px solid var(--gray-1000);
}

.repo-card-top {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.repo-year {
  color: var(--gray-900);
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 16px;
}

.repo-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  overflow-wrap: anywhere;
}

.repo-subtitle {
  color: var(--gray-900);
  font-size: 13px;
  line-height: 18px;
  min-height: 36px;
  overflow-wrap: anywhere;
}

.repo-facts {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.repo-facts div {
  background: var(--background-200);
  border-radius: var(--radius-sm);
  padding: 8px;
}

.repo-facts dt,
.detail-grid small {
  color: var(--gray-900);
  font-size: 12px;
  line-height: 16px;
}

.repo-facts dd {
  color: var(--gray-1000);
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 18px;
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.status {
  align-items: center;
  border-radius: 9999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  padding: 3px 8px;
}

.status.ready {
  background: var(--green-100);
  color: var(--green-800);
}

.status.missing {
  background: var(--amber-100);
  color: var(--amber-900);
}

.detail-panel {
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 24px;
  position: sticky;
  top: 88px;
}

.empty-detail {
  align-items: center;
  color: var(--gray-900);
  display: grid;
  font-size: 14px;
  line-height: 20px;
  min-height: 240px;
  text-align: center;
}

.detail-title {
  align-items: start;
  border-bottom: 1px solid var(--gray-alpha-200);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 18px;
}

.detail-title h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 26px;
  overflow-wrap: anywhere;
}

.muted-copy {
  color: var(--gray-900);
  font-size: 14px;
  line-height: 20px;
}

.detail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 20px;
}

.detail-grid div,
.artifact-list a,
.module-list li {
  background: var(--background-200);
  border: 1px solid var(--gray-alpha-100);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.detail-grid div {
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 18px;
  overflow-wrap: anywhere;
}

.detail-grid small {
  display: block;
  font-family: "Geist Sans", ui-sans-serif, system-ui, sans-serif;
  margin-bottom: 4px;
}

.detail-panel h3 {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  margin: 20px 0 10px;
}

.artifact-list,
.module-list {
  display: grid;
  gap: 8px;
}

.artifact-list a {
  color: var(--gray-1000);
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  line-height: 18px;
  text-decoration: none;
}

.artifact-list a:hover {
  border-color: var(--blue-700);
}

.module-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.module-list li {
  color: var(--gray-900);
  font-size: 13px;
  line-height: 18px;
  overflow-wrap: anywhere;
}

.detail-panel p a {
  color: var(--blue-700);
  font-size: 13px;
  line-height: 18px;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    max-height: none;
    position: static;
  }
}

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

  .header-meta {
    align-items: start;
    flex-direction: column;
  }

  .page-shell {
    padding: 24px 16px 40px;
  }

  h1 {
    font-size: 32px;
    line-height: 40px;
  }

  .summary-grid,
  .toolbar,
  .repo-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .project-panel,
  .detail-panel {
    padding: 16px;
  }
}
