.legal-body {
  min-height: 100vh;
  color: #1d2128;
  background: #eeefec;
  color-scheme: light;
}

.legal-shell {
  width: min(860px, calc(100% - 48px));
  margin-inline: auto;
}

.legal-header {
  position: relative;
  z-index: 1;
  height: 82px;
}

.legal-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.legal-home {
  color: #3c4350;
  font-size: 14px;
}

.legal-main {
  padding: 34px 0 70px;
}

.legal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  margin-bottom: 18px;
  color: #3c4350;
  font-size: 13px;
}

.language-switch {
  display: none;
  align-items: center;
  gap: 8px;
}

.js .language-switch {
  display: flex;
}

.language-switch button {
  padding: 8px 4px;
  border: 0;
  color: #646b74;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.language-switch button[aria-pressed="true"] {
  color: #1d2128;
  font-weight: 600;
}

.language-switch button:focus-visible,
.legal-body a:focus-visible {
  outline-color: #15171c;
}

.legal-document {
  padding: 56px 64px;
  border-radius: 24px;
  color: #1d2128;
  background: #fbfbf8;
  box-shadow: 0 12px 40px rgba(34, 42, 48, 0.06);
}

.legal-en {
  margin-top: 28px;
}

.js .legal-en,
.js.show-en .legal-zh {
  display: none;
}

.js.show-en .legal-en {
  display: block;
  margin-top: 0;
}

.legal-updated {
  color: #69717b;
  font-size: 12px;
}

.legal-document h1 {
  margin-top: 15px;
  font-size: clamp(34px, 5vw, 46px);
  line-height: 1.25;
}

.legal-intro {
  margin-top: 20px;
  color: #3c4350;
  font-size: 17px;
  line-height: 1.85;
}

.legal-document section {
  margin-top: 36px;
  padding-top: 30px;
  border-top: 1px solid #e4e5e1;
}

.legal-document section h2 {
  font-size: 19px;
  line-height: 1.5;
  letter-spacing: -0.015em;
}

.legal-document section p {
  margin-top: 12px;
  color: #3c4350;
  font-size: 15px;
  line-height: 1.95;
  overflow-wrap: anywhere;
}

.legal-document section a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 40px;
  border-top: 1px solid #d6d9d5;
  color: #3c4350;
  font-size: 13px;
}

.legal-footer > a {
  color: #1d2128;
  font-weight: 600;
}

.legal-footer nav {
  display: flex;
  gap: 24px;
}

.error-main {
  display: grid;
  place-items: center;
  min-height: calc(100svh - 82px);
  padding: 30px 0 90px;
}

.error-card {
  width: min(620px, 100%);
  padding: 54px;
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 32px;
  background: var(--glass-warm);
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
}

.error-card h1 {
  margin-top: 16px;
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1.25;
}

.error-card > p:nth-of-type(2) {
  margin-top: 18px;
  color: var(--muted);
  font-size: 17px;
}

.error-home {
  display: inline-flex;
  margin-top: 28px;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  font-size: 14px;
  font-weight: 500;
}

body[data-period="night"] .error-home {
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 600px) {
  .legal-shell {
    width: calc(100% - 32px);
  }

  .legal-header {
    height: 68px;
  }

  .legal-main {
    padding-top: 20px;
  }

  .legal-document {
    padding: 32px 24px;
    border-radius: 20px;
  }

  .legal-document section {
    margin-top: 28px;
    padding-top: 24px;
  }

  .legal-document section p {
    font-size: 15px;
  }

  .error-card {
    padding: 34px 26px;
    border-radius: 26px;
  }
}
