:root {
  --base-font-size: 16px;
  --siteBackgroundColor: #ffffff;
  --paragraphMediumColor: #222222;
  --heading-font-font-family: Georgia, serif;
  --body-font-font-family: "Helvetica Neue", sans-serif;
}

body {
  font-size: var(--base-font-size);
  font-family: var(--body-font-font-family);
  background-color: var(--siteBackgroundColor);
  color: var(--paragraphMediumColor);
  margin: 0;
  padding: 0; 
}



.hero {
  height: 100vh;
  background: linear-gradient(to bottom right, #fafafa, #eee);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.hero-content h1 {
  font-size: 3.5rem;
  font-family: var(--heading-font-font-family);
  margin-bottom: 1rem;
}

.hero-content p {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}


#intro {
  max-width: 750px;      
  margin: 0 auto;         /* 居中显示 */
  padding: 1rem 1.5rem;   /* 给左右一些缓冲 */
  text-align: justify;     
  
}

/* For links */
.hero-content a {
  position: relative;
  text-decoration: none;
  color: #005f99;
}
.hero-content a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: #005f99;
  transition: width 0.3s ease;
}
.hero-content a:hover::after {
  width: 100%;
}

.full-screen-section {
  height: 100vh;
  background-color: #f8f8f8;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
}


.section-content {
  width: 100%;
}

section#research {
  background-color: #ffffff;
  padding: 2rem 1rem;
}

#research h2 {
  text-align: center;
  font-size: 3rem;       
  margin-bottom: 2rem;
  font-family: 'EB Garamond', serif;
}

#talks h2 {
  text-align: center;
  font-size: 3rem;       
  margin-bottom: 2rem;
  font-family: 'EB Garamond', serif;
}


.full-screen-section h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  font-family: var(--heading-font-font-family);
}



.paper-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 850px;
}

.paper-list li {
  margin-bottom: 2rem;
}

.paper-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap; /* 避免溢出时断行混乱 */
}


.collaborator {
  font-style: italic;
  color: #444;
  margin-left: 1rem;
  white-space: nowrap;
}

  .journal {
    font-style: italic;
    color: #666;
    font-size: 0.95rem;
    margin-top: 0.3rem;
  }

.paper-list {
  padding-left: 0;
  margin-left: 0;
  list-style: none;           /* optional: 去掉左侧圆点 */
}

.paper-list li {
  text-align: left;
  margin-bottom: 1.8rem;      /* 增加每条之间的垂直间距 */
  line-height: 1.5;
  max-width: 850px;           /* 防止行太长，便于阅读 */
}

.paper-list li:not(:last-child) {
  border-bottom: 1px dashed #ddd;   /* 可选：添加浅浅的分隔线 */
  padding-bottom: 1rem;
}

.paper-list a {
  position: relative;
  text-decoration: none;
  color: #b01825;
}
.paper-list a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: #700010;
  transition: width 0.3s ease;
}
.paper-list a:hover::after {
  width: 100%;
}


@keyframes draw-brush {
  to {
    stroke-dashoffset: 0;
  }
}


.fade-in-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  margin-bottom: 1.5rem;
}

.fade-in-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  text-align: center;
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  color: #111;
}

.center-underline {
  width: 800px;
  height: 3px;
  margin: 0 auto 3rem auto;
  position: relative;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.8s ease-out;
}

#hero_underline {
  background-color: #333;
}

#research_underline {
  background-color: #b01825;
}


.center-underline.visible {
  transform: scaleX(1);
}

/* Container for all cards */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  column-gap: 16px;  /* 横向间距变小 */
  row-gap: 20px;     /* 保持垂直间距 */
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px;
  box-sizing: border-box;
}

.card-container {
  perspective: 1000px;
  position: relative;
  border-radius: 10px;
  box-sizing: border-box;
  overflow: visible; /* 确保阴影不被遮住 */
}

.card-inner{
  position: relative;
  width: 100%;
  height: 250px;
  text-align: center;
  transform-style: preserve-3d;
  cursor: pointer;
  transform: translateZ(0);
  border-radius: 10px;
  transition: transform 0.8s ease, box-shadow 0.4s ease;
}


.card-inner.flipped {
  transform: rotateY(180deg) scale(1.02);
}

.card-inner.flipped.highlighted {
  transform: rotateY(180deg) translateY(-8px) scale(1.02);
  transition: transform 0.8s ease;
}

.card-inner.highlighted {
  box-shadow:
    0 0 10px rgba(176, 24, 37, 0.3),
    0 0 20px rgba(176, 24, 37, 0.2),
    0 0 30px rgba(176, 24, 37, 0.15);
  border-radius: 10px;
  transform: translateY(-8px) scale(1.02);
  transition: transform 0.8s ease, box-shadow 0.4s ease;
}

@keyframes wiggle {
  0%   { transform: rotateY(0deg); }
  25%  { transform: rotateY(8deg); }
  50%  { transform: rotateY(-8deg); }
  75%  { transform: rotateY(5deg); }
  100% { transform: rotateY(0deg); }
}
.wiggle-on-hover:hover {
  perspective: 1000px;
}

.wiggle-on-hover:hover {
  animation: wiggle 0.6s ease-in-out;
}

.card-front, .card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 2px 4px 10px rgba(0,0,0,0.1);
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  transition:
    border 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}




.card-back {
  transform: rotateY(180deg);
  font-size: 2rem;
  line-height: 1.6;
  text-align: left;
  padding: 20px;    
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
        
.abstract {
  font-size: 1.2rem;
  line-height: 1.4;
  color: #222;
}

.paper-meta {
  font-size: 1rem;
  color: #555;
}

.paper-journal {
  font-size: 1 rem;
  font-weight: bold;
  margin-top: 4px;
  color: #333;
}
.paper-title-container {
  font-size: 1.3rem;
  line-height: 1.4;
  color: #b01825;
  margin-bottom: 8px;
  display: inline;  /* important */
  white-space: normal;
}



.link-btn {
  font-size: 1rem;
  color: #555;
  text-decoration: none;
  margin-top: 12px;
  cursor: pointer;
  transform: scale(1.3);
  display: inline-block;
}

.link-btn:hover {
  color: #b01825;
}

.paper-title {
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  font-weight: bold;
  font-size: 1.25rem;
  color: #b01825;
  text-decoration: none;
}

.paper-title:hover {
  text-decoration: underline;  /* show underline on hover */
}

.paper-meta {
  font-style: italic;
  margin-top: 0.3rem;
  font-size: 1.05rem;
  color: #555;
}

.paper-journal {
  font-weight: bold;
  margin-top: 0.5rem;
  color: #333;
  font-size: 1.05rem;  
}

.submitted {
  margin-top: 0.5rem;
  color: rgba(51, 51, 51, 0.8);
  font-size: 1.05rem;  
}



.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: #222;
  color: white;
  display: flex;
  padding: 12px 24px;
  font-family: sans-serif;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

.nav-left .brand {
  font-weight: bold;
  font-size: 1.2rem;
  margin-right: 10px;
}

.nav-left a {
  color: white;
  text-decoration: none;
  font-size: 1rem;
}

.nav-left a:hover {
  text-decoration: underline;
}


.topic-buttons button {
  background: #eee;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.7rem;
  font
  cursor: pointer;
}

.topic-buttons button:hover {
  background-color: #b01825;
  color: white;
}

.topic-buttons {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: 20px;
}

.topic-buttons.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.topic-buttons button.active {
  background-color: #b01825;
  color: white;
  box-shadow: 0 0 6px rgba(176, 24, 37, 0.4);
  transform: translateY(-1px);
}



.talks-section {
  background-color: #f5f7fc; /* 浅蓝灰背景 */
  padding: 60px 20px;
}


#talks_underline {
  background-color: #1e3a8a;
}

.talks-container {
  max-width: 1100px;  /* 可以调整为1000、960等 */
  margin: 0 auto;
  padding: 0 20px;   /* 防止在窄屏贴边 */
}

.talk-year {
  font-size: 1.6rem;
  font-weight: 600;
  color: #1e3a8a;
  margin-top: 20px;
  margin-bottom: 6px;
  border-left: 4px solid #1e3a8a;
  padding-left: 12px;
}
.talk-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 4px;
}

.talk-list li {
  font-family: "Segoe UI", Roboto, sans-serif;
  font-size: 1.3rem;
  padding: 1px 0;
  padding-left: 7rem;
  border-bottom: 1px dashed rgba(30, 58, 138, 0.2);
}

.talk-year + .talk-list::before {
  content: "";
  display: block;
  height: 1px;
  background: rgba(30, 58, 138, 0.1);
  margin: 10px 0;
}

/* 默认：桌面版显示卡片，隐藏纯文本 */
.desktop-only {
  display: block;
}
.mobile-only {
  display: none;
}

/* Default: desktop version shows cards, hides plain text */
.desktop-only {
  display: block; /* Keep only one of these */
}

.mobile-only {
  display: none;
}

/* Mobile specific styles */
@media (max-width: 767px) { 
  body {
    font-size: 14px; /* Slightly smaller base font size for phones */
  }

  .desktop-only {
    display: none !important; /* This will now only apply to actual mobile sizes */
  }

  .topic-buttons {
    display: none; /* Hide topic buttons on mobile, !important is removed for cleaner code */
    opacity: 0;
    pointer-events: none;
  }

  .mobile-only {
    display: block; /* Use block for list items to stack properly */
  }
  
    
/* Hero section adjustments for mobile */
  .hero-content h1 {
    font-size: 2rem; /* Further reduce font size for very small screens */
  }
  .hero-content p {
    font-size: 1.rem; /* Adjust paragraph font size for readability on small screens */
  }
  #intro {
    padding: 0 0.5rem; /* Reduce padding to give more horizontal space to the text */
    text-align: left; /* Optional: left align intro text for better readability on mobile */
  }    
    

  /* Navbar adjustments for mobile */
  .navbar {
    display: none; 
    opacity: 0;
    pointer-events: none;
  }

  /* Research section adjustments for mobile papers */
  .M_paper-list {
    list-style: none;
    max-width: 100%; /* Ensure it takes full width */
    margin: 0; /* Center the list */
  }

  .M_paper-list li {
    margin-bottom: 1rem; /* Reduced margin */
    padding-bottom: 0.8rem;
    max-width: 100%;
  }

    .M_paper-title {
  font-weight: 600;
  color: #b01825;
  font-size: 1.1rem;
  text-align: left;
    }
    .M_paper-title a {
      color: #b01825;
    }

    .M_journal{
      margin-top: 0.3rem;
      font-size: 0.95rem;
      color: #333;
      font-weight: bold;
      font-style: italic;
      text-align: left;
    }
    .M_collaborator {
      font-style: italic;
      color: #444;
      text-align: left;
    }
  .M_submitted {
      margin-top: 0.3rem;
      font-size: 0.95rem;
      color: rgba(51, 51, 51, 0.8);
      text-align: left;
   }

    
  section {
    padding: 0rem; /* Adjust overall section padding for mobile, reducing side padding */
  }

  .section-content {
    padding: 0 0rem; /* Reduce padding inside section content for more space */
    width: 100%;
    max-width: 100%;
  }

  /* Talks section adjustments for mobile */
  .talks-container {
    padding: 0 0.5rem;
  }

  .talk-year {
    font-size: 1rem;
    padding-left: 8px; /* Slightly less padding */
  }

  .talk-list li {
    font-size: 0.8rem; /* Smaller font for talk details */
    padding-left: 0.5rem; /* Reduced padding */
  }
}

