/* ==========================================================================
   毛文崢 個人 IP 網站 —— 視覺提案 v2
   匠域數位設計 TAKUMIIKI / 2026.10.22

   v2 的依據（實際量測，非主觀偏好）
   ─────────────────────────────────────────────────────────────────────────
   · 單一字體家族 —— Pentagram 只用 Plain、Stripe 只用 Söhne；
     四個學術網站（al-folio／markdean／deaneckles／andrewheiss）也都是單一無襯線。
     v1 用了襯線＋無襯線＋等寬三套，是雜訊。
   · 顯示級字重 300 ＋ 負字距 —— Stripe h1 為 40px / w300 / ls −0.8px。
   · 字級跨度拉開 —— Stripe 9→48px（5.3 倍）；v1 只有 3.1 倍，所以顯得溫吞。
   · 近乎單色 —— 肖像的飽和度中位數只有 0.04，整張照片本來就是黑白的；
     版面不另外加企業藍，整頁唯一的「顏色」就是那張照片與黑白絲巾。
   · 人像襯底用中灰 —— 白西裝亮度 231、頭髮接近全黑，
     只有中間調的底才能同時讓兩者跳出來（原攝影棚就是這樣打的）。
   ========================================================================== */

:root {
  /* 色 —— 單色系統，不設彩色主色 */
  --ink: #111111;
  --paper: #ffffff;
  --tone: #a6a29b;          /* 人像襯底的中灰，接近原攝影棚背景 */
  --tone-soft: #f2f1ef;     /* 區塊交替用的淺灰 */
  /* 朱紅（印章紅）：全站唯一的彩色，只用在互動與「目前位置」。
     白底 6.69／灰底 5.93，文字用也過 AA；放在深色頁尾只有 2.82，所以頁尾不用它 */
  --accent: #a8321c;

  /* 兩種底色（白／#f2f1ef）都要過 WCAG AA 4.5:1。
     v2 原本的 #97958f 只有 3.00／2.65，用在六十幾個元素上，全部不及格。 */
  --muted: #4d4c48;   /* 白 8.60／灰 7.62 */
  --faint: #6c6a65;   /* 白 5.40／灰 4.79 */
  --line: #d9d7d2;
  --hair: #eceae6;

  /* 字 —— 全站一套 */
  --sans: "Archivo", "Noto Sans TC", -apple-system, "Segoe UI", sans-serif;

  /* 留白 */
  --maxw: 1200px;
  --nav-h: 68px;
  --gutter: clamp(22px, 5vw, 72px);
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 28px;
  --sp-4: 48px;
  --sp-5: 84px;
  --sp-6: clamp(80px, 8.5vw, 136px);

  /* 字級 —— 跨度 10 → 76px（7.6 倍），對齊量到的參考值 */
  /* 字級 v3 —— 讀得舒服是底線，設計感從對比與導言層來，不靠把字縮小。
     全站下限 12px；所有閱讀文字 ≥15px。（v2 有 94 個元素是 10px，多數是漢字） */
  --fs-display: clamp(3.25rem, 1.9rem + 5.2vw, 5.75rem);  /* 52 → 92 首屏姓名 */
  --fs-h2: clamp(1.875rem, 1.25rem + 2.2vw, 2.875rem);    /* 30 → 46 區塊標題 */
  --fs-lead: clamp(1.1875rem, 0.95rem + 0.9vw, 1.5rem);   /* 19 → 24 編輯式導言 */
  --fs-h3: clamp(1.125rem, 0.98rem + 0.5vw, 1.3125rem);   /* 18 → 21 論文／主題標題 */
  --fs-body: clamp(1rem, 0.93rem + 0.28vw, 1.125rem);     /* 16 → 18 內文 */
  --fs-small: 0.9375rem;    /* 15px 作者、期刊、說明 */
  --fs-meta: 0.75rem;       /* 12px 拉丁大寫標籤 */
  --fs-meta-cjk: 0.8125rem; /* 13px 漢字標籤：10–12px 的漢字筆畫會糊在一起 */
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 中英分治：兩種語言的行高與字距分開設定 */
html[lang^="zh"] body { line-height: 1.85; letter-spacing: 0.01em; }
html[lang="en"] body  { line-height: 1.65; letter-spacing: 0; }
html[lang="en"] :is(p, dd, li) { text-wrap: pretty; }
html[lang^="zh"] :is(p, dd, li) { line-break: strict; }

h1, h2, h3, p, dl, dd, dt, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--ink); color: var(--paper); }

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* metadata：同一套字體，靠字級、字距與大寫做出區別，不另外換字體 */
.meta,
.fact__label, .theme__en, .shead__label, .pub__tag, .crow__label,
.nav__link, .langsw__item, .hero__eyebrow, .tl__period, .pub__links,
.pubs__groupTitle, .pub__absLabel, .news__date, .profiles__label,
.hero__position dt, .foot__by, .net3d__label, .pub__doi,
.teach__level, .teach__count, .teach__num, .topics__num, .cta__label,
.cdetails__head, .cdetails__label, .cdetails__pending,
.theme__collabLabel, .student__meta, .student__badge {
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

html[lang^="zh"] :is(.meta,
  .fact__label, .theme__en, .shead__label, .pub__tag, .crow__label,
  .tl__period, .pubs__groupTitle, .pub__absLabel, .news__date, .profiles__label,
  .hero__position dt, .foot__by, .profiles__pending,
  .teach__level, .teach__count, .teach__num, .topics__num, .cta__label,
  .cdetails__head, .cdetails__label, .cdetails__pending,
  .theme__collabLabel, .student__meta, .student__badge, .pub__links) {
  font-size: var(--fs-meta-cjk);
  letter-spacing: 0.08em;
}

/* 英文版的副名是中文「毛文崢」：漢字沒有大小寫，0.2–0.3em 的寬字距只會讓它散開 */
html[lang="en"] :is(.hero__nameLatin, .nav__brand small, .foot__latin) {
  letter-spacing: 0.06em;
  font-size: var(--fs-meta-cjk);
}

/* ── 導覽列 ───────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--hair);
}
.nav__inner { display: flex; align-items: center; gap: var(--sp-4); height: var(--nav-h); }
.nav__brand { display: flex; align-items: baseline; gap: 9px; white-space: nowrap; flex: none; }
.nav__brand b { font-size: 1.0625rem; font-weight: 500; letter-spacing: -0.01em; }
.nav__brand small {
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--faint);
}
.nav__links { display: flex; gap: var(--sp-3); margin-left: auto; }
.nav__link {
  /* 主要導航不套 metadata 樣式：10px 大寫在中文版是「關於」「動態」兩個小字，太難點 */
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
  transition: color 0.18s;
  white-space: nowrap;
}
.nav__link:hover { color: var(--ink); }

.langsw { display: flex; gap: 1px; flex: none; white-space: nowrap; }
.langsw__item {
  padding: 6px 11px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  border: 1px solid var(--hair);
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}
.langsw__item + .langsw__item { margin-left: -1px; }
.langsw__item:hover { color: var(--ink); border-color: var(--line); }
.langsw__item.is-active { color: var(--paper); background: var(--ink); border-color: var(--ink); }

.nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: 6px;
  padding: 0;
  background: none;
  border: 1px solid var(--hair);
  cursor: pointer;
}
.nav__bars { position: relative; display: block; width: 16px; height: 9px; }
.nav__bars::before,
.nav__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.2s ease, top 0.2s ease;
}
.nav__bars::before { top: 0; }
.nav__bars::after { top: 7.5px; }
.nav.is-open .nav__bars::before { top: 3.75px; transform: rotate(45deg); }
.nav.is-open .nav__bars::after { top: 3.75px; transform: rotate(-45deg); }

/* ── 按鈕 ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  font-size: var(--fs-small);
  font-weight: 500;
  border: 1px solid var(--ink);
  transition: background 0.2s, color 0.2s;
}
.btn__arrow { font-style: normal; transition: transform 0.2s; }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: #000; }
.btn--ghost { color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

/* ── 首屏：不對稱，人像從右側色場底部出血 ───────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  min-height: min(76vh, 700px);
  display: flex;
  align-items: flex-end;
  padding-top: clamp(48px, 7vw, 92px);
}
/* 右側中灰色場：切齊視窗右緣，不受容器寬度限制 */
.hero__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: clamp(360px, 46vw, 760px);
  background: var(--tone);
}
.hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 34vw, 500px);
  gap: var(--sp-4);
  align-items: center;
  width: 100%;
}
.hero__text { padding-bottom: clamp(24px, 4vw, 56px); }

.hero__eyebrow { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); }
.hero__eyebrow span + span::before { content: "／"; margin-right: 12px; color: var(--faint); }

.hero__title { margin-top: var(--sp-3); }
.hero__name {
  display: block;
  font-size: var(--fs-display);
  font-weight: 300;           /* 顯示級用細字重（量到的作法） */
  line-height: 1.0;
  letter-spacing: -0.022em;   /* 負字距 */
}
html[lang^="zh"] .hero__name { letter-spacing: 0.02em; font-weight: 400; }
.hero__nameLatin {
  display: block;
  margin-top: 14px;
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__position {
  margin-top: var(--sp-4);
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  border-top: 1px solid var(--ink);
}
.hero__position dt {
  padding: 12px var(--sp-3) 12px 0;
  color: var(--faint);
  border-bottom: 1px solid var(--hair);
  white-space: nowrap;
}
.hero__position dd {
  padding: 13px 0;
  font-size: var(--fs-body);
  line-height: 1.6;
  border-bottom: 1px solid var(--hair);
}
html[lang="en"] .hero__position dd { line-height: 1.5; }

.hero__actions { margin-top: var(--sp-4); display: flex; flex-wrap: wrap; gap: 12px; }

/* 人像：貼著首屏底緣，向左略為壓過文字欄 */
.hero__figure { position: relative; align-self: end; }
.hero__portrait {
  position: relative;
  z-index: 2;
  margin-left: -8%;
  width: 108%;
}
.hero__portrait img { width: 100%; height: auto; display: block; }

/* three.js 網絡圖：退到色場裡當極淡底紋，不再與人像搶位置 */
.net3d {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.net3d[data-state="ready"] { opacity: 0.8; }
.net3d__canvas { width: 100%; height: 100%; display: block; }
.net3d__labels { position: absolute; inset: 0; pointer-events: none; }
.net3d__label {
  position: absolute;
  top: 0;
  left: 0;
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper);
  white-space: nowrap;
  will-change: transform, opacity;
}

/* ── 事實列 ───────────────────────────────────────────────── */
.facts { padding: var(--sp-4) 0; border-bottom: 1px solid var(--hair); }
.facts__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }
.fact { display: flex; flex-direction: column; gap: 7px; }
.fact__num { font-size: clamp(1.5rem, 1.2rem + 0.8vw, 2rem); font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; }
.fact__label { color: var(--ink); }
.fact__sub { font-size: var(--fs-small); color: var(--muted); }

/* ── 區塊 ─────────────────────────────────────────────────── */
.section { padding: var(--sp-6) 0; }
.section--alt { background: var(--tone-soft); }

.shead { margin-bottom: var(--sp-4); }
.shead__label { display: block; color: var(--faint); }
.shead__title {
  margin-top: 14px;
  font-size: var(--fs-h2);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.018em;
}
html[lang^="zh"] .shead__title {
  font-weight: 400;
  letter-spacing: 0.01em;
  /* 中文標題只在標點處換行：避免「學術合作、演／講與交流」這種斷在詞中間的情況 */
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* 關於：編輯式導言。大字細字重、墨色，取代原本 13.5px 的灰字 */
.about__body {
  max-width: 52ch;
  display: grid;
  gap: var(--sp-3);
  font-size: var(--fs-lead);
  font-weight: 300;
  color: var(--ink);
}
html[lang="en"] .about__body { line-height: 1.45; letter-spacing: -0.005em; }
html[lang^="zh"] .about__body { line-height: 1.75; font-weight: 400; }

.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.theme { padding-top: var(--sp-2); border-top: 1px solid var(--ink); }
.theme__num { color: var(--faint); }
.theme__en { display: block; margin-top: 10px; color: var(--faint); }
.theme__title { margin-top: 10px; font-size: var(--fs-h3); font-weight: 500; line-height: 1.45; }
.theme__desc { margin-top: 10px; font-size: var(--fs-small); color: var(--muted); }

/* ── 最新動態 ─────────────────────────────────────────────── */
.news { display: grid; }
.news__row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--line);
}
.news__row:last-child { border-bottom: 1px solid var(--line); }
.news__date { color: var(--faint); padding-top: 5px; }
.news__text { font-size: var(--fs-body); color: var(--ink); max-width: 68ch; }

/* ── 學術發表 ─────────────────────────────────────────────── */
.pubs { display: grid; gap: var(--sp-4); }
.pubs__group { display: grid; }
.pubs__groupTitle { color: var(--faint); font-weight: 500; padding-bottom: var(--sp-1); }
.pub { padding: var(--sp-3) 0; border-top: 1px solid var(--line); }
.pubs__group .pub:last-child { border-bottom: 1px solid var(--line); }

.pub__tag { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink); }
.pub__dot { color: var(--faint); }
.pub__honor { color: var(--muted); }

.pub__title {
  margin-top: 12px;
  max-width: 64ch;
  font-size: var(--fs-h3);
  font-weight: 500;
  line-height: 1.45;
}
.pub__authors { margin-top: 8px; font-size: var(--fs-small); color: var(--muted); }
.pub__me { font-weight: 600; color: var(--ink); }
.pub__venue { margin-top: 3px; font-size: var(--fs-small); color: var(--faint); font-style: italic; }
.pub__doi { margin-top: 6px; color: var(--faint); text-transform: none; letter-spacing: 0.04em; user-select: all; }

.pub__toggleRow { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--hair); }
.pub__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  font-family: inherit;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
}
.pub__toggle:hover { text-decoration: underline; text-underline-offset: 4px; }
.pub__toggleIcon { width: 14px; height: 14px; flex: none; }
.pub__chev { width: 12px; height: 12px; flex: none; color: var(--faint); transition: transform 0.26s ease; }
.pub__toggle[aria-expanded="true"] .pub__chev { transform: rotate(180deg); }

.pub__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.pub__panel.is-open { grid-template-rows: 1fr; }
.pub__panelInner { overflow: hidden; }
.pub__panel.is-open .pub__panelInner { padding-top: var(--sp-2); }
.pub__absLabel { display: block; color: var(--faint); }
.pub__absNote { margin-top: 6px; font-size: 0.875rem; color: var(--ink); }
.pub__abs { margin-top: 8px; max-width: 68ch; font-size: var(--fs-body); color: var(--muted); }
.pub__abs[lang="en"] { line-height: 1.65; letter-spacing: 0; }

.pub__links { margin-top: var(--sp-2); display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.pub__link { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); }
.pub__link:hover { text-decoration: underline; text-underline-offset: 4px; }
.pub__linkIcon { width: 11px; height: 11px; flex: none; }
.pub__link.is-placeholder { color: var(--faint); cursor: not-allowed; text-decoration: none; }

.note {
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--hair);
  max-width: 74ch;
  font-size: 0.875rem;
  color: var(--faint);
}

/* ── 經歷 / 教學 ──────────────────────────────────────────── */
.tl { display: grid; }
.tl__row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--line);
}
.tl__row:last-child { border-bottom: 1px solid var(--line); }
.tl__period { color: var(--faint); padding-top: 5px; }
.tl__title { font-size: var(--fs-h3); font-weight: 500; line-height: 1.45; }
.tl__org { margin-top: 5px; font-size: var(--fs-small); color: var(--muted); }

/* ── 聯絡 ─────────────────────────────────────────────────── */
.contact__lead {
  max-width: 46ch;
  font-size: var(--fs-lead);
  font-weight: 300;
  color: var(--ink);
}
html[lang="en"] .contact__lead { line-height: 1.45; }
html[lang^="zh"] .contact__lead { line-height: 1.75; font-weight: 400; }
.contact__rows { margin-top: var(--sp-4); display: grid; }
.crow {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: var(--sp-3);
  padding: 14px 0;
  border-top: 1px solid var(--hair);
}
.crow:last-child { border-bottom: 1px solid var(--hair); }
.crow__label { color: var(--faint); }
.crow__value { font-size: var(--fs-body); }
a.crow__value:hover { text-decoration: underline; text-underline-offset: 4px; }

/* 學術檔案連結 */
.profiles { margin-top: var(--sp-4); padding-top: var(--sp-2); border-top: 1px solid var(--ink); }
.profiles__label { display: block; color: var(--faint); }
.profiles__row { margin-top: var(--sp-2); display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.profiles__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-small);
  font-weight: 500;
}
.profiles__item:hover { text-decoration: underline; text-underline-offset: 4px; }
.profiles__icon { width: 11px; height: 11px; flex: none; }
.profiles__item.is-placeholder { color: var(--faint); cursor: not-allowed; text-decoration: none; }
.profiles__pending {
  margin-left: 7px;
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ── 頁尾 ─────────────────────────────────────────────────── */

/* ── 教學領域：兩組並排 ─────────────────────────────────── */
.teach { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.teach__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--ink);
}
.teach__level { color: var(--ink); }
.teach__count { color: var(--faint); }
.teach__list { list-style: none; margin: 0; padding: 0; }
.teach__item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: var(--sp-2);
  align-items: baseline;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
}
.teach__num { color: var(--faint); }
.teach__title { font-size: var(--fs-h3); font-weight: 500; line-height: 1.4; }

/* ── 學術合作、演講與交流 ───────────────────────────────────
   四層：導言 → 合作類型 → 大字 Email（焦點）→ 聯絡資訊｜學術檔案 */
.topics {
  list-style: none;
  margin: var(--sp-4) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--sp-4);
  border-top: 1px solid var(--ink);
}
.topics__item {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line);
}
.topics__num { color: var(--faint); }
.topics__label { font-size: var(--fs-body); font-weight: 500; }

.cta { margin-top: var(--sp-5); }
.cta__label { display: block; color: var(--faint); }
.cta__mail {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
  margin-top: 10px;
  padding-bottom: 6px;
  font-size: clamp(1.5rem, 0.9rem + 2.4vw, 2.75rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.15;
  border-bottom: 1px solid var(--ink);
  overflow-wrap: anywhere;
}
.cta__arrow { font-style: normal; font-size: 0.7em; transition: transform 0.25s ease; }
.cta__mail:hover .cta__arrow { transform: translateX(6px); }

.cdetails {
  margin-top: var(--sp-5);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}
.cdetails__head {
  display: block;
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
}
.cdetails__row { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--hair); }
.cdetails__label { color: var(--faint); }
.cdetails__value { font-size: var(--fs-body); line-height: 1.55; }
.cdetails__tel { justify-self: start; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.cdetails__tel:hover { color: var(--accent); text-decoration-color: currentColor; }
.cdetails__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  font-size: var(--fs-body);
  font-weight: 500;
  border-bottom: 1px solid var(--hair);
}
.cdetails__link:hover span:first-child { text-decoration: underline; text-underline-offset: 4px; }
.cdetails__icon { width: 12px; height: 12px; flex: none; margin-left: auto; color: var(--faint); }
.cdetails__link.is-placeholder { color: var(--faint); cursor: not-allowed; }
.cdetails__pending { margin-left: auto; color: var(--faint); }

@media (max-width: 720px) {
  .teach, .topics, .cdetails { grid-template-columns: 1fr; }
  .teach { gap: var(--sp-4); }
}

/* 不拆開的詞（例如職稱「副教授」不能被拆成「副／教授」） */
.nb { white-space: nowrap; }

/* ── 桌機：編輯式雙欄 ─────────────────────────────────────
   v2 首屏以下仍是單欄置中、右半邊整片空著，這是樣板感最大的來源。
   改成標題在左窄欄、內容在右寬欄；標題捲動時黏住，長的論文區特別有用。 */
@media (min-width: 1025px) {
  .section > .wrap {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    column-gap: var(--sp-5);
    align-items: start;
  }
  .section > .wrap > .shead {
    grid-column: 1;
    grid-row: 1 / span 20;
    position: sticky;
    top: 104px;
    margin-bottom: 0;
  }
  .section > .wrap > :not(.shead) { grid-column: 2; }

  /* 研究主題：右欄放三欄太擠，改成編號清單 */
  .themes { grid-template-columns: 1fr; gap: 0; }
  .theme {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    column-gap: var(--sp-3);
    padding: var(--sp-3) 0;
    border-top: 1px solid var(--line);
  }
  .theme:last-child { border-bottom: 1px solid var(--line); }
  .theme__num { grid-column: 1; grid-row: 1 / span 3; padding-top: 4px; }
  .theme > :not(.theme__num) { grid-column: 2; }
  .theme__en { margin-top: 0; }
}

/* ── 平板 ─────────────────────────────────────────────────── */
/* 選單收合：7 個連結＋品牌＋語言鈕約需 1050px，
   原本只在 720px 以下收合，721–1100px 的平板寬度字會被擠成直排 */
@media (max-width: 1100px) {
  .lang { margin-left: auto; }
  .nav__toggle { display: inline-flex; }
  .nav__links { display: none; }
}

@media (max-width: 1024px) {
  /* 單欄時沒有空白區可以放路線，放了只會壓在文字上 */
  .routes { display: none; }
  /* 窄畫面：不再用「絕對定位、佔首屏下半部」的色場——它會壓在文字上。
     改成色場只墊在人像後面，滿版出血；文字留在白底。
     （three.js 底紋跟著色場隱藏，IntersectionObserver 會自動停掉繪製，順便省電） */
  .hero { min-height: 0; padding-top: var(--sp-4); display: block; }
  .hero__panel { display: none; }
  .hero__inner { grid-template-columns: 1fr; gap: 0; }
  .hero__text { padding-bottom: var(--sp-4); }
  .hero__figure {
    margin-inline: calc(var(--gutter) * -1);
    padding-top: var(--sp-4);
    background: var(--tone);
    display: flex;
    justify-content: center;
  }
  .hero__portrait { margin-left: 0; width: min(72%, 420px); }
  .themes { grid-template-columns: 1fr 1fr; }
  .facts__grid { grid-template-columns: 1fr 1fr; gap: var(--sp-3) var(--sp-4); }
}

/* ── 手機 ─────────────────────────────────────────────────── */
@media (max-width: 720px) {
  :root { --nav-h: 58px; }
  .nav__inner { gap: var(--sp-1); }
  .nav__brand small { display: none; }
  /* eyebrow 斷行時斜線會跑到第二行開頭：手機改成上下兩行、不放斜線 */
  .hero__eyebrow { flex-direction: column; gap: 4px; }
  .hero__eyebrow span + span::before { content: none; }
  .themes { grid-template-columns: 1fr; gap: var(--sp-3); }
  .tl__row, .crow, .news__row { grid-template-columns: 1fr; gap: 5px; }
  .hero__position { grid-template-columns: 1fr; }
  .hero__position dt { padding-bottom: 0; border-bottom: 0; }
  .hero__position dd { padding-top: 4px; }
  .hero__portrait { width: min(84%, 360px); }
  .pub__links { gap: var(--sp-2) var(--sp-3); }
}

/* ── 區塊底紋 ─────────────────────────────────────────────
   只放在部分區塊，保持節奏；邊緣用遮罩淡出，避免變成壁紙。
   動態＝點陣、代表性研究＝配送路線、學術發表＝方格紙、聯絡＝路線匯聚 */
.section { position: relative; isolation: isolate; }
.section > .wrap { position: relative; z-index: 1; }
.section[data-texture="dots"]::before,
.section[data-texture="grid"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.section[data-texture="dots"]::before {
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 22%, transparent) 1px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(100deg, transparent 18%, #000 62%);
          mask-image: linear-gradient(100deg, transparent 18%, #000 62%);
}
.section[data-texture="grid"]::before {
  background-image:
    linear-gradient(color-mix(in srgb, var(--ink) 8%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 8%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 75% 55% at 88% 12%, #000 0%, transparent 72%);
          mask-image: radial-gradient(ellipse 75% 55% at 88% 12%, #000 0%, transparent 72%);
}

/* 配送路線（SVG，由 motion.js 產生） */
.routes {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* 只留在左欄空白處，進到文字欄（約 42% 起）之前就淡出——
     v3 初版濃度 16%、橫跨全寬，穿過論文列表跟分隔線打架，太重 */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 28%, transparent 44%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 28%, transparent 44%);
}
.routes path {
  fill: none;
  stroke: color-mix(in srgb, var(--ink) 9%, transparent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.routes circle { fill: color-mix(in srgb, var(--ink) 22%, transparent); }
.routes .routes__hub { fill: color-mix(in srgb, var(--ink) 55%, transparent); }

/* ── 捲動互動 ─────────────────────────────────────────────── */
/* 只有 JS 確定要做動態時（html.js-motion）才先藏起來；JS 沒跑，內容照常顯示 */
.js-motion .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.75s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.75s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--d, 0ms);
}
.js-motion .reveal.is-in { opacity: 1; transform: none; }

/* 分隔線從左畫到右：把原本的 border-top 換成可以伸長的背景線 */
.js-motion .reveal-line {
  border-top-color: transparent;
  background-image: linear-gradient(var(--line), var(--line));
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 0% 1px;
  transition:
    opacity 0.75s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.75s cubic-bezier(0.2, 0.7, 0.2, 1),
    background-size 1.1s cubic-bezier(0.25, 0.7, 0.2, 1);
  transition-delay: var(--d, 0ms);
}
.js-motion .reveal-line.is-in { background-size: 100% 1px; }

/* 路線底紋：捲到時一條一條畫出來 */
.js-motion .routes { opacity: 1; transform: none; }
.js-motion .routes path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 2.4s cubic-bezier(0.3, 0.6, 0.2, 1);
  transition-delay: var(--d, 0ms);
}
.js-motion .routes circle { opacity: 0; transition: opacity 0.6s ease; transition-delay: var(--d, 0ms); }
.js-motion .routes.is-in path { stroke-dashoffset: 0; }
.js-motion .routes.is-in circle { opacity: 1; }


/* 目前所在區塊 */
.nav__link[aria-current="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

/* 人像視差由 motion.js 寫 transform，這裡只負責讓它順 */
.hero__portrait { will-change: transform; }


/* ── 論文列滑過：白卡浮起＋朱紅色條＋標題轉紅 ───────────────
   v3 是 2.5% 的灰，看不出來；改淡紅底也不行——學術發表在灰底區塊，
   7% 淡紅與灰底的對比只有 1.01。所以用白卡、色條與文字色三件事一起撐出對比。 */
.pub { position: relative; isolation: isolate; }
.pub::after {
  content: "";
  position: absolute;
  inset: 0 calc(var(--gutter) * -0.5);
  z-index: -1;
  background: var(--paper);
  box-shadow: inset 4px 0 0 var(--accent);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}
.pub__title, .pub__tag, .pub__link, .pub__toggle { transition: color 0.2s ease; }
@media (hover: hover) {
  .pub:hover::after { opacity: 1; }
  .pub:hover :is(.pub__title, .pub__tag, .pub__link, .pub__toggle) { color: var(--accent); }
}
/* 鍵盤操作進到某一篇時給同樣的回饋 */
.pub:focus-within::after { opacity: 1; }
.pub:focus-within :is(.pub__title, .pub__tag) { color: var(--accent); }

/* 浮起：滑過時整篇內容往上浮、白卡帶出淡陰影。
   寫在「列裡的內容」上而不是整列：整列帶著捲動浮現的延遲（最多 420ms），
   寫在整列上滑過也會慢半秒才動。 */
@media (prefers-reduced-motion: no-preference) {
  .pub > * { transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.2s ease; }
  .pub::after {
    transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s ease;
  }
  @media (hover: hover) {
    .pub:hover > * { transform: translateY(-4px); }
    .pub:hover::after {
      transform: translateY(-4px);
      box-shadow: inset 4px 0 0 var(--accent), 0 22px 44px -26px rgba(0, 0, 0, 0.38);
    }
  }
}

/* ── 語言選單 ─────────────────────────────────────────────── */
.lang { position: relative; flex: none; }
.lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.lang__btn:hover { border-color: var(--ink); }
.lang.is-open .lang__btn { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.lang__globe { width: 15px; height: 15px; flex: none; }
.lang__chev { width: 11px; height: 11px; flex: none; transition: transform 0.2s ease; }
.lang.is-open .lang__chev { transform: rotate(180deg); }
.lang__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  min-width: 196px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px -18px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}
.lang.is-open .lang__menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}
.lang__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 12px;
  font-size: 0.9375rem;
  color: var(--ink);
}
.lang__opt:hover { background: var(--tone-soft); }
.lang__opt.is-current { font-weight: 600; }
.lang__code { font-size: var(--fs-meta); font-weight: 500; letter-spacing: 0.08em; color: var(--faint); }
.lang__check { width: 14px; height: 14px; flex: none; color: var(--accent); }

/* ── 浮動 TOP ─────────────────────────────────────────────── */
.totop {
  position: fixed;
  right: clamp(16px, 2.4vw, 32px);
  bottom: clamp(16px, 2.4vw, 32px);
  z-index: 60;
  width: 58px;
  height: 58px;
  padding: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s, background 0.2s, color 0.2s;
}
.totop.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s, background 0.2s, color 0.2s;
}
.totop:hover { background: var(--ink); color: var(--paper); }
.totop__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.totop__ring circle { fill: none; stroke-width: 2; }
.totop__track { stroke: var(--hair); }
.totop__progress {
  stroke: var(--accent);
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.12s linear;
}
.totop__icon { position: relative; width: 14px; height: 14px; }
.totop__label { position: relative; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; line-height: 1; }

/* ── 頁尾：一列收完 ───────────────────────────────────────
   字級全部沿用全站 token：標題＝區塊標籤（12px 大寫）、連結＝次要文字（15px）、
   Email＝內文（16–18px）。不再出現比首屏還大的字。 */
.foot {
  --foot-faint: #a3a19b;   /* 深底 7.31 */
  --foot-line: rgba(255, 255, 255, 0.14);
  /* 底部多留一個 TOP 鈕的高度：捲到底時按鈕落在空白處，不壓到版權列 */
  padding: var(--sp-4) 0 calc(var(--sp-3) + 76px);
  color: var(--paper);
  background: var(--ink);
  border-top: 0;
}
.foot a { color: inherit; }
.foot a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1.6fr) minmax(0, 1fr);
  gap: var(--sp-4);
  padding-bottom: var(--sp-4);
}
.foot__name { display: block; font-size: var(--fs-h3); font-weight: 500; letter-spacing: -0.005em; }
html[lang^="zh"] .foot__name { letter-spacing: 0.03em; }
.foot__latin {
  display: block;
  margin-top: 6px;
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--foot-faint);
}
.foot__head {
  display: block;
  margin-bottom: 12px;
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--foot-faint);
}
html[lang^="zh"] .foot__head { font-size: var(--fs-meta-cjk); letter-spacing: 0.08em; }
.foot__mail { display: inline-block; font-size: var(--fs-body); overflow-wrap: anywhere; }
.foot__line { display: block; margin-top: 4px; font-size: var(--fs-small); color: var(--foot-faint); }
.foot__links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--fs-small); }
.foot__links .is-current { font-weight: 600; text-decoration: underline; text-underline-offset: 5px; }
.foot__col:last-child .foot__links { gap: 6px 0; }
.foot__col:last-child .foot__links a + a::before {
  content: "·";
  display: inline-block;
  margin: 0 12px;
  color: var(--foot-faint);
  text-decoration: none;
}
.foot__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--foot-line);
  font-size: 0.8125rem;
  color: var(--foot-faint);
}
.foot__by { color: var(--foot-faint); text-transform: none; letter-spacing: 0.02em; font-size: 0.8125rem; }

@media (max-width: 1024px) {
  .foot__row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .foot__row { grid-template-columns: 1fr 1fr; gap: var(--sp-3) var(--sp-2); }
  .foot__brand, .foot__row > .foot__col:nth-child(2) { grid-column: 1 / -1; }
  .foot__bar { flex-direction: column; }
  .lang__btn { padding: 0 10px; }
  .totop { width: 52px; height: 52px; }
}

/* ── 全螢幕選單（≤1100px）──────────────────────────────── */
.mmenu { display: none; }
/* 開啟時鎖住背景捲動。鎖在 body 不鎖 html：body 有 overflow-x: hidden，
   若 html 也設 overflow，body 會變成獨立捲動容器，黏頂的導覽列就跟著被捲走 */
html.menu-open body { overflow: hidden; }
html.menu-open .totop { opacity: 0; visibility: hidden; pointer-events: none; }
@media (max-width: 1100px) {
  .mmenu {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 39;
    display: flex;
    flex-direction: column;
    padding: var(--sp-3) var(--gutter) calc(var(--sp-3) + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--paper);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
  }
  html.menu-open .mmenu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s;
  }
  .mmenu__nav { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
  .mmenu__link {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: baseline;
    gap: var(--sp-2);
    padding: clamp(14px, 2.4vh, 20px) 0;
    border-bottom: 1px solid var(--line);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.2s;
    transition-delay: calc(var(--i, 0) * 45ms + 90ms);
  }
  html.menu-open .mmenu__link { opacity: 1; transform: none; }
  .mmenu__num { font-size: var(--fs-meta); font-weight: 500; letter-spacing: 0.1em; color: var(--faint); }
  .mmenu__label {
    font-size: clamp(1.5rem, 1.05rem + 2.2vw, 2.125rem);
    font-weight: 300;
    line-height: 1.15;
    letter-spacing: -0.015em;
  }
  html[lang^="zh"] .mmenu__label { font-weight: 400; letter-spacing: 0.03em; }
  .mmenu__en {
    font-size: var(--fs-meta);
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
    text-align: right;
  }
  .mmenu__link:hover .mmenu__label,
  .mmenu__link[aria-current="true"] .mmenu__label,
  .mmenu__link[aria-current="true"] .mmenu__num { color: var(--accent); }

  .mmenu__foot {
    margin-top: auto;
    padding-top: var(--sp-4);
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: var(--sp-3);
  }
  .mmenu__head {
    display: block;
    margin-bottom: 10px;
    font-size: var(--fs-meta);
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--faint);
  }
  html[lang^="zh"] .mmenu__head { font-size: var(--fs-meta-cjk); letter-spacing: 0.08em; }
  .mmenu__mail { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-small); overflow-wrap: anywhere; }
  .mmenu__icon { width: 15px; height: 15px; flex: none; color: var(--faint); }
  .mmenu__langs { display: flex; align-items: center; font-size: var(--fs-small); }
  .mmenu__langs a + a::before { content: "·"; display: inline-block; margin: 0 12px; color: var(--faint); }
  .mmenu__langs .is-current { font-weight: 600; text-decoration: underline; text-underline-offset: 5px; }
}
@media (max-width: 420px) {
  .mmenu__en { display: none; }              /* 太窄時只留中文主標 */
  .mmenu__link { grid-template-columns: 34px minmax(0, 1fr); }
  .mmenu__foot { grid-template-columns: 1fr; }
}

/* ── 功能性圖示 ───────────────────────────────────────────
   只加在「有辨識功能」的地方：學術檔案、聯絡資訊、選單 Email。
   研究主題、動態、教學是排版性內容，加圖示只會變成樣板裝飾。 */
.cdetails__row { grid-template-columns: 18px minmax(0, 1fr); column-gap: 12px; }
.cdetails__ico { grid-row: 1 / span 2; width: 16px; height: 16px; margin-top: 2px; color: var(--faint); }
.cdetails__lead { width: 16px; height: 16px; flex: none; color: var(--muted); margin-right: 4px; }
.cdetails__link.is-placeholder .cdetails__lead { color: var(--faint); }

/* ── 研究定位（10/28 需求表第 3 項）───────────────────────────
   導言＋三個主題。主題內容很長，平常只露出第一段的前兩行，點擊原地展開。 */
.themes__intro {
  display: grid;
  gap: var(--sp-2);
  max-width: 62ch;
  margin-bottom: var(--sp-4);
  font-size: var(--fs-lead);
  font-weight: 300;
  color: var(--ink);
}
html[lang="en"] .themes__intro { line-height: 1.5; }
html[lang^="zh"] .themes__intro { line-height: 1.75; font-weight: 400; }
html[lang="en"] .themes__intro p + p { font-size: var(--fs-body); color: var(--muted); }

.theme__body { margin-top: 12px; max-width: 66ch; }
.theme__p { font-size: var(--fs-small); color: var(--muted); }
.theme__p + .theme__p { margin-top: 10px; }
.theme__p strong { font-weight: 600; color: var(--ink); }
/* 收合：只留第一段的前兩行，其餘段落與合作方向隱藏 */
.theme__body > .theme__p:first-child {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.theme__body > :not(:first-child) { display: none; }
.theme.is-open .theme__body > .theme__p:first-child { display: block; -webkit-line-clamp: unset; overflow: visible; }
.theme.is-open .theme__body > :not(:first-child) { display: block; animation: themeIn 0.35s ease both; }
@keyframes themeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.theme__collab {
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) 18px;
  background: var(--tone-soft);
  border-left: 2px solid var(--ink);
}
.theme__collabLabel { display: block; margin-bottom: 8px; color: var(--ink); }

.theme__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  margin-top: 14px;
  padding: 0;
  font-family: inherit;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
}
.theme__toggle:hover { color: var(--accent); }
.theme__chev { width: 12px; height: 12px; color: currentColor; transition: transform 0.26s ease; }
.theme__toggle[aria-expanded="true"] .theme__chev { transform: rotate(180deg); }

/* 結構化摘要的小標（Problem definition: …） */
.pub__absHead { font-weight: 600; color: var(--ink); }

/* ── 學生成果（10/28 需求表第 6 項）──────────────────────────
   沒有資料時整區不出現；有資料後支援分類篩選、搜尋、分頁載入。 */
.students__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.students__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.students__chip {
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.students__chip:hover { color: var(--ink); border-color: var(--ink); }
.students__chip[aria-pressed="true"] { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.students__search {
  flex: 0 1 260px;
  min-width: 200px;
  padding: 10px 2px;
  font-family: inherit;
  font-size: var(--fs-small);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
}
.students__search::placeholder { color: var(--faint); }
.students__search:focus-visible { outline: none; border-bottom-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }

.students { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--sp-4) var(--sp-3); }
.student { display: flex; flex-direction: column; }
.student__media {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 0 0 14px;
  overflow: hidden;
  background: var(--tone-soft);
}
.student__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.student:hover .student__media img { transform: scale(1.03); }
/* 沒有圖片時的類別底圖：跟全站底紋同一套語言（點陣／方格／路線） */
.student__media[data-cat="research"] {
  background-image: linear-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
}
.student__media[data-cat="project"] {
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 24%, transparent) 1px, transparent 1.4px);
  background-size: 16px 16px;
}
.student__media[data-cat="award"],
.student__media[data-cat="other"] {
  background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ink) 9%, transparent) 0 1px, transparent 1px 14px);
}
.student__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  color: var(--paper);
  background: var(--ink);
}
.student__meta { display: flex; gap: 8px; color: var(--faint); }
.student__title { margin-top: 8px; font-size: 1.0625rem; font-weight: 500; line-height: 1.45; }
.student__people { margin-top: 6px; font-size: var(--fs-small); color: var(--ink); }
.student__desc {
  margin-top: 6px;
  font-size: var(--fs-small);
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.student .pub__links { margin-top: 12px; }
.students__empty { padding: var(--sp-4) 0; text-align: center; color: var(--faint); }
.students__more { display: flex; margin: var(--sp-4) auto 0; }
.students__empty[hidden], .students__more[hidden] { display: none; }

/* ── 浮動聯絡鈕（10/28 需求表第 5 項）───────────────────────
   疊在 TOP 鈕正上方；點開是聯絡小卡。捲到聯絡區時由 motion.js 收起。 */
.fab {
  position: fixed;
  right: clamp(16px, 2.4vw, 32px);
  bottom: calc(clamp(16px, 2.4vw, 32px) + 58px + 12px);
  z-index: 61;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}
.fab.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s;
}
html.menu-open .fab { opacity: 0; visibility: hidden; pointer-events: none; }
.fab__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px 0 16px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: background 0.2s;
}
.fab__btn:hover, .fab.is-open .fab__btn { background: var(--accent); }
.fab__icon { width: 16px; height: 16px; flex: none; }
.fab__card {
  width: min(300px, calc(100vw - 32px));
  margin-bottom: 10px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px -20px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
.fab.is-open .fab__card {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
}
.fab__head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 12px; }
.fab__title { font-size: var(--fs-small); font-weight: 600; }
.fab__close {
  width: 32px;
  height: 32px;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
}
.fab__close:hover { color: var(--ink); }
.fab__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  font-size: var(--fs-small);
  border-top: 1px solid var(--hair);
  overflow-wrap: anywhere;
}
.fab__row:hover { background: var(--tone-soft); color: var(--accent); }
.fab__rowIcon { width: 16px; height: 16px; flex: none; color: var(--faint); }
.fab__row:last-child .fab__rowIcon { transform: rotate(-90deg); }

@media (max-width: 720px) {
  .students__tools { flex-direction: column; align-items: stretch; }
  .students__search { flex-basis: auto; }
  /* 手機：浮動聯絡縮成圓鈕，只留圖示，避免遮住內容 */
  .fab { bottom: calc(clamp(16px, 2.4vw, 32px) + 52px + 10px); }
  .fab__btn { width: 52px; height: 52px; padding: 0; justify-content: center; }
  .fab__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ── 減少動態 ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .pub__panel { transition: none; }
}
