/* AI Writer Pro - 修复版样式 */
/* 字体改用系统字体，移除被墙的 Google Fonts @import，避免渲染阻塞 */

/* ===== 基础样式变量 ===== */
:root {
    /* 主色调 - 现代极简黑（Claude Code 风格） */
    --primary-gradient: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    --secondary-gradient: linear-gradient(135deg, #404040 0%, #1a1a1a 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);

    /* 基础颜色 */
    --primary-color: #1a1a1a;
    --secondary-color: #525252;
    --accent-color: #1a1a1a;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* 背景和表面 */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.8);
    --bg-surface: #f1f5f9;
    --bg-hover: #f8fafc;
    
    /* 文字颜色 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-accent: #1a1a1a;

    /* 边框和分割线 */
    --border-color: #e5e5e5;
    --border-accent: rgba(0, 0, 0, 0.12);

    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.10);
    --shadow-glow: 0 4px 20px rgba(0, 0, 0, 0.10);
    
    /* 圆角和间距 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --spacing-xs: 0.25rem; /* 4px */
    --spacing-sm: 0.5rem;  /* 8px */
    --spacing-md: 0.75rem; /* 12px */
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* 字体 */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    
    /* 动画 */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== 粒子背景 ===== */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 0, 0, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(75, 172, 254, 0.03) 0%, transparent 50%);
}

/* ===== 文件上传显示区域 ===== */
.uploaded-files-display {
    margin-top: var(--spacing-sm);
}

.files-list {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    backdrop-filter: blur(10px);
}

.files-list h5 {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.files-list h5 i {
    color: var(--primary-color);
}

.file-items {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.file-item:hover {
    border-color: var(--border-accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    color: var(--primary-color);
    font-size: 0.875rem;
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.file-remove:hover {
    background: var(--danger-color);
    color: white;
}

/* ===== 对话界面改进 ===== */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 400px;
    overflow-y: auto;
    padding: var(--spacing-sm);
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    margin-bottom: var(--spacing-sm);
}

.message {
    display: flex;
    gap: var(--spacing-sm);
    animation: slideIn 0.3s ease-out;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--primary-gradient);
}

.message.assistant .message-avatar {
    background: var(--secondary-gradient);
}

.message-content {
    flex: 1;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.5;
    max-width: 80%;
}

.message.user .message-content {
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: var(--radius-sm);
}

.message.assistant .message-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: var(--radius-sm);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 输入区域改进 ===== */
.chat-input-container {
    position: relative;
}

.chat-input {
    width: 100%;
    min-height: 100px;
    max-height: 200px;
    padding: var(--spacing-sm);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.chat-input:focus + .input-hint {
    opacity: 1;
    transform: translateY(0);
}

.input-hint {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0;
    transform: translateY(-5px);
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

/* ===== 历史文章区域 ===== */
.history-section {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.history-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm);
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.history-section .section-header:hover {
    background: var(--bg-hover);
}

.history-section .section-header h4 {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.toggle-icon {
    margin-left: var(--spacing-xs);
    transition: var(--transition);
}

.history-section.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    padding: var(--spacing-sm);
    padding-right: 4px;
    transition: var(--transition);
}

.history-section.collapsed .history-list {
    max-height: 0;
    padding: 0 var(--spacing-sm);
    opacity: 0;
}

.history-section.expanded .history-list {
    max-height: 200px;
    padding: var(--spacing-sm);
    opacity: 1;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: var(--bg-surface);
    border-radius: 2px;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: var(--spacing-xs);
}

.history-item:hover {
    background: var(--bg-hover);
    transform: translateX(2px);
}

.history-item:last-child {
    margin-bottom: 0;
}

/* ===== AI聊天区域改进 ===== */
.ai-chat-section {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
}

.chat-input-area {
    margin-top: auto;
}

/* ===== 左右面板布局改进 ===== */
.left-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: var(--spacing-md);
}

.right-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-canvas {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.canvas-content {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
}

/* ===== 编辑器头部优化 ===== */
.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-to-workshop {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.back-to-workshop:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.back-to-workshop i {
    font-size: 0.875rem;
}

.back-text {
    font-weight: 600;
}

/* ===== 新的顶部控制区域样式 ===== */
.top-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.project-header-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
    min-width: 300px;
}

.project-info {
    display: flex;
    align-items: center;
}

.project-breadcrumb {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.current-project-name {
    color: var(--text-primary);
    font-weight: 600;
}

.controls-section {
    display: flex;
    align-items: flex-end;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 120px;
    align-items: flex-start;
}

.control-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.control-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.control-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
}

/* 文件上传状态显示 */
.uploaded-file-info {
    margin-top: 0.25rem;
}

.file-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--success-color);
    background: rgba(67, 233, 123, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    max-width: 120px;
}

.file-status i {
    font-size: 10px;
}

.file-status span:first-of-type {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-count {
    background: var(--success-color);
    color: white;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 8px;
    font-weight: 600;
}

/* ===== 新的双栏布局样式 ===== */
.dual-panel-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    height: calc(100vh - 280px); /* 根据顶部控制区域调整高度 */
    min-height: 600px;
}

/* 左侧对话面板 */
.chat-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    height: 100%;
}

.chat-panel-header {
    padding: var(--spacing-sm);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-primary);
    font-weight: 500;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.chat-messages-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.chat-messages {
    height: 100%;
    overflow-y: auto;
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* 消息样式优化 */
.message {
    display: flex;
    gap: var(--spacing-xs);
    max-width: 100%;
    animation: messageSlideIn 0.3s ease-out;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--secondary-gradient);
}

.message-content {
    flex: 1;
    background: var(--bg-surface);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    word-wrap: break-word;
}

.message.user .message-content {
    background: var(--bg-glass);
    border: 1px solid var(--border-accent);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* 输入区域 */
.chat-input-area {
    padding: var(--spacing-sm);
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.chat-input-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.chat-input {
    width: 100%;
    min-height: 80px;
    max-height: 120px;
    padding: var(--spacing-xs);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    resize: vertical;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    transition: border-color 0.2s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.chat-input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 右侧预览面板 */
.preview-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    height: 100%;
}

.preview-panel-header {
    padding: var(--spacing-sm);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.preview-panel-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.canvas-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.preview-content-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.canvas-content {
    height: 100%;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.canvas-placeholder {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    color: var(--text-muted) !important;
    text-align: center !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

.canvas-placeholder i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

/* 历史文章区域优化 */
.history-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    transition: all 0.3s ease;
}

.history-section.collapsed {
    transform: translateY(-5px);
}

.history-section.collapsed .history-list {
    max-height: 0;
    opacity: 0;
}

.history-section.expanded .history-list {
    max-height: 200px;
    opacity: 1;
}

.section-header {
    padding: var(--spacing-sm);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.section-header:hover {
    background: var(--bg-hover);
}

.section-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-primary);
    font-weight: 600;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.history-section.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.history-list {
    max-height: 200px;
    opacity: 1;
    overflow: hidden;
    transition: all 0.3s ease;
    padding: var(--spacing-xs);
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.history-item:hover {
    background: var(--bg-hover);
}

.history-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.history-content {
    flex: 1;
}

.history-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.history-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 动画效果 */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 历史文章功能样式 */
.loading-history {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.loading-history i {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.empty-history {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-history i {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--text-muted);
}

.empty-history h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.history-item-modal {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.history-item-modal:hover {
    background-color: var(--bg-hover);
}

.history-item-modal:last-child {
    border-bottom: none;
}

.history-icon-modal {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.history-icon-modal i {
    color: white;
    font-size: 16px;
}

.history-content-modal {
    flex: 1;
    min-width: 0;
}

.history-title-modal {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 15px;
    line-height: 1.4;
}

.history-meta-modal {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.history-preview {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-actions-modal {
    display: flex;
    gap: 8px;
    margin-left: 12px;
    flex-shrink: 0;
}

.history-actions-modal .btn {
    padding: 6px 12px;
    font-size: 12px;
    min-width: auto;
}

/* 最新文章显示区域样式优化 */
.latest-article .article-item {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    padding: 8px;
}

.latest-article .article-item:hover {
    background-color: var(--bg-hover);
    transform: translateY(-1px);
}

.latest-article .article-title {
    font-weight: 500;
    color: var(--text-primary);
}

.latest-article .article-meta {
    color: var(--text-secondary);
    font-size: 11px;
}

/* 自动保存指示器 */
.auto-save-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 10000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.auto-save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.auto-save-indicator i {
    margin-right: 6px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .dual-panel-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
        height: auto;
        min-height: 800px;
    }
    
    .controls-section {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .project-header-section {
        flex-wrap: wrap;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .top-controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }
    
    .project-header-section {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }
    
    .controls-section {
        justify-content: stretch;
    }
    
    .control-group {
        min-width: auto;
        flex: 1;
    }
}

/* ===== 编辑器工作区间距优化 ===== */
.editor-workspace-grid {
    padding: var(--spacing-md) var(--spacing-lg);
    gap: var(--spacing-md);
}

.top-controls-row {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.main-content-area {
    margin-top: 0;
}

/* ===== 画布头部优化 ===== */
.canvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.canvas-actions {
    display: flex;
    gap: var(--spacing-xs);
}

#sync-to-design-btn {
    background: var(--success-gradient);
    color: white;
    border: none;
    font-weight: 600;
}

#sync-to-design-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}



/* ===== 侧边栏 ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 180px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: 100;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.sidebar-header {
    padding: 16px 8px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: var(--primary-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: var(--shadow-sm);
}

.logo-text h2 {
    font-size: 20px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    overflow: visible;
}

.logo-text span {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.version-tag {
    display: inline-block;
    background: var(--bg-surface);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    margin-top: 4px;
}

/* 导航菜单 */
.nav-menu {
    list-style: none;
    padding: var(--spacing-md) 4px;
    /* 调整上边距，让导航项目不要太靠下 */
    margin-top: 10px;
    /* 减少左边距 */
    padding-left: 8px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    width: calc(100% - var(--spacing-xs) * 2);
    box-sizing: border-box;
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.nav-icon {
    width: 28px;
    height: 28px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    transition: var(--transition);
}

.nav-item.active .nav-icon {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 5px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    padding: 8px 2px;
    border-radius: 8px;
    transition: background 0.2s;
    cursor: pointer;
}

.user-profile:hover {
    background: var(--bg-hover);
}

.avatar {
    width: 42px;
    height: 42px;
    background: var(--bg-surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
    font-size: 16px;
}

.avatar.logged-in {
    background: var(--primary-gradient);
    color: white;
}

.user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.user-info span {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.user-info span.not-logged-in {
    color: #ef4444;
}

.user-info small {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
    display: block;
    white-space: nowrap;
}

.user-menu-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu-btn:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
}

.user-menu {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.user-menu[style*="display: block"] {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.user-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 14px;
}

.user-menu a:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
}

.user-menu a i {
    width: 18px;
    text-align: center;
}

/* ===== 主内容区域 ===== */
.main-content {
    margin-left: 190px;
    margin-right: 10px;
    min-height: 100vh;
    padding: var(--spacing-md);
    background: var(--bg-primary);
}

.site-footer {
    margin-left: 190px;
    padding: 16px 12px 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.site-footer a {
    color: inherit;
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--text-primary);
    text-decoration: underline;
}

/* ===== 页面切换系统 - 修复版 ===== */
.page {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease-out;
}

.page.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 工作坊视图切换 */
.workshop-view {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease-out;
}

.workshop-view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ===== 项目选择页面 ===== */
.project-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md) 0;
}

.project-selection-header .header-content h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 2px;
    line-height: 1.2;
    color: var(--text-primary);
}

.project-selection-header .header-content p {
    display: none;
}

.header-stats {
    display: flex;
    gap: var(--spacing-lg);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 项目展示区域 */
.projects-showcase {
    margin-bottom: var(--spacing-xl);
}

.showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.showcase-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.showcase-header i {
    color: var(--primary-color);
    font-size: 20px;
}

/* 项目卡片网格 */
.project-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    max-width: 100%;
}

/* 新的卡片布局样式 */
.card-content-new {
    padding: var(--spacing-md);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: flex-start;
}

.card-content-new .project-meta {
    display: flex;
    gap: var(--spacing-md);
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.card-content-new .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-content-new .meta-item i {
    font-size: 11px;
    color: var(--primary-color);
}

.card-top-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.project-title-horizontal {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.project-description-area {
    display: flex;
    align-items: flex-start;
    min-height: 0;
}

.project-description-text {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.4;
}

.project-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
    min-height: 150px;
    height: auto;
}

.project-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

/* 项目卡片头部 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-surface);
}

.project-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
}

.project-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.project-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.project-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.star-btn, .delete-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.star-btn:hover, .delete-btn:hover {
    opacity: 1;
    background: var(--bg-hover);
}

.star-btn.starred {
    color: #ffd700;
    opacity: 1;
}

.delete-btn:hover {
    color: var(--danger-color);
    background: rgba(239, 83, 80, 0.1);
}

/* 星标项目样式 */
.project-card[data-starred="true"] {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, transparent 100%);
}

.project-card[data-starred="true"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #ffd700 0%, transparent 100%);
}

/* 卡片内容区域 */
.card-content {
    padding: var(--spacing-xs) var(--spacing-md) var(--spacing-md) var(--spacing-md);
    position: relative;
    z-index: 2;
}

.project-card.create-new {
    border: 2px dashed var(--border-color);
    min-height: 150px;
    height: auto;
}

.project-card.create-new:hover {
    border-color: var(--primary-color);
    background: var(--bg-glass);
}

.project-card.create-new .project-actions .action-btn {
    pointer-events: none;
    opacity: 1 !important;
}

/* 拖拽状态 */
.project-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    z-index: 1000;
}

.project-cards.drag-over {
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
}

.project-icon.tech {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}

.project-icon.marketing {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.project-icon.create {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 2px dashed var(--border-color);
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
    font-size: 14px;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-muted);
}

.project-meta i {
    margin-right: 4px;
}

.create-hint {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: var(--spacing-sm);
}

/* ===== AI编辑工作台 ===== */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
    border-bottom: 1px solid var(--border-color);
}

.editor-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.breadcrumb-item {
    color: var(--text-secondary);
    font-size: 14px;
}

.breadcrumb-item.current {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-size: 12px;
}

.editor-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* 顶部控制区域 */
.top-controls-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.control-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.control-group i {
    color: var(--primary-color);
}

/* 字数选择按钮 */
.word-options {
    display: flex;
    gap: var(--spacing-xs);
}

.word-option {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.word-option:hover {
    border-color: var(--primary-color);
    background: var(--bg-glass);
}

.word-option.active {
    background: var(--primary-gradient);
    color: white;
    border-color: var(--primary-color);
}

.control-select {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}

.control-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* 主要内容区域 */
.main-content-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

/* 左侧面板 */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* 历史文章部分 */
.history-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.section-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.section-header i {
    color: var(--primary-color);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.history-item:hover {
    background: var(--bg-glass);
}

.history-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.history-content {
    flex: 1;
}

.history-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.history-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* AI聊天部分 */
.ai-chat-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn-purple {
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-purple:hover {
    background: linear-gradient(135deg, #000000, #1a1a1a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-purple:active {
    transform: translateY(0);
}

.ai-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.ai-status i {
    color: var(--primary-color);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.chat-input-container {
    position: relative;
}

.chat-input {
    width: 100%;
    min-height: 120px;
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: var(--font-primary);
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.chat-input::placeholder {
    color: var(--text-muted);
    line-height: 1.4;
}

/* 右侧面板 */
.right-panel {
    display: flex;
    flex-direction: column;
}

.article-canvas {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    height: 100%;
}

.canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.canvas-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.canvas-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.canvas-content {
    flex: 1;
    min-height: 400px;
}

.canvas-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-muted);
}

.canvas-placeholder i {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    color: var(--text-muted);
}

.canvas-placeholder h3 {
    font-size: 18px;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

/* 生成的文章样式 */
.generated-article {
    color: var(--text-primary);
    line-height: 1.5;
}

.generated-article h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5em;
    margin-bottom: 1em;
}

.generated-article h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2em;
    margin-bottom: 1em;
}

.generated-article p {
    color: var(--text-secondary);
    margin-top: 0;
    margin-bottom: 2.5em; /* Further increased spacing between paragraphs */
}

.generated-article blockquote {
    margin: 1.5em 0;
    padding: 0.5em 1.5em;
    border-left: 4px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
}

.generated-article ul, .generated-article ol {
    margin: var(--spacing-md) 0;
    padding-left: var(--spacing-lg);
}

.generated-article li {
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
}

.generated-article li strong {
    color: var(--text-primary);
}

/* 生成中占位符 */
.generating-placeholder {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.generating-placeholder h3,
.generating-placeholder p {
    margin: 1px 0 !important;
    text-align: center !important;
    color: var(--text-muted) !important;
}

/* 确保生成中占位符在预览区域中也能居中显示 */
#article-preview-content .generating-placeholder,
#article-preview-content .generating-placeholder h3,
#article-preview-content .generating-placeholder p {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

#article-preview-content .generating-placeholder {
    width: 100% !important;
    height: 100% !important;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== 按钮样式 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-glass);
    border-color: var(--border-accent);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-ghost:disabled,
.btn-ghost.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}

.btn-ghost:disabled:hover,
.btn-ghost.disabled:hover {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}

.btn-glass {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.btn-glass:hover {
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 12px;
}

.btn-success {
    background: var(--success-gradient);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 4px 20px rgba(67, 233, 123, 0.3);
}

/* ===== 最近项目 ===== */
.recent-projects {
    margin-top: var(--spacing-xl);
}

.recent-projects h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.recent-projects i {
    color: var(--primary-color);
}

.recent-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    align-items: stretch;
    grid-auto-rows: 150px;
}

.recent-list .recent-project-card {
    height: 150px !important;
    min-height: 150px !important;
    max-height: 150px !important;
    overflow: hidden !important;
}

.recent-list .recent-project-card:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

.recent-list .recent-project-card .card-content-new {
    height: 100% !important;
    justify-content: flex-start;
    gap: 4px;
    overflow: hidden;
}

.recent-list .project-title-horizontal {
    font-size: 15px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.recent-list .card-top-row {
    align-items: flex-start;
}

.recent-list .project-description-area {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    align-items: flex-start !important;
}

.recent-list .project-description-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-list .card-content-new .project-meta {
    margin-top: auto !important;
}

.empty-recent {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

.empty-recent i {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    color: var(--text-muted);
}

.empty-recent p {
    font-size: 16px;
    margin-bottom: var(--spacing-xs);
}

.empty-recent small {
    font-size: 14px;
}

@media (max-width: 1180px) {
    .recent-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .recent-list {
        grid-template-columns: 1fr;
    }
}

/* ===== 模态框 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-width: 800px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: var(--transition);
    border: 1px solid #e5e7eb;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* 微信公众号账号列表样式 */
.wechat-account-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.wechat-account-item input[type="checkbox"]:checked ~ div {
    font-weight: 600;
}

.wechat-account-item button:hover {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

/* 公众号列表滚动条样式 */
#wechat-accounts-list::-webkit-scrollbar {
    width: 6px;
}

#wechat-accounts-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#wechat-accounts-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#wechat-accounts-list::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* 生图配置弹窗：内容可滚动，保存按钮始终可点击 */
.image-generation-modal {
    padding: 16px;
    box-sizing: border-box;
}

.image-generation-modal .modal {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
    overflow: hidden;
}

.image-generation-modal .modal-header,
.image-generation-modal .modal-footer {
    flex-shrink: 0;
    background: #ffffff;
    position: relative;
    z-index: 1;
}

.image-generation-modal .modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.image-generation-modal .modal-footer {
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.06);
}

/* 表单样式 */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-primary);
}

.input-field {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-primary);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.input-field::placeholder {
    color: var(--text-muted);
}

/* 项目提示词编辑框专用样式 */
#edit-system-prompt {
    min-height: 420px;
    resize: vertical;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    transition: var(--transition);
}

#edit-system-prompt:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
    outline: none;
}

/* 提示词模态框专用样式 */
.modal-overlay.prompt-modal .modal {
    max-width: 900px;
    width: 95%;
}

.modal-overlay.prompt-modal .modal-body {
    padding: var(--spacing-md) var(--spacing-lg);
}

/* 提示词标题和保存按钮布局 */
.prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.prompt-label {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
}

.save-prompt-top {
    background: var(--primary-gradient) !important;
    color: white !important;
    border: none !important;
    padding: var(--spacing-xs) var(--spacing-md) !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    box-shadow: var(--shadow-glow) !important;
    display: flex !important;
    align-items: center !important;
    gap: var(--spacing-xs) !important;
}

.save-prompt-top:hover {
    transform: translateY(-1px) !important;
    box-shadow: var(--shadow-lg) !important;
}

.save-prompt-top:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.modal-overlay.prompt-modal .form-group {
    margin-bottom: var(--spacing-sm);
}

.modal-overlay.prompt-modal .editor-tips {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-top: var(--spacing-sm);
    border-left: 4px solid var(--primary-color);
}

.modal-overlay.prompt-modal .editor-tips p {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.modal-overlay.prompt-modal .editor-tips i {
    color: var(--primary-color);
}

.modal-overlay.prompt-modal .editor-tips ul {
    margin: 0;
    padding-left: var(--spacing-lg);
}

.modal-overlay.prompt-modal .editor-tips li {
    margin: var(--spacing-xs) 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 提示词模态框按钮样式优化 */
.modal-overlay.prompt-modal .modal-footer {
    padding: var(--spacing-lg) var(--spacing-xl);
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
}

.modal-overlay.prompt-modal .save-prompt {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-glow);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.modal-overlay.prompt-modal .save-prompt:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.prompt-modal .save-prompt::before {
    content: '\f0c7';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

.modal-overlay.prompt-modal .cancel-prompt {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-overlay.prompt-modal .cancel-prompt:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

/* 历史文章模态框优化 */
#history-modal .modal {
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
}

#history-modal .modal-body {
    padding: 0;
    max-height: 70vh;
    overflow: hidden;
}

.history-articles-list {
    max-height: 70vh;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.history-articles-list::-webkit-scrollbar {
    width: 8px;
}

.history-articles-list::-webkit-scrollbar-track {
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
}

.history-articles-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

.history-articles-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 历史文章项目优化 */
.history-item-modal {
    margin-bottom: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.history-item-modal:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.history-preview {
    margin-top: var(--spacing-xs);
    padding: var(--spacing-xs);
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
}

/* 空状态和加载状态优化 */
.empty-history {
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.empty-history i {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.loading-history {
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.loading-history i {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

/* ===== 通知系统 ===== */
.notification {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    max-width: 500px;
    font-size: 13px;
    font-weight: 500;
    transition: transform 0.3s ease-in-out;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
}

.notification.success {
    border-left: 4px solid var(--success-color);
    color: var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--danger-color);
    color: var(--danger-color);
}

.notification.info {
    border-left: 4px solid var(--primary-color);
    color: var(--primary-color);
}

/* ===== 编辑器页面样式 ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
}

.header-content h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 2px;
    line-height: 1.2;
    color: var(--text-primary);
}

.gradient-text {
    color: var(--text-primary);
}

.header-content p {
    display: none;
}

.header-actions {
    display: flex;
    gap: var(--spacing-sm);
}

#editor-page .page-header {
    margin-bottom: 8px;
}

#editor-page .style-gallery {
    margin-bottom: 8px;
}

#editor-page .style-gallery h3 {
    margin-bottom: 8px;
}

#editor-page .style-tabs {
    margin-bottom: 0;
}

#editor-page .editor-workspace {
    margin-top: 0;
}

/* ===== 风格设计页固定布局（仅桌面双栏布局生效）=====
   页头 / 风格卡片区 / 左右列 header 固定，滚动只发生在
   左列工具面板 (.editor-content) 与右列文章内容 (.preview-content) 内部。
   滚动链路：#editor-page 占满视口剩余高度 → .editor-workspace flex:1
   → .editor-columns 100% → .editor-column(overflow:hidden)
   → .editor-content / .preview-content overflow-y:auto */
@media (min-width: 1025px) {
    #editor-page.page.active {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 2 * var(--spacing-md));
        overflow: hidden;
    }

    #editor-page .page-header {
        flex-shrink: 0;
        margin-bottom: 6px;
    }

    #editor-page .style-gallery-pc {
        flex-shrink: 0;
        margin-bottom: 6px;
    }

    #editor-page .editor-workspace {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    #editor-page .editor-columns {
        flex: 1;
        height: 100%;
        min-height: 0;
    }

    /* 取消旧的 sticky 整列方案，列高交由 grid 行高约束 */
    #editor-page #style-editor-column {
        position: static;
        height: auto;
        max-height: none;
    }

    #editor-page .editor-content,
    #editor-page .preview-content {
        overflow-y: auto;
        min-height: 0;
    }
}

/* 风格选择 */
.style-gallery {
    margin-bottom: var(--spacing-lg);
}

.style-gallery h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.style-gallery h3 i {
    font-size: 13px;
    color: var(--text-muted);
}

.style-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 5px;
    margin-bottom: var(--spacing-sm);
}

.style-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 3px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.style-tab:hover {
    border-color: var(--text-muted);
    background: var(--bg-hover);
}

.style-tab.active {
    border-color: #b0b0b0;
    background: var(--bg-surface);
}

.style-tab.active i,
.style-tab.active span {
    color: var(--text-primary);
}

.style-tab.active span {
    font-weight: 600;
}

.style-tab span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

/* === PC 端隐藏移动端风格选择器（修复重复显示 / 乱码竖排） === */
.style-select-mobile,
.style-panel-mobile,
.style-panel-overlay,
.mobile-editor-toggle {
    display: none;
}

@media (max-width: 768px) {
    #editor-page .style-gallery-pc {
        display: none !important;
    }
    .style-select-mobile {
        display: flex !important;
        gap: 8px;
        align-items: center;
        margin-bottom: 12px;
    }
    .style-dropdown-wrapper {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        flex: 1;
        padding: 8px 12px;
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        cursor: pointer;
    }
    .style-dropdown-wrapper .dropdown-label {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-primary);
    }
    .style-dropdown-wrapper .dropdown-arrow {
        font-size: 11px;
        color: var(--text-secondary);
        transition: transform 0.2s;
    }
    .style-dropdown-wrapper.open .dropdown-arrow {
        transform: rotate(180deg);
    }
    .btn-custom-style {
        display: flex !important;
        align-items: center;
        gap: 4px;
        padding: 8px 10px;
        font-size: 12px;
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        color: var(--text-secondary);
        cursor: pointer;
        white-space: nowrap;
    }
    .style-panel-overlay.show {
        display: block !important;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 199;
    }
    .style-panel-mobile.show {
        display: block !important;
        position: fixed;
        top: 120px;
        left: 12px;
        right: 12px;
        z-index: 200;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }
    .style-grid-mobile {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .style-grid-item {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px 8px;
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        cursor: pointer;
    }
    .style-grid-item span {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-primary);
    }
    .style-grid-item.active {
        border-color: var(--primary-color);
        background: var(--bg-hover);
    }
}


/* ===== 设置页面样式 ===== */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.header-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 16px;
}

.header-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.header-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* AI模型配置 */
.ai-models {
    display: grid;
    gap: var(--spacing-lg);
}

/* 紧凑型AI模型网格布局 - 每行两个 */
.ai-models-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.ai-model-card-compact {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.ai-model-card-compact:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.model-header-compact {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.model-header-compact .left-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.model-info-compact {
    flex: 1;
}

.model-info-compact h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.model-info-compact .model-provider {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.model-info-compact .model-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
}

.api-config-compact {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 2px;
    flex: 1;
}

.api-config-compact .form-group {
    margin-bottom: 0;
    flex: 1;
}

.api-config-compact label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    display: block;
}

.api-config-compact .form-control {
    font-size: 14px;
    padding: 10px 12px;
    width: 100%;
}

.api-config-compact .input-with-button {
    display: flex;
    gap: 6px;
    width: 100%;
}

.api-config-compact .input-with-button input {
    flex: 1;
}

.ai-model-card-compact .test-connection {
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0;
    padding: 6px 12px;
    font-size: 12px;
}
}

.api-config-compact .btn.test-connection {
    position: absolute;
    top: 12px;
    right: 12px;
    width: auto;
    font-size: 12px;
    padding: 6px 12px;
    background: var(--primary-gradient);
    color: white;
    border: none;
}

.api-config-compact .btn.test-connection:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}


.api-config-compact .input-with-button input {
    font-size: 14px;
}

/* Logo尺寸调整 */
.model-header-compact .model-logo {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

/* 新增模型Logo颜色 */
.model-logo.yuanbao {
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
}

.model-logo.kimi {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

/* 响应式 - 小屏幕单列显示 */
@media (max-width: 768px) {
    .ai-models-grid {
        grid-template-columns: 1fr;
    }
}



.ai-model-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    transition: var(--transition);
}

.ai-model-card:hover {
    border-color: var(--border-accent);
    background: var(--bg-glass);
}

.ai-model-card.active {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.model-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.model-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.model-logo.claude {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}

.model-logo.deepseek {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.model-logo.doubao {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.model-logo.tongyi {
    background: linear-gradient(135deg, #fdbb2d 0%, #22c1c3 100%);
}

.model-info {
    flex: 1;
}

.model-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.model-provider {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
}

.model-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 12px;
    font-weight: 500;
}

.model-status.online {
    color: var(--success-color);
}

.model-status.offline {
    color: var(--text-muted);
}

.model-status i {
    font-size: 8px;
}

.model-description p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: var(--spacing-sm);
}

.model-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.api-config {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    display: none;
}

.ai-model-card.active .api-config {
    display: block;
}

.form-control {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}

.input-with-button {
    display: flex;
    gap: var(--spacing-xs);
}

.input-with-button input {
    flex: 1;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1200px) {
    .main-content-area {
        grid-template-columns: 1fr;
    }
    
    .project-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-sm);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 250px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .site-footer {
        margin-left: 0;
    }
    
    .main-content {
        margin-left: 0;
        padding: var(--spacing-md);
    }
    
    .project-selection-header {
        flex-direction: column;
        gap: var(--spacing-lg);
    }
    
    .header-stats {
        flex-direction: column;
        width: 100%;
    }
    
    .project-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .project-cards {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .top-controls-row {
        grid-template-columns: 1fr;
    }
    
    .style-tabs {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .project-selection-header .header-content h1 {
        font-size: 32px;
    }
    
    .header-content h1 {
        font-size: 32px;
    }
    
    .style-tabs {
        grid-template-columns: 1fr;
    }
}

/* ===== 简化的左右双栏布局样式 ===== */
.simple-dual-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    height: calc(100vh - 280px);
    min-height: 600px;
}

/* 左侧面板 */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    overflow: hidden;
}

/* 历史文章区域 - 紧凑版 */
.history-section.compact {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md);
    flex-shrink: 0;
}

.history-section.compact .section-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    user-select: none;
}

.history-section.compact .section-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.history-section.compact .section-header i {
    color: var(--primary-color);
    font-size: 12px;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-icon.expanded {
    transform: rotate(180deg);
}

.history-list.compact {
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.history-list.compact.expanded {
    max-height: 300px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.history-item:hover {
    background: var(--bg-glass);
}

.history-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 12px;
}

.history-content {
    flex: 1;
}

.history-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.3;
}

.history-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* AI对话区域 */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.chat-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-glass);
}

.ai-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.ai-status i {
    color: var(--primary-color);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: auto;
}

.status-indicator.online {
    background: var(--success-color);
    box-shadow: 0 0 0 2px rgba(67, 233, 123, 0.2);
}

.chat-messages-container {
    flex: 1;
    overflow: hidden;
}

.chat-messages {
    height: 100%;
    overflow-y: auto;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.message {
    display: flex;
    gap: var(--spacing-sm);
    max-width: 90%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.message-content {
    flex: 1;
}

.message-content > div:first-child {
    background: var(--bg-glass);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.message.user .message-content > div:first-child {
    background: var(--primary-color);
    color: white;
    margin-left: var(--spacing-sm);
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    padding-left: var(--spacing-sm);
}

.message.user .message-time {
    text-align: right;
    padding-left: 0;
    padding-right: var(--spacing-sm);
}

.chat-input-area {
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.chat-input-container {
    padding: var(--spacing-md);
}

.chat-input {
    width: 100%;
    min-height: 80px;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.chat-input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-sm);
}

.input-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* 右侧面板 */
.right-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-content-container {
    flex: 1;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.preview-header i {
    color: var(--primary-color);
    font-size: 14px;
}

.preview-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.canvas-content {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
    background: var(--bg-secondary);
}

/* 微信配置模态框样式 */
.wechat-config-modal-content {
    max-width: 600px;
    width: 90vw;
}

.wechat-config-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.wechat-config-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.wechat-config-form label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.wechat-config-form .form-input {
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.wechat-config-form .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.wechat-config-form .help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

.wechat-config-form input[type="checkbox"] {
    width: auto;
    margin-right: var(--spacing-xs);
}

.wechat-help {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.wechat-help h4 {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.wechat-help i {
    color: var(--primary-color);
}

.wechat-help ul {
    margin: 0;
    padding-left: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 13px;
}

.wechat-help li {
    margin-bottom: var(--spacing-xs);
}

.wechat-help a {
    color: var(--primary-color);
    text-decoration: none;
}

.wechat-help a:hover {
    text-decoration: underline;
}

/* 自定义风格相关样式 */
.custom-style-modal-content {
    max-width: 700px;
    width: 90vw;
}

.style-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.option-group {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    background: var(--bg-glass);
}

.option-group h4 {
    margin: 0 0 var(--spacing-md) 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.color-input {
    width: 50px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    cursor: pointer;
    background: none;
}

.color-input::-webkit-color-swatch {
    border: none;
    border-radius: calc(var(--radius-xs) - 1px);
}

.custom-styles-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 200px;
    overflow-y: auto;
}

.custom-style-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-style-item:hover {
    background: var(--bg-surface);
    border-color: var(--primary-color);
}

.custom-style-item.active {
    background: rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.custom-style-item h5 {
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.style-preview-sample {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.delete-style-btn {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.custom-style-item:hover .delete-style-btn {
    opacity: 1;
}

.no-custom-styles {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: var(--spacing-lg);
}

.canvas-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
}

.canvas-placeholder i {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    color: var(--text-muted);
}

.canvas-placeholder h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

.canvas-placeholder p {
    font-size: 14px !important;
    max-width: 300px !important;
    line-height: 1.5 !important;
    text-align: center !important;
    margin: 0 auto !important;
    width: 100% !important;
    display: block !important;
}

/* 强制覆盖任何可能影响canvas-placeholder文本对齐的样式 */
.canvas-content .canvas-placeholder,
.canvas-content .canvas-placeholder h3,
.canvas-content .canvas-placeholder p {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 专门覆盖#article-preview-content内的canvas-placeholder样式 */
#article-preview-content .canvas-placeholder,
#article-preview-content .canvas-placeholder h3,
#article-preview-content .canvas-placeholder p {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

#article-preview-content .canvas-placeholder {
    width: 100% !important;
    height: 100% !important;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .simple-dual-panel {
        grid-template-columns: 1fr;
        height: auto;
        gap: var(--spacing-md);
    }
    
    .left-panel {
        order: 1;
    }
    
    .right-panel {
        order: 2;
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .simple-dual-panel {
        height: auto;
        min-height: auto;
    }
    
    .chat-messages {
        padding: var(--spacing-sm);
    }
    
    .chat-input-container {
        padding: var(--spacing-sm);
    }
    
    .preview-header,
    .chat-header,
    .history-section.compact {
        padding: var(--spacing-sm);
    }
}

/* ===== 图标选择器样式 ===== */
.icon-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--spacing-sm);
    max-height: 400px;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-surface);
    border: 2px solid transparent;
}

.icon-option:hover {
    background: var(--bg-glass);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.icon-option.selected {
    border-color: var(--primary-color);
    background: var(--bg-glass);
    box-shadow: var(--shadow-glow);
}

.icon-preview {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    box-shadow: var(--shadow-sm);
}

.icon-option span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
}

.icon-option.selected span {
    color: var(--primary-color);
    font-weight: 600;
}

/* 点击图标的指针样式 */
.project-icon {
    cursor: pointer;
    transition: var(--transition);
}

.project-icon:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-sm);
}

/* ===== 项目筛选器样式 ===== */
.showcase-title-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex: 1;
}

.project-filter-buttons {
    display: flex;
    gap: var(--spacing-xs);
    background: var(--bg-surface);
    padding: 4px;
    border-radius: var(--radius-md);
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-btn:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.filter-btn i {
    font-size: 12px;
}

.showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.empty-starred-message {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    animation: fadeIn 0.3s ease-out;
}

.empty-starred-content {
    text-align: center;
    color: var(--text-muted);
}

.empty-starred-content i {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    color: var(--text-muted);
}

.empty-starred-content h3 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.empty-starred-content p {
    font-size: 14px;
    max-width: 300px;
    line-height: 1.5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 新的编辑器布局样式 ===== */

/* 编辑器工作区容器 */
.editor-workspace-new {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
    background: var(--bg-primary);
}

/* 顶部控制栏 */
.editor-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    min-height: 45px;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-left-expanded {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
    min-width: 0;
}

.project-title-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.project-title-section i {
    color: var(--primary-color);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.header-controls-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-left: var(--spacing-lg);
    flex-wrap: wrap;
}

.header-attachments {
    display: flex;
    align-items: center;
    max-width: 300px;
    flex: 1;
    min-height: 40px;
    min-width: 200px;
}

.attachments-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-muted);
    height: 80px;
    width: 100%;
    overflow-y: auto;
}

/* 附件项目样式 */
.attachment-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: var(--primary-color-10);
    border-radius: var(--radius-xs);
    font-size: 11px;
    color: var(--primary-color);
    border: 1px solid var(--primary-color-20);
    width: 100%;
    flex-shrink: 0;
}

.attachment-item span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.attachment-item i {
    font-size: 10px;
}

.attachment-item .remove-attachment {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0.7;
    font-size: 12px;
    padding: 2px;
}

.attachment-item .remove-attachment:hover {
    opacity: 1;
    color: var(--danger-color);
}

.no-attachments {
    color: var(--text-muted);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
}

/* 对话附件显示区域 */
.chat-attachments-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(139, 92, 246, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
}

.chat-attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: white;
    border-radius: var(--radius-xs);
    font-size: 12px;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    max-width: 200px;
}

.chat-attachment-item .file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.chat-attachment-item i:first-child {
    color: var(--primary-color);
    font-size: 14px;
}

.chat-attachment-item .remove-chat-attachment {
    cursor: pointer;
    color: var(--text-muted);
    opacity: 0.6;
    font-size: 12px;
    transition: all 0.2s;
}

.chat-attachment-item .remove-chat-attachment:hover {
    opacity: 1;
    color: var(--danger-color);
    transform: scale(1.1);
}

.attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.attachment-item i {
    color: var(--primary-color);
}

.control-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 13px;
    white-space: nowrap;
}

.control-item i {
    color: var(--primary-color);
    width: 14px;
    font-size: 12px;
}

.control-item span {
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 40px;
    font-size: 12px;
}

.control-select {
    padding: 3px 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    font-size: 12px;
    min-width: 80px;
}

.btn-outline {
    padding: 3px 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 主要布局区域 */
.editor-main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    flex: 1;
    background: var(--border-color);
    overflow: hidden;
}

/* 左侧列 - 纯聊天区域 */
.left-column.chat-only {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    height: 100%;
    overflow: hidden;
}

/* 历史文章区域 */
.history-section {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

/* 紧凑型历史文章区域 */
.history-section.compact {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    max-height: 120px;
    padding: var(--spacing-sm) var(--spacing-md);
    overflow: visible;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.history-section.compact .history-header {
    padding: 0;
    background: transparent;
    margin-bottom: var(--spacing-xs);
}

.history-section.compact .article-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.history-section.compact .article-item:hover {
    background: var(--bg-hover);
    padding: var(--spacing-xs);
    margin: 0 calc(-1 * var(--spacing-xs));
}

.history-section.compact .article-icon {
    width: 20px;
    height: 20px;
    background: var(--bg-secondary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 10px;
    flex-shrink: 0;
    margin-top: 2px;
}

.history-section.compact .article-info {
    flex: 1;
    min-width: 0;
}

.history-section.compact .article-title {
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 2px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-section.compact .article-meta {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-header i {
    color: var(--primary-color);
    margin-right: var(--spacing-xs);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-text:hover {
    background: var(--bg-hover);
}

.latest-article {
    padding: var(--spacing-sm);
}

.article-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.article-item:hover {
    background: var(--bg-hover);
}

.article-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    color: var(--primary-color);
}

.article-info {
    flex: 1;
}

.article-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.article-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* 聊天区域 */
.chat-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.chat-header {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

/* 历史按钮样式 */
.history-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.history-btn:hover {
    background: var(--bg-glass);
    color: var(--primary-color);
    border-color: var(--border-accent);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.chat-title i {
    color: var(--primary-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    margin-left: auto;
}

/* 聊天消息区域 */
.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
    background: #fafbfc;
    height: 0; /* 强制flex容器计算高度 */
    scroll-behavior: smooth;
    max-height: calc(100vh - 200px); /* 增加可用高度 */
    min-height: 200px; /* 确保最小高度 */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* 聊天区域滚动条样式 */
.chat-messages-area::-webkit-scrollbar {
    width: 6px;
}

.chat-messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages-area::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.chat-messages-area::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

.welcome-message {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.ai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.message-bubble {
    max-width: 80%;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 12px;
    position: relative;
}

.ai-message {
    background: white;
    border: none !important;
    outline: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-left: var(--spacing-xs);
}

.user-message {
    background: #95EC69;
    color: #1a1a1a;
    margin-left: auto;
    margin-right: var(--spacing-xs);
}

/* 用户消息容器 - 右对齐，微信风格 */
.user-message-container {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: var(--spacing-sm);
    padding-left: 60px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
    order: 2;
    overflow: hidden;
}

/* 对话里的用户头像图片：撑满圆形头像，与 AI 头像同样大小 */
.user-avatar .user-avatar-logo,
.user-avatar-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.user-message-bubble {
    background: #95EC69;
    color: #1a1a1a;
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
    border: none !important;
    outline: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    order: 1;
    word-wrap: break-word;
    position: relative;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.7;
}

/* 输入区域 - 微信风格 */
.chat-input-section {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-sm);
}

.input-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.tool-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
}

.input-area {
    display: flex;
    align-items: flex-end;
    gap: var(--spacing-xs);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 12px;
}

.input-area-improved {
    display: flex;
    align-items: flex-end;
    gap: var(--spacing-xs);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 12px;
    min-height: 60px;
}

.message-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-family: var(--font-primary);
    font-size: 14px;
    line-height: 1.4;
    max-height: 100px;
    min-height: 20px;
}

.message-input-improved {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-family: var(--font-primary);
    font-size: 14px;
    line-height: 1.5;
    max-height: 120px;
    min-height: 44px;
    padding: 4px 0;
}

.tool-btn-inside {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    margin-bottom: 4px;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    outline: none;
}

.tool-btn-inside:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
    transform: scale(1.05);
}

.tool-btn-inside:active {
    transform: scale(0.95);
    background: var(--primary-color-10);
    color: var(--primary-color);
}

.tool-btn-inside:focus {
    box-shadow: 0 0 0 2px var(--primary-color-20);
}

.send-button {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-button:hover {
    transform: scale(1.05);
}

.input-hint {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
}

/* 右侧列 */
/* 右侧列 - 独立预览区域 */
.right-column.preview-only {
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.canvas-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
}

.canvas-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.canvas-title i {
    color: var(--primary-color);
}

.canvas-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.canvas-content {
    flex: 1;
    padding: var(--spacing-sm);
    background: white;
    overflow-y: auto;
    border-radius: var(--radius-sm);
    margin: var(--spacing-xs);
    border: 1px solid var(--border-color);
    max-height: calc(100vh - 120px); /* 增加可用高度 */
    min-height: 300px; /* 最小高度 */
}

/* 确保预览区域内容可以滚动 */
#article-preview-content {
    overflow-y: auto !important;
    height: calc(100vh - 140px) !important;
    max-height: calc(100vh - 140px) !important;
    padding: 1rem 2em !important;
    line-height: 1.5;
    font-size: 15px;
    color: var(--text-primary);
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* 预览区域内的段落间距 */
#article-preview-content p {
    margin-bottom: 1em !important;
    margin-top: 0 !important;
}

/* 预览区域内的标题间距 */
#article-preview-content h2 {
    margin-top: 1.2em !important;
    margin-bottom: 1em !important;
}

/* 预览区域内的引用样式 */
#article-preview-content blockquote {
    margin: 1.5em 0 !important;
    padding: 0.5em 1.5em !important;
    border-left: 4px solid var(--border-color) !important;
    background: transparent !important;
    color: var(--text-secondary) !important;
}

/* 相邻的引用块合并显示 */
#article-preview-content blockquote + blockquote {
    margin-top: 0 !important;
    border-top: none !important;
    padding-top: 0 !important;
}

/* 引用内的段落不要额外间距 */
#article-preview-content blockquote p {
    margin-bottom: 0.5em !important;
    margin-top: 0 !important;
    display: block !important;
    line-height: 1.6 !important;
}

/* 引用内最后一个段落不要底部间距 */
#article-preview-content blockquote p:last-child {
    margin-bottom: 0 !important;
}

/* 引用内段落之间的间距控制 */
#article-preview-content blockquote p + p {
    margin-top: 0.5em !important;
}

#article-preview-content::-webkit-scrollbar {
    width: 6px;
}

#article-preview-content::-webkit-scrollbar-track {
    background: transparent;
}

#article-preview-content::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

#article-preview-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

.canvas-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.canvas-placeholder i {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.3;
}

.canvas-placeholder h3 {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

/* 响应式布局 */
@media (max-width: 1200px) {
    .editor-main-layout {
        grid-template-columns: 1fr 1fr;
    }
    
    .header-controls, .header-controls-left {
        gap: var(--spacing-sm);
    }
    
    .control-item span {
        font-size: 11px;
        min-width: 30px;
    }
    
    .header-attachments {
        max-width: 250px;
        min-height: 35px;
        min-width: 150px;
    }
    
    .control-select {
        min-width: 70px;
        font-size: 11px;
    }
    
    .btn-outline {
        padding: 2px 6px;
        font-size: 11px;
    }
}

@media (max-width: 900px) {
    .header-left-expanded {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
    
    .header-controls-left {
        margin-left: 0;
        gap: var(--spacing-sm);
    }
    
    .control-item span {
        display: none;
    }
    
    .header-attachments {
        max-width: 200px;
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .editor-header-bar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
        min-height: auto;
    }
    
    .header-left-expanded {
        justify-content: space-between;
        flex-wrap: nowrap;
    }
    
    .project-title-section {
        font-size: 15px;
        flex-shrink: 0;
    }
    
    .header-controls-left {
        margin-left: 0;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }
    
    .header-attachments {
        max-width: 100%;
        min-width: auto;
        order: 2;
    }
    
    .editor-main-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .left-column {
        order: 2;
        border-right: none;
        border-top: 1px solid var(--border-color);
        max-height: 300px;
    }
    
    .right-column {
        order: 1;
    }
    
    .history-section {
        display: none;
    }
}

@media (max-width: 480px) {
    .editor-workspace-new {
        height: calc(100vh - 60px);
    }
    
    .editor-header-bar {
        padding: var(--spacing-xs);
    }
    
    .project-title-section {
        font-size: 14px;
    }
    
    .header-left-expanded {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-xs);
    }
    
    .header-controls-left {
        justify-content: space-between;
        width: 100%;
    }
    
    .control-item {
        font-size: 11px;
    }
    
    .control-select {
        min-width: 60px;
        font-size: 10px;
        padding: 2px 4px;
    }
    
    .btn-outline {
        padding: 2px 6px;
        font-size: 10px;
    }
}

/* ===== 重新设计的项目卡片样式 (Claude风格) ===== */
/* 覆盖原有的项目卡片样式 */
/* 项目卡片网格样式已在上方定义，此处删除重复定义 */

.project-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    position: relative !important;
    height: 120px !important; /* 固定高度，确保一致性 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

.project-card:hover {
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-1px) !important;
}

/* 统一的卡片内容容器 */
.card-content-unified {
    padding: 20px !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 12px !important;
    background: none !important;
}

/* 头部行布局 */
.card-header-row {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
}

/* 重新设计的项目图标：浅色描边风，不再用纯黑实心块 */
.project-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 15px !important;
    color: var(--text-secondary) !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
}

.project-icon:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* 项目标题区域 */
.project-title-section {
    flex: 1 !important;
    min-width: 0 !important; /* 防止flex子元素溢出 */
}

.project-name {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    margin: 0 0 4px 0 !important;
    line-height: 1.3 !important;
}

.project-description {
    font-size: 13px !important;
    color: var(--text-secondary) !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* 项目操作按钮 */
.card-actions-row {
    display: flex !important;
    justify-content: flex-end !important;
}

.project-actions {
    display: flex !important;
    gap: 4px !important;
    opacity: 1 !important;
    transition: opacity 0.2s ease !important;
}

.project-card:hover .project-actions {
    opacity: 1 !important;
}

.action-btn {
    background: none !important;
    border: none !important;
    padding: 6px !important;
    border-radius: 6px !important;
    color: var(--text-muted) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 12px !important;
}

.action-btn:hover {
    background: var(--bg-surface) !important;
    color: var(--text-primary) !important;
}

.action-btn.star-btn:hover {
    background: rgba(255, 215, 0, 0.1) !important;
    color: #ffd700 !important;
}

.action-btn.delete-btn:hover {
    background: rgba(239, 83, 80, 0.1) !important;
    color: var(--danger-color) !important;
}

/* 项目元数据 */
.project-meta {
    display: flex !important;
    gap: 16px !important;
    margin-top: auto !important;
}

.meta-item {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 12px !important;
    color: var(--text-muted) !important;
}

.meta-item i {
    font-size: 11px !important;
}

/* 确保新布局中的文本正常显示 */
.card-content-new .project-description-area {
    display: flex !important;
    align-items: flex-start !important;
    min-height: 36px !important;
    max-height: 60px !important;
    margin: 8px 0 !important;
    overflow: hidden !important;
    flex: 1 !important;
}

.card-content-new .project-description-text {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 13px !important;
    color: var(--text-secondary) !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    font-weight: 400 !important;
}

.card-content-new .project-meta {
    display: flex !important;
    gap: 12px !important;
    font-size: 12px !important;
    color: var(--text-muted) !important;
    margin-top: auto !important;
    padding-top: 8px !important;
    border-top: 1px solid var(--border-color) !important;
    opacity: 1 !important;
    visibility: visible !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 1 !important;
}

.card-content-new .project-meta .meta-item {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.card-content-new .project-meta .meta-item i {
    font-size: 11px !important;
    color: var(--primary-color) !important;
}

/* 星标项目样式 */
.project-card[data-starred="true"] {
    border-color: #ffd700 !important;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.03) 0%, var(--bg-secondary) 100%) !important;
}

.project-card[data-starred="true"] .star-btn {
    color: #ffd700 !important;
    opacity: 1 !important;
}

.project-card[data-starred="true"]::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 2px !important;
    background: linear-gradient(90deg, #ffd700 0%, transparent 100%) !important;
}

/* 新建项目卡片 */
.project-card.create-new {
    border: 1px dashed var(--border-color) !important;
    background: var(--bg-surface) !important;
    height: 120px !important;
}

/* API密钥配置对话框 */
.api-key-modal-content {
    max-width: 500px;
    width: 90%;
}

.api-key-help {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
}

.api-key-help p {
    margin: 8px 0;
    color: var(--text-secondary);
}

.api-key-help ul {
    margin: 8px 0;
    padding-left: 20px;
}

.api-key-help li {
    margin: 4px 0;
    color: var(--text-secondary);
}

.api-key-help a {
    color: var(--primary-color);
    text-decoration: none;
}

.api-key-help a:hover {
    text-decoration: underline;
}

.form-group {
    margin: 12px 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-main);
    color: var(--text-primary);
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color-10);
}

/* 风格设计工作室样式 */

/* 自定义风格选项卡 */
.custom-style-tab {
    border: 2px dashed var(--border-color) !important;
    position: relative;
}

.custom-style-tab:hover {
    border-color: var(--primary-color) !important;
    background: var(--primary-color-05) !important;
}

.custom-style-controls {
    margin-top: 16px;
}

.custom-styles-list {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.custom-style-item {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    cursor: pointer;
    transition: all var(--transition);
}

.custom-style-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.custom-style-item.active {
    border-color: var(--primary-color);
    background: var(--primary-color-05);
}

/* 编辑器工作区 */
.editor-workspace {
    margin-top: var(--spacing-sm);
}

.editor-columns {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: var(--spacing-md);
    min-height: 700px;
}

.editor-column {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.editor-header,
.preview-header {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.editor-header h3,
.preview-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-tools,
.preview-tools {
    display: flex;
    gap: 8px;
}

/* 顶部三个「移动端」快捷入口（历史文章 / 上传 / 对话·预览）在桌面端隐藏，
   桌面端左右两栏已同时展示对话与预览，且附件框里已有上传，这些都是多余的 */
@media (min-width: 769px) {
    #mobile-history-entry,
    .mobile-history-entry,
    #mobile-upload-entry,
    .mobile-upload-entry,
    #mobile-view-toggle,
    .mobile-view-toggle {
        display: none !important;
    }
}

/* 左侧格式工具栏头部：标题独占一行，按钮在下一行横排，避免在窄面板里挤成竖排 */
#style-editor-column .editor-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px;
}
#style-editor-column .editor-header h3 {
    font-size: 14px;
    white-space: nowrap;
}
#style-editor-column .editor-tools {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
}
#style-editor-column .editor-tools .btn {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    font-size: 12px;
    white-space: nowrap;
    justify-content: center;
}
#style-editor-column .editor-tools .btn span {
    white-space: nowrap;
}

#style-editor-column {
    position: sticky;
    top: 8px;
    align-self: start;
    height: calc(100vh - 16px);
    max-height: calc(100vh - 16px);
}

#style-editor-column .editor-content {
    overflow-y: auto;
    padding: 4px 12px 10px;
}

.editor-content,
.preview-content {
    flex: 1;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
}

.content-editor {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    background: var(--bg-main);
    color: var(--text-primary);
    resize: none;
    outline: none;
}

.content-editor:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color-10);
}

.styled-preview {
    flex: 1;
    padding: var(--spacing-lg);
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow-y: auto;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.preview-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.preview-placeholder h4 {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
}

.preview-placeholder p {
    margin: 0;
    font-size: 14px;
}

/* ===== 风格预览样式（与微信导出 getStyleMap 完全一致，无伪元素装饰） ===== */
.styled-preview h1, .styled-preview h2, .styled-preview h3, .styled-preview h4,
.styled-preview p, .styled-preview li, .styled-preview blockquote {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}
.styled-preview ul, .styled-preview ol { margin: 16px 0 16px 22px; padding: 0; }
.styled-preview img { max-width: 100%; height: auto; display: block; margin: 18px auto; border-radius: 6px; }
.styled-preview hr { border: none; border-top: 1px solid #e5e7eb; margin: 24px 0; }
.styled-preview code { font-family: "Courier New", monospace; }

/* 商务专业风格 */
.styled-preview.business-style {
    background: #ffffff;
    color: #24292e;
    padding: 24px;
    font-size: 16px;
    line-height: 1.75;
    font-family: 'SF Pro Display', 'PingFang SC', 'Helvetica Neue', sans-serif;
}
.styled-preview.business-style h1 { font-size: 24px; color: #1e3a8a; font-weight: 600; line-height: 1.25; margin: 16px 0; letter-spacing: 0; text-align: left; padding-bottom: 8px; border-bottom: 1px solid #e5e7eb; }
.styled-preview.business-style h2 { font-size: 18px; color: #1e3a8a; font-weight: 500; line-height: 1.25; margin: 16px 0; padding: 8px 8px 8px 12px; border-left: 3px solid #3b82f6; text-align: left; }
.styled-preview.business-style h3 { font-size: 16px; color: #1e3a8a; font-weight: 600; line-height: 1.25; margin: 16px 0 6px; }
.styled-preview.business-style h4 { font-size: 15px; color: #1e3a8a; font-weight: 600; margin: 14px 0 6px; line-height: 1.25; }
.styled-preview.business-style p { font-size: 15px; color: #334155; line-height: 1.75; margin: 12px 0; }
.styled-preview.business-style blockquote { background: #f8fafc; border-left: 4px solid #3b82f6; color: #475569; padding: 12px 16px; margin: 16px 0; font-style: italic; }
.styled-preview.business-style strong { color: #1e3a8a; font-weight: 600; }
.styled-preview.business-style em { color: #3b82f6; font-style: italic; }
.styled-preview.business-style code { background: #f1f5f9; color: #1e3a8a; padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: "Courier New", monospace; }
.styled-preview.business-style pre { background: #1e293b; color: #e5e7eb; padding: 14px 16px; border-radius: 8px; overflow-x: auto; margin: 16px 0; font-size: 14px; line-height: 1.6; }
.styled-preview.business-style ul { margin: 12px 0 12px 24px; padding: 0; list-style-type: disc; }
.styled-preview.business-style ol { margin: 12px 0 12px 24px; padding: 0; list-style-type: decimal; }
.styled-preview.business-style li { font-size: 15px; color: #334155; line-height: 1.75; margin: 6px 0; }
.styled-preview.business-style img { max-width: 100%; height: auto; margin: 16px auto; border-radius: 6px; display: block; }
.styled-preview.business-style a { color: #3b82f6; text-decoration: underline; }
.styled-preview.business-style hr { height: 1px; border: none; background: #e5e7eb; margin: 20px 0; }
.styled-preview.business-style table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; line-height: 1.6; }
.styled-preview.business-style th { border: 1px solid #e2e8f0; background: #f8fafc; color: #1e3a8a; font-weight: 600; padding: 8px 10px; text-align: left; }
.styled-preview.business-style td { border: 1px solid #e8edf3; color: #334155; padding: 8px 10px; vertical-align: top; }

/* 生活美学风格 */
.styled-preview.lifestyle-style {
    background: #ffffff;
    color: #24292e;
    padding: 24px;
    font-size: 16px;
    line-height: 1.75;
    font-family: 'Helvetica Neue', Helvetica, Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}
.styled-preview.lifestyle-style h1 { font-size: 24px; color: #111111; font-weight: 600; line-height: 1.4; margin: 0 0 24px; padding-bottom: 10px; border-bottom: 1px solid #eee; text-align: left; }
.styled-preview.lifestyle-style h2 { display: table; padding: 0.4em 1.2em; margin: 2.4em auto 1.2em; font-size: 1.2em; font-weight: 600; text-align: center; color: #fff; background: #ff6a00; border-radius: 30px; letter-spacing: 0.02em; border: 2px solid rgba(255, 255, 255, 0.3); }
.styled-preview.lifestyle-style h3 { font-size: 1.15em; font-weight: 600; color: #333; margin: 2em 0 0.8em; padding-left: 12px; border-left: 3px solid #ff8c00; line-height: 1.5; }
.styled-preview.lifestyle-style h4 { font-size: 16px; font-weight: 600; color: #333; margin: 1.5em 0 0.6em; }
.styled-preview.lifestyle-style p { font-size: 16px; line-height: 2; color: #555555; margin: 16px 0; }
.styled-preview.lifestyle-style blockquote { font-style: italic; margin: 24px 0; padding: 15px 20px 15px 25px; background: #fffaf5; border-left: 4px solid #ff6a00; border-radius: 0 8px 8px 0; color: #444; }
.styled-preview.lifestyle-style strong { font-weight: 600; color: #ff6a00; }
.styled-preview.lifestyle-style em { font-style: italic; }
.styled-preview.lifestyle-style code { background: #fff3e8; color: #d45a00; padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: "Courier New", monospace; }
.styled-preview.lifestyle-style pre { background: #44372c; color: #f5efe9; padding: 14px 16px; border-radius: 8px; overflow-x: auto; margin: 16px 0; font-size: 14px; line-height: 1.6; }
.styled-preview.lifestyle-style ul { margin: 16px 0 16px 24px; padding: 0; list-style-type: disc; }
.styled-preview.lifestyle-style ol { margin: 16px 0 16px 24px; padding: 0; list-style-type: decimal; }
.styled-preview.lifestyle-style li { font-size: 16px; color: #555555; line-height: 2; margin: 6px 0; }
.styled-preview.lifestyle-style img { max-width: 100%; height: auto; margin: 20px auto; border-radius: 8px; display: block; }
.styled-preview.lifestyle-style a { color: #ff6a00; text-decoration: underline; }
.styled-preview.lifestyle-style hr { margin: 24px 0; border: none; height: 1px; background-color: #eaecef; }
.styled-preview.lifestyle-style table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 15px; line-height: 1.7; }
.styled-preview.lifestyle-style th { border: 1px solid #f0d9c0; background: #fffaf5; color: #ff6a00; font-weight: 600; padding: 8px 10px; text-align: left; }
.styled-preview.lifestyle-style td { border: 1px solid #f3e6d8; color: #555; padding: 8px 10px; vertical-align: top; }

/* 科技前沿风格 */
.styled-preview.tech-style {
    background: #ffffff;
    color: #1c1f23;
    padding: 24px;
    line-height: 1.75;
    font-family: "PingFang SC", "SF Pro Text", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
    word-wrap: break-word;
}
.styled-preview.tech-style h1 {
    position: relative;
    color: #1c1f23;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
    margin: 0 0 22px;
    padding: 0 0 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.styled-preview.tech-style h1::after {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin: 10px auto -2px;
    border-radius: 4px;
    background: linear-gradient(90deg, #0066ff, #fa2c19);
}
.styled-preview.tech-style h2 {
    display: table;
    color: #ffffff;
    max-width: calc(100% - 32px);
    box-sizing: border-box;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
    letter-spacing: 0.02em;
    margin: 3em auto 1.5em;
    padding: 8px 22px;
    border-radius: 8px 24px 8px 24px;
    background: linear-gradient(135deg, #1677ff, #05d4cd);
    white-space: normal;
    word-break: break-word;
}
.styled-preview.tech-style h3 {
    color: #1677ff;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.6;
    margin: 2.2em 0 1em;
    padding: 0.5em 1em 0.5em 12px;
    border: 1px solid rgba(22, 119, 255, 0.1);
    border-left: 4px solid #1677ff;
    background: rgba(22, 119, 255, 0.05);
    border-radius: 6px;
}
.styled-preview.tech-style h4 { color: #1c1f23; font-size: 16px; font-weight: 600; margin: 18px 0 10px; line-height: 1.6; }
.styled-preview.tech-style p { margin: 16px 0; padding: 0 2px; color: #1c1f23; font-size: 16px; line-height: 2; letter-spacing: 0; }
.styled-preview.tech-style blockquote { position: relative; margin: 20px 0; padding: 12px 20px; background: rgba(0, 102, 255, 0.04); border-left: 4px solid #0066ff; border-radius: 0 8px 8px 0; color: #4e5969; font-style: italic; line-height: 1.85; }
.styled-preview.tech-style blockquote p { margin: 0; color: #4e5969; }
.styled-preview.tech-style strong { color: #1c1f23; font-weight: 600; padding: 0 2px; background: rgba(0, 102, 255, 0.1); border-radius: 2px; }
.styled-preview.tech-style em { font-style: italic; color: #4e5969; }
.styled-preview.tech-style code { background: rgba(0, 102, 255, 0.08); color: #0066ff; padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace; }
.styled-preview.tech-style pre { background: #1c1f23; color: #f8fafc; padding: 14px 16px; border-radius: 8px; overflow-x: auto; margin: 18px 0; font-size: 14px; line-height: 1.6; }
.styled-preview.tech-style ul, .styled-preview.tech-style ol { margin: 16px 0; padding: 12px; border-radius: 8px 16px 8px 16px; background: rgba(0, 102, 255, 0.02); list-style: none; }
.styled-preview.tech-style li { position: relative; margin: 0 0 8px; padding-left: 24px; color: #4e5969; font-size: 16px; line-height: 1.75; }
.styled-preview.tech-style li:last-child { margin-bottom: 0; }
.styled-preview.tech-style ul li::before { content: ""; position: absolute; left: 1px; top: 0.72em; width: 8px; height: 8px; background: #fa2c19; border-radius: 0 2px 2px 2px; transform: rotate(45deg); }
.styled-preview.tech-style ol { counter-reset: tech-counter; }
.styled-preview.tech-style ol li { counter-increment: tech-counter; }
.styled-preview.tech-style ol li::before { content: counter(tech-counter); position: absolute; left: 0; top: 0.22em; width: 18px; height: 18px; border-radius: 50%; background: #1677ff; color: #ffffff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.styled-preview.tech-style img { max-width: 100%; height: auto; margin: 18px auto; border-radius: 8px; display: block; }
.styled-preview.tech-style a { color: #0066ff; text-decoration: underline; }
.styled-preview.tech-style hr { margin: 24px 0; border: 0; height: 1px; background-color: #eaecef; }
.styled-preview.tech-style table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 16px 0; overflow: hidden; border: 1px solid rgba(0, 102, 255, 0.1); border-radius: 8px; font-size: 14px; line-height: 1.5; }
.styled-preview.tech-style th { white-space: nowrap; background: rgba(0, 102, 255, 0.06); color: #1c1f23; font-weight: 600; padding: 10px 12px; text-align: left; border: 0; border-bottom: 2px solid rgba(0, 102, 255, 0.1); }
.styled-preview.tech-style td { color: #4e5969; padding: 10px 12px; vertical-align: top; border: 0; border-bottom: 1px solid #ebedf0; }
.styled-preview.tech-style tr:last-child td { border-bottom: 0; }

/* 知识分享风格 — 仿"深圳卫视深度"蓝色科普（参考：夏天喝什么最解渴） */
.styled-preview.knowledge-style {
    background: #ffffff;
    color: #3e3e3e;
    padding: 24px;
    line-height: 2;
}
/* H2: 蓝色边框方框居中（仿文中「太长不看版」蓝框） */
.styled-preview.knowledge-style h1 { color: #1a1a1a; font-size: 22px; font-weight: 700; text-align: center; margin: 20px 0 24px; padding-bottom: 12px; border-bottom: 2px solid #244bf7; line-height: 1.4; }
.styled-preview.knowledge-style h2 { display: table; position: relative; padding: 5px 20px; margin: 22px auto 14px; font-size: 18px; font-weight: 700; color: #244bf7; border: 1.5px solid #244bf7; border-radius: 3px; text-align: center; line-height: 1.5; letter-spacing: 1px; }
.styled-preview.knowledge-style h2::after { content: "✎"; position: absolute; top: -10px; right: -12px; font-size: 11px; color: #ffffff; background: #244bf7; width: 20px; height: 20px; border-radius: 50%; line-height: 20px; text-align: center; font-weight: 400; }
/* H3: 蓝色左竖条（仿文中子标题左bar样式） */
.styled-preview.knowledge-style h3 { color: #244bf7; font-size: 17px; font-weight: 700; margin: 22px 0 10px; padding-left: 12px; border-left: 4px solid #244bf7; line-height: 2; }
.styled-preview.knowledge-style h4 { color: #244bf7; font-size: 16px; font-weight: 600; margin: 16px 0 8px; line-height: 1.6; }
.styled-preview.knowledge-style p { margin: 16px 0; color: #3e3e3e; font-size: 16px; line-height: 2; }
/* blockquote: 灰底信息框（仿文中灰色科普框） */
.styled-preview.knowledge-style blockquote { background: #f4f4f4; border: none; padding: 24px 18px 20px; margin: 20px 0; color: #3e3e3e; font-size: 15px; line-height: 1.9; border-radius: 4px; }
.styled-preview.knowledge-style strong { color: #244bf7; font-weight: 700; }
.styled-preview.knowledge-style em { font-style: italic; color: #4a6cf7; }
.styled-preview.knowledge-style code { background: #eef2ff; color: #244bf7; padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: "Courier New", monospace; }
.styled-preview.knowledge-style pre { background: #1a1a3e; color: #e0e7ff; padding: 14px 16px; border-radius: 8px; overflow-x: auto; margin: 18px 0; font-size: 14px; line-height: 1.6; }
.styled-preview.knowledge-style ul { margin: 16px 0 16px 22px; padding: 0; list-style-type: disc; }
.styled-preview.knowledge-style ol { margin: 16px 0 16px 22px; padding: 0; list-style-type: decimal; }
.styled-preview.knowledge-style li { margin: 9px 0; color: #3e3e3e; font-size: 16px; line-height: 2; }
.styled-preview.knowledge-style img { max-width: 100%; height: auto; margin: 18px auto; display: block; }
.styled-preview.knowledge-style a { color: #244bf7; text-decoration: underline; }
.styled-preview.knowledge-style hr { border: none; border-top: 1px solid #c7d2fe; margin: 28px 0; }
.styled-preview.knowledge-style table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; line-height: 1.6; }
.styled-preview.knowledge-style th { border: 1px solid #a5b4fc; background: #eef2ff; color: #244bf7; font-weight: 700; padding: 8px 10px; text-align: left; }
.styled-preview.knowledge-style td { border: 1px solid #e2e8f0; color: #3e3e3e; padding: 8px 10px; vertical-align: top; }

@keyframes literaryBreath {
    0%, 100% { opacity: 0.85; transform: rotate(0deg) scale(0.95); }
    45% { opacity: 1; transform: rotate(18deg) scale(1.18); }
    70% { opacity: 0.75; transform: rotate(-8deg) scale(1.02); }
}
/* 文艺情感风格 — 仿"果壳"浅蓝文学（参考：你的情绪，可能是大脑"现编"的） */
.styled-preview.literary-style {
    background: #ffffff;
    color: #3e3e3e;
    padding: 24px;
    line-height: 1.75;
}
.styled-preview.literary-style h1 { color: #0f0f0f; font-size: 22px; font-weight: 700; text-align: center; margin: 24px 0 20px; padding-bottom: 10px; border-bottom: 1px solid #d1d5db; letter-spacing: 2px; line-height: 1.5; }
/* H2: 深色极简居中（仿文中章节标题） */
.styled-preview.literary-style h2 { color: #252525; font-size: 19px; font-weight: 600; text-align: center; margin: 32px 0 18px; letter-spacing: 2px; line-height: 1.6; }
.styled-preview.literary-style h2::before,
.styled-preview.literary-style h2::after { content: "✺"; display: inline-block; color: #2bb3f1; font-size: 17px; line-height: 1; animation: literaryBreath 2.2s ease-in-out infinite; vertical-align: -0.05em; transform-origin: center; }
.styled-preview.literary-style h2::before { margin-right: 12px; }
.styled-preview.literary-style h2::after { margin-left: 12px; animation-delay: 0.35s; }
/* H3: 浅蓝色文字（仿文中小节标题，#2bb3f1） */
.styled-preview.literary-style h3 { color: #2bb3f1; font-size: 17px; font-weight: 600; text-align: justify; margin: 26px 0 14px; line-height: 1.7; }
.styled-preview.literary-style h4 { color: #2bb3f1; font-size: 16px; font-weight: 600; margin: 20px 0 12px; line-height: 1.7; }
.styled-preview.literary-style p { margin: 16px 0; color: #3e3e3e; font-size: 16px; line-height: 1.75; letter-spacing: 1px; }
/* blockquote: 浅蓝左border + 浅蓝底（仿文中旁注框） */
.styled-preview.literary-style blockquote { background: #f1f6ff; border-left: 3px solid #8fb6f9; border-radius: 0 6px 6px 0; padding: 15px 18px; margin: 22px 0; color: #3f3f3f; font-size: 15px; line-height: 1.8; }
/* strong: 浅蓝色加粗（仿文中关键词高亮） */
.styled-preview.literary-style strong { color: #2bb3f1; font-weight: bold; letter-spacing: 1px; }
.styled-preview.literary-style em { font-style: italic; color: #5a5a5a; }
.styled-preview.literary-style code { background: #f1f6ff; color: #2bb3f1; padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: "Courier New", monospace; }
.styled-preview.literary-style pre { background: #252525; color: #e8e8e8; padding: 14px 16px; border-radius: 8px; overflow-x: auto; margin: 18px 0; font-size: 14px; line-height: 1.6; }
.styled-preview.literary-style ul { margin: 16px 0 16px 22px; padding: 0; list-style-type: disc; }
.styled-preview.literary-style ol { margin: 16px 0 16px 22px; padding: 0; list-style-type: decimal; }
.styled-preview.literary-style li { margin: 10px 0; color: #3e3e3e; font-size: 16px; line-height: 1.75; letter-spacing: 1px; }
.styled-preview.literary-style img { max-width: 100%; height: auto; margin: 22px auto; display: block; border: 1px solid #000; }
.styled-preview.literary-style a { color: #2bb3f1; text-decoration: underline; }
.styled-preview.literary-style hr { border: none; border-top: 1px solid #d1d5db; margin: 32px 0; }
.styled-preview.literary-style table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 15px; line-height: 1.8; }
.styled-preview.literary-style th { border: 1px solid #c8d9f5; background: #f1f6ff; color: #252525; font-weight: 600; padding: 8px 10px; text-align: left; }
.styled-preview.literary-style td { border: 1px solid #e2e8f0; color: #3e3e3e; padding: 8px 10px; vertical-align: top; }

/* 实用指南风格 — 仿"三联生活周刊"杂志报道（参考：当爸妈沉迷手机不可自拔） */
.styled-preview.guide-style {
    background: #ffffff;
    color: rgba(0,0,0,0.9);
    padding: 24px;
    line-height: 1.75;
}
.styled-preview.guide-style h1 { color: rgba(0,0,0,0.9); font-size: 22px; font-weight: 700; text-align: center; margin: 20px 0 24px; line-height: 1.5; letter-spacing: 0.5px; }
/* H2: 黄+深橙双侧10px竖线夹住居中文字（完全还原原文设计） */
.styled-preview.guide-style h2 { display: table; margin: 30px auto 18px; padding: 6px 14px; border-left: 10px solid rgb(141,71,34); border-right: 10px solid rgb(141,71,34); font-size: 17px; font-weight: 700; color: rgba(0,0,0,0.9); text-align: center; line-height: 1.75; letter-spacing: 0.578px; }
.styled-preview.guide-style h3 { color: #1a1a1a; font-size: 16px; font-weight: 600; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid #f4dc32; line-height: 1.5; }
.styled-preview.guide-style h4 { color: #222; font-size: 15px; font-weight: 600; margin: 18px 0 10px; line-height: 1.6; }
.styled-preview.guide-style p { margin: 16px 0; color: rgba(0,0,0,0.9); font-size: 16px; line-height: 1.75; letter-spacing: 0.578px; }
/* blockquote: 斜体灰色引言（仿文中pull quote风格） */
.styled-preview.guide-style blockquote { font-style: italic; color: rgb(136,136,136); font-size: 15px; line-height: 1.75; margin: 18px 16px; padding: 0; border: none; background: none; }
.styled-preview.guide-style strong { font-weight: bold; color: rgba(0,0,0,0.9); }
.styled-preview.guide-style em { font-style: italic; color: #555; }
.styled-preview.guide-style code { background: #f5f5f5; color: #333; padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: "Courier New", monospace; }
.styled-preview.guide-style pre { background: #222; color: #f5f5f5; padding: 14px 16px; border-radius: 4px; overflow-x: auto; margin: 18px 0; font-size: 14px; line-height: 1.6; }
.styled-preview.guide-style ul { margin: 16px 0 16px 22px; padding: 0; list-style-type: disc; }
.styled-preview.guide-style ol { margin: 16px 0 16px 22px; padding: 0; list-style-type: decimal; }
.styled-preview.guide-style li { margin: 9px 0; color: rgba(0,0,0,0.9); font-size: 16px; line-height: 1.75; }
.styled-preview.guide-style img { max-width: 100%; height: auto; margin: 18px auto; display: block; }
.styled-preview.guide-style a { color: #222; text-decoration: underline; }
.styled-preview.guide-style hr { border: none; border-top: 1px solid #e0e0e0; margin: 28px 0; }
.styled-preview.guide-style table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; line-height: 1.75; }
.styled-preview.guide-style th { border: 1px solid #ddd; background: #f4dc32; color: rgba(0,0,0,0.9); font-weight: 700; padding: 8px 10px; text-align: left; }
.styled-preview.guide-style td { border: 1px solid #e8e8e8; color: rgba(0,0,0,0.9); padding: 8px 10px; vertical-align: top; }

/* 凤凰WEEKLY风格 — 钢蓝色（参考：跳舞机器人剃发为僧 · 凤凰WEEKLY） */
.styled-preview.phoenix-style { background: #ffffff; color: rgb(62,62,62); padding: 24px; line-height: 2; }
.styled-preview.phoenix-style h1 { color: #1a1a1a; font-size: 22px; font-weight: 700; text-align: center; margin: 20px 0 24px; padding-bottom: 12px; border-bottom: 2px solid rgb(72,106,183); line-height: 1.4; }
.styled-preview.phoenix-style h2 { display: table; margin: 20px auto 20px; padding: 4px 20px; background-color: rgb(220,234,244); color: rgb(72,106,183); font-size: 20px; font-weight: 700; text-align: center; letter-spacing: 1px; line-height: 1.5; box-shadow: 5px 5px 0 rgb(72,106,183); }
.styled-preview.phoenix-style h3 { color: rgb(72,106,183); font-size: 17px; font-weight: 600; padding: 6px 0 6px 14px; border-left: 4px solid rgb(72,106,183); margin: 20px 0 10px; line-height: 1.6; }
.styled-preview.phoenix-style h3::before { content: "◆ "; font-size: 9px; vertical-align: middle; color: rgb(72,106,183); }
.styled-preview.phoenix-style h4 { color: rgb(72,106,183); font-size: 16px; font-weight: 600; margin: 16px 0 8px; }
.styled-preview.phoenix-style p { margin: 14px 0; color: rgb(62,62,62); font-size: 16px; line-height: 2; letter-spacing: 0.544px; }
.styled-preview.phoenix-style blockquote { background: rgb(220,234,244); border: none; padding: 16px 18px; margin: 20px 0; color: rgb(72,106,183); font-size: 15px; line-height: 1.9; border-radius: 4px; }
.styled-preview.phoenix-style strong { color: rgb(72,106,183); font-weight: bold; }
.styled-preview.phoenix-style em { font-style: italic; color: rgb(96,105,223); }
.styled-preview.phoenix-style code { background: rgb(220,234,244); color: rgb(72,106,183); padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: "Courier New", monospace; }
.styled-preview.phoenix-style pre { background: #1a2a5a; color: #e0e7ff; padding: 14px 16px; border-radius: 8px; overflow-x: auto; margin: 18px 0; font-size: 14px; line-height: 1.6; }
.styled-preview.phoenix-style ul { margin: 14px 0 14px 24px; padding: 0; list-style-type: disc; }
.styled-preview.phoenix-style ol { margin: 14px 0 14px 24px; padding: 0; list-style-type: decimal; }
.styled-preview.phoenix-style li { margin: 8px 0; color: rgb(62,62,62); font-size: 16px; line-height: 2; }
.styled-preview.phoenix-style img { max-width: 100%; height: auto; margin: 18px auto; display: block; }
.styled-preview.phoenix-style a { color: rgb(72,106,183); text-decoration: underline; }
.styled-preview.phoenix-style hr { border: none; border-top: 1px solid rgb(220,234,244); margin: 24px 0; }
.styled-preview.phoenix-style table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; line-height: 1.6; }
.styled-preview.phoenix-style th { border: 1px solid rgb(220,234,244); background: rgb(220,234,244); color: rgb(72,106,183); font-weight: 700; padding: 8px 10px; text-align: left; }
.styled-preview.phoenix-style td { border: 1px solid #e2e8f0; color: rgb(62,62,62); padding: 8px 10px; vertical-align: top; }

/* 文旅跨界风格 — 复古暖棕（参考：这可能是今年最横的文旅跨界） */
.styled-preview.travel-style { background: #ffffff; color: rgb(62,62,62); padding: 24px; line-height: 2; }
.styled-preview.travel-style h1 { color: rgb(109,40,11); font-size: 22px; font-weight: 600; text-align: center; margin: 20px 0 24px; letter-spacing: 2px; line-height: 1.5; }
.styled-preview.travel-style h2 { display: table; margin: 24px auto 14px; color: rgb(109,40,11); font-size: 20px; font-weight: 500; text-align: center; letter-spacing: 1px; line-height: 2; }
.styled-preview.travel-style h2::before { content: "✦ "; color: rgb(249,110,87); font-size: 13px; }
.styled-preview.travel-style h2::after { content: " ✦"; color: rgb(249,110,87); font-size: 13px; }
.styled-preview.travel-style h3 { display: inline-block; padding: 4px 14px; color: rgb(249,110,87); font-size: 15px; font-weight: 500; background: rgba(249,110,87,0.1); border-radius: 14px; margin: 20px 0 10px; }
.styled-preview.travel-style h4 { color: rgb(155,97,11); font-size: 16px; font-weight: 600; margin: 16px 0 8px; }
.styled-preview.travel-style p { margin: 14px 0; color: rgb(62,62,62); font-size: 16px; line-height: 2; letter-spacing: 1px; }
.styled-preview.travel-style blockquote { background: rgb(239,239,239); border: 1px solid rgba(0,0,0,0.04); padding: 20px; margin: 20px 0; color: rgb(109,40,11); font-size: 15px; line-height: 1.9; }
.styled-preview.travel-style strong { color: rgb(249,110,87); font-weight: bold; }
.styled-preview.travel-style em { font-style: italic; color: rgb(155,97,11); }
.styled-preview.travel-style code { background: rgba(249,110,87,0.1); color: rgb(155,97,11); padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: "Courier New", monospace; }
.styled-preview.travel-style pre { background: #2a1a0a; color: #f5e8d0; padding: 14px 16px; border-radius: 8px; overflow-x: auto; margin: 18px 0; font-size: 14px; line-height: 1.6; }
.styled-preview.travel-style ul { margin: 14px 0 14px 24px; padding: 0; list-style-type: disc; }
.styled-preview.travel-style ol { margin: 14px 0 14px 24px; padding: 0; list-style-type: decimal; }
.styled-preview.travel-style li { margin: 8px 0; color: rgb(62,62,62); font-size: 16px; line-height: 2; }
.styled-preview.travel-style img { max-width: 100%; height: auto; margin: 20px auto; display: block; }
.styled-preview.travel-style a { color: rgb(155,97,11); text-decoration: underline; }
.styled-preview.travel-style hr { border: none; border-top: 1px dashed rgb(155,97,11); margin: 26px 0; opacity: 0.5; }
.styled-preview.travel-style table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; line-height: 1.6; }
.styled-preview.travel-style th { border: 1px solid rgb(239,239,239); background: rgba(155,97,11,0.1); color: rgb(109,40,11); font-weight: 600; padding: 8px 10px; text-align: left; }
.styled-preview.travel-style td { border: 1px solid rgb(239,239,239); color: rgb(62,62,62); padding: 8px 10px; vertical-align: top; }

/* 科技评论风格 — 智源青绿（参考：AI春晚智源研究院世界模型） */
.styled-preview.review-style { background: #ffffff; color: rgb(62,62,62); padding: 24px; line-height: 1.8; }
.styled-preview.review-style h1 { color: rgb(51,51,51); font-size: 22px; font-weight: 700; text-align: center; margin: 20px 0 24px; line-height: 1.4; letter-spacing: 1px; }
.styled-preview.review-style h2 { color: rgb(34,34,34); font-size: 20px; font-weight: 700; padding: 6px 0 6px 15px; border-left: 6px solid rgb(0,153,127); margin: 28px 0 16px; letter-spacing: 1px; line-height: 1.5; }
.styled-preview.review-style h3 { color: rgb(0,153,127); font-size: 17px; font-weight: 600; margin: 20px 0 12px; letter-spacing: 1px; line-height: 1.7; }
.styled-preview.review-style h3::before { content: "⬡ "; font-size: 11px; color: rgb(0,153,127); }
.styled-preview.review-style h4 { color: rgb(0,120,100); font-size: 16px; font-weight: 600; margin: 16px 0 8px; }
.styled-preview.review-style p { margin: 14px 0; color: rgb(62,62,62); font-size: 16px; line-height: 1.8; letter-spacing: 0.5px; }
.styled-preview.review-style blockquote { background: rgba(0,153,127,0.06); border-left: 4px solid rgb(0,153,127); padding: 14px 18px; margin: 22px 0; color: rgb(51,51,51); font-size: 15px; line-height: 1.85; }
.styled-preview.review-style strong { color: rgb(0,153,127); font-weight: bold; }
.styled-preview.review-style em { font-style: italic; color: rgb(178,178,178); }
.styled-preview.review-style code { background: rgba(0,153,127,0.1); color: rgb(0,120,100); padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: "Courier New", monospace; }
.styled-preview.review-style pre { background: #1a2a28; color: #b0e8e0; padding: 14px 16px; border-radius: 8px; overflow-x: auto; margin: 18px 0; font-size: 14px; line-height: 1.6; }
.styled-preview.review-style ul { margin: 14px 0 14px 24px; padding: 0; list-style-type: disc; }
.styled-preview.review-style ol { margin: 14px 0 14px 24px; padding: 0; list-style-type: decimal; }
.styled-preview.review-style li { margin: 8px 0; color: rgb(62,62,62); font-size: 16px; line-height: 1.8; }
.styled-preview.review-style img { max-width: 100%; height: auto; margin: 20px auto; display: block; }
.styled-preview.review-style a { color: rgb(0,153,127); text-decoration: underline; }
.styled-preview.review-style hr { border: none; border-top: 1px solid rgba(0,153,127,0.3); margin: 26px 0; }
.styled-preview.review-style table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; line-height: 1.6; }
.styled-preview.review-style th { border: 1px solid rgba(0,153,127,0.2); background: rgba(0,153,127,0.08); color: rgb(0,120,100); font-weight: 700; padding: 8px 10px; text-align: left; }
.styled-preview.review-style td { border: 1px solid rgba(0,153,127,0.1); color: rgb(62,62,62); padding: 8px 10px; vertical-align: top; }

/* 橙媒科技风格 — 京东橙（参考：618京东智享AI家电） */
.styled-preview.orange-style { background: #ffffff; color: rgba(0,0,0,0.9); padding: 24px; line-height: 1.75em; }
.styled-preview.orange-style h1 { color: rgba(0,0,0,0.9); font-size: 22px; font-weight: 700; text-align: center; margin: 20px 0 24px; letter-spacing: 0.5px; }
.styled-preview.orange-style h2 { color: rgba(0,0,0,0.9); font-size: 18px; font-weight: 700; padding: 0 0 8px 0; border-bottom: 2px solid rgb(251,87,7); margin: 28px 0 16px; letter-spacing: 0.578px; line-height: 1.5; }
.styled-preview.orange-style h2::before { content: ""; display: inline-block; width: 3px; height: 1em; background: rgb(251,87,7); margin-right: 8px; vertical-align: middle; border-radius: 2px; }
.styled-preview.orange-style h2::after { content: " ›"; color: rgb(251,87,7); font-size: 22px; font-weight: 300; }
.styled-preview.orange-style h3 { color: rgb(251,87,7); font-size: 17px; font-weight: 600; margin: 20px 0 12px; letter-spacing: 0.578px; line-height: 1.6; }
.styled-preview.orange-style h4 { color: rgb(61,59,59); font-size: 16px; font-weight: 600; margin: 16px 0 8px; }
.styled-preview.orange-style p { margin: 14px 0; color: rgba(0,0,0,0.9); font-size: 16px; line-height: 1.75em; letter-spacing: 0.578px; }
.styled-preview.orange-style blockquote { background: rgba(255,218,81,0.2); border-left: 4px solid rgb(255,218,81); padding: 12px 16px; margin: 18px 0; color: rgba(0,0,0,0.9); font-size: 15px; line-height: 1.75; }
.styled-preview.orange-style strong { color: rgb(251,87,7); letter-spacing: 0.578px; font-weight: bold; }
.styled-preview.orange-style em { font-style: italic; color: rgb(163,163,163); }
.styled-preview.orange-style code { background: rgba(251,87,7,0.08); color: rgb(220,60,0); padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: "Courier New", monospace; }
.styled-preview.orange-style pre { background: #1a1a1a; color: #f5f5f5; padding: 14px 16px; border-radius: 6px; overflow-x: auto; margin: 18px 0; font-size: 14px; line-height: 1.6; }
.styled-preview.orange-style ul { margin: 14px 0 14px 24px; padding: 0; list-style-type: disc; }
.styled-preview.orange-style ol { margin: 14px 0 14px 24px; padding: 0; list-style-type: decimal; }
.styled-preview.orange-style li { margin: 8px 0; color: rgba(0,0,0,0.9); font-size: 16px; line-height: 1.75; }
.styled-preview.orange-style img { max-width: 100%; height: auto; margin: 18px auto; display: block; }
.styled-preview.orange-style a { color: rgb(251,87,7); text-decoration: underline; }
.styled-preview.orange-style hr { border: none; border-top: 1px solid rgba(251,87,7,0.2); margin: 24px 0; }
.styled-preview.orange-style table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; line-height: 1.6; }
.styled-preview.orange-style th { border: 1px solid rgba(251,87,7,0.2); background: rgba(251,87,7,0.06); color: rgb(220,60,0); font-weight: 700; padding: 8px 10px; text-align: left; }
.styled-preview.orange-style td { border: 1px solid rgba(251,87,7,0.1); color: rgba(0,0,0,0.9); padding: 8px 10px; vertical-align: top; }

/* 极简大刊风格 — 杂志版式（替代自定义） */
.styled-preview.minimal-style { background: #fafafa; color: #2d2d2d; padding: 32px; line-height: 2; }
.styled-preview.minimal-style h1 { color: #111; font-size: 24px; font-weight: 700; text-align: center; margin: 24px 0 28px; letter-spacing: 4px; line-height: 1.5; }
.styled-preview.minimal-style h2 { color: #111; font-size: 19px; font-weight: 300; text-align: center; margin: 36px 0 20px; letter-spacing: 5px; border-top: 2px solid #5aafef; border-bottom: 1px solid #5aafef; padding: 10px 0; line-height: 1.6; }
.styled-preview.minimal-style h3 { color: #5aafef; font-size: 13px; font-weight: 700; letter-spacing: 4px; margin: 28px 0 12px; padding-bottom: 8px; border-bottom: 1px dashed #b8dcf8; text-transform: uppercase; }
.styled-preview.minimal-style h3::before { content: "— "; color: #5aafef; }
.styled-preview.minimal-style h4 { color: #444; font-size: 16px; font-weight: 600; margin: 20px 0 10px; letter-spacing: 1px; }
.styled-preview.minimal-style p { margin: 18px 0; color: #2d2d2d; font-size: 17px; line-height: 2; letter-spacing: 0.5px; }
.styled-preview.minimal-style blockquote { border: none; border-left: 3px solid #ccc; padding: 10px 30px; margin: 36px 0; font-size: 17px; font-weight: 300; color: #333; font-style: italic; line-height: 2; letter-spacing: 1px; }
.styled-preview.minimal-style strong { font-weight: 700; color: #3a8fd1; }
.styled-preview.minimal-style em { font-style: italic; color: #666; }
.styled-preview.minimal-style code { background: #f0f0f0; color: #333; padding: 2px 6px; border-radius: 2px; font-size: 14px; font-family: "Courier New", monospace; }
.styled-preview.minimal-style pre { background: #111; color: #eee; padding: 16px 20px; border-radius: 4px; overflow-x: auto; margin: 20px 0; font-size: 14px; line-height: 1.6; }
.styled-preview.minimal-style ul { margin: 16px 0 16px 28px; padding: 0; list-style-type: none; }
.styled-preview.minimal-style ul li::before { content: "— "; color: #888; }
.styled-preview.minimal-style ol { margin: 16px 0 16px 28px; padding: 0; list-style-type: decimal; }
.styled-preview.minimal-style li { margin: 10px 0; color: #2d2d2d; font-size: 17px; line-height: 2; }
.styled-preview.minimal-style img { max-width: 100%; height: auto; margin: 24px auto; display: block; }
.styled-preview.minimal-style a { color: #333; text-decoration: underline; }
.styled-preview.minimal-style hr { border: none; border-top: 1px solid #ccc; margin: 36px 0; }
.styled-preview.minimal-style table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 15px; line-height: 1.6; }
.styled-preview.minimal-style th { border-bottom: 2px solid #111; border-top: 2px solid #111; color: #111; font-weight: 700; padding: 10px 12px; text-align: left; background: none; }
.styled-preview.minimal-style td { border-bottom: 1px solid #e0e0e0; color: #333; padding: 10px 12px; vertical-align: top; }

/* 深度报道风格 — 蓝白深度报道 */
.styled-preview.depth-style { background: #ffffff; color: #3e3e3e; padding: 24px; line-height: 2; }
.styled-preview.depth-style h1 { color: #0d50c7; font-size: 22px; font-weight: 700; text-align: center; margin: 20px 0 24px; padding-bottom: 12px; border-bottom: 2px solid #0d50c7; letter-spacing: 1px; line-height: 1.5; }
.styled-preview.depth-style h2 { color: #1a1a1a; font-size: 18px; font-weight: 700; text-align: center; margin: 28px 0 16px; letter-spacing: 1px; line-height: 2; }
.styled-preview.depth-style h2::before { content: ""; display: inline-block; width: 8px; height: 24px; border-left: 2px solid #0d50c7; border-top: 2px solid #0d50c7; border-bottom: 2px solid #0d50c7; margin-right: 14px; vertical-align: middle; }
.styled-preview.depth-style h2::after { content: ""; display: inline-block; width: 8px; height: 24px; border-right: 2px solid #0d50c7; border-top: 2px solid #0d50c7; border-bottom: 2px solid #0d50c7; margin-left: 14px; vertical-align: middle; animation: none; }
.styled-preview.depth-style h3 { color: #0d50c7; font-size: 17px; font-weight: 700; padding-left: 0; border-left: none; margin: 22px 0 12px; line-height: 1.7; }
.styled-preview.depth-style h3::after { content: "✦"; display: inline-block; margin-left: 8px; color: #0d50c7; font-size: 17px; line-height: 1; vertical-align: 0.02em; animation: depthTitlePulse 1.9s ease-in-out infinite; transform-origin: center; }
.styled-preview.depth-style h4 { color: #0d50c7; font-size: 16px; font-weight: 600; margin: 16px 0 8px; line-height: 1.6; }
.styled-preview.depth-style p { margin: 14px 0; color: #3e3e3e; font-size: 16px; line-height: 2; letter-spacing: 0.5px; text-align: justify; }
.styled-preview.depth-style blockquote { border-left: 4px solid #0d50c7; background: rgba(13,80,199,0.04); padding: 14px 18px; margin: 22px 0; color: #636363; font-size: 15px; line-height: 2; letter-spacing: 1px; }
.styled-preview.depth-style strong { color: #0d50c7; font-weight: 700; }
.styled-preview.depth-style em { font-style: italic; color: #636363; }
.styled-preview.depth-style code { background: rgba(13,80,199,0.07); color: #0d50c7; padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: "Courier New", monospace; }
.styled-preview.depth-style pre { background: #0d1b3e; color: #c7d8f8; padding: 14px 16px; border-radius: 6px; overflow-x: auto; margin: 18px 0; font-size: 14px; line-height: 1.6; }
.styled-preview.depth-style ul { margin: 14px 0 14px 22px; padding: 0; list-style-type: disc; }
.styled-preview.depth-style ol { margin: 14px 0 14px 22px; padding: 0; list-style-type: decimal; }
.styled-preview.depth-style li { margin: 8px 0; color: #3e3e3e; font-size: 16px; line-height: 2; }
.styled-preview.depth-style img { max-width: 100%; height: auto; margin: 18px auto; display: block; }
.styled-preview.depth-style a { color: #0d50c7; text-decoration: underline; }
.styled-preview.depth-style hr { border: none; border-top: 1px solid #0d50c7; margin: 28px 0; }
.styled-preview.depth-style table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; line-height: 1.6; }
.styled-preview.depth-style th { border: 1px solid rgba(13,80,199,0.25); background: rgba(13,80,199,0.06); color: #0d50c7; font-weight: 700; padding: 8px 10px; text-align: left; }
.styled-preview.depth-style td { border: 1px solid rgba(13,80,199,0.1); color: #3e3e3e; padding: 8px 10px; vertical-align: top; }

@keyframes depthTitlePulse {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(0.92); opacity: 0.72; }
    45% { transform: translateY(-2px) rotate(18deg) scale(1.16); opacity: 1; }
    70% { transform: translateY(1px) rotate(-8deg) scale(1.02); opacity: 0.9; }
}

/* 微信公众号排版风格 */
.styled-preview.wechat-article-style {
    background: #ffffff;
    color: #3f3f3f;
    padding: 24px;
    line-height: 1.95;
}
.styled-preview.wechat-article-style h1 { color: #2c5f7c; font-size: 22px; font-weight: 700; text-align: center; margin: 26px 0 18px; padding: 10px 0; border-top: 1px solid #cfdfe9; border-bottom: 3px solid #2c5f7c; letter-spacing: 2px; line-height: 1.5; }
.styled-preview.wechat-article-style h2 { color: #ffffff; font-size: 18px; font-weight: 600; background: #2c5f7c; padding: 10px 24px; border-radius: 8px; text-align: center; margin: 30px 0 18px; line-height: 1.7; letter-spacing: 1px; box-shadow: 0 3px 12px rgba(44,95,124,0.3); }
.styled-preview.wechat-article-style h2::before { content: "◆  "; font-size: 8px; opacity: 0.55; vertical-align: middle; }
.styled-preview.wechat-article-style h2::after { content: "  ◆"; font-size: 8px; opacity: 0.55; vertical-align: middle; }
.styled-preview.wechat-article-style h3 { color: #2c5f7c; font-size: 17px; font-weight: 600; background: #f0f6fa; border-left: 4px solid #5A8FB5; border-radius: 6px; padding: 8px 14px; margin: 24px 0 12px; line-height: 1.5; }
.styled-preview.wechat-article-style h4 { color: #4A7BA7; font-size: 16px; font-weight: 600; margin: 18px 0 10px; line-height: 1.6; }
.styled-preview.wechat-article-style p { margin: 18px 0; color: #3f3f3f; font-size: 16px; line-height: 1.95; letter-spacing: 0.5px; text-align: left; word-wrap: break-word; overflow-wrap: break-word; white-space: normal; }
.styled-preview.wechat-article-style blockquote { background: #f0f6fa; border: 1px solid #cfe0eb; border-radius: 8px; padding: 14px 18px; margin: 22px 0; color: #2c5f7c; font-size: 15px; line-height: 1.85; }
.styled-preview.wechat-article-style strong { color: #2c5f7c; font-weight: 700; }
.styled-preview.wechat-article-style em { font-style: italic; color: #4A7BA7; }
.styled-preview.wechat-article-style code { background: #f0f6fa; color: #2c5f7c; padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: "Courier New", monospace; }
.styled-preview.wechat-article-style pre { background: #1f2937; color: #e5e7eb; padding: 14px 16px; border-radius: 6px; overflow-x: auto; margin: 16px 0; font-size: 14px; line-height: 1.6; }
.styled-preview.wechat-article-style ul { margin: 14px 0 14px 22px; padding: 0; list-style-type: disc; }
.styled-preview.wechat-article-style ol { margin: 14px 0 14px 22px; padding: 0; list-style-type: decimal; }
.styled-preview.wechat-article-style li { margin: 9px 0; color: #3f3f3f; font-size: 16px; line-height: 1.9; }
.styled-preview.wechat-article-style img { max-width: 100%; height: auto; display: block; margin: 16px auto; padding: 0; border-radius: 8px; }
.styled-preview.wechat-article-style a { color: #2c5f7c; text-decoration: underline; }
.styled-preview.wechat-article-style hr { border: none; border-top: 2px solid #cfdfe9; margin: 26px 0; }
.styled-preview.wechat-article-style table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; line-height: 1.7; color: #374151; }
.styled-preview.wechat-article-style th { border: 1px solid #cbd5e1; background: #eef6fb; color: #2c5f7c; font-weight: 700; padding: 6px 8px; text-align: left; }
.styled-preview.wechat-article-style td { border: 1px solid #e5e7eb; color: #374151; padding: 6px 8px; vertical-align: top; }

/* 互联网风格 */
.styled-preview.internet-style {
    background: #ffffff;
    color: #292929;
    padding: 24px;
    line-height: 1.85;
}
.styled-preview.internet-style h1 { color: #1a1a1a; font-size: 26px; font-weight: 800; margin: 26px 0 16px; line-height: 1.3; letter-spacing: -0.3px; }
.styled-preview.internet-style h2 { color: #1a1a1a; font-size: 21px; font-weight: 700; margin: 32px 0 16px; padding-bottom: 8px; border-bottom: 3px solid #d92b2b; line-height: 1.4; letter-spacing: -0.2px; }
.styled-preview.internet-style h3 { color: #1a1a1a; font-size: 18px; font-weight: 700; margin: 24px 0 10px; line-height: 1.45; }
.styled-preview.internet-style h4 { color: #404040; font-size: 16px; font-weight: 600; margin: 18px 0 10px; line-height: 1.5; }
.styled-preview.internet-style p { margin: 20px 0; color: #292929; font-size: 17px; line-height: 1.85; letter-spacing: 0.2px; }
.styled-preview.internet-style blockquote { background: #f7f7f7; border-left: 4px solid #d92b2b; border-radius: 0 8px 8px 0; padding: 14px 20px; margin: 24px 0; color: #444444; font-size: 18px; font-style: italic; line-height: 1.7; }
.styled-preview.internet-style strong { color: #d92b2b; font-weight: 700; }
.styled-preview.internet-style em { font-style: italic; color: #555555; }
.styled-preview.internet-style code { background: #f2f2f2; color: #d92b2b; padding: 2px 6px; border-radius: 4px; font-size: 15px; font-family: "Courier New", monospace; }
.styled-preview.internet-style pre { background: #1a1a1a; color: #f5f5f5; padding: 14px 16px; border-radius: 8px; overflow-x: auto; margin: 20px 0; font-size: 14px; line-height: 1.6; }
.styled-preview.internet-style ul { margin: 18px 0 18px 22px; padding: 0; list-style-type: disc; }
.styled-preview.internet-style ol { margin: 18px 0 18px 22px; padding: 0; list-style-type: decimal; }
.styled-preview.internet-style li { margin: 9px 0; color: #292929; font-size: 17px; line-height: 1.85; }
.styled-preview.internet-style img { max-width: 100%; height: auto; margin: 22px auto; border-radius: 4px; display: block; }
.styled-preview.internet-style a { color: #d92b2b; text-decoration: underline; }
.styled-preview.internet-style hr { border: none; border-top: 1px solid #e5e5e5; margin: 28px 0; }
.styled-preview.internet-style table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 16px; line-height: 1.6; }
.styled-preview.internet-style th { border: 1px solid #d1d5db; background: #fafafa; color: #1a1a1a; font-weight: 700; padding: 10px 12px; text-align: left; }
.styled-preview.internet-style td { border: 1px solid #e5e7eb; color: #292929; padding: 10px 12px; vertical-align: top; }

/* 编辑框（Quill）内列表修正：仅作用于 .ql-editor，不影响导出。
   tech 主题的 li::before 为 position:absolute，需抵消 quill.bubble.css
   中 .ql-editor li:not(.ql-direction-rtl)::before 的 margin-left:-1.5em / margin-right:0.3em，
   否则序号/菱形标记会被拖出列表框外。 */
.styled-preview.tech-style .ql-editor li::before { margin-left: 0; margin-right: 0; }

/* 响应式设计 */
@media (max-width: 1024px) {
    .editor-columns {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .editor-column {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .editor-content,
    .preview-content {
        padding: var(--spacing-md);
    }
    
    .content-editor {
        min-height: 300px;
    }
}

/* 微信公众号配置对话框样式 */
.wechat-config-modal-content {
    max-width: 600px;
    width: 90%;
}

.wechat-config-form {
    margin-bottom: 24px;
}

.wechat-help {
    padding: 16px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary-color);
    margin-top: 20px;
}

.wechat-help h4 {
    margin: 0 0 12px 0;
    color: var(--primary-color);
    font-size: 14px;
}

.wechat-help ul {
    margin: 0;
    padding-left: 18px;
}

.wechat-help li {
    margin: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.help-text {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group label input[type="checkbox"] {
    margin-right: 8px;
}

.color-input {
    width: 60px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: none;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.option-group {
    margin: 20px 0;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
}

.option-group h4 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.style-preview-sample {
    padding: 8px;
    margin: 8px 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: white;
    font-size: 12px;
}

.delete-style-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity var(--transition);
}

.custom-style-item {
    position: relative;
}

.custom-style-item:hover .delete-style-btn {
    opacity: 1;
}

.no-custom-styles {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
}

.project-card.create-new:hover {
    border-color: var(--primary-color) !important;
    background: var(--bg-glass) !important;
}

.create-new-content {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    gap: 12px !important;
    text-align: left !important;
}

.create-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    background: var(--bg-surface) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--text-muted) !important;
    font-size: 14px !important;
    border: 1px dashed var(--border-color) !important;
}

.create-text {
    flex: 1 !important;
}

.create-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    margin: 0 0 2px 0 !important;
}

.create-subtitle {
    font-size: 13px !important;
    color: var(--text-secondary) !important;
    margin: 0 !important;
}

/* ===== 重新设计的对话框界面 (Claude风格) ===== */
/* AI对话区域 */
.chat-section {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    background: var(--bg-secondary) !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden !important;
    border: 1px solid var(--border-color) !important;
}

.chat-header {
    padding: 16px 20px 12px 20px !important;
    border-bottom: 1px solid var(--border-color) !important;
    background: var(--bg-secondary) !important;
}

.ai-status {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
}

.ai-status i {
    color: var(--primary-color) !important;
    font-size: 16px !important;
}

.status-indicator {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    margin-left: auto !important;
}

.status-indicator.online {
    background: var(--success-color) !important;
    box-shadow: 0 0 0 2px rgba(67, 233, 123, 0.2) !important;
}

.chat-messages-container {
    flex: 1 !important;
    overflow: hidden !important;
}

.chat-messages {
    height: 100% !important;
    overflow-y: auto !important;
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    scroll-behavior: smooth !important;
}

/* 消息气泡重新设计 */
.message {
    display: flex !important;
    gap: 12px !important;
    max-width: 85% !important;
    animation: messageSlideIn 0.3s ease-out !important;
}

.message.user {
    align-self: flex-end !important;
    flex-direction: row-reverse !important;
    max-width: 80% !important;
}

.message-avatar {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: var(--primary-gradient) !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.message.user .message-avatar {
    background: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.message-content {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.message-content > div:first-child {
    background: var(--bg-surface) !important;
    padding: 12px 16px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: var(--text-primary) !important;
    margin-bottom: 4px !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

.message.user .message-content > div:first-child {
    background: var(--primary-color) !important;
    color: white !important;
    border: 1px solid var(--primary-color) !important;
    margin-left: 0 !important;
    margin-right: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.message-time {
    font-size: 11px !important;
    color: var(--text-muted) !important;
    padding-left: 16px !important;
    margin-top: 2px !important;
}

.message.user .message-time {
    text-align: right !important;
    padding-left: 0 !important;
    padding-right: 24px !important;
}

/* 输入区域重新设计 */
.chat-input-area {
    border-top: 1px solid var(--border-color) !important;
    background: var(--bg-secondary) !important;
    padding: 16px 20px !important;
}

.chat-input-container {
    padding: 0 !important;
}

.chat-input {
    width: 100% !important;
    min-height: 88px !important;
    padding: 12px 16px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    font-size: 14px !important;
    font-family: inherit !important;
    resize: none !important;
    line-height: 1.5 !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.chat-input:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1) !important;
}

.chat-input::placeholder {
    color: var(--text-muted) !important;
    line-height: 1.4 !important;
}

.chat-input-actions {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 12px !important;
}

.input-hint {
    font-size: 12px !important;
    color: var(--text-muted) !important;
}

/* 发送按钮重新设计 */
#send-message-btn {
    background: var(--primary-gradient) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

#send-message-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

#send-message-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* 历史文章区域优化 */
.history-section.compact {
    background: var(--bg-secondary) !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    padding: 16px 20px !important;
    flex-shrink: 0 !important;
    border: 1px solid var(--border-color) !important;
}

.history-section.compact .section-header {
    cursor: pointer !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 12px !important;
    user-select: none !important;
}

.history-section.compact .section-header h4 {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.history-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: 1px solid transparent !important;
}

.history-item:hover {
    background: var(--bg-glass) !important;
    border-color: var(--border-color) !important;
}

.history-icon {
    width: 32px !important;
    height: 32px !important;
    background: var(--bg-surface) !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--primary-color) !important;
    font-size: 14px !important;
    flex-shrink: 0 !important;
}

.history-title {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
    margin-bottom: 2px !important;
    line-height: 1.3 !important;
}

.history-meta {
    font-size: 11px !important;
    color: var(--text-muted) !important;
}

/* 动画效果 */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ── 格式工具面板 (左列) ───────────────────────────────────────────────── */

.format-tools-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}

.format-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.format-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.format-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.format-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    width: 100%;
    min-height: 34px;
    padding: 6px 7px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
}

.format-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.format-btn:active {
    transform: scale(0.98);
}

.fmt-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    padding: 0 3px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 10px;
    font-family: 'Monaco', 'Menlo', monospace;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.format-hint {
    margin-top: 2px;
    padding: 8px 10px;
    background: rgba(var(--primary-rgb, 49, 130, 206), 0.06);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.35;
}

.format-hint i {
    margin-top: 1px;
    flex-shrink: 0;
    color: var(--primary-color);
    opacity: 0.7;
}

@media (max-width: 768px) {
    #style-editor-column {
        position: static;
        max-height: none;
    }

    #style-editor-column .editor-content {
        overflow: visible;
    }
}

/* ── Quill 编辑器覆盖样式 ─────────────────────────────────────────────── */

/* 移除 Quill 容器的边框（我们用 .styled-preview 的边框） */
#style-preview.ql-container {
    border: none !important;
    font-size: inherit !important;
    font-family: inherit !important;
}

/* 编辑区域内边距和最小高度 */
#style-preview .ql-editor {
    padding: 28px 32px !important;
    min-height: 500px;
    line-height: inherit;
}

/* 确保 placeholder 样式 */
#style-preview .ql-editor.ql-blank::before {
    color: var(--text-muted) !important;
    font-style: normal !important;
    font-size: 14px;
}

/* 气泡工具栏的 z-index 保障 */
.ql-bubble .ql-tooltip {
    z-index: 9999 !important;
}

/* 图片在编辑器内自适应 */
#style-preview .ql-editor img {
    max-width: 100%;
    height: auto;
}

#style-preview .ql-editor blockquote + blockquote {
    margin-top: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    padding-top: 0 !important;
}

#style-preview .ql-editor blockquote:has(+ blockquote) {
    margin-bottom: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    padding-bottom: 4px !important;
}

#style-preview .ql-editor blockquote + blockquote:last-of-type {
    border-bottom-left-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

#style-preview .ql-editor blockquote strong {
    font-style: normal !important;
    font-weight: 700 !important;
}

/* ===== 项目卡片：统一高度统一宽度，所有元素都能完整显示、不被遮挡 ===== */
.projects-showcase .project-cards {
    align-items: stretch;            /* 同排卡片等高 */
    grid-auto-rows: 150px;           /* 固定行高，所有卡片高度一致 */
}
.projects-showcase .project-cards .project-card {
    height: 150px !important;
    min-height: 150px !important;
    max-height: 150px !important;
    overflow: hidden !important;
}
.projects-showcase .project-cards .project-card .card-content-new {
    height: 100% !important;
    justify-content: flex-start;
    gap: 4px;
    overflow: hidden;
}
/* 标题最多两行，超出省略；两行时自动缩小字号（.two-line 由 JS 添加） */
.projects-showcase .project-cards .project-title-horizontal {
    font-size: 15px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.projects-showcase .project-cards .project-title-horizontal.two-line {
    font-size: 13px;
    line-height: 1.25;
}
.projects-showcase .project-cards .card-top-row {
    align-items: flex-start;
}
/* 描述最多两行，缩短中间空白 buffer */
.projects-showcase .project-cards .project-description-area {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    align-items: flex-start !important;
}
.projects-showcase .project-cards .project-description-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.projects-showcase .project-cards .card-content-new .project-meta {
    margin-top: auto !important;   /* 信息行钉在底部，留白集中在中间且有限 */
}

/* ===== 项目顶部三按钮（大模型 / 提示词 / 项目附件）+ 大模型下拉 ===== */
.header-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}
.model-dropdown-wrap {
    position: relative;
}
.header-ctrl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast, all .15s ease);
}
.header-ctrl-btn:hover {
    background: var(--bg-surface);
    border-color: #b0b0b0;
}
.header-ctrl-btn i {
    font-size: 12px;
    color: var(--text-secondary);
}
.header-ctrl-btn .hctrl-caret {
    font-size: 10px;
    margin-left: 2px;
}
.model-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 160px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 1000;
    display: none;
}
.model-dropdown-menu.open {
    display: block;
}
.model-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.model-option:hover {
    background: var(--bg-surface);
}
.model-option.selected {
    font-weight: 600;
}
.model-option.selected::after {
    content: "✅";
    font-size: 12px;
    margin-left: 8px;
}

/* ===== 风格设计：iPhone 17 手机预览 ===== */
#style-mobile-preview-modal {
    z-index: 1200;
    align-items: flex-start;
    background: rgba(15, 23, 42, 0.62);
    padding: 6px 12px;
    overflow: auto;
}

#style-mobile-preview-modal .style-mobile-preview-modal-content {
    position: relative;
    width: auto;
    max-width: none;
    max-height: none;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}

#style-mobile-preview-modal .modal-header {
    position: absolute;
    top: 10px;
    right: -8px;
    z-index: 8;
    padding: 0;
    border: 0;
    background: transparent;
}

#style-mobile-preview-modal .modal-header h3 {
    display: none;
}

#style-mobile-preview-modal .modal-close {
    width: 38px;
    height: 38px;
    color: #fff;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.26);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#style-mobile-preview-modal .modal-close:hover {
    background: rgba(15, 23, 42, 0.9);
}

.style-mobile-preview-body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
    overflow: visible;
    background: transparent;
}

.iphone-preview-shell {
    position: relative;
    height: min(93vh, 900px);
    width: auto;
    max-width: calc(100vw - 44px);
    aspect-ratio: 71.5 / 149.6;
    padding: clamp(8px, 1.35vh, 13px);
    border-radius: clamp(34px, 5.9vh, 57px);
    background: linear-gradient(145deg, #111827 0%, #020617 48%, #334155 100%);
    box-shadow: 0 26px 58px rgba(15, 23, 42, 0.36), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.iphone-preview-shell::before,
.iphone-preview-shell::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.iphone-preview-shell::before {
    top: 5px;
    width: 24%;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.iphone-preview-shell::after {
    inset: clamp(7px, 1.1vh, 11px);
    border-radius: clamp(28px, 5vh, 48px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.iphone-preview-notch {
    position: absolute;
    top: clamp(18px, 2.55vh, 25px);
    left: 50%;
    width: 30.2%;
    height: 4.1%;
    transform: translateX(-50%);
    border-radius: 999px;
    background: #050505;
    z-index: 3;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.iphone-preview-screen {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: clamp(27px, 4.9vh, 46px);
    background: #fff;
    aspect-ratio: 1206 / 2622;
}

.iphone-preview-content {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    color: #111827;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
    scrollbar-width: thin;
}

.iphone-preview-content::-webkit-scrollbar {
    width: 4px;
}

.iphone-preview-content::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.55);
    border-radius: 999px;
}

.wechat-mobile-status {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    padding: 0 24px;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.wechat-mobile-status span:last-child {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.wechat-article-page {
    font-size: 16px;
    line-height: 1.75;
}

.wechat-article-header {
    padding: 34px 20px 14px;
    background: #fff;
}

.wechat-article-title {
    margin: 0 0 14px;
    color: #111827;
    font-size: 24px;
    line-height: 1.28;
    font-weight: 750;
    letter-spacing: 0;
}

.wechat-article-author-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    color: #8a8f98;
    font-size: 14px;
}

.wechat-article-author {
    color: #576b95;
}

.wechat-article-body {
    padding: 0 20px 42px;
    word-break: break-word;
}

.wechat-article-body > article,
.wechat-article-body > .generated-article,
.wechat-article-body > .ql-editor {
    padding: 0 !important;
}

.wechat-article-body :where(h1, h2, h3) {
    line-height: 1.35;
    letter-spacing: 0;
}

.wechat-article-body :where(h1) {
    font-size: 24px;
}

.wechat-article-body :where(h2) {
    font-size: 21px;
    margin-top: 28px;
}

.wechat-article-body :where(h3) {
    font-size: 18px;
    margin-top: 22px;
}

.wechat-article-body :where(p, li) {
    font-size: 16px;
    line-height: 1.82;
    text-align: justify;
    text-justify: inter-ideograph;
    text-align-last: left;
}

.wechat-article-body :where(img) {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.iphone-preview-home {
    position: absolute;
    left: 50%;
    bottom: 20px;
    width: 124px;
    height: 5px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.78);
    z-index: 4;
}

@media (max-width: 520px) {
    #style-mobile-preview-modal .style-mobile-preview-modal-content {
        width: auto;
        max-height: none;
    }

    #style-mobile-preview-modal {
        padding: 8px;
    }

    .iphone-preview-shell {
        width: min(360px, calc(100vw - 22px));
        height: auto;
    }

    #style-mobile-preview-modal .modal-header {
        right: 0;
    }
}


/* 聊天区顶部「提取配图」按钮：与「新的对话」并列，用描边样式区分主次 */
.btn-figure {
    background: #fff;
    color: #2d2d2d;
    border: 1px solid #d5d5d5;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-figure:hover:not(:disabled) {
    border-color: #2d2d2d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.btn-figure:active:not(:disabled) {
    transform: translateY(0);
}

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


/* 表格在 Quill 里以原子嵌入块存在（Quill 1.3.7 无 table blot，裸 table 会被 Delta 同步删掉） */
.pb-table-embed {
    display: block;
    margin: 16px 0;
    overflow-x: auto;
}

.pb-table-embed table {
    width: 100%;
    border-collapse: collapse;
}
