/* /agreement/《用户协议》《隐私协议》样式
 *
 * 这两个页面给两处看：App 内 webview（司机端/客户端手机屏）+ App Store 审核（桌面浏览器、可能打印）。
 * 所以按「手机优先、桌面阅读宽度、可打印」三层写，字体栈与官网 www.css 保持一致。
 *
 * 结构由 scripts/build-agreement.py 生成（产物 agreement/*.html），改样式只改本文件。
 * 线上地址：/assets/site/css/agreement.css（deploy.sh 随官网资源一起发）。
 */

:root {
  --doc-fg: #1d1d1f;        /* 正文（与官网一致） */
  --doc-fg-soft: #3a3a3c;   /* 次级正文 / 提示块 */
  --doc-muted: #6e6e73;     /* 日期、脚注 */
  --doc-line: #e5e5ea;      /* 分隔线 */
  --doc-soft: #f5f5f7;      /* 卡片底 */
  --doc-accent: #0071e3;    /* 链接、强调条 */
  --doc-li: 1.6em;          /* 编号段落的悬挂缩进 */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--doc-fg);
  font-family: "SF Pro SC", "SF Pro Text", "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.75;
}

.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* ---------------------------------------------------------------- 页头 */

.doc__title {
  margin: 0 0 8px;
  font-size: clamp(24px, 6.2vw, 32px);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -.02em;
}

/* 隐私政策的「更新日期 / 生效日期」 */
.doc__meta {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--doc-muted);
}

.doc__meta + .doc__meta { margin-top: 2px; }

.doc__body > .doc__meta:first-child {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--doc-line);
  margin-bottom: 4px;
}

/* 文末的发布/生效/更新日期 */
.doc__foot {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--doc-muted);
}

.doc__foot:first-of-type { margin-top: 28px; }

/* ---------------------------------------------------------------- 目录 */

.toc {
  margin: 22px 0 6px;
  padding: 16px 18px 12px;
  background: var(--doc-soft);
  border-radius: 14px;
}

.toc__label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--doc-muted);
  letter-spacing: .02em;
}

.toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc__list li a {
  display: block;
  padding: 8px 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--doc-fg);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.toc__list li:last-child a { border-bottom: 0; padding-bottom: 2px; }

.toc__list li a:active { color: var(--doc-accent); }

/* 正文自带的「（1）…（11）」目录保留原编号，不另加序号 */
.toc__list li { counter-increment: toc; }

/* ---------------------------------------------------------------- 正文 */

.doc__body > h2 {
  margin: 44px 0 14px;
  padding-top: 26px;
  border-top: 1px solid var(--doc-line);
  font-size: 20px;
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: -.01em;
  scroll-margin-top: 16px;   /* 锚点跳转后不被顶到边缘 */
}

.doc__body > h2:first-of-type,
.doc__body > .toc + h2 {
  margin-top: 30px;
  padding-top: 0;
  border-top: 0;
}

.doc__body > h3 {
  margin: 26px 0 8px;
  font-size: 17px;
  line-height: 1.55;
  font-weight: 600;
  scroll-margin-top: 16px;
}

.doc__body > p {
  margin: 12px 0;
}

/* 编号段落（（1）/(1)/a./1.）悬挂缩进，编号不折到正文里 */
.doc__body > .is-li {
  padding-left: var(--doc-li);
  text-indent: calc(-1 * var(--doc-li));
  margin: 10px 0;
}

.doc__body > .lead {
  font-size: 18px;
  color: var(--doc-fg-soft);
  margin-bottom: 4px;
}

/* 「特别提示」块 */
.callout {
  margin: 20px 0 24px;
  padding: 16px 18px 6px;
  background: var(--doc-soft);
  border-left: 3px solid var(--doc-accent);
  border-radius: 0 14px 14px 0;
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--doc-fg-soft);
}

.callout .callout__label {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--doc-fg);
}

.callout p { margin: 0 0 10px; }

/* 链接（SDK 隐私政策地址等，长 URL 必须能断行） */
.doc a {
  color: var(--doc-accent);
  text-decoration: none;
  word-break: break-all;
}

.doc a:active { opacity: .6; }

/* ---------------------------------------------------------------- 表格 */

.table-wrap {
  margin: 16px 0 22px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--doc-line);
  border-radius: 14px;
}

.table-wrap table {
  width: 100%;
  min-width: 520px;          /* 手机上横向滚动，不挤成一列 */
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.6;
}

.table-wrap th,
.table-wrap td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--doc-line);
}

.table-wrap th {
  background: var(--doc-soft);
  font-weight: 600;
  white-space: nowrap;
}

.table-wrap tbody tr:last-child td { border-bottom: 0; }

.table-wrap tbody tr:nth-child(even) td { background: #fafafc; }

/* ---------------------------------------------------------------- SDK 卡（键值段） */

.kv {
  margin: 14px 0;
  padding: 14px 16px 10px;
  border: 1px solid var(--doc-line);
  border-radius: 14px;
}

.kv__title {
  margin: 0 0 10px;
  font-size: 15.5px;
  font-weight: 600;
}

.kv__row {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid rgba(0, 0, 0, .05);
  font-size: 14.5px;
  line-height: 1.7;
}

.kv__row dt {
  flex: 0 0 5.4em;
  color: var(--doc-muted);
}

.kv__row dd {
  flex: 1;
  margin: 0;
  min-width: 0;
  color: var(--doc-fg-soft);
}

/* ---------------------------------------------------------------- 回到顶部 */

.to-top {
  position: fixed;
  right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  padding: 9px 14px;
  font-size: 13px;
  color: var(--doc-fg);
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--doc-line);
  border-radius: 999px;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

.to-top.is-on { opacity: 1; visibility: visible; }

/* ---------------------------------------------------------------- 宽屏 */

@media (min-width: 700px) {
  .doc { padding: 48px 24px 96px; }

  .doc__body > h2 { font-size: 22px; margin-top: 52px; }

  .toc { padding: 20px 22px 16px; }

  .toc__list {
    columns: 2;
    column-gap: 28px;
  }

  .toc__list li a { break-inside: avoid; }

  .kv { padding: 16px 18px 12px; }
}

/* ---------------------------------------------------------------- 暗色 */

@media (prefers-color-scheme: dark) {
  :root {
    --doc-fg: #f5f5f7;
    --doc-fg-soft: #d1d1d6;
    --doc-muted: #98989d;
    --doc-line: #2c2c2e;
    --doc-soft: #1c1c1e;
    --doc-accent: #2997ff;
  }

  body { background: #000; }

  .toc__list li a { border-bottom-color: rgba(255, 255, 255, .1); }
  .table-wrap tbody tr:nth-child(even) td { background: #101012; }
  .kv__row { border-top-color: rgba(255, 255, 255, .08); }

  .to-top {
    background: rgba(28, 28, 30, .86);
  }
}

/* ---------------------------------------------------------------- 打印（App Store 审核可能要纸质/PDF） */

@media print {
  body { font-size: 11.5pt; line-height: 1.6; }
  .doc { max-width: none; padding: 0; }
  .to-top { display: none; }
  .toc { background: transparent; padding: 0; border-bottom: 1px solid #ccc; border-radius: 0; }
  .toc__list { columns: 2; }
  .callout { background: transparent; border-left: 2px solid #666; }
  .table-wrap { overflow: visible; border: 0; }
  .table-wrap table { min-width: 0; font-size: 10pt; }
  .table-wrap th { background: transparent; }
  .kv { border-color: #ccc; break-inside: avoid; }
  .doc__body > h2 { break-after: avoid; }
  .doc__body > h3 { break-after: avoid; }
}
