:root {
  --primary: #1a365d;
  --primary-light: #2a4a7f;
  --accent: #3b82f6;
  --accent-soft: #dbeafe;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --sidebar-w: 280px;
  --radius: 8px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
}

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

/* ===== Sidebar ===== */

.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 auto 0.75rem;
  letter-spacing: 1px;
}

.sidebar-header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.sidebar-title {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-bottom: 0.15rem;
}

.sidebar-affiliation {
  font-size: 0.75rem;
  opacity: 0.6;
}

.lang-switch {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.25);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.lang-switch button {
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: none;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-switch button.active {
  background: var(--accent);
  color: #fff;
}

.sidebar nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar nav a {
  display: block;
  padding: 0.65rem 1.5rem;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-left-color: var(--accent);
  text-decoration: none;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.sidebar-footer a {
  color: rgba(255,255,255,0.55);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: #fff;
  text-decoration: none;
}

/* ===== Mobile Header ===== */

.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--primary);
  color: #fff;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 101;
}

.mobile-header .site-name {
  font-weight: 700;
  font-size: 1rem;
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.2s;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

/* ===== Main Content ===== */

.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

.section {
  padding: 3.5rem 3rem;
  max-width: 900px;
  margin: 0 auto;
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
}

.section-intro {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 700px;
}

.subsection-title {
  font-size: 1.15rem;
  color: var(--primary);
  margin: 2rem 0 1rem;
  font-weight: 600;
}

.count {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.9em;
}

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

.about-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.about-info {
  text-align: center;
}

.about-avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto 1rem;
  letter-spacing: 2px;
}

.about-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

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

.about-info p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.about-text p {
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.about-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.about-badge {
  background: var(--accent-soft);
  color: var(--primary);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}


/* ===== Research Section ===== */

.research-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.research-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  border-top: 3px solid var(--accent);
}

.research-card h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.research-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.domains-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.domain-tag {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
}

.domain-partner {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.78rem;
}

.domain-partner::before {
  content: ', ';
}

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

.pub-group {
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.pub-group:last-child {
  border-bottom: none;
}

.pub-toggle {
  font-size: 1rem;
  color: var(--primary);
  font-weight: 600;
  padding: 0.75rem 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
  margin: 0;
}

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

.chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.pub-toggle.open .chevron {
  transform: rotate(90deg);
}

.pub-list {
  list-style: none;
  padding-bottom: 0.75rem;
}

.pub-list li {
  display: flex;
  gap: 0.6rem;
  padding: 0.35rem 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.pub-year {
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 2.5em;
  text-align: right;
  padding-top: 1px;
}

.pub-content {
  flex: 1;
}

.pub-content b {
  color: var(--primary);
  font-weight: 600;
}

.pub-content strong {
  font-weight: 600;
}

.pub-content em {
  color: var(--text-secondary);
  font-style: normal;
}

.badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  margin-left: 0.2rem;
  text-transform: uppercase;
  vertical-align: middle;
}

.patent-ref {
  color: var(--text-secondary);
  font-size: 0.85em;
}

/* ===== Supervision Section ===== */

.thesis-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.thesis-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.thesis-card h4 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: var(--primary);
}

.thesis-card .thesis-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.thesis-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.thesis-meta span strong {
  font-weight: 600;
  color: var(--text);
}

/* ===== Projects Section ===== */

.project-type-group {
  margin-bottom: 2rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.project-card h4 {
  font-size: 0.95rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.project-period {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.project-card p {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.project-partner {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ===== Teaching Section ===== */

.teaching-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.teaching-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  border-left: 4px solid var(--accent);
}

.teaching-card h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.teaching-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.resp-list {
  list-style: none;
}

.resp-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.resp-list li:last-child {
  border-bottom: none;
}

.resp-role {
  font-weight: 600;
  color: var(--text);
}

.resp-where {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.resp-since {
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--primary);
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.info-row {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.info-block h4 {
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.info-block p {
  font-size: 0.83rem;
  color: var(--text-secondary);
}

/* ===== Awards Section ===== */

.awards-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.award-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.award-year {
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
}

.award-content h4 {
  font-size: 0.95rem;
  color: var(--primary);
  margin-bottom: 0.2rem;
}

.award-content p {
  font-size: 0.83rem;
  color: var(--text-secondary);
}

/* ===== Contact Section ===== */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.contact-block h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.contact-block p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.profile-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 500;
}

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

.site-footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  margin-left: var(--sidebar-w);
}

/* ===== Responsive ===== */

@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .research-grid,
  .teaching-grid {
    grid-template-columns: 1fr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-header {
    display: flex;
  }
  .main-content {
    margin-left: 0;
    padding-top: 56px;
  }
  .site-footer {
    margin-left: 0;
  }
  .section {
    padding: 2rem 1.25rem;
  }
  .section-title {
    font-size: 1.35rem;
  }
  .resp-list li {
    flex-direction: column;
    gap: 0.25rem;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
}
