/* 请柬编辑器样式 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    overflow: hidden;
}

/* 顶部工具栏 */
.editor-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auto-save-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #52c41a;
    margin-right: 15px;
}

.auto-save-icon {
    font-size: 14px;
}

.auto-save-text {
    color: #666;
}

.editor-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.template-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #e6f7ff;
    color: #1890ff;
    border-radius: 12px;
    font-size: 12px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.3s;
}

.btn-icon:hover {
    background: #f0f0f0;
}

.btn-primary {
    background: #1890ff;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #40a9ff;
}

.btn-secondary {
    background: #fff;
    color: #333;
    border: 1px solid #d9d9d9;
}

.btn-secondary:hover:not(:disabled) {
    border-color: #1890ff;
    color: #1890ff;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 主容器 */
.editor-container {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    overflow: hidden;
}

/* 左侧表单 */
.editor-sidebar {
    width: 420px;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-content {
    padding: 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.form-section {
    margin-bottom: 32px;
}

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #666;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-label.required::after {
    content: ' *';
    color: #ff4d4f;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #999;
}

/* 右侧预览 */
.editor-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow-y: auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.preview-container {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.preview-header {
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.preview-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.preview-header p {
    font-size: 14px;
    opacity: 0.9;
}

.preview-content {
    padding: 24px;
}

.preview-section {
    margin-bottom: 20px;
}

.preview-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #999;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-section-content {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}

.preview-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.preview-empty-icon {
    font-size: 60px;
    margin-bottom: 16px;
}

.preview-empty-text {
    font-size: 16px;
}

/* 响应式 */
@media (max-width: 1024px) {
    .editor-sidebar {
        width: 360px;
    }
}

@media (max-width: 768px) {
    .editor-container {
        flex-direction: column;
    }
    
    .editor-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e8e8e8;
        max-height: 50vh;
    }
    
    .editor-preview {
        padding: 20px;
    }
}

/* 滚动条 */
.editor-sidebar::-webkit-scrollbar,
.editor-preview::-webkit-scrollbar {
    width: 8px;
}

.editor-sidebar::-webkit-scrollbar-track,
.editor-preview::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.editor-sidebar::-webkit-scrollbar-thumb,
.editor-preview::-webkit-scrollbar-thumb {
    background: #d9d9d9;
    border-radius: 4px;
}

.editor-sidebar::-webkit-scrollbar-thumb:hover,
.editor-preview::-webkit-scrollbar-thumb:hover {
    background: #bfbfbf;
}

/* 加载状态 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 消息提示 */
.message {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 20px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.message.success {
    border-left: 4px solid #52c41a;
}

.message.error {
    border-left: 4px solid #ff4d4f;
}

.message.warning {
    border-left: 4px solid #faad14;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

