/* ========================================
   Dr Shengchen Li — Personal Academic Website
   Editorial warm-tone design
   ======================================== */

:root {
  --bg: #f8f7f3;
  --bg-muted: #efede7;
  --text: #171717;
  --text-muted: #5f5f5f;
  --primary: #1f4f46;
  --primary-dark: #153a34;
  --accent: #c87533;
  --border: #dedbd2;
  --card: #ffffff;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.08);
  --max-width: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }

/* --- Sticky Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(248, 247, 243, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.navbar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-logo-university {
  height: 22px;
  width: auto;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.nav-logo-university:hover { opacity: 1; }

.nav-links {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.nav-links a.active,
.nav-links a:hover { color: var(--primary); }

/* Mobile toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--primary);
}
.nav-toggle svg { width: 24px; height: 24px; }

/* --- Hero (Homepage) --- */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 7rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 3rem;
  align-items: center;
}

.hero h1,
.page-hero h1 {
  margin: 0;
  max-width: 850px;
  font-size: clamp(2.7rem, 7vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.hero-text,
.page-hero p {
  max-width: 720px;
  font-size: 1.18rem;
  color: var(--text-muted);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

/* --- Buttons --- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover { transform: translateY(-2px); }

.button.primary {
  color: white;
  background: var(--primary);
  box-shadow: 0 12px 24px rgba(31, 79, 70, 0.2);
}

.button.primary:hover { background: var(--primary-dark); color: white; }

.button.secondary {
  color: var(--primary);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.55);
}

/* --- Profile Card (Hero aside) --- */
.hero-card,
.card,
.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 1.7rem;
  box-shadow: var(--shadow);
}

.hero-card h2,
.card h2,
.card h3,
.contact-card h2 {
  margin-top: 0;
  letter-spacing: -0.03em;
}

.hero-card ul,
.topic-list ul,
.contact-card ul { padding-left: 1.1rem; }

.hero-card li,
.topic-list li,
.contact-card li { margin-bottom: 0.55rem; }

.hero-portrait {
  width: 18vw;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 20px;
  margin-bottom: 1.2rem;
  display: block;
}

/* --- Page Hero (Sub-pages) --- */
.page-hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6rem 1.5rem 3rem;
}

/* --- Sections --- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
}

.section.muted {
  max-width: none;
  padding-left: calc((100vw - var(--max-width)) / 2 + 1.5rem);
  padding-right: calc((100vw - var(--max-width)) / 2 + 1.5rem);
  background: var(--bg-muted);
}

.section-header {
  max-width: 720px;
  margin-bottom: 2rem;
}

.section-header h2,
.section h2 {
  margin-top: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.two-column p,
.wide-text {
  font-size: 1.08rem;
  color: var(--text-muted);
}

.two-column p:last-child {
  grid-column: 1 / -1;
}

/* --- Card Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.card { box-shadow: none; }
.card p { color: var(--text-muted); }

/* --- Stats Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.stat-card strong {
  display: block;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--primary);
  letter-spacing: -0.05em;
}

.stat-card span {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* --- CTA Section --- */
.cta { text-align: center; }
.cta p {
  max-width: 680px;
  margin: 0 auto 2rem;
  color: var(--text-muted);
  font-size: 1.08rem;
}

/* --- Research Items --- */
.research-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.research-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.research-item:nth-child(even) {
  direction: rtl;
}

.research-item:nth-child(even) > * {
  direction: ltr;
}

.research-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.research-figure {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.research-figure img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.research-number {
  color: var(--accent);
  font-weight: 900;
  font-size: 1.3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.research-item h2 {
  margin-top: 0;
  font-size: 1.7rem;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.research-item p { color: var(--text-muted); }

/* --- Tag List --- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
}

/* --- Contact Grid --- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

/* --- CV Sections --- */
.cv-section {
  margin-bottom: 4rem;
}

.cv-section h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.7rem;
  margin-bottom: 1.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

/* --- Timeline --- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 1.5rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item span {
  color: var(--accent);
  font-weight: 800;
}

.timeline-item h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.timeline-item p {
  margin: 0;
  color: var(--text-muted);
}

/* --- CV List --- */
.cv-list {
  padding-left: 1.2rem;
}

.cv-list li {
  margin-bottom: 0.85rem;
  color: var(--text-muted);
}

.cv-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  padding: 3px 10px;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
  margin-right: 0.4rem;
}

.cv-detail {
  color: var(--text-muted);
}

/* --- Numbered Publications --- */
.numbered-publications {
  counter-reset: publication;
  list-style: none;
  padding-left: 0;
}

.numbered-publications li {
  counter-increment: publication;
  position: relative;
  padding: 1.3rem 1.3rem 1.3rem 4rem;
  margin-bottom: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
}

.numbered-publications li::before {
  content: counter(publication);
  position: absolute;
  left: 1.2rem;
  top: 1.2rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
}

.numbered-publications strong { color: var(--text); }

/* --- Publication List (simpler style for filter view) --- */
.pub-list {
  list-style: none;
  padding: 0;
}

.pub-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
}

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

.pub-venue {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  background: var(--primary);
  padding: 2px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.pub-venue.journal { background: var(--accent); }

.pub-title { font-weight: 600; }
.pub-title a { color: var(--text); border-bottom: 1px solid var(--border); }
.pub-title a:hover { color: var(--primary); border-bottom-color: var(--primary); }

.pub-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.25em;
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* --- Year Label --- */
.year-label {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--primary);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* --- News List --- */
.news-list {
  list-style: none;
  padding: 0;
}

.news-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  align-items: baseline;
}

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

.news-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.news-text { font-size: 0.95rem; color: var(--text-muted); }

/* --- Awards List --- */
.awards-list {
  list-style: none;
  padding: 0;
}

.awards-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  align-items: baseline;
}

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

.award-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
}

/* --- Recruitment Info --- */
.recruitment-info {
  background: var(--bg-muted);
  border-left: 4px solid var(--primary);
  padding: 1.5rem 1.7rem;
  border-radius: 0 20px 20px 0;
  margin: 1.5rem 0;
}

.recruitment-info p:last-child { margin-bottom: 0; }

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* --- Responsive --- */
@media (max-width: 860px) {
  .navbar {
    align-items: flex-start;
    gap: 1rem;
    flex-direction: column;
  }

  .nav-links {
    display: none;
    flex-wrap: wrap;
    gap: 0.9rem;
  }

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

  .hero {
    grid-template-columns: 1fr;
    padding-top: 4.5rem;
  }

  .two-column,
  .card-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .section.muted {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .research-item {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .research-item:nth-child(even) {
    direction: ltr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .news-list li,
  .awards-list li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

@media (max-width: 520px) {
  .hero h1,
  .page-hero h1 {
    font-size: 2.55rem;
  }

  .hero,
  .page-hero,
  .section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-card,
  .card,
  .contact-card {
    border-radius: 22px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .numbered-publications li {
    padding-left: 1.3rem;
    padding-top: 4rem;
  }

  .numbered-publications li::before { top: 1.2rem; }
}
