/* === News 公开页样式 === */

.news-container {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
}

.news-header {
  text-align: center;
  margin-bottom: 32px;
}

.news-header h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text, #1a1a1a);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.news-header p {
  color: var(--text-light, #666);
  font-size: 17px;
}

.news-categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  padding-bottom: 0;
}

.news-category-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-light, #666);
  transition: all 0.2s;
}

.news-category-tab:hover {
  color: var(--primary, #0969da);
}

.news-category-tab.active {
  color: var(--primary, #0969da);
  border-bottom-color: var(--primary, #0969da);
  font-weight: 500;
}

.news-pinned-card {
  background: var(--white, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  gap: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.news-pinned-card .news-cover {
  width: 280px;
  height: 160px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.news-pinned-card .news-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.news-pinned-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
}

.news-pinned-card h2 a {
  color: var(--text, #1a1a1a);
  text-decoration: none;
}

.news-pinned-card h2 a:hover {
  color: var(--primary, #0969da);
}

.news-pinned-card .news-meta {
  color: var(--text-light, #666);
  font-size: 13px;
  margin-bottom: 8px;
}

.news-pinned-card .news-meta .news-pinned-badge {
  color: #f59e0b;
  font-weight: 500;
  margin-right: 8px;
}

.news-pinned-card .news-excerpt {
  color: var(--text-light, #666);
  font-size: 14px;
  line-height: 1.6;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.news-card {
  background: var(--white, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: var(--primary, #0969da);
}

.news-card .news-cover {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  background-size: cover;
  background-position: center;
}

.news-card .news-body {
  padding: 16px 20px;
}

.news-card .news-category {
  display: inline-block;
  background: #e0e7ff;
  color: #3730a3;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 11px;
  margin-bottom: 8px;
}

.news-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #1a1a1a);
  line-height: 1.4;
}

.news-card .news-excerpt {
  color: var(--text-light, #666);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card .news-meta {
  color: var(--text-light, #666);
  font-size: 12px;
}

.news-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light, #666);
}

.news-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.news-pagination button {
  padding: 8px 14px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--white, #fff);
  color: var(--text, #1a1a1a);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.news-pagination button:hover:not(:disabled) {
  border-color: var(--primary, #0969da);
  color: var(--primary, #0969da);
}

.news-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.news-pagination button.active {
  background: var(--primary, #0969da);
  color: #fff;
  border-color: var(--primary, #0969da);
}

/* Detail mode */
.news-detail-container {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}

.news-back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--primary, #0969da);
  text-decoration: none;
  font-size: 14px;
}

.news-back-link:hover {
  text-decoration: underline;
}

.news-detail-cover {
  width: 100%;
  height: 360px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  margin-bottom: 24px;
}

.news-detail-meta {
  color: var(--text-light, #666);
  font-size: 14px;
  margin-bottom: 8px;
}

.news-detail-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text, #1a1a1a);
  margin: 0 0 24px;
  letter-spacing: -0.02em;
}

.news-detail-content {
  line-height: 1.8;
  font-size: 16px;
  color: var(--text, #1a1a1a);
}

.news-detail-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 12px 0;
}

.news-detail-content pre {
  background: #f6f8fa;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
}

.news-detail-content code {
  background: #f6f8fa;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

.news-detail-content h2,
.news-detail-content h3 {
  margin-top: 24px;
  margin-bottom: 12px;
}

.news-loading,
.news-error {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light, #666);
}

.news-error {
  color: #cf222e;
}

@media (max-width: 768px) {
  .news-pinned-card {
    flex-direction: column;
  }
  .news-pinned-card .news-cover {
    width: 100%;
    height: 200px;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
  .news-detail-cover {
    height: 200px;
  }
  .news-detail-title {
    font-size: 24px;
  }
}
