/* ==========================================================================
   Design System — Custom Properties
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --text: #333333;
  --text-light: #666666;
  --accent: #1a73e8;
  --accent-hover: #1557b0;
  --border: #e0e0e0;
  --nav-height: 56px;
  --max-width: 900px;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
}

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

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

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

h1, h2, h3 {
  line-height: 1.3;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 60px 0;
}

section:nth-child(even) {
  background: var(--bg-alt);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg);
  z-index: 1000;
  transition: box-shadow 0.3s;
}

.nav.scrolled {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.nav-brand:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

/* ==========================================================================
   About Section
   ========================================================================== */

.about {
  padding-top: calc(var(--nav-height) + 48px);
  position: relative;
  z-index: 2;
  overflow: visible;
}

.about-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: start;
}

.profile-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}

.about-name {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.about-name-cn {
  font-size: 1rem;
  color: var(--text-light);
  font-weight: 400;
}

.about-title {
  font-size: 1.05rem;
  color: var(--text-light);
  margin-bottom: 2px;
}

.about-affiliation {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.about-bio {
  margin-bottom: 16px;
  color: var(--text);
}

.social-links {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.social-links a:hover {
  color: var(--accent);
}

.social-links svg,
.social-links i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.social-links i {
  font-size: 18px;
}

.email-wrapper {
  position: relative;
  display: inline-flex;
}

.email-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-main);
  padding: 0;
  transition: color 0.2s;
}

.email-toggle:hover {
  color: var(--accent);
}

.email-toggle svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.email-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  min-width: 280px;
  overflow: visible;
}

.email-dropdown.open {
  display: block;
}

.email-dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.email-dropdown a:last-child {
  border-bottom: none;
}

.email-dropdown a:hover {
  background: var(--bg-alt);
  color: var(--accent);
}

/* ==========================================================================
   News Section
   ========================================================================== */

.news-list {
  border-left: 2px solid var(--border);
  padding-left: 20px;
}

.news-item {
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
}

.news-date {
  font-weight: 600;
  color: var(--accent);
  min-width: 80px;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.news-text {
  font-size: 0.95rem;
}

/* ==========================================================================
   Publications Section
   ========================================================================== */

.pub-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.pub-card:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.pub-thumbnail {
  width: 180px;
  height: 120px;
  border-radius: 6px;
  flex-shrink: 0;
}

.pub-thumb-1 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pub-thumb-2 {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.pub-thumb-3 {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.pub-thumb-4 {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.pub-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

.pub-authors strong {
  color: var(--text);
}

.pub-venue {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}

.pub-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pub-links a {
  font-size: 0.85rem;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-light);
  transition: all 0.2s;
}

.pub-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ==========================================================================
   Projects Section (horizontal cards, stacked vertically)
   ========================================================================== */

.proj-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.proj-card:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.proj-thumbnail {
  width: 180px;
  height: 120px;
  border-radius: 6px;
  flex-shrink: 0;
}

.proj-thumb-1 {
  background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
}

.proj-thumb-2 {
  background: linear-gradient(135deg, #ee9ca7 0%, #ffdde1 100%);
}

.proj-thumb-3 {
  background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
}

.proj-thumb-4 {
  background: linear-gradient(135deg, #8360c3 0%, #2ebf91 100%);
}

.proj-thumb-5 {
  background: linear-gradient(135deg, #e44d26 0%, #f16529 100%);
}

.proj-thumb-6 {
  background: linear-gradient(135deg, #0f2027 0%, #2c5364 100%);
}

.proj-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.proj-role {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}

.proj-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}

.proj-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.proj-links a {
  font-size: 0.85rem;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-light);
  transition: all 0.2s;
}

.proj-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ==========================================================================
   Experience / Timeline Section
   ========================================================================== */

.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-period {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-role {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.timeline-org {
  font-size: 0.9rem;
  color: var(--text-light);
}

.timeline-org-cn {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ==========================================================================
   Blog Section
   ========================================================================== */

.blog-placeholder {
  text-align: center;
  color: var(--text-light);
  padding: 40px 0;
  font-size: 1rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
}

.footer a {
  color: var(--text-light);
}

.footer a:hover {
  color: var(--accent);
}

/* ==========================================================================
   Responsive — Tablet (≤768px)
   ========================================================================== */

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    padding: 16px 24px;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

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

  .nav-toggle {
    display: block;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-photo {
    margin: 0 auto;
    width: 160px;
    height: 160px;
  }

  .social-links {
    justify-content: center;
  }

  .pub-card {
    grid-template-columns: 1fr;
  }

  .pub-thumbnail {
    width: 100%;
    height: 140px;
  }

  .proj-card {
    grid-template-columns: 1fr;
  }

  .proj-thumbnail {
    width: 100%;
    height: 140px;
  }

  section {
    padding: 40px 0;
  }
}

/* ==========================================================================
   Responsive — Mobile (≤480px)
   ========================================================================== */

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .container {
    padding: 0 16px;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
  }

  .about-name {
    font-size: 1.5rem;
  }

  .profile-photo {
    width: 130px;
    height: 130px;
  }

  section {
    padding: 32px 0;
  }

  .news-item {
    flex-direction: column;
    gap: 2px;
  }

  .timeline {
    padding-left: 24px;
  }
}
