/* Base styles */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Fira Code', 'Inter', 'Consolas', 'Menlo', 'monospace', 'sans-serif';
  font-size: clamp(13px, 1.2vw, 16px);
  background: #1e1e1e;
  color: #eee;
  transition: background-color 0.3s, color 0.3s;
}
body.light {
  background: #f4f4f7;
  color: #232323;
}

/* Top navigation bar */
.top-pane {
  width: 100%;
  height: 40px;
  background: #ff6b4a;
  margin: 0;
  padding: 0 0.5em;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  box-sizing: border-box;
  z-index: 2;
}

/* Main container */
.container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: border-box;
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: 170px;
  background: #232323;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #ddd;
  transition: background 0.3s, color 0.3s;
}
body.light .sidebar {
  background: #f0f0f0;
  color: #111;
}
.sidebar img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 160px;
  max-height: 220px;
  border-radius: 6px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.sidebar-desc {
  margin-bottom: 18px;
  text-align: center;
}
.sidebar-name {
  font-weight: bold;
  font-size: 1.08em;
  margin-bottom: 2px;
}
.sidebar-title {
  font-size: 0.98em;
  color: #ff6b4a;
  letter-spacing: 0.01em;
  margin-bottom: 2px;
}
body.light .sidebar-title {
  color: #fd2e00;
}

/* Contact links */
.contact {
  line-height: 1.7;
}
.contact a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  transition: color 0.2s;
}
.contact a .icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}
.contact a:hover {
  color: #66aaff;
  text-decoration: underline;
}
.contact span {
  margin-left: 8px;
}

/* Main content area */
.content {
  flex: 1;
  padding: 40px 5vw 40px 40px;
  overflow-y: auto;
  position: relative;
  min-width: 0;
  max-width: 900px;
  margin: 0 auto;
  background: none;
}
.intro {
  margin-bottom: 38px;
  text-align: justify;
}
.intro h1 {
  margin-top: 0;
}

/* Research section */
.research {
  margin-bottom: 38px;
}
.research h2 {
  margin-top: 0;
  border-bottom: 2px solid #444;
}

/* Publications section */
.publications h2 {
  margin-top: 0;
  border-bottom: 2px solid #444;
  text-align: justify;
}
.pub {
  display: flex;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid #444;
  transition: border-color 0.3s;
}
.pub-img-container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-shrink: 0;
  width: auto;
  height: auto;
  margin-right: 18px;
}
.pub-img-container img {
  width: 110px;
  max-width: 100%;
  height: auto;
  border: 1px solid #555;
  border-radius: 4px;
  transition: border-color 0.3s;
  object-fit: contain;
  display: block;
}
body.light .pub-img-container img {
  border: 1px solid #bbb;
}
.pub-details {
  flex: 1;
  min-width: 0;
}
.pub-title {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 1.05em;
}
.pub-authors {
  font-size: 1.05em;
  color: #bbb;
  margin-bottom: 4px;
  transition: color 0.3s;
}
.pub-authors .author-self {
  color: #ff6b4a;
}
body.light .pub-authors {
  color: #555;
}
body.light .pub-authors .author-self {
  color: #fd2e00;
}
.pub-venue {
  font-size: 1.05em;
  margin-bottom: 4px;
  transition: color 0.3s;
  font-style: italic;
}

/* Links */
a, .contact a, .pub-links a {
  color: #ff6b4a;
  transition: color 0.2s;
}
a:hover, .contact a:hover, .pub-links a:hover {
  color: #fffbe6;
  text-decoration: underline;
  font-weight: bold;
}
.intro a {
  text-decoration: none;
}
.intro a:hover {
  text-decoration: none;
}
body.light a,
body.light .contact a,
body.light .pub-links a {
  color: #fd2e00;
}
body.light a:hover,
body.light .contact a:hover,
body.light .pub-links a:hover {
  font-weight: bold;
}

/* Theme toggle button */
.toggle-btn {
  position: static;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.2s;
  color: #111;
  margin-right: 0.2em;
  margin-left: 0.2em;
  padding: 0 24px;
  border-radius: 6px;
  line-height: 1;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toggle-btn:focus {
  outline: 2px solid #66aaff;
}
.toggle-btn:hover {
  transform: scale(1.1);
}
.toggle-btn svg {
  display: block;
}

/* Responsive design */
@media (max-width: 1100px) {
  .container {
    padding: 0 10px;
  }
}
@media (max-width: 700px) {
  .container {
    flex-direction: column;
    padding: 0;
  }
  .sidebar {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    padding: 12px 8px 8px 8px;
    margin-bottom: 0;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100vw;
    justify-content: flex-start;
  }
  .sidebar img {
    display: block;
    width: auto;
    height: auto;
    max-width: 110px;
    max-height: 140px;
    border-radius: 14px;
    margin-right: 24px;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    align-self: center;
  }
  .sidebar-content-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
  }
  .sidebar-desc {
    text-align: left;
    margin-bottom: 0;
    margin-right: 0;
  }
  .sidebar-content-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
  }
  .sidebar-name {
    font-size: 1.6em;
    font-weight: bold;
  }
  .sidebar-title {
    font-size: 1.15em;
    font-weight: 600;
  }
  .contact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    justify-items: center;
    margin-bottom: 0;
    width: 100%;
    max-width: 350px;
  }
  .contact a {
    margin-bottom: 0;
    margin-right: 0;
    width: 100%;
    text-align: center;
  }
  .content {
    padding: 24px 2vw;
    max-width: 100vw;
  }
  .pub-img-container {
    margin-right: 10px;
  }
  .pub-img-container img {
    width: 80px;
    max-width: 80px;
  }
}

/* Footer/Trademark */
.trademark {
  width: 100%;
  font-size: 12px;
  color: #ff6b4a;
  text-align: center;
  padding: 18px 0 12px 0;
  background: #23272e;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.light .trademark {
  color: #fd2e00;
  background: #e9e9ef;
}
