/* ===== 首页开源项目展示 ===== */
.open-source-section {
  padding: 3rem 0 2rem;
  margin-top: -1rem;
}

.os-header {
  margin-bottom: 2.5rem;
}

.os-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.os-title i {
  font-size: 1.75rem;
  color: var(--text-color);
}

.os-subtitle {
  font-size: 1rem;
  color: var(--sec-text-color);
  margin: 0;
}

/* 项目卡片网格 */
.os-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* 单个项目卡片 */
.os-card {
  background-color: var(--board-bg-color);
  border: 1px solid var(--line-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.os-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4285f4, #34a853, #fbbc05, #ea4335);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.os-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  border-color: transparent;
}

.os-card:hover::before {
  opacity: 1;
}

/* 卡片头部 */
.os-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.os-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.os-card-lang {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.os-lang-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sec-text-color);
  background-color: var(--highlight-bg-color);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.os-stars {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: var(--sec-text-color);
}

.os-stars i {
  font-size: 0.9rem;
  color: #fbbc05;
}

/* 卡片内容 */
.os-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 0.5rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-card-desc {
  font-size: 0.9rem;
  color: var(--sec-text-color);
  line-height: 1.6;
  margin: 0 0 1.25rem;
  min-height: 2.8rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* 卡片底部 */
.os-card-footer {
  border-top: 1px solid var(--line-color);
  padding-top: 1rem;
}

.os-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--link-hover-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

.os-card-link:hover {
  color: var(--post-link-color);
  text-decoration: none;
}

.os-card-link:hover .os-arrow {
  transform: translateX(3px);
}

.os-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

/* 查看更多 */
.os-more {
  margin-top: 2rem;
}

.os-more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--sec-text-color);
  text-decoration: none;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--line-color);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.os-more-link:hover {
  color: var(--link-hover-color);
  border-color: var(--link-hover-color);
  background-color: var(--link-hover-bg-color);
  text-decoration: none;
}

.os-more-link i:first-child {
  font-size: 1.1rem;
}

/* 暗色模式适配 */
[data-user-color-scheme="dark"] .os-card {
  background-color: var(--board-bg-color);
  border-color: var(--line-color);
}

[data-user-color-scheme="dark"] .os-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

[data-user-color-scheme="dark"] .os-lang-tag {
  background-color: var(--highlight-bg-color);
}

[data-user-color-scheme="dark"] .os-more-link:hover {
  background-color: var(--link-hover-bg-color);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-user-color-scheme]) .os-card {
    background-color: var(--board-bg-color);
    border-color: var(--line-color);
  }

  :root:not([data-user-color-scheme]) .os-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  }
}

/* 移动端适配 */
@media (max-width: 767px) {
  .open-source-section {
    padding: 2rem 0 1.5rem;
  }

  .os-header {
    margin-bottom: 1.5rem;
  }

  .os-title {
    font-size: 1.4rem;
  }

  .os-subtitle {
    font-size: 0.9rem;
  }

  .os-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .os-card {
    padding: 1.25rem;
  }

  .os-card:hover {
    transform: translateY(-2px);
  }
}

@media (max-width: 575px) {
  .os-title {
    font-size: 1.25rem;
  }

  .os-title i {
    font-size: 1.25rem;
  }

  .os-card-title {
    font-size: 1.05rem;
  }

  .os-card-desc {
    font-size: 0.85rem;
  }
}

/* 平板适配 */
@media (min-width: 768px) and (max-width: 991px) {
  .os-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 大屏适配 */
@media (min-width: 1200px) {
  .os-cards {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1140px;
  }
}

/* ===== Banner 底部开源项目展示（透明毛玻璃卡片） ===== */
.banner-open-source {
  margin-top: 1rem;
  width: 100%;
}

.banner-open-source .bos-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

.banner-open-source .bos-card {
  display: block;
  text-decoration: none;
  max-height: 500px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.banner-open-source .bos-card:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.banner-open-source .bos-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.banner-open-source .bos-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  opacity: 0.9;
}

.banner-open-source .bos-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.banner-open-source .bos-lang-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.15);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.banner-open-source .bos-stars {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
}

.banner-open-source .bos-stars i {
  font-size: 0.85rem;
  color: #fbbc05;
}

.banner-open-source .bos-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.4rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.banner-open-source .bos-card-desc {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.banner-open-source .bos-more {
  margin-top: 1.25rem;
}

.banner-open-source .bos-more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding: 0.45rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.banner-open-source .bos-more-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.banner-open-source .bos-more-link i:first-child {
  font-size: 1rem;
}

/* Banner 暗色模式适配 */
[data-user-color-scheme="dark"] .banner-open-source .bos-card {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

[data-user-color-scheme="dark"] .banner-open-source .bos-card:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

[data-user-color-scheme="dark"] .banner-open-source .bos-lang-tag {
  background: rgba(255, 255, 255, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-user-color-scheme]) .banner-open-source .bos-card {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
  }
  :root:not([data-user-color-scheme]) .banner-open-source .bos-card:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
  }
  :root:not([data-user-color-scheme]) .banner-open-source .bos-lang-tag {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* Banner 移动端适配 */
@media (max-width: 767px) {
  .banner-open-source {
    margin-top: 0.5rem;
  }
  .banner-open-source .bos-cards {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .banner-open-source .bos-card {
    padding: 0.2rem 0.5rem;
    max-height: none;
    border-radius: 6px;
  }
  .banner-open-source .bos-card:hover {
    transform: translateY(-1px);
  }
  .banner-open-source .bos-card .bos-card-header {
    display: none;
  }
  .banner-open-source .bos-card-title {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    line-height: 1.2;
  }
  .banner-open-source .bos-card .bos-card-desc {
    display: none;
  }
  .banner-open-source .bos-more {
    margin-top: 0.35rem;
  }
  .banner-open-source .bos-more-link {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }
}

@media (max-width: 575px) {
  .banner-open-source {
    margin-top: 0.35rem;
  }
  .banner-open-source .bos-cards {
    gap: 0.2rem;
  }
  .banner-open-source .bos-card {
    padding: 0.15rem 0.4rem;
  }
  .banner-open-source .bos-card-title {
    font-size: 0.72rem;
  }
}

/* Banner 平板适配 */
@media (min-width: 768px) and (max-width: 991px) {
  .banner-open-source .bos-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Banner 大屏适配 */
@media (min-width: 1200px) {
  .banner-open-source .bos-cards {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1100px;
  }
}
