/* 文章内容样式 - Markdown 转 HTML 后的美化样式 */
.post-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.8;
    color: #2c3e50;
    font-size: 16px;
    max-width: 100%;
    word-wrap: break-word;
}

/* 标题样式 */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    font-weight: 600;
    line-height: 1.4;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #1a202c;
    position: relative;
}

.post-content h1 {
    font-size: 2.25rem;
    border-bottom: 3px solid #3eaf7c;
    padding-bottom: 0.5rem;
    margin-top: 0;
}

.post-content h2 {
    font-size: 1.875rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.3rem;
}

.post-content h3 {
    font-size: 1.5rem;
    color: #2d3748;
}

.post-content h3::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 1.2em;
    background: linear-gradient(135deg, #3eaf7c, #2ecc71);
    margin-right: 0.5rem;
    vertical-align: middle;
    border-radius: 2px;
}

.post-content h4 {
    font-size: 1.25rem;
    color: #4a5568;
}

.post-content h5 {
    font-size: 1.125rem;
    color: #4a5568;
}

.post-content h6 {
    font-size: 1rem;
    color: #718096;
    font-weight: 500;
}

/* 段落样式 */
.post-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
    text-justify: inter-ideograph;
}

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

/* 链接样式 */
.post-content a {
    color: #3eaf7c;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.post-content a:hover {
    color: #2ecc71;
    border-bottom-color: #3eaf7c;
}

.post-content a:visited {
    color: #8e44ad;
}

/* 强调文本 */
.post-content strong,
.post-content b {
    font-weight: 600;
    color: #1a202c;
}

.post-content em,
.post-content i {
    font-style: italic;
    color: #4a5568;
}

/* 删除线 */
.post-content del,
.post-content s {
    text-decoration: line-through;
    color: #a0aec0;
}

/* 列表样式 */
.post-content ul,
.post-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-content ul {
    list-style: none;
}

.post-content ul li {
    position: relative;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
}

.post-content ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #3eaf7c, #2ecc71);
    border-radius: 50%;
    transform: translateY(-50%);
}

.post-content ol {
    counter-reset: list-counter;
}

.post-content ol li {
    position: relative;
    margin-bottom: 0.5rem;
    padding-left: 2rem;
    counter-increment: list-counter;
}

.post-content ol li::before {
    content: counter(list-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.5rem;
    height: 1.5rem;
    background: linear-gradient(135deg, #3eaf7c, #2ecc71);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* 嵌套列表 */
.post-content ul ul,
.post-content ol ol,
.post-content ul ol,
.post-content ol ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.post-content ul ul li::before {
    background: #cbd5e0;
    width: 4px;
    height: 4px;
}

/* 引用块样式 */
.post-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(62, 175, 124, 0.05), rgba(46, 204, 113, 0.05));
    border-left: 4px solid #3eaf7c;
    border-radius: 0 8px 8px 0;
    position: relative;
    font-style: italic;
    color: #4a5568;
}

.post-content blockquote::before {
    content: "\201C";
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    font-size: 2rem;
    color: #3eaf7c;
    opacity: 0.3;
}

.post-content blockquote p {
    margin-bottom: 0;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* 代码样式 */
.post-content code {
    background: #f7fafc;
    color: #e53e3e;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875em;
    border: 1px solid #e2e8f0;
}

.post-content pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.post-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* 代码块语言标签 */
.post-content pre::before {
    content: attr(data-lang);
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: #a0aec0;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* 表格样式 */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-content table th,
.post-content table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.post-content table th {
    background: linear-gradient(135deg, #3eaf7c, #2ecc71);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.post-content table tr:hover {
    background: #f7fafc;
}

.post-content table tr:last-child td {
    border-bottom: none;
}

/* 水平分割线 */
.post-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3eaf7c, transparent);
    margin: 3rem 0;
    border-radius: 1px;
}

/* 图片样式 */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
    transition: transform 0.3s ease;
}

.post-content img:hover {
    transform: scale(1.02);
}

/* 任务列表 */
.post-content input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

.post-content .task-list-item {
    list-style: none;
    margin-left: -2rem;
    padding-left: 2rem;
}

.post-content .task-list-item::before {
    display: none;
}

/* 键盘按键样式 */
.post-content kbd {
    background: #f7fafc;
    border: 1px solid #cbd5e0;
    border-bottom: 2px solid #a0aec0;
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    color: #2d3748;
    box-shadow: inset 0 -1px 0 #a0aec0;
}

/* 标记文本 */
.post-content mark {
    background: linear-gradient(120deg, rgba(255, 235, 59, 0.3) 0%, rgba(255, 235, 59, 0.3) 100%);
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}

/* 脚注样式 */
.post-content .footnote {
    font-size: 0.875rem;
    color: #718096;
    border-top: 1px solid #e2e8f0;
    margin-top: 3rem;
    padding-top: 1.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .post-content {
        font-size: 15px;
        line-height: 1.7;
    }
    
    .post-content h1 {
        font-size: 1.875rem;
    }
    
    .post-content h2 {
        font-size: 1.5rem;
    }
    
    .post-content h3 {
        font-size: 1.25rem;
    }
    
    .post-content ul,
    .post-content ol {
        padding-left: 1.5rem;
    }
    
    .post-content blockquote {
        padding: 1rem 1.5rem;
        margin: 1.5rem 0;
    }
    
    .post-content pre {
        padding: 1rem;
        margin: 1.5rem 0;
    }
    
    .post-content table {
        font-size: 0.875rem;
    }
    
    .post-content table th,
    .post-content table td {
        padding: 0.75rem 0.5rem;
    }
}

/* 打印样式 */
@media print {
    .post-content {
        color: #000;
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .post-content a {
        color: #000;
        text-decoration: underline;
    }
    
    .post-content pre {
        background: #f5f5f5;
        color: #000;
        border: 1px solid #ccc;
    }
    
    .post-content img {
        max-width: 100%;
        box-shadow: none;
    }
}

/* TOC侧边栏样式 */
.toc-container {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.toc-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 4px;
}

.toc-link {
    display: block;
    padding: 6px 0;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.4;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.toc-link:hover {
    color: #3eaf7c;
    background-color: rgba(62, 175, 124, 0.1);
    padding-left: 8px;
}

.toc-link.active {
    color: #3eaf7c;
    font-weight: 600;
    background-color: rgba(62, 175, 124, 0.15);
    padding-left: 8px;
}

.toc-level-1 { padding-left: 0; }
.toc-level-2 { padding-left: 16px; }
.toc-level-3 { padding-left: 32px; }
.toc-level-4 { padding-left: 48px; }
.toc-level-5 { padding-left: 64px; }
.toc-level-6 { padding-left: 80px; }

/* TOC子列表样式 */
.toc-sublist {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-top: 4px;
}

/* 隐藏TOC在小屏幕上 */
@media (max-width: 768px) {
    .toc-container {
        display: none;
    }
}