/* 文章页面专用样式 - 与主站风格保持一致 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #374151;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 50%, #ecfdf5 100%);
    min-height: 100vh;
}

/* 导航栏样式 - 与主站保持一致 */
.header {
    background: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #111827;
    font-size: 1.25rem;
    font-weight: 700;
    transition: color 0.3s ease;
}

.logo:hover {
    color: #059669;
}

.logo-icon {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    border-radius: 4px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    color: #059669;
}

/* 主内容区域 */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    min-height: calc(100vh - 64px);
    width: 100%;
}

/* 左侧目录导航 */
.table-of-contents {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.toc-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #059669;
}

.toc-list {
    list-style: none;
}

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-list a {
    text-decoration: none;
    color: #6b7280;
    font-size: 0.875rem;
    padding: 0.25rem 0;
    display: block;
    transition: all 0.3s ease;
    border-radius: 6px;
    padding-left: 0.5rem;
}

.toc-list a:hover {
    color: #059669;
    background: #f0fdf4;
    padding-left: 1rem;
}

.toc-list .toc-level-2 {
    padding-left: 1rem;
    font-size: 0.8125rem;
}

.toc-list .toc-level-3 {
    padding-left: 1.5rem;
    font-size: 0.75rem;
}

/* 文章内容区域 */
.article-container {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    width: 100%;
    max-width: none;
}

.back-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #059669;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #047857;
}

.back-link::before {
    content: '←';
    margin-right: 0.5rem;
}

/* 文章标题 */
.article-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
    line-height: 1.2;
}

/* 文章元信息 */
.article-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #6b7280;
}

.article-category {
    background: #f0fdf4;
    color: #059669;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 500;
}

/* 分享按钮 */
.share-inline {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* 文章内容样式 */
.article-content {
    font-size: 1rem;
    line-height: 1.75;
    color: #374151;
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #111827;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0fdf4;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 1.5rem 0 1rem 0;
}

.article-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 1.25rem 0 0.75rem 0;
}

.article-content p {
    margin-bottom: 1.25rem;
}

.article-content ul, .article-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 4px solid #059669;
    background: #f0fdf4;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 6px 6px 0;
}

.article-content code {
    background: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

.article-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.article-content a {
    color: #059669;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.article-content a:hover {
    border-bottom-color: #059669;
}

/* 广告区域 */
.ad-container {
    margin: 2rem 0;
    text-align: center;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* 响应式设计 */
/* 大屏幕优化 */
@media (min-width: 1600px) {
    .main-content {
        max-width: 1800px;
        grid-template-columns: 300px 1fr;
        gap: 4rem;
        padding: 3rem 2rem;
    }
    
    .article-container {
        padding: 3rem;
    }
}

@media (min-width: 1200px) and (max-width: 1599px) {
    .main-content {
        grid-template-columns: 280px 1fr;
        gap: 3.5rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem;
        display: flex;
        flex-direction: column;
    }
    
    .article-container {
        padding: 1.5rem;
        order: 1;
    }
    
    .share-inline {
        order: 2;
        margin-bottom: 1.5rem;
    }
    
    .table-of-contents {
        position: static;
        order: 3;
        margin-top: 0;
        margin-bottom: 2rem;
        background: #f9fafb;
        padding: 1rem;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
    }
    
    .article-content {
        order: 4;
    }
    
    .article-title {
        font-size: 1.875rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-menu {
        display: none;
    }
}

/* Footer样式 - 与主站保持一致 */
footer {
    width: 100%;
    margin: 0;
    padding: 0;
}

footer .max-w-6xl {
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
}

footer .px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

footer .sm\:px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

footer .lg\:px-8 {
    padding-left: 2rem;
    padding-right: 2rem;
}

footer .flex {
    display: flex;
}

footer .flex-col {
    flex-direction: column;
}

footer .md\:flex-row {
    flex-direction: row;
}

footer .justify-between {
    justify-content: space-between;
}

footer .items-center {
    align-items: center;
}

footer .mb-4 {
    margin-bottom: 1rem;
}

footer .md\:mb-0 {
    margin-bottom: 0;
}

footer .space-x-6 > * + * {
    margin-left: 1.5rem;
}

footer .text-sm {
    font-size: 0.875rem;
}

footer .text-gray-600 {
    color: #6b7280;
}

footer .text-gray-700 {
    color: #374151;
}

footer .hover\:text-gray-800:hover {
    color: #1f2937;
}

footer .transition-colors {
    transition-property: color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

footer .duration-300 {
    transition-duration: 300ms;
}

footer .py-6 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

@media (min-width: 640px) {
    footer .sm\:px-6 {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 768px) {
    footer .md\:flex-row {
        flex-direction: row;
    }
    
    footer .md\:mb-0 {
        margin-bottom: 0;
    }
}

@media (min-width: 1024px) {
    footer .lg\:px-8 {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 0.75rem;
    }
    
    .article-container {
        padding: 1rem;
    }
    
    .article-title {
        font-size: 1.5rem;
    }
    
    .share-inline {
        flex-wrap: wrap;
    }
}