:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --bg-top: #fbfcfd;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --ink: #111318;
  --ink-soft: #303642;
  --muted: #657083;
  --subtle: #9aa4b2;
  --line: #dce2ea;
  --line-strong: #c9d2df;
  --blue: #0a66c2;
  --blue-dark: #064a8f;
  --red: #b42318;
  --green: #067647;
  --amber: #a15c07;
  --shadow-soft: 0 20px 55px rgba(16, 24, 40, 0.1);
  --shadow-card: 0 16px 36px rgba(16, 24, 40, 0.12);
  --shadow-hairline: 0 1px 2px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, var(--bg-top) 0, #edf2f7 410px, var(--bg) 820px),
    var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  backdrop-filter: saturate(160%) blur(22px);
  background: rgba(252, 252, 253, 0.84);
  border-bottom: 1px solid rgba(217, 222, 231, 0.78);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1240px;
  min-height: 64px;
  padding: 0 24px;
}

.brand {
  align-items: center;
  display: flex;
  font-size: 16px;
  font-weight: 750;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  align-items: center;
  background:
    linear-gradient(#fff, #fff) padding-box,
    conic-gradient(from 160deg, var(--blue), var(--green), var(--amber), var(--red), var(--blue)) border-box;
  border: 2px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.brand-mark::after {
  background: #111318;
  border-radius: 999px;
  content: "";
  display: block;
  height: 12px;
  width: 12px;
}

.source-link,
.controls button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-hairline);
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  justify-content: center;
  min-height: 36px;
  padding: 8px 15px;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.source-link:hover,
.controls button:hover {
  background: #f8fafc;
  border-color: var(--blue);
  color: var(--blue);
  text-decoration: none;
  transform: translateY(-1px);
}

.shell {
  margin: 0 auto;
  max-width: 1240px;
  padding: 20px 24px 32px;
}

.masthead,
.panel,
.person-card,
.archive-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(217, 222, 231, 0.92);
}

.masthead {
  align-items: stretch;
  border-radius: 8px;
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 0.78fr);
  overflow: hidden;
  padding: 28px;
  position: relative;
}

.masthead::before {
  background: linear-gradient(90deg, var(--blue), var(--green), var(--amber), var(--red));
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.masthead-copy {
  align-content: center;
  display: grid;
  gap: 8px;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.card-school,
.meta,
.archive-item p,
label span,
.feed-caption,
.masthead-copy p {
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
}

h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
}

.metrics div {
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-hairline);
  display: grid;
  min-height: 92px;
  padding: 14px;
}

.metrics span {
  display: block;
  font-size: 28px;
  font-weight: 850;
  line-height: 1;
}

.metrics p {
  align-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  margin-top: 12px;
}

.workspace {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: 312px minmax(0, 1fr);
  margin-top: 20px;
}

.sidebar {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 84px;
}

.panel,
.archive-panel {
  border-radius: 8px;
  box-shadow: var(--shadow-hairline);
}

.controls {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.panel-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding-bottom: 2px;
}

.panel-title > span {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.feed-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  font-size: 12px;
  font-weight: 750;
}

input,
select {
  background: #fbfcfd;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

input::placeholder {
  color: var(--subtle);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  border-color: var(--blue);
  outline: 3px solid rgba(10, 102, 194, 0.2);
  outline-offset: 2px;
}

.school-strip {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-hairline);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 10px;
}

.school-chip {
  align-items: center;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  height: 72px;
  justify-items: center;
  padding: 8px;
  position: relative;
  text-align: center;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.school-chip:hover {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.school-chip[aria-pressed="true"] {
  background: #eef6ff;
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(10, 102, 194, 0.16);
}

.school-chip-count {
  align-items: center;
  background: var(--ink);
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  min-width: 24px;
  padding: 0 6px;
  position: absolute;
  right: 7px;
  top: 7px;
}

.school-logo {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(16, 24, 40, 0.04);
  display: grid;
  flex: 0 0 42px;
  height: 42px;
  justify-items: center;
  overflow: hidden;
  position: relative;
  width: 42px;
}

.school-logo.small {
  border-radius: 6px;
  flex-basis: 32px;
  height: 32px;
  width: 32px;
}

.school-logo img {
  background: #fff;
  display: block;
  height: 100%;
  object-fit: contain;
  padding: 5px;
  width: 100%;
}

.logo-empty {
  background: linear-gradient(135deg, #e8edf4, #fff);
  border-radius: 6px;
  display: block;
  height: 22px;
  width: 22px;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.feed {
  min-width: 0;
}

.results-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  min-height: 42px;
}

.feed-caption {
  font-size: 13px;
  font-weight: 650;
}

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

.person-card {
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 218px;
  overflow: hidden;
  padding: 16px;
  position: relative;
  text-align: left;
  transition:
    box-shadow 180ms ease,
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.person-card::before {
  background: linear-gradient(90deg, var(--blue), var(--green), var(--amber), var(--red));
  content: "";
  height: 2px;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: opacity 180ms ease;
}

.person-card:hover {
  background: #fff;
  border-color: #a8b1c1;
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.person-card:hover::before {
  opacity: 1;
}

.card-top {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-width: 0;
}

.card-school-wrap {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.credibility-pill {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  padding: 7px 9px;
  white-space: nowrap;
}

.card-body {
  align-content: start;
  display: grid;
  padding: 18px 0 0;
}

.person-card h3 {
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.25;
  word-break: break-word;
}

.card-school {
  display: block;
  font-size: 13px;
  font-weight: 780;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-nature {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-title {
  color: var(--ink-soft);
  display: -webkit-box;
  font-size: 14px;
  line-height: 1.55;
  margin-top: 14px;
  min-height: 64px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-foot {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--blue);
  display: flex;
  font-size: 13px;
  font-weight: 780;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
}

.archive-panel {
  margin-top: 20px;
  padding: 16px;
}

.archive-panel summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  list-style-position: outside;
}

.archive-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.archive-item {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
}

.archive-item a {
  font-size: 12px;
  font-weight: 700;
}

.archive-item p {
  display: none;
}

.empty {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  padding: 38px;
  text-align: center;
}

.detail-dialog {
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  max-height: min(88vh, 880px);
  max-width: min(940px, calc(100vw - 28px));
  padding: 0;
  width: 940px;
}

.detail-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
}

.detail-sheet {
  background: #fff;
  border-radius: 8px;
  color: var(--ink);
  max-height: min(88vh, 880px);
  overflow: auto;
  position: relative;
}

.detail-sheet::before {
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.95) 0 46%, rgba(248, 250, 252, 0.95) 46% 72%, rgba(255, 243, 235, 0.95) 72% 100%);
  border-bottom: 1px solid var(--line);
  content: "";
  display: block;
  height: 110px;
}

.icon-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  font-size: 24px;
  height: 40px;
  justify-items: center;
  line-height: 1;
  position: absolute;
  right: 16px;
  top: 16px;
  transition:
    background-color 160ms ease,
    transform 160ms ease;
  width: 40px;
  z-index: 2;
}

.icon-button:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

.detail-title {
  align-items: end;
  display: flex;
  gap: 16px;
  margin-top: -39px;
  padding: 0 26px 22px;
}

.detail-title .school-logo {
  border: 3px solid #fff;
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  flex-basis: 76px;
  height: 76px;
  width: 76px;
}

.detail-title h2 {
  font-size: 30px;
  line-height: 1.16;
}

.detail-title p {
  color: var(--muted);
  line-height: 1.5;
  margin-top: 8px;
}

.detail-grid {
  display: grid;
  gap: 0 20px;
  grid-template-columns: 1fr 1fr;
  padding: 0 26px 26px;
}

.detail-block {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.detail-block.full {
  grid-column: 1 / -1;
}

.detail-block h3 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 8px;
}

.detail-block p {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.78;
}

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

.link-list a {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 11px;
}

.link-list a:hover {
  background: #eef6ff;
  border-color: rgba(10, 102, 194, 0.38);
  text-decoration: none;
}

@media (max-width: 1020px) {
  .masthead {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .school-strip {
    grid-template-columns: repeat(9, minmax(64px, 1fr));
    overflow-x: auto;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 14px 12px 22px;
  }

  .topbar-inner {
    padding: 0 12px;
  }

  .brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .source-link {
    padding-left: 12px;
    padding-right: 12px;
  }

  .masthead {
    gap: 16px;
    padding: 18px;
  }

  h1 {
    font-size: 28px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .metrics div {
    min-height: 86px;
  }

  .results-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .school-strip {
    grid-template-columns: repeat(9, 64px);
  }

  .school-chip {
    height: 64px;
  }

  .detail-title,
  .detail-grid {
    padding-left: 16px;
    padding-right: 16px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-title {
    align-items: flex-start;
    flex-direction: column;
  }
}
