/* ============================================
   AI排版大师 - 专业级公众号排版工具样式
   设计风格：现代、简洁、专业
   ============================================ */

/* CSS变量定义 */
:root {
    /* 主色调 */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    
    /* 辅助色 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* 中性色 */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* 背景色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    
    /* 文字色 */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #9ca3af;
    
    /* 边框 */
    --border-color: #e5e7eb;
    --border-focus: #6366f1;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* 过渡 */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* 字体 */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ============================================
   顶部导航栏
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-brand .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

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

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

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

.nav-btn svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   主工作区布局
   ============================================ */
.workspace {
    display: grid;
    grid-template-columns: 320px 1fr 280px;
    gap: 0;
    padding-top: 64px;
    height: 100vh;
    overflow: hidden;
}

/* ============================================
   左侧边栏
   ============================================ */
.sidebar {
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 20px;
}

.sidebar-section {
    margin-bottom: 28px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

/* 上传区域 */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
}

.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--primary);
    margin-bottom: 12px;
}

.upload-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.file-types {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.file-type {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* 设置组 */
.setting-group {
    margin-bottom: 20px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* 风格选择网格 */
.style-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.style-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.style-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.style-card.active {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--primary);
}

.style-card svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.style-card.active svg {
    color: var(--primary);
}

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

.style-card.active span {
    color: var(--primary);
}

/* 下拉选择器 */
.select-wrapper {
    position: relative;
}

.setting-select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    transition: all var(--transition);
}

.setting-select:hover {
    border-color: var(--gray-300);
}

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

.select-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
    pointer-events: none;
}

/* 文本域 */
.setting-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    resize: vertical;
    transition: all var(--transition);
}

.setting-textarea:hover {
    border-color: var(--gray-300);
}

.setting-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 开关样式 */
.switch-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.switch-wrapper input {
    display: none;
}

.switch-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--gray-300);
    border-radius: 12px;
    transition: all var(--transition);
    flex-shrink: 0;
}

.switch-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.switch-wrapper input:checked + .switch-slider {
    background: var(--primary);
}

.switch-wrapper input:checked + .switch-slider::before {
    transform: translateX(20px);
}

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

.setting-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* API配置区域 */
.api-section {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.api-input-wrapper {
    position: relative;
}

.api-input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    transition: all var(--transition);
}

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

.api-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.api-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.api-toggle svg {
    width: 16px;
    height: 16px;
}

.api-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

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

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

/* ============================================
   中间编辑区
   ============================================ */
.editor-section {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow: hidden;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.editor-tabs {
    display: flex;
    gap: 4px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

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

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-btn svg {
    width: 16px;
    height: 16px;
}

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

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

.action-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.action-btn.secondary:hover {
    background: var(--gray-200);
    color: var(--text-primary);
}

.action-btn.primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.action-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.5);
}

/* 编辑器内容区 */
.editor-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tab-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
}

.tab-panel.active {
    display: flex;
}

/* 工具栏 */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

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

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

.toolbar-btn svg {
    width: 18px;
    height: 18px;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 8px;
}

/* 编辑器文本域 */
.editor-textarea {
    flex: 1;
    padding: 24px;
    background: var(--bg-primary);
    border: none;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    resize: none;
    outline: none;
}

.editor-textarea::placeholder {
    color: var(--text-tertiary);
}

/* 编辑器底部 */
.editor-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 24px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.word-count {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* 预览区 */
.preview-container {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: var(--bg-tertiary);
}

.wechat-frame {
    max-width: 414px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.wechat-header {
    padding: 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.wechat-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.wechat-content {
    padding: 24px;
    min-height: 600px;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
}

.empty-icon {
    width: 64px;
    height: 64px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state span {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* ============================================
   右侧导出栏
   ============================================ */
.export-sidebar {
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
}

.export-section {
    margin-bottom: 28px;
}

.export-section:last-child {
    margin-bottom: 0;
}

.export-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.export-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.export-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

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

.export-icon svg {
    width: 20px;
    height: 20px;
}

.export-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.export-desc {
    font-size: 12px;
    color: var(--text-tertiary);
}

.export-action {
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
    opacity: 0;
    transition: all var(--transition);
}

.export-card:hover .export-action {
    opacity: 1;
    color: var(--primary);
}

/* 历史记录 */
.history-section {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty-history {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.empty-history svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   加载状态
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
    padding: 48px;
}

.loading-spinner {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
}

.spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: var(--primary-light);
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: var(--primary-dark);
    animation-duration: 2s;
}

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

.loading-text {
    font-size: 16px;
    font-weight: 500;
    color: white;
    margin-bottom: 16px;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

/* ============================================
   Toast提示
   ============================================ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    color: var(--text-primary);
    animation: slideIn 0.3s ease;
    min-width: 280px;
}

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

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

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--info);
}

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

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

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

/* ============================================
   快捷键提示
   ============================================ */
.shortcuts-hint {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 50;
}

.shortcuts-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
}

.shortcuts-content h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
}

.shortcut-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.shortcut-item kbd {
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

.shortcut-item span {
    color: var(--text-secondary);
}

/* ============================================
   公众号文章样式
   ============================================ */
.wechat-article {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
}

.wechat-article h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.4;
    color: var(--text-primary);
}

.wechat-article h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 28px 0 16px;
    padding-left: 12px;
    border-left: 4px solid var(--primary);
    line-height: 1.4;
}

.wechat-article h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 12px;
    line-height: 1.4;
}

.wechat-article p {
    margin-bottom: 16px;
    text-align: justify;
}

.wechat-article img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 20px 0 8px;
    display: block;
    box-shadow: var(--shadow-md);
}

/* 图片说明文字 */
.wechat-article img + em,
.wechat-article p em:only-child {
    display: block;
    text-align: center;
    font-size: 13px;
    color: var(--text-tertiary);
    font-style: normal;
    margin-bottom: 20px;
}

/* 图片容器 */
.wechat-article p:has(img) {
    margin: 0;
}

/* 图片加载动画 */
.wechat-article img {
    opacity: 0;
    animation: fadeInImage 0.5s ease forwards;
}

@keyframes fadeInImage {
    to {
        opacity: 1;
    }
}

.wechat-article blockquote {
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--text-secondary);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.wechat-article ul,
.wechat-article ol {
    margin: 16px 0;
    padding-left: 28px;
}

.wechat-article li {
    margin-bottom: 8px;
}

.wechat-article strong {
    font-weight: 600;
    color: var(--text-primary);
}

.wechat-article em {
    font-style: italic;
}

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

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

/* 文生图提示词样式 - 仅使用字体颜色 */
.wechat-article .inline-image-prompt {
    color: #dc2626;
    font-weight: 600;
}

.wechat-article hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 28px 0;
}

.wechat-article code {
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--primary);
}

.wechat-article pre {
    background: var(--gray-800);
    color: var(--gray-100);
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 20px 0;
}

.wechat-article pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* ============================================
   弹窗样式
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

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

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform var(--transition);
}

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

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

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

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all var(--transition);
}

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

.modal-body {
    padding: 24px;
}

/* 帮助文档弹窗样式 */
.help-modal-content {
    max-width: 640px;
    max-height: 85vh;
}

.help-modal-body {
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

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

.help-section:last-child {
    margin-bottom: 0;
}

.help-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.help-step {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.step-number {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    display: block;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.step-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.step-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.step-content li {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 4px;
}

.help-tip {
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
    margin-top: 12px;
}

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

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

.help-item {
    margin-bottom: 16px;
}

.help-item strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.help-item p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.help-shortcuts {
    display: grid;
    gap: 12px;
}

.help-shortcut-item {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.help-shortcut-item kbd {
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.faq-item {
    margin-bottom: 16px;
}

.faq-item strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.faq-item p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 1200px) {
    .workspace {
        grid-template-columns: 280px 1fr 240px;
    }
}

@media (max-width: 1024px) {
    .workspace {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .sidebar,
    .export-sidebar {
        display: none;
    }
}

@media (max-width: 640px) {
    .navbar {
        padding: 0 16px;
    }
    
    .nav-brand .logo span {
        display: none;
    }
    
    .editor-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .editor-toolbar {
        padding: 8px 16px;
        overflow-x: auto;
    }
    
    .editor-textarea {
        padding: 16px;
    }
    
    .shortcuts-hint {
        display: none;
    }
}

/* ============================================
   动画效果
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.animate-fadeIn {
    animation: fadeIn 0.3s ease;
}

.animate-fadeInUp {
    animation: fadeInUp 0.3s ease;
}
