/* editor-theme.css
   自动生成：为 Lexical 编辑器提供统一主题类
   路径: apps/lowcode/src/components/RichEditor/editor-theme.css
   说明：此文件对应 ThemeConfig.tsx 中的 key。所有样式使用 CSS 变量以便项目中统一覆盖。
*/

:root {
    /* --page-max-width: 1280px; */
    --editor-font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    --editor-font-size: 1em; /* 16px → 1em */
    --editor-line-height: 1.6;
    --editor-bg: transparent;
    --editor-placeholder-color: #9aa4b2;
    --editor-highlight-bg: rgba(255, 229, 100, 0.2);
    --editor-tokenAttr: #d19a66;
    --editor-tokenProperty: #e06c75;
    --editor-tokenSelector: #98c379;
    --editor-tokenComment: #7f848a;
    --editor-tokenFunction: #61afef;
    --editor-tokenVariable: #c678dd;
    --editor-tokenOperator: #56b6c2;
    --editor-tokenPunctuation: #abb2bf;
}

body {
    overflow-x: hidden;
}

.s_text {
    user-select: text;
    /* white-space: pre-wrap; */
    word-break: break-word;
}

/* 文本方向 */
[dir='ltr'] {
    text-align: left;
    direction: ltr;
}

[dir='rtl'] {
    text-align: right;
    direction: rtl;
}
.editor-inner {
    position: relative;
    background: #fff;
    border-radius: 0 0 6px 6px
}

.editor-input {
    min-height: 200px;
    padding: 12px;
    outline: none;
    font-size: 14px;
    line-height: 1.5;
    color: #000000e0
}

.editor-input:focus {
    outline: none
}

.editor-placeholder {
    position: absolute;
    top: 12px;
    left: 12px;
    color: #00000040;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
    font-size: 14px
}

.editor-error {
    padding: 12px;
    color: #ff4d4f;
    background: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 4px;
    font-size: 14px
}

.editor-text-bold {
    font-weight: 700
}

.editor-text-italic {
    font-style: italic;
    display: inline-block;
    transform: skew(-10deg);
    font-family: inherit,"Times New Roman",serif
}

.editor-text-underline {
    text-decoration: underline
}

.editor-text-strikethrough {
    text-decoration: line-through
}

.editor-text-code {
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: Courier New,Courier,monospace;
    font-size: .9em
}

.editor-paragraph {
    /** 会导致段落之间有间距，与设计不一致 */
    /* margin: 0 0 8px; */
    position: relative
}

.editor-paragraph:last-child {
    margin-bottom: 0
}

.editor-heading-h1 {
    font-size: 2em;
    font-weight: 700;
    margin: 16px 0 8px;
    line-height: 1.3
}

.editor-heading-h2 {
    font-size: 1.5em;
    font-weight: 700;
    margin: 14px 0 8px;
    line-height: 1.35
}

.editor-heading-h3 {
    font-size: 1.25em;
    font-weight: 600;
    margin: 12px 0 8px;
    line-height: 1.4
}

.editor-heading-h4 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 10px 0 8px;
    line-height: 1.45
}

.editor-heading-h5 {
    font-size: 1em;
    font-weight: 600;
    margin: 8px 0;
    line-height: 1.5
}

.editor-heading-h6 {
    font-size: .875em;
    font-weight: 600;
    margin: 8px 0;
    line-height: 1.5;
    color: #000000bf
}

.editor-link {
    color: #1890ff;
    text-decoration: none
}

.editor-link:hover {
    text-decoration: underline
}

.editor-link:visited {
    color: #722ed1
}

.editor-list-ol,.editor-list-ul {
    padding: 0;
    margin: 0 0 8px 24px
}

.editor-list-ol {
    list-style-type: decimal
}

.editor-list-ul {
    list-style-type: disc
}

.editor-listitem {
    margin: 4px 0
}

.editor-nested-listitem {
    list-style-type: none
}

.editor-code {
    background-color: #f5f5f5;
    font-family: Courier New,Courier,monospace;
    display: block;
    padding: 12px;
    line-height: 1.5;
    font-size: 13px;
    margin: 8px 0;
    border-radius: 4px;
    overflow-x: auto;
    border: 1px solid #e8e8e8
}

.editor-table {
    border-collapse: collapse;
    border: 1px solid #d9d9d9;
    width: 100%;
    margin: 12px 0
}

.editor-table-cell,.editor-table-cell-header {
    border: 1px solid #d9d9d9;
    padding: 8px 12px;
    min-width: 75px;
    vertical-align: top
}

.editor-table-cell-header {
    background-color: #fafafa;
    font-weight: 600;
    text-align: left
}

.editor-token-comment {
    color: #6a9955
}

.editor-token-keyword {
    color: #569cd6
}

.editor-token-string {
    color: #ce9178
}

.editor-token-function {
    color: #dcdcaa
}

.editor-token-number {
    color: #b5cea8
}

.editor-token-operator,.editor-token-punctuation {
    color: #d4d4d4
}

.editor-token-class-name,.editor-token-builtin {
    color: #4ec9b0
}

.editor-token-boolean,.editor-token-tag {
    color: #569cd6
}

.editor-token-attr,.editor-token-property {
    color: #9cdcfe
}

/* 原生语义标签映射（显式复制规则,保持纯 CSS 兼容性） */
h1 {
    font-size: 2em; /* 2em → 2em */
    /* margin: 0.67em 0; 0.67em → 0.67em */
    margin: 0;
    font-weight: 400;
}

h2 {
    font-size: 1.75em; /* 1.75em → 1.75em */
    /* margin: 0.83em 0; 0.83em → 0.83em */
    margin: 0;
    font-weight: 400;
}

h3 {
    font-size: 1.5em; /* 1.5em → 1.5em */
    /* margin: 1em 0; 1em → 1em */
    margin: 0;
    font-weight: 400;
}

h4 {
    font-size: 1.25em; /* 1.25em → 1.25em */
    /* margin: 1.33em 0; 1.33em → 1.33em */
    margin: 0;
    font-weight: 400;
}

h5 {
    font-size: 1em; /* 1em → 1em */
    /* margin: 1.67em 0; 1.67em → 1.67em */
    margin: 0;
    font-weight: 400;
}

.h6 {
    font-size: 0.8em;
    /* 1em → 1em */
    margin: 0;
    /* 1.67em → 1.67em */
    font-weight: 400;
}

p {
    /* margin: 0 0 1em 0; 1em → 1em */
    margin: 0;
    font-family: var(--editor-font-family);
    font-size: var(--editor-font-size);
}

blockquote {
    border-left: 0.25em solid rgba(0, 0, 0, 0.08); /* 4px → 0.25em */
    padding-left: 1em;
    color: rgba(0, 0, 0, 0.65);
    margin: 0 0 1em 0; /* 1em → 1em */
}

pre {
    background: #0b0f13;
    color: #e6eef6;
    padding: 1em; /* 1em → 1em */
    border-radius: 0.375em; /* 6px → 0.375em */
    overflow: auto;
}

code {
    font-family: Menlo, Monaco, 'Courier New', monospace;
    background: rgba(27, 31, 35, 0.05);
    padding: 0.1em 0.25em; /* 0.1em 0.25em → 0.1em 0.25em */
    border-radius: 0.1875em; /* 3px → 0.1875em */
}

ul {
    padding-left: 1.75em; /* 1.75em → 1.75em */
}

ol {
    padding-left: 1.75em; /* 1.75em → 1.75em */
}

li {
    margin: 0.25em 0; /* 0.25em → 0.25em */
}

/* 列表 */
.editor-list-ol {
    padding-left: 1.75em; /* 1.75em → 1.75em */
}

.editor-list-ul {
    padding-left: 1.75em; /* 1.75em → 1.75em */
}

.editor-listitem {
    margin: 0.25em 0; /* 0.25em → 0.25em */
}

.editor-nested-listitem {
    margin-left: 1em; /* 1em → 1em */
}

/* 图片 & 链接 */
.editor-image {
    display: block;
    max-width: 100%;
    height: auto;
}

.editor-link {
    color: #0969da;
    text-decoration: underline;
}

/* 文本样式 */
.editor-text-bold {
    font-weight: 700;
}

.editor-text-italic {
    font-style: italic;
}

.editor-text-overflowed {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.editor-text-hashtag {
    color: #0366d6;
}

.editor-text-underline {
    text-decoration: underline;
}

.editor-text-strikethrough {
    text-decoration: line-through;
}

.editor-text-underlineStrikethrough {
    text-decoration: underline line-through;
}

.editor-text-code {
    font-family: Menlo, Monaco, 'Courier New', monospace;
    background: rgba(27, 31, 35, 0.05);
    padding: 0.1em 0.25em; /* 0.1em 0.25em → 0.1em 0.25em */
    border-radius: 0.1875em; /* 3px → 0.1875em */
}

/* 代码块 */
.editor-code {
    background: #0b0f13;
    color: #e6eef6;
    padding: 1em; /* 1em → 1em */
    border-radius: 0.375em; /* 6px → 0.375em */
    overflow: auto;
}

/* 代码高亮 token 类映射 */
.editor-tokenAttr {
    color: var(--editor-tokenAttr);
}

.editor-tokenProperty {
    color: var(--editor-tokenProperty);
}

.editor-tokenSelector {
    color: var(--editor-tokenSelector);
}

.editor-tokenComment {
    color: var(--editor-tokenComment);
    font-style: italic;
}

.editor-tokenFunction {
    color: var(--editor-tokenFunction);
}

.editor-tokenVariable {
    color: var(--editor-tokenVariable);
}

.editor-tokenOperator {
    color: var(--editor-tokenOperator);
}

.editor-tokenPunctuation {
    color: var(--editor-tokenPunctuation);
}

/* 统一可编辑区域基础样式 */
.lexical-editor {
    min-height: 12.5em; /* 200px → 12.5em */
    padding: 0.75em 1em; /* 12px 16px → 0.75em 1em */
    background: var(--editor-bg);
    font-family: var(--editor-font-family);
    font-size: var(--editor-font-size);
    outline: none;
}

/* 可访问性与聚焦 */
.lexical-editor:focus {
    box-shadow: 0 0 0 0.1875em rgba(16, 124, 255, 0.12); /* 3px → 0.1875em */
}

/* 工具专用小类（帮助工具栏读取状态） */
.editor-text-bold[aria-pressed='true'],
.editor-text-italic[aria-pressed='true'] {
    outline: 0.125em dashed rgba(0, 0, 0, 0.05); /* 2px → 0.125em */
}

/* 链接外观微调 */
.editor-link:hover {
    text-decoration: none;
}

/* 颜色与背景快捷类 */
.editor-bg-highlight {
    background: var(--editor-highlight-bg);
}

/* 行内样式覆盖（如果需要通过 JS 设置 style 属性） */
/* 例如：element.style.fontSize = '18px' 时，下面的选择器可保证优先展示 */
.editor-paragraph[style] {
    font-size: inherit;
}


/** 默认的a标签样式 */
a {
    color: inherit;
    text-decoration: none;
    letter-spacing: inherit;
    display: inline-block;
    cursor: pointer;
}
a:link,
a:visited,
a:active {
    text-decoration: none;
    color: inherit;
}
a:hover,
a:focus {
    text-decoration: underline;
    outline: none;
}


/* 高对比度支持 */
@media (prefers-contrast: more) {
    :root {
        --editor-color: #000;
    }

    .editor-quote {
        border-left-color: rgba(0, 0, 0, 0.2);
    }
}


/** 默认元素样式 **/
/* .ce-button:not(#root) {
    transition: all 0.3s ease;
} */
/** 默认元素样式 **/
/* 默认有动画 */
.ce-button {
    transition: all 0.3s ease;
}

/* 在 #root 内部则取消动画 */
#root{
    .ce-button {
        transition: none;
    }
    .ce-tree{
        .ce-tree-expand-placeholder{
            transition: none;
        }
        .ce-tree-expand-btn svg{
            transition: none;
        }
        .ce-tree-expand-open svg{
            transition: none;
        }
        .ce-tree-label{
            transition: none;
        }
        .ce-tree-expanded .ce-tree-expand-btn svg{
            transition: none;
        }
        .ce-tree-children{
            transition: none;
        }

    }

    /** preview css reset **/
    .ce-section > .ce-container__responsive{
        margin: 0 auto;
    }
}

