:root {
  --accent: #1264a3;
  --accent-hover: #0e5083;
  --text: #17212b;
  --muted: #607080;
  --surface: #fff;
  --border: #dde5ed;
  --card-radius: 12px;
  --control-radius: 8px;
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: #17212b;
  background: #f6f7f9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #dce2e8;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  margin-bottom: 12px;
}

.topbar p,
.person-card span,
.source-row span,
.meta,
.empty {
  color: #607080;
}

.search,
#import-form {
  display: flex;
  gap: 8px;
}

input {
  width: min(360px, 48vw);
  height: 40px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
}

select {
  height: 40px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  padding: 0 10px;
  font: inherit;
  background: #fff;
}

button {
  height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  font: inherit;
  font-weight: 650;
  color: #fff;
  background: #1264a3;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
}

#import-status {
  color: #356338;
}

#enrich-status {
  color: #356338;
}

.categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.cat-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid #dde5ed;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.cat-card:hover {
  border-color: #1264a3;
  box-shadow: 0 4px 14px rgba(18, 100, 163, 0.12);
  transform: translateY(-2px);
}

.cat-card.active {
  border-color: #1264a3;
  background: #eef5fb;
}

.cat-name {
  font-size: 17px;
  font-weight: 700;
  color: #17212b;
}

.cat-count {
  font-size: 13px;
  font-weight: 650;
  color: #1264a3;
  font-variant-numeric: tabular-nums;
}

.cat-examples {
  font-size: 12px;
  line-height: 1.5;
  color: #607080;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.filter-note {
  margin: 0 0 16px;
  color: #607080;
  font-size: 14px;
}

.filter-note a {
  color: #1264a3;
  font-weight: 650;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.person-card,
.profile,
.section {
  background: #fff;
  border: 1px solid #dde5ed;
  border-radius: 8px;
}

.person-card {
  display: grid;
  gap: 10px 12px;
  min-height: 200px;
  padding: 16px;
  align-items: start;
}

.person-card p {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.55;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.back {
  display: inline-block;
  margin-bottom: 16px;
  color: #1264a3;
  font-weight: 650;
}

.profile,
.section {
  padding: 20px;
  margin-bottom: 16px;
}

.profile {
  display: block;
  padding: 20px;
  margin-bottom: 16px;
}

.profile-head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.profile-avatar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.profile-head-text {
  min-width: 0;
}

.enrich-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta span {
  padding: 4px 8px;
  border: 1px solid #d7e0e8;
  border-radius: 999px;
}

.source-row {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid #edf1f4;
}

.source-row:first-of-type {
  border-top: 0;
}

.book-list {
  display: grid;
  gap: 10px;
}

.book-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px 0;
  border-top: 1px solid #edf1f4;
}

.book-row[hidden],
.book-evidence[hidden],
.book-filter-empty[hidden] {
  display: none;
}

.book-row:first-child {
  border-top: 0;
}

.book-row img,
.book-cover-placeholder {
  width: 52px;
  height: 72px;
  border: 1px solid #d7e0e8;
  border-radius: 4px;
  background: #eef2f5;
}

.book-row img {
  object-fit: cover;
}

.book-cover-placeholder {
  display: grid;
  place-items: center;
  color: #607080;
  font-size: 18px;
  font-weight: 700;
}

.book-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.book-info strong,
.book-info em {
  overflow-wrap: anywhere;
}

.book-row em {
  color: #607080;
  font-style: normal;
}

.empty {
  padding: 18px;
  border: 1px dashed #cbd5df;
  border-radius: 8px;
}

.profile .bio {
  font-size: 16px;
  line-height: 1.7;
  color: #2a3744;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px 20px;
  margin: 0;
}

.facts div {
  display: grid;
  gap: 2px;
}

.facts dt {
  font-size: 12px;
  color: #8a96a3;
  letter-spacing: 0.04em;
}

.facts dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #17212b;
}

.fact-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.fact-tags-label {
  font-size: 13px;
  color: #8a96a3;
  margin-right: 4px;
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef5fb;
  color: #1264a3;
  font-size: 13px;
  font-weight: 600;
}

.tag.muted {
  background: #eef1f4;
  color: #51606e;
  font-weight: 500;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ext {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  color: #324152;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
}

.ext:hover {
  border-color: #1264a3;
  color: #1264a3;
}

/* 头像：固定尺寸、不裁剪、等比缩放居中 */
.avatar,
.avatar-lg {
  border-radius: 10px;
  object-fit: contain;
  background: #f0f2f5;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar {
  width: 72px;
  height: 72px;
  align-self: start;
  box-shadow: 0 1px 3px rgba(20, 40, 60, 0.1);
}

.person-card .avatar.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #8899aa;
  background: #e8ecf1;
}

.avatar-lg {
  width: 112px;
  height: 112px;
  box-shadow: 0 2px 8px rgba(20, 40, 60, 0.15);
}

.avatar-lg.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 700;
  color: #8899aa;
  background: #e8ecf1;
}

.profile {
  display: block;
}

.profile h1 {
  margin: 0;
}

.profile .bio {
  margin-top: 8px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 28px 0 8px;
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  color: #8ca0b3;
  font-size: 14px;
  user-select: none;
}

.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  font-size: 14px;
  color: #5b6f83;
}

.page-jump input[type="number"] {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid #dde4ea;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  color: #2a3b4d;
}

.page-jump input[type="number"]:focus {
  outline: none;
  border-color: #9fb3c6;
}

.page-jump button {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #dde4ea;
  background: #fff;
  color: #2a3b4d;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.page-jump button:hover {
  border-color: #9fb3c6;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #dde4ea;
  color: #2a3b4d;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s, border-color 0.15s;
}

.page-link:hover {
  border-color: #9fb3c6;
}

.page-link.active {
  background: #2a3b4d;
  color: #fff;
  border-color: #2a3b4d;
}

.page-link.disabled {
  color: #b6c1cc;
  cursor: default;
  pointer-events: none;
}

.page-info {
  margin-left: auto;
  color: #6b7a8a;
  font-size: 13px;
}

@media (max-width: 720px) {
  .topbar,
  .toolbar,
  .search,
  #import-form {
    align-items: stretch;
    flex-direction: column;
  }

  input {
    width: 100%;
  }

  .page-info {
    margin-left: 0;
    width: 100%;
  }
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.source-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #e2e8ee;
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.source-card:hover {
  border-color: #9fb3c6;
  box-shadow: 0 2px 8px rgba(20, 40, 60, 0.08);
}

.source-platform {
  font-size: 12px;
  font-weight: 700;
  color: #1264a3;
  letter-spacing: 0.03em;
}

.source-name {
  font-size: 14px;
  color: #2a3b4d;
}

.section-note {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: #9aa7b4;
  border-radius: 999px;
  padding: 2px 10px;
  margin-left: 8px;
  vertical-align: middle;
}

.section-hint {
  margin: 4px 0 14px;
  font-size: 13px;
  color: #6b7a8a;
}

.image-attribution {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: #93a0ad;
  max-width: 112px;
}

.source-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #6b7a8a;
}

.source-note a {
  color: #1264a3;
  text-decoration: none;
}

.source-note a:hover {
  text-decoration: underline;
}

.contact-mail {
  margin: 6px 0 0;
  font-size: 19px;
  font-weight: 600;
}

.contact-mail a {
  color: #1264a3;
  text-decoration: none;
}

.contact-mail a:hover {
  text-decoration: underline;
}

.about-link {
  align-self: center;
  color: #1264a3;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.about-link:hover {
  text-decoration: underline;
}

.about-list {
  margin: 8px 0 0;
  padding-left: 20px;
  line-height: 1.9;
  color: #2a3b4d;
}

.about-list li {
  margin-bottom: 4px;
}

.breadcrumbs, .category-intro {
  margin: 12px 0 20px;
  line-height: 1.7;
  color: #51606e;
}

.section {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 20px 0;
  border-top: 1px solid #dce2e8;
  line-height: 1.7;
}

.verified-fact {
  padding: 12px 0;
  border-bottom: 1px solid #e2e8ee;
}

.fact-citation {
  margin-top: 6px;
  font-size: 13px;
  color: #607080;
}

.fact-citation a, .breadcrumbs a, .related-links a {
  color: #1264a3;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.bio { line-height: 1.8; }
.shell { overflow-wrap: anywhere; }
.cat-card, .source-card { border-radius: 8px; }
.facts dt, .source-platform { letter-spacing: 0; }

@media (max-width: 480px) {
  .profile-head { gap: 12px; }
  .profile h1 { font-size: 26px; line-height: 1.3; }
  .avatar-lg { width: 88px; height: 88px; }
  .image-attribution { max-width: 88px; }
  .section h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
}

/* Shared geometry for both languages. Content previews reserve the same rows. */
.shell { overflow-wrap:normal; }
.language-picker { display:flex; align-items:center; gap:6px; width:fit-content; margin:0 0 16px auto; color:#718096; }
.language-picker select { width:96px; height:34px; padding:0 8px; font:inherit; font-size:13px; color:#475569; border:1px solid #dde5ed; border-radius:7px; background:#fff; cursor:pointer; }
.language-picker select:hover { border-color:#94a3b8; }
.language-picker select:focus-visible { outline:2px solid #1264a3; outline-offset:3px; }
.topbar { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:12px 24px; padding-bottom:24px; margin-bottom:24px; }
.topbar h1 { font-size:32px; line-height:40px; min-height:40px; margin:0; overflow-wrap:normal; }
.header-actions { display:flex; align-items:center; gap:20px; }
.header-actions .language-picker { margin:0; }
.site-description { grid-column:1 / -1; min-height:24px; line-height:24px; font-size:14px; color:#607080; }
.collection-total { display:inline-block; margin-left:8px; color:#4c6378; white-space:nowrap; font-variant-numeric:tabular-nums; }
.topbar .search { grid-column:1 / -1; display:flex; flex-direction:row; align-items:center; gap:8px; margin-top:4px; }
.topbar .search input:not([type="hidden"]) { width:100%; min-width:0; flex:1; height:44px; border-radius:8px; }
.search button { white-space:nowrap; flex-shrink:0; min-width:88px; height:44px; border-radius:8px; }
.categories { grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
.cat-card { grid-template-columns:minmax(0,1fr) auto; grid-template-rows:40px 36px; gap:4px 8px; height:112px; min-height:0; padding:14px; border-radius:10px; }
.cat-name { font-size:14px; line-height:20px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.cat-count { align-self:start; padding:2px 6px; background:#f0f5fa; border-radius:5px; line-height:18px; font-size:12px; }
.cat-examples { grid-column:1 / -1; height:36px; line-height:18px; overflow-wrap:anywhere; }
.grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.person-card { grid-template-rows:64px 40px 40px 88px; gap:8px; height:288px; min-height:0; border-radius:12px; transition:border-color .15s,box-shadow .15s; }
.person-card:hover { border-color:#94afc5; box-shadow:0 5px 18px rgba(23,33,43,.05); }
.person-card .avatar { width:64px; height:64px; }
.person-card > strong { font-size:16px; line-height:20px; height:40px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
.person-card > span:not(.avatar) { font-size:13px; line-height:20px; height:40px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.person-card p { font-size:14px; line-height:22px; height:88px; margin:0; overflow-wrap:anywhere; }
.profile, .source-row, .book-info, .verified-fact { overflow-wrap:anywhere; }
.profile h1 { line-height:1.3; }
.bio { font-size:16px; line-height:1.8; }
a:focus-visible, button:focus-visible { outline:2px solid #1264a3; outline-offset:3px; }
@media(max-width:1000px) {
  .categories { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:720px) {
  .shell { padding-top:20px; }
  .topbar { gap:10px 12px; padding-bottom:20px; margin-bottom:20px; }
  .topbar h1 { font-size:24px; line-height:30px; min-height:60px; display:flex; align-items:center; }
  .header-actions { display:contents; }
  .header-actions .language-picker { grid-column:2; grid-row:1; }
  .header-actions .about-link { grid-column:1 / -1; grid-row:4; justify-self:end; line-height:20px; }
  .site-description { min-height:48px; }
  .collection-total { margin-left:0; }
  .categories { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
}
@media(max-width:560px) {
  .grid { grid-template-columns:1fr; }
  .cat-card { padding:12px; height:108px; }
}

.geo-credit { margin-top:32px; padding-top:16px; border-top:1px solid #e2e8ee; font-size:11px; color:#718096; text-align:right; }
.geo-credit a:hover { text-decoration:underline; }

.saved-link { color:#1264a3; font-size:14px; font-weight:600; white-space:nowrap; align-self:center; }
.back { margin-right:12px; }
.profile-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:12px 0; }
.save-person, .saved-person button { background:#eef5fb; color:#1264a3; border:1px solid #b7cddd; }
.save-person[aria-pressed="true"] { background:#1264a3; color:#fff; }
.save-person[hidden] { display:none; }
.save-status { color:#607080; font-size:13px; }
.profile-toc { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 20px; }
.profile-toc a { color:#1264a3; background:#fff; border:1px solid #dde5ed; border-radius:20px; padding:9px 14px; font-size:14px; }
.section[id] { scroll-margin-top:20px; }
.direct-resource small { color:#607080; }
.saved-collection h1 { margin-bottom:16px; }
.saved-list { display:grid; gap:12px; margin-top:20px; }
.saved-person { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 0; border-top:1px solid #e2e8ee; }
.saved-person a { color:#1264a3; overflow-wrap:anywhere; }
.saved-person button { flex-shrink:0; }
@media(max-width:720px) {
  .header-actions .saved-link { grid-column:1 / -1; grid-row:4; justify-self:start; }
}

.discovery { margin-bottom:28px; }
.section-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; margin:0 0 16px; scroll-margin-top:20px; }
.section-heading h2 { margin:0; }
.section-heading p { color:#607080; font-size:14px; line-height:1.6; margin-top:6px; }
.section-heading a, .search-empty a { color:#1264a3; font-size:14px; white-space:nowrap; }
.featured-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.featured-card { display:flex; gap:12px; align-items:center; min-width:0; padding:16px; border:1px solid #dde5ed; border-radius:12px; background:#fff; }
.featured-card:hover { border-color:#1264a3; }
.featured-card .avatar { width:48px; height:48px; flex-shrink:0; }
.featured-card > span:last-child { min-width:0; }
.featured-card strong { display:block; font-size:15px; overflow-wrap:anywhere; }
.featured-card small { display:block; color:#607080; font-size:12px; margin-top:6px; }
.browse-heading { margin-bottom:16px; }
.search-empty { grid-column:1 / -1; padding:32px 20px; background:#fff; border:1px solid #dde5ed; border-radius:12px; }
.search-empty h3 { margin:0 0 12px; color:#17212b; }
.search-empty p { line-height:1.7; margin-bottom:16px; }
.search-empty a { display:inline-block; margin-right:16px; }
@media(max-width:720px) {
  .section-heading { align-items:flex-start; }
  .featured-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .featured-card { flex-direction:column; align-items:flex-start; padding:12px; }
}

/* Keep contact navigation prominent and data attribution separate. */
.header-actions .contact-link { display:inline-flex; align-items:center; justify-content:center; min-height:40px; padding:0 14px; border-radius:8px; background:#1264a3; color:#fff; font-size:14px; font-weight:600; white-space:nowrap; }
.header-actions .contact-link:hover { background:#0e5083; }
.geo-credit { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; text-align:left; }
.geo-credit .footer-contact { font-size:14px; font-weight:600; color:#1264a3; }
.geo-credit .data-credit { font-size:11px; color:#718096; }
@media(max-width:720px) {
  .header-actions .contact-link { grid-column:1 / -1; grid-row:5; justify-self:start; }
}

.skip-link { position:fixed; left:16px; top:-100px; z-index:100; background:#1264a3; color:#fff; padding:12px 16px; border-radius:8px; }
.skip-link:focus { top:12px; }
#main-content:focus { outline:none; }
.category-picker { margin:0 0 24px; }
.category-picker summary { cursor:pointer; color:#1264a3; padding:12px 0; font-weight:600; }
.category-picker .browse-heading { margin-top:12px; }
#all-people { scroll-margin-top:20px; }
.contact-actions { display:flex; flex-wrap:wrap; gap:10px; margin:16px 0 0; }
.primary-action, .secondary-action { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:10px 16px; border-radius:8px; font-size:14px; line-height:22px; font-weight:600; cursor:pointer; }
.primary-action { background:#1264a3; color:#fff; }
.secondary-action { background:#fff; border:1px solid #b7cddd; color:#1264a3; }
.secondary-action[hidden] { display:none; }
.action-status { font-size:13px; color:#607080; }
.action-status:empty { display:none; }
.correction-link { color:#1264a3; font-size:14px; padding:10px 0; }
.avatar-fallback { display:inline-flex; align-items:center; justify-content:center; background:#eef2f6; color:#607080; }
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } *, *::before, *::after { transition:none !important; animation:none !important; } }

/* Shared interaction styles across profiles, discovery and research. */
.primary-action { background:var(--accent); color:var(--surface); border:1px solid var(--accent); font-family:inherit; }
.primary-action:hover { background:var(--accent-hover); border-color:var(--accent-hover); }
.secondary-action:hover { background:#f0f5fa; border-color:var(--accent); }
.primary-action:focus-visible, .secondary-action:focus-visible,
.market a:focus-visible, .research-form :focus-visible {
  outline:2px solid var(--accent); outline-offset:3px;
}
