/* =============================================
   CSS Custom Properties
   ============================================= */
:root {
  --nav-bg: #0f172a;
  --nav-text: #94a3b8;
  --nav-accent: #38bdf8;
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --bg-card: #ffffff;
  --bg-tag: #dbeafe;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --tag-text: #1d4ed8;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #0a0f1a;
  --bg-card: #1e293b;
  --bg-tag: #1e3a5f;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --border: #334155;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
  --shadow: 0 1px 3px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.45);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.55);
  --tag-text: #93c5fd;
}

/* =============================================
   Reset & Base
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* =============================================
   Scroll Animation
   ============================================= */
.observe {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.observe.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   Navigation
   ============================================= */
nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--nav-bg);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--nav-accent) !important;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  flex: 1;
}
.nav-links li a {
  color: var(--nav-text);
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.nav-links li a:hover {
  background: rgba(56,189,248,0.1);
  color: var(--nav-accent);
}
.nav-links li a.active {
  background: rgba(56,189,248,0.15);
  color: var(--nav-accent);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}
.theme-toggle {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: var(--nav-text);
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  transition: background var(--transition);
}
.theme-toggle:hover { background: rgba(255,255,255,0.12); }
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--nav-text);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =============================================
   Layout
   ============================================= */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.page-header p {
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-size: 0.95rem;
}
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* =============================================
   Hero
   ============================================= */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 55%, #0c4a6e 100%);
  padding: 5rem 1.5rem 4.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 30%, rgba(56,189,248,0.07) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 3rem;
  align-items: center;
  position: relative;
}
.hero-text h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: #38bdf8;
  font-weight: 600;
  margin-bottom: 1rem;
}
.hero-desc {
  font-size: 0.925rem;
  color: #94a3b8;
  line-height: 1.75;
  max-width: 560px;
  margin-bottom: 1.75rem;
}
.hero-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: var(--font);
  border: none;
}
.btn-primary { background: #38bdf8; color: #0f172a; }
.btn-primary:hover { background: #7dd3fc; color: #0f172a; transform: translateY(-1px); }
.btn-outline { background: transparent; color: #e2e8f0; border: 1px solid rgba(255,255,255,0.2); }
.btn-outline:hover { background: rgba(255,255,255,0.08); color: #f1f5f9; }
.hero-stats { display: flex; gap: 2.5rem; }
.stat .value {
  display: block;
  font-size: 1.875rem;
  font-weight: 800;
  color: #38bdf8;
  line-height: 1;
}
.stat .label {
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
  display: block;
}
.hero-social-links {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.hero-social-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition);
}
.hero-social-link:hover {
  background: rgba(56,189,248,0.1);
  border-color: rgba(56,189,248,0.3);
  color: #38bdf8;
}
.hero-social-link i { width: 16px; text-align: center; color: #38bdf8; }

/* =============================================
   Cards
   ============================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tag {
  display: inline-block;
  background: var(--bg-tag);
  color: var(--tag-text);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  margin: 0.15rem;
  white-space: nowrap;
}

/* =============================================
   Home page
   ============================================= */
.home-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.75rem;
  margin-top: 2.5rem;
}
.news-home-list { display: flex; flex-direction: column; }
.news-home-item {
  display: flex;
  gap: 1rem;
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
  border-radius: 6px;
  transition: background var(--transition);
}
.news-home-item:last-child { border-bottom: none; }
.news-home-item:hover { background: var(--bg-alt); }
.news-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 0.5rem;
  flex-shrink: 0;
}
.news-text { font-size: 0.875rem; line-height: 1.55; color: var(--text); }
.news-text a { font-weight: 500; font-size: 0.8rem; margin-left: 0.2rem; }
.quick-links { display: flex; flex-direction: column; gap: 0.75rem; }
.quick-link-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.quick-link-card:hover {
  transform: translateX(3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  color: var(--text);
}
.quick-link-icon { font-size: 1.4rem; flex-shrink: 0; }
.quick-link-label { font-weight: 700; font-size: 0.875rem; }
.quick-link-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.1rem; }

/* =============================================
   Timeline (News)
   ============================================= */
.timeline { display: flex; flex-direction: column; }
.timeline-item {
  display: grid;
  grid-template-columns: 120px 12px 1fr;
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-date {
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--text-muted);
  padding-top: 0.15rem;
}
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 0.35rem;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--bg-tag);
}
.timeline-content h3 {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}
.timeline-content p { font-size: 0.825rem; color: var(--text-muted); line-height: 1.55; }
.timeline-content a { font-size: 0.8rem; font-weight: 500; }

/* =============================================
   Publications
   ============================================= */
.pub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.filter-btn {
  padding: 0.3rem 0.85rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.pub-list { display: flex; flex-direction: column; gap: 0.875rem; }
.pub-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.pub-item:hover { transform: translateX(3px); box-shadow: var(--shadow); }
.pub-number {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}
.pub-title { font-size: 0.92rem; font-weight: 700; color: var(--text); line-height: 1.4; margin-bottom: 0.35rem; }
.pub-authors { font-size: 0.81rem; color: var(--text-muted); margin-bottom: 0.3rem; line-height: 1.5; }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-venue { font-size: 0.8rem; color: var(--accent); font-weight: 600; margin-bottom: 0.3rem; }
.pub-doi { font-size: 0.78rem; color: var(--text-muted); }
.pub-doi a { color: var(--accent); }

/* =============================================
   Projects
   ============================================= */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.project-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--bg-tag);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.project-card h3 { font-size: 1rem; font-weight: 700; color: var(--text); }
.project-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.7; flex: 1; }
.project-card .tags { margin-top: auto; }

/* =============================================
   About
   ============================================= */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2.5rem;
  align-items: start;
}
.about-bio { font-size: 0.925rem; line-height: 1.8; color: var(--text); margin-bottom: 1.25rem; }
.about-bio a { font-weight: 500; }
.exp-table { width: 100%; border-collapse: collapse; }
.exp-table tr { border-bottom: 1px solid var(--border); }
.exp-table tr:last-child { border-bottom: none; }
.exp-table td { padding: 0.75rem 0; vertical-align: top; font-size: 0.875rem; }
.exp-table td:first-child { font-weight: 600; padding-right: 1rem; width: 55%; }
.exp-table td:last-child { color: var(--text-muted); font-size: 0.81rem; }

/* =============================================
   Contact
   ============================================= */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--text); }
.contact-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.gh-icon  { background: #181717; color: #fff; }
.li-icon  { background: #0a66c2; color: #fff; }
.gs-icon  { background: #4285f4; color: #fff; }
.em-icon  { background: #ea4335; color: #fff; }
.contact-info .ci-label {
  font-size: 0.71rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  display: block;
}
.contact-info .ci-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  display: block;
  margin-top: 0.1rem;
}

/* =============================================
   Footer
   ============================================= */
footer {
  background: var(--nav-bg);
  color: #475569;
  text-align: center;
  padding: 1.75rem 1.5rem;
  font-size: 0.8rem;
  margin-top: 4rem;
  border-top: 1px solid rgba(255,255,255,0.04);
}
footer a { color: #64748b; }
footer a:hover { color: #94a3b8; }

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    flex-direction: column;
    padding: 0.75rem 1rem;
    gap: 0.15rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    z-index: 999;
  }
  .nav-links.open { display: flex; }
  .nav-links li a { padding: 0.65rem 1rem; display: block; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-social-links { flex-direction: row; flex-wrap: wrap; }
  .hero-social-link { flex: 1; min-width: 160px; }
  .hero-stats { gap: 1.5rem; }
  .home-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 95px 12px 1fr; gap: 0.75rem; }
  .about-layout { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .hero { padding: 3.5rem 1rem 3rem; }
  .container { padding: 1.75rem 1rem; }
  .hero-stats { gap: 1.25rem; }
  .stat .value { font-size: 1.5rem; }
  .timeline-item { grid-template-columns: 1fr; gap: 0.2rem; }
  .timeline-dot { display: none; }
  .timeline-date { color: var(--accent); font-size: 0.78rem; }
  .project-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

/* =============================================
   Language Toggle Button
   ============================================= */
.lang-toggle {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: var(--nav-text);
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  transition: background var(--transition);
}
.lang-toggle:hover { background: rgba(255,255,255,0.12); }

/* =============================================
   Awards
   ============================================= */
.award-list { display: flex; flex-direction: column; gap: 1.25rem; }
.award-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  transition: transform var(--transition), box-shadow var(--transition);
}
.award-item:hover { transform: translateX(3px); box-shadow: var(--shadow); }
.award-badge { font-size: 1.75rem; flex-shrink: 0; margin-top: 0.15rem; line-height: 1; }
.award-content { flex: 1; min-width: 0; }
.award-meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}
.award-title { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 0.25rem; }
.award-assoc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.award-assoc i { color: var(--accent); margin-right: 0.3rem; }
.award-desc { font-size: 0.83rem; color: var(--text-muted); line-height: 1.65; margin: 0; }
@media (max-width: 540px) {
  .award-item { flex-direction: column; gap: 0.5rem; }
}

/* =============================================
   Chinese font override (applied via JS when zh is active)
   ============================================= */
:root[lang="zh-Hans"] {
  --font: 'Noto Sans SC', 'Inter', -apple-system, sans-serif;
}
