/* Experience cards and their individual memory pages share one palette.
   Color tokens follow Radix Colors: https://www.radix-ui.com/colors
   Backgrounds use the light scale; readable text stays #30343b. */
.memory-theme {
  --memory-bg: #f6f7f9;
  --memory-border: #d9dce2;
  --memory-accent: #536277;
  --memory-link: #354358;
}
.memory-theme[data-memory="360"] { --memory-bg: #f5fbf7; --memory-border: #dceee2; --memory-accent: #66937e; --memory-link: #3e6253; }
.memory-theme[data-memory="pku"] { --memory-bg: #fdf6f8; --memory-border: #f1dde3; --memory-accent: #b77d8c; --memory-link: #704958; }
.memory-theme[data-memory="sjtu"] { --memory-bg: #fdf7f5; --memory-border: #f0e1db; --memory-accent: #bd8674; --memory-link: #77564a; }
.memory-theme[data-memory="tsinghua"] { --memory-bg: #f8f6fd; --memory-border: #e8e0f5; --memory-accent: #8f87b6; --memory-link: #5a5675; }
.memory-theme[data-memory="xidian"] { --memory-bg: #f7f9fc; --memory-border: #e1e9f2; --memory-accent: #7b92aa; --memory-link: #455f75; }
.memory-theme[data-memory="ucla"] { --memory-bg: #f4faff; --memory-border: #d9e9f7; --memory-accent: #6395b8; --memory-link: #365f7a; }
.memory-theme[data-memory="zhenhai"] { --memory-bg: #fbfaf8; --memory-border: #ede6e0; --memory-accent: #9a8276; --memory-link: #6a5147; }

/* Card text has an explicit shared font, including links and award spans.
   This also removes the old weight/color difference in Xidian's summary. */
.home-profile .page__content .experience-card,
.home-profile .page__content .experience-card .experience-name,
.home-profile .page__content .experience-card p.experience-role,
.home-profile .page__content .experience-card p.experience-summary,
.home-profile .page__content .experience-card p.experience-date {
  font-family: var(--rounded-font);
  font-style: normal;
}
.home-profile .page__content .experience-card p.experience-role,
.home-profile .page__content .experience-card p.experience-summary {
  color: #30343b;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}
.home-profile .page__content .experience-card .experience-name a,
.home-profile .page__content .experience-card .experience-role a,
.home-profile .page__content .experience-card .experience-summary span {
  color: inherit !important;
  border-bottom: 0;
  font-family: inherit;
  font-style: inherit;
  font-weight: inherit;
}
.home-profile .page__content .experience-card p.experience-date { color: #59616b; }
.home-profile .page__content .experience-card > p.experience-summary {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: 3px;
  margin-top: 0;
  padding-top: 9px;
  padding-right: 10px;
  border-top: 1px solid var(--memory-border);
  overflow-wrap: break-word;
}
.home-profile .page__content .experience-card .experience-summary > span:nth-child(2)::before {
  content: "·";
  margin-right: 12px;
}
.home-profile .page__content .experience-card .experience-award {
  flex-basis: 100%;
  white-space: normal;
}
.home-profile .page__content .experience-card .experience-name a {
  position: static;
  text-decoration: none !important;
}
.home-profile .page__content .experience-card .experience-name a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 10px;
}
.home-profile .page__content .experience-card .experience-name a:focus-visible { outline: none; }
.home-profile .page__content .experience-card .experience-name a:focus-visible::after {
  outline: 3px solid var(--memory-accent);
  outline-offset: 3px;
}
/* Lab/school links remain separately usable above the full-card link. */
.home-profile .page__content .experience-card .experience-role a {
  position: relative;
  z-index: 2;
  text-decoration: underline !important;
  text-decoration-color: var(--memory-border);
}
.home-profile .page__content .experience-card .experience-role a:hover,
.home-profile .page__content .experience-card .experience-name a:hover { color: var(--memory-link) !important; }
.home-profile .page__content .experience-card .experience-role a:focus-visible {
  outline: 2px solid var(--memory-accent);
  outline-offset: 3px;
}
.home-profile .page__content .experience-memory-arrow {
  position: absolute;
  right: 10px;
  bottom: 8px;
  color: var(--memory-accent);
  font-family: var(--rounded-font);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}
/* The archive link shares the Experience heading row instead of
   reserving an extra line under the seven cards. */
.home-profile .page__content .experience-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin: 32px 0 18px;
}
.home-profile .page__content .experience-section-heading h1 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
  padding: 0;
  font-family: var(--rounded-font);
  font-size: clamp(23px, 2.2vw, 26px);
  font-weight: 700;
}
/* Match the selected "All" pill in Works, but keep this a single link. */
.home-profile .page__content .experience-section-heading > a.experience-index-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  min-height: 46px;
  margin: 0;
  padding: 9px 14px;
  border: 1px solid #cc939d;
  border-radius: 999px;
  background: #fbf0f2;
  box-shadow: inset 0 0 0 1px currentColor;
  color: #914e5d;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  text-decoration: none;
}
.home-profile .page__content .experience-section-heading > a.experience-index-link:hover {
  color: #914e5d;
  background: #f8e8ec;
  text-decoration: none;
}
.home-profile .page__content .experience-section-heading > a.experience-index-link:focus-visible {
  outline: 3px solid #914e5d;
  outline-offset: 3px;
}
.home-profile .page__content .experience-card:hover {
  border-color: var(--memory-border);
  box-shadow: 0 4px 14px rgba(35, 42, 52, .06);
}
@media (max-width: 640px) {
  .home-profile .page__content .experience-section-heading h1 { font-size: 24px; }
  .home-profile .page__content .experience-section-heading > a.experience-index-link { font-size: 18px; min-height: 44px; padding: 8px 12px; }
}
@media (max-width: 360px) {
  .home-profile .page__content .experience-section-heading { gap: 8px; }
  .home-profile .page__content .experience-section-heading h1 { font-size: 22px; }
  .home-profile .page__content .experience-section-heading > a.experience-index-link { font-size: 16px; padding: 8px 10px; }
}

/* Memories: Kalam headings and Nunito Sans prose, with fonts served locally.
   Keep the handwriting in headings and use regular-weight text for reading. */
.memory-page {
  --memory-body-font: "Nunito Sans", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --memory-heading-font: "Kalam", "Segoe Print", "PingFang SC", "Microsoft YaHei", cursive;
  color: #30343b;
  background: #fff;
  font-family: var(--memory-body-font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
.memory-page #main {
  display: block;
  width: calc(100% - 56px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 0 64px;
}
.memory-page .page {
  float: none;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.memory-page .page__content {
  color: #30343b;
  font-family: var(--memory-body-font);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.75;
  overflow-wrap: break-word;
}
.memory-page .page__content h1,
.memory-page .page__content h2,
.memory-page .page__content h3,
.memory-page .page__content h4,
.memory-page .page__content h5,
.memory-page .page__content h6 {
  font-family: var(--memory-heading-font);
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0;
}
.memory-page .page__content p,
.memory-page .page__content a,
.memory-page .page__content dl,
.memory-page .page__content dt,
.memory-page .page__content dd {
  font-family: inherit;
}
.memory-page .page__content a {
  color: #30343b;
  text-decoration-color: var(--memory-border, #d9dce2);
  text-underline-offset: 4px;
}
.memory-page .page__content a:hover { color: var(--memory-link, #354358); }
.memory-page .page__content a:focus-visible {
  outline: 3px solid var(--memory-accent, #536277);
  outline-offset: 4px;
  border-radius: 3px;
}
.memory-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin: 0 0 22px;
  color: #626a75;
  font-size: 16px;
  line-height: 1.6;
}
.memory-page .memory-breadcrumb a { text-decoration: none; }
.memory-breadcrumb > span[aria-hidden] { color: #89909a; }
.memory-header {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 22px 26px;
  padding: 30px;
  border: 1px solid var(--memory-border);
  border-left: 5px solid var(--memory-accent);
  border-radius: 5px 16px 16px 5px;
  background: var(--memory-bg);
}
.memory-logo {
  display: block;
  width: 88px;
  height: 88px;
  margin: 3px 0 0;
  object-fit: contain;
}
.memory-header__copy { min-width: 0; }
.memory-page .memory-header h1 {
  margin: 0;
  padding: 0;
  border: 0;
  color: #30343b;
  font-size: clamp(25px, 3vw, 32px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
}
.memory-page .memory-date { margin: 8px 0 5px; color: #59616b; font-size: 16px; line-height: 1.5; }
.memory-page .memory-role { margin: 0; color: #30343b; font-size: 17px; font-weight: 600; line-height: 1.55; }
.memory-page .memory-place {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 9px 0 0;
  color: #59616b;
  font-size: 16px;
}
.memory-status { color: var(--memory-link); font-size: 16px; font-weight: 700; }
.memory-status::before { content: "·"; margin-right: 10px; }
.memory-page .memory-lead {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--memory-border);
  color: #30343b;
  font-size: 18px;
  line-height: 1.75;
}
.memory-columns { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 48px; margin-top: 36px; }
.memory-story, .memory-aside { min-width: 0; }
.memory-section + .memory-section { margin-top: 30px; }
.memory-page .memory-section h2,
.memory-page .memory-related > h2 {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: #30343b;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.45;
}
.memory-page .memory-section p { margin: 0 0 16px; color: #30343b; font-size: 18px; line-height: 1.8; }
.memory-page .memory-section p:last-child { margin-bottom: 0; }
.memory-facts { padding: 22px; border: 1px solid var(--memory-border); border-radius: 12px; background: var(--memory-bg); }
.memory-page .memory-aside h2 { margin: 0 0 16px; padding: 0; border: 0; color: #30343b; font-size: 19px; line-height: 1.4; }
.memory-facts dl { margin: 0; font-size: 16px; }
.memory-facts dl > div + div { margin-top: 16px; }
.memory-facts dt { margin: 0 0 3px; color: #59616b; font-size: 16px; font-weight: 400; line-height: 1.5; }
.memory-facts dd { margin: 0; color: #30343b; font-size: 17px; font-weight: 600; line-height: 1.6; }
.memory-resources { margin-top: 26px; padding: 0 2px; }
.memory-resources a { display: block; width: fit-content; margin: 9px 0; font-size: 16px; line-height: 1.6; }
.memory-related { margin-top: 40px; padding-top: 28px; border-top: 1px solid #e7e8eb; }
.memory-work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.memory-work { padding: 22px; border: 1px solid #e4e7ec; border-radius: 12px; }
.memory-page .memory-work h3 { margin: 0 0 12px; padding: 0; font-size: 21px; font-weight: 700; line-height: 1.5; }
.memory-page .memory-work h3 a { text-decoration: none; }
.memory-page .memory-work p { margin: 0; color: #30343b; font-size: 18px; line-height: 1.75; }
.memory-work__links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px 13px; margin-top: 15px; font-size: 16px; line-height: 1.6; }
.memory-work__links > span { color: #59616b; }
.memory-work__links a { font-weight: 600; }
.memory-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 28px; margin-top: 42px; padding-top: 22px; border-top: 1px solid #e7e8eb; font-size: 16px; font-weight: 600; }
.memory-page .memory-footer a { text-decoration: none; }

/* The index is a compact set of chapter cards with the same color mapping. */
.memory-index__header { margin: 0 0 28px; }
.memory-page .memory-index__header h1 { margin: 0 0 12px; padding: 0; border: 0; color: #30343b; font-size: 38px; line-height: 1.3; }
.memory-page .memory-index__header p { max-width: 760px; margin: 0; color: #30343b; font-size: 18px; line-height: 1.75; }
.memory-index__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.memory-index-card {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-content: start;
  gap: 17px 20px;
  padding: 24px;
  border: 1px solid var(--memory-border);
  border-left: 4px solid var(--memory-accent);
  border-radius: 5px 14px 14px 5px;
  background: var(--memory-bg);
  transition: box-shadow 160ms ease;
}
.memory-index-card:hover { box-shadow: 0 6px 20px rgb(35 42 52 / 7%); }
.memory-index-card > div { min-width: 0; }
.memory-index-card > img { display: block; width: 68px; height: 68px; margin: 0; object-fit: contain; }
.memory-page .memory-index-card h2 { margin: 0 0 6px; padding: 0; border: 0; color: #30343b; font-size: 24px; line-height: 1.4; }
.memory-page .memory-index-card h2 a { text-decoration: none; }
.memory-index-card h2 a::after { content: ""; position: absolute; inset: 0; border-radius: 5px 14px 14px 5px; }
.memory-page .memory-index-card h2 a:focus-visible { outline: none; }
.memory-page .memory-index-card h2 a:focus-visible::after { outline: 3px solid var(--memory-accent); outline-offset: 3px; }
.memory-page .memory-index-card__date { margin: 0 0 5px; color: #59616b; font-size: 16px; line-height: 1.5; }
.memory-page .memory-index-card__role { margin: 0; color: #30343b; font-size: 17px; font-weight: 600; line-height: 1.55; }
.memory-page .memory-index-card__summary { grid-column: 1 / -1; margin: 0; color: #30343b; font-size: 18px; line-height: 1.7; }
.memory-index-card__more { grid-column: 1 / -1; color: var(--memory-link); font-size: 16px; font-weight: 600; line-height: 1.6; }

@media (max-width: 820px) {
  .memory-columns { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .memory-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
  .memory-resources { margin: 0; }
  .memory-work-grid, .memory-index__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 540px) {
  .memory-page #main { width: calc(100% - 32px); padding-top: 22px; padding-bottom: 42px; }
  .memory-breadcrumb { font-size: 16px; margin-bottom: 18px; }
  .memory-header { grid-template-columns: 62px minmax(0, 1fr); gap: 18px 16px; padding: 20px 18px; }
  .memory-logo { width: 62px; height: 62px; }
  .memory-page .memory-header h1 { font-size: 27px; }
  .memory-page .memory-date { font-size: 16px; }
  .memory-page .memory-role { font-size: 17px; }
  .memory-page .memory-place { font-size: 16px; }
  .memory-page .memory-lead { padding-top: 16px; }
  .memory-aside { grid-template-columns: minmax(0, 1fr); }
  .memory-facts, .memory-work { padding: 20px; }
  .memory-page .memory-section h2, .memory-page .memory-related > h2 { font-size: 22px; }
  .memory-page .memory-index__header h1 { font-size: 38px; }
  .memory-index-card { grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding: 20px 18px; }
  .memory-index-card > img { width: 56px; height: 56px; }
  .memory-page .memory-index-card h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { .memory-index-card { transition: none; } }
