/**
 * Resources Page Styles
 * Shares base styles with Topics page
 */

/* ==================== Resources Page Container ==================== */
.resources-page {
  max-width: var(--nav-width);
  margin: 0 auto;
  padding: calc(var(--gap) * 2) var(--gap);
}

/* ==================== Resources Section ==================== */
.resources-section {
  margin-bottom: calc(var(--gap) * 4);
}

.resources-section .section-header {
  text-align: center;
  margin-bottom: calc(var(--gap) * 2);
}

.resources-section .section-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--primary);
  margin: 0 0 8px;
}

.resources-section .section-description {
  font-size: var(--text-base);
  color: var(--secondary);
  margin: 0;
}

/* ==================== Resource Grid ==================== */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: calc(var(--gap) * 1.5);
}

.resource-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: calc(var(--gap));
  text-decoration: none;
  overflow: hidden;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent; /* 默认透明边框 */
}

.resource-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.resource-card:hover {
  border-bottom-color: var(--accent); /* hover时显示蓝色底部边框 */
}

.resource-card:hover::before {
  opacity: 0.03;
}

.resource-card > * {
  position: relative;
  z-index: 1;
}

/* ==================== Resource Icon ==================== */
.resource-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  color: white;
  margin-bottom: var(--gap);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.resource-icon svg {
  width: 32px;
  height: 32px;
}

.resource-card:hover .resource-icon {
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--shadow-xl);
}

/* ==================== Resource Content ==================== */
.resource-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--primary);
  margin: 0 0 8px;
  line-height: 1.3;
}

.resource-description {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--secondary);
  margin: 0 0 var(--gap);
  flex: 1;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s ease;
  margin-top: auto;
}

.resource-card:hover .resource-link {
  color: var(--accent-2);
  transform: translateX(4px);
}

/* ==================== CTA Section ==================== */
.cta-section {
  margin-top: calc(var(--gap) * 4);
}

.cta-card {
  text-align: center;
  padding: calc(var(--gap) * 4) calc(var(--gap) * 2);
  margin: 0 auto;
}

.cta-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--primary);
}

.cta-description {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1024px) {
  .resource-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .resources-page {
    padding: 0;
  }

  .resources-section .section-title {
    font-size: var(--text-2xl);
  }

  .resource-grid {
    grid-template-columns: 1fr;
    gap: var(--gap);
  }

  .resource-card {
    padding: calc(var(--gap) * 1.5);
  }

  .resource-icon {
    width: 56px;
    height: 56px;
  }

  .resource-icon svg {
    width: 28px;
    height: 28px;
  }

  .cta-card {
    padding: calc(var(--gap) * 3) var(--gap);
  }

  .cta-title {
    font-size: var(--text-2xl);
  }

  .cta-description {
    font-size: var(--text-base);
  }
}

@media (max-width: 480px) {
  .resource-title {
    font-size: var(--text-lg);
  }

  .resource-description {
    font-size: var(--text-sm);
  }
}
