/* Document typography synced from templates/ui.docx
   Scope: only affects rendered markdown inside .content-card. */

.docs-main {
  padding: 0;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.content-card {
  background: var(--bg-color-white, #fff);
  border: 1px solid var(--border-color, #eef0f3);
  border-radius: 8px;
  padding: 16px;
  color: var(--text-primary, #080613);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 22px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-wrap: anywhere;
}

.content-card p,
.content-card li {
  margin: 8px 0; /* ui.docx before/after=120 => ~6pt */
}

/* Headings (docx: h1 18pt, h2 16pt, h3 15pt) */
.content-card h1,
.content-card h2,
.content-card h3 {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  color: var(--text-primary, #080613);
}

.content-card h1 {
  font-size: 24px;
  line-height: 32px;
  margin: 20px 0 10px;
}

.content-card h2 {
  font-size: 20px;
  line-height: 28px;
  margin: 18px 0 10px;
}

.content-card h3 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  margin: 16px 0 8px;
}

.content-card h4,
.content-card h5,
.content-card h6 {
  font-weight: 600;
  margin: 14px 0 8px;
  color: var(--text-primary, #080613);
}

/* Lists */
.content-card ul,
.content-card ol {
  padding-left: 24px;
  margin: 8px 0;
}

/* Tables */
.content-card table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.content-card th,
.content-card td {
  border: 1px solid var(--border-color, #eef0f3);
  padding: 12px 16px;
  vertical-align: top;
}

.content-card th {
  background: var(--bg-color-container, #eef0f3);
  font-weight: 500;
  color: var(--text-primary, #080613);
}

/* Code blocks（浅色、去除上下白线） */
.content-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 22px;
  background: var(--bg-color-container, #eef0f3);
  color: var(--text-primary, #080613);
  border: none;
  outline: none;
  box-shadow: none;
  padding: 2px 6px;
  border-radius: 6px;
}

.content-card pre {
  background: #F8F9FA;
  color: var(--text-primary, #080613);
  border: none;
  outline: none;
  box-shadow: none;
  padding: 12px 16px;
  border-radius: 6px;
  margin: 12px 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.content-card pre code {
  background: transparent;
  padding: 0;
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .content-card pre {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow-x: hidden;
  }

  .content-card pre code {
    white-space: inherit;
    word-break: inherit;
    overflow-wrap: inherit;
  }

  .content-card :not(pre) > code {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* codehilite 外层有时为 table，避免撑破视口 */
  .content-card .codehilite,
  .content-card .highlight {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* codehilite (Python-Markdown codehilite) sometimes uses tables for line numbers;
   remove per-line borders so "white lines" won't appear between lines. */
.content-card .codehilite table,
.content-card .codehilite td,
.content-card .codehilite th,
.content-card .highlight table,
.content-card .highlight td,
.content-card .highlight th {
  border: none !important;
}

.content-card .codehilite td,
.content-card .highlight td {
  padding: 0 !important;
}

