:root {
  --paper: #f5efe3;
  --paper-deep: #e9decb;
  --ink: #211d1b;
  --muted: #6e625d;
  --berry: #8a344d;
  --berry-dark: #5f2337;
  --sage: #66785f;
  --line: #cbbca8;
  --focus: #1f5f8b;
  --measure: 72rem;
  --reading: 44rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: max(16px, 1rem);
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
.site-name {
  font-family: STSong, SimSun, "Songti SC", "Noto Serif CJK SC", serif;
  font-weight: 700;
  line-height: 1.18;
  text-wrap: balance;
}

a {
  color: var(--berry-dark);
  text-decoration-color: color-mix(in srgb, var(--berry) 55%, transparent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--berry);
  text-decoration-color: currentColor;
}

button,
summary,
a {
  touch-action: manipulation;
}

:focus-visible {
  border-radius: 0.15rem;
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.masthead {
  width: min(calc(100% - 2rem), var(--measure));
  margin-inline: auto;
  padding-block: 1.4rem 1rem;
  border-top: 0.35rem solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.site-name {
  display: inline-block;
  color: var(--ink);
  font-size: clamp(2rem, 6vw, 4.5rem);
  letter-spacing: 0.08em;
  text-decoration: none;
}

.masthead > p {
  max-width: 38rem;
  margin: 0.25rem 0 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.nav-disclosure summary {
  display: none;
  font-weight: 700;
}

.top-navigation ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-navigation a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.top-navigation a[aria-current="page"],
.top-navigation a.current-section {
  border-bottom-color: var(--berry);
  color: var(--berry-dark);
}

.breadcrumbs {
  width: min(calc(100% - 2rem), var(--measure));
  margin: 0.75rem auto 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li:not(:last-child)::after {
  margin-left: 0.35rem;
  color: var(--line);
  content: "／";
}

main {
  width: min(calc(100% - 2rem), var(--measure));
  margin-inline: auto;
}

.page-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 2rem;
  padding: clamp(3.5rem, 9vw, 7.5rem) 0 clamp(2.8rem, 7vw, 5rem);
  border-bottom: 1px solid var(--ink);
}

.eyebrow,
.page-number {
  margin: 0;
  color: var(--berry-dark);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-number {
  grid-column: 2;
  grid-row: 1;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.page-intro h1 {
  grid-column: 1 / -1;
  max-width: 18ch;
  margin: 0.8rem 0 1.3rem;
  font-size: clamp(2.65rem, 8vw, 6.5rem);
  letter-spacing: -0.035em;
}

.page-intro .lead {
  grid-column: 1 / -1;
  max-width: var(--reading);
  margin: 0;
  color: var(--muted);
  font-family: STSong, SimSun, "Songti SC", "Noto Serif CJK SC", serif;
  font-size: clamp(1.1rem, 2.3vw, 1.45rem);
}

.label-legend {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.label-legend h2 {
  flex: none;
  margin: 0;
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.label-legend p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
}

.content-label {
  display: inline-flex;
  min-height: 1.85rem;
  align-items: center;
  padding: 0.1rem 0.6rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.content-label--facts {
  color: #596a53;
}

.content-label--analysis {
  color: var(--berry-dark);
}

.content-label--original {
  color: #5c4a7b;
}

.content-label--safety {
  color: var(--focus);
}

.editorial-page {
  counter-reset: editorial-section;
}

.content-section {
  counter-increment: editorial-section;
  display: grid;
  grid-template-columns: minmax(12rem, 0.8fr) minmax(0, 2fr);
  gap: 0 3.5rem;
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  border-bottom: 1px solid var(--line);
}

.content-section::before {
  grid-column: 1;
  margin-bottom: 0.75rem;
  color: var(--muted);
  content: counter(editorial-section, decimal-leading-zero);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
}

.content-section > header {
  grid-column: 1;
}

.content-section > header h2 {
  margin: 0.9rem 0 1.5rem;
  font-size: clamp(1.8rem, 4vw, 3.15rem);
}

.content-section > :not(header) {
  grid-column: 2;
}

.content-section > p,
.content-section > ul,
.entity-card > p,
.entity-card > ul,
.rating-card > p {
  width: min(100%, var(--reading));
}

.content-section > p {
  margin: 0 0 1.25rem;
  font-family: STSong, SimSun, "Songti SC", "Noto Serif CJK SC", serif;
  font-size: 1.08rem;
}

.content-section > ul,
.section-links {
  margin-top: 0.5rem;
  padding-left: 1.35rem;
}

.section-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.5rem;
  list-style: "→  ";
}

.entity-cards,
.media-items,
.rating-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 2.25rem 1.5rem;
  width: 100%;
  margin-top: 2rem;
}

.entity-card,
.rating-card {
  padding-top: 1.1rem;
  border-top: 3px solid var(--ink);
}

.entity-card:nth-child(even),
.rating-card:nth-child(even) {
  border-top-color: var(--berry);
}

.entity-card h3,
.rating-card h3 {
  margin: 0.45rem 0 0.9rem;
  font-size: 1.55rem;
}

.entity-card ul {
  padding-left: 1.25rem;
}

.rating-cards {
  grid-template-columns: 1fr;
  gap: 3.5rem;
}

.rating-card {
  display: grid;
  grid-template-columns: minmax(12rem, 0.6fr) minmax(0, 1.6fr);
  gap: 1.5rem 2rem;
}

.rating-card > header {
  grid-column: 1;
}

.rating-card > header p {
  margin: 0.2rem 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.rating-card .rating-total {
  margin: 0.8rem 0;
  color: var(--ink);
  font-size: 1rem;
}

.rating-card .table-scroll {
  grid-column: 2;
}

.rating-card .source-notes,
.rating-card .rating-basis {
  grid-column: 1 / -1;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

caption {
  padding-bottom: 0.6rem;
  color: var(--muted);
  text-align: left;
}

th,
td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th {
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

tbody td:nth-child(2) {
  color: var(--berry-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 750;
}

.diagram {
  margin: 2rem 0 0;
  padding: 1.5rem;
  border-block: 1px solid var(--ink);
  background: linear-gradient(110deg, transparent 0 62%, color-mix(in srgb, var(--paper-deep) 65%, transparent) 62% 100%);
}

.diagram h3 {
  margin-top: 0;
}

.diagram ul,
.diagram ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.source-notes {
  width: min(100%, var(--reading));
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.source-notes h3 {
  margin: 0 0 0.5rem;
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

.source-list {
  margin: 0;
  padding-left: 1.3rem;
}

.source-list li {
  margin-block: 0.7rem;
  overflow-wrap: anywhere;
}

.source-scope,
.source-list time {
  display: block;
}

.image-card,
.motion-poster {
  margin: 0;
}

.image-card img,
.motion-poster__stage {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}

.image-card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

figcaption {
  max-width: var(--reading);
  padding-top: 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.motion-poster {
  width: 100%;
}

.motion-poster__stage {
  display: grid;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.motion-poster__stage > * {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.motion-poster__video {
  opacity: 0;
}

.motion-poster[data-motion-state="playing"] .motion-poster__video {
  opacity: 1;
}

.motion-poster__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  margin-top: 0.75rem;
}

.motion-poster__controls button {
  min-width: 9rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--berry-dark);
  background: transparent;
  color: var(--berry-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.motion-poster__controls button:hover {
  background: var(--berry-dark);
  color: var(--paper);
}

.motion-status {
  color: var(--muted);
  font-size: 0.82rem;
}

.related-reading {
  display: grid;
  grid-template-columns: minmax(12rem, 0.8fr) minmax(0, 2fr);
  gap: 3.5rem;
  padding: 3rem 0;
  border-bottom: 1px solid var(--ink);
}

.related-reading h2 {
  margin: 0;
}

.related-reading ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-reading a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
}

.site-footer {
  width: min(calc(100% - 2rem), var(--measure));
  margin: 4rem auto 0;
  padding: 1.5rem 0 3rem;
  border-top: 0.35rem solid var(--ink);
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer p {
  max-width: var(--reading);
}

.not-found {
  min-height: 55vh;
  padding: clamp(4rem, 12vw, 9rem) 0;
}

.not-found h1 {
  margin: 0;
  font-size: clamp(3rem, 9vw, 7rem);
}

@media (max-width: 900px) {
  .content-section,
  .related-reading,
  .rating-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .content-section::before,
  .content-section > header,
  .content-section > :not(header),
  .rating-card > header,
  .rating-card .table-scroll,
  .rating-card .source-notes,
  .rating-card .rating-basis {
    grid-column: 1;
  }

  .content-section > header h2 {
    max-width: 20ch;
  }

  .diagram ul,
  .diagram ol {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .masthead,
  .breadcrumbs,
  main,
  .site-footer {
    width: min(calc(100% - 1.25rem), var(--measure));
  }

  .nav-disclosure summary {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    border-block: 1px solid var(--line);
    cursor: pointer;
  }

  .top-navigation ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding-top: 0.4rem;
  }

  .top-navigation a {
    width: 100%;
    min-height: 2.75rem;
  }

  .page-intro {
    grid-template-columns: 1fr;
  }

  .page-number {
    grid-column: 1;
    grid-row: auto;
    margin-top: 0.4rem;
  }

  .page-intro h1,
  .page-intro .lead {
    grid-column: 1;
  }

  .label-legend {
    display: block;
  }

  .label-legend h2 {
    margin-bottom: 0.7rem;
  }

  .content-section {
    padding-block: 3rem;
  }

  .entity-cards,
  .media-items {
    grid-template-columns: 1fr;
  }

  .table-scroll,
  .source-notes,
  .source-list,
  .source-list li {
    max-width: 100%;
  }

  table {
    min-width: 38rem;
  }

  .motion-poster__controls button,
  .related-reading a,
  .top-navigation a,
  .nav-disclosure summary {
    min-height: 44px;
  }

  .section-links a,
  .breadcrumbs a,
  .source-list a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }

  .site-name,
  .site-footer a,
  .not-found a {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    vertical-align: middle;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #423b38;
    --line: #6e625d;
  }

  a,
  .content-label,
  .motion-poster__controls button {
    text-decoration-thickness: 0.14em;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .skip-link,
  .nav-disclosure,
  .motion-poster__controls,
  script {
    display: none !important;
  }

  .masthead,
  .content-section,
  .site-footer {
    border-color: #000;
  }

  .content-section,
  .rating-card,
  figure,
  table {
    break-inside: avoid;
  }

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