:root {
  color-scheme: light;
  --ink: #1d2329;
  --muted: #667085;
  --line: #d7dde5;
  --paper: #fffdf9;
  --canvas: #f5f7fb;
  --accent: #b42345;
  --accent-soft: #fff0f3;
  --nav: rgba(255, 253, 249, 0.88);
  --shadow: 0 18px 52px rgba(29, 35, 41, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(29, 35, 41, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(29, 35, 41, 0.03) 1px, transparent 1px),
    var(--canvas);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  line-height: 1.88;
}

a {
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 0 36px;
  border-bottom: 1px solid rgba(215, 221, 229, 0.86);
  background: var(--nav);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(180, 35, 69, 0.22);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: Georgia, serif;
  font-weight: 800;
}

.nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(215, 221, 229, 0.78);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  font-family: "Microsoft YaHei", sans-serif;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: #475467;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

body[data-current="privacy"] .nav a[data-nav="privacy"],
body[data-current="terms"] .nav a[data-nav="terms"] {
  background: var(--ink);
  color: #ffffff;
}

.layout {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 880px);
  gap: 34px;
  width: min(1240px, calc(100% - 48px));
  margin: 42px auto 72px;
  align-items: start;
}

.rail {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 124px);
  padding: 4px 0 4px 2px;
  overflow: auto;
  font-family: "Microsoft YaHei", sans-serif;
}

.rail-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.toc {
  display: grid;
  gap: 6px;
}

.toc a {
  display: block;
  padding: 8px 10px;
  border-left: 2px solid transparent;
  color: #475467;
  font-size: 13px;
  line-height: 1.45;
}

.toc a:hover {
  border-left-color: var(--accent);
  background: rgba(255, 255, 255, 0.58);
  color: var(--accent);
  text-decoration: none;
}

.paper {
  min-height: 72vh;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid rgba(215, 221, 229, 0.92);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.document-head {
  margin-bottom: 34px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.08;
  letter-spacing: 0;
}

.summary {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.8;
}

.document {
  font-size: 16px;
}

.document p,
.document li {
  margin: 0 0 14px;
  overflow-wrap: anywhere;
}

.document strong {
  color: #101828;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(180, 35, 69, 0.25);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

.document ol,
.document ul {
  margin: 0 0 16px 1.4em;
  padding: 0;
}

.document .doc-title {
  display: none;
}

.document .doc-date {
  margin-bottom: 6px;
  color: var(--muted);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

.document .doc-heading {
  margin: 34px 0 14px;
  padding-top: 22px;
  border-top: 1px solid rgba(215, 221, 229, 0.75);
  color: #101828;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.45;
}

.document .doc-subheading {
  margin-top: 22px;
  color: #29323d;
  font-weight: 700;
}

.loading,
.error {
  color: var(--muted);
  font-family: "Microsoft YaHei", sans-serif;
}

.backtop {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(180, 35, 69, 0.26);
  border-radius: 50%;
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 10px 28px rgba(29, 35, 41, 0.14);
  cursor: pointer;
  font-size: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.backtop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.backtop:hover {
  transform: translateY(-2px);
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px;
  }

  .nav {
    width: 100%;
  }

  .nav a {
    flex: 1;
    justify-content: center;
  }

  .layout {
    display: block;
    width: min(100% - 24px, 720px);
    margin-top: 18px;
  }

  .rail {
    position: static;
    max-height: none;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid rgba(215, 221, 229, 0.9);
    border-radius: 6px;
    background: rgba(255, 253, 249, 0.82);
  }

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

  .toc a {
    padding: 7px 8px;
  }

  .paper {
    padding: 24px 18px 32px;
  }

  .document {
    font-size: 15px;
  }

  .backtop {
    right: 14px;
    bottom: 14px;
  }
}

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

  .document-head {
    margin-bottom: 24px;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .topbar,
  .rail,
  .backtop {
    display: none;
  }

  .layout {
    display: block;
    width: 100%;
    margin: 0;
  }

  .paper {
    padding: 0;
    border: 0;
    box-shadow: none;
  }
}
