/* Clean, minimal academic homepage - inspired by modern academic sites */
:root {
  --bg: #ffffff;
  --card-bg: #ffffff;
  --text: #333333;
  --text-muted: #666666;
  --text-light: #999999;
  --accent: #0066cc;
  --accent-hover: #0052a3;
  --border: #e5e5e5;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
}

section[id] {
  scroll-margin-top: 60px;
}

body {
  font-family: 'Times New Roman', Times, 'Latin Modern Roman', 'Computer Modern', serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Motion: keyframes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

img {
  max-width: 100%;
  height: auto;
}

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 60px 0 40px 0;
  animation: fadeIn 0.6s ease-out;
}

.site-header .container {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  flex-shrink: 0;
}

.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  border: 2px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.avatar:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.university-logo {
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  opacity: 0.8;
  display: block;
}

.university-logo[src=""],
.university-logo:not([src]) {
  display: none;
}

.title-block {
  flex: 1;
}

.title-block h1 {
  margin: 0 0 12px 0;
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.subtitle {
  margin: 8px 0;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 400;
}

.meta {
  margin: 8px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.meta a {
  color: var(--accent);
  text-decoration: none;
}

.meta a:hover {
  text-decoration: underline;
}

.social-links {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.social-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 400;
  transition: color 0.2s ease, transform 0.2s ease;
}
.social-links a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
  transform: translateY(-1px);
}

.social-links .separator {
  margin: 0;
  color: var(--border);
}

/* Navigation */
.nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  animation: fadeIn 0.5s ease-out 0.2s both;
}

.nav .container {
  display: flex;
  gap: 0;
  padding: 0 24px;
  overflow-x: auto;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 16px 24px;
  display: inline-block;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav a:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
  background: rgba(0, 102, 204, 0.04);
}

/* Main content */
main {
  padding: 40px 0;
}

.card {
  background: var(--card-bg);
  padding: 0;
  margin: 0 0 48px 0;
  border: none;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease, background 0.3s ease;
}
.card.visible {
  opacity: 1;
  transform: translateY(0);
}
.card:hover {
  background: rgba(0, 0, 0, 0.01);
}

.card h2 {
  margin: 0 0 24px 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card p {
  margin: 16px 0;
  color: var(--text);
  line-height: 1.7;
}

.card ul,
.card ol {
  margin: 16px 0;
  padding-left: 24px;
}

.card li {
  margin: 8px 0;
  color: var(--text);
  line-height: 1.7;
}

.card a {
  color: var(--accent);
  text-decoration: none;
}

.card a:hover {
  text-decoration: underline;
}

/* Publications */
.publication-category {
  margin-top: 48px;
  margin-bottom: 24px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.publication-category.visible {
  opacity: 1;
  transform: translateY(0);
}
.publication-category:first-of-type {
  margin-top: 0;
}

.publications-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin: 24px 0 0 0;
}

.publication-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 0;
  transition: transform 0.3s ease;
}
.publication-item:hover {
  transform: translateX(6px);
}

.publication-figure {
  flex-shrink: 0;
  width: 180px;
}

.paper-thumbnail {
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.paper-thumbnail:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.publication-content {
  flex: 1;
  min-width: 0;
}

.publication-title {
  margin: 0 0 8px 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.publication-authors {
  margin: 6px 0;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
}

.publication-authors strong {
  color: var(--text);
  font-weight: 600;
}

.publication-venue {
  margin: 6px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.publication-links {
  margin: 10px 0 0 0;
  font-size: 0.95rem;
}

.publication-links a {
  margin-right: 12px;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}
.publication-links a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
  transform: translateY(-1px);
}

.paper-link {
  color: var(--accent);
}

.code-link {
  color: var(--text-muted);
}

.code-link:hover {
  color: var(--accent);
}

/* Footer */
.site-footer {
  padding: 40px 0;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  margin-top: 60px;
  background: var(--bg);
}

.site-footer p {
  margin: 8px 0;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

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

/* ========== Responsive: tablet and below ========== */
@media (max-width: 1024px) {
  .container {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }

  .site-header {
    padding: 40px 0 32px 0;
  }

  .site-header .container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .header-left {
    align-items: center;
  }

  .title-block {
    text-align: center;
  }

  .avatar {
    width: 120px;
    height: 120px;
  }

  .university-logo {
    height: 32px;
    max-width: 120px;
  }

  .title-block h1 {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .social-links {
    justify-content: center;
  }

  main {
    padding: 32px 0;
  }

  .card {
    margin-bottom: 40px;
  }

  .card h2 {
    font-size: 1.35rem;
  }

  .nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav .container {
    padding: 0 16px;
    flex-wrap: nowrap;
    min-width: min-content;
  }

  .nav a {
    padding: 14px 18px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .publication-item {
    flex-direction: column;
    align-items: stretch;
  }

  .publication-item:hover {
    transform: none;
  }

  .publication-figure {
    width: 100%;
    max-width: 280px;
    margin: 0 auto 12px auto;
  }

  .publication-category {
    margin-top: 36px;
    font-size: 1.15rem;
  }

  .site-footer {
    padding: 32px 0;
    margin-top: 48px;
  }
}

/* ========== Responsive: mobile ========== */
@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .container {
    padding: 0 16px;
  }

  .site-header {
    padding: 32px 0 24px 0;
  }

  .avatar {
    width: 100px;
    height: 100px;
  }

  .title-block h1 {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .meta {
    font-size: 0.9rem;
  }

  .social-links {
    gap: 12px;
    font-size: 0.9rem;
  }

  main {
    padding: 24px 0;
  }

  .card {
    margin-bottom: 32px;
  }

  .card h2 {
    font-size: 1.25rem;
    padding-bottom: 10px;
  }

  .card p {
    font-size: 0.95rem;
  }

  .nav a {
    padding: 12px 14px;
    font-size: 0.85rem;
  }

  .publication-figure {
    max-width: 100%;
  }

  .publication-title {
    font-size: 1rem;
  }

  .publication-authors,
  .publication-venue {
    font-size: 0.9rem;
  }

  .publication-links {
    font-size: 0.9rem;
  }

  .site-footer {
    padding: 24px 0;
    margin-top: 40px;
  }

  .site-footer p {
    font-size: 0.85rem;
  }
}

/* Prevent horizontal overflow on all devices */
html, body {
  overflow-x: hidden;
}
