/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  src: local('Lato Italic'), local('Lato-Italic'), url("/?originalUrl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6u8w4BMUTPHjxsAUi-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("/?originalUrl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6u8w4BMUTPHjxsAXC-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("/?originalUrl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6u_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("/?originalUrl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6u_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("/?originalUrl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6uyw4BMUTPHjxAwXiWtFCfQ7A.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("/?originalUrl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6uyw4BMUTPHjx4wXiWtFCc.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("/?originalUrl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6u9w4BMUTPHh6UVSwaPGQ3q5d0N7w.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("/?originalUrl=https%3A%2F%2Ffonts.gstatic.com%2Fs%2Flato%2Fv15%2FS6u9w4BMUTPHh6UVSwiPGQ3q5d0.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: 40px;
}

/* --- 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.6; /* More breathing room */
  padding-top: 60px;
  /* Fade in animation */
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
}

@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 25px 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: 10px;
  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: 20px; 
  scroll-margin-top: 70px; 
}

.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.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: var(--header-bg);
  padding: 10px 0;
  z-index: 1000;
  font-size: larger;
  box-shadow: 0 2px 15px rgba(0,0,0,0.3); /* Added shadow */
}

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

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

.fixed-header nav a {
  margin-left: 25px;
  font-size: 15px;
  font-weight: 500;
  position: relative;
  transition: color 0.3s;
}

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

/* Header Link Animation */
.fixed-header nav a::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -5px;
  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: 22px;
  width: auto;
  vertical-align: middle;
  margin-right: 15px;
  border-radius: 50%;
}

.header-home {
  padding-right: 150px;
  font-size: large;
}

.header-link {
  padding-right: 30px;
  padding-left: 30px;
}

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

.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: 10px;
  margin: 0 0 15px 0;
  font-family: var(--font-main);
  font-size: 28px; /* Larger name */
  font-weight: 700;
  letter-spacing: 0.5px;
}

.chinese_name {
  font-family: "XuandongKaishu";
  color: #888888;
  font-size: 26px;
  margin-left: 10px;
}

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

.header-logo-link {
  display: flex; 
  align-items: center;
}

.github-link {
  margin-left: 10px; 
  color: black; 
  font-weight: bold;
}

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

/* --- Components & Utilities --- */
span.highlight {
  background-color: #fff8e1; /* Softer highlight */
  padding: 0 2px;
  border-radius: 2px;
}

.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; }

/* Scrollbar */
.scrollable::-webkit-scrollbar {
  width: 6px;
}

.scrollable::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.scrollable::-webkit-scrollbar-thumb {
  background: #888;
}

.scrollable::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* --- Media Queries --- */
@media screen and (max-width: 768px) {
  .header_name { width: 100%; }
  .header_navi { position: absolute; left: -9999px; }
  .header-home { padding-right: 0; } 
}

@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;
  }

  .header-home {
    padding-right: 10px;
    font-size: medium;
  }

  .header-link {
    padding-right: 15px;
    padding-left: 15px;
  }

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

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

  .name {
    font-size: 22px;
  }

  .chinese_name {
    font-size: 24px;
  }

  .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;
  }
}