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

:root {
  --bg-sidebar: #f3f4f6;
  --bg-content: #ffffff;
  --surface: #f9fafb;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent2: #7c3aed;
  --text: #111827;
  --muted: #6b7280;
  --green: #16a34a;
  --radius: 8px;
  --sidebar-width: 260px;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-sidebar);
}

/* ── LAYOUT ── */
.site-wrapper {
  display: flex;
  height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  overflow-y: auto;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: block;
  object-fit: cover;
}

.sidebar-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.2rem;
  letter-spacing: -0.3px;
}

.sidebar-typed {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  height: 1.3em;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.typed-cursor {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  background: var(--accent);
  animation: blink 0.8s step-end infinite;
  flex-shrink: 0;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.sidebar-divider { height: 1px; background: var(--border); }

.sidebar-sections { display: flex; flex-direction: column; gap: 0.9rem; }

.sidebar-section { display: flex; flex-direction: column; gap: 0.4rem; }

.sidebar-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
}

.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.sidebar-tag {
  font-size: 0.67rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.18);
  color: var(--accent2);
}

.sidebar-tag--blue {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.18);
  color: var(--accent);
}

.sidebar-tag--green {
  background: rgba(22, 163, 74, 0.06);
  border-color: rgba(22, 163, 74, 0.2);
  color: var(--green);
}

.sidebar-tag--gray {
  background: rgba(107, 114, 128, 0.07);
  border-color: rgba(107, 114, 128, 0.18);
  color: var(--muted);
}

.sidebar-tag--amber {
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.2);
  color: #b45309;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: auto;
  padding-top: 1rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 7px 9px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  min-height: 36px;
}

.sidebar-link:hover { background: var(--border); color: var(--text); }
.sidebar-link svg { flex-shrink: 0; }

/* ── CONTENT PANEL ── */
.content-panel {
  flex: 1;
  background: var(--bg-content);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
}

/* ── TAB BAR ── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  background: var(--bg-content);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.9rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
  font-family: inherit;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ── TAB CONTENT ── */
.tab-content-wrapper {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.tab-pane {
  display: none;
  padding: 2.5rem 2rem;
  max-width: 740px;
}

.tab-pane--wide { max-width: none; }

.tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── PANE HEADERS ── */
.pane-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.pane-title {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 800;
  margin-bottom: 0.2rem;
  letter-spacing: -0.3px;
}

.pane-sub {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 2rem;
}

/* ── BIO ── */
.bio-intro {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.75;
  font-weight: 400;
  margin-bottom: 1.25rem;
}

.bio-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.8rem;
}

.bio-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 0.75rem;
  text-align: center;
}

.bio-stat-num {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.bio-stat-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 0.2rem;
}

.bio-blobs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.bio-blob {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: border-color 0.15s;
}

.bio-blob:hover { border-color: var(--accent); }

.bio-blob-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.bio-blob-company {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

.bio-blob-date {
  font-size: 0.72rem;
  color: var(--muted);
}

.bio-blob p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.75;
  margin: 0;
}

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

/* ── RESEARCH ── */
.research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.8rem;
}

.research-tag {
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.18);
  color: var(--accent2);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 13px;
  border-radius: 20px;
}

.currently-card {
  background: rgba(37, 99, 235, 0.03);
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: var(--radius);
  padding: 1rem 1.3rem;
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
}

.currently-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  white-space: nowrap;
  padding-top: 2px;
  flex-shrink: 0;
}

.currently-text { color: var(--muted); font-size: 0.87rem; line-height: 1.65; }

/* ── PAPERS ── */
.papers-list { display: flex; flex-direction: column; gap: 0.9rem; }

.paper-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
  transition: border-color 0.15s;
}

.paper-card:hover { border-color: var(--accent); }
.paper-info { flex: 1; }
.paper-info h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.2rem; line-height: 1.4; }
.paper-meta { color: var(--muted); font-size: 0.78rem; margin-bottom: 0.3rem; line-height: 1.5; }

.paper-tag {
  font-size: 0.68rem;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: var(--accent);
  padding: 2px 9px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 0.25rem;
}

.paper-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
  align-self: flex-start;
  white-space: nowrap;
}

.paper-link:hover { border-color: var(--accent); color: var(--accent); }

/* ── PROJECTS ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(37,99,235,0.07); }
.card.featured { border-color: rgba(37, 99, 235, 0.22); }

.card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }

.card-icon {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(37, 99, 235, 0.07);
  border-radius: 5px; flex-shrink: 0; color: var(--accent);
}

.card-icon svg { width: 13px; height: 13px; }
.card h3 { font-size: 0.87rem; font-weight: 700; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { color: var(--muted); font-size: 0.79rem; flex: 1; margin-bottom: 0.75rem; line-height: 1.55; }

.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.card-lang { font-size: 0.72rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.lang-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.card-link { font-size: 0.72rem; color: var(--accent); text-decoration: none; font-weight: 500; }
.card-link:hover { text-decoration: underline; }

/* ── TIMELINE ── */
.timeline { display: flex; flex-direction: column; gap: 1.8rem; }

.timeline-item {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 1.2rem;
  align-items: start;
}

.timeline-date { color: var(--muted); font-size: 0.75rem; padding-top: 2px; line-height: 1.4; }
.timeline-content h4 { font-size: 0.88rem; font-weight: 700; margin-bottom: 0.1rem; }
.timeline-content .company { color: var(--accent); font-size: 0.77rem; margin-bottom: 0.45rem; font-weight: 500; }
.timeline-bullets { list-style: none; display: flex; flex-direction: column; gap: 0.28rem; }
.timeline-bullets li { color: var(--muted); font-size: 0.79rem; padding-left: 1rem; position: relative; line-height: 1.5; }
.timeline-bullets li::before { content: '—'; position: absolute; left: 0; color: var(--border); }

/* ── EDUCATION ── */
.edu-list { display: flex; flex-direction: column; gap: 0.9rem; }

.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  transition: border-color 0.15s;
}

.edu-card:hover { border-color: var(--accent); }
.edu-card h4 { font-size: 0.88rem; font-weight: 700; margin-bottom: 0.18rem; }
.edu-card .edu-school { color: var(--accent); font-size: 0.77rem; font-weight: 500; margin-bottom: 0.35rem; }
.edu-card .edu-meta { color: var(--muted); font-size: 0.77rem; line-height: 1.6; }

.edu-badge {
  display: inline-block; margin-top: 0.5rem;
  font-size: 0.67rem;
  background: rgba(22, 163, 74, 0.07);
  border: 1px solid rgba(22, 163, 74, 0.22);
  color: var(--green);
  padding: 2px 9px; border-radius: 20px;
}

/* ── NETWORK GRAPH ── */
.network-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  height: 540px;
}

.network-container svg { display: block; }

/* ── SHOWCASE ── */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.9rem;
  margin-bottom: 0.5rem;
}

.showcase-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s;
}

.showcase-card:hover { border-color: var(--accent); }

.showcase-tag {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.showcase-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.showcase-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.showcase-video {
  width: 100%;
  border-radius: 5px;
  display: block;
  margin-top: 0.4rem;
}

.bio-blob-desc {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.4rem 0;
  line-height: 1.5;
}

/* ── VIDEO ── */
.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ── CONTACT ── */
.contact-links { display: flex; flex-direction: column; gap: 0.6rem; max-width: 320px; }

.contact-link {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--surface); border: 1px solid var(--border);
  padding: 10px 16px; border-radius: var(--radius);
  text-decoration: none; color: var(--text);
  font-size: 0.875rem; font-weight: 500;
  transition: border-color 0.15s, color 0.15s;
}

.contact-link:hover { border-color: var(--accent); color: var(--accent); }

/* ── MOBILE ≤768px ── */
@media (max-width: 768px) {
  html, body { height: auto; }

  .site-wrapper {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    border: none;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }

  .sidebar-avatar { width: 44px; height: 44px; }
  .sidebar-name { font-size: 0.95rem; }
  .sidebar-typed { font-size: 0.75rem; }
  .sidebar-tags { display: none; }
  .sidebar-divider { display: none; }

  .sidebar-links {
    flex-direction: row;
    margin-top: 0;
    padding-top: 0;
    gap: 0.2rem;
    margin-left: auto;
  }

  .sidebar-link span { display: none; }
  .sidebar-link { padding: 6px; min-height: 36px; min-width: 36px; justify-content: center; }

  .content-panel { height: auto; overflow: visible; }
  .tab-content-wrapper { overflow: visible; }
  .tab-bar { padding: 0 0.75rem; }
  .tab-pane { padding: 1.5rem 1rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 0.2rem; }
  .paper-card { flex-direction: column; gap: 0.7rem; }
  .paper-link { align-self: flex-start; }
}

@media (max-width: 480px) {
  .tab-btn { padding: 0.75rem 0.7rem; font-size: 0.8rem; }
}
