:root {
  color-scheme: light dark;
  --paper: #fff9f6;
  --surface: #fffefd;
  --tint: #fff3f1;
  --ink: #2a1722;
  --body: #47333d;
  --muted: #705664;
  --line: #ecdee4;
  --accent: #9b3159;
  --focus: #bb416e;
  --shadow: 0 18px 60px -40px #652a495c;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
}

* { box-sizing: border-box; }
html { scroll-padding-block-start: 24px; }
body.legal-page {
  margin: 0;
  color: var(--body);
  background: var(--paper) radial-gradient(ellipse 52rem 26rem at 65% 0%, #fbe0e5, transparent 95%) no-repeat;
  font: 16px/1.85 var(--sans);
  overflow-wrap: anywhere;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: .18em; }
:where(a, summary):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 4px;
}
.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1040px;
  margin: auto;
  padding: 16px clamp(16px, 4vw, 32px);
}
.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.legal-brand img {
  display: block;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.legal-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
.legal-back:hover { background: var(--tint); }
.legal-document,
.legal-index {
  margin: 8px auto 52px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(22px, 5.6vw, 60px);
}
.legal-document { width: min(calc(100% - 32px), 790px); }
.legal-index { width: min(calc(100% - 32px), 976px); }
:where(.legal-document, .legal-index) h1 {
  margin: 0 0 20px;
  color: var(--ink);
  font: 700 clamp(30px, 5vw, 44px)/1.2 var(--serif);
  letter-spacing: -.015em;
}
.legal-document h2 {
  margin: 34px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font: 700 clamp(20px, 3.2vw, 24px)/1.4 var(--sans);
}
.legal-document h3,
.legal-document h4 {
  margin: 23px 0 8px;
  color: var(--ink);
  font: 700 17px/1.5 var(--sans);
}
.legal-document p { margin: 0 0 14px; }
.legal-document :where(ul, ol) { padding-inline-start: 1.4em; }
.legal-document li + li { margin-top: 10px; }
.legal-document :where(strong, b) { color: var(--ink); }
.legal-document .document-date,
.legal-document .word-meta {
  color: var(--muted);
  font-size: 14px;
}
.legal-document .hint {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}
.legal-document .document-contents {
  margin: 18px 0 26px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.document-contents summary {
  display: list-item;
  padding: 10px 1px;
  color: var(--accent);
  font-weight: 650;
  cursor: pointer;
}
.document-contents ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
  margin: 0;
  padding: 0 0 10px;
  list-style: none;
}
.document-contents li + li { margin: 0; }
.document-contents a {
  display: block;
  min-height: 42px;
  padding: 7px 0;
  font-size: 14px;
}
.fields,
.signatures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}
.party,
.signature {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--tint);
}
.party p,
.signature p { margin: 0; }
.party p + p,
.signature p + p { margin-top: 4px; }
.party p:first-child,
.signature p:first-child { color: var(--ink); font-weight: 700; }
[data-entrust-field] { color: var(--accent); font-weight: 650; }
.legal-document table {
  width: 100%;
  margin: 18px 0 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-spacing: 0;
  border-radius: 14px;
  font-variant-numeric: tabular-nums;
}
.legal-document caption {
  padding-bottom: 8px;
  color: var(--ink);
  font-weight: 700;
  text-align: start;
}
.legal-document :where(th, td) {
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
  text-align: start;
}
.legal-document thead th { background: var(--tint); color: var(--ink); }
.legal-document thead th:first-child { border-start-start-radius: 13px; }
.legal-document thead th:last-child { border-start-end-radius: 13px; }
.legal-document tbody tr:last-child > * { border-bottom: 0; }
.legal-document tbody td { color: var(--accent); font-weight: 650; }
.legal-document img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}
.legal-index h1 { margin-bottom: 30px; }
.legal-directory {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.legal-directory section { min-width: 0; }
.legal-directory h2 {
  margin: 0;
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.legal-directory ul {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  list-style: none;
}
.legal-directory li + li { border-top: 1px solid var(--line); }
.legal-directory a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 12px;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.45;
  text-decoration: none;
}
.legal-directory a::after {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin-inline-end: 3px;
  transform: rotate(-45deg);
  border: solid var(--accent);
  border-width: 0 1.5px 1.5px 0;
  content: "";
}
.legal-directory a:hover { background: var(--tint); color: var(--accent); }
.legal-directory a:focus-visible { outline-offset: -3px; }

.legacy-copy {
  min-width: 0;
  font: inherit;
}
.legacy-copy :where(p, h1, h2, h3, h4) {
  margin-inline: 0 !important;
  text-align: start !important;
  text-indent: 0 !important;
}
.legacy-copy p {
  color: var(--body) !important;
  font-size: inherit !important;
  line-height: 1.85 !important;
}
.legacy-copy :is(h1, h2, h3, h4) {
  color: var(--ink) !important;
  line-height: 1.45 !important;
}
.legacy-copy :where(span, font, b, strong, i, em) {
  background-color: transparent !important;
  color: inherit !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
}
.legacy-copy a,
.legacy-copy a * { color: var(--accent) !important; }
.legacy-copy .word-spacer { display: none; }
.legacy-copy .word-meta {
  margin-bottom: 4px;
  color: var(--muted) !important;
  font-size: 14px !important;
}

@media (max-width: 680px) {
  .legal-directory { grid-template-columns: 1fr; gap: 20px; }
  .legal-document,
  .legal-index { margin-top: 4px; border-radius: 20px; }
}
@media (max-width: 480px) {
  .legal-header { padding-block: 10px; }
  .legal-document,
  .legal-index {
    width: calc(100% - 24px);
    padding: 20px 17px;
  }
  .fields,
  .signatures { grid-template-columns: 1fr; gap: 8px; }
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #21171e;
    --surface: #2c2028;
    --tint: #392630;
    --ink: #fff1f5;
    --body: #f0dce4;
    --muted: #cfb2bf;
    --line: #523845;
    --accent: #ffadc9;
    --focus: #ffc2d8;
    --shadow: none;
  }
  body.legal-page {
    background-image: radial-gradient(ellipse 50rem 25rem at 65% 0%, #432538, transparent 95%);
  }
}
@media print {
  :root {
    color-scheme: light;
    --ink: #171117;
    --body: #241b21;
    --muted: #53434b;
    --line: #d7ccd2;
    --tint: #f7f2f5;
    --surface: white;
    --accent: #6f2846;
  }
  body.legal-page { background: white; color: black; }
  .legal-header,
  .document-contents { display: none; }
  .legal-document { width: 100%; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .legal-document :where(h2, h3, h4) { break-after: avoid; }
  .legal-document :where(table, .fields, .signatures) { break-inside: avoid; }
}
