/* Modern Font Setup */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Open+Sans:wght@300;400;600&display=swap');

:root {
  --primary-color: #1772d0;
  --secondary-color: #f09228;
  --text-color: #333;
  --light-gray: #f5f5f5;
  --border-color: #e0e0e0;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  
  /* Adjusted scale factor */
  --scale-factor: 0.85;
}

/* Center the entire page */
.page-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
}

body {
  background-color: #fafafa;
  color: var(--text-color);
  font-family: 'Open Sans', 'Lato', Verdana, Helvetica, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

.container {
  max-width: 1000px;
  width: 100%;
  transform: scale(var(--scale-factor));
  transform-origin: top center;
  margin: 0 auto;
}

.main-table {
  width: 100%;
  border-spacing: 0;
  border-collapse: separate;
  margin: 0 auto;
}

/* 去掉全局链接的下划线并使用自定义颜色 */
a {
  text-decoration: none;
  color: var(--primary-color); /* 使用你定义的主色 */
  transition: color 0.3s ease;
}

/* 鼠标悬停时加一个交互效果 */
a:hover {
  color: var(--secondary-color); /* 悬停时换颜色 */
  text-decoration: underline; /* 如果你想悬停时才显示下划线，可以保留 */
}

/* Header Section */
.header-table {
  width: 100%;
  margin-bottom: 30px;
}

.profile-text {
  padding: 2.5%;
  width: 63%;
  vertical-align: middle;
}

.profile-img {
  padding: 2.5%;
  width: 30%;
  vertical-align: middle;
  max-width: 40%;
}

h1 {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin: 10px 0 20px;
  color: #222;
}

.profile-text p {
  font-size: 16px;
  margin-bottom: 20px;
}

.img-container {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}

.img-container:hover {
  transform: translateY(-5px);
}

.img-container img {
  width: 100%;
  height: auto;
  display: block;
}

.social-links {
  text-align: center;
  margin-top: 25px;
}

.social-links a {
  display: inline-block;
  margin: 0 12px;
  padding: 8px 15px;
  background-color: var(--light-gray);
  border-radius: 30px;
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.social-links a:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(23, 114, 208, 0.2);
}

.social-links a i {
  margin-right: 8px;
}

/* Section Headers */
.section {
  padding: 15px 0;
  margin: 30px 0 20px;
  border-bottom: 2px solid var(--primary-color);
}

.section h2 {
  font-size: 24px;
  font-weight: 700;
  color: #222;
  margin: 0;
}

.section h2 i {
  margin-right: 12px;
  color: var(--primary-color);
}

/* Research Section - Improved Image Hover Effect */
.research-table {
  width: 100%;
  margin-bottom: 30px;
  border-spacing: 0;
}

.research-img {
  padding: 20px;
  width: 30%;
  vertical-align: middle;
}

.img-hover-container {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
  aspect-ratio: 230/165; /* Maintain original aspect ratio */
  background: #f8f8f8;
}

.img-hover-container:hover {
  transform: translateY(-5px);
}

.img-hover-container .static-img,
.img-hover-container .animated-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-hover-container .static-img {
  opacity: 1;
}

.img-hover-container .animated-img {
  opacity: 0;
}

.img-hover-container:hover .static-img {
  opacity: 0;
}

.img-hover-container:hover .animated-img {
  opacity: 1;
}

.img-hover-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* Fit original shape */
  display: block;
}

.research-details {
  padding: 20px;
  width: 70%;
  vertical-align: middle;
}

.research-details h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #222;
}

.research-details h3 a {
  color: #222;
  text-decoration: none;
  transition: color 0.3s ease;
}

.research-details h3 a:hover {
  color: var(--primary-color);
}

.authors {
  margin: 10px 0;
  font-size: 15px;
  line-height: 1.5;
}

.authors strong {
  font-weight: 700;
}

.pub-info {
  margin: 10px 0;
  font-style: italic;
  color: #555;
}

.links {
  margin: 15px 0;
}

.links a {
  display: inline-block;
  margin-right: 15px;
  padding: 6px 12px;
  background-color: var(--light-gray);
  border-radius: 4px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.links a:hover {
  background-color: var(--primary-color);
  color: white;
}

.links a i {
  margin-right: 6px;
}

.research-details p {
  margin-top: 15px;
  font-size: 15px;
}

/* Experience Section - Simplified Logo */
.experience-table {
  width: 100%;
  border-spacing: 0;
  margin-bottom: 30px;
}

.logo-cell {
  padding: 20px;
  width: 20%;
  vertical-align: top;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px; /* Increased height */
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.logo-container img {
  max-height: 100px; /* Larger size */
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.exp-details {
  padding: 20px;
  width: 80%;
  vertical-align: top;
}

.exp-details h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 5px;
  color: #222;
}

.exp-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #666;
  font-size: 15px;
}

.exp-details p {
  margin: 8px 0;
}

/* Footer */
.footer {
  text-align: right;
  font-size: 14px;
  color: #777;
  padding-top: 30px;
  margin-top: 30px;
  border-top: 1px solid var(--border-color);
}

.footer a {
  color: #555;
  text-decoration: none;
}

.footer a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1000px) {
  .page-wrapper {
    padding: 15px;
  }
  
  .container {
    transform: scale(0.95);
  }
}

@media (max-width: 768px) {
  .container {
    transform: scale(1);
    width: 100%;
  }
  
  .header-table {
    display: block;
  }
  
  .profile-text, 
  .profile-img {
    width: 100%;
    display: block;
    padding: 20px;
    max-width: 100%;
  }
  
  .research-img,
  .research-details {
    width: 100%;
    display: block;
    padding: 10px;
  }
  
  .logo-cell,
  .exp-details {
    width: 100%;
    display: block;
    padding: 10px;
  }
  
  .social-links a {
    margin: 5px;
    display: block;
    text-align: center;
  }
  
  .exp-meta {
    flex-direction: column;
  }
  
  .logo-container {
    height: auto;
    margin-bottom: 15px;
    max-width: 150px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .logo-container img {
    max-height: 80px;
  }
  
  .img-hover-container {
    max-width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .page-wrapper {
    padding: 10px;
  }
  
  h1 {
    font-size: 28px;
  }
  
  .section h2 {
    font-size: 22px;
  }
  
  .research-details h3 {
    font-size: 18px;
  }
  
  .links a {
    display: block;
    margin: 5px 0;
    text-align: center;
  }
}