/* ===== 资讯页 — 百度文库式布局 + PaiMoMo 主题 ===== */

.news-page {
  padding-top: 88px;
  min-height: 100vh;
  background: var(--bg-alt);
}

/* 顶栏当前页高亮 */
.nav-links a.active {
  color: var(--text);
  background: var(--bg-cream);
  font-weight: 600;
}

/* Hero 搜索区 */
.news-hero {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  border-bottom: 1px solid var(--border);
  padding: 48px 0 40px;
}
.news-hero-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: 0 48px;
}
.news-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  color: var(--text);
}
.news-hero-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}
.news-search {
  display: flex;
  align-items: stretch;
  max-width: 560px;
  margin: 0 auto 16px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 100px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.news-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(167, 112, 50, 0.12);
}
.news-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 22px;
  font: inherit;
  font-size: 0.95rem;
  background: transparent;
  color: var(--text);
}
.news-search input::placeholder { color: var(--text-muted); }
.news-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.2s;
  border-radius: 0 100px 100px 0;
}
.news-search-btn:hover { opacity: 0.88; }
.news-hot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.news-hot-label { margin-right: 4px; }
.news-hot a {
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--bg-cream);
  color: var(--text-secondary);
  transition: color 0.2s, background 0.2s;
}
.news-hot a:hover {
  color: var(--accent-dark);
  background: var(--brown-200);
}

/* 主布局：侧栏 + 列表 */
.news-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 48px 80px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}

/* 左侧分类（文库侧栏风格） */
.news-sidebar {
  position: sticky;
  top: 96px;
}
.news-sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.news-sidebar-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.news-cat-list {
  list-style: none;
}
.news-cat-list button {
  width: 100%;
  text-align: left;
  padding: 12px 18px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.news-cat-list li:last-child button { border-bottom: none; }
.news-cat-list button:hover {
  background: var(--bg-alt);
  color: var(--text);
}
.news-cat-list button.active {
  background: var(--bg-cream);
  color: var(--accent-dark);
  font-weight: 600;
  border-left: 3px solid var(--accent);
  padding-left: 15px;
}
.news-cat-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 100px;
}

/* 热门排行 */
.news-rank {
  margin-top: 20px;
}
.news-rank ol {
  list-style: none;
  counter-reset: rank;
}
.news-rank li {
  counter-increment: rank;
  border-bottom: 1px solid var(--border);
}
.news-rank li:last-child { border-bottom: none; }
.news-rank a {
  display: flex;
  gap: 10px;
  padding: 12px 18px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}
.news-rank a::before {
  content: counter(rank);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
  background: var(--bg-alt);
  color: var(--text-muted);
}
.news-rank li:nth-child(-n+3) a::before {
  background: var(--accent);
  color: #fff;
}
.news-rank a:hover {
  background: var(--bg-alt);
  color: var(--text);
}

/* 主内容区 */
.news-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.news-main-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.news-sort {
  display: flex;
  gap: 4px;
}
.news-sort button {
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 100px;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}
.news-sort button:hover { color: var(--text); background: var(--bg-cream); }
.news-sort button.active {
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}

/* 文章列表卡片（文库文档列表风格） */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.news-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: inherit;
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s;
}
.news-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.news-card-cover {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-cream);
}
.news-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.news-card-body { min-width: 0; }
.news-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.news-card-cat {
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--bg-cream);
  color: var(--accent-dark);
  font-weight: 600;
}
.news-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card:hover h2 { color: var(--accent-dark); }
.news-card-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.news-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.news-card-tags span {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--bg-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.news-card-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.news-card-footer svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 4px;
  opacity: 0.6;
}

/* 状态 */
.news-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.news-state.error { color: #a33; border-color: #e8c4c4; background: #fff8f8; }
.news-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: news-spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes news-spin { to { transform: rotate(360deg); } }

/* 分页 */
.news-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.news-pagination button,
.news-pagination span {
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.news-pagination button:hover:not(:disabled) {
  border-color: var(--text);
  color: var(--text);
}
.news-pagination button.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.news-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.news-pagination .page-ellipsis {
  border: none;
  background: none;
  min-width: auto;
}

/* ===== 文章详情页 ===== */
.article-page {
  padding-top: 88px;
  min-height: 100vh;
  background: var(--bg);
}
.article-breadcrumb {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 48px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.article-breadcrumb a:hover { color: var(--accent); }
.article-breadcrumb span { margin: 0 8px; opacity: 0.5; }
.article-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 48px 80px;
}
.article-header {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.article-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text);
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.article-cover {
  margin-bottom: 36px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}
.article-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-secondary);
}
.article-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 36px 0 16px;
  letter-spacing: -0.02em;
}
.article-content p { margin-bottom: 1.2em; }
.article-content ul,
.article-content ol {
  margin: 0 0 1.2em 1.4em;
}
.article-content li { margin-bottom: 0.5em; }
.article-content blockquote {
  margin: 1.5em 0;
  padding: 16px 24px;
  border-left: 4px solid var(--accent);
  background: var(--bg-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  font-style: italic;
}
.article-content code {
  font-size: 0.9em;
  padding: 2px 6px;
  background: var(--bg-alt);
  border-radius: 4px;
}
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.article-tags span {
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--bg-cream);
  color: var(--accent-dark);
}
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 40px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.article-back:hover { color: var(--accent); }

/* 响应式 */
@media (max-width: 1024px) {
  .news-layout {
    grid-template-columns: 1fr;
    padding: 24px 48px 64px;
  }
  .news-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .news-rank { margin-top: 0; }
}
@media (max-width: 768px) {
  .news-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .news-card-cover { max-height: 180px; }
  .news-sidebar { grid-template-columns: 1fr; }
  .news-hero-inner { padding: 0 24px; }
}
@media (max-width: 640px) {
  .news-layout,
  .article-wrap,
  .article-breadcrumb {
    padding-left: 24px;
    padding-right: 24px;
  }
  .news-search { border-radius: var(--radius); flex-direction: column; }
  .news-search-btn { border-radius: 0 0 var(--radius) var(--radius); padding: 12px; }
}
