:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #29263a;
  background: #f7f6fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 28px;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 0, rgba(207, 70, 255, 0.09), transparent 28rem),
    linear-gradient(180deg, #f2effa 0, #f7f6fb 320px, #f7f6fb 100%);
}

a {
  color: inherit;
}

.legal-header {
  color: #fff;
  background:
    radial-gradient(circle at 82% -20%, rgba(255, 88, 139, 0.55), transparent 28rem),
    linear-gradient(135deg, #22183d 0%, #35204e 58%, #4a204f 100%);
  box-shadow: 0 12px 40px rgba(45, 30, 70, 0.13);
}

.legal-nav,
.legal-hero,
.legal-layout,
.legal-footer {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.legal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand,
.back-link {
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 11px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  transition: color 160ms ease;
}

.back-link::before {
  content: "←";
  font-size: 1.1rem;
}

.back-link:hover {
  color: #fff;
}

.legal-hero {
  padding: 48px 0 54px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #ffb4ca;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.hero-description {
  max-width: 650px;
  margin: 15px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.98rem;
  line-height: 1.75;
}

.legal-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: start;
  gap: 32px;
  padding: 38px 0 64px;
}

.legal-layout.no-toc {
  grid-template-columns: minmax(0, 1fr);
}

.legal-layout.no-toc .legal-card {
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
}

.legal-toc {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 20px;
  border: 1px solid #ebe7f2;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(43, 31, 68, 0.05);
  backdrop-filter: blur(14px);
}

.toc-title {
  margin: 0 0 13px;
  color: #81778f;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.toc-links {
  display: grid;
  gap: 3px;
}

.toc-links a {
  padding: 8px 10px;
  border-radius: 9px;
  color: #625b6e;
  font-size: 0.88rem;
  line-height: 1.45;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.toc-links a:hover,
.toc-links a.is-active {
  color: #aa245c;
  background: #fff0f5;
}

.legal-card {
  min-width: 0;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid #ebe7f2;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(43, 31, 68, 0.07);
}

.document-meta {
  display: inline-flex;
  align-items: center;
  margin: 0 0 30px;
  padding: 8px 13px;
  border-radius: 999px;
  color: #8c536d;
  background: #fff1f6;
  font-size: 0.82rem;
  font-weight: 600;
}

.legal-content {
  color: #514c5a;
  font-size: 1rem;
  line-height: 1.95;
  overflow-wrap: anywhere;
}

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

.legal-content h2 {
  position: relative;
  margin: 50px 0 18px;
  padding: 0 0 13px 18px;
  border-bottom: 1px solid #eeeaf3;
  color: #292536;
  font-size: clamp(1.18rem, 2.2vw, 1.42rem);
  line-height: 1.5;
}

.legal-content h2::before {
  position: absolute;
  top: 0.32em;
  bottom: calc(0.32em + 13px);
  left: 0;
  width: 4px;
  min-height: 20px;
  border-radius: 4px;
  background: linear-gradient(180deg, #ff476f, #bd42dd);
  content: "";
}

.legal-content h3 {
  margin: 32px 0 10px;
  color: #373141;
  font-size: 1.05rem;
  line-height: 1.65;
}

.legal-content p {
  margin: 12px 0;
}

.legal-content .list-item {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  margin: 9px 0;
}

.legal-content .list-marker {
  color: #c03267;
  font-weight: 650;
}

.legal-content .list-text {
  min-width: 0;
}

.legal-content a {
  color: #a52258;
  text-decoration: underline;
  text-decoration-color: rgba(165, 34, 88, 0.3);
  text-underline-offset: 3px;
}

.legal-content strong {
  color: #312b3a;
}

.intro-callout {
  margin: 0 0 34px;
  padding: 20px 22px;
  border: 1px solid #f2dbe5;
  border-radius: 15px;
  color: #665260;
  background: #fff8fa;
  line-height: 1.8;
}

.minor-grid {
  display: grid;
  gap: 14px;
  margin: 24px 0 30px;
}

.minor-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
  border: 1px solid #ece7f1;
  border-radius: 15px;
  background: #fbfafd;
}

.minor-number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #f34e78, #b23ed3);
  font-weight: 700;
}

.minor-item p {
  margin: 3px 0 0;
}

.contact-intro {
  max-width: 680px;
  margin: 0 0 28px;
  color: #625c69;
  line-height: 1.9;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 34px;
}

.contact-item {
  min-width: 0;
  padding: 20px;
  border: 1px solid #ece7f1;
  border-radius: 15px;
  background: #fbfafd;
}

.contact-item.is-wide {
  grid-column: 1 / -1;
}

.contact-label {
  display: block;
  margin-bottom: 7px;
  color: #91899a;
  font-size: 0.78rem;
  font-weight: 650;
}

.contact-value {
  color: #332e3b;
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.65;
  text-decoration: none;
}

.contact-value[href]:hover {
  color: #aa245c;
}

.notice-box {
  padding: 20px 22px;
  border-left: 4px solid #d74379;
  border-radius: 0 14px 14px 0;
  color: #675c64;
  background: #fff6f9;
  line-height: 1.85;
}

.notice-box strong {
  display: block;
  margin-bottom: 5px;
}

.legal-footer {
  padding: 0 0 36px;
  color: #888091;
  text-align: center;
  font-size: 0.8rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
  margin-bottom: 12px;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: #a52258;
}

.loading,
.error-message {
  padding: 34px 0;
  color: #888091;
  text-align: center;
}

@media (max-width: 860px) {
  .legal-layout {
    display: block;
  }

  .legal-toc {
    position: static;
    max-height: none;
    margin-bottom: 18px;
  }

  .toc-links {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .toc-links::-webkit-scrollbar {
    display: none;
  }

  .toc-links a {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 600px) {
  .legal-nav,
  .legal-hero,
  .legal-layout,
  .legal-footer {
    width: min(100% - 24px, 1160px);
  }

  .legal-nav {
    min-height: 64px;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .legal-hero {
    padding: 34px 0 39px;
  }

  .hero-description {
    font-size: 0.92rem;
  }

  .legal-layout {
    padding: 20px 0 42px;
  }

  .legal-toc {
    padding: 14px;
    border-radius: 14px;
  }

  .toc-title {
    margin: 0 0 8px 6px;
  }

  .legal-card {
    padding: 25px 20px 34px;
    border-radius: 18px;
  }

  .legal-content {
    font-size: 0.94rem;
    line-height: 1.88;
  }

  .legal-content h2 {
    margin-top: 40px;
    padding-left: 14px;
  }

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

  .contact-item.is-wide {
    grid-column: auto;
  }
}
