/*
 * Dear Theme - Main Stylesheet
 * 极简 Typecho 主题样式文件
 * 
 * 文件结构：
 * 1. CSS 变量定义 2. 深色模式变量 3. 基础样式 4. 组件样式 5. 响应式设计
 * 性能优化：高效选择器、合并规则、模块化组织、深色模式适配
 */

/* CSS 变量定义 */
:root {
    --width: 660px;
    --font-yahei: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Helvetica, Arial, "PingFangSC-Regular", "Hiragino Sans GB", "Lantinghei SC", "Microsoft Yahei", "Source Han Sans CN", "WenQuanYi Micro Hei", SimSun, sans-serif;
    --font-fangsong: Baskerville, "Times New Roman", "Liberation Serif", STFangsong, FangSong, FangSong_GB2312, "CWTEX\-F", serif;
    --font-songti: Georgia, "Nimbus Roman No9 L", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif CN", STSong, "AR PL New Sung", "AR PL SungtiL GB", NSimSun, SimSun, "TW\-Sung", "WenQuanYi Bitmap Song", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", PMingLiU, MingLiU, serif;
    --font-scale: 1em;
    --background-color: #fff;
    --heading-color: #222;
    --text-color: #444;
    --link-color: #333;
    --visited-color: #666;
    --code-background-color: #f8f8f8;
    --code-color: #333;
    --blockquote-color: #222;
}

/* 深色模式变量 */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #111;
        --heading-color: #eee;
        --text-color: #ddd;
        --link-color: #ccc;
        --visited-color: #aaa;
        --code-background-color: #1a1a1a;
        --code-color: #e6e6e6;
        --blockquote-color: #ccc;
    }
}

/* 基础样式 */

body {
    font-family: var(--font-yahei); /* 可替换 --font-fangsong 或 --font-songti 字体 */
    font-size: var(--font-scale);
    margin: auto;
    padding: 20px;
    max-width: var(--width);
    text-align: left;
    background-color: var(--background-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.7;
    color: var(--text-color);
}

h1,h2,h3,h4,h5,h6,strong,b {
    color: var(--heading-color);
}
a {
    color: var(--link-color);
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

a:hover,nav .current {
    border-bottom: 1px solid var(--link-color);
}
nav a {
    margin-right: 8px;
}

button {
    margin: 0;
    cursor: pointer;
}
table {
    width: 100%;
}
hr {
    border: 0;
    border-top: 1px dashed;
}
img {
    max-width: 100%;
    height: auto;
}

code,pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    background-color: var(--code-background-color);
    color: var(--code-color);
    border: 1px solid var(--text-color);
    font-size: 0.9em;
}

code {
    padding: 0.2em 0.4em;
    font-weight: 400;
}

pre {
    padding: 1em;
    margin: 1.5em 0;
    overflow-x: auto;
    line-height: 1.4;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

pre::-webkit-scrollbar,#toc-nav::-webkit-scrollbar {
    height: 8px;
    width: 4px;
}

pre::-webkit-scrollbar-track,#toc-nav::-webkit-scrollbar-track {
    background: var(--background-color);
}

pre::-webkit-scrollbar-thumb,#toc-nav::-webkit-scrollbar-thumb {
    background: var(--text-color);
    opacity: 0.3;
}

pre::-webkit-scrollbar-thumb:hover,#toc-nav::-webkit-scrollbar-thumb:hover {
    opacity: 0.6;
}

blockquote {
    border-left: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 0 0 0 20px;
    font-style: italic;
    margin: 1.5em 0;
    opacity: 0.8;
}

table {
    border-collapse: collapse;
    margin: 1.5em 0;
}

th,td {
    border: 1px solid var(--text-color);
    padding: 0.5em;
    text-align: left;
}

th {
    background-color: var(--code-background-color);
    font-weight: bold;
}

header,footer {
    padding: 20px 0;
}
.title:hover {
    text-decoration: none;
}
.title h1,.title h2 {
    font-size: 1.5em;
}

ul.posts {
    list-style-type: none;
    padding: unset;
}
ul.posts li {
    display: flex;
}
ul.posts li span {
    flex: 0 0 110px;
}
ul.posts li a:visited {
    color: var(--visited-color);
}

/* 组件样式 */

/* 4.1 文章内容样式 */
.article-layout {
    position: relative;
}

#article-content img {
    display: block;
    margin: 1.5em auto;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    #article-content img {
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
        opacity: 0.95;
    }
}

/* 4.2 TOC 目录导航样式 */
#toc-sidebar {
    position: fixed;
    right: 20px;
    top: 100px;
    width: 200px;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#toc-sidebar.show {
    opacity: 1;
    visibility: visible;
}

#toc-container {
    padding: 1em 0.5em;
    background: transparent;
    font-size: 0.9em;
}

#toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid var(--text-color);
    opacity: 0.7;
}

#toc-header h4 {
    margin: 0;
    color: var(--heading-color);
    font-size: 0.9em;
    opacity: 0.8;
}

#toc-toggle {
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.75em;
    opacity: 0.6;
}

#toc-toggle:hover {
    opacity: 1;
    border-bottom: 1px solid var(--link-color);
}

#toc-nav {
    line-height: 1.6;
    max-height: 40vh;
    overflow-y: auto;
}

#toc-nav a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    padding: 0.25em 0 0.25em 0.5em;
    transition: all 0.2s ease;
    font-size: 0.9em;
    opacity: 0.7;
    border-left: 2px solid transparent;
}

#toc-nav a:hover,#toc-nav a.active {
    color: var(--link-color);
    opacity: 1;
    border-left-color: var(--link-color);
    font-weight: normal;
}

/* TOC 层级样式 */
#toc-nav .toc-h2 {
    padding-left: 0.5em;
}

#toc-nav .toc-h3 {
    padding-left: 1.2em;
    font-size: 0.85em;
}

#toc-nav .toc-h4 {
    padding-left: 1.8em;
    font-size: 0.8em;
    opacity: 0.6;
}

#toc-nav .toc-h5 {
    padding-left: 2.4em;
    font-size: 0.75em;
    opacity: 0.5;
}

#toc-nav .toc-h6 {
    padding-left: 3em;
    font-size: 0.7em;
    opacity: 0.4;
}


/* 4.3 图片懒加载样式 */
.lazy-load {
    opacity: 0;
    transition: all 0.4s ease;
    transform: translateY(20px);
    background-color: var(--bg-color-secondary);
    border-radius: 4px;
}

.lazy-load.loaded {
    opacity: 1;
    transform: translateY(0);
}

.lazy-load.loading {
    opacity: 0.7;
    transform: translateY(10px);
}

/* 关键图片样式 */
.critical-image {
    opacity: 1;
    transform: translateY(0);
    transition: none;
}

.critical-image.loaded {
    transition: opacity 0.2s ease;
}

/* 图片加载动画 */
@keyframes imageLoad {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.lazy-load.animate-in {
    animation: imageLoad 0.5s ease-out forwards;
}

/* 图片占位符样式 */
.lazy-load[src*="data:image/svg"] {
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    animation: placeholderShimmer 2s infinite linear;
}

@keyframes placeholderShimmer {
    0% {
        background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    }
    100% {
        background-position: 20px 20px, 20px 30px, 30px 10px, 10px 20px;
    }
}

/* 深色模式下的占位符 */
@media (prefers-color-scheme: dark) {
    .lazy-load[src*="data:image/svg"] {
        background: linear-gradient(45deg, #333 25%, transparent 25%), 
                    linear-gradient(-45deg, #333 25%, transparent 25%), 
                    linear-gradient(45deg, transparent 75%, #333 75%), 
                    linear-gradient(-45deg, transparent 75%, #333 75%);
        background-size: 20px 20px;
        background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    }
}

/* 图片加载错误状态 */
.lazy-load.load-error {
    opacity: 1;
    background-color: #f8f8f8;
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #999;
    font-size: 14px;
    position: relative;
}

.lazy-load.load-error::before {
    content: "图片加载失败";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 深色模式下的错误状态 */
@media (prefers-color-scheme: dark) {
    .lazy-load.load-error {
        background-color: #2a2a2a;
        border-color: #444;
        color: #666;
    }
}

/* 图片容器优化 */
.lazy-fancybox {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.lazy-fancybox:hover .lazy-load.loaded {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}



/* 图片点击提示样式 */
#article-content img[data-fancybox] {
    cursor: pointer;
    transition: all 0.3s ease;
}

#article-content img[data-fancybox]:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* 图片加载失败样式 */
#article-content img.load-error {
    background: var(--code-background-color);
    border: 2px dashed var(--text-color);
    opacity: 0.6;
    position: relative;
}

#article-content img.load-error::after {
    content: "图片加载失败";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-color);
    font-size: 14px;
    background: var(--background-color);
    padding: 4px 8px;
    border-radius: 4px;
}

/* 加载指示器 */
.lazy-load.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式图片优化 */
@media (max-width: 768px) {
    .lazy-load {
        transform: translateY(10px);
    }
    
    .lazy-load.loaded {
        transform: translateY(0);
    }
    
    .lazy-load.loading {
        transform: translateY(5px);
    }
}

/* 4.4 代码块复制功能样式 */
.code-block-wrapper {
    position: relative;
    margin: 1.5em 0;
}

.copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--code-background-color);
    color: var(--code-color);
    border: 1px solid var(--text-color);
    padding: 4px 8px;
    font-size: 0.75em;
    cursor: pointer;
    border-radius: 3px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.code-block-wrapper:hover .copy-button {
    opacity: 0.8;
}

.copy-button:hover {
    opacity: 1 !important;
    background: var(--background-color);
}

.copy-button.copied {
    color: var(--link-color);
    border-color: var(--link-color);
}

/* 4.5 搜索功能样式 */
.search-container {
    margin: 2em 0;
    padding: 1em 0;
    border: 1px dashed var(--text-color);
    border-left: none;
    border-right: none;
}

.search-wrapper {
    display: flex;
    gap: 0;
    max-width: 400px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 0.6em 0.8em;
    border: 1px solid var(--text-color);
    border-right: none;
    background: var(--background-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.95em;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--link-color);
}

.search-input::placeholder {
    color: var(--text-color);
    opacity: 0.6;
}

.search-button {
    padding: 0.6em 1.2em;
    border: 1px solid var(--text-color);
    background: var(--text-color);
    color: var(--background-color);
    font-family: inherit;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.search-button:hover {
    background: var(--background-color);
    color: var(--text-color);
}

.search-input:focus+.search-button {
    border-color: var(--link-color);
}

/* 4.6 标签云样式 */
.tag-cloud {
    margin: 2em 0 0 0;
    padding: 2em 0 0 0;
    border-top: 1px dashed var(--text-color);
}

.tag-cloud h3 {
    color: var(--heading-color);
    font-size: 1.1em;
    margin-bottom: 1em;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    line-height: 1.6;
}

.tag-item {
    display: inline-block;
    padding: 0.3em 0.6em;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tag-item:hover {
    background: var(--text-color);
    color: var(--background-color);
    border-bottom: 1px solid var(--text-color);
}

/* 4.7 返回顶部按钮样式 */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background-color: var(--background-color);
    border: 1px solid #e0e0e0;
    padding: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: none;
    /* 默认隐藏，通过 JavaScript 控制显示 */
    align-items: center;
    justify-content: center;
}

#back-to-top a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    display: block;
}

#back-to-top:hover {
    border-color: #ddd;
    background-color: var(--code-background-color);
}

/* 4.8 评论系统样式 */
#comments {
    margin: 2em 0 0 0;
    color: var(--text-color);
}

#comments h3 {
    color: var(--heading-color);
    font-size: 1.2em;
    margin-bottom: 1em;
}

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

.comment-list li {
    position: relative;
    margin-bottom: 0.8em;
    padding: 0 0 0.8em 0;
    border: none;
    border-bottom: 1px solid #eee;
}

.comment-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.comment-body {
    display: flex;
    align-items: flex-start;
    position: relative;
}

.comment-avatar {
    flex-shrink: 0;
    margin-right: 0.75em;
}
.comment-avatar img,.children .comment-avatar img,.children .children .comment-avatar img {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    display: block;
}

.contain-main {
    flex: 1;
    min-width: 0;
}
.comment-meta {
    margin: 0 0 0.5em 0;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.4em;
    margin: 0 0 0.2em 0;
}

.comment-author .author-name {
    font-weight: bold;
    color: var(--heading-color);
    font-size: 0.85em;
    text-decoration: none;
    margin: 0;
}

.comment-author .author-name:hover {
    text-decoration: underline;
}
.author-badge {
    display: inline-block;
    font-size: 0.7em;
    font-weight: 500;
    padding: 0.15em 0.5em;
    margin-left: 0.15em;
    border-radius: 10px;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
    vertical-align: middle;
    line-height: 1;
}

.comment-time {
    font-size: 0.75em;
    color: var(--text-color);
    opacity: 0.7;
    margin: 0;
    display: block;
}

.comment-content {
    line-height: 1.6;
    color: var(--text-color);
    margin-top: 0.3em;
    font-size: 1em;
}

.comment-reply a {
    background: #f0f0f0;
    color: var(--text-color);
    padding: 0.2em 0.5em;
    border-radius: 3px;
    font-size: 0.75em;
    text-decoration: none;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
    cursor: pointer;
    opacity: 0;
}

.comment-reply a:hover {
    background: var(--text-color);
    color: var(--background-color);
}

.comment-list li:hover .comment-reply a {
    opacity: 1;
}

.children {
    list-style: none;
    margin: 0.4em 0 0 0;
    padding: 0;
    border: none;
}


.children .children,.children .children .children {
    margin: 0.4em 0 0 0;
    border: none;
}

.respond {
    margin-bottom: 2em;
    padding: 1.5em;
    background: var(--background-color);
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.comment-list li .respond {
    margin: 1em 0 0 0;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    width: 100%;
    box-sizing: border-box;
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
}

.respond h3 {
    color: var(--heading-color);
    font-size: 1.1em;
    margin: 0;
    font-weight: 600;
}

.comment-form-row {
    display: flex;
    gap: 0.75em;
    margin-bottom: 0.75em;
}

.comment-form-field {
    flex: 1;
}

/* 表单输入框统一样式 */
.comment-form-field input,.comment-form-content textarea {
    width: 100%;
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.9em;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.comment-form-field input {
    padding: 0.75em 1em;
    border-radius: 20px;
}

.comment-form-content {
    margin-bottom: 0.75em;
}

.comment-form-content textarea {
    padding: 1em;
    border-radius: 12px;
    resize: vertical;
    min-height: 120px;
}

.comment-form-field input:focus,.comment-form-content textarea:focus {
    outline: none;
    border-color: #007bff;
    background: var(--background-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.comment-form-field input::placeholder,.comment-form-content textarea::placeholder {
    color: #999;
}

.comment-form-field input::placeholder {
    font-size: 0.85em;
}

.comment-form-content textarea::placeholder {
    line-height: 1.5;
}

.comment-form-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.respond button,.load-more-btn {
    padding: 0.75em 2em;
    border: 1px solid var(--text-color);
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 80px;
}

.respond button {
    background: var(--text-color);
    color: var(--background-color);
}

.load-more-btn {
    background: transparent;
    color: var(--text-color);
    min-width: 120px;
}

.respond button:hover,.load-more-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.respond button:hover {
    background: var(--background-color);
    color: var(--text-color);
}

.load-more-btn:hover {
    background: var(--text-color);
    color: var(--background-color);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cancel-comment-reply a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85em;
    padding: 0.4em 0.8em;
    background: transparent;
    border: 1px solid var(--text-color);
    border-radius: 15px;
    transition: all 0.2s ease;
    opacity: 0.7;
    display: none;
    margin: 0 0 1em 0;
}

.cancel-comment-reply a:hover {
    background: var(--text-color);
    color: var(--background-color);
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-navigator {
    text-align: center;
    margin: 1.5em 0;
    padding: 0.5em 0;
    border-top: 1px solid #eee;
}
.page-navigator a,.page-navigator span {
    display: inline-block;
    padding: 0.25em 0.5em;
    margin: 0 0.15em;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85em;
}
.page-navigator a:hover {
    text-decoration: underline;
}
.page-navigator .current {
    font-weight: bold;
}

.load-more-wrapper {
    margin: 1.5em 0;
    text-align: center;
}
.load-more-loading {
    font-size: 0.9em;
    color: var(--text-color);
    opacity: 0.7;
    display: none;
}

.comment-content .reply-mention {
    color: #666;
    font-size: 1em;
}
.comment-load-status {
    text-align: center;
    color: var(--text-color);
    opacity: 0.6;
    font-size: 0.9em;
}

/* 响应式设计 */

/* 5.1 深色模式适配 */
@media (prefers-color-scheme: dark) {
    #back-to-top {
        border-color: #404040;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    }
    #back-to-top:hover {
        border-color: #555;
    }
    .author-badge {
        background: #2a2a2a;
        color: #aaa;
        border-color: #404040;
    }
    .comment-list li .respond {
        background: #2a2a2a;
        border-color: #404040;
    }
}

@media (min-width: 1400px) {
    #toc-sidebar {
        right: 30px;
        width: 220px;
    }
    #toc-container {
        font-size: 0.95em;
    }
}

@media (max-width: 1200px) {
    #toc-sidebar {
        right: 15px;
        width: 180px;
    }
    #toc-container {
        font-size: 0.85em;
    }
}

@media (max-width: 1100px) {
    #toc-sidebar {
        display: none !important;
    }
}

@media (min-width: 769px) {
    #back-to-top {
        border-radius: 5px;
        width: auto;
        height: auto;
    }
    #back-to-top a {
        padding: 5px 10px;
    }
}

@media (max-width: 768px) {
    #back-to-top {
        border-radius: 50%;
        width: 40px;
        height: 40px;
        bottom: 10px;
        right: 10px;
    }
    #back-to-top a {
        font-size: 20px;
        padding: 0;
    }
}

@media (max-width: 600px) {
    pre {
        padding: 0.8em;
        font-size: 0.85em;
        margin: 1em 0;
    }
    code {
        font-size: 0.85em;
        padding: 0.15em 0.3em;
    }
    .copy-button {
        opacity: 0.6;
        font-size: 0.7em;
        padding: 3px 6px;
    }

    .search-wrapper {
        max-width: 100%;
        flex-direction: column;
        gap: 0.5em;
    }
    .search-input {
        border-right: 1px solid var(--text-color);
    }
    .search-button {
        align-self: center;
        min-width: 80px;
    }

    .tag-list {
        gap: 0.3em;
    }

    .tag-item {
        font-size: 0.85em;
        padding: 0.25em 0.5em;
    }

    .comment-list li {
        margin-bottom: 0.8em;
    }

    .comment-list img,.children .comment-avatar img,.children .children .comment-avatar img {
        width: 40px !important;
        height: 40px !important;
    }
    .comment-list img {
        margin-right: 0.6em;
    }

    .comment-list .comment-author cite {
        font-size: 0.9em;
    }
    .comment-list .comment-author time {
        font-size: 0.8em;
    }
    .comment-list .comment-content {
        font-size: 1em;
    }
    .comment-list .comment-reply a {
        padding: 0.25em 0.5em;
        font-size: 0.75em;
    }

    .children,.children .children,.comment-children,.comment-children .comment-children {
        margin: 0.4em 0 0 0;
        padding: 0;
    }

    .comment-children .comment-avatar img,.comment-children .comment-children .comment-avatar img {
        width: 32px !important;
        height: 32px !important;
    }

    .respond,.comment-list li .respond {
        padding: 1em;
    }

    .comment-list li .respond {
        margin: 0.8em 0 0 0;
        width: 100%;
    }

    .comment-form-row {
        flex-direction: column;
        gap: 0.5em;
    }

    .response-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5em;
    }

    #cancel-comment-reply-link {
        font-size: 0.8em;
        padding: 0.3em 0.6em;
    }

    .page-navigator {
        margin: 1.5em 0;
    }

    .page-navigator a,.page-navigator span {
        padding: 0.4em 0.6em;
        margin: 0 0.15em;
        font-size: 0.85em;
    }

    .load-more-btn {
        padding: 0.6em 1.5em;
        font-size: 0.85em;
        min-width: 100px;
    }
}

/* 友情链接页面样式 */

.link_tab_list {
    display: flex;
    margin-bottom: 20px;
}

.link_tab_list label {
    padding: 10px;
    cursor: pointer;
    margin-right: 10px;
    font-weight: bold;
    color: var(--text-color);
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.link_tab_list label:hover,.link_tab_list label.active {
    color: var(--heading-color);
    border-color: var(--heading-color);
}

.link_body {
    display: none;
}

.link_body.active {
    display: block;
}

.link_body_friend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.link_body_friend a {
    text-decoration: none;
    color: var(--heading-color);
    display: block;
    border: 1px solid var(--code-background-color);
    padding: 10px;
    border-radius: 0;
    width: calc(33.333% - 20px);
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.link_body_friend a:hover {
    border-color: var(--heading-color);
}

.link_body_list {
    display: flex;
    align-items: center;
}

.link_body_img img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.link_body_name {
    font-size: 16px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .link_body_friend a {
        width: calc(50% - 10px);
    }
}

@media (max-width: 480px) {
    .link_body_friend a {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .link_body_friend {
        gap: 10px;
    }
    
    .link_body_img img {
        width: 35px;
        height: 35px;
    }
    
    .link_body_name {
        font-size: 14px;
    }
}