/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  src: local('Lato Italic'), local('Lato-Italic'), url(https://fonts.gstatic.com/s/lato/v15/S6u8w4BMUTPHjxsAUi-qNiXg7eU0.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  src: local('Lato Italic'), local('Lato-Italic'), url(https://fonts.gstatic.com/s/lato/v15/S6u8w4BMUTPHjxsAXC-qNiXg7Q.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url(https://fonts.gstatic.com/s/lato/v15/S6u_w4BMUTPHjxsI5wq_FQftx9897sxZ.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url(https://fonts.gstatic.com/s/lato/v15/S6u_w4BMUTPHjxsI5wq_Gwftx9897g.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(https://fonts.gstatic.com/s/lato/v15/S6uyw4BMUTPHjxAwXiWtFCfQ7A.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(https://fonts.gstatic.com/s/lato/v15/S6uyw4BMUTPHjx4wXiWtFCc.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  src: local('Lato Bold'), local('Lato-Bold'), url(https://fonts.gstatic.com/s/lato/v15/S6u9w4BMUTPHh6UVSwaPGQ3q5d0N7w.woff2) format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  src: local('Lato Bold'), local('Lato-Bold'), url(https://fonts.gstatic.com/s/lato/v15/S6u9w4BMUTPHh6UVSwiPGQ3q5d0.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =========================================================
   Theme tokens
   ========================================================= */
:root {
  --primary-color: #1772d0;
  --hover-color: #e0801a;
  --text-color: #2b2f36;
  --muted-color: #6b7280;
  --background-color: #fbfbfc;
  --surface-color: #ffffff;
  --card-bg: #f6f7f9;
  --border-color: #e6e8ec;
  --shadow-color: rgba(15, 23, 42, 0.08);
  --chip-bg: rgba(23, 114, 208, 0.06);
  --chip-border: rgba(23, 114, 208, 0.18);
  --nav-bg: rgba(251, 251, 252, 0.78);
  --content-width: 840px;
}

body.dark-mode {
  --primary-color: #8ab4f8;
  --hover-color: #f2b56b;
  --text-color: #e6e8eb;
  --muted-color: #9aa3ad;
  --background-color: #17181b;
  --surface-color: #1f2024;
  --card-bg: #24262b;
  --border-color: #34373d;
  --shadow-color: rgba(0, 0, 0, 0.45);
  --chip-bg: rgba(138, 180, 248, 0.10);
  --chip-border: rgba(138, 180, 248, 0.28);
  --nav-bg: rgba(23, 24, 27, 0.72);
}

/* =========================================================
   Base
   ========================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  color: var(--text-color);
  background-color: var(--background-color);
  transition: background-color 0.3s, color 0.3s;
  margin: 0;
  padding: 72px 0 40px;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Soft ambient background, kept subtle */
body::before {
  content: '';
  position: fixed;
  inset: -20% -10% -10% -10%;
  background:
    radial-gradient(40% 40% at 15% 10%, rgba(23, 114, 208, 0.12), transparent 60%),
    radial-gradient(35% 35% at 85% 15%, rgba(240, 146, 40, 0.09), transparent 60%),
    radial-gradient(45% 45% at 80% 85%, rgba(99, 102, 241, 0.10), transparent 60%);
  filter: blur(48px);
  z-index: -1;
  pointer-events: none;
}

body.dark-mode::before {
  background:
    radial-gradient(40% 40% at 15% 10%, rgba(138, 180, 248, 0.10), transparent 60%),
    radial-gradient(35% 35% at 85% 15%, rgba(242, 181, 107, 0.07), transparent 60%),
    radial-gradient(45% 45% at 80% 85%, rgba(129, 140, 248, 0.08), transparent 60%);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--hover-color); }

p { margin: 0 0 12px; }

img, video { max-width: 100%; display: block; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================
   Navigation
   ========================================================= */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  padding: 12px 0;
  z-index: 1000;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.top-nav.scrolled {
  border-bottom-color: var(--border-color);
  box-shadow: 0 4px 18px var(--shadow-color);
}

.nav-container {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
}

.nav-name {
  font-weight: 700;
  font-size: 17px;
  color: var(--primary-color);
  white-space: nowrap;
}
.nav-name:hover { color: var(--primary-color); }

.nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-links a {
  color: var(--text-color);
  font-weight: 500;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover { background: var(--chip-bg); color: var(--primary-color); }
.nav-links a.active { color: var(--primary-color); font-weight: 700; }

.theme-toggle {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 16px;
  color: var(--text-color);
  transition: background 0.2s, transform 0.2s;
}
.theme-toggle:hover { background: var(--chip-bg); }
.theme-toggle:active { transform: scale(0.94); }

/* =========================================================
   Sections
   ========================================================= */
.section {
  padding: 28px 0 8px;
  scroll-margin-top: 72px;
}
#profile { scroll-margin-top: 90px; }

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-color);
  display: inline-block;
  margin: 0 0 16px;
  letter-spacing: 0.1px;
}
.section-title {
  padding-right: 6px;
}
.section-title::after {
  content: '';
  display: block;
  height: 3px;
  margin-top: 8px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary-color), transparent);
}

/* =========================================================
   Profile
   ========================================================= */
.profile {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 36px;
  align-items: center;
  padding: 28px 0 12px;
}

.profile-text { text-align: center; }

.name {
  margin: 0 0 4px;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.15;
  background: linear-gradient(90deg, var(--primary-color), var(--hover-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.name-chinese {
  font-size: 0.6em;
  margin-left: 10px;
  font-weight: 700;
}

.profile-role {
  color: var(--muted-color);
  font-size: 14px;
  letter-spacing: 0.2px;
  margin-bottom: 16px;
}

.profile-text p:not(.profile-role):not(.contact-info) { text-align: left; }

.profile-photo { display: flex; justify-content: center; }

.profile-image-container {
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 16px 40px var(--shadow-color);
  border: 4px solid var(--surface-color);
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 260px;
}
.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 14px;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  font-size: 14px;
  color: var(--text-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.social-icon i { color: var(--primary-color); transition: color 0.2s; }
.social-icon:hover {
  transform: translateY(-1px);
  border-color: var(--chip-border);
  box-shadow: 0 6px 16px var(--shadow-color);
  color: var(--primary-color);
}

.contact-info {
  text-align: center;
  color: var(--muted-color);
  font-size: 14px;
  margin: 0;
}
.contact-info i { margin-right: 4px; }

.hiring-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-color);
}
.hiring-callout i { color: var(--primary-color); margin-top: 3px; }
.hiring-callout strong { color: var(--primary-color); }

/* =========================================================
   News
   ========================================================= */
.timeline {
  position: relative;
  padding-left: 20px;
  margin-top: 4px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(23, 114, 208, 0.35), rgba(224, 128, 26, 0.25));
}
body.dark-mode .timeline::before {
  background: linear-gradient(180deg, rgba(138, 180, 248, 0.45), rgba(242, 181, 107, 0.3));
}

.timeline p {
  position: relative;
  margin: 0 0 10px;
}
.timeline p::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-color);
  box-shadow: 0 0 0 3px var(--background-color);
}

.news-date {
  display: inline-block;
  min-width: 62px;
  color: var(--muted-color);
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
}

.news-toggle {
  margin: 4px 0 0 20px;
  font-size: 13.5px;
  color: var(--muted-color);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  transition: color 0.2s;
}
.news-toggle:hover { color: var(--primary-color); }
.news-toggle i { font-size: 11px; transition: transform 0.25s; }
.news-toggle.open i { transform: rotate(180deg); }

/* =========================================================
   Publications
   ========================================================= */
.pub-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}

.pub-item {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 16px;
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease, background-color 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.pub-item.visible {
  opacity: 1;
  transform: translateY(0);
}
.pub-item:hover {
  background-color: var(--surface-color);
  border-color: var(--border-color);
  box-shadow: 0 8px 24px var(--shadow-color);
}

.pub-thumb img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.pub-body { min-width: 0; }

.paper-title {
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.4;
  color: var(--primary-color);
  transition: color 0.2s;
}
.pub-title-link:hover .paper-title { color: var(--hover-color); }

.pub-authors {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.55;
}
.pub-authors a { color: var(--text-color); }
.pub-authors a:hover { color: var(--primary-color); }

.pub-venue {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted-color);
}
.pub-venue em { font-style: italic; }

.pub-award {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
  color: #c2410c;
  background: rgba(240, 146, 40, 0.14);
}
body.dark-mode .pub-award {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.14);
}

.pub-links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pub-links a {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: var(--primary-color);
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.pub-links a:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

/* =========================================================
   Products
   ========================================================= */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 20px 0 8px;
}

.product-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 20px var(--shadow-color);
  transition: transform 0.3s, opacity 0.5s, box-shadow 0.3s;
  opacity: 0;
  transform: translateY(12px);
  display: flex;
  flex-direction: column;
}
.product-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px var(--shadow-color);
}

.product-image {
  position: relative;
  overflow: hidden;
  height: 210px;
  width: 100%;
  background-color: var(--card-bg);
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.video-display {
  width: 100%;
  height: 100%;
  background-color: #000;
}
.video-display video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.product-info { padding: 16px 18px 18px; }

.product-info h3 {
  margin: 0 0 2px;
  font-size: 16.5px;
  color: var(--primary-color);
}
.product-info h3 a:hover { color: var(--hover-color); }

.product-year {
  color: var(--muted-color);
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
}
.product-description {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

/* =========================================================
   Service, footer
   ========================================================= */
.service-list { line-height: 1.8; }
.service-label {
  color: var(--muted-color);
  font-weight: 600;
  margin-right: 4px;
}

.site-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 12.5px;
  color: var(--muted-color);
}
.site-footer p { margin: 0 0 4px; }
.last-updated { opacity: 0.8; }

/* =========================================================
   Utilities
   ========================================================= */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 1100;
  background: linear-gradient(90deg, var(--primary-color), var(--hover-color));
}

#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--shadow-color);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  z-index: 100;
}
#back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#back-to-top:hover { transform: translateY(-2px); }

.fade-in {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pub-item, .product-card, .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 768px) {
  body { padding-top: 96px; }

  .nav-container {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .nav-links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 2px;
  }
  .nav-links a { padding: 4px 8px; font-size: 13.5px; }

  .section { scroll-margin-top: 96px; }
  #profile { scroll-margin-top: 110px; }

  .profile {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 12px;
  }
  .profile-photo { order: -1; }
  .profile-image-container { max-width: 180px; }
  .name { font-size: 32px; }

  .pub-item {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px;
  }
  .pub-thumb { max-width: 320px; }

  .products-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .container, .nav-container { padding: 0 16px; }
  .name { font-size: 28px; }
  .news-date { display: block; min-width: 0; margin-bottom: 1px; }
}
