/* ==========================================================================
   EE画布 · 法律文件样式（用户协议 / 隐私政策）
   —— 同时服务两种场景：
      ① 独立页面 /legal/terms.html、/legal/privacy.html（body.lg-page）
      ② 登录页弹窗（.ee-legal-* + 注入的 .lg-doc）
   —— 所有选择器都带 lg- / ee-legal- 前缀，不污染全站样式。
   ========================================================================== */

/* --------------------------------------------------------------------------
   一、独立页面
   -------------------------------------------------------------------------- */
html.lg-root,
html.lg-root body { min-height: 100%; }

body.lg-page {
  margin: 0;
  padding: 0;
  color: #262331;
  background: #f4f4fa;
  font-family: -apple-system, "Segoe UI", Roboto, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.lg-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 21, 31, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 21, 31, .045) 1px, transparent 1px);
  background-size: 30px 30px;
}

.lg-shell {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 34px 24px 72px;
  box-sizing: border-box;
}

.lg-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.lg-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #1f1c2b;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .2px;
}
.lg-brand img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
}
.lg-brand-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  display: inline-block;
  border-radius: 4px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, .10);
}
.lg-brand span { opacity: .92; }

.lg-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #e3dff0;
  background: rgba(255, 255, 255, .7);
  color: #6d6880;
  font-size: 12px;
  text-decoration: none;
  transition: color .15s, border-color .15s, background .15s;
}
.lg-back:hover {
  color: #6d28d9;
  border-color: #c9bdf3;
  background: #fff;
}

.lg-foot {
  margin-top: 20px;
  text-align: center;
  color: #9a96aa;
  font-size: 11.5px;
  line-height: 1.8;
}
.lg-foot a { color: inherit; text-decoration: none; }
.lg-foot a:hover { color: #6d28d9; }

/* --------------------------------------------------------------------------
   二、正文排版（独立页与弹窗共用）
   -------------------------------------------------------------------------- */
.lg-doc {
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e9e6f3;
  border-radius: 18px;
  padding: 42px 48px 46px;
  box-shadow: 0 18px 48px rgba(31, 27, 46, .07), inset 0 1px 0 rgba(255, 255, 255, .8);
}

.lg-doc *,
.lg-doc *::before,
.lg-doc *::after { box-sizing: border-box; }

.lg-doc h1 {
  margin: 0 0 14px;
  color: #1a1726;
  font-size: 26px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -.3px;
}

.lg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0 0 24px;
  padding: 0 0 18px;
  border-bottom: 1px solid #efecf7;
  color: #918da3;
  font-size: 11.5px;
  line-height: 1.7;
}
.lg-meta span { white-space: nowrap; }

.lg-doc h2 {
  margin: 34px 0 12px;
  padding-left: 11px;
  border-left: 3px solid #7c3aed;
  color: #201c2e;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -.1px;
}

.lg-doc h3 {
  margin: 22px 0 8px;
  color: #353046;
  font-size: 14.5px;
  line-height: 1.6;
  font-weight: 650;
}

.lg-doc p {
  margin: 0 0 12px;
  color: #3b364b;
  font-size: 13.5px;
  line-height: 1.95;
}

.lg-doc strong {
  color: #211c31;
  font-weight: 650;
}

.lg-doc ul,
.lg-doc ol {
  margin: 0 0 14px;
  padding-left: 22px;
  color: #3b364b;
  font-size: 13.5px;
  line-height: 1.95;
}
.lg-doc li { margin: 5px 0; }
.lg-doc li::marker { color: #8b7bb8; }

.lg-doc a {
  color: #6d28d9;
  text-decoration: none;
  border-bottom: 1px solid rgba(109, 40, 217, .28);
  word-break: break-word;
}
.lg-doc a:hover { border-bottom-color: #6d28d9; }

.lg-note {
  margin: 16px 0 18px;
  padding: 14px 18px;
  border: 1px solid #e7e1fb;
  border-radius: 11px;
  background: #f8f6ff;
  color: #59516e;
  font-size: 12.8px;
  line-height: 1.9;
}
.lg-note strong { color: #4c327f; }

.lg-pre {
  margin: 14px 0 18px;
  padding: 14px 16px;
  border: 1px solid #e7e1fb;
  border-radius: 10px;
  background: #faf9ff;
  color: #4a445c;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.lg-doc table {
  width: 100%;
  margin: 12px 0 18px;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.8;
}
.lg-doc th,
.lg-doc td {
  padding: 9px 10px;
  border: 1px solid #ece8f6;
  text-align: left;
  vertical-align: top;
}
.lg-doc th {
  background: #f7f5fd;
  color: #554d6d;
  font-weight: 650;
}

.lg-doc .lg-divider {
  height: 1px;
  margin: 30px 0;
  border: 0;
  background: linear-gradient(90deg, transparent, #e7e2f4 18%, #e7e2f4 82%, transparent);
}

/* 规则中心卡片 */
.lg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 24px;
}
.lg-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid #e7e1fb;
  border-radius: 12px;
  background: #faf9ff;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.lg-card:hover { border-color: #c9bdf3; background: #fff; }
.lg-card b {
  display: block;
  margin-bottom: 4px;
  color: #2b2438;
  font-size: 14px;
  line-height: 1.5;
}
.lg-card span {
  display: block;
  color: #77718a;
  font-size: 12px;
  line-height: 1.7;
}
@media (max-width: 720px) {
  .lg-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   三、登录页弹窗
   -------------------------------------------------------------------------- */
.ee-legal-mask {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(21, 18, 31, .56);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
}
.ee-legal-mask[hidden] { display: none; }

.ee-legal-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(900px, 100%);
  max-height: min(88vh, 920px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 34px 100px rgba(19, 17, 24, .38);
}

.ee-legal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  padding: 15px 20px;
  border-bottom: 1px solid #ece8f5;
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(124, 58, 237, .09), transparent 58%),
    linear-gradient(180deg, #fcfbff, #f8f6fd);
}

.ee-legal-kicker {
  margin: 0 0 3px;
  color: #8f8aa3;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.ee-legal-title {
  margin: 0;
  color: #211d31;
  font-size: 16.5px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -.1px;
}

.ee-legal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.ee-legal-open {
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid #e4dff2;
  background: rgba(255, 255, 255, .72);
  color: #6b6482;
  font-size: 11.5px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.ee-legal-open:hover {
  color: #6d28d9;
  border-color: #cdbff5;
  background: #fff;
}

.ee-legal-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #9b96ad;
  font-family: inherit;
  font-size: 23px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  box-shadow: none;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.ee-legal-close:hover {
  color: #3f3954;
  background: rgba(124, 58, 237, .09);
}
.ee-legal-close:focus-visible,
.ee-legal-open:focus-visible {
  outline: 2px solid rgba(124, 58, 237, .55);
  outline-offset: 2px;
}

.ee-legal-tabs {
  display: flex;
  gap: 2px;
  flex: 0 0 auto;
  overflow-x: auto;
  padding: 7px 14px 0;
  border-bottom: 1px solid #ece8f5;
  background: #fbfaff;
  scrollbar-width: none;
}
.ee-legal-tabs::-webkit-scrollbar { display: none; }

.ee-legal-tab {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  min-width: 0;
  margin-bottom: 7px;
  padding: 6px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #7b748c;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
  box-shadow: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.ee-legal-tab:hover { color: #5b21b6; background: rgba(124, 58, 237, .07); }
.ee-legal-tab.on { color: #6d28d9; background: rgba(124, 58, 237, .11); font-weight: 650; }
.ee-legal-tab:focus-visible {
  outline: 2px solid rgba(124, 58, 237, .55);
  outline-offset: 1px;
}

.ee-legal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 30px 40px 44px;
  background: #fff;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d8d2e8 transparent;
}.ee-legal-body::-webkit-scrollbar { width: 9px; }
.ee-legal-body::-webkit-scrollbar-thumb {
  border: 3px solid #fff;
  border-radius: 999px;
  background: #d8d2e8;
}
.ee-legal-body:focus { outline: none; }

/* 弹窗里复用 .lg-doc 的排版，但去掉独立页的卡片外壳 */
.ee-legal-body .lg-doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.ee-legal-body .lg-doc h1 { display: none; }
.ee-legal-body .lg-meta {
  margin-bottom: 20px;
  padding-bottom: 16px;
}

.ee-legal-loading,
.ee-legal-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 30px 16px;
  color: #918ca4;
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
}
.ee-legal-error { color: #b4554f; }
.ee-legal-error a { color: #6d28d9; }

/* --------------------------------------------------------------------------
   四、深色模式（仅弹窗；独立页保持浅色纸张观感）
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .ee-legal-dialog {
  border-color: #2d293c;
  background: #16141e;
  box-shadow: 0 34px 100px rgba(0, 0, 0, .6);
}
html[data-theme="dark"] .ee-legal-head {
  border-bottom-color: #2a2638;
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(124, 58, 237, .16), transparent 58%),
    linear-gradient(180deg, #1c1926, #171520);
}
html[data-theme="dark"] .ee-legal-kicker { color: #817b95; }
html[data-theme="dark"] .ee-legal-title { color: #efecf8; }
html[data-theme="dark"] .ee-legal-tabs {
  border-bottom-color: #2a2638;
  background: #171520;
}
html[data-theme="dark"] .ee-legal-tab { color: #89839c; }
html[data-theme="dark"] .ee-legal-tab:hover { color: #c4b5fd; background: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .ee-legal-tab.on { color: #c4b5fd; background: rgba(124, 58, 237, .22); }
html[data-theme="dark"] .ee-legal-open {
  border-color: #37324a;
  background: rgba(255, 255, 255, .04);
  color: #b7b1c8;
}
html[data-theme="dark"] .ee-legal-open:hover {
  color: #c4b5fd;
  border-color: #544a78;
  background: rgba(255, 255, 255, .07);
}
html[data-theme="dark"] .ee-legal-close { color: #89839c; }
html[data-theme="dark"] .ee-legal-close:hover {
  color: #ece9f6;
  background: rgba(255, 255, 255, .07);
}
html[data-theme="dark"] .ee-legal-body { background: #16141e; }
html[data-theme="dark"] .ee-legal-body .lg-doc h1,
html[data-theme="dark"] .ee-legal-body .lg-doc h2,
html[data-theme="dark"] .ee-legal-body .lg-doc h3,
html[data-theme="dark"] .ee-legal-body .lg-doc strong { color: #efeaf9; }
html[data-theme="dark"] .ee-legal-body .lg-doc p,
html[data-theme="dark"] .ee-legal-body .lg-doc li { color: #c4bfd2; }
html[data-theme="dark"] .ee-legal-body .lg-meta { color: #8d87a1; border-bottom-color: #2b2738; }
html[data-theme="dark"] .ee-legal-body .lg-note {
  border-color: #332d47;
  background: #1e1a2b;
  color: #b7b1c8;
}
html[data-theme="dark"] .ee-legal-body .lg-note strong { color: #c4b5fd; }
html[data-theme="dark"] .ee-legal-body .lg-pre {
  border-color: #332d47;
  background: #1e1a2b;
  color: #c4bfd2;
}
html[data-theme="dark"] .ee-legal-body .lg-doc a { color: #a78bfa; border-bottom-color: rgba(167, 139, 250, .35); }

/* --------------------------------------------------------------------------
   五、窄屏
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .lg-shell { padding: 20px 12px 44px; }
  .lg-doc { padding: 28px 20px 32px; border-radius: 14px; }
  .lg-doc h1 { font-size: 22px; }
  .lg-doc h2 { font-size: 16.5px; margin-top: 28px; }
  .lg-doc p,
  .lg-doc ul,
  .lg-doc ol { font-size: 13px; }

  .ee-legal-mask { padding: 0; align-items: stretch; }
  .ee-legal-dialog {
    width: 100%;
    max-height: none;
    height: 100%;
    border: 0;
    border-radius: 0;
  }
  .ee-legal-head { padding: 13px 15px; }
  .ee-legal-tabs { padding: 6px 10px 0; }
  .ee-legal-open { display: none; }
  .ee-legal-body { padding: 22px 18px 36px; }
  .ee-legal-body .lg-doc h2 { font-size: 16px; }
}


