/* 用户服务协议 / 隐私政策等法律文稿共用样式（无首行缩进） */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.legal-page .back {
  font-size: 13px;
  display: inline-block;
  margin-bottom: 8px;
}

.legal-doc {
  color: var(--text, #0f172a);
  font-size: 14px;
  line-height: 1.85;
  letter-spacing: 0.01em;
}

.legal-doc .doc-main-title {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  line-height: 1.35;
}

.legal-doc .doc-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  line-height: 1.45;
}

.legal-doc .meta {
  margin: 0 0 24px;
  color: var(--text-muted, #64748b);
  font-size: 12.5px;
  text-align: center;
  line-height: 1.6;
}

.legal-doc h2,
.legal-doc h4 {
  margin: 28px 0 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
}

.legal-doc h3,
.legal-doc h5 {
  margin: 16px 0 8px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
}

.legal-doc h2:first-of-type,
.legal-doc h4:first-of-type {
  margin-top: 8px;
}

.legal-doc p {
  margin: 0 0 12px;
  text-align: justify;
  text-justify: inter-ideograph;
}

.legal-doc li {
  margin: 0 0 8px;
  text-align: justify;
  text-justify: inter-ideograph;
}

/* 有序列表：一级 1. 2.；嵌套 （1）（2） */
.legal-doc ol {
  counter-reset: legal-item;
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.legal-doc ol > li {
  counter-increment: legal-item;
  position: relative;
  padding-left: 1.85em;
}

.legal-doc ol > li::before {
  content: counter(legal-item) ". ";
  position: absolute;
  left: 0;
  top: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text, #0f172a);
}

.legal-doc ol ol {
  counter-reset: legal-sub;
  margin: 8px 0 4px;
}

.legal-doc ol ol > li {
  counter-increment: legal-sub;
  padding-left: 2.4em;
}

.legal-doc ol ol > li::before {
  content: "（" counter(legal-sub) "）";
  font-weight: 600;
}

.legal-doc ul {
  margin: 0 0 12px;
  padding-left: 1.35em;
}

.legal-doc ul > li {
  padding-left: 0.15em;
}

/* 注册弹窗内略紧凑，仍可读 */
.legal-modal {
  width: min(760px, 100%);
  max-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.legal-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
}

.legal-modal .modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.legal-modal .modal-body.legal-doc {
  padding: 18px 22px 22px;
  overflow: auto;
  flex: 1;
  font-size: 13.5px;
  line-height: 1.8;
}

.legal-modal .modal-body.legal-doc .doc-main-title {
  font-size: 18px;
}

.legal-modal .modal-body.legal-doc .doc-title {
  font-size: 14px;
}

.legal-modal .modal-body.legal-doc h4 {
  margin: 22px 0 10px;
  font-size: 14.5px;
}

.legal-modal .modal-body.legal-doc h5 {
  margin: 14px 0 6px;
  font-size: 13.5px;
}

.legal-modal .modal-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border, #e2e8f0);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

@media print {
  .legal-page .back,
  .legal-modal .modal-header button,
  .legal-modal .modal-footer {
    display: none !important;
  }

  .legal-doc {
    font-size: 12pt;
    line-height: 1.75;
  }

  .legal-modal {
    max-height: none;
    width: 100%;
  }

  .legal-modal .modal-body.legal-doc {
    overflow: visible;
  }
}
