:root {
  --nav: #1d5fae;
  --nav-dark: #164980;
  --nav-text: #f2f7ff;
  --accent: #4a9be0;
  --accent-dark: #1e5f9b;
  --link: #185b9e;
  --soft: #e9f4ff;
  --ring: #5ba7e8;
  --rail-text: #0c2945;
  --text: #252525;
  --muted: #666;
  --line: #d6d6d6;
  --page-width: 1060px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font: 16px/1.5 Arial, Helvetica, sans-serif;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--nav-dark); }
img, video, iframe, embed, object { max-width: 100%; }
img, video { height: auto; }
button, input { font: inherit; }

.sitehead { min-height: 58px; color: #fff; background: var(--nav); }
.navwrap {
  width: min(var(--page-width), calc(100% - 34px));
  min-height: 58px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}
.sitename {
  flex: 0 0 auto;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.sitehead nav { display: flex; gap: 24px; font-size: 14px; }
.sitehead nav a { color: var(--nav-text); text-decoration: none; white-space: nowrap; }
.sitehead nav a:hover,
.sitehead nav a[aria-current="page"] { color: #fff; text-decoration: underline; }

.site-main {
  width: min(var(--page-width), calc(100% - 34px));
  margin: 26px auto 80px;
}
.article-main { width: min(900px, calc(100% - 34px)); }

h1, h2, h3, h4, h5, h6 { color: #202020; }
h1 { margin: 0 0 14px; font-size: 36px; line-height: 1.2; }
h2 {
  margin: 31px 0 15px;
  padding-bottom: 5px;
  font-size: 26px;
  line-height: 1.2;
  border-bottom: 1px solid var(--line);
}
h3 { margin: 29px 0 13px; font-size: 21px; line-height: 1.3; }
p { margin: 0 0 15px; }

/* Approved hybrid profile: Template A layout with Template C identity treatment. */
.profile {
  display: grid;
  grid-template-columns: 275px minmax(0, 1fr);
  gap: 45px;
  align-items: start;
}
.identity { padding: 4px 0 20px; text-align: center; }
.portrait {
  display: block;
  width: 172px;
  height: 172px;
  margin: 0 auto 16px;
  object-fit: cover;
  object-position: center 28%;
  background: #fff;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ring);
}
.identity h1 { margin: 0 0 4px; font-size: 24px; }
.chinese {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font: 400 18px/1.25 Georgia, "Times New Roman", serif;
}
.role { margin: 0; color: #444; font-size: 14px; line-height: 1.45; }
.contact { margin: 13px 0 0; font-size: 13px; line-height: 1.6; }
.identity-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 12px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.identity-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 1px;
  border-bottom: 1px solid currentColor;
  line-height: 1.2;
  text-decoration: none;
}
.identity-links i {
  width: 14px;
  font-size: 14px;
  line-height: 1;
  text-align: center;
}
.bio h2 { margin-top: 0; }
.bio p { margin: 0 0 15px; }
.notice { padding: 9px 11px; background: var(--soft); border-left: 4px solid var(--accent); }

.affiliations {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  margin: 18px 0 5px;
  text-align: center;
}
.affiliation {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.affiliation-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.affiliation-logo img {
  width: 64px;
  height: 64px;
  margin: 0;
  object-fit: contain;
}
.affiliation-name {
  font-size: 14px;
  line-height: 1.35;
  text-underline-offset: 2px;
}
.affiliation-date {
  margin-top: 2px;
  color: #4d4d4d;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
}

.news-scroll {
  max-height: 224px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1px 12px 1px 0;
  scrollbar-gutter: stable;
  border-bottom: 1px solid #ececec;
}
.news { list-style: none; padding: 0; margin: 0; }
.news li {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 12px;
  margin: 9px 0;
}
.news time { color: var(--muted); font-size: 14px; white-space: nowrap; }
.highlight { color: #9a1620; font-weight: 700; }
.scroll-note { margin: 7px 0 0; color: var(--muted); font-size: 12px; }

.homepage-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 267px;
  gap: 32px;
  align-items: start;
}
.homepage-lower-grid > * { min-width: 0; }
.visitor-map {
  min-height: 145px;
  padding: 10px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}
.visitor-map #mapmyvisitors-widget {
  max-width: 100%;
  margin: 0 auto !important;
  text-decoration: none;
}
.visitor-map .mapmyvisitors-map-container,
.visitor-map .mapmyvisitors-map {
  max-width: 100%;
}

@media (min-width: 841px) {
  .homepage-lower-grid { row-gap: 13px; }
  .homepage-lower-grid #publications { display: contents; }
  .homepage-lower-grid #publications > h2 {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 2px;
  }
  .homepage-lower-grid #publications .publication-list { display: contents; }
  .homepage-lower-grid #publications .pub:nth-child(1) {
    grid-column: 1;
    grid-row: 2;
  }
  .homepage-lower-grid #publications .pub:nth-child(2) {
    grid-column: 1;
    grid-row: 3;
  }
  .homepage-lower-grid #publications .pub:nth-child(3) {
    grid-column: 1 / -1;
    grid-row: 4;
  }
  .homepage-lower-grid #publications > p {
    grid-column: 1 / -1;
    grid-row: 5;
    margin: 3px 0 0;
  }
  .homepage-lower-grid .visitor-panel {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: stretch;
    display: grid;
    grid-template-rows: auto 1fr;
  }
  .homepage-lower-grid .visitor-panel > h2 { margin-bottom: 2px; }
  .homepage-lower-grid .visitor-map { align-self: center; }
}

.publication-list { display: flex; flex-direction: column; gap: 13px; }
.pub {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  min-height: 116px;
  border: 1px solid #dedede;
  background: #fff;
}
.venue-rail {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  background: var(--nav);
  color: var(--nav-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .025em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
}
.pubbody { padding: 14px 17px 13px; }
.pubtitle { margin-bottom: 5px; font-size: 17px; line-height: 1.35; font-weight: 700; }
.authors { color: #555; font-size: 14px; }
.publinks { margin-top: 8px; font-size: 13px; }
.publinks a { margin-right: 11px; }
.oral {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.site-footer {
  margin-top: 45px;
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 13px; }

/* Static inner pages */
.page-heading { margin-bottom: 26px; }
.page-heading h1 { margin-bottom: 8px; }
.page-kicker { margin: 0; color: var(--muted); font-size: 14px; }
.page-section { margin-bottom: 38px; }
.page-section > h2:first-child { margin-top: 0; }
.prose-narrow { max-width: 850px; }

.honors-list { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 18px 25px; }
.honor-year { color: #333; font-weight: 700; }
.honor-items { margin: 0; padding-left: 20px; }
.honor-items li { margin: 0 0 7px; }

.course-groups { display: grid; gap: 18px; }
.course-group { padding-bottom: 17px; border-bottom: 1px solid #ececec; }
.course-group h3 { margin: 0 0 5px; font-size: 17px; }
.course-group p { margin: 0; }
.course-list { display: grid; gap: 11px; }
.course-row { padding: 11px 0; border-bottom: 1px solid #ececec; }
.course-row p { margin: 0 0 7px; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.action,
.link-button,
button.collapsible,
button.collapsible1 {
  display: inline-block;
  width: auto !important;
  margin: 0 !important;
  padding: 5px 10px !important;
  color: var(--link) !important;
  background: #fff !important;
  border: 1px solid #a9c7e3 !important;
  border-radius: 3px !important;
  font-size: 13px !important;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
}
.action:hover,
.link-button:hover,
button.collapsible:hover,
button.collapsible1:hover { color: #fff !important; background: var(--nav) !important; }
.skills-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.skill-row { padding: 10px 12px; background: #f5f7f8; border-left: 3px solid var(--accent); }
.skill-row p { margin: 0; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 22px; }
.filter-bar .btn {
  padding: 7px 11px !important;
  color: var(--link) !important;
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: 3px;
  font-size: 13px;
  cursor: pointer;
}
.filter-bar .btn.active { color: #fff !important; background: var(--nav) !important; border-color: var(--nav) !important; }
.note-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.filterDiv {
  display: none;
  min-height: 84px;
  padding: 14px;
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-top: 3px solid var(--accent) !important;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4 !important;
  cursor: pointer;
}
.filterDiv.show { display: block; }
.filter-empty { margin: 12px 0 0; color: var(--muted); font-style: italic; }
.filter-empty[hidden] { display: none; }

#more,
#more1,
#more2 { display: none; }

/* Topic filters stay compact and scholarly; each topic keeps one muted color. */
.publication-filter-panel {
  margin: 0 0 20px;
  padding: 14px 16px 15px;
  background: #f8fafc;
  border: 1px solid #dce3ea;
}
.publication-filter-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}
.publication-filter-summary h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .015em;
}
#publication-filter-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}
.publication-filter-level {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}
.publication-filter-label {
  padding-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.publication-topic-level {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid #e0e6ec;
}
.publication-filter-level[hidden],
.publication-subfilters[hidden] { display: none !important; }
.publication-filters,
.publication-subfilters,
.paper-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.publication-filter,
.paper-tag {
  --tag-color: var(--nav);
  --tag-bg: #edf4fb;
  --tag-border: #b6cee4;
  display: inline-flex;
  align-items: center;
  color: var(--tag-color);
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: 999px;
  font-weight: 600;
  line-height: 1.25;
}
.publication-filter {
  min-height: 29px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}
.publication-filter:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(24, 50, 75, .12);
}
.publication-filter:focus-visible {
  outline: 2px solid var(--tag-color);
  outline-offset: 2px;
}
.publication-filter.is-active {
  color: #fff;
  background: var(--tag-color);
  border-color: var(--tag-color);
  box-shadow: 0 2px 6px rgba(24, 50, 75, .18);
}
.paper-tags { margin: 8px 0 10px; }
.paper-tag { padding: 2px 7px; font-size: 11px; }

.tag-all { --tag-color: #1d5fae; --tag-bg: #edf4fb; --tag-border: #b6cee4; }
.tag-optimization { --tag-color: #204f96; --tag-bg: #edf3fb; --tag-border: #b7c9e2; }
.tag-convex { --tag-color: #2856a6; --tag-bg: #eef3fc; --tag-border: #bbc9e8; }
.tag-stochastic { --tag-color: #0f6f78; --tag-bg: #edf8f8; --tag-border: #add4d7; }
.tag-nonconvex { --tag-color: #6d4aa2; --tag-bg: #f4f0fa; --tag-border: #cfc1e2; }
.tag-non-euclidean { --tag-color: #4557a6; --tag-bg: #f0f2fb; --tag-border: #c2c9e7; }
.tag-high-order { --tag-color: #7a448f; --tag-bg: #f7eff9; --tag-border: #d9c1df; }
.tag-composite { --tag-color: #14746f; --tag-bg: #edf8f6; --tag-border: #add8d3; }
.tag-distributed { --tag-color: #496a25; --tag-bg: #f2f7ed; --tag-border: #c8d9b6; }
.tag-saddle-point { --tag-color: #805217; --tag-bg: #fbf5eb; --tag-border: #e0c9a9; }
.tag-ai-safety { --tag-color: #9a1620; --tag-bg: #fcf0f1; --tag-border: #e7b5b9; }
.tag-llm { --tag-color: #126b52; --tag-bg: #edf8f4; --tag-border: #afd7ca; }
.tag-llm-post-training { --tag-color: #0d725f; --tag-bg: #edf8f5; --tag-border: #acd8cd; }
.tag-llm-uncertainty { --tag-color: #4f6d2d; --tag-bg: #f2f7ed; --tag-border: #c7d8b7; }
.tag-recommendation { --tag-color: #8a4b18; --tag-bg: #fbf3eb; --tag-border: #e3c4aa; }
.tag-reinforcement-learning { --tag-color: #2f6f3e; --tag-bg: #eff7f1; --tag-border: #bad5c0; }
.tag-computer-vision { --tag-color: #97450f; --tag-bg: #fcf3ec; --tag-border: #e6c1a7; }
.tag-robotics { --tag-color: #5b5f72; --tag-bg: #f2f3f6; --tag-border: #c9cbd3; }

/* Complete publications use a real static rail supplied by data-venue. */
.complete-publications { display: flex; flex-direction: column; gap: 13px; }
.publication-entry[hidden] { display: none !important; }
.publication-entry {
  position: relative;
  min-height: 116px;
  padding: 14px 17px 13px 68px !important;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dedede;
}
.publication-entry::before {
  content: attr(data-venue);
  position: absolute;
  inset: -1px auto -1px -1px;
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  background: var(--nav);
  color: var(--nav-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .025em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.publication-entry[data-status="preprint"]::before {
  background: #d9ebf8;
  color: #164980;
}
.publication-entry > h5:first-of-type {
  margin: 0 0 5px !important;
  color: #202020;
  font-size: 17px !important;
  line-height: 1.35;
}
.publication-entry > h6 {
  margin: 4px 0 !important;
  color: #555 !important;
  font-size: 14px !important;
  font-weight: 400;
  line-height: 1.4;
}
.publication-entry > h6 i { color: var(--accent-dark); }
.publication-entry > h6 .highlight i { color: inherit; }
.publication-entry img[style*="float"] { margin: 0 0 12px 18px !important; }

.content {
  display: none;
  margin: 11px 0 2px;
  padding: 12px 15px !important;
  overflow: hidden;
  background: #f7f9fb !important;
  border-left: 3px solid var(--accent);
  font-size: 14px;
}
.content.is-open { display: block; }
.content p { margin: 0 0 10px; }
.content iframe, .content embed { width: 100%; min-height: 520px; }

/* Legacy project content is preserved, but the chrome and typography are not. */
.projects-content > h2:first-child { margin-top: 0; }
.projects-content > h3 {
  clear: both;
  margin: 34px 0 12px;
  padding: 9px 0 7px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid #ececec;
  font-size: 21px;
}
.projects-content > h3 span[style*="float"] { color: var(--muted); font-size: 13px !important; font-weight: 400; }
.project-entry { padding: 15px 0 19px; overflow: hidden; border-bottom: 1px solid #ececec; }
.project-entry h5 { margin: 0 0 7px !important; font-size: 17px !important; line-height: 1.4; }
.project-entry h6 { margin: 0 0 10px !important; font-size: 15px !important; font-weight: 400; line-height: 1.55; }
.project-entry center { margin: 10px 0; }
.project-entry img, .project-entry video { max-width: 100%; }
.project-entry hr { border: 0; border-top: 1px solid #ececec; }

/* Articles */
.article-meta { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 22px; color: var(--muted); font-size: 13px; }
.article-back { text-decoration: none; }
.article-content { min-width: 0; }
.article-content > h2:first-of-type {
  margin: 0 0 16px !important;
  padding-bottom: 9px !important;
  background: transparent !important;
  font-size: 30px !important;
}
.article-content h2:not(:first-of-type) {
  margin: 28px 0 12px !important;
  background: transparent !important;
  font-size: 23px !important;
}
.article-content p {
  margin: 0 0 15px !important;
  font-size: 16px !important;
  line-height: 1.62;
}
.article-content center { max-width: 100%; margin: 12px 0 !important; overflow-x: auto; font-size: 16px !important; }
.article-content embed, .article-content iframe { width: 100%; min-height: 720px; }
.article-content link-button { color: var(--link) !important; cursor: pointer; text-decoration: underline; }
.inline-disclosure,
.audio-button {
  display: inline;
  margin: 0 2px;
  padding: 0;
  color: var(--link);
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.inline-disclosure { text-decoration: underline; text-underline-offset: 2px; }
.audio-button:hover,
.inline-disclosure:hover { color: var(--nav-dark); }
.back-top { margin-top: 24px; text-align: right; font-size: 13px; }
.document-card { padding: 18px; background: var(--soft); border-left: 4px solid var(--accent); }

@media (max-width: 840px) {
  .homepage-lower-grid { grid-template-columns: 1fr; }
  .visitor-panel {
    width: min(300px, 100%);
    justify-self: center;
  }
}

@media (max-width: 720px) {
  .navwrap {
    flex-wrap: wrap;
    gap: 5px 18px;
    padding: 9px 0 8px;
  }
  .sitehead nav {
    width: 100%;
    gap: 18px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .sitehead nav::-webkit-scrollbar { display: none; }
  .profile { grid-template-columns: 1fr; gap: 23px; }
  .visitor-panel {
    width: 100%;
    justify-self: stretch;
  }
  .visitor-map {
    width: min(300px, 100%);
    margin: 0 auto;
  }
  .identity {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    column-gap: 21px;
    align-items: center;
    text-align: left;
  }
  .portrait { width: 126px; height: 126px; margin: 0; grid-row: 1 / 6; }
  .identity h1 { align-self: end; }
  .chinese { margin: 0; }
  .role { align-self: start; }
  .contact { margin: 3px 0 0; }
  .identity-links { grid-column: 1 / -1; justify-content: flex-start; }
  .affiliations { grid-template-columns: repeat(3, 1fr); }
  .affiliation-date { white-space: normal; }
  .news li { grid-template-columns: 75px minmax(0, 1fr); }
  .pub { grid-template-columns: 40px minmax(0, 1fr); }
  .publication-entry { padding-left: 58px !important; }
  .publication-entry::before { width: 40px; }
  .publication-filter-panel { padding: 13px 14px 14px; }
  .publication-filter-level { grid-template-columns: 1fr; gap: 4px; }
  .publication-filter-label { padding-top: 0; }
  .publication-filter { min-height: 31px; }
  .honors-list { grid-template-columns: 55px minmax(0, 1fr); gap: 15px 14px; }
  .skills-list, .note-grid { grid-template-columns: 1fr; }
  .publication-entry img[style*="float"],
  .project-entry img[style*="float"],
  .project-entry video[style*="float"] {
    float: none !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 9px 0 13px !important;
  }
  .projects-content span[style*="float:right"],
  .project-entry span[style*="float:right"] { float: none !important; display: block; margin: 5px 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .publication-filter { transition: none; }
}
