:root {
  --ink: #1c1c1c;
  --muted: #5f6368;
  --rule: #e0ddd6;
  --accent: #7a2e2e;
  --bg: #fdfcfa;
  --measure: 44rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", serif;
  font-size: 17px;
  line-height: 1.65;
}

.wrap {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

/* ---------- masthead ---------- */

header.masthead {
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.75rem;
  padding-top: 3rem;
}

.namebar h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
}

.namebar h1 a { color: inherit; text-decoration: none; border-bottom: none; }

.namebar .cn {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  margin-left: 0.45rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin: 1.4rem 0 1.1rem;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

nav a:hover { color: var(--ink); border-bottom-color: var(--rule); }

nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

nav .lang-switch {
  margin-left: auto;
  letter-spacing: 0.06em;
}

/* ---------- typography ---------- */

h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2.75rem 0 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
}

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

h3 {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2rem 0 0.75rem;
}

p, li { max-width: var(--measure); }

p { margin: 0 0 1.1rem; }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(122, 46, 46, 0.28); }

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

.lede { font-size: 1.08rem; }

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

/* ---------- home ---------- */

.intro {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 0 3rem;
  align-items: start;
}

.intro figure {
  margin: 0;
  position: sticky;
  top: 2rem;
}

.intro-text > p { max-width: none; }

.intro-text > p:first-child { margin-top: -0.35rem; }

.intro img {
  width: 100%;
  border-radius: 2px;
  display: block;
}

.intro figcaption {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 0.5rem;
}

.affil {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 1rem;
}

.affil a { color: var(--muted); border-bottom-color: var(--rule); }

/* ---------- lists ---------- */

ul.plain { list-style: none; padding: 0; margin: 0; }

ul.plain > li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}

ul.plain > li:last-child { border-bottom: none; }

ul.courses {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: var(--measure);
}

ul.courses > li {
  padding: 0.3rem 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}

ul.courses .level {
  flex: none;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pub { max-width: var(--measure); }

.pub .title { display: block; }

.pub .venue { font-style: italic; }

.meta {
  display: block;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 0.3rem;
}

.tag {
  display: inline-block;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(122, 46, 46, 0.3);
  border-radius: 2px;
  padding: 0.1rem 0.4rem;
  margin-right: 0.5rem;
  vertical-align: 1px;
}

.entry { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0 1.5rem; }

.entry .when {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-top: 0.28rem;
}

.entry .what { max-width: var(--measure); }

.entry .what strong { font-weight: 600; }

.entry .what .sub { display: block; color: var(--muted); font-size: 0.95rem; }

/* ---------- contact ---------- */

dl.contact { margin: 0; }

dl.contact dt {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 1.4rem;
}

dl.contact dd { margin: 0.15rem 0 0; }

/* ---------- footer ---------- */

footer {
  margin-top: 4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 0.76rem;
  color: var(--muted);
}

footer a { color: var(--muted); border-bottom-color: var(--rule); }

/* ---------- responsive ---------- */

@media (max-width: 620px) {
  body { font-size: 16px; }
  .wrap { padding: 0 1.25rem 4rem; }
  header.masthead { padding-top: 2.25rem; margin-bottom: 2rem; }
  .namebar h1 { font-size: 1.55rem; }
  nav { gap: 0.9rem 1.15rem; margin: 1.2rem 0 0.9rem; }

  /* 首页：照片居中、放松，去掉粘滞 */
  .intro { grid-template-columns: 1fr; gap: 1.4rem; }
  .intro figure { position: static; top: auto; text-align: center; }
  .intro img { max-width: 200px; margin: 0 auto; }
  .intro figcaption { text-align: center; max-width: 22rem; margin-left: auto; margin-right: auto; }
  .intro-text > p:first-child { margin-top: 0; }
  .lede { font-size: 1.05rem; }

  /* 列表页：时间/内容改为单列堆叠 */
  .entry { grid-template-columns: 1fr; gap: 0.15rem; }
  .entry .when { padding-top: 0; margin-bottom: 0.1rem; }

  /* 课程行：级别标签换到下一行，避免挤在一起 */
  ul.courses > li { flex-direction: column; align-items: flex-start; gap: 0.15rem; }

  h2 { margin-top: 2.25rem; }
  nav .lang-switch { margin-left: 0; }
}

/* ---------- dark ---------- */

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e6e1;
    --muted: #9a978f;
    --rule: #34322e;
    --accent: #c98a8a;
    --bg: #171614;
  }
  a { border-bottom-color: rgba(201, 138, 138, 0.3); }
  .tag { border-color: rgba(201, 138, 138, 0.35); }
}

@media print {
  nav, footer { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
}
