/* 简洁主题：与 Ascent 同一套设计语言（浅灰底、白色圆角卡片、蓝色主色、深色导航胶囊）。
   最后加载，覆盖 styles.css 与 academic.css。 */

@font-face { font-family: "Geist"; font-weight: 400; font-display: swap; src: url(vendor/geist/geist-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-weight: 500; font-display: swap; src: url(vendor/geist/geist-sans-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-weight: 600; font-display: swap; src: url(vendor/geist/geist-sans-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-weight: 700; font-display: swap; src: url(vendor/geist/geist-sans-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --panel-3: #f1f5f9;
  --line: #e2e8f0;
  --line-bright: #cbd5e1;
  --text: #1a1d23;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --cyan: #2563eb;
  --math: #2563eb;
  --physics: #d97706;
  --both: #7c3aed;
  --mentor: #0d9488;
  --collaborator: #d97706;
  --influence: #7c3aed;
  --paper: #ffffff;
  --paper-text: #1a1d23;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --ink: #0f172a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, .08);
  --page: 1024px;
  --sans: "Geist", "Source Han Sans SC", "Noto Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: var(--sans);
}

body { -webkit-font-smoothing: antialiased; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }

/* ---------- 顶栏 ---------- */
.main-shell { grid-template-rows: 60px 60px minmax(0, 1fr) 80px; }
.app[data-view="genealogy"] .main-shell { grid-template-rows: 60px minmax(0, 1fr); }
.topbar { gap: 20px; padding: 0 max(16px, calc((100% - var(--page)) / 2 + 16px)); background: #fff; }
.brand { gap: 10px; }
.brand-mark { width: 30px; height: 30px; }
.brand-copy strong { padding-right: 0; border-right: 0; color: var(--text); font-size: 18px; font-weight: 700; letter-spacing: 0; }
.brand-copy small { display: none; }
.top-nav { gap: 4px; }
.top-nav-button, .top-nav-link { min-width: 0; min-height: 32px; padding: 0 12px; border: 0; border-radius: 6px; color: #475569; font-size: 14px; font-weight: 500; }
.top-nav-button:hover, .top-nav-link:hover { background: #f1f5f9; }
.top-nav-button.active { background: var(--ink); color: #fff; }

/* ---------- 页面容器 ---------- */
.genealogy-panel { background: var(--bg); }
.genealogy-hero, .catalog-toolbar, .course-filters, .course-cards, .site-footer {
  width: min(var(--page), 100% - 32px);
  margin-left: auto;
  margin-right: auto;
}
.course-detail, .person-home { max-width: var(--page); padding: 24px 16px 48px; }

/* ---------- 首页 ---------- */
.genealogy-hero { min-height: 0; grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr); gap: 24px; margin-top: 24px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.hero-visual { height: 200px; border: 0; border-radius: var(--radius-sm); background: #fff; }
.hero-search { max-width: none; }
.hero-search input { height: 44px; }

.search-wrap input, .hero-search input { padding: 0 14px; border: 1px solid #cbd5e1; border-radius: var(--radius-sm); background: #fff; font-size: 14px; }
.search-wrap input::placeholder { color: #94a3b8; }
.search-wrap input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px #dbeafe; }

.catalog-toolbar { margin-top: 24px; margin-bottom: 12px; }
.catalog-toolbar strong { color: var(--text); font-size: 18px; font-weight: 600; }
.catalog-toolbar > div:first-child span { color: var(--muted); font-size: 13px; }
.catalog-page-head { margin-top: 24px; }
.catalog-page-head strong { font-size: 22px; }
.all-courses-link { min-height: 0; padding: 0; color: var(--blue); font-size: 14px; font-weight: 500; }

/* ---------- 分类栏 ---------- */
.course-filters { gap: 6px 20px; margin-bottom: 16px; padding: 0 0 14px; }
.filter-group + .filter-group { padding-left: 20px; }
.filter-pill-tab { min-height: 30px; padding: 0 12px; border-radius: 6px; color: #475569; font-size: 13px; font-weight: 500; }
.filter-pill-tab:hover { background: #e9edf2; color: var(--text); }
.filter-pill-tab.active { background: var(--ink); color: #fff; font-weight: 500; }

/* ---------- 课程卡片 ---------- */
.course-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-bottom: 32px; }
.course-card { min-height: 190px; padding: 18px; border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.course-card:hover { border-color: #bfdbfe; box-shadow: var(--shadow-md); transform: none; }
.course-card-body { min-height: 152px; }
.course-card-meta em, .course-card-meta small { padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 500; line-height: 1.5; }
.course-card-meta em { background: #eff6ff; color: var(--blue-dark); }
.course-card-meta small { background: #f1f5f9; color: #475569; }
.course-card-title { margin-top: 14px; font-size: 18px; font-weight: 600; }
.course-card-description { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.course-card-count { padding-top: 12px; border-top-color: #f1f5f9; color: var(--muted); font-size: 12px; font-weight: 500; }
.course-card-art { width: 34%; border-left-color: #f1f5f9; background: #f8fafc; }
.course-card-art img { filter: grayscale(.35); opacity: .85; }

.catalog-result-heading strong { font-size: 16px; font-weight: 600; }
.person-result-card { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.person-result-card:hover { border-color: #bfdbfe; }
.result-monogram { border-color: #bfdbfe; color: var(--blue); }
.person-result-card em { color: var(--muted); }

/* ---------- 页脚 ---------- */
.site-footer { padding: 20px 0 28px; }
.footer-brand img { width: 24px; height: 24px; }
.footer-brand strong { font-size: 15px; font-weight: 600; }
.footer-brand p, .site-footer a { color: var(--muted); font-size: 12px; }
.footer-brand small { color: var(--muted-2); font-size: 11px; }
.site-footer a:hover { color: var(--blue); }

/* ---------- 按钮 ---------- */
.back-button, .profile-map-button, .open-person-home { min-height: 36px; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: var(--radius-sm); background: #fff; color: #334155; font-size: 14px; font-weight: 500; cursor: pointer; }
.back-button:hover { border-color: #cbd5e1; background: #f8fafc; color: var(--text); }
.profile-map-button, .open-person-home { border-color: var(--blue); background: var(--blue); color: #fff; }
.profile-map-button:hover, .open-person-home:hover { border-color: var(--blue-dark); background: var(--blue-dark); color: #fff; }

/* ---------- 课程详情 ---------- */
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .04em; }
.route-head h2 { font-size: 24px; font-weight: 700; letter-spacing: 0; }
.route-count strong { color: var(--text); font-weight: 700; }
.route-outcome { border: 1px solid #dbeafe; border-left: 1px solid #dbeafe; border-radius: var(--radius); background: #eff6ff; }
.route-outcome span { color: var(--blue-dark); }
.course-mini-view { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.mini-view-people button:hover { border-color: var(--line); background: #f8fafc; }
.route-steps::before { background: var(--line-bright); }
.step-marker button { border-color: #cbd5e1; background: #fff; color: #475569; }
.route-step.active .step-marker button { border-color: var(--blue); background: var(--blue); color: #fff; }
.step-content { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.step-content:hover { border-color: #cbd5e1; }
.route-step.active .step-content { border-color: #93c5fd; background: #fff; box-shadow: 0 0 0 3px #eff6ff; }
.step-content > header > strong { color: var(--muted); }
.step-content h3 { font-weight: 600; }
.step-method { border-radius: var(--radius-sm); background: #f8fafc; }
.step-lesson-content { color: #334155; font-size: 14px; }
.step-lesson-content h4 { font-size: 15px; font-weight: 600; }
.knowledge-list span, .route-person { border-color: var(--line); border-radius: 6px; }
.route-person:hover { border-color: #bfdbfe; }
.step-source { color: var(--blue); }
.step-source:hover { color: var(--blue-dark); }
.genealogy-empty { border-color: var(--line-bright); border-radius: var(--radius); }

/* ---------- 人物主页 ---------- */
.person-identity, .profile-section { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.person-identity h1 { font-size: 28px; font-weight: 700; }
.profile-section > header { border-bottom-color: #f1f5f9; }
.profile-section > header h2 { font-size: 15px; font-weight: 600; }
.profile-school strong { color: var(--text); font-weight: 600; }
.profile-subjects span, .tag { border-color: #dbeafe; border-radius: 6px; background: #eff6ff; color: var(--blue-dark); }
.profile-contribution > strong { color: var(--blue-dark); }
.profile-links button { border-color: var(--line); border-radius: var(--radius-sm); }
.profile-links button:hover { border-color: #bfdbfe; }

/* ---------- 人物视图 ---------- */
.controlbar { gap: 12px; padding: 10px 16px; background: #fff; }
.person-view-switcher { gap: 2px; padding: 3px; border-radius: var(--radius-sm); background: #f1f5f9; border-color: transparent; }
.person-view-switcher button { min-width: 56px; min-height: 30px; border-radius: 6px; color: #475569; font-size: 13px; font-weight: 500; }
.person-view-switcher button:hover { background: #e2e8f0; }
.person-view-switcher button.active { background: var(--ink); color: #fff; }
.search-wrap input { height: 38px; }
.range-summary strong { font-size: 14px; font-weight: 600; }
.filter-toggle { min-height: 38px; border-color: #cbd5e1; border-radius: var(--radius-sm); font-size: 14px; }
.filter-toggle:hover, .filter-toggle[aria-expanded="true"] { border-color: #94a3b8; }
.filter-toggle span { background: #eff6ff; color: var(--blue-dark); }
.filter-popover { border-radius: var(--radius); box-shadow: var(--shadow-md); }
.filter-pill.active { border-color: #bfdbfe; background: #eff6ff; color: var(--blue-dark); }
.text-button, .icon-button { border-color: var(--line); background: #fff; }
.workspace { background: var(--line); }
.panel-head h2 { font-size: 16px; font-weight: 600; }
.profile-heading h2 { font-size: 22px; font-weight: 700; }
.dataset-note a { color: var(--blue); }
.relation-item { border-radius: var(--radius-sm); }
.relation-item:hover { border-color: var(--line); background: #f8fafc; }
.graph-tools button { border-radius: 6px; }

.time-overview { background: #fff; }
.play-button { border-color: #cbd5e1; color: var(--text); }
.play-button:hover { border-color: var(--blue); background: var(--blue); }
.overview-copy strong { font-weight: 600; }
.all-years { border-color: #cbd5e1; border-radius: var(--radius-sm); color: #475569; }
.all-years.active { border-color: #bfdbfe; background: #eff6ff; color: var(--blue-dark); }

/* ---------- 地图与时间线（浅色） ---------- */
.map-panel { background: #f1f5f9; }
.maplibregl-ctrl-attrib { background: rgba(255,255,255,.85) !important; color: var(--muted); }
.maplibregl-ctrl-attrib a { color: #475569 !important; }
.maplibregl-ctrl-attrib-button { filter: none; }
.map-heading, .zoom-controls, .map-loading, .map-error, .empty-state { border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255,255,255,.96); color: var(--text); box-shadow: var(--shadow-md); }
.map-heading strong { font-weight: 600; }
.zoom-btn { border-bottom-color: var(--line); color: #334155; }
.zoom-btn:hover { background: #f1f5f9; color: var(--blue); }
.map-loading, .map-error, .empty-state { color: var(--muted); }
.map-loading span { border-color: #dbeafe; border-top-color: var(--blue); }
.map-source { background: rgba(255,255,255,.85); color: var(--muted); }
.scientist-popup .maplibregl-popup-content { border-color: var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--text); box-shadow: var(--shadow-md); }
.scientist-popup .maplibregl-popup-tip { border-top-color: #fff; border-bottom-color: #fff; }
.city-drawer { border-top: 1px solid var(--line); background: rgba(255,255,255,.98); box-shadow: 0 -8px 24px rgba(15,23,42,.08); color: var(--text); }
.city-drawer-head strong { font-weight: 600; }
.text-button:hover, .icon-button:hover { border-color: #bfdbfe; color: var(--blue); }
.city-person-card { border-color: var(--line); border-radius: var(--radius-sm); background: #fff; }
.city-person-card:hover { border-color: #bfdbfe; background: #f8fafc; }
.city-person-card.selected { border-color: var(--blue); box-shadow: 0 0 0 3px #eff6ff; }
.city-person-card em { color: #475569; }
.river-panel, .river-stage { background: #fff; }
.river-summary { color: var(--muted); font-size: 14px; }

@media (max-width: 960px) {
  .course-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .genealogy-hero { grid-template-columns: 1fr; }
  .hero-visual { height: 160px; }
}
@media (max-width: 760px) {
  .main-shell, .app[data-view="genealogy"] .main-shell { grid-template-rows: auto; }
  .top-nav-button, .top-nav-link { min-height: 32px; font-size: 14px; }
  .genealogy-hero { margin-top: 16px; padding: 16px; }
  .genealogy-hero, .catalog-toolbar, .course-filters, .course-cards, .site-footer { margin-left: auto; margin-right: auto; }
  .course-cards { grid-template-columns: 1fr; }
  .course-card { min-height: 170px; }
  .catalog-toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
}
