/* Semantic, responsive adaptations of w-r-s/academic-homepage-template. */
:root {
  color-scheme: light;
  --ink: #272727;
  --muted: #626262;
  --amber: #b7760a;
  --amber-light: #fba524;
  --paper-border: rgba(0, 0, 0, 0.14);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; color: var(--ink); background: #fff; line-height: 1.6; }
button { font: inherit; cursor: pointer; }
img, video { max-width: 100%; }
[hidden] { display: none !important; }
button, a { -webkit-tap-highlight-color: transparent; }
a { overflow-wrap: anywhere; }
a:focus-visible, button:focus-visible {
  outline: 2px solid #9b6100;
  outline-offset: 4px;
  border-radius: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 200;
  padding: 8px 14px;
  background: #fff8e6;
  border: 1px solid var(--amber);
}
.skip-link:focus { top: 12px; }
.site-main { width: min(100%, 800px); margin: 0 auto; padding: 28px 20px 12px; }
.page-section { margin: 0 0 36px; scroll-margin-top: 24px; }
h1, h2, h3, p { overflow-wrap: break-word; }
h1 { margin: 0 0 16px; font-size: 28px; font-weight: 400; line-height: 1.3; }
h1 .chinese-name { white-space: nowrap; }
.page-section > h2, .section-heading h2 {
  margin: 0 0 16px;
  color: #222;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.35;
  text-decoration: underline;
  text-decoration-color: var(--amber-light);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
p { margin: 0 0 13px; }
ul { padding-left: 21px; }
li { margin: 4px 0; }
.profile-grid { display: flow-root; }
.profile-copy { min-width: 0; }
.profile-copy h1 { text-align: center; }
.profile-copy .profile-affiliation { color: var(--muted); text-align: center; font-size: 12px; margin-top: -9px; margin-bottom: 24px; }
.profile-photo { float: right; width: 220px; margin: 0 0 12px 30px; }
.profile-photo img { display: block; width: 100%; height: auto; border-radius: 50%; }
.profile-copy p { line-height: 1.65; }
.profile-copy .profile-intro { margin-bottom: 0; }
.bio-details { clear: right; margin-top: 0; }
.bio-details > :last-child { margin-bottom: 0; }
.contact-links { display: flow-root; margin: 0 0 24px; padding: 0; }
.contact-line { gap: 4px 5px; }
.contact-links a { min-height: 28px; gap: 3px; font-size: 12px; white-space: nowrap; color: #111; }
.contact-links a:hover, .contact-links a:focus { color: #111; text-decoration: underline; text-underline-offset: 3px; }
.contact-links .email-link .contact-sub { max-width: none; font-size: 12px; color: #717171; opacity: 1; }
.contact-links svg { width: 12px; height: 12px; }
.contact-links a[href^="mailto:"] svg { color: #d93025; }
.contact-links a[href="files/Han_Lin_Resume.pdf"] svg { color: #7c3aed; }
.contact-links a[href^="https://scholar.google.com/"] svg { color: #4285f4; }
.contact-links a[href^="https://github.com/"] svg { color: #24292f; }
.contact-links a[href^="https://twitter.com/"] svg { color: #1da1f2; }
.contact-links a[href^="https://www.linkedin.com/"] svg { color: #0a66c2; }
.contact-links a[href="files/wechat.pdf"] svg { color: #07a646; }
.research-list { margin: 0; padding-left: 20px; }
.research-list li { margin: 6px 0; }

/* Content stays expanded when JavaScript is unavailable. */
.news-list { margin-top: 0; }
.news-list:not(.expanded) .news-item:nth-child(n+6) { display: flex; }
.news-item { padding-top: 8px; padding-bottom: 8px; animation: none; }
.news-body { min-width: 0; flex: 1; display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 12px; align-items: baseline; }
.news-date { color: #887244; white-space: nowrap; }
.news-text { line-height: 1.65; }
.news-text .venue { color: #8f6000; }
.news-toggle { color: #926000; padding: 8px 0 2px 23px; }
.news-toggle:hover { color: #6e3519; }
#news { margin-bottom: 36px; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.publication-note { margin-bottom: 12px; color: var(--muted); }
.publication-note .highlight, .highlight-key { padding: 1px 4px; background: #ffffe0; }
.tag-filter { display: none; flex-wrap: wrap; gap: 8px; margin: 16px 0 19px; justify-content: center; }
.js-enabled .tag-filter { display: flex; }
.tag-btn {
  padding: 5px 13px;
  border-radius: 20px;
  border: 1px solid rgba(17, 17, 17, 0.18);
  background: rgba(251, 165, 36, 0.06);
  color: #6e3519;
  font-size: 13px;
  line-height: 1.6;
  transition: background 0.18s, border-color 0.18s;
}
.tag-btn:hover { border-color: rgba(17, 17, 17, 0.36); background: rgba(251, 165, 36, 0.13); }
.tag-btn.active, .tag-btn[aria-pressed="true"] { background: #ad7020; color: #fff; border-color: #855513; box-shadow: 0 2px 8px rgba(173, 112, 32, 0.18); }
.tag-count { display: inline-block; min-width: 18px; height: 18px; margin-left: 5px; padding: 0 3px; border-radius: 12px; background: rgba(251, 165, 36, 0.14); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: 1px; }
.tag-btn[aria-pressed="true"] .tag-count { background: rgba(255, 255, 255, 0.22); }
.publication-list { display: grid; gap: 16px; }
.publication-card { display: grid; grid-template-columns: 166px minmax(0, 1fr); gap: 21px; align-items: center; padding: 19px; border: 1px solid var(--paper-border); border-radius: 8px; background: #fff; }
.publication-card.featured { background: #ffffe0; }
.publication-media { min-width: 0; position: relative; }
.publication-media img, .publication-media video { display: block; width: 100%; height: auto; max-height: 166px; object-fit: contain; border-radius: 3px; }
.publication-media .video-poster { position: absolute; inset: 0; height: 100%; pointer-events: none; }
.publication-media video.has-played ~ .video-poster { visibility: hidden; }
.video-play { position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); min-height: 44px; padding: 9px 14px; border: 1px solid rgba(255,255,255,0.8); border-radius: 6px; color: #fff; background: rgba(22,29,32,0.9); font-size: 13px; white-space: nowrap; }
.video-play:hover { background: #161d20; }
.publication-body { min-width: 0; }
.paper-title { margin: 0 0 5px; font-size: 14px; line-height: 1.45; font-weight: 700; }
.paper-title a { font-weight: 700; }
.publication-authors-shell { padding-right: 0; margin: 0 0 5px; line-height: 1.5; }
/* Override the template's single-line author clamp. Always show every author. */
.publication-authors-shell .publication-authors,
.publication-authors-shell:not(.expanded) .publication-authors {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}
.publication-venue { margin-bottom: 4px; line-height: 1.5; }
.publication-venue .accepted { color: #ad7020; font-weight: 700; }
.publication-links { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 9px; line-height: 1.55; }
.publication-links a { white-space: nowrap; }
#motionToggle { display: none; padding: 3px 0; border: 0; background: transparent; color: #856022; font-size: 12px; }
#motionToggle.visible { display: inline-flex; align-items: center; gap: 6px; }
#motionToggle:hover { color: #6e3519; text-decoration: underline; text-underline-offset: 3px; }

.experience-list { display: grid; gap: 22px; }
.experience-entry { display: grid; grid-template-columns: 75px minmax(0, 1fr); align-items: center; gap: 22px; }
.institution-logo { width: 75px; text-align: center; }
.institution-logo img { display: block; width: auto; height: auto; max-width: 75px; max-height: 66px; margin: 0 auto; object-fit: contain; }
.experience-body h3 { margin: 0 0 3px; font-size: 14px; line-height: 1.5; }
.entry-details { color: #4e4e4e; }
.entry-details p { margin: 0; }
.entry-details .entry-bullets { margin: 5px 0 0; padding-left: 18px; }
.entry-bullets > li { margin: 4px 0; line-height: 1.55; }
.entry-bullets > li:last-child { margin-bottom: 0; }
.entry-block + .entry-block { margin-top: 14px; }
.service-list, .teaching-list { margin: 0; }
.service-list li, .teaching-list li { margin: 7px 0; }

.section-drip-nav { right: max(24px, calc((100vw - 800px) / 2 - 170px)); gap: 15px; }
.section-drip-nav a[aria-current="location"]::before { background: #fba524; border-color: #d98d1e; }
.section-drip-nav a[aria-current="location"] span { color: #6e3519; opacity: 1; }
.section-drip-nav a:focus-visible { outline: 2px solid #9b6100; outline-offset: 3px; }
.mobile-nav { display: none; }
.mountain-footer { margin-top: 10px; }
.mountain-stage { background: #142926; }
.mountain-stage::before {
  background:
    linear-gradient(to bottom, #fff 0%, rgba(255,255,255,0.85) 8%, rgba(255,255,255,0.25) 20%, rgba(255,255,255,0) 32%),
    linear-gradient(to bottom, rgba(8,24,25,0) 10%, rgba(8,24,25,0.2) 32%, rgba(8,24,25,0.58) 65%, rgba(8,24,25,0.8) 100%);
}
.mountain-stage .mountain-img { object-position: center 56%; }
.mountain-content h2 { text-decoration: none; }
.mountain-footnote a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#backToTop:focus-visible { outline: 3px solid #c08118; outline-offset: 4px; }

@media (min-width: 1180px) and (min-height: 561px) {
  .section-drip-nav { display: flex; }
}
@media (max-width: 1179px), (max-height: 560px) {
  .section-drip-nav { display: none; }
  .mobile-nav { display: flex; gap: 8px 15px; flex-wrap: wrap; padding: 0 0 16px; margin: 0 0 22px; border-bottom: 1px solid #ece5d8; }
  .mobile-nav a { font-size: 12px; color: #86632b; }
}
@media (max-width: 680px) {
  .site-main { padding: 24px 18px 8px; }
  .profile-photo { width: 170px; margin-left: 22px; }
  .profile-copy h1 { text-align: left; font-size: 26px; }
  .publication-card { grid-template-columns: 145px minmax(0, 1fr); gap: 17px; padding: 16px; }
  .tag-filter { justify-content: flex-start; gap: 7px; }
  .mountain-content { padding-bottom: 56px; }
  #backToTop { right: 17px; bottom: 17px; width: 40px; height: 40px; }
}
@media (max-width: 560px) {
  .site-main { padding-top: 24px; }
  .page-section { margin-bottom: 30px; }
  .profile-photo { float: none; width: 180px; margin: 0 auto 20px; }
  .profile-copy h1 { text-align: center; font-size: 28px; }
  .publication-card { grid-template-columns: minmax(0, 1fr); gap: 15px; padding: 17px; }
  .publication-media { width: 100%; margin: 0 auto; }
  .publication-media img, .publication-media video { max-height: 190px; width: 100%; object-fit: contain; }
  .paper-title { font-size: 15px; }
  .paper-title a { font-size: inherit; }
  .publication-links { gap: 4px 10px; }
  .experience-entry { grid-template-columns: 56px minmax(0, 1fr); gap: 16px; align-items: start; }
  .institution-logo { width: 56px; padding-top: 2px; }
  .institution-logo img { max-width: 56px; max-height: 54px; }
  .mountain-content h2 { font-size: 31px; }
  .mountain-content .mountain-sub { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .news-item:hover { transform: none; }
}
@media print {
  .site-main { width: 100%; max-width: none; padding: 0; }
  .section-drip-nav, .mobile-nav, .tag-filter, #motionToggle, #backToTop, .news-toggle, .skip-link, .video-play { display: none !important; }
  .publication-card[hidden], .news-item[hidden] { display: grid !important; }
  .news-item[hidden] { display: flex !important; }
  .publication-card, .experience-entry { break-inside: avoid; }
  .mountain-footer { display: none; }
}
