/* Jemdoc-inspired academic layout (original stylesheet for this site) */
*, *::before, *::after { box-sizing: border-box; }

html {
  background-color: #eeeeee;
  scroll-padding-top: 72px;
  scroll-behavior: smooth;
}

body {
  font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, "Noto Serif SC", serif;
  color: #1a1a1a;
  background-color: #fff;
  margin: 30px auto;
  padding: 10px 50px 36px;
  max-width: 960px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.layout-content {
  padding: 0 1em;
  background: #fff;
  text-align: left;
}

a {
  color: #224b8d;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  text-decoration: underline;
}

div#toptitle {
  padding-bottom: 0.2em;
  margin-bottom: 0.5em;
}

h1, h2, h3 {
  color: #1a1a1a;
  margin-top: 1em;
  margin-bottom: 0.6em;
  padding-bottom: 0.25em;
  line-height: 1.2;
  padding-top: 0.5em;
  border-bottom: 1px solid #ddd;
}

h1 { font-size: 165%; padding-bottom: 0.3em; }
h2 { padding-top: 0.8em; font-size: 125%; }
h3 {
  font-size: 110%;
  border-bottom: none;
  margin-top: 0.35em;
  padding-top: 0;
  color: #2e5a87;
}

.layout-content div#toptitle h1 {
  margin-bottom: 0;
  padding-bottom: 0.1em;
  padding-top: 0;
  margin-top: 0.5em;
  border-bottom: none;
}

h3.title {
  margin-top: -0.35em;
  margin-bottom: 0.75em;
  font-weight: normal;
  color: #444;
}

p {
  margin-top: 0;
  margin-bottom: 0.8em;
  padding: 0;
  line-height: 1.65;
  text-align: justify;
}

p.zh {
  color: #666;
  font-size: 0.92em;
}

img { border: none; max-width: 100%; }

/* Profile row */
.profile-row {
  display: flex;
  align-items: flex-start;
  gap: 2em;
}

.profile-info { flex: 1 1 0; }
.profile-photo { flex: 0 0 200px; }

.profile-photo img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* Navbar */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
  z-index: 1000;
  font-size: 0.95em;
}

#navbar .nav-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 50px;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

#navbar .nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

#navbar a {
  color: #224b8d;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

#navbar a:hover {
  border-bottom: 2px solid #224b8d;
  text-decoration: none;
}

#navbar .last-updated {
  margin-left: auto;
  font-size: 0.8em;
  color: #666;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #1a1a1a;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.page-section { margin-top: 56px; }

/* Publications */
.paper-cat {
  margin-top: 1.25em;
  margin-bottom: 0.35em;
}

.paper-block {
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.paper-block:hover {
  border-color: #e0e0e0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.paper-block.highlight {
  background: #ffffd0;
}

.papertitle { font-weight: 600; }

span.highlight { background-color: #ffffd0; }

@media (max-width: 768px) {
  body { padding: 10px 20px 24px; }

  #navbar .nav-container { padding: 10px 20px; }

  .nav-toggle { display: flex; }

  #navbar .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding-top: 8px;
  }

  #navbar .nav-links.open { display: flex; }

  #navbar .nav-links a {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
  }

  #navbar .last-updated { display: none; }

  .profile-row {
    flex-direction: column-reverse;
    align-items: center;
  }

  .profile-photo {
    flex: 0 0 auto;
    width: 160px;
  }
}

@media (max-width: 480px) {
  body { padding: 8px 12px 18px; }
  #navbar .nav-container { padding: 8px 12px; }
  h1 { font-size: 140%; }
  h2 { font-size: 115%; }
  .profile-photo { width: 130px; }
}
