/* ==========================================================================
   深林印象官网 — R14 统一视觉与结构样式
   单一规则集：tokens → header → hero → sections → cards → subpages → responsive
   ========================================================================== */

:root {
  --bg-page: #F6F4EC;
  --bg-surface: #FCFBF7;
  --bg-subtle: #EDEBE0;
  --bg-footer: #112A21;
  --text-primary: #14261E;
  --text-secondary: #3E4E45;
  --text-muted: #5A6B61;
  --brand-primary: #164233;
  --brand-hover: #0E2E23;
  --brand-tint: #E2ECE5;
  --focus-ring: #C5E063;
  --border-subtle: #D8DDD2;
  --border-strong: #94A69A;
  --serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  --shell: 1240px;
  --gutter: 40px;
  --section-space: 56px;
  --header-height: 68px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font: 400 16px/1.7 var(--sans);
  overflow-wrap: break-word;
}

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

a,
a:visited {
  color: inherit;
  text-decoration: none;
}

p {
  max-width: 72ch;
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--serif);
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.25;
}

h2 {
  font-size: clamp(22px, 2vw, 26px);
  line-height: 1.32;
}

h3 {
  font-size: 18px;
  line-height: 1.4;
}

:lang(en) h1,
:lang(en) h2,
:lang(en) h3,
:lang(en) p {
  letter-spacing: normal;
}

button,
input,
textarea,
select {
  font: inherit;
}

::selection {
  background: var(--brand-tint);
  color: var(--brand-primary);
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px var(--brand-primary);
}

.shell {
  width: min(calc(100% - (var(--gutter) * 2)), var(--shell));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border: 2px solid var(--brand-primary);
  background: var(--focus-ring);
  color: var(--brand-primary);
  font-size: 15px;
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header and mobile drawer ------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-height);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(246, 244, 236, 0.97);
  -webkit-backdrop-filter: saturate(110%) blur(12px);
  backdrop-filter: saturate(110%) blur(12px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  border: 1px solid var(--brand-primary);
  background: var(--bg-surface);
  color: var(--brand-primary);
  font: 500 22px/1 var(--serif);
}

.brand-text {
  color: var(--brand-primary);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.brand-sub {
  display: block;
  margin-top: 1px;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px 16px;
  min-width: 0;
  font-size: 14px;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 3px;
  color: var(--text-primary);
  white-space: nowrap;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--brand-primary);
  text-decoration: underline;
  text-underline-offset: 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.header-actions > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid transparent;
  color: var(--brand-primary);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.header-actions .nav-teaching {
  border-color: var(--border-strong);
}

.header-actions .nav-teaching:hover {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
  color: var(--bg-surface);
}

.nav-drawer {
  display: none;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--brand-primary);
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.nav-toggle::-webkit-details-marker {
  display: none;
}

.nav-toggle:hover,
.nav-drawer[open] .nav-toggle {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
  color: var(--bg-surface);
}

.primary-nav--drawer {
  display: none;
}

/* Hero -------------------------------------------------------------------- */

.hero {
  border-bottom: 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: 40px;
  padding-block: 48px 40px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-primary);
}

.hero-name {
  display: block;
  margin-top: 14px;
  color: var(--accent-moss, #2E6B54);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.hero-statement {
  display: block;
  margin-top: 6px;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.25;
}

.en-home .hero-statement {
  font-size: clamp(24px, 2.8vw, 34px);
}

.hero-lede {
  max-width: 64ch;
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-photo {
  margin: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
  overflow: hidden;
}

.hero-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.hero-photo figcaption {
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

/* Buttons and inline links ------------------------------------------------ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--brand-primary);
  border-radius: 3px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.button-primary {
  background: var(--brand-primary);
  color: var(--bg-surface);
}

.button-primary:hover {
  background: var(--brand-hover);
}

.button-secondary {
  background: var(--bg-surface);
  color: var(--brand-primary);
}

.button-secondary:hover {
  background: var(--brand-tint);
}

.inline-link,
.action-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--brand-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  margin-top: 20px;
}

p a:not(.button),
li a:not(.button):not(.research-project-item a):not(.research-paper-list li a),
.caption-text a,
.card-credit a,
.work-links a,
.pub-links a,
.contact-email,
.footer-note a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* Section rhythm ---------------------------------------------------------- */

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: end;
  gap: 32px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.section-kicker > span {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 22px;
  padding-inline: 4px;
  border: 1px solid var(--border-strong);
  color: var(--brand-primary);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0;
}

.section-aside {
  max-width: 52ch;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

.section-intro {
  max-width: 70ch;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

.research,
.featured-projects,
.works,
.people,
.teaching,
.contact,
.page-section {
  padding-block: var(--section-space);
}

.research,
.featured-projects,
.works,
.people,
.teaching,
.contact {
  border-top: 1px solid var(--border-subtle);
}

.works {
  background: var(--bg-subtle);
}

.research .section-head,
.featured-projects .section-head,
.people .section-head,
.contact .section-head {
  border-bottom: 0;
}

.section-backtop {
  width: min(calc(100% - (var(--gutter) * 2)), var(--shell));
  margin: 18px auto 0;
  text-align: right;
}

.back-top-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--brand-primary);
  font-size: 14px;
  font-weight: 600;
}

.back-top-pill:hover {
  background: var(--brand-tint);
}

/* Home: direction index --------------------------------------------------- */

.direction-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.direction-card {
  min-width: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
}

.direction-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.direction-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.direction-index {
  color: var(--brand-primary);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
}

.direction-count {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand-primary);
  font-size: 14px;
  font-weight: 600;
}

.direction-count:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.direction-card h3 {
  font-size: 18px;
}

.direction-short {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.65;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 3px 8px;
  border: 0;
  border-radius: 3px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

/* Home: six project teasers ----------------------------------------------- */

.project-teaser-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.project-teaser {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
  overflow: hidden;
}

.project-teaser-media {
  margin: 0;
  background: var(--bg-subtle);
}

.project-teaser-media img {
  width: 100%;
  height: 200px;
  max-height: 200px;
  object-fit: cover;
  object-position: 50% 50%;
}

.project-teaser-media img.is-contain {
  object-fit: contain;
  padding: 12px 16px;
  background: #FFFFFF;
}

.project-teaser-media img.project-diagram {
  object-fit: contain;
  padding: 4px 12px;
  background: var(--bg-surface);
}

.project-teaser-media img.project-photo--case03 {
  object-position: 50% 0%;
}

.project-teaser-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
}

.project-teaser-kicker {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.45;
}

.project-teaser h3 {
  font-size: 18px;
}

.project-teaser h3 a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-teaser-body > p:not(.project-teaser-kicker) {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.65;
}

.project-teaser-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  margin-top: auto;
  padding-top: 10px;
}

.project-teaser-facts {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.project-teaser-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand-primary);
  font-size: 14px;
  font-weight: 600;
}

.project-teaser-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.works-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 14px;
}

.works-more a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Home: compact papers ---------------------------------------------------- */

.works .section-head {
  padding-bottom: 14px;
  border-bottom: 0;
}

.works-list {
  border-top: 1px solid var(--border-subtle);
  margin-top: 8px;
}

.work {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.work:last-child {
  border-bottom: 0;
}

.work-index {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
}

.work-main {
  min-width: 0;
}

.work h3 {
  font-size: 18px;
  line-height: 1.45;
}

.work h3 a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.work-summary {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
}

.work-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 8px;
  font-size: 14px;
}

.work-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand-primary);
  font-weight: 600;
}

.work-authors {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Home: people ------------------------------------------------------------ */

.people-grid,
.member-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.person {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
}

.person h3 {
  font-size: 19px;
}

.person-role {
  margin: 0;
  color: var(--brand-primary);
  font-size: 14px;
  line-height: 1.45;
}

.person-dept {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.person .tags {
  margin-top: 2px;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  color: var(--brand-primary);
  font-size: 14px;
  font-weight: 600;
}

.profile-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-email {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand-primary);
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* Home: teaching ---------------------------------------------------------- */

.teaching-band {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 28px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-subtle);
}

.teaching-copy p {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 16px;
}

.teaching-links {
  display: grid;
  gap: 10px;
}

.teaching-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg-surface);
}

.teaching-link:hover {
  border-color: var(--border-strong);
}

.link-label {
  display: block;
  color: var(--brand-primary);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.link-note {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.4;
}

.link-arrow {
  color: var(--brand-primary);
  font-size: 18px;
}

/* Home: contact ----------------------------------------------------------- */

.contact-grid {
  display: block;
}

.contact-intro {
  max-width: 70ch;
}

.contact-lede {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 16px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.contact-address {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  background: var(--bg-footer);
  color: #E8EFE5;
  padding-block: 44px 24px;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 32px;
}

.footer-wordmark {
  color: var(--bg-surface);
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.footer-brand p {
  margin-top: 8px;
  color: #B9C8B7;
  font-size: 14px;
  line-height: 1.6;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0 14px;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #D5DFCB;
  font-size: 14px;
}

.footer-nav a:hover {
  color: var(--focus-ring);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid rgba(213, 217, 204, 0.2);
  color: #B9C8B7;
  font-size: 14px;
  line-height: 1.55;
}

.footer-copy {
  color: #A9BAA7;
}

/* Page heroes and subpage sections --------------------------------------- */

.page-hero {
  padding-block: 40px 28px;
  border-bottom: 1px solid var(--border-subtle);
}

.page-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.page-kicker strong {
  color: var(--brand-primary);
  font-weight: 600;
}

.page-lede {
  max-width: 70ch;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.page-section h2 {
  font-size: clamp(22px, 2vw, 26px);
}

.page-section > .shell > h2 + .section-intro,
.page-section > .shell > h2 + p {
  margin-top: 8px;
}

.anchor-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-block: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.anchor-bar a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--brand-primary);
  font-size: 14px;
  line-height: 1.35;
}

.anchor-bar a:hover {
  border-color: var(--brand-primary);
  background: var(--brand-tint);
}

.anchor-alias {
  display: block;
  height: 0;
  overflow: hidden;
}
section[id],
.project-teaser[id],
.project-card[id],
.pub-item[id] {
  scroll-margin-top: calc(var(--header-height) + 12px);
}


/* Projects page ----------------------------------------------------------- */

.project-group {
  padding-block: 32px;
  border-top: 1px solid var(--border-subtle);
  scroll-margin-top: calc(var(--header-height) + 12px);
}

.project-group:first-of-type {
  border-top: 0;
}

.project-group-head h2 {
  margin-top: 4px;
}

.project-group-head > p:last-child {
  max-width: 72ch;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

.project-subgroup {
  margin-top: 20px;
}

.project-subgroup h3,
.research-project-block h3,
.research-paper-block h3 {
  margin-bottom: 8px;
  color: var(--brand-primary);
  font-size: 18px;
}

.project-list {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.project-card {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
  scroll-margin-top: calc(var(--header-height) + 12px);
  overflow: hidden;
}

.project-card--text-only {
  grid-template-columns: 1fr;
}

.project-media {
  display: flex;
  flex-direction: column;
  margin: 0;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

.project-card--text-only .project-media {
  display: none;
}

.project-media img {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 200px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 50% 50%;
}

.project-media img.project-photo--case03 {
  aspect-ratio: 16 / 10;
  object-position: 50% 0%;
}

.project-media img.project-diagram {
  aspect-ratio: 16 / 10;
  object-fit: contain;
  padding: 8px;
  background: var(--bg-surface);
}

.project-media img.is-contain {
  object-fit: contain;
  padding: 12px;
  background: #FFFFFF;
}

.project-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 20px;
}

.project-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.project-direction-link {
  color: var(--text-muted);
  font-size: 14px;
}

.project-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.project-facts li {
  border: 0;
  padding: 0;
  background: none;
}

.project-facts li + li::before {
  content: "· ";
}

.fact-chip {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.project-title {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.project-summary {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

.project-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 14px;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand-primary);
  font-weight: 600;
}

.related-project-block {
  margin-top: 16px;
}

/* Research page ----------------------------------------------------------- */

.research-direction {
  padding-block: 32px;
  border-top: 1px solid var(--border-subtle);
  scroll-margin-top: calc(var(--header-height) + 12px);
}

.research-direction:first-of-type {
  border-top: 0;
}

.research-direction-head h2 {
  margin-top: 4px;
}

.research-direction-short {
  max-width: 72ch;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

.research-direction-top {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 18px;
}

.research-scene {
  margin: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.research-scene img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 50% 50%;
}

.research-scene img.photo-hand-grip {
  object-fit: contain;
  background: #FFFFFF;
  padding: 8px;
}

.research-body {
  min-width: 0;
}

.research-intro {
  display: grid;
  gap: 10px;
}

.research-intro h3 {
  color: var(--brand-primary);
}

.research-intro p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
}

.research-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 18px;
  align-items: start;
}

.research-project-block,
.research-paper-block {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
}

.research-project-list,
.research-paper-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.research-project-item a,
.research-paper-list li a {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg-page);
  color: var(--text-primary);
  text-decoration: none;
}

.research-project-item a:hover,
.research-paper-list li a:hover {
  border-color: var(--border-strong);
}

.research-project-title,
.research-paper-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.research-project-item a:hover .research-project-title,
.research-project-item a:focus-visible .research-project-title,
.research-paper-list li a:hover .research-paper-title,
.research-paper-list li a:focus-visible .research-paper-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.research-project-meta,
.research-paper-meta,
.research-paper-role {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
  text-decoration: none;
}

/* Publications page ------------------------------------------------------- */

.pub-group {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.pub-group:first-of-type {
  margin-top: 18px;
  padding-top: 0;
  border-top: 0;
}

.pub-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
}

.pub-group-head h2 {
  font-size: 22px;
}

.pub-group-head p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 14px;
}

.pub-group-head > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pub-list {
  margin-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.pub-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.pub-index {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 14px;
}

.pub-main h3 {
  font-size: 18px;
  line-height: 1.45;
}

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 14px;
}

.pub-authors {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.pub-summary {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 6px;
  font-size: 14px;
}

.pub-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand-primary);
  font-weight: 600;
}

/* About page -------------------------------------------------------------- */

.about-overview {
  display: grid;
  gap: 10px;
  max-width: 72ch;
}

.about-overview p {
  font-size: 16px;
  line-height: 1.7;
}

.official-links {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.official-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--brand-primary);
  font-size: 14px;
  font-weight: 600;
}

.official-link:hover {
  border-color: var(--border-strong);
}

.official-link span:last-child {
  color: var(--text-muted);
  font-weight: 400;
}

/* Contact page ------------------------------------------------------------ */

.contact-page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.contact-person {
  padding: 18px 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
}

.contact-person h3 {
  font-size: 19px;
}

.contact-person .person-role {
  margin-top: 4px;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand-primary);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.contact-person .profile-link {
  display: flex;
  width: 100%;
}

.detail-list {
  margin: 16px 0 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-list dt {
  color: var(--text-muted);
  font-size: 14px;
}

.detail-list dd {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
  overflow-wrap: anywhere;
}

/* Join page --------------------------------------------------------------- */

.join-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.join-card {
  padding: 18px 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
}

.join-card h3 {
  margin-top: 4px;
}

.join-card p:last-child {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.65;
}

.card-index {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.join-actions {
  margin-top: 18px;
}

.join-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  width: min(calc(100% - (var(--gutter) * 2)), var(--shell));
  margin-inline: auto;
}

.join-columns > .page-section {
  padding-block: var(--section-space);
}

.join-columns > .page-section .shell {
  width: 100%;
}

.material-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.material-list li {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg-surface);
}

.material-list strong {
  color: var(--brand-primary);
  font-size: 15px;
}

.material-list span {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

/* News and 404 ------------------------------------------------------------ */

.news-page .page-hero,
.error-page {
  padding-block: 28px 22px;
}

.empty-state {
  max-width: 640px;
  padding: 24px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
}

.empty-mark {
  color: var(--brand-primary);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.empty-state h2 {
  margin-top: 6px;
}

.empty-state p:not(.empty-mark) {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 16px;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 14px;
}

.empty-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.error-code {
  color: var(--brand-primary);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.error-page h1 {
  margin-top: 8px;
}

.error-page p {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 16px;
}

/* Figures and image semantics -------------------------------------------- */

figcaption {
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.caption-text,
.card-credit {
  display: inline;
}

.caption-kicker {
  display: inline;
  margin-right: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-weight: 500;
}

.card-credit {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.card-credit:not(:empty)::before {
  content: " · ";
}

.credit-link {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

img.photo-wireless-ap { object-fit: cover; object-position: 50% 58%; }
img.photo-antennas { object-fit: cover; object-position: 52% 42%; }
img.photo-thyroid { object-fit: cover; object-position: 50% 34%; }
img.photo-hand-grip { object-fit: contain; object-position: 50% 50%; background: #FFFFFF; padding: 8px; }
img.photo-mri-seg { object-fit: cover; object-position: 55% 48%; }
img.photo-mri-aging { object-fit: cover; object-position: 55% 50%; }

img.r6-image {
  object-fit: cover;
  object-position: 50% 50%;
}

img.r6-image[data-r6-fit-desktop="contain"],
img.r6-image[data-r6-fit-mobile="contain"] {
  object-fit: contain;
  background: #FFFFFF;
  padding: 10px;
}

img.r6-image[data-r6-pos-desktop="50% 52%"],
img.r6-image[data-r6-pos-mobile="50% 52%"] { object-position: 50% 52%; }
img.r6-image[data-r6-pos-desktop="50% 55%"],
img.r6-image[data-r6-pos-mobile="50% 55%"] { object-position: 50% 55%; }
img.r6-image[data-r6-pos-desktop="55% 50%"],
img.r6-image[data-r6-pos-mobile="55% 50%"] { object-position: 55% 50%; }

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1024px) {
  :root {
    --gutter: 24px;
    --section-space: 44px;
  }

  .header-inner {
    gap: 16px;
  }

  .primary-nav {
    gap: 2px 6px;
  }

  .direction-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .people-grid,
  .member-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-inner {
    gap: 28px;
  }

  .research-direction-top {
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 56px;
  }

  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    height: 100%;
  }

  .brand-mark {
    width: 32px;
    height: 36px;
    font-size: 20px;
  }

  .brand-text {
    font-size: 18px;
    letter-spacing: 0.06em;
  }

  .brand-sub {
    font-size: 11px;
  }

  .primary-nav--desktop,
  .header-actions .nav-teaching {
    display: none;
  }

  .nav-drawer {
    display: block;
  }

  .header-actions {
    gap: 4px;
  }

  .header-actions > a {
    padding-inline: 10px;
  }

  .primary-nav--drawer {
    position: absolute;
    top: var(--header-height);
    right: 0;
    left: 0;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: calc(100vh - var(--header-height));
    overflow: auto;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-strong);
    background: var(--bg-surface);
    box-shadow: 0 12px 24px rgba(20, 38, 30, 0.12);
  }

  .nav-drawer[open] .primary-nav--drawer {
    display: grid;
  }

  .primary-nav--drawer a {
    justify-content: flex-start;
    padding: 0 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    background: var(--bg-page);
    white-space: normal;
  }

  .primary-nav--drawer .drawer-teaching {
    justify-content: center;
    border-color: var(--border-strong);
    background: var(--brand-tint);
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-block: 28px 24px;
  }

  .direction-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-teaser-grid {
    gap: 16px;
  }

  .project-teaser-media img {
    height: 176px;
    max-height: 176px;
  }

  .research-direction-top {
    grid-template-columns: 1fr;
  }

  .research-scene img {
    aspect-ratio: 16 / 9;
  }

  .teaching-band {
    grid-template-columns: 1fr;
  }

  .contact-page-grid {
    grid-template-columns: 1fr;
  }

  .join-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .project-card {
    grid-template-columns: 1fr;
  }

  .project-media {
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .project-media img {
    aspect-ratio: 16 / 10;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 720px) {
  :root {
    --gutter: 16px;
    --section-space: 32px;
  }

  body {
    font-size: 16px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 17px;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-bottom: 16px;
  }

  .section-aside {
    font-size: 16px;
  }

  .direction-grid,
  .project-teaser-grid,
  .people-grid,
  .member-grid {
    grid-template-columns: 1fr;
  }

  .direction-grid {
    gap: 12px;
  }

  .direction-card-body {
    padding: 16px;
  }

  .project-teaser-media img {
    max-height: 176px;
  }

  .project-teaser-body {
    padding: 16px;
  }

  .project-teaser-foot {
    align-items: center;
  }

  .work {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    padding: 14px 0;
  }

  .work h3 {
    font-size: 17px;
  }

  .people-grid {
    gap: 12px;
  }

  .teaching-band {
    padding: 18px;
  }

  .contact-actions .button {
    width: 100%;
  }

  .footer-nav {
    gap: 0 12px;
  }

  .footer-nav a {
    min-height: 44px;
  }

  .page-hero {
    padding-block: 24px 18px;
  }

  .page-lede {
    margin-top: 8px;
  }

  .anchor-bar {
    gap: 6px;
    padding-block: 10px;
  }

  .anchor-bar a {
    flex: 1 1 calc(50% - 3px);
    justify-content: center;
    min-width: 0;
    padding-inline: 8px;
    text-align: center;
  }

  .project-group {
    padding-block: 24px;
  }

  .project-list {
    gap: 12px;
  }

  .project-content {
    padding: 16px;
  }

  .project-card--text-only .project-content {
    padding: 20px 16px;
  }

  .research-direction {
    padding-block: 24px;
  }

  .research-lists {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .research-project-block,
  .research-paper-block {
    padding: 12px;
  }

  .pub-item {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    padding: 14px 0;
  }

  .pub-main h3 {
    font-size: 17px;
  }

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

  .join-columns > .page-section {
    padding-block: 24px;
  }

  .detail-list > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .empty-state {
    padding: 18px;
  }

  .section-backtop {
    margin-top: 12px;
  }

  .back-top-pill {
    min-height: 44px;
  }
}

@media (max-width: 430px) {
  .brand-sub {
    display: none;
  }

  .header-actions > a {
    padding-inline: 8px;
  }

  .nav-toggle {
    padding-inline: 10px;
  }

  .primary-nav--drawer {
    grid-template-columns: 1fr;
  }

  .hero-statement {
    font-size: 24px;
  }

  .en-home .hero-statement {
    font-size: 22px;
  }

  .footer-note {
    display: block;
  }

  .footer-copy {
    display: block;
    margin-top: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .site-header,
  .footer-nav,
  .anchor-bar,
  .hero-actions,
  .section-backtop {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
