:root {
  --text: #262421;
  --muted: #6b6560;
  --bg: #fdfdfc;
  --accent: #2f6f9e;
  --rule: #e4e0da;
  --max-width: 760px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #e8e4de;
    --muted: #a39d93;
    --bg: #1a1816;
    --accent: #7ab8e8;
    --rule: #38342f;
  }
}

:root[data-theme="dark"] {
  --text: #e8e4de;
  --muted: #a39d93;
  --bg: #1a1816;
  --accent: #7ab8e8;
  --rule: #38342f;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  line-height: 1.65;
  font-size: 17px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

a:hover {
  border-bottom-color: var(--accent);
}

.page-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 5.5rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 2.5rem;
  padding-top: 3.5rem;
  padding-bottom: 2rem;
  padding-right: 2rem;
  border-right: 1px solid var(--rule);
  text-align: left;
}

.header-text {
  margin-top: 1.8rem;
}

.header-text h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.zh-name {
  display: block;
  font-family: "LXGW WenKai", "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
  font-weight: 500;
  color: var(--text);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

.subtitle {
  margin: 0.6rem 0 0;
  font-size: 1rem;
  color: var(--text);
}

.affiliation {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

.header-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  flex-shrink: 0;
}

.header-photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 50%;
  flex-shrink: 0;
}

.scholar-link {
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.site-nav {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
}

.theme-toggle {
  margin-top: 0.6rem;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.site-nav a {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
}

.site-nav a:hover {
  color: var(--accent);
}

main {
  min-width: 0;
  max-width: 720px;
  padding-top: 3.5rem;
}

section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 1.5rem;
}

section:last-of-type {
  border-bottom: none;
}

h2 {
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 1.3rem;
  color: var(--accent);
}

h3 {
  font-size: 1.05rem;
  margin: 1.8rem 0 0.8rem;
  color: var(--text);
}

h3:first-of-type {
  margin-top: 0;
}

p {
  margin: 0 0 1rem;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.pub-list, .cv-list-simple {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pub-list li, .cv-list-simple li {
  margin-bottom: 0.9rem;
  padding-left: 1.2rem;
  position: relative;
}

.pub-list li::before, .cv-list-simple li::before {
  content: "\2022";
  position: absolute;
  left: 0.15rem;
  color: var(--muted);
}

.abstract-toggle {
  display: inline-block;
  margin-top: 0.4rem;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.abstract-toggle::before {
  content: "[";
}

.abstract-toggle::after {
  content: "]";
}

.abstract-toggle:hover {
  border-bottom-color: var(--muted);
}

.abstract-box {
  margin-top: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-left: 2px solid var(--rule);
  font-size: 0.92rem;
  color: var(--muted);
  text-align: justify;
}

.abstract-box p {
  margin: 0;
  text-align: justify;
}

.abstract-more {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin-left: 0.3rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-style: italic;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.abstract-more::before {
  content: "[";
}

.abstract-more::after {
  content: "]";
}

.abstract-more:hover {
  border-bottom-color: var(--muted);
}

.cv-download {
  margin-bottom: 1.5rem;
}

.cv-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.split-section {
  display: flex;
  gap: 3rem;
}

.split-col {
  flex: 1 1 0;
  min-width: 0;
}

.split-col h2 {
  scroll-margin-top: 1rem;
}

.cv-list {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0.5rem 0.8rem;
  margin: 0;
}

.cv-list dt {
  color: var(--muted);
  font-size: 0.92rem;
  padding-top: 0.05rem;
}

.cv-list dd {
  margin: 0 0 0.6rem;
}

footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

@media (max-width: 820px) {
  .page-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .sidebar {
    position: static;
    padding-top: 3rem;
    padding-bottom: 1rem;
    padding-right: 0;
    border-right: none;
    text-align: center;
  }
  .site-nav {
    align-items: center;
  }
  .header-photo-wrap {
    align-items: center;
  }
  main {
    padding-top: 2rem;
  }
}

@media (max-width: 560px) {
  .split-section {
    flex-direction: column;
    gap: 0;
  }
  .split-col + .split-col h2 {
    margin-top: 2rem;
  }
  .cv-list {
    grid-template-columns: 1fr;
    gap: 0.1rem 0;
  }
  .cv-list dt {
    font-weight: 600;
  }
  .cv-list dd {
    margin-bottom: 1rem;
  }
}
