/* ==========================================================================
   AcadHomepage Classic Two-Column Academic Stylesheet
   Clean White Canvas · Scholarly Typography · Restrained Academic Palette
   ========================================================================== */

:root {
  --bg-page: #ffffff;
  --bg-subtle: #f8fafc;
  --text-main: #222222;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --link-blue: #224b8d;
  --link-hover: #1d4ed8;
  --badge-navy: #00369f;
  --badge-emerald: #166534;
  --badge-slate: #334155;
  --border-line: #e5e7eb;
  --border-light: #efefef;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--badge-navy);
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  z-index: 999;
}
.skip-link:focus {
  left: 16px;
}

/* --------------------------------------------------------------------------
   1. Top Masthead Navigation Bar (AcadHomepage Style)
   -------------------------------------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-line);
}

.masthead__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.masthead__brand {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
}
.masthead__brand:hover {
  color: var(--link-blue);
  text-decoration: none;
}

.masthead__nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.masthead__nav a {
  font-size: 15px;
  font-weight: 500;
  color: #4b5563;
  transition: color 0.15s ease;
}

.masthead__nav a:hover {
  color: #111827;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   2. Two-Column Page Layout (Left Sticky Profile + Right Scholarly Content)
   -------------------------------------------------------------------------- */
.page-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 72px;
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

/* Left Profile Sidebar */
.sidebar {
  position: sticky;
  top: 88px;
}

.author-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.author__avatar {
  width: 172px;
  height: 172px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #dbe3ec;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  background: var(--bg-subtle);
  margin-bottom: 16px;
}

.author__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.author__name {
  font-size: 21px;
  font-weight: 700;
  color: #111827;
  line-height: 1.25;
}

.author__name-zh {
  font-size: 15px;
  font-weight: 600;
  color: #4b5563;
  margin-top: 2px;
}

.author__bio {
  font-size: 13.5px;
  color: #374151;
  line-height: 1.5;
  margin-top: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  width: 100%;
}

.author__dept {
  color: var(--text-muted);
  font-size: 13px;
}

.author__urls {
  list-style: none;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13.5px;
  color: #374151;
  width: 100%;
}

.author__urls li {
  display: flex;
  align-items: center;
  gap: 9px;
  line-height: 1.4;
}

.author__urls svg {
  flex-shrink: 0;
  color: #6b7280;
}

.author__urls a {
  color: #374151;
}

.author__urls a:hover {
  color: var(--link-blue);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   3. Right Main Content Column & Sections
   -------------------------------------------------------------------------- */
.main-content {
  min-width: 0;
}

.acad-section {
  margin-bottom: 36px;
}

.section-heading {
  font-size: 21px;
  font-weight: 700;
  color: #111827;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-line);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.section-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-line);
  padding-bottom: 8px;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-heading-row .section-heading {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}

.heading-more {
  font-size: 14px;
  font-weight: 500;
  color: var(--link-blue);
}

.sub-heading {
  font-size: 16.5px;
  font-weight: 700;
  color: #111827;
  margin: 18px 0 8px;
}

.acad-section p {
  font-size: 15.5px;
  color: var(--text-main);
  margin-bottom: 12px;
  text-align: justify;
}

.bio-zh {
  color: #374151;
  font-size: 15px !important;
  background: #f8fafc;
  border-left: 3px solid var(--link-blue);
  padding: 10px 14px;
  border-radius: 0 4px 4px 0;
}

.acad-list {
  padding-left: 20px;
  font-size: 15px;
  color: var(--text-main);
}

.acad-list li {
  margin-bottom: 8px;
  line-height: 1.65;
}

.edu-sub {
  font-size: 14px;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   4. News List (AcadHomepage Style)
   -------------------------------------------------------------------------- */
.news-list {
  padding-left: 20px;
  font-size: 15px;
  color: var(--text-main);
}

.news-list li {
  margin-bottom: 9px;
  line-height: 1.6;
}

.news-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13.5px;
  font-weight: 600;
  color: #111827;
  margin-right: 4px;
}

/* --------------------------------------------------------------------------
   5. Paper Box Rows (AcadHomepage .paper-box with Top-Left Venue Ribbon)
   -------------------------------------------------------------------------- */
.paper-list {
  display: flex;
  flex-direction: column;
}

.paper-box {
  display: flex;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-light);
  align-items: flex-start;
}

.paper-box:first-child {
  padding-top: 6px;
}

.paper-box:last-child {
  border-bottom: 0;
}

.paper-box-image {
  flex: 0 0 33%;
  max-width: 275px;
}

.paper-img-wrap {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #dbe3ec;
  background: #f8fafc;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.paper-img-wrap img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.paper-img-wrap:hover img {
  transform: scale(1.015);
}

/* Classic AcadHomepage Top-Left Venue Badge */
.badge {
  position: absolute;
  top: 8px;
  left: 0;
  z-index: 2;
  background-color: var(--badge-navy);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.01em;
}

.badge-emerald {
  background-color: #0f5132;
}
.badge-blue, .badge-navy {
  background-color: #00369f;
}
.badge-indigo, .badge-amber {
  background-color: #334155;
}

.paper-box-text {
  flex: 1;
  min-width: 0;
}

.paper-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 5px;
}

.paper-title a {
  color: var(--link-blue);
}

.paper-title a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.paper-authors {
  font-size: 14.5px;
  color: #374151;
  margin-bottom: 3px !important;
}

.author-me {
  color: #111827;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.paper-venue {
  font-size: 14px !important;
  color: var(--text-secondary) !important;
  margin-bottom: 8px !important;
}

.paper-desc {
  font-size: 14.5px !important;
  color: #333333 !important;
  line-height: 1.6 !important;
  margin-bottom: 10px !important;
}

.paper-mechanism {
  font-size: 13.5px !important;
  color: #4b5563 !important;
  margin-bottom: 10px !important;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.paper-btn {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  color: var(--link-blue);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.paper-btn:hover {
  background: var(--link-blue);
  color: #ffffff;
  border-color: var(--link-blue);
  text-decoration: none;
}

/* BibTeX Drawer */
.bibtex-drawer {
  margin-top: 10px;
  background: #f8fafc;
  border: 1px solid var(--border-line);
  border-radius: 4px;
  padding: 10px 12px;
}

.bibtex-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.bibtex-copy {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 11.5px;
  cursor: pointer;
  color: #374151;
}

.bibtex-drawer pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: #1f2937;
  overflow-x: auto;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   6. Subtle Filter & Compact Toolbar for Projects
   -------------------------------------------------------------------------- */
.projects-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.view-switch {
  display: inline-flex;
  border: 1px solid var(--border-line);
  border-radius: 4px;
  overflow: hidden;
}

.view-btn {
  background: #ffffff;
  border: 0;
  padding: 3px 9px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.view-btn[aria-pressed="true"] {
  background: #f1f5f9;
  color: #111827;
  font-weight: 600;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filters button {
  background: #ffffff;
  border: 1px solid var(--border-line);
  border-radius: 3px;
  padding: 3px 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
}

.filters button[aria-pressed="true"] {
  background: var(--link-blue);
  color: #ffffff;
  border-color: var(--link-blue);
}

.search-box input {
  border: 1px solid var(--border-line);
  border-radius: 3px;
  padding: 4px 10px;
  font-size: 13px;
  color: var(--text-main);
  width: 200px;
}

/* Compact Mode for Projects */
#project-list.compact-mode .paper-box-image,
#project-list.compact-mode .paper-mechanism {
  display: none;
}

#project-list.compact-mode .paper-box {
  padding: 12px 0;
}

/* Footer */
.site-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border-line);
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] {
  display: none;
}
.lightbox img {
  max-width: 92vw;
  max-height: 82vh;
  background: #ffffff;
  border-radius: 6px;
  padding: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: #ffffff;
  color: #111827;
  border: 0;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
#lightbox-caption {
  color: #f8fafc;
  margin-top: 12px;
  font-size: 14px;
}

/* Responsive Tablet & Mobile */
@media (max-width: 860px) {
  .page-container {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .sidebar {
    position: static;
  }
  .author-card {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-line);
  }
  .author__avatar {
    width: 110px;
    height: 110px;
    margin-bottom: 0;
  }
  .paper-box {
    flex-direction: column;
    gap: 14px;
  }
  .paper-box-image {
    flex: none;
    width: 100%;
    max-width: 420px;
  }
}
