/* 字体定义 */
@font-face {
    font-family: '甜甜圈海报字体';
    src: url('/assets/fonts/甜甜圈海报字体.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --text-color: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg-color: #fff;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-light);
    background-image: url('/assets/images/backgroundPicture.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    position: relative;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(248, 249, 250, 0.65);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    font-family: '甜甜圈海报字体', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

.nav-item {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--primary-color);
}

/* 主内容区域 */
.main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* 博客布局 */
.blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 2rem;
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 2rem;
}

/* 文章卡片 */
.article-card {
    background: rgba(255, 255, 255, 0.75);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}

.article-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.article-cover {
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.article-card:hover .article-cover img {
    transform: scale(1.05);
}

.article-content {
    padding: 1.5rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.article-category,
.article-label {
    background: var(--bg-light);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    color: var(--primary-color);
}

.article-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-family: '甜甜圈海报字体', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.article-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.article-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.stat-item svg {
    width: 16px;
    height: 16px;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.read-more:hover {
    color: var(--secondary-color);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.page-btn:hover,
.page-btn.active {
    background: var(--primary-color);
    color: var(--bg-color);
    border-color: var(--primary-color);
}

/* 侧边栏 */
.blog-sidebar,
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-widget {
    background: rgba(255, 255, 255, 0.75);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.widget-title {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
    font-family: '甜甜圈海报字体', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.category-list,
.article-list {
    list-style: none;
}

.category-list li,
.article-list li {
    margin-bottom: 0.75rem;
}

.category-list a,
.article-list a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    display: block;
}

.category-list a:hover,
.article-list a:hover {
    color: var(--primary-color);
    padding-left: 0.5rem;
}

.article-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-count {
    font-size: 0.875rem;
    color: var(--text-lighter);
}

/* 文章详情页 */
.article-detail {
    background: rgba(255, 255, 255, 0.75);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    /* 关键：允许 grid 子项收缩，避免长代码把页面整体撑宽（移动端会被迫缩放） */
    min-width: 0;
}

.article-header {
    margin-bottom: 2rem;
}

.article-back {
    margin-bottom: 0.75rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-color);
    background: rgba(17, 24, 39, 0.10);
    border: 1px solid rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    font-size: 0.9rem;
}

.back-btn:hover {
    background: rgba(17, 24, 39, 0.16);
    transform: translateY(-1px);
}

.article-detail .article-title {
    font-size: 2rem;
    margin: 1rem 0;
    font-family: '甜甜圈海报字体', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info {
    flex: 1;
}

.author-name {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.article-cover-image {
    width: 100%;
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.article-cover-image img {
    width: 100%;
    height: auto;
    display: block;
}

.article-body {
    line-height: 1.8;
    color: var(--text-color);
    margin: 2rem 0;
    min-width: 0;
}

/* Markdown 样式 */
.article-body.markdown-body {
    font-size: 16px;
}

.markdown-body {
    box-sizing: border-box;
    min-width: 200px;
    max-width: 980px;
    margin: 0 auto;
    padding: 0;
    min-width: 0;
}

.markdown-body * {
    box-sizing: border-box;
}

.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: var(--text-color);
}

.markdown-body h1 {
    font-size: 2em;
    border-bottom: 1px solid rgba(224, 224, 224, 0.5);
    padding-bottom: 0.3em;
}

.markdown-body h2 {
    font-size: 1.5em;
    border-bottom: 1px solid rgba(224, 224, 224, 0.5);
    padding-bottom: 0.3em;
}

.markdown-body h3 {
    font-size: 1.25em;
}

.markdown-body h4 {
    font-size: 1em;
}

.markdown-body p {
    margin-bottom: 16px;
    line-height: 1.8;
}

.markdown-body code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

.markdown-body pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 6px;
    margin: 16px 0;
}

.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;
}

.markdown-body pre > code {
    padding: 0;
    margin: 0;
    font-size: 100%;
    word-break: normal;
    white-space: pre;
    background: transparent;
    border: 0;
}

.markdown-body blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    margin: 0 0 16px 0;
}

.markdown-body ul,
.markdown-body ol {
    margin-top: 0;
    margin-bottom: 16px;
    padding-left: 2em;
}

.markdown-body li {
    margin-bottom: 0.25em;
}

.markdown-body table {
    border-spacing: 0;
    border-collapse: collapse;
    margin: 16px 0;
    width: 100%;
}

.markdown-body table th,
.markdown-body table td {
    padding: 6px 13px;
    border: 1px solid #dfe2e5;
}

.markdown-body table th {
    font-weight: 600;
    background-color: rgba(27, 31, 35, 0.05);
}

.markdown-body table tr {
    background-color: #fff;
    border-top: 1px solid #c6cbd1;
}

.markdown-body table tr:nth-child(2n) {
    background-color: rgba(27, 31, 35, 0.02);
}

.markdown-body img {
    max-width: 100%;
    box-sizing: content-box;
    background-color: #fff;
    border-radius: 4px;
    margin: 16px 0;
}

.markdown-body hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: #e1e4e8;
    border: 0;
}

/* Highlight.js 样式调整 */
.markdown-body .hljs {
    display: block;
    overflow-x: auto;
    padding: 1em;
    background: #f6f8fa;
    border-radius: 6px;
}

.markdown-body .hljs-ln-numbers {
    text-align: right;
    color: #999;
    border-right: 1px solid #ddd;
    vertical-align: top;
    padding-right: 8px;
    padding-left: 8px;
    user-select: none;
}

.markdown-body .hljs-ln-code {
    padding-left: 16px;
}

/* Mac 风格代码块 */
.mac-codeblock {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin: 16px 0;
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(10px);
    min-width: 0;
}

.mac-codeblock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(31, 41, 55, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mac-dots {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 72px;
}

.mac-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

.mac-dots .dot-red { background: #ff5f57; }
.mac-dots .dot-yellow { background: #febc2e; }
.mac-dots .dot-green { background: #28c840; }

.mac-codeblock-title {
    flex: 1;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(229, 231, 235, 0.9);
    user-select: none;
}

.mac-codeblock-actions {
    min-width: 72px;
    display: flex;
    justify-content: flex-end;
}

.mac-codeblock-copy {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(17, 24, 39, 0.7);
    color: rgba(243, 244, 246, 0.95);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.15s ease;
}

.mac-codeblock-copy:hover {
    background: rgba(17, 24, 39, 0.95);
    transform: translateY(-1px);
}

.mac-codeblock pre {
    margin: 0;
    border-radius: 0;
    /* 用 !important 覆盖 github-markdown-css 的浅色 pre 背景（它在本文件之后加载） */
    background: rgba(17, 24, 39, 0.92) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    max-width: 100%;
    min-width: 0;
}

.mac-codeblock pre code {
    background: transparent;
}

/* 强制暗黑代码区（兼容 marked + highlight.js + line-numbers 输出结构） */
.mac-codeblock .hljs,
.mac-codeblock pre,
.mac-codeblock code,
.mac-codeblock table,
.mac-codeblock tbody,
.mac-codeblock tr,
.mac-codeblock td {
    background: rgba(17, 24, 39, 0.92) !important;
}

.mac-codeblock code,
.mac-codeblock .hljs,
.mac-codeblock .hljs-ln-code,
.mac-codeblock .hljs-ln-code * {
    color: rgba(243, 244, 246, 0.95) !important;
}

/* 行号区域也暗黑 */
.mac-codeblock .hljs-ln-numbers,
.mac-codeblock .hljs-ln-numbers * {
    background: rgba(17, 24, 39, 0.92) !important;
    color: rgba(148, 163, 184, 0.95) !important;
}

/* 去掉 line-numbers 表格可能带来的边框/间距 */
.mac-codeblock table.hljs-ln {
    width: max-content !important;
    min-width: 100% !important;
    border-collapse: collapse;
}

.mac-codeblock .hljs-ln td {
    border: none !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* 行号在暗色下更清晰 */
.mac-codeblock .hljs-ln-numbers {
    color: rgba(148, 163, 184, 0.9);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.mac-codeblock .hljs-ln-code {
    color: rgba(226, 232, 240, 0.95);
    white-space: pre;
}

/* 手机端代码块横向“进度条/滑条” */
.mac-codeblock-scrollbar {
    display: none;
    width: 100%;
    height: 26px;
    padding: 8px 12px 12px;
    margin: 0;
    background: rgba(17, 24, 39, 0.92);
    border: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    cursor: pointer;
    /* 给不支持自定义伪元素的浏览器一个兜底配色 */
    accent-color: rgba(99, 102, 241, 0.95);
    /* 进度百分比（由 JS 动态写入） */
    --p: 0%;
}

/* WebKit/Chromium/Edge */
.mac-codeblock-scrollbar::-webkit-slider-runnable-track {
    height: 6px;
    background: linear-gradient(
        90deg,
        rgba(99, 102, 241, 0.95) 0%,
        rgba(79, 70, 229, 0.95) var(--p),
        rgba(255, 255, 255, 0.10) var(--p),
        rgba(255, 255, 255, 0.10) 100%
    );
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.35);
}

.mac-codeblock-scrollbar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    /* 视觉上隐藏“球”，做成纯横杆进度条 */
    width: 0;
    height: 0;
    margin-top: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.mac-codeblock-scrollbar:active::-webkit-slider-thumb {
    transform: none;
}

/* Firefox */
.mac-codeblock-scrollbar::-moz-range-track {
    height: 6px;
    background: linear-gradient(
        90deg,
        rgba(99, 102, 241, 0.95) 0%,
        rgba(79, 70, 229, 0.95) var(--p),
        rgba(255, 255, 255, 0.10) var(--p),
        rgba(255, 255, 255, 0.10) 100%
    );
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.35);
}

.mac-codeblock-scrollbar::-moz-range-thumb {
    width: 0;
    height: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.mac-codeblock-scrollbar:disabled {
    opacity: 0.35;
    cursor: default;
}

@media (max-width: 1024px) {
    .mac-codeblock-scrollbar {
        display: block;
    }

    /* 防止整页横向滚动，确保只在代码块里横向拖动 */
    .mac-codeblock pre {
        max-width: 100%;
        touch-action: pan-x pan-y;
    }
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
    margin: 1.5rem 0 1rem;
    color: var(--text-color);
}

.article-body p {
    margin-bottom: 1rem;
    line-height: 1.8;
    word-wrap: break-word;
    white-space: pre-wrap; /* 保留换行和空格 */
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1rem 0;
}

.article-body code {
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.article-body pre {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

.article-body pre code {
    background: none;
    padding: 0;
}

.article-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-light);
    font-style: italic;
}

/* 文章导航 */
.article-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.nav-prev,
.nav-next {
    padding: 1rem;
    background: rgba(248, 249, 250, 0.7);
    border-radius: 4px;
    text-decoration: none;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}

.nav-prev:hover,
.nav-next:hover {
    background: var(--primary-color);
    color: var(--bg-color);
}

.nav-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.nav-prev:hover .nav-label,
.nav-next:hover .nav-label {
    color: var(--bg-color);
}

.nav-title {
    display: block;
    font-weight: 500;
    color: var(--text-color);
}

.nav-prev:hover .nav-title,
.nav-next:hover .nav-title {
    color: var(--bg-color);
}

/* 表单通用 */
.form-group {
    margin-bottom: 1rem;
}

.form-group textarea,
.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group textarea:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 评论功能已移除（UI/接口/脚本均已删除） */

/* 标题字体 */
h1, h2, h3, h4, h5, h6 {
    font-family: '甜甜圈海报字体', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 404页面 */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
}

.error-page h1 {
    font-size: 6rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-family: '甜甜圈海报字体', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.error-page p {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.btn-home {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: var(--bg-color);
    text-decoration: none;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-home:hover {
    background: var(--secondary-color);
}

/* 页脚 */
.footer {
    background: rgba(255, 255, 255, 0.7);
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid rgba(224, 224, 224, 0.5);
    backdrop-filter: blur(10px);
}

.footer-content {
    text-align: center;
    color: var(--text-light);
}

.footer-content p {
    margin: 0.5rem 0;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

/* 目录样式 */
.table-of-contents {
    max-height: 400px;
    overflow-y: auto;
}

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

.toc-item {
    margin-bottom: 0.5rem;
}

.toc-item a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    padding: 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.toc-item a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.toc-level-1 {
    font-weight: 500;
}

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

.toc-level-3 {
    padding-left: 2rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* 窄屏优先：避免某些移动端 WebView 按 980px 桌面宽度渲染导致右侧留白 */
@media (max-width: 1024px) {
    .blog-layout,
    .article-layout {
        grid-template-columns: 1fr;
    }

    /* 手机/窄屏不展示右侧栏（目录/推荐），避免占位造成“右侧空白” */
    .blog-sidebar,
    .article-sidebar {
        display: none;
    }

    /* 覆盖 github-markdown-css 的 980px 固定宽度（该库在 style.css 之后加载） */
    .markdown-body {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .blog-layout,
    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-nav {
        grid-template-columns: 1fr;
    }

    .nav {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .article-detail {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .article-detail .article-title {
        font-size: 1.5rem;
    }

    /* 处理 Markdown 在手机端的横向溢出（表格/长链接等） */
    .markdown-body {
        overflow-wrap: anywhere;
        word-break: break-word;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .markdown-body table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 代码块更“窄”更适配：减少内边距与字号，保持可横向滚动 */
    .markdown-body pre {
        padding: 10px !important;
        font-size: 13px;
        line-height: 1.6;
        border-radius: 8px;
        max-width: 100%;
        overflow-x: auto;
    }

    .markdown-body code {
        font-size: 13px;
    }

    /* 图片不溢出，并在手机端稍微缩小显示（居中） */
    .markdown-body img {
        max-width: 100% !important;
        height: auto !important;
        display: block;
        margin: 0.75rem auto;
    }

    /* 文章封面也避免过高 */
    .article-cover-image img {
        max-height: 45vh;
        object-fit: cover;
    }

    /* 防止极端情况下出现横向滚动条 */
    body {
        overflow-x: hidden;
    }

    .comment-children {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
    }
}
