/* ================================
   自定义页面：开源项目精选列表
================================ */

.opensource-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 20px 64px;
}

.opensource-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: end;
  gap: 28px;
  padding: 34px 0 28px;
  border-bottom: 1px solid #dbe4ee;
}

.opensource-kicker {
  display: inline-flex;
  margin-bottom: 12px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.opensource-heading h1 {
  margin: 0 0 14px;
  color: #102033;
  font-size: 44px;
  font-weight: 850;
  line-height: 1.12;
}

.opensource-heading p {
  max-width: 620px;
  margin: 0;
  color: #52616f;
  font-size: 16px;
  line-height: 1.8;
}

.opensource-search {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 4px;
  background: #ffffff;
  border: 1px solid #cfd9e5;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(16, 32, 51, 0.06);
}

.opensource-search input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  color: #102033;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 14px;
}

.opensource-search button {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 16px;
  color: #ffffff;
  background: #2563eb;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background-color 0.18s ease;
}

.opensource-search button:hover {
  background: #1d4ed8;
}

.opensource-project-list {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.opensource-project-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  background: #ffffff;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(16, 32, 51, 0.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.opensource-project-card:hover {
  border-color: #2563eb;
  box-shadow: 0 16px 34px rgba(16, 32, 51, 0.1);
  transform: translateY(-2px);
}

.opensource-project-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  color: #2563eb;
  background: #f4f8ff;
  border: 1px solid #d7e4f3;
  border-radius: 8px;
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
  overflow: hidden;
}

.opensource-project-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.opensource-project-body {
  min-width: 0;
}

.opensource-project-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.opensource-project-type,
.opensource-project-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
}

.opensource-project-type {
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #cfe0ff;
}

.opensource-project-status {
  color: #475569;
  background: #f8fafc;
  border: 1px solid #dbe4ee;
}

.opensource-project-card h2 {
  margin: 0 0 8px;
  color: #102033;
  font-size: 21px;
  font-weight: 850;
  line-height: 1.35;
}

.opensource-project-card p {
  max-width: 760px;
  margin: 0;
  color: #52616f;
  font-size: 14px;
  line-height: 1.75;
}

.opensource-project-posts {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.opensource-project-post {
  min-width: 0;
}

.opensource-project-post.is-extra {
  display: none;
}

.opensource-project-post a {
  display: inline-flex;
  max-width: 100%;
  color: #2563eb;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.opensource-project-post a:hover {
  color: #1d4ed8;
}

.opensource-project-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 38px;
  padding: 0 14px;
  color: #ffffff;
  background: #2563eb;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
  transition: background-color 0.18s ease;
}

.opensource-project-link:hover {
  background: #1d4ed8;
}

.opensource-empty {
  padding: 34px;
  text-align: center;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}

.opensource-empty h2 {
  margin: 0 0 10px;
  color: #102033;
  font-size: 22px;
}

.opensource-empty p {
  margin: 0;
  color: #64748b;
  line-height: 1.8;
}

@media (max-width: 992px) {
  .opensource-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .opensource-search {
    max-width: 560px;
  }

  .opensource-project-card {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .opensource-project-mark {
    width: 52px;
    height: 52px;
  }

  .opensource-project-link {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 768px) {
  .opensource-page {
    padding: 24px 14px 44px;
  }

  .opensource-header {
    padding-top: 22px;
  }

  .opensource-heading h1 {
    font-size: 34px;
  }

  .opensource-heading p {
    font-size: 15px;
  }

  .opensource-search {
    flex-direction: column;
    align-items: stretch;
    padding: 6px;
  }

  .opensource-search input,
  .opensource-search button {
    width: 100%;
  }

  .opensource-project-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

  .opensource-project-link {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .opensource-page {
    padding: 18px 12px 36px;
  }

  .opensource-header {
    gap: 18px;
    padding-top: 16px;
    padding-bottom: 20px;
  }

  .opensource-kicker {
    margin-bottom: 8px;
    font-size: 12px;
  }

  .opensource-heading h1 {
    margin-bottom: 10px;
    font-size: 30px;
  }

  .opensource-heading p {
    font-size: 14px;
    line-height: 1.65;
  }

  .opensource-search {
    flex-direction: row;
    min-height: 42px;
    padding: 3px;
  }

  .opensource-search input {
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .opensource-search button {
    width: 64px;
    height: 36px;
    padding: 0;
    font-size: 13px;
  }

  .opensource-project-list {
    gap: 12px;
    margin-top: 18px;
  }

  .opensource-project-card {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 16px;
  }

  .opensource-project-mark {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .opensource-project-body {
    grid-column: 2;
  }

  .opensource-project-topline {
    margin-bottom: 7px;
  }

  .opensource-project-type,
  .opensource-project-status {
    min-height: 22px;
    padding: 0 8px;
    font-size: 11px;
  }

  .opensource-project-card h2 {
    margin-bottom: 7px;
    font-size: 18px;
  }

  .opensource-project-card p {
    font-size: 13px;
    line-height: 1.65;
  }

  .opensource-project-posts {
    margin-top: 10px;
  }

  .opensource-project-link {
    grid-column: 2;
    width: 100%;
    height: 36px;
    font-size: 13px;
  }

  .opensource-empty {
    padding: 26px 16px;
  }
}
