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

:root {
  --color-bg: #0f1117;
  --color-surface: #1a1d27;
  --color-border: #2a2d3a;
  --color-text: #e2e8f0;
  --color-muted: #8892a4;
  --color-accent: #7c6af7;
  --color-accent-hover: #9d8fff;
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', monospace;
  --radius: 10px;
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
}

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

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

.section { padding: 5rem 0; }
.section-alt { background: var(--color-surface); }

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--color-accent);
  margin-top: 0.4rem;
  border-radius: 2px;
}

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
}
.nav-logo:hover { color: var(--color-accent); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a { color: var(--color-muted); font-size: 0.95rem; }
.nav-links a:hover { color: var(--color-text); }

.nav-toggle { display: none; background: none; border: none; color: var(--color-text); font-size: 1.4rem; cursor: pointer; }

/* ===== Hero ===== */
.hero { padding-top: 6rem; padding-bottom: 6rem; }

.hero-content {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.avatar {
  width: 210px;
  height: 210px;
  border-radius: 16px;
  object-fit: cover;
  border: 3px solid var(--color-accent);
  flex-shrink: 0;
}

.hero-text h1 { font-size: 2.2rem; font-weight: 800; line-height: 1.2; margin-bottom: 0.5rem; }
.highlight { color: var(--color-accent); }
.tagline { font-size: 1.1rem; color: var(--color-muted); margin-bottom: 1rem; }
.bio { color: var(--color-muted); max-width: 520px; margin-bottom: 1.5rem; }

.social-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.social-links a {
  padding: 0.4rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--color-text);
  transition: border-color var(--transition), color var(--transition);
}
.social-links a:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ===== Name subtitle ===== */
.name-zh {
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--color-muted);
  margin-left: 0.4rem;
}

/* ===== Publications ===== */
.pub-list { list-style: none; display: flex; flex-direction: column; gap: 1.6rem; }

.pub-item {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}

.pub-venue {
  flex-shrink: 0;
  width: 90px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-accent);
  background: rgba(124, 106, 247, 0.1);
  border: 1px solid rgba(124, 106, 247, 0.25);
  border-radius: 5px;
  padding: 0.25rem 0.5rem;
  text-align: center;
  line-height: 1.3;
  margin-top: 0.15rem;
}

.pub-body { flex: 1; }
.pub-title { font-size: 0.97rem; font-weight: 600; color: var(--color-text); margin-bottom: 0.3rem; line-height: 1.4; }
.pub-authors { font-size: 0.85rem; color: var(--color-muted); margin-bottom: 0.5rem; }
.pub-links { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.pub-links a {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--color-accent);
  border: 1px solid rgba(124, 106, 247, 0.3);
  border-radius: 4px;
  padding: 0.15rem 0.55rem;
  transition: background var(--transition), border-color var(--transition);
}
.pub-links a:hover { background: rgba(124, 106, 247, 0.12); border-color: var(--color-accent); color: var(--color-accent-hover); }

/* ===== Contact intro ===== */
.contact-intro { color: var(--color-muted); margin-bottom: 1rem; }

/* ===== Timeline (Experience & Education) ===== */
.timeline { display: flex; flex-direction: column; gap: 2.5rem; }

.tl-group-label {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: 1.2rem;
}

.tl-item {
  display: flex;
  gap: 1.2rem;
  position: relative;
}

/* vertical line connecting items within a group */
.tl-group .tl-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 35px; /* center of 72px logo */
  top: 80px;  /* below logo */
  bottom: -1.4rem;
  width: 1px;
  background: var(--color-border);
}

/* logo image */
.tl-logo {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  padding: 8px;
  border: 1px solid var(--color-border);
}

.tl-content { flex: 1; padding-bottom: 0.5rem; }

.tl-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.tl-title { font-size: 1rem; font-weight: 600; color: var(--color-text); }

.tl-period {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--color-muted);
}

.tl-org {
  font-size: 0.9rem;
  color: var(--color-accent);
  margin-bottom: 0.4rem;
}

.tl-desc { font-size: 0.9rem; color: var(--color-muted); }

/* ===== Blog Post List ===== */
.post-list { list-style: none; display: flex; flex-direction: column; gap: 1.5rem; }

.post-item {
  border-left: 3px solid var(--color-border);
  padding-left: 1.2rem;
  transition: border-color var(--transition);
}
.post-item:hover { border-color: var(--color-accent); }

.post-date { font-size: 0.8rem; font-family: var(--font-mono); color: var(--color-muted); display: block; margin-bottom: 0.2rem; }
.post-title { font-size: 1.05rem; font-weight: 600; color: var(--color-text); }
.post-title:hover { color: var(--color-accent); }
.post-excerpt { color: var(--color-muted); font-size: 0.9rem; margin-top: 0.3rem; }

/* ===== Contact ===== */
.contact-container p { color: var(--color-muted); margin-bottom: 1rem; }
.contact-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; color: var(--color-muted); }
.contact-list a { color: var(--color-accent); }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
}
.site-footer a { color: var(--color-muted); }
.site-footer a:hover { color: var(--color-accent); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero-content { flex-direction: column; text-align: center; gap: 1.5rem; }
  .hero-text h1 { font-size: 1.7rem; }
  .bio { margin: 0 auto 1.5rem; }
  .social-links { justify-content: center; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--color-bg); border-bottom: 1px solid var(--color-border); padding: 1rem 1.5rem; gap: 1rem; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}
