:root {
  --bg: #fdfdfc;
  --fg: #1d1d1f;
  --muted: #62646a;
  --rule: #e4e4e0;
  --accent: #1f5fa8;
  color-scheme: light;
  font-size: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16171a;
    --fg: #e6e6e3;
    --muted: #9a9ca3;
    --rule: #2c2d31;
    --accent: #7fb0ec;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16171a;
  --fg: #e6e6e3;
  --muted: #9a9ca3;
  --rule: #2c2d31;
  --accent: #7fb0ec;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Iowan Old Style", Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  line-height: 1.6;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 16px 40px;
}

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

.profile { margin-bottom: 8px; }
.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

#theme-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 8px;
  cursor: pointer;
}
#theme-toggle:hover { color: var(--fg); border-color: var(--muted); }
#theme-toggle svg { width: 18px; height: 18px; }
#theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] #theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] #theme-toggle .icon-moon { display: none; }
.profile p { margin: 10px 0; }
h1 { font-size: 2rem; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h1 small { font-size: 1.1rem; font-weight: 400; color: var(--muted); margin-left: 6px; }
.role { margin: 4px 0 10px; color: var(--muted); }
.links { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }

section { margin-top: 36px; }
h2 {
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

dl { margin: 0; }
dt { font-weight: 600; margin-top: 12px; }
dd { margin: 2px 0 0; color: var(--fg); }

.entry { margin-bottom: 18px; }
.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.date { color: var(--muted); font-size: 0.9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sub { margin: 2px 0 6px; color: var(--muted); font-style: italic; }
.authors { margin: 2px 0 0; }
sup { line-height: 0; }
.entry p.desc { margin: 4px 0 0; }
.pub-links { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.9rem; }
.pub-links a::before { content: "["; color: var(--muted); }
.pub-links a::after { content: "]"; color: var(--muted); }

ul { margin: 6px 0 0; padding-left: 20px; }
li { margin-bottom: 4px; }

ul.plain { list-style: none; padding: 0; }
ul.plain li { display: flex; justify-content: space-between; gap: 16px; }
.more-honors { margin-top: 8px; }
.more-honors summary { width: fit-content; color: var(--accent); cursor: pointer; }
.more-honors summary:hover { text-decoration: underline; }
.more-honors ul { margin-top: 8px; }

footer {
  margin-top: 48px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 560px) {
  main { padding-top: 32px; }
  .entry-head, ul.plain li { flex-direction: column; gap: 0; }
}
