/* ============================================================
   Shared site styles — Zifeng Wang
   Used by publication.html, software.html, cv.html
   (index.html keeps its own inline styles)
   ============================================================ */

:root {
  --accent: #8b1a1a;
  --accent-soft: #fdf6f6;
  --accent-border: #e8d6d6;
  --text: #1d1d1f;
  --muted: #6b6b70;
  --link: #8b1a1a;
  --venue: #1f5fa8;
  --rule: #ececec;
  --maxw: 1280px;
  --contentw: 1080px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  letter-spacing: -0.011em;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

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

/* ---------- Top bar ---------- */
nav.topbar {
  background: var(--accent);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
}
nav.topbar .bar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.7rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.6rem;
  font-family: var(--sans);
}
nav.topbar .bar-name {
  font-weight: 600;
  font-size: 1.15rem;
  color: #fff;
  margin-right: auto;
  letter-spacing: 0.01em;
}
nav.topbar a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.02rem;
  font-weight: 500;
}
nav.topbar a:hover,
nav.topbar a.current { color: #fff; text-decoration: none; }
nav.topbar a.current { border-bottom: 2px solid #fff; padding-bottom: 2px; }

/* ---------- Page container ---------- */
.page {
  max-width: var(--contentw);
  margin: 0 auto;
  padding: 2.4rem 1.5rem 4rem;
}

.page-title {
  font-family: var(--sans);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 1.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--accent);
}

.page h2 {
  font-family: var(--sans);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--rule);
}

.page h3 {
  font-family: var(--sans);
  font-weight: 600;
}

.page p { margin: 0.7rem 0; }

.page ul { padding-left: 1.3rem; margin: 0.6rem 0; }
.page ul li { margin-bottom: 0.45rem; }
.page ul ul { margin: 0.35rem 0; }

/* ---------- CV / About ---------- */
.bio-container {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 1.1rem 1.4rem;
  margin: 0 0 1.8rem;
  font-size: 1rem;
}

/* ---------- Honors & Awards ---------- */
ul.honors { list-style: none; padding: 0; margin: 0.6rem 0; }
ul.honors li {
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--rule);
}
ul.honors li:last-child { border-bottom: none; }
.honor-year {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-right: 0.5rem;
}

/* ---------- Software (figure + content rows) ---------- */
.software-list { margin: 0.6rem 0; }
.sw-entry {
  display: flex;
  gap: 1.3rem;
  align-items: flex-start;
  padding: 1.3rem 0;
  border-bottom: 1px dashed var(--rule);
}
.sw-entry:last-child { border-bottom: none; }
.sw-figure { flex: 0 0 240px; width: 240px; }
.sw-figure img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
  display: block;
}
.sw-detail { flex: 1; min-width: 0; }
.sw-detail h3 { margin: 0 0 0.35rem; font-size: 1.08rem; }
.sw-detail ul { margin: 0.3rem 0 0.7rem; }
.sw-detail li { font-size: 0.95rem; }
.sw-links { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.sw-detail { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .sw-entry { flex-direction: column; gap: 0.6rem; }
  .sw-figure { flex-basis: auto; width: 100%; }
  .sw-figure img { height: auto; max-height: 260px; }
}

/* ---------- Software cards (legacy) ---------- */
.software-card {
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin: 1.3rem 0;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.software-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}
.software-card .software-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 1rem 1.4rem;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--rule);
}
.software-card .software-title h3 {
  margin: 0;
  font-size: 1.08rem;
  color: var(--text);
}
.software-links { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.software-content { padding: 1rem 1.4rem; }
.software-content ul { margin: 0; }
.software-content li { font-size: 0.98rem; }

.paper-link, .doc-link {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  transition: all 0.18s ease;
}
.paper-link:hover, .doc-link:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.github-stars {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.github-stars:hover { text-decoration: none; }
.github-stars img { vertical-align: middle; }

/* ---------- Publications ---------- */
#filter-section {
  background: #fafafa;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.8rem;
}
#filter-section h3 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  color: var(--text);
}
#filter-section .filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
#filter-section strong { font-family: var(--sans); font-size: 0.85rem; font-weight: 500; }
#filter-section select {
  font-family: var(--sans);
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--rule);
  margin-left: 0.4rem;
  background: #fff;
}
#reset-filters {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.18s ease;
}
#reset-filters:hover { opacity: 0.88; }

h2[id^="year-"] {
  font-family: var(--sans);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin: 2rem 0 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--rule);
}

ul.pub-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.pub-item {
  position: relative;
  padding: 0.7rem 0 0.7rem 1.2rem;
  border-bottom: 1px dashed var(--rule);
}
.pub-item:last-child { border-bottom: none; }
.pub-item::before {
  content: "";
  position: absolute;
  left: 0; top: 1.15rem;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.pub-item p { margin: 0.25rem 0; font-size: 0.98rem; word-wrap: break-word; }
.pub-item b { color: var(--text); }
/* author highlight + venue from inline <font> tags */
.pub-item font[color="#ac0000"] { color: var(--accent) !important; font-weight: 600; }
.pub-item font[color="#0000ff"] { color: var(--venue) !important; font-style: normal; font-weight: 500; }
.pub-item a[href$=".pdf"], .pub-item a[href*="PDF"] { color: var(--accent); }

#no-results-message { padding: 1.2rem 0; font-style: italic; color: var(--muted); }

/* ---------- Footer ---------- */
footer.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .page { padding: 1.5rem 1.1rem 2.5rem; }
  .page-title { font-size: 1.6rem; }
  .page h2 { font-size: 1.2rem; }
  nav.topbar .bar-inner { padding: 0.6rem 1.1rem; gap: 0.2rem 1.1rem; }
  nav.topbar .bar-name { font-size: 1.05rem; width: 100%; margin-right: 0; margin-bottom: 0.15rem; }
  nav.topbar a { font-size: 0.95rem; padding: 0.15rem 0; }
  #filter-section .filter-row { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  #filter-section select { margin-left: 0; }
  .pub-item { padding-left: 1rem; overflow-wrap: anywhere; }
  footer.site-footer { padding: 1.6rem 1.1rem 2.5rem; }
}
