/* 服务条款 / 隐私政策：独立页（body.legal-page）+ 前台弹窗（#ptw-legal）
   v3.14 起弹窗与独立页共用同一套正文排版；首页也会引入本文件，所以全局规则一律加 .legal-page 作用域 */

body.legal-page {
  margin: 0;
  color: #334155;
  background: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.legal-page *, .ptw-legal-overlay *, .ptw-legal-overlay *::before, .ptw-legal-overlay *::after { box-sizing: border-box; }

/* ---------- 独立页 ---------- */
.legal-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px max(22px, calc((100vw - 1080px) / 2)); background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid #eef2f7;
}
.legal-actions { display: flex; align-items: center; gap: 14px; }
.legal-back { font-size: 13px; color: #64748b; text-decoration: none; }
.legal-back:hover { color: #2f6bff; }
.legal-cta {
  height: 34px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; text-decoration: none;
  background: #3b82f6; color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(59, 130, 246, .28); transition: filter .16s ease;
}
.legal-cta:hover { filter: brightness(1.04); }

.legal-wrap { max-width: 840px; margin: 0 auto; padding: 44px 24px 60px; }
.legal-title { font-size: 30px; line-height: 1.25; margin: 0 0 8px; color: #111827; letter-spacing: -.6px; }
.legal-meta { font-size: 12.5px; color: #94a3b8; margin: 0 0 26px; }
.legal-body {
  background: #fff; border: 1px solid #eef2f7; border-radius: 18px; padding: 30px 32px 24px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .04);
}

/* ---------- 正文排版：独立页 .legal-body 与弹窗 .ptw-legal-body 共用 ---------- */
.legal-body h2, .ptw-legal-body h2 { font-size: 17px; line-height: 1.5; margin: 28px 0 10px; color: #111827; }
.legal-body h2:first-child, .ptw-legal-body h2:first-child { margin-top: 0; }
.legal-body h3, .ptw-legal-body h3 { font-size: 15px; margin: 20px 0 8px; color: #111827; }
.legal-body p, .ptw-legal-body p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.88; color: #475569; }
.legal-body ul, .legal-body ol, .ptw-legal-body ul, .ptw-legal-body ol { margin: 0 0 14px; padding-left: 20px; }
.legal-body li, .ptw-legal-body li { font-size: 14.5px; line-height: 1.88; color: #475569; margin-bottom: 6px; }
.legal-body b, .legal-body strong, .ptw-legal-body b, .ptw-legal-body strong { color: #1f2937; font-weight: 600; }
.legal-body a, .ptw-legal-body a { color: #2f6bff; text-decoration: none; }
.legal-body a:hover, .ptw-legal-body a:hover { text-decoration: underline; }
.legal-body img, .ptw-legal-body img { max-width: 100%; border-radius: 10px; }

.legal-page .footer {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 30px 20px 40px; background: #fff; border-top: 1px solid #eef2f7; text-align: center;
}
.legal-page .footer-links { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legal-page .footer-links a { color: #5b6577; text-decoration: none; }
.legal-page .footer-links a:hover { color: #2f6bff; }
.legal-page .footer-dot { color: #cbd5e1; }
.legal-page .footer-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 12px; color: #a8b3c4; }
.legal-page .footer-meta a { color: #a8b3c4; text-decoration: none; }
.legal-page .footer-note { font-size: 11.5px; color: #c0c9d6; }

/* ---------- 前台弹窗（排版同《使用说明》，底部一个「关闭」，无右上 X） ---------- */
.ptw-legal-overlay {
  position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(15, 23, 42, .42);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: ptwLegalFade .22s ease both;
}
.ptw-legal-overlay[hidden] { display: none !important; }

.ptw-legal-card {
  position: relative; display: flex; flex-direction: column;
  width: min(760px, 92vw); height: 70vh; min-height: 320px; max-height: calc(100vh - 32px);
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .24), 0 2px 8px rgba(15, 23, 42, .08);
  animation: ptwLegalPop .26s cubic-bezier(.22, .9, .3, 1) both;
}

.ptw-legal-head {
  flex: 0 0 auto; display: flex; align-items: baseline; gap: 10px; padding: 18px 26px;
  border-bottom: 1px solid #eef2f7; background: linear-gradient(180deg, #fbfdff, #ffffff);
}
.ptw-legal-head h2 {
  margin: 0; font-size: 18px; font-weight: 700; color: #0f172a; letter-spacing: .2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ptw-legal-upd { flex: 0 0 auto; font-size: 12px; color: #94a3b8; }

.ptw-legal-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 26px 22px;
  scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent;
}
.ptw-legal-body::-webkit-scrollbar { width: 8px; }
.ptw-legal-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid #fff; }

.ptw-legal-foot {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  padding: 13px 24px 16px; border-top: 1px solid #eef2f7; background: #fff;
}
.ptw-legal-close {
  min-width: 132px; height: 38px; padding: 0 22px; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff;
  font-size: 14px; font-weight: 600; letter-spacing: .5px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
  transition: filter .16s ease, transform .16s ease;
}
.ptw-legal-close:hover { filter: brightness(1.06); }
.ptw-legal-close:active { transform: scale(.97); }

@keyframes ptwLegalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ptwLegalPop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 768px) {
  .legal-top { padding: 11px 14px; }
  .legal-actions { gap: 10px; }
  .legal-back { display: none; }
  .legal-wrap { padding: 26px 16px 40px; }
  .legal-title { font-size: 23px; }
  .legal-body { padding: 20px 18px 14px; border-radius: 14px; }
  .legal-body p, .legal-body li { font-size: 14px; line-height: 1.82; }

  .ptw-legal-overlay { padding: 10px; }
  .ptw-legal-card { width: 100%; height: 72vh; border-radius: 14px; }
  .ptw-legal-head { padding: 14px 16px; }
  .ptw-legal-head h2 { font-size: 16px; }
  .ptw-legal-upd { font-size: 11px; }
  .ptw-legal-body { padding: 16px 18px 18px; }
  .ptw-legal-body p, .ptw-legal-body li { font-size: 13.5px; line-height: 1.78; }
  .ptw-legal-foot { padding: 11px 16px 14px; }
  .ptw-legal-close { width: 100%; }
}
