:root,
[data-theme="light"] {
  --bg: #ffffff;
  --bg-elevated: #f6f8fa;
  --text: #1f2328;
  --text-muted: #656d76;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --border: #d0d7de;
  --topbar-bg: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg-elevated: #181c24;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --border: #30363d;
  --topbar-bg: rgba(15, 17, 23, 0.85);
}

:root {
  --font-sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", "Fira Code", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 18px;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s ease, border-color 0.4s ease;
}

.nav-inner {
  max-width: 900px;
  margin: 0 0 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.2s ease;
}

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

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  background: var(--border);
}

.theme-icon {
  display: none;
}

[data-theme="light"] .theme-icon.sun,
[data-theme="dark"] .theme-icon.moon {
  display: inline;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}

/* About section */
.about-wrapper {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

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

.about-content p {
  margin: 0 0 1rem;
}

.about-content p:last-child {
  margin-bottom: 0;
}

.about-sidebar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.avatar-wrap {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.name-block {
  text-align: center;
  margin-bottom: 0.25rem;
}

.name-main {
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--text);
}

.name-alt {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.contact-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.25rem 0;
}

.contact-item:hover {
  color: var(--accent);
}

.contact-icon-email {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.contact-block .contact-item {
  color: var(--accent);
}

.contact-block .contact-item:hover {
  color: var(--accent-hover);
}

.contact-email {
  font-family: var(--font-mono);
}

.social-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.25rem;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
  text-decoration: none;
}

.social-icon:hover {
  color: var(--accent-hover);
}

.social-icon svg {
  width: 100%;
  height: 100%;
}

/* Publication section */
.publication-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.publication-item {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.publication-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.publication-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.publication-venue {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
}

.publication-track {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-left: auto;
}

.publication-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

[data-theme="dark"] .publication-title {
  color: #f0f6fc;
}

.publication-authors {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.author-me {
  font-weight: 800;
  font-style: italic;
  color: var(--text);
}

[data-theme="dark"] .author-me {
  color: #c5cdd6;
}

.publication-links-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.publication-links {
  display: flex;
  gap: 1rem;
  font-size: 1rem;
}

.pub-link {
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

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

.abstract-content {
  margin-top: 0.75rem;
  padding: 1rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  max-height: 800px;
  opacity: 1;
  transition: opacity 0.55s ease, max-height 0.55s ease, margin 0.55s ease;
}

.abstract-content.abstract-collapsed {
  margin-top: 0;
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  border-width: 0;
}

.publication-rank {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.publication-item-note {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.publication-links a,
.publication-links .pub-link {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .about-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .about-sidebar {
    order: -1;
  }
}

@media (max-width: 640px) {
  .nav-inner {
    gap: 1rem;
    padding: 0.9rem 1rem;
  }

  .nav-links {
    gap: 1.5rem;
  }

  main {
    padding: 2rem 1rem 3rem;
  }

  body {
    font-size: 16px;
  }

}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.news-item {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

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

.news-date {
  font-weight: 600;
  color: var(--accent);
}

.news-celebrate {
  margin-right: 0.35em;
}

.news-item p {
  margin: 0;
  line-height: 1.6;
}

/* Honors & Awards */
.honors-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.honor-item {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

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

.honor-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.honor-issuer {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  transition: color 0.4s ease, border-color 0.4s ease;
}

.section,
.section-title,
.publication-item,
.publication-rank,
.contact-block .contact-item,
.contact-icon-email {
  transition: color 0.4s ease, background 0.4s ease, border-color 0.4s ease;
}
