/* Superior-style SaaS UI (Framer template rhythm: zinc neutrals, pill tabs, clean cards) */
:root {
  /* Subsection / role titles (Services, Quantitative, Teaching role line, etc.) — 20px */
  --type-subsection: 1.25rem;
  /* Vertical padding around pub-entry dividers (1.5× prior 0.65 / 0.45) */
  --pub-entry-pad-y: 0.975rem;
  --pub-entry-pad-y-edge: 0.675rem;
  --bg: #fafafa;
  --bg-page: #fafafa;
  --bg-muted: #f4f4f5;
  --bg-elevated: #ffffff;
  --ink: #0a0a0a;
  --muted: #71717a;
  --line: #e4e4e7;
  /* Slightly stronger hairlines between rows inside cards (Teaching, Research, etc.) */
  --divider-row: #d4d4d8;
  --line-soft: #f4f4f5;
  --accent: #18181b;
  --accent-link: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-nav: 0 1px 0 rgba(0, 0, 0, 0.04);
  --font: "Inter", sans-serif;
  --max: 1200px;
  --nav-h: 64px;
  --section-pad-x: clamp(1rem, 4vw, 1.5rem);
  /* Section block padding (y); −20% vs prior for tighter gaps between major sections */
  --section-pad-y: clamp(2rem, 4vw, 3.2rem);
  --text-body: 1rem;
  --leading-body: 1.7;
  --tracking-tight: -0.035em;
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  letter-spacing: -0.013em;
  color: var(--ink);
  background: var(--bg-page);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

input,
select,
textarea,
optgroup {
  font-family: var(--font);
}

a {
  color: var(--accent-link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

a.btn {
  color: inherit;
  text-decoration: none;
}
a.btn:hover {
  text-decoration: none;
}
a.btn-primary {
  color: #fff !important;
}

/* Top bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.5rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-nav);
}

/* Hamburger — 仅移动端；桌面端彻底移出布局避免中间出现伪「灰条」 */
.nav-toggle {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-family: var(--font);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle:hover {
  background: var(--accent-soft);
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.nav-toggle-icon {
  display: block;
  position: relative;
  width: 22px;
  height: 14px;
}
.nav-toggle-icon span {
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 1px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}
.nav-toggle-icon span:nth-child(1) {
  top: 0;
}
.nav-toggle-icon span:nth-child(2) {
  top: 6px;
}
.nav-toggle-icon span:nth-child(3) {
  top: 12px;
}
.site-header.nav-open .nav-toggle-icon span:nth-child(1) {
  top: 6px;
  transform: rotate(45deg);
}
.site-header.nav-open .nav-toggle-icon span:nth-child(2) {
  opacity: 0;
}
.site-header.nav-open .nav-toggle-icon span:nth-child(3) {
  top: 6px;
  transform: rotate(-45deg);
}

.brand {
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover {
  text-decoration: none;
  opacity: 0.85;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

/* 桌面端：全屏菜单专用结构不参与排版 */
.nav-mobile-head {
  display: none;
}
.nav-link-list {
  display: contents;
}

.nav-links a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-links a:hover {
  color: var(--ink);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff !important;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-xs);
  border: 1px solid transparent;
}
.nav-cta:hover {
  opacity: 0.92;
  color: #fff !important;
  text-decoration: none;
}

/* Hero */
.hero {
  padding: clamp(3rem, 8vw, 4.5rem) var(--section-pad-x) clamp(2.5rem, 6vw, 3.5rem);
  margin: 0 auto;
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.hero-header {
  max-width: 100%;
  width: 100%;
}

.badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-family: var(--font);
  font-size: clamp(2.125rem, 4.8vw, 3rem);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: 1.12;
  margin: 0 0 0.5rem;
}

.hero .role {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 36rem;
  margin: 0 0 1.75rem;
}

/* Hero structured panels (summary + metrics) */
.hero-panel {
  max-width: 100%;
  width: 100%;
  padding: 1.5rem 1.75rem;
  box-sizing: border-box;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.hero-panel-label {
  margin: 0 0 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.hero-panel-head .hero-panel-label {
  margin: 0;
}

.hero-panel-link {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-link);
  text-decoration: none;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.hero-panel-link:hover {
  text-decoration: underline;
}

.hero-metric-footnote {
  margin: 0.75rem 0 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted);
  letter-spacing: -0.005em;
}

.hero-intro-copy {
  margin: 0;
}

.hero-intro-copy p {
  margin: 0 0 1rem;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.hero-intro-copy p:last-child {
  margin-bottom: 0;
}

.hero-intro-copy strong {
  font-weight: 600;
  color: var(--ink);
}

.hero-metrics-panel {
  max-width: 100%;
  width: 100%;
}

.hero-metric-cards {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Compact metric chips (Menoa-style small indicator cards) */
.hero-metric-cards--grid {
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
}

.hero-metric-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 4.25rem;
  padding: 0.55rem 0.45rem;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.hero-metric-value {
  font-family: var(--font);
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}

.hero-metric-name {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-metric-chip .hero-metric-value {
  font-size: clamp(1.3rem, 3.2vw, 1.55rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--accent);
}
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}
.btn-ghost {
  background: var(--bg-elevated);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
  max-width: 28rem;
}
.metric {
  padding: 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.metric strong {
  display: block;
  font-family: var(--font);
  font-size: 1.75rem;
  color: var(--ink);
}
.metric span {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Sections */
section {
  padding: var(--section-pad-y) var(--section-pad-x);
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}
section.alt {
  background: transparent;
  border: none;
}

.section-head {
  margin-bottom: 1.5rem;
  max-width: 100%;
  width: 100%;
}
.section-head h2 {
  font-family: var(--font);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 600;
  margin: 0 0 0.35rem;
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
  padding-bottom: 0;
  border-bottom: none;
  color: var(--ink);
}
.section-head p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 100%;
  line-height: 1.65;
  letter-spacing: -0.01em;
}
/* Section subtitle under h2 (outside cards) — slightly larger than card body */
.section-head .section-desc {
  margin: 0.65rem 0 0;
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.65;
  max-width: 100%;
  letter-spacing: -0.012em;
  font-weight: 400;
}

/* Unified content surfaces — Superior-style flat white panels (tighter vertical padding) */
main section:not(.hero) .cv-block {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 1rem 1.5rem 0.95rem;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

main section:not(.hero) .cv-block .cv-list:last-child {
  margin-bottom: 0;
}

/* Readable wrapping — use full container width first; break-word only for overflow tokens / long strings */
main section:not(.hero) .cv-block,
main section:not(.hero) .cv-block .cv-list li,
main section#research .cv-block,
main section#research .cv-block .cv-list li,
main section#teaching .cv-block,
main section#teaching .cv-block .cv-list li,
main section#professional-services .cv-block,
main section#quantitative .cv-block,
main section#training .cv-block {
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: manual;
}
main section:not(.hero) .cv-block a {
  overflow-wrap: anywhere;
}

.hero-intro-copy p,
.hero-intro-copy a {
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: manual;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 44rem;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.tag {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

/* Cards — PDF / contact (template card: border + light lift on hover) */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  main section .card:hover {
    box-shadow: var(--shadow-sm);
    border-color: #d4d4d8;
    transform: translateY(-2px);
  }
}
.card h3 {
  font-family: var(--font);
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
  font-weight: 600;
}
.card .meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.65rem;
  font-size: 0.85rem;
}
.card-links a {
  font-weight: 500;
}

.pub-item {
  padding: 1.1rem 0;
  border-bottom: none;
}
.pub-item h3 {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  line-height: 1.45;
}
.corresponding-note {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.authors-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.35rem 0 0.2rem;
}

.pub-item .authors {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.pub-item .venue {
  font-size: 0.85rem;
  color: var(--muted);
}
.pub-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0;
}
.mini-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* Research Output — single panel + segmented tabs (Superior / integrations-style) */
/* Research Output — inner stack (tabs + panels); Research/Teaching Experience use .cv-block for outer card + .pub-entry dividers */
#research-output .research-output-stack {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-xs);
  padding: 1rem 1.15rem 0.5rem;
  max-width: 100%;
}

/* Pub tabs — gray track + white pill (segmented control) */
.pub-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.3rem;
  margin: 0 0 1rem;
  padding: 0.35rem;
  background: var(--bg-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: none;
}
.pub-tab {
  position: relative;
  flex: 1 1 160px;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  margin: 0;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  font-size: clamp(0.6875rem, 2.2vw, 0.8125rem);
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  color: var(--muted);
  box-shadow: none;
  line-height: 1.35;
  letter-spacing: -0.02em;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.pub-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.45);
}
.pub-tab[aria-selected="true"] {
  background: var(--bg-elevated);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.pub-tab[aria-selected="true"]::after {
  display: none;
}
.pub-tab:focus-visible {
  outline: 2px solid var(--accent-link);
  outline-offset: 2px;
}
.pub-panel {
  display: none;
}
.pub-panel.active {
  display: block;
}

/* Publication / stacked rows — vertical rhythm + hairline between items */
.pub-entry {
  margin: 0;
  padding: var(--pub-entry-pad-y) 0;
  border-bottom: 1px solid var(--divider-row);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.pub-entry:last-of-type {
  border-bottom: none;
  padding-bottom: var(--pub-entry-pad-y-edge);
}
/* No line under the last item of a subgroup (e.g. before next h3 group title in Research Output) */
.pub-entry:has(+ h3.pub-subhead) {
  border-bottom: none;
}
/* Research Experience: explicit row dividers (avoids trailing-text-node :last-child quirks) */
#research .cv-block > article.pub-entry:not(:last-of-type) {
  border-bottom: 1px solid var(--divider-row);
}
#research .cv-block > article.pub-entry:last-of-type {
  border-bottom: none;
}
/* First/last row: align with card padding (Teaching, Services, etc.) */
main section:not(.hero) .cv-block > .pub-entry:first-of-type {
  padding-top: var(--pub-entry-pad-y-edge);
}
main section:not(.hero) .cv-block > .pub-entry:last-of-type {
  padding-bottom: var(--pub-entry-pad-y-edge);
}
#research-output .pub-panel > .pub-entry:first-of-type {
  padding-top: var(--pub-entry-pad-y-edge);
}

#research .cv-block .pub-entry .cv-list,
#teaching .cv-block .pub-entry .cv-list,
#professional-services .pub-entry .cv-list,
#training .pub-entry .cv-list {
  margin-top: var(--pub-entry-pad-y);
  margin-bottom: 0;
}
#quantitative .pub-entry .qty-line-list {
  margin-top: var(--pub-entry-pad-y);
  margin-bottom: 0;
}
.pub-entry > .services-sub:first-child {
  margin-top: 0;
}
.pub-entry .cv-verbatim {
  margin-bottom: 0.45rem;
}
.pub-entry .cv-verbatim:last-of-type {
  margin-bottom: 0;
}
.pub-entry .cv-link {
  margin: 0.35rem 0 0;
  padding-top: 0.35rem;
  border-top: none;
}
/* PDF block */
.pdf-section .pdf-grid {
  display: grid;
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
}
@media (min-width: 880px) {
  .pdf-section .pdf-grid {
    grid-template-columns: 1fr 1.2fr;
    align-items: start;
  }
}
.pdf-card {
  padding: 1.5rem;
}
.pdf-card ul {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.pdf-viewer-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #f4f4f5;
  min-height: 480px;
  box-shadow: var(--shadow-sm);
}
.pdf-viewer-wrap embed {
  width: 100%;
  height: min(70vh, 640px);
  display: block;
}

/* Timeline simple */
.timeline-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: none;
}
.timeline-item:last-of-type {
  padding-bottom: 0.35rem;
}
@media (max-width: 600px) {
  .timeline-item {
    grid-template-columns: 1fr;
  }
}
.timeline-item .year {
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--accent-link);
}

/* Grid skills */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.skill-grid h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}
.skill-grid ul {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.88rem;
  color: var(--ink);
}

/* Footer */
footer {
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
  background: var(--bg);
}

footer a {
  color: var(--muted);
}

/* Mobile: drawer nav（遮罩须低于全屏菜单，否则链接无法点击） */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 18, 15, 0.15);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
body.nav-menu-open .nav-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
body.nav-menu-open {
  overflow: hidden;
}
@media (min-width: 721px) {
  body.nav-menu-open .nav-backdrop {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  /* 桌面端汉堡按钮不占位、不可见（修复导航栏中间异常灰条） */
  .nav-toggle {
    display: none !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
}

@media (max-width: 720px) {
  /* 菜单打开时顶栏叠在遮罩之上；全屏 nav 才能接收点击 */
  body.nav-menu-open .site-header {
    z-index: 300;
  }
  /* 避免 backdrop-filter 影响子元素 position:fixed 在部分 WebKit 下的表现 */
  .site-header.nav-open {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(247, 245, 242, 0.98);
  }
  /* 打开菜单后顶栏里的 logo/汉堡与全屏层重叠，会挡住下方链接点击，故隐藏（全屏内已有品牌与关闭） */
  .site-header.nav-open .brand,
  .site-header.nav-open .nav-toggle {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
  }
  .site-header {
    flex-wrap: nowrap;
    height: var(--nav-h);
    padding: 0 0.75rem 0 1rem;
  }
  .nav-toggle {
    display: inline-flex;
    flex-shrink: 0;
    margin-left: auto;
  }
  /* 顶栏仅保留 logo + 汉堡；链接收进全屏层 */
  .nav-links {
    display: none;
    flex-wrap: nowrap;
    margin-left: 0;
  }
  .site-header.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    position: fixed;
    inset: 0;
    z-index: 50;
    min-height: 100dvh;
    min-height: 100vh;
    margin: 0;
    padding: max(env(safe-area-inset-top, 0px), 1rem) 1.5rem max(env(safe-area-inset-bottom, 0px), 1.5rem);
    gap: 0;
    background-color: var(--bg);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: none;
    border: none;
    pointer-events: auto;
  }
  .nav-link-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 auto;
    width: 100%;
    gap: 0.25rem;
    padding: 0;
  }
  .nav-mobile-head {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-shrink: 0;
    padding-bottom: 1.25rem;
    margin-bottom: 1rem;
    border-bottom: none;
  }
  .nav-mobile-brand {
    position: relative;
    z-index: 2;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
    touch-action: manipulation;
  }
  .nav-mobile-brand:hover {
    opacity: 0.85;
    text-decoration: none;
  }
  .nav-close {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-elevated);
    cursor: pointer;
    font-family: var(--font);
    color: var(--ink);
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-close:hover {
    background: var(--accent-soft);
  }
  .nav-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  .nav-close-icon {
    position: relative;
    display: block;
    width: 18px;
    height: 18px;
  }
  .nav-close-icon::before,
  .nav-close-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 2px;
    border-radius: 1px;
    background: var(--ink);
  }
  .nav-close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }
  .nav-close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }
  .nav-link-list a {
    display: block;
    width: 100%;
    padding: 0.85rem 0;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--ink);
    border: none;
    text-decoration: none;
    position: relative;
    z-index: 2;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(30, 58, 95, 0.12);
    touch-action: manipulation;
  }
  .nav-link-list a:hover {
    color: var(--accent);
    text-decoration: none;
    background: transparent;
  }
  .nav-links .nav-cta {
    display: inline-flex;
    align-self: stretch;
    justify-content: center;
    margin-top: auto;
    padding: 0.85rem 1.25rem;
    font-size: 0.9375rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--ink);
    color: #fff !important;
    position: relative;
    z-index: 2;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.15);
  }
  .nav-links .nav-cta:hover {
    opacity: 0.92;
    color: #fff !important;
  }
  .metrics {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  .hero-metric-cards--grid {
    gap: 0.45rem;
  }
  .hero-metric-chip {
    min-height: 3.85rem;
    padding: 0.45rem 0.3rem;
  }
  .hero-metric-value {
    font-size: 1.25rem;
  }
}

/* Word-aligned CV blocks */
.cv-verbatim {
  margin: 0 0 0.65rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.cv-verbatim:last-child {
  margin-bottom: 0;
}
.cv-block .cv-verbatim strong {
  font-weight: 600;
}
.cv-block {
  max-width: 100%;
}
.cv-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  list-style-type: disc;
  list-style-position: outside;
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.65;
}
.cv-list li {
  margin-bottom: 0.35rem;
}
.training-list li {
  margin-bottom: 0.25rem;
}
.cv-link {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  word-break: break-all;
}
.cv-link:last-child {
  margin-bottom: 0;
}
/* Research Output — Presentations & working papers group titles (match .services-sub, flat) */
.pub-subhead {
  margin: 1.35rem 0 0.4rem;
  padding: 0;
  font-size: var(--type-subsection);
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  border: none;
  background: none;
  border-radius: 0;
}
#panel-other .pub-subhead:first-child {
  margin-top: 0;
  margin-bottom: 0.4rem;
}
/* First publication row under each group title — match compact card rhythm */
#panel-other > .pub-entry:first-of-type,
#panel-other .pub-subhead + .pub-entry {
  padding-top: var(--pub-entry-pad-y-edge);
}

/* Subsection titles (Services, Quantitative categories, Workshops/Courses, etc.) — 20px site-wide */
.services-sub {
  margin: 1.35rem 0 0.55rem;
  padding: 0.35rem 0;
  font-size: var(--type-subsection);
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  border: none;
}
.services-sub:first-child {
  margin-top: 0;
}
.services-block .cv-verbatim {
  margin-bottom: 0.35rem;
}

/* Teaching Experience — role line (e.g. Guest Lecturer | …) at 20px */
#teaching .pub-entry > p.cv-verbatim:first-child strong {
  font-size: var(--type-subsection);
  line-height: 1.3;
  font-weight: 600;
}

/* Education — degree line (first line of each entry) at 20px; body lines stay default */
#education .pub-entry > p.cv-verbatim:first-child {
  font-size: var(--type-subsection);
  font-weight: 600;
  line-height: 1.35;
}

.contact-card .cv-verbatim {
  margin-bottom: 0.5rem;
}

#contact .contact-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Research output — footnote strip (inside stack, not a second floating card) */
.module-note {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.55;
  background: var(--bg-muted);
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: none;
  max-width: none;
}
#research-output .module-note {
  margin-top: 0.15rem;
}

/* Quantitative — same disc bullets as Training / Services lists (Fig. 2) */
.qty-line-list {
  list-style-type: disc;
  list-style-position: outside;
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}
.qty-line-list li {
  margin: 0 0 0.4rem;
  padding-left: 0;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ink);
  word-break: normal;
  overflow-wrap: break-word;
  display: list-item;
}
.qty-line-list li:last-of-type {
  margin-bottom: 0;
}
.cv-block > .qty-line-list:last-child {
  margin-bottom: 0;
}

/* H5 — Research Output: horizontal tab scroll, tighter stack */
@media (max-width: 768px) {
  #research-output .research-output-stack {
    padding: 1rem 0.75rem 0.35rem;
    border-radius: var(--radius-lg);
  }
  #research-output .pub-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border-radius: var(--radius-lg);
    gap: 0.25rem;
    padding: 0.3rem;
  }
  .pub-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    min-width: min-content;
    padding: 0.5rem 0.85rem;
  }
}
@media (max-width: 480px) {
  #research-output .research-output-stack {
    padding: 0.75rem 0.6rem 0.25rem;
  }
}

/* Safe area (notch / home indicator) */
@supports (padding: max(0px)) {
  .site-header {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
  }
  section,
  .hero {
    padding-left: max(var(--section-pad-x), env(safe-area-inset-left));
    padding-right: max(var(--section-pad-x), env(safe-area-inset-right));
  }
  footer {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
}
