/*!
 * 纯文本 / 源代码编辑器 — yicool.com.cn /tools/notepad
 * 复刻 Notepad++ 经典界面：菜单栏 / 工具栏 / 标签页 / 编辑区 / 状态栏。
 *
 * 配色分两套：明亮（Notepad++ 经典）与暗色（Obsidian 风格），用 [data-theme] 切换。
 * 正文语法高亮由 CodeMirror 的 .cm-* 类承载，颜色全部走本文件定义的 --np-* 变量。
 * 断点：≥1100px 完整工具栏；≤1099px 工具栏可横向滚动；≤767px 隐藏菜单栏文字留图标、状态栏精简。
 */

/* ---------- 解除整屏限宽（保留左侧导航） ---------- */
body.page-notepad-full .app,
body.page-notepad-full .main-content { max-width: 100%; width: 100%; }

.np-app {
    --np-chrome: 130px;          /* 站点顶栏高度，由 notepad.js 实测回填 */
    --np-bg: #ffffff;
    --np-fg: #1f2328;
    --np-mute: #6b7280;
    --np-line: #d7d7d7;
    --np-chrome-bg: #f0f0f0;
    --np-chrome-bg2: #e6e6e6;
    --np-hover: #dceaf7;
    --np-accent: #136ce9;
    --np-tab-bg: #e9e9e9;
    --np-tab-on: #ffffff;
    --np-tab-line: #136ce9;
    --np-field: #ffffff;
    --np-field-line: #cfcfcf;
    --np-shadow: rgba(0, 0, 0, .18);

    /* 语法高亮（Notepad++ 经典配色） */
    --np-keyword: #0000ff;
    --np-string: #a31515;
    --np-comment: #008000;
    --np-number: #ff8000;
    --np-def: #0070c0;
    --np-var: #1f2328;
    --np-var2: #0070c0;
    --np-prop: #000080;
    --np-operator: #1f2328;
    --np-tag: #800000;
    --np-attr: #ff0000;
    --np-meta: #6b7280;
    --np-builtin: #792e8e;
    --np-type: #2b91af;
    --np-error: #ff0000;
    --np-heading: #0000ff;
    --np-link: #0563c1;

    /* 编辑区细节 */
    --np-gutter-bg: #ffffff;
    --np-gutter-fg: #8a8a8a;
    --np-curline: rgba(0, 0, 0, .045);
    --np-curgutter: rgba(0, 0, 0, .06);
    --np-select: #cfe4ff;
    --np-select-blur: #e8e8e8;
    --np-bracket: #ffff00;
    --np-bracket-bd: #ffaa00;
    --np-guide: rgba(0, 0, 0, .16);
    --np-fold: #6b7280;
    --np-searching: #fdfd96;
    --np-searching-bd: #e8e86a;
    --np-bm: #136ce9;
    --np-trail: rgba(255, 0, 0, .22);

    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--np-chrome));
    min-height: 400px;
    overflow: hidden;
    color: var(--np-fg);
    background: var(--np-bg);
    font-size: 13px;
}
.np-app * { box-sizing: border-box; }
.np-app button { font-family: inherit; font-size: inherit; }

/* ---------- 暗色主题 ---------- */
.np-app[data-theme="dark"] {
    --np-bg: #293134;
    --np-fg: #e0e2e4;
    --np-mute: #93a1a1;
    --np-line: #1c2124;
    --np-chrome-bg: #2f373a;
    --np-chrome-bg2: #262c2f;
    --np-hover: #3c474b;
    --np-tab-bg: #23292c;
    --np-tab-on: #293134;
    --np-field: #1f2427;
    --np-field-line: #3d464a;
    --np-shadow: rgba(0, 0, 0, .5);

    --np-keyword: #93c763;
    --np-string: #ec7600;
    --np-comment: #7d8c93;
    --np-number: #ffcd22;
    --np-def: #678cb1;
    --np-var: #e0e2e4;
    --np-var2: #8fa8bf;
    --np-prop: #a8b3c4;
    --np-operator: #e0e2e4;
    --np-tag: #93c763;
    --np-attr: #ec7600;
    --np-meta: #93a1a1;
    --np-builtin: #d39760;
    --np-type: #599eab;
    --np-error: #ff5b5b;
    --np-heading: #93c763;
    --np-link: #7bb0e0;

    --np-gutter-bg: #293134;
    --np-gutter-fg: #6f7d80;
    --np-curline: rgba(255, 255, 255, .045);
    --np-curgutter: rgba(255, 255, 255, .06);
    --np-select: #3f5663;
    --np-select-blur: #354248;
    --np-bracket: rgba(255, 255, 0, .3);
    --np-bracket-bd: #ffaa00;
    --np-guide: rgba(255, 255, 255, .13);
    --np-fold: #93a1a1;
    --np-searching: rgba(255, 210, 0, .35);
    --np-searching-bd: #e8c84a;
    --np-bm: #7bb0e0;
    --np-trail: rgba(255, 90, 90, .3);
}

/* ================= 菜单栏 ================= */
.np-menubar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1px;
    min-height: 27px;
    padding: 0 4px;
    background: var(--np-chrome-bg);
    border-bottom: 1px solid var(--np-line);
    user-select: none;
    overflow-x: auto;
    scrollbar-width: thin;
}
.np-menu { position: relative; }
.np-menu-btn {
    min-height: 25px;
    padding: 0 9px;
    color: var(--np-fg);
    background: transparent;
    border: 0;
    border-radius: 3px;
    cursor: default;
}
.np-menu.open > .np-menu-btn,
.np-menu-btn:hover { background: var(--np-hover); }
.np-menu-btn:focus-visible { outline: 2px solid var(--np-accent); outline-offset: -2px; }

.np-pop {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 60000;
    min-width: 200px;
    max-height: min(70dvh, 520px);
    overflow-y: auto;
    padding: 4px 0;
    background: var(--np-chrome-bg);
    border: 1px solid var(--np-line);
    border-radius: 4px;
    box-shadow: 0 8px 26px var(--np-shadow);
}
.np-pop[hidden] { display: none !important; }
.np-mi {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 4px 12px;
    color: var(--np-fg);
    background: transparent;
    border: 0;
    text-align: left;
    white-space: nowrap;
    cursor: default;
}
.np-mi:hover:not([disabled]) { background: var(--np-hover); }
.np-mi[disabled] { opacity: .45; }
.np-mi:focus-visible { outline: 2px solid var(--np-accent); outline-offset: -2px; }
.np-mi-txt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.np-mi-key { flex: 0 0 auto; color: var(--np-mute); font-size: 11.5px; }
.np-mi-on::before { content: '✓'; flex: 0 0 auto; width: 12px; color: var(--np-accent); font-weight: 700; }
.np-mi-off::before { content: ''; flex: 0 0 auto; width: 12px; }
.np-pop-sep { height: 1px; margin: 4px 8px; background: var(--np-line); }
.np-pop-head { padding: 4px 12px 2px; font-size: 11.5px; font-weight: 700; color: var(--np-mute); }

/* ================= 工具栏 ================= */
.np-toolbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: 34px;
    padding: 3px 6px;
    background: var(--np-chrome-bg);
    border-bottom: 1px solid var(--np-line);
    overflow-x: auto;
    scrollbar-width: thin;
}
.np-tb {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: var(--np-fg);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
}
.np-tb svg { width: 17px; height: 17px; }
.np-tb:hover { background: var(--np-hover); border-color: var(--np-line); }
.np-tb.is-on { background: var(--np-hover); border-color: var(--np-accent); }
.np-tb.is-rec { background: color-mix(in srgb, #ef4444 20%, transparent); border-color: #ef4444; }
.np-tb:focus-visible { outline: 2px solid var(--np-accent); outline-offset: 1px; }
.np-tb[disabled] { opacity: .4; }
.np-tb-sep { flex: 0 0 auto; width: 1px; height: 20px; margin: 0 4px; background: var(--np-line); }
.np-tb-push { flex: 1 1 auto; }
.np-macro {
    flex: 0 0 auto;
    padding: 2px 9px;
    font-size: 12px;
    color: #fff;
    background: #ef4444;
    border-radius: 999px;
}
.np-macro[hidden] { display: none !important; }

/* ================= 标签页 ================= */
.np-tabs {
    flex: 0 0 auto;
    display: flex;
    align-items: stretch;
    gap: 2px;
    min-height: 30px;
    padding: 3px 6px 0;
    background: var(--np-chrome-bg);
    border-bottom: 1px solid var(--np-line);
    overflow-x: auto;
    scrollbar-width: thin;
}
.np-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
    padding: 0 6px 0 11px;
    color: var(--np-fg);
    background: var(--np-tab-bg);
    border: 1px solid var(--np-line);
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    white-space: nowrap;
}
.np-tab.is-on {
    background: var(--np-tab-on);
    box-shadow: inset 0 2px 0 var(--np-tab-line);
    font-weight: 600;
}
.np-tab-name { overflow: hidden; text-overflow: ellipsis; }
.np-tab-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; }
.np-tab-dot[hidden] { display: none !important; }
.np-tab-x {
    flex: 0 0 auto;
    width: 17px; height: 17px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--np-mute);
    background: transparent;
    border: 0; border-radius: 3px;
    cursor: pointer;
    font-size: 15px; line-height: 1;
}
.np-tab-x:hover { background: var(--np-hover); color: var(--np-fg); }

/* ================= 编辑区 ================= */
.np-body { flex: 1 1 auto; display: flex; min-height: 0; overflow: hidden; }
.np-pane { flex: 1 1 50%; min-width: 0; min-height: 0; position: relative; overflow: hidden; }
.np-pane[hidden] { display: none !important; }
.np-body.is-split-v { flex-direction: column; }
.np-body:not(.is-split) .np-pane + .np-pane { border-left: 1px solid var(--np-line); }
.np-body.is-split-v .np-pane + .np-pane { border-left: 0; border-top: 1px solid var(--np-line); }

/* ================= 状态栏 ================= */
.np-status {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 24px;
    padding: 0 4px;
    background: var(--np-chrome-bg);
    border-top: 1px solid var(--np-line);
    font-size: 12px;
    color: var(--np-fg);
    overflow-x: auto;
    scrollbar-width: thin;
}
.np-st {
    flex: 0 0 auto;
    padding: 0 10px;
    border-right: 1px solid var(--np-line);
    white-space: nowrap;
    cursor: default;
}
.np-st:last-child { border-right: 0; }
.np-st-push { flex: 1 1 auto; border: 0; }
.np-st-lang { font-weight: 600; cursor: pointer; }
.np-st-lang:hover { background: var(--np-hover); }
.np-st-ro[hidden] { display: none !important; }
.np-st-ro { color: #ef4444; font-weight: 600; }

/* ================= 查找 / 替换面板 ================= */
.np-find {
    position: absolute;
    top: 34px; right: 18px;
    z-index: 70000;
    width: min(560px, calc(100% - 36px));
    background: var(--np-chrome-bg);
    border: 1px solid var(--np-line);
    border-radius: 7px;
    box-shadow: 0 14px 40px var(--np-shadow);
    overflow: hidden;
}
.np-find[hidden] { display: none !important; }
.np-find-tabs { display: flex; border-bottom: 1px solid var(--np-line); }
.np-ftab {
    padding: 6px 13px;
    color: var(--np-mute);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}
.np-ftab.is-on { color: var(--np-fg); font-weight: 600; border-bottom-color: var(--np-accent); }
.np-ftab:focus-visible { outline: 2px solid var(--np-accent); outline-offset: -2px; }
.np-find-body { padding: 10px 12px 11px; }
.np-fpane { display: flex; flex-direction: column; gap: 8px; }
.np-fpane[hidden] { display: none !important; }
.np-frow { display: flex; align-items: center; gap: 9px; }
.np-flb { flex: 0 0 68px; font-size: 12.5px; color: var(--np-mute); }
.np-fbtns { display: flex; flex-wrap: wrap; gap: 7px; }
.np-fopts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid var(--np-line);
}
.np-fmsg { margin-left: auto; font-size: 12px; color: var(--np-mute); }
.np-fi-list { max-height: 190px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.np-fi-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 9px;
    background: var(--np-field);
    border: 1px solid var(--np-field-line);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12.5px;
}
.np-fi-item:hover { border-color: var(--np-accent); }
.np-fi-doc { font-weight: 600; }
.np-fi-txt { color: var(--np-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= 通用控件 ================= */
.np-btn {
    min-height: 28px;
    padding: 0 13px;
    color: var(--np-fg);
    background: var(--np-field);
    border: 1px solid var(--np-field-line);
    border-radius: 5px;
    cursor: pointer;
}
.np-btn:hover { border-color: var(--np-accent); }
.np-btn-pri { color: #fff; background: var(--np-accent); border-color: var(--np-accent); }
.np-btn-pri:hover { filter: brightness(1.08); }
.np-btn:focus-visible { outline: 2px solid var(--np-accent); outline-offset: 1px; }
.np-inp {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 28px;
    padding: 4px 9px;
    color: var(--np-fg);
    background: var(--np-field);
    border: 1px solid var(--np-field-line);
    border-radius: 5px;
    font-family: inherit;
    font-size: 13px;
}
.np-inp:focus { outline: none; border-color: var(--np-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--np-accent) 18%, transparent); }
.np-inp-sm { flex: 0 0 auto; width: 74px; }
.np-sel {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 28px;
    padding: 4px 7px;
    color: var(--np-fg);
    background: var(--np-field);
    border: 1px solid var(--np-field-line);
    border-radius: 5px;
    font-family: inherit;
    font-size: 13px;
}
.np-chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: default; user-select: none; }
.np-chk input { width: 14px; height: 14px; margin: 0; accent-color: var(--np-accent); cursor: pointer; }

/* ================= 对话框 ================= */
.np-modal {
    position: fixed;
    inset: 0;
    z-index: 80000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .45);
}
.np-modal[hidden] { display: none !important; }
.np-modal-card {
    width: 100%;
    max-width: 420px;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 16px 18px 14px;
    background: var(--np-chrome-bg);
    border: 1px solid var(--np-line);
    border-radius: 9px;
    box-shadow: 0 22px 60px var(--np-shadow);
}
.np-modal-wide .np-modal-card { max-width: 720px; }
.np-modal-t { margin: 0 0 12px; font-size: 15.5px; font-weight: 700; }
.np-modal-note { margin: 10px 0 0; font-size: 12px; line-height: 1.7; color: var(--np-mute); }
.np-modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.np-prefs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.np-pref-col { display: flex; flex-direction: column; gap: 9px; }
.np-pref-h { font-size: 12px; font-weight: 700; color: var(--np-mute); text-transform: uppercase; letter-spacing: .04em; }
.np-colnum { display: flex; flex-wrap: wrap; gap: 10px; }
.np-mini { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--np-mute); }

/* ================= 文档结构 ================= */
.np-funclist {
    position: absolute;
    top: 34px; left: 12px;
    z-index: 65000;
    display: flex;
    flex-direction: column;
    width: min(300px, 60%);
    max-height: 60%;
    background: var(--np-chrome-bg);
    border: 1px solid var(--np-line);
    border-radius: 7px;
    box-shadow: 0 12px 34px var(--np-shadow);
    overflow: hidden;
}
.np-funclist[hidden] { display: none !important; }
.np-fl-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 10px;
    font-size: 12.5px; font-weight: 700;
    border-bottom: 1px solid var(--np-line);
}
.np-fl-close { background: transparent; border: 0; color: var(--np-mute); cursor: pointer; font-size: 17px; line-height: 1; }
.np-fl-body { overflow-y: auto; padding: 5px 0; }
.np-fl-item {
    display: block; width: 100%; text-align: left;
    padding: 4px 12px;
    background: transparent; border: 0; cursor: pointer;
    font-family: var(--np-mono-font, monospace); font-size: 12.5px;
    color: var(--np-fg);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.np-fl-item:hover { background: var(--np-hover); }
.np-fl-lv1 { padding-left: 24px; }
.np-fl-empty { padding: 12px; font-size: 12.5px; color: var(--np-mute); }

/* ================= Toast ================= */
.np-toasts {
    position: fixed;
    left: 50%;
    bottom: 34px;
    z-index: 90000;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    pointer-events: none;
}
.np-toast {
    max-width: 82vw;
    padding: 8px 16px;
    font-size: 13px;
    color: #fff;
    background: rgba(0, 0, 0, .88);
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .26);
    animation: np-toast-in .18s ease-out;
}
@keyframes np-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 隐藏的剪贴板中转区 */
.np-clip { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ================= 响应式 ================= */
@media (max-width: 1099px) {
    .np-tab { max-width: 170px; }
}
@media (max-width: 767px) {
    .np-menubar { min-height: 34px; }
    .np-menu-btn { min-height: 32px; padding: 0 10px; font-size: 14px; }
    .np-tb { width: 34px; height: 34px; }
    .np-tb svg { width: 19px; height: 19px; }
    .np-tab { max-width: 140px; padding-left: 9px; }
    .np-flb { flex-basis: 60px; }
    .np-find { top: 8px; right: 8px; left: 8px; width: auto; }
    .np-prefs { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .np-st { padding: 0 7px; }
    .np-st-lang, .np-st-lines { display: none; }
}
@media (max-width: 480px) {
    .np-st-enc, .np-st-eol { display: none; }
}

/* ================= 打印 ================= */
@media print {
    body.page-notepad-full .app,
    body.page-notepad-full .main-content,
    body.page-notepad-full .sidebar,
    .np-menubar, .np-toolbar, .np-tabs, .np-status,
    .np-find, .np-modal, .np-funclist, .np-toasts { display: none !important; }
    .np-app { height: auto; min-height: 0; overflow: visible; }
    .np-body { display: block; overflow: visible; height: auto; }
    .np-pane { height: auto !important; overflow: visible; }
    .CodeMirror { height: auto !important; border: 0; }
    .CodeMirror-scroll { overflow: visible !important; height: auto !important; }
}

@media (prefers-reduced-motion: reduce) {
    .np-app *, .np-app { transition: none !important; animation: none !important; }
}

/* =====================================================================
 * CodeMirror 主题：把 .cm-* 语法类映射到 Notepad++ 配色的 --np-* 变量
 * =================================================================== */
.np-app .CodeMirror {
    height: 100%;
    font-family: var(--np-font, Consolas, "Courier New", monospace);
    font-size: var(--np-fsize, 14px);
    line-height: var(--np-lheight, 1.5);
    background: var(--np-bg);
    color: var(--np-fg);
}
.np-app .CodeMirror-gutters {
    background: var(--np-gutter-bg);
    border-right: 1px solid var(--np-line);
    color: var(--np-gutter-fg);
}
.np-app .CodeMirror-linenumber { color: var(--np-gutter-fg); padding: 0 6px 0 4px; min-width: 26px; }
.np-app .CodeMirror-lines { padding: 4px 0; }
.np-app .CodeMirror-activeline-background { background: var(--np-curline); }
.np-app .CodeMirror-activeline-gutter { background: var(--np-curgutter); }
.np-app .CodeMirror-selected { background: var(--np-select) !important; }
.np-app .CodeMirror-focused .CodeMirror-selected { background: var(--np-select) !important; }
.np-app .cm-s-default .cm-matchhighlight,
.np-app .CodeMirror-searching { background: var(--np-searching) !important; border-radius: 2px; }
.np-app .CodeMirror-selectedtext { background: var(--np-select) !important; }

/* 括号匹配 */
.np-app .CodeMirror-matchingbracket { background: var(--np-bracket) !important; outline: 1px solid var(--np-bracket-bd); color: inherit !important; }
.np-app .CodeMirror-nonmatchingbracket { background: color-mix(in srgb, #ff0000 22%, transparent) !important; outline: 1px solid var(--np-error); }

/* 折叠栏 */
.np-app .CodeMirror-foldgutter { width: 13px; }
.np-app .CodeMirror-foldgutter-open,
.np-app .CodeMirror-foldgutter-folded {
    color: var(--np-fold);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    text-align: center;
}
.np-app .CodeMirror-foldmarker {
    display: inline-block;
    padding: 0 6px;
    color: var(--np-mute);
    background: var(--np-curline);
    border: 1px solid var(--np-line);
    border-radius: 9px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
}

/* 尾随空格（视图 > 显示空白） */
.np-app .cm-trailingspace-a { background: var(--np-trail); }
.np-app .cm-trailingspace-b { background: var(--np-trail); }
.np-app .cm-trailingspace-new-line::after { content: '¶'; color: var(--np-guide); }
.np-app .cm-tab { border-left: 1px dotted var(--np-guide); }

/* 书签：行号栏里的圆点 */
.np-app .np-gutter-bm { width: 12px; }
.np-app .np-bm {
    display: block;
    width: 12px;
    text-align: center;
    color: var(--np-bm);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}
.np-app .np-bm-empty { display: block; width: 12px; }
.np-app .np-bookmarked-line { background: color-mix(in srgb, var(--np-bm) 9%, transparent); }

/* 缩进参考线：按缩进层级给整行铺一层竖向虚线背景 */
.np-app .np-il { background-repeat: repeat-y; background-position-x: 0; }
.np-app .np-il-1  { background-image: repeating-linear-gradient(to right, var(--np-guide) 0 1px, transparent 1px var(--np-step, 8px)); background-size: calc(var(--np-step, 8px) * 1) 100%; }
.np-app .np-il-2  { background-image: repeating-linear-gradient(to right, var(--np-guide) 0 1px, transparent 1px var(--np-step, 8px)); background-size: calc(var(--np-step, 8px) * 2) 100%; }
.np-app .np-il-3  { background-image: repeating-linear-gradient(to right, var(--np-guide) 0 1px, transparent 1px var(--np-step, 8px)); background-size: calc(var(--np-step, 8px) * 3) 100%; }
.np-app .np-il-4  { background-image: repeating-linear-gradient(to right, var(--np-guide) 0 1px, transparent 1px var(--np-step, 8px)); background-size: calc(var(--np-step, 8px) * 4) 100%; }
.np-app .np-il-5  { background-image: repeating-linear-gradient(to right, var(--np-guide) 0 1px, transparent 1px var(--np-step, 8px)); background-size: calc(var(--np-step, 8px) * 5) 100%; }
.np-app .np-il-6  { background-image: repeating-linear-gradient(to right, var(--np-guide) 0 1px, transparent 1px var(--np-step, 8px)); background-size: calc(var(--np-step, 8px) * 6) 100%; }
.np-app .np-il-7  { background-image: repeating-linear-gradient(to right, var(--np-guide) 0 1px, transparent 1px var(--np-step, 8px)); background-size: calc(var(--np-step, 8px) * 7) 100%; }
.np-app .np-il-8  { background-image: repeating-linear-gradient(to right, var(--np-guide) 0 1px, transparent 1px var(--np-step, 8px)); background-size: calc(var(--np-step, 8px) * 8) 100%; }
.np-app .np-il-9  { background-image: repeating-linear-gradient(to right, var(--np-guide) 0 1px, transparent 1px var(--np-step, 8px)); background-size: calc(var(--np-step, 8px) * 9) 100%; }
.np-app .np-il-10 { background-image: repeating-linear-gradient(to right, var(--np-guide) 0 1px, transparent 1px var(--np-step, 8px)); background-size: calc(var(--np-step, 8px) * 10) 100%; }
.np-app .np-il-11 { background-image: repeating-linear-gradient(to right, var(--np-guide) 0 1px, transparent 1px var(--np-step, 8px)); background-size: calc(var(--np-step, 8px) * 11) 100%; }
.np-app .np-il-12 { background-image: repeating-linear-gradient(to right, var(--np-guide) 0 1px, transparent 1px var(--np-step, 8px)); background-size: calc(var(--np-step, 8px) * 12) 100%; }

/* 语法着色 */
.np-app .cm-keyword   { color: var(--np-keyword); }
.np-app .cm-atom      { color: var(--np-number); }
.np-app .cm-number    { color: var(--np-number); }
.np-app .cm-def       { color: var(--np-def); }
.np-app .cm-variable  { color: var(--np-var); }
.np-app .cm-variable-2 { color: var(--np-var2); }
.np-app .cm-variable-3 { color: var(--np-var2); }
.np-app .cm-property  { color: var(--np-prop); }
.np-app .cm-operator  { color: var(--np-operator); }
.np-app .cm-comment   { color: var(--np-comment); font-style: italic; }
.np-app .cm-string    { color: var(--np-string); }
.np-app .cm-string-2  { color: var(--np-string); }
.np-app .cm-meta      { color: var(--np-meta); }
.np-app .cm-builtin   { color: var(--np-builtin); }
.np-app .cm-tag       { color: var(--np-tag); }
.np-app .cm-attribute { color: var(--np-attr); }
.np-app .cm-qualifier { color: var(--np-def); }
.np-app .cm-type      { color: var(--np-type); }
.np-app .cm-bracket   { color: var(--np-operator); }
.np-app .cm-hr        { color: var(--np-mute); }
.np-app .cm-link      { color: var(--np-link); text-decoration: underline; }
.np-app .cm-url       { color: var(--np-link); }
.np-app .cm-error,
.np-app .cm-invalidchar { color: var(--np-error); }
.np-app .cm-header    { color: var(--np-heading); font-weight: 700; }
.np-app .cm-quote     { color: var(--np-comment); }
.np-app .cm-negative  { color: var(--np-error); }
.np-app .cm-positive  { color: var(--np-string); }
.np-app .cm-strong    { font-weight: 700; }
.np-app .cm-em        { font-style: italic; }

/* 自动补全下拉 */
.np-app .CodeMirror-hints {
    background: var(--np-chrome-bg);
    border: 1px solid var(--np-line);
    border-radius: 6px;
    box-shadow: 0 10px 30px var(--np-shadow);
    font-family: var(--np-font, Consolas, monospace);
    font-size: 12.5px;
}
.np-app ul.CodeMirror-hints li.CodeMirror-hint { color: var(--np-fg); padding: 2px 8px; }
.np-app ul.CodeMirror-hints li.CodeMirror-hint-active {
    background: var(--np-accent);
    color: #fff;
}

/* CodeMirror 自带对话框（跳转行等） */
.np-app .CodeMirror-dialog {
    background: var(--np-chrome-bg);
    color: var(--np-fg);
    border-bottom: 1px solid var(--np-line);
}
.np-app .CodeMirror-dialog input { font-family: inherit; color: var(--np-fg); background: var(--np-field); border: 1px solid var(--np-field-line); border-radius: 4px; }
