    :root {
      /* 色彩系统：清爽编辑体验 */
      --bg: #f0f0f0;
      --panel-bg: #ffffff;
      --surface: #f3f5f8;
      --surface-hover: #e8ebf0;
      --text: #1a1d23;
      --text-secondary: #5f6775;
      --text-muted: #615d59;
      --border: rgba(15, 23, 42, 0.08);
      --table-grid-border: rgba(15, 23, 42, 0.14);
      --hr-line: rgba(15, 23, 42, 0.06);
      --accent: #6C5CE7;
      --accent-hover: #5648D6;
      --accent-soft: rgba(108, 92, 231, 0.15);
      --code-bg: #1a1d27;
      --code-text: #d7dbea;
      --code-shadow: 0 4px 14px rgba(15, 23, 42, 0.12), 0 12px 32px rgba(15, 23, 42, 0.1);
      --danger: #ef4444;

      /* 布局专用色 */
      --header-bg: #ffffff;
      --header-text: #615d59;
      --header-muted: rgba(97, 93, 89, 0.72);
      --header-border: rgba(15, 23, 42, 0.08);
      --header-btn-bg: rgba(108, 92, 231, 0.15);
      --header-btn-hover: #6C5CE7;
      --toolbar-icon: var(--accent);
      --toolbar-icon-hover: var(--accent-hover);
      --preview-canvas: #e8ebf0;
      --preview-card-bg: #ffffff;
      --side-rail-bg: #f8f9fb;
      --side-rail-width: 56px;
      --modal-body-bg: #f5f5f5;
      --shortcut-tip-text: #70757a;
      --resizer-handle-bg: rgba(108, 92, 231, 0.12);
      --resizer-handle-border: rgba(108, 92, 231, 0.38);
      --resizer-handle-shadow: rgba(108, 92, 231, 0.18);

      /* 阴影：分层柔和 */
      --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
      --shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
      --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
      --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.12);

      /* 滚动条 */
      --scrollbar-size: 8px;
      --scrollbar-track: transparent;
      --scrollbar-thumb: rgba(15, 23, 42, 0.14);
      --scrollbar-thumb-hover: rgba(15, 23, 42, 0.26);
      --scrollbar-thumb-active: rgba(108, 92, 231, 0.55);

      /* 字体：Inter / Plus Jakarta Sans 本地加载，中文回退系统字体 */
      --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
      --font-sans: "Inter", "Microsoft YaHei", "PingFang SC", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      --font-mono: "Inter", "JetBrains Mono", "SF Mono", "Fira Code", Consolas, Menlo, monospace;
      --font-editor: "Inter", "SF Pro Text", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
      --font-editor-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", "Cascadia Code", monospace;

      /* 编辑区：排版与语法色 */
      --editor-bg: #ffffff;
      --editor-text: rgba(0, 0, 0, 0.92);
      --editor-font-size: 14px;
      --editor-line-height: 1.6;
      --editor-gutter-color: #a39e98;
      --editor-gutter-border: rgba(0, 0, 0, 0.08);
      --editor-gutter-width: 52px;
      --hl-heading: #333333;
      --hl-heading-mark: #9a6e3a;
      --hl-bold: #c83e8a;
      --hl-italic: #c678dd;
      --hl-code: #a31515;
      --hl-code-bg: rgba(163, 21, 21, 0.06);
      --hl-link: #0075de;
      --hl-quote: #708090;
      --hl-meta: #9a6e3a;
      --hl-fence: #9a6e3a;
      --hl-tag: #0075de;
      --hl-str: #dd5b00;
      --hl-hr: #b0b0b0;
      --hl-strike: #888888;
      --editor-match-bg: rgba(108, 92, 231, 0.32);
      --quote-bg: rgba(108, 92, 231, 0.07);
      --quote-border: var(--accent);
      --quote-text: var(--text-secondary);

      /* 圆角 */
      --radius-sm: 6px;
      --radius: 10px;
      --radius-lg: 14px;
      --radius-xl: 18px;
    }
    [data-theme="dark"] {
      --bg: #0b0d12;
      --panel-bg: #151821;
      --surface: #1c1f2a;
      --surface-hover: #252a38;
      --text: #f0f2f7;
      --text-secondary: #a5adb8;
      --text-muted: #6b7280;
      --border: rgba(255, 255, 255, 0.08);
      --table-grid-border: rgba(255, 255, 255, 0.14);
      --hr-line: rgba(255, 255, 255, 0.06);
      --accent: #8578F0;
      --accent-hover: #9588F5;
      --accent-soft: rgba(133, 120, 240, 0.18);
      --code-bg: #1a1d27;
      --code-text: #d7dbea;
      --code-shadow: 0 2px 8px rgba(0, 0, 0, 0.18), 0 6px 16px rgba(0, 0, 0, 0.12);
      --danger: #f87171;

      --header-bg: #151821;
      --header-text: #e8eaed;
      --header-muted: rgba(232, 234, 237, 0.65);
      --header-border: rgba(255, 255, 255, 0.08);
      --header-btn-bg: rgba(108, 92, 231, 0.18);
      --header-btn-hover: #8578F0;
      --toolbar-icon: var(--accent);
      --toolbar-icon-hover: var(--accent-hover);
      --preview-canvas: #0b0d12;
      --preview-card-bg: #151821;
      --side-rail-bg: #111318;
      --modal-body-bg: #11141c;
      --shortcut-tip-text: #a5adb8;
      --resizer-handle-bg: rgba(133, 120, 240, 0.16);
      --resizer-handle-border: rgba(133, 120, 240, 0.45);
      --resizer-handle-shadow: rgba(133, 120, 240, 0.28);

      --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
      --shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
      --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
      --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);

      --scrollbar-track: transparent;
      --scrollbar-thumb: rgba(255, 255, 255, 0.14);
      --scrollbar-thumb-hover: rgba(255, 255, 255, 0.26);
      --scrollbar-thumb-active: rgba(133, 120, 240, 0.65);

      --editor-bg: var(--panel-bg);
      --editor-text: rgba(255, 255, 255, 0.92);
      --editor-gutter-color: #6e6a65;
      --editor-gutter-border: rgba(255, 255, 255, 0.1);
      --hl-heading: rgba(255, 255, 255, 0.92);
      --hl-heading-mark: #e5b567;
      --hl-bold: #f0abfc;
      --hl-italic: #c084fc;
      --hl-code: #f472b6;
      --hl-code-bg: rgba(244, 114, 182, 0.12);
      --hl-link: #61b4ff;
      --hl-quote: #9ca3af;
      --hl-meta: #e5b567;
      --hl-fence: #e5b567;
      --hl-tag: #61b4ff;
      --hl-str: #f0a060;
      --hl-hr: #555555;
      --hl-strike: #9ca3af;
      --editor-match-bg: rgba(133, 120, 240, 0.38);
      --quote-bg: rgba(133, 120, 240, 0.12);
      --quote-border: var(--accent);
      --quote-text: var(--text-secondary);
    }
    * { box-sizing: border-box; }
    html, body {
      margin: 0;
      padding: 0;
      height: 100%;
      font-family: var(--font-sans);
      background: var(--bg);
      color: var(--text);
      overflow: hidden;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }
    button, input, select, textarea {
      font-family: inherit;
    }
    ::selection {
      background: var(--accent-soft);
      color: var(--text);
    }

    body.is-booting .app {
      visibility: hidden;
      pointer-events: none;
    }
    .app-loading {
      position: fixed;
      inset: 0;
      z-index: 9999;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--bg);
      color: var(--text);
      transition: opacity .25s ease, visibility .25s ease;
    }
    .app-loading.is-hidden {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }
    .app-loading-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 14px;
      padding: 8px 12px;
    }
    .app-loading-spinner {
      width: 28px;
      height: 28px;
      border: 2px solid var(--border);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: app-loading-spin .75s linear infinite;
    }
    .app-loading-card p {
      margin: 0;
      font-size: 14px;
      color: var(--text-secondary);
      letter-spacing: 0.02em;
    }
    @keyframes app-loading-spin {
      to { transform: rotate(360deg); }
    }
    /* 移动端：提示使用电脑端编辑 */
    .mobile-editor-gate {
      display: none;
    }
    @media (max-width: 768px) {
      .mobile-editor-gate {
        position: fixed;
        inset: 0;
        z-index: 10000;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 32px 24px;
        background: #f7f5ff;
      }
      [data-theme="dark"] .mobile-editor-gate {
        background: #12131a;
      }
      .mobile-editor-gate-card {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 28px;
        width: min(320px, calc(100vw - 48px));
        padding: 32px 28px 36px;
        border-radius: 20px;
        border: 1px solid rgba(108, 92, 231, 0.1);
        background: #fff;
        box-shadow: 0 18px 48px rgba(108, 92, 231, 0.12), 0 4px 14px rgba(15, 23, 42, 0.04);
        text-align: center;
      }
      [data-theme="dark"] .mobile-editor-gate-card {
        background: #1a1d27;
        border-color: rgba(133, 120, 240, 0.18);
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
      }
      .mobile-editor-gate-brand {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        padding: 5px 12px 5px 5px;
        border-radius: 999px;
        background: rgba(108, 92, 231, 0.1);
        box-shadow: inset 0 0 0 1px rgba(108, 92, 231, 0.12);
        text-decoration: none;
        color: inherit;
      }
      .mobile-editor-gate-brand .brand-logo {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        font-size: 12px;
      }
      .mobile-editor-gate-name {
        font-family: var(--font-display);
        font-size: 14px;
        font-weight: 700;
        letter-spacing: -0.02em;
        color: var(--text);
        line-height: 1.2;
        padding-right: 2px;
      }
      [data-theme="dark"] .mobile-editor-gate-brand {
        background: rgba(133, 120, 240, 0.14);
        box-shadow: inset 0 0 0 1px rgba(133, 120, 240, 0.2);
      }
      .mobile-editor-gate-copy {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
      }
      .mobile-editor-gate-text {
        margin: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        color: var(--text);
        font-size: 16px;
        font-weight: 700;
        line-height: 1.4;
        letter-spacing: -0.01em;
      }
      .mobile-editor-gate-icon {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        color: var(--accent);
      }
      .mobile-editor-gate-hint {
        margin: 0;
        max-width: 18em;
        color: var(--text-secondary);
        font-size: 13px;
        font-weight: 400;
        line-height: 1.55;
      }
      .mobile-editor-gate-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 148px;
        min-height: 38px;
        padding: 9px 20px;
        border-radius: 10px;
        background: var(--accent);
        color: #fff;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.3;
        text-decoration: none;
        transition: background .15s ease, transform .15s ease;
      }
      .mobile-editor-gate-btn:hover {
        background: var(--accent-hover);
      }
      .mobile-editor-gate-btn:active {
        transform: scale(0.98);
      }
    }

    /* 滚动条：细窄圆角，随主题变色，隐藏箭头 */
    .editor-pane .editor-code,
    .preview-content,
    .preview-source,
    .modal-body,
    #export-image-preview-wrap,
    .preview-content pre,
    .preview-content .katex-display {
      scrollbar-width: thin;
      scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    }
    .editor-pane .editor-code::-webkit-scrollbar,
    .preview-content::-webkit-scrollbar,
    .preview-source::-webkit-scrollbar,
    .modal-body::-webkit-scrollbar,
    #export-image-preview-wrap::-webkit-scrollbar,
    .preview-content pre::-webkit-scrollbar,
    .preview-content .katex-display::-webkit-scrollbar {
      width: var(--scrollbar-size);
      height: var(--scrollbar-size);
    }
    .editor-pane .editor-code::-webkit-scrollbar-track,
    .preview-content::-webkit-scrollbar-track,
    .preview-source::-webkit-scrollbar-track,
    .modal-body::-webkit-scrollbar-track,
    #export-image-preview-wrap::-webkit-scrollbar-track,
    .preview-content pre::-webkit-scrollbar-track,
    .preview-content .katex-display::-webkit-scrollbar-track {
      background: var(--scrollbar-track);
      border-radius: 999px;
    }
    .editor-pane .editor-code::-webkit-scrollbar-thumb,
    .preview-content::-webkit-scrollbar-thumb,
    .preview-source::-webkit-scrollbar-thumb,
    .modal-body::-webkit-scrollbar-thumb,
    #export-image-preview-wrap::-webkit-scrollbar-thumb,
    .preview-content pre::-webkit-scrollbar-thumb,
    .preview-content .katex-display::-webkit-scrollbar-thumb {
      background-color: var(--scrollbar-thumb);
      border: 2px solid transparent;
      border-radius: 999px;
      background-clip: content-box;
      transition: background-color .2s ease;
    }
    .editor-pane .editor-code::-webkit-scrollbar-thumb:hover,
    .preview-content::-webkit-scrollbar-thumb:hover,
    .preview-source::-webkit-scrollbar-thumb:hover,
    .modal-body::-webkit-scrollbar-thumb:hover,
    #export-image-preview-wrap::-webkit-scrollbar-thumb:hover,
    .preview-content pre::-webkit-scrollbar-thumb:hover,
    .preview-content .katex-display::-webkit-scrollbar-thumb:hover {
      background-color: var(--scrollbar-thumb-hover);
    }
    .editor-pane .editor-code::-webkit-scrollbar-thumb:active,
    .preview-content::-webkit-scrollbar-thumb:active,
    .preview-source::-webkit-scrollbar-thumb:active,
    .modal-body::-webkit-scrollbar-thumb:active,
    #export-image-preview-wrap::-webkit-scrollbar-thumb:active,
    .preview-content pre::-webkit-scrollbar-thumb:active,
    .preview-content .katex-display::-webkit-scrollbar-thumb:active {
      background-color: var(--scrollbar-thumb-active);
    }
    .editor-pane .editor-code::-webkit-scrollbar-corner,
    .preview-content::-webkit-scrollbar-corner,
    .preview-source::-webkit-scrollbar-corner,
    .modal-body::-webkit-scrollbar-corner,
    #export-image-preview-wrap::-webkit-scrollbar-corner {
      background: transparent;
    }
    .editor-pane .editor-code::-webkit-scrollbar-button,
    .preview-content::-webkit-scrollbar-button,
    .preview-source::-webkit-scrollbar-button,
    .modal-body::-webkit-scrollbar-button,
    #export-image-preview-wrap::-webkit-scrollbar-button,
    .preview-content pre::-webkit-scrollbar-button,
    .preview-content .katex-display::-webkit-scrollbar-button {
      display: none;
      width: 0;
      height: 0;
    }

    .app {
      display: flex;
      flex-direction: column;
      height: 100vh;
      background: var(--bg);
    }
    .workspace {
      display: flex;
      flex: 1;
      min-height: 0;
      overflow: hidden;
      padding: 10px;
      gap: 10px;
      background: var(--bg);
    }
    .workspace-main {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-width: 0;
      overflow: hidden;
    }

    /* 左侧图标栏 */
    .side-rail {
      width: var(--side-rail-width);
      flex: 0 0 var(--side-rail-width);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      padding: 10px 0;
      background: var(--panel-bg);
      border: none;
      border-radius: var(--radius-lg);
      box-shadow: none;
      z-index: 6;
      align-self: stretch;
    }
    .side-rail .rail-group {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 6px;
      width: 100%;
      padding: 0 4px;
    }
    .side-rail button.rail-item-icon-only,
    .side-rail a.rail-item-icon-only,
    .side-rail .dropdown.rail-item-icon-only > button {
      min-height: 36px;
      height: 36px;
      padding: 0;
      gap: 0;
      box-sizing: border-box;
    }
    .side-rail .rail-item-icon-only .rail-label {
      display: none;
    }
    .side-rail .rail-spacer { flex: 1; min-height: 8px; }
    .side-rail button,
    .side-rail label,
    .side-rail .dropdown > button {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      width: 100%;
      min-height: 48px;
      padding: 7px 2px 5px;
      border: none;
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
      transition: color .18s ease, background .18s ease;
    }
    .side-rail a.rail-item-icon-only {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 100%;
      border: none;
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
      transition: color .18s ease, background .18s ease;
      text-decoration: none;
    }
    .side-rail button:hover,
    .side-rail label:hover,
    .side-rail a.rail-item-icon-only:hover,
    .side-rail .dropdown > button:hover {
      background: var(--accent-soft);
      color: var(--accent);
    }
    .side-rail button .icon,
    .side-rail label .icon,
    .side-rail a.rail-item-icon-only .icon,
    .side-rail .dropdown > button .icon {
      width: 18px;
      height: 18px;
      flex-shrink: 0;
    }
    .side-rail .rail-label {
      display: block;
      font-size: 10px;
      font-weight: 400;
      line-height: 1.25;
      color: inherit;
      text-align: center;
      white-space: normal;
      word-break: keep-all;
      max-width: 100%;
    }
    .side-rail .dropdown {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      width: 100%;
    }
    .side-rail .dropdown-menu {
      left: calc(100% + 8px);
      top: 0;
      margin-top: 0;
    }
    #lang-menu {
      position: fixed;
      left: auto;
      top: auto;
      min-width: 148px;
      max-height: min(360px, calc(100vh - 16px));
      overflow-x: hidden;
      overflow-y: auto;
      padding: 4px;
      z-index: 220;
      scrollbar-width: thin;
      border-radius: 10px;
      box-shadow: 0 10px 32px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
    }
    #lang-menu::-webkit-scrollbar {
      width: 6px;
    }
    #lang-menu::-webkit-scrollbar-thumb {
      background: var(--border);
      border-radius: 999px;
    }
    #lang-menu .dropdown-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 7px 10px;
      font-size: 12px;
      line-height: 1.35;
      border-radius: 6px;
    }
    #lang-menu .dropdown-item.is-active {
      background: var(--accent-soft);
      color: var(--accent);
      font-weight: 600;
    }
    #lang-menu .dropdown-item.is-active::after {
      content: '✓';
      font-size: 12px;
      line-height: 1;
      opacity: 0.9;
    }
    #recent-menu {
      position: fixed;
      left: auto;
      top: auto;
      min-width: 220px;
      max-width: min(360px, calc(100vw - 80px));
      max-height: min(360px, calc(100vh - 16px));
      overflow-x: hidden;
      overflow-y: auto;
      padding: 0;
      align-items: stretch;
      z-index: 220;
      scrollbar-width: thin;
      border-radius: 10px;
      box-shadow: 0 10px 32px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
    }
    #recent-menu::-webkit-scrollbar {
      width: 6px;
    }
    #recent-menu::-webkit-scrollbar-thumb {
      background: var(--border);
      border-radius: 999px;
    }
    #recent-menu .recent-head {
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      width: 100%;
      box-sizing: border-box;
      flex-shrink: 0;
      padding: 14px 10px 8px;
      border-bottom: 1px solid var(--border, rgba(15, 23, 42, 0.08));
    }
    #recent-menu .recent-head-title {
      flex: 1 1 auto;
      font-size: 11px;
      font-weight: 600;
      line-height: 1.3;
      color: var(--text-muted, #70757a);
      letter-spacing: 0.01em;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
    }
    #recent-menu .recent-list {
      width: 100%;
      box-sizing: border-box;
      padding: 4px;
      margin-bottom: 8px;
    }
    #recent-menu .dropdown-item.recent-item {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 5px 8px;
      margin: 0;
      font-size: 12px;
      line-height: 1.3;
      border-radius: 6px;
      min-width: 0;
      min-height: 0;
      white-space: normal;
      font-weight: 400;
      cursor: pointer;
    }
    #recent-menu .recent-meta {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
      padding: 0;
    }
    #recent-menu .recent-title {
      display: flex;
      align-items: center;
      gap: 4px;
      min-width: 0;
    }
    #recent-menu .recent-item .recent-file-icon {
      flex-shrink: 0;
      width: 12px;
      height: 12px;
      opacity: 0.72;
    }
    #recent-menu .recent-name {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      min-width: 0;
      font-weight: 500;
      line-height: 1.3;
      font-size: 12px;
    }
    #recent-menu .recent-sub {
      padding-left: 16px;
      margin-top: 0;
      font-size: 10px;
      line-height: 1.25;
      color: var(--text-muted, #70757a);
      opacity: 0.58;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      min-width: 0;
    }
    #recent-menu .recent-remove {
      flex-shrink: 0;
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      min-height: 0;
      margin: 0;
      padding: 0;
      gap: 0;
      border: none;
      border-radius: 0;
      background: transparent;
      color: var(--text-muted, #70757a);
      opacity: 0;
      cursor: pointer;
      transition: opacity 0.15s ease, color 0.15s ease;
    }
    #recent-menu .recent-item:hover .recent-remove,
    #recent-menu .recent-item:focus-within .recent-remove {
      opacity: 0.45;
    }
    #recent-menu .recent-remove:hover {
      opacity: 1;
      background: transparent;
      color: var(--text-secondary, #5f6368);
    }
    #recent-menu .recent-remove .icon {
      width: 10px;
      height: 10px;
    }
    #recent-menu .recent-clear {
      flex-shrink: 0;
      display: inline-flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      width: auto;
      min-height: 0;
      padding: 0;
      gap: 0;
      border: none;
      border-radius: 0;
      background: transparent;
      color: var(--text-muted, #70757a);
      font-size: 11px;
      line-height: 1.2;
      cursor: pointer;
      transition: color 0.15s ease;
    }
    #recent-menu .recent-clear:hover {
      background: transparent;
      color: var(--accent, #6b4ce6);
    }
    [data-theme="dark"] #recent-menu .recent-sub {
      opacity: 0.48;
    }
    [data-theme="dark"] #recent-menu .recent-remove:hover {
      background: transparent;
      color: var(--text-primary, #e8eaed);
    }
    #recent-menu:has(.recent-empty) {
      min-width: 0;
      width: max-content;
    }
    #recent-menu .recent-empty {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      box-sizing: border-box;
      padding: 16px 20px 18px;
      font-size: 12px;
      line-height: 1.5;
      color: var(--text-muted);
      text-align: center;
      white-space: nowrap;
    }
    #recent-menu .recent-empty-icon {
      width: 20px;
      height: 20px;
      opacity: 0.32;
    }
    #recent-menu .recent-empty-text {
      opacity: 0.72;
    }
    .side-rail button:focus,
    .side-rail a.rail-item-icon-only:focus,
    .side-rail .dropdown > button:focus {
      outline: none;
    }
    .side-rail button:focus-visible,
    .side-rail a.rail-item-icon-only:focus-visible,
    .side-rail .dropdown > button:focus-visible {
      box-shadow: inset 0 0 0 2px var(--accent-soft);
    }
    .side-rail .dropdown.is-open > button,
    .side-rail button.is-active {
      background: var(--accent-soft);
      color: var(--accent);
    }
    .side-rail input[type="file"] { display: none; }

    /* 文档目录面板 */
    .outline-panel {
      --outline-panel-width: 248px;
      flex: 0 0 0px;
      width: 0;
      min-width: 0;
      max-width: var(--outline-panel-width);
      display: flex;
      flex-direction: column;
      min-height: 0;
      align-self: stretch;
      margin-inline-end: -10px;
      background: var(--panel-bg);
      border: none;
      border-radius: var(--radius-lg);
      box-shadow: none;
      overflow: hidden;
      opacity: 0;
      pointer-events: none;
      z-index: 5;
      transition:
        width .3s cubic-bezier(.22, 1, .36, 1),
        flex-basis .3s cubic-bezier(.22, 1, .36, 1),
        margin-inline-end .3s cubic-bezier(.22, 1, .36, 1),
        opacity .22s ease;
    }
    .outline-panel.is-open {
      flex-basis: var(--outline-panel-width);
      width: var(--outline-panel-width);
      margin-inline-end: 0;
      opacity: 1;
      pointer-events: auto;
    }
    .outline-panel.no-anim {
      transition: none !important;
    }
    .outline-panel-header,
    .outline-panel-body {
      min-width: var(--outline-panel-width);
      box-sizing: border-box;
    }
    @media (prefers-reduced-motion: reduce) {
      .outline-panel {
        transition: none;
      }
    }
    .outline-panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 8px 12px 8px 14px;
      min-height: 44px;
      box-sizing: border-box;
      flex-shrink: 0;
      background: transparent;
      border-bottom: 1px solid var(--border);
    }
    .outline-panel-heading {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }
    .outline-panel-icon {
      width: 15px;
      height: 15px;
      color: var(--accent);
      flex-shrink: 0;
      opacity: 0.9;
    }
    .outline-panel-title {
      font-size: 12px;
      font-weight: 600;
      color: var(--text-secondary);
      letter-spacing: 0.04em;
      white-space: nowrap;
    }
    .outline-panel-close {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      padding: 0;
      border: none;
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
      transition: background .15s ease, color .15s ease;
    }
    .outline-panel-close:hover {
      background: var(--accent-soft);
      color: var(--accent);
    }
    .outline-panel-body {
      flex: 1;
      min-height: 0;
      overflow: auto;
      padding: 10px 8px;
      scrollbar-width: thin;
      scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    }
    .outline-empty {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      box-sizing: border-box;
      padding: 28px 16px;
      font-size: 12px;
      line-height: 1.5;
      color: var(--text-muted);
      text-align: center;
    }
    .outline-empty-icon {
      width: 20px;
      height: 20px;
      opacity: 0.32;
    }
    .outline-empty-text {
      opacity: 0.72;
      max-width: 11em;
    }
    .outline-item {
      --outline-rail: 14px;
      --outline-indent: 10px;
      --outline-line: rgba(15, 23, 42, 0.4);
      position: relative;
      display: flex;
      align-items: stretch;
      gap: 0;
      width: 100%;
      margin: 0;
      padding: 0 8px 0 8px;
      border: none;
      border-radius: 8px;
      background: transparent;
      color: var(--text);
      font: inherit;
      font-size: 13px;
      line-height: 1.35;
      text-align: left;
      cursor: pointer;
      transition: background .15s ease, color .15s ease;
    }
    .outline-tree {
      display: flex;
      flex-shrink: 0;
      align-self: stretch;
    }
    .outline-rail {
      position: relative;
      width: var(--outline-rail);
      flex-shrink: 0;
      align-self: stretch;
    }
    .outline-rail.is-root {
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .outline-rail.is-root.has-children::before,
    .outline-rail.is-pipe::before,
    .outline-rail.is-tee::before,
    .outline-rail.is-angle::before {
      content: '';
      position: absolute;
      left: calc(50% - 0.5px);
      width: 1px;
      background-image: radial-gradient(
        circle closest-side,
        var(--outline-line) 0,
        var(--outline-line) 0.35px,
        transparent 0.45px
      );
      background-size: 1px 4px;
      background-repeat: repeat-y;
      background-position: center top;
    }
    .outline-rail.is-root.has-children::before {
      top: calc(50% + 5px);
      bottom: 0;
    }
    .outline-rail.is-pipe::before,
    .outline-rail.is-tee::before {
      top: 0;
      bottom: 0;
    }
    .outline-rail.is-angle::before {
      top: 0;
      bottom: 50%;
    }
    .outline-rail.is-tee::after,
    .outline-rail.is-angle::after {
      content: '';
      position: absolute;
      left: 50%;
      top: calc(50% - 0.5px);
      width: calc(50% + var(--outline-indent));
      height: 1px;
      background-image: radial-gradient(
        circle closest-side,
        var(--outline-line) 0,
        var(--outline-line) 0.35px,
        transparent 0.45px
      );
      background-size: 4px 1px;
      background-repeat: repeat-x;
      background-position: left center;
    }
    .outline-item-main {
      display: flex;
      align-items: center;
      min-width: 0;
      flex: 1;
      padding: 8px 4px 8px 8px;
    }
    .outline-item:not(.level-1) .outline-item-main {
      padding-left: var(--outline-indent);
    }
    /* 三级及以下：紧凑阶梯缩进 + 小圆点，替代已去掉的深层树线 */
    .outline-item.level-3 .outline-item-main,
    .outline-item.level-4 .outline-item-main,
    .outline-item.level-5 .outline-item-main,
    .outline-item.level-6 .outline-item-main {
      padding-top: 7px;
      padding-bottom: 7px;
    }
    .outline-item.level-3 .outline-item-main { padding-left: 15px; }
    .outline-item.level-4 .outline-item-main { padding-left: 20px; }
    .outline-item.level-5 .outline-item-main { padding-left: 25px; }
    .outline-item.level-6 .outline-item-main { padding-left: 30px; }
    .outline-item.level-3 .outline-item-main::before,
    .outline-item.level-4 .outline-item-main::before,
    .outline-item.level-5 .outline-item-main::before,
    .outline-item.level-6 .outline-item-main::before {
      content: '';
      flex-shrink: 0;
      width: 4px;
      height: 4px;
      margin-right: 3px;
      border-radius: 50%;
      background: currentColor;
      opacity: 0.28;
    }
    .outline-item.level-4 .outline-item-main::before,
    .outline-item.level-5 .outline-item-main::before,
    .outline-item.level-6 .outline-item-main::before {
      width: 3px;
      height: 3px;
      opacity: 0.22;
    }
    .outline-item-dot {
      position: relative;
      z-index: 1;
      flex-shrink: 0;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--accent);
      opacity: 0.7;
    }
    .outline-item-text {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      margin-left: 5px;
    }
    .outline-item:hover {
      background: transparent;
      color: var(--accent);
      --outline-line: rgba(108, 92, 231, 0.5);
    }
    .outline-item:hover .outline-item-dot {
      opacity: 1;
    }
    .outline-item.level-3:hover .outline-item-main::before,
    .outline-item.level-4:hover .outline-item-main::before,
    .outline-item.level-5:hover .outline-item-main::before,
    .outline-item.level-6:hover .outline-item-main::before,
    .outline-item.level-3.is-active .outline-item-main::before,
    .outline-item.level-4.is-active .outline-item-main::before,
    .outline-item.level-5.is-active .outline-item-main::before,
    .outline-item.level-6.is-active .outline-item-main::before {
      opacity: 0.7;
      background: var(--accent);
    }
    .outline-item.is-active {
      background: var(--accent-soft);
      color: var(--accent);
      font-weight: 600;
      --outline-line: rgba(108, 92, 231, 0.58);
    }
    .outline-item.is-active .outline-item-dot {
      opacity: 1;
      box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.18);
    }
    .outline-item.level-1 {
      margin-top: 4px;
      font-weight: 600;
      font-size: 13.5px;
    }
    .outline-item.level-1:first-child {
      margin-top: 0;
    }
    .outline-item.level-2:not(.is-active):not(:hover) { color: var(--text); }
    .outline-item.level-3 {
      font-size: 12.5px;
    }
    .outline-item.level-3:not(.is-active):not(:hover) {
      color: var(--text-secondary);
    }
    .outline-item.level-4,
    .outline-item.level-5,
    .outline-item.level-6 {
      font-size: 12px;
    }
    .outline-item.level-4:not(.is-active):not(:hover),
    .outline-item.level-5:not(.is-active):not(:hover),
    .outline-item.level-6:not(.is-active):not(:hover) {
      color: var(--text-muted);
    }
    .outline-item.is-active,
    .outline-item:hover {
      color: var(--accent);
    }
    [data-theme="dark"] .outline-item {
      --outline-line: rgba(255, 255, 255, 0.38);
    }
    [data-theme="dark"] .outline-item:hover {
      background: transparent;
      --outline-line: rgba(133, 120, 240, 0.55);
    }
    [data-theme="dark"] .outline-item.is-active {
      --outline-line: rgba(133, 120, 240, 0.65);
    }

    /* 顶部栏 */
    .header-bar {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 0 16px;
      height: 52px;
      background: var(--header-bg);
      color: var(--header-text);
      border-bottom: none;
      flex-shrink: 0;
      z-index: 10;
    }
    .header-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      flex-shrink: 0;
    }
    .brand-logo {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 30px;
      height: 30px;
      border-radius: 8px;
      background: var(--accent);
      font-family: var(--font-display);
      color: #fff;
      font-size: 14px;
      font-weight: 800;
      flex-shrink: 0;
    }
    .brand-info {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }
    .header-bar .brand {
      font-weight: 700;
      font-size: 16px;
      letter-spacing: -0.01em;
      color: var(--text);
      white-space: nowrap;
      line-height: 1.2;
      flex-shrink: 0;
      text-decoration: none;
    }
    .header-bar .brand:hover {
      color: var(--accent);
    }
    .brand-links {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      flex-shrink: 0;
    }
    .brand-link {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      color: var(--header-muted);
      opacity: 0.7;
      font-size: 13px;
      font-weight: 400;
      line-height: 1;
      text-decoration: none;
      white-space: nowrap;
      transition: color 0.15s ease, opacity 0.15s ease;
    }
    .brand-link:hover {
      color: var(--accent);
      opacity: 1;
    }
    .brand-link .icon {
      opacity: 0.85;
    }
    .brand-sep {
      color: var(--header-muted);
      opacity: 0.45;
      font-size: 13px;
      font-weight: 400;
      line-height: 1;
      flex-shrink: 0;
      user-select: none;
    }
    .header-bar .filename-input {
      flex: 1;
      min-width: 72px;
      max-width: min(280px, 32vw);
      padding: 3px 8px;
      border: 1px solid transparent;
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--header-muted);
      font-size: 13px;
      font-weight: 500;
      outline: none;
      transition: border-color .2s ease, color .2s ease, background .2s ease;
    }
    .header-bar .filename-input:hover {
      color: var(--header-text);
      background: var(--surface);
      border-color: var(--border);
    }
    .header-bar .filename-input:focus {
      color: var(--header-text);
      background: var(--panel-bg);
      border-color: var(--accent);
      box-shadow: 0 0 0 2px var(--accent-soft);
    }
    .header-bar .filename-input:read-only,
    .header-bar .filename-input.is-readonly {
      cursor: default;
      user-select: none;
    }
    .header-bar .filename-input:read-only:hover,
    .header-bar .filename-input.is-readonly:hover,
    .header-bar .filename-input:read-only:focus,
    .header-bar .filename-input.is-readonly:focus {
      color: var(--header-muted);
      background: transparent;
      border-color: transparent;
      box-shadow: none;
    }
    .header-status {
      display: flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
      font-size: 12px;
      color: var(--header-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .header-status .icon {
      width: 14px;
      height: 14px;
      opacity: 0.75;
      flex-shrink: 0;
    }
    .header-actions {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-shrink: 0;
      margin-left: auto;
    }
    .header-bar button,
    .header-bar label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 10px;
      border: 1px solid transparent;
      border-radius: var(--radius-sm);
      background: var(--header-btn-bg);
      color: var(--accent);
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      transition: all .18s ease;
      user-select: none;
      white-space: nowrap;
    }
    .header-bar button:hover,
    .header-bar label:hover {
      background: var(--header-btn-hover);
      color: #fff;
    }
    .header-bar button.primary {
      background: var(--accent);
      color: #fff;
      border-color: transparent;
      box-shadow: none;
    }
    .header-bar button.primary:hover {
      background: var(--accent-hover);
      color: #fff;
      box-shadow: none;
    }
    .header-bar input[type="file"] { display: none; }
    .header-actions .dropdown-menu {
      left: auto;
      right: 0;
    }

    .top-bar button, .top-bar label,
    .editor-toolbar button, .editor-toolbar label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      border: none;
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--text-secondary);
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      transition: all .2s ease;
      user-select: none;
      white-space: nowrap;
    }
    .top-bar button:hover, .top-bar label:hover,
    .editor-toolbar button:hover, .editor-toolbar label:hover {
      background: var(--surface);
      color: var(--accent);
    }
    .top-bar button.primary, .editor-toolbar button.primary {
      background: var(--accent);
      color: #fff;
      box-shadow: 0 1px 2px rgba(108, 92, 231, 0.2);
    }
    .top-bar button.primary:hover, .editor-toolbar button.primary:hover {
      background: var(--accent-hover);
      box-shadow: 0 4px 10px rgba(108, 92, 231, 0.25);
    }
    .top-bar input[type="file"], .editor-toolbar input[type="file"] { display: none; }

    /* Lucide SVG 图标（strokeWidth: 2，与 ChicPage 一致） */
    .icon {
      width: 16px;
      height: 16px;
      flex-shrink: 0;
      display: block;
      overflow: visible;
      color: inherit;
      fill: none;
    }
    .icon-sm { width: 12px; height: 12px; }
    .icon-lg { width: 18px; height: 18px; }

    .dropdown {
      position: relative;
      display: inline-flex;
    }
    .dropdown-menu {
      position: absolute;
      top: 100%;
      left: 0;
      margin-top: 6px;
      background: var(--panel-bg);
      border: 1px solid var(--border);
      border-radius: 10px;
      box-shadow: 0 10px 32px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
      min-width: 168px;
      display: none;
      flex-direction: column;
      z-index: 100;
      overflow: hidden;
      padding: 4px;
      animation: menuIn .18s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .top-actions .dropdown-menu {
      left: auto;
      right: 0;
    }
    .dropdown-menu.show {
      display: flex;
    }
    .dropdown-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 7px 10px;
      cursor: pointer;
      font-size: 12px;
      font-weight: 500;
      color: var(--text-secondary);
      border-radius: 6px;
      transition: background .15s ease, color .15s ease;
      white-space: nowrap;
    }
    .dropdown-item .icon {
      width: 14px;
      height: 14px;
      opacity: 0.72;
      transition: opacity .15s ease;
    }
    .dropdown-item:hover {
      background: var(--accent-soft);
      color: var(--accent);
    }
    .dropdown-item:hover .icon {
      opacity: 1;
    }
    #recent-menu .recent-list .dropdown-item.recent-item {
      padding: 5px 8px;
      gap: 6px;
      align-items: center;
      font-weight: 400;
      white-space: normal;
    }
    #recent-menu .recent-remove,
    #recent-menu .recent-clear {
      width: auto;
      min-height: 0;
      flex-direction: row;
      gap: 0;
    }
    .top-bar .divider, .editor-toolbar .divider {
      width: 1px;
      height: 18px;
      background: var(--border);
      margin: 0 4px;
    }
    /* 编辑器工具栏 */
    .editor-toolbar {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 4px;
      padding: 8px 16px;
      min-height: 44px;
      background: var(--panel-bg);
      border-bottom: 1px solid var(--border);
      flex-wrap: nowrap;
      overflow: visible;
      flex-shrink: 0;
    }
    .editor-toolbar .format-group {
      flex: 1;
      min-width: 0;
      overflow: visible;
      display: flex;
      align-items: center;
    }
    .editor-toolbar .format-group-track {
      display: flex;
      align-items: center;
      gap: 0;
      flex-wrap: nowrap;
      max-width: 100%;
      overflow-x: auto;
      overflow-y: visible;
      scrollbar-width: none;
    }
    .editor-toolbar .format-group-track::-webkit-scrollbar { display: none; }
    .editor-toolbar .format-group,
    .editor-toolbar .editor-actions {
      display: flex;
      align-items: center;
      gap: 0;
      flex-wrap: nowrap;
      padding: 0;
      background: transparent;
      border: none;
      border-radius: 0;
    }
    .editor-toolbar button,
    .editor-toolbar label {
      color: var(--toolbar-icon);
      font-size: 12px;
      font-weight: 500;
      padding: 4px;
      min-width: 28px;
      height: 28px;
      justify-content: center;
      border-radius: 4px;
      gap: 0;
      overflow: visible;
      flex-shrink: 0;
    }
    .editor-toolbar button:hover,
    .editor-toolbar label:hover {
      background: var(--accent-soft);
      color: var(--toolbar-icon-hover);
    }
    .editor-toolbar button svg.icon {
      width: 14px;
      height: 14px;
    }
    .editor-toolbar button span[data-i18n] {
      display: none;
    }
    .editor-toolbar button b,
    .editor-toolbar button i,
    .editor-toolbar button u,
    .editor-toolbar button s {
      font-size: 12px;
      font-weight: 600;
      color: inherit;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 16px;
      font-style: normal;
      text-decoration: none;
    }
    .editor-toolbar button i { font-style: italic; }
    .editor-toolbar button u { text-decoration: underline; }
    .editor-toolbar button s { text-decoration: line-through; }
    .editor-toolbar .dropdown-menu {
      position: fixed;
      top: auto;
      left: auto;
      margin-top: 0;
      z-index: 300;
    }
    .editor-toolbar .divider {
      width: 1px;
      height: 14px;
      background: var(--border);
      margin: 0 4px;
      flex-shrink: 0;
    }
    /* 表格选择器 */
    .table-selector-menu {
      padding: 14px 16px 12px;
      min-width: auto;
      border-radius: 12px;
      box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.08);
    }
    .table-grid {
      display: grid;
      grid-template-columns: repeat(10, 20px);
      grid-template-rows: repeat(10, 20px);
      gap: 4px;
    }
    .table-grid-cell {
      width: 20px;
      height: 20px;
      border: 1px solid rgba(15, 23, 42, 0.12);
      border-radius: 5px;
      cursor: pointer;
      background: #ffffff;
      transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
      box-sizing: border-box;
    }
    .table-grid-cell.active {
      background: var(--accent-soft);
      border-color: rgba(108, 92, 231, 0.55);
      box-shadow: inset 0 0 0 1px rgba(108, 92, 231, 0.08);
    }
    .table-size-label {
      text-align: center;
      margin-top: 12px;
      font-size: 13px;
      line-height: 1.4;
      color: var(--text-secondary);
      font-variant-numeric: tabular-nums;
      user-select: none;
    }
    [data-theme="dark"] .table-grid-cell {
      background: var(--surface);
      border-color: rgba(255, 255, 255, 0.12);
    }
    [data-theme="dark"] .table-grid-cell.active {
      background: var(--accent-soft);
      border-color: rgba(133, 120, 240, 0.62);
      box-shadow: inset 0 0 0 1px rgba(133, 120, 240, 0.12);
    }
    /* 主编辑区：三区块卡片布局 */
    .content-shell {
      flex: 1;
      display: flex;
      min-width: 0;
      min-height: 0;
      gap: 10px;
      overflow: hidden;
    }
    .main {
      display: flex;
      flex: 1;
      min-width: 0;
      min-height: 0;
      gap: 4px;
      overflow: hidden;
      position: relative;
    }
    .content-block {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
      min-height: 0;
      background: var(--panel-bg);
      border: none;
      border-radius: var(--radius-lg);
      box-shadow: none;
      overflow: hidden;
      transition: flex 0.25s ease, max-width 0.25s ease;
    }
    .content-block .editor-toolbar,
    .content-block .preview-toolbar {
      border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .main.layout-both .editor-block,
    .main.layout-both .preview-block {
      min-width: 320px;
    }
    .main.layout-edit .preview-block,
    .main.layout-edit .resizer {
      display: none !important;
    }
    .main.layout-edit .editor-block {
      flex: 1 1 0 !important;
      max-width: none !important;
      min-width: 0;
    }
    .main.layout-preview .editor-block,
    .main.layout-preview .resizer {
      display: none !important;
    }
    .main.layout-preview .preview-block {
      flex: 1 1 0 !important;
      max-width: none !important;
      min-width: 0;
    }
    .content-block .pane {
      flex: 1;
      min-height: 0;
      border-radius: 0;
      box-shadow: none;
      border: none;
    }
    .pane {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
      overflow: hidden;
      transition: flex 0.25s ease, max-width 0.25s ease, opacity 0.2s ease;
    }
    .pane-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      height: 36px;
      padding: 0 12px;
      background: var(--panel-bg);
      border-bottom: 1px solid var(--border);
      font-size: 12px;
      color: var(--text-muted);
      letter-spacing: 0.02em;
      gap: 10px;
      flex-shrink: 0;
    }
    .pane-title {
      font-weight: 600;
      color: var(--text-secondary);
      font-size: 12px;
    }
    .toolbar-meta {
      margin-left: auto;
      display: flex;
      align-items: center;
      gap: 2px;
      flex-shrink: 0;
      padding-left: 12px;
    }
    .shortcut-tip-wrap {
      display: inline-flex;
    }
    .shortcut-tip-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      padding: 0;
      border: none;
      border-radius: 4px;
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
    }
    .shortcut-tip-btn:hover {
      background: var(--accent-soft);
      color: var(--accent);
    }
    .shortcut-tip-btn .icon {
      width: 16px;
      height: 16px;
      stroke-width: 1.75;
    }
    #shortcuts-modal .modal {
      max-width: 560px;
      max-height: min(78vh, 640px);
    }
    #md-syntax-modal .modal {
      max-width: 480px;
      max-height: min(78vh, 640px);
    }
    #shortcuts-modal .modal-body,
    #md-syntax-modal .modal-body {
      padding: 16px;
      font-size: 12px;
      line-height: 1.45;
    }
    .shortcuts-groups {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .shortcuts-group {
      border-radius: var(--radius);
      border: 1px solid var(--border);
      background: var(--panel-bg);
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    .shortcuts-group__head {
      padding: 10px 12px;
      border-bottom: 1px solid var(--border);
      background: color-mix(in srgb, var(--panel-bg) 88%, var(--border));
    }
    .shortcuts-group__head h4 {
      margin: 0 0 2px;
      font-size: 14px;
      font-weight: 700;
      letter-spacing: -0.01em;
      color: var(--text);
    }
    .shortcuts-group__head p {
      margin: 0;
      font-size: 12px;
      line-height: 1.45;
      color: var(--text-muted);
    }
    .shortcuts-table {
      display: grid;
      gap: 0;
    }
    .shortcuts-table__head,
    .shortcuts-row {
      display: grid;
      grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.2fr) minmax(0, 1fr);
      gap: 8px;
      align-items: center;
      padding: 12px;
      font-size: 12px;
    }
    .shortcuts-table__head {
      font-size: 10px;
      font-weight: 600;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: var(--text-muted);
      background: color-mix(in srgb, var(--panel-bg) 92%, var(--border));
      border-bottom: 1px solid var(--border);
    }
    .shortcuts-row {
      color: var(--text-secondary);
      border-bottom: 1px solid var(--border);
    }
    .shortcuts-row:last-child {
      border-bottom: none;
    }
    .shortcuts-row > :first-child {
      color: var(--text);
      font-weight: 500;
    }
    .shortcuts-table__head.md-syntax-row,
    .shortcuts-row.md-syntax-row {
      grid-template-columns: 94px minmax(0, 1fr);
      gap: 12px;
      padding: 10px 12px;
      align-items: start;
    }
    .shortcuts-row.md-syntax-row > :first-child {
      font-size: 12px;
      font-weight: 700;
      line-height: 1.4;
      padding-top: 5px;
      white-space: nowrap;
    }
    .md-syntax-row code {
      display: block;
      margin: 0;
      padding: 5px 8px;
      border-radius: 6px;
      border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
      background: color-mix(in srgb, var(--bg) 88%, #e8eaed);
      color: var(--text-secondary);
      font-family: var(--font-mono);
      font-size: 12px;
      font-weight: 500;
      line-height: 1.5;
      white-space: pre-wrap;
      word-break: break-word;
    }
    [data-theme="dark"] .md-syntax-row code {
      background: color-mix(in srgb, var(--bg) 92%, #9aa0a6);
      border-color: color-mix(in srgb, var(--border) 45%, transparent);
      color: var(--text-muted);
    }
    .shortcuts-combo {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 4px;
    }
    .shortcuts-keys {
      display: inline-flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 3px;
      font-size: 12px;
    }
    .shortcuts-keys .kbd-sep {
      color: var(--text-muted);
      font-size: 12px;
      line-height: 1;
      padding: 0 1px;
    }
    .shortcuts-keys kbd {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-sizing: border-box;
      min-width: 18px;
      min-height: 20px;
      padding: 0 5px;
      border-radius: 4px;
      border: 1px solid var(--border);
      background: var(--bg);
      color: var(--text);
      font-family: var(--font-mono);
      font-size: 12px;
      font-weight: 600;
      line-height: 1;
      white-space: nowrap;
    }
    @media (max-width: 560px) {
      #shortcuts-modal .modal {
        max-width: min(560px, calc(100vw - 24px));
      }
      #md-syntax-modal .modal {
        max-width: min(480px, calc(100vw - 24px));
      }
      .shortcuts-table__head,
      .shortcuts-row {
        grid-template-columns: 1fr;
        gap: 6px;
      }
      .shortcuts-table__head > :not(:first-child),
      .shortcuts-row > :not(:first-child) {
        justify-self: start;
      }
      .shortcuts-table__head > :nth-child(2)::before { content: "Windows · "; }
      .shortcuts-table__head > :nth-child(3)::before { content: "Mac · "; }
      .md-syntax-table .shortcuts-table__head > :nth-child(2)::before,
      .md-syntax-table .shortcuts-row > :nth-child(2)::before {
        content: none;
      }
      .shortcuts-row.md-syntax-row > :first-child {
        padding-top: 0;
      }
    }
    /* 预览区顶栏：与编辑工具栏同高对齐 */
    .preview-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 8px 16px;
      min-height: 44px;
      background: var(--panel-bg);
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }
    .preview-toolbar-title {
      font-size: 12px;
      font-weight: 600;
      color: var(--text-secondary);
      white-space: nowrap;
    }
    .preview-toolbar .preview-word-count {
      font-size: 11px;
      color: var(--text-muted);
      white-space: nowrap;
      flex-shrink: 0;
    }
    .resizer {
      width: 4px;
      flex: 0 0 4px;
      background: transparent;
      cursor: col-resize;
      position: relative;
      align-self: stretch;
      z-index: 6;
      touch-action: none;
    }
    .resizer::before {
      content: '';
      position: absolute;
      top: 0;
      bottom: 0;
      left: -8px;
      right: -8px;
    }
    .resizer-handle {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(0.92);
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0;
      border-radius: 50%;
      background: var(--resizer-handle-bg);
      border: 1px solid var(--resizer-handle-border);
      box-shadow: 0 2px 10px var(--resizer-handle-shadow);
      color: var(--accent);
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
      transition: opacity .18s ease, visibility .18s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
    }
    .resizer-handle .icon {
      width: 9px;
      height: 9px;
      stroke-width: 2.75;
      flex-shrink: 0;
    }
    .resizer:hover .resizer-handle,
    .resizer.dragging .resizer-handle {
      opacity: 1;
      visibility: visible;
      transform: translate(-50%, -50%) scale(1);
    }
    .resizer:hover:not(.dragging) .resizer-handle {
      background: var(--accent-soft);
      border-color: var(--accent);
      color: var(--accent);
      box-shadow: 0 4px 14px var(--resizer-handle-shadow);
    }
    .resizer.dragging .resizer-handle {
      background: var(--accent);
      border-color: var(--accent);
      color: #fff;
      box-shadow: 0 4px 14px var(--resizer-handle-shadow);
    }
    .resizer.hidden {
      display: none;
    }
    .resizing .content-block,
    .resizing .resizer {
      transition: none !important;
    }
    .editor-pane {
      background: var(--editor-bg);
    }
    .editor-wrap {
      flex: 1;
      display: flex;
      min-height: 0;
      overflow: hidden;
      background: var(--editor-bg);
    }
    .editor-gutter {
      flex-shrink: 0;
      align-self: stretch;
      width: var(--editor-gutter-width);
      min-height: 0;
      height: 100%;
      padding: 20px 10px 20px 14px;
      overflow: hidden;
      overflow-anchor: none;
      text-align: right;
      user-select: none;
      color: var(--editor-gutter-color);
      font-family: var(--font-editor-mono);
      font-size: var(--editor-font-size);
      line-height: var(--editor-line-height);
      border-right: 1px solid var(--editor-gutter-border);
      background: var(--editor-bg);
      box-sizing: border-box;
      cursor: text;
    }
    .editor-gutter .line-num {
      min-height: calc(var(--editor-font-size) * var(--editor-line-height));
      height: calc(var(--editor-font-size) * var(--editor-line-height));
      line-height: calc(var(--editor-font-size) * var(--editor-line-height));
      box-sizing: border-box;
    }
    .editor-highlight .hl-line {
      display: block;
      white-space: pre-wrap;
      word-break: break-word;
      overflow-wrap: break-word;
      min-height: calc(var(--editor-font-size) * var(--editor-line-height));
    }
    .editor-code {
      flex: 1;
      min-width: 0;
      min-height: 0;
      overflow-x: hidden;
      overflow-y: hidden;
      overflow-anchor: none;
    }
    .editor-stack {
      display: grid;
    }
    .editor-stack > .editor-highlight,
    .editor-stack > textarea {
      grid-area: 1 / 1;
      width: 100%;
      min-height: 0;
      margin: 0;
      padding: 20px 24px 20px 16px;
      border: none;
      outline: none;
      box-sizing: border-box;
      font: 400 var(--editor-font-size)/calc(var(--editor-font-size) * var(--editor-line-height)) var(--font-editor-mono);
      font-variant-ligatures: none;
      font-feature-settings: normal;
      letter-spacing: normal;
      tab-size: 4;
      white-space: pre-wrap;
      word-break: break-word;
      overflow-wrap: break-word;
      text-decoration: none;
      overflow: hidden;
      resize: none;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }
    .editor-highlight {
      pointer-events: none;
      color: var(--editor-text);
      background: transparent;
    }
    /* 高亮仅改颜色，不改字宽/字重，避免光标错位 */
    .editor-highlight .hl-heading { color: var(--hl-heading); }
    .editor-highlight .hl-heading-mark { color: var(--hl-heading-mark); }
    .editor-highlight .hl-bold { color: var(--hl-bold); }
    .editor-highlight .hl-italic { color: var(--hl-italic); }
    .editor-highlight .hl-code { color: var(--hl-code); }
    .editor-highlight .hl-link { color: var(--hl-link); }
    .editor-highlight .hl-quote { color: var(--hl-quote); }
    .editor-highlight .hl-meta { color: var(--hl-meta); }
    .editor-highlight .hl-fence { color: var(--hl-fence); }
    .editor-highlight .hl-tag { color: var(--hl-tag); }
    .editor-highlight .hl-str { color: var(--hl-str); }
    .editor-highlight .hl-hr { color: var(--hl-hr); }
    .editor-highlight .hl-strike { color: var(--hl-strike); }
    .editor-highlight .hl-codeblock { color: var(--editor-text); }
    .editor-highlight .hl-match {
      background: var(--editor-match-bg);
      border-radius: 2px;
      box-decoration-break: clone;
      -webkit-box-decoration-break: clone;
    }
    .editor-highlight .hl-code .hl-match {
      color: var(--hl-code);
    }
    .editor-code textarea {
      background: transparent;
      color: transparent;
      caret-color: var(--accent);
    }
    /* color:transparent 时各浏览器对 placeholder 继承不一致，需单独指定 */
    .editor-code textarea::placeholder {
      color: var(--text-muted);
      opacity: 0.55;
    }
    .editor-code textarea::-moz-placeholder {
      color: var(--text-muted);
      opacity: 0.55;
    }
    .editor-code textarea::selection {
      background: var(--editor-match-bg);
      color: transparent;
    }
    /* 编辑区 → 预览：镜像选区（不占用 document Selection，避免与 textarea 互斥） */
    ::highlight(markpane-sel) {
      background-color: var(--editor-match-bg);
      color: inherit;
    }
    .preview-pane {
      background: transparent;
    }
    .preview-content {
      flex: 1;
      overflow: auto;
      overflow-anchor: none;
      font-family: var(--font-editor);
      font-size: 14px;
      line-height: 1.8;
      color: var(--text);
      width: 100%;
      max-width: none;
      margin: 0;
      background: var(--panel-bg);
      padding: 20px 32px 28px;
      user-select: text;
      -webkit-user-select: text;
    }
    .preview-content:has(.preview-empty) {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 32px 24px;
    }
    .preview-empty {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
      max-width: 280px;
      text-align: center;
      color: var(--text-muted);
      user-select: none;
      -webkit-user-select: none;
      pointer-events: none;
    }
    .preview-empty-icon {
      width: 28px;
      height: 28px;
      padding: 14px;
      box-sizing: content-box;
      border-radius: 50%;
      margin-bottom: 6px;
      color: var(--accent);
      background: var(--accent-soft);
      opacity: 1;
    }
    .preview-empty-title {
      font-size: 15px;
      font-weight: 600;
      line-height: 1.4;
      color: var(--text-secondary);
      opacity: 0.88;
    }
    .preview-empty-hint {
      font-size: 13px;
      line-height: 1.55;
      opacity: 0.72;
    }
    .preview-content ::selection {
      background: var(--editor-match-bg);
    }
    .preview-content .markdown-body {
      max-width: none;
      margin: 0;
      padding: 0;
      background: transparent;
      border: none;
      box-shadow: none;
      border-radius: 0;
      min-height: 0;
      user-select: text;
      -webkit-user-select: text;
    }
    .preview-source {
      flex: 1;
      width: 100%;
      padding: 28px 32px;
      border: none;
      outline: none;
      resize: none;
      display: none;
      font-family: var(--font-mono);
      font-size: 15px;
      line-height: 1.7;
      background: var(--preview-canvas);
      color: var(--text);
      caret-color: var(--accent);
      tab-size: 4;
      white-space: pre-wrap;
      word-break: break-all;
    }
    .preview-toggle {
      display: flex;
      gap: 4px;
      padding: 3px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
    }
    .toggle-btn {
      padding: 3px 12px;
      border: none;
      border-radius: 5px;
      background: transparent;
      color: var(--text-muted);
      font-size: 12px;
      font-weight: 500;
      cursor: pointer;
      transition: all .15s ease;
    }
    .toggle-btn.active {
      background: var(--panel-bg);
      color: var(--accent);
      box-shadow: var(--shadow-sm);
    }
    .toggle-btn:hover:not(.active) {
      color: var(--accent);
    }
    /* Markdown 预览样式 */
    .preview-content h1, .preview-content h2, .preview-content h3,
    .preview-content h4, .preview-content h5, .preview-content h6 {
      margin-top: 30px;
      margin-bottom: 16px;
      font-weight: 600;
      line-height: 1.25;
      color: var(--text);
      letter-spacing: -0.01em;
    }
    .preview-content h1 {
      font-size: 2.25em;
      font-weight: 700;
      letter-spacing: -0.02em;
      margin-bottom: 30px;
    }
    .preview-content h2 {
      position: relative;
      font-size: 1.55em;
      font-weight: 600;
      line-height: 1.4;
      letter-spacing: -0.01em;
      margin: 30px 0 22px;
      padding: 14px 76px 14px 20px;
      color: var(--text);
      background: transparent;
      border: none;
      border-bottom: 1px solid var(--hr-line);
      border-radius: 0;
      box-shadow: none;
      box-sizing: border-box;
    }
    [data-theme="dark"] .preview-content h2 {
      background: transparent;
    }
    .preview-content h2::before {
      content: '';
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(calc(-50% - 0.5px));
      width: 4px;
      height: 1.2em;
      border-radius: 3px;
      background: var(--accent);
    }
    .preview-content h2::after {
      content: '';
      position: absolute;
      right: 0;
      top: 50%;
      transform: translateY(calc(-50% - 0.5px));
      width: 18px;
      height: 12px;
      pointer-events: none;
      background: var(--accent);
      -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12'%3E%3Ccircle cx='6' cy='6' r='5.5' fill='%23fff' fill-opacity='0.5'/%3E%3Ccircle cx='12' cy='6' r='5.5' fill='%23fff' fill-opacity='0.2'/%3E%3C/svg%3E");
      mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12'%3E%3Ccircle cx='6' cy='6' r='5.5' fill='%23fff' fill-opacity='0.5'/%3E%3Ccircle cx='12' cy='6' r='5.5' fill='%23fff' fill-opacity='0.2'/%3E%3C/svg%3E");
      -webkit-mask-size: 100% 100%;
      mask-size: 100% 100%;
      -webkit-mask-repeat: no-repeat;
      mask-repeat: no-repeat;
    }
    .preview-content h3 { font-size: 1.4em; }
    .preview-content h4 { font-size: 1.15em; }
    .preview-content .md-source-block:first-child > :first-child {
      margin-top: 0;
    }
    .preview-content p { margin: 0 0 20px; color: var(--text); }
    .preview-content a { color: var(--accent); text-decoration: none; }
    .preview-content a:hover { text-decoration: underline; }
    .preview-content ul, .preview-content ol { margin: 0 0 20px; padding-left: 1.8em; }
    .preview-content ol.ol-circle {
      list-style: none;
      padding-left: 1.8em;
      margin: 0 0 20px;
      counter-reset: ol-circle;
    }
    .preview-content ol.ol-circle > li {
      position: relative;
      display: block;
      margin: 0.65em 0 0.65em -1.4em;
      padding-left: 2em;
      min-height: 1.55em;
      counter-increment: ol-circle;
      overflow-wrap: break-word;
      word-break: normal;
    }
    .preview-content ol.ol-circle > li::before {
      content: counter(ol-circle);
      position: absolute;
      left: 0;
      top: 0.35em;
      width: 1.5em;
      height: 1.5em;
      border-radius: 50%;
      background: var(--accent);
      color: #fff;
      font-size: 0.82em;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      box-sizing: border-box;
    }
    .preview-content ol.ol-circle > li > p {
      margin: 0;
    }
    .preview-content ol.ol-circle > li code {
      white-space: break-spaces;
      word-break: break-all;
    }
    .ol-style-swatch {
      width: 18px;
      height: 18px;
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      font-weight: 700;
      line-height: 1;
      color: var(--accent);
    }
    .ol-style-swatch-default {
      letter-spacing: -0.02em;
    }
    .ol-style-swatch-circle {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: var(--accent);
      color: #fff;
      font-size: 10px;
    }
    #ordered-menu .dropdown-item {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .preview-content li { margin: 6px 0; }
    .preview-content code {
      background: var(--hl-code-bg);
      padding: 0.15em 0.45em;
      border-radius: 5px;
      border: 1px solid rgba(163, 21, 21, 0.08);
      font-family: var(--font-editor-mono);
      font-size: 0.9em;
      color: var(--hl-code);
    }
    [data-theme="dark"] .preview-content code {
      border-color: rgba(244, 114, 182, 0.16);
    }
    .preview-content del,
    .preview-content s {
      text-decoration: line-through;
      color: var(--text-muted);
    }
    .preview-content pre {
      position: relative;
      background: var(--code-bg);
      color: var(--code-text);
      padding: 38px 20px 18px;
      border-radius: 12px;
      border: none;
      overflow-x: visible;
      margin: 6px 0 22px;
      box-shadow: var(--code-shadow);
      font-family: var(--font-editor-mono);
      font-size: 0.92em;
      line-height: 1.7;
      letter-spacing: 0.01em;
      white-space: pre-wrap;
      word-break: break-word;
      overflow-wrap: anywhere;
      -webkit-font-smoothing: antialiased;
    }
    .preview-content pre::before {
      content: '';
      position: absolute;
      left: 18px;
      top: 15px;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: #ff5f57;
      box-shadow: 16px 0 0 #febc2e, 32px 0 0 #28c840;
      pointer-events: none;
    }
    .preview-content pre code {
      background: transparent;
      padding: 0;
      border: none;
      color: inherit;
      font-size: inherit;
      font-family: inherit;
      border-radius: 0;
      box-shadow: none;
      white-space: inherit;
      word-break: inherit;
      overflow-wrap: inherit;
    }
    .preview-content blockquote {
      margin: 0 0 20px;
      padding: 16px 20px;
      border: none;
      border-left: 4px solid var(--quote-border);
      background: var(--quote-bg);
      color: var(--quote-text);
      font-style: normal;
      font-size: 0.95em;
      line-height: 1.75;
    }
    .preview-content blockquote p {
      margin: 0;
      color: inherit;
    }
    .preview-content blockquote p + p {
      margin-top: 8px;
    }
    .preview-content table {
      border-collapse: collapse;
      width: 100%;
      margin-bottom: 0;
      border-radius: var(--radius-sm);
      overflow: hidden;
    }
    .preview-table-wrap {
      position: relative;
      overflow-x: hidden;
      overflow-y: hidden;
      margin-bottom: 20px;
      max-width: 100%;
      border: 1px solid var(--table-grid-border);
      border-radius: var(--radius-sm);
      background: var(--panel-bg);
      -webkit-overflow-scrolling: touch;
    }
    .preview-table-wrap.has-horizontal-scroll {
      overflow-x: auto;
      padding-bottom: 4px;
      scrollbar-width: thin;
      scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    }
    .preview-table-wrap.has-horizontal-scroll::-webkit-scrollbar {
      height: 6px;
    }
    .preview-table-wrap.has-horizontal-scroll::-webkit-scrollbar-thumb {
      border-width: 1px;
    }
    .preview-table-wrap.has-horizontal-scroll:not(:hover):not(:focus-within)::-webkit-scrollbar-thumb {
      background-color: rgba(15, 23, 42, 0.08);
    }
    [data-theme="dark"] .preview-table-wrap.has-horizontal-scroll:not(:hover):not(:focus-within)::-webkit-scrollbar-thumb {
      background-color: rgba(255, 255, 255, 0.08);
    }
    .preview-table-wrap .table-edge-resizer {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 4px;
      cursor: col-resize;
      z-index: 3;
      user-select: none;
      touch-action: none;
    }
    .preview-table-wrap .table-edge-resizer::after {
      content: '';
      position: absolute;
      top: 8px;
      bottom: 8px;
      left: 50%;
      width: 2px;
      transform: translateX(-50%);
      border-radius: 1px;
      background: transparent;
      transition: background .15s ease;
    }
    .preview-table-wrap .table-edge-resizer:hover::after,
    .preview-table-wrap .table-edge-resizer.is-dragging::after {
      background: var(--accent);
    }
    .preview-table-wrap .table-edge-resizer:hover,
    .preview-table-wrap .table-edge-resizer.is-dragging {
      background: rgba(108, 92, 231, 0.08);
    }
    [data-theme="dark"] .preview-table-wrap .table-edge-resizer:hover,
    [data-theme="dark"] .preview-table-wrap .table-edge-resizer.is-dragging {
      background: rgba(133, 120, 240, 0.12);
    }
    .preview-content table.preview-table-resizable {
      table-layout: fixed;
      width: 100%;
      max-width: none;
      border-radius: 0;
      overflow: visible;
    }
    .preview-table-wrap table.preview-table-resizable th,
    .preview-table-wrap table.preview-table-resizable td {
      border: none;
      border-right: 1px solid var(--table-grid-border);
      border-bottom: 1px solid var(--table-grid-border);
    }
    .preview-table-wrap table.preview-table-resizable tr > :last-child {
      border-right: none;
    }
    .preview-table-wrap table.preview-table-resizable tr:last-child > th,
    .preview-table-wrap table.preview-table-resizable tr:last-child > td {
      border-bottom: none;
    }
    .preview-content .preview-table-cell {
      position: relative;
      overflow: hidden;
      word-break: break-word;
      border-radius: 0;
    }
    .preview-content .preview-editable {
      cursor: text;
      outline: none;
      border-radius: 3px;
      transition: box-shadow .15s ease, background-color .15s ease;
    }
    .preview-content th.preview-editable,
    .preview-content td.preview-editable {
      border-radius: 0;
    }
    .preview-content thead th,
    .preview-table-wrap table.preview-table-resizable thead th {
      border-bottom: 1px solid var(--table-grid-border);
    }
    .preview-content .preview-editable:focus {
      box-shadow: 0 0 0 2px var(--accent-soft);
      background: var(--accent-soft);
    }
    .preview-content li.task-item.preview-editable:focus-within {
      box-shadow: 0 0 0 2px var(--accent-soft);
      background: var(--accent-soft);
    }
    .preview-content li.task-item .task-text.preview-editable:focus {
      box-shadow: none;
      background: transparent;
    }
    .preview-content blockquote .preview-editable:focus {
      background: rgba(108, 92, 231, 0.08);
    }
    [data-theme="dark"] .preview-content blockquote .preview-editable:focus {
      background: rgba(133, 120, 240, 0.12);
    }
    .preview-content .col-resizer {
      position: absolute;
      top: 0;
      right: -4px;
      width: 8px;
      height: 100%;
      cursor: col-resize;
      z-index: 2;
      user-select: none;
      touch-action: none;
    }
    .preview-content .col-resizer::after {
      content: '';
      position: absolute;
      top: 8px;
      bottom: 8px;
      left: 50%;
      width: 2px;
      transform: translateX(-50%);
      border-radius: 1px;
      background: transparent;
      transition: background .15s ease;
    }
    .preview-content .col-resizer:hover::after,
    .preview-content .col-resizer.is-dragging::after {
      background: var(--accent);
    }
    .preview-content .col-resizer:hover,
    .preview-content .col-resizer.is-dragging {
      background: rgba(108, 92, 231, 0.08);
    }
    [data-theme="dark"] .preview-content .col-resizer:hover,
    [data-theme="dark"] .preview-content .col-resizer.is-dragging {
      background: rgba(133, 120, 240, 0.12);
    }
    .preview-content .mermaid {
      margin: 6px 0 22px;
      padding: 28px 24px;
      text-align: center;
      overflow-x: auto;
      overflow-y: hidden;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-sm);
      -webkit-overflow-scrolling: touch;
    }
    .preview-content .mermaid svg {
      max-width: 100%;
      height: auto;
      display: inline-block;
      vertical-align: middle;
    }
    .preview-content .mermaid .node .label-container,
    .preview-content .mermaid .node rect {
      rx: 10px;
      ry: 10px;
    }
    .preview-content .mermaid .node .label-container,
    .preview-content .mermaid .node rect,
    .preview-content .mermaid .node circle,
    .preview-content .mermaid .node ellipse,
    .preview-content .mermaid .node polygon {
      filter: drop-shadow(0 2px 6px rgba(108, 92, 231, 0.12));
    }
    [data-theme="dark"] .preview-content .mermaid .node .label-container,
    [data-theme="dark"] .preview-content .mermaid .node rect,
    [data-theme="dark"] .preview-content .mermaid .node circle,
    [data-theme="dark"] .preview-content .mermaid .node ellipse,
    [data-theme="dark"] .preview-content .mermaid .node polygon {
      filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
    }
    .preview-content .mermaid .edgePath .path,
    .preview-content .mermaid .flowchart-link {
      stroke-width: 1.75px;
    }
    .preview-content .mermaid .edgeLabel span,
    .preview-content .mermaid .nodeLabel,
    .preview-content .mermaid .label {
      font-family: var(--font-sans);
      letter-spacing: 0.01em;
    }
    .preview-content .mermaid .marker {
      fill: var(--accent) !important;
      stroke: var(--accent) !important;
    }
    /* Mindmap */
    .preview-content .mermaid .mindmap-node .node-bkg {
      filter: drop-shadow(0 2px 5px rgba(108, 92, 231, 0.1));
    }
    [data-theme="dark"] .preview-content .mermaid .mindmap-node .node-bkg {
      filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
    }
    .preview-content .mermaid .mindmap-node.section-root .node-bkg {
      filter: drop-shadow(0 3px 8px rgba(108, 92, 231, 0.28));
    }
    .preview-content .mermaid .mindmap-edges path,
    .preview-content .mermaid [class*="edge-depth-"] {
      opacity: 0.9;
    }
    .preview-content .mermaid .mindmap-node-label,
    .preview-content .mermaid .mindmap-node text {
      font-family: var(--font-sans);
    }
    .preview-content th, .preview-content td {
      border: 1px solid var(--border);
      padding: 10px 14px;
      text-align: left;
      vertical-align: top;
    }
    .preview-content th { background: var(--surface); font-weight: 600; color: var(--text); }
    .preview-content img { max-width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
    [data-theme="dark"] .preview-content img { opacity: 0.95; }
    .preview-content .preview-image-error {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      max-width: 100%;
      box-sizing: border-box;
      margin: 12px 0 20px;
      padding: 14px 16px;
      border: 1px dashed rgba(15, 23, 42, 0.18);
      border-radius: var(--radius-lg);
      background: var(--surface);
      color: var(--text-secondary);
      box-shadow: none;
    }
    [data-theme="dark"] .preview-content .preview-image-error {
      border-color: rgba(255, 255, 255, 0.16);
      background: rgba(255, 255, 255, 0.04);
    }
    .preview-content .preview-image-error-icon {
      flex-shrink: 0;
      width: 22px;
      height: 22px;
      margin-top: 1px;
      color: var(--text-muted);
    }
    .preview-content .preview-image-error-text {
      display: flex;
      flex-direction: column;
      gap: 3px;
      min-width: 0;
    }
    .preview-content .preview-image-error-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
      line-height: 1.4;
    }
    .preview-content .preview-image-error-name {
      font-size: 12px;
      font-family: var(--font-editor-mono);
      color: var(--accent);
      word-break: break-all;
      line-height: 1.45;
    }
    .preview-content .preview-image-error-hint {
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.5;
    }
    .export-image-link-fallback { display: none; }
    .preview-content hr {
      border: none;
      border-top: 1px solid var(--hr-line);
      height: 0;
      margin: 20px 0;
      background: none;
      display: block;
    }
    .preview-content badges {
      display: inline-block;
      padding: 5px 14px;
      margin: 0 0.45em 0.55em 0;
      border-radius: 999px;
      border: 1px solid transparent;
      font-size: 0.95em;
      font-weight: 600;
      line-height: 1.45;
      vertical-align: baseline;
      letter-spacing: 0.01em;
      white-space: nowrap;
      box-sizing: border-box;
      -webkit-font-smoothing: antialiased;
    }
    .preview-content p:has(> badges:only-child) {
      margin-bottom: 0.15em;
    }
    .preview-content badges[tone="accent"],
    .preview-content badges:not([tone]) {
      background: var(--accent-soft);
      color: var(--accent);
      border-color: color-mix(in srgb, var(--accent) 42%, transparent);
    }
    .preview-content badges[tone="green"] {
      background: rgba(34, 197, 94, 0.14);
      color: #15803d;
      border-color: rgba(34, 197, 94, 0.45);
    }
    .preview-content badges[tone="yellow"] {
      background: rgba(234, 179, 8, 0.16);
      color: #a16207;
      border-color: rgba(234, 179, 8, 0.5);
    }
    .preview-content badges[tone="dark"] {
      background: rgba(15, 23, 42, 0.88);
      color: #f8fafc;
      border-color: rgba(15, 23, 42, 0.55);
    }
    [data-theme="dark"] .preview-content badges[tone="green"] {
      background: rgba(34, 197, 94, 0.2);
      color: #86efac;
      border-color: rgba(134, 239, 172, 0.45);
    }
    [data-theme="dark"] .preview-content badges[tone="yellow"] {
      background: rgba(234, 179, 8, 0.2);
      color: #fde68a;
      border-color: rgba(253, 230, 138, 0.45);
    }
    [data-theme="dark"] .preview-content badges[tone="dark"] {
      background: rgba(255, 255, 255, 0.12);
      color: #f0f2f7;
      border-color: rgba(255, 255, 255, 0.28);
    }
    .tag-swatch {
      width: 12px;
      height: 12px;
      border-radius: 999px;
      flex-shrink: 0;
      display: inline-block;
    }
    .tag-swatch-accent { background: var(--accent); }
    .tag-swatch-green { background: #22c55e; }
    .tag-swatch-yellow { background: #eab308; }
    .tag-swatch-dark { background: #1a1d23; }
    [data-theme="dark"] .tag-swatch-dark { background: #e8eaed; }
    #tag-menu .dropdown-item,
    #more-format-menu .dropdown-item {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .effect-swatch {
      width: 16px;
      height: 12px;
      border-radius: 4px;
      flex-shrink: 0;
      display: inline-block;
    }
    .effect-swatch-gradient {
      background: linear-gradient(90deg, var(--accent-soft), rgba(108, 92, 231, 0.06));
      border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    }
    .effect-swatch-capsule {
      background: var(--accent);
      border-radius: 999px;
    }
    .effect-swatch-strong {
      background: color-mix(in srgb, var(--accent) 75%, #1a1d23);
    }
    .effect-swatch-soft {
      background: color-mix(in srgb, var(--accent) 55%, #c4b5fd);
    }
    .preview-content .md-mark {
      display: inline;
      box-decoration-break: clone;
      -webkit-box-decoration-break: clone;
    }
    .preview-content .md-mark-gradient {
      background: linear-gradient(90deg, var(--accent-soft), rgba(108, 92, 231, 0.08));
      padding: 2px 6px;
      border-radius: 4px;
      color: var(--text);
    }
    [data-theme="dark"] .preview-content .md-mark-gradient {
      background: linear-gradient(90deg, rgba(133, 120, 240, 0.28), rgba(133, 120, 240, 0.1));
    }
    .preview-content .md-mark-capsule {
      background: var(--accent);
      color: #fff;
      padding: 2px 10px;
      border-radius: 999px;
      font-weight: 600;
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
    }
    .preview-content .md-mark-strong {
      color: color-mix(in srgb, var(--accent) 82%, #1a1d23);
      font-weight: 700;
    }
    [data-theme="dark"] .preview-content .md-mark-strong {
      color: color-mix(in srgb, var(--accent) 70%, white);
    }
    .preview-content .md-mark-soft {
      /* 柔光重点：偏亮的主题色（柔和蓝紫），对齐 R-Markdown ::文字:: */
      color: color-mix(in srgb, var(--accent) 62%, #c4b5fd);
      font-weight: 600;
    }
    [data-theme="dark"] .preview-content .md-mark-soft {
      color: color-mix(in srgb, var(--accent) 48%, #ddd6fe);
    }
    /* 状态栏 */
    .statusbar {
      display: none;
    }
    /* 模态框*/
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.42);
      backdrop-filter: blur(6px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 200;
      padding: 20px 16px;
      opacity: 0;
      transition: opacity .2s ease;
    }
    .modal-overlay.show {
      opacity: 1;
    }
    /* 查找弹窗：无遮罩，便于对照文档 */
    #find-modal {
      background: transparent;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      pointer-events: none;
    }
    #find-modal .modal {
      pointer-events: auto;
    }
    .modal {
      background: var(--panel-bg);
      color: var(--text);
      border-radius: 14px;
      width: 100%;
      max-width: 520px;
      max-height: 88vh;
      box-shadow: 0 24px 64px rgba(15, 23, 42, 0.16), 0 8px 20px rgba(15, 23, 42, 0.08);
      border: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      transform: translateY(8px) scale(0.985);
      opacity: 0;
      transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1), opacity .22s ease;
    }
    .modal-overlay.show .modal {
      transform: translateY(0) scale(1);
      opacity: 1;
    }
    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      padding: 14px 18px;
      border-bottom: 1px solid var(--border);
      background: var(--panel-bg);
    }
    .modal-header h3 {
      margin: 0;
      font-size: 15px;
      font-weight: 600;
      letter-spacing: -0.01em;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      color: var(--text);
    }
    .modal-header button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      background: transparent;
      border: none;
      padding: 0;
      border-radius: 6px;
      color: var(--text-muted);
      cursor: pointer;
      line-height: 1;
      transition: color .15s ease, background .15s ease;
    }
    .modal-header button:hover {
      color: var(--text);
      background: var(--surface);
    }
    .modal-body {
      padding: 16px 18px 18px;
      overflow-y: auto;
      font-size: 13px;
      line-height: 1.6;
      background: var(--modal-body-bg);
    }
    .modal-body p {
      color: var(--text-secondary);
      font-size: 12px;
    }
    .confirm-modal .modal-header {
      border-bottom: none;
    }
    .confirm-modal .modal-body {
      background: var(--panel-bg);
      padding-top: 0;
    }
    .confirm-modal .modal-footer {
      border-top: none;
      padding-top: 0;
    }
    .confirm-modal-footer {
      justify-content: space-between;
    }
    .confirm-modal-footer-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-left: auto;
    }
    .confirm-modal .modal-body p {
      margin: 0;
      color: var(--text);
      font-size: 14px;
      line-height: 1.65;
    }
    .modal-body ul {
      margin: 6px 0 12px;
      padding-left: 1.5em;
    }
    .modal-body li {
      margin: 4px 0;
      font-size: 13px;
    }
    .modal-body label {
      display: block;
      font-weight: 600;
      margin-bottom: 6px;
      color: var(--text-secondary);
      font-size: 12px;
      letter-spacing: 0.01em;
    }
    .modal-body input[type="url"],
    .modal-body textarea,
    .modal-body input[type="text"],
    .modal-body select {
      width: 100%;
      min-height: 34px;
      padding: 7px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--panel-bg);
      color: var(--text);
      font-size: 13px;
      outline: none;
      margin-bottom: 14px;
      transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
      box-shadow: none;
    }
    .modal-body select {
      appearance: none;
      -webkit-appearance: none;
      padding-right: 32px;
      cursor: pointer;
      background-color: var(--panel-bg);
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2370757a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 10px center;
      background-size: 14px;
    }
    [data-theme="dark"] .modal-body select {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a5adb8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    }
    .modal-body input[type="url"]:focus,
    .modal-body textarea:focus,
    .modal-body input[type="text"]:focus,
    .modal-body select:focus {
      border-color: var(--accent);
      background: var(--panel-bg);
      box-shadow: 0 0 0 2px var(--accent-soft);
    }
    .modal-body textarea {
      font-family: var(--font-editor-mono);
      resize: vertical;
      min-height: 120px;
      line-height: 1.5;
    }
    .modal-footer {
      padding: 12px 18px;
      border-top: 1px solid var(--border);
      background: var(--panel-bg);
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 8px;
    }
    .modal-footer button {
      padding: 7px 14px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--panel-bg);
      color: var(--text-secondary);
      font-size: 12px;
      font-weight: 500;
      cursor: pointer;
      transition: all .15s ease;
    }
    .modal-footer button:hover {
      border-color: var(--accent);
      color: var(--accent);
      background: var(--accent-soft);
    }
    .modal-footer button.primary {
      background: var(--accent);
      color: #fff;
      border-color: var(--accent);
    }
    .modal-footer button.primary:hover {
      background: var(--accent-hover);
      border-color: var(--accent-hover);
      color: #fff;
    }
    .confirm-modal .modal-footer button.btn-text {
      padding: 7px 0;
      border: none;
      background: transparent;
      box-shadow: none;
      color: var(--text-muted);
      transition: color .15s ease;
    }
    .confirm-modal .modal-footer button.btn-text:hover,
    .confirm-modal .modal-footer button.btn-text:focus-visible {
      color: var(--accent);
      border: none;
      background: transparent;
      box-shadow: none;
    }
    /* 帮助弹窗 */
    #help-modal .modal {
      max-width: 540px;
    }
    #help-modal .modal-body {
      flex: 1 1 auto;
      min-height: 0;
      padding: 12px 14px 14px;
    }
    .help-modal-footer {
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 10px;
    }
    .help-modal-footer-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .help-doc {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .help-lead {
      margin: 0;
      padding: 10px 12px;
      background: var(--panel-bg);
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 13px;
      line-height: 1.55;
      color: var(--text-secondary);
    }
    .help-section {
      padding: 10px 12px;
      background: var(--panel-bg);
      border: 1px solid var(--border);
      border-radius: 8px;
    }
    .help-section-title {
      margin: 6px 0 6px;
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      letter-spacing: 0.01em;
    }
    .help-list {
      margin: 0;
      padding-left: 1.15em;
      list-style: disc;
    }
    .help-list li {
      margin: 0;
      padding: 3px 0;
      font-size: 12px;
      line-height: 1.55;
      color: var(--text-secondary);
    }
    .help-list li::marker {
      color: var(--accent);
    }
    .help-list b {
      font-weight: 600;
      color: var(--text);
    }
    .help-list code {
      font-family: var(--font-editor-mono);
      font-size: 11px;
      padding: 1px 5px;
      border-radius: 4px;
      background: var(--modal-body-bg);
      border: 1px solid var(--border);
      color: var(--text);
    }
    .help-footer {
      margin: 2px 0 0;
      padding-top: 2px;
      font-size: 11px;
      line-height: 1.5;
      color: var(--text-muted);
      text-align: center;
    }
    /* 移动端 */
    @media (max-width: 768px) {
      .header-bar { padding: 0 10px; gap: 8px; height: 48px; }
      .header-bar .brand { font-size: 13px; }
      .brand-links,
      .brand-sep { display: none; }
      .header-bar .filename-input { min-width: 56px; max-width: 120px; font-size: 12px; padding: 2px 6px; }
      .header-status { display: none; }
      .header-bar button span, .header-bar label span { display: none; }
      .side-rail { display: none; }
      .editor-toolbar { padding: 6px; gap: 8px; }
      .editor-toolbar .format-group-track, .editor-toolbar .editor-actions { gap: 3px; padding: 3px; }
      .editor-toolbar button span { display: none; }
      .main { flex-direction: column; }
      .main.layout-edit .preview-block,
      .main.layout-preview .editor-block {
        display: none !important;
      }
      .preview-block .preview-pane { border-top: none; }
      .resizer { display: none; }
      .preview-content { padding: 20px 24px; }
      .preview-content .markdown-body { padding: 0; }
    }
    /* Toast 提示 — 层级高于弹窗 */
    .toast {
      position: fixed;
      bottom: 56px;
      left: 50%;
      transform: translateX(-50%) translateY(20px);
      display: inline-flex;
      align-items: center;
      gap: 8px;
      max-width: min(92vw, 420px);
      background: rgba(26, 29, 35, 0.94);
      color: #fff;
      padding: 10px 16px;
      border-radius: 999px;
      font-size: 13px;
      font-weight: 500;
      line-height: 1.4;
      opacity: 0;
      pointer-events: none;
      transition: opacity .3s ease, transform .3s ease;
      z-index: 400;
      box-shadow: 0 10px 32px rgba(15, 23, 42, 0.2), 0 2px 8px rgba(15, 23, 42, 0.12);
      backdrop-filter: blur(10px);
    }
    .toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
    .toast-icon {
      width: 16px;
      height: 16px;
      flex-shrink: 0;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
      color: #fff;
    }
    .toast-text {
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    /* 拖放文件提示遮罩 */
    .drop-overlay {
      position: fixed;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 28px;
      z-index: 300;
      pointer-events: none;
      visibility: hidden;
      opacity: 0;
      background: rgba(248, 249, 252, 0.58);
      backdrop-filter: blur(6px) saturate(1.05);
      -webkit-backdrop-filter: blur(6px) saturate(1.05);
      transition: opacity .2s ease, visibility .2s ease;
    }
    .drop-overlay::before {
      content: '';
      position: absolute;
      inset: 18px;
      border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent);
      border-radius: 18px;
      background: color-mix(in srgb, var(--accent) 7%, transparent);
      box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
    }
    [data-theme="dark"] .drop-overlay {
      background: rgba(8, 10, 16, 0.52);
    }
    .drop-overlay.show {
      visibility: visible;
      opacity: 1;
    }
    .drop-overlay.show .drop-message {
      transform: translateY(0) scale(1);
      opacity: 1;
    }
    .drop-message {
      position: relative;
      z-index: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 14px;
      max-width: min(420px, calc(100vw - 64px));
      padding: 28px 32px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: var(--panel-bg);
      box-shadow: var(--shadow-lg);
      text-align: center;
      transform: translateY(8px) scale(0.98);
      opacity: 0;
      transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1), opacity .22s ease;
    }
    .drop-message-icon {
      width: 52px;
      height: 52px;
      border-radius: 14px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: var(--accent-soft);
      color: var(--accent);
      box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
    }
    .drop-message-icon .icon {
      width: 24px;
      height: 24px;
    }
    .drop-message-text {
      margin: 0;
      color: var(--text);
      font-size: 15px;
      font-weight: 600;
      line-height: 1.45;
      letter-spacing: -0.01em;
    }
    /* 导出图片 */
    .export-image-stage {
      position: fixed;
      left: -99999px;
      top: 0;
      visibility: visible;
      pointer-events: none;
      z-index: -1;
    }
    .ratio-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
      gap: 8px;
      margin-bottom: 14px;
    }
    .ratio-btn {
      padding: 8px 4px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--panel-bg);
      color: var(--text-secondary);
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      transition: all .15s ease;
      line-height: 1.3;
    }
    .ratio-btn small {
      display: block;
      font-size: 10px;
      color: var(--text-muted);
      font-weight: 400;
      margin-top: 2px;
    }
    .ratio-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
      background: var(--accent-soft);
    }
    .ratio-btn.active {
      background: var(--accent-soft);
      color: var(--accent);
      border-color: var(--accent);
      box-shadow: inset 0 0 0 1px var(--accent-soft);
    }
    .ratio-btn.active small {
      color: var(--accent);
      opacity: 0.85;
    }
    .ratio-btn:disabled {
      opacity: 0.42;
      cursor: not-allowed;
      pointer-events: none;
      background: var(--surface);
      border-color: var(--border);
      color: var(--text-muted);
    }
    .ratio-btn:disabled small {
      color: var(--text-muted);
      opacity: 0.8;
    }
    .modal-body .option-row {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      margin: 12px 0 16px;
      padding: 10px 12px;
      cursor: pointer;
      font-weight: 500;
      font-size: 13px;
      letter-spacing: normal;
      color: inherit;
      transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
    }
    .modal-body .option-row input[type="checkbox"] {
      -webkit-appearance: none;
      appearance: none;
      width: 16px;
      height: 16px;
      margin: 1px 0 0;
      flex-shrink: 0;
      border: 1.5px solid color-mix(in srgb, var(--accent) 42%, var(--border));
      border-radius: 5px;
      background: var(--panel-bg);
      cursor: pointer;
      position: relative;
      box-sizing: border-box;
      transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
    }
    .modal-body .option-row input[type="checkbox"]:hover {
      border-color: var(--accent);
    }
    .modal-body .option-row input[type="checkbox"]:checked {
      background: var(--accent);
      border-color: var(--accent);
    }
    .modal-body .option-row input[type="checkbox"]:checked::after {
      content: '';
      position: absolute;
      left: 50%;
      top: 45%;
      width: 3.5px;
      height: 7px;
      border: solid #fff;
      border-width: 0 1.5px 1.5px 0;
      transform: translate(-50%, -55%) rotate(45deg);
    }
    .modal-body .option-row input[type="checkbox"]:focus {
      outline: none;
    }
    .modal-body .option-row input[type="checkbox"]:focus-visible {
      box-shadow: 0 0 0 2px var(--accent-soft);
    }
    .modal-body .option-row > span {
      display: block;
      flex: 1;
      min-width: 0;
      margin: 0;
      font-weight: 500;
      font-size: 13px;
      line-height: 1.45;
      cursor: pointer;
      color: var(--text-secondary);
    }
    .modal-body .option-row:has(input:checked) > span {
      color: var(--text);
    }
    #export-image-preview-wrap {
      min-height: 200px;
      max-height: min(60vh, 520px);
      width: 100%;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 8px;
      display: block;
      overflow-x: hidden;
      overflow-y: auto;
      padding: 12px;
      transition: opacity .15s ease;
      -webkit-overflow-scrolling: touch;
    }
    #export-image-preview-wrap.is-generating {
      overflow: hidden;
    }
    #export-image-preview-wrap.is-generating #export-image-preview {
      display: none !important;
    }
    .export-image-loading {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      min-height: 176px;
      padding: 24px 16px;
      color: var(--text-secondary);
    }
    .export-image-loading[hidden] {
      display: none !important;
    }
    .export-image-loading-spinner {
      width: 28px;
      height: 28px;
      border: 2px solid var(--border);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: app-loading-spin .75s linear infinite;
    }
    .export-image-loading p {
      margin: 0;
      font-size: 13px;
      letter-spacing: 0.02em;
    }
    #export-image-modal.is-export-generating .ratio-btn {
      pointer-events: none;
      opacity: 0.65;
    }
    #export-image-preview {
      width: 100%;
      max-width: 100%;
      height: auto;
      display: block;
      border-radius: var(--radius-sm);
      box-shadow: var(--shadow-sm);
    }
    .export-image-preview-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 8px;
    }
    .export-image-preview-head > label {
      margin: 0;
    }
    .export-image-meta {
      margin: 0;
      font-size: 11px;
      line-height: 1.4;
      color: var(--text-muted);
      white-space: nowrap;
      flex-shrink: 0;
    }
    .modal-body .hint {
      margin: 10px 0 0;
      font-size: 12px;
      line-height: 1.5;
      color: var(--text-muted);
    }
    /* 插入图片模态框 */
    .image-modal-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0;
      margin: 0 0 16px;
      padding: 0;
      background: var(--panel-bg);
      border: 1px solid var(--border);
      border-radius: 999px;
      overflow: hidden;
    }
    .image-tab {
      position: relative;
      flex: none;
      width: 100%;
      padding: 9px 14px;
      border: none;
      border-radius: 0;
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 13px;
      font-weight: 500;
      line-height: 1.2;
      outline: none;
      transition: color .15s ease, background .15s ease;
    }
    .image-tab + .image-tab {
      border-left: 1px solid var(--border);
    }
    .image-tab::after {
      display: none;
    }
    .image-tab.active {
      background: var(--accent);
      color: #fff;
      font-weight: 600;
      border-color: var(--accent);
      box-shadow: none;
    }
    .image-tab.active + .image-tab,
    .image-tab.active {
      border-left-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    }
    .image-tab:hover:not(.active) {
      color: var(--text-secondary);
      background: var(--surface);
    }
    .image-tab:focus-visible {
      z-index: 1;
      box-shadow: inset 0 0 0 2px var(--accent-soft);
    }
    .image-tab-panel { display: none; }
    .image-tab-panel.active { display: block; }
    .upload-area {
      border: 1.5px dashed color-mix(in srgb, var(--border) 80%, var(--text-muted));
      border-radius: 12px;
      padding: 36px 20px;
      text-align: center;
      color: var(--text-muted);
      cursor: pointer;
      transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
      margin-bottom: 12px;
      position: relative;
      background: color-mix(in srgb, var(--surface) 65%, var(--panel-bg));
      font-size: 13px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
      min-height: 148px;
    }
    .upload-area-icon {
      width: 40px;
      height: 40px;
      border-radius: 10px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: var(--accent-soft);
      color: var(--accent);
      pointer-events: none;
    }
    .upload-area-icon .icon {
      width: 20px;
      height: 20px;
    }
    .upload-area p {
      margin: 0;
      max-width: 28em;
      line-height: 1.45;
      pointer-events: none;
    }
    .upload-area:hover,
    .upload-area.is-dragover {
      border-color: var(--accent);
      border-style: solid;
      color: var(--accent);
      background: var(--accent-soft);
      box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
    }
    .upload-area.is-dragover {
      border-width: 2px;
      padding: 35.5px 19.5px;
    }
    .upload-area input[type="file"] {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
      width: 100%;
      height: 100%;
    }
    .upload-preview {
      margin: 0 0 12px;
    }
    .upload-preview:empty {
      display: none;
    }
    .upload-preview-card {
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--surface);
      overflow: hidden;
    }
    .upload-preview-media {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 120px;
      max-height: 220px;
      padding: 10px;
      background:
        linear-gradient(45deg, color-mix(in srgb, var(--border) 65%, transparent) 25%, transparent 25%),
        linear-gradient(-45deg, color-mix(in srgb, var(--border) 65%, transparent) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, color-mix(in srgb, var(--border) 65%, transparent) 75%),
        linear-gradient(-45deg, transparent 75%, color-mix(in srgb, var(--border) 65%, transparent) 75%);
      background-size: 16px 16px;
      background-position: 0 0, 0 8px, 8px -8px, -8px 0;
      background-color: var(--panel-bg);
    }
    .upload-preview-media img {
      max-width: 100%;
      max-height: 200px;
      width: auto;
      height: auto;
      display: block;
      border-radius: 8px;
      border: 1px solid var(--border);
      box-shadow: var(--shadow-sm);
      background: var(--panel-bg);
    }
    .upload-preview-meta {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      border-top: 1px solid var(--border);
      background: var(--panel-bg);
    }
    .upload-preview-info {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .upload-preview-label {
      font-size: 11px;
      font-weight: 600;
      color: var(--accent);
      letter-spacing: 0.01em;
    }
    .upload-preview-name {
      font-size: 12px;
      font-weight: 500;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .upload-preview-size {
      font-size: 11px;
      color: var(--text-muted);
    }
    .upload-preview-remove {
      flex-shrink: 0;
      width: 32px;
      height: 32px;
      padding: 0;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface);
      color: var(--text-muted);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: color .15s ease, border-color .15s ease, background .15s ease;
    }
    .upload-preview-remove .icon {
      width: 16px;
      height: 16px;
    }
    .upload-preview-remove:hover {
      color: var(--danger, #ef4444);
      border-color: color-mix(in srgb, var(--danger, #ef4444) 35%, var(--border));
      background: color-mix(in srgb, var(--danger, #ef4444) 8%, var(--panel-bg));
    }
    #image-tab-upload.has-upload-preview .upload-area {
      min-height: 0;
      padding: 12px 14px;
      flex-direction: row;
      justify-content: flex-start;
      gap: 8px;
      margin-bottom: 10px;
    }
    #image-tab-upload.has-upload-preview .upload-area-icon {
      width: 28px;
      height: 28px;
      border-radius: 8px;
    }
    #image-tab-upload.has-upload-preview .upload-area-icon .icon {
      width: 14px;
      height: 14px;
    }
    #image-tab-upload.has-upload-preview .upload-area p {
      font-size: 12px;
      text-align: left;
    }
    /* 页面全屏 / 系统全屏 */
    .app.page-fullscreen,
    .app:fullscreen,
    .app:-webkit-full-screen {
      position: fixed;
      inset: 0;
      z-index: 1000;
      width: 100%;
      height: 100%;
      max-height: 100dvh;
    }
    .app.page-fullscreen .header-bar,
    .app.page-fullscreen .side-rail,
    .app.page-fullscreen .statusbar,
    .app:fullscreen .header-bar,
    .app:fullscreen .side-rail,
    .app:fullscreen .statusbar,
    .app:-webkit-full-screen .header-bar,
    .app:-webkit-full-screen .side-rail,
    .app:-webkit-full-screen .statusbar {
      display: none !important;
    }
    .app.page-fullscreen .workspace,
    .app:fullscreen .workspace,
    .app:-webkit-full-screen .workspace {
      padding: 0;
      gap: 0;
    }
    .app.page-fullscreen .content-shell,
    .app:fullscreen .content-shell,
    .app:-webkit-full-screen .content-shell {
      gap: 0;
    }
    .app.page-fullscreen .content-block,
    .app:fullscreen .content-block,
    .app:-webkit-full-screen .content-block {
      border-radius: 0;
      box-shadow: none;
    }
    body.page-fullscreen-active { overflow: hidden; }
    .page-fullscreen-exit {
      display: none;
      position: fixed;
      top: 12px;
      right: 12px;
      z-index: 1100;
      align-items: center;
      gap: 6px;
      padding: 8px 12px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--panel-bg);
      color: var(--text-secondary);
      font-size: 12px;
      font-weight: 500;
      cursor: pointer;
      box-shadow: var(--shadow-md);
      transition: color .15s ease, border-color .15s ease, background .15s ease;
    }
    .page-fullscreen-exit .icon {
      width: 16px;
      height: 16px;
    }
    .page-fullscreen-exit:hover {
      color: var(--accent);
      border-color: var(--accent);
      background: var(--accent-soft);
    }
    .app.page-fullscreen .page-fullscreen-exit,
    .app:fullscreen .page-fullscreen-exit,
    .app:-webkit-full-screen .page-fullscreen-exit {
      display: inline-flex;
    }
    /* KaTeX */
    .katex { font-size: 1.1em; }
    .preview-content .katex-display { margin: 16px 0; overflow-x: auto; }
    /* 任务列表 */
    .preview-content input[type="checkbox"] {
      -webkit-appearance: none;
      appearance: none;
      width: 1.15em;
      height: 1.15em;
      margin: calc((1.8em - 1.15em) / 2) 8px 0 0;
      border: 1.5px solid color-mix(in srgb, var(--accent) 50%, transparent);
      border-radius: 5px;
      background: transparent;
      cursor: pointer;
      position: relative;
      flex-shrink: 0;
      box-sizing: border-box;
      font-size: 1em;
    }
    .preview-content input[type="checkbox"]:checked {
      background: var(--accent);
      border-color: var(--accent);
    }
    .preview-content input[type="checkbox"]:checked::after {
      content: '';
      position: absolute;
      left: 50%;
      top: 46%;
      width: 0.28em;
      height: 0.52em;
      border: solid #fff;
      border-width: 0 2px 2px 0;
      transform: translate(-50%, -55%) rotate(45deg);
    }
    .preview-content li.task-item {
      list-style: none;
      margin-left: -1.4em;
      display: flex;
      align-items: flex-start;
      gap: 0;
    }
    .preview-content li.task-item > .task-text {
      flex: 1;
      min-width: 0;
      outline: none;
    }
    .preview-content li.task-item > p {
      margin: 0;
      display: flex;
      align-items: flex-start;
      flex: 1;
      min-width: 0;
    }
    .preview-content li.task-item > p > .task-text {
      flex: 1;
      min-width: 0;
      outline: none;
    }
    .preview-content ul.task-list {
      padding-left: 1.8em;
    }
    /* 工具栏下拉按钮文字 */
    .top-bar button, .editor-toolbar button { white-space: nowrap; }
    /* 下拉菜单进入动画 */
    @keyframes menuIn {
      from { opacity: 0; transform: translateY(-6px); }
      to { opacity: 1; transform: translateY(0); }
    }
    /* 打印 / 导出 PDF */
    @media print {
      @page {
        size: A4;
        margin: 2cm 1.8cm;
      }

      #app-loading,
      .app-loading,
      .mobile-editor-gate,
      .header-bar,
      .side-rail,
      .outline-panel,
      .editor-block,
      .editor-toolbar,
      .preview-toolbar,
      .preview-source,
      .resizer,
      .statusbar,
      .modal-overlay,
      .toast,
      .icon-sprite,
      .col-resizer,
      .table-edge-resizer {
        display: none !important;
      }

      .main.layout-edit .preview-block {
        display: flex !important;
      }

      html, body, .app, .workspace, .workspace-main, .main, .content-shell,
      .content-block, .preview-pane, .preview-content {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
      }

      body {
        background: #fff !important;
        color: #1a1d23 !important;
      }

      .preview-block {
        border: none !important;
        box-shadow: none !important;
        flex: none !important;
        width: 100% !important;
        max-width: none !important;
        display: flex !important;
      }

      .preview-content {
        padding: 0 !important;
        max-width: none !important;
        font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif !important;
        font-size: 11pt !important;
        line-height: 1.65 !important;
        color: #1a1d23 !important;
        background: #fff !important;
      }

      .preview-content .markdown-body {
        max-width: none !important;
        padding: 0 !important;
        background: transparent !important;
      }

      .preview-content h1,
      .preview-content h2,
      .preview-content h3,
      .preview-content h4,
      .preview-content h5,
      .preview-content h6 {
        color: #1a1d23 !important;
        font-weight: 600 !important;
        line-height: 1.25 !important;
        page-break-after: avoid;
        break-after: avoid-page;
      }

      .preview-content h1 { font-size: 22pt !important; margin: 0 0 30px !important; }
      .preview-content h2 {
        position: relative !important;
        font-size: 1.55em !important;
        font-weight: 650 !important;
        line-height: 1.4 !important;
        letter-spacing: -0.01em !important;
        margin: 30px 0 22px !important;
        padding: 14px 76px 14px 20px !important;
        color: #1a1d23 !important;
        border: none !important;
        border-bottom: 1px solid #eceef1 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        box-sizing: border-box !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }
      .preview-content h2::before {
        content: '' !important;
        position: absolute !important;
        left: 0 !important;
        top: 50% !important;
        transform: translateY(calc(-50% - 0.5px)) !important;
        width: 4px !important;
        height: 1.2em !important;
        border-radius: 3px !important;
        background: #6C5CE7 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }
      .preview-content h2::after {
        content: '' !important;
        position: absolute !important;
        right: 0 !important;
        top: 50% !important;
        transform: translateY(calc(-50% - 0.5px)) !important;
        width: 18px !important;
        height: 12px !important;
        pointer-events: none !important;
        background: #6C5CE7 !important;
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12'%3E%3Ccircle cx='6' cy='6' r='5.5' fill='%23fff' fill-opacity='0.5'/%3E%3Ccircle cx='12' cy='6' r='5.5' fill='%23fff' fill-opacity='0.2'/%3E%3C/svg%3E") !important;
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12'%3E%3Ccircle cx='6' cy='6' r='5.5' fill='%23fff' fill-opacity='0.5'/%3E%3Ccircle cx='12' cy='6' r='5.5' fill='%23fff' fill-opacity='0.2'/%3E%3C/svg%3E") !important;
        -webkit-mask-size: 100% 100% !important;
        mask-size: 100% 100% !important;
        -webkit-mask-repeat: no-repeat !important;
        mask-repeat: no-repeat !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }
      .preview-content h3 { font-size: 14pt !important; margin: 16pt 0 8pt !important; }
      .preview-content h4 { font-size: 12pt !important; margin: 14pt 0 8pt !important; }
      .preview-content h5,
      .preview-content h6 { font-size: 11pt !important; margin: 12pt 0 6pt !important; }

      .preview-content p,
      .preview-content li,
      .preview-content td,
      .preview-content th {
        color: #1a1d23 !important;
      }

      .preview-content p { margin: 0 0 10pt !important; }
      .preview-content ul,
      .preview-content ol { margin: 0 0 10pt !important; padding-left: 1.6em !important; }
      .preview-content li { margin: 3pt 0 !important; }
      .preview-content ol.ol-circle {
        list-style: none !important;
        padding-left: 1.6em !important;
        counter-reset: ol-circle;
      }
      .preview-content ol.ol-circle > li {
        position: relative !important;
        display: block !important;
        margin: 5pt 0 5pt -1.2em !important;
        padding-left: 2.1em !important;
        counter-increment: ol-circle;
      }
      .preview-content ol.ol-circle > li::before {
        content: counter(ol-circle) !important;
        position: absolute !important;
        left: 0 !important;
        top: 0.45em !important;
        width: 1.35em !important;
        height: 1.35em !important;
        border-radius: 50% !important;
        background: #6C5CE7 !important;
        color: #fff !important;
        font-size: 0.8em !important;
        font-weight: 700 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }
      .preview-content ol.ol-circle > li > p { margin: 0 !important; }

      .preview-content a,
      .preview-content a:link,
      .preview-content a:visited,
      .preview-content a:hover,
      .preview-content a:active {
        color: #6C5CE7 !important;
        text-decoration: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }

      .preview-content code {
        background: rgba(163, 21, 21, 0.06) !important;
        color: #a31515 !important;
        padding: 1pt 3pt !important;
        border-radius: 3px !important;
        font-family: ui-monospace, Consolas, monospace !important;
        font-size: 0.9em !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
      }

      .preview-content pre {
        background: #1a1d27 !important;
        color: #d7dbea !important;
        border: none !important;
        padding: 18pt 12pt 10pt !important;
        border-radius: 8px !important;
        box-shadow: 0 2pt 8pt rgba(15, 23, 42, 0.14) !important;
        white-space: pre-wrap !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
        overflow: visible !important;
        page-break-inside: avoid;
        break-inside: avoid-page;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
      }
      .preview-content pre::before {
        content: '' !important;
        position: absolute !important;
        left: 10pt !important;
        top: 7pt !important;
        width: 6pt !important;
        height: 6pt !important;
        border-radius: 50% !important;
        background: #ff5f57 !important;
        box-shadow: 10pt 0 0 #febc2e, 20pt 0 0 #28c840 !important;
      }

      .preview-content pre code {
        background: transparent !important;
        color: inherit !important;
        padding: 0 !important;
      }

      .preview-content blockquote {
        margin: 0 0 10pt !important;
        padding: 8pt 12pt !important;
        border: none !important;
        border-left: 3pt solid #6C5CE7 !important;
        background: rgba(108, 92, 231, 0.07) !important;
        color: #5f6775 !important;
        page-break-inside: avoid;
        break-inside: avoid-page;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
      }

      .preview-content blockquote p { margin: 0 !important; color: inherit !important; }

      .preview-table-wrap {
        overflow: visible !important;
        margin: 0 0 10pt !important;
        max-width: none !important;
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        page-break-inside: avoid;
        break-inside: avoid-page;
      }

      .preview-content table,
      .preview-table-wrap table.preview-table-resizable {
        border-collapse: collapse !important;
        width: 100% !important;
        max-width: 100% !important;
        table-layout: auto !important;
        margin: 0 !important;
        overflow: visible !important;
        border-radius: 0 !important;
        border: 1px solid #dce1e8 !important;
      }

      .preview-table-wrap table.preview-table-resizable col {
        width: auto !important;
        min-width: 0 !important;
      }

      .preview-table-wrap table.preview-table-resizable th,
      .preview-table-wrap table.preview-table-resizable td {
        border: 1px solid #dce1e8 !important;
        width: auto !important;
        min-width: 0 !important;
      }

      .preview-table-wrap table.preview-table-resizable tr > :last-child {
        border-right: 1px solid #dce1e8 !important;
      }

      .preview-table-wrap table.preview-table-resizable tr:last-child > th,
      .preview-table-wrap table.preview-table-resizable tr:last-child > td {
        border-bottom: 1px solid #dce1e8 !important;
      }

      .preview-content th,
      .preview-content td {
        border: 1px solid #dce1e8 !important;
        padding: 6pt 8pt !important;
        vertical-align: top !important;
        text-align: left !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
        white-space: normal !important;
        max-width: none !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }

      .preview-content th {
        background: #f3f5f8 !important;
        font-weight: 600 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
      }

      .preview-content th code,
      .preview-content td code {
        white-space: pre-wrap !important;
        word-break: break-all !important;
      }

      .preview-content img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 6px !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        break-inside: avoid-page;
      }

      .export-image-link-fallback {
        display: block !important;
        margin: 0 0 10pt !important;
        font-size: 10pt !important;
        text-align: center !important;
        word-break: break-all !important;
        page-break-inside: avoid;
        break-inside: avoid-page;
      }

      .export-image-link-fallback a {
        color: #1a1d23 !important;
        text-decoration: underline !important;
      }

      .preview-content hr {
        border: none !important;
        border-top: 1px solid #eceef1 !important;
        height: 0 !important;
        background: none !important;
        margin: 20px 0 !important;
        display: block !important;
        opacity: 1 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
      }

      .preview-content badges {
        display: inline-block !important;
        padding: 3pt 10pt !important;
        margin: 0 4pt 6pt 0 !important;
        border-radius: 999px !important;
        border: 1px solid #b8aef0 !important;
        font-size: 0.95em !important;
        font-weight: 650 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }
      .preview-content p:has(> badges:only-child) {
        margin-bottom: 2pt !important;
      }
      .preview-content badges[tone="accent"],
      .preview-content badges:not([tone]) {
        background: rgba(108, 92, 231, 0.15) !important;
        color: #6C5CE7 !important;
        border-color: #b8aef0 !important;
      }
      .preview-content badges[tone="green"] {
        background: rgba(34, 197, 94, 0.14) !important;
        color: #15803d !important;
        border-color: #86d9a4 !important;
      }
      .preview-content badges[tone="yellow"] {
        background: rgba(234, 179, 8, 0.16) !important;
        color: #a16207 !important;
        border-color: #e6c96a !important;
      }
      .preview-content badges[tone="dark"] {
        background: #1a1d23 !important;
        color: #f8fafc !important;
        border-color: #4b5160 !important;
      }

      .preview-content .md-mark-gradient {
        background: #efeafc !important;
        padding: 1pt 4pt !important;
        border-radius: 3px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }
      .preview-content .md-mark-capsule {
        background: #6C5CE7 !important;
        color: #fff !important;
        padding: 1pt 7pt !important;
        border-radius: 999px !important;
        font-weight: 650 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }
      .preview-content .md-mark-strong {
        color: #6C5CE7 !important;
        font-weight: 700 !important;
      }
      .preview-content .md-mark-soft {
        color: #8b7cf0 !important;
        font-weight: 600 !important;
      }

      .preview-content del,
      .preview-content s {
        color: #615d59 !important;
      }

      .preview-content .katex,
      .preview-content .katex-display,
      .preview-content .mermaid {
        color: #1a1d23 !important;
        overflow: visible !important;
        page-break-inside: avoid;
        break-inside: avoid-page;
      }

      .preview-content .katex-display {
        margin: 10pt 0 !important;
      }

      .preview-content ul.task-list {
        list-style: none !important;
        padding-left: 1.6em !important;
      }
      .preview-content li.task-item {
        list-style: none !important;
        margin-left: -1.2em !important;
        align-items: flex-start !important;
      }
      .preview-content input[type="checkbox"] {
        -webkit-appearance: none !important;
        appearance: none !important;
        width: 11pt !important;
        height: 11pt !important;
        margin: calc((1.65em - 11pt) / 2) 6pt 0 0 !important;
        border: 1pt solid #b8aef0 !important;
        border-radius: 3pt !important;
        background: transparent !important;
        position: relative !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }
      .preview-content input[type="checkbox"]:checked {
        background: #6C5CE7 !important;
        border-color: #6C5CE7 !important;
      }
      .preview-content input[type="checkbox"]:checked::after {
        content: '' !important;
        position: absolute !important;
        left: 50% !important;
        top: 46% !important;
        width: 3pt !important;
        height: 6pt !important;
        border: solid #fff !important;
        border-width: 0 1.5pt 1.5pt 0 !important;
        transform: translate(-50%, -55%) rotate(45deg) !important;
      }

      .preview-content .md-source-block:first-child > :first-child {
        margin-top: 0 !important;
      }
    }
  