:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --ink: #28313a;
  --muted: #66717c;
  --line: #dbe7f1;
  --soft: #eff7fc;
  --accent: #6aaed6;
  --accent-dark: #3d7fa6;
  --accent-pale: #e3f2fb;
  --gold: #9c7a34;
  --shadow: 0 12px 28px rgba(36, 86, 116, 0.08);
  --body: #47525d;
  --faint: #7d8790;
  --code-bg: #f5f7f8;
  --header-bg: #6aaed6;
  --button-bg: #3d7fa6;
  --notice-line: #bad9ed;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #11161b;
  --panel: #171e25;
  --ink: #e1e7ec;
  --muted: #9ba7b2;
  --line: #2a3640;
  --soft: #1a2631;
  --accent: #6aaed6;
  --accent-dark: #8ec5e6;
  --accent-pale: #1d3240;
  --gold: #d2ae63;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  --body: #c3ccd4;
  --faint: #8794a0;
  --code-bg: #1c242c;
  --header-bg: #1f4a63;
  --button-bg: #3d7fa6;
  --notice-line: #2f5873;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 58px;
  padding: 0 clamp(18px, 4vw, 56px);
  background: var(--header-bg);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16);
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 750;
}

.language-toggle {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
}

.language-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

[data-lang="zh"] {
  display: none;
}

html[lang="zh"] [data-lang="en"] {
  display: none;
}

html[lang="zh"] [data-lang="zh"] {
  display: revert;
}

html[lang="zh"] {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

.site-nav a,
.text-link {
  text-decoration: none;
}

.site-nav a:hover {
  color: #fff;
}

.text-link {
  color: var(--accent-dark);
  font-weight: 800;
}

main {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
}

.academic-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 76px;
  align-items: start;
  padding: 46px 0 72px;
}

.academic-sidebar {
  position: sticky;
  top: 86px;
  align-self: start;
  color: var(--muted);
}

.portrait {
  display: block;
  width: 168px;
  height: 168px;
  margin: 0 auto 24px;
  border: 5px solid var(--bg);
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
}

.academic-sidebar h1 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.05rem;
  line-height: 1.05;
}

.profile-meta {
  margin: 7px 0 8px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.sidebar-title {
  margin: 8px 0 2px;
  color: var(--accent-dark);
  font-weight: 850;
}

.sidebar-department {
  margin: 0;
  color: var(--faint);
  font-weight: 650;
}

.institution-card {
  margin: 22px 0 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 20px rgba(26, 45, 51, 0.05);
}

.institution-card strong {
  display: block;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  line-height: 1.05;
}

.institution-card span {
  display: block;
  color: var(--accent-dark);
  font-weight: 800;
}

.tagline {
  margin: 0 0 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

.contact-list {
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  font-size: 0.94rem;
}

.contact-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.contact-icon {
  display: inline-flex;
  width: 24px;
  justify-content: center;
  line-height: 1.5;
}

.contact-list span:not(.contact-icon) {
  color: var(--accent-dark);
  font-weight: 800;
}

.sidebar-actions,
.hero-actions,
.pub-actions,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sidebar-scholar {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.sidebar-section-title {
  margin-bottom: 8px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 800;
}

.sidebar-scholar p {
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.button,
.filter-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-dark);
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--button-bg);
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.ghost,
.button.small.ghost,
.filter-button {
  background: var(--year-bg, transparent);
  border-color: var(--year-border, var(--line));
  color: var(--year-fg, var(--ink));
}

.button.small {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.88rem;
}

.button-icon {
  margin-right: 6px;
  line-height: 1;
}

.filter-button.active {
  background: var(--year-bg, var(--button-bg));
  border-color: var(--year-border, var(--accent-dark));
  color: var(--year-fg, #fff);
  box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.04);
}

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

.content-section,
.section,
.page-intro,
.publication-page,
.post-page {
  padding: 30px 0 34px;
  border-bottom: 1px solid var(--line);
}

.content-section:first-child {
  padding-top: 14px;
}

.compact {
  padding: 34px 0;
}

h1,
h2,
h3 {
  color: var(--ink);
}

h2 {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.58rem, 2.3vw, 2rem);
  line-height: 1.15;
  letter-spacing: 0;
}

h2::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

h3 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.25;
}

.page-intro h1,
.publication-page h1,
.post-page h1 {
  max-width: 860px;
  margin: 0 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prose,
.section-lead {
  max-width: 780px;
  color: var(--body);
}

.prose p,
.section-lead {
  margin-top: 0;
}

.notice {
  margin-top: 24px;
  padding: 20px 24px;
  border: 1px solid var(--notice-line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--soft);
}

.notice strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
}

.notice p {
  margin: 0;
}

.news-list,
.timeline,
.publication-compact-list,
.publication-list,
.citation-feed {
  display: grid;
}

.news-list {
  gap: 0;
}

.news-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px dotted var(--line);
}

.news-item time,
.event time {
  color: var(--accent-dark);
  font-weight: 850;
}

.news-item p {
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--accent-pale);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.badge.paper {
  background: #eef5ff;
  color: #336f9a;
}

.badge.site {
  background: var(--accent-pale);
  color: var(--accent-dark);
}

.badge.journal {
  background: #e4f1fb;
  color: #356f91;
}

.badge.conference {
  background: #edf4ff;
  color: #4d6f9f;
}

.badge.talk {
  background: #eef0fb;
  color: #59659a;
}

.badge.poster {
  background: #edf7f0;
  color: #4d7657;
}

.badge.award {
  background: #fff3d8;
  color: #806222;
}

.badge.grant {
  background: #e7f6f7;
  color: #38767c;
}

.badge.service {
  background: #edf0f2;
  color: #59636d;
}

.badge.career {
  background: #e8f4ff;
  color: #3d7198;
}

.badge.teaching {
  background: #f8ebe7;
  color: #865948;
}

.badge.ieee-trans {
  background: #e3eefb;
  color: #1f4f8a;
}

.badge.ieee-oj {
  background: #e6f3f8;
  color: #2a6b80;
}

.badge.pesgm {
  background: #fff0d6;
  color: #7f5a12;
}

.badge.naps {
  background: #eaf5e6;
  color: #3f6b34;
}

.badge.icc {
  background: #efe9ff;
  color: #5a4596;
}

.badge.wcnc {
  background: #f6e9f2;
  color: #7d3e66;
}

.badge.qcnc {
  background: #e5f6f3;
  color: #2c6c62;
}

.badge.ieee {
  background: #e8eef6;
  color: #3b5b80;
}

.badge.software {
  background: #f1f1f1;
  color: #3d4650;
}

.badge.quantum {
  background: #ece8fb;
  color: #4f3f8f;
}

.badge.power {
  background: #fdf0e4;
  color: #8a5426;
}

.badge.update {
  background: #eaf0ea;
  color: #596f5d;
}

.research-thread-list {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.research-thread {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--research-bg, var(--panel));
  border-color: var(--research-border, var(--line));
  box-shadow: 0 8px 24px rgba(26, 45, 51, 0.06);
}

.research-thread-1 {
  --research-bg: #f2f8fd;
  --research-border: #cfe4f4;
}

.research-thread-2 {
  --research-bg: #f4faf0;
  --research-border: #d5e8c5;
}

.research-thread-3 {
  --research-bg: #fff7ec;
  --research-border: #edd8b4;
}

.thread-icon {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 800;
}

.thread-label {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 850;
}

.research-thread p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.section-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.section-row h2 {
  flex: 1;
}

.publication-compact-list {
  gap: 18px;
}

.publication-compact {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 16px;
}

.pub-number {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: var(--accent-pale);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 850;
}

.publication-compact h3 {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 850;
}

.publication-compact p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.topic,
.publication-card,
.event,
.citation-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.topic {
  min-height: 78px;
  padding: 16px;
  font-weight: 800;
}

.publication-list,
.citation-feed {
  gap: 16px;
}

.filters + .publication-list {
  margin-top: 18px;
}

.publication-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding: 22px;
  background: var(--publication-bg, var(--panel));
  border-color: var(--publication-border, var(--line));
}

.publication-card .pub-actions {
  align-self: start;
  justify-content: flex-end;
}

.publication-card.hidden {
  display: none;
}

.pub-authors,
.venue,
.empty-state {
  color: var(--muted);
}

.scholar-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 10px;
}

.metrics.vertical {
  grid-template-columns: 1fr;
  margin-bottom: 12px;
}

.metrics div {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metrics div > span {
  display: block;
  font-size: 1.55rem;
  font-weight: 850;
  line-height: 1;
}

.metrics small {
  color: var(--muted);
}

.citation-chart {
  margin: 14px 0 12px;
}

.chart-title {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
}

.citation-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.citation-chart line {
  stroke: var(--line);
  stroke-width: 1;
}

.citation-chart polyline {
  fill: none;
  stroke: var(--accent-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.citation-chart circle {
  fill: var(--panel);
  stroke: var(--accent-dark);
  stroke-width: 2;
}

.citation-chart text {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.chart-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.scholar-wordcloud {
  margin: 16px 0 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.scholar-wordcloud img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.timeline {
  gap: 12px;
}

.event {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 20px;
  padding: 18px;
}

.event p {
  margin: 4px 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 22px;
  color: var(--muted);
  text-decoration: none;
}

.citation {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
}

.clean-list {
  padding-left: 22px;
}

.skill-list,
.award-list {
  display: grid;
  gap: 10px;
  max-width: 900px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-list li,
.award-list li {
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.award-list li {
  background: var(--award-bg, var(--panel));
  border-color: var(--award-border, var(--line));
}

.citation-item {
  padding: 18px;
}

.site-footer {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 44px;
  color: var(--muted);
}

.skill-list div {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.skill-list dt {
  font-weight: 850;
}

.skill-list dd {
  margin: 0;
  color: var(--body);
}

.course-list {
  display: grid;
  gap: 10px;
  max-width: 900px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.course-list li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.course-list strong,
.course-list small {
  display: block;
}

.course-list small {
  color: var(--muted);
  font-size: 0.86rem;
}

.course-code {
  justify-self: start;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--accent-pale);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.post-list {
  display: grid;
  gap: 16px;
}

.filters + .post-list {
  margin-top: 18px;
}

.post-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.post-card.hidden {
  display: none;
}

.post-card h3 a {
  text-decoration: none;
}

.post-card h3 a:hover {
  color: var(--accent-dark);
}

.post-card p {
  margin: 0 0 10px;
  color: var(--body);
}

.post-card .post-subtitle,
.post-page .post-subtitle {
  color: var(--muted);
  font-style: italic;
}

.post-page .post-subtitle {
  margin: 0 0 14px;
  font-size: 1.15rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 750;
  text-decoration: none;
}

.tag-chip:hover {
  border-color: var(--accent);
}

.filter-button small {
  margin-left: 4px;
  opacity: 0.7;
}

.post-body {
  max-width: 780px;
}

.post-body h2 {
  margin-top: 30px;
}

.post-body img,
.post-body video {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.post-body blockquote {
  margin: 18px 0;
  padding: 10px 18px;
  border-left: 4px solid var(--accent);
  background: var(--soft);
  color: var(--muted);
}

.post-body pre,
.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.post-body pre {
  overflow-x: auto;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--code-bg);
}

.post-pager {
  display: flex;
  max-width: 780px;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
}

.post-pager a {
  max-width: 48%;
  text-decoration: none;
  font-weight: 750;
}

.post-pager a.next {
  text-align: right;
}

.post-pager small {
  display: block;
  color: var(--muted);
  font-weight: 600;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.lab-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.lab-thumb {
  display: block;
  margin: -22px -22px 6px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--soft);
}

.lab-thumb img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.25s ease;
}

html[lang="zh"] .lab-thumb img[data-lang="zh"] {
  display: block;
}

.lab-thumb:hover img {
  transform: scale(1.03);
}

.lab-card h3 a {
  text-decoration: none;
}

.lab-card h3 a:hover {
  color: var(--accent-dark);
}

.lab-card.hidden {
  display: none;
}

.lab-card.placeholder {
  border-style: dashed;
  background: var(--soft);
}

.lab-card h3,
.lab-card p {
  margin: 0;
}

.lab-card p {
  color: var(--body);
}

.lab-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lab-status,
.lab-sample {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
}

.lab-status {
  background: #fff0cf;
  color: #755313;
}

.lab-status.building {
  background: var(--accent-pale);
  color: var(--accent-dark);
}

.lab-status.live {
  background: #e9f3df;
  color: #3f6337;
}

.lab-sample {
  border: 1px dashed var(--muted);
  color: var(--muted);
}

.lab-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 12px 18px;
  }

  .academic-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 32px;
  }

  .academic-sidebar {
    position: static;
    display: grid;
    justify-items: start;
  }

  .portrait {
    margin-left: 0;
  }

  .institution-card,
  .tagline,
  .contact-list {
    width: 100%;
    max-width: 520px;
  }

  .research-thread,
  .publication-card,
  .scholar-strip {
    grid-template-columns: 1fr;
  }

  .topic-grid,
  .metrics,
  .lab-grid {
    grid-template-columns: 1fr;
  }

  .event,
  .news-item,
  .skill-list div,
  .course-list li {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (max-width: 560px) {
  main,
  .site-footer {
    width: min(100% - 28px, 1120px);
  }

  .site-nav {
    font-size: 0.84rem;
  }

  .research-thread {
    padding: 20px;
  }
}

[data-lang="zh"] {
  display: none;
}

html[lang="zh"] [data-lang="en"] {
  display: none;
}

html[lang="zh"] [data-lang="zh"] {
  display: inline;
}

html[lang="zh"] div[data-lang="zh"],
html[lang="zh"] p[data-lang="zh"],
html[lang="zh"] section[data-lang="zh"] {
  display: block;
}

.theme-toggle {
  min-width: 30px;
  font-size: 1rem;
  line-height: 1;
}

/* Dark mode: pastel palettes (set in CSS or by site.js) are blended into the dark panel,
   and pale badges are inverted so their hue stays but light text sits on a dark chip. */
:root[data-theme="dark"] .research-thread {
  background: color-mix(in srgb, var(--research-bg, var(--panel)) 8%, var(--panel));
  border-color: color-mix(in srgb, var(--research-border, var(--line)) 22%, var(--line));
  box-shadow: none;
}

:root[data-theme="dark"] .publication-card {
  background: color-mix(in srgb, var(--publication-bg, var(--panel)) 8%, var(--panel));
  border-color: color-mix(in srgb, var(--publication-border, var(--line)) 22%, var(--line));
}

:root[data-theme="dark"] .award-list li {
  background: color-mix(in srgb, var(--award-bg, var(--panel)) 8%, var(--panel));
  border-color: color-mix(in srgb, var(--award-border, var(--line)) 22%, var(--line));
}

:root[data-theme="dark"] .badge,
:root[data-theme="dark"] .lab-status,
:root[data-theme="dark"] [data-year-filter] {
  filter: invert(1) hue-rotate(180deg);
}

:root[data-theme="dark"] .scholar-wordcloud img,
:root[data-theme="dark"] .post-body img {
  filter: brightness(0.9);
}

