:root {
  --blue: #1f527a;
  --blue-2: #2d6c9d;
  --blue-soft: #eef6fb;
  --teal: #168a7a;
  --teal-soft: #e9f6f3;
  --red: #c9262a;
  --orange: #d97619;
  --ink: #101418;
  --muted: #5f6871;
  --line: #c8d8e4;
  --paper: #f7fafc;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(21, 55, 82, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 10px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.96);
  border-top: 8px solid var(--blue);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  color: var(--blue);
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

nav a {
  text-decoration: none;
}

nav a:hover {
  color: var(--blue);
}

.hero {
  min-height: auto;
  padding: clamp(16px, 2.8vw, 26px) clamp(18px, 5vw, 72px) 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: 4px solid var(--blue);
}

.conference-lockup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 10px;
  width: fit-content;
  margin: 14px 0 2px;
}

.conference-lockup img {
  height: 48px;
  width: auto;
  max-width: min(310px, 58vw);
  object-fit: contain;
}

.conference-year {
  color: var(--blue);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

h1 {
  margin: 0;
  font-size: clamp(44px, 7vw, 78px);
  line-height: 0.9;
  letter-spacing: 0;
}

.subtitle {
  margin: 12px 0 0;
  max-width: 900px;
  color: var(--blue);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 800;
  line-height: 1.1;
}

.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin: 16px 0 0;
  max-width: 1060px;
  color: var(--ink);
  font-size: clamp(15px, 1.7vw, 19px);
}

.authors span {
  white-space: nowrap;
}

.authors sup {
  position: relative;
  top: -0.1em;
  margin-left: 2px;
  color: var(--blue);
  font-size: 0.68em;
  font-weight: 900;
}

.corresponding-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.corresponding-note sup {
  color: var(--blue);
  font-weight: 900;
}

.affiliations {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(1120px, 100%);
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.affiliation-card {
  position: relative;
  display: grid;
  grid-template-rows: 42px auto;
  justify-items: center;
  align-items: center;
  gap: 8px;
  min-height: 112px;
  padding: 15px 14px 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-align: center;
}

.affiliation-card img,
.text-logo {
  width: 150px;
  max-width: 88%;
  height: 42px;
  object-fit: contain;
}

.affiliation-card img.tongji-logo {
  width: 190px;
  max-width: 96%;
}

.affiliation-card p {
  margin: 0;
  line-height: 1.25;
}

.aff-number {
  position: absolute;
  top: -10px;
  left: -10px;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 13px;
  font-weight: 900;
}

.text-logo {
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--blue);
  border-radius: 8px;
  color: var(--blue);
  font-weight: 900;
  letter-spacing: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  border: 2px solid var(--blue);
  border-radius: 8px;
  background: var(--white);
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.icon-code {
  mask-image: url("assets/icons/code-2.svg");
}

.icon-pdf {
  mask-image: url("assets/icons/file-text.svg");
}

.button:hover {
  background: var(--blue-soft);
}

.button.primary {
  background: var(--blue);
  color: var(--white);
}

.button.primary:hover {
  background: #173f60;
}

.hero-figure,
.wide-figure {
  margin: 0;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.hero-figure {
  width: min(820px, 100%);
}

.hero-figure figcaption {
  display: none;
}

.wide-figure {
  width: min(1030px, 100%);
}

.method-figure {
  margin: 22px auto 0;
  width: min(1120px, 100%);
}

.hero-figure img,
.wide-figure img {
  width: 100%;
}

figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.section {
  padding: clamp(42px, 7vw, 78px) clamp(18px, 5vw, 72px);
}

.band {
  background: var(--paper);
  border-block: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 auto 28px;
  width: min(1120px, 100%);
}

.section-heading span {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-weight: 900;
}

h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 20px;
  line-height: 1.2;
}

.logic-grid,
.method-grid,
.claims {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: min(1120px, 100%);
  margin: 0 auto 24px;
}

.logic-step,
.method-grid article,
.claims article {
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.logic-step:nth-child(2),
.claims article:nth-child(2) {
  border-color: rgba(201, 38, 42, 0.5);
}

.logic-step:nth-child(2) h3,
.claims article:nth-child(2) h3 {
  color: var(--red);
}

.logic-step:nth-child(3),
.claims article:nth-child(3),
.method-grid article:nth-child(3) {
  border-color: rgba(22, 138, 122, 0.5);
}

.logic-step:nth-child(3) h3,
.claims article:nth-child(3) h3,
.method-grid article:nth-child(3) h3 {
  color: var(--teal);
}

.formula {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px 8px;
  margin: 0 0 12px;
  padding: 12px;
  background: var(--blue-soft);
  border: 1px solid var(--blue);
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  text-align: center;
}

.condition-lead {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.formula-condition {
  flex-wrap: nowrap;
  font-size: 20px;
  white-space: nowrap;
}

.math-expression {
  white-space: nowrap;
}

.formula.red {
  background: #fff3f3;
  border-color: var(--red);
  color: var(--red);
}

.evidence-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1.4fr);
  gap: 18px;
  width: min(1280px, 100%);
  margin: 0 auto;
  align-items: stretch;
}

.evidence-pair figure,
.result-gallery figure {
  margin: 0;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.diagnosis-figure {
  display: flex;
  flex-direction: column;
}

.figure-media {
  display: grid;
  place-items: center;
  height: clamp(160px, 14vw, 190px);
}

.figure-media > img {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.scatter-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.scatter-pair > div {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 100%;
}

.scatter-pair img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}

.diagnosis-figure figcaption {
  margin-top: 7px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

@media (min-width: 1180px) {
  .diagnosis-figure:first-child figcaption {
    white-space: nowrap;
  }
}

.method-grid article:nth-child(1) {
  border-color: rgba(45, 108, 157, 0.55);
}

.method-grid article:nth-child(2) {
  border-color: rgba(201, 38, 42, 0.5);
}

.result-gallery {
  width: min(1240px, 100%);
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.result-gallery figure:first-child {
  grid-column: 1 / -1;
}

.result-gallery img {
  width: 100%;
}

.result-title {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 20px;
  line-height: 1.25;
  text-align: left;
}

.result-gallery figcaption {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}

.caption-label {
  display: inline-flex;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.caption-label.conclusion {
  background: var(--teal-soft);
  color: var(--teal);
}

.claims strong {
  display: block;
  min-height: 72px;
  margin-top: auto;
  color: var(--ink);
}

.claims article {
  display: flex;
  flex-direction: column;
}

.claims article > p {
  flex: 1;
  margin: 0 0 14px;
}

.citation {
  background: var(--paper);
}

.citation pre {
  width: min(1120px, 100%);
  margin: 0 auto 16px;
  padding: 20px;
  overflow-x: auto;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.copy-button {
  margin-left: calc((100% - min(1120px, 100%)) / 2);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 5vw, 72px);
  background: var(--ink);
  color: var(--white);
}

.site-footer div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.site-footer span,
.site-footer a {
  color: rgba(255, 255, 255, 0.7);
}

.zoomable {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(8, 17, 26, 0.88);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(1200px, 94vw);
  max-height: 88vh;
  background: var(--white);
}

.lightbox button {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 900px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .logic-grid,
  .method-grid,
  .claims,
  .affiliations,
  .evidence-pair,
  .result-gallery {
    grid-template-columns: 1fr;
  }

  .affiliation-card {
    grid-template-rows: 46px auto;
    min-height: 112px;
  }

  .affiliation-card img,
  .text-logo {
    width: 170px;
    max-width: 88%;
    height: 46px;
  }

  .result-gallery figure:first-child {
    grid-column: auto;
  }

  .scatter-pair {
    grid-template-columns: 1fr;
  }

  .figure-media,
  .figure-media > img,
  .scatter-pair img {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .scatter-pair > div {
    height: auto;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .claims strong {
    min-height: 0;
  }
}
