/* 人文社科项目平台 —— 样式
 * 白纸、黑字、大留白。汉字用细体无衬线，数字用衬线体（Instrument Serif，随站点本地存放）。
 * 全站只有一处颜色：核验印章的朱红。改配色只需动下面的变量。
 */
@font-face {
  font-family: "Instrument Serif";
  src: url("./fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #000000;
  --soft: #6e6e6e;
  --faint: #a3a3a3;
  --line: #e6e6e6;
  --wash: #f5f5f3;
  --seal: #c4301c;
  --series: #2a78d6;   /* 图表里表示“数量”的单一颜色 */
  --grid: #e9e9e6;
  --axis: #8a8a86;

  --sans: "Helvetica Neue", "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif;
  --numerals: "Instrument Serif", Georgia, "Times New Roman", serif;

  --ease: cubic-bezier(.2, .7, .1, 1);
  --gutter: clamp(20px, 4vw, 64px);
  --wide: 1520px;
  --step-1: clamp(15px, 0.6vw + 13px, 17px);
  --step-2: clamp(19px, 0.9vw + 15px, 24px);
  --step-3: clamp(26px, 2vw + 16px, 40px);
  --step-4: clamp(34px, 4.2vw + 14px, 76px);
  --step-5: clamp(30px, 6.6vw + 4px, 112px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
main:focus { outline: none; }
::selection { background: var(--ink); color: var(--paper); }

.icon { width: 1.15em; height: 1.15em; flex: none; }
.num { font-family: var(--numerals); font-variant-numeric: lining-nums; letter-spacing: -0.01em; }
.muted { color: var(--soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -60px; z-index: 10; padding: 8px 14px; background: var(--ink); color: var(--paper); }
.skip:focus { top: 10px; }

/* ---------- 页眉、页脚 ---------- */


.page { flex: 1; padding-block: clamp(28px, 5vw, 72px) clamp(64px, 9vw, 140px); }
.site-footer { border-top: 1px solid var(--line); color: var(--soft); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; padding-block: 28px; }
.footer-inner a:hover { color: var(--ink); }
.loading { padding-block: 20vh; color: var(--soft); }

/* ---------- 首页 ---------- */

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tag { padding: 5px 15px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; transition: border-color .15s; }
.tag:hover { border-color: var(--ink); }

.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border-block: 1px solid var(--line); }
.figures a { display: flex; flex-direction: column; gap: 2px; padding: clamp(18px, 2.4vw, 34px) 0; color: var(--soft); font-size: 14px; }
.figures .num { color: var(--ink); font-size: var(--step-4); line-height: 1; }
.figures a:hover span:last-child { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

.band { margin-top: clamp(56px, 8vw, 128px); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: clamp(18px, 2.4vw, 32px); }
.section-head h2, .section-head h3 { font-size: var(--step-3); font-weight: 300; line-height: 1.2; }
.section-head h2:focus { outline: none; }
.section-head small { margin-left: .3em; font: 400 .7em var(--numerals); color: var(--soft); }
.section-head > a, .text-button { flex: none; padding: 0; border: 0; background: none; color: var(--soft); font-size: 14px; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px; }
.section-head > a:hover, .text-button:hover:not(:disabled) { color: var(--ink); text-decoration-color: var(--ink); }
.text-button:disabled { opacity: .4; cursor: default; }
.section-note { margin: -8px 0 22px; max-width: 46em; color: var(--soft); font-size: 14px; }

/* 学科块：相当于没有图片的“封面” */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(12px, 1.4vw, 22px); }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-height: clamp(220px, 22vw, 330px); padding: clamp(20px, 2vw, 30px); border-radius: 14px; background: var(--wash); transition: background .2s, color .2s; }
.tile h3 { font-size: var(--step-3); font-weight: 300; line-height: 1.22; }
.tile-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.tile-foot p { display: flex; flex-direction: column; color: var(--soft); font-size: 13px; }
.tile-foot .num { color: var(--ink); font-size: clamp(34px, 3vw, 50px); line-height: 1; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 44px; }
.spark i { width: 7px; height: max(2px, calc(var(--share) * 100%)); background: currentColor; }
.tile:hover { background: var(--ink); color: var(--paper); }
.tile:hover .num { color: inherit; }
.tile:hover p { color: #bdbdbd; }

.facet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: clamp(32px, 5vw, 88px); }
.facet h3 { margin-bottom: 18px; color: var(--soft); font-size: 14px; font-weight: 400; }
.facet-stack { display: grid; gap: 44px; align-content: start; }

.years { display: flex; align-items: flex-end; gap: clamp(6px, 1vw, 14px); height: 190px; }
.years a { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; text-align: center; }
.year-count { font: 17px/1 var(--numerals); }
.year-bar { width: min(100%, 26px); margin-inline: auto; height: calc(var(--share) * (100% - 58px)); min-height: 2px; border-radius: 4px 4px 0 0; background: var(--series); transition: opacity .15s; }
.year-label { color: var(--soft); font: 16px/1 var(--numerals); }
.years:hover .year-bar { opacity: .25; }
.years a:hover .year-bar { opacity: 1; }
.years.dense .year-count { display: none; }
.years.dense .year-label { font-size: 11px; }

.bar-rows a { display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; padding-block: 9px; }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-count { font: 17px/1.5 var(--numerals); }
.bar-track { grid-column: 1 / -1; height: 2px; background: var(--line); }
.bar-track { border-radius: 2px; }
.bar-track span { display: block; width: calc(var(--share) * 100%); height: 100%; border-radius: 2px; background: var(--c, var(--series)); }
.bar-track { height: 4px; }
.swatch { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--c); vertical-align: baseline; }
.bar-rows a:hover .bar-name { text-decoration: underline; text-underline-offset: 4px; }

.rank-list { column-count: 2; column-gap: clamp(32px, 5vw, 88px); border-top: 1px solid var(--line); }
.rank-list li { break-inside: avoid; border-bottom: 1px solid var(--line); }
.rank-list a { display: grid; grid-template-columns: 2.2em 1fr auto; align-items: baseline; gap: 12px; padding-block: 15px; }
.rank-list .num { color: var(--faint); font-size: 22px; }
.rank-name { font-size: var(--step-2); font-weight: 300; }
.rank-count { color: var(--soft); font-size: 14px; }
.rank-list a:hover .rank-name { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

/* ---------- 页面标题 ---------- */

.page-heading { margin-bottom: clamp(32px, 5vw, 72px); }
.page-heading h1 { font-size: var(--step-5); font-weight: 300; line-height: 1.1; letter-spacing: -0.01em; }
.page-heading p { margin-top: 18px; max-width: 44em; color: var(--soft); font-size: var(--step-1); }
.page-heading .scope { color: var(--ink); }
.page-heading .scope a { text-decoration: underline; text-underline-offset: 4px; }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: clamp(24px, 4vw, 56px); color: var(--soft); font-size: 13px; }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs .icon { width: 12px; height: 12px; color: var(--faint); }
.breadcrumbs span { max-width: 24em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.detail-heading { margin-bottom: clamp(36px, 5vw, 76px); }
.kind { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--soft); font-size: 14px; }
.detail-heading h1 { max-width: 20em; font-size: var(--step-4); font-weight: 300; line-height: 1.18; letter-spacing: -0.005em; text-wrap: balance; }
.detail-facts { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 22px; color: var(--soft); font-size: var(--step-1); }
.detail-facts .num { margin-right: .15em; color: var(--ink); font-size: 1.5em; line-height: 1; }
.detail-action { margin-top: 26px; }
.grant { font-family: var(--numerals); font-size: 1.1em; letter-spacing: .02em; }

.seal { display: inline-block; padding: 1px 7px; border: 1px solid var(--seal); border-radius: 3px; color: var(--seal); font-size: 12px; font-weight: 400; line-height: 1.5; letter-spacing: .08em; vertical-align: middle; }
.seal.pending { border-color: var(--line); color: var(--soft); }
h2 .seal { margin-left: 10px; }

/* ---------- 筛选 ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; margin-bottom: 8px; }
.search { flex: 1 1 280px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--ink); }
.search .icon { color: var(--soft); }
.search input { flex: 1; min-width: 0; padding: 11px 0; border: 0; background: none; outline: none; font-size: 16px; }
.search input::placeholder { color: var(--faint); opacity: 1; }
.select { position: relative; }
.select select { appearance: none; max-width: 15em; padding: 11px 22px 11px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; cursor: pointer; text-overflow: ellipsis; }
.select::after { content: ""; position: absolute; right: 4px; top: 50%; width: 6px; height: 6px; border: solid var(--ink); border-width: 0 1px 1px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select select:hover, .select select:focus { border-color: var(--ink); }
.filter-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-block: 22px 12px; color: var(--soft); font-size: 14px; }
.filter-summary .num { margin-right: .2em; color: var(--ink); font-size: 26px; line-height: 1; }

.button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; border: 1px solid var(--ink); border-radius: 999px; background: var(--paper); font-size: 14px; transition: background .15s, color .15s; }
.button:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.button:disabled { border-color: var(--line); color: var(--faint); cursor: default; }

/* ---------- 项目列表 ---------- */

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: clamp(36px, 6vw, 104px); align-items: start; }
.project-head, .project-row { display: grid; grid-template-columns: 60px minmax(0, 1fr) 84px minmax(0, 168px) minmax(0, 126px); gap: 6px 24px; }
.project-head { padding-block: 10px; border-bottom: 1px solid var(--ink); color: var(--soft); font-size: 12px; }
.project-row { align-items: start; padding-block: 20px; border-bottom: 1px solid var(--line); font-size: 14px; }
.row-year { color: var(--soft); font-size: 20px; line-height: 1.3; }
.row-title { font-size: var(--step-2); font-weight: 300; line-height: 1.4; }
.row-title:hover, .work-title:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.row-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; margin-top: 6px; color: var(--soft); font-size: 13px; }
.row-meta a { color: var(--ink); }
.row-person, .row-unit, .row-subject { margin-top: 7px; color: var(--soft); }
.project-row .row-year { margin-top: 4px; }
.row-person { color: var(--ink); }
.project-row > a:not(.row-title):hover, .row-meta a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; color: var(--soft); }
.pagination .num { color: var(--ink); font-size: 22px; }
.pagination div { display: flex; gap: 8px; }
.empty { padding-block: clamp(48px, 8vw, 110px); border-top: 1px solid var(--line); color: var(--soft); font-size: var(--step-2); font-weight: 300; line-height: 1.7; }
.empty .text-button { font-size: 15px; }

/* ---------- 目录 ---------- */

.entry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); column-gap: clamp(24px, 3vw, 56px); border-top: 1px solid var(--ink); }
.entry-grid li { border-bottom: 1px solid var(--line); }
.entry { display: block; height: 100%; padding-block: 20px 22px; }
.entry h2 { font-size: var(--step-2); font-weight: 300; line-height: 1.35; }
.entry p { margin-top: 4px; color: var(--soft); font-size: 13px; }
.entry .entry-count { color: var(--ink); }
.entry:hover h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.entry:hover .seal { text-decoration: none; }

/* ---------- 成果 ---------- */

.work-list { border-top: 1px solid var(--ink); }
.work-row { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 6px 24px; align-items: baseline; padding-block: 18px; border-bottom: 1px solid var(--line); }
.work-title { font-size: var(--step-2); font-weight: 300; line-height: 1.4; }
.work-out { align-self: center; color: var(--faint); }
.work-row:hover .work-out { color: var(--ink); }

/* ---------- 详情 ---------- */

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 340px); gap: clamp(36px, 6vw, 104px); align-items: start; }
.detail-layout > div > * + *, .detail-layout > aside > * + * { margin-top: clamp(44px, 5vw, 76px); }
.block h2 { margin-bottom: 16px; font-size: var(--step-2); font-weight: 300; }
.block .section-head h2 { margin: 0; font-size: var(--step-3); }
.block > p { max-width: 44em; }
.block > p + p { margin-top: 12px; }
.block .work-list + p { margin-top: 16px; }
.block p a, .info-list a, .link-list a { text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 4px; }
.block p a:hover, .info-list a:hover, .link-list a:hover { text-decoration-color: var(--ink); }
.bio { max-width: 38em; font-size: var(--step-2); font-weight: 300; line-height: 1.7; }
.info-list { border-top: 1px solid var(--ink); }
.info-list div { display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: 16px; padding-block: 13px; border-bottom: 1px solid var(--line); }
.info-list dt { color: var(--soft); }
.info-list dd { overflow-wrap: anywhere; }
aside .info-list div { grid-template-columns: 5em minmax(0, 1fr); }
.link-list { border-top: 1px solid var(--ink); }
.link-list li { padding-block: 12px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }

.not-found { padding-block: 12vh; }
.not-found h1 { font-size: var(--step-4); font-weight: 300; }
.not-found p { margin-top: 18px; color: var(--soft); }



/* ---------- 主题与关键词的图表 ---------- */

.viz-head { margin-bottom: clamp(20px, 2.6vw, 36px); }
.viz-head h2 { font-size: var(--step-3); font-weight: 300; line-height: 1.2; }
.viz-head p { margin-top: 8px; max-width: 46em; color: var(--soft); font-size: 14px; }
.first-viz { margin-top: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 14px 0 0; color: var(--soft); font-size: 13px; }
.section-head + .legend { margin: -8px 0 18px; }
.legend i { display: inline-block; width: 18px; height: 3px; margin-right: 8px; border-radius: 2px; background: var(--c); vertical-align: middle; }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: clamp(12px, 1.4vw, 22px); }
.topic-card { position: relative; display: flex; flex-direction: column; padding: clamp(20px, 2vw, 28px); border-radius: 14px; background: color-mix(in srgb, var(--c) 7%, var(--paper)); overflow: hidden; transition: background .35s, transform .5s var(--ease), border-radius .5s var(--ease); }
.topic-card:hover { background: color-mix(in srgb, var(--c) 14%, var(--paper)); transform: translateY(-6px); border-radius: 26px; }
.topic-chip { display: block; width: 34px; height: 6px; margin-bottom: 22px; border-radius: 3px; background: var(--c); transition: width .5s var(--ease); }
.topic-card:hover .topic-chip { width: 72px; }
.topic-card h3 { font-size: var(--step-3); font-weight: 300; line-height: 1.2; }
.topic-sub { margin-top: 4px; color: var(--soft); font-size: 14px; }
.topic-terms { margin: 22px 0 26px; display: grid; gap: 9px; font-size: 13px; }
.topic-terms li { display: grid; grid-template-columns: 6.5em 1fr; align-items: center; gap: 10px; }
.topic-terms span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-terms i { height: 4px; width: calc(var(--share) * 100%); border-radius: 2px; background: var(--c); transform-origin: left; }
.topic-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: auto; }
.topic-foot p { display: flex; flex-direction: column; color: var(--soft); font-size: 13px; }
.topic-foot .num { color: var(--ink); font-size: clamp(30px, 2.6vw, 42px); line-height: 1; }
.spark-line { width: 96px; height: 36px; overflow: visible; }
.spark-line path { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.topic-tag { white-space: nowrap; }
.topic-heading .topic-chip { margin: 0; }
.tags.inline { margin: 0; gap: 6px; }
.tags.inline .tag { padding: 2px 11px; text-decoration: none; }

.chart-scroll { overflow-x: auto; }
.chart { display: block; width: 100%; min-width: 680px; height: auto; font-family: var(--sans); }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .tick { fill: var(--axis); font-size: 12px; }
.chart .year-tick { fill: var(--ink); font: 17px var(--numerals); }
.chart .line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke-width .2s, opacity .25s; }
.chart .dot { fill: var(--c); stroke: var(--paper); stroke-width: 2; transition: opacity .25s; }
.chart .dot.out { fill: var(--paper); stroke: var(--c); stroke-width: 1.5; }
.chart .hit { fill: transparent; }
.chart .leader { fill: none; stroke: var(--grid); stroke-width: 1; }
.chart .key { fill: var(--c); }
.chart .end-label { fill: var(--ink); font-size: 13px; transition: opacity .25s; }
.chart .end-value, .chart .rank-no { fill: var(--axis); }
.chart .series { cursor: pointer; }
.chart:has(.series:hover) .series:not(:hover) :is(.line, .dot, .end-label, .key), .chart.has-focus .series:not(.focus):not(:hover) :is(.line, .dot, .key) { opacity: .16; }
.chart.has-focus .series:not(.focus) { --c: #9a9a96; }
.chart.has-focus .series:not(.focus) .end-label { fill: var(--axis); }
.chart .series:hover .line, .chart .series.focus .line { stroke-width: 3.5; }
.chart .tone-flat .line { stroke-width: 1.5; }

.tfidf-list { column-count: 2; column-gap: clamp(32px, 5vw, 88px); }
.tfidf-list li { break-inside: avoid; }
.tfidf-list a { display: grid; grid-template-columns: 2em 8em 1fr 3em; align-items: center; gap: 12px; padding-block: 8px; }
.tfidf-list .num { color: var(--faint); font-size: 17px; }
.tf-name, .dv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-track { height: 6px; border-radius: 3px; background: var(--wash); }
.tf-track i { display: block; height: 100%; width: calc(var(--share) * 100%); border-radius: 3px; background: var(--series); transform-origin: left; }
.tf-value, .dv-value { color: var(--soft); font: 16px var(--numerals); text-align: right; }
.tfidf-list a:hover .tf-name, .dv-list a:hover .dv-name, .year-columns a:hover span { text-decoration: underline; text-underline-offset: 4px; }

.diverging { display: grid; gap: 4px; max-width: 980px; }
.dv-list a { display: grid; grid-template-columns: 9em 1fr 4em; align-items: center; gap: 12px; padding-block: 7px; }
.dv-track { position: relative; height: 8px; }
.dv-track::before { content: ""; position: absolute; left: 50%; top: -9px; bottom: -9px; width: 1px; background: var(--axis); opacity: .5; }
.dv-track i { position: absolute; top: 0; bottom: 0; width: calc(var(--share) * 50%); }
.pos .dv-track i { left: calc(50% + 1px); border-radius: 0 4px 4px 0; background: #e34948; transform-origin: left; }
.neg .dv-track i { right: calc(50% + 0px); border-radius: 4px 0 0 4px; background: #2a78d6; transform-origin: right; }

.year-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: clamp(24px, 4vw, 64px); }
.year-columns h3 { padding-bottom: 10px; border-bottom: 1px solid var(--ink); font-size: var(--step-4); font-weight: 400; line-height: 1; }
.year-columns a { display: grid; gap: 6px; padding-block: 10px 9px; }
.year-columns i { height: 4px; width: calc(var(--share) * 100%); border-radius: 2px; background: var(--series); transform-origin: left; }

.method { max-width: 52em; color: var(--soft); font-size: 14px; }
.method h2 { margin-bottom: 12px; color: var(--ink); font-size: var(--step-2); font-weight: 300; }
.method p + p { margin-top: 10px; }
.topic-focus { margin-bottom: clamp(44px, 5vw, 76px); }

.tooltip { position: fixed; left: 0; top: 0; z-index: 20; display: grid; gap: 2px; max-width: 280px; padding: 10px 14px; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: 13px; line-height: 1.5; pointer-events: none; box-shadow: 0 8px 28px rgb(0 0 0 / .18); }
.tooltip[hidden] { display: none; }
.tooltip strong { font-weight: 600; }
.tooltip span { color: #cfcfcf; }

@media (prefers-reduced-motion: no-preference) {
  /* 图表进入视野时：折线画出来，点逐个冒出，条形从基线长出来 */
  .viz.reveal .chart .line, .viz.reveal .spark-line path { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .viz.reveal.in .chart .line { stroke-dashoffset: 0; transition: stroke-dashoffset 1.5s cubic-bezier(.45, 0, .2, 1) calc(var(--d, 0) * 70ms + .15s), stroke-width .2s, opacity .25s; }
  .viz.reveal.in .spark-line path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s cubic-bezier(.45, 0, .2, 1) calc(var(--n, 0) * 90ms + .5s); }
  .viz.reveal .chart .dot { transform-box: fill-box; transform-origin: center; transform: scale(0); }
  .viz.reveal.in .chart .dot { transform: none; transition: transform .5s cubic-bezier(.3, 1.6, .5, 1) calc(var(--d, 0) * 70ms + var(--p, 0) * 300ms + .25s), opacity .25s; }
  .viz.reveal .chart :is(.end-label, .key, .leader) { opacity: 0; }
  .viz.reveal.in .chart :is(.end-label, .key, .leader) { opacity: 1; transition: opacity .6s calc(var(--d, 0) * 70ms + 1.1s); }
  .viz.reveal.in .chart:has(.series:hover) .series:not(:hover) :is(.end-label, .key) { opacity: .16; transition-delay: 0s; }
  .viz.reveal .chart .grid { opacity: 0; }
  .viz.reveal.in .chart .grid { opacity: 1; transition: opacity .8s; }

  .viz.reveal :is(.tf-track i, .dv-track i, .year-columns i, .topic-terms i) { transform: scaleX(0); }
  .viz.reveal.in :is(.tf-track i, .dv-track i, .year-columns i, .topic-terms i) { transform: none; transition: transform 1s var(--ease) calc(var(--d, 0) * 45ms + var(--n, 0) * 90ms + .2s); }
  .viz.reveal :is(.tfidf-list li, .dv-list li, .year-columns li) { opacity: 0; }
  .viz.reveal.in :is(.tfidf-list li, .dv-list li, .year-columns li) { opacity: 1; transition: opacity .6s calc(var(--d, 0) * 45ms + var(--n, 0) * 90ms); }
  .viz.reveal .topic-card { opacity: 0; transform: translateY(26px); }
  .viz.reveal.in .topic-card { opacity: 1; transform: none; transition: opacity .8s var(--ease) calc(var(--n, 0) * 80ms), transform .8s var(--ease) calc(var(--n, 0) * 80ms), background .35s, border-radius .5s var(--ease); }
  .viz.reveal.in .topic-card:hover { transform: translateY(-6px); transition-delay: 0s; }
}
@media (max-width: 720px) {
  .tfidf-list { column-count: 1; }
  .tfidf-list a { grid-template-columns: 1.6em 6.5em 1fr 2.6em; }
  .dv-list a { grid-template-columns: 6.5em 1fr 3.4em; }
}

/* ---------- 动效 ---------- */


/* 标题带：最新年度的项目名横向流过，悬停时停下 */
.ticker { margin-top: clamp(40px, 6vw, 96px); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { display: flex; width: max-content; animation: drift var(--duration, 120s) linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker-run { display: flex; align-items: center; }
.ticker-run a { display: flex; align-items: center; white-space: nowrap; font-size: var(--step-4); font-weight: 300; line-height: 1.4; color: var(--faint); transition: color .25s; }
.ticker-run a::after { content: ""; width: .22em; height: .22em; margin-inline: .7em; border-radius: 50%; background: var(--ink); }
.ticker-run a:hover { color: var(--ink); }
@keyframes drift { to { transform: translateX(-50%); } }

/* 列表悬停：标题右移，行首出现一道墨线 */
.row-title, .work-title, .rank-name, .entry h2 { display: inline-block; transition: transform .35s var(--ease); }
.project-row:hover .row-title, .work-row:hover .work-title, .rank-list a:hover .rank-name, .entry:hover h2 { transform: translateX(10px); }
.project-row, .work-row, .rank-list li, .entry-grid li { position: relative; }
.project-row::after, .work-row::after, .rank-list li::after, .entry-grid li::after { content: ""; position: absolute; inset: auto 0 -1px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); pointer-events: none; }
.project-row:hover::after, .work-row:hover::after, .rank-list li:hover::after, .entry-grid li:hover::after { transform: scaleX(1); }
.rank-list a .num { transition: color .25s; }
.rank-list a:hover .num { color: var(--ink); }
.work-out { transition: transform .35s var(--ease), color .2s; }
.work-row:hover .work-out { transform: translate(3px, -3px); }

.tile { transition: background .35s, color .35s, transform .5s var(--ease), border-radius .5s var(--ease); }
.tile:hover { transform: translateY(-6px); border-radius: 26px; }
.tile:hover .spark i { animation: grow-y .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.spark i { transform-origin: bottom; }
.spark i:nth-child(2) { --i: 1; } .spark i:nth-child(3) { --i: 2; } .spark i:nth-child(4) { --i: 3; }
.spark i:nth-child(5) { --i: 4; } .spark i:nth-child(6) { --i: 5; }
.tag { transition: border-color .2s, background .25s, color .25s, transform .35s var(--ease); }
.tag:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); transform: translateY(-2px); }
.button, .text-button { transition: background .2s, color .2s, text-decoration-color .2s; }

@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes draw-x { from { transform: scaleX(0); } }
@keyframes grow-y { from { transform: scaleY(0); } }

@media (prefers-reduced-motion: no-preference) {
  /* 进入页面：标题逐块升起，搜索线从左画到右 */
  .page.enter > .hero > *, .page.enter > .page-heading > *, .page.enter > .detail-heading > *, .page.enter > .breadcrumbs, .page.enter > .not-found > * { animation: rise .9s var(--ease) both; }
  .page.enter > .hero > :nth-child(3), .page.enter > .page-heading > :nth-child(2), .page.enter > .detail-heading > :nth-child(2) { animation-delay: .1s; }
  .page.enter > .hero > :nth-child(4), .page.enter > .page-heading > :nth-child(3), .page.enter > .detail-heading > :nth-child(3) { animation-delay: .2s; }
  .page.enter > .detail-heading > :nth-child(4) { animation-delay: .3s; }
  .page.enter > .workspace, .page.enter > .detail-layout, .page.enter > .tile-grid { animation: rise .9s var(--ease) .25s both; }

  /* 滚动到视野内再出现 */
  .reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
  .reveal.in { opacity: 1; transform: none; }
  .facet.reveal, .block.reveal, .catalog.reveal, .directory.reveal { transform: none; }
  .band.reveal .tile, .band.reveal .rank-list li, .band.reveal .work-row { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease), background .35s, color .35s, border-radius .5s var(--ease); transition-delay: calc(var(--n, 0) * 70ms); }
  .band.reveal.in .tile, .band.reveal.in .rank-list li, .band.reveal.in .work-row { opacity: 1; transform: none; }
  .band.reveal.in .tile:hover { transform: translateY(-6px); transition-delay: 0s; }
  :is(.tile, .rank-list li, .work-row):nth-child(2) { --n: 1; } :is(.tile, .rank-list li, .work-row):nth-child(3) { --n: 2; }
  :is(.tile, .rank-list li, .work-row):nth-child(4) { --n: 3; } :is(.tile, .rank-list li, .work-row):nth-child(5) { --n: 4; }
  :is(.tile, .rank-list li, .work-row):nth-child(6) { --n: 5; } :is(.tile, .rank-list li, .work-row):nth-child(7) { --n: 6; }
  :is(.tile, .rank-list li, .work-row):nth-child(8) { --n: 7; } :is(.tile, .rank-list li, .work-row):nth-child(n+9) { --n: 8; }

  /* 图表：柱子和进度线在出现时长出来 */
  .year-bar { transform-origin: bottom; }
  .bar-track span { transform-origin: left; }
  .facet.reveal .year-bar { transform: scaleY(0); transition: transform 1.1s var(--ease), opacity .15s; transition-delay: calc(var(--y, 0) * 90ms + .1s), 0s; }
  .facet.reveal .bar-track span { transform: scaleX(0); transition: transform 1.2s var(--ease); transition-delay: calc(var(--y, 0) * 80ms + .1s); }
  .facet.reveal .year-count { opacity: 0; transition: opacity .6s .7s; }
  .facet.reveal.in .year-bar, .facet.reveal.in .bar-track span { transform: none; }
  .facet.reveal.in .year-count { opacity: 1; }
  .years a:nth-child(2), .bar-rows li:nth-child(2) { --y: 1; } .years a:nth-child(3), .bar-rows li:nth-child(3) { --y: 2; }
  .years a:nth-child(4), .bar-rows li:nth-child(4) { --y: 3; } .years a:nth-child(5), .bar-rows li:nth-child(5) { --y: 4; }
  .years a:nth-child(6), .bar-rows li:nth-child(6) { --y: 5; } .years a:nth-child(n+7), .bar-rows li:nth-child(n+7) { --y: 6; }

  /* 筛选后结果轻轻换一下 */
  [data-results].refreshed { animation: fade .45s ease both; }
}

/* ---------- 窄屏 ---------- */

@media (max-width: 1080px) {
  .workspace, .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .facet-stack { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
  .project-head { display: none; }
  .project-list { border-top: 1px solid var(--ink); }
  .project-row { grid-template-columns: 60px minmax(0, 1fr); }
  .project-row > a:not(.row-title) { grid-column: 2; }
  .project-row .row-person, .project-row .row-unit, .project-row .row-subject { margin-top: 0; }
}
@media (max-width: 720px) {
  .rank-list { column-count: 1; }
  .project-row, .work-row { grid-template-columns: 46px minmax(0, 1fr); gap: 4px 12px; }
  .work-out { display: none; }
  .row-year { font-size: 17px; }
  .filters .select, .filters .select select { flex: 1; width: 100%; max-width: none; }
  .info-list div { grid-template-columns: 5.5em minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .ticker { overflow-x: auto; }
}
@media print {
  .site-header, .site-footer, .filters, .pagination, .hero-search button { display: none; }
}
@media (max-width: 720px) {
  .filters .search { flex-basis: 100%; }
}

/* ================= 第二版：分层页眉、全屏首页、杂志网格、时间线、瀑布流 ================= */

body { overflow-x: clip; }
.footer-inner, .page { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }
.page { padding-top: 168px; }
.page.is-home { padding-top: 0; }

/* ---------- 页眉：上层是站名和快捷入口，下层是带数字的导航胶囊 ---------- */
.site-header { position: fixed; inset: 0 0 auto; z-index: 10; display: grid; gap: 10px; padding: 14px var(--gutter) 12px; color: var(--ink); transition: background .35s, color .35s, padding .35s var(--ease), box-shadow .35s; }
.site-header:not(.over-hero) { background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(14px); }
.site-header.scrolled:not(.over-hero) { box-shadow: 0 1px 0 var(--line); }
.site-header.over-hero { color: #fff; }
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; max-width: calc(var(--wide) - 2 * var(--gutter)); margin-inline: auto; overflow: hidden; max-height: 60px; transition: max-height .4s var(--ease), opacity .3s; }
.site-header.scrolled .header-top { max-height: 0; opacity: 0; }
.site-header.scrolled { gap: 0; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid currentColor; border-radius: 50%; font-size: 18px; font-weight: 300; transition: background .3s, color .3s; }
.brand:hover .brand-mark { background: var(--seal); border-color: var(--seal); color: #fff; }
.brand-text { display: grid; font-size: 17px; font-weight: 600; letter-spacing: .04em; line-height: 1.25; }
.brand-text small { font-size: 12px; font-weight: 400; letter-spacing: 0; opacity: .65; }
.brand-text small span { font-family: var(--numerals); font-size: 14px; }
.header-tools { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.tool { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; opacity: .75; transition: opacity .2s, background .2s; }
.tool:hover { opacity: 1; background: color-mix(in srgb, currentColor 10%, transparent); }
.funder-tools { display: contents; }
.tool small { font: 14px var(--numerals); opacity: .7; }
.search-tool { border: 1px solid color-mix(in srgb, currentColor 45%, transparent); opacity: 1; }

.primary-nav { justify-self: center; display: flex; gap: 4px; max-width: 100%; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--paper) 80%, transparent); overflow-x: auto; scrollbar-width: none; transition: background .35s, border-color .35s, box-shadow .35s; }
.site-header.scrolled:not(.over-hero) .primary-nav { box-shadow: 0 6px 24px rgb(0 0 0 / .06); }
.over-hero .primary-nav { border-color: rgb(255 255 255 / .28); background: rgb(20 14 8 / .32); backdrop-filter: blur(14px); }
.primary-nav a { display: flex; align-items: baseline; gap: 7px; padding: 8px 18px; border-radius: 999px; white-space: nowrap; font-size: 15px; transition: background .25s, color .25s; }
.primary-nav a[hidden] { display: none; }
.primary-nav small { font: 14px var(--numerals); opacity: .55; }
.primary-nav a:hover { background: color-mix(in srgb, currentColor 9%, transparent); }
.primary-nav a[aria-current] { background: var(--ink); color: var(--paper); }
.over-hero .primary-nav a[aria-current] { background: #fff; color: #000; }
.primary-nav a[aria-current] small { opacity: .7; }

/* ---------- 全屏首页 ---------- */
.hero-full { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; width: 100vw; min-height: 100vh; min-height: 100svh; margin-left: calc((100vw - 100%) / -2); padding: 190px var(--gutter) 0; color: #fff; isolation: isolate;
  background-color: #1d140c;
  background-image: linear-gradient(180deg, rgb(12 8 4 / .62) 0%, rgb(12 8 4 / .38) 38%, rgb(12 8 4 / .86) 100%), url("./img/hero.jpg"), url("https://images.unsplash.com/photo-1530608031805-8e170c1b793a?auto=format&fit=crop&w=2400&q=70"), radial-gradient(120% 90% at 50% 0%, #6b4a2a 0%, #2a1c10 55%, #120c07 100%);
  background-size: cover; background-position: center 42%; }
.hero-inner { align-self: center; width: 100%; max-width: 1080px; margin-inline: auto; padding-bottom: clamp(32px, 6vh, 80px); text-align: center; }
.hero-kicker { display: inline-flex; align-items: baseline; gap: 12px; padding: 6px 18px; border: 1px solid rgb(255 255 255 / .35); border-radius: 999px; font-size: 14px; letter-spacing: .12em; }
.hero-kicker .num { font-size: 18px; letter-spacing: .02em; }
.hero-full h1 { margin: clamp(18px, 3vh, 34px) 0 clamp(24px, 4vh, 44px); font-size: clamp(40px, 8.4vw, 132px); font-weight: 300; line-height: 1.08; letter-spacing: .04em; text-shadow: 0 2px 40px rgb(0 0 0 / .45); }
.hero-search { display: flex; align-items: center; gap: 8px; max-width: 760px; margin-inline: auto; padding: 8px 8px 8px 28px; border: 1px solid rgb(255 255 255 / .4); border-radius: 999px; background: rgb(255 255 255 / .12); backdrop-filter: blur(18px); transition: background .3s, border-color .3s, box-shadow .3s; }
.hero-search:focus-within { background: rgb(255 255 255 / .2); border-color: #fff; box-shadow: 0 12px 48px rgb(0 0 0 / .35); }
.hero-search label { flex: 1; min-width: 0; }
.hero-search input { width: 100%; padding: 10px 0; border: 0; background: none; outline: none; color: #fff; font-size: clamp(17px, 1.6vw, 22px); font-weight: 300; }
.hero-search input::placeholder { color: rgb(255 255 255 / .72); }
.hero-search button { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 12px 26px; border: 0; border-radius: 999px; background: #fff; color: #000; font-size: 16px; transition: transform .3s var(--ease), background .2s; }
.hero-search button:hover { transform: scale(1.04); }
.hero-search button:hover .icon, .button:hover .icon, .section-head > a:hover::after { transform: translateX(4px); }
.hero-search .icon, .button .icon { transition: transform .35s var(--ease); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.button.solid { border-color: #fff; background: #fff; color: #000; }
.button.solid:hover:not(:disabled) { background: var(--seal); border-color: var(--seal); color: #fff; }
.button.ghost { border-color: rgb(255 255 255 / .5); background: rgb(255 255 255 / .06); color: #fff; backdrop-filter: blur(10px); }
.button.ghost:hover:not(:disabled) { background: #fff; color: #000; }
.hero-full .figures { width: 100%; max-width: calc(var(--wide) - 2 * var(--gutter)); margin-inline: auto; border: 0; border-top: 1px solid rgb(255 255 255 / .3); }
.hero-full .figures a { padding: clamp(16px, 2.6vh, 30px) 0 clamp(20px, 3.4vh, 38px); color: rgb(255 255 255 / .75); }
.hero-full .figures .num { color: #fff; font-size: clamp(34px, 4.4vw, 68px); }
.hero-full .figures a:hover span:last-child { color: #fff; }
.hero-credit { position: absolute; right: var(--gutter); top: 50%; writing-mode: vertical-rl; font-size: 11px; letter-spacing: .14em; color: rgb(255 255 255 / .5); transform: translateY(-50%); }
.hero-credit:hover { color: #fff; }
.is-home .ticker { margin-top: clamp(28px, 4vw, 64px); }

/* ---------- 可点击的按钮 ---------- */
.section-head > a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border: 1px solid var(--ink); border-radius: 999px; color: var(--ink); text-decoration: none; transition: background .2s, color .2s; }
.section-head > a::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); transition: transform .35s var(--ease); }
.section-head > a:hover { background: var(--ink); color: var(--paper); }
.section-head > a:hover::after { transform: translateX(4px) rotate(45deg); }
.section-head .text-button, .filter-summary .text-button { padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.section-head .text-button:hover:not(:disabled), .filter-summary .text-button:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; }
.chip { padding: 6px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font: 17px/1.4 var(--numerals); transition: background .2s, color .2s, border-color .2s, transform .3s var(--ease); }
.chip:first-child { font: 14px/1.7 var(--sans); }
.chip:hover { border-color: var(--ink); transform: translateY(-2px); }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }

/* ---------- 杂志网格 ---------- */
.magazine { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(210px, auto); gap: clamp(12px, 1.4vw, 22px); }
.mag-card { position: relative; display: flex; flex-direction: column; padding: clamp(18px, 1.8vw, 28px); border-radius: 14px; background: color-mix(in srgb, var(--c) 8%, var(--paper)); overflow: hidden; transition: background .35s, color .35s, transform .5s var(--ease), border-radius .5s var(--ease); }
.mag-card:hover { background: var(--c); color: #fff; transform: translateY(-6px); border-radius: 26px; }
.mag-card:hover :is(.topic-sub, .topic-foot p, .topic-foot .num, .lead-list) { color: inherit; }
.mag-card:hover .topic-chip { background: #fff; width: 72px; }
.mag-card:hover .spark-line path { stroke: #fff; }
.mag-card h3 { font-size: var(--step-3); font-weight: 300; line-height: 1.2; }
.mag-card.wide { grid-column: span 2; }
.mag-card.lead { grid-column: span 2; grid-row: span 2; background: color-mix(in srgb, var(--c) 13%, var(--paper)); }
.mag-card.lead h3 { font-size: clamp(48px, 6.4vw, 104px); line-height: 1.05; }
.mag-card.lead .topic-sub { margin-top: 12px; font-size: var(--step-1); }
.lead-list { display: grid; gap: 10px; margin: clamp(20px, 3vw, 44px) 0; max-width: 30em; color: var(--soft); font-size: 15px; }
.lead-list li { padding-left: 16px; border-left: 2px solid var(--c); }
.mag-card:hover .lead-list li { border-color: #fff; }
.spark-line.big { width: min(240px, 46%); height: 80px; }
.spark-line.big path { stroke-width: 2.5; }
.mag-card .topic-foot { padding-top: 18px; }

/* ---------- 垂直时间线 ---------- */
.timeline { position: relative; display: grid; gap: clamp(36px, 5vw, 84px); padding-block: 12px; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-item { position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(48px, 8vw, 140px); }
.tl-node { position: absolute; left: 50%; top: 50%; width: 15px; height: 15px; border: 3px solid var(--paper); border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 1px var(--ink); transform: translate(-50%, -50%); transition: background .3s, transform .4s var(--ease); }
.tl-item:hover .tl-node { background: var(--seal); box-shadow: 0 0 0 1px var(--seal); transform: translate(-50%, -50%) scale(1.5); }
.tl-year { text-align: right; }
.tl-year > .num { display: block; font-size: clamp(64px, 11vw, 190px); line-height: .9; color: var(--ink); }
.tl-year p { margin-top: 10px; color: var(--soft); font-size: 14px; }
.tl-year p .num { margin-right: 6px; color: var(--ink); font-size: 28px; }
.tl-item:nth-child(even) .tl-year { order: 2; text-align: left; }
.tl-card { padding: clamp(20px, 2.2vw, 34px); border-radius: 14px; background: var(--wash); transition: box-shadow .4s, transform .5s var(--ease); }
.tl-item:hover .tl-card { transform: translateY(-4px); box-shadow: 0 18px 50px rgb(0 0 0 / .08); }
.tl-card .tags { margin: 0; }
.tl-card .tag { background: var(--paper); }
.tl-mix { display: flex; gap: 2px; height: 10px; margin: 22px 0; }
.tl-mix a { min-width: 4px; border-radius: 3px; background: var(--c); transition: transform .3s var(--ease); }
.tl-mix a:hover { transform: scaleY(1.9); }
.tl-projects { display: grid; gap: 14px; margin-bottom: 22px; }
.tl-projects a { display: block; font-size: var(--step-2); font-weight: 300; line-height: 1.4; }
.tl-projects a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.tl-projects span { color: var(--soft); font-size: 13px; }

/* ---------- 瀑布流 ---------- */
.masonry { columns: 4 250px; column-gap: clamp(12px, 1.4vw, 22px); }
.m-card { display: grid; gap: 14px; margin-bottom: clamp(12px, 1.4vw, 22px); padding: clamp(18px, 1.8vw, 26px); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 4px 4px 14px 14px; break-inside: avoid; background: var(--paper); transition: transform .5s var(--ease), box-shadow .4s, border-color .3s; }
.m-card:hover { transform: translateY(-6px); border-color: var(--c); box-shadow: 0 18px 44px rgb(0 0 0 / .1); }
.m-card h3 { font-size: var(--step-2); font-weight: 300; line-height: 1.42; }
.m-card:nth-child(5n + 1) h3 { font-size: var(--step-3); line-height: 1.3; }
.m-card:nth-child(4n + 3) { background: color-mix(in srgb, var(--c) 7%, var(--paper)); border-color: transparent; border-top-color: var(--c); }
.m-topic { color: var(--soft); font-size: 13px; }
.m-card p { display: grid; font-size: 14px; }
.m-card p strong { font-weight: 600; }
.m-card p span { color: var(--soft); font-size: 13px; }
.m-terms { display: flex; flex-wrap: wrap; gap: 6px; }
.m-terms span { padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c) 12%, var(--paper)); font-size: 12px; }

@media (prefers-reduced-motion: no-preference) {
  .page.enter > .hero-full .hero-inner > * { animation: rise 1s var(--ease) both; }
  .page.enter > .hero-full .hero-inner > :nth-child(2) { animation-delay: .12s; }
  .page.enter > .hero-full .hero-inner > :nth-child(3) { animation-delay: .26s; }
  .page.enter > .hero-full .hero-inner > :nth-child(4) { animation-delay: .38s; }
  .hero-full .figures.reveal { transform: none; }
  .viz.reveal .mag-card, .viz.reveal .m-card { opacity: 0; transform: translateY(28px); }
  .viz.reveal.in .mag-card, .viz.reveal.in .m-card { opacity: 1; transform: none; transition: opacity .8s var(--ease) calc(var(--n, 0) * 70ms), transform .8s var(--ease) calc(var(--n, 0) * 70ms), background .35s, color .35s, border-radius .5s var(--ease), box-shadow .4s, border-color .3s; }
  .viz.reveal.in :is(.mag-card, .m-card):hover { transform: translateY(-6px); transition-delay: 0s; }
  .tl-item.reveal { opacity: 1; transform: none; }
  .tl-item.reveal .tl-year { opacity: 0; transform: translateX(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
  .tl-item.reveal:nth-child(even) .tl-year { transform: translateX(-40px); }
  .tl-item.reveal .tl-card { opacity: 0; transform: translateX(-40px); transition: opacity .9s var(--ease) .12s, transform .9s var(--ease) .12s, box-shadow .4s; }
  .tl-item.reveal:nth-child(even) .tl-card { transform: translateX(40px); }
  .tl-item.reveal .tl-node { transform: translate(-50%, -50%) scale(0); }
  .tl-item.reveal.in :is(.tl-year, .tl-card) { opacity: 1; transform: none; }
  .tl-item.reveal.in .tl-node { transform: translate(-50%, -50%); transition: transform .6s cubic-bezier(.3, 1.6, .5, 1) .2s, background .3s; }
  .tl-item.reveal .tl-mix a { transform: scaleX(0); transform-origin: left; }
  .tl-item.reveal.in .tl-mix a { transform: none; transition: transform .9s var(--ease) .5s; }
}

@media (max-width: 1080px) {
  .magazine { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .page { padding-top: 132px; }
  .header-tools .tool:not(.search-tool) { display: none; }
  .primary-nav { justify-self: stretch; }
  .primary-nav a { padding: 7px 14px; }
  .hero-full { padding-top: 150px; }
  .hero-full h1 { letter-spacing: 0; }
  .hero-kicker { font-size: 12px; letter-spacing: .06em; }
  .hero-full .figures { grid-template-columns: repeat(2, 1fr); }
  .hero-search { padding-left: 18px; }
  .hero-search button { padding: 10px 16px; }
  .hero-credit { display: none; }
  .magazine { grid-template-columns: minmax(0, 1fr); }
  .mag-card.wide, .mag-card.lead { grid-column: auto; }
  .timeline::before, .tl-node { left: 7px; }
  .tl-item { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-left: 30px; }
  .tl-year, .tl-item:nth-child(even) .tl-year { order: 0; text-align: left; }
  .tl-node { top: 28px; }
}

/* ---------- 基金来源：固定的徽标和颜色 ---------- */
.funder-badge { display: inline-block; padding: 1px 9px; border-radius: 4px; background: var(--f); color: #fff; font-size: 12px; line-height: 1.6; letter-spacing: .06em; white-space: nowrap; text-decoration: none !important; }
a.funder-badge:hover { opacity: .8; }
.row-meta .funder-badge { color: #fff; }
.kind .funder-badge, .m-topic .funder-badge { margin-right: 8px; }
.tl-projects span.funder-badge { margin-right: 8px; color: #fff; font-size: 12px; }
.funder-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--f); }
.over-hero .funder-dot { box-shadow: 0 0 0 1.5px #fff; }
.funder-chips { margin-top: 22px; }
.funder-chips .chip { display: inline-flex; align-items: center; gap: 8px; font: 14px/1.7 var(--sans); }
.funder-chips .chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--f); }
.funder-chips .chip small { font: 15px var(--numerals); opacity: .6; }
.funder-chips .chip[aria-pressed="true"] { border-color: var(--f, var(--ink)); background: var(--f, var(--ink)); }
.funder-chips .chip[aria-pressed="true"] i { background: #fff; }
.chips + .chips { margin-top: 10px; }
.year-bar.stacked { display: flex; flex-direction: column-reverse; gap: 2px; background: none; border-radius: 0; }
.year-bar.stacked i { min-height: 2px; border-radius: 2px; background: var(--f); }
.funder-legend { margin-top: 14px; }
.tl-funders { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 16px; }
.tl-funders a { display: inline-flex; align-items: center; gap: 7px; font: 17px var(--numerals); color: var(--ink); }
.tl-item:nth-child(even) .tl-funders { justify-content: flex-start; }
@media (max-width: 720px) { .tl-funders { justify-content: flex-start; } }

.sub-chips { margin-top: 10px; padding-left: 14px; border-left: 2px solid var(--line); }
.sub-chips[hidden] { display: none; }
.sub-chips .chip, .sub-chips .chip:first-child { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px; font: 13px/1.7 var(--sans); }
.sub-chips .chip small { font: 14px var(--numerals); opacity: .6; }
.header-tools { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 1180px) { .header-tools .tool:not(.search-tool) small { display: none; } }

/* 年份多的时候：柱子收窄，年份标签只留两位 */
.years.dense { gap: 3px; }
.years.dense .year-bar { width: 100%; border-radius: 2px 2px 0 0; }
.years.dense .year-label { font-size: 10px; letter-spacing: -.04em; }
.spark { flex: 0 1 46%; max-width: 132px; min-width: 0; justify-content: flex-end; gap: 2px; }
.spark i { flex: 1 1 0; width: auto; min-width: 1px; max-width: 7px; }
