:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #626871;
  --line: #dfe3e8;
  --paper: #ffffff;
  --canvas: #f6f7f9;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eaf1ff;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 16px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  width: 100%;
  height: 3px;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 40px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(223, 227, 232, 0.85);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}

.site-nav a {
  position: relative;
  padding: 6px 0;
  transition: color 180ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav a[aria-current="page"]::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  content: "";
  border-radius: 999px;
  background: var(--accent);
}

.legal-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 9vw, 124px) 40px clamp(62px, 7vw, 96px);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.11), transparent 58%),
    var(--paper);
}

.legal-hero::after {
  position: absolute;
  top: -160px;
  right: max(-180px, calc((100vw - 1280px) / 2 - 210px));
  width: 440px;
  height: 440px;
  content: "";
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 50%;
  box-shadow:
    0 0 0 56px rgba(37, 99, 235, 0.035),
    0 0 0 112px rgba(37, 99, 235, 0.025);
}

.legal-hero-inner {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  animation: enter 560ms ease both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 2px;
  background: var(--accent);
}

.legal-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 6.4vw, 78px);
  font-weight: 620;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.legal-hero .lead {
  max-width: 750px;
  margin: 24px 0 0;
  color: #4f5661;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.8;
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.document-meta span {
  display: inline-flex;
  gap: 8px;
}

.document-meta strong {
  color: var(--ink);
  font-weight: 620;
}

.document-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 780px);
  gap: clamp(46px, 7vw, 92px);
  align-items: start;
  width: min(1120px, calc(100% - 80px));
  margin: 0 auto;
  padding: clamp(64px, 8vw, 110px) 0 120px;
}

.document-toc {
  position: sticky;
  top: 96px;
  padding-top: 2px;
}

.document-toc > span {
  display: block;
  margin-bottom: 18px;
  color: #8a9098;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.document-toc ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.document-toc a {
  display: block;
  padding: 7px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  transition:
    color 160ms ease,
    transform 160ms ease;
}

.document-toc a:hover {
  color: var(--accent);
  transform: translateX(3px);
}

.legal-document {
  min-width: 0;
}

.legal-document section {
  padding: 0 0 42px;
  scroll-margin-top: 96px;
  animation: enter 520ms ease both;
}

.legal-document section + section {
  padding-top: 42px;
  border-top: 1px solid var(--line);
}

.legal-document section:nth-child(2) {
  animation-delay: 40ms;
}

.legal-document section:nth-child(3) {
  animation-delay: 80ms;
}

.legal-document h2 {
  margin: 0 0 18px;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 620;
  letter-spacing: -0.025em;
  line-height: 1.35;
}

.legal-document p {
  margin: 0;
  color: #454b54;
  text-align: justify;
  text-wrap: pretty;
}

.legal-document p + p {
  margin-top: 14px;
}

.legal-document a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.3);
  text-underline-offset: 4px;
}

.document-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.document-switch p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.document-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  color: var(--accent);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 8px;
  background: var(--paper);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.document-switch a:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.1);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 20px 40px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--paper);
  font-size: 13px;
}

.site-footer div {
  display: flex;
  gap: 20px;
}

.site-footer a:hover {
  color: var(--accent);
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(32, 33, 36, 0.1);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    color 180ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  color: var(--accent);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .site-header {
    min-height: 58px;
    padding: 0 20px;
  }

  .site-nav a:not([aria-current="page"]) {
    display: none;
  }

  .legal-hero {
    padding: 62px 24px 58px;
  }

  .legal-hero::after {
    top: -210px;
    right: -260px;
  }

  .legal-hero h1 {
    letter-spacing: -0.035em;
  }

  .document-meta {
    display: grid;
    gap: 6px;
  }

  .document-shell {
    display: block;
    width: min(100% - 48px, 780px);
    padding: 56px 0 88px;
  }

  .document-toc {
    position: static;
    margin-bottom: 52px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--line);
  }

  .document-toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
  }

  .document-toc a {
    padding: 6px 0;
  }

  .legal-document section {
    padding-bottom: 34px;
  }

  .legal-document section + section {
    padding-top: 34px;
  }

  .document-switch {
    align-items: flex-start;
    flex-direction: column;
  }

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

@media (max-width: 480px) {
  .site-nav {
    gap: 0;
  }

  .site-nav a[aria-current="page"] {
    max-width: 122px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .legal-hero {
    padding-right: 20px;
    padding-left: 20px;
  }

  .document-shell {
    width: calc(100% - 40px);
  }

  .document-toc ol {
    grid-template-columns: 1fr;
  }

  .legal-document p {
    text-align: left;
  }

  .document-switch a {
    width: 100%;
  }

  .site-footer div {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
  }
}

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

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