/* ==========================================================================
   Editorial Academic Design System (Jiaxing Shen & A2HD Lab)
   Restrained typography, borderless soft-shadow blocks, zero SaaS clutter
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --ink-primary: #1a2430;
  --ink-secondary: #3f4e5e;
  --ink-muted: #5e6d7d;

  --navy: #1b3a5c;
  --navy-hover: #122842;
  --navy-soft: #f0f4f8;
  --navy-border: #d5e0ec;

  --gold: #a98b51;
  --gold-dark: #785d2b;
  --gold-soft: #faf7f0;
  --gold-border: #e7d9bc;

  --award-bg: #fcf3f2;
  --award-text: #8f2626;
  --award-border: #edd0cc;

  --bg-page: #ffffff;
  --bg-surface: #ffffff;
  --bg-subtle: #f5f7fa;
  --border-subtle: #e7ecf1;
  --border-strong: #cfd8e2;

  --shadow-block: 0 1px 3px rgba(24, 37, 52, 0.06), 0 5px 16px rgba(24, 37, 52, 0.06);
  --shadow-sm: 0 1px 3px rgba(24, 37, 52, 0.05), 0 3px 10px rgba(24, 37, 52, 0.05);
  --shadow-md: 0 2px 6px rgba(24, 37, 52, 0.08), 0 8px 22px rgba(24, 37, 52, 0.08);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --url: var(--navy);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--bg-page);
}

body {
  font-family: var(--font-sans);
  font-size: 0.96875rem; /* 15.5px */
  line-height: 1.68;
  color: var(--ink-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
}

/* Ensure HTML hidden attribute always wins over element display rules */
[hidden] {
  display: none !important;
}

/* Override legacy global transition on every tag */
b, i, strong, em, blockquote, p, q, span, figure, img, h1, h2, header, input, tr, td {
  transition: none;
}

a {
  color: var(--navy);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

a:hover {
  color: var(--navy-hover);
}

/* Typography resets overriding legacy css_shen.css & _base.scss */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--ink-primary);
  text-indent: 0 !important;
  letter-spacing: -0.012em;
  line-height: 1.28;
}

.page-content {
  text-align: left;
}

.page-content h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.62rem, 2.5vw, 2.05rem);
  margin: 0 0 1.05rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--ink-primary);
}

.page-content h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.24rem, 1.85vw, 1.44rem);
  margin: 2.2rem 0 0.85rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--ink-primary);
}

.page-content h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 1.35rem 0 0.5rem;
  color: var(--ink-primary);
}

.page-content p {
  margin: 0 0 0.95rem;
  color: var(--ink-secondary);
}

.page-content p a,
.page-content li a {
  text-decoration: underline;
  text-decoration-color: rgba(27, 58, 92, 0.3);
  text-underline-offset: 0.18em;
}

.page-content p a:hover,
.page-content li a:hover {
  text-decoration-color: var(--navy);
}

/* Preserve A2HD custom heading spacing */
.a2hd-overview h1,
.a2hd-overview h2,
.a2hd-overview h3 {
  border-bottom: none;
  padding-bottom: 0;
}

/* ==========================================================================
   Site Header / Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink-primary);
  text-decoration: none !important;
  flex-shrink: 0;
  order: 1;
}

.site-nav {
  order: 2;
}

.site-header__controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  order: 3;
}

.header-util-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 0.55rem;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
}

.header-util-btn:hover {
  color: var(--navy);
  background: var(--bg-subtle);
}

.theme-toggle {
  padding: 0;
  width: 32px;
}

.theme-toggle svg {
  display: block;
  pointer-events: none;
}

.theme-toggle__icon-sun {
  display: none !important;
}

html[data-theme="dark"] .theme-toggle__icon-moon {
  display: none !important;
}

html[data-theme="dark"] .theme-toggle__icon-sun {
  display: block !important;
  color: var(--gold);
}

.site-brand__icon {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  object-fit: contain;
  display: block;
}

.site-brand__name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__item {
  margin: 0;
}

.site-nav__link {
  display: inline-block;
  padding: 0.38rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.89rem;
  font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none !important;
  position: relative;
}

.site-nav__link:hover {
  color: var(--navy);
  background: var(--bg-subtle);
}

.site-nav__link.is-active {
  color: var(--navy);
  font-weight: 600;
}

.site-nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0.12rem;
  height: 2px;
  background: var(--gold);
}

.site-nav__item--cta {
  margin-left: 0.35rem;
}

.site-nav__cta {
  background: var(--navy);
  color: #ffffff !important;
  font-weight: 600;
  padding: 0.38rem 0.78rem;
  border-radius: var(--radius-sm);
}

.site-nav__cta::after {
  display: none !important;
}

.site-nav__cta:hover,
.site-nav__cta.is-active {
  background: var(--navy-hover);
  color: #ffffff !important;
}

.site-nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.42rem 0.45rem;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.site-nav-toggle:hover {
  background: var(--bg-subtle);
}

.site-nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink-primary);
  border-radius: 1px;
}

@media (max-width: 960px) {
  .site-header__inner {
    flex-wrap: wrap;
    padding: 0.6rem 1rem;
  }

  .site-nav-toggle {
    display: inline-flex;
  }

  .site-header__controls {
    order: 2;
  }

  .site-nav {
    order: 3;
    display: none;
    width: 100%;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: 0.5rem;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
  }

  .site-nav__link.is-active::after {
    display: none;
  }

  .site-nav__link.is-active {
    background: var(--navy-soft);
  }

  .site-nav__item--cta {
    margin-left: 0;
    margin-top: 0.4rem;
  }

  .site-nav__cta {
    text-align: center;
  }
}

/* ==========================================================================
   Main Two-Column Shell (Open Editorial Canvas — No Outer Page Box)
   ========================================================================== */
#main.site-shell {
  max-width: 1180px;
  margin: 2.25rem auto 4rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
  animation: none;
}

.site-sidebar {
  position: sticky;
  top: 4.8rem;
}

.site-sidebar .sidebar {
  float: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
}

.site-content {
  min-width: 0;
}

.page-article {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

@media (max-width: 960px) {
  #main.site-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    margin-top: 1.15rem;
    padding: 0 1rem;
  }

  .site-sidebar {
    position: static;
  }
}

/* ==========================================================================
   Sidebar Profile Column (Calm Scholarly Layout)
   ========================================================================== */
.profile-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0.15rem 0;
  box-shadow: none;
}

.profile-card__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.profile-card__avatar-link {
  display: block;
  width: 164px;
  margin-bottom: 0.9rem;
}

.profile-card__avatar {
  display: block;
  width: 100%;
  height: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  object-fit: cover;
  box-shadow: none;
}

.profile-card__name {
  font-family: var(--font-serif);
  font-size: 1.42rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
  line-height: 1.2;
}

.profile-card__name a {
  color: var(--ink-primary);
  text-decoration: none;
}

.profile-card__title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-primary);
}

.profile-card__institution {
  margin: 0.12rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

.profile-card__credentials {
  text-align: left;
  margin-top: 0.45rem;
}

.profile-card__roles {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.profile-card__societies {
  margin: 0.3rem 0 0;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.profile-card__meta,
.profile-card__links {
  list-style: none;
  margin: 0.95rem 0 0;
  padding: 0.9rem 0 0;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.83rem;
  color: var(--ink-secondary);
}

.profile-card__meta li,
.profile-card__links li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  line-height: 1.42;
}

.profile-card__links li a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink-secondary);
  text-decoration: none;
}

.profile-card__links li a:hover {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.profile-card__meta i,
.profile-card__links i {
  color: var(--ink-muted);
  margin-top: 0.16rem;
  flex-shrink: 0;
  width: 1.1em;
  text-align: center;
}

.profile-card__links i {
  margin-top: 0;
}

.profile-card__meta a {
  color: var(--ink-secondary);
  word-break: break-word;
}

.profile-card__meta a:hover {
  color: var(--navy);
  text-decoration: underline;
}

.profile-recruit-box {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  margin-top: 1.05rem;
  padding: 0.5rem 0 0.5rem 0.8rem;
  border: 0;
  border-left: 2px solid var(--gold);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-decoration: none !important;
  color: var(--ink-primary);
}

.profile-recruit-box:hover .profile-recruit-box__meta {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.profile-recruit-box__eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-dark);
}

.profile-recruit-box__meta {
  font-size: 0.82rem;
  color: var(--navy);
  font-weight: 500;
  line-height: 1.4;
}

.profile-card__toggle {
  display: none;
}

.profile-card__collapsible {
  display: block;
}

@media (max-width: 960px) {
  .profile-card {
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 0.9rem 1rem;
    box-shadow: var(--shadow-sm);
  }

  .profile-card__header {
    flex-direction: row;
    text-align: left;
    gap: 0.85rem;
    align-items: center;
  }

  .profile-card__avatar-link {
    width: 60px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .profile-card__name {
    font-size: 1.15rem;
    margin-bottom: 0.1rem;
  }

  .profile-card__title {
    font-size: 0.82rem;
    line-height: 1.3;
  }

  .profile-card__institution {
    font-size: 0.78rem;
    margin-top: 0.1rem;
  }

  .profile-card__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.7rem;
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 0;
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    color: var(--navy);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
  }

  .profile-card__toggle:hover {
    background: var(--navy-soft);
  }

  .profile-card__toggle-chevron {
    transition: transform 0.16s ease;
  }

  .profile-card__toggle[aria-expanded="true"] .profile-card__toggle-chevron {
    transform: rotate(180deg);
  }

  .profile-card__collapsible {
    display: none;
    margin-top: 0.75rem;
  }

  .profile-card__collapsible.is-open {
    display: block;
  }
}

/* ==========================================================================
   Homepage & Projects: Editorial Summary Ledger (Replaces SaaS KPI Boxes)
   ========================================================================== */
.home-hero__title {
  margin-bottom: 0.9rem !important;
}

.home-bio--compact {
  display: none;
}

@media (max-width: 680px) {
  .home-bio--full {
    display: none;
  }

  .home-bio--compact {
    display: block;
  }
}

.home-stats,
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 1.4rem 0 1.85rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.home-stat,
.kpi-card {
  display: flex;
  flex-direction: column;
  padding: 0.1rem 1rem;
  border: 0;
  border-right: 1px solid var(--border-subtle);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-decoration: none !important;
  color: inherit;
}

.home-stat:first-child,
.kpi-card:first-child {
  padding-left: 0;
}

.home-stat:last-child,
.kpi-card:last-child {
  border-right: 0;
  padding-right: 0;
}

.home-stat:hover .home-stat__value {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.home-stat__value,
.kpi-card__num {
  font-family: var(--font-serif);
  font-size: 1.38rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink-primary);
}

.home-stat__label,
.kpi-card__label {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 0.25rem;
  line-height: 1.35;
}

@media (max-width: 680px) {
  .home-stats,
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1rem;
    padding: 0.85rem 0;
  }

  .home-stat,
  .kpi-card {
    padding: 0 !important;
    border-right: 0;
  }
}

.recruit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.95rem 1.15rem;
  margin: 1.5rem 0 1.75rem;
  border-radius: var(--radius-md);
  background: var(--gold-soft);
  border: 0;
  box-shadow: var(--shadow-sm);
}

.recruit-banner__text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-primary);
}

.recruit-banner__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #ffffff !important;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
}

.recruit-banner__cta:hover {
  background: var(--navy-hover);
}

.section-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  margin: 2.15rem 0 1rem;
  padding-bottom: 0.35rem;
}

.section-header-row h2 {
  border-bottom: none !important;
  margin: 0 !important;
  padding-bottom: 0 !important;
}

.section-header-row__link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--navy);
  white-space: nowrap;
  text-decoration: none !important;
}

.section-header-row__link:hover {
  text-decoration: underline !important;
  text-underline-offset: 0.16em;
}

/* Featured Papers Grid on Home (Borderless Soft-Shadow Blocks) */
.featured-papers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
  margin: 0 0 1rem;
}

@media (max-width: 680px) {
  .featured-papers {
    grid-template-columns: 1fr;
  }
}

.featured-paper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 0;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.featured-paper:hover {
  box-shadow: var(--shadow-md);
}

.featured-paper__top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.featured-paper__title {
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.42;
  color: var(--ink-primary);
  margin: 0.25rem 0 0;
}

.featured-paper__title a {
  color: var(--ink-primary);
  text-decoration: none;
}

.featured-paper__title a:hover {
  color: var(--navy);
  text-decoration: underline;
}

.featured-paper__authors {
  font-size: 0.81rem;
  color: var(--ink-muted);
  margin: 0.2rem 0 0;
  line-height: 1.42;
}

.featured-paper__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  margin-top: 0.2rem;
}

/* ==========================================================================
   Clean Timeline Lists (News, Experience, Education, Awards)
   ========================================================================== */
.date-ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0.4rem 0 1.25rem !important;
}

.date-ul > li.timeline-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 0.95rem;
  align-items: baseline;
  padding: 0.52rem 0;
  margin: 0 !important;
  border-bottom: 1px solid var(--border-subtle);
}

.date-ul > li.timeline-item--range {
  grid-template-columns: 156px minmax(0, 1fr);
}

.date-ul > li.timeline-item:last-child {
  border-bottom: none;
}

.timeline-date {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  white-space: nowrap;
}

.timeline-date--range {
  color: var(--ink-muted);
}

.timeline-body {
  font-size: 0.92rem;
  line-height: 1.58;
  color: var(--ink-secondary);
  min-width: 0;
  overflow-wrap: anywhere;
}

.timeline-body strong {
  color: var(--ink-primary);
}

@media (max-width: 600px) {
  .date-ul > li.timeline-item,
  .date-ul > li.timeline-item--range {
    grid-template-columns: 1fr;
    gap: 0.18rem;
  }
}

/* ==========================================================================
   Understated Editorial Tags & Inline Scholarly Action Links
   ========================================================================== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.42rem;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.38;
  white-space: nowrap;
  vertical-align: middle;
}

.pill--venue {
  background: var(--navy-soft);
  color: var(--navy);
}

.pill--ccfa {
  background: transparent;
  color: var(--ink-muted);
  padding: 0;
  font-weight: 500;
}

.pill--ccfb {
  background: transparent;
  color: var(--ink-muted);
  padding: 0;
  font-weight: 500;
}

.pill--jcrq1 {
  background: transparent;
  color: var(--gold-dark);
  padding: 0;
  font-weight: 500;
}

.pill--award {
  background: var(--award-bg);
  color: var(--award-text);
}

.pill--type {
  background: var(--bg-subtle);
  color: var(--ink-muted);
}

/* Quiet dot separator between venue and ranking labels in publication metadata */
.featured-paper__top .pill--ccfa::before,
.featured-paper__top .pill--ccfb::before,
.featured-paper__top .pill--jcrq1::before,
.pub-item__header .pill--ccfa::before,
.pub-item__header .pill--ccfb::before,
.pub-item__header .pill--jcrq1::before {
  content: "·";
  margin-right: 0.35rem;
  color: var(--border-strong);
}

/* Inline scholarly text links (PDF · DOI · BibTeX) instead of pill buttons */
.action-link {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--navy) !important;
  text-decoration: none !important;
  cursor: pointer;
  font-family: inherit;
}

.action-link:hover {
  text-decoration: underline !important;
  text-underline-offset: 0.18em;
  color: var(--navy-hover) !important;
}

/* ==========================================================================
   A2HD Lab: Selected Systems & Typographic Member Directory
   ========================================================================== */
.a2hd-systems {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 0.75rem 0 2rem;
}

@media (max-width: 780px) {
  .a2hd-systems {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .a2hd-systems {
    grid-template-columns: 1fr;
  }
}

.a2hd-system-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius-md);
  border: 0;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.a2hd-system-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.45rem;
}

.a2hd-system-card__name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-primary);
  min-width: 0;
}

.a2hd-system-card__desc {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.48;
  color: var(--ink-secondary);
}

.member-group-title {
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  color: var(--gold-dark) !important;
  margin: 1.45rem 0 0.55rem !important;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 0.25rem 1.5rem;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 1rem !important;
}

.member-card {
  display: block;
  padding: 0.55rem 0;
  margin: 0 !important;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.member-card--lead {
  background: transparent;
}

.member-info {
  min-width: 0;
}

.member-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.32;
}

.member-name a {
  color: var(--navy);
  text-decoration: none;
}

.member-name a:hover {
  text-decoration: underline;
}

.member-meta {
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.38;
  margin-top: 0.1rem;
}

/* Research map linked titles */
.a2hd-map-items li a {
  color: var(--ink-primary);
  text-decoration: underline;
  text-decoration-color: rgba(27, 58, 92, 0.28);
  text-underline-offset: 0.16em;
}

.a2hd-map-items li a:hover {
  color: var(--navy);
  text-decoration-color: var(--navy);
}

/* ==========================================================================
   Publications Page (Clean Hairline-Separated Bibliography)
   ========================================================================== */
.pub-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 0;
  box-shadow: var(--shadow-sm);
  margin: 0.75rem 0 1.25rem;
}

.pub-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.pub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pub-filter-btn {
  padding: 0.34rem 0.68rem;
  border-radius: var(--radius-sm);
  border: 0;
  background: var(--bg-surface);
  box-shadow: 0 1px 2px rgba(24, 37, 52, 0.06);
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

.pub-filter-btn:hover {
  color: var(--navy);
  background: var(--navy-soft);
}

.pub-filter-btn.is-active {
  background: var(--navy);
  color: #ffffff;
  font-weight: 600;
}

.pub-search {
  flex: 1 1 210px;
  max-width: 290px;
  padding: 0.38rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink-primary);
}

.pub-search:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(27, 58, 92, 0.14);
}

.pub-year-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.pub-year-nav a {
  padding: 0.1rem 0.15rem;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-weight: 500;
  text-decoration: none !important;
}

.pub-year-nav a:hover {
  text-decoration: underline !important;
  text-underline-offset: 0.18em;
}

.pub-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin: 0 0 1rem;
}

.pub-year-section {
  margin-bottom: 1.75rem;
  scroll-margin-top: 5rem;
}

.pub-year-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 1.5rem !important;
  margin-bottom: 0.25rem !important;
}

.pub-year-count {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.pub-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pub-item {
  padding: 0.9rem 0;
  margin: 0 !important;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scroll-margin-top: 5.5rem;
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-item--award {
  padding-left: 0.9rem;
  border-left: 2.5px solid var(--gold);
}

.pub-item:target {
  background: var(--gold-soft);
  padding-left: 0.9rem;
  padding-right: 0.9rem;
  border-radius: var(--radius-sm);
}

.pub-item__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.28rem;
}

.pub-item__title {
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.42;
  color: var(--ink-primary);
  margin: 0 0 0.2rem;
}

.pub-item__title a {
  color: var(--ink-primary);
  text-decoration: none;
}

.pub-item__title a:hover {
  color: var(--navy);
  text-decoration: underline;
}

.pub-item__authors {
  font-size: 0.85rem;
  line-height: 1.48;
  color: var(--ink-secondary);
  margin: 0 0 0.16rem;
}

.pub-item__venue {
  font-size: 0.84rem;
  color: var(--ink-muted);
  margin: 0;
}

.pub-item__venue em {
  color: var(--ink-secondary);
}

.pub-item__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  margin-top: 0.42rem;
}

.pub-bibtex-box {
  margin-top: 0.6rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 0;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--ink-primary);
  overflow-x: auto;
  white-space: pre-wrap;
}

.pub-empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--ink-muted);
}

/* ==========================================================================
   Projects Page (Clean Borderless Tables)
   ========================================================================== */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.75rem 0 1.6rem;
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.grants-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 !important;
  font-size: 0.86rem;
  background: var(--bg-surface);
}

.grants-table th {
  background: var(--bg-subtle);
  color: var(--ink-primary);
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.grants-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  color: var(--ink-secondary);
  line-height: 1.48;
}

.grants-table tbody tr:last-child td {
  border-bottom: none;
}

.grants-table tbody tr:hover {
  background: var(--bg-subtle);
}

.grants-table__period {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.grants-table__period-start,
.grants-table__period-end {
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .grants-table__period {
    white-space: normal;
    line-height: 1.35;
  }

  .grants-table__period-start,
  .grants-table__period-end {
    display: block;
  }
}

.grants-table__amount {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-primary);
}

.grants-table__title {
  color: var(--ink-primary);
  font-weight: 500;
}

.grants-table__sub {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 400;
  margin-top: 0.15rem;
}

/* ==========================================================================
   Service & Teaching (Clean Editorial Lists & Hairline Rows)
   ========================================================================== */
.tpc-list,
.reviewer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 1.75rem;
  list-style: none !important;
  padding: 0 !important;
  margin: 0.5rem 0 1.25rem !important;
}

@media (max-width: 680px) {
  .tpc-list,
  .reviewer-grid {
    grid-template-columns: 1fr;
  }
}

.tpc-list li,
.reviewer-grid li {
  margin: 0 !important;
  padding: 0.36rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.87rem;
  color: var(--ink-secondary);
}

.tpc-list li strong {
  color: var(--ink-primary);
}

.teaching-awards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0.9rem 0 1.65rem;
}

@media (max-width: 680px) {
  .teaching-awards {
    grid-template-columns: 1fr;
  }
}

.teaching-award-card {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--gold-soft);
  border: 0;
  box-shadow: var(--shadow-sm);
}

.teaching-award-card__year {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-dark);
}

.teaching-award-card__title {
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink-primary);
  margin: 0.2rem 0 0.25rem;
}

.teaching-award-card__desc {
  font-size: 0.82rem;
  color: var(--ink-secondary);
  margin: 0;
}

.course-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0.5rem 0 1.5rem;
}

.course-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  padding: 0.72rem 0;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.course-card:last-child {
  border-bottom: none;
}

.course-card__code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
  margin-right: 0.45rem;
}

.course-card__name {
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink-primary);
}

.course-card__meta {
  font-size: 0.81rem;
  color: var(--ink-muted);
  margin-top: 0.16rem;
}

/* ==========================================================================
   Acknowledgements / Supporting Logos
   ========================================================================== */
.support-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.support-section h2 {
  border-bottom: none !important;
  margin: 0 0 0.45rem !important;
  padding-bottom: 0 !important;
}

.support-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
  margin-top: 1rem;
}

.support-logos img {
  max-height: 48px;
  max-width: 185px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.support-logos img.support-logo-tall {
  max-height: 62px;
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-page);
  margin-top: 2.5rem;
}

.site-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.35rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.site-footer__brand strong {
  color: var(--ink-primary);
}

.site-footer__sep {
  margin: 0 0.35rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer__links a {
  color: var(--ink-secondary);
  font-weight: 500;
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--navy);
  text-decoration: underline;
}

/* ==========================================================================
   Night Mode (Dark Theme)
   ========================================================================== */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink-primary: #e8eef6;
  --ink-secondary: #b7c5d6;
  --ink-muted: #8c9eb4;

  --navy: #7db4ec;
  --navy-hover: #a5cdf5;
  --navy-soft: rgba(125, 180, 236, 0.14);
  --navy-border: rgba(125, 180, 236, 0.28);

  --gold: #d4b678;
  --gold-dark: #e0c48b;
  --gold-soft: rgba(212, 182, 120, 0.11);
  --gold-border: rgba(212, 182, 120, 0.32);

  --award-bg: rgba(235, 112, 112, 0.14);
  --award-text: #f6a4a4;
  --award-border: rgba(235, 112, 112, 0.32);

  --bg-page: #0f1621;
  --bg-surface: #16202e;
  --bg-subtle: #1b2636;
  --border-subtle: #243244;
  --border-strong: #34465f;

  --shadow-block: 0 2px 6px rgba(0, 0, 0, 0.32), 0 8px 22px rgba(0, 0, 0, 0.24);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.28), 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4), 0 10px 26px rgba(0, 0, 0, 0.3);
  --url: var(--navy);
  background-color: var(--bg-page);
}

html[data-theme="dark"] body {
  background-color: var(--bg-page);
  color: var(--ink-primary);
}

[data-theme="dark"] .site-header {
  background: rgba(15, 22, 33, 0.94);
}

[data-theme="dark"] .site-brand__icon {
  background: transparent;
  padding: 0;
  filter: invert(0.92) hue-rotate(180deg) brightness(1.08);
}

[data-theme="dark"] .site-nav__cta,
[data-theme="dark"] .recruit-banner__cta {
  background: #2b5a8e;
  color: #ffffff !important;
}

[data-theme="dark"] .site-nav__cta:hover,
[data-theme="dark"] .site-nav__cta.is-active,
[data-theme="dark"] .recruit-banner__cta:hover {
  background: #3a6fa8;
  color: #ffffff !important;
}

[data-theme="dark"] .page-content p a,
[data-theme="dark"] .page-content li a {
  text-decoration-color: rgba(125, 180, 236, 0.4);
}

[data-theme="dark"] .pub-filter-btn {
  background: var(--bg-surface);
  color: var(--ink-secondary);
}

[data-theme="dark"] .pub-filter-btn.is-active {
  background: #2b5a8e;
  color: #ffffff;
}

[data-theme="dark"] .pub-search {
  background: var(--bg-surface);
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

[data-theme="dark"] .pub-bibtex-box {
  background: #0d131d;
  color: #dce6f2;
}

/* Dark mode support for A2HD Lab & Recruitment custom panels */
[data-theme="dark"] .a2hd-stage,
[data-theme="dark"] .a2hd-trust,
[data-theme="dark"] .recruitment-card {
  background: var(--bg-surface);
  border: 0;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .a2hd-map {
  --a2hd-trust-line: var(--gold);
}

[data-theme="dark"] .a2hd-map-items li a {
  color: var(--ink-primary);
  text-decoration-color: rgba(125, 180, 236, 0.35);
}

[data-theme="dark"] .a2hd-map-items li a:hover {
  color: var(--navy);
}

[data-theme="dark"] .a2hd-intro-heading img {
  background: transparent;
  padding: 0;
  border-radius: 0;
  filter: invert(0.92) hue-rotate(180deg) brightness(1.08);
}

[data-theme="dark"] .support-logos {
  background: rgba(245, 247, 250, 0.94);
  padding: 0.95rem 1.2rem;
  border-radius: var(--radius-md);
}
