/* ============================================================
   CHENYUAN ZHANG — Personal Academic Website
   style.css

   Quick customization guide:
   - Colors: edit the :root variables below
   - Font: change --font-body in :root
   - Layout width: change --max-width in :root
============================================================ */

:root {
  --color-bg:        #ffffff;
  --color-bg-alt:    #f5f7fa;
  --color-text:      #1a1a2e;
  --color-text-muted:#5a6476;
  --color-accent:    #1d4ed8;     /* primary blue */
  --color-accent-light: #eff6ff;
  --color-border:    #e5e9f0;
  --color-award:     #92400e;
  --color-award-bg:  #fffbeb;
  --color-award-border: #fbbf24;

  --font-body:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width:   900px;
  --nav-height:  60px;
  --radius:      8px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  padding-top: var(--nav-height);
}
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ---- Layout helpers ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.section       { padding: 64px 0; background: var(--color-bg); }
.section-alt   { padding: 64px 0; background: var(--color-bg-alt); }

/* ============================================================
   NAVIGATION
============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.nav-brand:hover { text-decoration: none; }
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--color-accent);
  text-decoration: none;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s;
}

/* ============================================================
   PROFILE / ABOUT
============================================================ */
.profile-section { padding-top: 72px; padding-bottom: 72px; }

.profile-grid {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

/* Photo */
.profile-photo-wrap {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--color-border);
  background: var(--color-bg-alt);
}
.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.profile-initials {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--color-accent);
  letter-spacing: -0.02em;
}

/* Info */
.profile-name {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: 4px;
}
.degree-tag {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-left: 6px;
}
.profile-position {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: 2px;
}
.profile-institution {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}
.profile-bio {
  font-size: 0.95rem;
  color: var(--color-text);
  max-width: 560px;
  margin-bottom: 20px;
}

/* Social buttons */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1.5px solid var(--color-accent);
  color: var(--color-accent);
  background: transparent;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.btn:hover {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}

/* ============================================================
   SECTION TITLES
============================================================ */
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}
.section-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  margin-top: -12px;
}

/* ============================================================
   NEWS
============================================================ */
.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.news-list li {
  font-size: 0.92rem;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 16px;
  background: var(--color-bg);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.section-alt .news-list li { background: #fff; }
.news-date {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  min-width: 70px;
  text-align: center;
  margin-top: 1px;
}
.news-body {
  flex: 1;
  line-height: 1.55;
}
.news-role {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
  white-space: nowrap;
}

/* ============================================================
   PUBLICATIONS
============================================================ */
.pub-year-group {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  align-items: flex-start;
}
.pub-year {
  flex-shrink: 0;
  width: 52px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-muted);
  padding-top: 2px;
}
.pub-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.pub-item {
  padding: 16px 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-alt);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pub-item:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 12px rgba(29, 78, 216, 0.08);
}

/* Award paper */
.pub-item.pub-award {
  border-color: var(--color-award-border);
  background: var(--color-award-bg);
}
.pub-award-label {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-award);
  background: #fef3c7;
  border: 1px solid var(--color-award-border);
  padding: 2px 8px;
  border-radius: 4px;
}

.pub-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 5px;
  line-height: 1.5;
}
.pub-authors {
  font-size: 0.855rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.pub-authors strong {
  color: var(--color-text);
  font-weight: 600;
}
.pub-venue {
  font-size: 0.845rem;
  color: var(--color-text-muted);
  font-style: italic;
}
.pub-conf-tag {
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  white-space: nowrap;
}
.pub-links {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}
.pub-links a {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 2px 10px;
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  color: var(--color-accent);
  transition: background 0.12s, color 0.12s;
}
.pub-links a:hover {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}
.pub-toggle-btn {
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  padding: 3px 12px;
  border: none;
  border-radius: 4px;
  color: #fff;
  background: #4b6fa5;
  cursor: pointer;
  transition: opacity 0.12s;
  vertical-align: middle;
}
.pub-toggle-btn::after {
  content: ' ▾';
}
.pub-toggle-btn.active {
  background: var(--color-accent);
}
.pub-toggle-btn.active::after {
  content: ' ▴';
}
.pub-toggle-btn:hover {
  opacity: 0.82;
}
.pub-collapse {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--color-bg);
  border-radius: var(--radius);
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--color-text);
}
.pub-bibtex-code {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
  margin: 0 0 8px 0;
}
.pub-copy-btn {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 3px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: opacity 0.12s;
}
.pub-copy-btn:hover { opacity: 0.82; }
.pub-role {
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
  white-space: nowrap;
}

/* ============================================================
   TEACHING
============================================================ */
.teaching-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.teaching-list li {
  padding: 10px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.teaching-code {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
  white-space: nowrap;
}
.teaching-group-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 18px 0 10px;
}
.teaching-group-title span {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-left: 6px;
}

/* ============================================================
   AWARDS
============================================================ */
.awards-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.awards-list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 0.92rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}
.awards-list li:last-child { border-bottom: none; }
.award-year {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  min-width: 68px;
}

/* ============================================================
   FOOTER
============================================================ */
.footer {
  background: var(--color-text);
  color: rgba(255,255,255,0.65);
  padding: 28px 0;
  text-align: center;
  font-size: 0.85rem;
}
.footer a { color: rgba(255,255,255,0.8); }
.footer a:hover { color: #fff; }

/* ============================================================
   RESPONSIVE — Mobile (<= 680px)
============================================================ */
@media (max-width: 680px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 0; }
  .nav-links a {
    display: block;
    padding: 10px 24px;
    font-size: 0.9rem;
  }

  .profile-grid { flex-direction: column; align-items: center; text-align: center; }
  .profile-photo-wrap { width: 140px; height: 140px; }
  .profile-bio { margin: 0 auto 20px; }
  .social-links { justify-content: center; }
  .profile-name { font-size: 1.6rem; }

  .pub-year-group { flex-direction: column; gap: 8px; }
  .pub-year { width: auto; }

  .section, .section-alt { padding: 44px 0; }
}
