h1 { font-family: Arial, Helvetica, sans-serif; }

/* Markdown Preview Styles */
#preview {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: #333;
}

#preview h1 {
  font-size: 2em;
  font-weight: 600;
  margin-top: 0.67em;
  margin-bottom: 0.67em;
  border-bottom: 1px solid #eaecef;
  padding-bottom: 0.3em;
}

#preview h2 {
  font-size: 1.5em;
  font-weight: 600;
  margin-top: 0.83em;
  margin-bottom: 0.83em;
  border-bottom: 1px solid #eaecef;
  padding-bottom: 0.3em;
}

#preview h3 {
  font-size: 1.25em;
  font-weight: 600;
  margin-top: 1em;
  margin-bottom: 1em;
}

#preview h4 {
  font-size: 1em;
  font-weight: 600;
  margin-top: 1.33em;
  margin-bottom: 1.33em;
}

#preview h5 {
  font-size: 0.875em;
  font-weight: 600;
  margin-top: 1.67em;
  margin-bottom: 1.67em;
}

#preview h6 {
  font-size: 0.85em;
  font-weight: 600;
  margin-top: 2.33em;
  margin-bottom: 2.33em;
  color: #6a737d;
}

#preview p {
  margin-top: 0;
  margin-bottom: 1em;
}

#preview ul, #preview ol {
  margin-top: 0;
  margin-bottom: 1em;
  padding-left: 2em;
}

#preview li {
  margin-top: 0.25em;
}

#preview ul {
  list-style-type: disc;
}

#preview ol {
  list-style-type: decimal;
}

#preview code {
  background-color: rgba(27, 31, 35, 0.05);
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 85%;
  margin: 0;
  padding: 0.2em 0.4em;
}

#preview pre {
  background-color: #0d1117;
  border-radius: 6px;
  font-size: 85%;
  line-height: 1.45;
  overflow: auto;
  padding: 16px;
  margin-bottom: 1em;
}

#preview pre code {
  background-color: transparent;
  border: 0;
  display: block;
  line-height: inherit;
  margin: 0;
  overflow: visible;
  padding: 0;
  word-wrap: normal;
  color: #c9d1d9;
}

/* Mermaid diagram styling */
.mermaid-diagram {
  margin: 1em 0;
  padding: 1em;
  background-color: #f6f8fa;
  border-radius: 6px;
  overflow: auto;
}

#preview blockquote {
  border-left: 4px solid #dfe2e5;
  color: #6a737d;
  padding: 0 1em;
  margin: 0 0 1em 0;
}

#preview table {
  border-collapse: collapse;
  border-spacing: 0;
  margin: 1.5em 0;
  width: 100%;
  display: block;
  overflow-x: auto;
  border: 1px solid #e1e8ed;
  border-radius: 6px;
}

#preview table thead {
  background-color: #f6f8fa;
}

#preview table th,
#preview table td {
  border: 1px solid #e1e8ed;
  padding: 8px 12px;
  text-align: left;
}

#preview table th {
  background-color: #f6f8fa;
  font-weight: 600;
  color: #24292f;
}

#preview table tr:hover {
  background-color: #f6f8fa;
}

#preview table tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

#preview a {
  color: #0366d6;
  text-decoration: none;
}

#preview a:hover {
  text-decoration: underline;
}

#preview img {
  max-width: 100%;
  height: auto;
}

#preview hr {
  background-color: #e1e4e8;
  border: 0;
  height: 2px;
  margin: 1.5em 0;
}

#preview strong {
  font-weight: 600;
}

#preview em {
  font-style: italic;
}

#preview del {
  text-decoration: line-through;
  color: #6a737d;
}

/* KaTeX Math Styling */
#preview .katex {
  font-size: 1.1em;
}

#preview .katex-display {
  margin: 1.5em 0;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Code blocks with better styling */
#preview pre {
  position: relative;
}

#preview pre code.hljs {
  padding: 1em;
  border-radius: 6px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.5;
}

/* Footnotes styling */
#preview .footnote-ref {
  font-size: 0.85em;
  vertical-align: super;
  color: #0366d6;
  text-decoration: none;
}

#preview .footnote-ref:hover {
  text-decoration: underline;
}

#preview .footnotes {
  margin-top: 2em;
  padding-top: 1em;
  border-top: 1px solid #e1e4e8;
  font-size: 0.9em;
  color: #586069;
}

/* Task lists (GitHub style checkboxes) */
#preview input[type="checkbox"] {
  margin-right: 0.5em;
}

#preview li.task-list-item {
  list-style-type: none;
}

#preview li.task-list-item input {
  margin-left: -1.5em;
  margin-right: 0.5em;
}

/* Better list spacing */
#preview ul ul,
#preview ul ol,
#preview ol ul,
#preview ol ol {
  margin-top: 0.25em;
  margin-bottom: 0.25em;
}

/* Link styling */
#preview a code {
  color: #0366d6;
}

/* Improve inline code readability */
#preview p code,
#preview li code {
  background-color: rgba(175, 184, 193, 0.2);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 90%;
}