/*-- scss:defaults --*/

$theme: "drwater" !default;

//
// Color system
//

$white: #ffffff !default;
$gray-100: #f8f9fa !default;
$gray-200: #e9ecef !default;
$gray-300: #dee2e6 !default;
$gray-400: #ced4da !default;
$gray-500: #adb5bd !default;
$gray-600: #868e96 !default;
$gray-700: #495057 !default;
$gray-800: #373a3c !default;
$gray-900: #212529 !default;
$black: #000000 !default;

$blue: #2780e3 !default;
$indigo: #6610f2 !default;
$purple: #170c3a !default;
$pink: #a52c60 !default;
$red: #cf4446 !default;
$orange: #ee6a24 !default;
$light-orange: #fb9e07 !default;
$yellow: #f6d645 !default;
$green: #118230 !default;
$teal: #20c997 !default;
$cyan: #3093cf !default;

$primary: $pink !default;
$secondary: $gray-700 !default;
$success: $green !default;
$info: $cyan !default;
$warning: $orange !default;
$danger: $red !default;
$light: $gray-400 !default;
$dark: $black !default;

// $min-contrast-ratio: 2.6 !default;

// Fonts

$font-family-sans-serif: "Libre Franklin" !default;

$headings-font-family: "Jost" !default;
$headings-font-weight: 600 !default;

$navbar-font-family: "Jost" !default;
$toc-font-family: "Jost" !default;
$footer-font-family: "Jost" !default;

// $font-size-base: 1.1rem !default; // Assumes the browser default, typically `16px`
// $font-size-sm: $font-size-base * .875 !default;

// Body
$body-color: $gray-900 !default;

// Links
$link-color: $orange !default;
$link-decoration: none !default;
$link-hover-color: $red !default;
$link-hover-decoration: underline !default;

// Inline code
$code-bg: $gray-200 !default;
$code-color: $gray-900 !default;

// Code copy
$btn-code-copy-color-active: $orange !default;

// TOC
$toc-color: $orange;
$toc-font-size: 1em;

// Navbar
$navbar-bg: $purple !default;
$navbar-fg: $white !default;
$navbar-hl: $light-orange !default;

// Footer
$footer-bg: #102a43 !default;
$footer-fg: #dbecef !default;

/*-- scss:rules --*/

$web-font-path: "https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,100..900;1,100..900&family=Libre+Franklin:ital,wght@0,100..900;1,100..900&display=swap" !default;

@if $web-font-path {
  @import url($web-font-path);
}

body {
  -webkit-font-smoothing: antialiased;
}

.rtl {
  direction: rtl;
}

.home {
  .quarto-title-banner {
    margin-bottom: 0;
  }

}

.home-hero {
  position: relative;
  overflow: hidden;
  margin: 1.5rem 0 1.25rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid rgba($purple, 0.12);
  border-left: 4px solid $purple;
  border-radius: 0.55rem;
  background:
    radial-gradient(circle at 82% 18%, rgba(96, 203, 195, 0.3), transparent 34%),
    radial-gradient(circle at 12% 92%, rgba(74, 128, 190, 0.24), transparent 38%),
    linear-gradient(135deg, #102a43 0%, #173d5a 54%, #145267 100%);
  color: $white;
  box-shadow: 0 0.5rem 1.4rem rgba($purple, 0.1);

  &::after {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.18) 0 1px, transparent 1.5px);
    background-size: 3.2rem 3.2rem;
    content: "";
    opacity: 0.18;
    pointer-events: none;
  }

  > * { position: relative; z-index: 1; }

  .home-kicker {
    margin: 0 0 0.65rem;
    color: #d8cbe4;
    font-family: $headings-font-family;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
  }

  h1,
  h2 {
    max-width: 32rem;
    margin: 0 0 0.8rem;
    color: $white;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.08;
  }

  p:not(.home-kicker) {
    max-width: 42rem;
    font-size: 1.02rem;
    opacity: 0.88;
  }

  .home-actions { margin: 1.4rem 0 0; }
  .btn { margin-right: 0.45rem; margin-bottom: 0.4rem; }
  .btn-primary { background: #e6ddea; border-color: #e6ddea; color: $purple; }
  .btn-outline-secondary { border-color: rgba($white, 0.58); color: $white; }
}

.home-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(22rem, 0.9fr);
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 2rem;

  > .home-hero,
  > .home-latest-panel { min-height: 0; }

  .home-hero {
    margin: 0;
  }

  .home-latest-panel {
    display: flex;
    min-width: 0;
    min-height: 100%;
    flex-direction: column;
  }

  > section {
    max-height: 31rem;
    overflow: hidden;
  }

  .home-latest-panel .home-carousel {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
  }

  .home-latest-panel .home-carousel-track { height: 100%; }

  .home-latest-panel .home-carousel-slide {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  h3, h4 {
    margin-top: 0.75rem;
  }
}

.home-latest {
  margin: 0.5rem 0 0;
  overflow: hidden;

  .blog,
  .project-list ul {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    gap: 0.85rem;
    margin: 0;
    padding: 0.2rem 0.2rem 0.8rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-color: $gray-400 transparent;
  }

  .blog-entry,
  .project-list li.project {
    min-width: 0;
    margin: 0;
    scroll-snap-align: start;
  }

  .project-list li.project {
    max-height: 15rem;
    overflow: auto;
  }
}

.home-latest-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.35rem 0 0.65rem;
  color: $purple;
  font-family: $headings-font-family;
  font-size: 1.15rem;
  font-weight: 600;

  nav {
    display: flex;
    gap: 0.7rem;
    font-size: 0.78rem;
    font-weight: 400;

    a {
      color: $gray-600;
      text-decoration: none;

      &:hover,
      &:focus-visible {
        color: $purple;
        text-decoration: underline;
        text-underline-offset: 0.15em;
      }
    }
  }
}

.home-carousel-list {
  display: contents;
}

.home-carousel-slide {
  display: flex;
  position: relative;
  grid-area: 1 / 1;
  min-height: 18.5rem;
  flex-direction: column;
  padding: 1.35rem 1.4rem;
  border: 1px solid rgba($purple, 0.14);
  border-top: 4px solid $purple;
  border-radius: 0.8rem;
  background: linear-gradient(145deg, #ffffff 0%, #f7f4f9 100%);
  box-shadow: 0 0.8rem 1.8rem rgba($purple, 0.1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;

  &::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba($purple, 0.94) 0%, rgba($purple, 0.66) 48%, rgba($black, 0.5) 100%);
    content: "";
    opacity: 0;
    transition: opacity 200ms ease;
  }

  &.has-media {
    overflow: hidden;
    border-color: rgba(23, 12, 58, 0.28);
    background-color: #170c3a;
    background-position: center;
    background-size: cover;
    color: #fff;

    &::before {
      z-index: 1;
      background: linear-gradient(135deg, rgba(23, 12, 58, 0.9) 0%, rgba(23, 12, 58, 0.58) 48%, rgba(0, 0, 0, 0.55) 100%);
      opacity: 1;
      transition: opacity 220ms ease;
    }

    .home-carousel-content,
    .home-carousel-eyebrow,
    .home-carousel-title,
    .home-carousel-description,
    .home-carousel-link {
      position: relative;
      z-index: 2;
      color: #fff;
    }

    .home-carousel-content { position: static; }

    .home-carousel-title a,
    .home-carousel-link {
      color: #fff;
    }

    .home-carousel-link {
      display: inline-block;
      align-self: flex-start;
      position: absolute !important;
      bottom: .55rem !important;
      left: 1.4rem;
      margin-top: 0;
      padding: .35rem .65rem;
      border-radius: .45rem;
      background: transparent;
      text-shadow: 0 1px .2rem rgba(#102a43, .8);
    }

    .home-carousel-eyebrow { color: rgba(255, 255, 255, 0.78); }
    .home-carousel-description { color: rgba(255, 255, 255, 0.9); }
  }

  .home-carousel:not(.is-enhanced) &.home-carousel-slide:first-child {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  &.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  &:hover,
  &:focus-within {
    transform: translateY(-2px);
    border-color: $purple;
    box-shadow: 0 1rem 2rem rgba($purple, 0.16);
  }

  &.has-media:hover {
    &::before { opacity: 0.12; }
    .home-carousel-content { opacity: 1; }
    .home-carousel-content > :not(.home-carousel-link) { opacity: 0; }
    .home-carousel-content .home-carousel-link { opacity: 1; color: #fff !important; background: transparent; text-shadow: 0 1px .2rem rgba(#102a43, .98), 0 0 .45rem rgba(#102a43, .95), 0 0 1rem rgba(#771c6d, .82); }
  }

  &.has-media:focus-within {
    &::before { opacity: 0.12; }
    .home-carousel-content { opacity: 1; }
    .home-carousel-content > :not(.home-carousel-link) { opacity: 0.32; }
    .home-carousel-content .home-carousel-link { opacity: 1; color: #fff !important; background: transparent; text-shadow: 0 1px .2rem rgba(#102a43, .98), 0 0 .45rem rgba(#102a43, .95), 0 0 1rem rgba(#771c6d, .82); }
  }
}

.home-carousel-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-carousel {
  position: relative;
  overflow: hidden;

  .home-carousel-track {
    display: grid;
  }
}

.home-carousel-content {
  display: flex;
  min-height: 15rem;
  flex-direction: column;
  transition: opacity 220ms ease;
}

.home-carousel-controls {
  position: absolute;
  right: 0;
  bottom: 1rem;
  left: 0;
  z-index: 4;
  display: flex;
  justify-content: center;
  pointer-events: none;

  .home-carousel-dots {
    display: flex;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba($white, 0.45);
    border-radius: 999px;
    background: rgba($black, 0.28);
    backdrop-filter: blur(8px);
    pointer-events: auto;
  }

  .home-carousel-dot {
    width: 0.65rem;
    height: 0.65rem;
    padding: 0;
    border: 1px solid rgba($white, 0.9);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease;

    &:hover,
    &:focus-visible { transform: scale(1.2); }
    &.is-active { background: $white; }
  }
}

.home-carousel-eyebrow {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: $gray-600;
  font-family: $headings-font-family;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-carousel-title {
  margin: 1.1rem 0 0.65rem;
  color: $purple;
  font-family: $headings-font-family;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.3;

  a {
    color: inherit;
    text-decoration: none;

    &:hover,
    &:focus-visible {
      color: $purple;
      text-decoration: underline;
      text-underline-offset: 0.15em;
    }
  }
}

.home-carousel-reference {
  display: -webkit-box;
  overflow: hidden;
  max-height: 4.3rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 0.92rem;
  line-height: 1.5;
  font-weight: 400;
  text-overflow: ellipsis;
}

.home-carousel-description {
  margin: 0;
  color: $gray-700;
  font-size: 0.92rem;
  line-height: 1.55;
}

.home-carousel-link {
  margin-top: 0.9rem;
  padding-top: 0.25rem;
  color: $purple;
  font-family: $headings-font-family;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

// The hero is the homepage's single primary entry point; avoid a duplicate
// Quarto title strip above it.
.home #title-block-header,
body:has(.home-hero) #title-block-header {
  display: none !important;
}

.home-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 2.5rem;

  .home-pillar {
    padding: 1.1rem 1.2rem;
    border: 1px solid $gray-200;
    border-top: 4px solid $orange;
    border-radius: 0.65rem;
    background: $white;
    box-shadow: 0 0.35rem 1rem rgba($black, 0.05);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;

    &:hover,
    &:focus-within {
      transform: translateY(-2px);
      border-color: $purple;
      box-shadow: 0 0.6rem 1.2rem rgba($black, 0.09);
    }
  }
}

.home-positioning {
  max-width: 58rem;
  margin: 0.25rem 0 2rem;
  color: $gray-600;
  font-size: 0.98rem;
  line-height: 1.65;
}

// Team pages use one calm, editorial card system for every role and language.
.team-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
  counter-reset: team-section;

  .team-group-photo {
    width: 100%;
    margin: 0 0 2.2rem;
    overflow: hidden;
    border: 1px solid $gray-200;
    border-radius: 1rem;
    background: #eef3f5;
    box-shadow: 0 0.6rem 1.8rem rgba($purple, 0.08);
  }

  .team-group-photo img { display: block; width: 100%; max-height: 24rem; object-fit: cover; object-position: center; }

  // Empty role listings should not leave a heading or an empty block behind.
  > section:has(> .quarto-listing):not(:has(.team-card)) { display: none; }
  ~ #TOC li:has(a[href="#博士后"]),
  ~ #TOC li:has(a[href="#postdoctoral-fellows"]) { display: none; }

  > section {
    counter-increment: team-section;
    margin-top: 2.35rem;
  }

  > section > h2,
  > section > h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1.1rem;
    color: $purple;
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    letter-spacing: 0.01em;
  }

  > section > h2::before,
  > section > h3::before {
    display: inline-grid;
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid rgba($teal, 0.42);
    border-radius: 0.65rem;
    background: rgba($teal, 0.1);
    color: darken($teal, 18%);
    content: counter(team-section, decimal-leading-zero);
    font-family: $headings-font-family;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
  }

  > h2 {
    margin: 0 0 0.35rem;
    color: $purple;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
  }

  > p { max-width: 48rem; color: $gray-600; }

  .team-section {
    margin: 2.5rem 0 0;
    padding: clamp(1.15rem, 2.5vw, 2rem);
    border: 1px solid $gray-200;
    border-radius: 1rem;
    background: $white;
    box-shadow: 0 0.6rem 1.8rem rgba($purple, 0.06);

    > h2, > h3 {
      margin: 0 0 1.1rem;
      color: $purple;
      font-size: 1.2rem;
      letter-spacing: 0.01em;
    }

    > p { color: $gray-600; }
  }

  .team-current { background: #fbfafc; }
  .team-alumni-section { background: #f7f8f9; }

  .team-listing { margin: 0; }

  // Do not stretch every card to the tallest item in its CSS-grid row.
  // This is especially noticeable when alumni have different-length bios.
  .team-listing .list { align-items: start; }

  .team-card {
    min-width: 0;
    transition: transform 180ms ease, filter 180ms ease;

    &:hover,
    &:focus-within {
      transform: translateY(-4px);
      filter: drop-shadow(0 0.7rem 1rem rgba($purple, 0.14));
    }
  }

  .team-card-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
  }

  .team-card .card {
    overflow: hidden;
    height: 100%;
    border: 1px solid $gray-200;
    border-radius: 0.8rem;
    background: $white;
    transition: border-color 180ms ease, box-shadow 180ms ease;
  }

  .team-card:hover .card,
  .team-card:focus-within .card { border-color: $teal; box-shadow: 0 0 0 3px rgba($teal, 0.12); }

  .team-card-image {
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #eef0f2;
  }

  .team-card-image .listing-box-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #eef0f2;
    transition: transform 320ms ease;
  }

  .team-card:hover .listing-box-image,
  .team-card:focus-within .listing-box-image { transform: scale(1.035); }

  .team-card-body {
    position: relative;
    min-height: 0;
    padding: 1rem 2.25rem 1rem 1.1rem;
  }

  .team-card-name {
    margin: 0;
    color: $gray-900;
    font-family: $headings-font-family;
    font-size: clamp(0.82rem, 1.55vw, 1.03rem);
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -0.015em;
    white-space: nowrap;
  }

  .team-card-role,
  .team-card-education {
    margin-top: 0.38rem;
    color: $gray-600;
    font-size: 0.82rem;
    line-height: 1.45;
  }

  .team-card-arrow {
    position: absolute;
    right: 0.85rem;
    bottom: 0.8rem;
    display: grid;
    width: 1.65rem;
    height: 1.65rem;
    place-items: center;
    border: 1px solid rgba(#5fc7c1, 0.45);
    border-radius: 50%;
    background: rgba(#5fc7c1, 0.12);
    color: #145267;
    font-size: 0.9rem;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
  }

  .team-card:hover .team-card-arrow,
  .team-card:focus-within .team-card-arrow { transform: translateX(2px); background: #5fc7c1; color: #102a43; }
}

@media (min-width: map-get($grid-breakpoints, xl)) {
  .team-page .team-listing .list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: map-get($grid-breakpoints, md)) {
  .home-pillars { grid-template-columns: 1fr; }

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

  .quarto-listing-container-grid .listing-box-image {
    height: 230px;
  }

  .home-carousel-slide {
    min-height: 16rem;
  }
}

#title-block-header {
  &.home {
    margin-block-end: 0.5rem;
  }
}

// Keep primary section pages on the same readable measure as the homepage.
body:not(.floating):not(.dashboard) .page-columns {
  max-width: 100%;
}

body:has(.home-feature) main.content > .grid {
  max-width: 1100px;
  margin-inline: auto;
}

.research,
.blog,
.outcome {
  max-width: 900px;
  margin-inline: auto;
}

// Outcome listings use the same two-column reading rhythm as publications:
// descriptive content on the left and a quiet visual rail on the right.
body:has(.outcome-list) .outcome-list li.outcome-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 36%);
  grid-template-areas: "body logo";
  align-items: stretch;
  column-gap: 1rem;
  row-gap: .8rem;
  min-height: 15rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
}
body:has(.outcome-list) .outcome-list .outcome-entry .body { grid-area: body; min-width: 0; }
body:has(.outcome-list) .outcome-list .outcome-entry .logo { grid-area: logo; min-height: 11rem; padding-left: 1rem; border-left: 1px solid $gray-200; }
body:has(.outcome-list) .outcome-list .outcome-entry .logo img { max-height: 13rem; }
body:has(.outcome-list) .outcome-list .outcome-title { margin: 0 0 .45rem; font-size: clamp(1.05rem, 1.8vw, 1.3rem); line-height: 1.25; }
body:has(.outcome-list) .outcome-list .outcome-title a { color: $gray-900; text-decoration: none; }
body:has(.outcome-list) .outcome-list .outcome-title a:hover,
body:has(.outcome-list) .outcome-list .outcome-title a:focus-visible { color: #145267; text-decoration: underline; text-underline-offset: .16em; }
body:has(.outcome-list) .outcome-list .outcome-description { margin: 0 0 .7rem; color: $gray-600; font-size: .9rem; line-height: 1.45; }
body:has(.outcome-list) .outcome-list .outcome-details { margin: 0 0 .6rem; color: $gray-600; font-size: .9rem; line-height: 1.4; }
body:has(.outcome-list) .outcome-list ul.outcome-authors { margin: auto 0 0; }
body:has(.outcome-list) .outcome-list ul.outcome-authors li { border: 1px solid rgba(#5fc7c1, .38); border-radius: 999px; background: rgba(#5fc7c1, .12); color: #145267; }
body:has(.outcome-list) .outcome-list ul.outcome-authors li a { color: #145267; }
@media (max-width: 767.98px) {
  body:has(.outcome-list) .outcome-list li.outcome-entry { grid-template-columns: 1fr; grid-template-areas: "logo" "body"; min-height: 0; }
  body:has(.outcome-list) .outcome-list .outcome-entry .logo { min-height: 10rem; padding: 0 0 1rem; border-right: 0; border-bottom: 1px solid $gray-200; border-left: 0; }
}

.publication-listing-main { min-width: 0; }

.publication-ga {
  display: flex;
  flex: 0 0 clamp(11rem, 30%, 18rem);
  align-items: center;
  justify-content: center;
  min-height: 7rem;
  padding: 0.55rem;
  border-left: 1px solid $gray-200;
  background: #fbfcfc;
}

.publication-ga img { display: block; width: 100%; max-height: 9rem; object-fit: contain; }

.drwater-interactions {
  max-width: 900px;
  margin: 3rem auto 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid $gray-200;
  border-radius: 1rem;
  background: rgba($white, 0.62);
  backdrop-filter: blur(10px) saturate(115%);
}
.drwater-interaction-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.drwater-interaction-actions button { border: 1px solid rgba(#5fc7c1, .45); border-radius: 999px; padding: .5rem .85rem; background: rgba(#5fc7c1, .1); color: #145267; font: inherit; cursor: pointer; transition: background 180ms ease, border-color 180ms ease, transform 180ms ease; }
.drwater-interaction-actions button:hover, .drwater-interaction-actions button:focus-visible, .drwater-interaction-actions button.is-liked { border-color: #5fc7c1; background: rgba(#5fc7c1, .25); transform: translateY(-2px); }
.drwater-interaction-actions em { font-style: normal; }
.drwater-comments { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid rgba(#5fc7c1, .25); color: #52656b; font-size: .88rem; }
.drwater-comments p { margin: .35rem 0 0; }
.drwater-comments-mount { position: relative; z-index: 5; width: 100%; min-width: 0; pointer-events: auto; }
.drwater-comments-mount * { pointer-events: auto; }
.author-profile-link { color: inherit !important; font: inherit !important; letter-spacing: inherit; text-decoration: none; }
.author-profile-link:hover, .author-profile-link:focus-visible { color: inherit !important; text-decoration: underline; text-decoration-color: #5fc7c1; text-underline-offset: .15em; text-shadow: 0 0 .65rem rgba(#5fc7c1, .75); }
.drwater-meta-summary { width: 100%; max-width: 900px; margin: 1rem auto 1.25rem; color: #496273; font-size: .9rem; line-height: 1.5; }
// News title banners span the full article shell; keep the author/date row on
// that same measure instead of applying the narrower publication default.
body:has(.blog-post) #title-block-header > .drwater-meta-summary {
  width: 100%;
  max-width: none;
  margin-right: 0;
  margin-left: 0;
  box-sizing: border-box;
}
.drwater-meta-row { display: flex; align-items: baseline; gap: .65rem; min-width: 0; margin: .35rem 0; text-align: left; }
.drwater-meta-details { flex-wrap: wrap; gap: .35rem .65rem; }
.drwater-meta-doi-link { display: inline-flex; align-items: center; gap: .28rem; color: inherit !important; text-decoration: none; }
.drwater-meta-doi-link img { width: 1rem; height: 1rem; }
.drwater-meta-doi-link:hover, .drwater-meta-doi-link:focus-visible { color: inherit !important; text-decoration: underline; text-underline-offset: .15em; }
.drwater-meta-label { flex: 0 0 auto; min-width: 3.2rem; color: #145267; font-weight: 650; }
.drwater-meta-value { min-width: 0; overflow-wrap: anywhere; }
.drwater-meta-doi .drwater-meta-label { display: inline-flex; align-items: center; gap: .3rem; }
.drwater-meta-doi .drwater-meta-label img { width: 1rem; height: 1rem; }
.drwater-meta-doi a { color: #145267; text-decoration-color: rgba(#5fc7c1, .65); }
.drwater-meta-authors a { color: inherit !important; text-decoration: none; }
.drwater-meta-authors a:hover, .drwater-meta-authors a:focus-visible { color: inherit !important; text-decoration: underline; text-decoration-color: #5fc7c1; text-underline-offset: .15em; text-shadow: 0 0 .65rem rgba(#5fc7c1, .75); }
@media (max-width: 767.98px) { .drwater-meta-summary { margin-top: .8rem; } .drwater-meta-row { gap: .45rem; } }
@media (min-width: 992px) {
  #quarto-margin-sidebar .drwater-interactions { position: sticky; top: 5rem; width: 100%; max-width: 18rem; margin: 0 0 1rem; padding: .8rem; }
  #quarto-margin-sidebar .drwater-comments { margin-top: 0; padding-top: 0; border-top: 0; }
  #quarto-margin-sidebar .drwater-comments-mount { min-width: 0; width: 100%; }
}
@media (max-width: 991.98px) { .drwater-interactions { width: 100%; max-width: 900px; } }

// Wide graphical abstracts become an editorial banner on article pages.
.publication-ga-hero {
  position: relative;
  display: flex;
  width: min(100%, 760px);
  align-items: center;
  justify-content: center;
  max-height: 19rem;
  min-height: 13rem;
  margin: 1.2rem auto 2rem;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  padding: .35rem;
  background: transparent;
  box-shadow: none;
}
.publication-ga-hero::after {
  display: none;
}
.publication-ga-hero-accessible {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 18rem;
  object-fit: contain;
  border-radius: .85rem;
}
.publication-abstract-layout {
  display: block;
  margin: 1.25rem 0 2rem;
}
.publication-abstract-layout > section { display: block !important; min-width: 0; margin: 0; }
.publication-abstract-layout .publication-ga-hero { float: right; width: min(42%, 32rem); margin: 0 0 1rem 1.4rem; }
.publication-abstract-layout::after { display: table; clear: both; content: ""; }
@media (max-width: 799px) { .publication-abstract-layout .publication-ga-hero { float: none; width: 100%; margin: 0 auto 1rem; } }

.drwater-gallery {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 1.5rem auto 2rem;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.drwater-gallery-track { display: flex !important; width: 100%; transition: transform 360ms ease; }
.drwater-gallery-slide { position: relative; display: block !important; flex: 0 0 100% !important; width: 100%; min-width: 100%; padding: .35rem .5rem .2rem; }
.drwater-gallery-slide:not(.is-active) { visibility: hidden; pointer-events: none; }
.drwater-gallery-slide figure { position: relative; display: block !important; width: 100%; margin: 0; text-align: center; }
.drwater-gallery-slide img { display: inline-block; width: 100%; height: 24rem; max-width: 100%; max-height: 36rem; object-fit: contain; border-radius: .85rem; }
.drwater-gallery-slide figcaption { position: absolute !important; right: auto; bottom: .85rem; left: 50%; z-index: 2; width: 90%; max-width: 90%; box-sizing: border-box; margin: 0 !important; padding: .35rem .6rem !important; color: $white !important; font-size: .8rem; line-height: 1.4; text-align: center; background: transparent !important; border: 0; border-radius: 0; box-shadow: none; text-shadow: 0 1px .2rem rgba(#102a43, .95), 0 0 .7rem rgba(#102a43, .8); transform: translateX(-50%); }
.drwater-gallery-controls { display: flex; justify-content: center; padding: .35rem .6rem .65rem; }
.drwater-gallery-dots { display: flex; gap: .38rem; }
.drwater-gallery-dot { width: .52rem; height: .52rem; padding: 0; border: 1px solid #5fc7c1; border-radius: 50%; background: transparent; cursor: pointer; }
.drwater-gallery-dot.is-active { background: #5fc7c1; box-shadow: 0 0 0 3px rgba(#5fc7c1, .14); }
.drwater-gallery-arrow { position: absolute; top: 50%; z-index: 3; width: 2.2rem; height: 2.2rem; padding: 0; border: 1px solid rgba($white, .3); border-radius: 50%; color: rgba($white, .62); background: rgba(#102a43, .16); font-size: 1.7rem; line-height: 1; cursor: pointer; transform: translateY(-50%); backdrop-filter: blur(4px); }
.drwater-gallery-arrow:hover, .drwater-gallery-arrow:focus-visible { background: rgba(#145267, .86); }
.drwater-gallery-arrow-previous { left: .7rem; }
.drwater-gallery-arrow-next { right: .7rem; }
.drwater-gallery-slide img { cursor: zoom-in; }
.drwater-gallery:fullscreen { display: flex; width: 100vw; height: 100vh; max-width: none; margin: 0; flex-direction: column; justify-content: center; background: rgba(#102a43, .12); backdrop-filter: blur(18px) saturate(120%); }
.drwater-gallery::backdrop { background: rgba(#102a43, .06); backdrop-filter: blur(12px); }
.drwater-gallery:fullscreen .drwater-gallery-track { flex: 1 1 auto; align-items: center; }
.drwater-gallery:fullscreen .drwater-gallery-slide img { height: calc(100vh - 5rem); max-height: calc(100vh - 5rem); border-radius: 0; cursor: zoom-out; }
.drwater-gallery:fullscreen .drwater-gallery-slide figcaption { top: auto; right: auto; bottom: 1.5rem; left: 50%; width: 90%; max-width: 90%; text-align: center; background: transparent !important; border: 0; border-radius: 0; backdrop-filter: none; transform: translateX(-50%); }
main.content img:fullscreen { width: 100vw; height: 100vh; max-width: none; max-height: none; object-fit: contain; background: rgba(#102a43, .12); backdrop-filter: blur(14px); cursor: zoom-out; }
main.content img::backdrop { background: rgba(#102a43, .06); backdrop-filter: blur(12px); }

// Keep outcome-detail captions attached to their image instead of Quarto's
// margin column, which would collide with the desktop Artalk sidebar.
body:has(#title-block-header.quarto-title-block.research .project-details) main.content figure:not(.drwater-gallery-slide figure) {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1.25rem 0;
  text-align: center;
  box-sizing: border-box;
}
body:has(#title-block-header.quarto-title-block.research .project-details) main.content figure.page-full,
body:has(#title-block-header.quarto-title-block.research .project-details) main.content .quarto-figure.page-full { width: 100% !important; max-width: 100% !important; margin-right: 0 !important; margin-left: 0 !important; }
body:has(#title-block-header.quarto-title-block.research .project-details) main.content figure:not(.drwater-gallery-slide figure) img { display: inline-block; width: auto; max-width: 100% !important; height: auto; }
body:has(#title-block-header.quarto-title-block.research .project-details) main.content figure:not(.drwater-gallery-slide figure) figcaption {
  position: absolute !important;
  right: auto;
  bottom: .75rem;
  left: 50%;
  max-width: 88%;
  margin: 0 !important;
  padding: .3rem .55rem !important;
  color: $white !important;
  text-align: center;
  background: transparent !important;
  border: 0;
  box-shadow: none;
  text-shadow: 0 1px .2rem rgba(#102a43, .95), 0 0 .7rem rgba(#102a43, .8);
  transform: translateX(-50%);
}

// News figures should keep captions with the image instead of placing them in
// Quarto's right margin column (where they can collide with Artalk).
body:has(#title-block-header.quarto-title-block.default.blog-post) main.content figure:not(.drwater-gallery-slide figure) {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1.25rem 0;
  text-align: center;
  box-sizing: border-box;
}
body:has(#title-block-header.quarto-title-block.default.blog-post) main.content .quarto-figure.page-full { width: 100% !important; max-width: 100% !important; margin-right: 0 !important; margin-left: 0 !important; }
body:has(#title-block-header.quarto-title-block.default.blog-post) main.content figure:not(.drwater-gallery-slide figure) p { margin: 0; text-align: center; }
body:has(#title-block-header.quarto-title-block.default.blog-post) main.content figure:not(.drwater-gallery-slide figure) img { display: inline-block; width: auto; max-width: 100% !important; height: auto; }
body:has(#title-block-header.quarto-title-block.default.blog-post) main.content figure:not(.drwater-gallery-slide figure) figcaption {
  position: absolute !important;
  right: auto;
  bottom: .75rem;
  left: 50%;
  z-index: 2;
  width: 90% !important;
  max-width: 90% !important;
  margin: 0 !important;
  padding: .3rem .55rem !important;
  color: $white !important;
  text-align: center;
  background: transparent !important;
  border: 0;
  box-shadow: none;
  text-shadow: 0 1px .2rem rgba(#102a43, .95), 0 0 .7rem rgba(#102a43, .8);
  transform: translateX(-50%);
}
@media (prefers-reduced-motion: reduce) { .drwater-gallery-track { transition: none; } }
@media (max-width: 799px) {
  .publication-ga-hero { width: 100%; max-height: 13rem; margin-block: .9rem 1.5rem; padding: .55rem; border-radius: .8rem; }
  .publication-ga-hero-accessible { max-height: 12rem; }
}

@media (min-width: 992px) {
  body:has(.blog-post) #title-block-header .quarto-title-banner {
    position: relative;
    left: -2rem;
    width: calc(100% + 4rem);
    padding-left: 1rem;
    padding-right: 1.5rem;
  }
  body:has(.blog-post) #title-block-header .title { font-size: clamp(1.5rem, 3vw, 2.35rem); }
}

// Detail-page tools stay quiet and compact in the title area's upper-right.
.drwater-title-tools-host { position: relative; }
.drwater-category-tools-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.drwater-interaction-actions-top {
  position: static;
  z-index: 2;
  gap: .35rem;
  justify-content: flex-end;
}
.drwater-interaction-actions-top button {
  padding: .26rem .5rem;
  border-color: rgba(#5fc7c1, .3);
  background: rgba($white, .42);
  color: rgba(#145267, .78);
  font-size: .76rem;
  line-height: 1.2;
  box-shadow: none;
  backdrop-filter: blur(8px) saturate(110%);
}
.drwater-interaction-actions-top button:hover,
.drwater-interaction-actions-top button:focus-visible,
.drwater-interaction-actions-top button.is-liked {
  background: rgba(#5fc7c1, .14);
  border-color: rgba(#5fc7c1, .58);
  box-shadow: 0 2px 8px rgba(#102a43, .08);
  transform: none;
}
@media (max-width: 799px) {
  .drwater-interaction-actions-top {
    position: static;
    margin: .35rem 0 .75rem;
    justify-content: flex-start;
  }
}

// End-of-file interaction contract: all content cards share one waterline.
:is(.project-list li.project, .outcome-entry, .service-card, .team-card .card, .home-pillar, .news-card, .listing-box:not(.team-card)) {
  border-color: #e2eaec !important;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease !important;
}

:is(.project-list li.project, .outcome-entry, .service-card, .team-card .card, .home-pillar, .news-card, .listing-box:not(.team-card)):hover,
:is(.project-list li.project, .outcome-entry, .service-card, .team-card .card, .home-pillar, .news-card, .listing-box:not(.team-card)):focus-within {
  border-color: #5fc7c1 !important;
  background-color: rgba($white, 0.72) !important;
  box-shadow: 0 0.7rem 1.4rem rgba(#102a43, 0.12), 0 0 0 3px rgba(#5fc7c1, 0.1) !important;
  transform: translateY(-3px);
  backdrop-filter: blur(9px) saturate(115%);
}

body:has(.blog) .blog-entry {
  border-color: #e2eaec !important;
  background-color: rgba($white, 0.72) !important;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease !important;
}

body:has(.blog) .blog-entry:hover,
body:has(.blog) .blog-entry:focus-within {
  border-color: #5fc7c1 !important;
  background-color: rgba($white, 0.72) !important;
  box-shadow: 0 0.7rem 1.4rem rgba(#102a43, 0.12), 0 0 0 3px rgba(#5fc7c1, 0.1) !important;
  transform: translateY(-3px);
  backdrop-filter: blur(9px) saturate(115%);
}

body:has(.blog) .blog-entry .post-category:hover,
body:has(.blog) .blog-entry .post-category:focus-visible {
  border-color: #5fc7c1 !important;
  background: rgba(#5fc7c1, 0.16) !important;
  color: #145267 !important;
  text-decoration: none;
}

// Shared hover treatment for the site's content cards.
:where(.service-card, .team-card .card, .project, .outcome-card, .home-pillar, .news-card, .listing-box:not(.team-card)) {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

:where(.service-card, .team-card .card, .project, .outcome-card, .home-pillar, .news-card, .listing-box:not(.team-card)):hover,
:where(.service-card, .team-card .card, .project, .outcome-card, .home-pillar, .news-card, .listing-box:not(.team-card)):focus-within {
  border-color: #5fc7c1 !important;
  background-color: rgba($white, 0.78);
  box-shadow: 0 0.7rem 1.4rem rgba(#102a43, 0.12), 0 0 0 3px rgba(#5fc7c1, 0.1);
  transform: translateY(-3px);
  backdrop-filter: blur(8px) saturate(110%);
}

@media (max-width: map-get($grid-breakpoints, md)) {
  .publication-ga { flex-basis: 9rem; }
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 2rem;
}

.service-page {
  max-width: 900px;
  margin-inline: auto;

  > h2 { margin-top: 2rem; color: $purple; }

  .service-grid {
    display: block;
    gap: 1rem;

    > p {
      display: flex;
      flex-wrap: wrap;
      gap: 1rem;
    }
  }

  .service-card {
    min-height: 8.5rem;
    flex: 1 1 calc(25% - 0.75rem);
    min-width: 180px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: space-between;
    padding: 1.2rem;
    border-radius: 0.8rem;
    background: linear-gradient(145deg, $white 0%, #f7f8fa 100%);

    i { width: auto; color: $orange; font-size: 2.75rem; }
    span { font-family: $headings-font-family; font-size: 0.95rem; font-weight: 600; }
  }

  iframe { border: 1px solid $gray-200; border-radius: 0.8rem; }
}

.service-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 4rem;
  padding: 0.9rem 1rem;
  border: 1px solid $gray-200;
  border-radius: 0.55rem;
  background: $white;
  color: $purple;
  box-shadow: 0 0.2rem 0.7rem rgba($black, 0.04);
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;

  i {
    width: 1.35rem;
    color: $red;
    font-size: 1.2rem;
    text-align: center;
  }

  &:hover,
  &:focus-visible {
    color: $purple;
    border-color: $purple;
    background: #f8f6fa;
    box-shadow: 0 0.45rem 1rem rgba($purple, 0.1);
    transform: translateY(-2px);
  }
}

.contact-page {
  max-width: 900px;
  margin-inline: auto;

  .contact-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
    margin-bottom: 2.25rem;
  }

  .contact-card,
  .contact-columns > .contact-recruitment {
    margin: 0;
    padding: 1.25rem 1.4rem;
    border: 1px solid $gray-200;
    border-radius: .85rem;
    background: rgba($white, .72);
  }

  .contact-card h2 {
    color: $purple;
    font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  }

  .contact-recruitment { border-left: 4px solid $orange !important; }

  @media (max-width: map-get($grid-breakpoints, md)) {
    .contact-columns { grid-template-columns: 1fr; }
  }

  .contact-recruitment {
    margin: 0;
    padding: 1.25rem 1.4rem;
    border: 1px solid $gray-200 !important;
    border-radius: .85rem;
    background: rgba($white, .72);
    h3 { margin-top: 0; color: $purple; font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
    p:last-child { margin-bottom: 0; }
    a { color: $purple; font-family: $headings-font-family; font-weight: 650; }
  }

  .contact-map {
    overflow: hidden;
    margin-top: 1rem;
    border: 1px solid $gray-200;
    border-radius: 0.8rem;
    box-shadow: 0 0.5rem 1.2rem rgba($purple, 0.08);
    iframe { display: block; width: 100%; height: 28rem; border: 0; background: #eef3f5; }
  }
  .contact-map-note { margin: 0.55rem 0 0; text-align: right; font-size: 0.82rem; }
  .contact-map-note a { color: $purple; }
}

.service-grid-compact {
  grid-template-columns: minmax(0, 1fr);

  .service-card { flex-basis: 100%; }
}

@media (max-width: map-get($grid-breakpoints, lg)) {
  .service-page .service-grid:not(.service-grid-compact) .service-card { flex-basis: calc(50% - 0.5rem); }
}

@media (max-width: map-get($grid-breakpoints, md)) {
  .service-page .service-grid:not(.service-grid-compact) .service-card { flex-basis: 100%; }
}

// Shared publication index shell: quiet title band, readable intro, and
// consistent section rhythm across Chinese and English pages.
.research #title-block-header .quarto-title-banner {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid $purple;
  background: #f3f1f6;
  color: $purple;
}

.research > h2 { margin-top: 2rem; }

.research > h3 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 2.4rem 0 1.15rem;
  padding: 0.7rem 0.9rem 0.72rem;
  border: 0;
  border-left: 4px solid $orange;
  border-radius: 0 0.5rem 0.5rem 0;
  background: linear-gradient(90deg, #f7f3f0 0%, rgba(247, 243, 240, 0.25) 72%, transparent 100%);
  color: $purple;
  font-family: $headings-font-family;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  letter-spacing: 0.01em;
}

.research > h3::after {
  width: 2.5rem;
  height: 1px;
  background: rgba($orange, 0.65);
  content: "";
}

.home {
  .quarto-title-banner {
    margin-bottom: 0;
  }

  #title-block-header {
    margin-block-end: 0;
  }
}

// Shrink blocks of code
pre.text,
pre.sourceCode,
.cell-output pre {
  font-size: 0.775em;
}

.navbar {
  font-family: $navbar-font-family;
}

// Put all the icons in a single row in the hamburger menu
.navbar-nav.navbar-nav-scroll.ms-auto {
  flex-direction: row;
}

#TOC {
  font-family: $toc-font-family;
  padding-bottom: 0.1em;
  font-weight: 300;

  .active {
    font-weight: 400;
  }

  #toc-title {
    font-weight: 600;
  }
}

.sidebar nav[role="doc-toc"] > ul li a {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

// Blog categories
#quarto-margin-sidebar {
  .quarto-listing-category-title {
    margin-left: 0.5em;
  }

  .quarto-listing-category {
    font-family: $toc-font-family;
    font-weight: 300;
    font-size: 1em;
    line-height: 1.1;
    padding-left: 0.6rem;
    margin-left: 0.5em;
    border-left: 1px solid $gray-200;

    .category {
      padding-bottom: 0.5rem;
    }

    .active {
      font-weight: 400;
      color: $orange;
    }

    .quarto-category-count {
      font-weight: 200;
      font-size: 0.8em;
      color: $gray-600;
    }
  }
}

.nav-footer {
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid $gray-200 !important;
  min-height: 3em;
  font-family: $footer-font-family;
  font-size: 0.82rem;
  line-height: 1.5;

  a {
    color: #f1e8f5 !important;
    text-decoration: none;

    &:hover,
    &:focus-visible {
      color: $light-orange !important;
      text-decoration: underline;
      text-underline-offset: 0.15em;
    }
  }

  .faux-block {
    display: block;
    padding-bottom: 0.35rem;
  }

  .footer-brand {
    font-family: $headings-font-family;
    font-size: 1rem;
    font-weight: 600;

    a { color: $white !important; }
  }

  .footer-muted {
    color: rgba($white, 0.72);
  }

  .footer-stats {
    color: rgba($white, 0.72);
    font-variant-numeric: tabular-nums;
  }

  .footer-source {
    font-size: 0.78rem;
  }

  .fingerprint {
    font-family: $font-family-monospace;
    font-size: 0.8em;
  }

  // In the default Quarto template, .nav-footer-center has position: absolute
  // turned on, which makes the div not be a flex item
  // This changes that so that it *is* a flex item
  .nav-footer-center {
    text-align: center;
    position: inherit;
    margin-top: 0;

    @media (max-width: map-get($grid-breakpoints, md)) {
      margin-top: 0.5em;
      margin-bottom: 1.5em;
    }
  }

  // When the screen is medium or smaller, make each footer chunk be 100% width
  // and centered; otherwise make them be 33% width and left/right/centerd
  .nav-footer-left,
  .nav-footer-right,
  .nav-footer-center {
    text-align: center;
    width: 100%;
    min-height: 2em;
  }

  @media (min-width: map-get($grid-breakpoints, md)) {
    .nav-footer-left {
      text-align: left;
    }

    .nav-footer-right {
      text-align: right;
    }

    .nav-footer-left,
    .nav-footer-right,
    .nav-footer-center {
      flex: 1 1 33%;
    }
  }
}

.footer {
  position: relative;
  overflow: hidden;
  margin-top: 3rem;
  background: radial-gradient(circle at 82% 0%, rgba(#5fc7c1, 0.16), transparent 34%), linear-gradient(115deg, #102a43 0%, #173d5a 52%, #145267 100%);
  color: $footer-fg;
}

.footer::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #5fc7c1, #f6c85f 52%, #5fc7c1);
  content: "";
  opacity: 0.85;
}

.footer .nav-footer { position: relative; z-index: 1; border-top-color: transparent !important; }

#title-block-header {
  .quarto-title-banner {
    font-family: $headings-font-family;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid $purple;
    background: #f3f1f6;
    color: $purple;

    .description {
      font-size: 1rem;
      margin-top: 1em !important;
    }
  }
}

// Shared publication index shell: quiet title band, readable intro, and
// consistent section rhythm across Chinese and English pages.
.quarto-title-block.research .quarto-title-banner {
  margin-bottom: 1.5rem;
  padding: 0.9rem 1.25rem 1rem;
  border-left: 4px solid $purple;
  background: #f3f1f6 !important;
  color: $purple !important;

  .title {
    width: 100%;
    max-width: none;
    margin: 0;
    color: $purple !important;
    font-size: clamp(1.35rem, 2.45vw, 2rem);
    line-height: 1.14;
    letter-spacing: -0.015em;
  }

  .back-nav {
    margin-bottom: 0.85rem;
    font-size: 0.9rem;
  }

  .haiku {
    max-width: none;
    margin: 0.5rem 0 0;
    color: $gray-600;
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .quarto-categories {
    margin-top: 0.8rem;

    .quarto-category {
      font-size: 0.72rem;
    }
  }
}

.publication-ai-insight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 42%);
  gap: 1.25rem;
  align-items: stretch;
  margin: 1.1rem 0 1.4rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(#5fc7c1, .22);
  border-radius: .9rem;
  background: linear-gradient(120deg, rgba(#5fc7c1, .08), rgba($white, .78));
}
.publication-ai-kicker { margin-bottom: .4rem; color: #145267; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.publication-ai-insight-copy p { margin: 0; color: $gray-700; font-size: .92rem; line-height: 1.6; }
.publication-ai-gallery { display: flex; gap: .55rem; align-items: center; justify-content: center; overflow-x: auto; }
.publication-ai-gallery figure { flex: 0 0 30%; min-width: 7rem; margin: 0; }
.publication-ai-gallery img { display: block; width: 100%; height: 7rem; object-fit: contain; border-radius: .5rem; background: rgba($white, .85); }
.publication-overview-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin: 1rem 0 1.5rem; }
.publication-overview-gallery figure { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.publication-overview-gallery img { display: block; width: 100%; height: 9rem; object-fit: contain; }
.publication-overview-gallery.drwater-gallery { display: block; }
.publication-overview-gallery.drwater-gallery .drwater-gallery-slide img { height: 24rem; }
.publication-overview-gallery figcaption { margin-top: .4rem; color: $gray-600; font-size: .78rem; text-align: center; }
@media (max-width: 799px) { .publication-overview-gallery { grid-template-columns: 1fr; } .publication-overview-gallery img { height: auto; max-height: 15rem; } .publication-overview-gallery.drwater-gallery .drwater-gallery-slide img { height: 20rem; } }
@media (max-width: 799px) {
  .publication-ai-insight { grid-template-columns: 1fr; }
  .publication-ai-gallery figure { flex-basis: 31%; }
}

.publication-authors {
  margin: 0.85rem 0 1.1rem;
  border: 1px solid $gray-200;
  border-radius: 0.45rem;
  background: $white;

  summary {
    padding: 0.55rem 0.8rem;
    color: $purple;
    cursor: pointer;
    font-family: $headings-font-family;
    font-size: 0.9rem;
    font-weight: 600;
    list-style-position: inside;
  }

  .quarto-title-meta {
    margin: 0;
    padding: 0.65rem 0.8rem 0.8rem;
    border-top: 1px solid $gray-200;
    font-size: 0.88rem;
  }
}
.publication-authors .abstract { display: none !important; }

.research > h2 { margin-top: 2rem; }

// Blog
.blog {
  .blog-entry {
    display: flex;
    flex-direction: row;
    font-family: $headings-font-family;
    line-height: 1.3;
    margin-bottom: 1.5em;
    column-gap: 1em;
    padding: 1rem;
    border: 1px solid $gray-200;
    border-radius: 0.55rem;
    background: $white;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;

    &:hover,
    &:focus-within {
      transform: translateY(-2px);
      border-color: $purple;
      box-shadow: 0 0.45rem 1rem rgba($black, 0.07);
    }

    .metadata {
      flex: 0 0 8%;
    }

    .body {
      flex: 1 1 auto;
    }

    .thumbnail {
      flex: 0 0 25%;

      img {
        width: 100%;
        object-fit: cover;
        max-height: 120px;
        border-radius: 0.4rem;
      }
    }

    .title {
      font-weight: 500;
      font-size: 1.3em;
      margin-bottom: 0.2em;
      line-height: 1.2;
    }

    .description {
      font-weight: 300;
      font-size: 1em;
      margin-bottom: 0.3em;
    }

    .date {
      font-weight: 300;
      font-size: 0.85em;
      margin-top: 0.3em;
      text-align: right;
    }

    .post-categories {
      display: flex;
      flex-wrap: wrap;
      row-gap: 0.4em;
      column-gap: 0.4em;
      margin: 0.5em 0;

      .post-category {
        appearance: none;
        background: transparent;
        font-family: inherit;
        color: $gray-600;
        border: 1px solid $gray-500;
        border-radius: 0.25rem;
        text-transform: uppercase;
        font-size: 0.65em;
        padding: 0.15em 0.5em;
        cursor: pointer;

        &:hover,
        &:focus-visible {
          color: $red;
          border-color: $red;
          text-decoration: underline;
        }
      }
    }

    .post-doi {
      font-weight: 300;
      font-size: 0.85em;
      margin: 0.5em 0;
      text-align: right;

      .doi-icon {
        width: 1.1em;
        padding-bottom: 1px;
      }

      a {
        color: $gray-600;
      }
    }
  }
}

// Keep news listings readable on narrow screens. The desktop proportions are
// useful for scanning dates and thumbnails, but become cramped on phones.
@media (max-width: map-get($grid-breakpoints, md)) {
  .blog .blog-entry {
    column-gap: 0.65em;

    .metadata {
      flex-basis: 18%;
    }

    .thumbnail {
      flex-basis: 24%;

      img {
        max-height: 90px;
      }
    }

    .title {
      font-size: 1.05em;
    }

    .description {
      font-size: 0.9em;
    }
  }
}

// Preserve a visible keyboard focus indicator after custom link styling.
:where(a, button):focus-visible {
  outline: 3px solid $light-orange;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

// Keyboard users can jump past the persistent navigation immediately.
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  padding: 0.65rem 0.9rem;
  color: $purple;
  background: $white;
  border-radius: 0.45rem;
  box-shadow: 0 0.4rem 1rem rgba($black, 0.2);
  transform: translateY(-180%);
  transition: transform 0.2s ease;
}

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

.blog-post {
  #title-block-header .quarto-title-banner,
  #title-block-header .quarto-title {
    width: 100%;
    max-width: none;
  }

  #title-block-header .quarto-title-banner { padding-inline: clamp(1.25rem, 4vw, 3rem); }

  .quarto-title-banner {
    background: #f3f1f6 !important;
    color: $purple !important;
    border-left: 4px solid $purple;

    .title,
    .subtitle,
    .description,
    .quarto-title-meta,
    .quarto-title-meta-heading,
    .quarto-title-meta-contents {
      color: $purple !important;
    }

    .title {
      width: 100%;
      max-width: none;
      font-size: clamp(1.55rem, 3.4vw, 2.7rem);
      line-height: 1.18;
    }
  }

  .quarto-title .quarto-categories {
    margin-top: 1.5em;

    .quarto-category {
      background-color: shift-color($purple, -90%);
      border-color: shift-color($purple, -65%);
      color: $purple;
      font-size: 0.65em;
      opacity: 1;
    }
  }

  .quarto-title-author-orcid img {
    margin-bottom: -3px;
  }

  .quarto-title-meta-contents .doi::before {
    content: "";
    background-image: url(/files/doi.svg);
    background-size: 1.1em;
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    margin-bottom: -3px;
  }
}

// Publication detail pages use a custom title partial, but their title band
// follows the same visual contract as news details: one readable banner,
// consistent width, and identical type scale.
#title-block-header.quarto-title-block.publication-detail {
  max-width: 900px;
  margin-inline: auto;

  .publication-back-nav {
    margin: 0 0 .55rem;
    padding-left: .15rem;
    font-size: .82rem;
    line-height: 1.2;
  }

  .publication-back-nav a {
    color: $gray-600;
    text-decoration: none;
  }

  .publication-back-nav a:hover,
  .publication-back-nav a:focus-visible {
    color: #145267;
    text-decoration: underline;
    text-underline-offset: .15em;
  }

  .quarto-title-banner {
    width: 100%;
    max-width: 100%;
    padding-inline: clamp(1.25rem, 4vw, 3rem);
    background: #f3f1f6 !important;
    color: #102a43 !important;
    border-left: 0;
    border-radius: .8rem;
  }

  .quarto-title {
    width: 100%;
    max-width: none;
  }

  .quarto-title .title {
    width: 100%;
    max-width: none;
    font-size: clamp(1.45rem, 2.8vw, 2.35rem);
    line-height: 1.18;
    color: #102a43 !important;
  }

  .quarto-title .haiku {
    margin: .45rem 0 0;
    font-size: .78rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .quarto-title .quarto-categories { margin-top: .7rem; }
}


// Research
.quarto-title-block {
  .haiku {
    text-align: right;
    font-family: $headings-font-family;
    margin: 0.5em 0;
    font-size: 1.1em;
    font-weight: 300;
    font-style: italic;
  }

  .quarto-title .quarto-categories {
    padding-bottom: 0;
    flex-wrap: wrap;
    row-gap: 0.4em;
  }

  .project-details {
    background-color: rgba($red, 0.1);
    padding: 0.75em;
    margin: 1em 0;
  }

  .quarto-title-meta-heading.manual {
    margin-top: 2em !important;
  }

  .project-links {
    padding: 0;
    margin-bottom: 0;
  }

  .project-link {
    display: inline-block;
    white-space: nowrap;
    padding: 0 1em 0 0;
    font-weight: bold;
  }
}

// Unified detail-page title treatment for news, publications, and outcomes.
body:has(.blog-post) #title-block-header,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header {
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
}

body:has(.blog-post) #title-block-header .quarto-title-banner,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-banner,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-banner {
  position: relative;
  left: auto;
  width: 100%;
  max-width: 100%;
  padding: 1.15rem clamp(1.25rem, 4vw, 2.5rem) 1.25rem;
  background: #f3f1f6 !important;
  color: #102a43 !important;
  border: 0;
  border-radius: .8rem;
  box-shadow: 0 .55rem 1.4rem rgba(#102a43, .08);
}

body:has(.blog-post) #title-block-header .quarto-title .title,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title .title,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title .title {
  width: 100%;
  max-width: 100%;
  color: #102a43 !important;
  font-size: clamp(1.45rem, 2.8vw, 2.35rem);
  line-height: 1.18;
}

// Quarto marks news title blocks as page-full; contain that utility class so
// news details use the same measure as publication details.
body:has(.blog-post) #title-block-header.page-full {
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
}
body:has(.blog-post) #title-block-header .quarto-title-banner.page-full {
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
}
body:has(.blog-post) #title-block-header .quarto-title.column-body {
  width: 100%;
  max-width: none;
  grid-column: 1 / -1;
}
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header.page-full,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-banner.page-full { width: 100%; max-width: 900px; margin-inline: auto; }
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title.column-body { width: 100%; max-width: none; grid-column: 1 / -1; }
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .publication-back-nav { margin: 0 0 .55rem; padding-left: .15rem; font-size: .82rem; line-height: 1.2; }
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .publication-back-nav a { color: $gray-600; text-decoration: none; }
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .publication-back-nav a:hover,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .publication-back-nav a:focus-visible { color: #145267; text-decoration: underline; text-underline-offset: .15em; }
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header > .project-details { width: 100%; box-sizing: border-box; margin: 1rem 0; padding: .9rem 1.25rem; background: rgba(#5fc7c1, .08); border: 1px solid rgba(#5fc7c1, .2); border-radius: .7rem; }
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header > .project-details .publication-content p { margin: 0; }

// Compact title metadata: authors and publication date read as single lines.
body:has(.blog-post) #title-block-header .quarto-title-meta-author,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-author,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-author { display: block; }
body:has(.blog-post) #title-block-header .quarto-title-meta-author .quarto-title-meta-heading,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-author .quarto-title-meta-heading,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-author .quarto-title-meta-heading,
body:has(.blog-post) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents:has(.affiliation),
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents:has(.affiliation),
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents:has(.affiliation) { display: none !important; }
body:has(.blog-post) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents { display: inline; margin: 0; }
body:has(.blog-post) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents:has(.author)::before,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents:has(.author)::before,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents:has(.author)::before { content: "作者："; color: #496273; }
body:has(.blog-post) #title-block-header .quarto-title-meta-author .author,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-author .author,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-author .author { display: inline; margin: 0; }
body:has(.blog-post) #title-block-header .quarto-title-meta-author .author:not(:last-child)::after,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-author .author:not(:last-child)::after,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-author .author:not(:last-child)::after { content: "、"; }
body:has(.blog-post) #title-block-header .quarto-title-meta,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .35rem; }
body:has(.blog-post) #title-block-header .quarto-title-meta > div,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta > div,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta > div { display: inline; }
body:has(.blog-post) #title-block-header .quarto-title-meta-heading,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-heading,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-heading { display: inline; margin: 0; }
body:has(.blog-post) #title-block-header .quarto-title-meta-contents,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-contents,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-contents { display: inline; margin: 0; }
body:has(.blog-post) #title-block-header > .quarto-title-meta,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header > .quarto-title-meta,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header > .quarto-title-meta { width: 100%; max-width: 900px; box-sizing: border-box; margin-inline: auto; }

body:has(.blog-post) #title-block-header .quarto-title-banner :is(.subtitle, .description, .haiku, .quarto-title-meta, .quarto-title-meta-heading, .quarto-title-meta-contents),
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-banner :is(.subtitle, .description, .haiku, .quarto-title-meta, .quarto-title-meta-heading, .quarto-title-meta-contents),
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-banner :is(.subtitle, .description, .haiku, .quarto-title-meta, .quarto-title-meta-heading, .quarto-title-meta-contents) {
  color: #496273 !important;
}

.back-nav {
  margin-bottom: 1.5em;
}

.research {
  .back-nav a {
    color: shift-color($red, -50%);
  }

  .quarto-title .quarto-categories .quarto-category {
    background-color: shift-color($red, -75%);
    color: $red;
    font-size: 0.65em;
    opacity: 1;
  }

  .project-categories {
    display: flex;
    flex-wrap: wrap;
    margin: 0.35em 0 0.35em;
    padding-top: 0.35em;
    padding-left: 0.5em;
    padding-bottom: 0;
    row-gap: 0.4em;
    column-gap: 0.4em;
    font-family: $headings-font-family;

    .project-category {
      padding: 0.25em 0.75em 0.25em 0em;
      font-size: 0.7em;
      text-transform: uppercase;

      button {
        border: 0;
        padding: 0.2em 0.65em;
        color: shift-color($red, -50%);
        background: shift-color($red, -92%);
        border-radius: 999px;
        font: inherit;
        cursor: pointer;

        &:hover,
        &:focus-visible {
          color: $white;
          background: $red;
        }
      }
    }
  }
}

.project-list {
  ul {
    list-style: none;
    padding: 0;
    margin: 0 0 2em;

    li.project {
      margin-bottom: 2.5em;
      position: relative;
      padding: 1rem 1rem 0.9rem;
      border: 1px solid $gray-200;
      border-radius: 0.55rem;
      background: $white;
      box-shadow: 0 0.25rem 0.8rem rgba($black, 0.04);
      transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;

      &:hover,
      &:focus-within {
        transform: translateY(-2px);
        border-color: $purple;
        box-shadow: 0 0.6rem 1.2rem rgba($black, 0.09);
      }

      p {
        margin: 0;
      }
    }
  }

  .project-content {
    padding-left: 0.5em;

    .status {
      font-size: 1rem;
      font-weight: 250;
      padding: 0.2em;
      margin-right: 0.5em;
    }
  }

  .publication-number {
    float: left;
    min-width: 4.5rem;
    margin: 0 0.8rem 0.35rem 0;
    padding: 0.2rem 0.45rem;
    border-radius: 0.2rem;
    background: shift-color($red, -85%);
    color: $red;
    font-family: $headings-font-family;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-align: center;
  }

  .listing-pub-info {
    min-width: 0;
    font-size: 1rem;
    line-height: 1.55;

    a { overflow-wrap: anywhere; }
  }

  .haiku {
    margin: 0.4rem 0 0rem;
    font-family: $headings-font-family;
    font-weight: 300;
    font-style: italic;
    text-align: right;
    color: $gray-600;
    font-size: 1.1em;

    @media (max-width: map-get($grid-breakpoints, md)) {
      font-size: 0.95rem;
    }
  }

  ul.project-links {
    margin-bottom: 0;
  }

  .project-details-listing {
    margin-top: 0.8em;
    background-color: shift-color($red, -90%);
    font-size: 0.9rem;

    @media (max-width: map-get($grid-breakpoints, md)) {
      font-size: 0.95rem;
    }

    .project-link {
      display: inline-block;
      white-space: nowrap;
      padding: 0.5em 0.5em 0.5em 1em;
    }

    .details {
      background-color: $red;
      padding-right: 1.5em;

      a {
        color: #ffffff;
      }
    }
  }
}

@media (max-width: map-get($grid-breakpoints, md)) {
  .project-list {
    li.project { padding: 0.85rem 0.75rem 0.7rem; }
    .publication-number { float: none; display: inline-block; margin-bottom: 0.6rem; }
    .project-details-listing .project-link { padding-left: 0.6em; padding-right: 0.6em; }
  }
}

// Publication rows: fixed number, readable title, and a generous GA rail.
body:has(.research) .project-list li.project {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) minmax(18rem, 36%);
  grid-template-areas:
    "number main ga"
    "meta meta meta";
  align-items: start;
  column-gap: .8rem;
  row-gap: .8rem;
}
body:has(.research) .project-list .publication-number { grid-area: number; float: none; min-width: 0; margin: .15rem 0 0; }
body:has(.research) .publication-listing-main { grid-area: main; }
body:has(.research) .publication-listing-title { margin: 0 0 .45rem; font-family: $headings-font-family; font-size: clamp(1.05rem, 1.8vw, 1.3rem); line-height: 1.25; }
body:has(.research) .publication-listing-title a { color: $gray-900; text-decoration: none; }
body:has(.research) .publication-listing-title a:hover,
body:has(.research) .publication-listing-title a:focus-visible { color: #145267; text-decoration: underline; text-underline-offset: .16em; }
body:has(.research) .publication-listing-main .listing-pub-info { padding-left: 0; color: $gray-600; font-size: .9rem; line-height: 1.45; }
body:has(.research) .publication-listing-meta-line { margin: 0; color: $gray-600; font-size: .9rem; line-height: 1.4; }
body:has(.research) .publication-listing-main { display: flex; min-height: 11rem; align-self: stretch; flex-direction: column; }
body:has(.research) .publication-abstract-preview { display: -webkit-box; margin: auto 0 0; padding-top: .7rem; overflow: hidden; color: $gray-600; font-size: .84rem; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
body:has(.research) .publication-doi-icon { width: 1rem; height: 1rem; margin-right: .25rem; vertical-align: -.15rem; }
body:has(.research) .publication-ga { grid-area: ga; width: 100%; min-height: 11rem; padding: 0; border: 0; border-radius: 0; background: transparent; }
body:has(.research) .publication-ga-link { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; border-radius: .45rem; }
body:has(.research) .publication-ga-link:focus-visible { outline: 3px solid $light-orange; outline-offset: 2px; }
body:has(.research) .publication-ga img { max-height: 13rem; border-radius: .85rem; }
body:has(.research) .publication-listing-meta { grid-area: meta; min-width: 0; }
body:has(.research) .publication-listing-meta .project-details-listing { margin-top: .6rem; }

@media (max-width: 991.98px) and (min-width: 768px) {
  body:has(.research) .project-list li.project { grid-template-columns: 3.8rem minmax(0, 1fr) 16rem; }
}

@media (max-width: 767.98px) {
  body:has(.research) .project-list li.project {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    grid-template-areas: "number main" "ga ga" "meta meta";
  }
  body:has(.research) .publication-ga { min-height: 9rem; }
}

.bibtex-download {
  white-space: nowrap;
}

.outcome {
  .outcome-entry {
    display: flex;
    flex-direction: row;
    font-family: $headings-font-family;
    line-height: 1.3;
    margin-bottom: 3em;
    column-gap: 0.7em;
    min-height: 15rem;
    align-items: stretch;
    padding: 1.2rem;
    border: 1px solid $gray-300;
    border-radius: 0.6rem;
    background: $white;
    box-shadow: 0 0.25rem 0.8rem rgba($black, 0.04);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;

    &:hover,
    &:focus-within {
      transform: translateY(-2px);
      border: 1px solid $purple;
      box-shadow: 0 0.6rem 1.2rem rgba($black, 0.09);
    }

    .body {
      flex: 1 1 auto;
      order: 1;
    }

    .logo {
      display: flex;
      flex: 0 0 clamp(18rem, 38%, 24rem);
      order: 2;
      align-items: center;
      justify-content: center;
      padding-left: 1rem;
      border-left: 1px solid $gray-200;

      img {
        display: block;
        width: 100%;
        max-height: 15rem;
        object-fit: contain;
      }
    }

    .outcome-title {
      font-weight: 500;
      font-size: 1.25em;
      margin-bottom: 0.2em;
    }

    .outcome-details {
      font-weight: 300;
      font-size: 0.9em;
      margin-bottom: 0.5em;
      color: $gray-800;
    }

    .outcome-description {
      font-weight: 300;
      font-size: 1.1em;
      margin-bottom: 0.5em;
    }

    .outcome-role {
      font-weight: 500;
    }

    ul.outcome-authors {
      list-style: none;
      padding: 0;
      margin-bottom: 0;

      li {
        display: inline-block;
        white-space: nowrap;
        background-color: $orange;
        margin: 0 0.2em 0.4em 0;
        padding: 0.2em 0.4em;
        font-size: 0.85em;
        border-radius: 0.25rem;

        &.no-link {
          background-color: $white;
          border: 1px solid $black;
        }

        a {
          color: $white;
        }
      }
    }
  }
}

.teaching {
  .course-entry {
    display: flex;
    flex-direction: row;
    font-family: $headings-font-family;
    line-height: 1.3;
    margin-bottom: 3em;
    column-gap: 0.7em;

    .body {
      flex: 1 1 auto;
    }

    .logo {
      flex: 0 0 140px;

      img {
        width: 100%;
      }
    }

    .course-title {
      font-weight: 500;
      font-size: 1.25em;
      margin-bottom: 0.2em;
    }

    .course-details {
      font-weight: 300;
      font-size: 0.9em;
      margin-bottom: 0.5em;
      color: $gray-800;
    }

    .course-description {
      font-weight: 300;
      font-size: 1.1em;
      margin-bottom: 0.5em;
    }

    .course-role {
      font-weight: 500;
    }

    ul.course-semesters {
      list-style: none;
      padding: 0;
      margin-bottom: 0;

      li {
        display: inline-block;
        white-space: nowrap;
        background-color: $orange;
        margin: 0 0.2em 0.4em 0;
        padding: 0.2em 0.4em;
        font-size: 0.85em;
        border-radius: 0.25rem;

        &.no-link {
          background-color: $white;
          border: 1px solid $black;
        }

        a {
          color: $white;
        }
      }
    }
  }
}

.talks {
  .talk-entry {
    display: flex;
    flex-direction: row;
    font-family: $headings-font-family;
    line-height: 1.3;
    margin-bottom: 1.5em;
    column-gap: 1em;

    .body {
      flex: 1 0 80%;
    }

    .metadata {
      flex: 1 0 20%;
    }

    .title {
      font-weight: 500;
      font-size: 1.2em;
      margin-bottom: 0.2em;
      line-height: 1.2;
    }

    .description {
      font-weight: 300;
      font-size: 1em;
      margin-bottom: 0.3em;
    }

    .date {
      font-weight: 300;
      font-size: 0.85em;
      margin-top: 0.3em;
      text-align: right;
    }

    ul.talk-links {
      padding: 0 0.5em;
      background-color: shift-color($light-orange, -91%);
      margin-bottom: 0;

      .talk-link {
        display: inline-block;
        white-space: nowrap;
        margin: 0;
        padding: 0.5em 1em 0.5em 0;
        font-size: 0.85em;
      }
    }
  }
}

.cv-download {
  font-family: $headings-font-family;
  background-color: #771c6d;
  border-color: #771c6d;
  color: $white;

  &:hover {
    background-color: $red;
    border-color: $red;
    color: $white;
  }
}

.code-tools-button {
  position: relative;
  left: 5em;

  @media (max-width: map-get($grid-breakpoints, md)) {
    left: 0;
  }
}


/* Logo 悬停效果 */
.navbar-brand img {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  filter: brightness(0) invert(1);
  
  &:hover {
    filter: brightness(0) invert(0.55) sepia(1) saturate(2000%) hue-rotate(-8deg) brightness(1.05) contrast(1.2);
    transform: scale(1.05);
  }
}

// =============================================
// 桌面端样式 - 使用悬停展开下拉菜单
// =============================================
@media (min-width: 992px) {
  /* 导航栏主菜单项样式 */
  .navbar-nav .nav-item {
    position: relative;
    margin: 0 0.2rem;
    
    .nav-link {
      position: relative;
      color: $navbar-fg !important;
      font-weight: 500;
      padding: 0.75rem 1rem !important;
      border-radius: 8px;
      transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
      z-index: 1;
      
      /* 玻璃效果背景 */
      &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba($white, 0.1);
        backdrop-filter: blur(10px);
        border-radius: 8px;
        opacity: 0;
        transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
        z-index: -1;
        border: 1px solid rgba($white, 0.2);
      }
      
      &:hover {
        color: $light-orange !important;
        transform: translateY(-2px);
        
        &::before {
          opacity: 1;
          background: rgba($white, 0.15);
          backdrop-filter: blur(15px);
          box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        }
      }
      
      /* 激活状态 */
      &.active {
        color: $light-orange !important;
        font-weight: 600;
        
        &::before {
          opacity: 1;
          background: rgba($light-orange, 0.2);
          backdrop-filter: blur(15px);
          border: 1px solid rgba($light-orange, 0.3);
        }
      }
    }
  }

  /* 有下拉菜单的主菜单项特殊样式 */
  .navbar-nav .nav-item.dropdown {
    .nav-link {
      padding-right: 2rem !important;
      
      &::after {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
      }
    }
    
    &:hover .nav-link::before {
      opacity: 1;
      background: rgba($white, 0.2);
      backdrop-filter: blur(20px);
      border-bottom-left-radius: 0;
      border-bottom-right-radius: 0;
    }
    
    &:hover .nav-link::after {
      transform: translateY(-50%) rotate(-180deg);
      border-top-color: $light-orange;
    }
  }

  /* 桌面端下拉菜单悬停效果 */
  .navbar-nav .nav-item.dropdown:hover .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
  }

  .dropdown-menu {
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    background: rgba($purple, 0.98) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba($white, 0.1);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    margin-top: -1px;
    padding: 0.5rem 0;
    
    &.show {
      display: block;
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
    }
  }

  .dropdown-item {
    color: $white !important;
    font-family: $navbar-font-family;
    padding: 0.75rem 1.5rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
    
    /* 下拉菜单项的玻璃效果 */
    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba($white, 0.05);
      border-radius: 4px;
      opacity: 0;
      transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
      z-index: -1;
    }
    
    &:hover, &:focus {
      color: $light-orange !important;
      transform: translateX(5px);
      background: transparent !important;
      
      &::before {
        opacity: 1;
        background: rgba($white, 0.1);
      }
    }
  }

  /* 确保下拉菜单与主菜单视觉上连接 */
  .navbar-nav .nav-item.dropdown:hover .nav-link {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
}

// =============================================
// 移动端样式 - 使用点击展开下拉菜单
// =============================================
@media (max-width: 991.98px) {
  /* 完全重置移动端导航样式，使用 Bootstrap 默认行为 */
  .navbar-collapse {
    background: rgba($purple, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba($white, 0.1);
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    
    .navbar-nav {
      .nav-item {
        margin: 0;
        
        .nav-link {
          color: $navbar-fg !important;
          padding: 1rem 1.5rem !important;
          border-radius: 0;
          transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
          display: flex;
          justify-content: space-between;
          align-items: center;
          
          &:hover {
            color: $light-orange !important;
            background: rgba($white, 0.1);
          }
          
          &.active {
            color: $light-orange !important;
            background: rgba($light-orange, 0.1);
            font-weight: 600;
          }
        }
        
        /* 下拉菜单项样式 */
        &.dropdown {
          .dropdown-toggle::after {
            transition: transform 0.3s ease;
          }
          
          &.show {
            .dropdown-toggle {
              color: $light-orange !important;
              background: rgba($white, 0.15);
              
              &::after {
                transform: rotate(-180deg);
              }
            }
          }
          
          .dropdown-menu {
            background: rgba(darken($purple, 5%), 0.95) !important;
            border: none;
            border-radius: 0;
            padding: 0;
            margin: 0;
            position: static;
            float: none;
            display: none;
            
            &.show {
              display: block !important;
            }
          }
        }
      }
    }
  }

  /* 移动端下拉菜单项 */
  .dropdown-item {
    color: $navbar-fg !important;
    padding: 0.875rem 1.5rem 0.875rem 2.5rem !important;
    border-radius: 0;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    
    &:hover, &:focus {
      color: $light-orange !important;
      background: rgba($white, 0.1) !important;
      transform: none;
    }
    
    &.active {
      color: $light-orange !important;
      background: rgba($light-orange, 0.1) !important;
      font-weight: 600;
    }
  }

  /* 移动端导航栏折叠按钮 */
  .navbar-toggler {
    border: 1px solid rgba($white, 0.2);
    padding: 0.5rem 0.75rem;
    
    &:focus {
      box-shadow: 0 0 0 0.2rem rgba($light-orange, 0.25);
    }
    
    .navbar-toggler-icon {
      background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }
  }
  
  /* 禁用桌面端的悬停效果 */
  .navbar-nav .nav-item .nav-link::before {
    display: none;
  }
  
  .navbar-nav .nav-item.dropdown:hover .dropdown-menu {
    display: none !important;
  }
}

// =============================================
// 通用样式
// =============================================

/* 导航栏整体样式 */
.navbar {
  backdrop-filter: blur(10px);
  background: rgba($purple, 0.95) !important;
  border-bottom: 1px solid rgba($white, 0.1);
}

// Keep the primary navigation discoverable while scrolling. Quarto's
// headroom auto-hide can otherwise make the top-level menu appear to vanish.
#quarto-header.headroom,
#quarto-header.headroom--unpinned,
#quarto-header.headroom--pinned {
  transform: translateY(0) !important;
  visibility: visible !important;
}

// Keep the fixed header above hero imagery and make the desktop menu explicit
// instead of relying on Bootstrap's collapse selector precedence.
#quarto-header {
  z-index: 1030 !important;
}

@media (min-width: 992px) {
  #quarto-header .navbar-collapse.collapse {
    display: flex !important;
    flex-basis: auto !important;
    visibility: visible !important;
  }

  #quarto-header .navbar-toggler {
    display: none !important;
  }
}

/* 为有下拉菜单的导航项添加视觉指示 */
.navbar-nav .nav-item.dropdown > .nav-link::after {
  display: inline-block;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}

/* 确保 Bootstrap 的 JavaScript 交互正常工作 */
.navbar-nav .dropdown-toggle::after {
  display: inline-block !important;
}

/* 修复移动端点击事件 */
.navbar-nav .nav-item.dropdown .nav-link {
  cursor: pointer;
}

// Restore grouped author metadata; do not flatten authors into one line.
body:has(.blog-post) #title-block-header .quarto-title-meta-author,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-author,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-author { display: grid !important; }
body:has(.blog-post) #title-block-header .quarto-title-meta-author .quarto-title-meta-heading,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-author .quarto-title-meta-heading,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-author .quarto-title-meta-heading,
body:has(.blog-post) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents:has(.affiliation),
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents:has(.affiliation),
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents:has(.affiliation) { display: block !important; }
body:has(.blog-post) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents,
body:has(.blog-post) #title-block-header .quarto-title-meta-author .author,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-author .author,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-author .author { display: block !important; margin: revert; }
body:has(.blog-post) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents::before,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents::before,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents::before,
body:has(.blog-post) #title-block-header .quarto-title-meta-author .author::after,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-author .author::after,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-author .author::after { content: none !important; }
body:has(.blog-post) #title-block-header > .quarto-title-meta,
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header > .quarto-title-meta,
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header > .quarto-title-meta { display: grid !important; }
body:has(.blog-post) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents:has(.affiliation),
body:has(#title-block-header.quarto-title-block.publication-detail) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents:has(.affiliation),
body:has(#title-block-header.quarto-title-block.research .project-details) #title-block-header .quarto-title-meta-author .quarto-title-meta-contents:has(.affiliation) { display: block !important; visibility: visible !important; }
body:has(.blog-post) #title-block-header .quarto-title-meta > div:first-child { grid-column: 1 / -1; width: 100%; }

/* Final outcome-list override: keep it in the publication-like two-column layout. */
body:has(.outcome-list) .outcome-list li.outcome-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 36%); grid-template-areas: "body logo"; align-items: stretch; column-gap: 1rem; row-gap: .8rem; min-height: 15rem; }
body:has(.outcome-list) .outcome-list li.outcome-entry .body { grid-area: body; min-width: 0; }
body:has(.outcome-list) .outcome-list li.outcome-entry .logo { grid-area: logo; min-height: 11rem; padding-left: 1rem; border-left: 1px solid $gray-200; }
@media (max-width: 767.98px) {
  body:has(.outcome-list) .outcome-list li.outcome-entry { grid-template-columns: 1fr; grid-template-areas: "logo" "body"; min-height: 0; }
  body:has(.outcome-list) .outcome-list li.outcome-entry .logo { min-height: 10rem; padding: 0 0 1rem; border-right: 0; border-bottom: 1px solid $gray-200; border-left: 0; }
}
