/**
 * 文章增强模块样式
 */

/* 文章目录样式 - 中式风格 */
.post-toc {
    background-color: #fcf9e8;
    border: 1px solid #e8c59a;
    border-radius: 0;
    padding: 15px 18px;
    margin: 0 0 30px 30px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 320px;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
    float: right;
    position: relative;
    z-index: 5;
}

.post-toc:before {
    content: "※";
    position: absolute;
    left: 5px;
    top: 5px;
    color: #d1a975;
    font-size: 14px;
}

.post-toc:after {
    content: "※";
    position: absolute;
    right: 5px;
    bottom: 5px;
    color: #d1a975;
    font-size: 14px;
}

.post-toc-title {
    margin-top: 0!important;
    margin-bottom: 15px!important;
    font-size: 16px!important;
    font-weight: bold!important;
    color: #7c4a1c!important;
    display: flex!important;
    align-items: center!important;
    justify-content: space-between!important;
    padding-bottom: 8px!important;
    border-bottom: 1px solid #d1a975!important;
    text-align: center!important;
}

.post-toc-toggle {
    background: none;
    border: 1px solid #e8c59a;
    color: #7c4a1c;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 8px;
    transition: all 0.2s ease;
    font-family: "Kaiti", "STKaiti", "FangSong", serif;
}

.post-toc-toggle:hover {
    background-color: #f0e8d0;
    color: #7c4a1c;
}

.post-toc-content {
    margin: 0!important;
    padding-left: 15px;
    max-height: 450px;
    overflow-y: auto;
    font-family: "Kaiti", "STKaiti", "FangSong", serif;
}

.post-toc-content ul {
    padding-left: 18px;
    margin: 0!important;
}

.post-toc-content li {
    margin-bottom: 8px;
    position: relative;
}

.post-toc-content li::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 8px;
    width: 6px;
    height: 6px;
    background-color: #d1a975;
}

.post-toc-content a {
    color: #7c4a1c;
    text-decoration: none;
    transition: color 0.3s, padding-left 0.2s;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-toc-content a:hover {
    color: #a06c43;
    padding-left: 3px;
}

/* 清除浮动 - 添加在文章目录后 */
.post-toc-clear {
    clear: both;
    display: block;
}

/* 文章阅读时间样式 - 中式风格 */
.post-reading-time {
    color: #7c4a1c;
    font-size: 14px;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    background-color: #fcf9e8;
    padding: 8px 15px;
    border: 1px solid #e8c59a;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
    font-family: "Kaiti", "STKaiti", "FangSong", serif;
    position: relative;
}

.post-reading-time svg {
    margin-right: 8px;
    fill: #7c4a1c;
}

/* 适配移动设备 */
@media screen and (max-width: 768px) {
    .post-toc {
        float: none;
        margin: 0 0 30px 0;
        max-width: 100%;
    }
    
    .post-reading-time {
        display: flex;
        justify-content: center;
    }
}

/* 相关文章样式 - 中式风格 */
.related-posts {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e8c59a;
}

.related-posts-title {
    font-size: 20px!important;
    margin-bottom: 25px!important;
    font-weight: bold!important;
    color: #7c4a1c!important;
    position: relative!important;
    padding-left: 15px!important;
    font-family: "Kaiti", "STKaiti", "FangSong", serif!important;
}

.related-posts-title:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: #d1a975;
}

/* 基本列表样式 */
.related-posts-list {
    display: grid;
    gap: 25px;
}

/* 根据配置显示不同的列数 */
.related-posts-list[data-columns="1"] {
    grid-template-columns: 1fr;
}

.related-posts-list[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.related-posts-list[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.related-posts-list[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.related-post-item {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #fcf9e8;
    height: 100%;
    border: 1px solid #e8c59a;
    border-radius: 0;
}

.related-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
}

.related-post-image {
    position: relative;
    overflow: hidden;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 比例 */
}

.related-post-image a {
    display: block;
    height: 100%;
    width: 100%;
}

.related-post-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-post-item:hover .related-post-image img {
    transform: scale(1.08);
}

.related-post-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* 根据列数调整标题大小 */
.related-posts-list[data-columns="1"] .related-post-title {
    font-size: 20px;
}

.related-posts-list[data-columns="2"] .related-post-title {
    font-size: 18px;
}

.related-posts-list[data-columns="3"] .related-post-title {
    font-size: 17px;
}

.related-posts-list[data-columns="4"] .related-post-title {
    font-size: 16px;
}

.related-post-title {
    font-weight: bold;
    margin: 0 0 10px;
    line-height: 1.4;
    font-family: "Kaiti", "STKaiti", "FangSong", serif;
}

.related-post-title a {
    color: #7c4a1c!important;
    text-decoration: none!important;
    transition: color 0.2s!important;
}

.related-post-title a:hover {
    color: #a06c43;
}

.related-post-date {
    color: #777;
    font-size: 13px;
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    align-items: center;
    font-family: "Kaiti", "STKaiti", "FangSong", serif;
}

.related-post-date:before {
    font-family: dashicons;
    margin-right: 5px;
    font-size: 16px;
    opacity: 0.7;
}

/* 无缩略图时的样式调整 */
.related-post-item.no-thumbnail .related-post-content {
    padding-top: 20px;
}

.related-post-item.no-thumbnail {
    background-color: #fcf9e8;
}

/* 文章版权信息样式 */
.post-copyright {
    background-color: #fcf9e8;
    border: 1px solid #e8c59a;
    padding: 15px 20px;
    margin: 30px 0;
    font-size: 14px;
    line-height: 1.8;
    position: relative;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.post-copyright p {
    margin: 5px 0;
    color: #333;
    font-family: "Kaiti", "STKaiti", "FangSong", serif;
    text-indent: 2em;
}

.post-copyright:before {
    content: "※";
    position: absolute;
    left: 5px;
    top: 5px;
    color: #d1a975;
    font-size: 14px;
}

.post-copyright:after {
    content: "※";
    position: absolute;
    right: 5px;
    bottom: 5px;
    color: #d1a975;
    font-size: 14px;
}

@media (max-width: 768px) {
    .post-copyright {
        padding: 12px 15px;
        font-size: 13px;
    }
}

/* 代码块高亮样式 */
.post-enhancement pre {
    background-color: #f5f5f5;
    border-radius: 5px;
    padding: 15px;
    overflow-x: auto;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
}

.post-code-copy-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.post-code-copy-btn:hover {
    background-color: #fff;
}

/* 文章分享按钮样式 - 中式风格 */
.post-share {
    display: flex;
    margin: 30px 0;
    gap: 12px;
    justify-content: center;
}

.post-share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0;
    color: #fff;
    transition: all 0.3s;
    text-decoration: none;
    overflow: hidden;
    background-color: #fcf9e8;
    border: 1px solid #e8c59a;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.post-share-button:hover {
    transform: translateY(-3px);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
}

/* 分享图标样式 */
.share-icon {
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #7c4a1c;
    font-family: "Kaiti", "STKaiti", "FangSong", serif;
}

.post-share-weibo, .post-share-wechat, .post-share-qq, .post-share-qzone, .post-share-douban {
    background-color: #fcf9e8;
}

/* 响应式设计 */
@media screen and (max-width: 992px) {
    /* 中等屏幕上，4列变为3列 */
    .related-posts-list[data-columns="4"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 768px) {
    /* 平板屏幕上，调整为2列 */
    .related-posts-list[data-columns="3"],
    .related-posts-list[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .related-posts-list {
        gap: 15px;
    }
    
    .post-share {
        justify-content: center;
    }
    
    /* 调整移动设备上的内边距 */
    .related-post-content {
        padding: 12px;
    }
}

@media screen and (max-width: 480px) {
    /* 手机屏幕上，所有都变为单列 */
    .related-posts-list[data-columns="2"],
    .related-posts-list[data-columns="3"],
    .related-posts-list[data-columns="4"] {
        grid-template-columns: 1fr;
    }
    
    .quick-comment-like {
        width: 50px;
        height: 50px;
    }
    
    .quick-comment-like .dashicons {
        font-size: 22px;
        width: 22px;
        height: 22px;
    }
    
    .quick-comment-tip {
        font-size: 12px;
    }
}

/* 相关文章样式 - 不同列数的调整 */
/* 1列布局 - 更大更宽松的样式 */
.related-posts-list[data-columns="1"] .related-post-item {
    max-width: 800px;
    margin: 0 auto;
}

.related-posts-list[data-columns="1"] .related-post-image {
    padding-bottom: 40%; /* 扁平一些的宽高比 */
}

.related-posts-list[data-columns="1"] .related-post-content {
    padding: 24px;
}

/* 2列布局 */
.related-posts-list[data-columns="2"] .related-post-content {
    padding: 20px;
}

/* 4列布局 - 更紧凑的样式 */
.related-posts-list[data-columns="4"] .related-post-content {
    padding: 12px;
}

/* 调整不同列数时无缩略图的内边距 */
.related-posts-list[data-columns="1"] .related-post-item.no-thumbnail .related-post-content {
    padding-top: 30px;
    padding-bottom: 30px;
}

.related-posts-list[data-columns="4"] .related-post-item.no-thumbnail .related-post-content {
    padding-top: 16px;
}

/* 点赞图标样式 - 中式风格 */
.quick-comment-like-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.quick-comment-like {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background-color: #fcf9e8;
    border: 1px solid #e8c59a;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
}

.quick-comment-like .dashicons {
    font-size: 30px;
    width: 30px;
    height: 30px;
    color: #7c4a1c;
    transition: all 0.3s ease;
}

.quick-comment-like:hover {
    transform: scale(1.05);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
}

.quick-comment-like:hover .dashicons {
    color: #a06c43;
}

.quick-comment-like.ready-to-comment {
    border-color: #d1a975;
    box-shadow: 2px 2px 0 rgba(209, 169, 117, 0.3);
}

.quick-comment-like.ready-to-comment .dashicons {
    color: #a06c43;
}

.quick-comment-tip {
    font-size: 14px;
    color: #7c4a1c;
    margin-top: 5px;
    font-style: normal;
    font-family: "Kaiti", "STKaiti", "FangSong", serif;
}

/* QQ输入框容器 */
.qq-input-container {
    display: flex;
    align-items: center;
    margin: 0 auto 15px;
    padding: 5px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fff;
    max-width: 250px;
    position: relative;
}

.qq-number-input {
    flex: 1;
    border: none;
    outline: none;
    height: 30px;
    padding: 0 5px;
    font-size: 13px;
    background: transparent;
}

.qq-number-input:focus {
    background-color: #f8f8f8;
}

.qq-info-preview {
    display: flex;
    align-items: center;
    max-width: 120px;
    overflow: hidden;
}

.qq-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 6px;
    background-color: #eaeaea;
    flex-shrink: 0;
}

.qq-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qq-nickname {
    font-size: 12px;
    color: #333;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qq-loading .qq-avatar:before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    margin: 6px;
    border: 2px solid #4e73df;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

/* 快速评论状态样式 */
.quick-comment-status {
    margin: 10px auto 0;
    padding: 10px 15px;
    border-radius: 0;
    font-size: 14px;
    display: none;
    text-align: center;
    max-width: 300px;
    font-family: "Kaiti", "STKaiti", "FangSong", serif;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.quick-comment-status:not(:empty) {
    display: block;
}

.quick-comment-loading {
    background-color: #f5f7fa;
    border-left: 3px solid #5d76a8;
    color: #5d76a8;
}

.quick-comment-loading:before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border: 2px solid #5d76a8;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
    vertical-align: middle;
}

.quick-comment-success {
    background-color: #f0f7e6;
    border-left: 3px solid #7a9e53;
    color: #5c7e3e;
}

.quick-comment-error {
    background-color: #fcf0f0;
    border-left: 3px solid #c45a5a;
    color: #a94442;
}

@keyframes spinner {
    to {transform: rotate(360deg);}
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .quick-comment-like {
        width: 60px;
        height: 60px;
    }
    
    .quick-comment-like .dashicons {
        font-size: 26px;
        width: 26px;
        height: 26px;
    }
    
    .quick-comment-tip {
        font-size: 13px;
    }
}

/* 文章摘要 */
.post-summary {
    margin-bottom: 24px;
    padding: 15px 20px;
    background-color: #fcf9e8;
    border: 1px solid #e8c59a;
    position: relative;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.post-summary-title {
    margin: 0 0 10px 0!important;
    font-size: 16px!important;
    font-weight: bold!important;
    color: #7c4a1c!important;
    text-align: center!important;
    position: relative!important;
    padding-bottom: 8px!important;
}

.post-summary-title:after {
    content: "";
    display: block;
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 30%;
    height: 1px;
    background-color: #d1a975;
    transform: translateX(-50%);
}

.post-summary-content {
    color: #333;
    line-height: 1.8;
    font-size: 14px;
    text-indent: 2em;
    margin: 0;
    font-family: "Kaiti", "STKaiti", "FangSong", serif;
}

.post-summary:before {
    content: "※";
    position: absolute;
    left: 5px;
    top: 5px;
    color: #d1a975;
    font-size: 14px;
}

.post-summary:after {
    content: "※";
    position: absolute;
    right: 5px;
    bottom: 5px;
    color: #d1a975;
    font-size: 14px;
}

@media (max-width: 768px) {
    .post-summary {
        padding: 12px 15px;
    }
    
    .post-summary-title {
        font-size: 15px;
    }
    
    .post-summary-content {
        font-size: 13px;
        line-height: 1.7;
    }
} 