* { box-sizing: border-box; }

.legal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: #f4f6f8;
  color: #334155;
  -webkit-font-smoothing: antialiased;
  user-select: text;
}

.top-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: 14px max(20px, calc((100% - 960px) / 2));
  box-sizing: border-box;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.nav-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: #1e293b;
}

.nav-left img {
  flex: 0 0 auto;
  display: block;
  border-radius: 8px;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.nav-right a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.nav-right a:hover {
  border-color: #7c3aed;
  color: #7c3aed;
}

.legal-page > .footer {
  margin-top: auto;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 14px;
  color: #64748b;
}

.ft-main {
  margin: 0 0 12px;
}

.footer .ft-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin: 0;
  line-height: 1.8;
}

.footer .ft-links a {
  color: #475569;
  text-decoration: none;
}

.footer .ft-links a:not(:last-child)::after {
  content: "·";
  padding: 0 12px;
  color: #94a3b8;
}

.footer .ft-links a:hover,
.footer .ft-links a[aria-current="page"] {
  color: #7c3aed;
}

.legal-page main.legal-main {
  display: block;
  flex: 1 1 auto;
  align-items: stretch;
  justify-content: flex-start;
  overflow: visible;
  padding: 32px 20px 48px;
}

.legal-page section.legal-card {
  display: block;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.legal-header {
  flex-shrink: 0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.legal-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: #1e293b;
}

.legal-brand img {
  flex: 0 0 auto;
  border-radius: 8px;
}

.legal-brand-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legal-back-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.legal-back-link:hover {
  border-color: #7c3aed;
  color: #7c3aed;
}

.legal-main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.legal-main h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 12px;
  color: #1e293b;
}

.legal-lead {
  font-size: 15px;
  line-height: 1.75;
  color: #64748b;
  margin: 0 0 22px;
}

.legal-updated {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 22px;
}

.legal-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 22px 24px 10px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.legal-card h2 {
  font-size: 17px;
  margin: 0 0 12px;
  color: #1e293b;
}

.legal-card p,
.legal-card li {
  font-size: 15px;
  line-height: 1.8;
  color: #475569;
  margin: 0 0 10px;
}

.legal-card ul {
  padding-left: 1.2em;
  margin: 0 0 10px;
}

.legal-card a {
  color: #7c3aed;
}

.legal-contact {
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 8px 0 14px;
}

.legal-contact p {
  margin: 0 0 6px;
  color: #334155;
}

.legal-card code {
  font-size: 13px;
  background: #f1f5f9;
  color: #334155;
  padding: 1px 6px;
  border-radius: 4px;
}

.legal-footer {
  border-top: 1px solid #e2e8f0;
  background: #fff;
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 14px;
  color: #64748b;
}

.legal-footer .ft-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin: 0 0 14px;
  line-height: 1.8;
}

.legal-footer .ft-links a {
  color: #475569;
  text-decoration: none;
}

.legal-footer .ft-links a:hover,
.legal-footer .ft-links a[aria-current="page"] {
  color: #7c3aed;
}

.legal-footer .legal-sep {
  padding: 0 12px;
  color: #94a3b8;
  user-select: none;
}

.legal-footer .ft-meta {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #64748b;
}

.legal-footer .ft-meta a {
  color: #64748b;
  text-decoration: none;
}

.legal-footer .ft-meta a:hover {
  color: #7c3aed;
}

@media (max-width: 640px) {
  .legal-header-inner {
    padding: 12px 16px;
  }

  .legal-brand-name {
    font-size: 15px;
    max-width: 52vw;
  }

  .legal-back-link {
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }

  .legal-main {
    padding: 24px 16px 40px;
  }

  .legal-main h1 {
    font-size: 22px;
  }
}
