/* 赤三色锦鲤科普网 · 公共组件（三页共用：工具条、条目卡、正文、目录、相关推荐） */

/* ── 分类页工具条 ─────────────────────────────────────── */
.list-body { padding: 40px 0 56px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}

.toolbar-group { display: flex; align-items: center; gap: 10px; }

.toolbar-label {
  font-size: var(--fs-2);
  letter-spacing: 0.08em;
  color: var(--muted);
}

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; }

.filter-bar button {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: var(--fs-2);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.filter-bar button:hover { border-color: var(--red); color: var(--red); }

.filter-bar button[aria-pressed="true"] {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.toolbar-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

select {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--cream-2);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-2);
  padding: 7px 10px;
}

.filter-status {
  flex: 1 0 100%;
  font-size: var(--fs-2);
  color: var(--muted);
  min-height: 18px;
}

/* ── 条目卡网格 ───────────────────────────────────────── */
.list-head { margin-bottom: 22px; }

.list-head h2 { font-size: 26px; }

.list-head p {
  margin-top: 6px;
  font-size: var(--fs-3);
  color: var(--muted);
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px 24px;
}

.list-card {
  display: block;
  background: var(--cream-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.list-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(7, 35, 59, 0.1);
}

.list-card-link { display: block; }

.list-card.is-hidden { display: none; }

.list-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #d5e0e2;
}

.list-card-body { padding: 12px 14px 16px; }

.list-card-body h2 {
  font-size: 19px;
  margin-top: 4px;
}

.list-card-body p {
  margin-top: 7px;
  font-size: var(--fs-2);
  line-height: 1.7;
  color: var(--ink-soft);
}

/* ── 分类说明 ─────────────────────────────────────────── */
.list-desc {
  margin-top: 56px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--aside-gap);
}

.list-desc h2 { font-size: 26px; }

.list-desc p {
  font-size: var(--fs-4);
  line-height: 1.95;
  color: var(--ink-soft);
  max-width: 900px;
}

/* ── 相关分类 / 相关条目 ──────────────────────────────── */
.related {
  padding: 44px 0 60px;
  border-top: 1px solid var(--line-soft);
}

.related h2 {
  font-size: 26px;
  margin-bottom: 22px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.related-card {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 16px;
  align-items: center;
  background: var(--cream-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 12px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.related-card:hover { border-color: var(--red); transform: translateY(-2px); }

.related-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: #d5e0e2;
}

.related-card h3 { font-size: 16px; }

.related-card p {
  margin-top: 4px;
  font-size: var(--fs-2);
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ── 详情页正文 ───────────────────────────────────────── */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) 260px;
  gap: 64px;
  padding: 48px 0 20px;
  align-items: start;
}

.article-body {
  font-size: var(--fs-5);
  line-height: 1.95;
  color: var(--ink-soft);
}

.article-body > p:first-of-type {
  font-size: 16px;
  color: var(--ink);
}

.article-body section + section { margin-top: 38px; }

.article-body h2 {
  font-size: 25px;
  color: var(--ink);
  margin-bottom: 12px;
  padding-left: 14px;
  border-left: 3px solid var(--red);
}

.article-body p + p { margin-top: 14px; }

.article-body strong { color: var(--ink); }

.article-figure { margin: 30px 0; }

.article-figure img {
  width: 100%;
  border-radius: var(--radius-lg);
  background: #d5e0e2;
}

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

/* 目录 */
.toc {
  position: sticky;
  top: 32px;
  background: var(--cream-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}

.toc h2 {
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-weight: 600;
}

.toc ol { margin-top: 12px; display: grid; gap: 2px; counter-reset: toc; }

.toc a {
  display: block;
  padding: 7px 0 7px 0;
  font-size: var(--fs-3);
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-soft);
  transition: color 0.16s ease, padding-left 0.16s ease;
}

.toc li:last-child a { border-bottom: 0; }

.toc a:hover,
.toc a.is-active {
  color: var(--red);
  padding-left: 6px;
}

.toc-toggle { display: none; }

/* 详情页相关推荐 */
.detail-related {
  padding: 44px 0 64px;
  border-top: 1px solid var(--line);
}

.detail-related h2 { font-size: 26px; margin-bottom: 22px; }

.detail-related .related-grid { grid-template-columns: repeat(2, 1fr); }

/* ── 内页响应式 ───────────────────────────────────────── */
@media (max-width: 1080px) {
  .list-head { margin-bottom: 22px; }

.list-head h2 { font-size: 26px; }

.list-head p {
  margin-top: 6px;
  font-size: var(--fs-3);
  color: var(--muted);
}

.list-grid { grid-template-columns: repeat(2, 1fr); }
  .list-desc { grid-template-columns: 1fr; gap: 18px; }
  .article-layout { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
  .toc { position: static; order: -1; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .list-body { padding: 28px 0 40px; }
  .toolbar { gap: 12px; }
  .toolbar-sort { margin-left: 0; }
  .list-head { margin-bottom: 22px; }

.list-head h2 { font-size: 26px; }

.list-head p {
  margin-top: 6px;
  font-size: var(--fs-3);
  color: var(--muted);
}

.list-grid { grid-template-columns: 1fr; }
  .related-grid,
  .detail-related .related-grid { grid-template-columns: 1fr; }
  .related-card { grid-template-columns: 92px 1fr; }
  .article-body h2 { font-size: 21px; }
  .toc { padding: 16px 18px; }
  .article-layout { padding-bottom: 8px; }
}

/* ───────────────────────── 数据化补丁 v1.1 ───────────────────────── */

/* 分类索引：13 个分类按内容自适应高度（原主题为固定 7 列 × 284px） */
.cat-index { height: auto; padding-bottom: 46px; }

.cat-strip { grid-template-columns: repeat(7, 1fr); }

/* 精选区：13 类数据下条目更多，取消固定高度避免压到下一区 */
.featured { height: auto; padding-bottom: 48px; }

.cat-item img { aspect-ratio: 4 / 3.4; }

.cat-name { -webkit-line-clamp: 1; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }

.cat-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 30px;
}

/* 精选条目：标题最多两行，摘要两行，卡片等高 */
.variety-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
  word-break: break-word;
}

.variety-sum {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
  word-break: break-word;
}

/* 页脚：13 个分类链接按需换行（原固定 145px 高） */
.site-footer { height: auto; padding: 34px 0 30px; }

.footer-top { row-gap: 6px; }

/* 分类筛选 chips（列表页，服务端跳转） */
a.chip {
  display: inline-block;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: var(--fs-2);
  line-height: 1.5;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

a.chip:hover { border-color: var(--red); color: var(--red); }

a.chip.is-active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.filter-bar { row-gap: 8px; }

/* 列表卡片标题/摘要截断，保证等高 */
.list-card-body h2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 47px;
  word-break: break-word;
}

.list-card-body p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 59px;
  word-break: break-word;
}

/* 分页 */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: var(--fs-3);
  color: var(--ink-soft);
  background: var(--cream-2);
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.pager-btn:hover { border-color: var(--red); color: var(--red); }

.pager-btn.is-active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.pager-gap { color: var(--muted); font-size: var(--fs-3); padding: 0 4px; }

/* 详情页上下篇 */
.article-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 0 44px;
  border-top: 1px solid var(--line-soft);
  padding-top: 26px;
}

.article-pager .pager-btn { white-space: nowrap; }

/* 详情页相关条目标题截断 */
.detail-related .related-card h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.detail-related .related-card p {
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 1080px) {
  .cat-strip { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 640px) {
  .cat-strip { grid-template-columns: repeat(2, 1fr); }
  .filter-bar {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
  .list-card-body h2 { min-height: 0; }
  .list-card-body p { min-height: 0; }
  .pager-btn { padding: 7px 11px; }
}

@media (max-width: 640px) {
  .toolbar-group { min-width: 0; max-width: 100%; flex: 1 1 100%; }
  .filter-bar { min-width: 0; flex: 1 1 auto; width: 100%; }
}
