/* 基础样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 容器 */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* 头部区域 - 照片在右侧 */
.header {
  margin-bottom: 40px;
  padding-bottom: 40px;
}

.header-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.header-text {
  max-width: 680px;
}

.header-text h1 {
  font-size: 2.5em;
  font-weight: 700;
  margin-bottom: 12px;
  color: #24292e;
  letter-spacing: -0.02em;
}

.affiliation {
  font-size: 1.1em;
  color: #586069;
  margin-bottom: 20px;
}

.bio {
  font-size: 1em;
  line-height: 1.7;
  color: #444;
  margin-bottom: 20px;
}

.contact-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 1em;
}

.contact-links a {
  color: #0366d6;
  text-decoration: none;
  transition: color 0.2s;
}

.contact-links a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.contact-links .separator {
  color: #d1d5da;
  user-select: none;
}

.header-photo {
  flex-shrink: 0;
  margin-top: 80px;
}

.header-photo img {
  width: 220px;
  height: auto;
  border-radius: 8px;
  border: 3px solid #e1e4e8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 主内容区域 */
.main-content {
  margin-bottom: 40px;
  margin-top: 40px;
}

section {
  margin-bottom: 50px;
}

section:last-child {
  margin-bottom: 0;
}

h2 {
  font-size: 1.8em;
  font-weight: 700;
  color: #24292e;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e1e4e8;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.3em;
  font-weight: 600;
  color: #24292e;
  margin: 30px 0 16px;
}

/* Research 和 Experience 部分 - 统一样式 */
#research ul,
#experience ul {
  list-style: none;
  padding: 0;
}

#research li,
#experience li {
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
  line-height: 1.6;
}

#research li:before,
#experience li:before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #0366d6;
  font-weight: bold;
}

#research strong,
#experience strong {
  color: #24292e;
}

#experience a {
  color: #0366d6;
  text-decoration: none;
}

#experience a:hover {
  text-decoration: underline;
}

/* Publications 部分 */
.pub-group {
  margin-bottom: 30px;
}

.pub-group:last-child {
  margin-bottom: 0;
}

.pub-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid #e1e4e8;
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-link {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #e1e4e8;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pub-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pub-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: #f6f8fa;
}

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

.pub-title {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 8px;
  color: #24292e;
}

.pub-authors {
  font-size: 0.9em;
  color: #586069;
  margin-bottom: 6px;
  line-height: 1.5;
}

.pub-authors strong {
  color: #24292e;
  font-weight: 600;
}

.pub-venue {
  font-size: 0.95em;
  color: #0366d6;
  font-weight: 500;
  margin-bottom: 10px;
  font-style: italic;
}

.pub-brief {
  font-size: 0.95em;
  color: #586069;
  line-height: 1.6;
}

/* Footer */
footer {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid #e1e4e8;
  text-align: center;
  color: #586069;
  font-size: 0.9em;
}

footer a {
  color: #0366d6;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 20px 16px;
  }

  .header-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .header-photo {
    order: -1;
    text-align: center;
  }

  .header-photo img {
    width: 150px;
    height: 150px;
  }

  .header-text h1 {
    font-size: 2em;
  }

  .pub-item {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pub-thumb {
    height: 180px;
  }

  h2 {
    font-size: 1.5em;
  }
}

@media (max-width: 480px) {
  .header-text h1 {
    font-size: 1.75em;
  }

  .contact-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .contact-links .separator {
    display: none;
  }
}

#visitors .visitor-map {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 420px; /* shrink visitor map */
  margin-left: auto;
  margin-right: auto;
}

#visitors .visitor-map iframe,
#visitors .visitor-map img {
  max-width: 100%;
  width: 100% !important;
  border: 0;
}

/* ClustrMaps often injects an iframe with fixed height; constrain it */
#visitors .visitor-map iframe {
  height: 260px !important;
}

@media (max-width: 480px) {
  #visitors .visitor-map {
    max-width: 320px;
  }

  #visitors .visitor-map iframe {
    height: 210px !important;
  }
}
