:root {
  color-scheme: dark light;
}

html[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a21;
  --card: #1d2330;
  --text: #e9edf4;
  --muted: #a7b1c2;
  --border: #2a3140;
  --link: #8ab4ff;
  --button-bg: #242b3a;
  --button-text: #e9edf4;
}

html[data-theme="light"] {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --card: #f1f5ff;
  --text: #1d232f;
  --muted: #5a6474;
  --border: #d2dceb;
  --link: #185abc;
  --button-bg: #e8edf7;
  --button-text: #1d232f;
}

body {
  background-color: var(--bg);
  color: var(--text);
}

.site-header,
.site-footer,
.post-list > li,
.post-content,
.page-content {
  border-color: var(--border);
}

.site-header,
.site-footer {
  background-color: var(--surface);
}

a {
  color: var(--link);
}

.site-title,
.site-nav .page-link,
.post-meta,
.footer-col-wrapper,
.rss-subscribe {
  color: var(--text);
}

.site-header .site-title,
.site-header .site-nav .page-link {
  color: var(--text) !important;
  opacity: 1;
}

html[data-theme="dark"] .site-nav {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .site-nav .trigger {
  background: var(--surface);
}

html[data-theme="dark"] .site-nav label[for="nav-trigger"] {
  background: var(--surface);
}

html[data-theme="dark"] .site-nav .menu-icon > svg path {
  fill: var(--text);
}

.site-header a.site-title:visited,
.site-header a.site-title:hover,
.site-header a.site-title:active,
.site-header a.site-title:focus {
  color: var(--text) !important;
  opacity: 1;
}

html[data-theme="dark"] .site-header a.site-title,
html[data-theme="dark"] .site-header a.site-title:visited,
html[data-theme="dark"] .site-header a.site-title:hover,
html[data-theme="dark"] .site-header a.site-title:active,
html[data-theme="dark"] .site-header a.site-title:focus {
  color: #e9edf4 !important;
  -webkit-text-fill-color: #e9edf4;
  opacity: 1 !important;
}

.theme-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 999;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

html[data-theme="light"] .theme-toggle {
  background: #e8edf7 !important;
  opacity: 1;
}

.theme-toggle:hover {
  filter: brightness(1.06);
}

.profile-photo {
  width: min(320px, 100%);
  height: auto;
  border-radius: 12px;
  display: block;
  margin: 0;
  border: 1px solid var(--border);
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1rem;
}

.profile-copy p {
  margin-top: 0;
}

@media (max-width: 760px) {
  .profile-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.updates-list {
  display: grid;
  gap: 1rem;
}

.update-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--link);
  border-radius: 12px;
  padding: 1rem 1.1rem 1rem 1rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  max-width: 760px;
}

.update-card p {
  margin: 0;
}

.update-date {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.6rem !important;
}

.update-title {
  margin: 0 0 0.55rem 0;
  font-size: 1.08rem;
  line-height: 1.3;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.post-content th,
.post-content td {
  border: 1px solid var(--border);
  padding: 0.65rem 0.8rem;
  text-align: left;
  vertical-align: top;
}

html[data-theme="dark"] .post-content th {
  background: #232a39;
  color: #f2f5fb;
}

html[data-theme="dark"] .post-content td {
  background: #151b27;
  color: #e6ebf5;
}

html[data-theme="dark"] .post-content tr:nth-child(even) td {
  background: #101621;
}

html[data-theme="light"] .post-content th {
  background: #e9eef8;
}

html[data-theme="light"] .post-content td {
  background: #fcfdff;
}

html[data-theme="light"] .post-content tr:nth-child(even) td {
  background: #f4f7fd;
}

.site-footer .social-media-list .username {
  display: none;
}

.site-footer .social-media-list a {
  color: var(--muted);
  transition: color 160ms ease, filter 160ms ease;
}

.site-footer .social-media-list a:hover {
  color: var(--text);
  filter: brightness(1.2);
}

.muted-text {
  color: var(--muted);
}

.publications-list {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.pub-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.pub-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.pub-year {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.pub-authors,
.pub-venue,
.pub-note {
  margin-top: 0.35rem;
}

.pub-authors {
  color: var(--text);
}

.pub-venue {
  color: var(--muted);
}

.pub-note {
  color: var(--muted);
  font-size: 0.93rem;
}

.pub-actions {
  margin-top: 0.5rem;
}

.pub-link {
  font-weight: 600;
}

.research-intro {
  margin-top: 0.2rem;
  margin-bottom: 1.1rem;
  color: var(--muted);
}

.section-block {
  margin-top: 1.2rem;
}

.section-title {
  margin: 0 0 0.8rem 0;
  font-size: 1.45rem;
  line-height: 1.2;
}

.visit-list {
  margin: 0;
  padding-left: 1rem;
}

.visit-list li {
  color: var(--text);
}
