/* CSS 变量定义 */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --text-primary: #1e293b;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-light: #475569;
    --background-light: #f8fafc;
    --background-gray: #f1f5f9;
    --border-color: #e2e8f0;
    --border-light: #cbd5e1;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
}

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-light);
    color: var(--text-secondary);
    line-height: 1.6;
    overflow: hidden;
}

/* 主应用容器 */
.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部工具栏 */
.toolbar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-left h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-left h1 .app-icon {
    width: 24px;
    height: 24px;
    margin-right: 4px;
    vertical-align: middle;
}

.toolbar-left h1 i {
    color: var(--primary-color);
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mode-group {
    display: flex;
    gap: 8px;
    margin-right: 16px; /* 与右侧自定义/导出拉开距离 */
}

.btn-toggle.active {
    background: var(--primary-color);
    color: #fff;
    border-color: transparent;
}

.btn-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* 不同模式选中态颜色 */
#modeXhsBtn.active {
    background: #ef4444; /* 红色 */
}

#modePyqBtn.active {
    background: #10b981; /* 绿色 */
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    min-height: 0; /* 允许内部面板成为滚动容器，避免底部空白 */
}

/* 面板通用样式 */
.editor-panel,
.preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-right: 1px solid #e2e8f0;
    min-height: 0; /* 修复子容器溢出导致父容器被撑高 */
}

.preview-panel {
    border-right: none;
}

.panel-header {
    padding: 16px 28px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    flex-wrap: wrap; /* 允许标题和工具栏换行 */
    gap: 8px; /* 换行时的间距 */
    min-height: 56px; /* 最小高度确保单行时的高度 */
}

.panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 编辑器工具栏 */
.editor-tools,
.preview-tools {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap; /* 允许工具按钮换行 */
    max-width: 100%; /* 防止溢出 */
}

/* 预览工具栏特殊样式，确保与右侧工具栏对齐 */
.preview-panel .panel-header {
    padding-right: 125px;
}

.preview-tools {
    gap: 8px;
}

.tool-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

.zoom-level {
    font-size: 12px;
    color: #64748b;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    font-weight: 500;
}

/* Markdown 编辑器 */
.editor-with-lines {
    position: relative;
    display: flex;
    flex: 1;        /* 占满除去面板头部的剩余空间 */
    min-height: 0;  /* 允许内部滚动，不把父容器撑高 */
    background: #fafafa;
}

.line-numbers {
    counter-reset: linenumber;
    user-select: none;
    pointer-events: none;
    width: 48px;
    padding: 20px 10px 20px 16px;
    margin: 0;
    background: #f3f4f6;
    color: #94a3b8;
    text-align: right;
    line-height: 1.6;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 14px;
    overflow: hidden;
}

#markdownInput {
    flex: 1;
    border: none;
    padding: 20px 20px 20px 12px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    background: transparent;
    color: #374151;
}

#markdownInput::placeholder {
    color: #9ca3af;
}

/* 预览容器 */
.preview-container {
    flex: 1;
    min-height: 0;  /* 允许成为真正的滚动容器，避免底部空白 */
    overflow: auto;
    background: #f1f5f9;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.preview-content {
    transform-origin: top center;
    transition: transform 0.2s ease;
}

/* Markdown 海报样式 */
.markdown-poster {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0;
    padding: 40px;
    margin: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 640px; /* 视觉宽度（内容卡片外层） */
    min-height: 600px;
    position: relative;
    overflow: hidden;
}

/* 小红书模式下，为了与导出一致，使用 border-box 宽度模型 */
.markdown-poster[data-mode="xhs"] {
    box-sizing: border-box;
}

.markdown-poster[data-mode="pyq"] {
    box-sizing: border-box;
}

.markdown-poster::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0;
    pointer-events: none;
}

.poster-content {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
    overflow: hidden;
    word-wrap: break-word;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}


/* 空内容提示样式 */
.empty-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 40px;
    color: var(--text-muted);
    min-height: 400px;
}

.empty-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
    opacity: 0.8;
}

.empty-preview h3 {
    font-size: 24px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.empty-preview > p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.5;
}

.empty-tips {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 320px;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.tip-item i {
    color: var(--primary-color);
    font-size: 14px;
    width: 16px;
    flex-shrink: 0;
}

.tip-item span {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.4;
}

/* Markdown 内容样式 */
.poster-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 16px auto;
    box-shadow: var(--shadow-md);
    display: block;
    object-fit: cover;
}

.poster-content video,
.poster-content iframe {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
    display: block;
}

.poster-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
    display: table;
    table-layout: fixed;
}

.poster-content table th,
.poster-content table td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.poster-content table th {
    background: var(--background-light);
    font-weight: 600;
}

.poster-content h1 {
    font-size: var(--dynamic-h1-size, 28px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.3;
}

.poster-content h2 {
    font-size: var(--dynamic-h2-size, 22px);
    font-weight: 600;
    color: var(--text-secondary);
    margin: 24px 0 12px 0;
    line-height: 1.4;
}

.poster-content h3 {
    font-size: var(--dynamic-h3-size, 18px);
    font-weight: 600;
    color: var(--text-light);
    margin: 20px 0 8px 0;
}

.poster-content p {
    font-size: var(--dynamic-font-size, 16px);
    color: var(--text-light);
    margin-bottom: 16px;
    line-height: 1.7;
}

/* Markdown 空行（可视化占位） */
.poster-content .md-empty-line {
    height: 1em;
    line-height: 1em;
    margin: 8px 0;
    opacity: 0.2;
}

.poster-content em {
    font-style: italic;
    color: var(--primary-color);
}

.poster-content strong {
    font-weight: 700;
    color: var(--text-primary);
}

.poster-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-color);
    transition: all 0.2s ease;
}

.poster-content a:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-hover);
}

.poster-content ul,
.poster-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.poster-content li {
    font-size: var(--dynamic-font-size, 16px);
    color: var(--text-light);
    margin-bottom: 8px;
    line-height: 1.6;
    display: list-item;
}

.poster-content li a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-color);
    display: inline;
}

.poster-content li code {
    background: var(--background-gray);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: var(--dynamic-code-size, 14px);
    color: var(--primary-color);
    display: inline;
    vertical-align: baseline;
    line-height: inherit;
}

.poster-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 16px;
    background: var(--background-gray);
    padding-top: 12px;
    padding-bottom: 12px;
    margin: 16px 0;
    color: var(--text-muted);
    font-style: italic;
    font-size: var(--dynamic-quote-size, 16px);
}

/* 解决单行引用高度偏大：取消 blockquote 内段落默认外边距 */
.poster-content blockquote p {
    margin: 0;
    line-height: inherit;
}

.poster-content code {
    background: var(--background-gray);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: var(--dynamic-code-size, 14px);
    color: var(--primary-color);
    display: inline;
    line-height: inherit;
    vertical-align: baseline;
}

.poster-content pre {
    background: var(--text-primary);
    color: #e2e8f0;
    padding: 16px;
    border-radius: var(--border-radius);
    margin: 16px 0;
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-all;
}

.poster-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    display: inline;
}

/* 背景自定义面板 */
.background-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-width: 500px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.background-panel.active {
    opacity: 1;
    pointer-events: all;
}

.background-panel .panel-content {
    padding: 24px;
}

.background-panel h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.setting-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.setting-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.slider-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-group input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    cursor: pointer;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-value {
    font-size: 14px;
    color: #6366f1;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

.background-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.preset-backgrounds {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.bg-preset {
    width: 70px;
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
}

.bg-preset:hover {
    transform: scale(1.05);
}

.bg-preset.active {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* 背景预设样式 */
.bg-preset[data-bg="gradient1"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-preset[data-bg="gradient2"] {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.bg-preset[data-bg="gradient3"] {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.bg-preset[data-bg="gradient4"] {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.bg-preset[data-bg="gradient5"] {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.bg-preset[data-bg="gradient6"] {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.bg-preset[data-bg="gradient7"] {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.bg-preset[data-bg="gradient8"] {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.bg-preset[data-bg="atomic-cyber"] {
    background: linear-gradient(135deg, #0f0e23 0%, #1a0b2e 25%, #16213e 50%, #0f3460 75%, #00d4ff 100%);
}

.bg-preset[data-bg="atomic-punk"] {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 25%, #fdc830 50%, #4ecdc4 75%, #00b4d8 100%);
}

.bg-preset[data-bg="steampunk"] {
    background: linear-gradient(135deg, #2c1810 0%, #3d2817 25%, #8b6914 50%, #cd853f 75%, #daa520 100%);
}

/* 原子赛博主题特效 */
.markdown-poster.atomic-cyber-theme {
    background: linear-gradient(135deg, #0f0e23 0%, #1a0b2e 25%, #16213e 50%, #0f3460 75%, #00d4ff 100%) !important;
    position: relative;
}

.markdown-poster.atomic-cyber-theme::before {
    background: radial-gradient(circle at 30% 50%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(138, 43, 226, 0.12) 0%, transparent 50%);
}

.markdown-poster.atomic-cyber-theme::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 212, 255, 0.03) 0px,
            rgba(0, 212, 255, 0.03) 1px,
            transparent 1px,
            transparent 2px
        );
    pointer-events: none;
    z-index: 1;
}

.markdown-poster.atomic-cyber-theme .poster-content {
    background: rgba(15, 14, 35, 0.85) !important;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 
        0 0 20px rgba(0, 212, 255, 0.3),
        0 0 40px rgba(138, 43, 226, 0.2),
        inset 0 0 60px rgba(0, 212, 255, 0.05);
    position: relative;
    z-index: 2;
}

.markdown-poster.atomic-cyber-theme .poster-content h1,
.markdown-poster.atomic-cyber-theme .poster-content h2,
.markdown-poster.atomic-cyber-theme .poster-content h3 {
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.markdown-poster.atomic-cyber-theme .poster-content p,
.markdown-poster.atomic-cyber-theme .poster-content li {
    color: #e0e7ff;
}

.markdown-poster.atomic-cyber-theme .poster-content a {
    color: #00d4ff;
    border-bottom-color: #00d4ff;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
}

.markdown-poster.atomic-cyber-theme .poster-content code {
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.2);
}

.markdown-poster.atomic-cyber-theme .poster-content pre {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: inset 0 0 20px rgba(0, 212, 255, 0.1);
}

.markdown-poster.atomic-cyber-theme .poster-content blockquote {
    border-left-color: #00d4ff;
    background: rgba(0, 212, 255, 0.08);
    color: #cbd5e1;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
}

.markdown-poster.atomic-cyber-theme .poster-content strong {
    color: #00d4ff;
    font-weight: 700;
}

.markdown-poster.atomic-cyber-theme .poster-content em {
    color: #8b5cf6;
}

.markdown-poster.atomic-cyber-theme .madopic-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(138, 43, 226, 0.15) 100%);
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 
        0 4px 20px rgba(0, 212, 255, 0.2),
        0 0 30px rgba(138, 43, 226, 0.15);
}

.markdown-poster.atomic-cyber-theme .madopic-card:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(138, 43, 226, 0.2) 100%);
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 
        0 8px 32px rgba(0, 212, 255, 0.3),
        0 0 40px rgba(138, 43, 226, 0.2);
}

/* 原子朋克主题特效 */
.markdown-poster.atomic-punk-theme {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 25%, #fdc830 50%, #4ecdc4 75%, #00b4d8 100%) !important;
    position: relative;
}

.markdown-poster.atomic-punk-theme::before {
    background: radial-gradient(circle at 20% 30%, rgba(247, 147, 30, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(78, 205, 196, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(253, 200, 48, 0.15) 0%, transparent 60%);
}

.markdown-poster.atomic-punk-theme::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            90deg,
            rgba(255, 107, 53, 0.03) 0px,
            rgba(255, 107, 53, 0.03) 2px,
            transparent 2px,
            transparent 4px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(78, 205, 196, 0.03) 0px,
            rgba(78, 205, 196, 0.03) 2px,
            transparent 2px,
            transparent 4px
        );
    pointer-events: none;
    z-index: 1;
}

.markdown-poster.atomic-punk-theme .poster-content {
    background: rgba(255, 253, 247, 0.95) !important;
    border: 2px solid rgba(255, 107, 53, 0.4);
    box-shadow: 
        0 0 30px rgba(247, 147, 30, 0.4),
        0 0 60px rgba(78, 205, 196, 0.3),
        inset 0 0 80px rgba(253, 200, 48, 0.1);
    position: relative;
    z-index: 2;
}

.markdown-poster.atomic-punk-theme .poster-content h1 {
    color: #ff6b35;
    text-shadow: 
        2px 2px 0px rgba(247, 147, 30, 0.3),
        0 0 20px rgba(255, 107, 53, 0.4);
    font-weight: 800;
}

.markdown-poster.atomic-punk-theme .poster-content h2 {
    color: #f7931e;
    text-shadow: 0 0 15px rgba(247, 147, 30, 0.3);
    font-weight: 700;
}

.markdown-poster.atomic-punk-theme .poster-content h3 {
    color: #00b4d8;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
    font-weight: 600;
}

.markdown-poster.atomic-punk-theme .poster-content p,
.markdown-poster.atomic-punk-theme .poster-content li {
    color: #2d3748;
}

.markdown-poster.atomic-punk-theme .poster-content a {
    color: #ff6b35;
    border-bottom-color: #ff6b35;
    text-shadow: 0 0 8px rgba(255, 107, 53, 0.2);
    font-weight: 600;
}

.markdown-poster.atomic-punk-theme .poster-content a:hover {
    color: #f7931e;
    border-bottom-color: #f7931e;
}

.markdown-poster.atomic-punk-theme .poster-content code {
    background: rgba(253, 200, 48, 0.2);
    color: #d97706;
    border: 1px solid rgba(247, 147, 30, 0.3);
    box-shadow: 0 0 8px rgba(253, 200, 48, 0.2);
    font-weight: 600;
}

.markdown-poster.atomic-punk-theme .poster-content pre {
    background: rgba(45, 55, 72, 0.9);
    border: 2px solid rgba(78, 205, 196, 0.4);
    box-shadow: 
        inset 0 0 30px rgba(78, 205, 196, 0.1),
        0 0 20px rgba(78, 205, 196, 0.2);
}

.markdown-poster.atomic-punk-theme .poster-content pre code {
    color: #4ecdc4;
    background: transparent;
    border: none;
    box-shadow: none;
}

.markdown-poster.atomic-punk-theme .poster-content blockquote {
    border-left-color: #ff6b35;
    background: rgba(255, 107, 53, 0.08);
    color: #4a5568;
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.1);
}

.markdown-poster.atomic-punk-theme .poster-content strong {
    color: #ff6b35;
    font-weight: 800;
}

.markdown-poster.atomic-punk-theme .poster-content em {
    color: #00b4d8;
    font-style: italic;
}

.markdown-poster.atomic-punk-theme .madopic-card {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.12) 0%, rgba(253, 200, 48, 0.12) 100%);
    border-color: rgba(247, 147, 30, 0.4);
    box-shadow: 
        0 4px 20px rgba(255, 107, 53, 0.2),
        0 0 30px rgba(253, 200, 48, 0.15);
}

.markdown-poster.atomic-punk-theme .madopic-card:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.18) 0%, rgba(253, 200, 48, 0.18) 100%);
    border-color: rgba(247, 147, 30, 0.6);
    box-shadow: 
        0 8px 32px rgba(255, 107, 53, 0.3),
        0 0 40px rgba(253, 200, 48, 0.2);
}

.markdown-poster.atomic-punk-theme .madopic-card .card-title {
    color: #ff6b35;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.2);
}

.markdown-poster.atomic-punk-theme .madopic-card .card-content {
    color: #2d3748;
}

/* 蒸汽朋克主题特效 */
.markdown-poster.steampunk-theme {
    background: linear-gradient(135deg, #2c1810 0%, #3d2817 25%, #8b6914 50%, #cd853f 75%, #daa520 100%) !important;
    position: relative;
    font-family: 'Orbitron', 'Noto Sans Mono CJK SC', 'Sarasa Mono SC', 'Microsoft YaHei UI', monospace;
}

.markdown-poster.steampunk-theme::before {
    background: 
        radial-gradient(circle at 25% 40%, rgba(205, 133, 63, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 75% 60%, rgba(139, 105, 20, 0.15) 0%, transparent 50%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(139,105,20,0.1)" stroke-width="2"/><circle cx="50" cy="50" r="30" fill="none" stroke="rgba(205,133,63,0.1)" stroke-width="1"/><circle cx="50" cy="50" r="20" fill="none" stroke="rgba(218,165,32,0.1)" stroke-width="1"/></svg>');
    background-size: auto, auto, 200px 200px;
}

.markdown-poster.steampunk-theme::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            90deg,
            rgba(139, 105, 20, 0.05) 0px,
            rgba(139, 105, 20, 0.05) 1px,
            transparent 1px,
            transparent 10px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(139, 105, 20, 0.05) 0px,
            rgba(139, 105, 20, 0.05) 1px,
            transparent 1px,
            transparent 10px
        );
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
}

.markdown-poster.steampunk-theme .poster-content {
    background: rgba(60, 48, 38, 0.92) !important;
    border: 3px solid #8b6914;
    box-shadow: 
        0 0 0 1px #cd853f,
        0 0 30px rgba(139, 105, 20, 0.5),
        0 0 60px rgba(205, 133, 63, 0.3),
        inset 0 0 100px rgba(218, 165, 32, 0.08);
    position: relative;
    z-index: 2;
    font-family: 'Orbitron', 'Noto Sans Mono CJK SC', 'Sarasa Mono SC', 'Microsoft YaHei UI', monospace;
}

.markdown-poster.steampunk-theme .poster-content * {
    font-family: 'Orbitron', 'Noto Sans Mono CJK SC', 'Sarasa Mono SC', 'Microsoft YaHei UI', monospace !important;
}

.markdown-poster.steampunk-theme .poster-content h1 {
    color: #daa520;
    text-shadow: 
        2px 2px 0px rgba(139, 105, 20, 0.8),
        0 0 20px rgba(218, 165, 32, 0.6),
        0 0 30px rgba(205, 133, 63, 0.4);
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    border-bottom: 2px solid #8b6914;
    padding-bottom: 8px;
}

.markdown-poster.steampunk-theme .poster-content h2 {
    color: #cd853f;
    text-shadow: 
        1px 1px 0px rgba(139, 105, 20, 0.6),
        0 0 15px rgba(205, 133, 63, 0.4);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.markdown-poster.steampunk-theme .poster-content h3 {
    color: #daa520;
    text-shadow: 0 0 10px rgba(218, 165, 32, 0.3);
    font-weight: 700;
    letter-spacing: 1.5px;
}

.markdown-poster.steampunk-theme .poster-content p,
.markdown-poster.steampunk-theme .poster-content li {
    color: #e8dcc4;
    line-height: 1.8;
    letter-spacing: 1px;
    font-weight: 400;
}

.markdown-poster.steampunk-theme .poster-content a {
    color: #daa520;
    border-bottom: 2px solid #8b6914;
    text-shadow: 0 0 8px rgba(218, 165, 32, 0.3);
    font-weight: 700;
    text-decoration: none;
}

.markdown-poster.steampunk-theme .poster-content a:hover {
    color: #cd853f;
    border-bottom-color: #cd853f;
    text-shadow: 0 0 12px rgba(205, 133, 63, 0.5);
}

.markdown-poster.steampunk-theme .poster-content code {
    background: rgba(139, 105, 20, 0.3);
    color: #daa520;
    border: 2px solid #8b6914;
    box-shadow: 
        inset 0 0 10px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(139, 105, 20, 0.2);
    font-weight: 600;
    padding: 3px 8px;
    letter-spacing: 0.5px;
}

.markdown-poster.steampunk-theme .poster-content pre {
    background: rgba(28, 20, 13, 0.95);
    border: 3px double #8b6914;
    box-shadow: 
        inset 0 0 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(139, 105, 20, 0.3);
    padding: 20px;
}

.markdown-poster.steampunk-theme .poster-content pre code {
    color: #cd853f;
    background: transparent;
    border: none;
    box-shadow: none;
    text-shadow: 0 0 5px rgba(205, 133, 63, 0.3);
}

.markdown-poster.steampunk-theme .poster-content blockquote {
    border-left: 4px solid #8b6914;
    background: rgba(139, 105, 20, 0.15);
    color: #d4c5a9;
    box-shadow: 
        inset 0 0 20px rgba(139, 105, 20, 0.1),
        0 0 15px rgba(139, 105, 20, 0.1);
    font-style: italic;
    padding: 16px 20px;
}

.markdown-poster.steampunk-theme .poster-content strong {
    color: #daa520;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(218, 165, 32, 0.3);
}

.markdown-poster.steampunk-theme .poster-content em {
    color: #cd853f;
    font-style: italic;
}

.markdown-poster.steampunk-theme .poster-content table {
    border: 2px solid #8b6914;
}

.markdown-poster.steampunk-theme .poster-content table th {
    background: rgba(139, 105, 20, 0.3);
    color: #daa520;
    border: 1px solid #8b6914;
    font-weight: 700;
}

.markdown-poster.steampunk-theme .poster-content table td {
    border: 1px solid #8b6914;
    color: #e8dcc4;
}

.markdown-poster.steampunk-theme .madopic-card {
    background: linear-gradient(135deg, rgba(139, 105, 20, 0.2) 0%, rgba(205, 133, 63, 0.2) 100%);
    border: 2px solid #8b6914;
    box-shadow: 
        0 0 0 1px #cd853f,
        0 4px 20px rgba(139, 105, 20, 0.3),
        0 0 30px rgba(205, 133, 63, 0.2);
}

.markdown-poster.steampunk-theme .madopic-card:hover {
    background: linear-gradient(135deg, rgba(139, 105, 20, 0.3) 0%, rgba(205, 133, 63, 0.3) 100%);
    border-color: #cd853f;
    box-shadow: 
        0 0 0 1px #daa520,
        0 8px 32px rgba(139, 105, 20, 0.4),
        0 0 40px rgba(205, 133, 63, 0.3);
}

.markdown-poster.steampunk-theme .madopic-card .card-title {
    color: #daa520;
    text-shadow: 0 0 10px rgba(218, 165, 32, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.markdown-poster.steampunk-theme .madopic-card .card-content {
    color: #e8dcc4;
}

.markdown-poster.steampunk-theme .poster-content ul,
.markdown-poster.steampunk-theme .poster-content ol {
    color: #e8dcc4;
}

.markdown-poster.steampunk-theme .poster-content img {
    border: 3px solid #8b6914;
    box-shadow: 
        0 0 0 1px #cd853f,
        0 0 20px rgba(139, 105, 20, 0.3);
    filter: sepia(0.2) contrast(1.1);
}

.color-inputs {
    display: flex;
    gap: 16px;
}

.color-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.color-input-group label {
    font-size: 12px;
    color: #64748b;
}

input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background: white;
    cursor: pointer;
}

.panel-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

/* 遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* 响应式设计 */

/* 大屏 - 确保左右分栏各占一半 */
@media (min-width: 1200px) {
    .main-content {
        flex-direction: row;
    }
    
    .editor-panel,
    .preview-panel {
        flex: 1;
        width: 50%;
        max-width: 50%;
    }
    
    .editor-panel {
        border-right: 1px solid #e2e8f0;
        border-bottom: none;
    }
    
    /* 大屏工具栏优化 */
    .editor-tools {
        max-width: calc(100% - 150px); /* 为标题留出空间 */
    }
}

/* 中屏优化 - 工具栏按钮可能需要换行 */
@media (min-width: 900px) and (max-width: 1199px) {
    .panel-header {
        padding: 12px 20px;
    }
    
    .editor-tools {
        gap: 3px;
    }
    
    .tool-btn {
        width: 30px;
        height: 30px;
    }
}

/* 中等屏幕及以下 - 切换为上下布局，避免预览被挤压 */
@media (max-width: 1199px) {
    .main-content {
        flex-direction: column;
    }
    
    .editor-panel {
        height: 45vh;
        min-height: 300px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .preview-panel {
        height: 55vh;
        min-height: 400px;
    }
    
    /* 确保预览容器可以正常滚动 */
    .preview-container {
        overflow: auto;
    }
    
    .markdown-poster {
        width: 640px;
        max-width: calc(100% - 40px);
    }
}

/* 小屏幕优化 */
@media (max-width: 768px) {
    .editor-panel,
    .preview-panel {
        height: 50vh;
        min-height: 250px;
    }
    
    .toolbar {
        padding: 8px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .toolbar-left h1 {
        font-size: 18px;
    }
    
    .subtitle {
        display: none;
    }
    
    .toolbar-right {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .mode-group {
        margin-right: 0;
    }
    
    /* 隐藏部分按钮文字，只显示图标 */
    .btn span {
        display: none;
    }
    
    .btn {
        padding: 8px 12px;
    }
    
    .markdown-poster {
        width: calc(100vw - 40px);
        max-width: 640px;
        margin: 10px;
        padding: 20px;
    }
    
    .poster-content {
        padding: 20px;
    }
    
    /* 预览工具栏优化 */
    .preview-panel .panel-header {
        padding-right: 28px;
    }
    
    /* 编辑器面板头部优化 */
    .panel-header {
        padding: 10px 16px;
    }
    
    .panel-header h3 {
        font-size: 14px;
    }
    
    /* 减小工具按钮尺寸 */
    .tool-btn {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    
    .editor-tools {
        gap: 2px;
    }
    
    /* 隐藏部分不常用的工具按钮 */
    .tool-btn[data-action="pagebreak"],
    .tool-btn[data-action="empty-line"] {
        display: none;
    }
}

/* 超小屏幕 */
@media (max-width: 480px) {
    .toolbar-left h1 {
        font-size: 16px;
    }
    
    .app-icon {
        width: 20px !important;
        height: 20px !important;
    }
    
    .editor-panel,
    .preview-panel {
        height: 50vh;
        min-height: 200px;
    }
    
    .markdown-poster {
        padding: 15px;
        margin: 5px;
    }
    
    .poster-content {
        padding: 15px;
    }
    
    /* 进一步简化工具栏 */
    .editor-tools,
    .preview-tools {
        gap: 2px;
    }
    
    .tool-btn {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    
    .panel-header {
        padding: 8px 12px;
    }
    
    .panel-header h3 {
        font-size: 13px;
        gap: 4px;
    }
    
    /* 只显示最常用的编辑工具 */
    .tool-btn[data-action="sequence"],
    .tool-btn[data-action="gantt"],
    .tool-btn[data-action="pie"],
    .tool-btn[data-action="echarts"],
    .tool-btn[data-action="physics"],
    .tool-btn[data-action="chemistry"],
    .tool-btn[data-action="card"] {
        display: none;
    }
    
    /* 隐藏工具分隔线以节省空间 */
    .tool-separator {
        display: none;
    }
}

/* 缩放控制 */
.preview-content.zoom-75 {
    transform: scale(0.75);
}

.preview-content.zoom-50 {
    transform: scale(0.5);
}

.preview-content.zoom-125 {
    transform: scale(1.25);
}

.preview-content.zoom-150 {
    transform: scale(1.5);
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

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

.poster-content {
    animation: fadeIn 0.5s ease;
}

/* 工具提示 */
.tool-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

.tool-btn {
    position: relative;
}

/* GitHub 链接样式 */
.github-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    color: #24292e;
    border-radius: 50%;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.github-link:hover {
    color: #6366f1;
    transform: scale(1.1);
}

.github-link i {
    color: inherit;
}

/* 工具分隔线样式 */
.tool-separator {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 8px;
    flex-shrink: 0;
}



/* KaTeX 数学公式样式 */
.katex {
    font-size: 1.1em;
}

.katex-display {
    margin: 16px 0;
    text-align: center;
}

.katex-error {
    color: #cc0000;
    background: #ffe6e6;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
}

/* Mermaid 图表容器样式 */
.mermaid-diagram {
    margin: 16px 0;
    text-align: center;
    background: white;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.mermaid-diagram svg {
    max-width: 100%;
    height: auto;
}

.diagram-error-container {
    margin: 16px 0;
    text-align: center;
}

.diagram-error {
    display: inline-block;
    padding: 20px;
    border: 2px dashed #ff6b6b;
    border-radius: 8px;
    background-color: #ffe0e0;
    color: #d63031;
    font-family: monospace;
}

.error-title {
    font-weight: bold;
    margin-bottom: 8px;
}

.error-message {
    font-size: 12px;
    opacity: 0.8;
}

/* ECharts 容器样式 */
.echarts-container {
    margin: 16px 0;
    min-height: 400px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

/* 卡片样式 */
.madopic-card {
    margin: 20px 0;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 80px;
}

.madopic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
}



/* 卡片标题样式 */
.madopic-card .card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.madopic-card .card-title::before {
    content: '🎯';
    font-size: 18px;
}

/* 卡片内容样式 */
.madopic-card .card-content {
    color: var(--text-light);
    line-height: 1.7;
    font-size: var(--dynamic-font-size, 16px);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.madopic-card .card-content p {
    margin-bottom: 10px;
}

.madopic-card .card-content p:last-child {
    margin-bottom: 0;
}

/* 卡片内的列表样式 */
.madopic-card .card-content ul,
.madopic-card .card-content ol {
    margin: 12px 0;
    padding-left: 20px;
}

.madopic-card .card-content li {
    margin-bottom: 8px;
    color: var(--text-light);
}

/* 卡片内的代码样式 */
.madopic-card .card-content code {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: calc(var(--dynamic-font-size, 16px) * 0.875);
}

/* 卡片内的链接样式 */
.madopic-card .card-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.madopic-card .card-content a:hover {
    border-bottom-color: var(--primary-color);
}

/* 不同类型的卡片样式 */
.madopic-card.card-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(29, 78, 216, 0.12) 100%);
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
}

.madopic-card.card-info:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(29, 78, 216, 0.15) 100%);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.15);
}



.madopic-card.card-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.12) 100%);
    border-color: rgba(16, 185, 129, 0.2);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1);
}

.madopic-card.card-success:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.15) 100%);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.15);
}



.madopic-card.card-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.12) 100%);
    border-color: rgba(245, 158, 11, 0.2);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.1);
}

.madopic-card.card-warning:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.15) 100%);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.15);
}



.madopic-card.card-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(220, 38, 38, 0.12) 100%);
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.1);
}

.madopic-card.card-error:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.15);
}



.madopic-card.card-info .card-title::before {
    content: 'ℹ️';
}

.madopic-card.card-success .card-title::before {
    content: '✅';
}

.madopic-card.card-warning .card-title::before {
    content: '⚠️';
}

.madopic-card.card-error .card-title::before {
    content: '❌';
}

/* 分页符指示器样式 */
.page-break-indicator {
    margin: 20px 0;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    border: 2px dashed rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 页码标签样式 */
.page-number-label {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 小红书多页预览容器样式调整 */
body[data-mode="xhs"] .preview-container,
.preview-container.xhs-multi-page {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
    justify-content: flex-start; /* 从顶部开始，尊重 padding-top */
    padding-top: 40px;
}

/* 小红书模式下每个页面的包装 */
body[data-mode="xhs"] .preview-content,
.preview-content.xhs-page {
    position: relative;
    margin: 0;
}

/* 小红书多页模式下，移除 markdown-poster 的 margin，避免与容器顶部对齐问题 */
.preview-content.xhs-page .markdown-poster {
    margin: 0;
}