/* H5 Agreement Pages - Mobile WebView Optimized */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.8;
  color: #333;
  background-color: #fff;
  padding: 20px 16px 40px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Title */
.page-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Meta info (dates) */
.meta-info {
  text-align: center;
  color: #999;
  font-size: 0.82rem;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* Intro paragraph */
.intro {
  color: #555;
  font-size: 0.92rem;
  margin-bottom: 20px;
  line-height: 1.8;
}

/* Section headings */
h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-top: 28px;
  margin-bottom: 12px;
  padding-left: 0;
  line-height: 1.5;
}

h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  margin-top: 20px;
  margin-bottom: 8px;
  line-height: 1.5;
}

h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
  margin-top: 16px;
  margin-bottom: 6px;
  line-height: 1.5;
}

/* Content paragraphs */
p {
  font-size: 0.88rem;
  color: #444;
  margin-bottom: 12px;
  line-height: 1.8;
  text-align: justify;
}

/* Ordered & unordered lists */
ol, ul {
  padding-left: 1.2em;
  margin-bottom: 12px;
}

ol li, ul li {
  font-size: 0.88rem;
  color: #444;
  line-height: 1.8;
  margin-bottom: 6px;
  list-style: none;
}

/* Bold / emphasis */
strong {
  font-weight: 600;
  color: #1a1a1a;
}

/* Divider */
hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 24px 0;
}

/* Table of contents */
.toc {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.toc p {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 4px;
  line-height: 1.6;
}

/* iOS safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body {
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
}

/* Responsive adjustments */
@media screen and (min-width: 768px) {
  body {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 24px 60px;
  }

  .page-title {
    font-size: 1.5rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a;
    color: #e0e0e0;
  }

  .page-title {
    color: #f0f0f0;
  }

  .meta-info {
    color: #888;
  }

  .intro {
    color: #bbb;
  }

  h2 {
    color: #f0f0f0;
  }

  h3 {
    color: #ddd;
  }

  p, ol li, ul li {
    color: #ccc;
  }

  strong {
    color: #f0f0f0;
  }

  hr {
    border-top-color: #333;
  }

  .toc {
    background-color: #252525;
  }

  .toc p {
    color: #aaa;
  }
}
