:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --border: #e5e5e5;
  --link: #ab274f;
  --accent: #781b37;
  --max-width: 920px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212;
    --fg: #e8e8e8;
    --muted: #9a9a9a;
    --border: #2a2a2a;
    --link: #ff9f45;
    --accent: #ffb877;
  }
}

:root[data-theme="dark"] {
  --bg: #121212;
  --fg: #e8e8e8;
  --muted: #9a9a9a;
  --border: #2a2a2a;
  --link: #ff9f45;
  --accent: #ffb877;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --border: #e5e5e5;
  --link: #ab274f;
  --accent: #781b37;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.25rem 2rem;
}

#theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
#theme-toggle:hover {
  border-color: var(--accent);
}
#theme-toggle-icon {
  display: flex;
}
#theme-toggle-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

.intro {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3.5rem;
}

.avatar {
  width: 190px;
  height: 190px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

h1 {
  font-size: 2.2rem;
  margin: 0 0 0.35rem;
  font-weight: 600;
  font-family: Georgia, "Times New Roman", Times, serif;
}

.bio {
  margin: 0 0 0.9rem;
  font-size: 0.98rem;
}

a {
  color: var(--link);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}
a:hover {
  text-decoration-color: var(--accent);
  color: var(--accent);
}

.links {
  margin-top: 1.25rem;
  font-size: 0.95rem;
}
.links .sep {
  margin: 0 0.5rem;
  color: var(--muted);
}
.links a {
  text-decoration: none;
}
.links a:hover {
  text-decoration: underline;
}

.section {
  margin-bottom: 3rem;
}

.section h2 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg);
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

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

.entry {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  min-height: 176px;
}

.entry-thumb {
  width: 280px;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}

.entry-body {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}

.entry-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
  font-family: Georgia, "Times New Roman", Times, serif;
}

.entry-meta {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.entry-authors {
  margin: 0 0 0.2rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.entry-authors b {
  color: var(--fg);
}

.entry-venue {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
}

.entry-links {
  margin: 0;
  font-size: 0.92rem;
}
.entry-links a {
  text-decoration: none;
}
.entry-links a:hover {
  text-decoration: underline;
}
.entry-links .sep {
  margin: 0 0.45rem;
  color: var(--muted);
}

.cv-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cv-group-title {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.cv-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

#teaching-service .cv-items,
#honors-awards .cv-items {
  list-style: disc;
  padding-left: 1.1rem;
}

.cv-item {
  font-size: 0.92rem;
}

.cv-item-text {
  display: block;
}

.cv-item-date {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 560px) {
  .intro {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .avatar {
    order: -1;
    width: 160px;
    height: 160px;
  }
  .links {
    text-align: center;
  }
  .entry {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
  }
  .entry-thumb {
    width: 100%;
  }
}
