@layer listing {

.tag,
.foot-links a,
.footer-bottom span,
.page-info,
.stat-label,
.nav-search-item-meta,
.comment-author + time,
.code-copy-btn {
  font-family: var(--font-ui);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero-desc {
  max-width: 540px;
  margin: 0 0 42px;
  font-size: 15px;
  line-height: 2.1;
  font-weight: 300;
  color: var(--text-light);
}

.writings {
  padding: 24px 0 80px;
}

.section-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
}

.section-header h2 {
  font-size: 30px;
}

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 70vh;
  margin-top: 24px;
}

.page-info {
  font-size: 10px;
  color: var(--text-light);
}

.form-group input,
.form-group textarea {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
  font: inherit;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-light);
}

.btn.btn-primary{
  border: 1px solid var(--glass-border);
  background: var(--glass-inner);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn.btn-primary {
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.btn.btn-primary:hover{
  border-color: var(--accent-pale);
  transform: translateY(-1px);
}

.empty-hint{
  padding: 28px;
  border-radius: 22px;
  color: var(--text-light);
}

.empty-hint strong {
  color: var(--text);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}

.tag,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-inner);
  color: var(--text-light);
  text-decoration: none;
  font-size: 10px;
}

.tag.active,
.chip:hover {
  color: var(--text);
  border-color: var(--accent-pale);
}

.about {
  padding: 100px 0;
  border-top: 1px solid var(--text-dim);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.article-content {
  padding-top: 6px;
}

.prose {
  color: var(--text);
  font-size: clamp(16px, 1rem + 0.12vw, 18px);
  line-height: 2;
}

.prose h2,
.prose h3,
.prose h4 {
  margin: 1.8em 0 0.65em;
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.32;
}

.prose h2 {
  font-size: clamp(28px, 3vw, 38px);
}

.prose h3 {
  font-size: clamp(24px, 2.5vw, 32px);
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose table,
.prose figure {
  margin: 1.25em 0;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 0.4em;
}

.prose blockquote {
  position: relative;
  margin: 1.6em 0;
  padding: 18px 22px 18px 24px;
  border-left: none;
  border-radius: 0 18px 18px 0;
  background: var(--glass-inner);
  color: var(--text-light);
}

.prose blockquote::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  animation: breathe-bar 4s ease-in-out infinite;
}

/* 正文链接 —— 2026-08-20 去掉底线。
   这里原本是 `border-bottom: 1px solid rgba(83, 57, 99,.25)`，而 `style.css`
   的 `.prose a` 同时给了 `text-decoration: underline`：两条都会画，一个链接
   底下实测叠着两条线（一条 text-decoration、一条 border）。
   Fred：「有跳转链接的或者是可点击的全部都会下面多个下划线，彻底删干净，
   我不再使用这种 UI 风格。」可点击感改为交给颜色 + 字重。 */
.prose a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: none;
}

.prose a:hover {
  color: var(--accent-hover, var(--text));
  text-decoration: none;
  border-bottom: none;
}

/* ── 脚注（注释栏）的基础样式 ────────────────────────────────────────
   标记由 lib/content.js 的 renderMarkdown 生成，所以任何渲染文章正文的
   页面都可能出现它（/notes 的沉思也走同一条渲染路径）。文章详情页有
   012-article-craft.css 的精确版本，这里是别处的兜底。 */
.prose .footnote-ref {
  font-size: 0.68em;
  vertical-align: super;
  font-weight: 600;
  padding: 0 2px;
  color: var(--accent);
}

.prose .article-footnotes-block {
  margin-top: 2em;
  padding-top: 1.2em;
  border-top: 1px solid var(--text-dim);
  font-size: 0.85em;
  line-height: 1.65;
}

.prose .article-footnotes-block .fn-title {
  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.5em;
}

.prose .article-footnotes-block p {
  margin: 0;
}

.prose .article-footnotes-block p + p {
  margin-top: 0.4em;
}

.prose img {
  display: block;
  margin: 1.6em auto;
  border-radius: 22px;
  box-shadow: var(--glass-shadow);
  cursor: zoom-in;
}

.prose .story-media,
.prose .story-live-photo {
  margin: 1.7em 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.prose .story-media-frame,
.prose .story-live-photo-frame {
  display: block;
  line-height: 0;
  overflow: hidden;
  border-radius: 22px;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
}

.prose .story-media-frame > img,
.prose .story-live-photo-frame > img {
  width: 100%;
  margin: 0 !important;
  border-radius: inherit !important;
  box-shadow: none !important;
  -webkit-user-drag: none;
}

.prose .story-media figcaption,
.prose .story-live-photo figcaption {
  margin-top: 0.08rem;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.prose pre {
  position: relative;
  overflow: auto;
  padding: 18px;
  border-radius: 22px;
  background: #1e1813;
  color: #f7efe5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .prose pre {
  background: #11161d;
  color: #dbe6f2;
}

/* 2026-08-21：这里原本是 `var(--font-ui)`（= 无衬线）。它排在 layer `listing`，
   压过 style.css 里那条 `.prose code { font-family: var(--font-mono) }`（layer
   `legacy`），于是**全站的代码块和行内代码一直是按比例的黑体在排** ——
   `--font-mono` 实际上一个消费者都没有。全站字体自查只量「有没有多出来的字」，
   这种「该用的没用上」它报不出来。等宽是功能性的（对齐、l/1/I 分得开），
   现在是 Google Sans Code。 */
.prose code {
  font-family: var(--font-mono);
}

.prose :not(pre) > code {
  padding: 0.2em 0.45em;
  border-radius: 8px;
  background: var(--glass-inner);
  font-size: 0.9em;
}

/* A bare URL or DOI in a citation is one unbreakable token. At 390px the
   reference list in the 圣地巡礼 article had a <p> whose content measured 455px
   inside a 358px box, which pushed the DOCUMENT to 472px — and that is the
   other half of "swipe right and the whole page zooms": body{overflow-x:hidden}
   stops Chrome panning, but iOS Safari will still let the visual viewport pinch
   out to the full width. break-word only breaks a word that would otherwise
   overflow, so ordinary prose is untouched. */
.prose {
  /* ⚠️ 2026-08-30：这里原本是 `break-word`，而上面那段注释描述的症状
     （"the whole page zooms"）**它治不了** —— `break-word` 只在实际排版时断词，
     **不改 min-content**，而撑大布局视口的正是 min-content。改成 `anywhere`：
     渲染出来的文字一模一样，区别只在浏览器算「这块最窄能到多少」时认不认这个断点。
     详见 001-foundation-nav.css 里 `.main-manju` 那段。 */
  overflow-wrap: anywhere;
  line-break: strict;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
}

.prose th,
.prose td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--text-dim);
  text-align: left;
}

.prose thead {
  background: var(--glass-inner);
}

/* ══════════════ Mobile tables ══════════════
   A table can't lay out narrower than its min-content width, so `width: 100%`
   never contained a wide one: it squeezed every CJK cell to one character per
   line AND still pushed past the viewport.

   Two treatments, chosen by column count:

   • ≤3 columns — left as a real table. Three columns at 6.5em still fit inside
     358px, so nothing scrolls and nothing collapses; the min-width is only
     there to stop the one-character-per-line squeeze.

   • ≥4 columns — the table stops being a table and becomes one card per row,
     each cell on its own line labelled with its header. No horizontal scroll
     at all, every cell gets the full column width. Selected with :has(), so
     the layout is correct on FIRST PAINT — no flash of a scrolling table.
     Browsers without :has() (Safari <15.4) simply keep the ≤3-column
     treatment, which is the horizontal scroller — the old behaviour, not a
     broken one. The per-cell labels come from data-label, filled in by
     labelWideTables() in public-overhaul.js; if that never runs the cards
     still lay out, just without the label column. */
@media (max-width: 768px) {
  .prose table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    /* don't hand a horizontal fling to the page once the table hits its end */
    overscroll-behavior-x: contain;
    /* the 18px radius + tinted thead read as a "bubble" on a flat page */
    border-radius: 0;
  }

  .prose thead {
    background: none;
  }

  /* No cell min-width. It existed to stop the one-character-per-line squeeze
     back when every wide table was a horizontal scroller — but wide tables are
     cards now, and forcing 8em + 6.5em + 6.5em on a THREE-column table made it
     408px wide and scroll for no reason. At three columns each cell gets ~119px
     (about 8 CJK characters per line), which wraps fine on its own, and the
     .prose overflow-wrap above handles a long URL. overflow-x stays as a safety
     net for markup this doesn't anticipate; in practice it no longer engages. */
  .prose th,
  .prose td {
    padding: 10px 12px;
  }

  /* ── ≥4 columns → stacked cards ── */
  .prose table:has(tr > :nth-child(4)) {
    overflow: visible;
  }

  /* The header row is redundant once every cell carries its own label —
     whether it is a real <thead> or the first <tbody> row standing in for one
     (labelWideTables() tags that case, because the stored HTML for these
     articles carries an empty thead and puts the headers in the body). */
  .prose table:has(tr > :nth-child(4)) thead,
  .prose table:has(tr > :nth-child(4)) tr.is-synthetic-head {
    display: none;
  }

  .prose table:has(tr > :nth-child(4)) tbody,
  .prose table:has(tr > :nth-child(4)) tr,
  .prose table:has(tr > :nth-child(4)) td {
    display: block;
    width: auto;
    min-width: 0;
  }

  /* 直角（2026-09-12）：14px 圆角的淡底卡片就是 Fred 09-11 说的「气泡」，
     同一页的代码块、标注框、书签卡片都已经是方的。 */
  .prose table:has(tr > :nth-child(4)) tr {
    margin: 0 0 14px;
    padding: 14px 16px;
    border-radius: 0;
    background: color-mix(in srgb, var(--text) 4%, transparent);
  }

  .prose table:has(tr > :nth-child(4)) tr:last-child {
    margin-bottom: 0;
  }

  .prose table:has(tr > :nth-child(4)) td {
    display: grid;
    /* Fixed, not auto: each cell is its own grid, so an auto label column
       would size per-cell and the values would not line up down the card. */
    grid-template-columns: 6em 1fr;
    gap: 12px;
    padding: 7px 0;
    border-bottom: none;
    align-items: baseline;
  }

  /* No label to show → don't reserve the label column, or the value sits
     indented against nothing. Covers a colspan cell and the JS-disabled case. */
  .prose table:has(tr > :nth-child(4)) td:not([data-label]) {
    display: block;
  }

  .prose table:has(tr > :nth-child(4)) td::before {
    content: attr(data-label);
    font-size: 0.82em;
    line-height: 1.7;
    color: var(--text-light);
    /* a long header shouldn't push the value column around */
    overflow-wrap: anywhere;
  }

  /* First cell = the row's name. It titles the card instead of being a field. */
  .prose table:has(tr > :nth-child(4)) td:first-child {
    display: block;
    margin-bottom: 4px;
    padding-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--text-dim);
    font-weight: 600;
  }

  .prose table:has(tr > :nth-child(4)) td:first-child::before {
    display: none;
  }
}

}
