:root {
  --primary: #224b8d;
  --primary-dark: #19386a;
  --text: #494e52;
  --heading: #494e52;
  --muted: #7a8288;
  --border: #eeeeee;
  --surface: #ffffff;
  --red: #c00000;
  --content-width: 1260px;
  --sidebar-width: 230px;
  --font: "Trebuchet MS", Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 78px;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--surface);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
img { max-width: 100%; }
button { font: inherit; }
:lang(zh) { font-style: italic; }
.not-italic { font-style: normal !important; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 999;
  padding: 8px 12px;
  color: #fff;
  background: var(--primary-dark);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid #f0f0f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.masthead-inner {
  display: flex;
  align-items: center;
  width: min(calc(100% - 40px), var(--content-width));
  min-height: 58px;
  margin: 0 auto;
}

.site-title {
  margin-right: 48px;
  color: var(--muted);
  font-size: 1.12rem;
  font-weight: 700;
}

.site-title:hover { text-decoration: none; }
.site-nav { display: flex; gap: 28px; align-items: center; }
.site-nav a { color: var(--muted); font-size: 1.08rem; font-weight: 600; }
.site-nav a:hover, .site-nav a.active { color: var(--primary); text-decoration: none; }

.nav-toggle {
  display: none;
  margin-left: auto;
  padding: 6px 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid #d8dadd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 54px;
  width: min(calc(100% - 40px), var(--content-width));
  margin: 0 auto;
  padding: 32px 0 52px;
}

.sidebar {
  position: relative;
  min-width: 0;
}

.profile-box {
  position: sticky;
  top: 82px;
}

.author-avatar {
  display: block;
  width: 180px;
  height: 220px;
  overflow: hidden;
  border-radius: 50% / 42%;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-content { margin-top: 14px; }
.author-name { margin: 0; color: var(--heading); font-size: 1.42rem; line-height: 1.16; }
.author-name span { font-size: 0.95em; font-weight: 600; }
.author-bio { margin: 5px 0 0; font-size: 0.92rem; }

.author-urls {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.86rem;
}

.author-urls li { margin: 0 0 5px; }
.author-urls li > span, .author-urls a > span { display: inline-block; width: 23px; color: #555; text-align: center; }
.profile-description { margin-bottom: 10px !important; color: var(--text); line-height: 1.45; }
.scholar-profile-line {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  line-height: 1.35;
  white-space: nowrap;
}
.scholar-profile-line > a { flex: 0 0 auto; }
.scholar-citations { color: #222; font-weight: 800; white-space: nowrap; }
.scholar-profile-line .scholar-citations { margin-left: 5px; }
.profile-toggle { display: none; }

.page { min-width: 0; max-width: 950px; }
.content-section { margin: 0 0 24px; }
.content-section + .content-section { padding-top: 5px; }
.first-section { scroll-margin-top: 170px; }

.content-section h2 {
  margin: 0.68em 0 0.48em;
  padding-bottom: 0.3em;
  color: var(--heading);
  border-bottom: 1px solid var(--border);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.content-section p { margin: 0 0 0.5em; }
.content-section strong { color: #222; }
.red-text { color: var(--red) !important; }
#about-me a { font-weight: 700; }

.news-list, .plain-list { margin: 0; padding-left: 1.35em; }
.news-list li, .plain-list li { margin-bottom: 0.35em; }
.news-list em, .plain-list em { color: #555; }

.scholar-badge {
  display: inline-block;
  padding: 1px 7px;
  color: #fff;
  background: #f39c12;
  border-radius: 3px;
  font-size: 0.74rem;
  line-height: 1.6;
}
.scholar-badge:hover { color: #fff; text-decoration: none; background: #d98709; }
.author-note { color: var(--muted); font-size: 0.79rem; }

.publication-group {
  margin: 1.7em 0 0;
  padding-bottom: 0.3em;
  color: var(--heading);
  border-bottom: 1px solid var(--border);
  font-size: 1.22rem;
  font-weight: 700;
}

.paper-box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 1.3em 0;
  border-bottom: 1px solid var(--border);
}

.paper-box-image {
  position: relative;
  display: flex;
  flex: 0 0 34%;
  align-items: center;
  justify-content: flex-start;
  min-width: 200px;
}

.paper-box-image[data-venue-badge]::after {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  padding: 0.32rem 0.55rem;
  color: #fff;
  background: #1676b8;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
  content: attr(data-venue-badge);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
  pointer-events: none;
}

.paper-box-image a {
  display: block;
  width: 100%;
  padding: 0;
  background: #fff;
  border: 0;
}

.paper-box-image a:hover { text-decoration: none; }
.paper-box-image img,
.paper-box-image video { display: block; width: 100%; height: 174px; object-fit: contain; background: #fff; box-shadow: 3px 3px 6px #888; }
.paper-box-text { flex: 1 1 66%; min-width: 0; padding-left: 2em; }
.paper-title { color: var(--primary); font-size: 1.16rem; line-height: 1.3; }
.paper-title:hover { color: var(--primary-dark); }
.paper-box-text p { margin: 0.28em 0; font-size: 0.95rem; line-height: 1.42; }
.paper-venue { color: #3e4448; }
.paper-award { color: #2d3337; }
.paper-award strong { color: var(--red); }
.paper-links { color: #555; }
.paper-links a, .link-button { font-weight: 500; }
.paper-links a strong { color: inherit; }
.paper-links .paper-citation-count { color: inherit; font-weight: 700; }
.contribution-note { color: var(--red); font-size: 0.86rem !important; }
.honor-cn { font-weight: 700; }

.link-button {
  display: inline;
  padding: 0;
  color: var(--primary);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.link-button:hover { color: var(--primary-dark); text-decoration: underline; }

.page-footer {
  margin-top: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding-top: 18px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

.footer-visitors { flex: 0 1 46%; min-width: 220px; }
.visitor-map {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 104px;
  color: #748595;
  background: linear-gradient(135deg, #f7fafc, #edf2f6);
  border-radius: 3px;
  font-size: 0.83rem;
}
.visitor-map svg { display: block; width: 100%; height: auto; }
.visitor-map-country { fill: #8496a5; stroke: #f7fafc; stroke-width: 0.35; }
.visitor-map-dot { fill: #e74c5b; stroke: #fff; stroke-width: 0.7; cursor: default; }
.visitor-tooltip {
  position: absolute;
  z-index: 2;
  max-width: 180px;
  padding: 0.5rem 0.6rem;
  color: #fff;
  background: rgba(28, 39, 46, 0.94);
  border-radius: 3px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  font-size: 0.72rem;
  line-height: 1.35;
  pointer-events: none;
}
.visitor-tooltip[hidden] { display: none; }
.pageview-count { margin: 0.45rem 0 0; text-align: center; }
.footer-meta { flex: 1 1 auto; text-align: right; }
.footer-meta p { margin: 0.22rem 0; }
.footer-updated { font-style: italic; }

.video-dialog {
  width: min(92vw, 1100px);
  padding: 0;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
}
.video-dialog::backdrop { background: rgba(0, 0, 0, 0.75); }
.video-dialog-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.video-dialog-header h2 { margin: 0; color: var(--heading); font-size: 1rem; }
.video-dialog-header button { padding: 0 5px; color: #555; background: transparent; border: 0; cursor: pointer; font-size: 1.8rem; line-height: 1; }
.video-dialog video { display: block; width: 100%; max-height: 76vh; background: #000; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 190px minmax(0, 1fr); gap: 38px; }
  .author-avatar { width: 155px; height: 190px; }
  .site-nav { gap: 20px; }
  .paper-box-image { flex-basis: 36%; min-width: 170px; }
  .paper-box-text { padding-left: 1.45em; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 64px; }
  .masthead-inner { width: min(calc(100% - 28px), var(--content-width)); min-height: 58px; }
  .site-title { margin-right: 0; }
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: 58px;
    right: 0;
    left: 0;
    display: none;
    padding: 8px 14px 14px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 4px 9px rgba(0,0,0,.06);
  }
  .site-nav.open { display: grid; gap: 0; }
  .site-nav a { padding: 8px 0; }
  .layout { display: block; width: min(calc(100% - 30px), 720px); padding-top: 30px; }
  .profile-box { position: static; display: grid; grid-template-columns: 115px 1fr; column-gap: 20px; align-items: center; margin-bottom: 38px; }
  .author-avatar { grid-row: 1 / 4; width: 115px; height: 140px; }
  .author-content { margin-top: 0; }
  .author-name { font-size: 1.25rem; }
  .profile-toggle { display: block; width: fit-content; margin-top: 8px; padding: 5px 9px; color: #555; background: #fff; border: 1px solid #d8dadd; border-radius: 3px; font-size: 0.72rem; cursor: pointer; }
  .author-urls { display: none; grid-column: 1 / -1; margin: 18px 0 0; padding: 14px 0 5px; border-top: 1px solid var(--border); }
  .author-urls.open { display: block; }
  .page { max-width: none; }
  .paper-box { align-items: stretch; flex-direction: column; }
  .paper-box-image { width: 100%; min-width: 0; max-width: none; }
  .paper-box-image img,
  .paper-box-image video { height: auto; max-height: 310px; }
  .paper-box-text { width: 100%; padding: 1.25em 0 0; }
  .page-footer { display: block; }
  .footer-visitors { min-width: 0; }
  .footer-meta { margin-top: 16px; text-align: center; }
}

@media (max-width: 430px) {
  body { font-size: 14px; }
  .layout { width: calc(100% - 24px); }
  .profile-box { grid-template-columns: 90px 1fr; gap: 15px; }
  .author-avatar { width: 90px; height: 110px; }
  .content-section h2 { font-size: 1.35rem; }
  .paper-title { font-size: 1rem; }
  .paper-box { padding: 1.55em 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .masthead, .video-dialog, .profile-toggle { display: none !important; }
  .layout { display: grid; grid-template-columns: 170px 1fr; width: 100%; gap: 30px; padding: 0; }
  .profile-box { position: static; }
  .paper-box { break-inside: avoid; }
  .paper-box-image img,
  .paper-box-image video { height: 140px; }
}
