/* ================================================================
 * SOFT 门户 · 开源中心样式
 * ================================================================ */

.os-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

/* ---------------- 开源项目卡片 ---------------- */
.os-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 22px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: border-color .22s, transform .22s, box-shadow .22s, background .22s;
}
/* 顶部高光 */
.os-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  opacity: 0;
  transition: opacity .25s;
}
/* 悬浮光晕 */
.os-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(400px 180px at 50% -25%, rgba(102, 204, 255, 0.14), transparent 72%);
  opacity: 0;
  transition: opacity .28s;
}
.os-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-5px);
  background: var(--bg-elev);
  box-shadow: var(--shadow), var(--shadow-glow);
}
.os-card:hover::before,
.os-card:hover::after { opacity: 1; }

/* 图标芯片 */
.os-card .os-icon {
  position: relative;
  z-index: 1;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: linear-gradient(145deg, rgba(102, 204, 255, 0.22), rgba(167, 139, 250, 0.12));
  border: 1px solid var(--accent-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform .28s cubic-bezier(.34,1.56,.64,1), box-shadow .28s;
}
.os-card:hover .os-icon {
  transform: scale(1.1) rotate(-6deg);
  box-shadow: 0 10px 26px rgba(102, 204, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.os-card .os-body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}
.os-card .os-title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.os-card .os-title h3 {
  font-size: 1.1rem;
  font-weight: 720;
  letter-spacing: -0.015em;
}
.os-card .os-badge {
  font-size: 0.67rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--ok);
  background: rgba(63, 185, 80, 0.14);
  border: 1px solid rgba(63, 185, 80, 0.3);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
/* 开源协议徽章（MIT） */
.os-card .os-license {
  font-size: 0.67rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.os-card .os-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 10px;
}
.os-card .os-repo {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  word-break: break-all;
  transition: color .2s;
}
.os-card:hover .os-repo { color: var(--accent); }

/* 右上角箭头 */
.os-card .os-arrow {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  font-size: 1.05rem;
  color: var(--text-dim);
  transition: transform .25s, color .2s;
}
.os-card:hover .os-arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}

/* ---------------- 手机版 ---------------- */
@media (max-width: 760px) {
  .os-grid { grid-template-columns: 1fr; gap: 12px; }
  .os-card {
    padding: 18px 16px;
    gap: 13px;
    border-radius: var(--radius);
  }
  .os-card .os-icon {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    border-radius: 12px;
  }
  .os-card .os-title { gap: 7px; margin-bottom: 5px; }
  .os-card .os-title h3 { font-size: 1rem; }
  .os-card .os-badge,
  .os-card .os-license { font-size: 0.63rem; padding: 2px 8px; }
  .os-card .os-body p { font-size: 0.86rem; margin-bottom: 8px; }
  .os-card .os-repo { font-size: 0.68rem; }
}
