/* 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;
}

/* publication note */
.publication-note {
  font-size: 1em;
  color: #888;
  font-style: italic;
  margin-top: -4px;
}

/* 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;
}

:root {
  --primary-color: #1772d0;
  --accent-color: #f09228;
  --text-color: #333;
  --bg-color: #fff;
  --header-bg: #25282D;
  --header-text: #F0EEEE;
  --font-main: 'Lato', Verdana, Helvetica, sans-serif;
  --section-spacing: 28px;
}

/* --- Global Typography & Base Styles --- */
html {
  scroll-behavior: smooth;
}

body, td, th, tr, p, a {
  font-family: var(--font-main);
  font-size: 15px; /* Increased for better readability */
  font-weight: 300;
}

body {
  color: var(--text-color);
  background-color: var(--bg-color);
  margin: 0;
  line-height: 1.5;
  padding-top: 56px;
  /* Fade in animation */
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
}

p {
  margin: 0.5em 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

a:focus,
a:hover {
  color: var(--accent-color);
  text-decoration: none;
}

/* Modern link underline effect for paragraph links */
p a:not(.header-logo-link):not(.toggle-button) {
  position: relative;
  display: inline;
}

p a:not(.header-logo-link):not(.toggle-button)::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: var(--accent-color);
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

p a:not(.header-logo-link):not(.toggle-button):hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

strong {
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
}

h2 {
  margin: 0 0 16px 0;
  font-weight: 700;
  font-family: var(--font-main);
  font-size: 22px;
  color: #111;
  position: relative;
  display: inline-block;
  letter-spacing: -0.3px;
}

/* Decorative underline for H2 */
h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--primary-color);
  margin-top: 8px;
  border-radius: 2px;
  transition: width 0.3s ease;
}

h2:hover::after {
  width: 60px; /* Dynamic interaction */
}

h3 {
  font-weight: 600;
  font-family: var(--font-main);
  font-size: 17px;
  margin-bottom: 10px;
}

/* --- Layout & Utilities --- */
.container {
  width: 100%;
  max-width: 800px;
  border: 0;
  border-spacing: 0;
  border-collapse: separate;
  margin-right: auto;
  margin-left: auto;
  /* Added padding and box-sizing for mobile spacing */
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

.section-container {
  margin-bottom: var(--section-spacing);
  padding-top: 10px;
  scroll-margin-top: 66px;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* --- Header --- */
.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(37, 40, 45, 0.92);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  padding: 11px 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.fixed-header a {
  color: var(--header-text);
  text-decoration: none;
  display: inline-block;
}

.header-logo-link {
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.fixed-header nav a {
  margin-left: 22px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
  position: relative;
  transition: color 0.25s ease;
}

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

/* Header Link Animation */
.fixed-header nav a::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -6px;
  left: 0;
  background-color: var(--accent-color);
  visibility: hidden;
  transform: scaleX(0);
  transition: all 0.3s ease-in-out;
}

.fixed-header nav a:hover::before {
  visibility: visible;
  transform: scaleX(1);
}

.header_icon {
  height: 24px;
  width: 24px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* --- Profile Section --- */
.profile-section {
  display: flex;
  gap: 36px;
  align-items: center;
  margin-bottom: 20px;
}

.profile-photo-wrapper {
  display: flex;
}

.profile-photo {
  width: 100%;
  max-width: 180px;
  border-radius: 50%;
  display: block;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 4px solid #fff; /* Thicker border */
}

.profile-photo:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

.profile-info {
  flex: 1;
}

.name {
  padding-top: 4px;
  margin: 0 0 10px 0;
  font-family: var(--font-main);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.chinese_name {
  font-family: "Ma Shan Zheng", "STXingkai", "华文行楷", "STKaiti", cursive;
  color: #888888;
  font-size: 24px;
  margin-left: 10px;
}

/* --- New Classes extracted from HTML --- */

.github-link,
.x-link,
.linkedin-link {
  margin-left: 10px; 
  font-weight: bold;
}

.github-link,
.github-link:hover,
.github-link:focus {
  color: #181717;
}

.x-link,
.x-link:hover,
.x-link:focus {
  color: #000000;
}

.linkedin-link,
.linkedin-link:hover,
.linkedin-link:focus {
  color: #0a66c2;
}

p .x-link::after {
  background-color: #000000;
}

p .github-link::after {
  background-color: #181717;
}

p .linkedin-link::after {
  background-color: #0a66c2;
}

.x-link {
  display: inline-block;
  line-height: inherit;
  vertical-align: baseline;
}

footer {
  padding: 20px 0; 
  text-align: left; 
  font-size: 12px; 
  color: #888;
}

.footer-icon {
  vertical-align: middle; 
  margin-right: 5px;
}

/* --- Publications & News --- */
.papertitle {
  font-family: var(--font-main);
  font-size: 16px; /* Slightly larger */
  font-weight: 700;
  color: #111;
}

.news-scroll {
  max-height: 160px;
  overflow-y: auto;
  margin-top: 15px;
  margin-bottom: 15px;
  border: none; /* Requirement: No border */
  padding: 10px 15px 10px 25px; /* Left padding for bullets */
  background-color: transparent; /* Cleaner look */
  /* Custom Scrollbar styling remains below */
}

/* Style paragraphs or list items inside news to look like a list */
.news-scroll p, .news-scroll li {
  position: relative;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.5;
  padding-left: 5px;
}

/* Custom bullet point */
.news-scroll p::before, .news-scroll li::before {
  content: '•';
  position: absolute;
  left: -15px;
  color: var(--accent-color);
  font-weight: bold;
  font-size: 18px;
  line-height: 18px;
  top: 1px;
}

.news-scroll::-webkit-scrollbar { width: 6px; }
.news-scroll::-webkit-scrollbar-track { background: transparent; }
.news-scroll::-webkit-scrollbar-thumb { 
  background: #ddd; 
  border-radius: 3px;
}
.news-scroll::-webkit-scrollbar-thumb:hover { background: #bbb; }

.pub-table {
  width: 100%;
  border: 0;
  border-spacing: 0;
  border-collapse: collapse; /* Changed to collapse for borders */
  margin-right: auto;
}

.pub-table tr {
  transition: background-color 0.2s ease;
}

.pub-table tr:hover {
  background-color: #fafafa; /* Subtle hover effect */
}

.pub-img-cell {
  padding-top: 25px;
  padding-bottom: 25px;
  width: 25%;
  vertical-align: middle;
  padding-right: 25px;
  border-bottom: 1px solid #f0f0f0; /* Separator line */
}

.pub-img-cell img {
  width: 100%;
  max-width: 200px;
  height: auto;
  border-style: none;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08); /* Softer shadow */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pub-img-cell img:hover {
  transform: scale(1.03);
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.pub-content-cell {
  width: 75%;
  vertical-align: middle;
  padding-top: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid #f0f0f0; /* Separator line */
}

/* Remove border from the last row to look clean */
.pub-table tr:last-child td {
  border-bottom: none;
}

.pub-desc {
  margin-bottom: 15px;
  margin-top: 8px;
  font-size: 14px;
  font-style: italic;
  color: #555;
}

.project-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.project-meta a {
  line-height: 1.5;
}

.github-stars {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 21px;
  padding: 1px 8px;
  border: 1px solid #e3d6a4;
  border-radius: 999px;
  color: #3f3420;
  background: linear-gradient(180deg, #fffaf0 0%, #f7f1df 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75), 0 1px 2px rgba(0,0,0,0.04);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.1px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.github-stars:hover {
  border-color: #d0a51f;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 3px 8px rgba(208,165,31,0.16);
  transform: translateY(-1px);
}

.github-star-icon {
  color: #b88700;
  font-size: 12px;
  line-height: 1;
  transform: translateY(-0.5px);
}

.github-star-count {
  font-size: inherit;
  font-weight: inherit;
}

.github-stars-unavailable {
  border-color: #d8dee4;
  color: #6e7781;
  background: #f6f8fa;
}

/* --- Components & Utilities --- */
.toggle-button {
  background: none;
  border: 1px solid var(--primary-color); /* Outline style */
  border-radius: 20px; /* Pill shape */
  color: var(--primary-color);
  text-decoration: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  margin-top: 10px;
  display: inline-block;
  transition: all 0.3s ease;
}

.toggle-button:hover {
  background-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 10px rgba(23, 114, 208, 0.3);
}

/* Google Scholar Colors */
.gs-blue { color: #4285F4; }
.gs-red { color: #EA4335; }
.gs-yellow { color: #FBBC05; }
.gs-green { color: #34A853; }

/* --- Media Queries --- */
@media screen and (max-width: 480px) {
  body, td, th, tr, p, a {
    font-size: 12px;
  }

  strong {
    font-size: inherit;
  }

  .fixed-header nav {
    display: none;
  }

  .header-container {
    justify-content: center;
  }

  h2 {
    font-size: 18px;
  }

  h3 {
    font-size: 14px;
  }

  .fixed-header {
    padding: 5px 0;
  }

  .profile-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-photo {
    max-width: 150px;
  }

  .name {
    font-size: 20px;
  }

  .chinese_name {
    font-size: 18px;
  }

  .papertitle {
    font-size: 12px;
  }

  /* Force table cells to stack vertically on mobile */
  .pub-table tr {
    display: block;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
  }

  .pub-img-cell {
    display: block;
    width: 100%;
    padding-right: 0;
    text-align: center; /* Center the image */
    padding-bottom: 10px;
  }

  .pub-img-cell img {
    max-width: 100%; /* Ensure image fits within padding */
    width: auto;     /* Allow natural aspect ratio */
    max-height: 200px; /* Prevent image from being too tall */
  }

  .pub-content-cell {
    display: block;
    width: 100%;
    padding-bottom: 20px;
  }

  footer {
    text-align: center;
  }
}
