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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    width: 100%;
    height: 100vh;
}

/* 滚动条样式优化 */
/* Webkit浏览器 (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-2, rgba(0, 0, 0, 0.1));
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-3, rgba(0, 0, 0, 0.2));
    background-clip: padding-box;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-2, rgba(0, 0, 0, 0.1)) transparent;
}

/* 暗色细滚动条（用于编辑器/预览区） */
.thin-dark-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-3) transparent;
}

.thin-dark-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.thin-dark-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.thin-dark-scrollbar::-webkit-scrollbar-thumb {
    background: var(--color-border-3);
    border-radius: 3px;
}

.thin-dark-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-2);
}

/* Highlight.js CSS */
.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em;
  background: #f6f8fa;
  border-radius: 6px;
  color: #333;
}

.hljs-comment,
.hljs-quote {
  color: #6a737d;
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-addition {
  color: #d73a49;
}

.hljs-number,
.hljs-string,
.hljs-meta .hljs-string,
.hljs-literal,
.hljs-doctag,
.hljs-regexp {
  color: #032f62;
}

.hljs-title,
.hljs-section,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
  color: #6f42c1;
}

.hljs-attribute,
.hljs-attr,
.hljs-variable,
.hljs-template-variable,
.hljs-class .hljs-title,
.hljs-type {
  color: #005cc5;
}

.hljs-symbol,
.hljs-bullet,
.hljs-subst,
.hljs-meta,
.hljs-meta .hljs-keyword,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-link {
  color: #735c0f;
}

.hljs-built_in,
.hljs-deletion {
  color: #d73a49;
}

.hljs-formula {
  background: #f6f8fa;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: bold;
}

/* GitHub 风格的 Markdown 预览样式 */
.markdown-body {
  line-height: 1.6;
  color: #333;
  font-size: 14px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.25;
}

.markdown-body h1 { font-size: 2em; border-bottom: 1px solid #eaecef; padding-bottom: 0.3em; }
.markdown-body h2 { font-size: 1.5em; border-bottom: 1px solid #eaecef; padding-bottom: 0.3em; }
.markdown-body h3 { font-size: 1.25em; }
.markdown-body h4 { font-size: 1em; }
.markdown-body h5 { font-size: 0.875em; }
.markdown-body h6 { font-size: 0.85em; color: #6a737d; }

.markdown-body p {
  margin-top: 0;
  margin-bottom: 16px;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 2em;
  margin-top: 0;
  margin-bottom: 16px;
}

.markdown-body li {
  margin-top: 0.25em;
  margin-bottom: 0.25em;
}

.markdown-body blockquote {
  padding: 0 1em;
  color: #6a737d;
  border-left: 0.25em solid #dfe2e5;
  margin: 0 0 16px 0;
}

.markdown-body code {
  padding: 0.2em 0.4em;
  margin: 0;
  font-size: 85%;
  background-color: rgba(27, 31, 35, 0.05);
  border-radius: 3px;
  font-family: 'SF Mono', Monaco, Consolas, 'Courier New', monospace;
}

.markdown-body pre {
  padding: 16px;
  overflow: auto;
  font-size: 85%;
  line-height: 1.45;
  background-color: #f6f8fa;
  border-radius: 6px;
  margin-top: 0;
  margin-bottom: 16px;
}

.markdown-body pre code {
  padding: 0;
  margin: 0;
  background-color: transparent;
  border: 0;
}

.markdown-body table {
  border-spacing: 0;
  border-collapse: collapse;
  margin-top: 0;
  margin-bottom: 16px;
  display: block;
  width: 100%;
  overflow: auto;
}

.markdown-body table th,
.markdown-body table td {
  padding: 6px 13px;
  border: 1px solid #dfe2e5;
}

.markdown-body table th {
  font-weight: 600;
  background-color: #f6f8fa;
}

.markdown-body table tr:nth-child(even) {
  background-color: #f8f8f8;
}

.markdown-body img {
  max-width: 100%;
  box-sizing: content-box;
  background-color: #fff;
}

.markdown-body hr {
  height: 0.25em;
  padding: 0;
  margin: 24px 0;
  background-color: #e1e4e8;
  border: 0;
}

/* 打印样式 */
@media print {
  .no-print {
    display: none !important;
  }
  
  .markdown-body {
    max-width: 100%;
    margin: 0;
    padding: 20px;
    font-size: 12pt;
    line-height: 1.4;
  }
  
  .markdown-body h1 {
    font-size: 24pt;
    margin-bottom: 12pt;
    border-bottom: 1px solid #ccc;
  }
  
  .markdown-body h2 {
    font-size: 18pt;
    margin-bottom: 10pt;
    border-bottom: 1px solid #eee;
  }
  
  .markdown-body h3 {
    font-size: 14pt;
    margin-bottom: 8pt;
  }
  
  .markdown-body p {
    margin-bottom: 10pt;
  }
  
  .markdown-body ul,
  .markdown-body ol {
    margin-bottom: 10pt;
  }
  
  .markdown-body li {
    margin-bottom: 4pt;
  }
  
  .markdown-body table {
    border-collapse: collapse;
    margin-bottom: 12pt;
    width: 100%;
  }
  
  .markdown-body th,
  .markdown-body td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
  }
  
  .markdown-body th {
    background-color: #f5f5f5;
    font-weight: bold;
  }
  
  .markdown-body img {
    max-width: 100%;
    height: auto;
  }
  
  .markdown-body blockquote {
    border-left: 4px solid #ddd;
    margin: 16px 0;
    padding: 10px 20px;
    color: #666;
  }
  
  .markdown-body code {
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
  }
  
  .markdown-body pre {
    background-color: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
  }
  
  .markdown-body pre code {
    background-color: transparent;
    padding: 0;
  }
}

/* Markdown 标题锚点链接样式 */
.heading {
    position: relative;
    scroll-margin-top: 20px; /* 锚点跳转时的顶部偏移 */
}

.heading-anchor {
    opacity: 0;
    margin-left: 8px;
    color: rgb(var(--primary-6));
    text-decoration: none;
    font-size: 0.8em;
    font-weight: normal;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.heading:hover .heading-anchor {
    opacity: 1;
}

.heading-anchor:hover {
    text-decoration: none;
}

.heading-anchor:focus {
    opacity: 1;
    outline: none;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 拖拽分割条时禁止文本选中 */
body.resizing {
    user-select: none !important;
    cursor: inherit !important;
}

/* Tooltip 全局样式 */
.arco-tooltip {
    font-size: 12px !important;
}

.arco-tooltip-content {
    background: var(--color-bg-5) !important;
    color: var(--color-text-1) !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    max-width: 240px;
    line-height: 1.5;
    white-space: nowrap;
}

.arco-tooltip-content::before {
    background: var(--color-bg-5) !important;
}

.arco-tooltip-content-white {
    background: var(--color-bg-1) !important;
    border: 1px solid var(--color-border-2) !important;
    color: var(--color-text-1) !important;
}

.arco-tooltip-content-white::before {
    background: var(--color-bg-1) !important;
}