:root {
  --ink: #17211f;
  --body: #2a3532;
  --muted: #6b7974;
  --brand: #0e7a6e;
  --brand-soft: #e7f4f1;
  --line: #e3e9e6;
  --bg: #f5f8f6;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

.wrap {
  width: min(860px, calc(100% - 40px));
  margin: 0 auto;
}

/* ---------- 顶栏 / 底栏 ---------- */

.site-head {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
  flex: none;
}

.brand small {
  color: var(--muted);
  font-weight: 400;
  font-size: 12.5px;
  margin-left: 2px;
}

.head-link {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.head-link:hover {
  color: var(--brand);
}

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 26px 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.9;
}

.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  justify-content: space-between;
}

/* ---------- 协议列表 ---------- */

.page-title {
  font-size: clamp(26px, 4vw, 32px);
  margin: 48px 0 8px;
  letter-spacing: .01em;
}

.page-sub {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 14px;
}

.doc-list {
  display: grid;
  gap: 14px;
  margin-bottom: 64px;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color .18s, transform .18s, box-shadow .18s;
  box-shadow: 0 1px 2px rgba(23, 33, 31, .03);
}

.doc-item:hover {
  border-color: #bcdcd5;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(14, 122, 110, .08);
}

.doc-icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
}

.doc-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.doc-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

.meta {
  font-size: 12.5px;
  color: var(--muted);
}

.doc-item .arrow {
  margin-left: auto;
  color: #9aa8a3;
  font-size: 18px;
  flex: none;
}

.empty {
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.8;
}

/* ---------- 协议正文 ---------- */

.doc-wrap {
  padding: 32px 0 64px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  margin-bottom: 18px;
}

.back:hover {
  color: var(--brand);
}

/* 正文版式对齐 Word 原件：Arial、标题居中、加粗小节、11pt 正文、单倍行距 */
.doc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: clamp(26px, 5vw, 60px);
  box-shadow: 0 1px 2px rgba(23, 33, 31, .03);
}

/* 用户协议原件标题为左对齐，但 APP 内显示要求与导航标题一致，统一居中 */
.doc-card > h1 {
  font-family: Arial, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  color: #000;
  margin: 0 0 9px;
  letter-spacing: 0;
}

.doc-content {
  /* Word 的段前距与段后距相加，CSS 相邻外边距会合并，用弹性列还原原件段距 */
  display: flex;
  flex-direction: column;
  font-family: Arial, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14.67px;
  line-height: 21.33px;
  color: #000;
  word-break: break-word;
}

.doc-content h1 {
  font-size: 24px;
  line-height: 1.25;
  margin: 26px 0 9px;
}

.doc-content h2 {
  font-size: 21.33px;
  line-height: 21.33px;
  font-weight: 700;
  margin: 21.33px 0 8px;
  padding: 0;
  border: 0;
  color: #000;
}

.doc-content h3 {
  font-size: 20px;
  line-height: 21.33px;
  font-weight: 700;
  margin: 20px 0 8px;
  color: #000;
}

.doc-content p {
  margin: 8px 0;
  text-align: left;
}

.doc-content ol,
.doc-content ul {
  margin: 0 0 14px;
  padding-left: 24px;
}

.doc-content li {
  margin: 6px 0;
}

.doc-content blockquote {
  margin: 14px 0;
  padding: 10px 16px;
  background: var(--brand-soft);
  border-radius: 8px;
  color: #3c4a46;
}

.doc-content a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid rgba(14, 122, 110, .35);
}

.doc-content strong {
  font-weight: 700;
}

.doc-content hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 26px 0;
}

/* ---------- 表格（字段说明 / 第三方 SDK 清单等，来自粘贴的整篇 HTML） ---------- */
/* 服务端白名单会把 style 属性冲掉，所以表格观感统一在这里给，正文里不用带内联样式 */
.doc-content table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 12px 0 16px;
  font-size: 13.5px;
  line-height: 1.65;
  /* 列宽按内容自适应（fixed 会把中文列全压成等宽，行高翻倍、手机上很难读） */
  table-layout: auto;
}

.doc-content caption {
  caption-side: top;
  padding: 0 0 8px;
  font-size: 13.5px;
  font-weight: 700;
  text-align: left;
}

.doc-content th,
.doc-content td {
  border: 1px solid #d7dedb;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.doc-content th {
  background: #f1f5f3;
  font-weight: 700;
}

.doc-content tbody tr:nth-child(even) td {
  background: #fafcfb;
}

@media (max-width: 640px) {
  .doc-content table {
    font-size: 12.5px;
  }

  .doc-content th,
  .doc-content td {
    padding: 6px 8px;
  }
}

/* ---------- 嵌入模式（APP WebView / 第三方 iframe） ---------- */

body.embed {
  background: #fff;
}

body.embed .site-head,
body.embed .site-foot,
body.embed .back {
  display: none;
}

body.embed .wrap {
  width: 100%;
}

body.embed .doc-wrap {
  padding: 0;
}

body.embed .doc-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: clamp(18px, 4vw, 36px);
}

@media (max-width: 640px) {
  .wrap {
    width: calc(100% - 32px);
  }

  .site-head .wrap {
    height: 56px;
  }

  .page-title {
    margin-top: 32px;
  }

  .doc-item {
    padding: 18px;
    gap: 14px;
  }

  .doc-item .arrow {
    display: none;
  }

  .doc-card {
    border-radius: 4px;
  }

  .site-foot .wrap {
    display: block;
  }
}
