/* 文章目录复用默认卡片、字号和全局分页，只定义页面布局与两行导读。 */
.articles-directory { min-height: 55vh; padding-block: 32px 64px; background: var(--surface); }
.articles-heading { margin-block-end: 24px; }
.articles-heading h1 { font-size: var(--text-page); font-weight: 600; line-height: 1.4; letter-spacing: 0; }
.articles-heading p { margin-block-start: 8px; color: var(--muted); font-size: var(--text-sm); }
.articles-directory .guide-grid { align-items: stretch; }
.articles-directory .guide-card { min-width: 0; background: #fff; }
.articles-directory .guide-card > a { display: block; }
.article-thumbnail { aspect-ratio: 16 / 9; overflow: hidden; background: var(--pale); }
.article-thumbnail > img { width: 100%; height: 100%; object-fit: cover; }
.articles-directory .guide-copy h2, .related-content .guide-copy h3 { font-size: var(--text-name); font-weight: 600; line-height: 1.5; text-wrap: pretty; overflow-wrap: anywhere; }
.articles-directory .guide-copy h2 a, .related-content .guide-copy h3 a { display: block; color: var(--ink); }
.articles-directory .guide-copy h2 a { min-height: 44px; }
.articles-directory .guide-copy h2 a:is(:hover, :focus-visible), .related-content .guide-copy h3 a:is(:hover, :focus-visible) { color: var(--blue-hover); }
.guide-copy .article-date { margin-block: 0 8px; color: var(--muted); font-size: .8125rem; }
.question-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-block-start: 8px; }
.question-card-meta .article-date { margin: 0; }
.guide-copy .article-excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-block-size: 3.3em;
  max-block-size: 3.3em;
  line-height: 1.65;
}

/* 文章详情复用公共外壳及面包屑，推荐只提供本站文章入口。 */
.article-layout { display: grid; grid-template-columns: minmax(0, 836px); justify-content: center; padding-block: var(--detail-start-gap) 72px; }
.article-layout.has-recommendations, .article-layout.document-layout { grid-template-columns: minmax(0, 1fr) 288px; gap: 32px; justify-content: normal; }
.article-reading { min-width: 0; }
.article-section-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--blue); font-size: var(--text-sm); font-weight: 600; }
.article-heading h1:lang(zh) { text-wrap: wrap; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-block-start: var(--detail-meta-gap); color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
:is(.article-detail, .question-detail) .article-meta { gap: 0 16px; }
.article-engagement { display: contents; }
.article-views, .article-like { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.article-views svg, .article-like svg { flex: none; width: 18px; height: 18px; }
.article-like { min-height: 44px; padding: 8px 0; border: 0; background: transparent; color: inherit; font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; transition: color 150ms ease; }
.article-like:enabled:is(:hover, :focus-visible), .article-like[aria-pressed="true"] { color: var(--blue-hover); }
.article-like:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.article-like:disabled { cursor: default; }
.article-like[aria-busy="true"] { opacity: .65; cursor: wait; }
@media (prefers-reduced-motion: reduce) { .article-like { transition: none; } }
.article-summary { margin-block-start: 16px; padding: 14px 18px; border-radius: var(--radius-card); background: var(--surface); overflow-wrap: anywhere; }
.article-page .article-summary h2 { margin-block-end: var(--detail-subheading-gap); font-size: var(--text-body); line-height: 1.5; }
.article-summary p { font-size: .9375rem; line-height: 1.75; }
.article-cover { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-card); margin-block-start: 28px; }
.article-body { min-width: 0; margin-block-start: 32px; font-size: 1.0625rem; line-height: 2.05; overflow-wrap: anywhere; }
:is(.article-detail, .question-detail) .article-body { margin-block-start: 24px; line-height: 1.9; }
.article-body h2 { margin-block: var(--detail-section-gap) var(--detail-heading-gap); text-wrap: pretty; }
.article-body :is(h3, h4) { margin-block: 24px var(--detail-subheading-gap); }
.article-body > :first-child { margin-block-start: 0; }
.article-body p + p { margin-block-start: 14px; }
.article-body :is(ul, ol) { padding-inline-start: 1.5em; margin-block: 16px; }
.article-body li + li { margin-block-start: 8px; }
.article-body :is(h2, h3)[id] { scroll-margin-block-start: 96px; }
.article-body img { max-width: 100%; height: auto; margin-block: 20px; border-radius: var(--radius-card); }
.article-body blockquote { margin: 24px 0; padding: 20px 24px; border-inline-start: 3px solid var(--blue); background: var(--surface); }
.article-body blockquote p { margin: 0; }
.article-body pre { max-width: 100%; padding: 20px; overflow: auto; border-radius: var(--radius-button); background: var(--surface); font-size: var(--text-sm); line-height: 1.7; }
.article-body :not(pre) > code { padding: 2px 5px; background: var(--surface); border-radius: 4px; font-size: .9em; }
.article-body table { width: 100%; max-width: 100%; table-layout: fixed; border-collapse: collapse; margin-block: 24px; font-size: var(--text-sm); }
.article-body :is(th, td) { padding: 12px; border: 1px solid var(--line); text-align: start; overflow-wrap: anywhere; }
.article-body th { background: var(--surface); color: var(--ink); font-weight: 600; }
.article-body hr { margin-block: 32px; border: 0; border-block-start: 1px solid var(--line); }
.article-references { margin-block-start: 32px; padding-block-start: 24px; border-block-start: 1px solid var(--line); font-size: var(--text-sm); }
.article-references ul { margin-block-start: var(--detail-heading-gap); padding-inline-start: 1.5em; }
.article-references a { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.reading-disclaimer {
  margin-block-start: clamp(24px, 3vw, 32px);
  padding: 12px 16px;
  border-radius: var(--radius-button);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.reading-disclaimer strong { color: var(--body); font-weight: 600; }
.reading-disclaimer p { margin-block-start: 4px; }
.article-recommendations { position: sticky; top: 96px; align-self: start; min-width: 0; margin-block-start: 8px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-card); background: #fff; }
.article-recommendations h2 { margin-block-end: var(--detail-heading-gap); }
.article-recommendations ul { margin: 0; padding: 0; list-style: none; }
.article-recommendations li { padding-block: 20px; }
.article-recommendations li + li { border-block-start: 1px solid var(--line); }
.article-recommendations li:first-child { padding-block-start: 0; }
.article-recommendations li:last-child { padding-block-end: 0; }
.article-recommendations li a { display: flex; flex-direction: column; min-height: 44px; color: var(--ink); }
.article-recommendations time { display: block; margin-block-end: 8px; color: var(--muted); font-size: var(--text-xs); }
.article-recommendations li a span { font-size: .9375rem; font-weight: 500; line-height: 1.8; }
.article-recommendations a:is(:hover, :focus-visible) { color: var(--blue-hover); }
.article-recommendations a[aria-current="page"] { color: var(--blue); }
.article-recommendations a[aria-current="page"] span { font-weight: 600; }
.recommendations-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: var(--detail-heading-gap); }
.recommendations-heading h2 { min-width: 0; margin: 0; }
.article-contents { display: none; }
.article-detail .article-contents { display: block; margin-block-start: 12px; border-block: 1px solid var(--line); }
.article-contents summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding-block: 6px; color: var(--ink); font-size: var(--text-sm); font-weight: 600; list-style: none; }
.article-contents summary::-webkit-details-marker { display: none; }
.article-contents-chevron .icon { width: 16px; height: 16px; }
.article-contents[open] .article-contents-chevron { rotate: 180deg; }
.article-contents ol { margin: 0; padding: 0 0 12px 1.5em; color: var(--muted); }
.article-contents a { display: inline-flex; align-items: center; min-height: 44px; padding-block: 8px; font-size: var(--text-sm); overflow-wrap: anywhere; }

@media (768px <= width < 1100px) {
  .articles-directory .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout.has-recommendations, .article-layout.document-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; }
}

@media (width < 768px) {
  .articles-directory { padding-block: 24px 40px; }
  .articles-heading h1 { font-size: var(--text-page-mobile); }
  .articles-heading p { line-height: 1.8; }
  .guide-copy .article-date { font-size: var(--text-xs); }
  .article-layout, .article-layout.has-recommendations, .article-layout.document-layout { display: block; padding-block: var(--detail-start-gap) 40px; }
  /* 分类链接仍可从面包屑访问，手机信息行优先显示文章日期与互动。 */
  .article-detail .article-section-link { display: none; }
  .article-meta { gap: 6px 14px; font-size: var(--text-xs); }
  :is(.article-detail, .question-detail) .article-meta { gap: 0 12px; }
  .article-engagement { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 12px; min-width: 0; }
  .article-engagement :is(.article-views, .article-like) { white-space: normal; overflow-wrap: anywhere; }
  .article-summary { margin-block-start: 12px; padding: 12px 14px; }
  .article-body { margin-block-start: 28px; font-size: var(--text-body); line-height: 2; }
  :is(.article-detail, .question-detail) .article-body { margin-block-start: 16px; line-height: 1.9; }
  .article-body :is(th, td) { padding: 8px; }
  .article-recommendations { position: static; margin-block-start: 32px; padding: 20px; }
  .article-recommendations li a span { font-size: var(--text-body); }
  .article-contents { display: block; margin-block-start: 24px; border-block: 1px solid var(--line); }
  .document-detail .article-contents summary { min-height: 52px; padding-block: 12px; }
}

/* 栏目使用真实slug路径；相邻文章与列表复用边框、圆角和可见焦点。 */
.article-categories { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 0 24px; }
.article-categories a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--radius-button); background: #fff; color: var(--body); font-size: var(--text-sm); }
.article-categories a:hover { color: var(--blue-hover); border-color: var(--blue); }
.article-categories a[aria-current] { color: var(--blue-hover); border-color: #93b4ff; background: var(--pale); font-weight: 600; }
.article-neighbors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-block-start: 36px; }
.article-neighbor { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-block-size: 108px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-card); background: #fff; }
.article-neighbor.next { align-items: flex-end; text-align: end; }
.article-neighbor-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--text-sm); line-height: 1.5; }
.article-neighbor-label .icon { width: 16px; height: 16px; }
.article-neighbor.previous .icon { transform: rotate(180deg); }
.article-neighbor.next .icon { order: 1; }
.article-neighbor-title { max-inline-size: 100%; color: var(--ink); font-size: var(--text-body); font-weight: 500; line-height: 1.65; overflow-wrap: anywhere; }
a.article-neighbor:is(:hover, :focus-visible) .article-neighbor-title {
  color: var(--blue-hover);
  text-decoration-line: underline;
  text-decoration-thickness: inherit;
}
div.article-neighbor { border-style: dashed; }
div.article-neighbor .article-neighbor-title { color: var(--muted); }
@media (width < 768px) {
  .article-neighbors { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-block-start: 28px; }
  .article-neighbor { min-block-size: auto; padding: 16px 20px; }
}
