/* ==========================================================================
   Per-Website — 设计语言：整体克制到零装饰，细节全部做足。
   强调色是紫色，中性灰带轻微紫偏，让它看起来是跟强调色一起挑的。
   全站不使用任何圆角：所有边框、图片、按钮一律直角，靠直线和网格取规整感。
   ========================================================================== */

/* --- 1. Tokens ---------------------------------------------------------- */

:root {
  /* 浅色：完整定义一套，深色只覆盖 token */
  --bg:        #fcfbfd;
  --surface:   #ffffff;
  --surface-2: #f3f1f7;
  --ink:       #1a1720;
  --ink-2:     #413b4d;
  --muted:     #6b6478;
  --rule:      #e5e2ec;
  --rule-2:    #cbc6d8;
  --accent:    #6a3da8;   /* 对比度 7.2:1 */
  --accent-2:  #552e8a;
  --accent-wash: #f0eafa;
  --shadow: 0 1px 2px rgb(26 23 32 / 4%), 0 8px 24px -16px rgb(26 23 32 / 20%);

  /* 排版：两款无衬线。标题用紧、有性格的 grotesque，正文用开、易读的。 */
  --display: "Schibsted Grotesk", "PingFang SC", "Microsoft YaHei",
             system-ui, -apple-system, sans-serif;
  --sans:    "Figtree", "PingFang SC", "Microsoft YaHei",
             system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* 度量 */
  --measure: 46rem;   /* 正文栏宽，约 65 字符 */
  --wide:    62rem;   /* 网格类内容 */
  --nav-h:   3.75rem;

  /* 动效：全站只有两档时长和一条缓动曲线。
     hover 一律用「线和边」表达——不用阴影、不用位移、不用缩放。 */
  --t:    140ms;                          /* 颜色一类的即时反馈 */
  --t2:   240ms;                          /* 线条擦入这类有行程的 */
  --ease: cubic-bezier(.2, .7, .3, 1);    /* 起步快、收尾稳 */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0f0d14;
    --surface:   #17141e;
    --surface-2: #1f1b29;
    --ink:       #eae7f0;
    --ink-2:     #c7c2d4;
    --muted:     #948da6;
    --rule:      #2a2536;
    --rule-2:    #3d3650;
    --accent:    #b79bf0;   /* 对比度 8.2:1 */
    --accent-2:  #cdb8f8;
    --accent-wash: #251d3b;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px -16px rgb(0 0 0 / 70%);
  }
}

:root[data-theme="dark"] {
  --bg:        #0f0d14;
  --surface:   #17141e;
  --surface-2: #1f1b29;
  --ink:       #eae7f0;
  --ink-2:     #c7c2d4;
  --muted:     #948da6;
  --rule:      #2a2536;
  --rule-2:    #3d3650;
  --accent:    #b79bf0;
  --accent-2:  #cdb8f8;
  --accent-wash: #251d3b;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px -16px rgb(0 0 0 / 70%);
}

/* --- 2. Reset ----------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

/* --- 3. 排版 ------------------------------------------------------------ */

/* 无衬线标题靠“紧 + 重”跟正文拉开距离，而不是靠换字族的味道 */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -.018em;
  text-wrap: balance;
  margin: 0;
}

h1 { font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.6rem); font-weight: 700; letter-spacing: -.028em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; font-family: var(--sans); font-weight: 600; letter-spacing: -.006em; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

/* 正文链接：用 text-decoration 而不是 border-bottom。
   下划线本身不参与布局，所以颜色和 offset 都能平滑过渡而不会推动文字；
   hover 时下划线加深、并往下让出一点距离，是排版书里的做法，不是发光。 */
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
  text-underline-offset: .16em;
  transition: color var(--t) var(--ease),
              text-decoration-color var(--t) var(--ease),
              text-underline-offset var(--t2) var(--ease);
}
a:hover {
  color: var(--accent-2);
  text-decoration-color: currentColor;
  text-underline-offset: .24em;
}
/* 导航和按钮完全不要下划线 */
.nav__brand, .nav__links a, .socials a, a.pill,
.profile__role a, .section__more { text-decoration: none; }

/* 标题类链接：静止时下划线透明，hover 才淡入。
   因为线一直占着位，淡入淡出不会让标题跳动。 */
.pub__title a, .card__title a, .pwide__title a, .post-item__title a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: transparent;
  text-underline-offset: .18em;
  transition: color var(--t) var(--ease), text-decoration-color var(--t) var(--ease);
}
.pub__title a:hover, .card__title a:hover,
.pwide__title a:hover, .post-item__title a:hover {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

strong { font-weight: 600; color: var(--ink); }
code, kbd { font-family: var(--mono); font-size: .875em; }

/* 小号全大写标签 —— 全站统一的“元信息”声音 */
.label {
  font-family: var(--mono);
  font-size: .688rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* --- 4. 骨架 ------------------------------------------------------------ */

.skip {
  position: absolute; left: .5rem; top: -3rem; z-index: 100;
  background: var(--surface); color: var(--ink);
  padding: .5rem .875rem; border: 1px solid var(--rule-2);
  transition: top .15s ease;
}
.skip:focus { top: .5rem; }

.wrap { width: 100%; max-width: var(--measure); margin-inline: auto; padding-inline: 1.5rem; }
.wrap--wide { max-width: var(--wide); }

main { padding-block: 3.5rem 5rem; }

/* --- 5. 顶栏 ------------------------------------------------------------ */

.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav__inner {
  height: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: 1.5rem;
  display: flex; align-items: center; gap: 1.25rem;
}
.nav__brand {
  font-family: var(--display); font-size: 1.0625rem; font-weight: 600;
  color: var(--ink); letter-spacing: -.018em; white-space: nowrap;
  transition: color var(--t) var(--ease);
}
.nav__brand:hover { color: var(--accent); }

.nav__links { display: flex; align-items: center; gap: 1.125rem; margin-left: auto; }
.nav__links a {
  color: var(--muted); font-size: .9375rem;
  position: relative; padding-block: .25rem;
  transition: color var(--t) var(--ease);
}
.nav__links a:hover { color: var(--ink); }

/* 当前页和 hover 用同一条下划线，区别只在它是否已经擦到位。
   scaleX 只跑在合成层上，所以擦入是真正平滑的。 */
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.0625rem;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t2) var(--ease);
}
.nav__links a:hover::after,
.nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.nav__links a[aria-current="page"] { color: var(--ink); font-weight: 500; }

.theme-toggle {
  display: grid; place-items: center;
  width: 2rem; height: 2rem; padding: 0; margin-left: .25rem;
  background: none; border: 1px solid transparent;
  color: var(--muted); cursor: pointer;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--rule-2); }
.theme-toggle svg { width: 1.0625rem; height: 1.0625rem; }
/* 三态图标：由 data-state 决定显示哪一个 */
.theme-toggle [data-icon] { display: none; }
.theme-toggle[data-state="system"] [data-icon="system"],
.theme-toggle[data-state="light"]  [data-icon="light"],
.theme-toggle[data-state="dark"]   [data-icon="dark"] { display: block; }

.nav__menu { display: none; }

@media (max-width: 40rem) {
  .nav__links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--rule);
    padding: .5rem 1.5rem 1rem;
    box-shadow: var(--shadow);
  }
  .nav__links[hidden] { display: none; }
  .nav__links a { padding-block: .5rem; font-size: 1rem; }
  .nav__links a[aria-current="page"]::after { display: none; }
  .nav__links a[aria-current="page"] { color: var(--accent); }
  .nav__menu {
    display: grid; place-items: center; margin-left: auto;
    width: 2rem; height: 2rem; padding: 0;
    background: none; border: 1px solid transparent;
    color: var(--muted); cursor: pointer;
  }
  .nav__menu:hover { color: var(--ink); border-color: var(--rule-2); }
  .nav__menu svg { width: 1.125rem; height: 1.125rem; }
  .theme-toggle { margin-left: 0; }
}

/* --- 6. 页头 ------------------------------------------------------------ */

.page-head { margin-bottom: 2.75rem; }
.page-head .label { display: block; margin-bottom: .625rem; }
.page-head p { color: var(--ink-2); font-size: 1.0625rem; margin-top: .75rem; max-width: 42rem; }

/* --- 7. 首页 profile ---------------------------------------------------- */

.profile { display: grid; gap: 2rem; margin-bottom: 3.5rem; }
@media (min-width: 44rem) {
  .profile { grid-template-columns: 1fr 13.5rem; align-items: start; gap: 2.75rem; }
  .profile__aside { order: 2; position: sticky; top: calc(var(--nav-h) + 2rem); }
  .profile__main  { order: 1; }
}
/* 窄屏：头像缩到约三分之一宽、靠左上，联系方式排在它右边。
   全宽头像会吃掉一整屏，人还没看到名字就得先滚动。 */
@media (max-width: 44rem) {
  .profile { gap: 1.5rem; margin-bottom: 2.5rem; }
  .profile__aside {
    display: grid; grid-template-columns: minmax(0, 33%) 1fr;
    gap: 1rem; align-items: start;
  }
  .profile__photo { max-width: 8.5rem; }
  .profile__contact { margin-top: .125rem; }
}

/* 竖版 3:4 —— 人像比正方形更适合作头像 */
.profile__photo {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border: 1px solid var(--rule);
  background: var(--surface-2);
}
/* 还没放照片时，用姓名首字母顶上，别留一块空洞 */
.profile__photo--empty {
  display: grid; place-items: center;
  font-family: var(--display); font-size: 3rem; font-weight: 600;
  color: var(--rule-2); letter-spacing: .02em;
}

.profile__contact { margin-top: 1.125rem; display: flex; flex-direction: column; gap: .4rem; }
.profile__contact div { font-size: .875rem; color: var(--muted); display: flex; gap: .5rem; }
.profile__contact span:first-child { color: var(--rule-2); flex: none; }

.profile__name { margin-bottom: .375rem; }
/* 代词：跟在姓名后的小字，不抢主标题的重量 */
.pronouns {
  font-family: var(--mono); font-size: .75rem; font-weight: 500;
  letter-spacing: .04em; color: var(--muted);
  margin-left: .625rem; vertical-align: .42em; white-space: nowrap;
}
.profile__role { color: var(--muted); font-size: .9375rem; margin-bottom: 1.375rem; }
.profile__role a { color: var(--muted); }
.profile__role a:hover { color: var(--accent); }
.profile__bio { color: var(--ink-2); font-size: .9688rem; line-height: 1.68; }
.profile__bio p { margin-bottom: .875em; }

/* 学术社交图标：一排直角方块。hover 时底色从下往上灌满，
   用 background-size 走行程，不用伪元素——省掉一层堆叠上下文。 */
.socials { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: 1.5rem; }
.socials a {
  display: grid; place-items: center; width: 2.125rem; height: 2.125rem;
  border: 1px solid var(--rule); color: var(--muted);
  background-image: linear-gradient(var(--accent-wash), var(--accent-wash));
  background-repeat: no-repeat; background-position: 0 100%; background-size: 100% 0;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease),
              background-size var(--t2) var(--ease);
}
.socials a:hover { color: var(--accent); border-color: var(--accent); background-size: 100% 100%; }
.socials svg { width: 1.0625rem; height: 1.0625rem; }

/* --- 8. 通用区块 -------------------------------------------------------- */

.section { margin-top: 3.25rem; }
.section__head {
  display: flex; align-items: baseline; gap: .875rem;
  padding-bottom: .625rem; margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}
.section__head h2 { font-size: 1.25rem; }
.section__more { margin-left: auto; font-size: .875rem; }

/* Research Interests：单独一段说明文字，比 bio 稍宽松一点，
   栏宽卡在 62 字符左右，长段落才不会读得费劲。 */
.ri { font-size: 1rem; line-height: 1.72; color: var(--ink-2); max-width: 36rem; }

/* --- 9. News（日期左栏 + 内容右栏） ------------------------------------- */

.news { display: flex; flex-direction: column; }
.news__item {
  display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem;
  padding-block: .6875rem;
  border-bottom: 1px dashed var(--rule);
  font-size: .9375rem;
}
.news__item:last-child { border-bottom: none; }
.news__date {
  font-family: var(--mono); font-size: .75rem; color: var(--muted);
  font-variant-numeric: tabular-nums; padding-top: .2rem; white-space: nowrap;
}
.news__body { color: var(--ink-2); }
@media (max-width: 30rem) {
  .news__item { grid-template-columns: 1fr; gap: .125rem; }
}

/* --- 10. 论文条目 —— 全站最讲究的一块 ---------------------------------- */

.year-head {
  display: flex; align-items: center; gap: 1rem;
  margin: 2.5rem 0 1.125rem;
}
.year-head:first-child { margin-top: 0; }
.year-head span {
  font-family: var(--display); font-size: 1.5rem; font-weight: 600;
  color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.022em;
}
.year-head::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* 缩略图比首屏的作品图小一档，但要大到能认出图里是什么 */
.pub {
  display: grid; grid-template-columns: 11.5rem 1fr; gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.pub:last-child { border-bottom: none; }
@media (max-width: 38rem) {
  .pub { grid-template-columns: 1fr; gap: 1rem; }
  .pub__thumb { max-width: 16rem; }
}

.pub__thumb {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border: 1px solid var(--rule); background: var(--surface-2);
  transition: border-color var(--t) var(--ease);
}
/* 鼠标落在条目任意位置，缩略图边框就跟着响应——整条是一个整体 */
.pub:hover .pub__thumb { border-color: color-mix(in srgb, var(--accent) 40%, var(--rule)); }
/* 没有配图时不留空洞，给一块带首字母的占位 */
.pub__thumb--empty {
  display: grid; place-items: center;
  font-family: var(--display); font-size: 2.5rem; font-weight: 600; color: var(--rule-2);
}

.pub__title {
  font-family: var(--sans); font-size: 1.0625rem; font-weight: 600;
  line-height: 1.45; margin: 0 0 .25rem; letter-spacing: -.006em;
}
.pub__title a { color: var(--ink); }

.pub__authors { font-size: .9375rem; font-style: italic; color: var(--ink-2); margin-bottom: .1875rem; }
.pub__authors b { font-style: normal; font-weight: 600; color: var(--ink); }

.pub__venue {
  font-size: .875rem; color: var(--muted); margin-bottom: .625rem;
  font-variant-numeric: tabular-nums;
}
.pub__venue em { font-style: normal; color: var(--ink-2); font-weight: 500; }

/* 荣誉：行内小徽章，不另开栏目 */
.award {
  display: inline-block; margin-left: .4375rem;
  font-family: var(--mono); font-size: .6875rem; font-weight: 500;
  letter-spacing: .03em; vertical-align: .08em;
  color: var(--accent); background: var(--accent-wash);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  padding: .0625rem .375rem;
}

/* 直角小方按钮排。
   .pills 的直接子元素会被 flex 容器块级化，但 <summary> 里的那颗 pill 不会——
   行内盒的垂直 padding/border 不进入行高，两者会差几个像素且基线错位。
   所以 pill 必须自己声明 inline-flex + 固定行高，不依赖所处的上下文。 */
.pills { display: flex; flex-wrap: wrap; gap: .375rem; align-items: flex-start; }
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1.45;
  font-family: var(--mono); font-size: .6875rem; font-weight: 500;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted);
  background-color: var(--surface);
  background-image: linear-gradient(var(--accent-wash), var(--accent-wash));
  background-repeat: no-repeat; background-position: 0 100%; background-size: 100% 0;
  border: 1px solid var(--rule-2);
  padding: .1875rem .625rem; cursor: pointer;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease),
              background-size var(--t2) var(--ease);
}
.pill:hover {
  color: var(--accent); border-color: var(--accent);
  background-size: 100% 100%;
}

/* 就地展开：用原生 <details>，零 JS、键盘可达 */
/* 就地展开：抽屉不放在 <details> 内部，而是作为按钮行的兄弟节点放在行外面。
   放在里面的话，展开时那个 details 会被撑成整行宽，把同排按钮全挤走。
   现在 <details> 只留一个 summary，抽屉的显隐由 :has() 读它的 open 状态。 */
.pub__act { display: flex; flex-direction: column; gap: .625rem; }

/* details → summary → pill 这条链上只要还剩一个行盒，line-height 的 leading
   就会把 pill 往下顶几个像素，跟同排的按钮对不齐。整条链用 flex 杜绝行盒。 */
.tgl { display: flex; }
.tgl > summary { list-style: none; display: flex; }
.tgl > summary::-webkit-details-marker { display: none; }
.tgl[open] > summary .pill { color: var(--accent); border-color: var(--accent); background-size: 100% 100%; }

@supports selector(:has(*)) {
  .pub__act > .drawer { display: none; }
  .pub__act:has(.tgl--abs[open]) > .drawer--abs { display: block; }
  .pub__act:has(.tgl--bib[open]) > .drawer--bib { display: block; }
}
/* 没有 :has() 的老浏览器：干脆藏掉切换钮，抽屉常开，内容不会丢 */
@supports not selector(:has(*)) {
  .pub__act .tgl { display: none; }
}

.drawer {
  padding: .875rem 1rem;
  background: var(--surface-2);
  border-left: 2px solid var(--accent);
  font-size: .9063rem; color: var(--ink-2); line-height: 1.65;
}
.drawer--bib { padding: 0; border-left-color: var(--rule-2); position: relative; }
.drawer--bib pre {
  margin: 0; padding: .875rem 1rem; overflow-x: auto;
  font-family: var(--mono); font-size: .75rem; line-height: 1.6; color: var(--ink-2);
}
.copy-bib {
  position: absolute; top: .5rem; right: .5rem;
  font-family: var(--mono); font-size: .6563rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: var(--surface); border: 1px solid var(--rule-2);
  padding: .125rem .4375rem; cursor: pointer;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.copy-bib:hover { color: var(--accent); border-color: var(--accent); }

/* --- 11. 作品：首页用小卡网格，Projects 页用大图长条 -------------------- */

/* 首页的三格预览 */
.grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 34rem) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 52rem) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

/* hover 用顶边一条 2px 强调线从左擦入，代替「浮起来 + 投影」那套。
   scaleX 只在合成层上跑，不触发重排重绘，卡片本身纹丝不动。 */
.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--rule);
  transition: border-color var(--t) var(--ease);
}
.card::after {
  content: ""; position: absolute; inset: -1px -1px auto -1px; height: 2px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t2) var(--ease);
}
.card:hover { border-color: var(--rule-2); }
.card:hover::after { transform: scaleX(1); }
.card__media {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  background: var(--surface-2); border-bottom: 1px solid var(--rule);
}
.card__media--empty {
  display: grid; place-items: center;
  font-family: var(--display); font-size: 2.25rem; font-weight: 600; color: var(--rule-2);
}
.card__body { padding: 1rem 1.125rem 1.125rem; display: flex; flex-direction: column; gap: .4375rem; flex: 1; }
.card__title { font-size: 1.0313rem; font-weight: 600; line-height: 1.4; }
.card__title a { color: var(--ink); }
.card__desc { font-size: .9063rem; color: var(--muted); line-height: 1.6; flex: 1; }
.card__foot { display: flex; flex-wrap: wrap; gap: .375rem; align-items: center; margin-top: .1875rem; }

/* Projects 页：一条一个，大图在上，一眼看清是什么 */
.plist { display: flex; flex-direction: column; gap: 3.25rem; }

.pwide { display: flex; flex-direction: column; gap: 1.125rem; }
/* 大图底边同样用一条擦入的强调线，跟首页卡片是同一套语言 */
.pwide__frame { position: relative; }
.pwide__frame::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t2) var(--ease);
}
.pwide:hover .pwide__frame::after { transform: scaleX(1); }
.pwide__media {
  width: 100%; aspect-ratio: 2 / 1; object-fit: cover;
  border: 1px solid var(--rule); background: var(--surface-2);
  transition: border-color var(--t) var(--ease);
}
.pwide:hover .pwide__media { border-color: var(--rule-2); }
.pwide__media--empty {
  display: grid; place-items: center;
  font-family: var(--display); font-size: 4.5rem; font-weight: 600;
  color: var(--rule-2); letter-spacing: .02em;
}
.pwide__body { display: flex; flex-direction: column; gap: .625rem; }
.pwide__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem .875rem; }
.pwide__title {
  font-family: var(--display); font-size: 1.5rem; font-weight: 600;
  line-height: 1.25; letter-spacing: -.022em;
}
.pwide__title a { color: var(--ink); }
.pwide__meta {
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums;
}
.pwide__desc { font-size: 1rem; color: var(--ink-2); line-height: 1.65; max-width: 46rem; }
.pwide__foot { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }

.tag {
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .04em;
  color: var(--muted); background: var(--surface-2);
  padding: .125rem .4375rem;
}

/* --- 12. CV ------------------------------------------------------------- */

.cv-block { margin-top: 2.5rem; }
.cv-row {
  display: grid; grid-template-columns: 8.5rem 1fr; gap: 1.25rem;
  padding-block: .875rem;
  border-bottom: 1px solid var(--rule);
}
.cv-row:last-child { border-bottom: none; }
.cv-row__when {
  font-family: var(--mono); font-size: .8125rem; color: var(--muted);
  font-variant-numeric: tabular-nums; padding-top: .1875rem; white-space: nowrap;
}
.cv-row__what strong { display: block; font-size: 1rem; font-weight: 600; }
.cv-row__where { font-size: .9375rem; color: var(--ink-2); }
.cv-row__note { font-size: .9063rem; color: var(--muted); margin-top: .1875rem; }

/* 机构徽标：透明底，不加底板方块。
   多数徽标（RMIT 红、EGL 黄、Aalto 黑底白字）在两种主题下都成立；
   只有深色单色徽标（如深技大的深蓝）需要在深色主题下反相，
   由 data 里的 logo_invert_dark 打上 --flip 标记。 */
.cv-block--logos .cv-row { grid-template-columns: 2.5rem 8.5rem 1fr; gap: 1rem 1.125rem; }
.cv-row__logo {
  width: 2.5rem; height: 2.5rem; margin-top: .0625rem;
  display: grid; place-items: center;
}
.cv-row__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* invert + hue-rotate(180deg) 只翻转明度、保留色相，
   所以深蓝会变成浅蓝而不是变成橙色。 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cv-row__logo--flip img {
    filter: invert(1) hue-rotate(180deg);
  }
}
:root[data-theme="dark"] .cv-row__logo--flip img {
  filter: invert(1) hue-rotate(180deg);
}

@media (max-width: 32rem) {
  .cv-row { grid-template-columns: 1fr; gap: .25rem; }
  /* 窄屏改成徽标在左、文字在右的两列，时间行跨满 */
  .cv-block--logos .cv-row { grid-template-columns: 2.5rem 1fr; gap: .25rem .875rem; }
  .cv-block--logos .cv-row__when { grid-column: 2; }
  .cv-block--logos .cv-row__what { grid-column: 2; }
}

/* --- 13. 文章列表 / 正文 ------------------------------------------------ */

.post-list { display: flex; flex-direction: column; }
.post-item {
  display: grid; grid-template-columns: 6rem 1fr; gap: 1.25rem;
  padding-block: 1rem; border-bottom: 1px solid var(--rule);
}
.post-item:last-child { border-bottom: none; }
.post-item__date {
  font-family: var(--mono); font-size: .75rem; color: var(--muted);
  font-variant-numeric: tabular-nums; padding-top: .3125rem;
}
.post-item__title { font-size: 1.0625rem; font-weight: 600; line-height: 1.45; }
.post-item__title a { color: var(--ink); }
.post-item__excerpt { font-size: .9375rem; color: var(--muted); margin-top: .1875rem; }
@media (max-width: 32rem) {
  .post-item { grid-template-columns: 1fr; gap: .25rem; }
}

.prose { font-size: 1.0625rem; color: var(--ink-2); }
.prose h2 { margin: 2.25rem 0 .875rem; font-size: 1.375rem; color: var(--ink); }
.prose h3 { margin: 1.75rem 0 .625rem; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: .375rem; }
.prose blockquote {
  margin: 1.5rem 0; padding: .25rem 0 .25rem 1.125rem;
  border-left: 2px solid var(--accent); color: var(--muted); font-style: italic;
}
.prose pre {
  background: var(--surface-2); padding: 1rem;
  overflow-x: auto; font-family: var(--mono); font-size: .8438rem; line-height: 1.6;
  margin: 0 0 1.1em;
}
.prose :not(pre) > code {
  background: var(--surface-2); padding: .0938rem .3125rem;
}
.prose img { border: 1px solid var(--rule); margin: 1.5rem 0; }
.prose hr { border: none; border-top: 1px solid var(--rule); margin: 2.25rem 0; }

/* --- 14. 游戏手记 ------------------------------------------------------- */

.plays { display: flex; flex-direction: column; }
.play {
  display: grid; grid-template-columns: 4.5rem 1fr; gap: 1.25rem;
  padding-block: 1.375rem; border-bottom: 1px solid var(--rule);
}
.play:last-child { border-bottom: none; }
.play__cover {
  width: 4.5rem; aspect-ratio: 3 / 4; object-fit: cover;
  border: 1px solid var(--rule); background: var(--surface-2);
}
.play__cover--empty {
  display: grid; place-items: center;
  font-family: var(--display); font-size: 1.5rem; font-weight: 600; color: var(--rule-2);
}
.play__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem .625rem; margin-bottom: .375rem; }
.play__title { font-size: 1.0313rem; font-weight: 600; line-height: 1.4; }
.play__meta {
  font-family: var(--mono); font-size: .6875rem; color: var(--muted);
  letter-spacing: .04em; font-variant-numeric: tabular-nums;
}
.play__take { font-size: .9688rem; color: var(--ink-2); line-height: 1.65; }
/* 一句话“带走的东西”——这条是给专业读者看的 */
.play__lesson {
  margin-top: .625rem; padding-left: .75rem;
  border-left: 2px solid var(--accent);
  font-size: .9063rem; color: var(--muted);
}
.play__lesson b {
  font-family: var(--mono); font-size: .6563rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); font-weight: 500;
  margin-right: .5rem;
}

/* 评分：五个小方块，不用星星 */
.rating { display: inline-flex; gap: 2px; vertical-align: .06em; }
.rating i { width: .375rem; height: .375rem; background: var(--rule-2); }
.rating i.on { background: var(--accent); }

/* --- 15. 页脚 ----------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--rule);
  padding-block: 1.75rem 3rem;
  font-size: .8438rem; color: var(--muted);
}
.foot__inner { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: baseline; }
.foot__updated { margin-left: auto; font-family: var(--mono); font-size: .75rem; font-variant-numeric: tabular-nums; }

/* --- 16. 杂项 ----------------------------------------------------------- */

.empty {
  padding: 2rem 0; color: var(--muted); font-size: .9375rem;
  border-top: 1px dashed var(--rule); border-bottom: 1px dashed var(--rule);
}
.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* --- 17. 作品详情页 ------------------------------------------------------ */

.pback {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .06em;
  text-transform: uppercase; margin-bottom: 1.75rem;
}
.pback a { color: var(--muted); text-decoration: none; }
.pback a:hover { color: var(--accent); }
.pback--end {
  margin: 3.5rem 0 0; padding-top: 1.75rem; border-top: 1px solid var(--rule);
}

.phead { margin-bottom: 2.5rem; }
.phead .label { display: block; margin-bottom: .75rem; }
.phead h1 { margin-bottom: 1rem; max-width: 22ch; }
.phead__lead { font-size: 1.125rem; line-height: 1.66; color: var(--ink-2); max-width: 38rem; }
.phead__foot { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: 1.375rem; }
.phead .pills { margin-top: .75rem; }

.phero { margin-bottom: 3rem; }
.phero img {
  width: 100%; aspect-ratio: 2 / 1; object-fit: cover;
  border: 1px solid var(--rule); background: var(--surface-2);
}

/* 一眼看清的关键信息：大号线性图标 + 小标签 + 值 */
.facts {
  display: grid; gap: 1.75rem 2rem; grid-template-columns: 1fr;
  margin-bottom: 3.5rem; padding-block: 1.875rem;
  border-block: 1px solid var(--rule);
}
@media (min-width: 34rem) { .facts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 52rem) { .facts { grid-template-columns: repeat(4, 1fr); } }
.fact { display: flex; flex-direction: column; }
.fact__icon { color: var(--accent); }
.fact__icon svg { width: 2rem; height: 2rem; }
.fact__label {
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin: .75rem 0 .3125rem;
}
.fact__value { font-size: .9375rem; color: var(--ink-2); line-height: 1.55; }

.psecs { display: flex; flex-direction: column; gap: 3.75rem; }
.psec h2 { font-size: 1.375rem; margin-bottom: .875rem; }
.psec__body { font-size: 1.0313rem; line-height: 1.72; color: var(--ink-2); max-width: 38rem; }
.psec__fig { margin: 1.875rem 0 0; }
.psec__fig img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border: 1px solid var(--rule); background: var(--surface-2);
}
.psec__fig figcaption {
  font-size: .8438rem; color: var(--muted); margin-top: .6875rem; max-width: 34rem;
}

/* 卡片整块图都可点，但对读屏隐藏——标题里已经有同一个链接了 */
.card__media-link { display: block; text-decoration: none; }

/* --- 18. 入场动效 -------------------------------------------------------- */
/* 只在 JS 可用时才隐藏（<head> 里会给 <html> 加 .js），
   否则脚本失效时内容会永远看不见。
   注意这是「入场」不是 hover——hover 仍然只用线和边，不做位移。 */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0; transform: translateY(10px);
    transition: opacity .55s var(--ease), transform .55s var(--ease);
  }
  .js .reveal.is-in { opacity: 1; transform: none; }
}
