:root {
  --ink: #17211e;
  --muted: #65716d;
  --paper: #f7f8f4;
  --surface: #ffffff;
  --line: #dbe2dc;
  --teal: #0e6c63;
  --green: #3f6f52;
  --rust: #aa4638;
  --gold: #b98525;
  --blue: #245f86;
  --plum: #66456b;
  --shadow: 0 18px 52px rgba(23, 33, 30, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(14, 108, 99, 0.12), transparent 34%),
    linear-gradient(240deg, rgba(170, 70, 56, 0.1), transparent 30%),
    var(--paper);
  font-family: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", Georgia, serif;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
button, input, textarea { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(219, 226, 220, 0.86);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 22px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 230px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--rust));
  font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; }
.brand small, .top-nav, .eyebrow, .hero-stats, .search-panel, .timeline-controls, .result-count, .school-meta, .comment-form, .comment-toggle, .comment-meta, .comment-empty, .comment-status {
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}
.brand small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.top-nav { display: flex; align-items: center; gap: 8px; overflow-x: auto; white-space: nowrap; }
.top-nav a {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 12px;
  color: #34413d;
  font-size: 14px;
}
.top-nav a:hover, .top-nav a:focus-visible {
  border-color: rgba(14, 108, 99, 0.26);
  color: var(--teal);
  background: rgba(14, 108, 99, 0.08);
  outline: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(430px, 1.05fr);
  gap: 34px;
  align-items: stretch;
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 22px 30px;
}
.hero-copy { display: flex; min-height: 640px; flex-direction: column; justify-content: center; }
.eyebrow { margin: 0 0 10px; color: var(--rust); font-size: 13px; font-weight: 900; }
.hero h1 { margin: 0; max-width: 680px; font-size: clamp(36px, 5.2vw, 68px); font-weight: 900; line-height: 1.08; }
.hero-lead { margin: 22px 0 0; max-width: 650px; color: #3f4c48; font-size: 18px; line-height: 1.9; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.hero-stats div {
  border: 1px solid rgba(219, 226, 220, 0.96);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 32px rgba(23, 33, 30, 0.07);
}
.hero-stats strong { display: block; color: var(--teal); font-size: 24px; line-height: 1; }
.hero-stats span { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
.search-panel {
  margin-top: 24px;
  border: 1px solid rgba(14, 108, 99, 0.26);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 32px rgba(23, 33, 30, 0.08);
}
.search-panel label { display: block; color: #32423d; font-size: 14px; font-weight: 800; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 10px; }
.search-row input, .comment-form input, .comment-form textarea {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fbfcf9;
  outline: none;
}
.search-row button, .filter-button, .comment-form button, .comment-toggle {
  border: 1px solid rgba(14, 108, 99, 0.28);
  border-radius: 8px;
  padding: 10px 13px;
  color: #173f3a;
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.comment-form button { color: #fff; background: var(--teal); }

.portrait-wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 150px; gap: 12px; }
.portrait-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(23, 33, 30, 0.12);
  border-radius: 8px;
  background: #e7ece7;
  box-shadow: 0 14px 36px rgba(23, 33, 30, 0.12);
}
.portrait-tile:nth-child(1), .portrait-tile:nth-child(6), .portrait-tile:nth-child(11) { grid-row: span 2; }
.portrait-tile img { height: 100%; object-fit: cover; }
.portrait-tile span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  border-radius: 8px;
  padding: 8px 9px;
  color: #fff;
  background: rgba(23, 33, 30, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.section { max-width: 1240px; margin: 0 auto; padding: 36px 22px; }
.section-heading { max-width: 830px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.15; }
.section-heading p:not(.eyebrow) { margin: 14px 0 0; color: #4d5d58; font-size: 17px; line-height: 1.8; }

.school-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.school-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent, var(--teal));
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(23, 33, 30, 0.08);
  cursor: pointer;
  text-align: left;
}
.school-card.selected { border-color: var(--accent, var(--teal)); box-shadow: var(--shadow); }
.school-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 800; }
.school-card h3 { margin: 16px 0 10px; font-size: 22px; line-height: 1.18; }
.school-card p { margin: 0; color: #4d5d58; font-size: 14px; line-height: 1.7; }
.school-figures { margin-top: auto; padding-top: 15px; color: #2f403b; font-size: 13px; line-height: 1.55; }

.existential-shell { display: grid; grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr); gap: 18px; }
.existential-lead, .existential-grid article, .influence-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(23, 33, 30, 0.08);
}
.existential-lead { display: flex; min-height: 360px; flex-direction: column; justify-content: flex-end; border-top: 5px solid var(--plum); padding: 24px; }
.existential-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.existential-grid article { min-height: 170px; border-top: 5px solid var(--plum); padding: 18px; }
.existential-lead span, .existential-grid span, .influence-grid span { color: var(--rust); font: 900 13px "PingFang SC", "Microsoft YaHei", Arial, sans-serif; }
.existential-lead h3 { margin: 10px 0; font-size: clamp(28px, 3.2vw, 42px); line-height: 1.18; }
.existential-grid h3, .influence-grid h3 { margin: 10px 0; font-size: 21px; line-height: 1.22; }
.existential-lead p, .existential-grid p, .influence-grid p { margin: 0; color: #4d5d58; line-height: 1.75; }

.timeline-controls { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0 12px; }
.filter-button.active { color: #fff; border-color: var(--teal); background: var(--teal); }
.result-count { min-height: 22px; margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.timeline-list { position: relative; display: grid; gap: 16px; }
.timeline-list::before { position: absolute; top: 0; bottom: 0; left: 125px; width: 2px; background: linear-gradient(var(--teal), var(--rust), var(--gold), var(--blue)); content: ""; }
.timeline-item { position: relative; display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 34px; }
.timeline-date { padding-top: 22px; text-align: right; }
.timeline-date strong { display: block; color: var(--rust); font: 900 22px/1 "PingFang SC", "Microsoft YaHei", Arial, sans-serif; }
.timeline-date span { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.timeline-card {
  position: relative;
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 38px rgba(23, 33, 30, 0.08);
}
.timeline-card::before { position: absolute; top: 30px; left: -43px; width: 15px; height: 15px; border: 3px solid #fff; border-radius: 999px; background: var(--accent, var(--teal)); content: ""; }
.portrait-link { overflow: hidden; border-radius: 8px; background: linear-gradient(135deg, rgba(14,108,99,.2), rgba(170,70,56,.18)); }
.portrait-link img, .portrait-fallback { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.portrait-fallback { display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--teal), var(--plum)); font-size: 42px; font-weight: 900; }
.timeline-topline { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pill { display: inline-flex; border-radius: 999px; padding: 5px 9px; color: #fff; background: var(--accent, var(--teal)); font: 800 12px "PingFang SC", "Microsoft YaHei", Arial, sans-serif; }
.pill.secondary { color: #30423d; background: rgba(219, 226, 220, 0.78); }
.timeline-content h3 { margin: 0; font-size: 28px; line-height: 1.16; }
.timeline-content h3 span { display: block; margin-top: 4px; color: var(--muted); font: 700 13px "PingFang SC", "Microsoft YaHei", Arial, sans-serif; }
.timeline-content p { margin: 12px 0 0; color: #4a5a55; font-size: 15px; line-height: 1.78; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag-row span, .wiki-link { border-radius: 8px; padding: 6px 8px; color: #34443f; background: rgba(14,108,99,.09); font: 800 12px "PingFang SC", "Microsoft YaHei", Arial, sans-serif; }
.wiki-link { display: inline-flex; margin-top: 14px; color: #fff; background: #264a45; }

.comment-panel { margin-top: 16px; border-top: 1px solid rgba(219,226,220,.92); padding-top: 14px; }
.comment-toggle { display: inline-flex; align-items: center; gap: 8px; }
.comment-toggle-count { min-width: 24px; border-radius: 999px; padding: 3px 7px; color: #fff; background: var(--plum); font-size: 12px; text-align: center; }
.comments-body { display: grid; gap: 12px; margin-top: 12px; }
.comments-body[hidden] { display: none; }
.comment-list { display: grid; gap: 10px; }
.comment-empty, .comment-status { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.comment-item { border: 1px solid rgba(219,226,220,.92); border-radius: 8px; padding: 12px; background: rgba(247,248,244,.78); }
.comment-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.comment-meta strong { color: #2f403b; font-size: 13px; }
.comment-text { margin: 8px 0 0; color: #3f4c48; font-size: 14px; line-height: 1.72; white-space: pre-wrap; }
.comment-form { display: grid; gap: 10px; border: 1px solid rgba(14,108,99,.18); border-radius: 8px; padding: 12px; background: rgba(255,255,255,.9); }
.comment-form-row { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) auto; gap: 10px; }
.comment-form label { display: grid; gap: 5px; color: #34443f; font-size: 12px; font-weight: 800; }
.comment-form textarea { min-height: 74px; resize: vertical; }
.comment-form button { align-self: end; }
.comment-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.influence-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.influence-grid article { padding: 20px; }
.empty-state { border: 1px dashed rgba(14,108,99,.4); border-radius: 8px; padding: 28px; color: var(--muted); background: rgba(255,255,255,.76); text-align: center; }

@media (max-width: 1080px) {
  .hero, .existential-shell { grid-template-columns: 1fr; }
  .hero-copy { min-height: 0; }
  .school-grid, .influence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .header-inner { align-items: flex-start; flex-direction: column; }
  .hero, .section { padding-right: 16px; padding-left: 16px; }
  .hero-stats, .school-grid, .existential-grid, .influence-grid { grid-template-columns: 1fr; }
  .search-row, .comment-form-row { grid-template-columns: 1fr; }
  .portrait-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 150px; }
  .portrait-tile:nth-child(1), .portrait-tile:nth-child(6), .portrait-tile:nth-child(11) { grid-row: span 1; }
  .timeline-list::before { left: 8px; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; padding-left: 28px; }
  .timeline-date { padding-top: 0; text-align: left; }
  .timeline-card { grid-template-columns: 104px minmax(0, 1fr); gap: 12px; }
  .timeline-card::before { top: 24px; left: -27px; }
  .timeline-content h3 { font-size: 22px; }
}
@media (max-width: 520px) {
  .hero h1 { font-size: 34px; }
  .portrait-wall, .timeline-card { grid-template-columns: 1fr; }
  .portrait-link img, .portrait-fallback { aspect-ratio: 16 / 10; }
}
