:root {
  --ground: #f5f5f7;
  --surface: #ffffff;
  --hover: #fbfbfd;
  --text: #1d1d1f;
  --body: #424245;
  --muted: #6e6e73;
  --hairline: rgba(0, 0, 0, 0.07);
  --accent: #0071e3;
  --panel-radius: 22px;
  --panel-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 14px 40px rgba(0, 0, 0, 0.05);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-optical-sizing: auto;
  color: var(--text);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 0;
  background: var(--ground);
  color: var(--body);
}

a { color: var(--accent); }

.legal-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 245, 247, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}

.legal-nav-inner {
  width: min(100%, 1080px);
  min-height: 56px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legal-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.legal-brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.legal-back {
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
}

.legal-back:active { transform: scale(0.98); }

.legal-main {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: clamp(42px, 7vw, 72px) 22px max(64px, env(safe-area-inset-bottom));
}

.legal-eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(32px, 7vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.legal-lede {
  margin: 18px 0 0;
  max-width: 640px;
  color: var(--body);
  font-size: clamp(16px, 2.6vw, 18px);
  line-height: 1.85;
}

.legal-meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.legal-toc {
  margin: 34px 0 0;
  padding: 6px 0;
  overflow: hidden;
  list-style: none;
  background: var(--surface);
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow);
}

.legal-toc li + li { border-top: 1px solid var(--hairline); }

.legal-toc a {
  min-height: 48px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
}

.legal-toc a::after { content: "›"; color: #86868b; font-size: 20px; }
.legal-toc a:hover { background: var(--hover); }

.legal-body { margin-top: clamp(42px, 7vw, 64px); }

.legal-section {
  padding: 0 0 clamp(34px, 6vw, 52px);
  scroll-margin-top: 78px;
}

.legal-section + .legal-section {
  padding-top: clamp(34px, 6vw, 52px);
  border-top: 1px solid var(--hairline);
}

h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: clamp(21px, 4vw, 27px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h3 {
  margin: 26px 0 8px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

p, li {
  font-size: 16px;
  line-height: 1.9;
}

p { margin: 0 0 14px; }
ul { margin: 10px 0 0; padding-left: 1.3em; }
li + li { margin-top: 8px; }

.legal-note {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  color: var(--body);
}

.legal-footer {
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 680px) {
  .legal-nav-inner {
    min-height: calc(54px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 14px 0;
  }

  .legal-brand span {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .legal-main {
    padding: 34px 16px max(48px, env(safe-area-inset-bottom));
  }

  .legal-toc { border-radius: 18px; }
  .legal-toc a { padding-inline: 16px; }
  p, li { font-size: 15.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .legal-back { transition: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .legal-nav { background: var(--ground); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  .legal-nav { border-bottom-color: rgba(0, 0, 0, 0.45); }
  .legal-section + .legal-section { border-top-color: rgba(0, 0, 0, 0.45); }
}
