/* 基础样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background-color: #f5f5f5; height: 100vh; overflow: hidden; }

/* 布局容器 */
.container { display: flex; flex-direction: column; height: 100vh; }
.header { background-color: #2c3e50; color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.header h1 { font-size: 24px; font-weight: 500; }
.header-buttons { display: flex; gap: 10px; }

/* 按钮样式 */
.btn { padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; transition: all 0.3s ease; display: flex; align-items: center; gap: 5px; }
.btn-primary { background-color: #3498db; color: white; }
.btn-primary:hover { background-color: #2980b9; }
.btn-secondary { background-color: #95a5a6; color: white; }
.btn-secondary:hover { background-color: #7f8c8d; }

/* 工具栏 */
.toolbar { background-color: #34495e; padding: 10px 20px; display: flex; gap: 10px; flex-wrap: wrap; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.toolbar button { background-color: #2c3e50; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 14px; transition: all 0.3s ease; }
.toolbar button:hover { background-color: #1a252f; }

/* 编辑器容器 */
.editor-container { flex: 1; display: flex; overflow: hidden; }
.pane { flex: 1; display: flex; flex-direction: column; background-color: white; overflow: hidden; }
.pane-header { background-color: #ecf0f1; padding: 10px 20px; border-bottom: 1px solid #ddd; font-weight: 500; color: #2c3e50; }

/* 编辑器和预览 */
#editor { flex: 1; border: none; outline: none; padding: 20px; font-family: 'Consolas', 'Monaco', 'Courier New', monospace; font-size: 14px; line-height: 1.6; resize: none; background-color: #fafafa; }
#preview { flex: 1; overflow-y: auto; padding: 20px; background-color: white; }

/* 分隔条 */
.divider { width: 2px; background-color: #ddd; cursor: col-resize; position: relative; }
.divider:hover { background-color: #3498db; }

/* 全屏模式 */
.fullscreen #editor { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; background-color: white; padding: 40px; font-size: 16px; }

/* 状态栏 */
.status-bar { background-color: #34495e; color: white; padding: 5px 20px; font-size: 12px; display: flex; justify-content: space-between; }

/* Markdown预览样式 */
#preview h1, #preview h2, #preview h3, #preview h4, #preview h5, #preview h6 { margin-top: 20px; margin-bottom: 10px; font-weight: 600; }
#preview h1 { font-size: 2em; border-bottom: 2px solid #eee; padding-bottom: 5px; }
#preview h2 { font-size: 1.5em; }
#preview h3 { font-size: 1.25em; }
#preview p { margin-bottom: 10px; line-height: 1.6; }
#preview code { background-color: #f4f4f4; padding: 2px 4px; border-radius: 3px; font-family: 'Consolas', 'Monaco', 'Courier New', monospace; font-size: 0.9em; }
#preview pre { background-color: #f4f4f4; padding: 15px; border-radius: 5px; overflow-x: auto; margin-bottom: 10px; }
#preview pre code { background-color: transparent; padding: 0; }
#preview blockquote { border-left: 4px solid #ddd; padding-left: 15px; margin-left: 0; color: #666; font-style: italic; }
#preview ul, #preview ol { margin-left: 20px; margin-bottom: 10px; }
#preview li { margin-bottom: 5px; }
#preview a { color: #3498db; text-decoration: none; }
#preview a:hover { text-decoration: underline; }
#preview img { max-width: 100%; height: auto; display: block; margin: 10px 0; }
#preview table { border-collapse: collapse; width: 100%; margin-bottom: 10px; }
#preview th, #preview td { border: 1px solid #ddd; padding: 8px; text-align: left; }
#preview th { background-color: #f4f4f4; font-weight: 600; }

/* 响应式设计 */
@media (max-width: 768px) { .editor-container { flex-direction: column; } .divider { width: 100%; height: 2px; cursor: row-resize; } }