/* LoomQR legal pages (terms.html / privacy.html)
   Shares the auth-page palette so legal docs feel part of the same product. */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "Segoe UI", Arial, Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #2a2440;
  background: #fbf7ff;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ---- language blocks (i18n.js sets <html lang="en"> after boot) ----
   .zh / .en on <article class="doc"> swap as blocks; use .i-zh / .i-en
   for inline spans so display mode stays correct in each context. */
article.en { display: none; }
html[lang="en"] article.zh { display: none; }
html[lang="en"] article.en { display: block; }

.i-en { display: none; }
html[lang="en"] .i-zh { display: none; }
html[lang="en"] .i-en { display: inline; }

/* 窄屏短标签：默认隐藏，<=700px 时按语言各自接管。
   用独立的 only-sm-zh / only-sm-en，不复用 i-zh / i-en，
   避免与上面 html[lang="en"] 规则同权重互相覆盖。 */
.only-sm-zh, .only-sm-en { display: none; }

/* ---- layout ---- */
.wrap { max-width: 820px; margin: 0 auto; padding: 0 24px 96px; }

.legal-top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251, 247, 255, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid #ece6f5;
}
.legal-top .inner {
  max-width: 820px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 14px;
}
.back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: #7c5cff; text-decoration: none;
}
.back:hover { opacity: .78; }
.top-doc {
  margin-left: auto; display: flex; gap: 4px;
  background: #fff; border: 1px solid #ece6f5; border-radius: 999px; padding: 3px;
}
.top-doc a {
  font-size: 12.5px; font-weight: 600; color: #8a82a6; text-decoration: none;
  padding: 6px 14px; border-radius: 999px; transition: .15s;
}
.top-doc a:hover { color: #7c5cff; }
.top-doc a.on { background: linear-gradient(120deg, #7c5cff, #ff5a8a); color: #fff; }

/* ---- hero ---- */
.legal-hero { padding: 52px 0 30px; text-align: center; }
.legal-logo {
  font-size: 26px; font-weight: 800; letter-spacing: .5px; margin-bottom: 16px;
  background: linear-gradient(120deg, #7c5cff, #ff5a8a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.legal-hero h1 { font-size: 30px; font-weight: 800; letter-spacing: .3px; margin-bottom: 12px; }
.legal-hero p { font-size: 14px; color: #8a82a6; }
.meta {
  display: inline-block; margin-top: 16px; font-size: 12.5px; color: #8a82a6;
  background: #fff; border: 1px solid #ece6f5; border-radius: 999px; padding: 7px 16px;
}

/* ---- body ---- */
.doc {
  background: #fff; border: 1px solid #ece6f5; border-radius: 20px;
  padding: 40px 44px 44px; box-shadow: 0 18px 50px rgba(78, 52, 140, .08);
}

.doc h2 {
  font-size: 18px; font-weight: 700; margin: 34px 0 12px;
  padding-left: 12px; border-left: 3px solid #7c5cff; line-height: 1.4;
}
.doc h2:first-child { margin-top: 0; }
.doc h3 { font-size: 15px; font-weight: 700; margin: 20px 0 8px; color: #4a4366; }
.doc p { font-size: 14.5px; color: #4a4366; margin-bottom: 12px; }
.doc ul, .doc ol { margin: 0 0 14px 22px; }
.doc li { font-size: 14.5px; color: #4a4366; margin-bottom: 7px; }
.doc li strong { color: #2a2440; }
.doc b, .doc strong { color: #2a2440; }
.doc a { color: #7c5cff; }

.callout {
  border-radius: 12px; padding: 14px 18px; margin: 16px 0;
  font-size: 14px; color: #4a4366;
  background: #f8f5ff; border: 1px solid #ece6f5;
}
.callout.warn { background: #fff7f0; border-color: #ffe0cc; }
.callout b { display: block; margin-bottom: 4px; color: #2a2440; }

.tbl { width: 100%; border-collapse: collapse; margin: 14px 0 18px; font-size: 14px; table-layout: fixed; }
.tbl th, .tbl td { border: 1px solid #ece6f5; padding: 10px 14px; text-align: left; vertical-align: top; word-break: break-word; overflow-wrap: anywhere; }
.tbl th { background: #f8f5ff; font-weight: 700; color: #2a2440; }
.tbl td { color: #4a4366; }
.tbl code {
  background: #f4f1fb; padding: 1px 6px; border-radius: 5px; font-size: 13px;
  /* 模型文件名很长（如 revAnimated_v122.safetensors），必须允许断行，
     否则窄屏下会把整页撑出横向滚动条 */
  word-break: break-all; overflow-wrap: anywhere;
}

/* 两列/三列表在窄屏下堆叠，避免固定列宽导致溢出。
   这些表格没有 <thead>（首行直接是 <th>），所以隐藏首行；
   列名改由每个单元格的 data-th 以小字标签呈现。 */
@media (max-width: 700px) {
  .tbl.stack-sm thead { display: none; }
  .tbl.stack-sm tr:first-child { display: none; }
  .tbl.stack-sm, .tbl.stack-sm tbody, .tbl.stack-sm tr, .tbl.stack-sm td { display: block; width: 100%; }
  .tbl.stack-sm tr { border: 1px solid #ece6f5; border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
  .tbl.stack-sm td { border: none; border-bottom: 1px solid #f2eefb; padding: 9px 12px; }
  .tbl.stack-sm td:last-child { border-bottom: none; }
  .tbl.stack-sm td::before {
    content: attr(data-th); display: block; font-size: 11.5px; font-weight: 700;
    color: #8a82a6; margin-bottom: 2px;
  }
}

.doc-foot {
  margin-top: 34px; padding-top: 22px; border-top: 1px solid #ece6f5;
  font-size: 13.5px; color: #8a82a6;
}
.doc-foot a { color: #7c5cff; font-weight: 600; text-decoration: none; }
.doc-foot a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .legal-hero { padding: 36px 0 22px; }
  .legal-hero h1 { font-size: 23px; }
  .doc { padding: 26px 20px 30px; border-radius: 16px; }
  .doc h2 { font-size: 16px; margin: 26px 0 10px; }
  .doc p, .doc li, .tbl { font-size: 14px; }
  .tbl th, .tbl td { padding: 8px 10px; }
  .legal-top .inner { padding: 12px 18px; gap: 10px; }

  /* 窄屏下让顶栏更紧凑，避免页签换行：长标签换成短标签 */
  html[lang] .hide-sm { display: none; }
  html[lang="zh-CN"] .only-sm-zh { display: inline; }
  html[lang="en"] .only-sm-en { display: inline; }
  .back { gap: 0; }
  .top-doc { flex-shrink: 0; }
  .top-doc a { padding: 6px 11px; font-size: 12px; white-space: nowrap; }
  .wrap { padding: 0 18px 72px; }
}