/* 资讯详情页面样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 面包屑导航 */
.breadcrumb {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px 15px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
    color: #999;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}
.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* 页面容器 */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 24px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    background: #fff;
}

/* 文章主体 */
.article-main {
    background: white;
    border-radius: 8px;
    padding: 30px;
    border: 1px solid #e8e8e8;
    min-width:100%;
}

.article-header {
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 25px;
    margin-bottom: 25px;
}

.article-category {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 15px;
}

.article-title {
    font-size: 28px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    margin-bottom: 15px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #999;
    font-size: 14px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-cover {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.article-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: #444;
}

/* Markdown 内容样式 */
.markdown-body {
    word-wrap: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: #222;
}

.markdown-body h1 {
    font-size: 2em;
    border-bottom: 2px solid #e8e8e8;
    padding-bottom: 0.3em;
}

.markdown-body h2 {
    font-size: 1.6em;
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 0.3em;
}

.markdown-body h3 {
    font-size: 1.3em;
}

.markdown-body h4 {
    font-size: 1.1em;
}

.markdown-body h5 {
    font-size: 1em;
}

.markdown-body h6 {
    font-size: 0.9em;
    color: #666;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.markdown-body p {
    margin-top: 0;
    margin-bottom: 16px;
}

.markdown-body a {
    color: #667eea;
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.markdown-body strong {
    font-weight: 600;
}

.markdown-body em {
    font-style: italic;
}

.markdown-body del {
    text-decoration: line-through;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    display: block;
}

.markdown-body img {
    max-width: 100%;
    box-sizing: content-box;
    background-color: #fff;
    border-radius: 8px;
    margin: 1.5rem auto;
    display: block;
}

.markdown-body img[align=right] {
    padding-left: 20px;
}

.markdown-body img[align=left] {
    padding-right: 20px;
}

.article-content h2 {
    font-size: 1.6rem;
    margin: 2rem 0 1rem;
    color: #222;
}

.article-content h3 {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.8rem;
    color: #333;
}

/* 任务列表样式 */
.markdown-body input[type="checkbox"] {
    margin-right: 0.5em;
}

.markdown-body .task-list-item {
    list-style-type: none;
}

.markdown-body .task-list-item input {
    margin: 0 0.2em 0.25em -1.6em;
    vertical-align: middle;
}

/* 语法高亮增强 */
.markdown-body .highlight pre,
.markdown-body pre {
    background-color: #f6f8fa;
    border-radius: 6px;
}

.markdown-body pre code {
    background-color: transparent;
}

/* 脚注样式 */
.markdown-body .footnotes {
    border-top: 1px solid #e8e8e8;
    margin-top: 2rem;
    padding-top: 1rem;
    font-size: 0.9em;
    color: #666;
}

.markdown-body .footnotes ol {
    padding-left: 1.5em;
}

.markdown-body .footnote-ref {
    text-decoration: none;
}

.article-content ul,
.article-content ol {
    margin: 1rem 0 1.5rem 2rem;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 2em;
    margin-top: 0;
    margin-bottom: 16px;
}

.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ol,
.markdown-body ol ul {
    margin-top: 0;
    margin-bottom: 0;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.markdown-body li {
    word-wrap: break-all;
}

.markdown-body li + li {
    margin-top: 0.25em;
}

.article-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #666;
    font-style: italic;
}

.markdown-body blockquote {
    margin: 0;
    margin-bottom: 16px;
    padding: 0 1em;
    color: #666;
    border-left: 0.25em solid #667eea;
    background-color: #f8f9fa;
}

.markdown-body blockquote > :first-child {
    margin-top: 0;
}

.markdown-body blockquote > :last-child {
    margin-bottom: 0;
}

.markdown-body hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: #e8e8e8;
    border: 0;
}

.article-content code {
    background: #f5f7fa;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.markdown-body code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(175, 184, 193, 0.2);
    border-radius: 6px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, 'Courier New', monospace;
}

.article-content pre {
    background: #282c34;
    color: #abb2bf;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.markdown-body pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f6f8fa;
    border-radius: 6px;
    margin-bottom: 16px;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.markdown-body pre code {
    display: inline;
    max-width: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    line-height: inherit;
    word-wrap: normal;
    background-color: transparent;
    border: 0;
    color: #24292f;
}

.markdown-body table {
    border-spacing: 0;
    border-collapse: collapse;
    display: block;
    width: 100%;
    overflow: auto;
    margin-bottom: 16px;
}

.markdown-body table th {
    font-weight: 600;
}

.markdown-body table th,
.markdown-body table td {
    padding: 6px 13px;
    border: 1px solid #d0d7de;
}

.markdown-body table tr {
    background-color: #fff;
    border-top: 1px solid #d0d7de;
}

.markdown-body table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

/* 文章底部 */
.article-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f2f5;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.tag {
    padding: 0.4rem 1rem;
    background: #f5f7fa;
    color: #666;
    border-radius: 20px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s;
}

.tag:hover {
    background: #667eea;
    color: white;
}

.share-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.share-section h4 {
    color: #666;
    font-weight: 500;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e6ed;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.share-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.sidebar-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 相关文章 */
.related-article {
    display: block;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f2f5;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
}

.related-article:last-child {
    border-bottom: none;
}

.related-article:hover {
    transform: translateX(5px);
}

.related-article:hover .related-title {
    color: #667eea;
}

.related-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-meta {
    font-size: 0.85rem;
    color: #999;
    display: flex;
    gap: 1rem;
}

/* 返回按钮 */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    margin-top: 2rem;
}

.back-button:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .page-container {
        grid-template-columns: 1fr;
        padding: 24px 16px;
    }

    .article-main {
        padding: 2rem;
    }

    .article-title {
        font-size: 1.8rem;
    }

    .sidebar {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .breadcrumb {
        padding: 16px 16px;
        font-size: 14px;
        overflow-x: auto;
        white-space: nowrap;
    }

    .page-container {
        padding: 20px 16px;
    }

    .article-main {
        padding: 1.5rem;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .article-meta {
        gap: 1rem;
    }

    .article-content {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .breadcrumb {
        padding: 12px 12px;
        font-size: 12px;
        overflow-x: auto;
        white-space: nowrap;
    }

    .page-container {
        padding: 16px 12px;
    }

    .article-main {
        padding: 1rem;
    }

    .article-title {
        font-size: 1.3rem;
    }

    .article-meta {
        font-size: 0.85rem;
        gap: 0.8rem;
    }

    .sidebar-card {
        padding: 1rem;
    }
}
