@layer discovery {
.recommend-card {
  height: 100%;
  border-radius: 26px;
  overflow: hidden;
  background: color-mix(in srgb, var(--glass-bg) 80%, transparent);
  box-shadow: 0 18px 40px rgba(17, 18, 24, 0.08);
}

.page-header {
  padding: 24px;
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 14px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 300;
}

.stat-card {
  padding: 22px;
  text-align: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 38px;
  color: var(--accent);
}

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

.chip em {
  font-family: var(--font-ui);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 1px;
  color: var(--text-light);
}

.chip {
  gap: 8px;
}

.footer-area {
  position: relative;
  z-index: 1;
  padding: 32px 0 28px;
  margin-top: 0;
  background: var(--ink);
  color: var(--bg);
  overflow: hidden;
  width: 100%;
}

html[data-theme="dark"] .footer-area {
  background: #0a0a0a;
  color: var(--text);
}

.footer-area::before {
  content: "感谢阅读";
  position: absolute;
  right: 30px;
  bottom: -6px;
  font-family: var(--font-serif);
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
  pointer-events: none;
  animation: drift-text 20s ease-in-out infinite;
}

html[data-theme="dark"] .footer-area::before {
  color: rgba(255, 255, 255, 0.05);
}

/* 这句是 CSS 的 content，翻译那一套（服务端 t() + 客户端 OpenCC）都够不着，要按语言各写一份。 */
html[lang="zh-Hant"] .footer-area::before { content: "感謝閱讀"; }
html[lang="en"] .footer-area::before { content: "Thanks for reading"; }

.footer-wrap h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 300;
}

.footer-wrap h3 .accent {
  color: var(--accent-pale);
}

.footer-wrap > p {
  max-width: 420px;
  margin: 0 0 36px;
  font-size: 14px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.32);
}

.footer-wrap {
  display: grid;
  /* ⚠️ **单列的 grid 默认是 `auto`，而 `auto` 不会收缩到内容的 min-content 以下。**
     版权那一行的 min-content 是 286px，于是这一列在任何手机宽度上都固定 286 ——
     320 的屏上右边 44px 直接被切掉（`min-width: 0` 加在 flex item 上救不了，
     卡住的是**外面这条 grid 轨道**）。`minmax(0, 1fr)` 才让它真的跟着屏幕收。
     判据见 scripts/mobile-probe.js 的第 ③ 条（逐元素量右边缘）。 */
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.footer-area .footer-wrap {
  max-width: min(1680px, 100%);
  padding-inline: clamp(32px, 5vw, 96px);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: none;
}

.footer-bottom span {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.24);
}

.footer-bottom-side {
  display: flex;
  align-items: end;
  /* ⚠️ **flex item 的 min-width 默认是 auto** —— 它会拒绝收缩到内容的
     min-content 宽度以下。版权那一行（Copyright © / 2025-2026 / The Fred's. /
     All rights reserved.）的 min-content 是 286px，于是这一整块**在任何手机宽度上
     都固定 286px**：320 实测 x=78、right=364，右边 44px 直接被切掉；
     360 切 4px；390 才勉强不切 —— 而且它连自己的容器（footer-wrap 内容宽 280）
     都撑破了 6px，只是视口还够宽，看不出来。
     全站 `body { overflow-x: hidden }`（001:73）把这一切**静静裁掉**：
     页面不横向滚动，`documentElement.scrollWidth` 永远等于 clientWidth，
     所以 `overflow-probe` 那条「文档比视口宽」的判据在这个站上根本不会成立。
     是 `scripts/mobile-probe.js` **逐元素量右边缘**才抓到的。 */
  min-width: 0;
}

.footer-bottom-side--left {
  justify-content: flex-start;
}

.footer-bottom-side--center {
  justify-content: center;
}

.footer-bottom-side--right {
  justify-content: flex-end;
}

.footer-copyright {
  line-height: 1;
  white-space: nowrap;
}

/* 版权行里那条站名链接在手机上只有 18px 高，够不到可点下限。
   inline-flex + min-height 撑到 28，行内位置不变（版权那行本来就有 1.6 行高）。 */
@media (max-width: 768px) {
  .footer-copyright a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
  }
}

.footer-copyright a {
  color: rgba(255, 255, 255, 0.28);
  text-decoration: none;
}

.footer-copyright a:hover {
  color: rgba(255, 255, 255, 0.92);
}

/* Infinity loop animation — year → ∞ on hover */
.footer-copyright-range {
  position: relative;
  display: inline-flex;
  align-items: baseline;
}

.footer-copyright-year {
  display: inline-block;
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0s;
}

.footer-infinity-loop {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.footer-infinity-path {
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
}

.footer-area:hover .footer-copyright-year {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-4px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
}

.footer-area:hover .footer-infinity-loop {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0s linear 0s;
}

.footer-area:hover .footer-infinity-path {
  animation: infinity-flow 2s linear infinite;
}

@keyframes infinity-flow {
  0% { stroke-dashoffset: 160; }
  100% { stroke-dashoffset: 0; }
}

.footer-live-readers {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.42);
}

.footer-live-readers strong {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.9);
}

.footer-live-readers-label,
.footer-live-readers-unit {
  color: inherit;
}

.foot-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* No `color` here on purpose — the footer nav inherits the footer's own ink.
   A dimmed value used to sit in this rule but never applied (it lost to
   `body.public-body a { color: inherit }` in the foundation layer); with cascade
   layers it WOULD apply, dropping these 11px uppercase links from 14.3:1 to
   4.6:1 contrast. Inheriting is both the shipped look and the legible one.
   Same reasoning at the .foot-links override further down this file. */
.foot-links a {
  font-size: 9px;
  text-decoration: none;
}

.foot-links a:hover {
  color: var(--bg);
}

html[data-theme="dark"] .foot-links a:hover {
  color: var(--text);
}

.code-copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 7px 10px;
  font-size: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  opacity: 1;
  z-index: 3;
  min-width: 64px;
  text-align: center;
  text-transform: none;
  letter-spacing: 0.04em;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.code-copy-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
}

.code-copy-btn.copied {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.prose pre.has-code-copy,
.article-body-card .article-content pre.has-code-copy,
body.public-body .page-card .article pre.has-code-copy {
  padding-top: 48px;
}

.code-copy-note {
  position: absolute;
  top: 15px;
  left: 16px;
  z-index: 2;
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.62);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.code-copy-note.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.article-body-card .article-content pre .code-copy-btn,
body.public-body .page-card .article pre .code-copy-btn {
  background: var(--glass-inner);
  border-color: var(--glass-border);
  color: var(--text-light);
}

.article-body-card .article-content pre .code-copy-btn.copied,
body.public-body .page-card .article pre .code-copy-btn.copied {
  color: var(--accent);
}

.article-body-card .article-content pre .code-copy-note,
body.public-body .page-card .article pre .code-copy-note {
  color: var(--text-light);
}

.btn.btn-primary {
  color: var(--text);
}

.cf-turnstile {
  width: 100%;
}

@keyframes breathe-bar {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes drift-text {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-20px); }
}

@media (max-width: 960px) {
  body.public-body.page-home {
    --hp-screen-h: auto;
    scroll-snap-type: none;
  }

  body.public-body .nav-live-search {
    width: 100%;
    min-width: 0;
  }

  .feature {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {

  .home-social-row {
    gap: 14px;
  }

  /* The `.home-site-pulse-*` responsive overrides went with the family itself
     — 那份说明原在 002-home.css，该表 2026-08-19 随旧首页一起退役。 */

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  /* (the .lightbox-* responsive override went with the family — see 003.) */

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-copyright,
  .foot-links {
    white-space: normal;
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .home-social-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  body.public-body .main-manju {
    padding-top: 6rem;
  }

  .footer-area {
    padding-top: 0;
  }
}

@media (max-width: 430px) {

  .home-landing-copy h1 {
    font-size: clamp(30px, 10vw, 42px);
  }
}

@media (max-width: 360px) {
  .home-social-row {
    grid-template-columns: 1fr;
  }

  }

/* ── 出错的那两页（404 / error）──────────────────────────────────────────
   原来整块是写在模板里的内联样式（`style="text-align:center; padding: 4rem 0"` 等三处），
   收进这里。数值一个没改，改的只是它住在哪儿。

   ⚠️ 真正的毛病是那条「返回首页」：它和上面那行说明**逐属性一模一样** ——
   同色（rgb(46,43,38)）、同字重（400）、同字号、没有下划线，量出来 `same: true`。
   那是这一页上唯一的出口，却看不出能点。按站里的规矩（不要发丝线、不要 hover 才滑出的
   下划线，可点击感交给**颜色 + 字重**）给它上色加粗。 */
.error-page {
  text-align: center;
  padding: 4rem 0;
}

.error-page-code {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.error-page-home {
  margin-top: 1rem;
  display: inline-block;
  font-weight: 600;
  color: #533963;
  text-decoration: none;
}

.error-page-home:hover {
  color: #2b1d33;
}

:is(html[data-theme="dark"], body.dark-mode) .error-page-home {
  color: #DFCEEA;
}

:is(html[data-theme="dark"], body.dark-mode) .error-page-home:hover {
  color: #fff;
}

/* ── Footer typography: larger, calmer, reference fonts ── */
.footer-area { --ftf-sans: var(--font-sans); --ftf-serif: var(--font-serif); }
.footer-bottom { padding-top: 18px; gap: 22px; align-items: baseline; }
.footer-bottom span { font-family: var(--ftf-sans); font-size: 11px; letter-spacing: 0.14em; color: rgba(255,255,255,0.52); }
.footer-copyright { display: inline-flex; align-items: baseline; gap: 0.55em; font-family: var(--ftf-sans); font-size: 11px; letter-spacing: 0.14em; line-height: 1; text-transform: uppercase; }
.footer-copyright a { font-family: var(--ftf-serif); font-size: 18px; font-style: italic; letter-spacing: 0.01em; text-transform: none; color: rgba(255,255,255,0.85); }
.footer-copyright a:hover { color: #fff; }
.foot-links { align-items: baseline; gap: 22px; }
.foot-links a { display: inline-flex; align-items: baseline; font-family: var(--ftf-sans); font-size: 11px; letter-spacing: 0.14em; line-height: 1; text-transform: uppercase; transition: color 0.3s ease; }
.foot-links a:hover, html[data-theme="dark"] .foot-links a:hover { color: #fff; }
.footer-live-readers { color: rgba(255,255,255,0.52); }
.footer-live-readers strong { font-family: var(--ftf-sans); font-size: 13px; color: #fff; }
.footer-live-readers-label, .footer-live-readers-unit { font-family: var(--ftf-sans); letter-spacing: 0.08em; }

/* fix: READING NOW — breathing room between label/number/unit + sizing */
.footer-live-readers { gap: 0.45em; align-items: baseline; }
.footer-live-readers-label { font-size: 11px; letter-spacing: 0.14em; }
.footer-live-readers-unit { font-size: 11px; letter-spacing: 0.06em; }
.footer-live-readers strong { font-size: 14px; font-weight: 500; }

/* ⚠️ 断点是 **1200**，不是 769（2026-09-12 抬上来的）。
   下面这套三列是 `max-content max-content max-content` —— max-content 的轨道**永远不收缩**。
   写 769 的时候只在宽屏上看过：一旦窗口窄下来（769–1180 这一整段：小笔记本、平板横屏、
   分屏窗口），三列加两道 gap 就比容器宽，整行左右两头一起被 `body { overflow-x: hidden }`
   （001:73）**静静裁掉** —— 左边「READING NOW」缺字母，右边 RSS / About 直接没了。
   逐宽度量过的溢出量：1100 → 24px，1024 → 58px，900 → 114px，800 → 159px。
   页面不会横向滚动，所以「文档比视口宽」那条判据看不见它；mobile-probe 只扫到 430px，
   这一档从来没人量过。

   试过另一条路：把轨道改成 `minmax(0, max-content)` 再让 .foot-links 折行。不裁了，
   但版权那一行是 `white-space: nowrap`、收不动，于是链接的第一行直接压在
   「ALL RIGHTS RESERVED」上面 —— 从「切掉」变成「叠字」，更糟。所以退回原样，只抬断点：
   放得下的时候还是设计稿那一行，放不下就落回文件顶上那条 flex 基础规则
   （`space-between` + `flex-wrap: wrap`），自己折成两行。
   1200 这个值是量出来的：1280 时三列比容器窄 46px，1100 时已经超出 24px。 */
@media (min-width: 1200px) {
  .footer-bottom {
    display: grid;
    grid-template-columns: max-content max-content max-content;
    justify-content: center;
    align-items: baseline;
    column-gap: clamp(46px, 4.2vw, 84px);
    row-gap: 10px;
  }

  .footer-bottom-side--left {
    justify-self: start;
    transform: none;
  }

  .footer-bottom-side--center {
    justify-self: start;
    transform: translateX(-18px);
  }

  .footer-bottom-side--right {
    justify-self: end;
    min-width: 0;
  }

  .foot-links {
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: clamp(12px, 1.05vw, 20px);
  }

  .footer-copyright {
    white-space: nowrap;
  }
}
}
