/* ===== Base & Reset ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Lato', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  background: #fff;
  margin: 0;
  padding: 0;
}

a { color: #1772d0; text-decoration: none; }
a:hover { color: #f09228; text-decoration: none; }

h2 {
  font-size: 1.4em;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 6px;
  margin-top: 32px;
  margin-bottom: 12px;
}


/* ===== Bio Header (centered name + email) ===== */
.bio-header {
  text-align: center;
  margin-bottom: 20px;
}

name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.6em;
  font-weight: 400;
  color: #1a1a1a;
  display: block;
  margin-bottom: 6px;
}

.bio-email {
  font-size: 15px;
  color: #555;
}

/* ===== Main Bio Layout ===== */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 0 32px;
  align-items: start;
  margin-bottom: 24px;
}

.left-column { }

.profile-pic-container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.profile-pic-container img {
  width: 240px;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
}
body.dark name { color: #e8e8e8; }

/* ===== Bio Links ===== */
.bio-links {
  margin-top: 12px;
  font-size: 15px;
}
.bio-links a { color: #1772d0; }
.bio-links a:hover { color: #f09228; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  margin: 3px 3px 3px 0;
  border-radius: 6px;
  border: 1px solid #c8d0da;
  background: #f0f4f8;
  color: #333;
  font-size: 13px;
  font-family: 'Lato', sans-serif;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  vertical-align: middle;
}
.btn:hover { background: #dde8f5; border-color: #1772d0; color: #1772d0; text-decoration: none; }
.btn .material-icons { font-size: 15px; line-height: 1; }

.btn-publication {
  padding: 8px 18px;
  font-size: 12px;
  border-radius: 999px;
  border-color: #4f66d4;
  background: #fff;
  color: #4f66d4;
}
.btn-publication:hover {
  background: #eef1ff;
  border-color: #3e56cb;
  color: #3e56cb;
}

/* ===== News ===== */
.news-scroll-container {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #fafafa;
  margin-bottom: 8px;
}
.news-list {
  display: flex;
  flex-direction: column;
}

.news-item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 0 18px;
  align-items: start;
  padding: 10px 4px;
  border-bottom: 1px solid #f0f0f0;
}

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

.news-date {
  font-weight: 700;
  font-size: 12px;
  color: #888;
  white-space: nowrap;
  display: block;
  line-height: 1.4;
  padding-top: 2px;
}

.news-text {
  min-width: 0;
  line-height: 1.4;
}
.news-item-title { font-weight: 600; }
.news-highlight-red { color: #EF5350; font-weight: 600; }

/* ===== Research Tabs ===== */
.research-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1px solid #c8d0da;
  background: #f0f4f8;
  color: #555;
  font-size: 13px;
  font-family: 'Lato', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tab-btn:hover { background: #dde8f5; border-color: #1772d0; color: #1772d0; }
.tab-btn.active { background: #1772d0; color: #fff; border-color: #1772d0; }

/* ===== Publications Table ===== */
.publications-table {
  border-collapse: separate;
  border-spacing: 0 18px;
}
.publications-table tr[data-type] {
  transition: opacity 0.2s;
}
.publication-cell {
  padding: 0;
}
.publication-card {
  width: 100%;
  padding: 26px 30px;
  border: 1px solid #e8ebf6;
  border-left: 6px solid #4f66d4;
  border-radius: 0 22px 22px 0;
  background: linear-gradient(180deg, #fbfcff 0%, #f5f7ff 100%);
  box-shadow: 0 10px 24px rgba(45, 63, 140, 0.08);
}

.pub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

papertitle {
  font-size: 15px;
  font-weight: 700;
  color: #243279;
  line-height: 1.35;
  display: block;
  margin-bottom: 12px;
}

.publication-authors {
  font-size: 13px;
  color: #222;
  margin-bottom: 8px;
}

.publication-venue {
  font-size: 13px;
  color: #4a5368;
  line-height: 1.5;
}

.publication-venue em {
  font-style: normal;
  font-weight: 700;
  color: #4f66d4;
}

.description {
  font-size: 13px;
  color: #666;
  margin: 8px 0;
  line-height: 1.5;
}
body.dark .description { color: #aaa; }

/* ===== BibTeX Block ===== */
.bibtex {
  display: none;
  background: #f5f8fc;
  border: 1px solid #dde4ec;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 8px;
  overflow-x: auto;
}
.bibtex.show { display: block; }
.bibtex pre {
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
  color: #333;
}

/* ===== Video Modal ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: #111;
  border-radius: 10px;
  padding: 16px;
  position: relative;
  max-width: 800px;
  width: 90%;
}
.modal-content video { width: 100%; border-radius: 6px; display: block; }
.close-btn {
  position: absolute;
  top: 8px;
  right: 14px;
  font-size: 26px;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}
.close-btn:hover { color: #ccc; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .profile-pic-container {
    justify-content: center;
    margin-bottom: 16px;
    order: -1;
  }
  .profile-pic-container img { width: 180px; }
  .bio-links { text-align: center; }
  .news-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .publications-table td { display: block; width: 100% !important; }
  .publication-card {
    padding: 20px 18px;
    border-radius: 0 18px 18px 0;
  }
}
