/* 编辑器对话框遮罩 */
.content-editor-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.content-editor-dialog.show {
    opacity: 1;
}

/* 编辑器容器 */
.editor-container {
    width: 90vw;
    height: 85vh;
    max-width: 1600px;
    background: var(--surface-color);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* 全屏模式 */
.content-editor-dialog.fullscreen .editor-container {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
}

/* 编辑器头部 */
.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--background-color);
}

.editor-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.editor-title svg {
    stroke: var(--primary-color);
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 移除重复的按钮样式定义,使用全局 buttons.css */
.content-editor-dialog .btn {
    height: 36px;
}

/* 仅保留编辑器特定的图标按钮样式 */
.editor-actions .btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-actions .btn-icon:hover {
    background: var(--hover-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 统一的面板头部栏 */
.panels-header {
    display: flex;
    align-items: center;
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    min-height: 48px;
}

.panel-header-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    min-width: 400px;
}

/* 顶部静态分割线 */
.panel-header-divider {
    width: 17px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    height: 100%;
}

/* 顶部静态分割线 */
.panel-header-divider::before {
    content: '';
    width: 1px;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .panel-header-divider::before {
    background: rgba(255, 255, 255, 0.1);
}

.panel-header-right {
    width: 375px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

/* 刷新按钮样式统一 */
.panel-header-right .btn-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 4px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-header-right .btn-icon:hover {
    background: var(--hover-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.editor-status {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* 编辑器主体 */
.editor-body {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    min-height: 0;
}

/* 编辑器面板 */
.editor-panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    border-right: none;
    min-width: 400px;
    max-width: calc(100% - 375px - 17px);
    min-height: 0;
}

/* 预览面板 */
.editor-preview-panel {
    width: 375px;
    flex: 0 0 375px;
    display: flex;
    flex-direction: column;
    border-left: none;
    min-height: 0;
}

/* Monaco Editor 容器 */
#monaco-editor-container {
    flex: 1;
    overflow: hidden;
}

/* 尝试统一Monaco Editor的滚动条样式(有限支持) */
#monaco-editor-container .monaco-scrollable-element>.scrollbar {
    background: transparent !important;
}

#monaco-editor-container .monaco-scrollable-element>.scrollbar>.slider {
    background: var(--border-color) !important;
    border-radius: 4px !important;
}

#monaco-editor-container .monaco-scrollable-element>.scrollbar>.slider:hover {
    background: var(--secondary-color) !important;
}

/* 预览 iframe - 确保占据剩余空间 */
#preview-iframe {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    border: none;
    background: var(--surface-color);
}

/* 下方可交互分割线 - 最佳视觉设计 */
.resize-handle {
    width: 1px;
    background: rgba(0, 0, 0, 0.1);
    cursor: col-resize;
    transition: all 0.2s ease;
    position: relative;
    margin: 0 8px;
}

[data-theme="dark"] .resize-handle {
    background: rgba(255, 255, 255, 0.1);
}

.resize-handle::before {
    content: '';
    position: absolute;
    left: -8px;
    right: -8px;
    top: 0;
    bottom: 0;
}

.resize-handle:hover {
    background: var(--primary-color);
    width: 2px;
    margin: 0 7.5px;
}

.resize-handle:active {
    background: var(--primary-color);
    width: 2px;
}

/* 语言选择器 */
.language-selector {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--surface-color);
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-selector:hover {
    border-color: var(--primary-color);
}

.language-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* 模式选择器（模板：HTML 源码 / Markdown 转公众号） */
.mode-selector {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--surface-color);
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-selector:hover {
    border-color: var(--primary-color);
}

.mode-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* gzh-design 文本输入模式 */
#text-input-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 16px;
    gap: 12px;
}

.gzh-design-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.gzh-design-controls .theme-selector {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--surface-color);
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.gzh-design-controls .theme-selector:hover {
    border-color: var(--primary-color);
}

.gzh-design-controls .theme-selector:focus {
    outline: none;
    border-color: var(--primary-color);
}

#gzh-generate-btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

#gzh-markdown-input {
    flex: 1;
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#gzh-markdown-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#gzh-markdown-input::placeholder {
    color: var(--text-tertiary);
}

/* 生成中动画 */
.gzh-generating-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 6px;
    animation: gzhGeneratingPulse 1.2s infinite ease-in-out;
}

@keyframes gzhGeneratingPulse {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .editor-container {
        width: 95vw;
        height: 90vh;
    }

    .editor-body {
        flex-direction: column;
    }

    .editor-panel {
        flex: 0 0 50%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        min-width: unset;
        max-width: none;
    }

    .editor-preview-panel {
        width: 375px;
        max-width: 100%;
        flex: 0 0 auto;
        border-left: none;
        margin: 0 auto;
    }

    .resize-handle {
        width: 100%;
        height: 4px;
        cursor: row-resize;
        margin: 0;
    }

    .language-selector {
        display: none;
    }

    /* 响应式面板头部 */
    .panels-header {
        flex-direction: column;
    }

    .panel-header-left {
        width: 100%;
        min-width: unset;
        border-bottom: 1px solid var(--border-color);
    }

    .panel-header-divider {
        display: none;
    }

    .panel-header-right {
        width: 100%;
    }
}

/* 更小屏幕适配 */
@media (max-width: 480px) {
    .editor-preview-panel {
        width: 100%;
        flex: 0 0 auto;
    }
}