@charset "UTF-8";
.ͼ2 .cm-tooltip-below {
  z-index: var(--cdt-zindex-tooltip);
  box-shadow: var(--cdt-shadows-md);
  border: none;
  border-radius: var(--cdt-radius-lg);
  background-color: rgba(var(--cdt-color-background-default), 1);
  overflow: hidden;
}

.ͼ2 .cm-tooltip-above {
  z-index: var(--cdt-zindex-tooltip);
  box-shadow: var(--cdt-shadows-md);
  border: none;
  border-radius: var(--cdt-radius-lg);
  background-color: rgba(var(--cdt-color-background-default), 1);
  overflow: hidden;
}

.ͼ1 .cm-diagnostic-error {
  border-left: none;
}
.ͼ1 .cm-diagnostic-error::before {
  background-color: rgba(var(--cdt-color-text-danger), 1);
}

.ͼ1 .cm-diagnostic-warning {
  border-left: none;
}
.ͼ1 .cm-diagnostic-warning::before {
  background-color: rgba(var(--cdt-color-text-warning), 1);
}

.ͼ1 .cm-diagnostic {
  display: block;
  position: relative;
  margin-left: -1px;
  padding: 4px 8px 4px 16px;
  white-space: pre-wrap;
}
.ͼ1 .cm-diagnostic::before {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 8px;
  border-radius: 2px;
  width: 3px;
  content: "";
}

.ͼ2 .cm-tooltip-section:not(:first-child) {
  border-top-color: rgba(var(--cdt-color-border-default), 1);
}

.ͼ2 .cm-tooltip-autocomplete {
  display: flex;
  align-items: stretch;
  z-index: var(--cdt-zindex-tooltip);
  padding: 0;
  max-height: 240px;
  overflow: hidden;
  font-size: var(--cdt-font-sizes-sm);
  font-family: var(--font-sans);
}

.ͼ1 .cm-tooltip.cm-tooltip-autocomplete > ul {
  margin: 0;
  padding: 0;
  min-width: 200px;
  max-width: 240px;
  max-height: 240px;
  overflow-y: auto;
  list-style: none;
}
.ͼ1 .cm-tooltip.cm-tooltip-autocomplete > ul > li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
  margin: 0;
  border-bottom: none;
  padding: 0 0.5rem;
  height: 1.5rem;
  scroll-margin: 40px;
  scroll-padding: 40px;
  font-size: var(--cdt-font-sizes-sm);
  line-height: 1.5rem;
}
.ͼ1 .cm-tooltip.cm-tooltip-autocomplete > ul > li[role=option]:hover {
  background-color: rgba(var(--cdt-color-background-secondary), 1);
}
.ͼ1 .cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected] {
  background-color: rgba(var(--cdt-color-background-selected), 1);
  color: rgba(var(--cdt-color-text-accent), 1);
}
.ͼ1 .cm-tooltip.cm-tooltip-autocomplete > ul > li .cm-completionLabel {
  flex: 1;
}
.ͼ1 .cm-tooltip.cm-tooltip-autocomplete > ul > li .cm-completionDetail {
  margin-left: 0.5rem;
  color: rgba(var(--cdt-color-text-secondary), 0.5);
  font-style: normal;
}
.ͼ1 .cm-tooltip.cm-tooltip-autocomplete > ul > li .cm-section-title {
  color: rgba(var(--cdt-color-text-secondary), 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ͼ2 .cm-tooltip-expression-info {
  z-index: var(--cdt-zindex-tooltip);
  padding: 0.5rem;
  height: 100%;
}

.ͼ1 .cm-tooltip.cm-completionInfo {
  display: flex;
  position: relative;
  top: 0 !important;
  right: 0;
  left: 0;
  flex: 1;
  flex-direction: column;
  border-top: none;
  border-right: none;
  border-bottom: none;
  border-left: 1px solid rgba(var(--cdt-color-border-default), 1);
  background-color: rgba(var(--cdt-color-background-secondary), 1);
  padding: 0;
  width: 280px;
  max-width: 280px !important;
  max-height: 240px;
  overflow: hidden;
  font-family: var(--font-sans);
}

.ͼ1 .cm-completionInfo.cm-completionInfo-right {
  border-left: 1px solid rgba(var(--cdt-color-border-default), 1);
}

.ͼ2 .autocomplete-info-container {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.5rem;
  cursor: default;
  background-color: rgba(var(--cdt-color-background-secondary), 1);
  padding: 0.5rem;
  min-width: 240px;
  max-width: 320px;
  height: 100%;
  overflow-y: auto;
}

.autocomplete-info-header {
  color: rgba(var(--cdt-color-text-secondary), 0.5);
}

.autocomplete-info-name {
  margin-right: 0.25rem;
  color: rgba(var(--cdt-color-text-accent), 1);
  font-weight: var(--cdt-font-weights-medium);
}

.autocomplete-info-description {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.autocomplete-info-description a {
  cursor: pointer;
  color: rgba(var(--cdt-color-text-accent), 1);
  text-decoration: underline;
}

.autocomplete-info-examples-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 1rem;
}

.autocomplete-info-example {
  border: 1px solid rgba(var(--cdt-color-border-default), 1);
  border-radius: var(--cdt-radius-md);
  background-color: rgba(var(--cdt-color-background-default), 1);
  padding: 0.5rem;
  font-family: var(--font-mono);
}
.autocomplete-info-example code {
  white-space: pre-wrap;
  word-break: break-all;
}

.autocomplete-info-example-comment {
  color: rgba(var(--cdt-color-text-secondary), 0.5);
  font-style: italic;
}

.autocomplete-info-section-title {
  margin-bottom: 0.25rem;
  color: rgba(var(--cdt-color-text-accent), 1);
  font-weight: var(--cdt-font-weights-medium);
}

.autocomplete-info-args {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-left: 0.75rem;
}
.autocomplete-info-args li {
  list-style: disc;
  word-break: break-all;
}
.autocomplete-info-args .autocomplete-info-args {
  margin-top: 0.5rem;
}

.autocomplete-info-arg-name {
  color: rgba(var(--cdt-color-text-secondary), 0.5);
}

.ͼ1 .cm-completionMatchedText {
  color: rgba(var(--cdt-color-text-accent), 1);
  text-decoration: none;
}

/**
* 🎨 React Syntax Highlighter 自定义主题
* 
* 基于 CodeMirror 的颜色规则创建
* 使用与 style.scss 相同的 CSS 变量
*/
.react-syntax-highlighter {
  border-radius: 0;
  background-color: var(--code-editor-bg) !important;
  overflow: auto;
  color: var(--code-editor-fg) !important;
  font-family: var(--font-mono) !important;
}
.react-syntax-highlighter code {
  background-color: transparent !important;
  color: inherit !important;
  font-family: inherit !important;
}
.react-syntax-highlighter pre {
  margin: 0 !important;
  background-color: transparent !important;
}

.token.keyword,
.token.control,
.token.conditional,
.token.important {
  color: var(--code-syntax-keyword) !important;
}

.token.string,
.token.char,
.token.attr-value,
.token.regex {
  color: var(--code-syntax-string) !important;
}

.token.number,
.token.constant,
.token.symbol {
  color: var(--code-syntax-number) !important;
}

.token.boolean {
  color: var(--code-syntax-boolean) !important;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--code-syntax-comment) !important;
  font-style: italic;
}

.token.function,
.token.method,
.token.function-name {
  color: var(--code-syntax-function) !important;
}

.token.property,
.token.tag,
.token.selector,
.token.attr-name,
.token.namespace {
  color: var(--code-syntax-property) !important;
}

.token.operator,
.token.entity,
.token.url,
.token.punctuation {
  color: var(--code-syntax-operator) !important;
}

.token.variable,
.token.parameter,
.token.class-name,
.token.builtin {
  color: var(--code-syntax-variable) !important;
}

.token.deleted {
  background-color: color-mix(in srgb, var(--code-error-bg) 20%, transparent) !important;
  color: var(--code-error-bg) !important;
}

.token.inserted {
  background-color: color-mix(in srgb, var(--code-syntax-string) 20%, transparent) !important;
  color: var(--code-syntax-string) !important;
}

.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}

.linenumber {
  padding-right: 1em;
  min-width: 3em;
  color: var(--code-ui-gutter-text) !important;
  user-select: none;
  text-align: right;
}

.highlight-line {
  display: block;
  margin: 0 -1rem;
  background-color: var(--code-ui-active-line) !important;
  padding: 0 1rem;
}

.react-syntax-highlighter ::selection {
  background-color: var(--code-ui-selection) !important;
}

.language-json .token.property {
  color: var(--code-syntax-property) !important;
}
.language-json .token.string {
  color: var(--code-syntax-string) !important;
}
.language-json .token.number {
  color: var(--code-syntax-number) !important;
}
.language-json .token.boolean,
.language-json .token.null {
  color: var(--code-syntax-boolean) !important;
}
.language-json .token.punctuation {
  color: var(--code-syntax-operator) !important;
}

.react-syntax-highlighter {
  scrollbar-color: var(--code-ui-gutter-text) var(--code-ui-gutter);
  scrollbar-width: thin;
}
.react-syntax-highlighter::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.react-syntax-highlighter::-webkit-scrollbar-track {
  border-radius: 4px;
  background: var(--code-ui-gutter);
}
.react-syntax-highlighter::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: var(--code-ui-gutter-text);
}
.react-syntax-highlighter::-webkit-scrollbar-thumb:hover {
  background: var(--code-syntax-comment);
}

.react-syntax-highlighter {
  padding: 1rem !important;
}
@media (max-width: 640px) {
  .react-syntax-highlighter {
    padding: 0.75rem !important;
    font-size: 0.875rem !important;
  }
}

.react-syntax-highlighter-inline {
  display: inline !important;
  border-radius: 4px !important;
  background-color: var(--code-ui-gutter) !important;
  padding: 0.125rem 0.25rem !important;
  font-size: 0.875em !important;
}

/**
 * 🎨 CodeMirror 主题系统 - 完全基于 SCSS
 * 
 * 功能：
 * - 主题变量定义（亮色/暗色）
 * - CodeMirror 完整样式覆盖
 * - 响应式设计支持
 * - 语义化的颜色命名
 * 
 * 架构：TypeScript 只负责语法高亮规则，所有视觉样式由 SCSS 统一管理
 */
:root {
  --code-editor-bg: var(--background-default, #ffffff);
  --code-editor-fg: var(--color-default-foreground, rgba(0, 0, 0, 0.9));
  --code-editor-border: var(--boundary-default, #e6e6e6);
  --code-editor-border-focus: var(--boundary-selected-strong, #0d99ff);
  --code-editor-caret: var(--color-default-foreground, rgba(0, 0, 0, 0.9));
  --code-syntax-keyword: #cb0b96;
  --code-syntax-string: #c53e0d;
  --code-syntax-number: #0768cf;
  --code-syntax-boolean: #c53e0d;
  --code-syntax-comment: #888;
  --code-syntax-function: #cb0b96;
  --code-syntax-property: #093077;
  --code-syntax-operator: #093077;
  --code-syntax-variable: #0768cf;
  --code-ui-selection: rgba(0, 0, 0, 0.2);
  --code-ui-active-line: transparent;
  --code-ui-matching-bracket: rgba(50, 140, 130, 0.32);
  --code-ui-gutter: var(--background-default, #ffffff);
  --code-ui-gutter-text: rgba(0, 0, 0, 0.3);
  --code-error-bg: var(--foreground-danger, #dc3412);
  --code-error-fg: var(--foreground-on-accent, #ffffff);
  --color-scrollbar: rgba(0, 0, 0, 0.2);
  --color-scrollbar-hover: rgba(0, 0, 0, 0.4);
}

.dark,
[data-theme=dark] {
  --code-syntax-keyword: #fc9ce0;
  --code-syntax-string: #fcb34a;
  --code-syntax-number: #d1a8ff;
  --code-syntax-boolean: #fcb34a;
  --code-syntax-comment: #888;
  --code-syntax-function: #fc9ce0;
  --code-syntax-property: #7cc4f8;
  --code-syntax-operator: #7cc4f8;
  --code-syntax-variable: #d1a8ff;
  --code-ui-selection: rgba(255, 255, 255, 0.2);
  --code-ui-active-line: transparent;
  --code-ui-matching-bracket: rgba(50, 140, 130, 0.32);
  --code-ui-gutter: var(--background-default, #2c2c2c);
  --code-ui-gutter-text: rgba(255, 255, 255, 0.4);
  --code-error-bg: var(--foreground-danger, #e0421c);
  --code-error-fg: var(--foreground-on-accent, #ffffff);
  --color-scrollbar: rgba(255, 255, 255, 0.2);
  --color-scrollbar-hover: rgba(255, 255, 255, 0.4);
}

.cm-editor {
  display: flex;
  flex-direction: column;
  cursor: text;
  border: none;
  border-radius: 0;
  background-color: transparent;
  height: 100%;
  color: var(--code-editor-fg);
  font-size: 11px;
  font-family: var(--font-mono);
}
.cm-editor.cm-focused {
  outline: none;
  border-color: transparent;
}
.cm-editor .cm-content {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  padding-left: 0.5rem;
  caret-color: var(--code-editor-caret);
  line-height: 1.4;
  font-family: var(--font-mono);
}
.cm-editor .cm-content[contenteditable=false] {
  caret-color: transparent;
}
.cm-editor .cm-content:where([data-expanded=true] .cm-content) {
  padding: 1rem;
}
.cm-editor .cm-cursor,
.cm-editor .cm-dropCursor {
  border-left: 2px solid var(--code-editor-caret);
}
.cm-editor.cm-focused > .cm-scroller .cm-selectionLayer > .cm-selectionBackground, .cm-editor .cm-selectionBackground, .cm-editor .cm-content ::selection {
  background: var(--code-ui-selection);
}
.cm-editor .cm-selectionMatch, .cm-editor .cm-selectionMatch-main {
  background: var(--code-ui-selection);
}
.cm-editor .cm-line {
  padding: 0;
  line-height: var(--cdt-font-line-heights-snug);
}
.cm-editor .cm-activeLine {
  background-color: var(--code-ui-active-line);
}
.cm-editor .cm-gutters {
  border: 0;
  border-radius: 4px;
  background-color: var(--code-ui-gutter);
  color: var(--code-ui-gutter-text);
  user-select: none;
  cursor: default;
}
.cm-editor .cm-activeLineGutter {
  background-color: var(--code-ui-active-line);
  color: var(--code-editor-caret);
}
.cm-editor .cm-lineNumbers .cm-gutterElement {
  padding: 0 3px 0 5px;
  cursor: default;
}
.cm-editor .cm-gutterElement {
  padding: 0;
  user-select: none;
  cursor: default;
}
.cm-editor .cm-scroller {
  max-height: var(--editor-max-height, 100%);
  overflow: auto;
}
.cm-editor .cm-scroller:not([style*="--editor-is-readonly: true"]) {
  min-height: var(--editor-min-height, auto);
}
.cm-editor .cm-scroller {
  scrollbar-width: thin;
  scrollbar-color: var(--color-scrollbar) transparent;
}
.cm-editor .cm-scroller::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.cm-editor .cm-scroller::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
}
.cm-editor .cm-scroller::-webkit-scrollbar-thumb {
  background: var(--color-scrollbar);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.cm-editor .cm-scroller::-webkit-scrollbar-thumb:hover {
  background: var(--color-scrollbar-hover);
  background-clip: padding-box;
}
.cm-editor .cm-scroller::-webkit-scrollbar-corner {
  background: transparent;
}
.cm-editor .cm-gutter,
.cm-editor .cm-content {
  min-height: var(--editor-min-height, 1.5rem);
}
.cm-editor .cm-gutter[style*="--editor-rows: -1"], .cm-editor .cm-gutter[style*="--editor-rows: auto"],
.cm-editor .cm-content[style*="--editor-rows: -1"],
.cm-editor .cm-content[style*="--editor-rows: auto"] {
  min-height: auto;
}
.cm-editor .cm-foldGutter {
  width: 16px;
}
.cm-editor .cm-fold-marker {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
  height: 100%;
}
.cm-editor .cm-fold-marker:hover {
  transform: scale(1.1);
  opacity: 1;
}
.cm-editor .cm-activeLineGutter .cm-fold-marker {
  opacity: 0.9;
}
.cm-editor .cm-foldPlaceholder {
  border: 1px solid var(--code-editor-border);
  background-color: var(--code-editor-bg);
  color: var(--code-syntax-comment);
  cursor: default;
}
.cm-editor .cm-foldPlaceholder:hover {
  color: var(--code-editor-fg);
}
.cm-editor .cm-matchingBracket {
  background: transparent;
}
.cm-editor .cm-completionMatchedText {
  color: var(--code-syntax-keyword);
  font-weight: 600;
  text-decoration: none;
}
.cm-editor .cm-lintPoint-error {
  border-radius: 2px;
  background-color: var(--code-error-bg);
  padding: 0 1px;
  color: var(--code-error-fg);
}
.cm-editor .cm-lintPoint-error:after {
  content: none;
}
.cm-editor .cm-diagnostic-error {
  background-color: var(--background-secondary);
}
.cm-editor .cm-diagnosticText {
  color: var(--color-default-foreground);
  font-size: 12px;
}
.cm-editor .cm-diagnosticAction {
  cursor: pointer;
  margin-left: 0.2em;
  background-color: inherit;
  color: var(--code-editor-border-focus);
  line-height: 16px;
  text-decoration: underline;
}
.cm-editor .cm-diagnosticDocs {
  font-size: 11px;
}
.cm-editor .cm-panel.cm-search {
  padding: 2px 6px 4px;
}
.cm-editor .cm-panels {
  background: var(--foreground-tertiary);
  color: var(--color-default-foreground);
}
.cm-editor .cm-panels-bottom {
  border-top: 1px solid var(--code-editor-border);
}
.cm-editor .cm-textfield {
  border: 1px solid var(--code-editor-border);
  border-radius: 4px;
  background: inherit;
  color: var(--color-black);
  font-size: 90%;
}
.cm-editor .cm-textfield:focus {
  outline: none;
  border-color: var(--code-editor-border-focus);
}
.cm-editor .cm-panel button {
  color: var(--color-default-foreground);
}
.cm-editor .cm-panel input[type=checkbox] {
  outline: none;
  border: 1px solid var(--code-editor-border);
}
.cm-editor .cm-panel input[type=checkbox]:hover {
  outline: none;
  border: 1px solid var(--code-editor-border);
}
.cm-editor .cm-panel.cm-search label {
  display: inline;
  font-size: 90%;
}
.cm-editor .cm-button {
  outline: none;
  border: 1px solid var(--code-editor-border);
  border-radius: 4px;
  background-image: none;
  background-color: var(--color-white);
  color: var(--color-black);
  font-size: 90%;
}
.cm-editor .cm-faded > span {
  opacity: 0.6;
}
.cm-editor[style*="--editor-is-readonly: true"] .cm-content {
  caret-color: transparent !important;
}
.cm-editor[style*="--editor-is-readonly: true"] .cm-content[contenteditable=false] {
  caret-color: transparent !important;
}
.cm-editor[style*="--editor-is-readonly: true"] .cm-scroller {
  min-height: auto;
}
.cm-editor[style*="--editor-is-readonly: true"] .cm-gutter,
.cm-editor[style*="--editor-is-readonly: true"] .cm-content {
  min-height: auto;
}

.js-editor-container .cm-editor .cm-gutters {
  background-color: var(--background-secondary, #f5f5f5) !important;
}

.js-editor-container .cm-editor .cm-activeLineGutter {
  background-color: var(--background-secondary, #f5f5f5) !important;
}