:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #090a0d;
  color: #f7f7f8;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -20%, rgba(255, 255, 255, 0.08), transparent 34rem),
    #090a0d;
}

.legal-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px clamp(18px, 3vw, 48px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(20, 21, 25, 0.9);
  backdrop-filter: blur(18px);
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
}

.legal-brand img {
  display: block;
  width: 132px;
  height: auto;
}

.legal-login {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: #fff;
  color: #111217;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.legal-login:hover {
  background: transparent;
  color: #fff;
  transform: translateY(-1px);
}

.legal-main {
  width: min(100% - 40px, 900px);
  margin: 0 auto;
  padding: clamp(56px, 8vw, 92px) 0 110px;
}

.legal-document {
  color: #dedee2;
  font-size: 16px;
  line-height: 1.92;
  overflow-wrap: anywhere;
}

.legal-document > :first-child {
  margin-top: 0;
}

.legal-title {
  margin: 0 0 24px;
  color: #fff;
  font-size: clamp(31px, 5vw, 46px);
  line-height: 1.18;
  letter-spacing: -0.045em;
}

.legal-date {
  margin: 6px 0;
  color: #a9a9b0;
  font-size: 14px;
  line-height: 1.65;
}

.legal-date + .legal-paragraph,
.legal-date + .legal-heading-1 {
  margin-top: 34px;
}

.legal-paragraph {
  margin: 0 0 18px;
  text-align: justify;
  text-justify: inter-ideograph;
}

.legal-heading-1 {
  margin: 58px 0 22px;
  padding-top: 2px;
  color: #fff;
  font-size: clamp(24px, 3.4vw, 30px);
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.legal-heading-2 {
  margin: 38px 0 17px;
  color: #fff;
  font-size: 21px;
  line-height: 1.45;
}

.legal-heading-3 {
  margin: 28px 0 13px;
  color: #fff;
  font-size: 17px;
  line-height: 1.55;
}

.legal-toc-item {
  position: relative;
  margin: 0 0 9px;
  padding-left: 20px;
  color: #f0f0f2;
}

.legal-toc-item::before {
  position: absolute;
  top: 0;
  left: 2px;
  content: "•";
  color: #fff;
}

.legal-loading,
.legal-error {
  color: #bdbdc2;
  text-align: center;
}

.legal-error {
  color: #fff;
}

html[data-theme="light"] {
  color-scheme: light;
  background: #f5f7fb;
  color: #182334;
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 50% -20%, rgba(62, 111, 169, 0.1), transparent 34rem),
    #f5f7fb;
}

html[data-theme="light"] .legal-header {
  border-bottom-color: rgba(20, 35, 55, 0.12);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 14px rgba(42, 64, 92, 0.05);
}

html[data-theme="light"] .legal-login {
  border-color: #182334;
  background: #182334;
  color: #ffffff;
}

html[data-theme="light"] .legal-login:hover {
  background: transparent;
  color: #182334;
}

html[data-theme="light"] .legal-document {
  color: #334155;
}

html[data-theme="light"] .legal-title,
html[data-theme="light"] .legal-heading-1,
html[data-theme="light"] .legal-heading-2,
html[data-theme="light"] .legal-heading-3,
html[data-theme="light"] .legal-toc-item,
html[data-theme="light"] .legal-toc-item::before,
html[data-theme="light"] .legal-error {
  color: #182334;
}

html[data-theme="light"] .legal-date,
html[data-theme="light"] .legal-loading {
  color: #68778b;
}

@media (max-width: 640px) {
  .legal-header {
    min-height: 60px;
    padding: 10px 16px;
  }

  .legal-brand img {
    width: 112px;
  }

  .legal-login {
    min-height: 34px;
    padding: 0 14px;
    font-size: 13px;
  }

  .legal-main {
    width: min(100% - 32px, 900px);
    padding-top: 42px;
  }

  .legal-document {
    font-size: 15px;
    line-height: 1.85;
  }

  .legal-paragraph {
    text-align: left;
  }

  .legal-heading-1 {
    margin-top: 44px;
  }

  .legal-heading-2 {
    margin-top: 32px;
  }
}
