/* ============================================================
   TECH THEME - Chenye Wu Academic Website
   Modern dark-accent, glassmorphism, clean typography
   ============================================================ */

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

/* ---- CSS Variables ---- */
:root {
  --bg-dark:       #0a0e1a;
  --bg-card:       #111827;
  --bg-card2:      #151e2d;
  --accent:        #00d4ff;
  --accent2:       #7c3aed;
  --accent3:       #10b981;
  --text-primary:  #f0f4f8;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;
  --border:        rgba(0, 212, 255, 0.15);
  --border-hover:  rgba(0, 212, 255, 0.4);
  --shadow-glow:   0 0 30px rgba(0, 212, 255, 0.08);
  --shadow-card:   0 4px 24px rgba(0,0,0,0.4);
  --radius:        12px;
  --radius-sm:     8px;
  --sidebar-w:     280px;
  --transition:    0.25s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Animated background grid ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

/* ---- Layout ---- */
.page-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  max-width: calc(var(--sidebar-w) + 960px);
  margin: 0 auto;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #0d1424 0%, #0a0e1a 100%);
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}

/* Profile block */
.sidebar-profile {
  text-align: center;
  margin-bottom: 1rem;
}

.sidebar-profile .avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 20px rgba(0,212,255,0.3);
  object-fit: cover;
  margin-bottom: 0.75rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.sidebar-profile h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.sidebar-profile .title-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

.sidebar-profile .institution {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Language toggle */
.lang-toggle {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin: 0.5rem 0;
}
.lang-toggle a {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}
.lang-toggle a:hover, .lang-toggle a.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0,212,255,0.06);
}

/* Nav */
.sidebar-nav {
  margin: 0.5rem 0;
}

.sidebar-nav .nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem 0.5rem 0.25rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.sidebar-nav a .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--accent);
  background: rgba(0,212,255,0.06);
}

.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.sidebar-nav .sub-link {
  padding-left: 2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.sidebar-nav .sub-link:hover { color: var(--accent); }

/* Social links */
.sidebar-social {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sidebar-social .label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.sidebar-social .social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sidebar-social .social-links a {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.sidebar-social .social-links a:hover {
  color: var(--accent);
  border-color: rgba(0,212,255,0.3);
  background: rgba(0,212,255,0.05);
}

/* Contact */
.sidebar-contact {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.sidebar-contact a {
  color: var(--accent);
  text-decoration: none;
}
.sidebar-contact a:hover { text-decoration: underline; }

.sidebar-footer {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  line-height: 1.8;
}
.sidebar-footer a { color: var(--text-muted); text-decoration: none; }
.sidebar-footer a:hover { color: var(--accent); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 3rem 4rem;
  max-width: 900px;
}

/* ---- Section headings ---- */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.section-header .section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  flex-shrink: 0;
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

h2 { 
  font-size: 1.25rem; 
  font-weight: 700; 
  color: var(--text-primary);
  margin: 2rem 0 1rem;
}
h3 { 
  font-size: 1rem; 
  font-weight: 600; 
  color: var(--text-primary);
  margin: 1.5rem 0 0.75rem;
}
h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 1.25rem 0 0.5rem;
}

p { color: var(--text-secondary); margin-bottom: 1rem; }

ul, ol { color: var(--text-secondary); padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.4rem; }

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

strong { color: var(--text-primary); font-weight: 600; }

hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.card:hover::before { opacity: 1; }

/* ---- Hero (Home page) ---- */
.hero {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0,212,255,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-photo {
  flex-shrink: 0;
}

.hero-photo img {
  width: 160px;
  height: 160px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 0 30px rgba(0,212,255,0.15);
}

.hero-info h2 {
  font-size: 1.5rem;
  margin-top: 0;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.hero-info .hero-title {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.hero-info .hero-affil {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.badge-blue   { color: #00d4ff; background: rgba(0,212,255,0.08);   border: 1px solid rgba(0,212,255,0.2); }
.badge-purple { color: #a78bfa; background: rgba(124,58,237,0.1);   border: 1px solid rgba(124,58,237,0.25); }
.badge-green  { color: #34d399; background: rgba(16,185,129,0.08);  border: 1px solid rgba(16,185,129,0.2); }
.badge-orange { color: #fb923c; background: rgba(251,146,60,0.08);  border: 1px solid rgba(251,146,60,0.2); }

/* ---- Recruiting banner ---- */
.recruiting-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, rgba(0,212,255,0.06) 0%, rgba(124,58,237,0.06) 100%);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.recruiting-banner .dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent3);
  box-shadow: 0 0 8px var(--accent3);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent3); }
  50% { opacity: 0.6; box-shadow: 0 0 16px var(--accent3); }
}

/* ---- Research challenge list ---- */
.challenge-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.challenge-list li {
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: var(--transition);
  border-left: 3px solid var(--accent2);
}
.challenge-list li:hover {
  border-color: var(--border-hover);
  border-left-color: var(--accent);
  background: var(--bg-card2);
}
.challenge-list li a { color: var(--accent); }
.challenge-list li a:hover { text-decoration: underline; }

/* ---- Publication items ---- */
.pub-item {
  padding: 1.25rem 1.25rem 1.25rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent2);
  margin-bottom: 1rem;
  transition: var(--transition);
}

.pub-item:hover {
  border-color: var(--border-hover);
  border-left-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.pub-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  display: block;
  line-height: 1.4;
}
.pub-title:hover { color: var(--accent); }

.pub-authors { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.pub-venue   { font-size: 0.8rem; color: var(--accent3); font-style: italic; margin-bottom: 0.5rem; }

.pub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.btn-pub {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-pub:hover {
  color: var(--accent);
  border-color: rgba(0,212,255,0.3);
  background: rgba(0,212,255,0.05);
}
.btn-pub.active {
  color: var(--accent);
  border-color: rgba(0,212,255,0.4);
  background: rgba(0,212,255,0.08);
}

.pub-abstract-panel,
.pub-bibtex-panel {
  display: none;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.pub-abstract-panel.show,
.pub-bibtex-panel.show { display: block; }

.pub-bibtex-panel pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-secondary);
  margin: 0;
}

/* ---- Research topic tags ---- */
.topic-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(0,212,255,0.06);
  border: 1px solid rgba(0,212,255,0.15);
  margin-right: 0.3rem;
  margin-bottom: 0.3rem;
}

/* ---- Student cards ---- */
.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.student-card {
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  position: relative;
}
.student-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.student-card .student-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}
.student-card .student-name a { color: var(--text-primary); }
.student-card .student-name a:hover { color: var(--accent); }

.student-card .student-bg {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.student-card .student-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent3);
  box-shadow: 0 0 6px var(--accent3);
}

/* ---- Course cards ---- */
.course-card {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-top: 2px solid var(--accent2);
  margin-bottom: 1rem;
  transition: var(--transition);
}
.course-card:hover {
  border-top-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.course-card .course-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.course-card .course-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.course-card .course-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.course-card .eval-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.eval-link {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}
.eval-link:hover {
  color: var(--accent);
  border-color: rgba(0,212,255,0.3);
  background: rgba(0,212,255,0.05);
}

/* ---- Award item ---- */
.award-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(251,191,36,0.04) 0%, var(--bg-card) 100%);
  border: 1px solid rgba(251,191,36,0.15);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.award-item .award-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.award-item .award-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---- Stats row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: var(--transition);
}
.stat-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.stat-card .stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.3rem;
  font-family: 'JetBrains Mono', monospace;
}

.stat-card .stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---- Section anchor ---- */
.section-anchor {
  scroll-margin-top: 1rem;
}

/* ---- Mobile hamburger ---- */
.hamburger {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .page-wrapper {
    max-width: 100%;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open { transform: translateX(0); }

  .hamburger { display: flex; }

  .main-content {
    margin-left: 0;
    padding: 1.25rem 1.25rem 3rem;
    max-width: 100%;
  }

  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-photo img {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 600px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .student-grid { grid-template-columns: 1fr; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,212,255,0.3); }

/* ---- Code blocks ---- */
code, pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}
pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  overflow-x: auto;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

/* ---- ENLIGHT Lab logo ---- */
.lab-logo {
  display: block;
  max-width: 320px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

/* ---- Page title bar ---- */
.page-title-bar {
  margin-bottom: 2rem;
}

.page-title-bar .page-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.page-title-bar h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-title-bar .page-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ---- Utility ---- */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
