/* 文章页样式 */
.page-main { padding: 32px 0 64px; min-height: 60vh; }

.page-header {
  text-align: center;
  padding: 40px 0 32px;
}

.page-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.article-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  box-shadow: var(--shadow);
  display: block;
}

.article-card:hover {
  border-color: var(--tg-blue);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.article-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.article-card-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pin-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  background: #fef3c7;
  color: #b45309;
  vertical-align: middle;
}

[data-theme="dark"] .pin-badge {
  background: rgba(180, 83, 9, 0.25);
  color: #fcd34d;
}

.article-detail {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 48px);
  box-shadow: var(--shadow);
}

.article-detail h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}

.article-detail-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-body h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--text-primary);
}

.article-body p { margin-bottom: 16px; }

.article-body a {
  color: var(--tg-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body a:hover { opacity: 0.85; }

.article-body ul {
  margin: 0 0 16px 20px;
  color: var(--text-secondary);
}

.article-body ol {
  margin: 0 0 16px 20px;
  color: var(--text-secondary);
}

.article-body li { margin-bottom: 8px; }

.article-figure {
  margin: 0 0 20px;
  text-align: center;
}

.article-figure img,
.article-inline-img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.article-figure img { display: block; margin: 0 auto; }

.article-figure figcaption {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-video {
  position: relative;
  width: 100%;
  margin: 0 0 20px;
  padding-top: 56.25%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}

.article-video iframe,
.article-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.back-bar {
  max-width: 720px;
  margin: 0 auto 20px;
}

.back-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 8px 0;
}

.back-link-btn:hover { color: var(--tg-blue); }

.home-articles {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.home-articles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.home-articles-header h2 {
  font-size: 1.35rem;
  font-weight: 600;
}

.nav-link-articles.active,
.nav-link-articles:hover {
  color: var(--tg-blue);
  background: var(--tg-blue-light);
}

@media (max-width: 768px) {
  .article-list { grid-template-columns: 1fr; gap: 12px; }
  .article-card { padding: 14px; }
  .article-card-title { font-size: 0.95rem; }
  .article-card-summary { font-size: 0.82rem; -webkit-line-clamp: 3; }
  .article-card:hover { transform: none; }
  .article-detail { padding: 20px; }
  .home-articles { padding: 32px 0; }
  .home-articles-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .page-main { padding: 24px 0 48px; }
}

/* 资源详情页 */
.resource-detail {
  max-width: 800px;
  margin: 0 auto;
}

.resource-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.resource-avatar {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.resource-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.resource-avatar-letter {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.resource-avatar.avatar-fallback .resource-avatar-letter {
  display: flex;
}

.resource-hero-info h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.resource-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.resource-username {
  color: var(--tg-blue);
  font-size: 0.95rem;
}

.resource-desc-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.resource-desc-box h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.resource-desc-box p {
  line-height: 1.8;
  color: var(--text-primary);
}

.resource-actions {
  text-align: center;
  margin-bottom: 40px;
}

.btn-lg {
  padding: 14px 36px;
  font-size: 1rem;
  min-width: 200px;
}

.related-section {
  margin-top: 32px;
}

.related-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s;
}

.related-card:hover { border-color: var(--tg-blue); }

.related-card-name {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.related-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.related-articles {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .resource-hero { flex-direction: column; text-align: center; padding: 20px; }
  .resource-meta { justify-content: center; }
  .card-actions { flex-wrap: wrap; }
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .related-card { padding: 12px; }
  .related-card-name {
    font-size: 0.82rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .related-card-meta { font-size: 0.75rem; }
}
