* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f5f5f5; color: #333; line-height: 1.6; }

/* 顶部导航 */
.navbar { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 1rem 0; box-shadow: 0 2px 10px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 1000; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; display: flex; justify-content: space-between; align-items: center; }
.nav-logo { font-size: 1.5rem; font-weight: bold; color: white; text-decoration: none; }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-link { color: white; text-decoration: none; transition: opacity 0.3s; }
.nav-link:hover { opacity: 0.8; }
.search-box { padding: 0.5rem 1rem; border: none; border-radius: 20px; background: rgba(255,255,255,0.2); color: white; width: 200px; }
.search-box::placeholder { color: rgba(255,255,255,0.7); }

/* 主布局 */
.container { max-width: 1200px; margin: 2rem auto; padding: 0 2rem; display: grid; grid-template-columns: 250px 1fr; gap: 2rem; }

/* 侧边栏 */
.sidebar { background: white; padding: 1.5rem; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); height: fit-content; position: sticky; top: 80px; }
.sidebar h3 { margin-bottom: 1rem; color: #667eea; }
.sidebar ul { list-style: none; }
.sidebar li { margin-bottom: 0.5rem; }
.sidebar a { color: #666; text-decoration: none; transition: color 0.3s; }
.sidebar a:hover { color: #667eea; }

/* 内容区 */
.content { background: white; padding: 2rem; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }

/* 文章列表 */
.post-list { display: flex; flex-direction: column; gap: 0; }
.post-card { padding: 16px 0; border-bottom: 1px solid #eaecf0; cursor: pointer; transition: background 0.15s; }
.post-card:hover { background: rgba(102,126,234,0.03); }
.post-card h3 { color: #0645ad; margin-bottom: 4px; }
.post-card h3:hover { text-decoration: underline; }
.post-meta { font-size: 13px; color: #999; margin-bottom: 4px; }
.post-excerpt { color: #666; font-size: 14px; line-height: 1.6; }
.post-category { display: inline-block; background: #667eea; color: white; padding: 2px 10px; border-radius: 15px; font-size: 12px; margin-top: 6px; }

/* 编辑器 */
.post-editor { max-width: 100%; }
.editor-header h1, .post-editor h2 { font-size: 22px; color: #333; margin-bottom: 16px; border-bottom: 2px solid #eaecf0; padding-bottom: 8px; }
.editor-toolbar { background: #f8f9fa; border: 1px solid #ddd; padding: 8px; margin-bottom: 12px; display: flex; gap: 4px; flex-wrap: wrap; }
.editor-toolbar button { padding: 6px 12px; background: white; border: 1px solid #ddd; cursor: pointer; font-size: 14px; border-radius: 4px; }
.editor-toolbar button:hover { background: #eaecf0; }
.editor-form label { display: block; font-size: 14px; font-weight: 600; color: #333; margin-bottom: 4px; margin-top: 12px; }
.input-field { width: 100%; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; }
.input-field:focus { outline: none; border-color: #667eea; }
.textarea-field { width: 100%; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; min-height: 300px; resize: vertical; font-family: 'Consolas', monospace; }
.button-group { margin-top: 16px; display: flex; gap: 8px; }

/* 按钮 */
.btn { padding: 10px 20px; border: 1px solid #ddd; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.2s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.1); }
.btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border: none; }
.btn-primary:hover { background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%); }
.btn-secondary { background: #f5f5f5; color: #666; }
.btn-secondary:hover { background: #eaecf0; }

/* 文章查看 */
.post-actions-top { display: flex; gap: 8px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #eaecf0; }
#post-content-view h1 { font-size: 28px; color: #333; margin-bottom: 8px; border-bottom: 2px solid #eaecf0; padding-bottom: 8px; }
#post-content-view h2 { font-size: 20px; color: #333; margin-top: 20px; margin-bottom: 8px; border-bottom: 1px solid #eaecf0; padding-bottom: 4px; }
#post-content-view h3 { font-size: 17px; color: #333; margin-top: 16px; margin-bottom: 6px; }
#post-content-view p { margin-bottom: 12px; line-height: 1.75; }
#post-content-view code { background: #f5f5f5; padding: 2px 6px; border: 1px solid #ddd; border-radius: 4px; font-family: 'Consolas', monospace; font-size: 13px; }
#post-content-view pre { background: #f5f5f5; border: 1px solid #ddd; border-radius: 8px; padding: 12px; overflow-x: auto; margin-bottom: 12px; }
#post-content-view pre code { background: none; border: none; padding: 0; }
#post-content-view a { color: #0645ad; }
#post-content-view a:hover { text-decoration: underline; }
#post-content-view .post-meta { font-size: 13px; color: #999; margin-bottom: 16px; }

.preview-area { border: 1px solid #ddd; border-radius: 8px; padding: 16px; margin-top: 12px; background: #f8f9fa; max-height: 400px; overflow-y: auto; }
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state h2 { font-size: 22px; color: #666; margin-bottom: 8px; }

@media (max-width: 768px) {
    .container { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .nav-container { flex-direction: column; gap: 1rem; }
    .search-box { width: 100%; }
}