/* 导入得意黑相关字体 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&family=Noto+Serif+SC:wght@300;400;500;700&display=swap');
/* 导入霞鹜文楷字体 */
@import url('https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.7.0/lxgwwenkaiscreenr.css');

:root {
    /* 主色调 */
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #7c3aed;
    --accent-color: #ec4899;
    
    /* 中性色调 */
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;
    
    /* 背景色 */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    
    /* 边框色 */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-dark: #94a3b8;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 过渡时间 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 图标基础样式 */
.iconfont {
    font-size: 1rem;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    fill: currentColor;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-primary);
    color: var(--neutral-800);
    line-height: 1.6;
    background-image: radial-gradient(circle at 10% 20%, rgba(120, 119, 198, 0.05) 0%, rgba(255, 255, 255, 0) 13%),
                      radial-gradient(circle at 90% 80%, rgba(121, 144, 235, 0.05) 0%, rgba(255, 255, 255, 0) 13%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
}

header {
    background: var(--bg-card);
    color: var(--neutral-800);
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    border-radius: 0 0 8px 8px;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.85);
}

header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

header h1 span {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--neutral-500);
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    background-color: var(--neutral-100);
    border: 1px solid var(--border-light);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.toolbar {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.toolbar button {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--neutral-700);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.toolbar button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.toolbar button:hover::before {
    left: 100%;
}

.toolbar button:hover {
    background: var(--neutral-50);
    border-color: var(--neutral-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.toolbar button:active {
    transform: translateY(0);
}

/* 高亮按钮样式 */
.toolbar button.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.toolbar button.primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* 在移动设备上调整工具栏按钮 */
@media (max-width: 768px) {
    .toolbar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.4rem;
    }
    
    .toolbar button {
        padding: 0.45rem 0.85rem;
        font-size: 0.85rem;
        margin: 0.1rem;
    }
}

.editor-container {
    display: flex;
    flex: 1;
    gap: 1.8rem;
    padding: 1.8rem;
    height: calc(100vh - 150px);
    background: var(--bg-secondary);
    border-radius: 16px;
    margin: 1.2rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.editor-panel, .preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    overflow: hidden;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal);
}

.editor-panel:hover, .preview-panel:hover {
    box-shadow: var(--shadow-md);
}

.editor-panel h2, .preview-panel h2 {
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--neutral-50), var(--bg-card));
    border-bottom: 1px solid var(--border-light);
    font-size: 1rem;
    color: var(--neutral-700);
    font-weight: 600;
    letter-spacing: -0.01em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 14px 14px 0 0;
}

/* 在移动设备上优化预览面板标题栏 */
@media (max-width: 768px) {
    .preview-panel h2 {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }
    
    .mobile-download-btn {
        position: relative;
        margin-left: 0.5rem;
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}

.mobile-download-btn {
    display: none;
    background: var(--neutral-100);
    border: 1px solid var(--border-light);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--neutral-600);
    transition: all var(--transition-normal);
    font-weight: 500;
    white-space: nowrap; /* 防止文字换行 */
}

.mobile-download-btn:hover {
    background: var(--neutral-200);
    color: var(--neutral-800);
    border-color: var(--neutral-300);
}

/* 在移动设备上进一步优化按钮 */
@media (max-width: 480px) {
    .mobile-download-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
        min-width: auto;
    }
    
    .preview-panel h2 {
        flex-wrap: nowrap; /* 防止换行 */
    }
}

/* 在移动设备上显示下载按钮 */
@media (max-width: 768px) {
    .mobile-download-btn {
        display: inline-block;
    }
}

.editor-actions {
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, var(--neutral-50), var(--bg-card));
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    overflow-x: auto;
    backdrop-filter: blur(10px);
}

.editor-actions button {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-normal);
    font-size: 0.85rem;
    min-width: 36px;
    text-align: center;
    font-family: inherit;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.editor-actions button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.editor-actions button:hover::before {
    left: 100%;
}

.editor-actions button:hover {
    background: var(--neutral-50);
    border-color: var(--neutral-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.editor-actions select,
.editor-actions input[type="color"] {
    padding: 0.5rem;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    height: 34px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.editor-actions select:focus,
.editor-actions input[type="color"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.editor-actions select {
    min-width: 100px;
    background-color: var(--bg-card);
}

/* 编辑器工具栏图标按钮样式 */
.editor-actions button i {
    font-size: 1rem;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    fill: currentColor;
    overflow: hidden;
}

/* 对于带有文本的按钮，调整样式 */
.toolbar button i {
    font-size: 1rem;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    fill: currentColor;
    overflow: hidden;
}

/* 确保图标在按钮中正确显示 */
.toolbar button i,
.editor-actions button i {
    display: inline-block;
    margin-right: 0.3rem;
    font-size: 0.9em;
}

/* 对于纯图标按钮，不需要右边距 */
.editor-actions button i.no-text {
    margin-right: 0;
}

.editor-actions select,
.editor-actions input[type="color"] {
    padding: 0.4rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    height: 32px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.editor-actions select {
    min-width: 90px;
}

.editor-actions input[type="color"] {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: #ffffff;
    cursor: pointer;
    border-radius: 4px;
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    position: relative;
}

.color-palette {
    display: none;
    position: absolute;
    top: 38px;
    left: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem;
    z-index: 10;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

.color-picker-container:hover .color-palette {
    display: flex;
    flex-wrap: wrap;
    width: 120px;
}

.color-option {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid #fff;
    transition: transform 0.2s;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.color-option:hover {
    transform: scale(1.4);
    border: 1px solid #000;
}

#editor {
    flex: 1;
    width: 100%;
    padding: 1.2rem;
    border: none;
    resize: none;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', monospace;
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    background-color: #ffffff;
    color: #1a1a1a;
}

#preview {
    flex: 1;
    padding: 1.2rem;
    overflow-y: auto;
    background-color: #f8fafc;
    color: #1a1a1a;
}

/* 圆角卡片样式 */
.preview-content {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

#preview h1, #preview h2, #preview h3, #preview h4, #preview h5, #preview h6 {
    margin-top: 1.4em;
    margin-bottom: 0.7em;
    font-weight: 500;
    line-height: 1.3;
    color: #1a1a1a;
}

#preview h1 {
    font-size: 1.7em;
}

#preview h2 {
    font-size: 1.45em;
}

#preview h3 {
    font-size: 1.25em;
}

#preview p {
    margin-bottom: 1em;
    color: #333;
}

#preview ul, #preview ol {
    margin-left: 1.5rem;
    margin-bottom: 1em;
}

#preview li {
    margin-bottom: 0.4em;
}

#preview pre {
    background-color: #f8f9fa;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.95em;
}

#preview code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', monospace;
    font-size: 14px;
    background-color: #f8f9fa;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    color: #e03131;
}

#preview blockquote {
    border-left: 3px solid #e2e8f0;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #666;
    font-style: italic;
    background-color: #f8f9fa;
    padding: 0.8rem 1rem;
    border-radius: 0 6px 6px 0;
}

.status-bar {
    padding: 0.6rem 1.2rem;
    background-color: #fafafa;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
}

footer {
    text-align: center;
    padding: 1.2rem;
    border-top: 1px solid var(--border-light);
    color: var(--neutral-500);
    font-size: 0.85rem;
    background: var(--bg-card);
    border-radius: 0 0 8px 8px;
    margin: 0 1.2rem 1.2rem 1.2rem;
    box-shadow: var(--shadow-sm);
}

/* 图片生成配置模态框样式 */
#imageConfigModal .modal-content {
    background: var(--bg-card);
    margin: 5% auto;
    padding: 1.8rem;
    border: none;
    border-radius: 16px;
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    font-family: inherit;
    box-shadow: var(--shadow-xl);
    position: relative;
    border: 1px solid var(--border-light);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

#imageConfigModal .close {
    position: absolute;
    right: 1.2rem;
    top: 1.2rem;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--neutral-500);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-normal);
    z-index: 10;
}

#imageConfigModal .close:hover {
    color: var(--neutral-700);
    background: var(--neutral-100);
    transform: rotate(90deg);
}

#imageConfigModal h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--neutral-800);
    text-align: center;
    font-weight: 600;
    font-size: 1.4rem;
    position: relative;
}

#imageConfigModal h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

.config-section {
    margin-bottom: 1.8rem;
}

.config-section label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 500;
    color: var(--neutral-700);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-section label::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.device-options {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.device-option {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all var(--transition-normal);
    text-align: center;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.device-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.device-option:hover::before {
    left: 100%;
}

.device-option:hover {
    background: var(--neutral-50);
    border-color: var(--neutral-300);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.device-option.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.background-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding: 1.2rem;
    background: var(--neutral-50);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    transition: all var(--transition-normal);
}

.background-options:hover {
    border-color: var(--neutral-300);
}

.background-options .color-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-normal);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.background-options .color-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.background-options .color-option.active {
    border: 2px solid var(--neutral-700);
    transform: scale(1.15);
    box-shadow: 0 0 0 2px white, var(--shadow-md);
}

#authorInput {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-normal);
    background: var(--bg-card);
    color: var(--neutral-800);
}

#authorInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.config-actions {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

#generateImageButton {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.9rem 2rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#generateImageButton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s;
}

#generateImageButton:hover::before {
    left: 100%;
}

#generateImageButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

#generateImageButton:active {
    transform: translateY(0);
}

/* 实时预览样式 */
.realtime-preview {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--neutral-50);
    border-radius: 10px;
    padding: 1.2rem;
}

.realtime-preview h3 {
    margin-bottom: 1rem;
    color: var(--neutral-700);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.realtime-preview h3::before {
    content: '👁️';
    font-size: 1.2em;
}

#realtimePreviewContainer {
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 1rem;
    background-color: var(--bg-card);
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.preview-container {
    width: 100%;
    min-height: 200px;
}

.preview-content {
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal) ease;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
}

.preview-content.phone {
    width: 375px;
    height: 667px;
    margin: 0 auto;
}

.preview-content.tablet {
    width: 768px;
    height: 1024px;
    margin: 0 auto;
}

.preview-content.desktop {
    width: 1024px;
    height: 768px;
    margin: 0 auto;
}

.preview-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.preview-title {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

.preview-body {
    line-height: 1.6;
    color: #666;
}

.preview-footer {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    text-align: right;
    color: #888;
}

.preview-author {
    font-size: 0.9em;
}

/* 模态框通用样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#imageConfigModal .modal-content {
    animation: slideIn 0.3s ease-out;
}

.modal-content {
    background-color: #ffffff;
    margin: 3% auto;
    padding: 0;
    border: none;
    border-radius: 12px;
    width: 85%;
    max-width: 950px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    font-family: inherit;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.close {
    color: #999;
    font-size: 24px;
    font-weight: normal;
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close:hover,
.close:focus {
    color: #333;
    background: #f8f9fa;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .editor-container {
        flex-direction: column;
        height: auto;
        padding: 1rem;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .toolbar {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .editor-actions {
        justify-content: center;
        padding: 0.8rem;
    }
    
    .editor-actions button {
        margin: 0.1rem;
    }
    
    #imageConfigModal .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .device-options {
        flex-direction: column;
    }
    
    #realtimePreviewContainer {
        max-height: 200px; /* 在移动设备上适当减小预览区域高度 */
    }
}