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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: #494e52;
  background: #fff;
}

a { color: #224b8d; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid #eee;
  backdrop-filter: blur(6px);
}

.navbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
}

.nav-brand { font-weight: 700; color: #333; font-size: 1rem; }
.nav-brand:hover { text-decoration: none; }

.nav-links { display: flex; gap: 1.2rem; list-style: none; }
.nav-links a { font-size: 0.875rem; color: #666; position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 2px; background: #224b8d;
  transform: scaleX(0); transition: transform 0.2s;
}
.nav-links a:hover { text-decoration: none; color: #224b8d; }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none; background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-toggle svg { width: 22px; height: 22px; stroke: #333; }

/* ===== Layout ===== */
.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-layout {
  display: flex;
  gap: 1.5rem;
  padding-top: 1rem;
  align-items: flex-start;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 62px;
  text-align: center;
}

.sidebar img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eee;
}

.sidebar h1 {
  font-size: 1.3rem;
  color: #333;
  margin: 0.4rem 0 0.1rem;
}

.sidebar .title {
  font-size: 0.85rem;
  color: #777;
  line-height: 1.45;
  margin-bottom: 0.3rem;
}

.sidebar .contact {
  font-size: 0.78rem;
  color: #aaa;
  margin-bottom: 0.25rem;
  cursor: pointer;
}

.sidebar .contact .hide {
  display: none;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.82rem;
}

.sidebar-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #555;
}

.sidebar-links a:hover { color: #224b8d; text-decoration: none; }
.sidebar-links svg { width: 15px; height: 15px; flex-shrink: 0; }

.scholar-stats {
  font-size: 0.75rem;
  color: #999;
  font-weight: 400;
}

/* ===== Main Content ===== */
.main {
  flex: 1;
  min-width: 0;
  padding-bottom: 1.5rem;
}

/* ===== Sections ===== */
.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #333;
  margin: 0.9rem 0 0.3rem;
  padding-bottom: 0.15rem;
  border-bottom: 1.5px solid #ddd;
}

.main > .section-title:first-child {
  margin-top: 0;
}

/* ===== About ===== */
.about-text {
  font-size: 0.95rem;
  color: #494e52;
  margin-bottom: 0.25rem;
  line-height: 1.6;
}

/* ===== Research Interests ===== */
.research-list {
  list-style: none;
}

.research-list li {
  font-size: 0.93rem;
  color: #494e52;
  padding: 0.15rem 0 0.15rem 1rem;
  position: relative;
  line-height: 1.5;
}

.research-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #224b8d;
}

/* ===== News ===== */
.news-list {
  list-style: none;
}

.news-list li {
  font-size: 0.93rem;
  line-height: 1.5;
  color: #494e52;
  padding: 0.1rem 0;
}

.news-date {
  display: inline-block;
  color: #B00C00;
  font-weight: 500;
  font-style: italic;
  margin-right: 0.25rem;
}

/* ===== Education & Experience ===== */
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.info-table td {
  padding: 0.25rem 0;
  vertical-align: top;
  border-bottom: 1px solid #f2f2f2;
  line-height: 1.5;
}

.info-table tr:last-child td {
  border-bottom: none;
}

.info-table .col-year {
  width: 140px;
  color: #999;
  font-size: 0.85rem;
  white-space: nowrap;
  padding-right: 0.8rem;
}

.info-table .col-info strong {
  color: #333;
  font-weight: 600;
}

/* ===== Publications ===== */
.pub-note {
  font-size: 0.88rem;
  color: #777;
  margin-bottom: 0.3rem;
}

.pub-note .red { color: #B00C00; font-weight: 600; }

.pub-list {
  list-style: none;
  counter-reset: pub;
}

.pub-list li {
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 0.3rem 0;
  border-bottom: 1px solid #f5f5f5;
}

.pub-list li:last-child {
  border-bottom: none;
}

.pub-line1 {
  line-height: 1.6;
}

.pub-venue {
  font-family: Monaco, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: #224b8d;
  background: #f0f4fa;
  padding: 0.08rem 0.4rem;
  border-radius: 2px;
  white-space: nowrap;
  margin-right: 0.3rem;
  vertical-align: middle;
}

.pub-title {
  font-weight: 600;
  color: #333;
}

.pub-ccf-a { font-size: 0.78rem; font-weight: 600; color: #B00C00; white-space: nowrap; margin-right: 0.2rem; }
.pub-ccf-b { font-size: 0.78rem; font-weight: 600; color: #e67e22; white-space: nowrap; margin-right: 0.2rem; }
.pub-ccf-c { font-size: 0.78rem; font-weight: 600; color: #27ae60; white-space: nowrap; margin-right: 0.2rem; }

.pub-award {
  font-size: 0.72rem;
  font-weight: 700;
  color: #d4920b;
  background: #fef9e7;
  padding: 0.06rem 0.35rem;
  border-radius: 2px;
  white-space: nowrap;
  margin-right: 0.2rem;
  vertical-align: middle;
}

.pub-links {
  font-size: 0.82rem;
  white-space: nowrap;
  margin-left: 0.15rem;
}

.pub-links a { color: #224b8d; }

.pub-authors {
  font-size: 0.86rem;
  color: #888;
  margin-top: 0.05rem;
}

.pub-authors .me {
  color: #224b8d;
  font-weight: 600;
}

/* ===== Awards ===== */
.awards-list {
  list-style: none;
}

.awards-list li {
  font-size: 0.93rem;
  color: #494e52;
  padding: 0.15rem 0;
  line-height: 1.5;
}

.awards-list .award-year {
  display: inline-block;
  color: #999;
  font-size: 0.85rem;
  font-style: italic;
  margin-right: 0.25rem;
}

/* Service list */
.service-list {
  list-style: none;
}

.service-list li {
  font-size: 0.93rem;
  color: #494e52;
  padding: 0.15rem 0 0.15rem 1rem;
  position: relative;
}

.service-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #224b8d;
}

/* ===== CVEs ===== */
.cve-intro {
  font-size: 0.93rem;
  color: #494e52;
  margin-bottom: 0.3rem;
}

.cve-group {
  margin-bottom: 0.35rem;
}

.cve-group summary {
  font-size: 0.93rem;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  padding: 0.2rem 0;
  list-style: none;
}

.cve-group summary::-webkit-details-marker { display: none; }

.cve-group summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.4rem;
  color: #224b8d;
  transition: transform 0.2s;
}

.cve-group[open] summary::before {
  transform: rotate(90deg);
}

.cve-group h3 {
  font-size: 0.93rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.1rem;
}

.cve-ids {
  font-size: 0.82rem;
  color: #666;
  line-height: 1.6;
  word-break: break-all;
}

.cve-ids a { color: #555; white-space: nowrap; }
.cve-ids a:hover { color: #224b8d; }

/* ===== Footer ===== */
.footer {
  background: #f8f9fa;
  border-top: 1px solid #eee;
  padding: 0.6rem 0;
  text-align: center;
  font-size: 0.78rem;
  color: #aaa;
}

.footer a { color: #888; }

/* ===== Animation ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.page-layout { animation: fadeIn 0.35s ease; }

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .page-layout {
    flex-direction: column;
    gap: 1.2rem;
  }

  .sidebar {
    width: 100%;
    position: static;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
  }

  .sidebar img { width: 90px; height: 90px; }

  .sidebar-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 48px; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 0.8rem 1.5rem;
    gap: 0.5rem;
  }

  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }

  .info-table .col-year { width: 105px; }
}
