html {
  scroll-behavior: smooth;
}

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --accent: #0071e3;
  --accent-hover: #0058b0;
  --accent-soft: rgba(0, 113, 227, 0.12);
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --divider: #d2d2d7;
  --surface-alt: #f5f5f7;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(0, 0, 0, 0.06);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

body.dark-mode {
  --accent: #2997ff;
  --accent-hover: #6cb6ff;
  --accent-soft: rgba(41, 151, 255, 0.16);
  --text-primary: #f5f5f7;
  --text-secondary: #86868b;
  --divider: #38383a;
  --surface-alt: #1d1d1f;
  --card-bg: #1d1d1f;
  --card-shadow: none;
  --glass-bg: rgba(29, 29, 31, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body {
  margin: 0;
  padding-top: 60px;
  font-size: 14px;
  font-family: var(--font-sans);
  background-color: #ffffff;
  color: var(--text-primary);
  padding-bottom: 100px;
}

body.dark-mode {
  background-color: #000000;
}

p {
  margin-bottom: 1.2em;
}

.navbar {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: none;
  font-family: var(--font-sans);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  gap: 16px;
}

.section-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2.5%;
  box-sizing: border-box;
}

table#about {
  background: transparent;
  padding: 32px 0;
  margin-top: 20px !important;
}

table#education,
table#research,
table#experience {
  margin-top: 72px !important;
}

a:has(> .big-icon) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  vertical-align: middle;
  transition: background-color 0.25s ease;
}

a:has(> .big-icon):hover {
  background-color: var(--accent-soft);
}

.section-container table {
  width: 100%;
  margin: 0;
}

.nav-logo {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.navbar.scrolled .nav-logo {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-empty-div {
  flex: 1;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-links li {
  display: inline-flex;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-logo:hover {
  color: var(--accent);
}

.nav-links li a {
  position: relative;
}

.nav-links li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  background-color: #000;
  width: 0;
  transition: width 0.45s ease;
}

body.dark-mode .nav-links li a::after {
  background-color: #fff;
}

.nav-links li a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
}

.arxiv-button {
  padding: 5px 14px;
  font-size: 13px;
  color: var(--accent);
  background-color: transparent;
  border: 1px solid var(--accent);
  border-radius: 980px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
  margin-top: 5px;
}

.arxiv-button:hover {
  background-color: var(--accent);
  color: #fff;
}

body.dark-mode .arxiv-button {
  color: var(--accent);
  border: 1px solid var(--accent);
}

body.dark-mode .arxiv-button:hover {
  background-color: var(--accent);
  color: #0a0f1e;
}

.arxiv-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

body.dark-mode .arxiv-button:focus {
  box-shadow: 0 0 0 2px var(--accent-soft);
}

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-logo,
  .color-mode-toggle,
  .nav-empty-div {
    display: none;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background-color: #ffffff;
    padding-top: 60px;
    transition: left 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .navbar {
    background-color: rgba(255, 255, 255, 1);
    backdrop-filter: none;
  }

  body.dark-mode .navbar {
    background-color: rgba(0, 0, 0, 1) !important;
    backdrop-filter: none !important;
  }

  body.dark-mode .nav-links {
    background-color: #000000;
  }

  .nav-links.show {
    left: 0;
    opacity: 0.95;
  }

  .nav-links li {
    width: 100%;
    margin: 15px 0;
    padding-left: 20px;
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 26px;
    height: 26px;
    cursor: pointer;
    z-index: 1002;
  }

  .nav-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
  }

  .nav-toggle.open .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .nav-toggle.open .bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.open .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .section-heading .link-icon {
    display: none;
  }
}

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

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

body,
td,
th,
tr,
p,
a {
  font-size: 17px;
  line-height: 1.55;
}

strong {
  font-size: 17px;
  font-weight: 600;
}

h2 {
  margin-bottom: -10px;
  font-weight: 600;
  font-size: 32px;
  letter-spacing: -0.015em;
  font-family: var(--font-sans);
}

.papertitle {
  font-size: 16px;
  font-weight: 700;
}

.name {
  padding-top: 20px;
  margin: 0;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--text-primary);
  font-family: var(--font-sans);
  text-align: center;
}

.big-icon {
  font-size: 1.5em;
}

.education-item {
  display: flex;
  align-items: baseline;
  margin-bottom: -6px;
}

.bullet-icon {
  font-size: 1.2em;
  margin-right: 8px;
  flex-shrink: 0;
}

body.dark-mode {
  color: var(--text-primary);
}

body.dark-mode a {
  color: var(--accent);
}

body.dark-mode a:hover {
  color: var(--accent-hover);
}

body.dark-mode .navbar {
  background-color: rgba(29, 29, 31, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

body.dark-mode .nav-links li a::after {
  background-color: var(--accent);
  opacity: 0.9;
}

.color-mode-toggle {
  width: 36px;
  height: 36px;
  box-sizing: border-box;
  background: none;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
}

.color-mode-toggle .sun {
  width: 50%;
  height: 50%;
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.6) rotate(0deg);
  transition: transform 0.55s ease-in, opacity 0.2s ease-in 0.1s;
  background: radial-gradient(circle, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 50%, #333 50%);
}

.color-mode-toggle .sun:before {
  content: "";
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, #333 30%, rgba(0, 0, 0, 0) 31%, rgba(0, 0, 0, 0) 50%, #333 50%);
  transform: rotate(45deg);
}

.color-mode-toggle .sun.visible {
  pointer-events: auto;
  opacity: 1;
  transform: scale(1) rotate(180deg);
  transition: transform 0.45s ease-in, opacity 0.2s ease-in 0.1s;
}

.color-mode-toggle .moon {
  width: 50%;
  height: 50%;
  pointer-events: none;
  position: absolute;
  left: -2.5%;
  top: 18.75%;
  background-color: rgba(0, 0, 0, 0);
  border-radius: 50%;
  box-shadow: 9px 3px 0px 0px var(--accent);
  opacity: 0;
  transform: scale(0.3) rotate(65deg);
  transition: transform 0.45s ease-in, opacity 0.2s ease-in 0.1s;
}

.color-mode-toggle .moon.visible {
  pointer-events: auto;
  opacity: 1;
  transform: scale(1) rotate(0deg);
  transition: transform 0.45s ease-in, opacity 0.2s ease-in 0.1s;
}

body {
  transition: background-color 1s ease, color 1s ease;
}

.navbar {
  transition: background-color 1s ease, color 1s ease;
}

a {
  transition: color 1s ease;
}

.name-part {
  position: relative;
  cursor: pointer;
  border: none;
  background-color: transparent;
  padding: 0;
  font-family: var(--font-sans);
}

.name-part .tooltip {
  visibility: hidden;
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 20px;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.4s;
  white-space: nowrap;
}

.name-part:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

::selection {
  background: var(--accent-soft);
  color: inherit;
}

body.dark-mode ::selection {
  background: rgba(96, 165, 250, 0.35);
  color: #ffffff;
}

body.dark-mode ::-moz-selection {
  background: rgba(96, 165, 250, 0.35);
  color: #ffffff;
}

img {
  user-select: none;
}

.research-media {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  transition: opacity 0.3s ease;
}

.section-heading {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.section-heading h2 {
  cursor: pointer;
  margin: 0;
}

.section-heading .link-icon {
  position: absolute;
  left: -25px;
  opacity: 0;
  font-size: 0.8em;
  color: var(--text-secondary);
  transition: opacity 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  padding: 5px;
}

.section-heading:hover .link-icon {
  opacity: 1;
}

body.dark-mode .section-heading .link-icon {
  color: var(--text-secondary);
}

.copy-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  background-color: #333;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.copy-toast.show {
  opacity: 1;
  transform: translateY(0);
}

body.dark-mode .copy-toast {
  background-color: #d3d3d3;
  color: #121212;
}

.list-section {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.list-item {
  display: flex;
  gap: 20px;
  align-items: center;
  background: transparent;
}

.list-item:first-child {
  padding-top: 0;
}

.list-media {
  flex: 0 0 160px;
  height: 100px;
  width: 160px;
  max-width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.list-body {
  flex: 1;
}

.list-body h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  font-family: var(--font-sans);
}

.list-meta {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 0.6rem;
}

.list-body ul {
  margin: 0;
  padding-left: 1.2rem;
}

.list-body li+li {
  margin-top: 0.4rem;
}

.section-note {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .list-item {
    flex-direction: column;
  }

  .list-media {
    width: 100%;
    height: 160px;
  }
}

/* Research Paper List Styles */
.paper-item {
  display: flex;
  gap: 20px;
  align-items: center;
  background: transparent;
}

.paper-img {
  flex: 0 0 160px;
  height: 100px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  object-fit: cover;
  width: 160px;
  max-width: 160px;
}

img.paper-img {
  height: auto;
  object-fit: contain;
}

.paper-content {
  flex: 1;
}

.paper-title {
  display: block;
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
  line-height: 1.3;
  font-family: var(--font-sans);
}

.paper-title:hover {
  text-decoration: underline;
}

.paper-authors {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.paper-venue {
  font-size: 15px;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 10px;
}

.paper-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.paper-button {
  display: inline-block;
  padding: 5px 14px;
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 980px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.paper-button:hover {
  background-color: var(--accent);
  color: #fff;
  text-decoration: none;
}

.paper-abstract {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Dark Mode Adjustments */
body.dark-mode .paper-title {
  color: var(--accent);
}

body.dark-mode .paper-button {
  color: var(--accent);
  border-color: var(--accent);
}

body.dark-mode .paper-button:hover {
  background-color: var(--accent);
  color: #0a0f1e;
}

@media (max-width: 640px) {
  .paper-item {
    flex-direction: column;
    gap: 15px;
  }

  .paper-img {
    width: 100%;
    height: 120px;
    flex: none;
  }
}