/* v2 — Hero + horizontal menu + tabbed content */

* { box-sizing: border-box; }
a { color: inherit; text-decoration: none; }

body {
  margin: 0; min-height: 100svh;
  background:
    linear-gradient(135deg, var(--warm-overlay), transparent 30%),
    linear-gradient(315deg, var(--cool-overlay), transparent 38%),
    var(--bg);
  color: var(--text);
}

/* ============================================================
   HERO — wide bridge fire image
   ============================================================ */
/* Unified type — sans only across the page (sole exception: hero title) */
h1, h2, h3, h4 { font-family: var(--font-sans); font-style: normal; letter-spacing: -0.005em; }
body[data-lang="en"] .pub-item em,
body[data-lang="en"] .publication-list em { font-weight: 500; }

.hero {
  position: relative;
  width: 100%;
  height: 230px;
  overflow: hidden;
  background: #0a1224;
}
.hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 55%;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,18,36,0) 55%, rgba(10,18,36,0.55) 100%),
    linear-gradient(90deg, rgba(10,18,36,0.35) 0%, transparent 35%);
  pointer-events: none;
}
.hero-overlay {
  position: absolute;
  left: 50%; right: auto; bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--page-max);
  padding: 18px 28px 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  color: #fff;
  box-sizing: border-box;
}
.hero-name { display: flex; flex-direction: column; gap: 4px; }
.hero-name .eyebrow {
  color: rgba(255,255,255,0.96); font-weight: 700;
  font-size: clamp(1.4rem, 2.4vw, 2rem); letter-spacing: 0;
  text-transform: none;
  margin: 0; line-height: 1.25;
  font-family: var(--font-serif);
  text-shadow: 0 1px 12px rgba(0,0,0,0.5);
}
.hero-name .eyebrow span { display: block; }
.hero-name h1 {
  font-size: clamp(1.7rem, 2.8vw, 2.3rem);
  font-weight: 700;
  line-height: 1; margin: 0;
  text-shadow: 0 2px 24px rgba(0,0,0,0.4);
}
.hero-name .tag {
  font-size: 0.95rem; font-weight: 600;
  color: rgba(255,255,255,0.88);
  margin: 0; margin-top: 2px;
}
.hero-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  font-size: 0.78rem; color: rgba(255,255,255,0.75);
}
.hero-meta strong { color: #fff; font-weight: 700; }
.hero-actions { display: flex; gap: 8px; margin-top: 4px; }
.hero-actions a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 0.78rem; font-weight: 700;
  backdrop-filter: blur(6px);
  transition: background 150ms ease;
}
.hero-actions a:hover { background: rgba(255,255,255,0.22); color: #fff; }

/* ============================================================
   NAV BAR — horizontal menu directly below hero
   ============================================================ */
.menubar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line-soft), 0 8px 22px rgba(23,32,51,0.04);
}
.menu {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 54px;
}
.menu-brand {
  display: flex; align-items: center; gap: 10px;
  padding-right: 18px; border-right: 1px solid var(--line);
  margin-right: 6px;
}
.brand-mark {
  display: grid; width: 32px; height: 32px; place-items: center;
  border-radius: 50%; background: var(--brand); color: #fff;
  font-weight: 900; font-size: 16px;
  line-height: 1;
}
.menu-brand strong {
  font-size: 0.95rem; line-height: 1.1;
  color: var(--text); font-weight: 700;
}
.menu-brand small { display: block; color: var(--text-muted); font-size: 0.72rem; margin-top: 1px; }

.menu-tabs {
  display: flex; align-items: center;
  flex: 1;
  gap: 4px;
  padding-left: 0;
}
.tab-btn {
  position: relative;
  display: inline-flex; align-items: center;
  padding: 0 14px; height: 34px; margin: 0;
  border: 0; background: transparent;
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
  letter-spacing: 0;
  transition:
    color 240ms cubic-bezier(0.22, 0.61, 0.36, 1),
    background-color 240ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 140ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.tab-btn:hover:not(.is-active) {
  color: var(--text);
  background-color: var(--ink-100);
}
.tab-btn:active { transform: scale(0.96); }
.tab-btn.is-active {
  color: var(--brand);
  font-weight: 700;
  background-color: var(--brand-soft);
}
.mobile-menu {
  display: none;
}

.menu-end {
  display: flex; align-items: center; gap: 10px;
  padding-left: 14px;
}
.nav-email {
  border-radius: var(--radius); background: var(--navy-700); color: #fff;
  font-size: 0.85rem; font-weight: 700; padding: 7px 14px;
  border: 0; cursor: pointer; font-family: inherit;
  transition: background 150ms, transform 100ms;
}
.nav-email:hover { background: var(--navy-800); color: #fff; }
.nav-email:active { transform: scale(0.98); }
.lang-switch {
  position: relative;
  display: inline-flex; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); padding: 3px;
  overflow: hidden;
}
.lang-switch::before {
  content: "";
  position: absolute;
  top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px);
  background: var(--brand);
  border-radius: 6px;
  z-index: 0;
  transition: transform 380ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.lang-switch[data-active="en"]::before {
  transform: translateX(100%);
}
.lang-switch button {
  position: relative; z-index: 1;
  flex: 1; min-width: 42px; border: 0; border-radius: 6px; background: transparent;
  color: var(--text-muted); cursor: pointer; font-family: inherit;
  font-size: 0.78rem; font-weight: 800; padding: 4px 8px;
  transition: color 280ms cubic-bezier(0.22, 0.61, 0.36, 1), transform 140ms ease;
}
.lang-switch button:hover:not(.is-active) { color: var(--text); }
.lang-switch button.is-active { color: #fff; }
.lang-switch button:active { transform: scale(0.95); }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 22px 22px 36px;
}

/* tab fade */
.tab-panel {
  animation: fadeUp 220ms ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
}
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin: 0 0 16px;
}
.section-head .titles { display: flex; flex-direction: column; gap: 4px; }
.section-head h2 {
  font-size: 1.8rem; font-weight: 700; line-height: 1.05; margin: 0;
}

/* ============================================================
   HOME TAB
   ============================================================ */
.home-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}

/* carousel */
.carousel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a1224;
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
}
.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 600ms cubic-bezier(0.4, 0.0, 0.2, 1);
}
.carousel-slide {
  flex: 0 0 100%; height: 100%; min-width: 0;
  display: block; cursor: pointer;
}
.carousel-slide img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.carousel-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 20px;
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, transparent 100%);
  color: #fff; pointer-events: auto;
  display: block; text-decoration: none; cursor: pointer;
}
.carousel-overlay .eyebrow {
  color: rgba(255,255,255,0.7); font-size: 0.7rem; margin: 0 0 4px;
}
.carousel-overlay h3 {
  font-size: 1.15rem; font-weight: 700;
  margin: 0; line-height: 1.2;
}
.carousel-overlay p {
  font-size: 0.78rem; color: rgba(255,255,255,0.78);
  margin: 4px 0 0; max-width: 460px;
}
.carousel-dots {
  position: absolute; left: 0; right: 0; top: 14px;
  display: flex; justify-content: center; gap: 6px;
  z-index: 2;
}
.carousel-dots button {
  width: 26px; height: 3px; border: 0; padding: 0;
  background: rgba(255,255,255,0.35); cursor: pointer; border-radius: 2px;
  transition: background 200ms;
}
.carousel-dots button.is-active { background: #fff; width: 38px; }
.carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; cursor: pointer; z-index: 2;
  display: grid; place-items: center;
  backdrop-filter: blur(4px);
  transition: background 150ms;
}
.carousel-nav:hover { background: rgba(0,0,0,0.65); color: #fff; }
.carousel-nav.prev { left: 12px; }
.carousel-nav.next { right: 12px; }

.research-aside h3 {
  font-size: 1.2rem; font-weight: 700; line-height: 1.15;
  margin: 0 0 4px;
}
.research-aside .lede {
  color: var(--text-body); font-size: 0.92rem; line-height: 1.55;
  margin: 0 0 14px;
}
.directions { display: grid; gap: 10px; }
.direction {
  display: grid; grid-template-columns: 28px 1fr;
  gap: 10px; align-items: baseline;
}
.direction .idx {
  font-family: var(--font-mono); color: var(--brand);
  font-size: 0.72rem; font-weight: 800; padding-top: 4px;
}
.direction b {
  display: block; color: var(--text); font-weight: 700; font-size: 0.92rem;
}
.direction span {
  display: block; color: var(--text-muted); font-size: 0.78rem;
  line-height: 1.45; margin-top: 1px;
}

/* Home — 最新动态列表 */
.updates-aside .eyebrow { margin: 0 0 14px; }
.updates-list { list-style: none; margin: 0; padding: 0; display: grid; }
.updates-list li { border-top: 1px solid var(--line-soft); }
.updates-list li:first-child { border-top: none; }
.updates-list a {
  display: grid; grid-template-columns: 52px 1fr;
  gap: 12px; align-items: baseline;
  padding: 13px 0; text-decoration: none;
  transition: opacity 160ms;
}
.updates-list a:hover { opacity: 0.78; }
.updates-list a:hover .u-text { color: var(--brand); }
.updates-list .u-date {
  font-family: var(--font-mono); color: var(--brand);
  font-size: 0.72rem; font-weight: 800; padding-top: 2px;
}
.updates-list .u-text {
  color: var(--text); font-size: 0.9rem; line-height: 1.5;
  transition: color 160ms;
}

/* ============================================================
   PERSONAL INFO TAB
   ============================================================ */
.cv-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-areas: "profile timeline";
  gap: 24px;
}
.cv-profile { grid-area: profile; }
.cv-portrait img {
  width: 100%; aspect-ratio: 0.78;
  border-radius: var(--radius);
  object-fit: cover; object-position: center top;
  border: 1px solid var(--line);
}
.cv-name {
  margin-top: 14px;
}
.cv-name h2 {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 700; margin: 0; line-height: 1.05;
}
.cv-name .role { color: var(--navy-700); font-weight: 600; font-size: 0.9rem; margin: 4px 0 0; }
.cv-name .org { color: var(--text-muted); font-size: 0.82rem; margin: 6px 0 0; line-height: 1.4; }

.timeline { display: grid; gap: 18px; grid-area: timeline; }
.tl-section h4 {
  display: flex; align-items: baseline; gap: 12px;
  font-family: var(--font-sans);
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--brand); font-weight: 800;
  margin: 0 0 8px;
}
.tl-section h4::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.tl-item {
  display: grid; grid-template-columns: 130px 1fr;
  gap: 14px; padding: 6px 0;
}
.tl-item + .tl-item { border-top: 1px solid var(--line-soft); }
.tl-item .when {
  font-family: var(--font-sans); font-size: 0.78rem;
  color: var(--navy-700); font-weight: 700; padding-top: 2px;
}
.tl-item .what .what-title {
  display: block; color: var(--text); font-weight: 500; font-size: 0.9rem;
}
.tl-item .what span {
  display: block; color: var(--text-muted); font-size: 0.8rem;
  line-height: 1.45; margin-top: 2px;
}

.awards-list {
  display: grid; gap: 8px; margin: 0; padding: 0; list-style: none;
}
.awards-list li {
  display: grid; grid-template-columns: 16px 1fr auto;
  gap: 10px; align-items: baseline;
  font-size: 0.86rem; color: var(--text-body); line-height: 1.4;
  padding: 6px 0; border-bottom: 1px solid var(--line-soft);
}
.awards-list li:last-child { border-bottom: 0; }
.awards-list .bullet { color: var(--brand); font-weight: 800; }
.awards-list .year { font-family: var(--font-sans); font-size: 0.76rem; color: var(--text-muted); }

/* ============================================================
   RESEARCH TAB
   ============================================================ */
.research-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Research — 代表性论文两列（从左到右换行，每列竖向间距相等） */
.paper-masonry {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  align-items: start;
}
.paper-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.paper-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: transform 220ms cubic-bezier(.22,.61,.36,1), box-shadow 220ms cubic-bezier(.22,.61,.36,1), border-color 220ms;
}
.paper-card:hover {
  transform: translateY(-4px);
  border-color: var(--line);
  box-shadow: 0 14px 34px -10px rgba(23,32,51,0.18), 0 4px 10px -4px rgba(23,32,51,0.08);
}
.paper-card .paper-text {
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
}
.paper-card .paper-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px dashed var(--line);
  border-radius: calc(var(--radius) - 4px);
  background: var(--surface, #f7f7f5);
  display: flex; align-items: center; justify-content: center;
}
.paper-card .paper-media.has-img {
  border-style: solid;
  aspect-ratio: auto;
  overflow: hidden;
  display: block;
}
.paper-card .paper-media.has-img img {
  width: 100%; height: auto; display: block;
}
.paper-card .paper-media::before {
  content: attr(data-placeholder);
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.04em;
  color: var(--text-muted, #9a9a96);
}
.paper-card .paper-media.has-img::before { content: none; }
.paper-card .paper-venue {
  font-family: var(--font-sans);
  font-size: 0.74rem; letter-spacing: 0.01em;
  color: var(--brand); font-weight: 700;
}
.paper-card h3 {
  font-weight: 700; margin: 0; line-height: 1.3;
}
.paper-card h3 a { color: inherit; text-decoration: none; }
.paper-card h3 a:hover { color: var(--brand); text-decoration: underline; }
.paper-card .paper-authors {
  color: var(--text-muted, #6b6b66); font-size: 0.8rem; font-style: italic; margin: 0;
}
.paper-card p {
  color: var(--text-body); font-size: 0.82rem; line-height: 1.55; margin: 0;
}
.paper-card .paper-body { white-space: pre-line; }
.paper-card .paper-hint {
  color: var(--text-muted, #9a9a96); font-style: italic;
}
.research-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: transform 220ms cubic-bezier(.22,.61,.36,1), box-shadow 220ms cubic-bezier(.22,.61,.36,1), border-color 220ms;
}
.research-card:hover {
  transform: translateY(-4px);
  border-color: var(--line);
  box-shadow: 0 14px 34px -10px rgba(23,32,51,0.18), 0 4px 10px -4px rgba(23,32,51,0.08);
}
.research-card .num {
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--brand); font-weight: 800;
  letter-spacing: 0.04em;
}
.research-card h3 {
  font-size: 1.05rem;
  font-weight: 700; margin: 0; line-height: 1.25;
}
.research-card p {
  color: var(--text-body); font-size: 0.85rem; line-height: 1.55;
  margin: 0;
}
.research-card .tags {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-top: 4px; padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.research-card .tags span {
  font-size: 0.7rem; padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft); color: var(--brand);
  font-weight: 700;
}

/* ============================================================
   PUBLICATIONS TAB
   ============================================================ */
.pub-section { margin: 0 0 28px; }
.pub-section:last-child { margin-bottom: 0; }
.pub-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin: 0 0 14px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}
.pub-section-head h2 {
  font-family: inherit;
  font-size: 0.95rem; font-weight: 600; line-height: 1.1; margin: 0;
  color: var(--text);
  letter-spacing: 0;
}
.pub-filters { display: flex; gap: 6px; }
.pub-filters button {
  padding: 5px 11px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: #fff;
  font-family: inherit; font-size: 0.78rem; font-weight: 700;
  color: var(--text-muted); cursor: pointer;
  transition: all 150ms ease;
}
.pub-filters button:hover { color: var(--text); border-color: var(--ink-500); }
.pub-filters button.is-active {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.pub-count { color: var(--text-muted); font-size: 0.78rem; font-weight: 700; }

.pub-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.pub-empty {
  margin: 6px 0 0;
  padding: 18px 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  text-align: left;
}
.pub-item {
  display: grid; grid-template-columns: 28px 1fr 90px;
  gap: 10px; align-items: baseline;
  padding: 4px 0;
}
.pub-item .num {
  font-family: var(--font-mono); font-size: 0.88rem;
  color: var(--text-muted); font-weight: 500;
  text-align: right;
}
.pub-item .body {
  font-size: 0.88rem; line-height: 1.45; color: var(--text-body);
}
.pub-item .authors { color: var(--text-body); }
.pub-item .pub-link {
  color: var(--navy-700);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}
.pub-item .pub-link:hover {
  color: var(--brand);
  border-bottom-color: currentColor;
}
.pub-item .author.me {
  font-weight: 600;
}
.pub-item .body em,
.pub-item .body .journal {
  font-style: italic;
  color: var(--text-body); font-weight: 500;
}
.pub-item .lang-note {
  color: var(--text-muted); font-style: normal;
  font-size: 0.82rem;
}
.pub-item .badge {
  justify-self: end;
  font-size: 0.7rem; font-weight: 800;
  padding: 3px 8px; border-radius: var(--radius-pill);
  background: var(--brand-soft); color: var(--brand);
  white-space: nowrap;
}
.pub-item .badge.spacer {
  background: transparent; padding: 0;
}

/* ============================================================
   OPEN DATA TAB
   ============================================================ */
.data-grid {
  display: grid; grid-template-columns: 1fr; gap: 14px;
}
.data-card {
  display: grid; grid-template-columns: 48px 1fr;
  gap: 14px; align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: transform 220ms cubic-bezier(.22,.61,.36,1), box-shadow 220ms cubic-bezier(.22,.61,.36,1), border-color 220ms;
}
.data-card:hover {
  transform: translateY(-4px);
  border-color: var(--line);
  box-shadow: 0 14px 34px -10px rgba(23,32,51,0.18), 0 4px 10px -4px rgba(23,32,51,0.08);
}
.data-icon {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: var(--brand-soft); color: var(--brand);
  font-family: var(--font-mono); font-weight: 800; font-size: 0.74rem;
  letter-spacing: 0.04em;
}
.data-icon[data-kind="data"] {
  background: var(--brand-soft); color: var(--brand);
}
.data-icon[data-kind="code"] {
  background: var(--ink-200); color: var(--navy-700);
}
.data-card h3 {
  font-family: var(--font-sans); font-size: 0.98rem; font-weight: 700;
  margin: 0 0 4px;
}
.data-card h3 .data-title-link {
  color: var(--navy-700);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}
.data-card h3 .data-title-link:hover {
  color: var(--brand);
  border-bottom-color: currentColor;
}
.data-card p {
  color: var(--text-muted); font-size: 0.82rem; line-height: 1.45;
  margin: 0 0 8px;
}
.data-card .meta {
  display: flex; gap: 12px; font-size: 0.72rem; color: var(--text-muted);
  font-family: var(--font-mono);
}
.data-card .meta strong { color: var(--text); font-weight: 700; }
.data-card .link {
  display: inline-block; margin-top: 6px;
  color: var(--brand); font-weight: 800; font-size: 0.78rem;
}
.data-card .link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   TEACHING TAB
   ============================================================ */
.course-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.course-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: transform 220ms cubic-bezier(.22,.61,.36,1), box-shadow 220ms cubic-bezier(.22,.61,.36,1), border-color 220ms;
}
.course-card:hover {
  transform: translateY(-4px);
  border-color: var(--line);
  box-shadow: 0 14px 34px -10px rgba(23,32,51,0.18), 0 4px 10px -4px rgba(23,32,51,0.08);
}
.course-card .level {
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 800;
  color: var(--brand); text-transform: uppercase; letter-spacing: 0.06em;
}
.course-card h3 {
  font-size: 1rem; font-weight: 700;
  margin: 0; line-height: 1.2;
}
.course-card .code {
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-muted);
}
.course-card p {
  color: var(--text-body); font-size: 0.82rem; line-height: 1.5;
  margin: 6px 0 0;
}
.course-card .footer {
  margin-top: auto; padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: flex; gap: 14px;
  font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono);
}

.teaching-note {
  margin-top: 18px; padding: 14px 18px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.teaching-note p {
  margin: 0; font-size: 0.86rem; line-height: 1.55;
  color: var(--text);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  display: flex; justify-content: space-between; gap: 16px;
  max-width: var(--page-max); margin: 0 auto;
  padding: 0 22px 18px;
  color: var(--text-muted); font-size: 0.78rem;
}
.site-footer a { color: var(--navy-700); font-weight: 700; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--navy-800); color: #fff;
  font-size: 0.85rem; font-weight: 600;
  padding: 10px 16px; border-radius: var(--radius);
  box-shadow: var(--shadow-card); z-index: 100;
  animation: toastIn 200ms ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .home-grid { grid-template-columns: 1fr; }
  .cv-grid { grid-template-columns: 180px 1fr; gap: 18px; }
  .research-grid, .data-grid { grid-template-columns: 1fr; }
  .paper-masonry { grid-template-columns: 1fr; }
  .paper-col { gap: 18px; }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .menu { padding: 0 14px; min-height: auto; flex-wrap: wrap; }
  .menu-brand { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 0; margin: 0; }
  .menu-tabs { display: none; }
  .mobile-menu {
    display: block;
    width: 100%;
    margin: 8px 0;
  }
  .mobile-menu-toggle {
    position: relative;
    width: 100%;
    min-height: 40px;
    padding: 0 34px 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
  }
  .mobile-menu-toggle::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: translateY(-65%) rotate(45deg);
    transition: transform 160ms ease;
  }
  .mobile-menu.is-open .mobile-menu-toggle::after {
    transform: translateY(-35%) rotate(225deg);
  }
  .mobile-menu-panel {
    display: grid;
    gap: 4px;
    margin-top: 6px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-card);
  }
  .mobile-menu-panel button {
    min-height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
  }
  .mobile-menu-panel button.is-active {
    background: var(--brand-soft);
    color: var(--brand);
  }
  .tab-btn { padding: 10px 12px; }
  .menu-end { width: 100%; justify-content: space-between; padding: 8px 0 10px; border-top: 1px solid var(--line); }
  .hero-overlay { padding: 16px 18px; flex-direction: column; align-items: flex-start; }
  .hero-meta { align-items: flex-start; }
  .page { padding: 16px 14px 28px; }
  .cv-grid {
    display: flex;
    flex-direction: column;
  }
  .cv-profile { order: 1; }
  .cv-grid .timeline { order: 2; }
  .cv-portrait {
    max-width: 150px;
    margin: 4px auto 0;
  }
  .cv-name {
    text-align: center;
  }
  .course-grid { grid-template-columns: 1fr; }
  .pub-item { grid-template-columns: 28px 1fr; }
  .pub-item .badge { display: none; }
}

/* ============================================================
   CAP — text below the menu must not exceed the menu tab size (0.95rem)
   Applies to everything inside <main class="page">.
   ============================================================ */
.page { font-size: 0.95rem; }
.page h1,
.page h2,
.page h3,
.page h4,
.page h5,
.page h6,
.page .section-head h2,
.page .carousel-overlay h3,
.page .research-aside h3,
.page .cv-name h2,
.page .research-card h3,
.page .data-card h3,
.page .course-card h3,
.page .pub-section-head h2 {
  font-size: 0.95rem;
  line-height: 1.3;
}
