/* =============================================
   Haolin (Harry) Zhang — Academic Homepage
   Minimal & clean static site
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --text: #333333;
  --text-light: #666666;
  --text-lighter: #999999;
  --accent: #b8860b;
  --accent-light: #e8c547;
  --link: #1a6dcc;
  --link-hover: #b8860b;
  --border: #e5e5e5;
  --border-light: #f0f0f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --max-width: 780px;
  --nav-height: 56px;
  --radius: 6px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #1a1a2e;
  --bg-alt: #16213e;
  --text: #e0e0e0;
  --text-light: #aaaaaa;
  --text-lighter: #777777;
  --link: #6db3f2;
  --link-hover: #e8c547;
  --border: #2a2a4a;
  --border-light: #333355;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

/* =============================================
   NAVIGATION
   ============================================= */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  height: var(--nav-height);
}
nav .nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
nav .nav-brand {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
nav .nav-links { display: flex; gap: 0.3rem; align-items: center; }
nav .nav-links a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  transition: all var(--transition);
}
nav .nav-links a:hover,
nav .nav-links a.active { color: var(--accent); background: var(--bg-alt); }

/* Theme toggle */
#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-light);
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  transition: all var(--transition);
}
#theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* =============================================
   MAIN CONTENT
   ============================================= */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.2rem 4rem;
}

/* =============================================
   PROFILE / HEADER
   ============================================= */
.profile {
  display: flex;
  align-items: flex-start;
  gap: 1.8rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.profile-photo {
  flex-shrink: 0;
  width: 150px;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}
.profile-info h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}
.profile-info .subtitle {
  font-size: 1rem;
  color: var(--text-light);
  font-weight: 400;
  margin-bottom: 0.4rem;
}
.profile-info .affiliation {
  font-size: 0.9rem;
  color: var(--text-lighter);
}

/* Social Icons */
.social-icons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}
.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.social-icons a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* =============================================
   SECTIONS
   ============================================= */
section { margin-bottom: 2.5rem; padding-top: 0.5rem; }

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
  letter-spacing: -0.01em;
}
h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

p { margin-bottom: 0.8rem; color: var(--text-light); }

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

/* =============================================
   EDUCATION / TIMELINE ITEMS
   ============================================= */
.timeline-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border-light);
}
.timeline-item:last-child { border-bottom: none; padding-bottom: 0; }
.timeline-year {
  flex-shrink: 0;
  width: 90px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: 0.15rem;
}
.timeline-content { flex: 1; }
.timeline-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.timeline-content .meta {
  font-size: 0.85rem;
  color: var(--text-lighter);
  margin-bottom: 0.3rem;
}
.timeline-content p {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* =============================================
   BADGES / TAGS
   ============================================= */
.badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0; }
.badge {
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  background: var(--bg-alt);
  color: var(--text-light);
  border: 1px solid var(--border);
  font-weight: 500;
}

/* =============================================
   PUBLICATIONS
   ============================================= */
.pub-list, .blog-list { list-style: none; }

.pub-item, .blog-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
.pub-item:last-child, .blog-item:last-child { border-bottom: none; }

.pub-item .pub-title {
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.pub-item .pub-authors {
  font-size: 0.84rem;
  color: var(--text-light);
  margin-bottom: 0.15rem;
}
.pub-item .pub-venue {
  font-size: 0.82rem;
  color: var(--text-lighter);
  font-style: italic;
}
.pub-item .pub-links {
  margin-top: 0.25rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.pub-item .pub-links a {
  font-size: 0.8rem;
  color: var(--link);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: var(--bg-alt);
  transition: all var(--transition);
}
.pub-item .pub-links a:hover {
  background: var(--accent);
  color: #fff;
}

.pub-group-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin: 1.5rem 0 0.8rem;
}

/* =============================================
   BLOG CARDS (on listing page)
   ============================================= */
.blog-item {
  display: block;
  padding: 1rem 0.8rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-light);
  transition: all var(--transition);
}
.blog-item:hover {
  background: var(--bg-alt);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.blog-item .blog-date {
  font-size: 0.8rem;
  color: var(--text-lighter);
  margin-bottom: 0.2rem;
}
.blog-item .blog-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.3rem;
  text-decoration: none;
}
.blog-item:hover .blog-title { color: var(--accent); }
.blog-item .blog-excerpt {
  font-size: 0.84rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* =============================================
   BLOG POST PAGE
   ============================================= */
.blog-post-header {
  margin-bottom: 2rem;
}
.blog-post-header .post-date {
  font-size: 0.85rem;
  color: var(--text-lighter);
  margin-bottom: 0.3rem;
}
.blog-post-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.blog-post-content h2 { font-size: 1.15rem; margin-top: 2rem; }
.blog-post-content h3 { font-size: 1rem; margin-top: 1.5rem; }
.blog-post-content p { margin-bottom: 1rem; }
.blog-post-content ul, .blog-post-content ol { margin: 0.5rem 0 1rem 1.5rem; }
.blog-post-content li { margin-bottom: 0.4rem; color: var(--text-light); }
.blog-post-content pre, .blog-post-content code {
  background: var(--bg-alt);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
}
.blog-post-content pre {
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.5;
}
.blog-post-content pre code { border: none; padding: 0; }

/* Back link */
.back-link {
  display: inline-block;
  font-size: 0.88rem;
  color: var(--text-lighter);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color var(--transition);
}
.back-link:hover { color: var(--accent); }

/* =============================================
   NEWS LIST
   ============================================= */
.news-list { list-style: none; }
.news-list li {
  display: flex;
  gap: 0.8rem;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: var(--text-light);
}
.news-list .news-date {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-lighter);
  min-width: 85px;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-lighter);
  font-size: 0.82rem;
  border-top: 1px solid var(--border-light);
}
footer a { color: var(--text-lighter); }
footer a:hover { color: var(--accent); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 640px) {
  .profile { flex-direction: column; align-items: center; text-align: center; }
  .social-icons { justify-content: center; }
  .timeline-item { flex-direction: column; gap: 0.2rem; }
  .timeline-year { width: auto; }
  nav .nav-brand { font-size: 0.9rem; }
  nav .nav-links a { font-size: 0.82rem; padding: 0.3rem 0.5rem; }
  main { padding: 1.5rem 1rem 3rem; }
}

/* =============================================
   PRINT
   ============================================= */
@media print {
  nav, footer, .social-icons { display: none !important; }
  body { font-size: 12px; color: #000; background: #fff; }
  a { color: #000; }
}
