:root {
  --ink: #17342f;
  --ink-2: #21483f;
  --cream: #f1ecdf;
  --paper: #faf8f1;
  --white: #fffdf8;
  --red: #c94636;
  --gold: #c2a76e;
  --muted: #6e766f;
  --line: rgba(23, 52, 47, 0.18);
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans: "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 24px 70px rgba(15, 35, 31, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

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

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 0 5vw;
  color: var(--cream);
  background: rgba(23, 52, 47, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-mark {
  display: flex;
  align-items: end;
  gap: 3px;
  width: 25px;
  height: 25px;
  padding: 5px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.brand-mark i {
  display: block;
  width: 3px;
  background: currentColor;
}

.brand-mark i:nth-child(1) {
  height: 6px;
}

.brand-mark i:nth-child(2) {
  height: 13px;
}

.brand-mark i:nth-child(3) {
  height: 9px;
}

.site-header nav {
  display: flex;
  gap: 34px;
  font-size: 13px;
  font-weight: 600;
}

.site-header nav a {
  opacity: 0.72;
  transition: opacity 180ms ease;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  opacity: 1;
}

.github-link {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  padding: 9px 15px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

.github-link svg {
  width: 16px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.72fr);
  min-height: 690px;
  color: var(--cream);
  background: var(--ink);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 9vw 7vw 9vw 9vw;
}

.hero h1 {
  max-width: 900px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(48px, 5.7vw, 88px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.24;
}

.hero-copy > p {
  max-width: 720px;
  margin: 34px 0 38px;
  color: rgba(241, 236, 223, 0.7);
  font-size: 17px;
  line-height: 1.9;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 7px;
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--red);
}

.primary-action svg {
  width: 17px;
}

.hero-note {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 58px 48px 52px;
  color: var(--ink);
  background: var(--paper);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.note-heading {
  display: flex;
  justify-content: space-between;
  padding-bottom: 18px;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  border-bottom: 1px solid var(--line);
}

.hero-note blockquote {
  position: relative;
  margin: 54px 0;
  padding-top: 48px;
  font-family: var(--serif);
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 600;
  line-height: 1.75;
}

.hero-note blockquote::before {
  position: absolute;
  top: -10px;
  left: 0;
  color: var(--red);
  content: "“";
  font-family: Georgia, serif;
  font-size: 80px;
  font-weight: 400;
  line-height: 1;
}

.hero-note strong {
  color: var(--red);
  font-weight: 700;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.hero-stats div {
  display: flex;
  flex-direction: column;
}

.hero-stats strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.2;
}

.hero-stats span {
  color: var(--muted);
  font-size: 11px;
}

.map-section,
.library-section,
.method-section {
  padding: 110px max(5vw, calc((100vw - 1360px) / 2));
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 56px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.section-heading > div {
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.section-heading span,
.section-number {
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.section-heading h2,
.method-section h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 55px);
  line-height: 1.2;
}

.section-heading p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.axis-list {
  border-top: 1px solid var(--ink);
}

.axis-card {
  display: grid;
  grid-template-columns: 70px 240px 1fr auto;
  gap: 30px;
  align-items: center;
  min-height: 130px;
  padding: 24px 8px;
  border-bottom: 1px solid var(--line);
  transition: padding 180ms ease, background 180ms ease;
}

.axis-card:hover {
  padding-right: 22px;
  padding-left: 22px;
  background: rgba(255, 253, 248, 0.48);
}

.axis-index {
  color: var(--red);
  font-family: var(--serif);
  font-size: 20px;
}

.axis-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.4;
}

.axis-card p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.axis-methods {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  max-width: 370px;
}

.axis-methods button {
  padding: 6px 10px;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  transition: color 160ms ease, border-color 160ms ease;
}

.axis-methods button:hover {
  color: var(--red);
  border-color: var(--red);
}

.library-section {
  background: var(--paper);
}

.library-controls {
  position: sticky;
  top: 76px;
  z-index: 10;
  display: grid;
  gap: 17px;
  padding: 18px 0;
  background: rgba(250, 248, 241, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.search-control {
  display: flex;
  align-items: center;
  gap: 13px;
  max-width: 790px;
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid var(--line);
}

.search-control:focus-within {
  border-color: var(--red);
  outline: 2px solid rgba(201, 70, 54, 0.1);
}

.search-control svg {
  flex: 0 0 auto;
  width: 19px;
  color: var(--red);
}

.search-control input {
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 14px;
}

.search-control input::placeholder {
  color: #92968f;
}

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

.filter-button {
  padding: 7px 13px;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.filter-button:hover,
.filter-button.active {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
}

.results-line {
  display: flex;
  justify-content: space-between;
  margin: 25px 0;
  color: var(--muted);
  font-size: 12px;
}

.results-line strong {
  color: var(--red);
}

.results-line button {
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  font-size: 12px;
}

.paper-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.paper-card {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--line);
  transition: color 200ms ease, background 200ms ease, transform 200ms ease;
}

.paper-card:hover {
  color: var(--cream);
  background: var(--ink);
  transform: translateY(-4px);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.paper-card:hover .card-meta,
.paper-card:hover .paper-question,
.paper-card:hover .keyword-list span {
  color: rgba(241, 236, 223, 0.7);
}

.paper-card h3 {
  margin: 28px 0 8px;
  font-family: var(--serif);
  font-size: 31px;
  line-height: 1.1;
}

.paper-title {
  min-height: 48px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
}

.paper-question {
  margin: 28px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.paper-answer {
  display: -webkit-box;
  margin: 0 0 28px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.8;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-list span {
  padding: 4px 8px;
  color: var(--muted);
  background: rgba(23, 52, 47, 0.05);
  border-radius: 3px;
  font-size: 10px;
}

.paper-card:hover .keyword-list span {
  background: rgba(255, 255, 255, 0.08);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.paper-card:hover .card-footer {
  border-color: rgba(255, 255, 255, 0.14);
}

.card-footer span {
  font-size: 11px;
  font-weight: 700;
}

.open-paper {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  color: var(--red);
  cursor: pointer;
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 700;
}

.open-paper svg {
  width: 15px;
}

.empty-state {
  padding: 90px 20px;
  text-align: center;
  border: 1px solid var(--line);
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.compare-section {
  padding: 110px max(5vw, calc((100vw - 1360px) / 2));
  color: var(--cream);
  background: var(--ink);
}

.section-heading.light {
  border-color: rgba(255, 255, 255, 0.18);
}

.section-heading.light p {
  color: rgba(241, 236, 223, 0.62);
}

.table-shell {
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}

table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

th,
td {
  padding: 18px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

th {
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

td {
  color: rgba(241, 236, 223, 0.72);
  font-size: 12px;
  line-height: 1.65;
}

td:first-child {
  color: var(--cream);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
}

td:nth-child(2) {
  color: var(--red);
  font-weight: 700;
}

td a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--cream);
  border-bottom: 1px solid var(--red);
}

.method-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 12vw;
  align-items: start;
}

.method-section h2 {
  margin-top: 12px;
}

.method-copy {
  padding-top: 23px;
  font-family: var(--serif);
  font-size: 17px;
}

.method-copy p {
  margin: 0 0 25px;
}

.method-copy .source-note {
  padding-top: 22px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 30px;
  min-height: 130px;
  padding: 30px 5vw;
  color: rgba(241, 236, 223, 0.58);
  background: #102822;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
}

footer .brand {
  color: var(--cream);
}

footer p {
  text-align: center;
}

footer > span {
  justify-self: end;
}

.paper-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  box-shadow: var(--shadow);
}

.paper-dialog::backdrop {
  background: rgba(8, 27, 23, 0.82);
  backdrop-filter: blur(5px);
}

.dialog-inner {
  min-height: 100%;
}

.dialog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 25px;
  padding: 34px 42px 28px;
  color: var(--cream);
  background: var(--ink);
}

.dialog-meta {
  margin-bottom: 9px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dialog-header h2 {
  max-width: 790px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(25px, 4vw, 40px);
  line-height: 1.35;
}

.dialog-close {
  display: grid;
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  padding: 9px;
  color: var(--cream);
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  place-items: center;
}

.dialog-close svg {
  width: 18px;
}

.dialog-content {
  display: grid;
  gap: 38px;
  padding: 42px;
}

.dialog-content section {
  min-width: 0;
}

.dialog-content h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 19px;
}

.dialog-content p {
  margin: 0;
  color: #4d5f59;
  font-size: 14px;
  line-height: 1.9;
}

.summary-block,
.report-block {
  padding: 28px;
  border-left: 4px solid var(--red);
}

.summary-block {
  background: var(--white);
}

.summary-block span,
.report-block span {
  display: block;
  margin-bottom: 12px;
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.summary-block p,
.report-block p {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
}

.detail-grid section {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.dialog-content ol,
.dialog-content ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 25px;
  color: #4d5f59;
  font-size: 14px;
  line-height: 1.8;
}

.dialog-content li::marker {
  color: var(--red);
  font-weight: 700;
}

.report-block {
  color: var(--cream);
  background: var(--ink);
}

.report-block p {
  color: var(--cream);
}

.dialog-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.dialog-footer a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid currentColor;
}

.dialog-footer a svg {
  width: 15px;
}

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

  .hero-copy {
    min-height: 600px;
    padding: 90px 8vw;
  }

  .hero-note {
    min-height: 520px;
    padding: 50px 8vw;
    border-left: 0;
  }

  .paper-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .axis-card {
    grid-template-columns: 55px 210px 1fr;
  }

  .axis-methods {
    grid-column: 2 / -1;
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr auto;
    min-height: 66px;
    padding: 0 20px;
  }

  .site-header nav {
    display: none;
  }

  .github-link {
    padding: 7px 11px;
  }

  .brand > span:last-child {
    font-size: 10px;
  }

  .hero-copy {
    min-height: 520px;
    padding: 70px 24px;
  }

  .hero h1 {
    font-size: clamp(39px, 12vw, 58px);
  }

  .hero-copy > p {
    margin: 28px 0;
    font-size: 15px;
  }

  .hero-note {
    min-height: auto;
    padding: 42px 24px;
  }

  .hero-note blockquote {
    margin: 45px 0;
    font-size: 23px;
  }

  .map-section,
  .library-section,
  .compare-section,
  .method-section {
    padding: 76px 20px;
  }

  .section-heading {
    display: block;
    margin-bottom: 38px;
  }

  .section-heading p {
    margin-top: 14px;
    text-align: left;
  }

  .axis-card {
    grid-template-columns: 42px 1fr;
    gap: 15px;
    padding: 24px 0;
  }

  .axis-card p,
  .axis-methods {
    grid-column: 2;
  }

  .axis-card:hover {
    padding-right: 0;
    padding-left: 0;
    background: transparent;
  }

  .library-controls {
    top: 66px;
  }

  .search-control {
    padding: 12px 14px;
  }

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

  .paper-card {
    min-height: 390px;
  }

  .method-section {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  footer {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  footer p {
    text-align: left;
  }

  footer > span {
    justify-self: start;
  }

  .paper-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
  }

  .dialog-header {
    padding: 26px 20px 22px;
  }

  .dialog-content {
    gap: 30px;
    padding: 28px 20px 45px;
  }

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

  .summary-block,
  .report-block {
    padding: 22px 20px;
  }

  .summary-block p,
  .report-block p {
    font-size: 16px;
  }

  .dialog-footer {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
