/* 新编辑器专用样式 */

/* ========== 编辑器工具栏 ========== */
.editor-toolbar-new {
    padding: 8px 12px;
    background: #f4e3cf;
    /* 与footer色调一致，稍亮 */
    border-bottom: 1px solid rgba(148, 120, 84, 0.1);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    position: relative;
    z-index: 25;
}

.editor-toolbar-grouped {
    gap: 10px;
    align-items: flex-start;
}

.toolbar-group {
    position: relative;
    display: inline-flex;
    flex-direction: column;
}

.toolbar-group-trigger {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid rgba(148, 120, 84, 0.24);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    color: #5d4037;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-group-trigger:hover {
    border-color: rgba(196, 138, 58, 0.45);
    background: #fff;
    box-shadow: 0 3px 8px rgba(148, 120, 84, 0.12);
}

.toolbar-group-trigger.active {
    border-color: rgba(196, 138, 58, 0.6);
    background: linear-gradient(135deg, rgba(255, 248, 236, 0.98), rgba(245, 224, 188, 0.95));
    box-shadow: 0 6px 14px rgba(148, 120, 84, 0.18);
}

.toolbar-group-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.toolbar-group-caret {
    font-size: 17px;
    opacity: 0.75;
}

.toolbar-group-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    width: -moz-fit-content;
    width: fit-content;
    min-width: 0;
    max-width: min(92vw, 420px);
    border: 1px solid rgba(148, 120, 84, 0.28);
    border-radius: 14px;
    padding: 10px;
    background: linear-gradient(160deg, rgba(255, 251, 244, 0.98), rgba(247, 233, 209, 0.96));
    box-shadow: 0 14px 34px rgba(33, 23, 13, 0.24);
    backdrop-filter: blur(4px);
    z-index: 60;
    display: grid;
    gap: 8px;
    transform-origin: top left;
    animation: toolbarPanelPop 0.18s ease-out;
}

@keyframes toolbarPanelPop {
    0% {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toolbar-group-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

.toolbar-group-row.icon-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 40px;
    gap: 8px;
    width: max-content;
}

.toolbar-group-row.icon-row .toolbar-btn-new {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
}

.toolbar-btn-new {
    padding: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #5d4037;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 3px;
    min-width: 32px;
    height: 32px;
    justify-content: center;
}

.toolbar-btn-new:hover {
    background: #fff;
    color: #c48a3a;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(148, 120, 84, 0.1);
}

.toolbar-btn-new.active {
    background: #c48a3a;
    color: white;
    box-shadow: 0 2px 5px rgba(196, 138, 58, 0.3);
}

.toolbar-btn-new .material-symbols-outlined {
    font-size: 20px;
}

.toolbar-btn-new.toolbar-btn-text {
    min-width: 64px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
}

.toolbar-btn-new.toolbar-lock-btn {
    background: linear-gradient(180deg, rgba(255, 246, 227, 0.92), rgba(245, 229, 198, 0.9));
    border: 1px solid rgba(148, 120, 84, 0.28);
    box-shadow: 0 1px 0 rgba(148, 120, 84, 0.14);
}

.toolbar-btn-new.toolbar-lock-btn:hover {
    background: linear-gradient(180deg, rgba(255, 252, 241, 0.98), rgba(247, 236, 212, 0.96));
}

.toolbar-separator-new {
    width: 1px;
    height: 20px;
    background: rgba(148, 120, 84, 0.2);
    margin: 0 4px;
}

.toolbar-select-new {
    padding: 5px 10px;
    border: 1px solid rgba(148, 120, 84, 0.15);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    color: #5d4037;
    cursor: pointer;
    min-width: 85px;
    height: 32px;
    outline: none;
    transition: all 0.2s;
}

.toolbar-select-new:hover,
.toolbar-select-new:focus {
    background: #fff;
    border-color: #c48a3a;
    box-shadow: 0 2px 5px rgba(148, 120, 84, 0.1);
}

/* 颜色选择器改进 - 区分文字和背景 */
.color-picker-wrapper {
    position: relative;
    display: inline-block;
}

.color-picker-btn {
    padding: 6px 10px;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #5d4037;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 70px;
    height: 32px;
    border: 1px solid rgba(148, 120, 84, 0.15);
}

.color-picker-btn:hover {
    background: #fff;
    border-color: #c48a3a;
    box-shadow: 0 2px 5px rgba(148, 120, 84, 0.1);
}

.color-picker-btn .color-preview {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid #dadce0;
}

.color-picker-btn .label {
    font-size: 11px;
}

/* 文字颜色：A图标 */
.color-picker-btn.text-color .color-preview {
    position: relative;
}

.color-picker-btn.text-color .color-preview::after {
    content: 'A';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 11px;
    color: white;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* 背景颜色：粗边框区分 */
.color-picker-btn.bg-color .color-preview {
    border: 2px solid #333;
}

input[type="color"].hidden-color-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ========== 新版编辑器内容区 ========== */
.editor-content-new {
    flex: 1 1 auto;
    min-height: 0;
    padding: 32px 44px 48px;
    font-size: 20px;
    /* 默认较大字体，提升阅读体验 */
    line-height: 1.6;
    color: #000000;
    /* 默认黑色文字 */
    outline: none;
    border: none;
    /* 默认背景已移除，由主题类控制 */
    /* background: #f4e3cf; */
    /* background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(244, 227, 207, 0.9)); */
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: inset 0 1px 0 rgba(148, 120, 84, 0.2);
}

.editor-content-new:focus {
    outline: none;
}

/* 在编辑器内容后添加额外空白区域，让用户打字不用一直在最底部 */
.editor-content-new::after {
    content: '';
    display: block;
    clear: both;
    height: 50vh;
    /* 视窗高度的50%作为底部空白 */
    min-height: 300px;
    pointer-events: none;
    /* 不影响点击 */
}

.editor-content-new h1 {
    font-size: 2em;
    font-weight: 600;
    margin: 1em 0 0.5em;
    color: #202124;
}

.editor-content-new h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 0.83em 0;
    color: #202124;
}

.editor-content-new h3 {
    font-size: 1.17em;
    font-weight: 600;
    margin: 1em 0;
    color: #202124;
}

.editor-content-new p {
    margin: 0.5em 0;
}

.editor-content-new ul,
.editor-content-new ol {
    padding-left: 2em;
    margin: 1em 0;
}

.editor-content-new li {
    margin: 0.25em 0;
}

.editor-content-new .memo-task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0.42em 0;
    min-height: 1.6em;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.88);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82));
    box-shadow:
        0 8px 20px rgba(255, 255, 255, 0.62),
        0 2px 10px rgba(148, 120, 84, 0.14);
}

.editor-content-new .memo-task-item .memo-task-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #c48a3a;
    cursor: pointer;
}

.editor-content-new .memo-task-item .memo-task-checkbox[contenteditable="false"] {
    user-select: none;
}

.editor-content-new .memo-task-item .memo-task-text {
    flex: 1;
    min-height: 1.5em;
    line-height: 1.55;
    outline: none;
    word-break: break-word;
}

.editor-content-new .memo-task-item .memo-task-text p {
    margin: 0;
}

.editor-content-new .memo-task-item .memo-task-text br:only-child {
    line-height: 1.4;
}

.editor-content-new .memo-task-item.is-checked {
    background: linear-gradient(180deg, rgba(245, 245, 245, 0.95), rgba(238, 238, 238, 0.82));
}

.editor-content-new .memo-task-item.is-checked .memo-task-text {
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    color: rgba(91, 72, 52, 0.68);
}

.editor-content-new img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 16px 0;
}

.editor-content-new a {
    color: #1a73e8;
    text-decoration: none;
}

.editor-content-new a:hover {
    text-decoration: underline;
}

/* ========== AI标记样式 ========== */
.ai-original {
    text-decoration: line-through;
    background-color: #fee2e2;
    padding: 2px 4px;
    border-radius: 2px;
    color: #999;
}

.ai-new {
    background-color: #e6f4ea;
    padding: 2px 4px;
    border-radius: 2px;
    color: #34a853;
    font-weight: 500;
}

/*  ========== AI审核栏 ========== */
.ai-review-bar-new {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(90deg, #fff3cd 0%, #fffbea 100%);
    border-top: 2px solid #ffc107;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-review-text {
    flex: 1;
    color: #856404;
    font-weight: 500;
    font-size: 14px;
}

.ai-review-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.ai-review-btn.accept {
    background: #34a853;
    color: white;
}

.ai-review-btn.accept:hover {
    background: #2d8e47;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(52, 168, 83, 0.3);
}

.ai-review-btn.reject {
    background: #ea4335;
    color: white;
}

.ai-review-btn.reject:hover {
    background: #d33426;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(234, 67, 53, 0.3);
}

/* ========== Editor Footer 调色 ========== */
.editor-footer {
    background: #f0dec7;
    border-top: 1px solid rgba(148, 120, 84, 0.35);
    color: #4b3a2a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.editor-footer .save-status {
    color: inherit;
}

.editor-footer .save-status svg {
    stroke: currentColor;
}

/* ========== 移动端AI对话按钮特殊样式 ========== */
.toolbar-btn-new.mobile-ai-btn {
    background: linear-gradient(135deg, #ffb347 0%, #ff8c4a 100%);
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(255, 140, 74, 0.3);
}

.toolbar-btn-new.mobile-ai-btn:hover {
    background: linear-gradient(135deg, #ffa530 0%, #ff7a38 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 140, 74, 0.45);
}

.toolbar-btn-new.mobile-ai-btn .material-symbols-outlined {
    font-size: 20px;
}

/* ========== 代码块样式 ========== */
.editor-content-new .memo-code-block {
    margin: 16px 0;
    clear: both;
    border-radius: 12px;
    border: 1px solid rgba(23, 26, 33, 0.88);
    background: linear-gradient(180deg, #212530 0%, #141821 100%);
    color: #d9e2ff;
    box-shadow: 0 10px 24px rgba(11, 12, 17, 0.34);
    overflow: hidden;
}

.editor-content-new .memo-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.editor-content-new .memo-code-header-left {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.editor-content-new .memo-code-icon {
    font-size: 17px;
    color: rgba(172, 194, 255, 0.92);
}

.editor-content-new .memo-code-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: rgba(228, 236, 255, 0.94);
}

.editor-content-new .memo-code-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.editor-content-new .memo-code-language-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.editor-content-new .memo-code-language-text {
    font-size: 11px;
    color: rgba(214, 226, 255, 0.72);
}

.editor-content-new .memo-code-language {
    height: 28px;
    border-radius: 7px;
    border: 1px solid rgba(154, 177, 228, 0.38);
    background: rgba(20, 25, 36, 0.75);
    color: #ebf1ff;
    font-size: 12px;
    padding: 0 8px;
    outline: none;
}

.editor-content-new .memo-code-language:focus {
    border-color: rgba(123, 164, 255, 0.86);
    box-shadow: 0 0 0 2px rgba(93, 141, 255, 0.22);
}

.editor-content-new .memo-code-action {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(171, 193, 247, 0.32);
    border-radius: 7px;
    background: rgba(20, 25, 35, 0.86);
    color: rgba(229, 236, 255, 0.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
}

.editor-content-new .memo-code-action .material-symbols-outlined {
    font-size: 17px;
}

.editor-content-new .memo-code-action:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(173, 194, 255, 0.7);
    transform: translateY(-1px);
}

.editor-content-new .memo-code-action.is-disabled,
.editor-content-new .memo-code-action:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
}

.editor-content-new .memo-code-editor {
    /* 编辑层：透明文字，接收用户输入 */
    grid-area: 1 / 1 / 2 / 2;
    display: block;
    width: 100%;
    min-height: 180px;
    border: 0;
    padding: 14px 18px 14px 24px;
    margin: 0;
    box-sizing: border-box;
    resize: none;
    background: transparent;
    color: transparent;
    caret-color: #fff;
    outline: none;
    font-size: 13px;
    line-height: 1.65;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    tab-size: 2;
    position: relative;
    z-index: 2;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-word;
}

.editor-content-new .memo-code-editor::selection {
    background: rgba(100, 150, 255, 0.35);
    color: transparent;
}

.editor-content-new .memo-code-editor::placeholder {
    color: rgba(207, 221, 255, 0.44);
}

.editor-content-new .memo-code-editor[readonly] {
    cursor: default;
    opacity: 0.92;
}

.editor-content-new .memo-code-stage {
    display: grid;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(8, 11, 17, 0.9);
    overflow: auto;
    max-height: 500px;
}

.editor-content-new .memo-code-highlight {
    /* 高亮层：底层，显示语法高亮，不接收交互 */
    grid-area: 1 / 1 / 2 / 2;
    margin: 0;
    min-height: 180px;
    padding: 14px 18px 14px 24px;
    box-sizing: border-box;
    background: transparent;
    color: #cfdcff;
    font-size: 13px;
    line-height: 1.65;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    white-space: pre-wrap;
    word-break: break-word;
    pointer-events: none;
    z-index: 1;
}

.editor-content-new .memo-code-highlight .token-comment {
    color: #7f8ba8;
    font-style: italic;
}

.editor-content-new .memo-code-highlight .token-keyword {
    color: #c792ea;
}

.editor-content-new .memo-code-highlight .token-string {
    color: #ecc48d;
}

.editor-content-new .memo-code-highlight .token-number {
    color: #f78c6c;
}

.editor-content-new .memo-code-highlight .token-boolean {
    color: #82aaff;
}

.editor-content-new .memo-code-highlight .token-tag {
    color: #82aaff;
}

.editor-content-new .memo-code-highlight .token-attr {
    color: #ffcb6b;
}

.editor-content-new .memo-code-highlight .token-punctuation {
    color: #89ddff;
}

.memo-code-expand-modal {
    position: fixed;
    inset: 0;
    z-index: 99991;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.18s ease;
}

.memo-code-expand-modal.closing {
    opacity: 0;
}

.memo-code-expand-mask {
    position: absolute;
    inset: 0;
    background: rgba(8, 8, 12, 0.66);
    backdrop-filter: blur(2px);
}

.memo-code-expand-panel {
    position: relative;
    width: min(1180px, calc(100vw - 34px));
    height: min(860px, calc(100vh - 30px));
    border-radius: 14px;
    border: 1px solid rgba(136, 161, 224, 0.34);
    background: #101520;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.memo-code-expand-header {
    height: 52px;
    padding: 0 12px 0 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, #1a2232 0%, #141c2b 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.memo-code-expand-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #edf3ff;
    font-size: 13px;
    font-weight: 600;
}

.memo-code-expand-title .material-symbols-outlined {
    font-size: 18px;
}

.memo-code-expand-tools {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.memo-code-expand-language {
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(177, 198, 244, 0.36);
    background: rgba(10, 15, 25, 0.8);
    color: #f1f6ff;
    font-size: 12px;
    padding: 0 10px;
    outline: none;
}

.memo-code-expand-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(185, 204, 246, 0.32);
    background: rgba(255, 255, 255, 0.07);
    color: #eff4ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.memo-code-expand-btn .material-symbols-outlined {
    font-size: 18px;
}

.memo-code-expand-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.memo-code-expand-btn.is-disabled,
.memo-code-expand-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.memo-code-expand-body {
    flex: 1;
    min-height: 0;
    display: grid;
    overflow: auto;
    background: #0f141f;
}

.memo-code-expand-editor {
    /* 编辑层：透明文字 */
    grid-area: 1 / 1 / 2 / 2;
    display: block;
    width: 100%;
    min-height: 280px;
    border: 0;
    margin: 0;
    padding: 16px 20px 16px 26px;
    box-sizing: border-box;
    background: transparent;
    color: transparent;
    caret-color: #fff;
    font-size: 14px;
    line-height: 1.64;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    resize: none;
    outline: none;
    position: relative;
    z-index: 2;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-word;
}

.memo-code-expand-highlight {
    /* 高亮层：底层渲染 */
    grid-area: 1 / 1 / 2 / 2;
    margin: 0;
    padding: 16px 20px 16px 26px;
    min-height: 280px;
    box-sizing: border-box;
    background: transparent;
    color: #cfdcff;
    font-size: 14px;
    line-height: 1.64;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    white-space: pre-wrap;
    word-break: break-word;
    pointer-events: none;
    z-index: 1;
}

.memo-code-expand-highlight .token-comment {
    color: #7f8ba8;
    font-style: italic;
}

.memo-code-expand-highlight .token-keyword {
    color: #c792ea;
}

.memo-code-expand-highlight .token-string {
    color: #ecc48d;
}

.memo-code-expand-highlight .token-number {
    color: #f78c6c;
}

.memo-code-expand-highlight .token-boolean {
    color: #82aaff;
}

.memo-code-expand-highlight .token-tag {
    color: #82aaff;
}

.memo-code-expand-highlight .token-attr {
    color: #ffcb6b;
}

.memo-code-expand-highlight .token-punctuation {
    color: #89ddff;
}

.memo-code-expand-footer {
    height: 52px;
    padding: 0 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #141b28;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.memo-code-expand-footer-btn {
    min-width: 74px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(172, 193, 244, 0.28);
    padding: 0 12px;
    cursor: pointer;
    font-size: 13px;
}

.memo-code-expand-footer-btn.ghost {
    background: rgba(255, 255, 255, 0.06);
    color: #dbe6ff;
}

.memo-code-expand-footer-btn.primary {
    background: linear-gradient(180deg, #3f6fd1, #2f5cb8);
    border-color: rgba(124, 160, 244, 0.7);
    color: #fff;
}

.memo-code-expand-footer-btn:hover {
    filter: brightness(1.06);
}

.memo-code-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.18s ease;
}

.memo-code-preview-modal.closing {
    opacity: 0;
}

.memo-code-preview-mask {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 14, 0.62);
    backdrop-filter: blur(2px);
}

.memo-code-preview-panel {
    position: relative;
    width: min(1100px, calc(100vw - 36px));
    height: min(760px, calc(100dvh - 36px));
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(121, 143, 197, 0.3);
    background: #0f1219;
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.46);
    display: flex;
    flex-direction: column;
}

.memo-code-preview-header {
    height: 48px;
    padding: 0 10px 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, #1b2231 0%, #141a26 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.memo-code-preview-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #edf3ff;
    font-size: 13px;
    font-weight: 600;
}

.memo-code-preview-title .material-symbols-outlined {
    font-size: 18px;
}

.memo-code-preview-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(196, 210, 245, 0.26);
    background: rgba(255, 255, 255, 0.08);
    color: #ecf2ff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.memo-code-preview-close:hover {
    background: rgba(255, 255, 255, 0.14);
}

.memo-code-preview-close .material-symbols-outlined {
    font-size: 18px;
}

.memo-code-preview-iframe {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: 0;
    background: #fff;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.memo-code-preview-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
}

.memo-code-preview-body .memo-code-preview-iframe {
    display: block;
    width: 100%;
    min-height: 100%;
    border: 0;
    background: #fff;
}

/* ========== 智能表格样式 ========== */
.editor-content-new .smart-table-wrapper {
    margin: 14px 0;
    padding: 6px;
    border: 1px solid rgba(148, 120, 84, 0.24);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    overflow: hidden;
    resize: horizontal;
    float: left;
    display: inline-block;
    width: 640px;
    max-width: 100%;
    min-width: 280px;
    margin-right: 16px;
    vertical-align: top;
    position: relative;
}

.editor-content-new .editor-smart-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 280px;
    table-layout: fixed;
    background: #fff;
}

.editor-content-new .editor-smart-table th,
.editor-content-new .editor-smart-table td {
    border: 1px solid rgba(148, 120, 84, 0.35);
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
    min-height: 38px;
}

.editor-content-new .editor-smart-table th {
    background: linear-gradient(180deg, #f4e6d1, #efdfc8);
    color: #5a442c;
    font-weight: 700;
}

.editor-content-new .smart-table-insert-handles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 6;
    opacity: 0;
    transition: opacity 0.16s ease;
}

.editor-content-new .smart-table-wrapper:hover .smart-table-insert-handles {
    opacity: 1;
}

.editor-content-new .smart-col-handle-layer,
.editor-content-new .smart-row-handle-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.editor-content-new .smart-insert-handle {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(148, 120, 84, 0.55);
    background: rgba(255, 250, 241, 0.98);
    color: #6c4826;
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(44, 30, 18, 0.24);
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0.94;
}

.editor-content-new .smart-insert-handle:hover {
    transform: translate(-50%, -50%) scale(1.08);
    background: #fff;
    border-color: rgba(196, 138, 58, 0.7);
    color: #5f3f1f;
}

.editor-content-new .smart-insert-handle.row-handle {
    background: rgba(245, 236, 220, 0.98);
}

@media (max-width: 768px) {
    .editor-toolbar-grouped {
        gap: 8px;
    }

    .toolbar-group {
        width: calc(50% - 4px);
        min-width: 0;
    }

    .toolbar-group-trigger {
        width: 100%;
        justify-content: space-between;
    }

    .toolbar-group-panel {
        top: calc(100% + 8px);
        left: 0;
        right: auto;
        min-width: 100%;
        max-width: calc(100vw - 24px);
    }

    .editor-content-new .smart-table-wrapper {
        float: none;
        display: block;
        width: 100%;
        margin-right: 0;
        min-width: 220px;
    }

    .editor-content-new .smart-table-insert-handles {
        opacity: 1;
        pointer-events: none;
    }

    .editor-content-new .memo-code-actions {
        gap: 6px;
    }

    .memo-code-preview-panel {
        width: calc(100vw - 18px);
        height: calc(100dvh - 22px);
    }

    .memo-code-expand-panel {
        width: calc(100vw - 14px);
        height: calc(100vh - 14px);
    }
}
