/* 快乐爱消除 协议文档通用样式 - 参考 HungryStudio 扁平布局 */
:root {
  --color-text: #333;
  --color-text-secondary: #666;
  --color-accent: #2c5f4f;
  --color-border: #ddd;
  --color-bg-subtle: #f2f2f2;
  --font-serif: 'STSong', 'SimSun', 'NSimSun', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

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

html, body {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: #fff;
  margin: 0;
  padding: 0;
}

.container {
  padding: 24px;
  width: 100%;
  overflow-x: hidden;
  max-width: 1400px;
  margin: 0 auto;
}

h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-accent);
  text-align: center;
  margin-bottom: 8px;
}

.meta {
  font-size: 14px;
  color: var(--color-text-secondary);
  text-align: center;
  text-indent: 0;
  margin-bottom: 24px;
}

.meta .highlight {
  font-weight: 600;
}

h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 32px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

h2.section-underline {
  border-bottom: 2px solid var(--color-text);
}

a.doc-link {
  color: #3498db;
  text-decoration: underline;
}

ol.sub-list {
  list-style: none;
  counter-reset: sub;
  padding-left: 0;
  margin: 8px 0 0;
  text-indent: 0;
}

ol.sub-list li {
  counter-increment: sub;
  position: relative;
  padding-left: 2em;
  margin-bottom: 6px;
}

ol.sub-list li::before {
  content: "(" counter(sub) ") ";
  position: absolute;
  left: 0;
}

ol.sub-list-bold li {
  font-weight: 600;
}

h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin: 24px 0 8px;
}

p { margin-bottom: 12px; font-size: 16px; }

.clause { margin-bottom: 16px; }

.clause-num { font-weight: 600; color: var(--color-accent); }

ul, ol {
  padding-left: 20px;
  margin: 12px 0;
}

li { margin-bottom: 12px; }

.abstract {
  background: #f8f9fa;
  border-left: 4px solid var(--color-accent);
  padding: 16px 20px;
  margin: 24px 0;
}

.toc {
  list-style: none;
  padding-left: 0;
  margin: 12px 0 24px;
}

.toc li {
  margin-bottom: 6px;
}

.toc a {
  color: #3498db;
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

a {
  color: #3498db;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

th, td {
  border: 1px solid var(--color-border);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--color-bg-subtle);
  font-weight: 600;
  color: var(--color-text);
}

tr:hover { background: #f9f9f9; }

.table-wrapper {
  overflow-x: auto;
  margin: 16px 0;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper table {
  display: table;
  min-width: 600px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--color-accent);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-accent);
}

.section-title:first-of-type { margin-top: 0; }

.info-cell { font-size: 13px; line-height: 1.6; }

/* 屏幕适配 */
@media screen and (max-width: 768px) {
  .container {
    padding: 16px;
  }

  body {
    font-size: 14px;
  }

  h1 { font-size: 22px; }
  h2 { font-size: 20px; margin-top: 24px; }
  h3 { font-size: 18px; margin-top: 20px; }
  .section-title { font-size: 18px; margin: 24px 0 12px; }

  .table-wrapper {
    margin-left: -16px;
    margin-right: -16px;
    padding: 0 16px;
  }

  .table-wrapper table {
    font-size: 13px;
    min-width: 480px;
  }

  th, td {
    padding: 10px 8px;
    word-break: break-word;
    overflow-wrap: break-word;
  }
}

@media screen and (max-width: 480px) {
  .container {
    padding: 12px;
  }

  .table-wrapper {
    margin-left: -12px;
    margin-right: -12px;
    padding: 0 12px;
  }

  .table-wrapper table {
    font-size: 12px;
    min-width: 400px;
  }
}
