:root {
  --theme-bg-primary: #f9fafb;
  --theme-bg-secondary: #ffffff;
  --theme-text-primary: #111827;
  --theme-text-secondary: #6b7280;
  --theme-border: #e5e7eb;
  --theme-accent: #a02040;
  --theme-shadow: rgba(17, 24, 39, 0.08);
}

body.dark {
  --theme-bg-primary: #111827;
  --theme-bg-secondary: #1f2937;
  --theme-text-primary: #ffffff;
  --theme-text-secondary: #9ca3af;
  --theme-border: #374151;
  --theme-accent: #e11d2e;
  --theme-shadow: rgba(0, 0, 0, 0.25);
}

body[data-theme="space"] {
  --theme-bg-primary: #f0f4ff;
  --theme-bg-secondary: #ffffff;
  --theme-text-primary: #1e1b4b;
  --theme-text-secondary: #4c4b63;
  --theme-border: #c7d2fe;
  --theme-accent: #6366f1;
}

body.dark[data-theme="space"] {
  --theme-bg-primary: #0a0e27;
  --theme-bg-secondary: #1e293b;
  --theme-text-primary: #e0e7ff;
  --theme-text-secondary: #a5b4fc;
  --theme-border: #334155;
  --theme-accent: #818cf8;
}

body[data-theme="winter"] {
  --theme-bg-primary: #f0f9ff;
  --theme-bg-secondary: #ffffff;
  --theme-text-primary: #0c4a6e;
  --theme-text-secondary: #075985;
  --theme-border: #bae6fd;
  --theme-accent: #0284c7;
}

body.dark[data-theme="winter"] {
  --theme-bg-primary: #0c1222;
  --theme-bg-secondary: #1e293b;
  --theme-text-primary: #e0f2fe;
  --theme-text-secondary: #7dd3fc;
  --theme-border: #334155;
  --theme-accent: #38bdf8;
}

body[data-theme="coffee"] {
  --theme-bg-primary: #d4c5a8;
  --theme-bg-secondary: #c4b299;
  --theme-text-primary: #3d2817;
  --theme-text-secondary: #5d4a35;
  --theme-border: #b8956a;
  --theme-accent: #6d4c41;
}

body.dark[data-theme="coffee"] {
  --theme-bg-primary: #2a1f14;
  --theme-bg-secondary: #3d2e1f;
  --theme-text-primary: #e8dcc8;
  --theme-text-secondary: #c9b89a;
  --theme-border: #5d4a35;
  --theme-accent: #d4a574;
}

body[data-theme="spring"] {
  --theme-bg-primary: #fef2f8;
  --theme-bg-secondary: #ffffff;
  --theme-text-primary: #7c2d12;
  --theme-text-secondary: #9a3412;
  --theme-border: #fecdd3;
  --theme-accent: #ec4899;
}

body.dark[data-theme="spring"] {
  --theme-bg-primary: #1a0f14;
  --theme-bg-secondary: #2d1a24;
  --theme-text-primary: #fce7f3;
  --theme-text-secondary: #f9a8d4;
  --theme-border: #4a1e35;
  --theme-accent: #ec4899;
}

body[data-theme="autumn"] {
  --theme-bg-primary: #f5ead5;
  --theme-bg-secondary: #fef7e8;
  --theme-text-primary: #5d4037;
  --theme-text-secondary: #8b6914;
  --theme-border: #d4a574;
  --theme-accent: #b8860b;
}

body.dark[data-theme="autumn"] {
  --theme-bg-primary: #1a1611;
  --theme-bg-secondary: #2a1f18;
  --theme-text-primary: #eec170;
  --theme-text-secondary: #f2a65a;
  --theme-border: #585123;
  --theme-accent: #f58549;
}

body[data-theme="summer"] {
  --theme-bg-primary: #fff8e1;
  --theme-bg-secondary: #fff3c4;
  --theme-text-primary: #e65100;
  --theme-text-secondary: #f57c00;
  --theme-border: #ffcc02;
  --theme-accent: #ff6f00;
}

body.dark[data-theme="summer"] {
  --theme-bg-primary: #1a1208;
  --theme-bg-secondary: #2d1f0f;
  --theme-text-primary: #ffb74d;
  --theme-text-secondary: #ffa726;
  --theme-border: #ff8f00;
  --theme-accent: #ff9800;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--theme-bg-primary);
  color: var(--theme-text-primary);
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

a:hover {
  text-decoration: underline;
}

.app-container {
  min-height: 100vh;
}

.site-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 360px;
  flex-shrink: 0;
  padding: 1.5rem;
}

.sidebar-panel {
  position: sticky;
  top: 1.5rem;
  background: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border);
  border-radius: 24px;
  padding: 1.25rem;
  box-shadow: 0 18px 40px var(--theme-shadow);
}

.sidebar-controls {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.icon-button {
  border: 1px solid var(--theme-border);
  background: transparent;
  color: var(--theme-text-primary);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

.sidebar-profile {
  text-align: center;
}

.profile-image {
  width: 168px;
  height: 168px;
  object-fit: cover;
  border-radius: 999px;
  border: 1px solid var(--theme-border);
  background: var(--theme-bg-primary);
}

.sidebar-profile h1 {
  font-size: 2.4rem;
  line-height: 1;
  margin: 1rem 0 0.45rem;
}

.sidebar-role,
.sidebar-school,
.sidebar-bio {
  color: var(--theme-text-secondary);
}

.sidebar-role,
.sidebar-school {
  margin: 0.2rem 0;
}

.sidebar-bio {
  margin: 1.2rem 0 1.4rem;
  line-height: 1.65;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.contact-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--theme-border);
  border-radius: 999px;
  color: var(--theme-text-primary);
  background: var(--theme-bg-primary);
  font-size: 0.92rem;
  font-weight: 500;
}

.contact-grid a:hover {
  text-decoration: none;
  border-color: var(--theme-accent);
}

.section-nav {
  display: grid;
  gap: 0.45rem;
}

.section-nav a {
  display: block;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  color: var(--theme-text-secondary);
  font-size: 0.96rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-nav a:hover,
.section-nav a.active {
  background: rgba(0, 0, 0, 0.04);
  color: var(--theme-text-primary);
  text-decoration: none;
}

body.dark .section-nav a:hover,
body.dark .section-nav a.active {
  background: rgba(255, 255, 255, 0.08);
}

.content {
  flex: 1;
  padding: 4rem 3rem 2rem;
  max-width: calc(100% - 360px);
}

.content-section {
  padding: 3rem 0 1rem;
  border-top: 1px solid var(--theme-border);
  scroll-margin-top: 1.5rem;
}

.content-section.first-section {
  padding-top: 0;
  border-top: 0;
}

.content-section h2 {
  margin: 0 0 1.2rem;
  font-size: 2rem;
}

.research-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1rem;
  margin: 0 0 1.2rem;
}

.group-by {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.group-by label {
  color: var(--theme-text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
}

.group-by select {
  min-height: 42px;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--theme-border);
  background: var(--theme-bg-secondary);
  color: var(--theme-text-primary);
  font: inherit;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.filter-tab {
  min-height: 38px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--theme-border);
  background: var(--theme-bg-secondary);
  color: var(--theme-text-secondary);
  font: inherit;
  cursor: pointer;
}

.filter-tab.active {
  border-color: var(--theme-accent);
  color: var(--theme-text-primary);
}

.subsection {
  margin-bottom: 2rem;
}

.subsection h3 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  color: var(--theme-text-primary);
}

.stack {
  display: grid;
  gap: 1rem;
}

.paper-card {
  background: var(--theme-bg-secondary);
  border: 1px solid var(--theme-border);
  border-radius: 18px;
  padding: 1.4rem;
  box-shadow: 0 12px 28px var(--theme-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.paper-card:hover {
  transform: translateY(-4px);
}

.paper-card p,
.paper-card li {
  line-height: 1.7;
  color: var(--theme-text-secondary);
}

.paper-card ol {
  margin: 0.8rem 0;
  padding-left: 1.4rem;
}

.timeline-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--theme-border);
}

.timeline-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.timeline-row span,
.year,
.detail-head span {
  color: var(--theme-text-secondary);
  font-size: 0.92rem;
}

.timeline-row p {
  margin: 0;
}

.research-card h3,
.detail-head h4 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
}

.paper-authors {
  margin: 0 0 0.65rem;
  color: var(--theme-text-secondary);
  line-height: 1.6;
}

.paper-authors .self-author {
  color: var(--theme-text-primary);
  font-weight: 700;
}

.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--theme-text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.paper-topline,
.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.venue {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--theme-accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.dark .venue {
  background: rgba(255, 255, 255, 0.08);
}

.paper-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}

.paper-links a {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--theme-border);
  color: var(--theme-text-primary);
}

.paper-links a:hover {
  text-decoration: none;
  border-color: var(--theme-accent);
}

.detail-card p {
  margin: 0.25rem 0 0;
}

.empty-card {
  min-height: 88px;
}

.site-footer {
  padding: 2rem 0 0.5rem;
  color: var(--theme-text-secondary);
  text-align: center;
}

@media (max-width: 1080px) {
  .site-layout {
    flex-direction: column;
  }

  .sidebar,
  .content {
    width: 100%;
    max-width: 100%;
  }

  .content {
    padding: 1rem 1rem 2rem;
  }

  .sidebar {
    padding: 1rem;
  }

  .sidebar-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .research-controls,
  .group-by {
    align-items: flex-start;
    flex-direction: column;
  }

  .timeline-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .content-section h2 {
    font-size: 1.75rem;
  }

  .sidebar-profile h1 {
    font-size: 2rem;
  }
}
